zhaoke 2 rokov pred
rodič
commit
62fd44710a

+ 13 - 10
src/components/Table/index.vue

@@ -59,8 +59,11 @@
               <el-row :gutter="20">
                 <el-col v-for="(item, index) in tableColsCopy" :key="index" :span="rows">
                   <el-form-item :label="item.columnLabel">
-                    <template v-if="item.listqueryTemplateID || item.listqueryTemplateID == 0">
-                      <el-select size="small" clearable style="width:100%" v-model="tableForm[item.columnName]" placeholder="请选择">
+                    <template v-if="
+                        item.listqueryTemplateID ||
+                        item.listqueryTemplateID == 0
+                      ">
+                      <el-select size="small" clearable style="width: 100%" v-model="tableForm[item.columnName]" placeholder="请选择">
                         <el-option v-for="item in tableOptions[item.columnName]" :key="item.v" :label="item.k" :value="item.v">
                         </el-option>
                       </el-select>
@@ -300,9 +303,9 @@ export default {
         dataContent: [],
       });
       if (code == 0) {
-        return returnData.listValues
+        return returnData.listValues;
       } else {
-        return []
+        return [];
       }
     },
     //重组table-显示名称
@@ -367,10 +370,10 @@ export default {
       const { columns, data } = param;
       const sums = [];
       columns.forEach((column, index) => {
-        this.tableColsCopy.forEach(p => {
+        this.tableColsCopy.forEach((p) => {
           if (column.property == p.columnName && p.needCount) {
-            const values = data.map(item => Number(item[column.property]));
-            if (!values.every(value => isNaN(value))) {
+            const values = data.map((item) => Number(item[column.property]));
+            if (!values.every((value) => isNaN(value))) {
               sums[index] = values.reduce((prev, curr) => {
                 const value = Number(curr);
                 if (!isNaN(value)) {
@@ -379,10 +382,10 @@ export default {
                   return prev;
                 }
               }, 0);
-              sums[index] += '';
+              sums[index] += "";
             }
           }
-        })
+        });
       });
       return sums;
     },
@@ -400,7 +403,7 @@ export default {
       this.tableType = "add";
       this.tableTitle = "新增";
       this.tableForm = {};
-      console.log(this.tableOptions)
+      console.log(this.tableOptions);
     },
     //表格-编辑
     handleEdit (row) {

+ 9 - 0
src/layout/components/ToolBar/index.vue

@@ -45,10 +45,12 @@ export default {
   created() {
     const path = this.$route.path;
     const pathArr = path.split("/");
+    // console.log(path);
     if (pathArr.length > 2) {
       //子路由
       const name = pathArr[pathArr.length - 2];
       const childName = pathArr[pathArr.length - 1];
+      path;
       this.getRoutes(name, childName);
     } else {
       //一级路由
@@ -79,6 +81,13 @@ export default {
       } else {
         this.dataArr = arrs;
       }
+      if (this.dialog == false) {
+        this.dataArr.forEach((res, index) => {
+          if (res.path == this.$route.path) {
+            this.$store.dispatch("app/toggleDialog", index);
+          }
+        });
+      }
     },
   },
 };