{"remainingRequest":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\bzzgj-fvue\\src\\views\\Device\\deviceMonitor\\EquipmentMaintain.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\src\\views\\Device\\deviceMonitor\\EquipmentMaintain.vue","mtime":1686910374768},{"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//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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 {\n\tmapState\n} from 'vuex'\nimport {\n\tTableMixin\n} from '@/mixins/tableMixin'\nimport EquipmentManageDialog from '@/views/Device/deviceManage/components/EquipmentManageDialog'\nimport EquipmentExtendDialog from '@/views/Device/deviceManage/components/EquipmentExtendDialog'\nimport resourceManage from '@/api/device/resourceManage.js'\nimport userManage from '@/api/device/userManage.js'\nimport equipmentManage from '@/api/device/equipmentManage.js'\nimport dictUtils from '@/components/dict/DictSelectUtils.js'\nexport default {\n\tname: 'EquipmentManage',\n\tcomponents: {\n\t\tEquipmentManageDialog,\n\t\tEquipmentExtendDialog\n\t},\n\tmixins: [TableMixin],\n\tdata() {\n\t\treturn {\n\t\t\timportVisible: false,\n\t\t\treviseDat: '',\n\t\t\treviseVisible: false,\n\t\t\treviseStart: '',\n\t\t\texportParam: {},\n\t\t\t//携带参数\n\t\t\tuploadData: {\n\t\t\t\tproductId: ''\n\t\t\t},\n\t\t\turl: {\n\t\t\t\tdelete: '/device/info/'\n\t\t\t},\n\t\t\ttreeData: [],\n\t\t\tproductValue: [],\n\t\t\tregionValue: [],\n\t\t\tshowMore: false,\n\t\t\tparameters: {},\n\t\t\tshowExtend: false,\n\t\t\tparams: {\n\t\t\t\tname: '',\n\t\t\t\tproductId: '', //产品\n\t\t\t\tstatus: '', //状态\n\t\t\t\timportant: '', //重点设备\n\t\t\t\tareaId: '' //区域\n\t\t\t},\n\t\t\tquerys: [{\n\t\t\t\t\tgroup: 'main',\n\t\t\t\t\toperation: 'LIKE',\n\t\t\t\t\tparentGroup: '',\n\t\t\t\t\tproperty: 'd.name_',\n\t\t\t\t\trelation: 'AND',\n\t\t\t\t\tvalue: ''\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tgroup: 'main',\n\t\t\t\t\toperation: 'EQUAL',\n\t\t\t\t\tparentGroup: '',\n\t\t\t\t\tproperty: 'product_id_',\n\t\t\t\t\trelation: 'AND',\n\t\t\t\t\tvalue: ''\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tgroup: 'main',\n\t\t\t\t\toperation: 'EQUAL',\n\t\t\t\t\tparentGroup: '',\n\t\t\t\t\tproperty: 'status',\n\t\t\t\t\trelation: 'AND',\n\t\t\t\t\tvalue: ''\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tgroup: 'main',\n\t\t\t\t\toperation: 'EQUAL',\n\t\t\t\t\tparentGroup: '',\n\t\t\t\t\tproperty: 'd.code_',\n\t\t\t\t\trelation: 'AND',\n\t\t\t\t\tvalue: ''\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tgroup: 'main',\n\t\t\t\t\toperation: 'EQUAL',\n\t\t\t\t\tparentGroup: '',\n\t\t\t\t\tproperty: 'important',\n\t\t\t\t\trelation: 'AND',\n\t\t\t\t\tvalue: ''\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tgroup: 'main',\n\t\t\t\t\toperation: 'EQUAL',\n\t\t\t\t\tparentGroup: '',\n\t\t\t\t\tproperty: 'areaId',\n\t\t\t\t\trelation: 'AND',\n\t\t\t\t\tvalue: ''\n\t\t\t\t},\n\n\n\n\t\t\t],\n\t\t\tdeviceStatus: [], // 设备状态\n\t\t\tproductData: [], // 产品数据\n\t\t\tflagList: [], //禁用标识字段列表\n\t\t\taddressTypeList: [], //安装地点类型字段列表\n\t\t\tproductIdInfo: '',\n\t\t\tdeviceInfo: {\n\t\t\t\t0: '',\n\t\t\t\t1: '',\n\t\t\t\t2: '',\n\t\t\t\t3: '',\n\t\t\t\t9: '',\n\t\t\t\t10: ''\n\t\t\t} //设备状态数量\n\t\t}\n\t},\n\t//获取token\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\tcreated() {\n\t\t//在created里面区获取actionUrl\n\t\tthis.actionUrl = window.context.portal\n\t\tthis.loadProduct()\n\t\tthis.getAreaTree()\n\t},\n\tmounted() {\n\t\tthis.deviceStatus = dictUtils.getDictItemsFromCache('sbzt')\n\t\tthis.flagList = dictUtils.getDictItemsFromCache('jybs')\n\t\tthis.addressTypeList = dictUtils.getDictItemsFromCache('azddlx')\n\t},\n\tmethods: {\n\t\topenUpload() {\n\t\t\tif (this.productValue.length > 0) {\n\t\t\t\tlet arr = JSON.parse(JSON.stringify(this.productValue))\n\t\t\t\tthis.uploadData.productId = arr.pop()\n\t\t\t}\n\t\t\tthis.importVisible = true\n\t\t},\n\t\tdelRegion() {\n\t\t\tif (this.regionValue.length == 0) {\n\t\t\t\tthis.params.areaId = ''\n\t\t\t}\n\t\t},\n\t\tdelProduct() {\n\t\t\tif (this.productValue.length == 0) {\n\t\t\t\tthis.params.productId = ''\n\t\t\t}\n\t\t},\n\t\topenMore() {\n\t\t\tthis.showMore = !this.showMore\n\t\t},\n\t\trevise(val) {\n\t\t\tthis.reviseVisible = true\n\t\t\tthis.reviseDat = val\n\t\t},\n\t\treviseBtn() {\n\t\t\t// console.log(this.reviseDat)\n\t\t\tequipmentManage.updateStatus({\n\t\t\t\t\tid: this.reviseDat.id,\n\t\t\t\t\tproductCode: this.reviseDat.productCode,\n\t\t\t\t\tstatus: this.reviseStart\n\t\t\t\t},\n\t\t\t\tres => {\n\t\t\t\t\t// console.log(res)\n\t\t\t\t\tif (res.state) {\n\t\t\t\t\t\tthis.$message({\n\t\t\t\t\t\t\tmessage: res.message,\n\t\t\t\t\t\t\ttype: 'success'\n\t\t\t\t\t\t})\n\t\t\t\t\t\tthis.loadData()\n\t\t\t\t\t\tthis.reviseVisible = false\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t)\n\t\t},\n\t\tgetAreaTree() {\n\t\t\tequipmentManage.loadAreaTree({\n\t\t\t\tid: '0'\n\t\t\t}, res => {\n\t\t\t\tthis.treeData = res.value // this.formatData(res.rows)\n\t\t\t\tthis.$set(this.treeData)\n\t\t\t})\n\t\t},\n\t\tequipment(val) {\n\t\t\tconsole.log(val)\n\t\t\tlet importantData = '0'\n\t\t\tif (val.important == '1' && val.important) {\n\t\t\t\timportantData = 0\n\t\t\t} else {\n\t\t\t\timportantData = 1\n\t\t\t}\n\t\t\tequipmentManage.updateImportant({\n\t\t\t\t\tid: val.id,\n\t\t\t\t\timportant: importantData\n\t\t\t\t},\n\t\t\t\tres => {\n\t\t\t\t\t// console.log(res)\n\t\t\t\t\tif (res.state) {\n\t\t\t\t\t\tthis.$message({\n\t\t\t\t\t\t\tmessage: res.message,\n\t\t\t\t\t\t\ttype: 'success'\n\t\t\t\t\t\t})\n\t\t\t\t\t\tthis.loadData()\n\t\t\t\t\t\t// this.reviseVisible = false\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t)\n\t\t},\n\t\t//\n\t\thandleClose() {\n\t\t\tthis.importVisible = false\n\t\t\tthis.reviseVisible = false\n\t\t},\n\t\t//导入\n\t\timportKPL() {},\n\t\t//下载模版\n\t\tdownload() {\n\t\t\tlet a = document.createElement('a')\n\t\t\ta.href = `/deviceData.xlsx`\n\t\t\ta.download = '设备表格.xlsx'\n\t\t\ta.click()\n\t\t},\n\t\t//导出\n\t\texportKPL() {\n\t\t\tthis.exportParam = {\n\t\t\t\t...this.queryParam\n\t\t\t}\n\t\t\tthis.exportParam.pageBean = {\n\t\t\t\tpage: 1,\n\t\t\t\tpageSize: -1\n\t\t\t}\n\t\t\t//导出直接调用接口\n\t\t\tresourceManage.infoExportExcel(this.exportParam, res => {})\n\t\t},\n\t\t//上传成功\n\t\thandleAvatarSuccess(res, file) {\n\t\t\t//提示\n\t\t\tthis.$notify({\n\t\t\t\ttype: 'success',\n\t\t\t\tmessage: this.$t('domestic.success'),\n\t\t\t\tduration: 2000\n\t\t\t})\n\t\t\tthis.getData() //调用用页面查询接口,刷新数据\n\t\t},\n\t\t//上传失败\n\t\thandleAvatarError(err, file, fileList) {\n\t\t\t//提示\n\t\t\tthis.$notify({\n\t\t\t\ttype: 'error',\n\t\t\t\tmessage: this.$t('domestic.failure'),\n\t\t\t\tduration: 2000\n\t\t\t})\n\t\t},\n\t\ttoEquipmentDetails(val) {\n\t\t\tlet path = this.$route.path\n\t\t\tif (path.indexOf('frontPlat') !== -1) {\n\t\t\t\tthis.$router.push({\n\t\t\t\t\tname: 'EquipmentDetails',\n\t\t\t\t\tquery: {\n\t\t\t\t\t\tid: val.id,\n\t\t\t\t\t\tname: val.name,\n\t\t\t\t\t\tstatus:false\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\tthis.$router.push({\n\t\t\t\t\tname: 'EquipmentDetailsLink',\n\t\t\t\t\tquery: {\n\t\t\t\t\t\tid: val.id,\n\t\t\t\t\t\tname: val.name,\n\t\t\t\t\t\tstatus:false\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}\n\t\t},\n\t\tloadProduct() {\n\t\t\tresourceManage.getProductTree({}, res => {\n\t\t\t\tif (res.state) {\n\t\t\t\t\tthis.productData = res.value\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\t\tclearQuerys() {\n\t\t\tthis.querys.forEach(item => {\n\t\t\t\titem.value = ''\n\t\t\t})\n\t\t},\n\t\treload() {\n\t\t\tthis.loadData()\n\t\t},\n\t\t// 点击刷新设备数量\n\t\trefreshInfo() {\n\t\t\tthis.getDeviceInfo()\n\t\t},\n\t\t// 选择产品搜索对应设备\n\t\thandleChange(val) {\n\t\t\tthis.productIdInfo = val\n\t\t\tthis.uploadData.product_id_ = val\n\t\t\tthis.loadData()\n\t\t},\n\t\t// 根据产品id获取设备数量\n\t\tgetDeviceInfo() {\n\t\t\tlet data = {\n\t\t\t\tproductId: ''\n\t\t\t}\n\t\t\tif (this.productValue.length > 0) {\n\t\t\t\tlet arr = JSON.parse(JSON.stringify(this.productValue))\n\t\t\t\tdata.productId = arr.pop()\n\t\t\t}\n\t\t\tequipmentManage.getDeviceInfo(this.qs.stringify(data), res => {\n\t\t\t\tthis.deviceInfo = res.value\n\t\t\t})\n\t\t},\n\t\tloadData(page) {\n\t\t\tthis.loadProduct()\n\t\t\tif (page) {\n\t\t\t\tthis.queryParam.pageBean.page = page\n\t\t\t}\n\t\t\tthis.loading = true\n\t\t\tif (this.productValue.length > 0) {\n\t\t\t\tlet arr = JSON.parse(JSON.stringify(this.productValue))\n\t\t\t\tthis.params.productId = arr.pop()\n\t\t\t}\n\t\t\tif (this.regionValue.length > 0) {\n\t\t\t\tlet arr = JSON.parse(JSON.stringify(this.regionValue))\n\t\t\t\tthis.params.areaId = arr.pop()\n\t\t\t}\n\t\t\tthis.queryParam.params = this.params\n\t\t\tthis.tableData = []\n\t\t\t// this.queryParam.querys = []\n\t\t\t// if (this.querys[0].value) {\n\t\t\t// \tthis.queryParam.querys.push(this.querys[0])\n\t\t\t// }\n\t\t\t// if (this.querys[1].value) {\n\t\t\t// \tthis.queryParam.querys.push(this.querys[1])\n\t\t\t// }\n\t\t\t// if (this.querys[2].value) {\n\t\t\t// \tthis.queryParam.querys.push(this.querys[2])\n\t\t\t// }\n\t\t\t// if (this.querys[3].value) {\n\t\t\t// \tthis.queryParam.querys.push(this.querys[3])\n\t\t\t// }\n\t\t\t// if (this.querys[4].value) {\n\t\t\t// \tthis.queryParam.querys.push(this.querys[4])\n\t\t\t// }\n\t\t\t// if (this.querys[5].value) {\n\t\t\t// \tthis.queryParam.querys.push(this.querys[5])\n\t\t\t// }\n\t\t\tresourceManage.loadDevice(this.queryParam, res => {\n\t\t\t\tthis.total = res.total\n\t\t\t\tthis.tableData = res.rows\n\t\t\t\tthis.$set(this.tableData)\n\t\t\t\tthis.loading = false\n\t\t\t\tthis.getDeviceInfo()\n\t\t\t\tthis.tableData.forEach(item => {\n\t\t\t\t\tthis.deviceStatus.forEach(val => {\n\t\t\t\t\t\tif (item.status == val.value) {\n\t\t\t\t\t\t\titem['statusName'] = val.name\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\tthis.addressTypeList.forEach(val => {\n\t\t\t\t\t\tif (item.addressType == val.value) {\n\t\t\t\t\t\t\titem['addressTypeName'] = val.name\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t})\n\t\t\t})\n\t\t\tif (this.querys[1].value == '') {}\n\t\t},\n\t\t// 设备起禁用\n\t\thandleFlag(val) {\n\t\t\tlet title\n\t\t\ttitle = val.flag == 1 ? '启用' : '禁用'\n\t\t\tlet data = {\n\t\t\t\tid: val.id\n\t\t\t}\n\t\t\tequipmentManage.deviceflag(data, res => {\n\t\t\t\tif (res.state) {\n\t\t\t\t\tthis.$message({\n\t\t\t\t\t\tmessage: title + '成功',\n\t\t\t\t\t\ttype: 'success'\n\t\t\t\t\t})\n\t\t\t\t\t// this.loadData()\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\t\thandleExtend(row) {\n\t\t\tthis.showExtend = true\n\t\t\tthis.parameters = row\n\t\t},\n\t\tcloseExtend() {\n\t\t\tthis.showExtend = false\n\t\t}\n\t}\n}\n",null]}