{"remainingRequest":"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\\productManageDialog.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\src\\views\\Device\\deviceManage\\components\\productManageDialog.vue","mtime":1687946823184},{"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":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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 productManage from '@/api/device/productManage.js'\nimport dictUtils from '@/components/dict/DictSelectUtils.js'\nimport utils from '@/hotent-ui-util.js'\nimport IconDialog from '@/components/dialog/IconDialog.vue'\nimport IconPanl from '@/components/selector/IconPanl.vue'\nimport {\n\tmapState\n} from 'vuex'\nexport default {\n\tname: 'productManageModal',\n\tcomponents: {\n\t IconDialog,\n\t\tIconPanl,\n\t},\n\tdata() {\n\t\treturn {\n\t\t\tvisible: false,\n\t\t\tisSaved: false,\n\t\t\ttitle: '新增',\n\t\t\tparams: {\n\t\t\t\tname: '', //设备名称\n\t\t\t\tisIntellect: '', //智能分类\n\t\t\t\ttypeId: '', //产品分类ID\n\t\t\t\tdeviceType: '', //设备类型\n\t\t\t\tcode: '', //产品编码\n\t\t\t\tmemo: '', //备注\n\t\t\t\tid: null,\n\t\t\t\tfullName: '',\n\t\t\t\ticon: '',\n\t\t\t},\n\t\t\tpreviewUrl: window.context.portal + '/file/onlinePreviewController/v1/getFileById_',\n\t\t\tuploadUrl: window.context.portal + '/file/v1/fileUpload', // 服务器上传地址\n\t\t\ticon: '',\n\t\t\tactiveCollapse1: '1',\n\t\t\tctlTypeList: '',\n\t\t\tactive: 1,\n\t\t\tdeviceTypeList: [], //设备类型字段列表\n\t\t\tisIntellectList: [], //智能分类字段列表\n\t\t\trules: {\n\t\t\t\tname: [{\n\t\t\t\t\trequired: true,\n\t\t\t\t\tmessage: '请输入产品名称',\n\t\t\t\t\ttrigger: 'blur',\n\t\t\t\t}, ],\n\t\t\t\tisIntellect: [{\n\t\t\t\t\trequired: true,\n\t\t\t\t\tmessage: '请选择智能分类',\n\t\t\t\t\ttrigger: 'blur',\n\t\t\t\t}, ],\n\t\t\t\tcode: [{\n\t\t\t\t\trequired: true,\n\t\t\t\t\tmessage: '请输入产品编码',\n\t\t\t\t\ttrigger: 'blur',\n\t\t\t\t}, ],\n\t\t\t\tdeviceType: [{\n\t\t\t\t\trequired: true,\n\t\t\t\t\tmessage: '请选择设备类型',\n\t\t\t\t\ttrigger: 'blur',\n\t\t\t\t}, ],\n\t\t\t},\n\t\t}\n\t},\n\tcreated() {\n\t\tthis.deviceTypeList = dictUtils.getDictItemsFromCache('sblx')\n\t\tthis.ctlTypeList = dictUtils.getDictItemsFromCache('kjlx')\n\t\tthis.isIntellectList = dictUtils.getDictItemsFromCache('znfl')\n\t},\n\tmounted() {},\n\tcomputed: mapState({\n\t\theader: (state) => {\n\t\t\treturn {\n\t\t\t\tAuthorization: `Bearer ${state.login.currentUser.token}`,\n\t\t\t}\n\t\t},\n\t}),\n\tmethods: {\n\t\tclearIcon() {\n\t\t\tthis.params.icon = ''\n\t\t},\n\t\tchoseIcon(icon) {\n\t\t this.params.icon = icon\n\t\t},\n\t\thandleAvatarSuccess(res, file) {\n\t\t\tthis.$set(this.params, 'icon', res.fileId)\n\t\t\tthis.icon = this.previewUrl + res.fileId\n\t\t},\n\t\tbeforeAvatarUpload(file) {\n\t\t\tconst isJPG =\n\t\t\t\tfile.type === 'image/jpeg' ||\n\t\t\t\tfile.type === 'image/png' ||\n\t\t\t\tfile.type === 'image/jpg'\n\t\t\tconst isLt1M = file.size / 1024 / 1024 < 1\n\t\t\tif (!isJPG) {\n\t\t\t\tthis.$message.error('上传图片只能是 JPG 格式!')\n\t\t\t}\n\t\t\tif (!isLt1M) {\n\t\t\t\tthis.$message.error('上传图片大小不能超过 1MB!')\n\t\t\t}\n\t\t\treturn isJPG && isLt1M\n\t\t},\n\t\tadd(userRow) {\n\t\t\tthis.params.fullName = userRow.fullName\n\t\t\tthis.params.typeId = userRow.id\n\t\t\tthis.params.deviceType = this.deviceTypeList[0].value\n\t\t\tthis.params.isIntellect = this.isIntellectList[0].value\n\t\t\tthis.visible = true\n\t\t},\n\t\t// 保存产品信息\n\t\thandleSave() {\n\t\t\tthis.isSaved = true\n\t\t\tthis.$refs.formInfo.validate((valid) => {\n\t\t\t\tif (valid) {\n\t\t\t\t\tif (this.title === '新增') {\n\t\t\t\t\t\tproductManage.addProductInfo(this.params).then((response) => {\n\t\t\t\t\t\t\tconsole.log(this.params)\n\t\t\t\t\t\t\tif (response.state) {\n\t\t\t\t\t\t\t\tthis.$notify({\n\t\t\t\t\t\t\t\t\ttype: 'success',\n\t\t\t\t\t\t\t\t\tmessage: '新增成功',\n\t\t\t\t\t\t\t\t\tduration: 2000,\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\tthis.handleClose()\n\t\t\t\t\t\t\t\tthis.$emit('reload')\n\t\t\t\t\t\t\t} else {}\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t\tif (this.title === '修改') {\n\t\t\t\t\t\tproductManage.updateProductInfo(this.params).then((response) => {\n\t\t\t\t\t\t\tif (response.state) {\n\t\t\t\t\t\t\t\tthis.$notify({\n\t\t\t\t\t\t\t\t\ttype: 'success',\n\t\t\t\t\t\t\t\t\tmessage: '修改成功',\n\t\t\t\t\t\t\t\t\tduration: 2000,\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\tthis.handleClose()\n\t\t\t\t\t\t\t\tthis.$emit('reload')\n\t\t\t\t\t\t\t} else {}\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis.$notify({\n\t\t\t\t\t\ttype: 'warning',\n\t\t\t\t\t\tmessage: \"请完善表单信息!\",\n\t\t\t\t\t\tduration: 2000,\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\t\tedit(row) {\n\t\t\tthis.params = utils.deepClone(row)\n\t\t\tconsole.log(this.params)\n\t\t\tthis.params.id = row.id\n\t\t\tthis.visible = true\n\t\t\tthis.title = '修改'\n\t\t\t// 根据id查询产品信息\n\t\t\tif (this.title === '修改') {\n\t\t\t\tproductManage.productTypeDetail(row.typeId).then((res) => {\n\t\t\t\t\tconsole.log(res)\n\t\t\t\t\tthis.params.fullName = res.name\n\t\t\t\t})\n\t\t\t}\n\t\t},\n\t\t// 关闭新增人员窗口\n\t\thandleClose() {\n\t\t\t;\n\t\t\t(this.params = {\n\t\t\t\tname: '', //设备名称\n\t\t\t\tisIntellect: '', //智能分类\n\t\t\t\ttypeId: '', //产品分类ID\n\t\t\t\tdeviceType: '', //设备类型\n\t\t\t\tcode: '', //产品编码\n\t\t\t\tmemo: '', //备注\n\t\t\t\tid: null,\n\t\t\t\tfullName: '',\n\t\t\t\ticon: '',\n\t\t\t}),\n\t\t\t(this.title = '新增')\n\t\t\tthis.visible = false\n\t\t\tthis.activeCollapse1 = '1'\n\t\t},\n\t},\n}\n",null]}