{"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\\form\\CustomChartManager.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\src\\views\\form\\CustomChartManager.vue","mtime":1675071992913},{"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/web.dom.iterable\";\nimport \"core-js/modules/es6.object.keys\";\nimport \"core-js/modules/es6.function.name\";\nimport \"core-js/modules/es6.string.ends-with\";\nimport \"core-js/modules/es7.array.includes\";\nimport \"core-js/modules/es6.string.includes\";\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//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nimport form from \"@/api/form.js\";\nimport utils from \"@/hotent-ui-util\";\nimport uc from \"@/api/uc\";\nimport req from \"@/request\";\nimport { mapState } from \"vuex\";\n\nvar eipChart = function eipChart() {\n  return import(\"@/components/form/chart/EipChart.vue\");\n};\n\nvar eipChartSetting = function eipChartSetting() {\n  return import(\"@/components/form/chart/EipChartSetting.vue\");\n};\n\nexport default {\n  name: \"customChartManager\",\n  components: {\n    eipChart: eipChart,\n    eipChartSetting: eipChartSetting\n  },\n  data: function data() {\n    return {\n      data: [],\n      pageResult: {\n        page: 1,\n        pageSize: 50,\n        total: 0\n      },\n      activeTab: \"basicSetting\",\n      dialogVisible: false,\n      chartDialogVisible: false,\n      //基本设置的属性\n      initProp: {\n        width: 800,\n        height: 400,\n        system: 1,\n        isTable: 1,\n        dsalias: \"LOCAL\",\n        // 本地数据源\n        displayfield: [],\n        xaxisField: [],\n        sortfield: [],\n        conditionfield: [],\n        alias: ''\n      },\n      prop: {},\n      //标题设置，图例设置与数据展示\n      initConfig: {\n        maxLength: 0,\n        //最大数据量\n        yMin: \"1\",\n        xShowAll: \"1\",\n        theme: \"default\",\n        //主题\n        //title,legend参考echarts的属性\n        title: {\n          show: true,\n          textStyle: {\n            fontStyle: \"normal\",\n            fontFamily: \"sans-serif\",\n            fontSize: 18\n          },\n          subtext: \"\",\n          left: \"auto\",\n          top: \"auto\"\n        },\n        legend: {\n          show: true,\n          type: \"plain\",\n          left: \"auto\",\n          top: \"auto\",\n          orient: \"horizontal\"\n        },\n        series: {}\n      },\n      config: {},\n      line: {\n        doubleYAxis: true,\n        stack: false,\n        showType: true,\n        smooth: true,\n        dataZoom: false\n      },\n      pie: {\n        showType: true,\n        roseType: false,\n        selectedMode: false,\n        radius: [\"0\", \"75\"],\n        center: [\"50\", \"50\"],\n        label: {\n          position: \"outside\"\n        }\n      },\n      radar: {\n        showType: true,\n        radius: \"75\",\n        center: [\"50\", \"50\"],\n        areaStyle: true\n      },\n      funnel: {\n        showType: true,\n        funnelAlign: \"center\",\n        sort: \"none\",\n        label: {\n          position: \"inside\"\n        }\n      },\n      scatter: {\n        showType: true,\n        xAxisType: 'category'\n      },\n      fontFamilies: [\"sans-serif\", \"monospace\", \"Arial\", \"Courier New\", \"Microsoft YaHei\", \"serif\"],\n      fontStyles: [\"normal\", \"italic\", \"oblique\"],\n      styles: [{\n        text: \"折线图/柱状图\",\n        value: 1\n      }, {\n        text: \"饼图\",\n        value: 3\n      }, {\n        text: \"雷达图\",\n        value: 4\n      }, {\n        text: \"漏斗图\",\n        value: 5\n      }, {\n        text: \"散点图\",\n        value: 6\n      }, {\n        text: \"热力图\",\n        value: 7\n      }],\n      dataSources: [],\n      tablesOrViews: [],\n      isCheckSql: \"notCheck\",\n      isSubmit: false,\n      id: \"\",\n      param: {},\n      state: \"\",\n      deleteUrl: window.context.form + \"/form/customChart/v1/removes\",\n      chartType: {\n        \"1\": \"line\",\n        \"3\": \"pie\",\n        \"4\": \"radar\",\n        \"5\": \"funnel\",\n        \"6\": \"scatter\",\n        \"7\": \"heatMap\"\n      },\n      importDialogVisible: false,\n      uploadUrl: window.context.form + \"/form/customChart/v1/import\",\n      fullscreenLoading: false\n    };\n  },\n  computed: mapState({\n    uploadHeaders: function uploadHeaders(mapState) {\n      return {\n        Authorization: \"Bearer \" + mapState.login.currentUser.token\n      };\n    }\n  }),\n  created: function created() {\n    this.config = _objectSpread({}, this.initConfig);\n  },\n  mounted: function mounted() {\n    this.getDataSource();\n  },\n  watch: {\n    //修改过SQL语句把状态改为未验证\n    'prop.diySql': {\n      handler: function handler(newValue, oldValue) {\n        if (newValue !== oldValue) {\n          this.isCheckSql = \"notCheck\";\n        }\n      }\n    }\n  },\n  methods: {\n    rowClick: function rowClick(row) {\n      this.$refs.table.$refs.htTable.toggleRowSelection(row);\n    },\n    loadData: function loadData(param, cb) {\n      var _this = this;\n\n      param.sorter = [{\n        direction: \"DESC\",\n        property: \"updateTime\"\n      }];\n      form.getCustomChartList(param).then(function (response) {\n        _this.data = response.rows;\n        _this.pageResult = {\n          page: response.page,\n          pageSize: response.pageSize,\n          total: response.total\n        };\n      }).finally(function () {\n        cb();\n      });\n    },\n    showDialog: function showDialog(id) {\n      var _this2 = this;\n\n      this.dialogVisible = true;\n\n      if (id != null) {\n        form.getCustomChartById(id).then(function (data) {\n          _this2.prop = data;\n          _this2.prop.displayfield = JSON.parse(data.displayfield);\n          _this2.prop.xaxisField = JSON.parse(data.xaxisField);\n          _this2.prop.sortfield = JSON.parse(data.sortfield);\n          _this2.prop.conditionfield = JSON.parse(data.conditionfield);\n          _this2.config = JSON.parse(data.conf);\n          _this2[_this2.chartType[_this2.prop.style + \"\"]] = _this2.config.series;\n          _this2.isCheckSql = \"suc\";\n        });\n      } else {\n        this.prop = _objectSpread({}, this.initProp);\n        this.config = _objectSpread({}, this.initConfig);\n      }\n    },\n    beforeClose: function beforeClose() {\n      this.dialogVisible = false;\n    },\n    beforeChartClose: function beforeChartClose() {\n      this.chartDialogVisible = false;\n    },\n    //获取数据源\n    getDataSource: function getDataSource() {\n      var _this3 = this;\n\n      form.getDataSource().then(function (response) {\n        _this3.dataSources = response.data;\n      });\n    },\n    //根据关键字查询数据源中的表\n    getByDsObjectName: function getByDsObjectName() {\n      var _this4 = this;\n\n      if (this.prop.dsalias === null) {\n        this.$message({\n          message: \"请选择数据源\",\n          type: \"warning\"\n        });\n        return;\n      }\n\n      var data = {\n        dsalias: this.prop.dsalias,\n        isTable: this.prop.isTable,\n        objName: this.state\n      };\n      form.getTableList(data).then(function (response) {\n        if (!response.data || response.data.length === 0) {\n          _this4.$message({\n            message: \"该数据源中未查询到表或视图\",\n            type: \"warning\"\n          });\n\n          return;\n        }\n\n        _this4.tablesOrViews = response.data;\n      });\n    },\n    columnSetting: function columnSetting() {\n      if (!this.checkSelectWay()) return;\n\n      if (this.prop.dsType === \"dataSource\" && this.prop.objName == null) {\n        this.$message({\n          type: \"warning\",\n          message: \"请选择目标表或视图\"\n        });\n      }\n\n      this.param = {\n        dsalias: this.prop.dsalias,\n        isTable: this.prop.isTable,\n        objName: this.prop.objName,\n        diySql: this.prop.diySql\n      };\n      this.$refs.columnSetting.handleOpen();\n    },\n    checkSelectWay: function checkSelectWay() {\n      var errMsgArr = [];\n\n      if (!this.prop.style || this.prop.style === \"\") {\n        errMsgArr.push(\"请选择图表类型\");\n      }\n\n      if (this.prop.isTable === 1 && this.prop.objName == null) {\n        errMsgArr.push(\"请选择目标表\");\n      }\n\n      if (this.prop.isTable === 2) {\n        if (this.prop.diySql == null) {\n          errMsgArr.push(\"请填写SQL语句并验证\");\n        } else if (this.isCheckSql === \"notCheck\") {\n          errMsgArr.push(\"请验证SQL语句\");\n        } else if (this.isCheckSql === \"fail\") {\n          errMsgArr.push(\"SQL语句验证不通过\");\n        }\n      }\n\n      if (errMsgArr.length > 0) {\n        this.$message({\n          message: errMsgArr.join(\",\"),\n          type: \"warning\"\n        });\n        return false;\n      } else {\n        return true;\n      }\n    },\n    close: function close(dialogVisible) {\n      this[dialogVisible] = false;\n    },\n    changeName: function changeName() {\n      document.getElementsByName(\"chartName\")[0].style.border = \"\";\n    },\n    save: function save() {\n      var _this5 = this;\n\n      utils.validateForm(this, \"propForm\").then(function (r) {\n        if (!_this5.checkSelectWay()) return;\n        _this5.prop.conf = JSON.stringify(_this5.config);\n\n        var param = _objectSpread({}, _this5.prop);\n\n        if (!param.xaxisField || param.xaxisField.length < 1 || !param.displayfield || param.displayfield.length < 1) {\n          _this5.$message({\n            message: \"请设置列\",\n            type: \"warning\"\n          });\n\n          return;\n        }\n\n        param.displayfield = JSON.stringify(param.displayfield);\n        param.xaxisField = JSON.stringify(param.xaxisField);\n        param.conditionfield = JSON.stringify(param.conditionfield);\n        param.sortfield = JSON.stringify(param.sortfield);\n        _this5.config.series = _this5[_this5.chartType[param.style + \"\"]];\n        param.conf = JSON.stringify(_this5.config);\n        delete param.resultfield;\n        form.saveCustomChart(param).then(function (response) {\n          if (response.state) {\n            _this5.$message({\n              message: \"保存成功\",\n              type: \"success\"\n            });\n\n            _this5.dialogVisible = false;\n\n            _this5.$refs.table.load();\n          } else {\n            document.getElementsByName(\"chartName\")[0].focus();\n            document.getElementsByName(\"chartName\")[0].style.border = \"1px solid red\";\n          }\n        }).catch(function () {\n          _this5.$message.error(\"保存失败\");\n        });\n      }).catch(function (reason) {\n        _this5.$message.error(\"表单校验不通过，请检查表单\");\n      });\n    },\n    preview: function preview(id) {\n      this.id = id;\n      this.chartDialogVisible = true;\n    },\n    //验证sql\n    checkSql: function checkSql() {\n      var _this6 = this;\n\n      var data = {\n        sql: this.prop.diySql,\n        dsName: this.prop.dsalias\n      };\n\n      if (!this.prop.diySql) {\n        this.$message('请填写自定义sql!');\n        return;\n      }\n\n      form.checkSql(data).then(function (response) {\n        if (response.state) {\n          _this6.isCheckSql = 'suc';\n\n          _this6.$message({\n            type: \"success\",\n            message: response.message\n          });\n        } else {\n          _this6.isCheckSql = 'fail';\n        }\n      });\n    },\n    //设置列弹框保存回调，保存设置列数据\n    saveColumnSetting: function saveColumnSetting(data) {\n      this.prop.displayfield = data.yAxisField;\n      this.prop.xaxisField = data.xAxisField;\n      this.prop.conditionfield = data.conditionField;\n      this.prop.sortfield = data.sortField;\n    },\n    handleExport: function handleExport() {\n      var selection = this.$refs.table.$refs.htTable.selection;\n\n      if (selection && selection.length === 0) {\n        this.$message.warning(\"请选择至少一项记录\");\n        return;\n      }\n\n      var ids = selection.map(function (item) {\n        return item.id;\n      });\n      var url = \"\".concat(window.context.form, \"/form/customChart/v1/exportXml?ids=\").concat(ids);\n      req.download(url);\n    },\n    handleUploadResult: function handleUploadResult(data) {\n      if (data.state) {\n        if (data.message.includes(\"已存在故跳过\")) {\n          this.$message({\n            type: \"warning\",\n            message: data.message,\n            showClose: true,\n            duration: 5000,\n            dangerouslyUseHTMLString: true\n          });\n        } else {\n          this.$message({\n            type: \"success\",\n            message: \"导入成功\"\n          });\n        }\n      } else {\n        this.$message({\n          type: \"error\",\n          message: data.message\n        });\n      }\n\n      this.$refs.table.querys = [];\n      this.$refs.table.load();\n      this.importDialogVisible = false;\n      this.fullscreenLoading = false;\n    },\n    beforeUpload: function beforeUpload(file) {\n      if (!file.name.endsWith(\".zip\")) {\n        this.$message.warning(\"只能导入zip文件!\");\n        return false;\n      }\n\n      this.fullscreenLoading = true;\n    },\n    onExceed: function onExceed(file) {\n      this.$message.warning(\"只能选择一个zip文件!\");\n    },\n    uploadSubmit: function uploadSubmit() {\n      if (!this.$refs.upload.uploadFiles || this.$refs.upload.uploadFiles.length === 0) {\n        this.$message.warning(\"请选择要导入的数据图表!\");\n        return false;\n      }\n\n      this.$refs.upload.submit();\n    }\n  }\n};",null]}