统计分析

This commit is contained in:
geting 2024-11-28 15:36:45 +08:00
parent 4a8bce3b04
commit 0ea9ce926e

View File

@ -79,7 +79,7 @@
:data="attrTableData" :data="attrTableData"
ref="attributeTableRef" ref="attributeTableRef"
@select="selectTable" @select="selectTable"
@selectAll="selectAllTable" @selectAll="selectTable"
row-key="id" row-key="id"
class="attrtable" class="attrtable"
> >
@ -271,30 +271,18 @@ const initSelect = () => {
const multipleSelection: any = ref([]) const multipleSelection: any = ref([])
const selectTable = (section: any) => { const selectTable = (section: any) => {
const defaultCode = multipleSelection.value.map((item: any) => item.attributeCode) const allCode = attrTableData.value.map((item: any) => {
const addSection = section return item.attributeCode
.filter((item: any) => !defaultCode.includes(item.attributeCode)) })
.map((item: any) => { const extraCode = multipleSelection.value.filter((item: any) => !allCode.includes(item.attributeCode))
return { const setionMap = section.map((item: any) => {
attributeName: item.attributeName, return {
attributeCode: item.attributeCode, attributeName: item.attributeName,
unit: item.unit, attributeCode: item.attributeCode,
} unit: item.unit,
}) }
multipleSelection.value = [...multipleSelection.value, ...addSection] })
} multipleSelection.value = [...extraCode, ...setionMap]
const selectAllTable = (section: any) => {
const defaultCode = multipleSelection.value.map((item: any) => item.attributeCode)
const addSection = section
.filter((item: any) => !defaultCode.includes(item.attributeCode))
.map((item: any) => {
return {
attributeName: item.attributeName,
attributeCode: item.attributeCode,
unit: item.unit,
}
})
multipleSelection.value = [...multipleSelection.value, ...addSection]
} }
const attrTableData = ref([]) const attrTableData = ref([])
@ -364,6 +352,7 @@ const getDateRange = (type: 'week' | 'month') => {
const openMeasure = () => { const openMeasure = () => {
showMeasure.value = true showMeasure.value = true
pageSetting.current = 1
} }
const handleSelectionChange1 = (val: any) => { const handleSelectionChange1 = (val: any) => {