{"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\\productManageDialog.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\src\\views\\Device\\deviceManage\\components\\productManageDialog.vue","mtime":1687336502346},{"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 \"core-js/modules/es6.function.name\";\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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 { mapState } from 'vuex';\nexport default {\n name: 'productManageModal',\n components: {\n IconDialog: IconDialog,\n IconPanl: IconPanl\n },\n data: function data() {\n return {\n visible: false,\n isSaved: false,\n title: '新增',\n params: {\n name: '',\n //设备名称\n isIntellect: '',\n //智能分类\n typeId: '',\n //产品分类ID\n deviceType: '',\n //设备类型\n code: '',\n //产品编码\n memo: '',\n //备注\n id: null,\n fullName: '',\n icon: ''\n },\n previewUrl: window.context.portal + '/file/onlinePreviewController/v1/getFileById_',\n uploadUrl: window.context.portal + '/file/v1/fileUpload',\n // 服务器上传地址\n icon: '',\n activeCollapse1: '1',\n ctlTypeList: '',\n active: 1,\n deviceTypeList: [],\n //设备类型字段列表\n isIntellectList: [],\n //智能分类字段列表\n rules: {\n name: [{\n required: true,\n message: '请输入产品名称',\n trigger: 'blur'\n }],\n isIntellect: [{\n required: true,\n message: '请选择智能分类',\n trigger: 'blur'\n }],\n code: [{\n required: true,\n message: '请输入产品编码',\n trigger: 'blur'\n }],\n deviceType: [{\n required: true,\n message: '请选择设备类型',\n trigger: 'blur'\n }]\n }\n };\n },\n created: function created() {\n this.deviceTypeList = dictUtils.getDictItemsFromCache('sblx');\n this.ctlTypeList = dictUtils.getDictItemsFromCache('kjlx');\n this.isIntellectList = dictUtils.getDictItemsFromCache('znfl');\n },\n mounted: function mounted() {},\n computed: mapState({\n header: function header(state) {\n return {\n Authorization: \"Bearer \".concat(state.login.currentUser.token)\n };\n }\n }),\n methods: {\n clearIcon: function clearIcon() {\n this.params.icon = '';\n },\n choseIcon: function choseIcon(icon) {\n this.params.icon = icon;\n },\n handleAvatarSuccess: function handleAvatarSuccess(res, file) {\n this.$set(this.params, 'icon', res.fileId);\n this.icon = this.previewUrl + res.fileId;\n },\n beforeAvatarUpload: function beforeAvatarUpload(file) {\n var isJPG = file.type === 'image/jpeg' || file.type === 'image/png' || file.type === 'image/jpg';\n var isLt1M = file.size / 1024 / 1024 < 1;\n\n if (!isJPG) {\n this.$message.error('上传图片只能是 JPG 格式!');\n }\n\n if (!isLt1M) {\n this.$message.error('上传图片大小不能超过 1MB!');\n }\n\n return isJPG && isLt1M;\n },\n add: function add(userRow) {\n this.params.fullName = userRow.fullName;\n this.params.typeId = userRow.id;\n this.params.deviceType = this.deviceTypeList[0].value;\n this.params.isIntellect = this.isIntellectList[0].value;\n this.visible = true;\n },\n // 保存产品信息\n handleSave: function handleSave() {\n var _this = this;\n\n this.isSaved = true;\n this.$refs.formInfo.validate(function (valid) {\n if (valid) {\n if (_this.title === '新增') {\n productManage.addProductInfo(_this.params).then(function (response) {\n console.log(_this.params);\n\n if (response.state) {\n _this.$notify({\n type: 'success',\n message: '新增成功',\n duration: 2000\n });\n\n _this.handleClose();\n\n _this.$emit('reload');\n } else {}\n });\n }\n\n if (_this.title === '修改') {\n productManage.updateProductInfo(_this.params).then(function (response) {\n if (response.state) {\n _this.$notify({\n type: 'success',\n message: '修改成功',\n duration: 2000\n });\n\n _this.handleClose();\n\n _this.$emit('reload');\n } else {}\n });\n }\n } else {\n _this.$notify({\n type: 'warning',\n message: \"请完善表单信息!\",\n duration: 2000\n });\n }\n });\n },\n edit: function edit(row) {\n var _this2 = this;\n\n this.params = utils.deepClone(row);\n console.log(this.params);\n this.params.id = row.id;\n this.visible = true;\n this.title = '修改'; // 根据id查询产品信息\n\n if (this.title === '修改') {\n productManage.productTypeDetail(row.typeId).then(function (res) {\n console.log(res);\n _this2.params.fullName = res.name;\n });\n }\n },\n // 关闭新增人员窗口\n handleClose: function handleClose() {\n ;\n this.params = {\n name: '',\n //设备名称\n isIntellect: '',\n //智能分类\n typeId: '',\n //产品分类ID\n deviceType: '',\n //设备类型\n code: '',\n //产品编码\n memo: '',\n //备注\n id: null,\n fullName: '',\n icon: ''\n }, this.title = '新增';\n this.visible = false;\n this.activeCollapse1 = '1';\n }\n }\n};",null]}