diff --git a/src/api/request.js b/src/api/request.js index 95661c3..a51ff99 100644 --- a/src/api/request.js +++ b/src/api/request.js @@ -2,7 +2,6 @@ import axios from 'axios' import { useRouter } from 'vue-router' import { ElMessage } from 'element-plus' -// let devToken = 'eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6ImE1OWFmNWYwLTU3OWItNDJkNy1hZDJhLTY0Y2JlODA5ZWI1NiJ9.BTxvu6jUWbN0qONWf5K6VzXopE8T8qXzKuX-mij21VJT4U0LdgnqToyqeNDQ2OyJ6cvpdJBzQ9mEEb-dnwrTpQ' let proToken = @@ -15,7 +14,7 @@ const router = useRouter() const instance = axios.create({ // baseURL: 'http://36.138.38.16:6180/fjtcc-api', baseURL: 'http://36.138.38.16:8001/fjtcc-api', - // baseURL: 'http://172.22.15.170/fjtcc-api', + // baseURL: 'http://192.168.77.200/fjtcc-api', timeout: 100000, headers: { Authorization: devToken, diff --git a/src/components/CoreVideo/index.vue b/src/components/CoreVideo/index.vue index a2da096..ee565d2 100644 --- a/src/components/CoreVideo/index.vue +++ b/src/components/CoreVideo/index.vue @@ -50,7 +50,6 @@ let res = await getVideoListApi({ businessVideoDisplayPosition: '' }) - console.log(res, '============') list.value = res.data nextTick(() => { list.value.forEach(async (item, index) => { diff --git a/src/components/Header/index.vue b/src/components/Header/index.vue index 331e3c6..94ee006 100644 --- a/src/components/Header/index.vue +++ b/src/components/Header/index.vue @@ -50,8 +50,8 @@ 风速:{{ weatherData?.windSpeed }} | 空气质量:{{ weatherData?.airQuality }} - {{ currentDate }} +

{{ currentDate }}

返回
@@ -206,6 +206,46 @@ ] isBack.value = true break + case '/sceneTesting': + title.value = '三峡之巅-安全检测' + navLeft.value = [ + { + name: '奉节县', + path: '/sceneTesting' + }, + { + name: '三峡之巅', + path: '/sceneTesting' + }, + { + name: '白帝城', + path: '/sceneTesting' + }, + { + name: '龙河桥', + path: '/sceneTesting' + } + ] + navRight.value = [ + { + name: '路段', + path: '/roadTesting' + }, + { + name: '路段', + path: '/roadTesting' + }, + { + name: '路段', + path: '/roadTesting' + }, + { + name: '路段', + path: '/roadTesting' + } + ] + isBack.value = true + break } } watch( @@ -230,7 +270,7 @@ left: vw(326); .weather { position: absolute; - right: 0; + left: 0; top: vh(10); font-weight: 400; font-size: vw(18); @@ -239,6 +279,14 @@ margin: 0 vw(10); } } + .date { + position: absolute; + right: 0; + top: vh(10); + font-weight: 400; + font-size: vw(18); + color: #ffffff; + } .back { position: absolute; right: 0; diff --git a/src/components/Line/index.vue b/src/components/Line/index.vue index e320b8c..72c5184 100644 --- a/src/components/Line/index.vue +++ b/src/components/Line/index.vue @@ -140,7 +140,7 @@ }, series: [] } - const updateOption = () => { + const init = () => { if (params) { props.data.map((item, index) => { params.series[index].data = item.data @@ -167,7 +167,7 @@ (val) => { if (val[0].length > 0 && val[1].length > 0) { setTimeout(() => { - updateOption() + init() }, 1000) } }, diff --git a/src/components/Nav/index.vue b/src/components/Nav/index.vue new file mode 100644 index 0000000..0f5f794 --- /dev/null +++ b/src/components/Nav/index.vue @@ -0,0 +1,243 @@ + + + diff --git a/src/components/PieRow/index.vue b/src/components/PieRow/index.vue index f10fce8..8dc105d 100644 --- a/src/components/PieRow/index.vue +++ b/src/components/PieRow/index.vue @@ -32,13 +32,17 @@ type: Array, default: () => [] }, + label: { + type: String, + default: () => '' + }, total: { type: Number, default: () => 0 } }) - const { id, chart, setOption, initChart } = useEchart() + const { id, setOption } = useEchart() var colorList = ['#FDC40A', '#FF5232', '#50F0A6', '#5FDFFA'] @@ -46,14 +50,14 @@ color: colorList, legend: { orient: 'vertical', - bottom: 'center', - left: '70%', - itemWidth: fitChartSize(20), - itemHeight: fitChartSize(20), - itemGap: fitChartSize(20), + x: '64%', + y: 'center', + itemWidth: fitChartSize(12), + itemHeight: fitChartSize(12), + itemGap: fitChartSize(10), textStyle: { color: '#ffffff', - fontSize: fitChartSize(20) + fontSize: fitChartSize(14) } }, series: [ @@ -69,8 +73,8 @@ show: true, position: 'center', fontWeight: 'bold', - formatter: function (o) { - return `{value|123456}` + '\n' + `{name|舆情总数 }` + formatter: () => { + return `{value|${props.total}}` + '\n' + `{name|${props.label} }` }, rich: { value: { diff --git a/src/components/monitor/index.vue b/src/components/monitor/index.vue index 25fc6c3..7766341 100644 --- a/src/components/monitor/index.vue +++ b/src/components/monitor/index.vue @@ -1,217 +1,221 @@ \ No newline at end of file + .video-box { + flex: 1; + display: flex; + .video-one-1 { + background-image: url('/src/assets/images/log-v-bg.png'); + background-size: 100% 100%; + flex-wrap: wrap; + padding-top: 0; + padding: vh(30) vw(20); + margin-left: vw(20); + } + .video-live { + justify-content: space-between; + margin-left: vw(10); + .video-lt { + width: vw(1666); + height: vh(950); + background-image: url('/src/assets/images/one-video-bg.png'); + background-size: 100% 100%; + padding: vh(40) vw(50); + position: relative; + .desc { + position: absolute; + // width:100%; + left: vw(50); + right: vw(50); + top: 40 (vh); + z-index: 9; + background: rgba(4, 30, 69, 0.5); + border-radius: 0px 0px 0px 0px; + text-align: center; + font-weight: 400; + font-size: vw(14); + color: #ffffff; + padding: vw(20); + text-align: left; + font-style: normal; + text-transform: none; + } + } + .v-error-bg { + // background-image: url('/src/assets/images/v-item-bg-1.png'); + // background-size: 100% 100%; + .desc { + background: rgba(226, 27, 27, 0.5); + } + } + .video-rt { + width: vw(400); + height: vh(950); + background: radial-gradient( + to bottom 70% at 99% 50%, + #0a4190 0%, + rgba(0, 77, 136, 0.6) 100% + ); + border-radius: 0px 0px 0px 0px; + border: 1px solid; + opacity: 0.4; + border-image: linear-gradient(180deg, rgba(0, 150, 255, 1), rgba(0, 90, 153, 0)) 1 1; + margin-left: vw(10); + padding: vw(20); + .rt-v-box { + overflow-y: auto; + /* 滚动条整体样式 */ + &::-webkit-scrollbar { + width: vw(4); /* 滚动条的宽度 */ + } + /* 滚动条轨道 */ + &::-webkit-scrollbar-track { + background: 'transparent'; /* 轨道的背景色 */ + } + /* 滚动条滑块 */ + &::-webkit-scrollbar-thumb { + background: rgba(0, 150, 255, 0.63); /* 滑块的背景色 */ + border-radius: 5px; /* 滑块的圆角 */ + } + height: 100%; + } + .title { + background-image: url('/src/assets/images/nav-l-t-bg.png'); + background-size: 100% 100%; + margin-bottom: vh(10); + position: relative; + left: vw(-20); + span { + margin-left: vw(30); + font-weight: 800; + font-size: vw(15); + line-height: vh(26); + text-align: center; + font-style: normal; + text-transform: none; + + background: linear-gradient(90deg, #ffffff 0%, #5cb5ff 100%); + -webkit-background-clip: text; + background-clip: text; + -webkit-text-fill-color: transparent; + color: transparent; + } + } + .rt-video { + width: 100%; + height: vh(300); + background-image: url('/src/assets/images/v-item-bg.png'); + background-size: 100% 100%; + padding: vw(20); + box-sizing: border-box; + margin-bottom: vh(2); + position: relative; + .desc { + position: absolute; + width: 100%; + left: 0; + bottom: 0; + z-index: 9; + background: rgba(4, 30, 69, 0.5); + border-radius: 0px 0px 0px 0px; + text-align: center; + font-weight: 400; + font-size: vw(14); + color: #ffffff; + padding: vw(20); + text-align: left; + font-style: normal; + text-transform: none; + } + } + .v-error-bg { + background-image: url('/src/assets/images/v-item-bg-1.png'); + background-size: 100% 100%; + .desc { + background: rgba(226, 27, 27, 0.5); + } + } + } + } + .v-item { + width: vw(400); + height: vh(300); + background-image: url('/src/assets/images/v-item-bg.png'); + background-size: 100% 100%; + padding: vw(20); + margin-right: vw(4); + margin-bottom: vh(4); + } + .v-error-bg { + background-image: url('/src/assets/images/v-item-bg-1.png'); + background-size: 100% 100%; + } + } + diff --git a/src/components/navLeft/index.vue b/src/components/navLeft/index.vue deleted file mode 100644 index 6d66ccf..0000000 --- a/src/components/navLeft/index.vue +++ /dev/null @@ -1,246 +0,0 @@ - - - \ No newline at end of file diff --git a/src/hooks/socket.js b/src/hooks/socket.js index 23f34d3..88f2ba1 100644 --- a/src/hooks/socket.js +++ b/src/hooks/socket.js @@ -6,6 +6,7 @@ const homeStore = useHomeStore() export function useWebSocket(url) { let socket = ref(null) // socket对象 let isConnected = ref(false) // 是否连接成功 + let dataRes = ref(null) // 存储推送数据 const connectWebSocket = () => { socket.value = new WebSocket(url, 'echo-protocol', { @@ -25,7 +26,7 @@ export function useWebSocket(url) { // 处理接收到的消息 if (JSON.parse(message.data)) { let data = JSON.parse(message.data) - console.log(data, '接收到的消息') + dataRes.value = data switch (data.type) { case 'userPortrait': homeStore.setUserPortraitData(data.data) @@ -87,5 +88,5 @@ export function useWebSocket(url) { } }) - return { socket, isConnected, connectWebSocket, sendMessage } + return { socket, dataRes, isConnected, connectWebSocket, sendMessage } } diff --git a/src/router/index.js b/src/router/index.js index 626ba80..6c0173d 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -43,19 +43,19 @@ const router = createRouter({ path: '/traffic', name: 'traffic', component: () => import('@/views/traffic/index.vue') + }, + { + path: '/sceneTesting', + name: 'sceneTesting', + component: () => import('@/views/testing/index.vue') + }, + { + path: '/roadTesting', + name: 'roadTesting', + component: () => import('@/views/testing/road.vue') } ] }, - { - path: '/sceneTesting', - name: 'sceneTesting', - component: () => import('@/views/testing/index.vue') - }, - { - path: '/roadTesting', - name: 'roadTesting', - component: () => import('@/views/testing/road.vue') - }, { path: '/404', name: 'NotFound', diff --git a/src/stores/scenic.js b/src/stores/scenic.js new file mode 100644 index 0000000..304f3e9 --- /dev/null +++ b/src/stores/scenic.js @@ -0,0 +1,88 @@ +import { ref } from 'vue' +import { defineStore } from 'pinia' + +export const useScenicStore = defineStore('scenic', () => { + // 门票销售数据 + let scenicSpotData = ref([ + { name: '今日购票数', value: 0 }, + + { name: '未来三天购票数', value: 0 }, + + { name: '三天后购票数', value: 0 } + ]) + // 景区排队信息 + let scenicQueueData = ref({ dataList: [], header: { jrcp: 0, jrjdrs: 0, pdcxsj: 0, pdrs: 0 } }) + // 景区负载信息 + let scenicBearData = ref({ dataList: [], header: { jqzdcz: 0, jrjdrs: 0 } }) + // 景区停车信息 + let stopCarData = ref({ + dataList: [], + dataLists: [], + headList: [] + }) + // 安全信息 + let secureData = ref({ + dataList: [] + }) + // 交通信息 + let trafficData = ref({ + infoList: [ + { name: '总通景路段', value: 100 }, + { name: '通景路段拥堵', value: 0 }, + { name: '通景拥堵开始时间', value: 0 }, + { name: '拥堵持续时间', value: 0 } + ], + data: { + congestion: [], + countRate: [], + timeRate: [] + } + }) + // 安全信息 + let userPortraitData = ref({ + data: { + ageRate: [], + channel: [], + genderRate: [], + provinceRate: [] + } + }) + + const setUserPortraitData = (val) => { + userPortraitData.value = val + } + const setTrafficData = (val) => { + trafficData.value = val + } + const setSecureData = (val) => { + secureData.value = val + } + const setStopCarData = (val) => { + stopCarData.value = val + } + const setScenicBearData = (val) => { + scenicBearData.value = val + } + const setScenicQueueData = (val) => { + scenicQueueData.value = val + } + const setScenicSpotData = (val) => { + scenicSpotData.value = val + } + return { + scenicSpotData, + scenicQueueData, + scenicBearData, + stopCarData, + secureData, + trafficData, + userPortraitData, + setScenicSpotData, + setScenicQueueData, + setScenicBearData, + setStopCarData, + setSecureData, + setTrafficData, + setUserPortraitData + } +}) diff --git a/src/styles/common.scss b/src/styles/common.scss index 2c15c8f..a23ba86 100644 --- a/src/styles/common.scss +++ b/src/styles/common.scss @@ -35,13 +35,13 @@ margin-right: vw(8) !important; } .mt-8 { - margin-top: vw(8) !important; + margin-top: vh(8) !important; } .pt-10 { - padding-top: vw(10) !important; + padding-top: vh(10) !important; } .pb-10 { - padding-bottom: vw(10) !important; + padding-bottom: vh(10) !important; } .mb-10 { margin-bottom: vh(10) !important; diff --git a/src/views/home/components/box-2.vue b/src/views/home/components/box-2.vue index 6c52c8b..539e0a9 100644 --- a/src/views/home/components/box-2.vue +++ b/src/views/home/components/box-2.vue @@ -38,8 +38,8 @@ -
-
+
+