Browse Source

大屏接口api

master
DX 1 month ago
parent
commit
acb236431d
  1. 15
      src/api/screen/index.ts
  2. 33
      src/views/screen/compenonts/leftwrapper.vue
  3. 2
      src/views/screen/compenonts/numbox.vue
  4. 24
      src/views/screen/compenonts/rightwrapper.vue

15
src/api/screen/index.ts

@ -4,31 +4,28 @@ import request from '@/config/axios'
// 数据大屏 API
export const ScreenApi = {
// 查询大屏左侧第一个接口
getLifeFirst: async (params: any) => {
return await request.get({ url: `/system/big-view-data/getLifeFirst`, params })
getLeftFirst: async (params: any) => {
return await request.get({ url: `/system/big-view-data/getLeftFirst`, params })
},
getLeftSecond: async (params: any) => {
return await request.get({ url: `/system/big-view-data/getLeftSecond`, params })
},
getLeftThird: async (params: any) => {
getLeftThird: async (params: any) => {
return await request.get({ url: `/system/big-view-data/getLeftThird`, params })
},
getRightFirst: async (params: any) => {
getRightFirst: async (params: any) => {
return await request.get({ url: `/system/big-view-data/getRightFirst`, params })
},
getRightSecond: async (params: any) => {
getRightSecond: async (params: any) => {
return await request.get({ url: `/system/big-view-data/getRightSecond`, params })
},
getRightThird: async (params: any) => {
getRightThird: async (params: any) => {
return await request.get({ url: `/system/big-view-data/getRightThird`, params })
},
}

33
src/views/screen/compenonts/leftwrapper.vue

@ -14,6 +14,8 @@
<script setup lang="ts">
import TitleBox from './titleBox.vue'
import { ScreenApi } from '@/api/screen'
const leftWrapperRef = ref()
@ -67,7 +69,7 @@ const row1Options = ref({
series: [
{
type: 'bar',
data: [100, 90, 10, 90, 90, 20, 56, 89],
data: [100, 10],
barWidth: 5,
itemStyle: {
color: {
@ -311,7 +313,36 @@ const handlerResize = () => {
unref(row3Chart).resizeHandler()
}
const queryParams:any = ref();
//
const leftFirst = async() => {
const data:any = await ScreenApi.getLeftFirst(queryParams.value);
row1Options.value.xAxis.data = data.map(i=>i.name)
row1Options.value.series[0].data = data.map(i=>i.value)
}
//
const leftSecond = async() => {
const data = await ScreenApi.getLeftSecond(queryParams.value);
row2Options.value.title.text = data.enterpriseCount
row2Options.value.series[0].data = data.enterpriseCountGroup
}
//
const leftThird = async() => {
const data = await ScreenApi.getLeftThird(queryParams.value);
row3Options.value.yAxis[0].data = data.map(i=>i.name)
row3Options.value.yAxis[1].data = data.map(i=>i.finishCount)
}
onMounted(() => {
leftFirst()
leftSecond()
leftThird()
initChart()
observer = new ResizeObserver(handlerResize)
observer.observe(leftWrapperRef.value)

2
src/views/screen/compenonts/numbox.vue

@ -29,7 +29,7 @@
<section>企业数</section>
<count-to
:start-val="0"
:end-val="1000"
:end-val="100"
:duration="2000"
:options="{ decimal: 2 }"
suffix="+"

24
src/views/screen/compenonts/rightwrapper.vue

@ -17,6 +17,7 @@
<script setup lang="ts">
import TitleBox from './titleBox.vue'
import { ScreenApi } from '@/api/screen'
const rightWrapperRef = ref()
@ -382,6 +383,28 @@ const row2Chart = ref()
const row3Chart = ref()
const initChart = () => {}
const queryParams:any = ref()
//
// const rightFirst = async() => {
// const data:any = await ScreenApi.getRightFirst(queryParams.value);
// row1Options.value.xAxis.data = data.map(i=>i.name)
// row1Options.value.series[0].data = data.map(i=>i.value)
// }
//
const rightSecond = async() => {
const data = await ScreenApi.getRightSecond(queryParams.value);
row2Options.value.series[0].data = data
}
//
// const rightThird = async() => {
// const data = await ScreenApi.getRightThird(queryParams.value);
// row3Options.value.yAxis[0].data = data.map(i=>i.name)
// row3Options.value.yAxis[1].data = data.map(i=>i.finishCount)
// }
const handlerResize = () => {
unref(row1Chart).resizeHandler()
unref(row2Chart).resizeHandler()
@ -390,6 +413,7 @@ const handlerResize = () => {
onMounted(() => {
initChart()
rightSecond()
observer = new ResizeObserver(handlerResize)
observer.observe(rightWrapperRef.value)
handlerResize()

Loading…
Cancel
Save