{"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\\LowerDictModal.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\src\\views\\system\\SysDict\\LowerDictModal.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.object.values\";\nimport \"regenerator-runtime/runtime\";\nimport _asyncToGenerator from \"D:/jenkins/workspace/xq-web-bpm/node_modules/@babel/runtime/helpers/esm/asyncToGenerator\";\nimport \"core-js/modules/es6.array.find\";\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//\nimport portal from '@/api/portal';\nexport default {\n name: 'LowerDictModal',\n components: {},\n props: {\n lowerDictParams: {\n type: Object\n }\n },\n data: function data() {\n return {\n upperDictId: '',\n //设置级联的字典id\n dictItemId: '',\n // 设置级联的字典项id\n load: false,\n visible: false,\n type: '',\n // \"setting\" ,\"search\"\n defaultQuerys: [{\n property: 'id_',\n value: '',\n operation: 'NOT_EQUAL'\n }, {\n property: 'flag_',\n value: 1,\n operation: 'EQUAL'\n }],\n querySearch: [{\n label: '名称',\n prop: 'name_'\n }, {\n label: '编码',\n prop: 'code_'\n }],\n dictData: [],\n selectItemData: [],\n pageResult: {\n page: 1,\n pageSize: 20,\n total: 0\n },\n selectItemTableHeight: 320,\n currentDictId: '',\n // 左侧当前选中字典的id值\n quickSearchPlaceholder: '请输入字典名称进行查询',\n sectionObj: {// key 是字典id 值是选中的字典项的id的数组\n }\n };\n },\n methods: {\n loadData: function loadData(param, cb) {\n var _this = this;\n\n this.load = true;\n\n if (this.type == 'search') {\n var _param = this.qs.stringify({\n detailId: this.dictItemId\n });\n\n portal.loadSetLowerDict(_param).then(function (resp) {\n var response = resp;\n _this.dictData = response;\n\n _this.$nextTick(function () {\n _this.selectItemTableHeight = _this.$refs.htTable.$refs.htTable.maxHeight;\n });\n\n _this.load = false;\n }).finally(function () {\n return cb();\n });\n } else {\n portal.loadDictList(param).then(function (resp) {\n var response = resp;\n _this.dictData = response.rows;\n\n _this.$nextTick(function () {\n _this.selectItemTableHeight = _this.$refs.htTable.$refs.htTable.maxHeight;\n });\n\n _this.load = false;\n _this.pageResult = {\n page: response.page,\n pageSize: response.pageSize,\n total: response.total\n };\n }).finally(function () {\n return cb();\n });\n }\n },\n rowClick: function rowClick(row, column, event) {\n var _this2 = this;\n\n this.currentDictId = row.id;\n console.log(row, column);\n this.$refs.htTable.$refs.htTable.toggleRowSelection(row);\n this.qs.stringify({\n id: row.id\n });\n\n if (this.type == 'search') {\n this.loadSetLowerDictItem();\n } else {\n var data = {\n dictionaryId: row.id,\n flag: 1\n };\n portal.queryDictDetail(data).then(function (res) {\n console.log(res, 'res');\n _this2.selectItemData = res;\n\n _this2.toggeRowSelection();\n });\n }\n },\n toggeRowSelection: function toggeRowSelection() {\n var _this3 = this;\n\n var selected = this.sectionObj[this.currentDictId];\n\n if (selected) {\n this.$nextTick(function () {\n selected.forEach(function (row) {\n _this3.$refs.selectTable.toggleRowSelection(_this3.selectItemData.find(function (item) {\n return row.id == item.id; // 注意这里寻找的字段要唯一\n }), true);\n });\n });\n }\n },\n selectionChange: function selectionChange(selection) {\n this.sectionObj[this.currentDictId] = selection;\n console.log(selection, 'selection');\n console.log(this.sectionObj);\n },\n setCurrent: function setCurrent(row) {\n this.$refs.singleTable.setCurrentRow(row);\n },\n quickSearch: function quickSearch() {},\n open: function open(row, type, upperDictId) {\n var _this4 = this;\n\n this.type = type;\n this.defaultQuerys[0].value = upperDictId;\n this.upperDictId = upperDictId;\n this.dictItemId = row.id;\n this.visible = true;\n this.$nextTick(function () {\n _this4.$refs.htTable.load();\n });\n },\n close: function close() {\n this.beforeClose();\n this.visible = false;\n },\n handleClickRow: function handleClickRow(record) {\n var _this5 = this;\n\n return {\n on: {\n click: function () {\n var _click = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {\n var keys;\n return regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n keys = [];\n keys.push(record.id);\n _this5.selectedRowKeys = keys;\n\n if (!(_this5.fromUpperDict.type == 'add')) {\n _context.next = 9;\n break;\n }\n\n _context.next = 6;\n return _this5.loadDictItem(_this5.selectedRowKeys);\n\n case 6:\n _this5.itemDataSource = _context.sent;\n _context.next = 12;\n break;\n\n case 9:\n _context.next = 11;\n return _this5.loadAddedDictItem(_this5.selectedRowKeys[0]);\n\n case 11:\n _this5.itemDataSource = _context.sent;\n\n case 12:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n\n function click() {\n return _click.apply(this, arguments);\n }\n\n return click;\n }()\n }\n };\n },\n rowClassName: function rowClassName() {\n return 'row-class-name';\n },\n beforeClose: function beforeClose() {\n this.upperDictId = '';\n this.defaultQuerys[0].value = '';\n this.currentDictId = '';\n this.type = '';\n this.dictData = [];\n this.selectItemData = [];\n this.sectionObj = {};\n },\n // 保存下级字典\n saveLowerDict: function saveLowerDict() {\n var _this6 = this;\n\n if (this.type == 'setting') {\n var ids = [];\n Object.values(this.sectionObj).forEach(function (selections) {\n selections.forEach(function (item) {\n ids.push(item.id);\n });\n });\n\n if (!ids.length) {\n this.$message.warning(\"请选择级联字典及对应字典项\");\n return;\n }\n\n var params = this.qs.stringify({\n detailId: this.dictItemId,\n lowerDetailIds: ids.join(','),\n lowerDictId: this.currentDictId\n });\n portal.saveDictLowerDetails(params).then(function () {\n _this6.$message.success('字典级联设置成功');\n\n _this6.beforeClose();\n\n _this6.visible = false;\n }).catch(function (err) {\n _this6.$message.success('字典级联设置失败');\n });\n } else {\n this.close();\n }\n },\n // 查看\n loadSetLowerDictItem: function loadSetLowerDictItem() {\n var _this7 = this;\n\n var data = this.qs.stringify({\n detailId: this.dictItemId,\n dictLowerId: this.currentDictId\n }); // 查看已设置下级字典项\n\n portal.loadSetLowerDictItem(data).then(function (res) {\n console.log(res, 'res');\n _this7.selectItemData = res;\n });\n },\n // 删除已设置的级联字典\n deleteDictItem: function deleteDictItem(id) {\n var _this8 = this;\n\n var data = this.qs.stringify({\n detailId: this.dictItemId,\n lowerDetailIds: id\n }); // 查看已设置下级字典\n\n portal.delLowerDetails(data).then(function (res) {\n _this8.loadSetLowerDictItem();\n\n _this8.$message.success('删除成功');\n });\n }\n }\n};",null]}