{"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\\modle\\BasicInformationDialog.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\src\\views\\Device\\deviceManage\\components\\modle\\BasicInformationDialog.vue","mtime":1687336502346},{"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\nimport productManage from '@/api/device/productManage.js'\nimport dictUtils from '@/components/dict/DictSelectUtils.js'\nimport IconDialog from '@/components/dialog/IconDialog.vue'\nimport IconPanl from '@/components/selector/IconPanl.vue'\nimport {\n\tmapState\n} from 'vuex'\nimport utils from '@/hotent-ui-util.js'\nexport default {\n\tprops: {\n\t\tparameter: {\n\t\t\ttype: Object,\n\t\t\tdefault: function() {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t},\n\tname: 'BasicInformationDialog',\n\tcomponents: {\n\t IconDialog,\n\t\tIconPanl,\n\t},\n\tdata() {\n\t\treturn {\n\t\t\tvisible: false,\n\t\t\ttitle: '新增',\n\t\t\tactiveCollapse1: '1',\n\t\t\tctlTypeList: '',\n\t\t\tactive: 1,\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\tdeviceTypeList: [], //设备类型字段列表\n\t\t\tisIntellectList: [], //智能分类字段列表\n\t\t\ttypeOptions: [], //产品分类数据\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\tthis.icon = this.previewUrl + this.parameter.icon\n\n\t},\n\tmounted() {\n\t\tthis.treeType()\n\t},\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.parameter.icon = ''\n\t\t},\n\t\tchoseIcon(icon) {\n\t\t this.parameter.icon = icon\n\t\t},\n\t\thandleAvatarSuccess(res, file) {\n\t\t\tconsole.log(res.fileId)\n\t\t\tconsole.log(this.previewUrl + res.fileId)\n\t\t\tthis.$set(this.parameter, '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() {\n\t\t\tthis.visible = true\n\t\t\tconsole.log(this.parameter, 'ppppppppp');\n\t\t\tthis.icon = this.previewUrl + this.parameter.icon\n\t\t},\n\t\ttreeType() {\n\t\t\tproductManage.productType().then(res => {\n\t\t\t\tthis.typeOptions = res.value\n\t\t\t})\n\t\t},\n\t\thandleChange(type) {\n\t\t\tif (type == 'fullName') {\n\t\t\t\tlet nodes = this.$refs.cascader.getCheckedNodes()\n\t\t\t\tconsole.log(nodes);\n\t\t\t\tif (nodes && nodes.length > 0) {\n\t\t\t\t\tthis.parameter.typeId = nodes[0].data.id\n\t\t\t\t\tthis.parameter.fullId = nodes[0].data.fullId\n\t\t\t\t\tthis.parameter.fullName = nodes[0].data.fullName\n\t\t\t\t} else {\n\t\t\t\t\tthis.$refs.cascader.$refs.panel.clearCheckedNodes()\n\t\t\t\t\tthis.$refs.cascader.$refs.panel.checkedValue = '' // 清空选中值\n\t\t\t\t\tthis.$refs.cascader.$refs.panel.activePath = '' // 清除高亮\n\t\t\t\t\tthis.$refs.cascader.$refs.panel.syncActivePath() // 初始化(只展示一级节点)\n\t\t\t\t\tthis.parameter.fullName = ''\n\t\t\t\t\tthis.parameter.fullId = ''\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\thandleSuccess(res, file) {\n\t\t\tconst portal = window.context.portal\n\t\t\tlet uploadUrl = portal + '/file/v1/uploadFileForConfig'\n\t\t\tconsole.log(res, 'llllll', file)\n\t\t\tconsole.log(uploadUrl)\n\t\t\tthis.$set(this.parameter, 'icon', res.fileId)\n\t\t\tthis.icon = this.previewUrl + res.fileId\n\t\t},\n\t\tbeforeUpload(file) {\n\t\t\tconst isJPG = file.type === 'image/jpeg'\n\t\t\tif (!isJPG) {\n\t\t\t\tthis.$message.error('上传图片只能是 JPG 格式!')\n\t\t\t}\n\t\t\treturn isJPG\n\t\t},\n\t\t// 保存产品信息\n\t\thandleSave() {\n\t\t\tthis.$refs.formInfo.validate(valid => {\n\t\t\t\tif (valid) {\n\t\t\t\t\tproductManage.updateProductInfo(this.parameter).then(response => {\n\t\t\t\t\t\tconsole.log(this.parameter, '修改');\n\t\t\t\t\t\tif (response.state) {\n\t\t\t\t\t\t\tthis.$notify({\n\t\t\t\t\t\t\t\ttype: 'success',\n\t\t\t\t\t\t\t\tmessage: '修改成功',\n\t\t\t\t\t\t\t\tduration: 2000\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\tthis.handleClose()\n\t\t\t\t\t\t\tthis.$parent.loadData(1)\n\t\t\t\t\t\t} else {}\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\t\t// 关闭新增人员窗口\n\t\thandleClose() {\n\t\t\tthis.visible = false\n\t\t\tthis.activeCollapse1 = '1'\n\t\t}\n\t}\n}\n",null]}