{"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\\EquipmentManage.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\src\\views\\Device\\deviceManage\\EquipmentManage.vue","mtime":1688615807625},{"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//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\r\nimport {mapState} from 'vuex'\r\nimport {TableMixin} from '@/mixins/tableMixin'\r\nimport EquipmentManageDialog from '@/views/Device/deviceManage/components/EquipmentManageDialog'\r\nimport EquipmentExtendDialog from '@/views/Device/deviceManage/components/EquipmentExtendDialog'\r\nimport resourceManage from '@/api/device/resourceManage.js'\r\nimport userManage from '@/api/device/userManage.js'\r\nimport equipmentManage from '@/api/device/equipmentManage.js'\r\nimport dictUtils from '@/components/dict/DictSelectUtils.js'\r\nexport default {\r\n name: 'EquipmentManage',\r\n components: {\r\n EquipmentManageDialog,\r\n EquipmentExtendDialog,\r\n },\r\n mixins: [TableMixin],\r\n data() {\r\n return {\r\n importVisible: false,\r\n uploading: false,\r\n reviseDat: '',\r\n reviseVisible: false,\r\n reviseStart: '',\r\n exportParam: {},\r\n //携带参数\r\n uploadData: {\r\n productId: '',\r\n },\r\n url: {\r\n delete: '/device/info/',\r\n },\r\n treeData: [],\r\n productValue: [],\r\n regionValue: [],\r\n showMore: false,\r\n parameters: {},\r\n showExtend: false,\r\n params: {\r\n name: '',\r\n productId: '', //产品\r\n status: '', //状态\r\n important: '', //重点设备\r\n areaId: '', //区域\r\n },\r\n querys: [\r\n {\r\n group: 'main',\r\n operation: 'LIKE',\r\n parentGroup: '',\r\n property: 'd.name_',\r\n relation: 'AND',\r\n value: '',\r\n },\r\n {\r\n group: 'main',\r\n operation: 'EQUAL',\r\n parentGroup: '',\r\n property: 'product_id_',\r\n relation: 'AND',\r\n value: '',\r\n },\r\n {\r\n group: 'main',\r\n operation: 'EQUAL',\r\n parentGroup: '',\r\n property: 'status',\r\n relation: 'AND',\r\n value: '',\r\n },\r\n {\r\n group: 'main',\r\n operation: 'EQUAL',\r\n parentGroup: '',\r\n property: 'd.code_',\r\n relation: 'AND',\r\n value: '',\r\n },\r\n {\r\n group: 'main',\r\n operation: 'EQUAL',\r\n parentGroup: '',\r\n property: 'important',\r\n relation: 'AND',\r\n value: '',\r\n },\r\n {\r\n group: 'main',\r\n operation: 'EQUAL',\r\n parentGroup: '',\r\n property: 'areaId',\r\n relation: 'AND',\r\n value: '',\r\n },\r\n ],\r\n deviceStatus: [], // 设备状态\r\n productData: [], // 产品数据\r\n flagList: [], //禁用标识字段列表\r\n addressTypeList: [], //安装地点类型字段列表\r\n productIdInfo: '',\r\n deviceInfo: {\r\n 0: '',\r\n 1: '',\r\n 2: '',\r\n 3: '',\r\n 9: '',\r\n 10: '',\r\n }, //设备状态数量\r\n }\r\n },\r\n //获取token\r\n computed: mapState({\r\n header: (state) => {\r\n return {\r\n Authorization: `Bearer ${state.login.currentUser.token}`,\r\n }\r\n },\r\n }),\r\n created() {\r\n //在created里面区获取actionUrl\r\n this.actionUrl = window.context.portal\r\n this.loadProduct()\r\n this.getAreaTree()\r\n },\r\n mounted() {\r\n this.deviceStatus = dictUtils.getDictItemsFromCache('sbzt')\r\n this.flagList = dictUtils.getDictItemsFromCache('jybs')\r\n this.addressTypeList = dictUtils.getDictItemsFromCache('azddlx')\r\n },\r\n methods: {\r\n openUpload() {\r\n if (this.productValue.length > 0) {\r\n let arr = JSON.parse(JSON.stringify(this.productValue))\r\n this.uploadData.productId = arr.pop()\r\n }\r\n this.importVisible = true\r\n },\r\n delRegion() {\r\n if (this.regionValue.length == 0) {\r\n this.params.areaId = ''\r\n }\r\n },\r\n delProduct() {\r\n if (this.productValue.length == 0) {\r\n this.params.productId = ''\r\n } else {\r\n let arr = JSON.parse(JSON.stringify(this.productValue))\r\n this.uploadData.productId = arr.pop()\r\n }\r\n },\r\n openMore() {\r\n this.showMore = !this.showMore\r\n },\r\n revise(val) {\r\n this.reviseVisible = true\r\n this.reviseDat = val\r\n },\r\n reviseBtn() {\r\n // console.log(this.reviseDat)\r\n equipmentManage.updateStatus(\r\n {\r\n id: this.reviseDat.id,\r\n productCode: this.reviseDat.productCode,\r\n status: this.reviseStart,\r\n },\r\n (res) => {\r\n // console.log(res)\r\n if (res.state) {\r\n this.$message({\r\n message: res.message,\r\n type: 'success',\r\n })\r\n this.loadData()\r\n this.reviseVisible = false\r\n }\r\n }\r\n )\r\n },\r\n getAreaTree() {\r\n equipmentManage.loadAreaTree(\r\n {\r\n id: '0',\r\n },\r\n (res) => {\r\n this.treeData = res.value // this.formatData(res.rows)\r\n this.$set(this.treeData)\r\n }\r\n )\r\n },\r\n equipment(val) {\r\n console.log(val)\r\n let importantData = '0'\r\n if (val.important == '1' && val.important) {\r\n importantData = 0\r\n } else {\r\n importantData = 1\r\n }\r\n equipmentManage.updateImportant(\r\n {\r\n id: val.id,\r\n important: importantData,\r\n },\r\n (res) => {\r\n // console.log(res)\r\n if (res.state) {\r\n this.$message({\r\n message: res.message,\r\n type: 'success',\r\n })\r\n this.loadData()\r\n // this.reviseVisible = false\r\n }\r\n }\r\n )\r\n },\r\n //\r\n handleClose() {\r\n this.importVisible = false\r\n this.reviseVisible = false\r\n },\r\n //导入\r\n importKPL() {},\r\n //下载模版\r\n download() {\r\n let a = document.createElement('a')\r\n a.href = `/deviceData.xlsx`\r\n a.download = '设备表格.xlsx'\r\n a.click()\r\n },\r\n //导出\r\n exportKPL() {\r\n this.exportParam = {\r\n ...this.queryParam,\r\n }\r\n this.exportParam.pageBean = {\r\n page: 1,\r\n pageSize: -1,\r\n }\r\n //导出直接调用接口\r\n resourceManage.infoExportExcel(this.exportParam, (res) => {})\r\n },\r\n handleAvatarProgress() {\r\n this.uploading = true\r\n },\r\n //上传成功\r\n handleAvatarSuccess(res, file) {\r\n //提示\r\n this.$message.success('导入成功')\r\n\r\n this.uploading = false\r\n this.loadData(1) //调用用页面查询接口,刷新数据\r\n },\r\n //上传失败\r\n handleAvatarError(err, file, fileList) {\r\n this.uploading = false\r\n this.loadData(1) //调用用页面查询接口,刷新数据\r\n this.$message.error(err.message)\r\n },\r\n toEquipmentDetails(val) {\r\n let path = this.$route.path\r\n if (path.indexOf('frontPlat') !== -1) {\r\n this.$router.push({\r\n name: 'EquipmentDetails',\r\n query: {\r\n id: val.id,\r\n name: val.name,\r\n status: true,\r\n },\r\n })\r\n } else {\r\n this.$router.push({\r\n name: 'EquipmentDetailsLink',\r\n query: {\r\n id: val.id,\r\n name: val.name,\r\n status: true,\r\n },\r\n })\r\n }\r\n },\r\n loadProduct() {\r\n resourceManage.getProductTree({}, (res) => {\r\n if (res.state) {\r\n this.productData = res.value\r\n }\r\n })\r\n },\r\n clearQuerys() {\r\n this.querys.forEach((item) => {\r\n item.value = ''\r\n })\r\n },\r\n reload() {\r\n this.loadData()\r\n },\r\n // 点击刷新设备数量\r\n refreshInfo() {\r\n this.getDeviceInfo()\r\n },\r\n // 选择产品搜索对应设备\r\n handleChange(val) {\r\n this.productIdInfo = val\r\n this.uploadData.product_id_ = val\r\n this.loadData()\r\n },\r\n // 根据产品id获取设备数量\r\n getDeviceInfo() {\r\n let data = {\r\n productId: '',\r\n }\r\n if (this.productValue.length > 0) {\r\n let arr = JSON.parse(JSON.stringify(this.productValue))\r\n data.productId = arr.pop()\r\n }\r\n equipmentManage.getDeviceInfo(this.qs.stringify(data), (res) => {\r\n this.deviceInfo = res.value\r\n })\r\n },\r\n loadData(page) {\r\n this.loadProduct()\r\n if (page) {\r\n this.queryParam.pageBean.page = page\r\n }\r\n this.loading = true\r\n if (this.productValue.length > 0) {\r\n let arr = JSON.parse(JSON.stringify(this.productValue))\r\n this.params.productId = arr.pop()\r\n }\r\n if (this.regionValue.length > 0) {\r\n let arr = JSON.parse(JSON.stringify(this.regionValue))\r\n this.params.areaId = arr.pop()\r\n }\r\n this.queryParam.params = this.params\r\n this.tableData = []\r\n // this.queryParam.querys = []\r\n // if (this.querys[0].value) {\r\n // \tthis.queryParam.querys.push(this.querys[0])\r\n // }\r\n // if (this.querys[1].value) {\r\n // \tthis.queryParam.querys.push(this.querys[1])\r\n // }\r\n // if (this.querys[2].value) {\r\n // \tthis.queryParam.querys.push(this.querys[2])\r\n // }\r\n // if (this.querys[3].value) {\r\n // \tthis.queryParam.querys.push(this.querys[3])\r\n // }\r\n // if (this.querys[4].value) {\r\n // \tthis.queryParam.querys.push(this.querys[4])\r\n // }\r\n // if (this.querys[5].value) {\r\n // \tthis.queryParam.querys.push(this.querys[5])\r\n // }\r\n resourceManage.loadDevice(this.queryParam, (res) => {\r\n this.total = res.total\r\n this.tableData = res.rows\r\n this.$set(this.tableData)\r\n this.loading = false\r\n this.getDeviceInfo()\r\n this.tableData.forEach((item) => {\r\n this.deviceStatus.forEach((val) => {\r\n if (item.status == val.value) {\r\n item['statusName'] = val.name\r\n }\r\n })\r\n this.addressTypeList.forEach((val) => {\r\n if (item.addressType == val.value) {\r\n item['addressTypeName'] = val.name\r\n }\r\n })\r\n })\r\n })\r\n if (this.querys[1].value == '') {\r\n }\r\n },\r\n // 设备起禁用\r\n handleFlag(val) {\r\n let title\r\n title = val.flag == 1 ? '启用' : '禁用'\r\n let data = {\r\n id: val.id,\r\n }\r\n equipmentManage.deviceflag(data, (res) => {\r\n if (res.state) {\r\n this.$message({\r\n message: title + '成功',\r\n type: 'success',\r\n })\r\n // this.loadData()\r\n }\r\n })\r\n },\r\n handleExtend(row) {\r\n this.showExtend = true\r\n this.parameters = row\r\n },\r\n closeExtend() {\r\n this.showExtend = false\r\n },\r\n },\r\n}\r\n",null]}