{"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\\ProductManage.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\src\\views\\Device\\deviceManage\\ProductManage.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//\n//\n\nimport {\n\tTableMixin\n} from '@/mixins/tableMixin'\nimport {\n\tdragControllerDiv\n} from '@/mixins/dragControllerDiv'\nimport productManage from '@/api/device/productManage.js'\nimport dictUtils from '@/components/dict/DictSelectUtils.js'\nimport productOrgDialog from '@/views/Device/deviceManage/components/productOrgDialog'\nimport productOrgUpdateDialog from '@/views/Device/deviceManage/components/productOrgUpdateDialog'\nimport productManageDialog from '@/views/Device/deviceManage/components/productManageDialog'\n\nexport default {\n\tname: 'productManage',\n\tcomponents: {\n\t\tproductOrgDialog,\n\t\tproductOrgUpdateDialog,\n\t\tproductManageDialog\n\t},\n\tmixins: [TableMixin],\n\tdata() {\n\t\treturn {\n\t\t\ttitles: '',\n\t\t\ttitleUp: '',\n\t\t\ttableData: [],\n\t\t\tshowFormDias: false,\n\t\t\tshowFormDiaUp: false, //修改产品类型\n\t\t\ttreeData: [],\n\t\t\tdefaultProps: {\n\t\t\t\tchildren: 'children',\n\t\t\t\tlabel: 'name'\n\t\t\t},\n\t\t\tpreviewUrl: window.context.portal + '/file/onlinePreviewController/v1/getFileById_', //图标预览\n\t\t\ttreeNode: {\n\t\t\t\tcode: '',\n\t\t\t\tid: '0',\n\t\t\t\tname: '产品管理',\n\t\t\t\ttype: 0,\n\t\t\t\tchildren: []\n\t\t\t},\n\t\t\tpId: '',\n\t\t\turl: {\n\t\t\t\tdelete: '/device/product/info/'\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: '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: '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: 'deviceType',\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: 'typeId',\n\t\t\t\t\trelation: 'AND',\n\t\t\t\t\tvalue: ''\n\t\t\t\t}\n\t\t\t],\n\t\t\tdeviceTypeList: [], //设备类型字段列表\n\t\t\tisIntellectList: [] //智能分类字段列表\n\t\t}\n\t},\n\twatch: {\n\t\tfilterText(val) {\n\t\t\tthis.$refs.tree.filter(val)\n\t\t}\n\t},\n\tcreated() {\n\t\tthis.deviceTypeList = dictUtils.getDictItemsFromCache('sblx')\n\t\tthis.isIntellectList = dictUtils.getDictItemsFromCache('znfl')\n\t},\n\tmounted() {\n\t\tdragControllerDiv()\n\t\tthis.getTreen()\n\t},\n\tmethods: {\n\t\t// 产品组织树查询\n\t\tgetTreen() {\n\t\t\tproductManage.productType().then(res => {\n\t\t\t\tthis.treeData = res.value\n\t\t\t\tthis.$set(this.treeData)\n\t\t\t})\n\t\t},\n\t\ttoProductDetails(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: 'ProductDetails',\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}\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\tthis.$router.push({\n\t\t\t\t\tname: 'ProductDetailsLink',\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}\n\t\t\t\t})\n\t\t\t}\n\t\t},\n\t\t// renderContent(h, {node, data, store}) {\n\t\t// return (\n\t\t// {\n\t\t// this.show = true\n\t\t// }}\n\t\t// on-mouseout={() => {\n\t\t// this.show = false\n\t\t// }}\n\t\t// >\n\t\t// {data.name}\n\t\t// \n\t\t// \n\t\t// this.append(data, 'son')}\n\t\t// >\n\t\t// 新增\n\t\t// \n\t\t// this.upDateinfo(data, '')}\n\t\t// >\n\t\t// 修改\n\t\t// \n\t\t// this.remove(data)}\n\t\t// >\n\t\t// 删除\n\t\t// \n\t\t// \n\t\t// \n\t\t// \n\t\t// \n\t\t// )\n\t\t// },\n\t\treload() {\n\t\t\tthis.treeData = []\n\t\t\tthis.$set(this.treeData)\n\t\t\tthis.getTreen()\n\t\t\tthis.loadData()\n\t\t},\n\t\tfilterNode(value, data) {\n\t\t\tif (!value) return true\n\t\t\treturn data.name.indexOf(value) !== -1\n\t\t},\n\t\t// 获取产品信息\n\t\tloadData(page) {\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\tthis.tableData = []\n\t\t\tthis.queryParam.querys = []\n\t\t\tif (this.querys[0].value) {\n\t\t\t\tthis.queryParam.querys.push(this.querys[0])\n\t\t\t}\n\t\t\tif (this.querys[1].value) {\n\t\t\t\tthis.queryParam.querys.push(this.querys[1])\n\t\t\t}\n\t\t\tif (this.querys[2].value) {\n\t\t\t\tthis.queryParam.querys.push(this.querys[2])\n\t\t\t}\n\t\t\tif (this.querys[3].value) {\n\t\t\t\tthis.queryParam.querys.push(this.querys[3])\n\t\t\t}\n\t\t\tproductManage.productInfo(this.queryParam).then(res => {\n\t\t\t\t// console.log(res)\n\t\t\t\tthis.total = res.total\n\t\t\t\tthis.tableData = res.rows\n\t\t\t\tthis.tableData.forEach(item => {\n\t\t\t\t\tlet arr = item.fullName.split('/')\n\t\t\t\t\tfor (let index = 0; index < arr.length; index++) {\n\t\t\t\t\t\tif (arr[index] == item.name) {\n\t\t\t\t\t\t\treturn (item['fullName'] = arr[index - 1])\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\tthis.tableData.forEach(item => {\n\t\t\t\t\tthis.isIntellectList.forEach(val => {\n\t\t\t\t\t\tif (item.isIntellect == val.value) {\n\t\t\t\t\t\t\titem['isIntellect'] = val.name\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t})\n\t\t\t\tthis.tableData.forEach(item => {\n\t\t\t\t\tthis.deviceTypeList.forEach(val => {\n\t\t\t\t\t\tif (item.deviceType == val.value) {\n\t\t\t\t\t\t\titem['deviceType'] = val.name\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t})\n\t\t\t\tthis.$set(this.tableData)\n\t\t\t\tthis.loading = false\n\t\t\t})\n\t\t},\n\t\thandleAdd() {\n\t\t\tif (this.treeNode.type == 0) {\n\t\t\t\tthis.$message.warning('请选择产品类型!')\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.$refs.formModal.add(this.treeNode)\n\t\t},\n\t\t// 重置\n\t\tclearQuerys() {\n\t\t\tthis.querys[0].value = ''\n\t\t\tthis.querys[1].value = ''\n\t\t\tthis.querys[2].value = ''\n\t\t},\n\t\tappend(data, type) {\n\t\t\tthis.showFormDias = true\n\t\t\tif (type != 'father') {\n\t\t\t\tthis.titles = '新增'\n\t\t\t\tthis.showFormDias = true\n\t\t\t\tthis.pId = data.id\n\t\t\t} else {\n\t\t\t\tthis.titles = '新增'\n\t\t\t\tthis.showFormDias = true\n\t\t\t}\n\t\t},\n\t\tupDateinfo(data, type) {\n\t\t\tthis.titleUp = '修改'\n\t\t\tthis.showFormDiaUp = true\n\t\t\tthis.pId = data.id\n\t\t},\n\t\t// 关闭新增产品类型窗口\n\t\tcloseFormDiaos() {\n\t\t\tthis.showFormDias = false\n\t\t\tthis.getTreen()\n\t\t\tthis.loadData()\n\t\t},\n\t\t// 关闭修改产品类型窗口\n\t\tcloseFormDiaoUp() {\n\t\t\tthis.showFormDiaUp = false\n\t\t\tthis.getTreen()\n\t\t\tthis.loadData()\n\t\t},\n\t\t// 删除产品类型\n\t\tremove(data) {\n\t\t\tthis.$confirm('确定删除选中数据?', '提示', {\n\t\t\t\t\tconfirmButtonText: '确 定',\n\t\t\t\t\tcancelButtonText: '取 消',\n\t\t\t\t\ttype: 'warning'\n\t\t\t\t})\n\t\t\t\t.then(() => {\n\t\t\t\t\tproductManage\n\t\t\t\t\t\t.removeProductType(data.id)\n\t\t\t\t\t\t.then(res => {\n\t\t\t\t\t\t\tif (res.state) {\n\t\t\t\t\t\t\t\tthis.$notify({\n\t\t\t\t\t\t\t\t\ttype: 'success',\n\t\t\t\t\t\t\t\t\tmessage: '删除成功',\n\t\t\t\t\t\t\t\t\tduration: 2000\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\tthis.queryParam.pageBean.page = 1\n\t\t\t\t\t\t\t\tthis.loadData()\n\t\t\t\t\t\t\t\tthis.getTreen()\n\t\t\t\t\t\t\t\tthis.$set(this.treeData, this.treeData, this.treeData)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.catch(res => {\n\t\t\t\t\t\t\tthis.$notify({\n\t\t\t\t\t\t\t\ttype: 'error',\n\t\t\t\t\t\t\t\tmessage: res.message,\n\t\t\t\t\t\t\t\tduration: 2000,\n\t\t\t\t\t\t\t\toffset: 80\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t})\n\t\t\t\t})\n\t\t\t\t.catch(() => {})\n\t\t},\n\t\thandleNodeClick(data) {\n\t\t\tthis.treeNode = data\n\t\t\tif (data.id == '0') {\n\t\t\t\tthis.querys[3].value = this.treeNode.code\n\t\t\t\tthis.loadData(1)\n\t\t\t} else {\n\t\t\t\tthis.querys[3].value = this.treeNode.id\n\t\t\t\tthis.loadData(1)\n\t\t\t}\n\t\t},\n\t\thandleRelease(row) {\n\t\t\t// let params={\n\t\t\t// \tid:row.id,\n\t\t\t// \tpublishStatus:row.publishStatus\n\t\t\t// }\n\t\t\tlet publishStatus = row.publishStatus == 1 ? 0 : 1\n\t\t\tconst formData = new FormData()\n\t\t\tformData.append('id', row.id)\n\t\t\tformData.append('publishStatus', publishStatus)\n\t\t\tconst config = {\n\t\t\t\theaders: {\n\t\t\t\t\t'Content-Type': 'multipart/form-data'\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.$http.post(window.context.portal + `/device/product/info/publish`, formData, config).then(res => {\n\t\t\t\tif (res.data.state) {\n\t\t\t\t\tthis.$message.success(`${row.publishStatus==0?'发布':'下架'}成功`)\n\t\t\t\t\tthis.loadData(1)\n\t\t\t\t}\n\t\t\t})\n\n\n\t\t}\n\t}\n}\n",null]}