档案数量

master
lion 10 months ago
parent e1b51fdfee
commit dfa7374765

@ -1,25 +1,56 @@
import request from "@/utils/request";
export function home(params){
return request({
method:'get',
url:'/api/chart',
params
})
}
export function yearChart(params){
return request({
method:'get',
url:'/api/fill-datas-total-chart',
params
})
}
export function fillChart(params){
return request({
method:'get',
url:'/api/fill-datas-chart',
params
})
import request from "@/utils/request";
function customParamsSerializer(params) {
let result = '';
for (let key in params) {
if (params.hasOwnProperty(key)) {
if (Array.isArray(params[key])) {
params[key].forEach((item, index) => {
if (item.key) {
result +=
`${key}[${index}][key]=${item.key}&${key}[${index}][op]=${item.op}&${key}[${index}][value]=${item.value}&`;
} else {
result += `${key}[${index}]=${item}&`
}
});
} else {
result += `${key}=${params[key]}&`;
}
}
}
return result.slice(0, -1);
}
export function home(params) {
return request({
method: 'get',
url: '/api/chart',
params
})
}
export function yearChart(params) {
return request({
method: 'get',
url: '/api/fill-datas-total-chart',
params
})
}
export function fillChart(params) {
return request({
method: 'get',
url: '/api/fill-datas-chart',
params
})
}
export function catalogTotal(params) {
return request({
method: 'get',
url: '/api/admin/other/catalog-total',
params,
paramsSerializer: customParamsSerializer
})
}

@ -194,7 +194,11 @@
import {
index,
destroy
} from "@/api/system/baseForm.js"
} 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);
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)
@ -517,7 +525,8 @@
this.menuName.splice(this.menuName.length - 1, 1)
this.select.catalog_name = ' / ' + this.menuName.join(" / ")
this.hasMenu = true
},
},
async getCatalogList(pid) {
const res = await index({
page_size: 999,
@ -533,9 +542,44 @@
let pList = this.base.findNodesById(this.catalogList, pid)
console.log("pList", pList)
this.catalogChildren = pList[0].children
this.showData = this.catalogChildren
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({

@ -25,7 +25,7 @@ module.exports = {
* Detail: https://cli.vuejs.org/config/#publicpath
*/
publicPath: process.env.ENV === 'staging' ? '/admin_test' : '/admin',
outputDir: '/Users/mac/Documents/朗业/2024/s-四世同堂-档案/sstt_dangan/public/admin_test',
outputDir: '/Users/mac/Documents/朗业/2024/s-四世同堂-档案/sstt_dangan/public/admin',
assetsDir: 'static',
css: {
loaderOptions: { // 向 CSS 相关的 loader 传递选项

Loading…
Cancel
Save