Browse Source

Merge branch '1.2.2' of http://git.platomix.net/yangfan/workflow into 1.2.2

hml 5 months ago
parent
commit
858bdfd59f

+ 97 - 6
package-lock.json

@@ -1,12 +1,12 @@
 {
   "name": "web",
-  "version": "3.1.0",
+  "version": "1.1.0",
   "lockfileVersion": 2,
   "requires": true,
   "packages": {
     "": {
       "name": "web",
-      "version": "3.1.0",
+      "version": "1.1.0",
       "license": "MIT",
       "dependencies": {
         "@fullcalendar/bootstrap": "^4.4.0",
@@ -18,6 +18,7 @@
         "axios": "1.6.8",
         "bin-ace-editor": "^3.2.0",
         "brace": "^0.11.1",
+        "canvg": "^4.0.2",
         "clipboard": "2.0.4",
         "codemirror": "^5.58.2",
         "core-js": "^3.25.1",
@@ -2730,6 +2731,11 @@
       "integrity": "sha512-uXHQKES6DQKKCLh441Xv/dwxOq1TVS3JPUMlEqoEglvlhR6Mxnlew/Xq/LRVHpLyk7iK3zODe1qYHIMltO7XGg==",
       "dev": true
     },
+    "node_modules/@types/raf": {
+      "version": "3.4.3",
+      "resolved": "https://registry.npmmirror.com/@types/raf/-/raf-3.4.3.tgz",
+      "integrity": "sha512-c4YAvMedbPZ5tEyxzQdMoOhhJ4RD3rngZIdwC2/qDN3d7JpEhB6fiBRKVY1lg5B7Wk+uPBjn5f39j1/2MY1oOw=="
+    },
     "node_modules/@types/range-parser": {
       "version": "1.2.7",
       "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz",
@@ -6630,6 +6636,21 @@
         }
       ]
     },
+    "node_modules/canvg": {
+      "version": "4.0.2",
+      "resolved": "https://registry.npmmirror.com/canvg/-/canvg-4.0.2.tgz",
+      "integrity": "sha512-/7kIZger/mdFci4KXdtMr+NQB4GU1InkJ4RwSyDBRcvy4BUlg1hD+ZUWo550sWPyWaKZ8purqby6kjf09qVriw==",
+      "dependencies": {
+        "@types/raf": "^3.4.0",
+        "raf": "^3.4.1",
+        "rgbcolor": "^1.0.1",
+        "stackblur-canvas": "^2.0.0",
+        "svg-pathdata": "^6.0.3"
+      },
+      "engines": {
+        "node": ">=12.0.0"
+      }
+    },
     "node_modules/capture-exit": {
       "version": "1.2.0",
       "resolved": "https://registry.npmjs.org/capture-exit/-/capture-exit-1.2.0.tgz",
@@ -18279,8 +18300,7 @@
     "node_modules/performance-now": {
       "version": "2.1.0",
       "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
-      "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=",
-      "dev": true
+      "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns="
     },
     "node_modules/picocolors": {
       "version": "0.2.1",
@@ -19644,6 +19664,14 @@
         "node": ">=0.10"
       }
     },
+    "node_modules/raf": {
+      "version": "3.4.1",
+      "resolved": "https://registry.npmmirror.com/raf/-/raf-3.4.1.tgz",
+      "integrity": "sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA==",
+      "dependencies": {
+        "performance-now": "^2.1.0"
+      }
+    },
     "node_modules/randomatic": {
       "version": "3.1.1",
       "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.1.1.tgz",
@@ -20278,6 +20306,14 @@
       "integrity": "sha1-QzdOLiyglosO8VI0YLfXMP8i7rM=",
       "dev": true
     },
+    "node_modules/rgbcolor": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmmirror.com/rgbcolor/-/rgbcolor-1.0.1.tgz",
+      "integrity": "sha512-9aZLIrhRaD97sgVhtJOW6ckOEh6/GnvQtdVNfdZ6s67+3/XwLS9lBcQYzEEhYVeUowN7pRzMLsyGhK2i/xvWbw==",
+      "engines": {
+        "node": ">= 0.8.15"
+      }
+    },
     "node_modules/rimraf": {
       "version": "2.7.1",
       "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
@@ -21649,6 +21685,14 @@
         "node": ">=8"
       }
     },
+    "node_modules/stackblur-canvas": {
+      "version": "2.7.0",
+      "resolved": "https://registry.npmmirror.com/stackblur-canvas/-/stackblur-canvas-2.7.0.tgz",
+      "integrity": "sha512-yf7OENo23AGJhBriGx0QivY5JP6Y1HbrrDI6WLt6C5auYZXlQrheoY8hD4ibekFKz1HOfE48Ww8kMWMnJD/zcQ==",
+      "engines": {
+        "node": ">=0.1.14"
+      }
+    },
     "node_modules/stackframe": {
       "version": "1.2.0",
       "resolved": "https://registry.npmjs.org/stackframe/-/stackframe-1.2.0.tgz",
@@ -22249,6 +22293,14 @@
         "node": ">=0.8.0"
       }
     },
+    "node_modules/svg-pathdata": {
+      "version": "6.0.3",
+      "resolved": "https://registry.npmmirror.com/svg-pathdata/-/svg-pathdata-6.0.3.tgz",
+      "integrity": "sha512-qsjeeq5YjBZ5eMdFuUa4ZosMLxgr5RZ+F+Y1OrDhuOCEInRMA3x74XdBtggJcj9kOeInz0WE+LgCPDkZFlBYJw==",
+      "engines": {
+        "node": ">=12.0.0"
+      }
+    },
     "node_modules/svg-sprite-loader": {
       "version": "4.1.3",
       "resolved": "https://registry.npmjs.org/svg-sprite-loader/-/svg-sprite-loader-4.1.3.tgz",
@@ -27389,6 +27441,11 @@
       "integrity": "sha512-uXHQKES6DQKKCLh441Xv/dwxOq1TVS3JPUMlEqoEglvlhR6Mxnlew/Xq/LRVHpLyk7iK3zODe1qYHIMltO7XGg==",
       "dev": true
     },
+    "@types/raf": {
+      "version": "3.4.3",
+      "resolved": "https://registry.npmmirror.com/@types/raf/-/raf-3.4.3.tgz",
+      "integrity": "sha512-c4YAvMedbPZ5tEyxzQdMoOhhJ4RD3rngZIdwC2/qDN3d7JpEhB6fiBRKVY1lg5B7Wk+uPBjn5f39j1/2MY1oOw=="
+    },
     "@types/range-parser": {
       "version": "1.2.7",
       "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz",
@@ -30545,6 +30602,18 @@
       "integrity": "sha512-RHVYKov7IcdNjVHJFNY/78RdG4oGVjbayxv8u5IO74Wv7Hlq4PnJE6mo/OjFijjVFNy5ijnCt6H3IIo4t+wfEw==",
       "dev": true
     },
+    "canvg": {
+      "version": "4.0.2",
+      "resolved": "https://registry.npmmirror.com/canvg/-/canvg-4.0.2.tgz",
+      "integrity": "sha512-/7kIZger/mdFci4KXdtMr+NQB4GU1InkJ4RwSyDBRcvy4BUlg1hD+ZUWo550sWPyWaKZ8purqby6kjf09qVriw==",
+      "requires": {
+        "@types/raf": "^3.4.0",
+        "raf": "^3.4.1",
+        "rgbcolor": "^1.0.1",
+        "stackblur-canvas": "^2.0.0",
+        "svg-pathdata": "^6.0.3"
+      }
+    },
     "capture-exit": {
       "version": "1.2.0",
       "resolved": "https://registry.npmjs.org/capture-exit/-/capture-exit-1.2.0.tgz",
@@ -39916,8 +39985,7 @@
     "performance-now": {
       "version": "2.1.0",
       "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
-      "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=",
-      "dev": true
+      "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns="
     },
     "picocolors": {
       "version": "0.2.1",
@@ -41074,6 +41142,14 @@
         "fast-diff": "1.1.2"
       }
     },
+    "raf": {
+      "version": "3.4.1",
+      "resolved": "https://registry.npmmirror.com/raf/-/raf-3.4.1.tgz",
+      "integrity": "sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA==",
+      "requires": {
+        "performance-now": "^2.1.0"
+      }
+    },
     "randomatic": {
       "version": "3.1.1",
       "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.1.1.tgz",
@@ -41584,6 +41660,11 @@
       "integrity": "sha1-QzdOLiyglosO8VI0YLfXMP8i7rM=",
       "dev": true
     },
+    "rgbcolor": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmmirror.com/rgbcolor/-/rgbcolor-1.0.1.tgz",
+      "integrity": "sha512-9aZLIrhRaD97sgVhtJOW6ckOEh6/GnvQtdVNfdZ6s67+3/XwLS9lBcQYzEEhYVeUowN7pRzMLsyGhK2i/xvWbw=="
+    },
     "rimraf": {
       "version": "2.7.1",
       "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
@@ -42700,6 +42781,11 @@
         }
       }
     },
+    "stackblur-canvas": {
+      "version": "2.7.0",
+      "resolved": "https://registry.npmmirror.com/stackblur-canvas/-/stackblur-canvas-2.7.0.tgz",
+      "integrity": "sha512-yf7OENo23AGJhBriGx0QivY5JP6Y1HbrrDI6WLt6C5auYZXlQrheoY8hD4ibekFKz1HOfE48Ww8kMWMnJD/zcQ=="
+    },
     "stackframe": {
       "version": "1.2.0",
       "resolved": "https://registry.npmjs.org/stackframe/-/stackframe-1.2.0.tgz",
@@ -43181,6 +43267,11 @@
         }
       }
     },
+    "svg-pathdata": {
+      "version": "6.0.3",
+      "resolved": "https://registry.npmmirror.com/svg-pathdata/-/svg-pathdata-6.0.3.tgz",
+      "integrity": "sha512-qsjeeq5YjBZ5eMdFuUa4ZosMLxgr5RZ+F+Y1OrDhuOCEInRMA3x74XdBtggJcj9kOeInz0WE+LgCPDkZFlBYJw=="
+    },
     "svg-sprite-loader": {
       "version": "4.1.3",
       "resolved": "https://registry.npmjs.org/svg-sprite-loader/-/svg-sprite-loader-4.1.3.tgz",

+ 57 - 77
src/components/Dataset-filter/filterSetting.vue

@@ -281,15 +281,15 @@ export default {
       this.$set( field, 'conditions', [{function: "eq", values: ["", ""], timeType: "absolute", countType: "left",connectType:"and",asFilter:true,uniqId: util.getRandomStr(7)}])
       this.config.filter.push(field);
       document.body.click()
-      field.conditions.forEach((item,i)=>{
-        this.relationNode.conditions.push({uniqId: item.uniqId, columnTitle: field.columnTitle,})
-        this.config.filterRelation = JSON.stringify(this.relationNode)
-      })
-      // if (this.config.filterRelation){
-      //   let filterRelation = JSON.parse(this.config.filterRelation)
-      //   filterRelation.conditions.push({uniqId: field.uniqId, columnTitle: field.columnTitle,})
-      //   this.config.filterRelation = JSON.stringify(filterRelation)
-      // }
+      // field.conditions.forEach((item,i)=>{
+      //   this.relationNode.conditions.push({uniqId: item.uniqId, columnTitle: field.columnTitle,})
+      //   this.config.filterRelation = JSON.stringify(this.relationNode)
+      // })
+      if (this.config.filterRelation){
+        let filterRelation = JSON.parse(this.config.filterRelation)
+        filterRelation.conditions.push({uniqId: field.uniqId, columnTitle: field.columnTitle,})
+        this.config.filterRelation = JSON.stringify(filterRelation)
+      }
     },
     countCanAggregation(filter) {
       if (filter.connectTime == 'where') return false;
@@ -371,15 +371,17 @@ export default {
     },
     // 初始化过滤器结构
     initRelation() {
-      let filterRelation = this.config.filter.filter((i) => i.connectTime === "where");
+      // let filterRelation = this.config.filter.filter((i) => i.connectTime === "where");
       // 遍历 filterRelation 定义filterRelation下每个对象为item,如果item下conditions 存在且有长度的 遍历item的 conditions map出来 {uniqId: i.uniqId, columnTitle: item.columnTitle}
-      let conditionsList = []
-      filterRelation.forEach((item) => {
-        let filterItem = item.conditions.map((i) => ({uniqId: i.uniqId, columnTitle: item.columnTitle,}));
-        conditionsList = [...conditionsList,...filterItem]
-      });
+      // let conditionsList = []
+      // filterRelation.forEach((item) => {
+      //   let filterItem = item.conditions.map((i) => ({uniqId: i.uniqId, columnTitle: item.columnTitle,}));
+      //   conditionsList = [...conditionsList,...filterItem]
+      // });
       this.relationNode = {
-        conditions: conditionsList,
+        conditions: this.config.filter
+          .filter((i) => i.connectTime === "where")
+          .map((i) => ({uniqId: i.uniqId, columnTitle: i.columnTitle,})),
         relation: "AND",
       };
     },
@@ -422,47 +424,38 @@ export default {
     onConditionAdd() {
       let addItem = {function: "eq", values: ["", ""], timeType: "absolute", countType: "left",uniqId: util.getRandomStr(7)}
       this.nowFilter.conditions.push(addItem);
-      if (this.config.filterRelation){
-        this.relationNode.conditions.push({uniqId: addItem.uniqId, columnTitle: this.nowFilter.columnTitle,})
-        this.config.filterRelation = JSON.stringify(this.relationNode)
-      }
+      // if (this.config.filterRelation){
+      //   this.relationNode.conditions.push({uniqId: addItem.uniqId, columnTitle: this.nowFilter.columnTitle,})
+      //   this.config.filterRelation = JSON.stringify(this.relationNode)
+      // }
     },
     onConditionUpdate() {
       this.showEditFilter = false
-      let itemUniqId = [];
-      // 遍历 filter 中的每个对象
-      this.config.filter.forEach(item => {
-        // 检查 conditions 是否存在且不为空
-        if (item.conditions && item.conditions.length > 0) {
-          // 遍历 conditions 数组中的每个对象
-          item.conditions.forEach(condition => {
-            // 将 uniqId 添加到 uniqIds 数组中
-            itemUniqId.push(condition.uniqId);
-          });
-        }
-      });
-      this.relationNode?.conditions?.forEach((node, index) => {
-        this.updateNullNode(this.relationNode, node,itemUniqId, index);
-      });
-      if (this.config.filterRelation){
-        this.config.filterRelation = JSON.stringify(this.relationNode)
-      }
-    },
-    // 清除空节点
-    updateNullNode(parent, item,itemUniqId, index) {
-      if (item?.conditions && item.conditions.length){
-        item.conditions.forEach((node, i) => this.updateNullNode(item, node, itemUniqId, i));
-      }
-      if (!item.conditions && !itemUniqId.includes(item.uniqId)) {
-        parent.conditions.splice(index, 1);
-      }
+      // let itemUniqId = [];
+      // // 遍历 filter 中的每个对象
+      // this.config.filter.forEach(item => {
+      //   // 检查 conditions 是否存在且不为空
+      //   if (item.conditions && item.conditions.length > 0) {
+      //     // 遍历 conditions 数组中的每个对象
+      //     item.conditions.forEach(condition => {
+      //       // 将 uniqId 添加到 uniqIds 数组中
+      //       itemUniqId.push(condition.uniqId);
+      //     });
+      //   }
+      // });
+      // this.relationNode?.conditions?.forEach((node, index) => {
+      //   this.updateNullNode(this.relationNode, node,itemUniqId, index);
+      // });
+      // if (this.config.filterRelation){
+      //   this.config.filterRelation = JSON.stringify(this.relationNode)
+      // }
     },
     // 清除空节点
-    // clearNullNode(parent, item, index) {
-    //   if (item.conditions && item.conditions.length){
-    //     item.conditions.forEach((node, i) => this.clearNullNode(item, node, i));
+    // updateNullNode(parent, item,itemUniqId, index) {
+    //   if (item?.conditions && item.conditions.length){
+    //     item.conditions.forEach((node, i) => this.updateNullNode(item, node, itemUniqId, i));
     //   }
-    //   if (item.conditions && !item.conditions.length) {
+    //   if (!item.conditions && !itemUniqId.includes(item.uniqId)) {
     //     parent.conditions.splice(index, 1);
     //   }
     // },
@@ -476,17 +469,6 @@ export default {
       this.$nextTick(() => {
         this.nowFilter = field;
         this.toggleType = toggleType;
-        let relation = this.config.filterRelation;
-        if (relation) {
-          let where = JSON.parse(relation);
-          if (where.conditions && where.conditions.length) {
-            this.relationNode = where;
-          } else {
-            this.initRelation();
-          }
-        } else {
-          this.initRelation();
-        }
       })
       // let func = this.nowFilter.conditions[0].function;
       // if (func === "in" || func === "notIn" || func === "indexIn") {
@@ -497,21 +479,19 @@ export default {
     },
     onFieldDel(index) {
       let item = this.config.filter.splice(index, 1)[0];
-      item.conditions.forEach((item1) => {
-        let uniqId = item1.uniqId;
-        if (this.config.filterRelation){
-          let where = JSON.parse(this.config.filterRelation);
-          let node = this.getIncludeNode(where, uniqId);
-          let index2 = node.conditions.findIndex((i) => i.uniqId === uniqId);
-          node.conditions.splice(index2, 1);
-          where.conditions.forEach((node, index) => {
-            this.clearNullNode(where, node, index);
-          });
-          this.config.filterRelation = JSON.stringify(where);
-          this.relationNode = where;
-          this.$forceUpdate();
-        }
-      })
+      let uniqId = item.uniqId;
+      if (this.config.filterRelation){
+        let where = JSON.parse(this.config.filterRelation);
+        let node = this.getIncludeNode(where, uniqId);
+        let index2 = node.conditions.findIndex((i) => i.uniqId === uniqId);
+        node.conditions.splice(index2, 1);
+        where.conditions.forEach((node, index) => {
+          this.clearNullNode(where, node, index);
+        });
+        this.config.filterRelation = JSON.stringify(where);
+        this.relationNode = where;
+        this.$forceUpdate();
+      }
     },
     getIncludeNode(node, uniqId) {
       if (node.conditions && node.conditions.length){

+ 32 - 25
src/components/Dataset-filter/tab-filter.vue

@@ -203,36 +203,28 @@ export default {
         }
       })
     },
+    updateNullNode(parent,item,filter){
+      if (item?.conditions && item.conditions.length) {
+        item.conditions.forEach((node, i) => this.updateNullNode(item,node,filter));
+      }else {
+        let filterItem = filter.find(item1=> item1.uniqId === item.uniqId)
+        if (filterItem.conditions && filterItem.conditions.length){
+          filterItem.conditions.forEach((z, i) =>{
+            parent.conditions.push(
+              {uniqId: z.uniqId, columnTitle: filterItem.columnTitle,}
+            )
+          });
+          parent.conditions = parent.conditions.filter(item1=> item1.uniqId !== item.uniqId)
+        }
+      }
+    },
     addFormClick(){
       this.$refs['addForm'].validate((valid) => {
         if (valid) {
           this.newlabelList = this.newlabelList.filter(item=> item.visualdevPermName !== '全部')
           // let browserRequest = []
           if (this.addForm.filter && this.addForm.filter.length) {
-            // this.addForm.filter.forEach((item,index)=>{
-            //   if (item.conditions && item.conditions.length) {
-            //     // 从this.formData.fields里查存在relationData的 并且itemRelationList有长度的 循环itemRelationList 找到drawId 等于 item.id 的 找到的话 将plaintext返回
-            //     let relationData = this.formData.fields.find(field=>field.relationData && field.relationData.itemRelationList && field.relationData.itemRelationList.length && field.relationData.itemRelationList.find(i=>i.drawId === item.id))
-            //     let associationColumnFlag = false
-            //     if (relationData) {
-            //       if (relationData.relationData.itemRelationList.find(i=>i.drawId === item.id).plaintext === 1) {
-            //         associationColumnFlag = true
-            //       }
-            //     }
-            //     item.conditions.forEach(condition => {
-            //       let conditionItem = {
-            //         cubeColumnId: item.id,
-            //         function: condition.function,
-            //         values: condition.values && condition.values.length ? condition.values[1] ? condition.values : [condition.values[0]] : [],
-            //         uniqId: item.uniqId
-            //       }
-            //       if (associationColumnFlag) conditionItem = {...conditionItem, associationColumn:false}
-            //       browserRequest.push(conditionItem)
-            //     })
-            //   }
-            // })
             if (!this.addForm.filterRelation) {
-              console.log(this.addForm)
               let filterRow = this.addForm.filter.filter((i) => i.connectTime === "where");
               // 遍历 filterRelation 定义filterRelation下每个对象为item,如果item下conditions 存在且有长度的 遍历item的 conditions map出来 {uniqId: i.uniqId, columnTitle: item.columnTitle}
               let conditionsList = []
@@ -244,13 +236,28 @@ export default {
                 conditions: conditionsList,
                   relation: "AND",
               }
-              this.addForm.filterRelation = JSON.stringify(filterRelation)
+              this.addForm.filterRelationIntegration = JSON.stringify(filterRelation)
+              this.addForm.filterRelation = JSON.stringify({
+                conditions: this.addForm.filter
+                  .filter((i) => i.connectTime === "where")
+                  .map((i) => ({uniqId: i.uniqId, columnTitle: i.columnTitle,})),
+                relation: "AND",
+              })
+            }else {
+              let filterRelation = JSON.parse(this.addForm.filterRelation)
+              if (filterRelation.conditions && filterRelation.conditions.length) {
+                let cloneFilterRelation = deepClone(filterRelation)
+                cloneFilterRelation.conditions.forEach((i,z)=>{
+                  this.updateNullNode(cloneFilterRelation,i,this.addForm.filter)
+                })
+                this.addForm.filterRelationIntegration = JSON.stringify(cloneFilterRelation)
+              }
             }
           }
           let params = {
             visualdevPermName:this.addForm.name,
             labelStatus: this.addForm.states,
-            labelJson:JSON.stringify({filter:this.addForm.filter,filterRelation:this.addForm.filterRelation}),
+            labelJson:JSON.stringify({filter:this.addForm.filter,filterRelationIntegration:this.addForm.filterRelationIntegration,filterRelation:this.addForm.filterRelation}),
             dataPermId:this.nowFilter.dataPermId,
             labelGroupId:this.nowFilter.id,
             id:this.addForm.id,

+ 1 - 1
src/views/basic/dynamicModel/list/index.vue

@@ -3194,7 +3194,7 @@ export default {
           })
         }
         this.labelBrowserRequest = JSON.stringify(browserRequest)
-        this.paramCondition = data.filterRelation ? JSON.parse(data.filterRelation) : ''
+        this.paramCondition = data.filterRelationIntegration ? JSON.parse(data.filterRelationIntegration) : ''
         this.$refs.Search.searchList = deepClone(this.columnData.searchList)
         this.$refs.Search.buildOptions(deepClone(this.columnData.searchList))
         this.reset()