Merge branch 'master' of 1ihldi8qxdvv.angerl.cn:fengjie/fengjie-datascreen

This commit is contained in:
duanliang
2024-12-26 14:09:41 +08:00
11 changed files with 192 additions and 139 deletions

View File

@@ -150,12 +150,12 @@
<span class="text">男性</span>
<div class="progress">
<el-progress
:percentage="50"
:percentage="genderRate['男']"
:show-text="false"
color="linear-gradient( to right, #074D90 0%, #55E0FF 100%)"
/>
</div>
<span class="man">50%</span>
<span class="man">{{ genderRate['男'] }}%</span>
</div>
</div>
<div class="cell pt-20">
@@ -164,13 +164,13 @@
<span class="text">女性</span>
<div class="progress">
<el-progress
:percentage="50"
:percentage="genderRate['女']"
:show-text="false"
color="linear-gradient( to right,
#0A4482 0%, #FF7021 100%)"
/>
</div>
<span class="woman">50%</span>
<span class="woman">{{ genderRate['女'] }}%</span>
</div>
</div>
</div>
@@ -189,10 +189,23 @@
<script setup>
import countup from 'vue-countup-v3'
import AgeRatio from './age-ratio.vue'
import top from './top.vue'
import gauge from './gauge.vue'
import ticket from './ticket.vue'
import ageRatio from './age-ratio.vue'
let props = defineProps({
data: {
type: Object,
default: () => ({})
}
})
let genderRate = computed(() => {
if (props.data?.userPortrait) return props.data?.userPortrait.genderRate
return {
: 0,
: 0
}
})
let xAxisData = ref([
'12-16 10:00',
'12-16 14:00',

View File

@@ -1,16 +1,21 @@
<template>
<Header title="奉节县旅游指挥调度中心" is-skip :nav-left="navLeft" :nav-right="navRight" />
<CoreVideo />
<box2 />
<box1 :data="data" />
<box3 />
<box4 />
<Correspondence />
</template>
<script setup>
import box2 from './components/box-2.vue'
import box1 from './components/box-1.vue'
import box3 from './components/box-3.vue'
import box4 from './components/box-4.vue'
import { useWebSocket } from '@/hooks/socket'
const { data, sendMessage } = useWebSocket('ws://36.138.38.16:81/ws/third-party')
const navLeft = [
{ name: '安全', path: '/monitor' },
{ name: '景区', path: '/scenic' },
@@ -22,30 +27,4 @@
{ name: '舆情', path: '/sentiment' },
{ name: '酒店' }
]
onMounted(() => {
let socket = new WebSocket('ws://36.138.38.16:81/ws/third-party', 'echo-protocol', {
headers: {
Authorization:
'eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6ImE1OWFmNWYwLTU3OWItNDJkNy1hZDJhLTY0Y2JlODA5ZWI1NiJ9.BTxvu6jUWbN0qONWf5K6VzXopE8T8qXzKuX-mij21VJT4U0LdgnqToyqeNDQ2OyJ6cvpdJBzQ9mEEb-dnwrTpQ'
}
})
socket.onopen = () => {
console.log('WebSocket connected')
socket.send(
JSON.stringify({
action: 'start',
type: 'index'
})
)
}
socket.onerror = (error) => {
console.error('WebSocket error:', error)
}
socket.onmessage = (message) => {
console.log('Received message:', message.data)
let data = JSON.parse(message.data)
console.log('Received message:', data)
}
socket.onclose = () => {}
})
</script>

View File

@@ -24,18 +24,10 @@
</div>
</div>
<div class="flex mt-20 gap-8 ml-8 mr-8">
<div v-for="(item, index) in stateList" class="border flex-1">
<Title3 :title="index" />
<pie-row :width="500" :height="330" :dataList="item" />
<div v-for="(item, index) in stateList" :key="index" class="border flex-1">
<Title3 :title="item.name" />
<pie-row :width="500" :height="330" :dataList="item.data" :total="item.total" />
</div>
<!-- <div class="border flex-1">
<Title3 title="山峡之巅" />
<pie-row :width="500" :height="330" />
</div>
<div class="border flex-1">
<Title3 title="山峡之巅" />
<pie-row :width="500" :height="330" />
</div> -->
</div>
</div>
<div class="box-1">
@@ -46,6 +38,7 @@
<div class="flex mt-10">
<div class="box-2 mr-10">
<Title1 title="舆情指数" />
<Dropdown :options="options" @on-change="onChange" />
<Line
:width="1560"
:height="400"
@@ -71,7 +64,13 @@
import Area from './components/area.vue'
import wordCloud from './components/wordCloud.vue'
import dataSource from './components/dataSource.vue'
import { getHotNewApi, getLineChartApi, getStateApi, getTotalApi } from '@/api/sentiment.js'
import {
getHotNewApi,
getLineChartApi,
getStateApi,
getTotalApi,
getSpotApi
} from '@/api/sentiment.js'
let seriesData = ref([])
let xAxisData = ref([])
@@ -80,7 +79,15 @@
let sensitive = ref(0)
let unsensitive = ref(0)
let stateList = ref([])
let options = ref([])
const onChange = (e) => {
console.log(e, '===')
getLineChart(e.id)
}
const getStop = async () => {
let res = await getSpotApi()
options.value = res.data
}
const getTotal = async () => {
let res = await getTotalApi()
total.value = res.data.total
@@ -92,8 +99,8 @@
stateList.value = res.data
console.log(stateList.value, '------')
}
const getLineChart = async () => {
let res = await getLineChartApi()
const getLineChart = async (id) => {
let res = await getLineChartApi({ id })
xAxisData.value = res.data.data
seriesData.value = res.data.series
}
@@ -102,6 +109,7 @@
hotNewList.value = res.data
}
onMounted(() => {
getStop()
getHotNew()
getTotal()
getState()