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