全局添加导出表格配置

This commit is contained in:
GGJ
2024-12-27 08:47:47 +08:00
parent 1f94ac5267
commit 0994a52699
28 changed files with 3264 additions and 200 deletions

View File

@@ -38,7 +38,7 @@
<el-button type="primary" @click="init" icon="el-icon-Search">查询</el-button>
</el-form-item>
</el-form>
<div style="flex: 1; overflow-y: scroll" class="mt10" v-loading="loading">
<div style="flex: 1; overflow-y: scroll" class="mt10">
<my-echart :options="item.option" v-for="item in list" :style="height" />
</div>
</div>
@@ -52,7 +52,6 @@ import { useMonitoringPoint } from '@/stores/monitoringPoint'
import { indexOptions, harmonicOptions, inharmonicOptions } from '@/utils/dictionary'
import { getHistoryResult } from '@/api/harmonic-boot/harmonic'
import { mainHeight } from '@/utils/layout'
import { yMethod } from '@/utils/echartMethod'
const datePickerRef = ref()
const monitoringPoint = useMonitoringPoint()
const checked = ref(monitoringPoint.state.showCheckBox)
@@ -76,7 +75,6 @@ const formData = reactive<{
inHarmonic: 1,
ptType: 0
})
const height: any = ref(mainHeight(200, 1))
const options = ref({})
const traceability = ref<any>([])
const list = ref<any>([])
@@ -89,9 +87,9 @@ const typeOptions = ref([
{ label: 'cp95值', value: 4 }
])
onMounted(() => {
datePickerRef.value.setTheDate(5)
init()
})
const height: any = ref(mainHeight(200, 1))
const checkChange = () => {
if (checked.value) {
monitoringPoint.setShowCheckBox(true)
@@ -120,15 +118,13 @@ const init = () => {
}
list.value = []
shujuchuli(res)
loading.value = false
}).catch(() => { loading.value = false })
})
}
const shujuchuli = (res: any) => {
let shujuData = res.data
shujuData.forEach((item: any, i: number) => {
let [min, max] = yMethod([ ...(item.value.map(arr => arr.slice(1)).flat()),item.topLimit,,item.lowerLimit])
//判断是否存在暂降点
if (item.eventDetail !== null || item.eventDetail.length === 0) {
//向项别中添加暂降点
let chufa = []
@@ -147,8 +143,8 @@ const shujuchuli = (res: any) => {
let cvalue = []
let topLimit = []
let lowerLimit = []
item.maxValue = max
item.minValue = min
item.maxValue = item.topLimit
item.minValue = item.lowerLimit
//判断数据是否存在
if (item.value !== null) {
for (let j = 0; j < item.value.length; j++) {
@@ -213,8 +209,8 @@ const shujuchuli = (res: any) => {
let gvalue = []
let topLimit = []
let lowerLimit = []
item.maxValue = max
item.minValue = min
item.maxValue = item.topLimit
item.minValue = item.lowerLimit
//判断数据是否存在
if (item.value !== null) {
for (let j = 0; j < item.value.length; j++) {
@@ -287,7 +283,7 @@ const shujuchuli = (res: any) => {
let bvalue = []
let cvalue = []
let topLimit = []
item.maxValue = max
item.maxValue = item.topLimit
//判断数据是否存在
if (item.value !== null) {
for (let j = 0; j < item.value.length; j++) {
@@ -349,7 +345,7 @@ const shujuchuli = (res: any) => {
if (item.phaiscType.length == 3) {
let gvalue = []
let topLimit = []
item.maxValue = max
item.maxValue = item.topLimit
//判断数据是否存在
if (item.value !== null) {
for (let j = 0; j < item.value.length; j++) {
@@ -415,7 +411,7 @@ const shujuchuli = (res: any) => {
let bvalue = []
let cvalue = []
let lowerLimit = []
item.minValue = min
item.minValue = item.lowerLimit
//判断数据是否存在
if (item.value !== null) {
for (let j = 0; j < item.value.length; j++) {
@@ -472,7 +468,7 @@ const shujuchuli = (res: any) => {
if (item.phaiscType.length == 3) {
let gvalue = []
let lowerLimit = []
item.minValue = min
item.minValue = item.lowerLimit
//判断数据是否存在
if (item.value !== null) {
for (let j = 0; j < item.value.length; j++) {
@@ -663,8 +659,8 @@ const shujuchuli = (res: any) => {
let cvalue = []
let topLimit = []
let lowerLimit = []
item.maxValue = max
item.minValue = min
item.maxValue = item.topLimit
item.minValue = item.lowerLimit
//判断数据是否存在
if (item.value !== null) {
for (let j = 0; j < item.value.length; j++) {
@@ -717,8 +713,8 @@ const shujuchuli = (res: any) => {
let gvalue = []
let topLimit = []
let lowerLimit = []
item.maxValue = max
item.minValue = min
item.maxValue = item.topLimit
item.minValue = item.lowerLimit
//判断数据是否存在
if (item.value !== null) {
for (let j = 0; j < item.value.length; j++) {
@@ -780,7 +776,7 @@ const shujuchuli = (res: any) => {
let bvalue = []
let cvalue = []
let topLimit = []
item.maxValue = max
item.maxValue = item.topLimit
// item.minValue=item.lowerLimit
//判断数据是否存在
if (item.value !== null) {
@@ -831,7 +827,7 @@ const shujuchuli = (res: any) => {
if (item.phaiscType.length == 2) {
let gvalue = []
let topLimit = []
item.maxValue = max
item.maxValue = item.topLimit
// item.minValue=item.lowerLimit
//判断数据是否存在
if (item.value !== null) {
@@ -892,7 +888,7 @@ const shujuchuli = (res: any) => {
let cvalue = []
let lowerLimit = []
// item.maxValue=item.topLimit
item.minValue = min
item.minValue = item.lowerLimit
//判断数据是否存在
if (item.value !== null) {
for (let j = 0; j < item.value.length; j++) {
@@ -943,7 +939,7 @@ const shujuchuli = (res: any) => {
let gvalue = []
let lowerLimit = []
// item.maxValue=item.topLimit
item.minValue = min
item.minValue = item.lowerLimit
//判断数据是否存在
if (item.value !== null) {
for (let j = 0; j < item.value.length; j++) {
@@ -1096,7 +1092,6 @@ const shujuchuli = (res: any) => {
}
const rendering = () => {
height.value = mainHeight(200, list.value.length > 1 ? 2 : 1)
list.value.forEach((item: any) => {
let opitonserise: any[] = []
item.legend.forEach((item2: any) => {
@@ -1125,7 +1120,7 @@ const rendering = () => {
smooth: true,
itemStyle: {
normal: {
color: '#009900'
color: '#339900'
}
},
@@ -1142,7 +1137,7 @@ const rendering = () => {
barWidth: 22,
itemStyle: {
normal: {
color: '#CC0000'
color: '#FF3300'
}
},
data: item.cvalue
@@ -1300,8 +1295,6 @@ const rendering = () => {
getEcharts()
}
const getEcharts = () => {
console.log("🚀 ~ list.value.forEach ~ list.value:", list.value)
list.value.forEach((item: any, i: number) => {
item.option = {
backgroundColor: '#fff',
@@ -1325,7 +1318,7 @@ const getEcharts = () => {
opacity: 0.35,
fontSize: 14
},
backgroundColor: 'rgba(0,0,0,0.55)',
backgroundColor: 'rgba(0,0,0,0.35)',
formatter: function (params: any) {
let tips = ''
@@ -1398,7 +1391,8 @@ const getEcharts = () => {
}
},
legend: {
left: '140px',
left: '50px',
top: '25px',
verticalAlign: 'top',
enabled: true,
itemDistance: 5,
@@ -1412,6 +1406,9 @@ const getEcharts = () => {
padding: [0, 0, 0, 0] //[上、右、下、左]
}
},
grid: {
top: '70px',
},
xAxis: [
{
type: 'time',
@@ -1426,42 +1423,42 @@ const getEcharts = () => {
}
}
],
toolbox: {
show: true,
feature: {
dataZoom: {
// bottom: '10px',
yAxisIndex: 'none'
}
}
},
// toolbox: {
// show: true,
// feature: {
// dataZoom: {
// // bottom: '10px',
// yAxisIndex: 'none'
// }
// }
// },
yAxis: [
{
type: 'value',
min: item.minValue,
max: item.maxValue,
// min: item.minValue,
name: item.valueName,
axisLabel: {
interval: 0,
formatter: function (value: any) {
return value.toFixed(3)
},
left: '20px'
},
minInterval: 1,
// axisLabel: {
// interval: 0,
// // formatter: function (value: any) {
// // return value.toFixed(0)
// // },
// left: '20px'
// },
axisLine: {
show: true,
onZero: false, //-----------重点
lineStyle: {}
},
splitLine: {
lineStyle: {
// 使用深浅的间隔色
type: 'dashed',
opacity: 0.5
}
}
// splitLine: {
// lineStyle: {
// // 使用深浅的间隔色
// type: 'dashed',
// opacity: 0.5
// }
// }
}
],
series: item.serise
@@ -1555,7 +1552,7 @@ const getEcharts = () => {
symbolSize: 0,
itemStyle: {
normal: {
color: '#CC0000'
color: '#FF3300'
}
}
},