From 20b0ce2db27b64a60de60aee05dedd448099e330 Mon Sep 17 00:00:00 2001
From: 马宇豪 <978517621@qq.com>
Date: Mon, 08 Jul 2024 10:12:16 +0800
Subject: [PATCH] xiugai
---
src/views/riskWarningSys/warningBigScreen/components/message.vue | 56 ++++++++++++++++++++++++++++++++++----------------------
1 files changed, 34 insertions(+), 22 deletions(-)
diff --git a/src/views/riskWarningSys/warningBigScreen/components/message.vue b/src/views/riskWarningSys/warningBigScreen/components/message.vue
index 5bcbabc..f15d59f 100644
--- a/src/views/riskWarningSys/warningBigScreen/components/message.vue
+++ b/src/views/riskWarningSys/warningBigScreen/components/message.vue
@@ -20,8 +20,10 @@
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({
@@ -31,7 +33,7 @@
size: Number,
theme: Boolean
},
- setup(props) {
+ setup(props,context) {
const screenThemes = useScreenTheme()
const { screenTheme } = storeToRefs(screenThemes);
const userInfo = useUserInfo()
@@ -39,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){
@@ -110,6 +121,7 @@
// 页面载入时执行方法
onMounted(() => {
+ getReport()
getTheme()
});
--
Gitblit v1.9.2