{"remainingRequest":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\bzzgj-fvue\\src\\views\\Device\\deviceManage\\components\\productExtendInfoDialog.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\src\\views\\Device\\deviceManage\\components\\productExtendInfoDialog.vue","mtime":1687946823184},{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import _toConsumableArray from \"D:/jenkins/workspace/bzzgj-fvue/node_modules/@babel/runtime/helpers/esm/toConsumableArray\";\nimport \"core-js/modules/web.dom.iterable\";\nimport \"core-js/modules/es6.string.iterator\";\nimport \"core-js/modules/es6.set\";\nimport \"core-js/modules/es6.regexp.replace\";\nimport \"core-js/modules/es6.number.constructor\";\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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 productExtend from '@/api/device/productExtend.js';\nimport utils from '@/hotent-ui-util.js';\nimport dictUtils from '@/components/dict/DictSelectUtils.js';\nexport default {\n name: 'productExtendInfoDialog',\n data: function data() {\n return {\n activeCollapse: '1',\n visible: false,\n title: '新增',\n params: {\n code: '',\n name: '',\n ctlType: '',\n isRequired: 0,\n layout: null,\n json: '',\n productId: ''\n },\n dialogData: [{}],\n dialogVisible: false,\n TypeList: [],\n kjlxList: [],\n row: {},\n companyType: [],\n //单位类型\n rules: {\n code: [{\n required: true,\n message: '请输入参数代码(英文字母)',\n trigger: 'blur'\n }],\n name: [{\n required: true,\n message: '请输入参数名称',\n trigger: 'blur'\n }],\n ctlType: [{\n required: true,\n message: '请选择控件类型',\n trigger: 'blur'\n }],\n layout: [{\n required: true,\n message: '请输入布局(小于25数字)',\n trigger: 'blur'\n }],\n json: [{\n required: true,\n message: '请输入可选项',\n trigger: 'change'\n }]\n }\n };\n },\n created: function created() {\n this.kjlxList = dictUtils.getDictItemsFromCache('kjlx');\n },\n methods: {\n changeType: function changeType() {\n this.$forceUpdate();\n },\n add: function add(row) {\n console.log(row, 'sssss');\n this.visible = true;\n this.params.productId = row;\n this.dialogData = [{}];\n },\n edit: function edit(row) {\n console.log(row);\n this.row = row;\n this.params = utils.deepClone(row);\n this.params.isRequired = Number(row.isRequired);\n this.visible = true;\n this.title = '修改';\n console.log(row.json);\n\n if (row.json) {\n this.dialogData = JSON.parse(row.json);\n }\n },\n Layout: function Layout() {\n if (this.params.layout < 25 || typeof this.params.layout == 'number') {} else {\n this.params.layout = '';\n }\n },\n inputCode: function inputCode() {\n this.params.code = this.params.code.replace(/[^a-zA-Z]/g, '');\n },\n changeCtl: function changeCtl(val) {\n this.dialogData = [{}];\n },\n addTable: function addTable() {\n this.dialogData.push({});\n },\n removeTable: function removeTable(index) {\n if (this.dialogData.length == 1) {\n this.params.json = '';\n this.dialogData = [{}];\n } else {\n this.dialogData.splice(index, 1);\n }\n },\n handleClose: function handleClose() {\n this.params = {\n code: '',\n name: '',\n ctlType: '',\n isRequired: 0,\n layout: null,\n json: '',\n productId: ''\n };\n this.title = '新增';\n this.activeCollapse = '1';\n this.visible = false;\n },\n handleSave: function handleSave() {\n var _this = this;\n\n // 找到导致重复的元素,ID\n // 将所有对象的ID重新组成数组\n var jsons = true;\n var dtype = true;\n\n if (this.dialogData[0].label || this.dialogData[0].value) {\n var label = this.dialogData.map(function (e) {\n if (e.label == '' || typeof e.label == 'undefined') {\n dtype = false;\n jsons = false;\n\n _this.$message({\n message: '名称不能为空',\n type: 'warning'\n });\n } else {\n return e.label;\n }\n });\n var value = this.dialogData.map(function (v) {\n if (v.value == '' || typeof v.value == 'undefined') {\n dtype = false;\n jsons = false;\n\n _this.$message({\n message: '值不能为空',\n type: 'warning'\n });\n } else {\n return v.value;\n }\n });\n\n if (dtype) {\n // 通过Set去除数组重复项\n var labelSet = new Set(label);\n var valueSet = new Set(value); // 比较两个数组的长度来判断是否存在重复项\n\n if (_toConsumableArray(labelSet).length != label.length) {\n jsons = false;\n this.$message({\n message: '存在相同名称',\n type: 'warning'\n });\n } else if (_toConsumableArray(valueSet).length != value.length) {\n jsons = false;\n this.$message({\n message: '存在相同值',\n type: 'warning'\n });\n } else if (_toConsumableArray(labelSet).length === label.length && _toConsumableArray(valueSet).length === value.length) {\n this.params.json = JSON.stringify(this.dialogData);\n jsons = true;\n this.dialogVisible = false;\n }\n }\n }\n\n this.$refs.formInfo.validate(function (valid) {\n if (valid) {\n var method;\n\n if (jsons) {\n if (_this.title === '新增') {\n method = productExtend.addUnit;\n } else if (_this.title === '修改') {\n method = productExtend.editUnit;\n }\n\n method(_this.params, function (response) {\n console.log(_this.params);\n\n if (response.state) {\n _this.$notify({\n type: 'success',\n message: _this.title + '成功',\n duration: 2000\n });\n\n _this.handleClose();\n\n console.log(_this);\n\n _this.$parent.loadData(1);\n } else {\n _this.$message.warning(response.message);\n }\n });\n }\n }\n });\n }\n }\n};",null]}