数据完整性图表显示

This commit is contained in:
sjl
2025-12-24 11:19:41 +08:00
parent 4f0dc512e2
commit cf7e5fa991
2 changed files with 36 additions and 9 deletions

View File

@@ -75,11 +75,11 @@ const tableStore = new TableStore({
yData = [] yData = []
chartsData.value.map((item: any) => { chartsData.value.map((item: any) => {
xData.push(item.type) xData.push(item.type)
if (item.single == 0 || item.single == 3.14159) { // if (item.single == 0 || item.single == 3.14159) {
yData.push(0) // yData.push(0)
} else { // } else {
yData.push(item.single) yData.push(item.single)
} //}
}) })
// tableStore.table.data.type // tableStore.table.data.type
const legendColorList = ['#0099CC', '#9A6601', '#CCCCCC', '#FFFFFF'] const legendColorList = ['#0099CC', '#9A6601', '#CCCCCC', '#FFFFFF']
@@ -111,7 +111,19 @@ const tableStore = new TableStore({
}, },
tooltip: { tooltip: {
formatter: function (params: any) {
var tips = ''
for (var i = 0; i < params.length; i++) {
if (params[i].value == 3.14159) {
tips += params[i].name + '</br>'
tips += params[i].marker + '完整性:暂无数据'
} else {
tips += params[i].name + '</br>'
tips += params[i].marker + '完整性:' + params[i].value.toFixed(2)
}
}
return tips
}
// formatter: function (params: any) { // formatter: function (params: any) {
// var tips = `<div style="min-width:80px;display:flex;justify-content:space-between;align-items:center"> // var tips = `<div style="min-width:80px;display:flex;justify-content:space-between;align-items:center">
// <span style="margin-left:5px;dislpay:block;min-width:80px;color:#000">${params[0].name}</span></div>` // <span style="margin-left:5px;dislpay:block;min-width:80px;color:#000">${params[0].name}</span></div>`
@@ -181,7 +193,21 @@ const tableStore = new TableStore({
// 定制显示(按顺序) // 定制显示(按顺序)
color: function (params) { color: function (params) {
if (params.value >= 90) { if (params.value == 3.14159) {
return new echarts.graphic.LinearGradient(
0,
1,
0,
0,
[
{
offset: 1,
color: '#ccc'
}
],
false
)
} else if (params.value >= 90) {
return new echarts.graphic.LinearGradient( return new echarts.graphic.LinearGradient(
0, 0,
1, 1,
@@ -209,7 +235,7 @@ const tableStore = new TableStore({
], ],
false false
) )
} else if (params.value > 0.5 && params.value <= 60) { } else if (params.value > 0 && params.value <= 60) {
return new echarts.graphic.LinearGradient( return new echarts.graphic.LinearGradient(
0, 0,
1, 1,
@@ -223,7 +249,7 @@ const tableStore = new TableStore({
], ],
false false
) )
} else if (params.value > 0 && params.value <= 0.5) { } else if (params.value == 0) {
return new echarts.graphic.LinearGradient( return new echarts.graphic.LinearGradient(
0, 0,
1, 1,

View File

@@ -56,7 +56,7 @@
</el-form-item> </el-form-item>
</template> </template>
<template #operation> <template #operation>
<el-button type="primary" icon="el-icon-Tickets" @click="makeUp">补招</el-button> <el-button type="primary" icon="el-icon-Tickets" @click="makeUp" v-if="!VITE_FLAG">补招</el-button>
</template> </template>
</TableHeader> </TableHeader>
</div> </div>
@@ -113,6 +113,7 @@ const adminInfo = useAdminInfo()
defineOptions({ defineOptions({
name: 'harmonic-boot/harmonic/getIntegrityData' name: 'harmonic-boot/harmonic/getIntegrityData'
}) })
const VITE_FLAG = import.meta.env.VITE_NAME == 'hainan'
const logRef = ref() const logRef = ref()
const tableRef = ref() const tableRef = ref()
const chartsRef = ref() const chartsRef = ref()