81 lines
2.2 KiB
Vue
81 lines
2.2 KiB
Vue
|
|
<template>
|
|||
|
|
<div class="default-main">
|
|||
|
|
<TableHeader>
|
|||
|
|
<template v-slot:select>
|
|||
|
|
<el-form-item label="筛选数据">
|
|||
|
|
<el-input
|
|||
|
|
v-model="tableStore.table.params.searchValue"
|
|||
|
|
placeholder="根据名称,容量查询"
|
|||
|
|
/>
|
|||
|
|
</el-form-item>
|
|||
|
|
</template>
|
|||
|
|
|
|||
|
|
</TableHeader>
|
|||
|
|
<Table ref="tableRef" />
|
|||
|
|
</div>
|
|||
|
|
</template>
|
|||
|
|
<script setup lang="tsx">
|
|||
|
|
import { ref, onMounted, provide, reactive } from 'vue'
|
|||
|
|
import TableStore from '@/utils/tableStore'
|
|||
|
|
import Table from '@/components/table/index.vue'
|
|||
|
|
import TableHeader from '@/components/table/header/index.vue'
|
|||
|
|
import { useDictData } from '@/stores/dictData'
|
|||
|
|
|
|||
|
|
const tableRef = ref()
|
|||
|
|
const tableStore = new TableStore({
|
|||
|
|
url: '',
|
|||
|
|
method: 'POST',
|
|||
|
|
column: [
|
|||
|
|
// 第一层:主标题(跨列)
|
|||
|
|
{
|
|||
|
|
title: '谐波源',
|
|||
|
|
width: 300,
|
|||
|
|
children: [
|
|||
|
|
{ field: 'gdName', title: '名称' },
|
|||
|
|
{ field: 'subName', title: '电压等级' },
|
|||
|
|
{ field: 'ip', title: '容量' }
|
|||
|
|
]
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
title: '各次谐波电流含量(%)',
|
|||
|
|
width: 1800, // 根据实际列数调整
|
|||
|
|
children: Array.from({ length: 24 }, (_, i) => ({
|
|||
|
|
field: `harm${i + 2}`,
|
|||
|
|
title: `${i + 2}次`
|
|||
|
|
}))
|
|||
|
|
}
|
|||
|
|
],
|
|||
|
|
})
|
|||
|
|
|
|||
|
|
|
|||
|
|
provide('tableStore', tableStore)
|
|||
|
|
|
|||
|
|
const mockData = [
|
|||
|
|
{
|
|||
|
|
gdName: '变压器A',
|
|||
|
|
subName: '10kV',
|
|||
|
|
ip: '1000kVA',
|
|||
|
|
...Array.from({ length: 24 }, (_, i) => ({ [`harm${i + 2}`]: (Math.random() * 10).toFixed(2) }))
|
|||
|
|
.reduce((acc, cur) => ({ ...acc, ...cur }), {})
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
gdName: '电机B',
|
|||
|
|
subName: '35kV',
|
|||
|
|
ip: '2000kVA',
|
|||
|
|
...Array.from({ length: 24 }, (_, i) => ({ [`harm${i + 2}`]: (Math.random() * 10).toFixed(2) }))
|
|||
|
|
.reduce((acc, cur) => ({ ...acc, ...cur }), {})
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
gdName: '整流器C',
|
|||
|
|
subName: '110kV',
|
|||
|
|
ip: '5000kVA',
|
|||
|
|
...Array.from({ length: 24 }, (_, i) => ({ [`harm${i + 2}`]: (Math.random() * 10).toFixed(2) }))
|
|||
|
|
.reduce((acc, cur) => ({ ...acc, ...cur }), {})
|
|||
|
|
}
|
|||
|
|
]
|
|||
|
|
|
|||
|
|
onMounted(() => {
|
|||
|
|
tableStore.index()
|
|||
|
|
})
|
|||
|
|
</script>
|