diff --git a/package-lock.json b/package-lock.json index a4d23b9..5b802c6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,8 @@ "vue": "^3.5.13", "vue-countup-v3": "^1.4.2", "vue-echarts": "^7.0.3", - "vue-router": "^4.4.5" + "vue-router": "^4.4.5", + "vue3-seamless-scroll": "^2.0.1" }, "devDependencies": { "@vitejs/plugin-vue": "^5.2.1", @@ -3368,6 +3369,14 @@ "url": "https://opencollective.com/webpack" } }, + "node_modules/throttle-debounce": { + "version": "5.0.0", + "resolved": "https://registry.npmmirror.com/throttle-debounce/-/throttle-debounce-5.0.0.tgz", + "integrity": "sha512-2iQTSgkkc1Zyk0MeVrt/3BvuOXYPl/R8Z0U2xxo9rjwNciaHDG3R+Lm6dh4EeUci49DanvBnuqI6jshoQQRGEg==", + "engines": { + "node": ">=12.22" + } + }, "node_modules/tinyglobby": { "version": "0.2.10", "resolved": "https://registry.npmmirror.com/tinyglobby/-/tinyglobby-0.2.10.tgz", @@ -3887,6 +3896,14 @@ "vue": "^3.2.0" } }, + "node_modules/vue3-seamless-scroll": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/vue3-seamless-scroll/-/vue3-seamless-scroll-2.0.1.tgz", + "integrity": "sha512-mI3BaDU3pjcPUhVSw3/xNKdfPBDABTi/OdZaZqKysx4cSdNfGRbVvGNDzzptBbJ5S7imv5T55l6x/SqgnxKreg==", + "dependencies": { + "throttle-debounce": "5.0.0" + } + }, "node_modules/watchpack": { "version": "2.4.2", "resolved": "https://registry.npmmirror.com/watchpack/-/watchpack-2.4.2.tgz", diff --git a/package.json b/package.json index 428687c..fcb01d6 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,8 @@ "vue": "^3.5.13", "vue-countup-v3": "^1.4.2", "vue-echarts": "^7.0.3", - "vue-router": "^4.4.5" + "vue-router": "^4.4.5", + "vue3-seamless-scroll": "^2.0.1" }, "devDependencies": { "@vitejs/plugin-vue": "^5.2.1", diff --git a/src/assets/images/legend-item-blue.png b/src/assets/images/legend-item-blue.png new file mode 100644 index 0000000..5ad5dc9 Binary files /dev/null and b/src/assets/images/legend-item-blue.png differ diff --git a/src/assets/images/legend-item-green.png b/src/assets/images/legend-item-green.png new file mode 100644 index 0000000..08a4bcf Binary files /dev/null and b/src/assets/images/legend-item-green.png differ diff --git a/src/assets/images/legend-item-orange.png b/src/assets/images/legend-item-orange.png new file mode 100644 index 0000000..a5c4158 Binary files /dev/null and b/src/assets/images/legend-item-orange.png differ diff --git a/src/components/CoreVideo/index.vue b/src/components/CoreVideo/index.vue index 40456cd..0008466 100644 --- a/src/components/CoreVideo/index.vue +++ b/src/components/CoreVideo/index.vue @@ -8,6 +8,7 @@ :style="{ backgroundImage: `url(${index == 0 ? primary : error})` }" v-for="(item, index) in list" :key="index" + @click.shop="handleItem(item)" >

@@ -15,11 +16,11 @@

@@ -27,6 +28,7 @@
+ + + diff --git a/src/hooks/map.js b/src/hooks/map.js index 0984320..51812d8 100644 --- a/src/hooks/map.js +++ b/src/hooks/map.js @@ -7,6 +7,9 @@ export function useMap() { map.value = new BMapGL.Map(id) map.value.centerAndZoom(new BMapGL.Point(lat, lng), scale) map.value.enableScrollWheelZoom(true) + map.value.setMapStyleV2({ + styleId: '23c9fb8e1c604995f97f0f1cebd7036f' + }) if (satellite) map.value.setMapType(BMAP_SATELLITE_MAP) } diff --git a/src/main.js b/src/main.js index 5993957..eee9913 100644 --- a/src/main.js +++ b/src/main.js @@ -5,7 +5,6 @@ import router from './router' import '@/styles/reset.css' import '@/styles/common.scss' import '@/assets/fonts/index.css' - const app = createApp(App) app.use(createPinia()) diff --git a/src/views/home/components/age.vue b/src/views/home/components/age.vue index 6c9db3a..dae3c84 100644 --- a/src/views/home/components/age.vue +++ b/src/views/home/components/age.vue @@ -21,6 +21,7 @@ const init = () => { if (!params) { params = { + color: ['#00B1FF', '#00FFFF', '#FF3737', '#DD5627', '#D3F0FE'], legend: { orient: 'vertical', left: '54%', diff --git a/src/views/home/components/box-1.vue b/src/views/home/components/box-1.vue index 402045d..240c121 100644 --- a/src/views/home/components/box-1.vue +++ b/src/views/home/components/box-1.vue @@ -186,7 +186,7 @@
游客总数:
- +
@@ -210,6 +210,7 @@ { value: 0, name: '低感景区总数' } ] }) + // 景区购票数 const admission = computed(() => { if (homeData.value) return homeData.value?.admission return [ @@ -225,6 +226,11 @@ 0 ) }) + // 年龄占比 + const channelData = computed(() => { + if (homeData.value) return homeData.value?.userPortrait.channel + return [] + }) const channelTotal = computed(() => { return homeData.value?.userPortrait?.channel.reduce( (total, current) => Number(current.count) + total, diff --git a/src/views/home/components/box-2.vue b/src/views/home/components/box-2.vue index 2de3d7e..51aad1a 100644 --- a/src/views/home/components/box-2.vue +++ b/src/views/home/components/box-2.vue @@ -5,15 +5,15 @@
今年总游客数
- +
全县景区总游客人数
- +
总在园人数
- +
@@ -149,7 +149,15 @@ const homeData = inject('homeData') - let count = ref(69459) + const visitorInfo = computed(() => { + if (homeData.value) return homeData.value?.visitorInfo.data + return { + total_count_this_year: 0, + total_count_today: 0, + total_count_today_within_three_hours: 0 + } + }) + let spotList = ref([]) let list = ref([ @@ -180,7 +188,6 @@ let res1 = await getBaiduMapCrowdedApi({ nodeId: res.data[0].nodeid }) - console.log(res1, 'res1') } watch( @@ -200,7 +207,7 @@ arr.push(new BMapGL.Point(j[0], j[1])) }) var polyline = new BMapGL.Polyline(arr, { - strokeColor: '#1EBA29', + strokeColor: '#38DBFF', strokeWeight: 4, strokeOpacity: 0.8 }) @@ -280,7 +287,7 @@ position: absolute; top: vw(20); left: vw(20); - z-index: 99999; + z-index: 99; .alarm-item { width: vw(110); height: vh(40); @@ -303,7 +310,7 @@ position: absolute; bottom: vw(20); left: vw(20); - z-index: 99999; + z-index: 999; } .spot-list { display: flex; diff --git a/src/views/home/components/box-3.vue b/src/views/home/components/box-3.vue index 24bfe79..be851f1 100644 --- a/src/views/home/components/box-3.vue +++ b/src/views/home/components/box-3.vue @@ -2,51 +2,36 @@
-
- +
+
- -
{{ item.label }}
+ +
路段总数
+
+
+
+ +
+ +
当前拥堵路段
+
+
+
+ +
+ +
总拥堵次数
+
+
+
+ +
+ +
最大拥堵时长
-
-
- -
- -
-
-
@@ -54,37 +39,21 @@ :width="250" :height="150" :config="{ legend: false }" - :data="[ - { - name: '企业数', - data: [64, 159, 112, 86, 151, 131, 118, 232, 23, 64, 159, 112, 86, 151, 131, 118] - } - ]" - :xAxisData="[ - '12-16 10:00', - '12-16 14:00', - '12-16 16:00', - '12-16 22:00', - '12-17 02:00', - '12-17 06:00', - '12-17 10:00', - '12-17 14:00', - '12-17 16:00', - '12-16 22:00', - '12-18 02:00', - '12-18 06:00', - '12-8 10:00', - '12-18 14:00', - '12-18 16:00', - '12-18 20:00' - ]" + :data="congestionData" + :xAxisData="congestionXAxisData" />
- - + + +
+
+
+
+ +
@@ -127,11 +96,11 @@
- -
+ +
- +
@@ -199,15 +168,24 @@
空余
-
-
{{ item.name }}
-
{{ item.started_count }}
-
{{ item.not_started_count }}
-
+
+
{{ item.name }}
+
{{ item.started_count }}
+
{{ item.not_started_count }}
+
+
@@ -226,15 +204,24 @@
空余
-
-
{{ item.name }}
-
{{ item.started_count }}
-
{{ item.not_started_count }}
-
+
+
{{ item.name }}
+
{{ item.started_count }}
+
{{ item.not_started_count }}
+
+
@@ -279,7 +266,8 @@ diff --git a/src/views/home/components/jam-duration.vue b/src/views/home/components/jam-duration.vue new file mode 100644 index 0000000..39ac439 --- /dev/null +++ b/src/views/home/components/jam-duration.vue @@ -0,0 +1,195 @@ + + + + + diff --git a/src/views/home/components/jam.vue b/src/views/home/components/jam.vue deleted file mode 100644 index fbef9aa..0000000 --- a/src/views/home/components/jam.vue +++ /dev/null @@ -1,190 +0,0 @@ - - - - - diff --git a/src/views/home/components/ticket.vue b/src/views/home/components/ticket.vue index 418542f..b4b14ec 100644 --- a/src/views/home/components/ticket.vue +++ b/src/views/home/components/ticket.vue @@ -1,18 +1,6 @@ @@ -20,6 +8,13 @@ import { fitChartSize } from '@/utils/dataUtil' import { useEchart } from '@/hooks/echart' + let props = defineProps({ + list: { + type: Array, + default: () => [] + } + }) + const { id, setOption } = useEchart() const homeData = inject('homeData') @@ -29,9 +24,9 @@ let params = null watch( - () => homeData.value?.userPortrait?.channel, + () => props.list, (val) => { - if (val) init() + if (val.length > 0) init() }, { immediate: true @@ -39,11 +34,12 @@ ) const setSeries = () => { - return homeData.value?.userPortrait?.channel.map((item, index) => { + return props.list.map((item, index) => { return { name: item.name, - clockwise: false, type: 'pie', + clockwise: false, + silent: true, radius: [`${x * (index + 1)}%`, `${y + index * 15}%`], center: ['50%', '40%'], label: { show: false }, @@ -73,20 +69,22 @@ show: true, x: 'center', y: 'bottom', - itemHeight: fitChartSize(8), - itemWidth: fitChartSize(8), - itemGap: fitChartSize(20), + itemHeight: fitChartSize(12), + itemWidth: fitChartSize(12), + itemGap: fitChartSize(10), formatter: function (name) { - return '{title|' + name + '}' + let obj = props.list.find((item) => item.name == name) + return '{name|' + name + '} {value|' + obj?.value + '}{value|%}' }, textStyle: { rich: { - title: { + name: { color: '#fff', fontSize: fitChartSize(14) }, value: { color: '#00D5F6', + fontWeight: 600, fontSize: fitChartSize(14) } } diff --git a/src/views/sentiment/index.vue b/src/views/sentiment/index.vue index 9f72b5e..b771a86 100644 --- a/src/views/sentiment/index.vue +++ b/src/views/sentiment/index.vue @@ -24,8 +24,8 @@
- - + +