数据迁移

This commit is contained in:
GGJ
2024-10-24 08:51:29 +08:00
parent 2e364d82ed
commit 1aa7e4263b
9 changed files with 559 additions and 58 deletions

View File

@@ -4,19 +4,9 @@
<el-option v-for="item in timeOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
<el-date-picker
v-model="timeValue"
type="daterange"
:disabled="disabledPicker"
style="width: 220px; margin-right: 10px"
unlink-panels
:clearable="false"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="YYYY-MM-DD"
:shortcuts="shortcuts"
/>
<el-date-picker v-model="timeValue" type="daterange" :disabled="disabledPicker"
style="width: 220px; margin-right: 10px" unlink-panels :clearable="false" range-separator=""
start-placeholder="开始日期" end-placeholder="结束日期" value-format="YYYY-MM-DD" :shortcuts="shortcuts" />
<el-button :disabled="backDisabled" type="primary" :icon="DArrowLeft" @click="preClick"></el-button>
<el-button type="primary" :icon="VideoPause" @click="nowTime">当前</el-button>
<el-button :disabled="preDisabled" type="primary" :icon="DArrowRight" @click="next"></el-button>
@@ -43,7 +33,7 @@ const count = ref(0)
const disabledPicker = ref(true)
const timeValue = ref()
const backDisabled = ref(false)
const preDisabled = ref(false)
const preDisabled = ref(true)
const timeOptions: any = ref([
{ label: '年份', value: 1 },
{ label: '季度', value: 2 },
@@ -86,7 +76,7 @@ onMounted(() => {
// 选择时间范围
const timeChange = (e: number) => {
backDisabled.value = false
preDisabled.value = false
preDisabled.value = props.nextFlag?false: true
count.value = 0
if (e == 1) {
disabledPicker.value = true
@@ -111,7 +101,7 @@ const timeChange = (e: number) => {
} else if (e == 5) {
disabledPicker.value = false
backDisabled.value = true
preDisabled.value = true
preDisabled.value = props.nextFlag?false: true
timeValue.value = [setTime(), setTime()]
}
if (e == 1 || e == 2) {
@@ -128,6 +118,7 @@ const nowTime = () => {
}
// 上一个
const preClick = () => {
preDisabled.value = false
let startTime = timeValue.value[0]
let endTime = timeValue.value[1]
let year = parseInt(startTime.substring(0, 4))
@@ -391,6 +382,7 @@ const next = () => {
if (year >= presentY && !props.nextFlag) {
startTime = presentY + '-01-01'
if (presentM < 10) {
if (presentD < 10) {
endTime = presentY + '-0' + presentM + '-0' + presentD
} else {
@@ -407,7 +399,14 @@ const next = () => {
startTime = year + '-01-01'
endTime = year + '-12-31'
}
}
if (!props.nextFlag) {
if (new Date(endTime + ' 00:00:00').getTime() >= new Date(window.XEUtils.toDateString(new Date(), 'yyyy-MM-dd ') + ' 00:00:00').getTime()) {
preDisabled.value = props.nextFlag?false: true
}
}
timeValue.value = [startTime, endTime]
}

View File

@@ -6,7 +6,7 @@
<div class="device-manage-right">
<el-form :inline="true" class="demo-form-inline">
<el-form-item style="position: relative; z-index: 2">
<el-button icon="el-icon-Plus" type="primary" @click="add"> </el-button>
<el-button icon="el-icon-Plus" type="primary" @click="add" v-if="!VITE_FLAG"> </el-button>
<el-button icon="el-icon-Edit" type="primary" @click="update"> </el-button>
<el-button icon="el-icon-Close" type="danger" @click="remove"> </el-button>
<el-button

View File

@@ -1,7 +1,7 @@
<template>
<div class="default-main">
<!-- 案例库 -->
<TableHeader ref="TableHeaderRef" datePicker>
<TableHeader ref="TableHeaderRef" >
<template #select>
<el-form-item label="名称">
<el-input v-model="tableStore.table.params.searchValue" clearable

View File

@@ -0,0 +1,139 @@
<template>
<div class="default-main">
<TableHeader datePicker area>
<template #select>
<el-form-item label="统计类型:">
<el-select v-model="tableStore.table.params.statisticalType" placeholder="请选择统计类型" value-key="id">
<el-option v-for="item in classificationData" :key="item.id" :label="item.name" :value="item">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="电压等级:">
<el-select v-model="tableStore.table.params.scale" filterable multiple collapse-tags clearable
placeholder="请选择电压等级" value-key="id">
<el-option v-for="item in voltageleveloption" :key="item.id" :label="item.name" :value="item">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="终端厂家:">
<el-select v-model="tableStore.table.params.manufacturer" filterable multiple collapse-tags
clearable placeholder="请选择终端厂家" value-key="id">
<el-option v-for="item in terminaloption" :key="item.id" :label="item.name" :value="item">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="干扰源类型:">
<el-select v-model="tableStore.table.params.loadType" filterable multiple collapse-tags clearable
placeholder="请选择干扰源类型" value-key="id">
<el-option v-for="item in interfereoption" :key="item.id" :label="item.name" :value="item">
</el-option>
</el-select>
</el-form-item>
</template>
</TableHeader>
<Table ref="tableRef" isGroup />
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import { useDictData } from '@/stores/dictData'
import TableHeader from '@/components/table/header/index.vue'
const dictData = useDictData()
defineOptions({
name: 'harmonic-boot/detailedAnalysis/details'
})
const view = ref(true)
const classificationData = dictData.getBasicData('Statistical_Type', ["Report_Type"])
const voltageleveloption = dictData.getBasicData('Dev_Voltage_Stand')
const terminaloption = dictData.getBasicData('Dev_Manufacturers')
const interfereoption = dictData.getBasicData('Interference_Source')
const tableStore = new TableStore({
url: '/harmonic-boot/detailAnalysis/lineOverLimit',
method: 'POST',
column: [
{ field: 'index', title: '序号', width: '60', formatter: (row: any) => { return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1 } },
{ field: 'provinceCompany', title: '地级区', minWidth: "150px", },
{ field: 'cityCompany', title: '供电公司', minWidth: "150px", },
{ field: 'subName', title: '变电站', minWidth: "150px", },
{ field: 'lineScale', title: '电压等级', minWidth: "150px", },
{ field: 'lineName', title: '监测点名称', minWidth: "150px", },
{ field: 'loadType', title: '干扰源类型', minWidth: "150px", },
{ field: 'lineObjectName', title: '监测点对象名称', minWidth: "150px", formatter: (row: any) => { return row.cellValue == null ? '/' : row.cellValue } },
{ field: 'overDay', title: '超标天数', minWidth: "150px", },
{ field: 'freqOverDay', title: '频率偏差超标天数', minWidth: "150px", },
{ field: 'volDevOverDay', title: '电压偏差超标天数', minWidth: "180px", },
{ field: 'volDisOverDay', title: '电压总畸变率超标天数', minWidth: "180px", },
{ field: 'volContainOverDay', title: '谐波电压含有率超标天数', minWidth: "180px", },
{ field: 'harmVolOverDay', title: '谐波电压超标天数', minWidth: "180px", },
{ field: 'harmCurOverDay', title: '谐波电流超标天数', minWidth: "180px", },
{
title: '各次谐波电压含有率(%)',
children: [
{ field: 'overVolThreeTimes', title: '3次', minWidth: "80px", },
{ field: 'overVolFiveTimes', title: '5次', minWidth: "80px", },
{ field: 'overVolSevenTimes', title: '7次', minWidth: "80px", },
{ field: 'overVolElevenTimes', title: '11次', minWidth: "80px", },
{ field: 'overVolThirteenTimes', title: '13次', minWidth: "80px", },
{ field: 'overVolTwentyThreeTimes', title: '23次', minWidth: "80px", },
{ field: 'overVolTwentyFiveTimes', title: '25次', minWidth: "80px", },
{ field: 'overVolOtherTimes', title: '其他次', minWidth: "80px", },
],
},
{
title: '各次谐波电流幅值(A)',
children: [
{ field: 'overCurThreeTimes', title: '3次', minWidth: "80px", },
{ field: 'overCurFiveTimes', title: '5次', minWidth: "80px", },
{ field: 'overCurSevenTimes', title: '7次', minWidth: "80px", },
{ field: 'overCurElevenTimes', title: '11次', minWidth: "80px", },
{ field: 'overCurThirteenTimes', title: '13次', minWidth: "80px", },
{ field: 'overCurTwentyThreeTimes', title: '23次', minWidth: "80px", },
{ field: 'overCurTwentyFiveTimes', title: '25次', minWidth: "80px", },
{ field: 'overCurOtherTimes', title: '其他次', minWidth: "80px", },
],
},
{ field: 'threeUnbalance', title: '三相电压不平衡度超标天数', minWidth: "180px", },
{ field: 'negativeOverDay', title: '负序电流超标天数', minWidth: "180px", },
{ field: 'flickerOverDay', title: '闪变超标天数', minWidth: "180px", },
{ field: 'monitorNumber', title: '监测点编号', minWidth: "180px", formatter: (row: any) => { return row.cellValue == null ? '/' : row.cellValue } },
],
beforeSearchFun: () => {
},
})
tableStore.table.params.statisticalType = classificationData[0]
tableStore.table.params.serverName = "harmonic-boot"
tableStore.table.params.powerFlag = 2
tableStore.table.params.monitorFlag = 2
tableStore.table.params.scale = []
tableStore.table.params.manufacturer = []
tableStore.table.params.loadType = []
const wp = ref({})
provide('tableStore', tableStore)
onMounted(() => {
tableStore.index()
})
</script>

View File

@@ -0,0 +1,163 @@
<template>
<div class="default-main">
<TableHeader datePicker area>
<template #select>
<el-form-item label="统计类型:">
<el-select v-model="tableStore.table.params.statisticalType" placeholder="请选择统计类型" value-key="id">
<el-option v-for="item in classificationData" :key="item.id" :label="item.name" :value="item">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="电压等级:">
<el-select v-model="tableStore.table.params.scale" filterable multiple collapse-tags clearable
placeholder="请选择电压等级" value-key="id">
<el-option v-for="item in voltageleveloption" :key="item.id" :label="item.name" :value="item">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="终端厂家:">
<el-select v-model="tableStore.table.params.manufacturer" filterable multiple collapse-tags
clearable placeholder="请选择终端厂家" value-key="id">
<el-option v-for="item in terminaloption" :key="item.id" :label="item.name" :value="item">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="干扰源类型:">
<el-select v-model="tableStore.table.params.loadType" filterable multiple collapse-tags clearable
placeholder="请选择干扰源类型" value-key="id">
<el-option v-for="item in interfereoption" :key="item.id" :label="item.name" :value="item">
</el-option>
</el-select>
</el-form-item>
</template>
</TableHeader>
<Table ref="tableRef" isGroup :key="num" />
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import { useDictData } from '@/stores/dictData'
import TableHeader from '@/components/table/header/index.vue'
const dictData = useDictData()
defineOptions({
name: 'harmonic-boot/detailedAnalysis/contrast'
})
const view = ref(true)
const classificationData = dictData.getBasicData('Statistical_Type', ["Report_Type"])
const voltageleveloption = dictData.getBasicData('Dev_Voltage_Stand')
const terminaloption = dictData.getBasicData('Dev_Manufacturers')
const interfereoption = dictData.getBasicData('Interference_Source')
const num = ref(0)
const tableStore = new TableStore({
url: '/harmonic-boot/detailAnalysis/overAreaStatistics',
method: 'POST',
isWebPaging: true,
column: [
{ field: 'index', title: '序号', width: '60', formatter: (row: any) => { return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1 } },
{ field: 'name', title: '电网拓扑', minWidth: "180px", },
{ field: 'onlineMonitorNumber', title: '在线监测点数量(个)', minWidth: "200px", formatter: (row: any) => { return row.cellValue == -1 ? '/' : row.cellValue } },
{ field: 'overLimitMonitorNumber', title: '超标监测点数量(个)', minWidth: "200px", formatter: (row: any) => { return row.cellValue == -1 ? '/' : row.cellValue } },
{ field: 'overBiLi', title: '超标监测点占比(个)', minWidth: "200px", formatter: (row: any) => { return row.cellValue == -1 ? '/' : row.cellValue } },
{
title: '频率偏差超标情况',
children: [
{ field: 'frequencyMonitorNumber', title: '超标点数(天/点)', minWidth: "200px", formatter: (row: any) => { return row.cellValue == -1 ? '/' : row.cellValue } },
{ field: 'frequencyBiLi', title: '超标占比(%)', minWidth: '120px', formatter: (row: any) => { return row.cellValue == -1 ? '/' : row.cellValue } },
{ field: 'frequencyOverDayBiLi', title: '平均超标天数(天/点)', minWidth: "200px", formatter: (row: any) => { return row.cellValue == -1 ? '/' : row.cellValue } },
],
},
{
title: '电压偏差超标情况',
children: [
{ field: 'voltageMonitorNumber', title: '超标点数(天/点)', minWidth: "200px", formatter: (row: any) => { return row.cellValue == -1 ? '/' : row.cellValue } },
{ field: 'voltageBiLi', title: '超标占比(%)', minWidth: '120px', formatter: (row: any) => { return row.cellValue == -1 ? '/' : row.cellValue } },
{ field: 'voltageOverDayBiLi', title: '平均超标天数(天/点)', minWidth: "200px", formatter: (row: any) => { return row.cellValue == -1 ? '/' : row.cellValue } },
],
},
{
title: '谐波电压超标情况',
children: [
{ field: 'harmonicVoltageMonitorNumber', title: '超标点数(天/点)', minWidth: "200px", formatter: (row: any) => { return row.cellValue == -1 ? '/' : row.cellValue } },
{ field: 'harmonicVoltageBiLi', title: '超标占比(%)', minWidth: '120px', formatter: (row: any) => { return row.cellValue == -1 ? '/' : row.cellValue } },
{ field: 'harmonicVoltageOverDayBiLi', title: '平均超标天数(天/点)', minWidth: "200px", formatter: (row: any) => { return row.cellValue == -1 ? '/' : row.cellValue } },
],
},
{
title: '谐波电流超标情况',
children: [
{ field: 'harmonicCurrentMonitorNumber', title: '超标点数(天/点)', minWidth: "200px", formatter: (row: any) => { return row.cellValue == -1 ? '/' : row.cellValue } },
{ field: 'harmonicCurrentBiLi', title: '超标占比(%)', minWidth: '120px', formatter: (row: any) => { return row.cellValue == -1 ? '/' : row.cellValue } },
{ field: 'harmonicCurrentOverDayBiLi', title: '平均超标天数(天/点)', minWidth: "200px", formatter: (row: any) => { return row.cellValue == -1 ? '/' : row.cellValue } },
],
},
{
title: '三相电压不平衡度超标情况',
children: [
{ field: 'threePhaseVoltageMonitorNumber', title: '超标点数(天/点)', minWidth: "200px", formatter: (row: any) => { return row.cellValue == -1 ? '/' : row.cellValue } },
{ field: 'threePhaseVoltageBiLi', title: '超标占比(%)', minWidth: '120px', formatter: (row: any) => { return row.cellValue == -1 ? '/' : row.cellValue } },
{ field: 'threePhaseVoltageOverDayBiLi', title: '平均超标天数(天/点)', minWidth: "200px", formatter: (row: any) => { return row.cellValue == -1 ? '/' : row.cellValue } },
],
},
{
title: '闪变超标情况',
children: [
{ field: 'flickerMonitorNumber', title: '超标点数(天/点)', minWidth: "200px", formatter: (row: any) => { return row.cellValue == -1 ? '/' : row.cellValue } },
{ field: 'flickerBiLi', title: '超标占比(%)', minWidth: '120px', formatter: (row: any) => { return row.cellValue == -1 ? '/' : row.cellValue } },
{ field: 'flickerOverDayBiLi', title: '平均超标天数(天/点)', minWidth: "200px", formatter: (row: any) => { return row.cellValue == -1 ? '/' : row.cellValue } },
],
},
{
title: '负序电流超标情况',
children: [
{ field: 'negativeMonitorNumber', title: '超标点数(天/点)', minWidth: "200px", formatter: (row: any) => { return row.cellValue == -1 ? '/' : row.cellValue } },
{ field: 'negativeBiLi', title: '超标占比(%)', minWidth: '120px', formatter: (row: any) => { return row.cellValue == -1 ? '/' : row.cellValue } },
{ field: 'negativeOverDayBiLi', title: '平均超标天数(天/点)', minWidth: "200px", formatter: (row: any) => { return row.cellValue == -1 ? '/' : row.cellValue } },
],
},
{
title: '间谐波电压超标情况',
children: [
{ field: 'interHarmonicMonitorNumber', title: '超标点数(天/点)', minWidth: "200px", formatter: (row: any) => { return row.cellValue == -1 ? '/' : row.cellValue } },
{ field: 'interHarmonicBiLi', title: '超标占比(%)', minWidth: '120px', formatter: (row: any) => { return row.cellValue == -1 ? '/' : row.cellValue } },
{ field: 'interHarmonicOverDayBiLi', title: '平均超标天数(天/点)', minWidth: "200px", formatter: (row: any) => { return row.cellValue == -1 ? '/' : row.cellValue } },
],
},
],
beforeSearchFun: () => {
tableStore.options.column[1].title = tableStore.table.params.statisticalType.name
num.value += 1
},
})
tableStore.table.params.statisticalType = classificationData[0]
tableStore.table.params.serverName = "harmonic-boot"
tableStore.table.params.powerFlag = 2
tableStore.table.params.monitorFlag = 2
tableStore.table.params.scale = []
tableStore.table.params.manufacturer = []
tableStore.table.params.loadType = []
const wp = ref({})
provide('tableStore', tableStore)
onMounted(() => {
tableStore.index()
})
</script>

View File

@@ -1,6 +1,9 @@
<template>
<TableHeader area datePicker ref="TableHeaderRef">
<template #select>
<el-form-item label="筛选">
<el-input v-model="tableStore.table.params.filterName" @keyup="searchEvent" placeholder="输入关键字筛选" />
</el-form-item>
<el-form-item label="统计类型:">
<el-select v-model="tableStore.table.params.statisticalType" value-key="id" placeholder="请选择统计类型">
<el-option v-for="item in classificationData" :key="item.id" :label="item.name"
@@ -49,9 +52,12 @@ import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { useDictData } from '@/stores/dictData'
import { exportModelJB } from '@/api/harmonic-boot/harmonic.ts'
import { debounce } from 'lodash-es'
import XEUtils from 'xe-utils'
const dictData = useDictData()
const tableRef = ref()
const treeDataCopy: any = ref([])
const treeData: any = ref([])
const classificationData = dictData.getBasicData('Statistical_Type', ['Report_Type'])
const voltageleveloption = dictData.getBasicData('Dev_Voltage_Stand')
const terminaloption = dictData.getBasicData('Dev_Manufacturers')
@@ -138,21 +144,15 @@ const tableStore = new TableStore({
tableStore.options.column[0].title = tableStore.table.params.statisticalType.name
},
loadCallback: () => {
let treeData = []
// tableStore.table.data.forEach((item: any) => {
// if (item.children.length > 0) {
// item.children.forEach((k: any) => {
// k.pid = item.id
// })
// }
// })
treeData = tree2List(tableStore.table.data, Math.random() * 1000)
tableStore.table.data = JSON.parse(JSON.stringify(treeData))
setTimeout(() => {
tableRef.value.getRef().setAllTreeExpand(true)
}, 0)
}, 1000)
treeData.value = tree2List(tableStore.table.data, Math.random() * 1000)
treeDataCopy.value = JSON.parse(JSON.stringify(treeData.value))
tableStore.table.data = treeData.value
tableStore.table.params.filterName=''
searchEvent()
}
})
const loading = ref(false)
@@ -188,6 +188,33 @@ const tree2List = (list: any, id: any) => {
onMounted(() => {
tableStore.index()
})
const searchEvent = debounce(() => {
const filterVal = XEUtils.toValueString(tableStore.table.params.filterName).trim().toLowerCase()
if (filterVal) {
const options = { children: 'children' }
const searchProps = ['name']
const rest = XEUtils.searchTree(
treeDataCopy.value,
(item: any) => searchProps.some(key => String(item[key]).toLowerCase().indexOf(filterVal) > -1),
options
)
console.log("🚀 ~ searchEvent ~ rest:", rest)
tableStore.table.data = rest
// 搜索之后默认展开所有子节点
} else {
tableStore.table.data = treeDataCopy.value
}
nextTick(() => {
const $table = tableRef.value.getRef()
if ($table) {
$table.setAllTreeExpand(true)
}
})
}, 500)
const exportEvent = () => {
let line = tableRef.value.getRef().getRadioRecord()
if (!line) {

View File

@@ -1,6 +1,9 @@
<template>
<TableHeader area datePicker ref="TableHeaderRef">
<template #select>
<el-form-item label="筛选">
<el-input v-model="tableStore.table.params.filterName" @keyup="searchEvent" placeholder="输入关键字筛选" />
</el-form-item>
<el-form-item label="统计类型:">
<el-select v-model="tableStore.table.params.statisticalType" value-key="id" placeholder="请选择统计类型">
<el-option v-for="item in classificationData" :key="item.id" :label="item.name"
@@ -31,7 +34,8 @@
</el-form-item>
</template>
</TableHeader>
<Table ref="tableRef" :tree-config="{ transform: true, parentField: 'uPid',rowField:'uId' }" :scroll-y="{ enabled: true }" />
<Table ref="tableRef" :tree-config="{ transform: true, parentField: 'uPid', rowField: 'uId' }"
:scroll-y="{ enabled: true }" :key="num" />
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick } from 'vue'
@@ -39,14 +43,18 @@ 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'
import { debounce } from 'lodash-es'
import XEUtils from 'xe-utils'
const dictData = useDictData()
const tableRef = ref()
const num = ref(0)
const classificationData = dictData.getBasicData('Statistical_Type', ['Report_Type'])
const voltageleveloption = dictData.getBasicData('Dev_Voltage_Stand')
const terminaloption = dictData.getBasicData('Dev_Manufacturers')
const interfereoption = dictData.getBasicData('Interference_Source')
const treeDataCopy: any = ref([])
const treeData: any = ref([])
const TableHeaderRef = ref()
const tableStore = new TableStore({
url: '/device-boot/terminalOnlineRateData/getOnlineRateData',
@@ -129,31 +137,19 @@ const tableStore = new TableStore({
beforeSearchFun: () => {
tableStore.options.column[0].title = tableStore.table.params.statisticalType.name
},
loadCallback: () => {
let treeData = []
// tableStore.table.data.forEach((item: any, index: number) => {
// item.id = Math.floor(Math.random() * 1000)
// item.pid = index
// if (item.children.length > 0) {
// item.children.forEach((k: any) => {
// k.id = Math.floor(Math.random() * 1000)
// k.pid = item.id
// // if (k.children.length > 0) {
// // k.children.forEach((v: any) => {
// // v.id = Math.floor(Math.random() * 1000)
// // v.pid = k.id
// // })
// // }
// })
// }
// })
treeData = tree2List(tableStore.table.data, Math.random() * 1000)
tableStore.table.data = JSON.parse(JSON.stringify(treeData))
loadCallback: () => {
setTimeout(() => {
tableRef.value.getRef().setAllTreeExpand(true)
}, 0)
}, 1000)
treeData.value = tree2List(tableStore.table.data, Math.random() * 1000)
treeDataCopy.value = JSON.parse(JSON.stringify(treeData.value))
tableStore.table.data = treeData.value
tableStore.table.params.filterName=''
searchEvent()
}
})
@@ -186,6 +182,34 @@ const tree2List = (list: any, id: any) => {
// 返回结果数组
return arr
}
// 表格过滤
const searchEvent = debounce(() => {
const filterVal = XEUtils.toValueString(tableStore.table.params.filterName).trim().toLowerCase()
if (filterVal) {
const options = { children: 'children' }
const searchProps = ['name']
const rest = XEUtils.searchTree(
treeDataCopy.value,
(item: any) => searchProps.some(key => String(item[key]).toLowerCase().indexOf(filterVal) > -1),
options
)
console.log("🚀 ~ searchEvent ~ rest:", rest)
tableStore.table.data = rest
// 搜索之后默认展开所有子节点
} else {
tableStore.table.data = treeDataCopy.value
}
nextTick(() => {
const $table = tableRef.value.getRef()
if ($table) {
$table.setAllTreeExpand(true)
}
})
}, 500)
onMounted(() => {
tableStore.index()
})

View File

@@ -0,0 +1,149 @@
<template>
<div class="default-main">
<TableHeader area>
<template #select>
<!-- <el-form-item label="统计类型:">
<el-select v-model="tableStore.table.params.statisticalType" placeholder="请选择统计类型" value-key="id">
<el-option v-for="item in classificationData" :key="item.id" :label="item.name" :value="item">
</el-option>
</el-select>
</el-form-item> -->
<el-form-item label="电压等级:">
<el-select v-model="tableStore.table.params.scale" filterable multiple collapse-tags clearable
placeholder="请选择电压等级" value-key="id">
<el-option v-for="item in voltageleveloption" :key="item.id" :label="item.name" :value="item">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="终端厂家:">
<el-select v-model="tableStore.table.params.manufacturer" filterable multiple collapse-tags
clearable placeholder="请选择终端厂家" value-key="id">
<el-option v-for="item in terminaloption" :key="item.id" :label="item.name" :value="item">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="干扰源类型:">
<el-select v-model="tableStore.table.params.loadType" filterable multiple collapse-tags clearable
placeholder="请选择干扰源类型" value-key="id">
<el-option v-for="item in interfereoption" :key="item.id" :label="item.name" :value="item">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="通讯状态:">
<el-select v-model="tableStore.table.params.comFlag" filterable multiple collapse-tags clearable
placeholder="请选择通讯状态">
<el-option v-for="item in communicationstatus" :key="item.value" :label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="终端状态:">
<el-select v-model="tableStore.table.params.runFlag" filterable multiple collapse-tags clearable
placeholder="请选择终端状态">
<el-option v-for="item in terminalstatus" :key="item.value" :label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="评价筛选">
<el-input v-model="tableStore.table.params.evaluate" clearable placeholder="输入关键字筛选" />
</el-form-item>
</template>
</TableHeader>
<Table ref="tableRef" />
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import { useDictData } from '@/stores/dictData'
import TableHeader from '@/components/table/header/index.vue'
const dictData = useDictData()
defineOptions({
name: 'harmonic-boot/run/terminalmessage'
})
const view = ref(true)
const classificationData = dictData.getBasicData('Statistical_Type', ["Report_Type"])
const voltageleveloption = dictData.getBasicData('Dev_Voltage_Stand')
const terminaloption = dictData.getBasicData('Dev_Manufacturers')
const interfereoption = dictData.getBasicData('Interference_Source')
const communicationstatus = [
{ value: 0, label: "中断" },
{ value: 1, label: "正常" },
]
const terminalstatus = [
{ value: 0, label: "投运" },
{ value: 1, label: "热备用" },
{ value: 2, label: "停运" },
]
const tableStore = new TableStore({
url: '/device-boot/runManage/getLineLedger',
method: 'POST',
isWebPaging: true,
column: [
{
field: 'index',
title: '序号',
width: '60',
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ field: 'areaName', title: '区域' },
{ field: 'gdName', title: '地级区' },
{
field: 'bdName',
title: '供电公司',
minWidth: 100
},
{ field: 'manufacturer', title: '厂家' , minWidth: 100},
{ field: 'scale', title: '电压等级' , minWidth: 100},
{ field: 'businessType', title: '行业类型' , minWidth: 100},
{ field: 'devName', title: '终端名称', minWidth: 80 },
{ field: 'ip', title: '网络参数' , minWidth: 100},
{ field: 'lineName', title: '监测点名称' , minWidth: 100},
{ field: 'comFlag', title: '通讯状态' , minWidth: 100},
{ field: 'loadType', title: '干扰源类型' , minWidth: 100},
{ field: 'objName', title: '监测点对象名称' , minWidth: 240},
],
loadCallback: () => {
tableStore.table.data.map((item: any) => {
item.onlineEvaluate == 3.14159 ? item.onlineEvaluate = '/' : item.onlineEvaluate <= 0.6 ? item.onlineEvaluate = '差' : item.onlineEvaluate <= 0.9 ? item.onlineEvaluate = '良' : item.onlineEvaluate <= 1 ? item.onlineEvaluate = '优' : '/'
})
}
})
tableStore.table.params.statisticalType = classificationData[0]
tableStore.table.params.serverName = "harmonic-boot"
tableStore.table.params.comFlag = []
tableStore.table.params.runFlag = []
tableStore.table.params.evaluate = ''
tableStore.table.params.powerFlag = 2
tableStore.table.params.monitorFlag = 2
tableStore.table.params.scale = []
tableStore.table.params.manufacturer = []
tableStore.table.params.loadType = []
const wp = ref({})
provide('tableStore', tableStore)
onMounted(() => {
tableStore.index()
})
</script>

View File

@@ -3,12 +3,12 @@
<TableHeader area>
<template #select>
<el-form-item label="统计类型:">
<!-- <el-form-item label="统计类型:">
<el-select v-model="tableStore.table.params.statisticalType" placeholder="请选择统计类型" value-key="id">
<el-option v-for="item in classificationData" :key="item.id" :label="item.name" :value="item">
</el-option>
</el-select>
</el-form-item>
</el-form-item> -->
<el-form-item label="电压等级:">
<el-select v-model="tableStore.table.params.scale" filterable multiple collapse-tags clearable
placeholder="请选择电压等级" value-key="id">