{"remainingRequest":"D:\\jenkins\\workspace\\jd_cgpt_fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\jd_cgpt_fvue\\src\\views\\Normal\\BasicDataManagement\\platformManage\\component\\platformClassification.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\jd_cgpt_fvue\\src\\views\\Normal\\BasicDataManagement\\platformManage\\component\\platformClassification.vue","mtime":1717706455733},{"path":"D:\\jenkins\\workspace\\jd_cgpt_fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\jd_cgpt_fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\jd_cgpt_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\nimport pagination from '@/components/pagination'\nimport {TableMixin} from '@/mixins/tableMixin'\nimport basicData from '@/api/basicData'\nexport default {\n name: 'DemandEntry',\n components: {\n pagination\n },\n mixins: [TableMixin],\n data() {\n return {\n tableData: [],\n tableHeight: 1000,\n handleDeleteActive: true,\n handleDeleteId: [],\n tableLoading: false,\n queryParam: {\n pageBean: {\n page: 1,\n pageSize: 20,\n total: 0\n }\n },\n querys: [\n {\n group: 'main',\n operation: 'LIKE',\n parentGroup: '',\n property: 'code',\n relation: 'AND',\n value: ''\n },\n {\n group: 'main',\n operation: 'LIKE',\n parentGroup: '',\n property: 'name',\n relation: 'AND',\n value: ''\n }\n ]\n }\n },\n mounted() {\n this.calcTableHeight()\n //页面缩放从新计算表格的高度\n window.addEventListener('resize', this.calcTableHeight)\n },\n created() {\n this.loadData()\n },\n beforeDestroy() {\n window.removeEventListener('resize', this.calcTableHeight)\n },\n methods: {\n //改变列表状态\n switchChange(val, row) {\n console.log(row)\n let statusValue = {\n ids: [row.id],\n status: val\n }\n function recursivefilter(arr) {\n for (let item of arr) {\n if (item.id) {\n statusValue.ids.push(item.id)\n }\n if (item.children.length > 0) {\n recursivefilter(item.children)\n }\n }\n return arr\n }\n recursivefilter(row.children)\n basicData.bizMaterialCategoryUpdateStatus(statusValue).then(res => {\n if (res.state) {\n this.$message.success(res.message)\n this.loadData()\n }\n })\n },\n // 动态计算表格的高度,自适应当前容器\n calcTableHeight() {\n this.tableHeight = this.$refs.tableContent.offsetHeight\n },\n //导出数据\n dataExport() {\n this.queryParam.querys = []\n if (this.querys[0].value) {\n this.queryParam.querys.push(this.querys[0])\n }\n if (this.querys[1].value) {\n this.queryParam.querys.push(this.querys[1])\n }\n basicData\n .bizMaterialCategoryExportExcelData(this.queryParam)\n .then(res => {\n console.log(res)\n })\n },\n //字典翻译\n getDictName(code, value) {\n return utils.getDictName(code, value)\n },\n //获取数据\n loadData() {\n this.tableLoading = true\n this.queryParam.querys = []\n if (this.querys[0].value) {\n this.queryParam.querys.push(this.querys[0])\n }\n if (this.querys[1].value) {\n this.queryParam.querys.push(this.querys[1])\n }\n basicData.bizMaterialCategorySelectTree(this.queryParam).then(res => {\n this.tableLoading = false\n // res.value = res.value.filter(function(item) {\n // if (item.hasChildren) {\n // return delete item.hasChildren\n // }\n // })\n\n function recursivefilter(arr) {\n for (let item of arr) {\n if (item.hasChildren) {\n delete item.hasChildren\n }\n if (item.children.length > 0) {\n recursivefilter(item.children)\n }\n }\n return arr\n }\n recursivefilter(res.value)\n this.tableData = res.value\n })\n // basicData.bizMaterialCategoryQuery(this.queryParam).then(res => {\n // this.tableLoading = false\n // this.tableData = res.rows\n // })\n },\n //添加\n handleAdd() {\n this.$router.push('materialeditAddDialog')\n },\n // 编辑\n handleEdit(rows) {\n this.$refs.form.clearValidate()\n this.$router.push({\n name: 'materialeditAddDialog',\n query: {editRows: rows, pageBean: this.queryParam}\n })\n },\n // 详情\n handleDetail(rows) {\n this.$router.push({\n name: 'materialDetail',\n query: {detailRows: rows, pageBean: this.queryParam}\n })\n },\n //添加下级\n LowerBtn(rows) {\n this.$router.push({\n name: 'materialeditAddDialog',\n query: {code: rows, pageBean: this.queryParam}\n })\n },\n // 删除\n handleDelete() {\n this.$confirm('确定删除选中数据?', '提示', {\n confirmButtonText: '确 定',\n cancelButtonText: '取 消',\n type: 'warning'\n })\n .then(() => {\n basicData\n .bizMaterialCategoryDeletCategory(this.handleDeleteId)\n .then(res => {\n if (res.state) {\n this.$notify({\n type: 'success',\n message: '删除成功',\n duration: 2000\n })\n this.loadData()\n }\n })\n .catch(res => {\n this.$notify({\n type: 'error',\n message: res.message,\n duration: 2000,\n offset: 80\n })\n })\n })\n .catch(() => {})\n },\n //重置\n clearSearchForm() {\n this.querys[0].value = ''\n this.querys[1].value = ''\n this.loadData()\n },\n // 顶部搜索\n handleSearch() {\n this.loadData()\n },\n handleSelectionChange(val) {\n if (val.length !== 0) {\n this.handleDeleteActive = false\n this.handleDeleteId = val.map(item => {\n return item.id\n })\n } else {\n this.handleDeleteActive = true\n }\n },\n handleCurrentChange(page) {\n this.queryParam.pageBean = {...this.queryParam.pageBean, page}\n this.loadData(this.queryParam)\n },\n handleSizeChange(pageSize) {\n this.queryParam.pageBean = {...this.queryParam.pageBean, pageSize}\n this.loadData(this.queryParam)\n }\n },\n computed: {\n SearchPanel() {\n return {\n '--searchPanel': this.searchPanel + 'px'\n }\n }\n }\n}\n",null]}