|
|
|
|
@ -195,6 +195,10 @@
|
|
|
|
|
index,
|
|
|
|
|
destroy
|
|
|
|
|
} from "@/api/system/baseForm.js"
|
|
|
|
|
import {
|
|
|
|
|
catalogTotal
|
|
|
|
|
} from "@/api/home/index.js"
|
|
|
|
|
|
|
|
|
|
import state from '@/store/modules/user.js'
|
|
|
|
|
export default {
|
|
|
|
|
components: {
|
|
|
|
|
@ -490,11 +494,15 @@
|
|
|
|
|
clickIn(i) {
|
|
|
|
|
if (i.children && i.children.length > 0) {
|
|
|
|
|
this.historyList.push(this.showData);
|
|
|
|
|
|
|
|
|
|
this.showData = i.children;
|
|
|
|
|
this.menuName.push(i.name)
|
|
|
|
|
this.select.catalog_name = ' / ' + this.menuName.join(" / ")
|
|
|
|
|
console.log(this.historyList);
|
|
|
|
|
let totalId = []
|
|
|
|
|
this.showData.map(item=>{
|
|
|
|
|
totalId.push(item.id)
|
|
|
|
|
})
|
|
|
|
|
this.getCatalogTotal(totalId.join(','))
|
|
|
|
|
} else {
|
|
|
|
|
this.select.catalog_id = i.id
|
|
|
|
|
this.menuName.push(i.name)
|
|
|
|
|
@ -518,6 +526,7 @@
|
|
|
|
|
this.select.catalog_name = ' / ' + this.menuName.join(" / ")
|
|
|
|
|
this.hasMenu = true
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
async getCatalogList(pid) {
|
|
|
|
|
const res = await index({
|
|
|
|
|
page_size: 999,
|
|
|
|
|
@ -534,8 +543,43 @@
|
|
|
|
|
console.log("pList", pList)
|
|
|
|
|
this.catalogChildren = pList[0].children
|
|
|
|
|
this.showData = this.catalogChildren
|
|
|
|
|
let totalId = []
|
|
|
|
|
this.showData.map(item=>{
|
|
|
|
|
totalId.push(item.id)
|
|
|
|
|
})
|
|
|
|
|
this.getCatalogTotal(totalId.join(','))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
async getCatalogTotal(ids){
|
|
|
|
|
const res = await catalogTotal({
|
|
|
|
|
ids:ids
|
|
|
|
|
})
|
|
|
|
|
let data = res.list
|
|
|
|
|
const updatedB = this.showData.map((item) => {
|
|
|
|
|
// 在数组 a 中查找匹配的 id
|
|
|
|
|
const matchedItem = data.find((aItem) => aItem.id == item.id);
|
|
|
|
|
|
|
|
|
|
// 如果找到匹配项,则将 records_total 和 sub_records_total 添加到当前项
|
|
|
|
|
if (matchedItem) {
|
|
|
|
|
return {
|
|
|
|
|
...item,
|
|
|
|
|
records_total: matchedItem.records_total,
|
|
|
|
|
sub_records_total: matchedItem.sub_records_total
|
|
|
|
|
};
|
|
|
|
|
}else{
|
|
|
|
|
return {
|
|
|
|
|
...item,
|
|
|
|
|
records_total: 0,
|
|
|
|
|
sub_records_total: 0
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 如果没有找到匹配项,则返回原项
|
|
|
|
|
return item;
|
|
|
|
|
});
|
|
|
|
|
this.showData = updatedB
|
|
|
|
|
console.log("this.showData",this.showData)
|
|
|
|
|
},
|
|
|
|
|
async getAreaList() {
|
|
|
|
|
const res = await index({
|
|
|
|
|
|