Browse Source

大屏接口

master
DX 1 month ago
parent
commit
576360ee94
  1. 40
      src/api/screen/index.ts
  2. 25
      src/views/screen/compenonts/rightwrapper.vue

40
src/api/screen/index.ts

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

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

@ -385,25 +385,33 @@ const initChart = () => {}
const queryParams:any = ref() const queryParams:any = ref()
// //
// const rightFirst = async() => { const rightFirst = async() => {
// const data:any = await ScreenApi.getRightFirst(queryParams.value); const data:any = await ScreenApi.getRightFirst(queryParams.value);
// row1Options.value.xAxis.data = data.map(i=>i.name) row1Options.value.xAxis.data = data.map(i=>i.name)
// row1Options.value.series[0].data = data.map(i=>i.value) row1Options.value.series[0].data = data.map(i=>i.value)
// } row1Options.value.series[1].data = data.map(i=>i.taskValue)
}
// //
const rightSecond = async() => { const rightSecond = async() => {
const data = await ScreenApi.getRightSecond(queryParams.value); const data = await ScreenApi.getRightSecond(queryParams.value);
row2Options.value.series[0].data = data row2Options.value.series[0].data = data
} }
// //
// const rightThird = async() => { // const rightThird = async() => {
// const data = await ScreenApi.getRightThird(queryParams.value); // const data = await ScreenApi.getRightThird(queryParams.value);
// row3Options.value.yAxis[0].data = data.map(i=>i.name) // row3Options.value.yAxis[0].data = data.map(i=>i.name)
// row3Options.value.yAxis[1].data = data.map(i=>i.finishCount) // row3Options.value.yAxis[1].data = data.map(i=>i.finishCount)
// } // }
//
// const rightFourth = async() => {
// const data = await ScreenApi.getRightFourth(queryParams.value);
// row3Options.value.xAxis[0].data = data.map(i=>i.name)
// row3Options.value.yAxis[1].data = data.map(i=>i.finishCount)
// }
const handlerResize = () => { const handlerResize = () => {
unref(row1Chart).resizeHandler() unref(row1Chart).resizeHandler()
@ -413,6 +421,7 @@ const handlerResize = () => {
onMounted(() => { onMounted(() => {
initChart() initChart()
rightFirst()
rightSecond() rightSecond()
observer = new ResizeObserver(handlerResize) observer = new ResizeObserver(handlerResize)
observer.observe(rightWrapperRef.value) observer.observe(rightWrapperRef.value)

Loading…
Cancel
Save