Sfoglia il codice sorgente

fix(规则管理): 修复表格刷新时未应用树节点筛选条件的问题

liujt 6 mesi fa
parent
commit
5fff9d967f
1 ha cambiato i file con 30 aggiunte e 3 eliminazioni
  1. 30 3
      src/views/rulesManagement/releaseRules/index.vue

+ 30 - 3
src/views/rulesManagement/releaseRules/index.vue

@@ -445,6 +445,7 @@
       /* 表格数据源 */
       datasource({ page, limit, where, order }) {
         const typeWhere = {};
+        console.log('this.treeNode~~~~~~~~~~~~~~~', this.treeNode);
         if (this.treeNode && this.treeNode.item) {
           if (this.treeNode.type === 'industry') {
             typeWhere.industryType = this.treeNode.item.industryType;
@@ -479,7 +480,32 @@
       },
       /* 刷新表格 */
       reload(where) {
-        this.$refs.table.reload({ page: 1, where });
+        const typeWhere = {};
+        if (this.treeNode && this.treeNode.item) {
+          if (this.treeNode.type === 'industry') {
+            typeWhere.industryType = this.treeNode.item.industryType;
+          } else if (this.treeNode.type === 'business') {
+            typeWhere.industryType = this.treeNode.item.industryType;
+            typeWhere.businessType = this.treeNode.item.businessType;
+          } else if (this.treeNode.type === 'reportWork') {
+            typeWhere.industryType = this.treeNode.item.industryType;
+            typeWhere.businessType = this.treeNode.item.businessType;
+            typeWhere.reportWorkType = this.treeNode.item.reportWorkType;
+          } else if (this.treeNode.type === 'scene') {
+            typeWhere.industryType = this.treeNode.item.industryType;
+            typeWhere.businessType = this.treeNode.item.businessType;
+            typeWhere.reportWorkType = this.treeNode.item.reportWorkType;
+            typeWhere.classify = this.treeNode.item.sceneType;
+          } else {
+            typeWhere.industryType = this.treeNode.item.industryType;
+            typeWhere.businessType = this.treeNode.item.businessType;
+            typeWhere.reportWorkType = this.treeNode.item.reportWorkType;
+            typeWhere.classify = this.treeNode.item.sceneType;
+            typeWhere.recordTemplateStyle =
+              this.treeNode.item.templateStyleType;
+          }
+        }
+        this.$refs.table.reload({ page: 1, where, ...typeWhere });
       },
       // 发布
       async publish(row) {
@@ -619,15 +645,16 @@
         tree.forEach(clean);
 
         this.typeTree = tree; // 结果树
-
+        
         if (!this.treeNode) {
           // 默认选中第一个节点
           this.treeNode = this.typeTree.length > 0 ? this.typeTree[0] : null;
+          // console.log('this.treeNode`1111111111111111111111`', this.treeNode);
           if (this.treeNode) {
             // 默认选中节点
             this.$nextTick(() => {
               this.$refs.treeRef.setCurrentKey(this.treeNode.id);
-              // this.reload();
+              this.reload();
             });
           }
         }