Эх сурвалжийг харах

Merge remote-tracking branch 'origin/master'

韩帛霖 1 жил өмнө
parent
commit
a1c72252f8

+ 3 - 3
zkqy-ui/src/utils/request.js

@@ -95,9 +95,9 @@ service.interceptors.response.use(res => {
     return Promise.reject('无效的会话,或者会话已过期,请重新登录。')
   } else if (code === 500) {
     console.log(msg);
-    // Message({ message: msg, type: 'error' })
-    // return Promise.reject(new Error(msg))
-    return Promise.resolve()
+    Message({ message: msg, type: 'error' })
+    return Promise.reject(new Error(msg))
+    // return Promise.resolve()
   } else if (code === 601) {
     Message({ message: msg, type: 'warning' })
     return Promise.reject('error')

+ 4 - 2
zkqy-ui/src/views/login.vue

@@ -171,8 +171,10 @@ export default {
     return {
       codeUrl: "",
       loginForm: {
-        username: "admin",
-        password: "admin123",
+        username: "",
+        password: "",
+        // username: "admin",
+        // password: "admin123",
         rememberMe: false,
         code: "",
         uuid: "",

+ 134 - 85
zkqy-ui/src/views/relateTable/index.vue

@@ -276,7 +276,9 @@
                 :label="item.tableComment"
                 :value="item.tableName"
               >
-                <span style="float: left">{{ item.tableComment }}</span>
+                <span class="discribe" style="float: left">{{
+                  item.tableComment
+                }}</span>
                 <span style="float: right; color: #8492a6; font-size: 13px">{{
                   item.tableName
                 }}</span>
@@ -784,6 +786,7 @@ export default {
     },
     isSearchBtn() {
       if (this.relyOption == 0) {
+        //自定义依赖值
         this.conditionDefault[this.isSearchIndex] =
           this.conditionDefaultValueMap;
       } else {
@@ -798,7 +801,7 @@ export default {
           "." +
           this.conditionDefaultValueMap;
       }
-
+      console.log(this.conditionDefault);
       this.isSearchDialog = false;
       this.conditionDefaultValueMap = "";
       this.relyFileds.tableName = "";
@@ -1056,89 +1059,118 @@ export default {
           }
           let echoData = {};
           // 判断修改还是新增
+
+          echoData = {
+            tableName: this.tableItemForm.tableName,
+            tableFieldData: this.tableFieldList,
+          };
+          console.log(echoData);
+          let tableKey = uuidv4();
+          let sqlKey = uuidv4();
+
+          this.relyFileds.tableFieldList = this.tableFieldList;
+          this.relyFileds.tableName = this.tableItemForm.tableName;
+          this.tableItemForm.rowId = Date.now();
+          let newTableData = {
+            //收集到的表格编辑结果
+            dtName: this.tableItemForm.title,
+            dtTableName: this.tableItemForm.tableName,
+            rowId: this.tableItemForm.rowId,
+            selectFields: this.tableItemForm.selectFields,
+            orderByColumn: this.tableItemForm.orderByColumn,
+            timeFormate: this.tableItemForm.timeFormate,
+            primaryKey: this.tableItemForm.selectFields,
+            tId: this.tId,
+            tableKey: tableKey,
+            sortOrder: this.tableItemForm.isAsc,
+            sqlKey: sqlKey,
+            dtColumnName: columns,
+            // timeFormat: "yyyy-MM-dd",
+            searchFieldList: searchFieldList,
+            conditionDefaultValueMap: this.conditionDefault,
+            tableSql: this.getSQLStr(),
+            tableExportField: "",
+            echoData: JSON.stringify(echoData),
+          };
           if (this.relateTitle) {
-            echoData = {
-              tableName: this.tableItemForm.tableName,
-              tableFieldData: this.tableFieldList,
-            };
-            console.log(echoData);
-            let tableKey = uuidv4();
-            let sqlKey = uuidv4();
+            this.tableDataList.push(newTableData);
+          } else {
+            this.$set(this.tableDataList, this.editIndex, newTableData);
+          }
 
-            this.relyFileds.tableFieldList = this.tableFieldList;
-            this.relyFileds.tableName = this.tableItemForm.tableName;
-            this.tableItemForm.rowId = Date.now();
+          // 选择依赖字段
+          this.groupList.push({
+            tableFieldList: this.tableFieldList,
+            tableItemForm: this.tableItemForm,
+            conditionDefaultValueMap: this.conditionDefaultValueMap,
+          });
 
-            this.tableDataList.push({
-              dtName: this.tableItemForm.title,
-              dtTableName: this.tableItemForm.tableName,
-              rowId: this.tableItemForm.rowId,
-              selectFields: this.tableItemForm.selectFields,
-              orderByColumn: this.tableItemForm.orderByColumn,
-              timeFormate: this.tableItemForm.timeFormate,
-              primaryKey: this.tableItemForm.selectFields,
+          if (this.groupTitle) {
+            this.addDragData.push({
               rowId: this.tableItemForm.rowId,
               tId: this.tId,
+              dtName: this.tableItemForm.title,
               tableKey: tableKey,
+              dtTableName: this.tableItemForm.tableName,
+              primaryKey: this.tableItemForm.selectFields,
+              orderByColumn: this.tableItemForm.orderByColumn,
               sortOrder: this.tableItemForm.isAsc,
               sqlKey: sqlKey,
               dtColumnName: columns,
-              timeFormat: "yyyy-MM-dd",
+              timeFormate: this.tableItemForm.timeFormate,
               searchFieldList: searchFieldList,
               conditionDefaultValueMap: this.conditionDefault,
               tableSql: this.getSQLStr(),
               tableExportField: "",
               echoData: JSON.stringify(echoData),
             });
+          }
 
-            // 选择依赖字段
-            this.groupList.push({
-              tableFieldList: this.tableFieldList,
-              tableItemForm: this.tableItemForm,
-              conditionDefaultValueMap: this.conditionDefaultValueMap,
-            });
+          // echoData = {
+          //   tableName: this.tableItemForm.tableName,
+          //   tableFieldData: this.tableFieldList,
+          // };
+          // console.log("123456", echoData);
+          // this.tableDataList.forEach((item, index) => {
+          //   console.log(item, this.tableItemForm);
+          //   if (item.tId == this.tableItemForm.tId) {
+          //     item.conditionDefaultValueMap = this.conditionDefault;
+          //     console.log(this.conditionDefault);
+          //     item.echoData = JSON.stringify(echoData);
+          //     item.sortOrder = this.tableItemForm.isAsc;
+          //     item.orderByColumn = this.tableItemForm.orderByColumn;
+          //     item.primaryKey = this.tableItemForm.selectFields;
+          //     item.dtTableName = this.tableItemForm.tableName;
+          //     item.dtName = this.tableItemForm.title;
+          //     item.dtColumnName = JSON.stringify(columns);
+          //     item.searchFieldList = searchFieldList;
+          //   }
+          // });
+          // console.log("保存表格信息", this.tableDataList, this.editIndex);
+          // this.tableDataList[this.editIndex] = {
+          //   iconditionDefaultValueMap: this.conditionDefault,
+          //   echoData: JSON.stringify(echoData),
+          //   sortOrder: this.tableItemForm.isAsc,
+          //   orderByColumn: this.tableItemForm.orderByColumn,
+          //   primaryKey: this.tableItemForm.selectFields,
+          //   dtTableName: this.tableItemForm.tableName,
+          //   dtName: this.tableItemForm.title,
+          //   dtColumnName: JSON.stringify(columns),
+          //   searchFieldList: searchFieldList,
+          // };
 
-            if (this.groupTitle) {
-              this.addDragData.push({
-                rowId: this.tableItemForm.rowId,
-                tId: this.tId,
-                dtName: this.tableItemForm.title,
-                tableKey: tableKey,
-                dtTableName: this.tableItemForm.tableName,
-                primaryKey: this.tableItemForm.selectFields,
-                orderByColumn: this.tableItemForm.orderByColumn,
-                sortOrder: this.tableItemForm.isAsc,
-                sqlKey: sqlKey,
-                dtColumnName: columns,
-                timeFormat: "yyyy-MM-dd",
-                searchFieldList: searchFieldList,
-                conditionDefaultValueMap: this.conditionDefault,
-                tableSql: this.getSQLStr(),
-                tableExportField: "",
-                echoData: JSON.stringify(echoData),
-              });
-            }
-          } else {
-            echoData = {
-              tableName: this.tableItemForm.tableName,
-              tableFieldData: this.tableFieldList,
-            };
-            console.log("123456", echoData);
-            this.tableDataList.forEach((item, index) => {
-              if (item.tId == this.tableItemForm.tId) {
-                item.conditionDefaultValueMap = this.conditionDefault;
-                console.log(this.conditionDefault);
-                item.echoData = JSON.stringify(echoData);
-                item.sortOrder = this.tableItemForm.isAsc;
-                item.orderByColumn = this.tableItemForm.orderByColumn;
-                item.primaryKey = this.tableItemForm.selectFields;
-                item.dtTableName = this.tableItemForm.tableName;
-                item.dtName = this.tableItemForm.title;
-                item.dtColumnName = JSON.stringify(columns);
-                item.searchFieldList = searchFieldList;
-              }
-            });
-          }
+          // this.$set(this.tableDataList, this.editIndex, {
+          //   iconditionDefaultValueMap: this.conditionDefault,
+          //   echoData: JSON.stringify(echoData),
+          //   sortOrder: this.tableItemForm.isAsc,
+          //   orderByColumn: this.tableItemForm.orderByColumn,
+          //   primaryKey: this.tableItemForm.selectFields,
+          //   dtTableName: this.tableItemForm.tableName,
+          //   dtName: this.tableItemForm.title,
+          //   dtColumnName: JSON.stringify(columns),
+          //   searchFieldList: searchFieldList,
+          //   timeFormate: this.tableItemForm.timeFormate,
+          // });
           this.isShowForm = false;
           echoData = {};
           this.tableItemForm = {};
@@ -1179,19 +1211,24 @@ export default {
         this.tableFieldList = echoData.tableFieldData;
         this.tableItemForm.tId = row.tId;
         this.tableItemForm.rowId = row.tableKey;
-        this.tableItemForm.isAsc = false;
+        console.log(typeof row.sortOrder);
+        this.$set(this.tableItemForm, "isAsc", row.sortOrder);
+        // this.tableItemForm.isAsc = row.sortOrder;
         this.tableItemForm.orderByColumn = row.orderByColumn;
         this.tableItemForm.title = row.dtName;
         this.tableItemForm.tableName = row.dtTableName;
         this.tableItemForm.selectFields = row.primaryKey;
-        this.tableItemForm.timeFormate = row.timeFormat;
+        this.tableItemForm.timeFormate = row.timeFormate;
       } else {
-        (this.tableItemForm.rowId = row.rowId),
-          (this.tableItemForm.title = row.dtName);
+        this.tableItemForm.rowId = row.rowId; //未知字段
+        this.tableItemForm.title = row.dtName;
         this.tableItemForm.selectFields = row.selectFields;
         this.tableItemForm.tableName = row.dtTableName;
         this.tableItemForm.orderByColumn = row.orderByColumn;
-        this.tableItemForm.timeFormate = row.timeFormat;
+        this.tableItemForm.timeFormate = row.timeFormate;
+        // this.tableItemForm.isAsc = row.sortOrder;
+        this.$set(this.tableItemForm, "isAsc", row.sortOrder);
+        this.tableItemForm.selectFields = row.primaryKey;
 
         this.getList();
         this.groupList.forEach((item) => {
@@ -1347,7 +1384,8 @@ export default {
               };
               console.log(this.addDragData);
               // return;
-              this.addDragData.forEach((item, index) => {
+              // this.addDragData.forEach((item, index) => {
+              this.tableDataList.forEach((item, index) => {
                 item.menuId = result.data;
                 // item.sqlKey = tableKeyObj.tableKey
                 let echo = JSON.parse(item.echoData);
@@ -1364,7 +1402,8 @@ export default {
               data.groupName = this.groupForm.groupName;
               data.groupDescription = this.groupForm.groupDescription;
               data.groupTableInfo = JSON.stringify(data.groupTableInfo);
-              data.dragTables = this.addDragData;
+              // data.dragTables = this.addDragData;
+              data.dragTables = this.tableDataList;
 
               // 添加表格组
               let res = await addGroup(data);
@@ -1389,7 +1428,8 @@ export default {
               dragTables: [],
               id: this.groupId,
             };
-            this.addDragData.forEach((item, index) => {
+            // this.addDragData.forEach((item, index) => {
+            this.tableDataList.forEach((item, index) => {
               // item.sqlKey = tableKeyObj.tableKey
               let echo = JSON.parse(item.echoData);
               // echo.formData = this.groupForm
@@ -1405,7 +1445,8 @@ export default {
             data.groupName = this.groupForm.groupName;
             data.groupDescription = this.groupForm.groupDescription;
             data.groupTableInfo = JSON.stringify(data.groupTableInfo);
-            data.dragTables = this.addDragData;
+            // data.dragTables = this.addDragData;
+            data.dragTables = this.tableDataList;
             console.log(data);
             let res = await updataGroup(data);
 
@@ -1626,15 +1667,16 @@ export default {
       }
       if (!this.groupTitle) {
         // console.log(this.tableDataList[this.tableDataList.length-1].dtTableName)
-
+        console.log(this.relyFileds, this.groupTitle);
         this.relyFileds.tableName =
-          this.tableDataList[this.tableDataList.length - 1].dtTableName;
-
-        let echoData = JSON.parse(
-          this.tableDataList[this.tableDataList.length - 1].echoData
-        );
-
-        this.relyFileds.tableFieldList = echoData.tableFieldData;
+          this.tableDataList[this.tableDataList.length - 1]?.dtTableName;
+        if (this.tableDataList[this.tableDataList.length - 1]?.echoData) {
+          //是否有需要回显的数据
+          let echoData = JSON.parse(
+            this.tableDataList[this.tableDataList.length - 1]?.echoData
+          );
+          this.relyFileds.tableFieldList = echoData.tableFieldData;
+        }
       }
       this.getAllTable();
       // 注意校验最后一条数据是否合法
@@ -1661,6 +1703,13 @@ export default {
 };
 </script>
 <style scoped lang="scss">
+.discribe {
+  display: block;
+  max-width: 200px;
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
+}
 ::v-deep .el-dialog:not(.is-fullscreen) {
   width: 900px !important;
 }

+ 5 - 6
zkqy-ui/src/views/system/engineeringManage/index.vue

@@ -112,13 +112,11 @@
       <!-- <el-table-column label="工程key" align="center" prop="engineeringKey" /> -->
       <el-table-column label="工程名称" align="center" prop="engineeringName" />
       <!-- <el-table-column label="下载次数" align="center" prop="downloadNumber" /> -->
-      <el-table-column
-        label="下载时间"
-        align="center"
-        prop="downloadTime"
-      >
+      <el-table-column label="下载时间" align="center" prop="downloadTime">
         <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.downloadTime, "{y}-{m}-{d} {h}:{i}:{s}") }}</span>
+          <span>{{
+            parseTime(scope.row.downloadTime, "{y}-{m}-{d} {h}:{i}:{s}")
+          }}</span>
         </template>
       </el-table-column>
       <!-- <el-table-column label="更新时间" align="center" prop="updateTime" /> -->
@@ -310,6 +308,7 @@ export default {
             navigator.msSaveBlob(blob, fileName);
             this.loading = false;
           }
+          this.getList();
         }
       });
     },