fix: modify

develop
时启龙 2024-10-29 17:56:32 +08:00
parent 2af63eb68c
commit beeed54ea2
2 changed files with 14 additions and 11 deletions

View File

@ -22,9 +22,10 @@ import LineCharts from './echarts/LineCharts.vue'
import ItemCard from './ItemCard.vue' import ItemCard from './ItemCard.vue'
import { getSevenDayWarnTrend } from 'services/system/dashboard' import { getSevenDayWarnTrend } from 'services/system/dashboard'
import echarts from '@cmp/cmp-echarts/hooks/echarts' import echarts from '@cmp/cmp-echarts/hooks/echarts'
export const colorMap = ['rgba(24, 144, 255, 1)', 'rgba(18, 185, 242, 1)', 'rgba(245, 167, 45, 1)', 'rgba(255, 0, 0, 1)', , ,] export const colorMap = ['rgba(255, 0, 0, 1)', 'rgba(245, 167, 45, 1)', 'rgba(18, 185, 242, 1)', 'rgba(24, 144, 255, 1)']
export const lineColorMap = ['rgba(24, 144, 255, 1)', 'rgba(18, 185, 242, 1)', 'rgba(245, 167, 45, 1)', 'rgba(255, 0, 0, 1)']
const chartSetting = { const chartSetting = {
color: colorMap, color: lineColorMap,
legend: { legend: {
right: 0, right: 0,
textStyle: { textStyle: {
@ -69,10 +70,10 @@ export default {
} }
if (!names.length) return if (!names.length) return
// //
countData.value[0].value = res.data[1].reduce((total, { count }) => count + total, 0) countData.value[0].value = res.data[4].reduce((total, { count }) => count + total, 0)
countData.value[1].value = res.data[2].reduce((total, { count }) => count + total, 0) countData.value[1].value = res.data[3].reduce((total, { count }) => count + total, 0)
countData.value[2].value = res.data[3].reduce((total, { count }) => count + total, 0) countData.value[2].value = res.data[2].reduce((total, { count }) => count + total, 0)
countData.value[3].value = res.data[4].reduce((total, { count }) => count + total, 0) countData.value[3].value = res.data[1].reduce((total, { count }) => count + total, 0)
// //
const result = { const result = {
keys: res.data[names[0]].map(({ date }) => date), keys: res.data[names[0]].map(({ date }) => date),

View File

@ -98,11 +98,13 @@ export default {
getItemList() { getItemList() {
getWarnList(this.params).then(data => { getWarnList(this.params).then(data => {
if (data.success) { if (data.success) {
this.tableList = data.data.map(item => { this.tableList = data.data
item.createTime = dayjs(item.createTime).format('YYYY-MM-DD HH:mm:ss') .map(item => {
item.updateTime = dayjs(item.updateTime).format('YYYY-MM-DD HH:mm:ss') item.createTime = dayjs(item.createTime).format('YYYY-MM-DD HH:mm:ss')
return item item.updateTime = dayjs(item.updateTime).format('YYYY-MM-DD HH:mm:ss')
}) return item
})
.slice(0, 20)
// this.total = data.data.total // this.total = data.data.total
} }
}) })