flat: 数据统计结构更改
This commit is contained in:
@@ -20,9 +20,9 @@ import {confirmCount} from '@/api/report/report'
|
||||
import CustomLoading from "@/components/Custom-Loading/index.vue";
|
||||
import { dateFormat } from "@/util/date";
|
||||
const columnEnum = {
|
||||
'totalCount': '总数',
|
||||
'otherCount': '机构登记数',
|
||||
'registerCount': '总库(其他)',
|
||||
'data1': '总数',
|
||||
'data2': '机构登记数',
|
||||
'data3': '总库(其他)',
|
||||
}
|
||||
const pages = { total: 0, size: 10, currentPage: 1 }
|
||||
const baseOptions = {
|
||||
@@ -59,27 +59,28 @@ export default {
|
||||
computed: {
|
||||
options() {
|
||||
const tableHead = this.headColum.map((item, index) => ({
|
||||
label: item.columnName,
|
||||
label: item.gname,
|
||||
display:false,
|
||||
children: Object.keys(columnEnum).map((key) => ({
|
||||
label: columnEnum[key],
|
||||
prop: `${index}_${item.id}_${key}`,
|
||||
prop: `${index}_${item.gid}_${key}`,
|
||||
display:false,
|
||||
width: 120,
|
||||
width: 100,
|
||||
}))
|
||||
}))
|
||||
console.log('tableHead',tableHead)
|
||||
const headTitle = {
|
||||
label: '机构名称',
|
||||
prop: 'name',
|
||||
search: true,
|
||||
fixed: true,
|
||||
}
|
||||
if(this.infoPages.total !== 0) {headTitle.width = 200}
|
||||
return {
|
||||
...baseOptions,
|
||||
height: 200,
|
||||
width:200,
|
||||
column: [{
|
||||
label: '机构名称',
|
||||
prop: 'name',
|
||||
search: true,
|
||||
fixed: true,
|
||||
width: 200,
|
||||
},
|
||||
column: [
|
||||
headTitle,
|
||||
...tableHead,
|
||||
{
|
||||
label: '日期',
|
||||
@@ -127,13 +128,12 @@ export default {
|
||||
}
|
||||
let resData = await confirmCount(params)
|
||||
if(resData.data.code === 200) {
|
||||
const { list, columnInfo } = resData.data.data
|
||||
const { current, size ,total, records } = list
|
||||
const { current, size ,total, records } = resData.data.data
|
||||
this.infoData = records.map((item) => ({
|
||||
...item,
|
||||
...this.decompose(item.list)
|
||||
}))
|
||||
console.log('infoData',this.infoData)
|
||||
const columnInfo = records.length ? records[0].list : []
|
||||
this.headColum = columnInfo
|
||||
this.infoPages = { ...this.infoPages, currentPage: current, total, size}
|
||||
this.visible = false;
|
||||
@@ -147,8 +147,8 @@ export default {
|
||||
let obj = {}
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
const item = list[i]
|
||||
Object.keys(item).forEach((vitem) => {
|
||||
obj[`${i}_${item.id}_${vitem}`] = item[vitem]
|
||||
Object.keys(item.dataVO).forEach((vitem) => {
|
||||
obj[`${i}_${item.gid}_${vitem}`] = item.dataVO[vitem]
|
||||
})
|
||||
}
|
||||
return obj
|
||||
|
||||
@@ -20,9 +20,9 @@ import {potentialCount} from '@/api/report/report'
|
||||
import CustomLoading from "@/components/Custom-Loading/index.vue";
|
||||
import { dateFormat } from "@/util/date";
|
||||
const columnEnum = {
|
||||
'totalCount': '总数',
|
||||
'otherCount': '机构登记数',
|
||||
'registerCount': '总库(其他)',
|
||||
'data1': '总数',
|
||||
'data2': '机构登记数',
|
||||
'data3': '总库(其他)',
|
||||
}
|
||||
const pages = { total: 0, size: 10, currentPage: 1 }
|
||||
const baseOptions = {
|
||||
@@ -51,6 +51,7 @@ export default {
|
||||
visible: false,
|
||||
search: {},
|
||||
headColum: [],
|
||||
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@@ -59,27 +60,28 @@ export default {
|
||||
computed: {
|
||||
options() {
|
||||
const tableHead = this.headColum.map((item, index) => ({
|
||||
label: item.columnName,
|
||||
label: item.gname,
|
||||
display:false,
|
||||
children: Object.keys(columnEnum).map((key) => ({
|
||||
label: columnEnum[key],
|
||||
prop: `${index}_${item.id}_${key}`,
|
||||
prop: `${index}_${item.gid}_${key}`,
|
||||
display:false,
|
||||
width: 120,
|
||||
width: 100,
|
||||
}))
|
||||
}))
|
||||
console.log('tableHead',tableHead)
|
||||
const headTitle = {
|
||||
label: '机构名称',
|
||||
prop: 'name',
|
||||
search: true,
|
||||
fixed: true,
|
||||
}
|
||||
if(this.infoPages.total !== 0) {headTitle.width = 200}
|
||||
return {
|
||||
...baseOptions,
|
||||
height: 200,
|
||||
width:200,
|
||||
column: [{
|
||||
label: '机构名称',
|
||||
prop: 'name',
|
||||
search: true,
|
||||
fixed: true,
|
||||
width: 200,
|
||||
},
|
||||
column: [
|
||||
headTitle,
|
||||
...tableHead,
|
||||
{
|
||||
label: '日期',
|
||||
@@ -127,13 +129,12 @@ export default {
|
||||
}
|
||||
let resData = await potentialCount(params)
|
||||
if(resData.data.code === 200) {
|
||||
const { list, columnInfo } = resData.data.data
|
||||
const { current, size ,total, records } = list
|
||||
const { current, size ,total, records } = resData.data.data
|
||||
this.infoData = records.map((item) => ({
|
||||
...item,
|
||||
...this.decompose(item.list)
|
||||
}))
|
||||
console.log('infoData',this.infoData)
|
||||
const columnInfo = records.length ? records[0].list : []
|
||||
this.headColum = columnInfo
|
||||
this.infoPages = { ...this.infoPages, currentPage: current, total, size}
|
||||
this.visible = false;
|
||||
@@ -147,8 +148,8 @@ export default {
|
||||
let obj = {}
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
const item = list[i]
|
||||
Object.keys(item).forEach((vitem) => {
|
||||
obj[`${i}_${item.id}_${vitem}`] = item[vitem]
|
||||
Object.keys(item.dataVO).forEach((vitem) => {
|
||||
obj[`${i}_${item.gid}_${vitem}`] = item.dataVO[vitem]
|
||||
})
|
||||
}
|
||||
return obj
|
||||
|
||||
Reference in New Issue
Block a user