Compare commits
17 Commits
2025-10
...
25971e5239
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
25971e5239 | ||
|
|
c3d7e91f4e | ||
|
|
72c37c2759 | ||
|
|
d1eb7f2dad | ||
|
|
308ceb1a03 | ||
|
|
ad7b77ff92 | ||
|
|
0e76ab66f3 | ||
|
|
24afa84f29 | ||
|
|
a5f3571906 | ||
|
|
d16d262d1a | ||
|
|
593f2e2c66 | ||
|
|
d1e7aab876 | ||
|
|
8a3e0263d2 | ||
|
|
35ce7314b0 | ||
|
|
5538d18127 | ||
|
|
00dd79e000 | ||
|
|
b5aff1a837 |
10
src/api/harmonic-boot/cockpit/cockpit.ts
Normal file
10
src/api/harmonic-boot/cockpit/cockpit.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 主要监测点列表查询
|
||||
export function mainLineList(data: any) {
|
||||
return request({
|
||||
url: '/harmonic-boot/mainLine/list',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<!--F47曲线 -->
|
||||
<TableHeader :showReset="false" @selectChange="selectChange" datePicker v-if="fullscreen"></TableHeader>
|
||||
<el-descriptions class="mt2" direction="vertical" :column="4" border>
|
||||
<el-descriptions-item align="center" label="名称">{{ data.name }}</el-descriptions-item>
|
||||
<el-descriptions-item align="center" label="事件总数">{{ data.gs }}</el-descriptions-item>
|
||||
@@ -11,7 +12,7 @@
|
||||
ref="chartRef"
|
||||
class="tall"
|
||||
:options="echartList"
|
||||
:style="{ width: prop.width, height: `calc(${prop.height} - 80px)` }"
|
||||
:style="{ width: prop.width, height: `calc(${prop.height} - 80px - ${headerHeight}px + ${fullscreen ? 0 : 56}px)` }"
|
||||
@chart-click="handleChartClick"
|
||||
/>
|
||||
<el-dialog v-model="isWaveCharts" draggable title="瞬时/RMS波形" append-to-body width="70%">
|
||||
@@ -23,19 +24,51 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, provide, reactive, watch, h } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { getTimeOfTheMonth } from '@/utils/formatTime'
|
||||
import waveFormAnalysis from '@/views/govern/device/control/tabs/components/waveFormAnalysis.vue';
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useTimeCacheStore } from '@/stores/timeCache'
|
||||
|
||||
const prop = defineProps({
|
||||
w: { type: String },
|
||||
h: { type: String },
|
||||
width: { type: String },
|
||||
height: { type: String },
|
||||
timeKey: { type: String },
|
||||
timeValue: { type: Object }
|
||||
})
|
||||
|
||||
const headerHeight = ref(57)
|
||||
|
||||
const route = useRoute()
|
||||
const timeCacheStore = useTimeCacheStore()
|
||||
|
||||
const selectChange = (showSelect: any, height: any, datePickerValue?: any) => {
|
||||
headerHeight.value = height
|
||||
|
||||
// 如果有传入 datePicker 的值
|
||||
if (datePickerValue) {
|
||||
// 更新表格参数
|
||||
tableStore.table.params.searchBeginTime = datePickerValue.timeValue?.[0]
|
||||
tableStore.table.params.searchEndTime = datePickerValue.timeValue?.[1]
|
||||
}
|
||||
}
|
||||
|
||||
// 计算是否全屏展示
|
||||
const fullscreen = computed(() => {
|
||||
const w = Number(prop.w)
|
||||
const h = Number(prop.h)
|
||||
if (!isNaN(w) && !isNaN(h) && w === 12 && h === 6) {
|
||||
// 执行相应逻辑
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
|
||||
const echartList = ref({})
|
||||
|
||||
const chartRef = ref()
|
||||
@@ -60,9 +93,22 @@ const tableStore: any = new TableStore({
|
||||
showPage: false,
|
||||
|
||||
column: [],
|
||||
beforeSearchFun: () => {
|
||||
tableStore.table.params.searchBeginTime = prop.timeValue?.[0] || getTimeOfTheMonth(prop.timeKey)[0]
|
||||
tableStore.table.params.searchEndTime = prop.timeValue?.[1] || getTimeOfTheMonth(prop.timeKey)[1]
|
||||
beforeSearchFun: () => {
|
||||
// 尝试从缓存获取时间值
|
||||
let beginTime, endTime
|
||||
|
||||
if (fullscreen.value) {
|
||||
const cached = timeCacheStore.getCache(route.path)
|
||||
if (cached && cached.timeValue) {
|
||||
beginTime = cached.timeValue[0]
|
||||
endTime = cached.timeValue[1]
|
||||
}
|
||||
}
|
||||
|
||||
// 如果缓存中没有则使用默认值
|
||||
tableStore.table.params.searchBeginTime = beginTime || prop.timeValue?.[0] || getTimeOfTheMonth(prop.timeKey)[0]
|
||||
|
||||
tableStore.table.params.searchEndTime = endTime || prop.timeValue?.[1] || getTimeOfTheMonth(prop.timeKey)[1]
|
||||
},
|
||||
loadCallback: () => {
|
||||
let res = {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<!--暂降方向统计 -->
|
||||
<TableHeader :showReset="false" @selectChange="selectChange" datePicker v-if="fullscreen"></TableHeader>
|
||||
<my-echart class="tall" :options="echartList" :style="{ width: prop.width, height: `calc(${prop.height} )` }" />
|
||||
</div>
|
||||
</template>
|
||||
@@ -12,12 +13,47 @@ import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { getTimeOfTheMonth } from '@/utils/formatTime'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useTimeCacheStore } from '@/stores/timeCache'
|
||||
|
||||
const prop = defineProps({
|
||||
w: { type: String },
|
||||
h: { type: String },
|
||||
width: { type: String },
|
||||
height: { type: String },
|
||||
timeKey: { type: String },
|
||||
timeValue: { type: Object }
|
||||
})
|
||||
|
||||
const headerHeight = ref(57)
|
||||
|
||||
const route = useRoute()
|
||||
const timeCacheStore = useTimeCacheStore()
|
||||
|
||||
const selectChange = (showSelect: any, height: any, datePickerValue?: any) => {
|
||||
headerHeight.value = height
|
||||
|
||||
// 如果有传入 datePicker 的值
|
||||
if (datePickerValue) {
|
||||
// 更新表格参数
|
||||
tableStore.table.params.searchBeginTime = datePickerValue.timeValue?.[0]
|
||||
tableStore.table.params.searchEndTime = datePickerValue.timeValue?.[1]
|
||||
}
|
||||
}
|
||||
|
||||
// 计算是否全屏展示
|
||||
const fullscreen = computed(() => {
|
||||
const w = Number(prop.w)
|
||||
const h = Number(prop.h)
|
||||
if (!isNaN(w) && !isNaN(h) && w === 12 && h === 6) {
|
||||
// 执行相应逻辑
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
|
||||
const data = [
|
||||
{
|
||||
name: '来自电网',
|
||||
@@ -93,8 +129,21 @@ const tableStore: any = new TableStore({
|
||||
|
||||
column: [],
|
||||
beforeSearchFun: () => {
|
||||
tableStore.table.params.searchBeginTime = prop.timeValue?.[0] || getTimeOfTheMonth(prop.timeKey)[0]
|
||||
tableStore.table.params.searchEndTime = prop.timeValue?.[1] || getTimeOfTheMonth(prop.timeKey)[1]
|
||||
// 尝试从缓存获取时间值
|
||||
let beginTime, endTime
|
||||
|
||||
if (fullscreen.value) {
|
||||
const cached = timeCacheStore.getCache(route.path)
|
||||
if (cached && cached.timeValue) {
|
||||
beginTime = cached.timeValue[0]
|
||||
endTime = cached.timeValue[1]
|
||||
}
|
||||
}
|
||||
|
||||
// 如果缓存中没有则使用默认值
|
||||
tableStore.table.params.searchBeginTime = beginTime || prop.timeValue?.[0] || getTimeOfTheMonth(prop.timeKey)[0]
|
||||
|
||||
tableStore.table.params.searchEndTime = endTime || prop.timeValue?.[1] || getTimeOfTheMonth(prop.timeKey)[1]
|
||||
},
|
||||
loadCallback: () => {}
|
||||
})
|
||||
|
||||
@@ -11,9 +11,6 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, provide, reactive, watch, h } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { getTimeOfTheMonth } from '@/utils/formatTime'
|
||||
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||
import { useConfig } from '@/stores/config'
|
||||
const prop = defineProps({
|
||||
@@ -30,103 +27,50 @@ const config = useConfig()
|
||||
|
||||
const echartList = ref({
|
||||
title: {
|
||||
text: '35kV进线谐波含有率',
|
||||
text: '指标日趋势图',
|
||||
},
|
||||
|
||||
xAxis: {
|
||||
type: 'time',
|
||||
type: 'category',
|
||||
data: [
|
||||
'00:00', '01:00', '02:00', '03:00', '04:00', '05:00',
|
||||
'06:00', '07:00', '08:00', '09:00', '10:00', '11:00',
|
||||
'12:00', '13:00', '14:00', '15:00', '16:00', '17:00',
|
||||
'18:00', '19:00', '20:00', '21:00', '22:00', '23:00'
|
||||
],
|
||||
axisLabel: {
|
||||
formatter: {
|
||||
day: '{MM}-{dd}',
|
||||
month: '{MM}',
|
||||
year: '{yyyy}'
|
||||
}
|
||||
interval: 1
|
||||
}
|
||||
},
|
||||
|
||||
yAxis: [{}, {}],
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
name: '数值'
|
||||
},
|
||||
grid: {
|
||||
left: '10px',
|
||||
right: '20px'
|
||||
right: '20px',
|
||||
containLabel: true
|
||||
},
|
||||
options: {
|
||||
series: [
|
||||
{
|
||||
// name: '暂降次数',
|
||||
type: 'bar',
|
||||
name: '有功功率',
|
||||
name: '指标值',
|
||||
type: 'line',
|
||||
showSymbol: true,
|
||||
smooth: true,
|
||||
data: [
|
||||
['2025-10-16 07:00:00', 10],
|
||||
['2025-10-16 07:15:00', 10],
|
||||
['2025-10-16 07:30:00', 10],
|
||||
['2025-10-16 07:45:00', 10],
|
||||
['2025-10-16 08:00:00', 30],
|
||||
['2025-10-16 08:15:00', 50],
|
||||
['2025-10-16 08:30:00', 60],
|
||||
['2025-10-16 08:45:00', 70],
|
||||
['2025-10-16 09:00:00', 100],
|
||||
['2025-10-16 09:15:00', 120],
|
||||
['2025-10-16 09:30:00', 130],
|
||||
['2025-10-16 09:45:00', 140],
|
||||
['2025-10-16 10:00:00', 160],
|
||||
['2025-10-16 10:15:00', 160],
|
||||
['2025-10-16 10:30:00', 130],
|
||||
['2025-10-16 10:45:00', 120],
|
||||
['2025-10-16 11:00:00', 140],
|
||||
['2025-10-16 11:15:00', 80],
|
||||
['2025-10-16 11:30:00', 70],
|
||||
['2025-10-16 11:45:00', 90],
|
||||
['2025-10-16 12:00:00', 60],
|
||||
['2025-10-16 12:15:00', 60],
|
||||
['2025-10-16 12:30:00', 60],
|
||||
['2025-10-16 12:45:00', 60]
|
||||
10, 12, 15, 18, 22, 28,
|
||||
35, 45, 60, 75, 88, 95,
|
||||
100, 98, 90, 80, 70, 60,
|
||||
50, 40, 30, 25, 20, 15
|
||||
],
|
||||
itemStyle: {
|
||||
normal: {
|
||||
//这里是颜色
|
||||
color: function (params: any) {
|
||||
if (params.value[1] == 0 || params.value[1] == 3.14159) {
|
||||
return '#ccc'
|
||||
} else {
|
||||
return config.layout.elementUiPrimary[0]
|
||||
}
|
||||
}
|
||||
color: config.layout.elementUiPrimary[0]
|
||||
}
|
||||
},
|
||||
yAxisIndex: 0
|
||||
},
|
||||
{
|
||||
name: '谐波总畸变率',
|
||||
type: 'line',
|
||||
showSymbol: false,
|
||||
smooth: true,
|
||||
data: [
|
||||
['2025-10-16 07:00:00', 0],
|
||||
['2025-10-16 07:15:00', 0],
|
||||
['2025-10-16 07:30:00', 0],
|
||||
['2025-10-16 07:45:00', 0],
|
||||
['2025-10-16 08:00:00', 0],
|
||||
['2025-10-16 08:15:00', 0.1],
|
||||
['2025-10-16 08:30:00', 0.1],
|
||||
['2025-10-16 08:45:00', 0.1],
|
||||
['2025-10-16 09:00:00', 1],
|
||||
['2025-10-16 09:15:00', 1],
|
||||
['2025-10-16 09:30:00', 1],
|
||||
['2025-10-16 09:45:00', 1],
|
||||
['2025-10-16 10:00:00', 0.8],
|
||||
['2025-10-16 10:15:00', 0.8],
|
||||
['2025-10-16 10:30:00', 0.8],
|
||||
['2025-10-16 10:45:00', 0.8],
|
||||
['2025-10-16 11:00:00', 0.8],
|
||||
['2025-10-16 11:15:00', 0.1],
|
||||
['2025-10-16 11:30:00', 0.1],
|
||||
['2025-10-16 11:45:00', 0.1],
|
||||
['2025-10-16 12:00:00', 0],
|
||||
['2025-10-16 12:15:00', 0],
|
||||
['2025-10-16 12:30:00', 0],
|
||||
['2025-10-16 12:45:00', 0]
|
||||
],
|
||||
yAxisIndex: 1
|
||||
areaStyle: {
|
||||
opacity: 0.3
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
<template>
|
||||
<div>
|
||||
<!--指标越限程度 -->
|
||||
<TableHeader :showReset="false" @selectChange="selectChange" datePicker v-if="fullscreen"></TableHeader>
|
||||
<my-echart
|
||||
class="tall"
|
||||
:options="echartList"
|
||||
:style="{ width: prop.width, height: `calc(${prop.height} / 2 )` }"
|
||||
/>
|
||||
<Table ref="tableRef" @cell-click="cellClickEvent" :height="`calc(${prop.height} / 2 )`" isGroup></Table>
|
||||
<Table ref="tableRef" @cell-click="cellClickEvent" :height="`calc(${prop.height} / 2 - ${headerHeight}px + ${fullscreen ? 0 : 56}px )`" isGroup></Table>
|
||||
<!-- 指标日趋势图 -->
|
||||
<DailyTrendChart ref="dailyTrendChartRef" />
|
||||
</div>
|
||||
@@ -15,17 +16,49 @@
|
||||
import { ref, onMounted, provide, reactive, watch, h } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { getTimeOfTheMonth } from '@/utils/formatTime'
|
||||
import DailyTrendChart from '@/components/cockpit/exceedanceLevel/components/dailyTrendChart.vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useTimeCacheStore } from '@/stores/timeCache'
|
||||
|
||||
const prop = defineProps({
|
||||
w: { type: String },
|
||||
h: { type: String },
|
||||
width: { type: String },
|
||||
height: { type: String },
|
||||
timeKey: { type: String },
|
||||
timeValue: { type: Object }
|
||||
})
|
||||
|
||||
const headerHeight = ref(57)
|
||||
|
||||
const route = useRoute()
|
||||
const timeCacheStore = useTimeCacheStore()
|
||||
|
||||
const selectChange = (showSelect: any, height: any, datePickerValue?: any) => {
|
||||
headerHeight.value = height
|
||||
|
||||
// 如果有传入 datePicker 的值
|
||||
if (datePickerValue) {
|
||||
// 更新表格参数
|
||||
tableStore.table.params.searchBeginTime = datePickerValue.timeValue?.[0]
|
||||
tableStore.table.params.searchEndTime = datePickerValue.timeValue?.[1]
|
||||
}
|
||||
}
|
||||
// 计算是否全屏展示
|
||||
const fullscreen = computed(() => {
|
||||
const w = Number(prop.w)
|
||||
const h = Number(prop.h)
|
||||
if (!isNaN(w) && !isNaN(h) && w === 12 && h === 6) {
|
||||
// 执行相应逻辑
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
|
||||
const echartList = ref({
|
||||
title: {
|
||||
text: '指标越限严重度'
|
||||
@@ -118,9 +151,22 @@ const tableStore: any = new TableStore({
|
||||
minWidth: '90'
|
||||
}
|
||||
],
|
||||
beforeSearchFun: () => {
|
||||
tableStore.table.params.searchBeginTime = prop.timeValue?.[0] || getTimeOfTheMonth(prop.timeKey)[0]
|
||||
tableStore.table.params.searchEndTime = prop.timeValue?.[1] || getTimeOfTheMonth(prop.timeKey)[1]
|
||||
beforeSearchFun: () => {
|
||||
// 尝试从缓存获取时间值
|
||||
let beginTime, endTime
|
||||
|
||||
if (fullscreen.value) {
|
||||
const cached = timeCacheStore.getCache(route.path)
|
||||
if (cached && cached.timeValue) {
|
||||
beginTime = cached.timeValue[0]
|
||||
endTime = cached.timeValue[1]
|
||||
}
|
||||
}
|
||||
|
||||
// 如果缓存中没有则使用默认值
|
||||
tableStore.table.params.searchBeginTime = beginTime || prop.timeValue?.[0] || getTimeOfTheMonth(prop.timeKey)[0]
|
||||
|
||||
tableStore.table.params.searchEndTime = endTime || prop.timeValue?.[1] || getTimeOfTheMonth(prop.timeKey)[1]
|
||||
},
|
||||
loadCallback: () => {
|
||||
tableStore.table.data = [
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<!--治理效果报表 -->
|
||||
<TableHeader :showReset="false" v-if="fullscreen">
|
||||
<TableHeader :showReset="false" datePicker @selectChange="selectChange" v-if="fullscreen">
|
||||
<template v-slot:select>
|
||||
<el-form-item label="治理对象">
|
||||
<el-select
|
||||
@@ -39,12 +39,11 @@ import { ref, onMounted, provide, reactive, watch, h, computed } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import { exportExcel } from '@/views/govern/reportForms/export.js'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { getTimeOfTheMonth } from '@/utils/formatTime'
|
||||
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||
import { useConfig } from '@/stores/config'
|
||||
import Json from './index.json'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useTimeCacheStore } from '@/stores/timeCache'
|
||||
|
||||
const prop = defineProps({
|
||||
w: { type: String },
|
||||
@@ -66,6 +65,9 @@ const powerList: any = ref([
|
||||
}
|
||||
])
|
||||
|
||||
const route = useRoute()
|
||||
const timeCacheStore = useTimeCacheStore()
|
||||
|
||||
const tableStore: any = new TableStore({
|
||||
url: '/user-boot/role/selectRoleDetail?id=0',
|
||||
method: 'POST',
|
||||
@@ -74,8 +76,20 @@ const tableStore: any = new TableStore({
|
||||
exportName: '主要监测点列表',
|
||||
column: [],
|
||||
beforeSearchFun: () => {
|
||||
tableStore.table.params.searchBeginTime = prop.timeValue?.[0] || getTimeOfTheMonth(prop.timeKey)[0]
|
||||
tableStore.table.params.searchEndTime = prop.timeValue?.[1] || getTimeOfTheMonth(prop.timeKey)[1]
|
||||
// 尝试从缓存获取时间值
|
||||
let beginTime, endTime
|
||||
|
||||
if (fullscreen.value) {
|
||||
const cached = timeCacheStore.getCache(route.path)
|
||||
if (cached && cached.timeValue) {
|
||||
beginTime = cached.timeValue[0]
|
||||
endTime = cached.timeValue[1]
|
||||
}
|
||||
}
|
||||
|
||||
// 如果缓存中没有则使用默认值
|
||||
tableStore.table.params.searchBeginTime = beginTime || prop.timeValue?.[0] || getTimeOfTheMonth(prop.timeKey)[0]
|
||||
tableStore.table.params.searchEndTime = endTime || prop.timeValue?.[1] || getTimeOfTheMonth(prop.timeKey)[1]
|
||||
},
|
||||
loadCallback: () => {}
|
||||
})
|
||||
@@ -103,6 +117,16 @@ onMounted(() => {
|
||||
|
||||
tableStore.index()
|
||||
})
|
||||
|
||||
const selectChange = (showSelect: any, height: any, datePickerValue?: any) => {
|
||||
// 如果有传入 datePicker 的值
|
||||
if (datePickerValue) {
|
||||
// 更新表格参数
|
||||
tableStore.table.params.searchBeginTime = datePickerValue.timeValue?.[0]
|
||||
tableStore.table.params.searchEndTime = datePickerValue.timeValue?.[1]
|
||||
}
|
||||
}
|
||||
|
||||
// 计算是否全屏展示
|
||||
const fullscreen = computed(() => {
|
||||
const w = Number(prop.w)
|
||||
|
||||
@@ -1,13 +1,21 @@
|
||||
<template>
|
||||
<div>
|
||||
|
||||
<!--电网侧指标越限统计 -->
|
||||
<TableHeader :showReset="false" @selectChange="selectChange" datePicker v-if="fullscreen"></TableHeader>
|
||||
<my-echart
|
||||
class="tall"
|
||||
:options="echartList"
|
||||
:style="{ width: prop.width, height: `calc(${prop.height} / 2 )` }"
|
||||
:style="{
|
||||
width: prop.width,
|
||||
height: `calc(${prop.height} / 2 - ${headerHeight / 2}px + ${fullscreen ? 0 : 28}px )`
|
||||
}"
|
||||
/>
|
||||
<Table ref="tableRef" @cell-click="cellClickEvent" :height="`calc(${prop.height} / 2 )`" isGroup></Table>
|
||||
<Table
|
||||
ref="tableRef"
|
||||
@cell-click="cellClickEvent"
|
||||
:height="`calc(${prop.height} / 2 - ${headerHeight / 2}px + ${fullscreen ? 0 : 28}px )`"
|
||||
isGroup
|
||||
></Table>
|
||||
<!-- 指标越限详情 -->
|
||||
<OverLimitDetails ref="OverLimitDetailsRef" />
|
||||
</div>
|
||||
@@ -17,16 +25,48 @@ import { ref, onMounted, provide, reactive, watch, h } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { getTimeOfTheMonth } from '@/utils/formatTime'
|
||||
import OverLimitDetails from '@/components/cockpit/listOfMainMonitoringPoints/components/overLimitDetails.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useTimeCacheStore } from '@/stores/timeCache'
|
||||
|
||||
const prop = defineProps({
|
||||
w: { type: String },
|
||||
h: { type: String },
|
||||
width: { type: String },
|
||||
height: { type: String },
|
||||
timeKey: { type: String },
|
||||
timeValue: { type: Object }
|
||||
})
|
||||
|
||||
const headerHeight = ref(57)
|
||||
|
||||
const route = useRoute()
|
||||
const timeCacheStore = useTimeCacheStore()
|
||||
|
||||
const selectChange = (showSelect: any, height: any, datePickerValue?: any) => {
|
||||
headerHeight.value = height
|
||||
|
||||
// 如果有传入 datePicker 的值
|
||||
if (datePickerValue) {
|
||||
// 更新表格参数
|
||||
tableStore.table.params.searchBeginTime = datePickerValue.timeValue?.[0]
|
||||
tableStore.table.params.searchEndTime = datePickerValue.timeValue?.[1]
|
||||
}
|
||||
}
|
||||
|
||||
// 计算是否全屏展示
|
||||
const fullscreen = computed(() => {
|
||||
const w = Number(prop.w)
|
||||
const h = Number(prop.h)
|
||||
if (!isNaN(w) && !isNaN(h) && w === 12 && h === 6) {
|
||||
// 执行相应逻辑
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
const echartList = ref({
|
||||
title: {
|
||||
text: '指标越限占比'
|
||||
@@ -52,7 +92,7 @@ const echartList = ref({
|
||||
type: 'bar',
|
||||
name: '越限占比',
|
||||
data: [0, 45, 22, 0, 70],
|
||||
barMaxWidth: 30,
|
||||
barMaxWidth: 30
|
||||
|
||||
// label: {
|
||||
// show: true,
|
||||
@@ -140,8 +180,21 @@ const tableStore: any = new TableStore({
|
||||
}
|
||||
],
|
||||
beforeSearchFun: () => {
|
||||
tableStore.table.params.searchBeginTime = prop.timeValue?.[0] || getTimeOfTheMonth(prop.timeKey)[0]
|
||||
tableStore.table.params.searchEndTime = prop.timeValue?.[1] || getTimeOfTheMonth(prop.timeKey)[1]
|
||||
// 尝试从缓存获取时间值
|
||||
let beginTime, endTime
|
||||
|
||||
if (fullscreen.value) {
|
||||
const cached = timeCacheStore.getCache(route.path)
|
||||
if (cached && cached.timeValue) {
|
||||
beginTime = cached.timeValue[0]
|
||||
endTime = cached.timeValue[1]
|
||||
}
|
||||
}
|
||||
|
||||
// 如果缓存中没有则使用默认值
|
||||
tableStore.table.params.searchBeginTime = beginTime || prop.timeValue?.[0] || getTimeOfTheMonth(prop.timeKey)[0]
|
||||
|
||||
tableStore.table.params.searchEndTime = endTime || prop.timeValue?.[1] || getTimeOfTheMonth(prop.timeKey)[1]
|
||||
},
|
||||
loadCallback: () => {
|
||||
tableStore.table.data = [
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<div>
|
||||
<!--指标越限明细 -->
|
||||
|
||||
<el-calendar v-model="value" :style="{ height: prop.height, overflow: 'auto' }">
|
||||
<TableHeader :showReset="false" @selectChange="selectChange" datePicker v-if="fullscreen"></TableHeader>
|
||||
<el-calendar v-model="value" :style="{ height: `calc(${prop.height} - ${headerHeight}px + ${fullscreen ? 0 : 56}px )`, overflow: 'auto' }">
|
||||
<template #date-cell="{ data }">
|
||||
<div style="height: 100%; padding: 8px" :style="{ background: setBackground(data.day) }">
|
||||
<p :class="data.isSelected ? 'is-selected' : ''">
|
||||
@@ -30,24 +30,56 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, provide, reactive, watch, h } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { getTimeOfTheMonth } from '@/utils/formatTime'
|
||||
import { overflow } from 'html2canvas/dist/types/css/property-descriptors/overflow'
|
||||
import { dayjs } from 'element-plus'
|
||||
|
||||
dayjs.en.weekStart = 1 //设置日历的周起始日为星期一
|
||||
const value = ref(new Date())
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useTimeCacheStore } from '@/stores/timeCache'
|
||||
|
||||
const prop = defineProps({
|
||||
w: { type: String },
|
||||
h: { type: String },
|
||||
width: { type: String },
|
||||
height: { type: String },
|
||||
timeKey: { type: String },
|
||||
timeValue: { type: Object }
|
||||
})
|
||||
|
||||
const headerHeight = ref(57)
|
||||
|
||||
const route = useRoute()
|
||||
const timeCacheStore = useTimeCacheStore()
|
||||
|
||||
dayjs.en.weekStart = 1 //设置日历的周起始日为星期一
|
||||
const value = ref(new Date())
|
||||
|
||||
const selectChange = (showSelect: any, height: any, datePickerValue?: any) => {
|
||||
headerHeight.value = height
|
||||
|
||||
// 如果有传入 datePicker 的值
|
||||
if (datePickerValue) {
|
||||
// 更新表格参数
|
||||
tableStore.table.params.searchBeginTime = datePickerValue.timeValue?.[0]
|
||||
tableStore.table.params.searchEndTime = datePickerValue.timeValue?.[1]
|
||||
}
|
||||
}
|
||||
|
||||
// 计算是否全屏展示
|
||||
const fullscreen = computed(() => {
|
||||
const w = Number(prop.w)
|
||||
const h = Number(prop.h)
|
||||
if (!isNaN(w) && !isNaN(h) && w === 12 && h === 6) {
|
||||
// 执行相应逻辑
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
|
||||
const list = ref([
|
||||
{
|
||||
time: '2025-10-01',
|
||||
time: '2025-11-01',
|
||||
key: 81,
|
||||
text: '3次谐波越限<br/>5次谐波越限<br/>三相不平衡越限'
|
||||
},
|
||||
@@ -57,22 +89,22 @@ const list = ref([
|
||||
text: '3次谐波越限<br/>5次谐波越限<br/>三相不平衡越限'
|
||||
},
|
||||
{
|
||||
time: '2025-10-08',
|
||||
time: '2025-11-08',
|
||||
key: 20,
|
||||
text: '3次谐波越限<br/>5次谐波越限<br/>三相不平衡越限'
|
||||
},
|
||||
{
|
||||
time: '2025-10-16',
|
||||
time: '2025-11-16',
|
||||
key: 20,
|
||||
text: '3次谐波越限<br/>5次谐波越限<br/>三相不平衡越限'
|
||||
},
|
||||
{
|
||||
time: '2025-10-23',
|
||||
time: '2025-11-23',
|
||||
key: 20,
|
||||
text: '3次谐波越限<br/>5次谐波越限<br/>三相不平衡越限'
|
||||
},
|
||||
{
|
||||
time: '2025-10-04',
|
||||
time: '2025-11-04',
|
||||
key: 0,
|
||||
text: ''
|
||||
},
|
||||
@@ -89,10 +121,22 @@ const tableStore: any = new TableStore({
|
||||
showPage: false,
|
||||
|
||||
column: [],
|
||||
beforeSearchFun: () => {
|
||||
tableStore.table.params.searchBeginTime = prop.timeValue?.[0] || getTimeOfTheMonth(prop.timeKey)[0]
|
||||
tableStore.table.params.searchEndTime = prop.timeValue?.[1] || getTimeOfTheMonth(prop.timeKey)[1]
|
||||
// value.value = new Date(prop.timeValue?.[0])
|
||||
beforeSearchFun: () => {
|
||||
// 尝试从缓存获取时间值
|
||||
let beginTime, endTime
|
||||
|
||||
if (fullscreen.value) {
|
||||
const cached = timeCacheStore.getCache(route.path)
|
||||
if (cached && cached.timeValue) {
|
||||
beginTime = cached.timeValue[0]
|
||||
endTime = cached.timeValue[1]
|
||||
}
|
||||
}
|
||||
|
||||
// 如果缓存中没有则使用默认值
|
||||
tableStore.table.params.searchBeginTime = beginTime || prop.timeValue?.[0] || getTimeOfTheMonth(prop.timeKey)[0]
|
||||
|
||||
tableStore.table.params.searchEndTime = endTime || prop.timeValue?.[1] || getTimeOfTheMonth(prop.timeKey)[1]
|
||||
},
|
||||
loadCallback: () => {
|
||||
tableStore.table.data = []
|
||||
|
||||
@@ -1,40 +1,226 @@
|
||||
<template>
|
||||
<div>
|
||||
<!--指标越限概率分布 -->
|
||||
<TableHeader :showReset="false" @selectChange="selectChange" datePicker v-if="fullscreen">
|
||||
<template v-slot:select>
|
||||
<el-form-item>
|
||||
<el-select size="small" v-model="tableStore.table.params.searchValue">
|
||||
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<my-echart
|
||||
class="tall"
|
||||
:options="echartList"
|
||||
:style="{ width: prop.width, height: `calc(${prop.height} / 2 )` }"
|
||||
:style="{
|
||||
width: prop.width,
|
||||
height: `calc(${prop.height} / 2 - ${headerHeight / 2}px + ${fullscreen ? 0 : 28}px )`
|
||||
}"
|
||||
/>
|
||||
<my-echart
|
||||
class="mt10"
|
||||
:options="echartList1"
|
||||
:style="{ width: prop.width, height: `calc(${prop.height} / 2 - 10px)` }"
|
||||
:style="{
|
||||
width: prop.width,
|
||||
height: `calc(${prop.height} / 2 - ${headerHeight / 2}px + ${fullscreen ? 0 : 28}px )`
|
||||
}"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, provide, reactive, watch, h } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { getTimeOfTheMonth } from '@/utils/formatTime'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useTimeCacheStore } from '@/stores/timeCache'
|
||||
|
||||
const prop = defineProps({
|
||||
w: { type: String },
|
||||
h: { type: String },
|
||||
width: { type: String },
|
||||
height: { type: String },
|
||||
timeKey: { type: String },
|
||||
timeValue: { type: Object }
|
||||
})
|
||||
|
||||
const options = [
|
||||
{
|
||||
value: '1',
|
||||
label: '35V进线'
|
||||
}
|
||||
]
|
||||
|
||||
const headerHeight = ref(57)
|
||||
|
||||
const route = useRoute()
|
||||
const timeCacheStore = useTimeCacheStore()
|
||||
|
||||
const selectChange = (showSelect: any, height: any, datePickerValue?: any) => {
|
||||
headerHeight.value = height
|
||||
|
||||
// 如果有传入 datePicker 的值
|
||||
if (datePickerValue) {
|
||||
// 更新表格参数
|
||||
tableStore.table.params.searchBeginTime = datePickerValue.timeValue?.[0]
|
||||
tableStore.table.params.searchEndTime = datePickerValue.timeValue?.[1]
|
||||
}
|
||||
}
|
||||
|
||||
// 计算是否全屏展示
|
||||
const fullscreen = computed(() => {
|
||||
const w = Number(prop.w)
|
||||
const h = Number(prop.h)
|
||||
if (!isNaN(w) && !isNaN(h) && w === 12 && h === 6) {
|
||||
// 执行相应逻辑
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
|
||||
// const echartList = ref({
|
||||
// options: {
|
||||
// xAxis: null,
|
||||
// yAxis: null,
|
||||
// dataZoom: null,
|
||||
// backgroundColor: '#fff',
|
||||
// tooltip: {
|
||||
// // trigger: 'axis'
|
||||
// textStyle: {
|
||||
// color: '#fff',
|
||||
// fontStyle: 'normal',
|
||||
// opacity: 0.35,
|
||||
// fontSize: 14
|
||||
// },
|
||||
// backgroundColor: 'rgba(0,0,0,0.55)',
|
||||
// borderWidth: 0,
|
||||
// formatter: function (params: any) {
|
||||
// console.log(params)
|
||||
// var tips = ''
|
||||
// for (var i = 0; i < params.length; i++) {
|
||||
// tips += params[i].name + '</br/>'
|
||||
// tips += '监测点数' + ':' + ' ' + ' ' + params[i].value + '</br/>'
|
||||
// }
|
||||
// return tips
|
||||
// }
|
||||
// },
|
||||
// title: {
|
||||
// text: '指标越限概率分布',
|
||||
// x: 'center'
|
||||
// },
|
||||
|
||||
// visualMap: {
|
||||
// max: 20,
|
||||
// show: false,
|
||||
// inRange: {
|
||||
// color: ['#313695', '#00BB00', '#ff8000', '#a50026']
|
||||
// }
|
||||
// },
|
||||
// xAxis3D: {
|
||||
// type: 'category',
|
||||
// name: '指标越限',
|
||||
// data: ['0-10', '10-20', '20-30', '30-40', '40-50'],
|
||||
// axisLine: {
|
||||
// lineStyle: {
|
||||
// color: '#111'
|
||||
// }
|
||||
// },
|
||||
// axisLabel: {
|
||||
// color: '#111'
|
||||
// }
|
||||
// },
|
||||
// yAxis3D: {
|
||||
// type: 'category',
|
||||
// name: '指标类型',
|
||||
// data: ['闪变', '谐波电压', '谐波电流', '电压偏差', '三相不平衡'],
|
||||
// nameTextStyle: {
|
||||
// color: '#111'
|
||||
// },
|
||||
// axisLine: {
|
||||
// show: true,
|
||||
// lineStyle: {
|
||||
// color: '#111'
|
||||
// }
|
||||
// },
|
||||
// axisLabel: {
|
||||
// color: '#111'
|
||||
// },
|
||||
// splitLine: {
|
||||
// lineStyle: {
|
||||
// // 使用深浅的间隔色
|
||||
// color: ['#111'],
|
||||
// type: 'dashed',
|
||||
// opacity: 0.5
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// zAxis3D: {
|
||||
// type: 'value',
|
||||
// splitNumber: 10,
|
||||
// minInterval: 10,
|
||||
// name: '越限占比'
|
||||
// },
|
||||
// grid3D: {
|
||||
// viewControl: {
|
||||
// projection: 'perspective',
|
||||
// distance: 250
|
||||
// },
|
||||
// boxWidth: 200,
|
||||
// boxDepth: 80,
|
||||
// light: {
|
||||
// main: {
|
||||
// intensity: 1.2
|
||||
// },
|
||||
// ambient: {
|
||||
// intensity: 0.3
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// series: [
|
||||
// {
|
||||
// type: 'bar3D',
|
||||
// data: [
|
||||
// [0, 0, 1],
|
||||
// [0, 1, 1],
|
||||
// [0.2, 1]
|
||||
// ],
|
||||
// shading: 'realistic',
|
||||
// label: {
|
||||
// show: false,
|
||||
// textStyle: {
|
||||
// fontSize: 16,
|
||||
// borderWidth: 1
|
||||
// }
|
||||
// },
|
||||
|
||||
// itemStyle: {
|
||||
// opacity: 1
|
||||
// },
|
||||
// emphasis: {
|
||||
// label: {
|
||||
// textStyle: {
|
||||
// fontSize: 20,
|
||||
// color: '#900'
|
||||
// }
|
||||
// },
|
||||
// itemStyle: {
|
||||
// color: '#900'
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
// })
|
||||
|
||||
var yAxisData=['闪变', '谐波电压', '谐波电流', '电压偏差', '三相不平衡']
|
||||
|
||||
const echartList = ref({
|
||||
options: {
|
||||
xAxis: null,
|
||||
yAxis: null,
|
||||
dataZoom: null,
|
||||
backgroundColor: '#fff',
|
||||
tooltip: {
|
||||
// trigger: 'axis'
|
||||
textStyle: {
|
||||
color: '#fff',
|
||||
fontStyle: 'normal',
|
||||
@@ -44,44 +230,74 @@ const echartList = ref({
|
||||
backgroundColor: 'rgba(0,0,0,0.55)',
|
||||
borderWidth: 0,
|
||||
formatter: function (params: any) {
|
||||
console.log(params)
|
||||
console.log(params, '33344')
|
||||
var yIndex = params.value[1]; //获取y轴索引
|
||||
var tips = ''
|
||||
for (var i = 0; i < params.length; i++) {
|
||||
tips += params[i].name + '</br/>'
|
||||
tips += '监测点数' + ':' + ' ' + ' ' + params[i].value + '</br/>'
|
||||
}
|
||||
// tips += '指标类型: ' + params.name + '</br>'
|
||||
tips += '指标类型: ' + yAxisData[yIndex] + '</br>'
|
||||
tips += '越限程度: ' + params.seriesName + '</br>'
|
||||
// tips += '越限占比: ' + params.value + '%</br>'
|
||||
tips += '越限占比: ' + params.value[2] + '%</br>'
|
||||
return tips
|
||||
}
|
||||
},
|
||||
title: {
|
||||
text: '指标越限概率分布',
|
||||
x: 'center'
|
||||
},
|
||||
|
||||
visualMap: {
|
||||
max: 20,
|
||||
show: false,
|
||||
inRange: {
|
||||
color: ['#313695', '#00BB00', '#ff8000', '#a50026']
|
||||
x: 'center',
|
||||
textStyle: {
|
||||
fontSize: 16,
|
||||
fontWeight: 'normal'
|
||||
}
|
||||
},
|
||||
visualMap: {
|
||||
max: 100,
|
||||
show: true,
|
||||
inRange: {
|
||||
color: [
|
||||
'#313695',
|
||||
'#4575b4',
|
||||
'#74add1',
|
||||
'#abd9e9',
|
||||
'#e0f3f8',
|
||||
'#ffffbf',
|
||||
'#fee090',
|
||||
'#fdae61',
|
||||
'#f46d43',
|
||||
'#d73027',
|
||||
'#a50026'
|
||||
]
|
||||
}
|
||||
// calculable: true,
|
||||
// orient: 'horizontal',
|
||||
// left: 'center',
|
||||
// bottom: '5%'
|
||||
},
|
||||
xAxis3D: {
|
||||
type: 'category',
|
||||
name: '指标越限',
|
||||
data: ['0-10', '10-20', '20-30', '30-40', '40-50'],
|
||||
name: '越限程度',
|
||||
nameLocation: 'middle',
|
||||
nameGap: 30,
|
||||
data: ['0-20%', '20-40%', '40-60%', '60-80%', '80-100%'],
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: '#111'
|
||||
}
|
||||
},
|
||||
axisLabel: {
|
||||
color: '#111',
|
||||
margin: 15
|
||||
},
|
||||
nameTextStyle: {
|
||||
color: '#111'
|
||||
}
|
||||
},
|
||||
yAxis3D: {
|
||||
type: 'category',
|
||||
name: '指标类型',
|
||||
data: ['闪变', '谐波电压', '谐波电流', '电压偏差', '三相不平衡'],
|
||||
nameLocation: 'middle',
|
||||
nameGap: 30,
|
||||
// data: ['闪变', '谐波电压', '谐波电流', '电压偏差', '三相不平衡'],
|
||||
data:yAxisData,
|
||||
nameTextStyle: {
|
||||
color: '#111'
|
||||
},
|
||||
@@ -92,11 +308,11 @@ const echartList = ref({
|
||||
}
|
||||
},
|
||||
axisLabel: {
|
||||
color: '#111'
|
||||
color: '#111',
|
||||
margin: 15
|
||||
},
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
// 使用深浅的间隔色
|
||||
color: ['#111'],
|
||||
type: 'dashed',
|
||||
opacity: 0.5
|
||||
@@ -105,61 +321,203 @@ const echartList = ref({
|
||||
},
|
||||
zAxis3D: {
|
||||
type: 'value',
|
||||
splitNumber: 10,
|
||||
minInterval: 10,
|
||||
name: '越限占比'
|
||||
name: '越限占比(%)',
|
||||
nameLocation: 'middle',
|
||||
nameGap: 30,
|
||||
nameTextStyle: {
|
||||
color: '#111'
|
||||
},
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: '#111'
|
||||
}
|
||||
},
|
||||
axisLabel: {
|
||||
color: '#111'
|
||||
},
|
||||
min: 0,
|
||||
max: 100
|
||||
},
|
||||
grid3D: {
|
||||
viewControl: {
|
||||
projection: 'perspective',
|
||||
distance: 250
|
||||
distance: 250,
|
||||
rotateSensitivity: 10,
|
||||
zoomSensitivity: 2
|
||||
},
|
||||
boxWidth: 200,
|
||||
boxDepth: 80,
|
||||
boxWidth: 150,
|
||||
boxDepth: 100,
|
||||
boxHeight: 100,
|
||||
light: {
|
||||
main: {
|
||||
intensity: 1.2
|
||||
},
|
||||
ambient: {
|
||||
intensity: 0.3
|
||||
intensity: 0.4
|
||||
}
|
||||
}
|
||||
},
|
||||
series: [
|
||||
{
|
||||
type: 'bar3D',
|
||||
name: '0-20%',
|
||||
data: [
|
||||
[0, 0, 1],
|
||||
[0, 1, 1],
|
||||
[0.2, 1]
|
||||
// [xIndex, yIndex, value]
|
||||
[0, 0, 5], // 闪变 - 0-20%
|
||||
[0, 1, 10], // 谐波电压 - 0-20%
|
||||
[0, 2, 8], // 谐波电流 - 0-20%
|
||||
[0, 3, 15], // 电压偏差 - 0-20%
|
||||
[0, 4, 12] // 三相不平衡 - 0-20%
|
||||
],
|
||||
shading: 'realistic',
|
||||
label: {
|
||||
show: false,
|
||||
textStyle: {
|
||||
fontSize: 16,
|
||||
borderWidth: 1
|
||||
}
|
||||
show: false
|
||||
},
|
||||
|
||||
itemStyle: {
|
||||
opacity: 1
|
||||
opacity: 0.9
|
||||
},
|
||||
emphasis: {
|
||||
label: {
|
||||
show: true,
|
||||
textStyle: {
|
||||
fontSize: 20,
|
||||
color: '#900'
|
||||
fontSize: 14,
|
||||
color: '#000'
|
||||
}
|
||||
},
|
||||
itemStyle: {
|
||||
color: '#900'
|
||||
color: '#ff8000'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'bar3D',
|
||||
name: '20-40%',
|
||||
// data: chartData.map(function (item) {
|
||||
// return {
|
||||
// value: [item[1], item[0], item[2]]
|
||||
// };
|
||||
// }),
|
||||
data: [
|
||||
[1, 0, 10], // 闪变 - 20-40%
|
||||
[1, 1, 20], // 谐波电压 - 20-40%
|
||||
[1, 2, 15], // 谐波电流 - 20-40%
|
||||
[1, 3, 25], // 电压偏差 - 20-40%
|
||||
[1, 4, 18] // 三相不平衡 - 20-40%
|
||||
],
|
||||
shading: 'realistic',
|
||||
label: {
|
||||
show: false
|
||||
},
|
||||
itemStyle: {
|
||||
opacity: 0.9
|
||||
},
|
||||
emphasis: {
|
||||
label: {
|
||||
show: true,
|
||||
textStyle: {
|
||||
fontSize: 14,
|
||||
color: '#000'
|
||||
}
|
||||
},
|
||||
itemStyle: {
|
||||
color: '#ff8000'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'bar3D',
|
||||
name: '40-60%',
|
||||
data: [
|
||||
[2, 0, 15], // 闪变 - 40-60%
|
||||
[2, 1, 25], // 谐波电压 - 40-60%
|
||||
[2, 2, 30], // 谐波电流 - 40-60%
|
||||
[2, 3, 35], // 电压偏差 - 40-60%
|
||||
[2, 4, 28] // 三相不平衡 - 40-60%
|
||||
],
|
||||
shading: 'realistic',
|
||||
label: {
|
||||
show: false
|
||||
},
|
||||
itemStyle: {
|
||||
opacity: 0.9
|
||||
},
|
||||
emphasis: {
|
||||
label: {
|
||||
show: true,
|
||||
textStyle: {
|
||||
fontSize: 14,
|
||||
color: '#000'
|
||||
}
|
||||
},
|
||||
itemStyle: {
|
||||
color: '#ff8000'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'bar3D',
|
||||
name: '60-80%',
|
||||
data: [
|
||||
[3, 0, 20], // 闪变 - 60-80%
|
||||
[3, 1, 30], // 谐波电压 - 60-80%
|
||||
[3, 2, 35], // 谐波电流 - 60-80%
|
||||
[3, 3, 40], // 电压偏差 - 60-80%
|
||||
[3, 4, 35] // 三相不平衡 - 60-80%
|
||||
],
|
||||
shading: 'realistic',
|
||||
label: {
|
||||
show: false
|
||||
},
|
||||
itemStyle: {
|
||||
opacity: 0.9
|
||||
},
|
||||
emphasis: {
|
||||
label: {
|
||||
show: true,
|
||||
textStyle: {
|
||||
fontSize: 14,
|
||||
color: '#000'
|
||||
}
|
||||
},
|
||||
itemStyle: {
|
||||
color: '#ff8000'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'bar3D',
|
||||
name: '80-100%',
|
||||
data: [
|
||||
[4, 0, 25], // 闪变 - 80-100%
|
||||
[4, 1, 35], // 谐波电压 - 80-100%
|
||||
[4, 2, 40], // 谐波电流 - 80-100%
|
||||
[4, 3, 45], // 电压偏差 - 80-100%
|
||||
[4, 4, 42] // 三相不平衡 - 80-100%
|
||||
],
|
||||
shading: 'realistic',
|
||||
label: {
|
||||
show: false
|
||||
},
|
||||
itemStyle: {
|
||||
opacity: 0.9
|
||||
},
|
||||
emphasis: {
|
||||
label: {
|
||||
show: true,
|
||||
textStyle: {
|
||||
fontSize: 14,
|
||||
color: '#000'
|
||||
}
|
||||
},
|
||||
itemStyle: {
|
||||
color: '#ff8000'
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
})
|
||||
|
||||
const echartList1 = ref({
|
||||
title: {
|
||||
text: '越限时间概率分布'
|
||||
@@ -356,8 +714,21 @@ const tableStore: any = new TableStore({
|
||||
showPage: false,
|
||||
column: [],
|
||||
beforeSearchFun: () => {
|
||||
tableStore.table.params.searchBeginTime = prop.timeValue?.[0] || getTimeOfTheMonth(prop.timeKey)[0]
|
||||
tableStore.table.params.searchEndTime = prop.timeValue?.[1] || getTimeOfTheMonth(prop.timeKey)[1]
|
||||
// 尝试从缓存获取时间值
|
||||
let beginTime, endTime
|
||||
|
||||
if (fullscreen.value) {
|
||||
const cached = timeCacheStore.getCache(route.path)
|
||||
if (cached && cached.timeValue) {
|
||||
beginTime = cached.timeValue[0]
|
||||
endTime = cached.timeValue[1]
|
||||
}
|
||||
}
|
||||
|
||||
// 如果缓存中没有则使用默认值
|
||||
tableStore.table.params.searchBeginTime = beginTime || prop.timeValue?.[0] || getTimeOfTheMonth(prop.timeKey)[0]
|
||||
|
||||
tableStore.table.params.searchEndTime = endTime || prop.timeValue?.[1] || getTimeOfTheMonth(prop.timeKey)[1]
|
||||
},
|
||||
loadCallback: () => {
|
||||
tableStore.table.data = []
|
||||
@@ -365,6 +736,7 @@ const tableStore: any = new TableStore({
|
||||
})
|
||||
|
||||
const tableRef = ref()
|
||||
tableStore.table.params.searchValue = '1'
|
||||
provide('tableRef', tableRef)
|
||||
|
||||
provide('tableStore', tableStore)
|
||||
|
||||
@@ -0,0 +1,158 @@
|
||||
<template>
|
||||
<div>
|
||||
<!-- 综合评估详情 -->
|
||||
<el-dialog draggable title="指标合格率统计" v-model="dialogVisible" append-to-body width="70%">
|
||||
<TableHeader datePicker showExport :showReset="false">
|
||||
<template v-slot:select>
|
||||
<el-form-item label="监测点名称">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.searchValue"
|
||||
placeholder="请选择监测点名称"
|
||||
style="width: 150px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" @cell-click="cellClickEvent" isGroup :height="height"></Table>
|
||||
</el-dialog>
|
||||
<!-- 谐波电流、谐波电压占有率 -->
|
||||
<HarmonicRatio ref="harmonicRatioRef" />
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, provide } from 'vue'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import HarmonicRatio from '@/components/cockpit/listOfMainMonitoringPoints/components/harmonicRatio.vue'
|
||||
const dialogVisible: any = ref(false)
|
||||
const harmonicRatioRef: any = ref(null)
|
||||
const options = [
|
||||
{
|
||||
value: '35kV进线',
|
||||
label: '35kV进线'
|
||||
}
|
||||
]
|
||||
const height = mainHeight(0, 2).height as any
|
||||
const loop50 = (key: string) => {
|
||||
let list: any[] = []
|
||||
for (let i = 2; i < 51; i++) {
|
||||
list.push({
|
||||
title: i + '次',
|
||||
// field: key + i,
|
||||
field: 'flicker',
|
||||
width: '80',
|
||||
// render: 'customTemplate',
|
||||
// customTemplate: (row: any) => {
|
||||
// return `<span style='cursor: pointer;text-decoration: underline;'>${row.flicker}</span>`
|
||||
// }
|
||||
})
|
||||
}
|
||||
return list
|
||||
}
|
||||
const tableStore: any = new TableStore({
|
||||
url: '/user-boot/role/selectRoleDetail?id=0',
|
||||
method: 'POST',
|
||||
publicHeight: 30,
|
||||
showPage: false,
|
||||
exportName: '主要监测点列表',
|
||||
column: [
|
||||
{
|
||||
field: 'index',
|
||||
title: '序号',
|
||||
width: '80',
|
||||
formatter: (row: any) => {
|
||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '日期',
|
||||
field: 'time',
|
||||
width: '150'
|
||||
},
|
||||
{
|
||||
title: '名称',
|
||||
field: 'name',
|
||||
width: '150'
|
||||
},
|
||||
{
|
||||
title: '闪变越限(分钟)',
|
||||
field: 'flicker',
|
||||
width: '80',
|
||||
// render: 'customTemplate',
|
||||
// customTemplate: (row: any) => {
|
||||
// return `<span style='cursor: pointer;text-decoration: underline;'>${row.flicker}</span>`
|
||||
// }
|
||||
},
|
||||
{
|
||||
title: '谐波电压越限(分钟)',
|
||||
children: loop50('voltage')
|
||||
},
|
||||
{
|
||||
title: '谐波电流越限(分钟)',
|
||||
children: loop50('harmonicCurrent')
|
||||
},
|
||||
{
|
||||
title: '三相不平衡度越限(分钟)',
|
||||
field: 'flicker',
|
||||
width: '100'
|
||||
},
|
||||
{
|
||||
title: '电压偏差越限(分钟)',
|
||||
field: 'flicker',
|
||||
width: '100'
|
||||
},
|
||||
{
|
||||
title: '频率偏差越限(分钟)',
|
||||
field: 'flicker',
|
||||
width: '100'
|
||||
}
|
||||
],
|
||||
beforeSearchFun: () => {},
|
||||
loadCallback: () => {
|
||||
tableStore.table.data = [
|
||||
{
|
||||
time: '2024-01-01 00:00:00',
|
||||
name: '35kV进线',
|
||||
flicker: '0'
|
||||
},
|
||||
{
|
||||
time: '2024-01-01 00:00:00',
|
||||
name: '35kV进线',
|
||||
flicker: '0'
|
||||
},
|
||||
{
|
||||
time: '2024-01-01 00:00:00',
|
||||
name: '35kV进线',
|
||||
flicker: '0'
|
||||
}
|
||||
]
|
||||
}
|
||||
})
|
||||
|
||||
tableStore.table.params.searchValue = ''
|
||||
provide('tableStore', tableStore)
|
||||
const open = async (row: any) => {
|
||||
dialogVisible.value = true
|
||||
tableStore.index()
|
||||
}
|
||||
|
||||
// 点击行
|
||||
const cellClickEvent = ({ row, column }: any) => {
|
||||
if (column.field != 'name' && column.field != 'time') {
|
||||
harmonicRatioRef.value.openDialog(row)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
defineExpose({ open })
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -1,14 +1,25 @@
|
||||
<template>
|
||||
<div>
|
||||
<!--主要监测点列表 -->
|
||||
<TableHeader :showReset="false" >
|
||||
<TableHeader
|
||||
:showReset="false"
|
||||
@selectChange="selectChange"
|
||||
v-if="fullscreen"
|
||||
datePicker
|
||||
:initialInterval="getInitialInterval()"
|
||||
:initialTimeValue="getInitialTimeValue()"
|
||||
>
|
||||
<template v-slot:select>
|
||||
<el-form-item label="关键词">
|
||||
<el-input v-model="tableStore.table.params.searchValue" clearable placeholder="请输关键字" />
|
||||
<el-input v-model="tableStore.table.params.keywords" clearable placeholder="请输关键字" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" @cell-click="cellClickEvent" :height="`calc(${prop.height} - 58px)`"></Table>
|
||||
<Table
|
||||
ref="tableRef"
|
||||
@cell-click="cellClickEvent"
|
||||
:height="`calc(${prop.height} - ${headerHeight}px + ${fullscreen ? 0 : 56}px )`"
|
||||
></Table>
|
||||
<!-- 指标越限详情 -->
|
||||
<OverLimitDetails ref="OverLimitDetailsRef" />
|
||||
</div>
|
||||
@@ -18,23 +29,52 @@ import { ref, onMounted, provide, reactive, watch, h } 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'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { getTimeOfTheMonth } from '@/utils/formatTime'
|
||||
import { ElTag } from 'element-plus'
|
||||
import OverLimitDetails from '@/components/cockpit/listOfMainMonitoringPoints/components/overLimitDetails.vue'
|
||||
import OverLimitDetails from '@/components/cockpit/indicatorFittingChart/components/overLimitDetails.vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useTimeCacheStore } from '@/stores/timeCache'
|
||||
|
||||
const prop = defineProps({
|
||||
w: { type: String },
|
||||
h: { type: String },
|
||||
width: { type: String },
|
||||
height: { type: String },
|
||||
timeKey: { type: String },
|
||||
timeValue: { type: Object }
|
||||
})
|
||||
const dictData = useDictData()
|
||||
const OverLimitDetailsRef = ref()
|
||||
const tableStore: any = new TableStore({
|
||||
url: '/user-boot/role/selectRoleDetail?id=0',
|
||||
method: 'POST',
|
||||
const headerHeight = ref(57)
|
||||
|
||||
const route = useRoute()
|
||||
const timeCacheStore = useTimeCacheStore()
|
||||
|
||||
const selectChange = (showSelect: any, height: any, datePickerValue?: any) => {
|
||||
headerHeight.value = height
|
||||
|
||||
// 如果有传入 datePicker 的值
|
||||
if (datePickerValue) {
|
||||
// 更新表格参数
|
||||
tableStore.table.params.searchBeginTime = datePickerValue.timeValue?.[0]
|
||||
tableStore.table.params.searchEndTime = datePickerValue.timeValue?.[1]
|
||||
}
|
||||
}
|
||||
|
||||
// 计算是否全屏展示
|
||||
const fullscreen = computed(() => {
|
||||
const w = Number(prop.w)
|
||||
const h = Number(prop.h)
|
||||
if (!isNaN(w) && !isNaN(h) && w === 12 && h === 6) {
|
||||
// 执行相应逻辑
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
const tableStore: any = new TableStore({
|
||||
url: '/harmonic-boot/mainLine/list',
|
||||
method: 'POST',
|
||||
showPage: false,
|
||||
exportName: '主要监测点列表',
|
||||
column: [
|
||||
@@ -48,79 +88,84 @@ const tableStore: any = new TableStore({
|
||||
},
|
||||
{
|
||||
title: '监测点名称',
|
||||
field: 'name',
|
||||
field: 'lineName',
|
||||
minWidth: '90',
|
||||
|
||||
render: 'customTemplate',
|
||||
customTemplate: (row: any) => {
|
||||
return `<span style='cursor: pointer;text-decoration: underline;'>${row.name}</span>`
|
||||
return `<span style='cursor: pointer;text-decoration: underline;'>${row.lineName}</span>`
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
title: '监测对象类型',
|
||||
field: 'type',
|
||||
field: 'objType',
|
||||
minWidth: '90'
|
||||
},
|
||||
{
|
||||
title: '是否治理',
|
||||
field: 'whetherToGovern',
|
||||
field: 'govern',
|
||||
minWidth: '70'
|
||||
},
|
||||
|
||||
{ title: '主要存在的电能质量问题', field: 'question', minWidth: '150' }
|
||||
{ title: '主要存在的电能质量问题', field: 'problems', minWidth: '150' }
|
||||
],
|
||||
beforeSearchFun: () => {
|
||||
tableStore.table.params.searchBeginTime = prop.timeValue?.[0] || getTimeOfTheMonth(prop.timeKey)[0]
|
||||
tableStore.table.params.searchEndTime = prop.timeValue?.[1] || getTimeOfTheMonth(prop.timeKey)[1]
|
||||
// 尝试从缓存获取时间值
|
||||
let beginTime, endTime
|
||||
|
||||
if (fullscreen.value) {
|
||||
const cached = timeCacheStore.getCache(route.path)
|
||||
if (cached && cached.timeValue) {
|
||||
beginTime = cached.timeValue[0]
|
||||
endTime = cached.timeValue[1]
|
||||
}
|
||||
}
|
||||
|
||||
// 如果缓存中没有则使用默认值
|
||||
tableStore.table.params.searchBeginTime = beginTime || prop.timeValue?.[0] || getTimeOfTheMonth(prop.timeKey)[0]
|
||||
|
||||
tableStore.table.params.searchEndTime = endTime || prop.timeValue?.[1] || getTimeOfTheMonth(prop.timeKey)[1]
|
||||
},
|
||||
loadCallback: () => {
|
||||
|
||||
tableStore.table.data = [
|
||||
{
|
||||
name: '10kV1#电动机',
|
||||
type: '电动机',
|
||||
whetherToGovern: '否',
|
||||
question: '3次谐波电压、5次谐波电流、电压不平衡度超标'
|
||||
},
|
||||
{
|
||||
name: '10kV2#(治理后)',
|
||||
type: '电焊机',
|
||||
whetherToGovern: '100A APF',
|
||||
question: '所有指标均合格'
|
||||
},
|
||||
{
|
||||
name: '380V电焊机(治理前)',
|
||||
type: '电焊机',
|
||||
whetherToGovern: '100A APF',
|
||||
question: '5次谐波电流、电压不平衡度超标'
|
||||
},
|
||||
{
|
||||
name: '380V水泵机',
|
||||
type: '电动机',
|
||||
whetherToGovern: '否',
|
||||
question: '所有指标均合格'
|
||||
}
|
||||
]
|
||||
|
||||
tableStore.table.height = `calc(${prop.height} - 80px)`
|
||||
}
|
||||
})
|
||||
|
||||
const tableRef = ref()
|
||||
provide('tableRef', tableRef)
|
||||
tableStore.table.params.type = ''
|
||||
tableStore.table.params.searchValue = ''
|
||||
tableStore.table.params.keywords = ''
|
||||
provide('tableStore', tableStore)
|
||||
|
||||
// 点击行
|
||||
const cellClickEvent = ({ row, column }: any) => {
|
||||
if (column.field == 'name') {
|
||||
if (column.field == 'lineName') {
|
||||
console.log(row)
|
||||
OverLimitDetailsRef.value.open(row)
|
||||
}
|
||||
}
|
||||
|
||||
// 获取缓存的初始值
|
||||
const getInitialInterval = (): 3 => {
|
||||
if (fullscreen.value) {
|
||||
const cached = timeCacheStore.getCache(route.path);
|
||||
if (cached && cached.interval !== undefined) {
|
||||
return cached.interval as 3; // 强制断言为 3 或根据实际类型调整
|
||||
}
|
||||
}
|
||||
return 3; // 明确返回字面量类型 3
|
||||
};
|
||||
// 外部总的时间值
|
||||
const getInitialTimeValue = () => {
|
||||
if (fullscreen.value) {
|
||||
const cached = timeCacheStore.getCache(route.path)
|
||||
if (cached && cached.timeValue) {
|
||||
return cached.timeValue
|
||||
}
|
||||
}
|
||||
return prop.timeValue // 使用传入的默认值
|
||||
}
|
||||
|
||||
// 在组件挂载时设置缓存值到 DatePicker
|
||||
onMounted(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
|
||||
@@ -7,27 +7,70 @@
|
||||
<el-select
|
||||
v-model="tableStore.table.params.searchValue"
|
||||
placeholder="请选择谐波次数"
|
||||
style="width: 240px"
|
||||
style="width: 150px"
|
||||
>
|
||||
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
|
||||
<el-option
|
||||
v-for="item in harmonicOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="指标类型">
|
||||
<el-form-item label="指标类型" v-show="!tableStore.table.params.checked">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.searchValue"
|
||||
v-model="tableStore.table.params.indicatorType"
|
||||
placeholder="请选择指标类型"
|
||||
style="width: 240px"
|
||||
style="width: 150px"
|
||||
>
|
||||
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
|
||||
<el-option
|
||||
v-for="item in indicatorList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="指标类型1" v-show="tableStore.table.params.checked == true">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.indicatorType1"
|
||||
placeholder="请选择指标类型1"
|
||||
style="width: 150px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in indicatorList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="指标类型2" v-show="tableStore.table.params.checked == true">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.indicatorType2"
|
||||
placeholder="请选择指标类型2"
|
||||
style="width: 150px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in indicatorList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-checkbox v-model="tableStore.table.params.checked">指标对比分析</el-checkbox>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<my-echart
|
||||
class="tall"
|
||||
v-if="!tableStore.table.params.checked"
|
||||
:options="echartList"
|
||||
style="width: 98%; height: 320px"
|
||||
/>
|
||||
<my-echart class="tall" v-else :options="echartContrastList" style="width: 98%; height: 320px" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
@@ -55,16 +98,12 @@ const options = [
|
||||
]
|
||||
|
||||
const config = useConfig()
|
||||
const powerList: any = ref([
|
||||
{
|
||||
label: '三相总有功功率',
|
||||
value: '1'
|
||||
},
|
||||
{
|
||||
label: '三相总无功功率',
|
||||
value: '2'
|
||||
}
|
||||
])
|
||||
|
||||
const harmonicOptions = Array.from({ length: 50 }, (_, i) => ({
|
||||
value: String(i + 1),
|
||||
label: `${i + 1}次谐波`
|
||||
}))
|
||||
|
||||
const exceedingTheLimitList: any = ref([
|
||||
{
|
||||
label: '越限',
|
||||
@@ -95,9 +134,8 @@ const indicatorList: any = ref([
|
||||
])
|
||||
const echartList = ref({
|
||||
title: {
|
||||
text: '35kV进线谐波含有率',
|
||||
text: '谐波电压含有率'
|
||||
},
|
||||
|
||||
xAxis: {
|
||||
type: 'time',
|
||||
axisLabel: {
|
||||
@@ -108,7 +146,6 @@ const echartList = ref({
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
yAxis: [{}, {}],
|
||||
grid: {
|
||||
left: '10px',
|
||||
@@ -117,51 +154,171 @@ const echartList = ref({
|
||||
options: {
|
||||
series: [
|
||||
{
|
||||
// name: '暂降次数',
|
||||
type: 'bar',
|
||||
name: '有功功率',
|
||||
name: 'A相',
|
||||
type: 'line',
|
||||
showSymbol: false,
|
||||
smooth: true,
|
||||
data: [
|
||||
['2025-10-16 07:00:00', 10],
|
||||
['2025-10-16 07:15:00', 10],
|
||||
['2025-10-16 07:30:00', 10],
|
||||
['2025-10-16 07:45:00', 10],
|
||||
['2025-10-16 08:00:00', 30],
|
||||
['2025-10-16 08:15:00', 50],
|
||||
['2025-10-16 08:30:00', 60],
|
||||
['2025-10-16 08:45:00', 70],
|
||||
['2025-10-16 09:00:00', 100],
|
||||
['2025-10-16 09:15:00', 120],
|
||||
['2025-10-16 09:30:00', 130],
|
||||
['2025-10-16 09:45:00', 140],
|
||||
['2025-10-16 10:00:00', 160],
|
||||
['2025-10-16 10:15:00', 160],
|
||||
['2025-10-16 10:30:00', 130],
|
||||
['2025-10-16 10:45:00', 120],
|
||||
['2025-10-16 11:00:00', 140],
|
||||
['2025-10-16 11:15:00', 80],
|
||||
['2025-10-16 11:30:00', 70],
|
||||
['2025-10-16 11:45:00', 90],
|
||||
['2025-10-16 12:00:00', 60],
|
||||
['2025-10-16 12:15:00', 60],
|
||||
['2025-10-16 12:30:00', 60],
|
||||
['2025-10-16 12:45:00', 60]
|
||||
['2025-10-16 07:00:00', 0.5],
|
||||
['2025-10-16 07:15:00', 0.6],
|
||||
['2025-10-16 07:30:00', 0.4],
|
||||
['2025-10-16 07:45:00', 0.7],
|
||||
['2025-10-16 08:00:00', 1.2],
|
||||
['2025-10-16 08:15:00', 1.5],
|
||||
['2025-10-16 08:30:00', 1.8],
|
||||
['2025-10-16 08:45:00', 2.1],
|
||||
['2025-10-16 09:00:00', 2.5],
|
||||
['2025-10-16 09:15:00', 2.8],
|
||||
['2025-10-16 09:30:00', 3.0],
|
||||
['2025-10-16 09:45:00', 2.7],
|
||||
['2025-10-16 10:00:00', 2.2],
|
||||
['2025-10-16 10:15:00', 1.9],
|
||||
['2025-10-16 10:30:00', 1.6],
|
||||
['2025-10-16 10:45:00', 1.3],
|
||||
['2025-10-16 11:00:00', 1.1],
|
||||
['2025-10-16 11:15:00', 0.8],
|
||||
['2025-10-16 11:30:00', 0.6],
|
||||
['2025-10-16 11:45:00', 0.4],
|
||||
['2025-10-16 12:00:00', 0.3],
|
||||
['2025-10-16 12:15:00', 0.2],
|
||||
['2025-10-16 12:30:00', 0.3],
|
||||
['2025-10-16 12:45:00', 0.4]
|
||||
],
|
||||
itemStyle: {
|
||||
normal: {
|
||||
//这里是颜色
|
||||
color: function (params: any) {
|
||||
if (params.value[1] == 0 || params.value[1] == 3.14159) {
|
||||
return '#ccc'
|
||||
} else {
|
||||
return config.layout.elementUiPrimary[0]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
yAxisIndex: 0
|
||||
},
|
||||
{
|
||||
name: '谐波总畸变率',
|
||||
name: 'B相',
|
||||
type: 'line',
|
||||
showSymbol: false,
|
||||
smooth: true,
|
||||
data: [
|
||||
['2025-10-16 07:00:00', 0.4],
|
||||
['2025-10-16 07:15:00', 0.5],
|
||||
['2025-10-16 07:30:00', 0.3],
|
||||
['2025-10-16 07:45:00', 0.6],
|
||||
['2025-10-16 08:00:00', 1.0],
|
||||
['2025-10-16 08:15:00', 1.3],
|
||||
['2025-10-16 08:30:00', 1.6],
|
||||
['2025-10-16 08:45:00', 1.9],
|
||||
['2025-10-16 09:00:00', 2.2],
|
||||
['2025-10-16 09:15:00', 2.5],
|
||||
['2025-10-16 09:30:00', 2.7],
|
||||
['2025-10-16 09:45:00', 2.4],
|
||||
['2025-10-16 10:00:00', 2.0],
|
||||
['2025-10-16 10:15:00', 1.7],
|
||||
['2025-10-16 10:30:00', 1.4],
|
||||
['2025-10-16 10:45:00', 1.1],
|
||||
['2025-10-16 11:00:00', 0.9],
|
||||
['2025-10-16 11:15:00', 0.7],
|
||||
['2025-10-16 11:30:00', 0.5],
|
||||
['2025-10-16 11:45:00', 0.3],
|
||||
['2025-10-16 12:00:00', 0.2],
|
||||
['2025-10-16 12:15:00', 0.1],
|
||||
['2025-10-16 12:30:00', 0.2],
|
||||
['2025-10-16 12:45:00', 0.3]
|
||||
],
|
||||
yAxisIndex: 0
|
||||
},
|
||||
{
|
||||
name: 'C相',
|
||||
type: 'line',
|
||||
showSymbol: false,
|
||||
smooth: true,
|
||||
data: [
|
||||
['2025-10-16 07:00:00', 0.6],
|
||||
['2025-10-16 07:15:00', 0.7],
|
||||
['2025-10-16 07:30:00', 0.5],
|
||||
['2025-10-16 07:45:00', 0.8],
|
||||
['2025-10-16 08:00:00', 1.4],
|
||||
['2025-10-16 08:15:00', 1.7],
|
||||
['2025-10-16 08:30:00', 2.0],
|
||||
['2025-10-16 08:45:00', 2.3],
|
||||
['2025-10-16 09:00:00', 2.8],
|
||||
['2025-10-16 09:15:00', 3.1],
|
||||
['2025-10-16 09:30:00', 3.3],
|
||||
['2025-10-16 09:45:00', 3.0],
|
||||
['2025-10-16 10:00:00', 2.5],
|
||||
['2025-10-16 10:15:00', 2.1],
|
||||
['2025-10-16 10:30:00', 1.8],
|
||||
['2025-10-16 10:45:00', 1.5],
|
||||
['2025-10-16 11:00:00', 1.3],
|
||||
['2025-10-16 11:15:00', 1.0],
|
||||
['2025-10-16 11:30:00', 0.8],
|
||||
['2025-10-16 11:45:00', 0.6],
|
||||
['2025-10-16 12:00:00', 0.5],
|
||||
['2025-10-16 12:15:00', 0.4],
|
||||
['2025-10-16 12:30:00', 0.5],
|
||||
['2025-10-16 12:45:00', 0.6]
|
||||
],
|
||||
yAxisIndex: 0
|
||||
},
|
||||
{
|
||||
name: '暂降触发点',
|
||||
type: 'line',
|
||||
showSymbol: false,
|
||||
smooth: true,
|
||||
data: [
|
||||
['2025-10-16 07:00:00', 3.14159],
|
||||
['2025-10-16 07:15:00', 3.14159],
|
||||
['2025-10-16 07:30:00', 3.14159],
|
||||
['2025-10-16 07:45:00', 3.14159],
|
||||
['2025-10-16 08:00:00', 3.14159],
|
||||
['2025-10-16 08:15:00', 3.14159],
|
||||
['2025-10-16 08:30:00', 3.14159],
|
||||
['2025-10-16 08:45:00', 3.14159],
|
||||
['2025-10-16 09:00:00', 3.14159],
|
||||
['2025-10-16 09:15:00', 3.14159],
|
||||
['2025-10-16 09:30:00', 3.14159],
|
||||
['2025-10-16 09:45:00', 3.14159],
|
||||
['2025-10-16 10:00:00', 3.14159],
|
||||
['2025-10-16 10:15:00', 3.14159],
|
||||
['2025-10-16 10:30:00', 3.14159],
|
||||
['2025-10-16 10:45:00', 3.14159],
|
||||
['2025-10-16 11:00:00', 3.14159],
|
||||
['2025-10-16 11:15:00', 3.14159],
|
||||
['2025-10-16 11:30:00', 3.14159],
|
||||
['2025-10-16 11:45:00', 3.14159],
|
||||
['2025-10-16 12:00:00', 3.14159],
|
||||
['2025-10-16 12:15:00', 3.14159],
|
||||
['2025-10-16 12:30:00', 3.14159],
|
||||
['2025-10-16 12:45:00', 3.14159]
|
||||
],
|
||||
lineStyle: {
|
||||
type: 'dashed',
|
||||
color: '#ff0000' // 红色
|
||||
},
|
||||
itemStyle: {
|
||||
color: '#ff0000' // 红色
|
||||
},
|
||||
yAxisIndex: 0
|
||||
}
|
||||
]
|
||||
}
|
||||
})
|
||||
|
||||
const echartContrastList = ref({
|
||||
title: {
|
||||
text: 'A相谐波电压和A相谐波电流对比趋势图'
|
||||
},
|
||||
xAxis: {
|
||||
type: 'time',
|
||||
axisLabel: {
|
||||
formatter: {
|
||||
day: '{MM}-{dd}',
|
||||
month: '{MM}',
|
||||
year: '{yyyy}'
|
||||
}
|
||||
}
|
||||
},
|
||||
yAxis: [{}, {}],
|
||||
grid: {
|
||||
left: '10px',
|
||||
right: '20px'
|
||||
},
|
||||
options: {
|
||||
series: [
|
||||
{
|
||||
name: 'A相谐波电压',
|
||||
type: 'line',
|
||||
showSymbol: false,
|
||||
smooth: true,
|
||||
@@ -191,11 +348,45 @@ const echartList = ref({
|
||||
['2025-10-16 12:30:00', 0],
|
||||
['2025-10-16 12:45:00', 0]
|
||||
],
|
||||
yAxisIndex: 0
|
||||
},
|
||||
{
|
||||
name: 'A相谐波电流',
|
||||
type: 'line',
|
||||
showSymbol: false,
|
||||
smooth: true,
|
||||
data: [
|
||||
['2025-10-16 07:00:00', 0],
|
||||
['2025-10-16 07:15:00', 0],
|
||||
['2025-10-16 07:30:00', 0],
|
||||
['2025-10-16 07:45:00', 0],
|
||||
['2025-10-16 08:00:00', 0],
|
||||
['2025-10-16 08:15:00', 0.05],
|
||||
['2025-10-16 08:30:00', 0.05],
|
||||
['2025-10-16 08:45:00', 0.05],
|
||||
['2025-10-16 09:00:00', 0.5],
|
||||
['2025-10-16 09:15:00', 0.5],
|
||||
['2025-10-16 09:30:00', 0.5],
|
||||
['2025-10-16 09:45:00', 0.5],
|
||||
['2025-10-16 10:00:00', 0.4],
|
||||
['2025-10-16 10:15:00', 0.4],
|
||||
['2025-10-16 10:30:00', 0.4],
|
||||
['2025-10-16 10:45:00', 0.4],
|
||||
['2025-10-16 11:00:00', 0.4],
|
||||
['2025-10-16 11:15:00', 0.05],
|
||||
['2025-10-16 11:30:00', 0.05],
|
||||
['2025-10-16 11:45:00', 0.05],
|
||||
['2025-10-16 12:00:00', 0],
|
||||
['2025-10-16 12:15:00', 0],
|
||||
['2025-10-16 12:30:00', 0],
|
||||
['2025-10-16 12:45:00', 0]
|
||||
],
|
||||
yAxisIndex: 1
|
||||
}
|
||||
]
|
||||
}
|
||||
})
|
||||
|
||||
const headerHeight = ref(57)
|
||||
const selectChange = (showSelect: any, height: any) => {
|
||||
headerHeight.value = height
|
||||
@@ -219,6 +410,10 @@ tableStore.table.params.power = '1'
|
||||
tableStore.table.params.indicator = '1'
|
||||
tableStore.table.params.exceedingTheLimit = '1'
|
||||
tableStore.table.params.searchValue = ''
|
||||
tableStore.table.params.checked = false
|
||||
tableStore.table.params.indicatorType = '' // 指标类型
|
||||
tableStore.table.params.indicatorType1 = '' // 指标类型1
|
||||
tableStore.table.params.indicatorType2 = '' // 指标类型2
|
||||
provide('tableStore', tableStore)
|
||||
|
||||
onMounted(() => {
|
||||
|
||||
@@ -0,0 +1,134 @@
|
||||
<template>
|
||||
<!-- 综合评估详情 -->
|
||||
<el-dialog draggable title="指标合格率统计" v-model="dialogVisible" append-to-body width="70%">
|
||||
<TableHeader datePicker showExport :showReset="false">
|
||||
<template v-slot:select>
|
||||
<el-form-item label="监测点名称">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.searchValue"
|
||||
placeholder="请选择监测点名称"
|
||||
style="width: 240px"
|
||||
>
|
||||
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" isGroup :height="height"></Table>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, provide } from 'vue'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
const dialogVisible: any = ref(false)
|
||||
const options = [
|
||||
{
|
||||
value: '35kV进线',
|
||||
label: '35kV进线'
|
||||
}
|
||||
]
|
||||
const height = mainHeight(0, 2).height as any
|
||||
const loop50 = (key: string) => {
|
||||
let list: any[] = []
|
||||
for (let i = 2; i < 51; i++) {
|
||||
list.push({
|
||||
title: i + '次',
|
||||
// field: key + i,
|
||||
field: 'flicker',
|
||||
width: '80'
|
||||
})
|
||||
}
|
||||
return list
|
||||
}
|
||||
const tableStore: any = new TableStore({
|
||||
url: '/user-boot/role/selectRoleDetail?id=0',
|
||||
method: 'POST',
|
||||
publicHeight: 30,
|
||||
showPage: false,
|
||||
exportName: '主要监测点列表',
|
||||
column: [
|
||||
{
|
||||
field: 'index',
|
||||
title: '序号',
|
||||
width: '80',
|
||||
formatter: (row: any) => {
|
||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '日期',
|
||||
field: 'time',
|
||||
width: '150'
|
||||
},
|
||||
{
|
||||
title: '名称',
|
||||
field: 'name',
|
||||
width: '150'
|
||||
},
|
||||
{
|
||||
title: '闪变越限(分钟)',
|
||||
field: 'flicker',
|
||||
width: '80'
|
||||
},
|
||||
{
|
||||
title: '谐波电压越限(分钟)',
|
||||
children: loop50('voltage')
|
||||
},
|
||||
{
|
||||
title: '谐波电流越限(分钟)',
|
||||
children: loop50('harmonicCurrent')
|
||||
},
|
||||
{
|
||||
title: '三相不平衡度越限(分钟)',
|
||||
field: 'flicker',
|
||||
width: '100'
|
||||
},
|
||||
{
|
||||
title: '电压偏差越限(分钟)',
|
||||
field: 'flicker',
|
||||
width: '100'
|
||||
},
|
||||
{
|
||||
title: '频率偏差越限(分钟)',
|
||||
field: 'flicker',
|
||||
width: '100'
|
||||
}
|
||||
],
|
||||
beforeSearchFun: () => {},
|
||||
loadCallback: () => {
|
||||
tableStore.table.data = [
|
||||
{
|
||||
time: '2024-01-01 00:00:00',
|
||||
name: '35kV进线',
|
||||
flicker: '0',
|
||||
|
||||
},
|
||||
{
|
||||
time: '2024-01-01 00:00:00',
|
||||
name: '35kV进线',
|
||||
flicker: '0',
|
||||
|
||||
},
|
||||
{
|
||||
time: '2024-01-01 00:00:00',
|
||||
name: '35kV进线',
|
||||
flicker: '0',
|
||||
|
||||
},
|
||||
]
|
||||
}
|
||||
})
|
||||
|
||||
tableStore.table.params.searchValue = ''
|
||||
provide('tableStore', tableStore)
|
||||
const open = async (row: any) => {
|
||||
dialogVisible.value = true
|
||||
tableStore.index()
|
||||
}
|
||||
|
||||
defineExpose({ open })
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -8,7 +8,7 @@
|
||||
<el-select
|
||||
v-model="tableStore.table.params.searchValue"
|
||||
placeholder="请选择监测点名称"
|
||||
style="width: 240px"
|
||||
style="width: 150px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
@@ -147,6 +147,7 @@ const open = async (row: any) => {
|
||||
|
||||
// 点击行
|
||||
const cellClickEvent = ({ row, column }: any) => {
|
||||
console.log(row, '1111')
|
||||
if (column.field != 'name' && column.field != 'time') {
|
||||
harmonicRatioRef.value.openDialog(row)
|
||||
}
|
||||
|
||||
@@ -70,6 +70,9 @@ import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { getTimeOfTheMonth } from '@/utils/formatTime'
|
||||
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||
import { useConfig } from '@/stores/config'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useTimeCacheStore } from '@/stores/timeCache'
|
||||
|
||||
const prop = defineProps({
|
||||
w: { type: String },
|
||||
h: { type: String },
|
||||
@@ -78,6 +81,10 @@ const prop = defineProps({
|
||||
timeKey: { type: String },
|
||||
timeValue: { type: Object }
|
||||
})
|
||||
|
||||
|
||||
const route = useRoute()
|
||||
const timeCacheStore = useTimeCacheStore()
|
||||
const config = useConfig()
|
||||
const powerList: any = ref([
|
||||
{
|
||||
@@ -242,9 +249,22 @@ const tableStore: any = new TableStore({
|
||||
showPage: false,
|
||||
exportName: '主要监测点列表',
|
||||
column: [],
|
||||
beforeSearchFun: () => {
|
||||
tableStore.table.params.searchBeginTime = prop.timeValue?.[0] || getTimeOfTheMonth(prop.timeKey)[0]
|
||||
tableStore.table.params.searchEndTime = prop.timeValue?.[1] || getTimeOfTheMonth(prop.timeKey)[1]
|
||||
beforeSearchFun: () => {
|
||||
// 尝试从缓存获取时间值
|
||||
let beginTime, endTime
|
||||
|
||||
if (fullscreen.value) {
|
||||
const cached = timeCacheStore.getCache(route.path)
|
||||
if (cached && cached.timeValue) {
|
||||
beginTime = cached.timeValue[0]
|
||||
endTime = cached.timeValue[1]
|
||||
}
|
||||
}
|
||||
|
||||
// 如果缓存中没有则使用默认值
|
||||
tableStore.table.params.searchBeginTime = beginTime || prop.timeValue?.[0] || getTimeOfTheMonth(prop.timeKey)[0]
|
||||
|
||||
tableStore.table.params.searchEndTime = endTime || prop.timeValue?.[1] || getTimeOfTheMonth(prop.timeKey)[1]
|
||||
},
|
||||
loadCallback: () => {
|
||||
tableStore.table.height = `calc(${prop.height} - 80px)`
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<div>
|
||||
<!--监测点列表 -->
|
||||
|
||||
<Table ref="tableRef" @cell-click="cellClickEvent" :height="`calc(${prop.height} )`"></Table>
|
||||
<TableHeader :showReset="false" @selectChange="selectChange" datePicker v-if="fullscreen"></TableHeader>
|
||||
<Table ref="tableRef" @cell-click="cellClickEvent" :height="`calc(${prop.height} - ${headerHeight}px + ${fullscreen ? 0 : 56}px )`"></Table>
|
||||
<!-- 指标越限详情 -->
|
||||
<OverLimitDetails ref="OverLimitDetailsRef" />
|
||||
</div>
|
||||
@@ -11,19 +11,51 @@
|
||||
import { ref, onMounted, provide, reactive, watch, h } 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'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { getTimeOfTheMonth } from '@/utils/formatTime'
|
||||
import { ElTag } from 'element-plus'
|
||||
import OverLimitDetails from '@/components/cockpit/listOfMainMonitoringPoints/components/overLimitDetails.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useTimeCacheStore } from '@/stores/timeCache'
|
||||
|
||||
const prop = defineProps({
|
||||
w: { type: String },
|
||||
h: { type: String },
|
||||
width: { type: String },
|
||||
height: { type: String },
|
||||
timeKey: { type: String },
|
||||
timeValue: { type: Object }
|
||||
})
|
||||
const dictData = useDictData()
|
||||
|
||||
const headerHeight = ref(57)
|
||||
|
||||
const route = useRoute()
|
||||
const timeCacheStore = useTimeCacheStore()
|
||||
|
||||
const selectChange = (showSelect: any, height: any, datePickerValue?: any) => {
|
||||
headerHeight.value = height
|
||||
|
||||
// 如果有传入 datePicker 的值
|
||||
if (datePickerValue) {
|
||||
// 更新表格参数
|
||||
tableStore.table.params.searchBeginTime = datePickerValue.timeValue?.[0]
|
||||
tableStore.table.params.searchEndTime = datePickerValue.timeValue?.[1]
|
||||
}
|
||||
}
|
||||
|
||||
// 计算是否全屏展示
|
||||
const fullscreen = computed(() => {
|
||||
const w = Number(prop.w)
|
||||
const h = Number(prop.h)
|
||||
if (!isNaN(w) && !isNaN(h) && w === 12 && h === 6) {
|
||||
// 执行相应逻辑
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
|
||||
const OverLimitDetailsRef = ref()
|
||||
const tableStore: any = new TableStore({
|
||||
url: '/user-boot/role/selectRoleDetail?id=0',
|
||||
@@ -63,8 +95,8 @@ const tableStore: any = new TableStore({
|
||||
minWidth: '80',
|
||||
render: 'customTemplate',
|
||||
customTemplate: (row: any) => {
|
||||
return `<span style='cursor: pointer;text-decoration: underline;' onclick="handleReportClick('${row.name}')">${row.type2}</span>`
|
||||
},
|
||||
return `<span style='cursor: pointer;text-decoration: underline;' onclick="handleReportClick('${row.name}')">${row.type2}</span>`
|
||||
}
|
||||
},
|
||||
{ title: '监测点名称', field: 'type3', minWidth: '70' },
|
||||
{ title: '监测类型', field: 'type4', minWidth: '60' },
|
||||
@@ -80,8 +112,21 @@ const tableStore: any = new TableStore({
|
||||
{ title: '最新数据时间', field: 'type6', minWidth: '140' }
|
||||
],
|
||||
beforeSearchFun: () => {
|
||||
tableStore.table.params.searchBeginTime = prop.timeValue?.[0] || getTimeOfTheMonth(prop.timeKey)[0]
|
||||
tableStore.table.params.searchEndTime = prop.timeValue?.[1] || getTimeOfTheMonth(prop.timeKey)[1]
|
||||
// 尝试从缓存获取时间值
|
||||
let beginTime, endTime
|
||||
|
||||
if (fullscreen.value) {
|
||||
const cached = timeCacheStore.getCache(route.path)
|
||||
if (cached && cached.timeValue) {
|
||||
beginTime = cached.timeValue[0]
|
||||
endTime = cached.timeValue[1]
|
||||
}
|
||||
}
|
||||
|
||||
// 如果缓存中没有则使用默认值
|
||||
tableStore.table.params.searchBeginTime = beginTime || prop.timeValue?.[0] || getTimeOfTheMonth(prop.timeKey)[0]
|
||||
|
||||
tableStore.table.params.searchEndTime = endTime || prop.timeValue?.[1] || getTimeOfTheMonth(prop.timeKey)[1]
|
||||
},
|
||||
loadCallback: () => {
|
||||
tableStore.table.data = [
|
||||
@@ -165,21 +210,21 @@ watch(
|
||||
)
|
||||
|
||||
const handleReportClick = (id: string) => {
|
||||
const row = tableStore.table.data.find((item: any) => item.id === id)
|
||||
if (row && row.type2 !== '/') {
|
||||
// 示例:触发下载逻辑(根据你注释掉的代码)
|
||||
// getFileZip({ eventId: id }).then(res => {
|
||||
// let blob = new Blob([res], { type: 'application/zip' })
|
||||
// const url = window.URL.createObjectURL(blob)
|
||||
// const link = document.createElement('a')
|
||||
// link.href = url
|
||||
// link.download = row.wavePath?.split('/')[2] || '报告文件.zip'
|
||||
// link.click()
|
||||
// })
|
||||
console.log('点击了报告:', row.type2)
|
||||
} else {
|
||||
ElMessage.warning('暂无报告可下载')
|
||||
}
|
||||
const row = tableStore.table.data.find((item: any) => item.id === id)
|
||||
if (row && row.type2 !== '/') {
|
||||
// 示例:触发下载逻辑(根据你注释掉的代码)
|
||||
// getFileZip({ eventId: id }).then(res => {
|
||||
// let blob = new Blob([res], { type: 'application/zip' })
|
||||
// const url = window.URL.createObjectURL(blob)
|
||||
// const link = document.createElement('a')
|
||||
// link.href = url
|
||||
// link.download = row.wavePath?.split('/')[2] || '报告文件.zip'
|
||||
// link.click()
|
||||
// })
|
||||
console.log('点击了报告:', row.type2)
|
||||
} else {
|
||||
ElMessage.warning('暂无报告可下载')
|
||||
}
|
||||
}
|
||||
|
||||
// 挂载到 window 供 HTML 调用
|
||||
@@ -187,7 +232,7 @@ window.handleReportClick = handleReportClick
|
||||
|
||||
// 组件销毁时清理全局方法
|
||||
onBeforeUnmount(() => {
|
||||
delete window.handleReportClick
|
||||
delete window.handleReportClick
|
||||
})
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
|
||||
@@ -1,13 +1,21 @@
|
||||
<template>
|
||||
<div>
|
||||
|
||||
<!--总体指标越限统计 -->
|
||||
<TableHeader :showReset="false" @selectChange="selectChange" datePicker v-if="fullscreen"></TableHeader>
|
||||
<my-echart
|
||||
class="tall"
|
||||
:options="echartList"
|
||||
:style="{ width: prop.width, height: `calc(${prop.height} / 2 )` }"
|
||||
:style="{
|
||||
width: prop.width,
|
||||
height: `calc(${prop.height} / 2 )`
|
||||
}"
|
||||
/>
|
||||
<Table ref="tableRef" @cell-click="cellClickEvent" :height="`calc(${prop.height} / 2 )`" isGroup></Table>
|
||||
<Table
|
||||
ref="tableRef"
|
||||
@cell-click="cellClickEvent"
|
||||
:height="`calc(${prop.height} / 2 - ${headerHeight}px + ${fullscreen ? 0 : 56}px )`"
|
||||
isGroup
|
||||
></Table>
|
||||
<!-- 指标越限详情 -->
|
||||
<OverLimitDetails ref="OverLimitDetailsRef" />
|
||||
</div>
|
||||
@@ -16,17 +24,49 @@
|
||||
import { ref, onMounted, provide, reactive, watch, h } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { getTimeOfTheMonth } from '@/utils/formatTime'
|
||||
import OverLimitDetails from '@/components/cockpit/listOfMainMonitoringPoints/components/overLimitDetails.vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useTimeCacheStore } from '@/stores/timeCache'
|
||||
|
||||
const prop = defineProps({
|
||||
w: { type: String },
|
||||
h: { type: String },
|
||||
width: { type: String },
|
||||
height: { type: String },
|
||||
timeKey: { type: String },
|
||||
timeValue: { type: Object }
|
||||
})
|
||||
|
||||
const headerHeight = ref(57)
|
||||
|
||||
const route = useRoute()
|
||||
const timeCacheStore = useTimeCacheStore()
|
||||
|
||||
const selectChange = (showSelect: any, height: any, datePickerValue?: any) => {
|
||||
headerHeight.value = height
|
||||
|
||||
// 如果有传入 datePicker 的值
|
||||
if (datePickerValue) {
|
||||
// 更新表格参数
|
||||
tableStore.table.params.searchBeginTime = datePickerValue.timeValue?.[0]
|
||||
tableStore.table.params.searchEndTime = datePickerValue.timeValue?.[1]
|
||||
}
|
||||
}
|
||||
|
||||
// 计算是否全屏展示
|
||||
const fullscreen = computed(() => {
|
||||
const w = Number(prop.w)
|
||||
const h = Number(prop.h)
|
||||
if (!isNaN(w) && !isNaN(h) && w === 12 && h === 6) {
|
||||
// 执行相应逻辑
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
const echartList = ref({
|
||||
title: {
|
||||
text: '指标越限占比'
|
||||
@@ -52,7 +92,7 @@ const echartList = ref({
|
||||
type: 'bar',
|
||||
name: '越限占比',
|
||||
data: [0, 45, 22, 0, 70],
|
||||
barMaxWidth: 30,
|
||||
barMaxWidth: 30
|
||||
|
||||
// label: {
|
||||
// show: true,
|
||||
@@ -140,8 +180,21 @@ const tableStore: any = new TableStore({
|
||||
}
|
||||
],
|
||||
beforeSearchFun: () => {
|
||||
tableStore.table.params.searchBeginTime = prop.timeValue?.[0] || getTimeOfTheMonth(prop.timeKey)[0]
|
||||
tableStore.table.params.searchEndTime = prop.timeValue?.[1] || getTimeOfTheMonth(prop.timeKey)[1]
|
||||
// 尝试从缓存获取时间值
|
||||
let beginTime, endTime
|
||||
|
||||
if (fullscreen.value) {
|
||||
const cached = timeCacheStore.getCache(route.path)
|
||||
if (cached && cached.timeValue) {
|
||||
beginTime = cached.timeValue[0]
|
||||
endTime = cached.timeValue[1]
|
||||
}
|
||||
}
|
||||
|
||||
// 如果缓存中没有则使用默认值
|
||||
tableStore.table.params.searchBeginTime = beginTime || prop.timeValue?.[0] || getTimeOfTheMonth(prop.timeKey)[0]
|
||||
|
||||
tableStore.table.params.searchEndTime = endTime || prop.timeValue?.[1] || getTimeOfTheMonth(prop.timeKey)[1]
|
||||
},
|
||||
loadCallback: () => {
|
||||
tableStore.table.data = [
|
||||
|
||||
@@ -1,25 +1,57 @@
|
||||
<template>
|
||||
<div>
|
||||
<!--敏感负荷列表 -->
|
||||
|
||||
<Table ref="tableRef" @cell-click="cellClickEvent" :height="`calc(${prop.height})`" isGroup></Table>
|
||||
<TableHeader :showReset="false" @selectChange="selectChange" datePicker v-if="fullscreen"></TableHeader>
|
||||
<Table ref="tableRef" @cell-click="cellClickEvent" :height="`calc(${prop.height} - ${headerHeight}px + ${fullscreen ? 0 : 56}px )`" isGroup></Table>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, provide, reactive, watch, h } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { getTimeOfTheMonth } from '@/utils/formatTime'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useTimeCacheStore } from '@/stores/timeCache'
|
||||
|
||||
const prop = defineProps({
|
||||
w: { type: String },
|
||||
h: { type: String },
|
||||
width: { type: String },
|
||||
height: { type: String },
|
||||
timeKey: { type: String },
|
||||
timeValue: { type: Object }
|
||||
})
|
||||
|
||||
const headerHeight = ref(57)
|
||||
|
||||
const route = useRoute()
|
||||
const timeCacheStore = useTimeCacheStore()
|
||||
|
||||
const selectChange = (showSelect: any, height: any, datePickerValue?: any) => {
|
||||
headerHeight.value = height
|
||||
|
||||
// 如果有传入 datePicker 的值
|
||||
if (datePickerValue) {
|
||||
// 更新表格参数
|
||||
tableStore.table.params.searchBeginTime = datePickerValue.timeValue?.[0]
|
||||
tableStore.table.params.searchEndTime = datePickerValue.timeValue?.[1]
|
||||
}
|
||||
}
|
||||
|
||||
// 计算是否全屏展示
|
||||
const fullscreen = computed(() => {
|
||||
const w = Number(prop.w)
|
||||
const h = Number(prop.h)
|
||||
if (!isNaN(w) && !isNaN(h) && w === 12 && h === 6) {
|
||||
// 执行相应逻辑
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
const OverLimitDetailsRef = ref()
|
||||
const tableStore: any = new TableStore({
|
||||
url: '/user-boot/dept/deptTree',
|
||||
@@ -58,9 +90,22 @@ const tableStore: any = new TableStore({
|
||||
minWidth: '80'
|
||||
}
|
||||
],
|
||||
beforeSearchFun: () => {
|
||||
tableStore.table.params.searchBeginTime = prop.timeValue?.[0] || getTimeOfTheMonth(prop.timeKey)[0]
|
||||
tableStore.table.params.searchEndTime = prop.timeValue?.[1] || getTimeOfTheMonth(prop.timeKey)[1]
|
||||
beforeSearchFun: () => {
|
||||
// 尝试从缓存获取时间值
|
||||
let beginTime, endTime
|
||||
|
||||
if (fullscreen.value) {
|
||||
const cached = timeCacheStore.getCache(route.path)
|
||||
if (cached && cached.timeValue) {
|
||||
beginTime = cached.timeValue[0]
|
||||
endTime = cached.timeValue[1]
|
||||
}
|
||||
}
|
||||
|
||||
// 如果缓存中没有则使用默认值
|
||||
tableStore.table.params.searchBeginTime = beginTime || prop.timeValue?.[0] || getTimeOfTheMonth(prop.timeKey)[0]
|
||||
|
||||
tableStore.table.params.searchEndTime = endTime || prop.timeValue?.[1] || getTimeOfTheMonth(prop.timeKey)[1]
|
||||
},
|
||||
loadCallback: () => {
|
||||
tableStore.table.data = [
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<div>
|
||||
<!--暂态事件明细 -->
|
||||
|
||||
<el-calendar v-model="value" :style="{ height: prop.height, overflow: 'auto' }">
|
||||
<TableHeader :showReset="false" @selectChange="selectChange" datePicker v-if="fullscreen"></TableHeader>
|
||||
<el-calendar v-model="value" :style="{ height: `calc(${prop.height} - ${headerHeight}px + ${fullscreen ? 0 : 56}px )`, overflow: 'auto' }">
|
||||
<template #date-cell="{ data }">
|
||||
<div style="height: 100%; padding: 8px" :style="{ background: setBackground(data.day) }">
|
||||
<p :class="data.isSelected ? 'is-selected' : ''">
|
||||
@@ -42,23 +42,53 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, provide, reactive, watch, h } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { getTimeOfTheMonth } from '@/utils/formatTime'
|
||||
import { overflow } from 'html2canvas/dist/types/css/property-descriptors/overflow'
|
||||
import { dayjs } from 'element-plus'
|
||||
import TransientList from './components/transientList.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useTimeCacheStore } from '@/stores/timeCache'
|
||||
|
||||
dayjs.en.weekStart = 1 //设置日历的周起始日为星期一
|
||||
const value = ref(new Date())
|
||||
const prop = defineProps({
|
||||
w: { type: String },
|
||||
h: { type: String },
|
||||
width: { type: String },
|
||||
height: { type: String },
|
||||
timeKey: { type: String },
|
||||
timeValue: { type: Object }
|
||||
})
|
||||
|
||||
const headerHeight = ref(57)
|
||||
|
||||
const route = useRoute()
|
||||
const timeCacheStore = useTimeCacheStore()
|
||||
|
||||
const selectChange = (showSelect: any, height: any, datePickerValue?: any) => {
|
||||
headerHeight.value = height
|
||||
|
||||
// 如果有传入 datePicker 的值
|
||||
if (datePickerValue) {
|
||||
// 更新表格参数
|
||||
tableStore.table.params.searchBeginTime = datePickerValue.timeValue?.[0]
|
||||
tableStore.table.params.searchEndTime = datePickerValue.timeValue?.[1]
|
||||
}
|
||||
}
|
||||
|
||||
// 计算是否全屏展示
|
||||
const fullscreen = computed(() => {
|
||||
const w = Number(prop.w)
|
||||
const h = Number(prop.h)
|
||||
if (!isNaN(w) && !isNaN(h) && w === 12 && h === 6) {
|
||||
// 执行相应逻辑
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
|
||||
dayjs.en.weekStart = 1 //设置日历的周起始日为星期一
|
||||
const value = ref(new Date())
|
||||
|
||||
const transientListRef = ref()
|
||||
const list = ref([
|
||||
{
|
||||
@@ -112,10 +142,22 @@ const tableStore: any = new TableStore({
|
||||
showPage: false,
|
||||
|
||||
column: [],
|
||||
beforeSearchFun: () => {
|
||||
tableStore.table.params.searchBeginTime = prop.timeValue?.[0] || getTimeOfTheMonth(prop.timeKey)[0]
|
||||
tableStore.table.params.searchEndTime = prop.timeValue?.[1] || getTimeOfTheMonth(prop.timeKey)[1]
|
||||
// value.value = new Date(prop.timeValue?.[0])
|
||||
beforeSearchFun: () => {
|
||||
// 尝试从缓存获取时间值
|
||||
let beginTime, endTime
|
||||
|
||||
if (fullscreen.value) {
|
||||
const cached = timeCacheStore.getCache(route.path)
|
||||
if (cached && cached.timeValue) {
|
||||
beginTime = cached.timeValue[0]
|
||||
endTime = cached.timeValue[1]
|
||||
}
|
||||
}
|
||||
|
||||
// 如果缓存中没有则使用默认值
|
||||
tableStore.table.params.searchBeginTime = beginTime || prop.timeValue?.[0] || getTimeOfTheMonth(prop.timeKey)[0]
|
||||
|
||||
tableStore.table.params.searchEndTime = endTime || prop.timeValue?.[1] || getTimeOfTheMonth(prop.timeKey)[1]
|
||||
},
|
||||
loadCallback: () => {
|
||||
tableStore.table.data = []
|
||||
|
||||
@@ -1,34 +1,68 @@
|
||||
<template>
|
||||
<div>
|
||||
<!--暂态事件概率分布 -->
|
||||
<TableHeader :showReset="false" @selectChange="selectChange" datePicker v-if="fullscreen"></TableHeader>
|
||||
<my-echart
|
||||
class="tall"
|
||||
:options="echartList"
|
||||
:style="{ width: prop.width, height: `calc(${prop.height} / 2 )` }"
|
||||
:style="{ width: prop.width, height: `calc(${prop.height} / 2 - ${headerHeight / 2}px + ${fullscreen ? 0 : 28}px )` }"
|
||||
/>
|
||||
<my-echart
|
||||
class="mt10"
|
||||
:options="echartList1"
|
||||
:style="{ width: prop.width, height: `calc(${prop.height} / 2 - 10px)` }"
|
||||
:style="{ width: prop.width, height: `calc(${prop.height} / 2 - ${headerHeight / 2}px + ${fullscreen ? 0 : 28}px )` }"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, provide, reactive, watch, h } from 'vue'
|
||||
import { ref, onMounted, provide, reactive, watch } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { getTimeOfTheMonth } from '@/utils/formatTime'
|
||||
import { useConfig } from '@/stores/config'
|
||||
const config = useConfig()
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useTimeCacheStore } from '@/stores/timeCache'
|
||||
|
||||
const prop = defineProps({
|
||||
w: { type: String },
|
||||
h: { type: String },
|
||||
width: { type: String },
|
||||
height: { type: String },
|
||||
timeKey: { type: String },
|
||||
timeValue: { type: Object }
|
||||
})
|
||||
|
||||
const headerHeight = ref(57)
|
||||
|
||||
const route = useRoute()
|
||||
const timeCacheStore = useTimeCacheStore()
|
||||
|
||||
const selectChange = (showSelect: any, height: any, datePickerValue?: any) => {
|
||||
headerHeight.value = height
|
||||
|
||||
// 如果有传入 datePicker 的值
|
||||
if (datePickerValue) {
|
||||
// 更新表格参数
|
||||
tableStore.table.params.searchBeginTime = datePickerValue.timeValue?.[0]
|
||||
tableStore.table.params.searchEndTime = datePickerValue.timeValue?.[1]
|
||||
}
|
||||
}
|
||||
|
||||
// 计算是否全屏展示
|
||||
const fullscreen = computed(() => {
|
||||
const w = Number(prop.w)
|
||||
const h = Number(prop.h)
|
||||
if (!isNaN(w) && !isNaN(h) && w === 12 && h === 6) {
|
||||
// 执行相应逻辑
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
|
||||
const config = useConfig()
|
||||
|
||||
const echartList = ref({
|
||||
options: {
|
||||
xAxis: null,
|
||||
@@ -308,8 +342,21 @@ const tableStore: any = new TableStore({
|
||||
showPage: false,
|
||||
column: [],
|
||||
beforeSearchFun: () => {
|
||||
tableStore.table.params.searchBeginTime = prop.timeValue?.[0] || getTimeOfTheMonth(prop.timeKey)[0]
|
||||
tableStore.table.params.searchEndTime = prop.timeValue?.[1] || getTimeOfTheMonth(prop.timeKey)[1]
|
||||
// 尝试从缓存获取时间值
|
||||
let beginTime, endTime
|
||||
|
||||
if (fullscreen.value) {
|
||||
const cached = timeCacheStore.getCache(route.path)
|
||||
if (cached && cached.timeValue) {
|
||||
beginTime = cached.timeValue[0]
|
||||
endTime = cached.timeValue[1]
|
||||
}
|
||||
}
|
||||
|
||||
// 如果缓存中没有则使用默认值
|
||||
tableStore.table.params.searchBeginTime = beginTime || prop.timeValue?.[0] || getTimeOfTheMonth(prop.timeKey)[0]
|
||||
|
||||
tableStore.table.params.searchEndTime = endTime || prop.timeValue?.[1] || getTimeOfTheMonth(prop.timeKey)[1]
|
||||
},
|
||||
loadCallback: () => {
|
||||
tableStore.table.data = []
|
||||
|
||||
@@ -1,12 +1,21 @@
|
||||
<template>
|
||||
<div>
|
||||
<!--暂态事件统计 -->
|
||||
<TableHeader :showReset="false" @selectChange="selectChange" datePicker v-if="fullscreen"></TableHeader>
|
||||
<my-echart
|
||||
class="tall"
|
||||
:options="echartList"
|
||||
:style="{ width: prop.width, height: `calc(${prop.height} / 2 )` }"
|
||||
:style="{
|
||||
width: prop.width,
|
||||
height: `calc(${prop.height} / 2 - ${headerHeight / 2}px + ${fullscreen ? 0 : 28}px )`
|
||||
}"
|
||||
/>
|
||||
<Table ref="tableRef" @cell-click="cellClickEvent" :height="`calc(${prop.height} / 2 )`" isGroup></Table>
|
||||
<Table
|
||||
ref="tableRef"
|
||||
@cell-click="cellClickEvent"
|
||||
:height="`calc(${prop.height} / 2 - ${headerHeight / 2}px + ${fullscreen ? 0 : 28}px )`"
|
||||
isGroup
|
||||
></Table>
|
||||
<TransientStatisticsDetail ref="transientStatisticsDetailRef"></TransientStatisticsDetail>
|
||||
</div>
|
||||
</template>
|
||||
@@ -15,18 +24,51 @@ import { ref, onMounted, provide, reactive, watch, h } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { getTimeOfTheMonth } from '@/utils/formatTime'
|
||||
import { useConfig } from '@/stores/config'
|
||||
import TransientStatisticsDetail from './components/transientStatisticsDetail.vue'
|
||||
const config = useConfig()
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useTimeCacheStore } from '@/stores/timeCache'
|
||||
|
||||
const prop = defineProps({
|
||||
w: { type: String },
|
||||
h: { type: String },
|
||||
width: { type: String },
|
||||
height: { type: String },
|
||||
timeKey: { type: String },
|
||||
timeValue: { type: Object }
|
||||
})
|
||||
|
||||
const headerHeight = ref(57)
|
||||
|
||||
const route = useRoute()
|
||||
const timeCacheStore = useTimeCacheStore()
|
||||
|
||||
const selectChange = (showSelect: any, height: any, datePickerValue?: any) => {
|
||||
headerHeight.value = height
|
||||
|
||||
// 如果有传入 datePicker 的值
|
||||
if (datePickerValue) {
|
||||
// 更新表格参数
|
||||
tableStore.table.params.searchBeginTime = datePickerValue.timeValue?.[0]
|
||||
tableStore.table.params.searchEndTime = datePickerValue.timeValue?.[1]
|
||||
}
|
||||
}
|
||||
|
||||
// 计算是否全屏展示
|
||||
const fullscreen = computed(() => {
|
||||
const w = Number(prop.w)
|
||||
const h = Number(prop.h)
|
||||
if (!isNaN(w) && !isNaN(h) && w === 12 && h === 6) {
|
||||
// 执行相应逻辑
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
const config = useConfig()
|
||||
|
||||
const data = [
|
||||
{
|
||||
name: '电压中断',
|
||||
@@ -148,8 +190,20 @@ const tableStore: any = new TableStore({
|
||||
}
|
||||
],
|
||||
beforeSearchFun: () => {
|
||||
tableStore.table.params.searchBeginTime = prop.timeValue?.[0] || getTimeOfTheMonth(prop.timeKey)[0]
|
||||
tableStore.table.params.searchEndTime = prop.timeValue?.[1] || getTimeOfTheMonth(prop.timeKey)[1]
|
||||
// 尝试从缓存获取时间值
|
||||
let beginTime, endTime
|
||||
|
||||
if (fullscreen.value) {
|
||||
const cached = timeCacheStore.getCache(route.path)
|
||||
if (cached && cached.timeValue) {
|
||||
beginTime = cached.timeValue[0]
|
||||
endTime = cached.timeValue[1]
|
||||
}
|
||||
}
|
||||
|
||||
// 如果缓存中没有则使用默认值
|
||||
tableStore.table.params.searchBeginTime = beginTime || prop.timeValue?.[0] || getTimeOfTheMonth(prop.timeKey)[0]
|
||||
tableStore.table.params.searchEndTime = endTime || prop.timeValue?.[1] || getTimeOfTheMonth(prop.timeKey)[1]
|
||||
},
|
||||
loadCallback: () => {
|
||||
tableStore.table.data = [
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<!--趋势对比 -->
|
||||
<TableHeader :showReset="false" @selectChange="selectChange" v-if="fullscreen">
|
||||
<TableHeader :showReset="false" datePicker @selectChange="selectChange" v-if="fullscreen">
|
||||
<template v-slot:select>
|
||||
<el-form-item label="监测点名称">
|
||||
<el-select
|
||||
@@ -67,6 +67,8 @@ import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { getTimeOfTheMonth } from '@/utils/formatTime'
|
||||
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||
import { useConfig } from '@/stores/config'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useTimeCacheStore } from '@/stores/timeCache'
|
||||
const prop = defineProps({
|
||||
w: { type: String },
|
||||
h: { type: String },
|
||||
@@ -75,6 +77,9 @@ const prop = defineProps({
|
||||
timeKey: { type: String },
|
||||
timeValue: { type: Object }
|
||||
})
|
||||
|
||||
const route = useRoute()
|
||||
const timeCacheStore = useTimeCacheStore()
|
||||
const config = useConfig()
|
||||
const powerList: any = ref([
|
||||
{
|
||||
@@ -238,8 +243,15 @@ const echartList = ref({
|
||||
}
|
||||
})
|
||||
const headerHeight = ref(57)
|
||||
const selectChange = (showSelect: any, height: any) => {
|
||||
const selectChange = (showSelect: any, height: any, datePickerValue?: any) => {
|
||||
headerHeight.value = height
|
||||
|
||||
// 如果有传入 datePicker 的值
|
||||
if (datePickerValue) {
|
||||
// 更新表格参数
|
||||
tableStore.table.params.searchBeginTime = datePickerValue.timeValue?.[0]
|
||||
tableStore.table.params.searchEndTime = datePickerValue.timeValue?.[1]
|
||||
}
|
||||
}
|
||||
const tableStore: any = new TableStore({
|
||||
url: '/user-boot/role/selectRoleDetail?id=0',
|
||||
@@ -248,9 +260,22 @@ const tableStore: any = new TableStore({
|
||||
showPage: false,
|
||||
exportName: '主要监测点列表',
|
||||
column: [],
|
||||
beforeSearchFun: () => {
|
||||
tableStore.table.params.searchBeginTime = prop.timeValue?.[0] || getTimeOfTheMonth(prop.timeKey)[0]
|
||||
tableStore.table.params.searchEndTime = prop.timeValue?.[1] || getTimeOfTheMonth(prop.timeKey)[1]
|
||||
beforeSearchFun: () => {
|
||||
// 尝试从缓存获取时间值
|
||||
let beginTime, endTime
|
||||
|
||||
if (fullscreen.value) {
|
||||
const cached = timeCacheStore.getCache(route.path)
|
||||
if (cached && cached.timeValue) {
|
||||
beginTime = cached.timeValue[0]
|
||||
endTime = cached.timeValue[1]
|
||||
}
|
||||
}
|
||||
|
||||
// 如果缓存中没有则使用默认值
|
||||
tableStore.table.params.searchBeginTime = beginTime || prop.timeValue?.[0] || getTimeOfTheMonth(prop.timeKey)[0]
|
||||
|
||||
tableStore.table.params.searchEndTime = endTime || prop.timeValue?.[1] || getTimeOfTheMonth(prop.timeKey)[1]
|
||||
},
|
||||
loadCallback: () => {
|
||||
tableStore.table.height = `calc(${prop.height} - 80px)`
|
||||
|
||||
@@ -1,13 +1,26 @@
|
||||
<template>
|
||||
<div style="width: 540px">
|
||||
<el-select v-model.trim="interval" style="min-width: 90px; width: 90px; margin-right: 10px"
|
||||
@change="timeChange">
|
||||
<el-select
|
||||
v-model.trim="interval"
|
||||
style="min-width: 90px; width: 90px; margin-right: 10px"
|
||||
@change="timeChange"
|
||||
>
|
||||
<el-option v-for="item in timeOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
|
||||
<el-date-picker v-model.trim="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.trim="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>
|
||||
@@ -21,13 +34,19 @@ import { ref, onMounted, nextTick, watch } from 'vue'
|
||||
interface Props {
|
||||
nextFlag?: boolean
|
||||
theCurrentTime?: boolean
|
||||
initialInterval?: number
|
||||
initialTimeValue?: any
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
nextFlag: false,
|
||||
theCurrentTime: true
|
||||
theCurrentTime: true,
|
||||
initialInterval: 3,
|
||||
initialTimeValue: undefined
|
||||
})
|
||||
|
||||
const emit = defineEmits(['change'])
|
||||
|
||||
const interval = ref(3)
|
||||
const timeFlag = ref(1)
|
||||
const count = ref(0)
|
||||
@@ -72,8 +91,27 @@ const shortcuts = [
|
||||
}
|
||||
]
|
||||
onMounted(() => {
|
||||
// 使用传入的初始值
|
||||
if (props.initialInterval !== undefined) {
|
||||
interval.value = props.initialInterval
|
||||
}
|
||||
|
||||
if (props.initialTimeValue) {
|
||||
timeValue.value = props.initialTimeValue
|
||||
}
|
||||
timeChange(3)
|
||||
})
|
||||
|
||||
// 添加统一的事件触发方法
|
||||
const emitChange = () => {
|
||||
nextTick(() => {
|
||||
emit('change', {
|
||||
interval: interval.value,
|
||||
timeValue: timeValue.value,
|
||||
timeFlag: timeFlag.value
|
||||
})
|
||||
})
|
||||
}
|
||||
// 选择时间范围
|
||||
const timeChange = (e: number) => {
|
||||
backDisabled.value = false
|
||||
@@ -110,6 +148,8 @@ const timeChange = (e: number) => {
|
||||
} else {
|
||||
timeFlag.value = 1
|
||||
}
|
||||
// 触发 change 事件
|
||||
emitChange()
|
||||
}
|
||||
|
||||
// 当前
|
||||
@@ -178,6 +218,9 @@ const preClick = () => {
|
||||
// 判断向后键的状态
|
||||
// var temp = NowgetEndTime()
|
||||
// timeStatus(temp, endTime)
|
||||
|
||||
// 触发 change 事件
|
||||
emitChange()
|
||||
}
|
||||
//下一个
|
||||
const next = () => {
|
||||
@@ -383,7 +426,6 @@ const next = () => {
|
||||
if (year >= presentY && !props.nextFlag) {
|
||||
startTime = presentY + '-01-01'
|
||||
if (presentM < 10) {
|
||||
|
||||
if (presentD < 10) {
|
||||
endTime = presentY + '-0' + presentM + '-0' + presentD
|
||||
} else {
|
||||
@@ -400,18 +442,31 @@ 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()) {
|
||||
if (
|
||||
new Date(endTime + ' 00:00:00').getTime() >=
|
||||
new Date(window.XEUtils.toDateString(new Date(), 'yyyy-MM-dd ') + ' 00:00:00').getTime()
|
||||
) {
|
||||
preDisabled.value = true
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
timeValue.value = [startTime, endTime]
|
||||
|
||||
// 触发 change 事件
|
||||
emitChange()
|
||||
}
|
||||
|
||||
// 监听值变化并触发事件
|
||||
watch(
|
||||
[interval, timeValue],
|
||||
() => {
|
||||
emitChange()
|
||||
},
|
||||
{ deep: true }
|
||||
)
|
||||
|
||||
const setTime = (flag = 0, e = 0) => {
|
||||
let dd = window.XEUtils.toDateString(new Date().getTime() - e * 3600 * 1000 * 24, 'dd')
|
||||
|
||||
|
||||
@@ -10,7 +10,14 @@
|
||||
:inline="true"
|
||||
>
|
||||
<el-form-item label="日期" v-if="datePicker" style="grid-column: span 2; max-width: 570px">
|
||||
<DatePicker ref="datePickerRef" :nextFlag="nextFlag" :theCurrentTime="theCurrentTime"></DatePicker>
|
||||
<DatePicker
|
||||
ref="datePickerRef"
|
||||
:nextFlag="nextFlag"
|
||||
:theCurrentTime="theCurrentTime"
|
||||
:initialInterval="initialInterval"
|
||||
:initialTimeValue="initialTimeValue"
|
||||
@change="handleDatePickerChange"
|
||||
></DatePicker>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="区域" v-if="area">
|
||||
@@ -57,6 +64,9 @@ import { mainHeight } from '@/utils/layout'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { Search, RefreshLeft } from '@element-plus/icons-vue'
|
||||
import { defineProps } from 'vue'
|
||||
import { useTimeCacheStore } from '@/stores/timeCache'
|
||||
import { useRoute } from 'vue-router'
|
||||
|
||||
const emit = defineEmits(['selectChange'])
|
||||
|
||||
const tableStore = inject('tableStore') as TableStore
|
||||
@@ -67,6 +77,11 @@ const areaRef = ref()
|
||||
const headerForm = ref()
|
||||
const headerFormSecond = ref()
|
||||
const num = ref(0)
|
||||
|
||||
// 获取路由和缓存 store
|
||||
const route = useRoute()
|
||||
const timeCacheStore = useTimeCacheStore()
|
||||
|
||||
interface Props {
|
||||
datePicker?: boolean
|
||||
area?: boolean
|
||||
@@ -75,6 +90,8 @@ interface Props {
|
||||
theCurrentTime?: boolean //控制时间前3天展示上个月时间
|
||||
showReset?: boolean //是否显示重置
|
||||
showExport?: boolean //导出控制
|
||||
initialInterval?: 3
|
||||
initialTimeValue?: undefined
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
@@ -84,8 +101,23 @@ const props = withDefaults(defineProps<Props>(), {
|
||||
nextFlag: false,
|
||||
theCurrentTime: true,
|
||||
showReset: true,
|
||||
showExport: false
|
||||
showExport: false,
|
||||
initialInterval: 3,
|
||||
initialTimeValue: undefined
|
||||
})
|
||||
|
||||
// 处理 DatePicker 值变化事件
|
||||
const handleDatePickerChange = (value: any) => {
|
||||
|
||||
// 将值缓存到 timeCache
|
||||
if (value) {
|
||||
timeCacheStore.setCache(route.path, value.interval, value.timeValue)
|
||||
}
|
||||
|
||||
// 将 datePicker 的变化传递给父组件
|
||||
emit('selectChange', true, tableHeader.value.offsetHeight, value)
|
||||
}
|
||||
|
||||
// 动态计算table高度
|
||||
let resizeObserver = new ResizeObserver(entries => {
|
||||
for (const entry of entries) {
|
||||
@@ -105,16 +137,40 @@ const headerFormSecondStyleClose = {
|
||||
padding: '0'
|
||||
}
|
||||
onMounted(() => {
|
||||
if (props.datePicker && tableStore) {
|
||||
tableStore.table.params.searchBeginTime = datePickerRef.value?.timeValue[0]
|
||||
tableStore.table.params.searchEndTime = datePickerRef.value?.timeValue[1]
|
||||
tableStore.table.params.startTime = datePickerRef.value?.timeValue[0]
|
||||
tableStore.table.params.endTime = datePickerRef.value?.timeValue[1]
|
||||
// 设置初始值到 DatePicker
|
||||
if (props.datePicker && datePickerRef.value) {
|
||||
// 如果有传入的初始值,则设置到 DatePicker
|
||||
if (props.initialInterval !== undefined) {
|
||||
datePickerRef.value.setInterval(props.initialInterval)
|
||||
}
|
||||
|
||||
if (props.initialTimeValue) {
|
||||
datePickerRef.value.timeValue = props.initialTimeValue
|
||||
}
|
||||
|
||||
// 从缓存中获取值并设置
|
||||
const cached = timeCacheStore.getCache(route.path)
|
||||
if (cached) {
|
||||
if (cached.interval !== undefined) {
|
||||
datePickerRef.value.setInterval(cached.interval)
|
||||
}
|
||||
if (cached.timeValue) {
|
||||
datePickerRef.value.timeValue = cached.timeValue
|
||||
}
|
||||
}
|
||||
|
||||
// 更新 tableStore 参数
|
||||
tableStore.table.params.searchBeginTime = datePickerRef.value?.timeValue?.[0]
|
||||
tableStore.table.params.searchEndTime = datePickerRef.value?.timeValue?.[1]
|
||||
tableStore.table.params.startTime = datePickerRef.value?.timeValue?.[0]
|
||||
tableStore.table.params.endTime = datePickerRef.value?.timeValue?.[1]
|
||||
tableStore.table.params.timeFlag = datePickerRef.value?.timeFlag
|
||||
}
|
||||
|
||||
if (props.area) {
|
||||
tableStore.table.params.deptIndex = dictData.state.area[0].id
|
||||
}
|
||||
|
||||
nextTick(() => {
|
||||
resizeObserver.observe(tableHeader.value)
|
||||
computedSearchRow()
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
style='cursor: pointer' v-if='props.canExpand' /> -->
|
||||
</div>
|
||||
<el-tree :style="{ height: 'calc(100vh - 200px)' }"
|
||||
style=' overflow: auto;' ref='treeRef' :props='defaultProps' highlight-current
|
||||
style=' overflow: auto;' ref='treeRef' :props='defaultProps' highlight-current :default-expand-all="false"
|
||||
@check-change="checkTreeNodeChange" :filter-node-method='filterNode' node-key='id' v-bind='$attrs'>
|
||||
<template #default='{ node, data }'>
|
||||
<span class='custom-tree-node'>
|
||||
@@ -75,7 +75,6 @@ const filterNode = (value: string, data: any, node: any) => {
|
||||
|
||||
// 过滤父节点 / 子节点 (如果输入的参数是父节点且能匹配,则返回该节点以及其下的所有子节点;如果参数是子节点,则返回该节点的父节点。name是中文字符,enName是英文字符.
|
||||
const chooseNode = (value: string, data: any, node: any) => {
|
||||
|
||||
if (data.name.indexOf(value) !== -1) {
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
</div>
|
||||
|
||||
<el-tree :style="{ height: 'calc(100vh - 200px)' }"
|
||||
style=' overflow: auto;' ref='treeRef' :props='defaultProps' highlight-current
|
||||
style=' overflow: auto;' ref='treeRef' :props='defaultProps' highlight-current :default-expand-all="false"
|
||||
@check-change="checkTreeNodeChange" :filter-node-method='filterNode' node-key='id' v-bind='$attrs'>
|
||||
<template #default='{ node, data }'>
|
||||
<span class='custom-tree-node'>
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
@node-click="handleNodeClick"
|
||||
:default-checked-keys="defaultCheckedKeys"
|
||||
v-bind='$attrs'
|
||||
:default-expand-all="false"
|
||||
>
|
||||
<template #default='{ node, data }'>
|
||||
<span class='custom-tree-node'>
|
||||
@@ -119,8 +120,69 @@ const handleNodeClick = (data: any, node: any, event: any) => {
|
||||
// 存储所有勾选的节点
|
||||
const checkedNodes = ref<any[]>([])
|
||||
const defaultCheckedKeys = ref<string[]>([])
|
||||
|
||||
// 处理节点勾选变化
|
||||
const handleCheckChange = (data: any, checkInfo: any) => {
|
||||
const { checkedNodes: nodes } = checkInfo
|
||||
// 过滤出监测点层级(level=3)的节点
|
||||
const monitoringPointNodes = nodes.filter((node: any) => {
|
||||
return node.level === 3
|
||||
})
|
||||
|
||||
|
||||
// 限制最多只能勾选5个监测点
|
||||
if (monitoringPointNodes.length > 5) {
|
||||
// 获取之前选中的节点
|
||||
const previousCheckedNodes = checkedNodes.value || []
|
||||
|
||||
// 计算新增的节点
|
||||
const newNodes = monitoringPointNodes.filter(
|
||||
(node: any) => !previousCheckedNodes.some((prev: any) => prev.id === node.id)
|
||||
)
|
||||
|
||||
// 如果是从父级勾选导致超过限制,保留前几个直到达到限制数量
|
||||
if (newNodes.length > 0) {
|
||||
const allowedNewCount = 5 - previousCheckedNodes.length
|
||||
if (allowedNewCount > 0) {
|
||||
// 允许添加allowedNewCount个新节点
|
||||
const allowedNewNodes = newNodes.slice(0, allowedNewCount)
|
||||
const finalNodes = [...previousCheckedNodes, ...allowedNewNodes]
|
||||
|
||||
checkedNodes.value = finalNodes
|
||||
|
||||
// 设置树的勾选状态为正确的节点
|
||||
treeRef.value?.setCheckedNodes(finalNodes)
|
||||
|
||||
// 将勾选的监测点节点暴露出去
|
||||
emit('checkedNodesChange', finalNodes)
|
||||
|
||||
// 更新节点的可勾选状态
|
||||
updateNodeCheckStatus(finalNodes.length)
|
||||
|
||||
// 只有在真正超过5个时才提示警告
|
||||
if (monitoringPointNodes.length > 5) {
|
||||
ElMessage.warning('最多只能选择5个监测点')
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// 其他情况回滚到之前的状态
|
||||
ElMessage.warning('最多只能选择5个监测点')
|
||||
treeRef.value?.setCheckedNodes(checkedNodes.value)
|
||||
return
|
||||
}
|
||||
|
||||
checkedNodes.value = monitoringPointNodes
|
||||
|
||||
// 将勾选的监测点节点暴露出去
|
||||
emit('checkedNodesChange', monitoringPointNodes)
|
||||
|
||||
// 更新节点的可勾选状态
|
||||
updateNodeCheckStatus(monitoringPointNodes.length)
|
||||
}
|
||||
// 处理节点勾选变化
|
||||
const handleCheckChange2 = (data: any, checkInfo: any) => {
|
||||
const { checkedNodes: nodes } = checkInfo
|
||||
// 过滤出监测点层级(level=3)的节点
|
||||
const monitoringPointNodes = nodes.filter((node: any) => {
|
||||
|
||||
34
src/stores/timeCache.ts
Normal file
34
src/stores/timeCache.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
// src/stores/timeCache.ts
|
||||
import { defineStore } from 'pinia'
|
||||
import { RouteLocationNormalizedLoaded } from 'vue-router'
|
||||
|
||||
// 时间组件的缓存值 用于驾驶舱放大的时候和内部的时间组件同步
|
||||
interface TimeCacheState {
|
||||
cache: Map<string, {
|
||||
interval: number | undefined // 时间组件的月份、年份、时间、时间格式的缓存值
|
||||
timeValue: any // 时间组件的值
|
||||
}>
|
||||
}
|
||||
|
||||
export const useTimeCacheStore = defineStore('timeCache', {
|
||||
state: (): TimeCacheState => ({
|
||||
cache: new Map()
|
||||
}),
|
||||
|
||||
actions: {
|
||||
setCache(routePath: string, interval: number | undefined, timeValue: any) {
|
||||
this.cache.set(routePath, {
|
||||
interval,
|
||||
timeValue
|
||||
})
|
||||
},
|
||||
|
||||
getCache(routePath: string) {
|
||||
return this.cache.get(routePath)
|
||||
},
|
||||
|
||||
hasCache(routePath: string) {
|
||||
return this.cache.has(routePath)
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -1,3 +1,5 @@
|
||||
import { number } from "vue-types"
|
||||
|
||||
const dataProcessing = (arr: any[]) => {
|
||||
return arr
|
||||
.filter(item => typeof item === 'number' || (typeof item === 'string' && !isNaN(parseFloat(item))))
|
||||
@@ -12,6 +14,7 @@ const calculateValue = (o: number, value: number, num: number, isMin: boolean) =
|
||||
} else if (value > -1 && value < 0 && isMin == false) {
|
||||
return 0
|
||||
}
|
||||
|
||||
let base
|
||||
if (Math.abs(o) >= 100) {
|
||||
base = 100
|
||||
@@ -20,7 +23,9 @@ const calculateValue = (o: number, value: number, num: number, isMin: boolean) =
|
||||
} else if (Math.abs(o) >= 1) {
|
||||
base = 1
|
||||
} else {
|
||||
base = 0.1
|
||||
const multiple = 1 / 0.1
|
||||
// 先放大→向上取整→再缩小
|
||||
return Math.ceil(Math.abs(o) * multiple) / multiple
|
||||
}
|
||||
let calculatedValue
|
||||
if (isMin) {
|
||||
@@ -34,8 +39,10 @@ const calculateValue = (o: number, value: number, num: number, isMin: boolean) =
|
||||
calculatedValue = value - num * value
|
||||
} else {
|
||||
calculatedValue = value + num * value
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (base === 0.1) {
|
||||
return parseFloat(calculatedValue.toFixed(1))
|
||||
} else if (isMin) {
|
||||
@@ -57,6 +64,7 @@ export const yMethod = (arr: any) => {
|
||||
minValue = Math.min(...numList)
|
||||
const o = maxValue - minValue
|
||||
min = calculateValue(o, minValue, num, true)
|
||||
|
||||
max = calculateValue(o, maxValue, num, false)
|
||||
// if (-100 >= minValue) {
|
||||
// min = Math.floor((minValue + num * minValue) / 100) * 100
|
||||
|
||||
@@ -313,6 +313,7 @@ const sourceChange = (e: any) => {
|
||||
tableStore.table.params.engineeringid = e[1] || ''
|
||||
tableStore.table.params.projectId = e[2] || ''
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// tableStore.table.params.engineeringid = e[1] || ''
|
||||
|
||||
@@ -1068,7 +1068,7 @@ const add = () => {
|
||||
nodeId: '',
|
||||
cntractNo: '',
|
||||
sort: 0,
|
||||
nodeProcess: '自动分配',
|
||||
nodeProcess: '',
|
||||
})
|
||||
busBarIndex.value = (deviceInfoList.value.length - 1).toString()
|
||||
// 清理监测点数据
|
||||
@@ -1325,7 +1325,7 @@ const remove = () => {
|
||||
message: res.message
|
||||
})
|
||||
reaseStatus()
|
||||
console.log('engineeringId',engineeringId)
|
||||
|
||||
if (engineeringId) {
|
||||
setTimeout(() => {
|
||||
treedata(engineeringId)
|
||||
@@ -1359,7 +1359,7 @@ const remove = () => {
|
||||
case 4: // 监测点层级
|
||||
|
||||
const deviceId = nodeData.value.pids ? nodeData.value.pids.split(',')[3] : null
|
||||
console.log(deviceId)
|
||||
|
||||
deleteLine(nodeData.value.id).then((res: any) => {
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
@@ -1421,7 +1421,7 @@ const next = async () => {
|
||||
nodeId: '',
|
||||
cntractNo: '',
|
||||
sort: 0,
|
||||
nodeProcess: '自动分配',
|
||||
nodeProcess: '',
|
||||
})
|
||||
busBarIndex.value = (deviceInfoList.value.length - 1).toString()
|
||||
nextfalg.value = false
|
||||
@@ -1536,9 +1536,8 @@ const submitAllLevelData = () => {
|
||||
|
||||
// 项目信息
|
||||
const projectData = tempAllLevelData.value.projects.length > 0
|
||||
? tempAllLevelData.value.projects[0]
|
||||
? tempAllLevelData.value.projects.find(project => project !== undefined) || {}
|
||||
: (projectInfoList.value[0] || {})
|
||||
|
||||
// 如果是从根节点开始新增工程和项目
|
||||
if (nodeData.value.level === 0) {
|
||||
submitData = {
|
||||
@@ -1557,10 +1556,9 @@ const submitAllLevelData = () => {
|
||||
case 2: // 工程 + 项目 + 设备
|
||||
// 工程信息
|
||||
const engineeringData2 = tempAllLevelData.value.engineering || { ...engineeringParam.value }
|
||||
|
||||
// 项目信息
|
||||
const projectData2 = tempAllLevelData.value.projects.length > 0
|
||||
? tempAllLevelData.value.projects[0]
|
||||
? tempAllLevelData.value.projects.find(project => project !== undefined) || {}
|
||||
: (projectInfoList.value[0] || {})
|
||||
|
||||
// 设备信息
|
||||
@@ -1615,8 +1613,8 @@ const submitAllLevelData = () => {
|
||||
const engineeringData3 = tempAllLevelData.value.engineering || { ...engineeringParam.value }
|
||||
|
||||
// 项目信息
|
||||
const projectData3 = tempAllLevelData.value.projects.length > 0
|
||||
? tempAllLevelData.value.projects[0]
|
||||
const projectData3 = tempAllLevelData.value.projects.length > 0
|
||||
? tempAllLevelData.value.projects.find(project => project !== undefined) || {}
|
||||
: (projectInfoList.value[0] || {})
|
||||
|
||||
// 设备信息
|
||||
@@ -1771,9 +1769,8 @@ const submitAllLevelData = () => {
|
||||
pageStatus.value = 1
|
||||
// 清空所有表单
|
||||
resetAllForms()
|
||||
|
||||
// 刷新树并选中合适的节点
|
||||
TerminalRef.value.info().then(() => {
|
||||
TerminalRef.value.info()
|
||||
// 等待树更新完成后,根据之前点击的节点层级选中合适的节点
|
||||
setTimeout(() => {
|
||||
let nodeIdToSelect: string|null|undefined = null;
|
||||
@@ -1808,7 +1805,7 @@ const submitAllLevelData = () => {
|
||||
treedata(); // 选中根节点
|
||||
}
|
||||
}, 100);
|
||||
})
|
||||
|
||||
})
|
||||
}
|
||||
/**
|
||||
@@ -2120,7 +2117,7 @@ const handleBusBarTabsEdit = (targetName: any, action: any) => {
|
||||
nodeId: '',
|
||||
cntractNo: '',
|
||||
sort: 0,
|
||||
nodeProcess: '自动分配',
|
||||
nodeProcess: '',
|
||||
})
|
||||
busBarIndex.value = (deviceInfoList.value.length - 1).toString()
|
||||
} else if (action === 'remove') {
|
||||
@@ -2240,6 +2237,7 @@ const tabChange = (type: string) => {
|
||||
}
|
||||
|
||||
const treedata = (selectedNodeId?: string) => {
|
||||
|
||||
if (selectedNodeId) {
|
||||
TerminalRef.value.info(selectedNodeId);
|
||||
} else {
|
||||
@@ -2296,10 +2294,15 @@ const area = () => {
|
||||
|
||||
onMounted(() => {
|
||||
nodeData.value.level = 0
|
||||
const dom = document.getElementById('navigation-splitpanes')
|
||||
if (dom) {
|
||||
size.value = Math.round((180 / dom.offsetHeight) * 100)
|
||||
}
|
||||
nextTick(() => {
|
||||
const dom = document.getElementById('navigation-splitpanes')
|
||||
if (dom && dom.offsetHeight > 0) {
|
||||
size.value = Math.round((180 / dom.offsetHeight) * 100)
|
||||
} else {
|
||||
// 设置默认值
|
||||
size.value = 20
|
||||
}
|
||||
})
|
||||
})
|
||||
area()
|
||||
</script>
|
||||
|
||||
@@ -99,11 +99,15 @@ tableStore.table.params.resourceType = 1
|
||||
tableStore.table.params.customType = 1
|
||||
const flag = ref(true)
|
||||
onMounted(() => {
|
||||
const dom = document.getElementById('navigation-splitpanes')
|
||||
if (dom) {
|
||||
|
||||
size.value = ((280 / (dom.offsetWidth - 7)) * 100)
|
||||
}
|
||||
nextTick(() => {
|
||||
const dom = document.getElementById('navigation-splitpanes')
|
||||
if (dom && dom.offsetHeight > 0) {
|
||||
size.value = ((280 / (dom.offsetWidth - 7)) * 100)
|
||||
} else {
|
||||
// 设置默认值
|
||||
size.value = 20
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
// getTemplateByDept({ id: dictData.state.area[0].id }).then((res: any) => {
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
</template>
|
||||
<template v-slot:operation>
|
||||
<el-button type="primary" class="ml10" @click="add" icon="el-icon-Plus">新增</el-button>
|
||||
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table
|
||||
@@ -81,17 +82,7 @@
|
||||
</el-tooltip>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-popconfirm
|
||||
class="box-item"
|
||||
title="确定重启吗?"
|
||||
placement="bottom"
|
||||
@confirm="restart(data)"
|
||||
>
|
||||
<template #actions="{ confirm, cancel }">
|
||||
<el-button size="small" @click="cancel">取消</el-button>
|
||||
<el-button type="warning" size="small" @click="confirm">确认</el-button>
|
||||
</template>
|
||||
|
||||
<el-popconfirm title="确定重启吗?" placement="bottom" @confirm="restart(data)">
|
||||
<template #reference>
|
||||
<el-tooltip content="重启" placement="top">
|
||||
<el-button
|
||||
@@ -99,10 +90,13 @@
|
||||
icon="el-icon-Refresh"
|
||||
type="warning"
|
||||
link
|
||||
@click.stop
|
||||
></el-button>
|
||||
/>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
<template #actions="{ confirm, cancel }">
|
||||
<el-button size="small" @click="cancel">取消</el-button>
|
||||
<el-button type="warning" size="small" @click="confirm">确认</el-button>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
</div>
|
||||
@@ -433,6 +427,7 @@ const currentChangeEvent = () => {
|
||||
|
||||
// 重启进程
|
||||
const restart = (data: any) => {
|
||||
|
||||
restartProcess({
|
||||
nodeId: nodeId.value,
|
||||
processNo: data.processNo
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<template>
|
||||
<div class="default-main">
|
||||
<TableHeader :showSearch="false" v-if="flag">
|
||||
<TableHeader :showSearch="false" v-show="flag">
|
||||
<template v-slot:select>
|
||||
<el-form-item label="日期">
|
||||
<DatePicker ref="datePickerRef" :nextFlag="false" :theCurrentTime="true"></DatePicker>
|
||||
<DatePicker ref="datePickerRef" :nextFlag="false" :theCurrentTime="true" @change="handleDatePickerChange"></DatePicker>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template v-slot:operation>
|
||||
@@ -42,6 +42,7 @@
|
||||
:height="rowHeight * item.h - seRowHeight(item.h) + 'px'"
|
||||
:width="rowWidth * item.w - 30 + 'px'"
|
||||
:timeKey="(item as LayoutItem).timeKey"
|
||||
:interval="datePickerRef?.interval"
|
||||
:w="item.w"
|
||||
:h="item.h"
|
||||
/>
|
||||
@@ -63,10 +64,13 @@ import DatePicker from '@/components/form/datePicker/index.vue'
|
||||
import { useDebounceFn } from '@vueuse/core'
|
||||
import { queryActivatePage, queryByPagePath } from '@/api/system-boot/csstatisticalset'
|
||||
import RoutingConfig from '@/views/pqs/cockpit/homePage/components/routingConfig.vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { useRouter,useRoute } from 'vue-router'
|
||||
import { useTimeCacheStore } from '@/stores/timeCache'
|
||||
const { push } = useRouter()
|
||||
const datePickerRef = ref()
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
const timeCacheStore = useTimeCacheStore()
|
||||
|
||||
defineOptions({
|
||||
// name: 'dashboard/index'
|
||||
@@ -225,6 +229,20 @@ const editd = (e: any) => {
|
||||
const settings = () => {
|
||||
RoutingConfigRef.value.open()
|
||||
}
|
||||
|
||||
// 处理 DatePicker 值变化事件
|
||||
const handleDatePickerChange = (value: any) => {
|
||||
|
||||
// 将值缓存到 timeCache
|
||||
if (value) {
|
||||
timeCacheStore.setCache(
|
||||
route.path,
|
||||
value.interval,
|
||||
value.timeValue
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// 生命周期钩子
|
||||
onMounted(() => {
|
||||
// initRowHeight()
|
||||
|
||||
Reference in New Issue
Block a user