修改表格操作列

This commit is contained in:
guanj
2026-01-20 14:18:41 +08:00
parent a19952b771
commit 6a112c8ae2
143 changed files with 17745 additions and 17546 deletions

View File

@@ -179,7 +179,7 @@ const tableStore = new TableStore({
{ field: 'duration', title: '持续时间(s)', minWidth: '100' },
{
title: '操作',
title: '操作',fixed: 'right',
width: '120',
render: 'buttons',
buttons: [

View File

@@ -74,9 +74,14 @@
</el-select>
</el-form-item>
<el-form-item label="电网标志">
<el-select v-model="tableStore.table.params.powerFlag" placeholder="请选择电网标志">
<el-option v-for="item in sign" :key="item.id" :label="item.name" :value="item.algoDescribe" />
</el-select>
<el-select v-model="tableStore.table.params.powerFlag" placeholder="请选择电网标志">
<el-option
v-for="item in sign"
:key="item.id"
:label="item.name"
:value="item.algoDescribe"
/>
</el-select>
</el-form-item>
</template>
</TableHeader>
@@ -159,6 +164,8 @@ const tableStore = new TableStore({
title: '电压等级',
field: 'voltageLevel',
align: 'center',
minWidth: 80,
formatter: function (row) {
return row.cellValue ? row.cellValue : '/'
}
@@ -167,6 +174,7 @@ const tableStore = new TableStore({
title: '网络参数',
field: 'networkParam',
align: 'center',
minWidth: 120,
formatter: function (row) {
return row.cellValue ? row.cellValue : '/'
}
@@ -175,6 +183,7 @@ const tableStore = new TableStore({
title: '监测点名称',
field: 'lineName',
align: 'center',
minWidth: 120,
formatter: function (row) {
return row.cellValue ? row.cellValue : '/'
}
@@ -183,6 +192,7 @@ const tableStore = new TableStore({
title: '厂家',
field: 'factoryName',
align: 'center',
minWidth: 80,
formatter: function (row) {
return row.cellValue ? row.cellValue : '/'
}
@@ -191,6 +201,7 @@ const tableStore = new TableStore({
title: '谐波电压(%)',
field: 'harmonicVoltage',
align: 'center',
minWidth: 80,
formatter: function (row) {
return row.cellValue != 3.14159 ? row.cellValue : '/'
}
@@ -199,6 +210,7 @@ const tableStore = new TableStore({
title: '电压偏差(%)',
field: 'voltageOffset',
align: 'center',
minWidth: 80,
formatter: function (row) {
return row.cellValue != 3.14159 ? row.cellValue : '/'
}
@@ -207,6 +219,7 @@ const tableStore = new TableStore({
title: '三相电压不平衡度(%)',
field: 'voltageUnbalance',
align: 'center',
minWidth: 100,
formatter: function (row) {
return row.cellValue != 3.14159 ? row.cellValue : '/'
}
@@ -215,6 +228,7 @@ const tableStore = new TableStore({
title: '间谐波电压含有率(%)',
field: 'interHarmonic',
align: 'center',
minWidth: 100,
formatter: function (row) {
return row.cellValue != 3.14159 ? row.cellValue : '/'
}
@@ -223,6 +237,7 @@ const tableStore = new TableStore({
title: '谐波电流(%)',
field: 'harmonicCurrent',
align: 'center',
minWidth: 80,
formatter: function (row) {
return row.cellValue != 3.14159 ? row.cellValue : '/'
}
@@ -231,6 +246,7 @@ const tableStore = new TableStore({
title: '负序电流(%)',
field: 'negativeCurrent',
align: 'center',
minWidth: 80,
formatter: function (row) {
return row.cellValue != 3.14159 ? row.cellValue : '/'
}
@@ -239,6 +255,7 @@ const tableStore = new TableStore({
title: '频率偏差(%)',
field: 'freqOffset',
align: 'center',
minWidth: 80,
formatter: function (row) {
return row.cellValue != 3.14159 ? row.cellValue : '/'
}
@@ -247,6 +264,7 @@ const tableStore = new TableStore({
title: '闪变(%)',
field: 'flicker',
align: 'center',
minWidth: 80,
formatter: function (row) {
return row.cellValue != 3.14159 ? row.cellValue : '/'
}
@@ -256,7 +274,7 @@ const tableStore = new TableStore({
loadCallback: () => {
tableStore.table.data = tree2List(tableStore.table.data, Math.random() * 1000)
tableStore.table.column[0].title = tableStore.table.params.statisticalType.name
chartsRef.value && chartsRef.value.getTableStoreParams(tableStore.table.params)
setTimeout(() => {
activeName.value == 0 && tableRef.value && tableRef.value.getRef().setAllTreeExpand(true)
@@ -312,7 +330,7 @@ const tree2List = (list: any, id?: string) => {
})
// 返回结果数组
return arr
}
}
onMounted(() => {
tableStore.index()
})

View File

@@ -69,7 +69,7 @@ const tableStore = new TableStore({
{ title: '更新时间', field: 'updateTime' },
{
title: '操作',
title: '操作',fixed: 'right',
width: '180',
render: 'buttons',
buttons: [

View File

@@ -49,7 +49,7 @@ const tableStore = new TableStore({
{ title: '计算时间', field: 'updateTime' },
{ title: '计算窗口', field: 'timeWindow' },
{
title: '操作',
title: '操作',fixed: 'right',
width: '180',
render: 'buttons',
buttons: [

View File

@@ -107,9 +107,9 @@ const tableStore = new TableStore({
minWidth: 150
},
{
title: '操作',
title: '操作',fixed: 'right',
width: '180',
fixed: 'right',
render: 'buttons',
buttons: [
{

View File

@@ -106,9 +106,9 @@ const tableStore = new TableStore({
}
},
{
title: '操作',
title: '操作',fixed: 'right',
width: '180',
fixed: 'right',
render: 'buttons',
buttons: [
{

View File

@@ -123,7 +123,8 @@ const tableStore = new TableStore({
{ field: 'name', title: '电网拓扑', width: 350, type: 'radio', align: 'left', treeNode: true },
{
field: 'ip',
title: '网络参数' ,width:'120px',
title: '网络参数',
width: '120px',
formatter: ({ row }: any) => {
return row.ip || '/'
}
@@ -249,7 +250,7 @@ const searchEvent = debounce(() => {
(item: any) => searchProps.some(key => String(item[key]).toLowerCase().indexOf(filterVal) > -1),
options
)
// console.log('🚀 ~ searchEvent ~ rest:', rest)
// console.log('🚀 ~ searchEvent ~ rest:', rest)
tableStore.table.data = rest
@@ -288,6 +289,10 @@ const exportEvent = () => {
})
exportModelJB(form)
.then(async res => {
if (res == undefined) {
loading.value = false
return
}
let blob = new Blob([res], {
type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
})

View File

@@ -123,7 +123,8 @@ const tableStore = new TableStore({
{ field: 'name', title: '电网拓扑', width: 350, type: 'radio', align: 'left', treeNode: true },
{
field: 'ip',
title: '网络参数' ,width:'120px',
title: '网络参数',
width: '120px',
formatter: ({ row }: any) => {
return row.ip || '/'
}
@@ -249,7 +250,7 @@ const searchEvent = debounce(() => {
(item: any) => searchProps.some(key => String(item[key]).toLowerCase().indexOf(filterVal) > -1),
options
)
// console.log('🚀 ~ searchEvent ~ rest:', rest)
// console.log('🚀 ~ searchEvent ~ rest:', rest)
tableStore.table.data = rest
@@ -288,6 +289,10 @@ const exportEvent = () => {
})
exportModelJB(form)
.then(async res => {
if (res == undefined) {
loading.value = false
return
}
let blob = new Blob([res], {
type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
})

View File

@@ -86,7 +86,7 @@ const tableStore = new TableStore({
item.data[k.r][k.c].v ? (item.data[k.r][k.c] = k.v) : ''
})
})
setTimeout(() => {
luckysheet.create({
container: 'luckysheet',
@@ -126,7 +126,6 @@ const changetype = (val: any) => {
reportForm.value = val.reportForm
}
const selectChange = () => {
if (tableStore.table.data.length != 0) {
setTimeout(() => {
luckysheet && luckysheet?.resize()
@@ -152,6 +151,10 @@ const exportReport = () => {
})
exportModelJB(form)
.then(async res => {
if (res == undefined) {
loading.value = false
return
}
let blob = new Blob([res], {
type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
})

View File

@@ -1,129 +1,141 @@
<!--业务用户管理界面-->
<template>
<div class="default-main">
<TableHeader datePicker area showExport>
<template v-slot:select>
<el-form-item label="筛选数据">
<el-input v-model="tableStore.table.params.searchValue" clearable maxlength="32" show-word-limit placeholder="筛选数据" />
</el-form-item>
</template>
<template v-slot:operation>
<!-- <el-button type="primary" @click="exportEvent" class="ml10" icon="el-icon-Download">导出</el-button> -->
</template>
</TableHeader>
<!--表格-->
<Table ref="tableRef"></Table>
</div>
</template>
<script setup lang="ts">
import { ElMessage } from 'element-plus'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { onMounted, provide, ref } from 'vue'
import { useDictData } from '@/stores/dictData'
import { pageTable } from '@/api/harmonic-boot/luckyexcel.ts'
defineOptions({
name: 'harmonic-boot/reate/word'
})
const dictData = useDictData()
//区域联级选择
const industry = dictData.getBasicData('Interference_Source')
//用户信息弹出框
const tableRef = ref()
const tableStore = new TableStore({
url: '/harmonic-boot/qualifiedReport/pageTable',
method: 'POST',
column: [
{
title: '序号',
width: 80,
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ title: '变电站', field: 'subName', width: 200 },
{ title: '监测点名称', field: 'lineName', width: 200 },
{
title: '行业类型',
field: 'businessType',
formatter: (row: any) => {
return industry.find((item: any) => item.id == row.cellValue)?.name || '/'
}
},
{
title: '分类等级',
field: 'calssificationGrade',
formatter: (row: any) => {
return row.cellValue || '/'
}
},
{ title: '电压等级', field: 'voltageScale' },
{
title: '上级变电站',
field: 'superiorsSubstation',
formatter: (row: any) => {
return row.cellValue || '/'
}
},
{
title: '挂接线路',
field: 'hangLine',
formatter: (row: any) => {
return row.cellValue || '/'
}
},
{
title: 'PT变比',
field: 'pt',
formatter: (row: any) => {
return row.row.pt1 + '/' + row.row.pt2
}
},
{
title: 'CT变比',
field: 'ct',
formatter: (row: any) => {
return row.row.ct1 + '/' + row.row.ct2
}
},
{ title: '短路容量(MVA)', field: 'shortCapacity' },
{ title: '终端容量(MVA)', field: 'deviceCapacity' },
{ title: '协议容量(MVA)', field: 'dealCapacity' },
{ title: '谐波情况', field: 'harmDes' },
{ title: '电能质量情况', field: 'powerDes' }
],
beforeSearchFun: () => {
tableStore.table.params.beginTime = tableStore.table.params.startTime
tableStore.table.params.deptId = tableStore.table.params.deptIndex
}
})
onMounted(() => {
// 加载数据
tableStore.index()
})
tableStore.table.params.searchValue = ''
provide('tableStore', tableStore)
// 导出
const exportEvent = () => {
let form = JSON.parse(JSON.stringify(tableStore.table.params))
form.pageNum = 1
form.pageSize = tableStore.table.total
pageTable(form).then(res => {
tableRef.value.getRef().exportData({
filename: '合格率报告', // 文件名字
sheetName: 'Sheet1',
type: 'xlsx', //导出文件类型 xlsx 和 csv
useStyle: true,
data: res.data.records, // 数据源 // 过滤那个字段导出
columnFilterMethod: function (column: any) {
return !(column.$columnIndex === 0)
}
})
})
}
</script>
<!--业务用户管理界面-->
<template>
<div class="default-main">
<TableHeader datePicker area showExport>
<template v-slot:select>
<el-form-item label="筛选数据">
<el-input
v-model="tableStore.table.params.searchValue"
clearable
maxlength="32"
show-word-limit
placeholder="筛选数据"
/>
</el-form-item>
</template>
<template v-slot:operation>
<!-- <el-button type="primary" @click="exportEvent" class="ml10" icon="el-icon-Download">导出</el-button> -->
</template>
</TableHeader>
<!--表格-->
<Table ref="tableRef"></Table>
</div>
</template>
<script setup lang="ts">
import { ElMessage } from 'element-plus'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { onMounted, provide, ref } from 'vue'
import { useDictData } from '@/stores/dictData'
import { pageTable } from '@/api/harmonic-boot/luckyexcel.ts'
defineOptions({
name: 'harmonic-boot/reate/word'
})
const dictData = useDictData()
//区域联级选择
const industry = dictData.getBasicData('Interference_Source')
//用户信息弹出框
const tableRef = ref()
const tableStore = new TableStore({
url: '/harmonic-boot/qualifiedReport/pageTable',
method: 'POST',
column: [
{
title: '序号',
width: 80,
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ title: '变电站', field: 'subName', width: 200 },
{ title: '监测点名称', field: 'lineName', width: 200 },
{
title: '行业类型',
field: 'businessType',
minWidth: 80,
formatter: (row: any) => {
return industry.find((item: any) => item.id == row.cellValue)?.name || '/'
}
},
{
title: '分类等级',
field: 'calssificationGrade',
minWidth: 80,
formatter: (row: any) => {
return row.cellValue || '/'
}
},
{ title: '电压等级', field: 'voltageScale', minWidth: 80 },
{
title: '上级变电站',
field: 'superiorsSubstation',
minWidth: 90,
formatter: (row: any) => {
return row.cellValue || '/'
}
},
{
title: '挂接线路',
field: 'hangLine',
minWidth: 80,
formatter: (row: any) => {
return row.cellValue || '/'
}
},
{
title: 'PT变比',
field: 'pt',
minWidth: 80,
formatter: (row: any) => {
return row.row.pt1 + '/' + row.row.pt2
}
},
{
title: 'CT变比',
field: 'ct',
minWidth: 80,
formatter: (row: any) => {
return row.row.ct1 + '/' + row.row.ct2
}
},
{ title: '短路容量(MVA)', field: 'shortCapacity', minWidth: 80 },
{ title: '终端容量(MVA)', field: 'deviceCapacity', minWidth: 80 },
{ title: '协议容量(MVA)', field: 'dealCapacity', minWidth: 80 },
{ title: '谐波情况', field: 'harmDes', minWidth: 80 },
{ title: '电能质量情况', field: 'powerDes', minWidth: 100 }
],
beforeSearchFun: () => {
tableStore.table.params.beginTime = tableStore.table.params.startTime
tableStore.table.params.deptId = tableStore.table.params.deptIndex
}
})
onMounted(() => {
// 加载数据
tableStore.index()
})
tableStore.table.params.searchValue = ''
provide('tableStore', tableStore)
// 导出
const exportEvent = () => {
let form = JSON.parse(JSON.stringify(tableStore.table.params))
form.pageNum = 1
form.pageSize = tableStore.table.total
pageTable(form).then(res => {
tableRef.value.getRef().exportData({
filename: '合格率报告', // 文件名字
sheetName: 'Sheet1',
type: 'xlsx', //导出文件类型 xlsx 和 csv
useStyle: true,
data: res.data.records, // 数据源 // 过滤那个字段导出
columnFilterMethod: function (column: any) {
return !(column.$columnIndex === 0)
}
})
})
}
</script>

View File

@@ -87,6 +87,10 @@ const exportEvent = () => {
endTime: TableHeaderRef.value.datePickerRef.timeValue[1]
})
.then((res: any) => {
if (res == undefined) {
loading.value = false
return
}
let blob = new Blob([res], {
type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document;charset=UTF-8'
})

View File

@@ -41,7 +41,13 @@
</template>
<template #operation>
<el-button icon="el-icon-Download" type="primary" @click="exportEvent">导出excel</el-button>
<el-button icon="el-icon-Download" :loading="loading" @click="exportReport" type="primary" v-if="VITE_FLAG">
<el-button
icon="el-icon-Download"
:loading="loading"
@click="exportReport"
type="primary"
v-if="VITE_FLAG"
>
下载报告
</el-button>
</template>
@@ -189,6 +195,10 @@ const exportReport = () => {
})
exportModelJB(form)
.then(async res => {
if (res == undefined) {
loading.value = false
return
}
let blob = new Blob([res], {
type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
})

View File

@@ -151,6 +151,10 @@ const exportEvent = () => {
ElMessage('生成报告中...')
exportModel(form)
.then((res: any) => {
if (res == undefined) {
loading.value = false
return
}
let blob = new Blob([res], {
type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document;charset=UTF-8'
})