暂态电能质量分析添加时间组件
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<!--F47曲线 -->
|
<!--F47曲线 -->
|
||||||
|
<TableHeader :showReset="false" @selectChange="selectChange" datePicker v-if="fullscreen"></TableHeader>
|
||||||
<el-descriptions class="mt2" direction="vertical" :column="4" border>
|
<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.name }}</el-descriptions-item>
|
||||||
<el-descriptions-item align="center" label="事件总数">{{ data.gs }}</el-descriptions-item>
|
<el-descriptions-item align="center" label="事件总数">{{ data.gs }}</el-descriptions-item>
|
||||||
@@ -11,7 +12,7 @@
|
|||||||
ref="chartRef"
|
ref="chartRef"
|
||||||
class="tall"
|
class="tall"
|
||||||
:options="echartList"
|
: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"
|
@chart-click="handleChartClick"
|
||||||
/>
|
/>
|
||||||
<el-dialog v-model="isWaveCharts" draggable title="瞬时/RMS波形" append-to-body width="70%">
|
<el-dialog v-model="isWaveCharts" draggable title="瞬时/RMS波形" append-to-body width="70%">
|
||||||
@@ -23,19 +24,51 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted, provide, reactive, watch, h } from 'vue'
|
import { ref, onMounted, provide, reactive, watch, h } from 'vue'
|
||||||
import TableStore from '@/utils/tableStore'
|
import TableStore from '@/utils/tableStore'
|
||||||
import Table from '@/components/table/index.vue'
|
|
||||||
import MyEchart from '@/components/echarts/MyEchart.vue'
|
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||||
import { useDictData } from '@/stores/dictData'
|
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
import { getTimeOfTheMonth } from '@/utils/formatTime'
|
import { getTimeOfTheMonth } from '@/utils/formatTime'
|
||||||
import waveFormAnalysis from '@/views/govern/device/control/tabs/components/waveFormAnalysis.vue';
|
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({
|
const prop = defineProps({
|
||||||
|
w: { type: String },
|
||||||
|
h: { type: String },
|
||||||
width: { type: String },
|
width: { type: String },
|
||||||
height: { type: String },
|
height: { type: String },
|
||||||
timeKey: { type: String },
|
timeKey: { type: String },
|
||||||
timeValue: { type: Object }
|
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 echartList = ref({})
|
||||||
|
|
||||||
const chartRef = ref()
|
const chartRef = ref()
|
||||||
@@ -61,8 +94,21 @@ const tableStore: any = new TableStore({
|
|||||||
|
|
||||||
column: [],
|
column: [],
|
||||||
beforeSearchFun: () => {
|
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: () => {
|
loadCallback: () => {
|
||||||
let res = {
|
let res = {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<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} )` }" />
|
<my-echart class="tall" :options="echartList" :style="{ width: prop.width, height: `calc(${prop.height} )` }" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -12,12 +13,47 @@ import MyEchart from '@/components/echarts/MyEchart.vue'
|
|||||||
import { useDictData } from '@/stores/dictData'
|
import { useDictData } from '@/stores/dictData'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
import { getTimeOfTheMonth } from '@/utils/formatTime'
|
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({
|
const prop = defineProps({
|
||||||
|
w: { type: String },
|
||||||
|
h: { type: String },
|
||||||
width: { type: String },
|
width: { type: String },
|
||||||
height: { type: String },
|
height: { type: String },
|
||||||
timeKey: { type: String },
|
timeKey: { type: String },
|
||||||
timeValue: { type: Object }
|
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 = [
|
const data = [
|
||||||
{
|
{
|
||||||
name: '来自电网',
|
name: '来自电网',
|
||||||
@@ -93,8 +129,21 @@ const tableStore: any = new TableStore({
|
|||||||
|
|
||||||
column: [],
|
column: [],
|
||||||
beforeSearchFun: () => {
|
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: () => {}
|
loadCallback: () => {}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -39,10 +39,7 @@ import { ref, onMounted, provide, reactive, watch, h, computed } from 'vue'
|
|||||||
import TableStore from '@/utils/tableStore'
|
import TableStore from '@/utils/tableStore'
|
||||||
import { exportExcel } from '@/views/govern/reportForms/export.js'
|
import { exportExcel } from '@/views/govern/reportForms/export.js'
|
||||||
import TableHeader from '@/components/table/header/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 { getTimeOfTheMonth } from '@/utils/formatTime'
|
||||||
import MyEchart from '@/components/echarts/MyEchart.vue'
|
|
||||||
import { useConfig } from '@/stores/config'
|
import { useConfig } from '@/stores/config'
|
||||||
import Json from './index.json'
|
import Json from './index.json'
|
||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
|
|||||||
@@ -1,25 +1,57 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<!--敏感负荷列表 -->
|
<!--敏感负荷列表 -->
|
||||||
|
<TableHeader :showReset="false" @selectChange="selectChange" datePicker v-if="fullscreen"></TableHeader>
|
||||||
<Table ref="tableRef" @cell-click="cellClickEvent" :height="`calc(${prop.height})`" isGroup></Table>
|
<Table ref="tableRef" @cell-click="cellClickEvent" :height="`calc(${prop.height} - ${headerHeight}px + ${fullscreen ? 0 : 56}px )`" isGroup></Table>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted, provide, reactive, watch, h } from 'vue'
|
import { ref, onMounted, provide, reactive, watch, h } from 'vue'
|
||||||
import TableStore from '@/utils/tableStore'
|
import TableStore from '@/utils/tableStore'
|
||||||
import Table from '@/components/table/index.vue'
|
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 { 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({
|
const prop = defineProps({
|
||||||
|
w: { type: String },
|
||||||
|
h: { type: String },
|
||||||
width: { type: String },
|
width: { type: String },
|
||||||
height: { type: String },
|
height: { type: String },
|
||||||
timeKey: { type: String },
|
timeKey: { type: String },
|
||||||
timeValue: { type: Object }
|
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 OverLimitDetailsRef = ref()
|
||||||
const tableStore: any = new TableStore({
|
const tableStore: any = new TableStore({
|
||||||
url: '/user-boot/dept/deptTree',
|
url: '/user-boot/dept/deptTree',
|
||||||
@@ -59,8 +91,21 @@ const tableStore: any = new TableStore({
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
beforeSearchFun: () => {
|
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: () => {
|
loadCallback: () => {
|
||||||
tableStore.table.data = [
|
tableStore.table.data = [
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<!--暂态事件明细 -->
|
<!--暂态事件明细 -->
|
||||||
|
<TableHeader :showReset="false" @selectChange="selectChange" datePicker v-if="fullscreen"></TableHeader>
|
||||||
<el-calendar v-model="value" :style="{ height: prop.height, overflow: 'auto' }">
|
<el-calendar v-model="value" :style="{ height: `calc(${prop.height} - ${headerHeight}px + ${fullscreen ? 0 : 56}px )`, overflow: 'auto' }">
|
||||||
<template #date-cell="{ data }">
|
<template #date-cell="{ data }">
|
||||||
<div style="height: 100%; padding: 8px" :style="{ background: setBackground(data.day) }">
|
<div style="height: 100%; padding: 8px" :style="{ background: setBackground(data.day) }">
|
||||||
<p :class="data.isSelected ? 'is-selected' : ''">
|
<p :class="data.isSelected ? 'is-selected' : ''">
|
||||||
@@ -42,23 +42,53 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted, provide, reactive, watch, h } from 'vue'
|
import { ref, onMounted, provide, reactive, watch, h } from 'vue'
|
||||||
import TableStore from '@/utils/tableStore'
|
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 { getTimeOfTheMonth } from '@/utils/formatTime'
|
||||||
import { overflow } from 'html2canvas/dist/types/css/property-descriptors/overflow'
|
|
||||||
import { dayjs } from 'element-plus'
|
import { dayjs } from 'element-plus'
|
||||||
import TransientList from './components/transientList.vue'
|
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({
|
const prop = defineProps({
|
||||||
|
w: { type: String },
|
||||||
|
h: { type: String },
|
||||||
width: { type: String },
|
width: { type: String },
|
||||||
height: { type: String },
|
height: { type: String },
|
||||||
timeKey: { type: String },
|
timeKey: { type: String },
|
||||||
timeValue: { type: Object }
|
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 transientListRef = ref()
|
||||||
const list = ref([
|
const list = ref([
|
||||||
{
|
{
|
||||||
@@ -113,9 +143,21 @@ const tableStore: any = new TableStore({
|
|||||||
|
|
||||||
column: [],
|
column: [],
|
||||||
beforeSearchFun: () => {
|
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
|
||||||
// value.value = new Date(prop.timeValue?.[0])
|
|
||||||
|
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: () => {
|
loadCallback: () => {
|
||||||
tableStore.table.data = []
|
tableStore.table.data = []
|
||||||
|
|||||||
@@ -1,34 +1,68 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<!--暂态事件概率分布 -->
|
<!--暂态事件概率分布 -->
|
||||||
|
<TableHeader :showReset="false" @selectChange="selectChange" datePicker v-if="fullscreen"></TableHeader>
|
||||||
<my-echart
|
<my-echart
|
||||||
class="tall"
|
class="tall"
|
||||||
:options="echartList"
|
: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
|
<my-echart
|
||||||
class="mt10"
|
class="mt10"
|
||||||
:options="echartList1"
|
: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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<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 TableStore from '@/utils/tableStore'
|
||||||
import Table from '@/components/table/index.vue'
|
|
||||||
import MyEchart from '@/components/echarts/MyEchart.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 { getTimeOfTheMonth } from '@/utils/formatTime'
|
||||||
import { useConfig } from '@/stores/config'
|
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({
|
const prop = defineProps({
|
||||||
|
w: { type: String },
|
||||||
|
h: { type: String },
|
||||||
width: { type: String },
|
width: { type: String },
|
||||||
height: { type: String },
|
height: { type: String },
|
||||||
timeKey: { type: String },
|
timeKey: { type: String },
|
||||||
timeValue: { type: Object }
|
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({
|
const echartList = ref({
|
||||||
options: {
|
options: {
|
||||||
xAxis: null,
|
xAxis: null,
|
||||||
@@ -308,8 +342,21 @@ const tableStore: any = new TableStore({
|
|||||||
showPage: false,
|
showPage: false,
|
||||||
column: [],
|
column: [],
|
||||||
beforeSearchFun: () => {
|
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: () => {
|
loadCallback: () => {
|
||||||
tableStore.table.data = []
|
tableStore.table.data = []
|
||||||
|
|||||||
@@ -1,12 +1,21 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<!--暂态事件统计 -->
|
<!--暂态事件统计 -->
|
||||||
|
<TableHeader :showReset="false" @selectChange="selectChange" datePicker v-if="fullscreen"></TableHeader>
|
||||||
<my-echart
|
<my-echart
|
||||||
class="tall"
|
class="tall"
|
||||||
:options="echartList"
|
: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>
|
<TransientStatisticsDetail ref="transientStatisticsDetailRef"></TransientStatisticsDetail>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -15,18 +24,51 @@ import { ref, onMounted, provide, reactive, watch, h } from 'vue'
|
|||||||
import TableStore from '@/utils/tableStore'
|
import TableStore from '@/utils/tableStore'
|
||||||
import Table from '@/components/table/index.vue'
|
import Table from '@/components/table/index.vue'
|
||||||
import MyEchart from '@/components/echarts/MyEchart.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 { getTimeOfTheMonth } from '@/utils/formatTime'
|
||||||
import { useConfig } from '@/stores/config'
|
import { useConfig } from '@/stores/config'
|
||||||
import TransientStatisticsDetail from './components/transientStatisticsDetail.vue'
|
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({
|
const prop = defineProps({
|
||||||
|
w: { type: String },
|
||||||
|
h: { type: String },
|
||||||
width: { type: String },
|
width: { type: String },
|
||||||
height: { type: String },
|
height: { type: String },
|
||||||
timeKey: { type: String },
|
timeKey: { type: String },
|
||||||
timeValue: { type: Object }
|
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 = [
|
const data = [
|
||||||
{
|
{
|
||||||
name: '电压中断',
|
name: '电压中断',
|
||||||
@@ -148,8 +190,20 @@ const tableStore: any = new TableStore({
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
beforeSearchFun: () => {
|
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: () => {
|
loadCallback: () => {
|
||||||
tableStore.table.data = [
|
tableStore.table.data = [
|
||||||
|
|||||||
Reference in New Issue
Block a user