{"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\\TableDesign\\CreateView.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\src\\views\\form\\TableDesign\\CreateView.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/es6.function.name\";\nimport \"core-js/modules/es7.array.includes\";\nimport \"core-js/modules/es6.string.includes\";\nimport \"core-js/modules/es6.string.ends-with\";\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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 req from '@/request';\nimport { mapState } from 'vuex';\nexport default {\n  data: function data() {\n    return {\n      data: [],\n      pageResult: {\n        page: 0,\n        pageSize: 50,\n        total: 0\n      },\n      selectedId: '',\n      deleteUrl: window.context.form + '/form/viewManage/v1/remove',\n      dialogVisible: false,\n      loadDataUrl: '',\n      model: {},\n      dataSources: [],\n      isChecked: false,\n      content: '请输入符合生成视图的SQL，如联表查询时存在重复字段将会导致验证通过但最后保存并生成视图时出错！',\n      checkState: false,\n      importDialogVisible: false,\n      uploadUrl: window.context.form + '/form/viewManage/v1/import',\n      fullscreenLoading: false,\n      viewNameValidate: {\n        required: true,\n        alpha_dash: true,\n        regex: {\n          exp: '^[a-zA-Z][a-zA-Z0-9_]*$',\n          message: '只能输入字母、数字、下划线，且以字母开头'\n        }\n      }\n    };\n  },\n  computed: mapState({\n    uploadHeaders: function uploadHeaders(mapState) {\n      return {\n        Authorization: 'Bearer ' + mapState.login.currentUser.token\n      };\n    }\n  }),\n  mounted: function mounted() {\n    var _this = this;\n\n    form.getDataSource().then(function (resp) {\n      _this.dataSources = resp.data;\n    });\n  },\n  methods: {\n    rowClick: function rowClick(row, column, event) {\n      this.$refs.htTable.$refs.htTable.toggleRowSelection(row);\n    },\n    checkSql: function checkSql() {\n      var _this2 = this;\n\n      if (!this.model.sql) {\n        this.$message({\n          type: 'warning',\n          message: '请输入sql语句'\n        });\n        return;\n      }\n\n      if (!this.model.dsAlias) {\n        this.$message({\n          type: 'warning',\n          message: '请选择数据源'\n        });\n        return;\n      }\n\n      if (this.model.sql.endsWith(';')) {\n        this.$message({\n          type: 'warning',\n          message: '请不要以;结尾'\n        });\n        return;\n      }\n\n      var param = {\n        sql: this.model.sql,\n        dsName: this.model.dsAlias\n      };\n      form.checkSql(param).then(function (response) {\n        if (response.state) {\n          _this2.$message({\n            type: 'success',\n            message: response.message\n          });\n\n          _this2.checkState = response.state;\n        }\n      });\n    },\n    loadData: function loadData(param, cb) {\n      var _this3 = this;\n\n      form.getViewManageList(param).then(function (response) {\n        _this3.data = response.rows;\n        _this3.pageResult = {\n          page: response.page,\n          pageSize: response.pageSize,\n          total: response.total\n        };\n      }).finally(function () {\n        cb();\n      });\n    },\n    edit: function edit(id) {\n      this.dialogVisible = true;\n\n      if (id) {\n        this.loadDataUrl = \"/form/viewManage/v1/getJson?id=\".concat(id);\n      } else {\n        this.model = {};\n        this.loadDataUrl = '';\n      }\n    },\n    afterLoadData: function afterLoadData(data) {\n      this.model = data;\n    },\n    beforeSaveData: function beforeSaveData() {\n      if (!this.checkState) {\n        this.$message({\n          type: 'warning',\n          message: '请先验证SQL！'\n        });\n      }\n    },\n    afterSaveData: function afterSaveData() {\n      this.dialogVisible = false;\n      this.checkState = false;\n      this.$refs.htTable.load();\n    },\n    handleClose: function handleClose() {\n      this.dialogVisible = false;\n    },\n    createPhysicalView: function createPhysicalView(id) {\n      var _this4 = this;\n\n      form.createPhysicalViewByViewMngId(id).then(function (response) {\n        if (response.state) {\n          _this4.$message({\n            type: 'success',\n            message: response.message\n          });\n\n          _this4.$refs.htTable.load();\n        }\n      });\n    },\n    handleExport: function handleExport() {\n      var selection = this.$refs.htTable.$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/viewManage/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.htTable.querys = [];\n      this.$refs.htTable.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    dsChange: function dsChange(dsAlias, dataSource) {\n      if (!dsAlias || dataSource.dbType !== 'oracle' && dataSource.dbType !== 'dm' && dataSource.dbType !== 'dm8') {\n        this.viewNameValidate = {\n          required: true,\n          alpha_dash: true,\n          regex: {\n            exp: '^[a-zA-Z][a-zA-Z0-9_]*$',\n            message: '只能输入字母、数字、下划线，且以字母开头'\n          }\n        };\n      } else {\n        this.viewNameValidate = {\n          required: true,\n          alpha_dash: true,\n          regex: {\n            exp: '^[A-Z][A-Z0-9_]*$',\n            message: '只能输入大写字母、数字、下划线，且以大写字母开头'\n          }\n        };\n      }\n    },\n    handleSqlChange: function handleSqlChange() {\n      this.checkState = false;\n    }\n  }\n};",null]}