|
|
@ -5,6 +5,10 @@ |
|
|
|
<el-col :span="4" style="padding-right: 10px;"> <!-- 适当留白避免拥挤 --> |
|
|
|
<el-card class="center-card margin-bottom">数据总览</el-card> |
|
|
|
</el-col> |
|
|
|
<!-- 最后更新时间 --> |
|
|
|
<el-col :span="18" style="display: flex; align-items: center; font-size: 18px"> |
|
|
|
最后更新时间:{{workDataUpdateTime}} |
|
|
|
</el-col> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 剩余栅格空间(可选,用于占满一行) --> |
|
|
@ -208,14 +212,14 @@ |
|
|
|
|
|
|
|
<script setup> |
|
|
|
import * as echarts from 'echarts' |
|
|
|
import {ref, onMounted, nextTick, watch} from 'vue' |
|
|
|
import {onMounted, ref, watch} from 'vue' |
|
|
|
import API from '@/util/http' |
|
|
|
import {ElMessage} from 'element-plus' |
|
|
|
import dayjs from 'dayjs'; |
|
|
|
import utc from 'dayjs-plugin-utc' |
|
|
|
import {ArrowDownBold, ArrowUpBold, SemiSelect} from '@element-plus/icons-vue' |
|
|
|
|
|
|
|
dayjs.extend(utc) |
|
|
|
import {ArrowUpBold, ArrowDownBold, SemiSelect, Refresh} from '@element-plus/icons-vue' |
|
|
|
// 地区数据 |
|
|
|
const markets = ref([]) |
|
|
|
// 图表相关 |
|
|
@ -672,12 +676,18 @@ const getAdminData = async function () { |
|
|
|
console.log('请求失败', error) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const workDataUpdateTime = ref(null) |
|
|
|
// 获取卡片数据 |
|
|
|
const getCardData = async () => { |
|
|
|
try { |
|
|
|
const response = await API({url: '/workbench/getCard', data: {}}) |
|
|
|
console.log('卡片数据', response.startDate) |
|
|
|
workDataUpdateTime.value = response.startDate |
|
|
|
|
|
|
|
if (response && response.data) { |
|
|
|
processData(response.data) |
|
|
|
|
|
|
|
} else if (Array.isArray(response?.marketCards)) { |
|
|
|
processData(response) |
|
|
|
} else { |
|
|
@ -688,21 +698,6 @@ const getCardData = async () => { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const refreshWorkspace = async () => { |
|
|
|
isLoading.value = true |
|
|
|
try { |
|
|
|
const result = await API({url: '/workbench/updateCard', data: {}}) |
|
|
|
if (result.code === 200) { |
|
|
|
ElMessage.success('数据更新成功') |
|
|
|
} else { |
|
|
|
ElMessage.error('数据更新失败') |
|
|
|
} |
|
|
|
} catch (error) { |
|
|
|
console.error('刷新工作台失败:', error) |
|
|
|
} finally { |
|
|
|
isLoading.value = false |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
onMounted(async () => { |
|
|
|
|
|
|
|