历史数据:修改使用模板数据同步
This commit is contained in:
parent
b4143608d8
commit
dc260a5c8d
@ -245,7 +245,7 @@ const templateOptions = ref<
|
||||
time: string[]
|
||||
id: string
|
||||
interval: string
|
||||
column: { label: string; prop: string }[]
|
||||
column: { label: string; prop: string; id: string }[]
|
||||
windBlowerList: string[]
|
||||
}[]
|
||||
>([])
|
||||
@ -259,6 +259,24 @@ const changeTemplate = () => {
|
||||
// selectWindBlower.value = templateData?.windBlowerList ?? selectWindBlower.value
|
||||
submitParams.windBlowerList = templateData?.windBlowerList ?? selectWindBlower.value
|
||||
submitParams.column = templateData?.column ?? multipleSelection.value
|
||||
const selectList: any = []
|
||||
if (templateData?.column) {
|
||||
templateData.column.forEach((item: { label: string; prop: string; id: string }) => {
|
||||
const realProp = item.prop.split('--')
|
||||
const exist = selectList.find((v: any) => v.attributeCode === realProp[0])
|
||||
if (exist) {
|
||||
exist[realProp[1]] = true
|
||||
} else {
|
||||
selectList.push({
|
||||
id: item.id,
|
||||
attributeCode: realProp[0],
|
||||
attributeName: item.label,
|
||||
[realProp[1]]: true,
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
selectRowList.value = selectList
|
||||
}
|
||||
}
|
||||
|
||||
@ -672,30 +690,34 @@ const getcurrentPageForPointDialog = () => {
|
||||
}
|
||||
|
||||
const getAddColumn = () => {
|
||||
const dynamicColumn: { label: string; prop: string }[] = []
|
||||
const dynamicColumn: { label: string; prop: string; id: string }[] = []
|
||||
for (let item of selectRowList.value) {
|
||||
if (item.interpolation) {
|
||||
dynamicColumn.push({
|
||||
label: item.attributeName,
|
||||
prop: item.attributeCode + '--interpolation',
|
||||
id: item.id,
|
||||
})
|
||||
}
|
||||
if (item.average) {
|
||||
dynamicColumn.push({
|
||||
label: item.attributeName + '-平均值',
|
||||
prop: item.attributeCode + '--average',
|
||||
id: item.id,
|
||||
})
|
||||
}
|
||||
if (item.max) {
|
||||
dynamicColumn.push({
|
||||
label: item.attributeName + '-最大值',
|
||||
prop: item.attributeCode + '--max',
|
||||
id: item.id,
|
||||
})
|
||||
}
|
||||
if (item.min) {
|
||||
dynamicColumn.push({
|
||||
label: item.attributeName + '-最小值',
|
||||
prop: item.attributeCode + '--min',
|
||||
id: item.id,
|
||||
})
|
||||
}
|
||||
}
|
||||
@ -710,7 +732,7 @@ const submitParams: {
|
||||
windBlowerList: [],
|
||||
}
|
||||
|
||||
const multipleSelection = ref<{ label: string; prop: string }[]>([])
|
||||
const multipleSelection = ref<{ label: string; prop: string; id: string }[]>([])
|
||||
const moveUp = (index: number) => {
|
||||
const temp = multipleSelection.value[index]
|
||||
multipleSelection.value[index] = multipleSelection.value[index - 1]
|
||||
@ -726,7 +748,7 @@ const moveRemove = (index: number, item: { label: string; prop: string }) => {
|
||||
const realProp = item.prop.split('--')
|
||||
const type = realProp[1] as 'interpolation' | 'average' | 'max' | 'min'
|
||||
const selectRowIndex = selectRowList.value.findIndex((row) => row.attributeCode === realProp[0])!
|
||||
if(selectRowIndex > -1){
|
||||
if (selectRowIndex > -1) {
|
||||
selectRowList.value[selectRowIndex][type] = false
|
||||
}
|
||||
if (
|
||||
@ -963,12 +985,10 @@ const exportExcel = () => {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
.templateOption {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
Loading…
Reference in New Issue
Block a user