{"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\\views\\uc\\MatrixData.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\src\\views\\uc\\MatrixData.vue","mtime":1675071993288},{"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/es6.function.name\";\nimport \"core-js/modules/web.dom.iterable\";\n\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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 eipUserSelector = function eipUserSelector() {\n  return import(\"@/components/selector/EipUserSelector.vue\");\n};\n\nvar userSelector = function userSelector() {\n  return import(\"@/components/selector/UserSelector.vue\");\n};\n\nvar customDialogShow = function customDialogShow() {\n  return import(\"@/views/form/customDialog/CustomDialogShow.vue\");\n};\n\nvar customDialogShowTree = function customDialogShowTree() {\n  return import(\"@/views/form/customDialog/CustomDialogShowTree.vue\");\n};\n\nvar eipTreeDialog = function eipTreeDialog() {\n  return import(\"@/views/form/customDialog/EipTreeDialog.vue\");\n};\n\nimport req from \"@/request.js\";\nimport htUtil from \"@/hotent-ui-util.js\";\nimport CustomQuery from \"@/views/form/customquery/CustomQuery.js\";\nimport form from \"@/api/form.js\";\nexport default {\n  components: {\n    eipUserSelector: eipUserSelector,\n    customDialogShow: customDialogShow,\n    userSelector: userSelector,\n    customDialogShowTree: customDialogShowTree,\n    eipTreeDialog: eipTreeDialog\n  },\n  data: function data() {\n    return {\n      dialogVisible: false,\n      dataList: [],\n      pageResult: {\n        page: 1,\n        pageSize: 20,\n        total: 0\n      },\n      matrix: {},\n      colFields: [],\n      formData: {},\n      //自定义对话框\n      aliasPreview: \"\",\n      customDialogPreview: {},\n      titlePreview: \"\",\n      //关联查询的返回数据集合\n      options: {},\n      isIssure: false,\n      dataSources: \"mysql\"\n    };\n  },\n  mounted: function mounted() {\n    this.getSQLType();\n    this.$validator = this.$root.$validator;\n  },\n  methods: {\n    showDialog: function showDialog(id) {\n      var _this = this;\n\n      this.$http.get(\"${uc}/uc/matrix/v1/data/getOneData?pk=\" + \"\".concat(id) + \"&matrixId=\" + this.matrix.id).then(function (resp) {\n        _this.formData = resp.data.data;\n\n        if (_this.formData) {\n          for (var key in _this.formData) {\n            if (key.indexOf(\"ROLE_\") == 0 && _this.formData[key]) {\n              _this.formData[key] = JSON.parse(_this.formData[key]);\n            }\n          }\n        }\n\n        _this.dialogVisible = true;\n      }, function (error) {});\n      this.getSelectOptions();\n    },\n    beforeCloseDialog: function beforeCloseDialog() {\n      this.dialogVisible = false;\n    },\n    loadData: function loadData(param, cb) {\n      var id = this.$route.params.matrixId;\n      var this_ = this;\n      this.$http.post(\"${uc}/uc/matrix/v1/data/list/\" + id, param).then(function (resp) {\n        var response = resp.data;\n        this_.matrix = response.matrix;\n        this_.isIssure = true;\n        this_.colFields = response.colFields;\n        /*if (this_.dataSources === \"oracle\" ){\r\n          for (let i = 0; i < this_.colFields.length; i++) {\r\n            const colFiled = this_.colFields[i];\r\n            colFiled.field = colFiled.field.toUpperCase();\r\n          }\r\n        }else if ( this_.dataSources === \"postgresql\"){\r\n          for (let i = 0; i < this_.colFields.length; i++) {\r\n            const colFiled = this_.colFields[i];\r\n            colFiled.field = colFiled.field.toLowerCase();\r\n          }\r\n        }*/\n\n        this_.dataList = response.data.rows;\n        this_.pageResult = {\n          page: response.data.page,\n          pageSize: response.data.pageSize,\n          total: response.data.total\n        };\n      }, function (error) {}).finally(function () {\n        return cb && cb();\n      });\n    },\n    save: function save() {\n      var _this2 = this;\n\n      //条件字段至少填一个\n      var hasCond = false;\n\n      for (var key in this.formData) {\n        if (key.indexOf(\"CONDK_\") === 0 && this.formData[key]) {\n          hasCond = true;\n          break;\n        }\n      }\n\n      if (!hasCond) {\n        this.$message.warning(\"条件字段至少填一个\");\n        return;\n      }\n\n      this.$http.post(\"${uc}/uc/matrix/v1/data/save/\" + this.matrix.id, JSON.stringify(this.formData)).then(function (resp) {\n        if (resp.data.state) {\n          _this2.$message.success(resp.data.message);\n\n          _this2.beforeCloseDialog();\n\n          _this2.$refs.htTable.load();\n        } else {\n          _this2.$message.error(resp.data.message);\n        }\n      }, function (error) {}).finally(function () {});\n    },\n    parseUser: function parseUser(val) {\n      var fullnames = [];\n\n      if (val && val != \"null\") {\n        var list = JSON.parse(val);\n        list.forEach(function (item) {\n          fullnames.push(item.fullname);\n        });\n      }\n\n      return fullnames.join(\",\");\n    },\n    showCustomDialog: function showCustomDialog(colDef) {\n      this.currColDef = colDef;\n      this.dialogPreview(colDef.queryAlias);\n    },\n    //预览\n    dialogPreview: function dialogPreview(alias) {\n      var this_ = this;\n      var url = \"${form}/form/customDialog/v1/getByAlias?alias=\" + alias;\n      req.get(url).then(function (customDialog) {\n        customDialog = customDialog.data; //格式化对话框的显示字段、返回字段、条件字段、排序字段\n\n        customDialog.displayfield = JSON.parse(customDialog.displayfield);\n\n        for (var i = 0; i < customDialog.displayfield.length; i++) {\n          customDialog.displayfield[i].field = customDialog.displayfield[i].field.toUpperCase();\n        }\n\n        customDialog.resultfield = JSON.parse(customDialog.resultfield);\n        customDialog.sortfield = JSON.parse(customDialog.sortfield);\n        customDialog.conditionfield = JSON.parse(customDialog.conditionfield); //这里强制给对话框改为单选\n\n        customDialog.selectNum = 1; //列表\n\n        if (customDialog.style == 0) {\n          this_.aliasPreview = alias;\n          this_.customDialogPreview = customDialog;\n          this_.titlePreview = customDialog.name + \"-对话框列表预览\";\n          setTimeout(function () {\n            this_.$refs.customDialogShow.showDialog(); //显示自定义对话框列表预览弹框\n          });\n        } else {\n          //树形\n          this_.aliasPreview = alias;\n          this_.customDialogPreview = customDialog;\n          this_.titlePreview = customDialog.name + \"-对话框树形预览\";\n          var param = {};\n\n          if (customDialog.conditionfield.length > 0) {\n            for (var _i = customDialog.conditionfield.length - 1; _i >= 0; _i--) {\n              //判断条件字段是否是动态传入（defaultType：4：动态传入，2：固定值 ）\n              if (customDialog.conditionfield[_i].defaultType == \"4\") {\n                param[customDialog.conditionfield[_i].field] = customDialog.conditionfield[_i].comment;\n              }\n            }\n          } //有动态传入的字段\n\n\n          if (JSON.stringify(param) != \"{}\") {\n            customDialog.param = param;\n            setTimeout(function () {\n              this_.$refs.customDialogShowTree.showDialog(); //显示自定义对话框列表预览弹框\n            });\n          } else {\n            setTimeout(function () {\n              this_.$refs.eipTreeDialog.showDialog();\n            });\n          }\n        }\n      });\n    },\n    handleSavePreview: function handleSavePreview(list) {\n      if (!list) {\n        return;\n      }\n\n      if (list.length > 1) {\n        this.$message.warning(\"请只选择一项！\");\n        return;\n      }\n\n      var data = list[0];\n      var code = this.currColDef.code;\n      var bindKey = this.currColDef.bindKey;\n      var bindValue = this.currColDef.bindValue;\n      var v1 = data[bindKey] || data[bindKey.toUpperCase()] || data[bindKey.toLowerCase()],\n          v2 = data[bindValue] || data[bindValue.toUpperCase()] || data[bindValue.toLowerCase()];\n      this.$set(this.formData, \"CONDK_\" + code, v1);\n      this.$set(this.formData, \"CONDV_\" + code, v2);\n    },\n    getSelectOptions: function getSelectOptions() {\n      for (var i = 0; i < this.matrix.condList.length; i++) {\n        var ele = this.matrix.condList[i];\n\n        if (ele.ctrlType === \"select\") {\n          //获取关联查询基本信息\n          !this.options[ele.queryAlias] && this.doCustomQuery(ele, ele.queryAlias);\n        }\n      }\n    },\n    doCustomQuery: function doCustomQuery(colDef, alias) {\n      var _this3 = this;\n\n      CustomQuery.load(alias, null).then(function (data) {\n        //判断是否有关联查询数据返回\n        if (data.length > 0) {\n          var bindKey = colDef.bindKey;\n          var bindValue = colDef.bindValue;\n          var option = [];\n\n          for (var i = 0; i < data.length; i++) {\n            var item = data[i];\n            option.push({\n              key: item[bindKey],\n              value: item[bindValue]\n            });\n          }\n\n          _this3.$set(_this3.options, alias, option);\n        }\n      }).finally();\n    },\n    handleFocus: function handleFocus(data, event) {\n      this.currColDef = data;\n    },\n    handleChange: function handleChange(value, data) {\n      if (data) {\n        var code = this.currColDef.code;\n        this.$set(this.formData, \"CONDK_\" + code, data.key);\n      }\n    },\n    clearCond: function clearCond(colDef) {\n      this.currColDef = colDef;\n      var code = this.currColDef.code;\n      this.$set(this.formData, \"CONDK_\" + code, \"\");\n      this.$set(this.formData, \"CONDV_\" + code, \"\");\n    },\n    getSQLType: function getSQLType() {\n      // 获取数据库类型\n      var this_ = this;\n      form.getDataSource().then(function (resp) {\n        this_.dataSources = resp.data[resp.data.length - 1].dbType;\n        this_.$refs.htTable.load();\n      });\n    }\n  }\n};",null]}