Browse Source

feat: 迁移drawer loading 逻辑修改

main
betaqi 4 weeks ago
parent
commit
700dcaca85
  1. 3
      src/api/module/transfer/index.ts
  2. 9
      src/views/stationData/transfer/components/deviceDrawer.vue

3
src/api/module/transfer/index.ts

@ -17,6 +17,7 @@ export const getDeviceDetails = (params: IGetDeviceDataParams) =>
url: `/api/query`, url: `/api/query`,
method: 'POST', method: 'POST',
data: params, data: params,
timeout: 0,
}) })
export interface ISite { export interface ISite {
@ -66,7 +67,7 @@ export interface IPointGroupOV {
id: number | string, id: number | string,
ip: string, ip: string,
name: string, name: string,
cnName:string cnName: string
port: number, port: number,
slave_addr: number | string, slave_addr: number | string,
type: string, type: string,

9
src/views/stationData/transfer/components/deviceDrawer.vue

@ -17,7 +17,8 @@
:siteInfo="props.siteInfo" :siteInfo="props.siteInfo"
ref="pointGroupTreeRef"/> ref="pointGroupTreeRef"/>
</EdfsWrap> </EdfsWrap>
<div class="flex-1 p-4 h-full overflow-hidden relative" <div class="flex-1 p-4 h-full overflow-hidden relative" v-loading="loading"
element-loading-text="数据加载中请耐心等待..."
> >
<div class="absolute w-full h-full bg-[#ffffffe5] z-99" v-if="loadingChart"> <div class="absolute w-full h-full bg-[#ffffffe5] z-99" v-if="loadingChart">
<div class="w-full h-full flex flex-col justify-center items-center"> <div class="w-full h-full flex flex-col justify-center items-center">
@ -171,6 +172,7 @@ const axisData = new Set<string>()
const legends = ref<{ addr: string; label: string, unit: string }[]>([]) const legends = ref<{ addr: string; label: string, unit: string }[]>([])
const loadingChart = ref(false) const loadingChart = ref(false)
const loading = ref(false)
const chartAllTotal = ref(0) const chartAllTotal = ref(0)
const chartLimit = ref(1000) const chartLimit = ref(1000)
const chartOffset = ref(0) const chartOffset = ref(0)
@ -207,10 +209,11 @@ async function loadChardData() {
offset offset
} }
loadingChart.value = true loading.value = true
isShowChart.value = false isShowChart.value = false
const res = await getDeviceDetails(params) const res = await getDeviceDetails(params)
loading.value = false
loadingChart.value = true
if (res.code !== 0) { if (res.code !== 0) {
resetChartStatus() resetChartStatus()
message.error('获取设备数据失败') message.error('获取设备数据失败')

Loading…
Cancel
Save