{"remainingRequest":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!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\\dataTemplate\\FilterSetting.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\src\\components\\form\\dataTemplate\\FilterSetting.vue","mtime":1675071992147},{"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":["import \"core-js/modules/es7.object.get-own-property-descriptors\";\nimport \"core-js/modules/es6.object.keys\";\nimport \"core-js/modules/es6.function.name\";\nimport \"core-js/modules/es6.regexp.split\";\nimport \"core-js/modules/es6.string.sub\";\nimport \"core-js/modules/web.dom.iterable\";\nimport _defineProperty from \"D:/jenkins/workspace/xq-web-bpm/node_modules/@babel/runtime/helpers/esm/defineProperty\";\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nvar eipAuthDialog = function eipAuthDialog() {\n  return import(\"@/components/dialog/EipAuthDialog.vue\");\n};\n\nvar templateFilterDialog = function templateFilterDialog() {\n  return import(\"@/components/form/dataTemplate/TemplateFilterDialog.vue\");\n};\n\nexport default {\n  components: {\n    eipAuthDialog: eipAuthDialog,\n    templateFilterDialog: templateFilterDialog\n  },\n  name: \"filter-setting\",\n  props: [\"data\"],\n  data: function data() {\n    return {\n      dataTemplate: {},\n      filterFields: [],\n      permissionMap: {},\n      permissionList: [],\n      tabHeight: \"\".concat(document.documentElement.clientHeight) - 280,\n      currentAuthRow: null,\n      colPrefix: \"\",\n      metafields: [],\n      editFilterIndex: -1,\n      conditionReplaceChar: \" &@ \"\n    };\n  },\n  mounted: function mounted() {\n    this.dataTemplate = this.data.bpmDataTemplate;\n    this.filterFields = this.dataTemplate.filterField ? JSON.parse(this.dataTemplate.filterField) : [];\n    this.permissionMap = this.data.permissionList;\n    this.colPrefix = this.data.colPrefix;\n    this.metafields = this.data.fields;\n\n    if (this.permissionMap) {\n      for (var key in this.permissionMap) {\n        this.permissionList.push({\n          type: key,\n          title: this.permissionMap[key]\n        });\n      }\n    }\n  },\n  methods: {\n    copy: function copy(index) {\n      var obj = JSON.parse(JSON.stringify(this.filterFields[index]));\n      this.filterFields.push(obj);\n    },\n    //保存过滤数据\n    saveFilterField: function saveFilterField() {\n      this.dataTemplate.filterField = this.filterFields ? JSON.stringify(this.filterFields) : null;\n    },\n    //显示字段排序\n    sort: function sort(index, type) {\n      if (\"up\" == type) {\n        if (index === 0) {\n          this.$message({\n            message: \"已经是列表中第一位\",\n            type: \"warning\"\n          });\n        } else {\n          var temp = this.filterFields[index - 1];\n          this.$set(this.filterFields, index - 1, this.filterFields[index]);\n          this.$set(this.filterFields, index, temp);\n        }\n      } else {\n        if (index === this.filterFields.length - 1) {\n          this.$message({\n            message: \"已经是列表中最后一位\",\n            type: \"warning\"\n          });\n        } else {\n          var i = this.filterFields[index + 1];\n          this.$set(this.filterFields, index + 1, this.displayFields[index]);\n          this.$set(this.filterFields, index, i);\n        }\n      }\n    },\n    //删除显示字段\n    remove: function remove(index) {\n      this.filterFields.splice(index, 1);\n    },\n    //添加管理过滤\n    addFilter: function addFilter(index, row) {\n      var conf = {\n        editFilter: {}\n      };\n\n      if (typeof index != \"undefined\" && index > -1) {\n        this.editFilterIndex = index;\n        conf.editFilter = _objectSpread({}, row);\n        conf.editFilter.condition = row.type == 1 ? this.transFromConditions(row.condition) : row.condition;\n      } else {\n        this.editFilterIndex = -1;\n      }\n\n      this.$refs.templateFilterDialog.showDialog(conf);\n    },\n    transFromConditions: function transFromConditions(condition) {\n      var _this2 = this;\n\n      var conditionObj = {\n        junction: \"and\",\n        condition: []\n      };\n      condition.forEach(function (c) {\n        if (c.branch) {\n          var subs = c.sub;\n          var subConditionObj = {\n            junction: subs[0].compType,\n            condition: []\n          };\n          subs.forEach(function (sub) {\n            var subCond = _this2.getTransDecode(sub);\n\n            subConditionObj.condition.push(subCond);\n          });\n          conditionObj.condition.push(subConditionObj);\n        } else {\n          var cond = _this2.getTransDecode(c);\n\n          conditionObj.junction = c.compType;\n          conditionObj.condition.push(cond);\n        }\n      });\n      return JSON.stringify(conditionObj);\n    },\n    getTransDecode: function getTransDecode(c) {\n      var descArray = c.conDesc.split(this.conditionReplaceChar);\n      var cond = {\n        property: c.flowvarKey,\n        operator: c.judgeCon1,\n        dataType: descArray.length > 3 ? descArray[3] : \"varchar\",\n        value: c.judgeVal1,\n        compType: \"1\",\n        style: descArray[2],\n        indexStr: descArray[1],\n        chooseDesc: descArray[0]\n      };\n      return cond;\n    },\n    transToConditions: function transToConditions(filterCondition) {\n      var _this3 = this;\n\n      var filter = JSON.parse(filterCondition);\n      var condition = [];\n\n      if (filter && filter.junction) {\n        var junction = filter.junction;\n\n        if (filter.condition) {\n          var conditions = filter.condition;\n          conditions.forEach(function (c) {\n            if (c.junction) {\n              if (c.condition) {\n                var subCond = {\n                  branch: true,\n                  sub: []\n                };\n                var subConditions = c.condition;\n                subConditions.forEach(function (sub) {\n                  var scond = _this3.getTransObj(sub, c.junction);\n\n                  subCond.sub.push(scond);\n                });\n                condition.push(subCond);\n              }\n            } else {\n              var cond = _this3.getTransObj(c, junction);\n\n              condition.push(cond);\n            }\n          });\n        }\n      }\n\n      return condition;\n    },\n    getTransObj: function getTransObj(c, junction) {\n      var cond = {\n        compType: junction,\n        flowvarKey: c.property,\n        judgeCon1: c.operator,\n        judgeVal1: c.value,\n        ruleType: \"1\"\n      };\n\n      switch (c.dataType) {\n        case \"number\":\n          cond.optType = \"1\";\n          break;\n\n        case \"date\":\n          cond.optType = \"3\";\n          break;\n\n        default:\n          cond.optType = \"2\";\n          break;\n      }\n\n      cond.conDesc = c.chooseDesc + this.conditionReplaceChar + c.indexStr + this.conditionReplaceChar + c.style + this.conditionReplaceChar + c.dataType;\n      return cond;\n    },\n    //打开设置权限\n    setFieldRightDialog: function setFieldRightDialog(row) {\n      var conf = {\n        right: JSON.parse(row.right),\n        permissionList: this.permissionList\n      };\n      this.currentAuthRow = row;\n      this.$refs.eipAuthDialog.showDialog(conf);\n    },\n    //设置权限\n    authDialogOnConfirm: function authDialogOnConfirm(data) {\n      if (this.currentAuthRow) {\n        this.currentAuthRow.right = JSON.stringify(data);\n      }\n    },\n    //设置过滤条件\n    filterDialogOnConfirm: function filterDialogOnConfirm(selection, rtn) {\n      if (rtn) {\n        if (this.editFilterIndex == -1) {\n          var filter = new Object();\n          filter.condition = rtn.filterType == 1 ? this.transToConditions(rtn.filter) : rtn.filter;\n          filter.name = rtn.name;\n          filter.key = rtn.key;\n          filter.type = rtn.filterType;\n          filter.right = JSON.stringify([{\n            type: \"everyone\"\n          }]);\n          this.filterFields.push(filter);\n        } else {\n          this.filterFields[this.editFilterIndex].condition = rtn.filterType == 1 ? this.transToConditions(rtn.filter) : rtn.filter;\n          this.filterFields[this.editFilterIndex].name = rtn.name;\n          this.filterFields[this.editFilterIndex].key = rtn.key;\n          this.filterFields[this.editFilterIndex].type = rtn.filterType;\n        }\n      }\n    },\n    //显示权限信息\n    rightToDesc: function rightToDesc(right) {\n      if (right) {\n        try {\n          right = JSON.parse(right);\n        } catch (error) {}\n      }\n\n      var desc = \"\";\n\n      var _this = this;\n\n      right.forEach(function (r) {\n        if (desc) {\n          desc += \" 和 \";\n        }\n\n        var str = _this.permissionMap[r.type];\n\n        if (r.name) {\n          str += \":\" + r.name;\n        } else if (r.id) {\n          str += \":\" + r.id;\n        }\n\n        desc += str;\n      });\n      return desc;\n    },\n    //显示类型描述\n    getFilterType: function getFilterType(type) {\n      type = parseInt(type);\n      var ft = \"条件脚本\";\n\n      switch (type) {\n        case 2:\n          ft = \"SQL\";\n          break;\n\n        case 3:\n          ft = \"追加SQL\";\n          break;\n\n        case 4:\n          ft = \"数据权限\";\n          break;\n      }\n\n      return ft;\n    },\n    //标题统一权限设置\n    mrightRenderHeader: function mrightRenderHeader(h, para) {\n      //下拉框选项\n      var _this = this;\n\n      var rights = [{\n        key: \"\",\n        value: \"请选择\"\n      }, {\n        key: \"none\",\n        value: \"无\"\n      }, {\n        key: \"everyone\",\n        value: \"所有人\"\n      }];\n      var rightMap = {\n        \"\": \"请选择\",\n        none: \"无\",\n        everyone: \"所有人\"\n      }; //下拉框内容包裹在一个div里面\n\n      return h(\"div\", {}, [h(\"span\", {\n        //div里面有一个文字提示：下拉框所属内容\n        style: {},\n        class: \"level-font-class\"\n      }, para.column.label), h(\"el-select\", {\n        //el-select实现下拉框\n        size: \"mini\",\n        style: {\n          width: \"120px\",\n          marginLeft: \"10px\"\n        },\n        on: {\n          input: function input(value) {\n            //随着下拉框的不同，文字框里的内容在边\n            _this.rightLab = rightMap[value];\n\n            if (value && _this.filterFields && _this.filterFields.length > 0) {\n              _this.filterFields.forEach(function (field) {\n                if (field.right) {\n                  try {\n                    field.right = JSON.parse(field.right);\n                  } catch (error) {}\n                }\n\n                if (field.right[0].hasOwnProperty(\"v\")) {\n                  field.right[0] = {\n                    v: value\n                  };\n                } else {\n                  field.right[0] = {\n                    type: value\n                  };\n                }\n\n                field.right = JSON.stringify(field.right);\n              });\n            }\n          }\n        },\n        props: {\n          value: _this.rightLab //文字框的内容取决于这个value，如果value不存在，会报错\n\n        }\n      }, [//下拉框里面填充选项，通过rights遍历map，为每一个选项赋值。\n      rights.map(function (item) {\n        return h(\"el-option\", {\n          props: {\n            value: item.key,\n            label: item.value\n          }\n        });\n      })])]);\n    }\n  }\n};",null]}