| | |
| | | * @Author: shuishen 1109946754@qq.com |
| | | * @Date: 2024-11-04 16:32:04 |
| | | * @LastEditors: shuishen 1109946754@qq.com |
| | | * @LastEditTime: 2024-11-05 17:12:37 |
| | | * @LastEditTime: 2024-11-19 15:29:44 |
| | | * @FilePath: \bigScreen\src\views\survey\components\box\dataContent.vue |
| | | * @Description: |
| | | * |
| | |
| | | --> |
| | | <script setup> |
| | | // import { ref, reactive, onMounted, nextTick, inject } from 'vue' |
| | | import { useEchartsResize } from "hooks/useEchartsResize"; |
| | | import { getRescueTeamStatistic } from "@/api/indParkInfo"; |
| | | import { nextTick } from "vue"; |
| | | import { useEchartsResize } from "hooks/useEchartsResize" |
| | | import { getRescueTeamStatistic } from "@/api/indParkInfo" |
| | | import { nextTick } from "vue" |
| | | |
| | | let $echarts = inject("echarts"); |
| | | const curEcharts = ref(null); |
| | | let $echarts = inject("echarts") |
| | | const curEcharts = ref(null) |
| | | |
| | | let myEcharts = reactive(null); |
| | | let myEcharts = reactive(null) |
| | | |
| | | function getStatistic() { |
| | | function getStatistic () { |
| | | getRescueTeamStatistic().then((res) => { |
| | | let xaxis_data = []; |
| | | let yaxis_data = []; |
| | | let xaxis_data = [] |
| | | let yaxis_data = [] |
| | | res.data.data.forEach((element) => { |
| | | xaxis_data.push(element.type); |
| | | yaxis_data.push(element.num); |
| | | }); |
| | | xaxis_data.push(element.type) |
| | | yaxis_data.push(element.num) |
| | | }) |
| | | |
| | | myEcharts.setOption({ |
| | | tooltip: { |
| | |
| | | color: "#fff", |
| | | }, |
| | | axisLine: { |
| | | show: true, |
| | | lineStyle: { |
| | | color: "#fff", |
| | | }, |
| | |
| | | axisLabel: { |
| | | color: "#fff", |
| | | }, |
| | | splitLine: { |
| | | show: false, |
| | | } |
| | | }, |
| | | ], |
| | | series: [ |
| | |
| | | }, |
| | | }, |
| | | ], |
| | | }); |
| | | }); |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | nextTick(() => { |
| | | myEcharts = $echarts.init(curEcharts.value); |
| | | getStatistic(); |
| | | }); |
| | | myEcharts = $echarts.init(curEcharts.value) |
| | | getStatistic() |
| | | }) |
| | | |
| | | const echartsResize = () => { |
| | | myEcharts && myEcharts.resize(); |
| | | }; |
| | | myEcharts && myEcharts.resize() |
| | | } |
| | | |
| | | useEchartsResize(echartsResize); |
| | | useEchartsResize(echartsResize) |
| | | </script> |
| | | |
| | | <template> |