Ver código fonte

清表列表代码出错重新合并提交

admin 3 anos atrás
pai
commit
de146bf8c9
1 arquivos alterados com 36 adições e 16 exclusões
  1. 36 16
      src/views/exctab/excelmodel/excelmodel.vue

+ 36 - 16
src/views/exctab/excelmodel/excelmodel.vue

@@ -8,6 +8,7 @@
             <basic-container>
               <!-- 树结构 -->
               <avue-tree
+                :permission="getPermission"
                 :loading="loading"
                 :option="option"
                 :data="data"
@@ -19,6 +20,25 @@
                 >
                   <div>
                     <span> {{ data.name }} </span>
+                    <!-- <span> {{ node}} </span> -->
+                    <!-- 添加 -->
+                    <i
+                      class="el-icon-circle-plus-outline marleft10"
+                      @click.stop="addExcel(data)"
+                      v-if="data.fileType!=3"
+                    ></i>
+                    <!-- 编辑 -->
+                    <i
+                      class="el-icon-edit marleft10"
+                      @click.stop="editExcel(data)"
+                      v-if="data.fileType!=3"
+                    ></i>
+                    <!-- 删除 -->
+                    <i
+                      class="el-icon-delete marleft10"
+                      @click.stop="deleteExcelM(data)"
+                      v-if="!data.hasChildren&&data.fileType!=1"
+                    ></i>
                   </div>
                 </span>
               </avue-tree>
@@ -111,7 +131,7 @@
 
     <!-- 弹出框 -->
     <el-dialog
-      :title="!excelForm.id?'添加':'编辑'"
+      title="新增编辑"
       class="dialogModel"
       :visible.sync="dialogTap"
       width="800px"
@@ -179,6 +199,7 @@
             </div>
             <div class="leftscroll">
               <avue-tree
+                :permission="getPermission"
                 :loading="loading"
                 :option="option2"
                 :data="wbsdata"
@@ -217,7 +238,7 @@
                   <td style="width:50%;">{{val.tableName}}</td>
                   <td style="text-align: center;height:30px;">
                     <el-button
-                      v-if="val.isLinkTable!==2"
+                      v-if="val.isLinkTable==1"
                       type="info"
                       size="small"
                       @click="relation(index)"
@@ -303,7 +324,7 @@ export default {
             const { data: res } = await wbstree({ parentId: node.data.id, wbsId: this.excelForm.wbsId, wbsType: this.excelForm.wbsType })
             console.log(res);
             if (res.code === 200) {
-              if (res.msg != '未查询到信息') {
+              if (Array.isArray(res.data)) {
                 res.data.forEach((val) => {
                   if (!val.hasChildren) {
                     val.leaf = true
@@ -392,27 +413,26 @@ export default {
       const { data: res } = await wbstree({ parentId: 0, wbsId: this.excelForm.wbsId, wbsType: this.excelForm.wbsType })
       console.log(res);
       if (res.code === 200) {
-        if (res.msg != "未查询到信息") {
-          res.data.forEach((val) => {
-            if (!val.hasChildren) {
-              val.leaf = true
-            }
-          })
-          this.wbsdata = res.data
-        }
+        res.data.forEach((val) => {
+          if (!val.hasChildren) {
+            val.leaf = true
+          }
+        })
+        this.wbsdata = res.data
       }
     },
     async selectByNodeTable (id, wbsType) {//wbs树获取表
       const { data: res } = await selectByNodeTable({ id, wbsType })
       console.log(res);
       if (res.code === 200) {
-        if (res.msg == "未查询到信息") {
-          this.tableData = []
-        } else {
+        console.log(Array.isArray(res.data));
+        if (Array.isArray(res.data)) {
           this.tableData = res.data
           this.tableData.forEach(val => {
             val.changeTable = val.isLinkTable
           })
+        } else {
+          this.tableData = []
         }
       }
     },
@@ -637,9 +657,9 @@ export default {
         if (valid) {
           let linkDataInfo = []
           if (this.tableList.length > 0) {
-            this.tableList.forEach(val => {
+            this.tableList.forEach((val, index) => {
               let linkIds = ''
-              val.arrs.forEach(da => {
+              val.arrs.forEach((da, key) => {
                 if (da.isLinkTable != da.changeTable) {
                   linkIds = `${linkIds}${linkIds != '' ? ',' : ''}${da.id}`
                 }