Files
admin-sjzx/src/views/pqs/database/model/components/harmonicSources.vue

81 lines
2.4 KiB
Vue
Raw Normal View History

2025-09-11 08:46:12 +08:00
<template>
2025-12-09 20:04:55 +08:00
<div>
2025-09-11 08:46:12 +08:00
<TableHeader>
<template v-slot:select>
2025-09-11 13:14:36 +08:00
<el-form-item label="名称">
2025-12-09 20:04:55 +08:00
<el-input
v-model="tableStore.table.params.searchValue"
clearable
placeholder="请输入搜索名称"
maxlength="32"
show-word-limit
/>
2025-09-11 08:46:12 +08:00
</el-form-item>
</template>
</TableHeader>
2025-12-09 20:04:55 +08:00
<Table ref="tableRef" isGroup />
2025-09-11 08:46:12 +08:00
</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({
2025-09-11 13:14:36 +08:00
url: '/supervision-boot/libModel/pageLibModelQuery',
2025-09-11 08:46:12 +08:00
method: 'POST',
2025-12-09 20:04:55 +08:00
publicHeight: 60,
column: [
2025-09-11 08:46:12 +08:00
{
title: '谐波源',
children: [
2025-09-11 14:48:34 +08:00
{
field: 'index',
title: '序号',
width: '80',
formatter: (row: any) => {
2025-12-09 20:04:55 +08:00
return (
(tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
)
2025-09-11 14:48:34 +08:00
}
},
2025-12-09 20:04:55 +08:00
{ field: 'name', title: '名称', minWidth: 200 },
{ field: 'voltage', title: '电压等级', minWidth: 200 },
{ field: 'capacity', title: '容量', minWidth: 200 }
2025-09-11 08:46:12 +08:00
]
},
{
title: '各次谐波电流含量(%',
2025-09-11 13:14:36 +08:00
width: 1800,
2025-09-11 08:46:12 +08:00
children: Array.from({ length: 24 }, (_, i) => ({
2025-09-11 13:14:36 +08:00
field: `i${i + 2}`,
title: `${i + 2}`,
minWidth: 100
2025-09-11 08:46:12 +08:00
}))
}
],
2025-12-09 20:04:55 +08:00
// 在请求发送前处理参数
2025-09-11 13:14:36 +08:00
beforeSearchFun: () => {
2025-12-09 20:04:55 +08:00
tableStore.table.params.pageSize = 100
2025-09-11 13:14:36 +08:00
},
2025-12-09 20:04:55 +08:00
resetCallback: () => {
2025-09-11 13:14:36 +08:00
tableStore.table.params.searchValue = ''
2025-12-09 20:04:55 +08:00
}
2025-09-11 08:46:12 +08:00
})
2025-09-11 13:14:36 +08:00
tableStore.table.params.type = 1
2025-09-11 08:46:12 +08:00
provide('tableStore', tableStore)
2025-09-11 13:14:36 +08:00
// 暴露查询方法给父组件调用
const queryData = () => {
2025-09-11 08:46:12 +08:00
tableStore.index()
2025-09-11 13:14:36 +08:00
}
defineExpose({
queryData
2025-09-11 08:46:12 +08:00
})
</script>