{"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\\system\\SysDict\\SysDict.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\src\\views\\system\\SysDict\\SysDict.vue","mtime":1675071993210},{"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.array.includes\";\nimport \"regenerator-runtime/runtime\";\nimport _asyncToGenerator from \"D:/jenkins/workspace/xq-web-bpm/node_modules/@babel/runtime/helpers/esm/asyncToGenerator\";\nimport _toConsumableArray from \"D:/jenkins/workspace/xq-web-bpm/node_modules/@babel/runtime/helpers/esm/toConsumableArray\";\nimport \"core-js/modules/es6.array.sort\";\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//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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 portal from '@/api/portal';\nimport LowerDictModal from \"./LowerDictModal.vue\";\nimport tenant from '@/store/tenant';\nimport user from '@/store/user';\n\nvar htAsideTree = function htAsideTree() {\n return import('@/components/common/HtAsideTree.vue');\n};\n\nvar htSysTypeTree = function htSysTypeTree() {\n return import('@/components/common/HtSysTypeTree.vue');\n};\n\nexport default {\n components: {\n htAsideTree: htAsideTree,\n LowerDictModal: LowerDictModal,\n htSysTypeTree: htSysTypeTree\n },\n data: function data() {\n return {\n tableHeight: 'calc(100vh - 318px)',\n dictItem: [],\n dialogVisible: false,\n filtersOptions: [{\n value: -1,\n text: '草稿'\n }, {\n value: 1,\n text: '启用'\n }, {\n value: 0,\n text: '禁用'\n }],\n data: [],\n querySearch: [{\n label: '名称',\n prop: 'name_'\n }, {\n label: '编码',\n prop: 'code_'\n }],\n pageResult: {\n page: 1,\n pageSize: 50,\n total: 0\n },\n options: {\n kindId: [{\n code: 1,\n desc: '系统字典'\n }, {\n code: 2,\n desc: '租户字典'\n }]\n },\n PortalSysDictionary: {\n name: '',\n code: '',\n kindId: 1,\n memo: '',\n details: [],\n treeId: ''\n },\n saveMethod: 'POST',\n multipleSelection: [],\n dictSelection: [],\n defaultQuerys: [],\n parantTreeId: '',\n // 移动字典\n moveDialog: false,\n moveDictionary: {},\n moveTreeId: '',\n currentDictId: '',\n snChange: null,\n tenantId: undefined,\n // -1 是超管,\n changeTree: false\n };\n },\n mounted: function mounted() {\n this.$validator = this.$root.$validator;\n },\n methods: {\n // 树的点击回调 查询列表\n handleNodeClick: function handleNodeClick(node) {\n this.changeTree = true;\n\n if (node.parentId != 0) {\n this.$set(this.defaultQuerys, 0, {\n property: 'TREE_ID_',\n value: node.id,\n operation: 'EQUAL'\n });\n this.parantTreeId = node.id;\n } else {\n //清空旧的查询值\n this.defaultQuerys.splice(0);\n this.parantTreeId = '';\n }\n\n this.$refs.htTable.load();\n },\n // 加载字典\n loadData: function loadData(param, cb) {\n var _this = this;\n\n console.log(param, 'param');\n\n if (this.changeTree && this.parantTreeId) {\n param.querys = [{\n property: 'TREE_ID_',\n value: this.parantTreeId,\n operation: 'EQUAL'\n }];\n } else if (this.changeTree && !this.parantTreeId) {\n param.querys = [];\n }\n\n portal.loadDictList(param).then(function (resp) {\n var response = resp;\n _this.data = response.rows;\n _this.pageResult = {\n page: response.page,\n pageSize: response.pageSize,\n total: response.total\n };\n _this.changeTree = false;\n }).finally(function () {\n return cb();\n });\n },\n // 新增编辑\n showDialog: function showDialog(id) {\n if (user.state.currentUserDetail && user.state.currentUserDetail.user) {\n this.tenantId = user.state.currentUserDetail.user.tenantId;\n }\n\n if (id) {\n this.currentDictId = id;\n this.loadDictItem();\n } else {\n if (!this.parantTreeId) {\n this.$message.warning('请先选择左侧添加的父节点!');\n } else {\n this.dialogVisible = true;\n }\n }\n },\n // 更新状态\n handleDictFlag: function handleDictFlag(flag) {\n var _this2 = this;\n\n // this.dictSelection 选中的数据\n if (!this.dictSelection.length) {\n this.$message.warning(\"\\u8BF7\\u9009\\u62E9\\u8981\".concat(flag, \"\\u7528\\u7684\\u6570\\u636E\"));\n return;\n } else {\n var msg = \"\\u786E\\u5B9A\".concat(flag, \"\\u7528\\u9009\\u4E2D\\u6570\\u636E\\u5417?\");\n this.$confirm(msg, '提示', {\n confirmButtonText: '确定',\n cancelButtonText: '取消',\n type: 'warning'\n }).then(function () {\n var ids = [];\n\n _this2.dictSelection.forEach(function (item) {\n ids.push(item.id);\n });\n\n var param = _this2.qs.stringify({\n status: flag == '启' ? 1 : 0,\n ids: ids.join(',')\n }); // 调用接口 提交数据\n\n\n portal.updateDictionariesStatus(param).then(function (res) {\n _this2.dictSelection = [];\n\n _this2.$refs.htTable.load();\n });\n }).catch(function () {\n _this2.$message({\n type: 'info',\n message: \"\\u5DF2\\u53D6\\u6D88\".concat(flag ? '启用' : '禁用')\n });\n });\n }\n },\n // 清空选择项\n afterDelete: function afterDelete() {\n this.dictSelection = [];\n },\n // 选择字典回调\n selectDict: function selectDict(selection, row) {\n this.dictSelection = selection;\n },\n // 获取字典子表 --字典项\n loadDictItem: function loadDictItem() {\n var _this3 = this;\n\n var data = this.qs.stringify({\n id: this.currentDictId\n });\n portal.loadDictionaryById(data).then(function (resp) {\n _this3.PortalSysDictionary = resp;\n\n if (_this3.PortalSysDictionary.details.length) {\n _this3.PortalSysDictionary.details.sort(function (a, b) {\n return a.sn - b.sn;\n });\n\n _this3.PortalSysDictionary.details.forEach(function (item, index) {\n item.key = new Date().getTime() + index;\n });\n\n _this3.dictItem = _toConsumableArray(_this3.PortalSysDictionary.details);\n }\n\n _this3.dialogVisible = true;\n }, function (error) {\n reject(error);\n });\n },\n // 子表改变排序号\n changeSN: function changeSN(row) {\n if (this.snChange == null) {\n this.snChange = {};\n this.snChange[row.id] = row.sn;\n } else {\n this.snChange[row.id] = row.sn;\n }\n\n console.log(this.snChange);\n },\n // 同步缓存\n handleSyncRedis: function handleSyncRedis() {\n var _this4 = this;\n\n portal.syncDictionaryRedis().then(function (resp) {\n _this4.$message.success(resp.message);\n }).catch(function (err) {\n _this4.$message.warning(err);\n });\n },\n // 移动字典\n handleMoveDict: function handleMoveDict() {\n if (!this.dictSelection.length) {\n this.$message.warning(\"\\u8BF7\\u9009\\u62E9\\u8981\\u79FB\\u52A8\\u7684\\u5B57\\u5178\");\n return;\n } else {\n this.moveDialog = true;\n }\n },\n beforeCloseMoveDialog: function beforeCloseMoveDialog() {\n this.moveTreeId = '';\n this.moveDialog = false;\n },\n MoveDict: function MoveDict() {\n var _this5 = this;\n\n if (!this.moveTreeId) {\n this.$message.warning(\"\\u8BF7\\u9009\\u62E9\\u79FB\\u52A8\\u7684\\u76EE\\u6807\\u5B57\\u5178\\u76EE\\u5F55\");\n return;\n }\n\n var ids = [];\n this.dictSelection.forEach(function (item) {\n ids.push(item.id);\n });\n var data = this.qs.stringify({\n treeId: this.moveTreeId,\n ids: ids.join(',')\n });\n portal.moveDictionaries(data).then(function (res) {\n _this5.moveTreeId = '';\n _this5.moveDialog = false;\n _this5.dictSelection = [];\n\n _this5.$refs.htTable.load();\n }).catch(function (err) {\n _this5.$message.warning(err);\n });\n },\n handleMoveTreeClick: function handleMoveTreeClick(node) {\n console.log(node);\n\n if (node.parentId != 0) {\n this.moveTreeId = node.id;\n } else {\n this.moveTreeId = '';\n }\n },\n // 子表验证\n checkRepeat: function checkRepeat(value, column, currentItem) {\n var _this6 = this;\n\n return new Promise(function (resolve) {\n var Temp = _this6.dictItem.filter(function (item) {\n return item.key != currentItem.key;\n });\n\n if (Temp.length) {\n Temp.forEach(function (item) {\n if (item[column] == value) {\n resolve(false);\n }\n });\n resolve(true);\n } else {\n resolve(true);\n }\n });\n },\n // 提交验证\n beforeSaveData: function () {\n var _beforeSaveData = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {\n var TempArr;\n return regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n console.log(this.dictItem, this.tenantId);\n\n if (this.dictItem.length) {\n // this.checkDictItem();\n TempArr = _toConsumableArray(this.dictItem);\n TempArr.forEach(function (item) {\n delete item.key;\n });\n this.PortalSysDictionary.details = TempArr;\n }\n\n console.log(this.dictItem, 'beforeSaveData');\n\n if (!this.PortalSysDictionary.treeId) {\n this.PortalSysDictionary.treeId = this.parantTreeId;\n }\n\n console.log(tenant);\n\n if (tenant.state.tenantId) {\n this.PortalSysDictionary.tenantId = tenant.state.tenantId;\n } // 超管默认添加系统字典,其他默认是租户字典\n\n\n this.PortalSysDictionary.kindId = this.tenantId == '-1' ? 1 : 2;\n this.isSubmit = true;\n\n case 8:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n\n function beforeSaveData() {\n return _beforeSaveData.apply(this, arguments);\n }\n\n return beforeSaveData;\n }(),\n handleAdd: function handleAdd() {\n var length = this.dictItem.length;\n var dictionaryId = '';\n\n if (this.PortalSysDictionary && this.PortalSysDictionary.id) {\n dictionaryId = this.PortalSysDictionary.id;\n }\n\n this.dictItem.push({\n dictionaryId: dictionaryId,\n name: '',\n value: '',\n sn: length + 1,\n flag: -1,\n key: new Date().getTime() + length\n });\n },\n handleDictItemDel: function handleDictItemDel() {\n var _this7 = this;\n\n // 非草稿状态不可删除\n // 区别有id 没得id\n if (!this.multipleSelection.length) {\n this.$message.warning('请选择要删除得数据');\n return;\n } else {\n // 过滤出草稿状态得数据\n var initDictItem = this.multipleSelection.filter(function (item) {\n return item.flag == -1;\n });\n\n if (!initDictItem.length) {\n this.$message.warning('启用或禁用状态的数据,不可删除!');\n } else {\n var msg = '如存在未保存的字典成员,请先保存!如继续此操作未保存的编辑将被删除,是否继续?';\n this.$confirm(msg, '提示', {\n confirmButtonText: '确定',\n cancelButtonText: '取消',\n type: 'warning'\n }).then(function () {\n // 收集已提交的数据id\n var ids = [],\n keys = [];\n initDictItem.forEach(function (item) {\n keys.push(item.key);\n\n if (item.id) {\n ids.push(item.id);\n }\n }); // 本地删除草稿的数据\n\n var dataSource = _toConsumableArray(_this7.dictItem);\n\n var dataTemp = dataSource.filter(function (item) {\n return !keys.includes(item.key);\n });\n _this7.dictItem = dataTemp;\n\n if (ids.length > 0) {\n // 提交数据\n var params = _this7.qs.stringify({\n ids: ids.join(',')\n });\n\n portal.deleteDictItem(params).then(function () {\n _this7.loadDictItem();\n\n _this7.$message.success('删除成功');\n });\n }\n }).catch(function () {\n _this7.$message({\n type: 'info',\n message: \"\\u5DF2\\u53D6\\u6D88\\u5220\\u9664\"\n });\n });\n }\n }\n },\n handleDictItemFlag: function handleDictItemFlag(status) {\n var _this8 = this;\n\n this.multipleSelection.forEach(function (item) {\n item.keys;\n });\n var hasNoSave = false;\n\n if (this.multipleSelection.length <= 0) {\n this.$message.warning('请选择至少一条数据!');\n return;\n } else {\n var ids = [];\n this.multipleSelection.forEach(function (item) {\n if (!item.id) {\n hasNoSave = true;\n return;\n }\n\n ids.push(item.id);\n });\n\n if (ids.length <= 0) {\n this.$message.warning('所选数据未保存,不能进行该操作!');\n return;\n }\n\n var query = {\n ids: ids.join(','),\n status: status\n };\n var param = this.qs.stringify(query, {\n indices: false\n });\n var tag = status ? '启' : '禁';\n var msg;\n\n if (hasNoSave) {\n msg = '存在未保存的字段成员,请先保存!如继续此操作未保存的编辑将被清除,是否继续?';\n } else {\n msg = \"\\u786E\\u5B9A\".concat(tag, \"\\u7528\\u9009\\u4E2D\\u6570\\u636E,\\u662F\\u5426\\u7EE7\\u7EED?\");\n }\n\n this.$confirm(msg, '提示', {\n confirmButtonText: '确定',\n cancelButtonText: '取消',\n type: 'warning'\n }).then(function () {\n // 调用接口 提交数据\n portal.updateDictItemStatus(param).then(function () {\n _this8.loadDictItem();\n\n _this8.$message.success(\"\".concat(status ? '启用' : '禁用', \"\\u6210\\u529F\"));\n });\n }).catch(function () {\n _this8.$message({\n type: 'info',\n message: \"\\u5DF2\\u53D6\\u6D88\".concat(status ? '启用' : '禁用')\n });\n });\n }\n },\n handleIndex: function handleIndex() {\n var _this9 = this;\n\n if (this.snChange == null) {\n this.$message.warning('字典项排序号无更改');\n } else {\n portal.updateDictItemSequence(this.snChange).then(function () {\n _this9.loadDictItem();\n\n _this9.$message.success('排序号更新成功!');\n });\n }\n },\n // 子表的选择回调\n handleSelectionChange: function handleSelectionChange(val) {\n this.multipleSelection = val;\n },\n // 打开级联字典弹窗\n loadSub: function loadSub(row, type) {\n console.log(row, type);\n this.$refs.lowerDict.open(row, type, this.currentDictId);\n },\n // 关闭前重置状态\n beforeCloseDialog: function beforeCloseDialog() {\n this.PortalSysDictionary = {\n kindId: 1,\n name: '',\n code: '',\n memo: '',\n details: [],\n treeId: ''\n };\n this.dictItem = [];\n this.currentDictId = '';\n this.dialogVisible = false;\n },\n afterSaveData: function afterSaveData(close) {\n var _this10 = this;\n\n setTimeout(function () {\n if (close) {\n _this10.beforeCloseDialog();\n } else {\n _this10.loadDictItem();\n }\n\n _this10.$refs.htTable.load();\n }, 0);\n },\n GetResponseValue: function GetResponseValue(value) {\n this.currentDictId = value;\n }\n }\n};",null]}