档案数量

master
lion 10 months ago
parent e1b51fdfee
commit dfa7374765

@ -1,25 +1,56 @@
import request from "@/utils/request"; import request from "@/utils/request";
export function home(params){ function customParamsSerializer(params) {
return request({ let result = '';
method:'get', for (let key in params) {
url:'/api/chart', if (params.hasOwnProperty(key)) {
params if (Array.isArray(params[key])) {
}) params[key].forEach((item, index) => {
} if (item.key) {
result +=
export function yearChart(params){ `${key}[${index}][key]=${item.key}&${key}[${index}][op]=${item.op}&${key}[${index}][value]=${item.value}&`;
return request({
method:'get', } else {
url:'/api/fill-datas-total-chart', result += `${key}[${index}]=${item}&`
params }
}) });
} } else {
result += `${key}=${params[key]}&`;
export function fillChart(params){ }
return request({ }
method:'get', }
url:'/api/fill-datas-chart', return result.slice(0, -1);
params }
})
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 { import {
index, index,
destroy 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' import state from '@/store/modules/user.js'
export default { export default {
components: { components: {
@ -490,11 +494,15 @@
clickIn(i) { clickIn(i) {
if (i.children && i.children.length > 0) { if (i.children && i.children.length > 0) {
this.historyList.push(this.showData); this.historyList.push(this.showData);
this.showData = i.children; this.showData = i.children;
this.menuName.push(i.name) this.menuName.push(i.name)
this.select.catalog_name = ' / ' + this.menuName.join(" / ") 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 { } else {
this.select.catalog_id = i.id this.select.catalog_id = i.id
this.menuName.push(i.name) this.menuName.push(i.name)
@ -517,7 +525,8 @@
this.menuName.splice(this.menuName.length - 1, 1) this.menuName.splice(this.menuName.length - 1, 1)
this.select.catalog_name = ' / ' + this.menuName.join(" / ") this.select.catalog_name = ' / ' + this.menuName.join(" / ")
this.hasMenu = true this.hasMenu = true
}, },
async getCatalogList(pid) { async getCatalogList(pid) {
const res = await index({ const res = await index({
page_size: 999, page_size: 999,
@ -533,9 +542,44 @@
let pList = this.base.findNodesById(this.catalogList, pid) let pList = this.base.findNodesById(this.catalogList, pid)
console.log("pList", pList) console.log("pList", pList)
this.catalogChildren = pList[0].children 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() { async getAreaList() {
const res = await index({ const res = await index({

@ -25,7 +25,7 @@ module.exports = {
* Detail: https://cli.vuejs.org/config/#publicpath * Detail: https://cli.vuejs.org/config/#publicpath
*/ */
publicPath: process.env.ENV === 'staging' ? '/admin_test' : '/admin', 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', assetsDir: 'static',
css: { css: {
loaderOptions: { // 向 CSS 相关的 loader 传递选项 loaderOptions: { // 向 CSS 相关的 loader 传递选项

Loading…
Cancel
Save