From 1b9fea7d4af68d8f933b2dc42bf6084b9646f64c Mon Sep 17 00:00:00 2001 From: 马宇豪 <978517621@qq.com> Date: 星期二, 04 三月 2025 08:39:55 +0800 Subject: [PATCH] 修改作业等级名称 --- src/views/riskWarningSys/warningBigScreen/components/message.vue | 57 +++++++++++++++++++++++++++++++++++---------------------- 1 files changed, 35 insertions(+), 22 deletions(-) diff --git a/src/views/riskWarningSys/warningBigScreen/components/message.vue b/src/views/riskWarningSys/warningBigScreen/components/message.vue index 7a8327a..f15d59f 100644 --- a/src/views/riskWarningSys/warningBigScreen/components/message.vue +++ b/src/views/riskWarningSys/warningBigScreen/components/message.vue @@ -20,8 +20,11 @@ import * as echarts from 'echarts'; import '/@/theme/bigScreen.css' import {useScreenTheme} from "/@/stores/screenTheme" + import {riskWarningApi} from "/@/api/riskWarning"; interface stateType { + reportData: [] + config: object } export default defineComponent({ name: 'message', @@ -30,7 +33,7 @@ size: Number, theme: Boolean }, - setup(props) { + setup(props,context) { const screenThemes = useScreenTheme() const { screenTheme } = storeToRefs(screenThemes); const userInfo = useUserInfo() @@ -38,45 +41,54 @@ const router = useRouter(); const pro = ref("eChartPro" + Date.now() + Math.random()) const state = reactive<stateType>({ + reportData: [], config:{ - header: ['消息列表', '同比'], - data: [ - ['一月预警消息SPI报告', '<span style="color:#4CF475;">↑ 94%</span>'], - ['二月预警消息SPI报告', '<span style="color:#4CF475;">↑ 94%</span>'], - ['三月预警消息SPI报告', '<span style="color:#4CF475;">↑ 94%</span>'], - ['四月预警消息SPI报告', '<span style="color:red;">↓ 43%</span>'], - ['五月预警消息SPI报告', '<span style="color:#4CF475;">↑ 94%</span>'], - ['六月预警消息SPI报告', '<span style="color:#4CF475;">↑ 94%</span>'], - ['七月预警消息SPI报告', '<span style="color:#4CF475;">↑ 94%</span>'], - ['八月预警消息SPI报告', '<span style="color:red;">↓ 65%</span>'], - ['九月预警消息SPI报告', '<span style="color:#4CF475;">↑ 94%</span>'], - ['十月预警消息SPI报告', '<span style="color:#4CF475;">↑ 94%</span>'], - ['十一月预警消息SPI报告', '<span style="color:#4CF475;">↑ 94%</span>'], - ['十二月预警消息SPI报告', '<span style="color:#4CF475;">↑ 94%</span>'] - ], - index: true, - columnWidth: [60], - align: ['center','center','center'], + header: ['消息列表','同比'], + data: [], + align: ['left'], headerBGC: '#0049af', oddRowBGC: 'none', + index: true, + columnWidth: [55,250], evenRowBGC: 'rgba(57,122,206,.1)', indexHeader: '序号', rowNum: fontSize(5) } }) + const getReport = async () => { + let res = await riskWarningApi().getAllReport(); + if (res.data.code === '200') { + state.reportData = res.data.data + state.config.data = state.reportData.map(i=> { + if(i.yoy >= 0){ + return [i.spiName,'<span style="color:#11feee">' + i.yoy + '%</span>'] + }else{ + return [i.spiName,'<span style="color:red">' + i.yoy + '%</span>'] + } + + }) + } else { + ElMessage({ + type: 'warning', + message: res.data.msg + }); + } + } + const mouseoverHandler = (e: any) => { } const clickHandler = (e: any) => { - console.log(e.row,'row') router.push({ - path: 'msgDetail', + path: 'screenPage', query: { - row: e.row + num: 8, + rowIndex: e.rowIndex } }) + context.emit('getData',e.rowIndex) } function fontSize(val){ @@ -109,6 +121,7 @@ // 页面载入时执行方法 onMounted(() => { + getReport() getTheme() }); -- Gitblit v1.9.2