From 641753aee8aa68cf00729bc7ab4b0fefa681e933 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=85=88=E7=94=9F?= Date: Fri, 14 Mar 2025 15:56:54 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=AE=8C=E5=96=84=E9=A6=96=E9=A1=B5=20?= =?UTF-8?q?=E6=99=AF=E5=8C=BA=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/scenic.js | 18 ++-- src/views/home/components/box-2.vue | 18 +--- src/views/scenic/components/box-1.vue | 21 +---- src/views/scenic/components/box-2.vue | 47 +---------- src/views/scenic/components/jam.vue | 114 +++++++++++++------------- src/views/scenic/index.vue | 4 +- 6 files changed, 81 insertions(+), 141 deletions(-) diff --git a/src/stores/scenic.js b/src/stores/scenic.js index cbeb936..5008dd5 100644 --- a/src/stores/scenic.js +++ b/src/stores/scenic.js @@ -3,13 +3,21 @@ import { defineStore } from 'pinia' export const useScenicStore = defineStore('scenic', () => { // 门票销售数据 - let scenicSpotData = ref([ - { name: '今日购票数', value: 0 }, + let scenicSpotData = ref({ + data: [ + { name: '今日购票数', value: 0 }, - { name: '未来三天购票数', value: 0 }, + { name: '未来三天购票数', value: 0 }, - { name: '三天后购票数', value: 0 } - ]) + { name: '三天后购票数', value: 0 } + ], + infoList: [ + { name: '游玩舒适度', type: 0, value: '空闲' }, + { name: '景区安全', type: 0, value: '安全' }, + { name: '通景交通', type: 0, value: '通畅' }, + { name: '停车场负荷', type: 0, value: '空闲' } + ] + }) // 景区排队信息 let scenicQueueData = ref({ dataList: [], header: { jrcp: 0, jrjdrs: 0, pdcxsj: 0, pdrs: 0 } }) // 景区负载信息 diff --git a/src/views/home/components/box-2.vue b/src/views/home/components/box-2.vue index cdfd3a3..e0b493d 100644 --- a/src/views/home/components/box-2.vue +++ b/src/views/home/components/box-2.vue @@ -21,20 +21,10 @@
- - - +
{{ item.name }}
+
{{ + item.value + }}
diff --git a/src/views/scenic/components/box-1.vue b/src/views/scenic/components/box-1.vue index 2ad9c2f..db2db02 100644 --- a/src/views/scenic/components/box-1.vue +++ b/src/views/scenic/components/box-1.vue @@ -5,7 +5,7 @@
{{ item.name }}
@@ -13,22 +13,9 @@
-
-
游览舒适度
-

舒适

-
-
-
景区安全
-

安全

-
- -
-
通景交通
-

畅通

-
-
-
停车场负荷度
-

空闲

+
+
{{ item.name }}
+

{{ item.value }}

diff --git a/src/views/scenic/components/box-2.vue b/src/views/scenic/components/box-2.vue index 7bcc223..8807b8a 100644 --- a/src/views/scenic/components/box-2.vue +++ b/src/views/scenic/components/box-2.vue @@ -4,11 +4,6 @@
- - - - -
@@ -335,44 +330,6 @@ let carOverlays = ref([]) let shipOverlays = ref([]) - let list = ref([ - { - name: '人群聚集识别', - count: 0, - value: 0 - }, - { - name: '人群计数识别', - count: 0, - value: 0 - }, - { - name: '游客跌倒', - count: 0, - value: 0 - }, - { - name: '游客攀爬', - count: 0, - value: 0 - }, - { - name: '违法吸烟', - count: 0, - value: 0 - }, - { - name: '烟火焚烧', - count: 0, - value: 0 - }, - { - name: '人员离岗', - count: 0, - value: 0 - } - ]) - const garageList = computed(() => { return scenicStore.stopCarData.headList }) diff --git a/src/views/scenic/components/jam.vue b/src/views/scenic/components/jam.vue index 12eb9e2..60fe5c2 100644 --- a/src/views/scenic/components/jam.vue +++ b/src/views/scenic/components/jam.vue @@ -56,7 +56,7 @@ return props.list.map((item) => { return { ...item, - value: parseFloat(item.value) + value: item.count } }) } @@ -71,68 +71,66 @@ return () => `{value|${getTotal()}}` + '\n' + `{name|${props.subTitle}}` } - let defaultCofig = { - color: ['#A665F1', '#0063FF', '#00D0FF', '#01FEFE', '#FC2638', '#FED958'], - legend: { - x: 'left', - y: '74%', - itemHeight: fitChartSize(12), - itemWidth: fitChartSize(12), - itemGap: fitChartSize(10), - formatter: function (name) { - return '{name|' + name + '}' - }, - textStyle: { - rich: { - name: { - color: '#fff', - fontSize: fitChartSize(14) + const init = () => { + if (!params) { + params = { + color: ['#A665F1', '#0063FF', '#00D0FF', '#01FEFE', '#FC2638', '#FED958'], + legend: { + x: 'left', + y: '74%', + itemHeight: fitChartSize(12), + itemWidth: fitChartSize(12), + itemGap: fitChartSize(10), + formatter: function (name) { + return '{name|' + name + '}' }, - value: { - color: '#00D5F6', - fontSize: fitChartSize(14) - } - } - } - }, - series: [ - { - type: 'pie', - center: ['50%', '40%'], - radius: ['55%', '70%'], - itemStyle: { - borderWidth: fitChartSize(4), - borderColor: '#093672' - }, - label: { - show: true, - position: 'center', - fontWeight: 'bold', - formatter: formatLabel(), - rich: { - value: { - color: '#fff', - fontSize: fitChartSize(24), - fontWeight: 'bold', - padding: [0, 0, 5, 0] - }, - name: { - color: '#fff', - fontSize: fitChartSize(12) + textStyle: { + rich: { + name: { + color: '#fff', + fontSize: fitChartSize(14) + }, + value: { + color: '#00D5F6', + fontSize: fitChartSize(14) + } } } }, - labelLine: { - show: false - }, - data: getSeriesData() + series: [ + { + type: 'pie', + center: ['50%', '40%'], + radius: ['55%', '70%'], + itemStyle: { + borderWidth: fitChartSize(4), + borderColor: '#093672' + }, + label: { + show: true, + position: 'center', + fontWeight: 'bold', + formatter: formatLabel(), + rich: { + value: { + color: '#fff', + fontSize: fitChartSize(24), + fontWeight: 'bold', + padding: [0, 0, 5, 0] + }, + name: { + color: '#fff', + fontSize: fitChartSize(12) + } + } + }, + labelLine: { + show: false + }, + data: getSeriesData() + } + ] } - ] - } - - const init = () => { - if (!params) { - params = defaultCofig } else { params.series[0].label.formatter = formatLabel() params.series[0].data = getSeriesData() diff --git a/src/views/scenic/index.vue b/src/views/scenic/index.vue index 75e6155..b3167d9 100644 --- a/src/views/scenic/index.vue +++ b/src/views/scenic/index.vue @@ -46,7 +46,7 @@ scenicStore.setWordkOrderData(val) break case 'scenicSpotData': - scenicStore.setScenicSpotData(val.data) + scenicStore.setScenicSpotData(val) break case 'scenicSppotLineUp': scenicStore.setScenicQueueData(val) @@ -70,7 +70,7 @@ scenicStore.setCarShipData(val.data) break } - if (!timer) sendCarShip() + // if (!timer) sendCarShip() } } )