{"remainingRequest":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\xq-web-bpm\\src\\components\\form\\customView\\FilterDialog.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\src\\components\\form\\customView\\FilterDialog.vue","mtime":1675071992085},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\r\nimport form from \"@/api/form.js\";\r\nimport utils from \"@/hotent-ui-util.js\";\r\nconst eipOrgSelector = () => import(\"@/components/selector/EipOrgSelector.vue\");\r\nexport default {\r\n  components: {\r\n    eipOrgSelector\r\n  },\r\n  props: {\r\n    metafields: {\r\n      type: Array,\r\n      default: () => {}\r\n    },\r\n    conditionfields: {\r\n      type: Array,\r\n      default: () => {}\r\n    },\r\n    filterData: Object,\r\n    keys: Array\r\n  },\r\n  data() {\r\n    return {\r\n      dialogVisible: false,\r\n      data: {},\r\n      isEditabled: true,\r\n      isSelected: false,\r\n      conditions: [],\r\n      comVarList: [],\r\n      colPrefix: \"\",\r\n      selectVar: \"\",\r\n      newMetafields: [],\r\n      judgeConditions: [\r\n        { key: \"1\", value: \"等于\" },\r\n        { key: \"3\", value: \"等于(忽略大小写)\" },\r\n        { key: \"2\", value: \"不等于\" },\r\n        { key: \"4\", value: \"like\" },\r\n        { key: \"5\", value: \"like左\" },\r\n        { key: \"6\", value: \"like右\" },\r\n        { key: \"7\", value: \"等于变量\" },\r\n        { key: \"8\", value: \"不等于变量\" }\r\n      ],\r\n      scriptType: [\r\n        { key: \"1\", value: \"条件脚本\" },\r\n        { key: \"2\", value: \"SQL\" },\r\n        { key: \"3\", value: \"追加SQL\" },\r\n        { key: \"4\", value: \"数据权限\" }\r\n      ],\r\n      diySql: \"\",\r\n      authConditions: [\r\n        {\r\n          type: \"loginUser\",\r\n          name: \"当前登录用户数据\",\r\n          field: \"\",\r\n          enabled: false\r\n        },\r\n        {\r\n          type: \"loginUserOrgs\",\r\n          name: \"当前登陆用户所属组织\",\r\n          field: \"\",\r\n          enabled: false\r\n        },\r\n        {\r\n          type: \"loginUserSubOrgs\",\r\n          name: \"当前登陆用户所属组织及下属组织\",\r\n          field: \"\",\r\n          enabled: false\r\n        },\r\n        {\r\n          type: \"customOrgs\",\r\n          name: \"自定义选择组织\",\r\n          orgs: [\r\n            { id: \"6777\", name: \"组织测试\" },\r\n            {\r\n              id: \"6645\",\r\n              name: \"测试测试长度是否有变化啊测试测试长度是否有变化啊\"\r\n            }\r\n          ],\r\n          field: \"\"\r\n        }\r\n      ],\r\n      orgSelect: {\r\n        id: \"\",\r\n        name: \"\"\r\n      },\r\n      isAdd: false,\r\n      conditionOptions:[{key:'and',value:'and'},{key:'or',value:'or'}]\r\n    };\r\n  },\r\n  mounted() {\r\n    if (this.$store.state.login.currentUser.userAttrs.tenantId != -1) {\r\n      this.scriptType.splice(1, 1);\r\n    }\r\n\r\n    form.getComVarList().then(data => {\r\n      for (let i=0;i<data.length;i++){\r\n        data[i].alias = \"[\" + data[i].alias + \"]\";\r\n      }\r\n      this.comVarList = data;\r\n    });\r\n  },\r\n  methods: {\r\n    afterSaveData(cb) {\r\n      utils\r\n        .validateForm(this, \"filterForm\")\r\n        .then(r => {\r\n          if (cb) {\r\n            cb();\r\n          }\r\n        })\r\n        .catch(items => {\r\n          this.$message.warning(`还有内容尚未填写`);\r\n        });\r\n    },\r\n    beforeClose() {\r\n      this.dialogVisible = false;\r\n    },\r\n    handleOpen(isAdd) {\r\n      this.dialogVisible = true;\r\n      this.isAdd = isAdd;\r\n      this.orgSelect = {\r\n        id:\"\",\r\n        name:\"\"\r\n      };\r\n      this.$nextTick(() => {\r\n        this.newMetafields = this.metafields.filter(function(item) {\r\n          return item.isVirtual !== 1;\r\n        });\r\n        if (this.filterData.type) {\r\n          this.data = { ...this.filterData };\r\n        } else {\r\n          this.data = {\r\n            condition: [],\r\n            name: \"\",\r\n            key: \"\",\r\n            type: \"1\",\r\n            right: [{ type: \"everyone\", title: \"所有人\", checked: true }]\r\n          };\r\n          this.conditions = [];\r\n          this.diySql = \"\";\r\n        }\r\n        if (this.data.type === \"1\") {\r\n          this.conditions = this.data.condition;\r\n        } else if (this.data.type === \"2\" || this.data.type === \"3\") {\r\n          this.diySql = this.data.condition;\r\n        } else if (this.data.type === \"4\") {\r\n          let auth = JSON.parse(this.data.condition);\r\n          for (let i = 0; i < this.authConditions.length - 1; i++) {\r\n            for (let j = 0; j < auth.length; j++) {\r\n              if (this.authConditions[i].type === auth[j].type) {\r\n                this.authConditions[i].field = auth[j].field;\r\n                this.authConditions[i].enabled = true;\r\n              }\r\n            }\r\n          }\r\n          for (let j = 0; j < auth.length; j++) {\r\n            if (this.authConditions[3].type === auth[j].type) {\r\n              this.authConditions[3].field = auth[j].field;\r\n              for (let k = 0; k < auth[j].orgs.length; k++) {\r\n                this.orgSelect.id += auth[j].orgs[k].id + \",\";\r\n                this.orgSelect.name += auth[j].orgs[k].name + \",\";\r\n              }\r\n            }\r\n          }\r\n        }\r\n      });\r\n    },\r\n    addRule(type, condition, event) {\r\n      let con = {};\r\n      if (type === \"common\") {\r\n        con = {\r\n          optType: \"2\",\r\n          flowvarKey: \"\",\r\n          judgeCon1: \"1\",\r\n          judgeVal1: \"\",\r\n          conDesc: \"\",\r\n          ruleType: \"1\"\r\n        };\r\n      } else if (type === \"combine\") {\r\n        con = {\r\n          branch: true,\r\n          sub: []\r\n        };\r\n      }\r\n      con.compType = event;\r\n      condition.push(con);\r\n    },\r\n    removeRule(conditions, index) {\r\n      conditions.splice(index, 1);\r\n    },\r\n    save() {\r\n      if (!this.data.name || !this.data.key) {\r\n        this.$message.error(\"请填写名称与别名\");\r\n        return;\r\n      }\r\n      for (let i = 0; i < this.keys.length; i++) {\r\n        if (this.keys[i].key === this.data.key && this.isAdd) {\r\n          this.$message.error(\"别名已存在\");\r\n          return;\r\n        }\r\n      }\r\n      if (this.data.key) {\r\n        if (this.data.type === \"1\") {\r\n          this.conditions = this.clearEmptyData(this.conditions);\r\n          this.data.condition = this.conditions;\r\n        } else if (this.data.type === \"2\" || this.data.type === \"3\") {\r\n          this.data.condition = this.diySql;\r\n        } else if (this.data.type === \"4\") {\r\n          let orgSelectId = this.orgSelect.id.split(\",\");\r\n          let orgSelectName = this.orgSelect.name.split(\",\");\r\n          let auth = [];\r\n          for (let i = 0; i < this.authConditions.length - 1; i++) {\r\n            if (\r\n              this.authConditions[i].enabled &&\r\n              this.authConditions[i].field\r\n            ) {\r\n              auth.push({\r\n                type: this.authConditions[i].type,\r\n                name: this.authConditions[i].name,\r\n                field: this.authConditions[i].field\r\n              });\r\n            }\r\n          }\r\n          if (orgSelectId.length > 0 && this.authConditions[3].field) {\r\n            let orgs = [];\r\n            for (let i = 0; i < orgSelectId.length; i++) {\r\n              orgs.push({\r\n                id: orgSelectId[i],\r\n                name: orgSelectName[i]\r\n              });\r\n            }\r\n            auth.push({\r\n              type: this.authConditions[3].type,\r\n              name: this.authConditions[3].name,\r\n              field: this.authConditions[3].field,\r\n              orgs: orgs\r\n            });\r\n          }\r\n          this.data.condition = JSON.stringify(auth);\r\n        }\r\n        this.$emit(\"after-save\", this.data);\r\n        this.dialogVisible = false;\r\n      } else {\r\n        this.$message(\"请输入key\");\r\n      }\r\n    },\r\n    clearEmptyData(conditions) {\r\n      if (conditions.length > 0) {\r\n        for (let i = 0; i < conditions.length; i++) {\r\n          if (conditions[i].branch) {\r\n            conditions[i].sub = this.clearEmptyData(conditions[i].sub);\r\n          } else {\r\n            if (!conditions[i].flowvarKey) {\r\n              conditions.splice(i, 1);\r\n              i = i - 1;\r\n            } else {\r\n              conditions[i].conDesc =\r\n                conditions[i].flowvarKey +\r\n                \" \" +\r\n                this.getJudgeConditionName(conditions[i].judgeCon1) +\r\n                \" \" +\r\n                conditions[i].judgeVal1;\r\n            }\r\n          }\r\n        }\r\n      }\r\n      return conditions;\r\n    },\r\n    getJudgeConditionName(key) {\r\n      for (let i = 0; i < this.judgeConditions.length; i++) {\r\n        if (this.judgeConditions[i].key === key) {\r\n          return this.judgeConditions[i].value;\r\n        }\r\n        return \"\";\r\n      }\r\n    },\r\n    selectColumn(data) {\r\n      this.diySql += data;\r\n    }\r\n  }\r\n};\r\n",null]}