diff --git a/src/api/api/index.ts b/src/api/api/index.ts index 4541b77..4aca814 100644 --- a/src/api/api/index.ts +++ b/src/api/api/index.ts @@ -19,7 +19,8 @@ monitorStationUpdate = '/monitorStation/update', monitorStationdDelete = '/monitorStation/delete', // 设备管理列表 - device = '/carbonDevice/listPage', + device = '/carbonDevice/list', + devicePage = '/carbonDevice/listPage', deviceAdd = '/carbonDevice/add', deviceUpdate = '/carbonDevice/update', deviceDelete = '/carbonDevice/delete', @@ -232,6 +233,13 @@ params, }) } +export function getDeviceListPage(params: any) { + return request({ + url: `${api.devicePage}`, + method: 'get', + params, + }) +} // 添加 设备管理 export function addDeviceList(data: any) { return request({ diff --git a/src/api/api/index.ts b/src/api/api/index.ts index 4541b77..4aca814 100644 --- a/src/api/api/index.ts +++ b/src/api/api/index.ts @@ -19,7 +19,8 @@ monitorStationUpdate = '/monitorStation/update', monitorStationdDelete = '/monitorStation/delete', // 设备管理列表 - device = '/carbonDevice/listPage', + device = '/carbonDevice/list', + devicePage = '/carbonDevice/listPage', deviceAdd = '/carbonDevice/add', deviceUpdate = '/carbonDevice/update', deviceDelete = '/carbonDevice/delete', @@ -232,6 +233,13 @@ params, }) } +export function getDeviceListPage(params: any) { + return request({ + url: `${api.devicePage}`, + method: 'get', + params, + }) +} // 添加 设备管理 export function addDeviceList(data: any) { return request({ diff --git a/src/views/data/device/detail.vue b/src/views/data/device/detail.vue index 83aa56e..ff65e93 100644 --- a/src/views/data/device/detail.vue +++ b/src/views/data/device/detail.vue @@ -55,11 +55,12 @@ } // 整理节点碳排趋势数据 if (data.emissionsTrends?.data?.length) { - xAxisData1.value = data.emissionsTrends?.data?.map((item: any) => item.time) + const emissionsTrends = data.emissionsTrends.data + xAxisData2.value = emissionsTrends.map((item: any) => item.time) data2.value = [ { name: '碳排趋势', - data: data.emissionsTrends?.data?.map((item: any) => item.value), + data: emissionsTrends.map((item: any) => item.value), }, ] } @@ -72,12 +73,15 @@ } // 监听 监测趋势时间段 变化 重新获取数据 watch(() => range.value, (newVal) => { - console.log(newVal, '选择时间段') fetchDeviceAnalysis() }, { deep: true, }) +// 监测类型 用来判断碳排趋势chart显不显示 +const monitorType = ref('') +monitorType.value = $route.query.monitor as string +console.log(monitorType.value, 'monitorType') onMounted(() => { fetchDeviceInfo() fetchDeviceAnalysis() @@ -150,18 +154,17 @@ - + - - + +
节点监测趋势
- +
- - - + +
节点碳排趋势
diff --git a/src/api/api/index.ts b/src/api/api/index.ts index 4541b77..4aca814 100644 --- a/src/api/api/index.ts +++ b/src/api/api/index.ts @@ -19,7 +19,8 @@ monitorStationUpdate = '/monitorStation/update', monitorStationdDelete = '/monitorStation/delete', // 设备管理列表 - device = '/carbonDevice/listPage', + device = '/carbonDevice/list', + devicePage = '/carbonDevice/listPage', deviceAdd = '/carbonDevice/add', deviceUpdate = '/carbonDevice/update', deviceDelete = '/carbonDevice/delete', @@ -232,6 +233,13 @@ params, }) } +export function getDeviceListPage(params: any) { + return request({ + url: `${api.devicePage}`, + method: 'get', + params, + }) +} // 添加 设备管理 export function addDeviceList(data: any) { return request({ diff --git a/src/views/data/device/detail.vue b/src/views/data/device/detail.vue index 83aa56e..ff65e93 100644 --- a/src/views/data/device/detail.vue +++ b/src/views/data/device/detail.vue @@ -55,11 +55,12 @@ } // 整理节点碳排趋势数据 if (data.emissionsTrends?.data?.length) { - xAxisData1.value = data.emissionsTrends?.data?.map((item: any) => item.time) + const emissionsTrends = data.emissionsTrends.data + xAxisData2.value = emissionsTrends.map((item: any) => item.time) data2.value = [ { name: '碳排趋势', - data: data.emissionsTrends?.data?.map((item: any) => item.value), + data: emissionsTrends.map((item: any) => item.value), }, ] } @@ -72,12 +73,15 @@ } // 监听 监测趋势时间段 变化 重新获取数据 watch(() => range.value, (newVal) => { - console.log(newVal, '选择时间段') fetchDeviceAnalysis() }, { deep: true, }) +// 监测类型 用来判断碳排趋势chart显不显示 +const monitorType = ref('') +monitorType.value = $route.query.monitor as string +console.log(monitorType.value, 'monitorType') onMounted(() => { fetchDeviceInfo() fetchDeviceAnalysis() @@ -150,18 +154,17 @@
- + - - + +
节点监测趋势
- +
- - - + +
节点碳排趋势
diff --git a/src/views/data/device/index.vue b/src/views/data/device/index.vue index ff34d80..284b131 100644 --- a/src/views/data/device/index.vue +++ b/src/views/data/device/index.vue @@ -2,7 +2,7 @@