1.设备监测 接口对接

2.环境监测 平均数据 前台页面开发
This commit is contained in:
fks-yangshouda
2024-07-17 15:06:11 +08:00
parent 1be888feba
commit ddf0514182
11 changed files with 832 additions and 324 deletions

View File

@@ -46,9 +46,6 @@
<a-button type="primary" style="width: 100%; margin-bottom: 10px" @click="getSelect">
查询
</a-button>
<a-button type="primary" style="width: 100%; margin-bottom: 10px" @click="getSelect11">
模拟不同数据查询
</a-button>
</div>
</div>
</template>
@@ -60,6 +57,7 @@
import { inject } from 'vue';
import { http } from '/nerv-lib/util';
import { device } from '/@/api/deviceManage';
import { deviceMonitor } from '/@/api/monitor';
export default defineComponent({
// eslint-disable-next-line vue/multi-word-component-names
@@ -163,6 +161,7 @@
tableList: any[];
tableColumns: any[];
graphList: any[];
XData: any[];
}
const pageData = inject<PageData>('pageData');
if (!pageData) {
@@ -170,278 +169,180 @@
}
// 查询数据后放入pageData
const getSelect = () => {
pageData.tableList = [
{
key: '1',
name: 'AC_002暖通电表',
position: 'A 相电压',
unit: 'V',
date: '2023-12-01',
'1:00': '3626',
},
{
key: '1',
name: 'AC_002暖通电表',
position: 'A 相电压',
unit: 'V',
date: '2023-12-01',
'1:00': '3626',
},
{
key: '2',
name: 'AC_003照明电表',
position: 'A 相电压',
unit: 'V',
date: '2023-12-01',
'1:00': '3626',
},
{
key: '2',
name: 'AC_003照明电表',
position: 'A 相电压',
unit: 'V',
date: '2023-12-01',
'1:00': '3626',
},
{
key: '3',
name: 'AC_004给排水电表',
position: 'A 相电压',
unit: 'V',
date: '2023-12-01',
'1:00': '3626',
},
];
pageData.tableColumns = [
{
title: '日期',
dataIndex: 'date',
},
{
title: '1:00',
dataIndex: '1:00',
},
];
pageData.graphList = [
{
date: '2023-12-01 0:00',
unit: 'V',
data: [
{
name: 'AC_002暖通电表',
value: '21',
},
{
name: 'AC_003照明电表',
value: '36',
},
{
name: 'AC_004给排水电表',
value: '5',
},
],
},
{
date: '2023-12-02 0:00',
unit: 'V',
data: [
{
name: 'AC_002暖通电表',
value: '26',
},
{
name: 'AC_003照明电表',
value: '25',
},
{
name: 'AC_004给排水电表',
value: '47',
},
],
},
{
date: '2023-12-03 0:00',
unit: 'V',
data: [
{
name: 'AC_002暖通电表',
value: '18',
},
{
name: 'AC_003照明电表',
value: '22',
},
{
name: 'AC_004给排水电表',
value: '26',
},
],
},
{
date: '2023-12-04 0:00',
unit: 'V',
data: [
{
name: 'AC_002暖通电表',
value: '40',
},
{
name: 'AC_003照明电表',
value: '15',
},
{
name: 'AC_004给排水电表',
value: '12',
},
],
},
{
date: '2023-12-05 0:00',
unit: 'V',
data: [
{
name: 'AC_002暖通电表',
value: '15',
},
{
name: 'AC_003照明电表',
value: '18',
},
{
name: 'AC_004给排水电表',
value: '15',
},
],
},
{
date: '2023-12-06 0:00',
unit: 'V',
data: [
{
name: 'AC_002暖通电表',
value: '15',
},
{
name: 'AC_003照明电表',
value: '18',
},
{
name: 'AC_004给排水电表',
value: '15',
},
],
},
];
};
// 测试查询 模拟不同数据
const getSelect11 = () => {
pageData.tableList = [
{
key: '1',
name: 'AC_002暖通电表',
position: 'A 相电压',
unit: 'V',
date: '2023-12-01',
'1:00': '3626',
'2:00': '2222',
},
{
key: '1',
name: 'AC_002暖通电表',
position: 'A 相电压',
unit: 'V',
date: '2023-12-01',
'1:00': '3626',
'2:00': '2222',
},
{
key: '2',
name: 'AC_003照明电表',
position: 'A 相电压',
unit: 'V',
date: '2023-12-01',
'1:00': '3626',
'2:00': '2222',
},
{
key: '2',
name: 'AC_003照明电表',
position: 'A 相电压',
unit: 'V',
date: '2023-12-01',
'1:00': '3626',
'2:00': '2222',
},
{
key: '3',
name: 'AC_004给排水电表',
position: 'A 相电压',
unit: 'V',
date: '2023-12-01',
'1:00': '3626',
'2:00': '2222',
},
];
pageData.tableColumns = [
{
title: '日期',
dataIndex: 'date',
},
{
title: '1:00',
dataIndex: '1:00',
},
{
title: '2:00',
dataIndex: '2:00',
},
];
pageData.graphList = [
{
date: '2023-12-01 0:00',
unit: 'V',
data: [
{
name: 'AC_002暖通电表',
value: '21',
},
{
name: 'AC_003照明电表',
value: '36',
},
{
name: 'AC_004给排水电表',
value: '5',
},
{
name: 'AC_0051111111',
value: '14',
},
],
},
{
date: '2023-12-02 0:00',
unit: 'V',
data: [
{
name: 'AC_002暖通电表',
value: '26',
},
{
name: 'AC_003照明电表',
value: '25',
},
{
name: 'AC_004给排水电表',
value: '47',
},
{
name: 'AC_0051111111',
value: '28',
},
],
},
];
http
.post(deviceMonitor.getDeviceGraph, {
deviceIds: ['HLlmTZp8-0601-0001', 'HLlmTZp-0804-0001'],
devicePointCode: 'ua',
devicePointId: 32,
endDate: '2024-07-02',
startDate: '2024-07-01',
timeRate: '2',
})
.then((res) => {
pageData.tableList = res.data.tableList;
pageData.tableColumns = res.data.tableHeaderList;
pageData.graphList = res.data.graphData;
pageData.XData = res.data.XData;
});
// pageData.tableList = [
// {
// key: '1',
// name: 'AC_002暖通电表',
// position: 'A 相电压',
// unit: 'V',
// date: '2023-12-01',
// '1:00': '3626',
// },
// {
// key: '1',
// name: 'AC_002暖通电表',
// position: 'A 相电压',
// unit: 'V',
// date: '2023-12-01',
// '1:00': '3626',
// },
// {
// key: '2',
// name: 'AC_003照明电表',
// position: 'A 相电压',
// unit: 'V',
// date: '2023-12-01',
// '1:00': '3626',
// },
// {
// key: '2',
// name: 'AC_003照明电表',
// position: 'A 相电压',
// unit: 'V',
// date: '2023-12-01',
// '1:00': '3626',
// },
// {
// key: '3',
// name: 'AC_004给排水电表',
// position: 'A 相电压',
// unit: 'V',
// date: '2023-12-01',
// '1:00': '3626',
// },
// ];
// pageData.tableColumns = [
// {
// title: '00:00',
// dataIndex: '00:00',
// },
// ];
// pageData.graphList = [
// {
// date: '2023-12-01 0:00',
// unit: 'V',
// data: [
// {
// name: 'AC_002暖通电表',
// value: '21',
// },
// {
// name: 'AC_003照明电表',
// value: '36',
// },
// {
// name: 'AC_004给排水电表',
// value: '5',
// },
// ],
// },
// {
// date: '2023-12-02 0:00',
// unit: 'V',
// data: [
// {
// name: 'AC_002暖通电表',
// value: '26',
// },
// {
// name: 'AC_003照明电表',
// value: '25',
// },
// {
// name: 'AC_004给排水电表',
// value: '47',
// },
// ],
// },
// {
// date: '2023-12-03 0:00',
// unit: 'V',
// data: [
// {
// name: 'AC_002暖通电表',
// value: '18',
// },
// {
// name: 'AC_003照明电表',
// value: '22',
// },
// {
// name: 'AC_004给排水电表',
// value: '26',
// },
// ],
// },
// {
// date: '2023-12-04 0:00',
// unit: 'V',
// data: [
// {
// name: 'AC_002暖通电表',
// value: '40',
// },
// {
// name: 'AC_003照明电表',
// value: '15',
// },
// {
// name: 'AC_004给排水电表',
// value: '12',
// },
// ],
// },
// {
// date: '2023-12-05 0:00',
// unit: 'V',
// data: [
// {
// name: 'AC_002暖通电表',
// value: '15',
// },
// {
// name: 'AC_003照明电表',
// value: '18',
// },
// {
// name: 'AC_004给排水电表',
// value: '15',
// },
// ],
// },
// {
// date: '2023-12-06 0:00',
// unit: 'V',
// data: [
// {
// name: 'AC_002暖通电表',
// value: '15',
// },
// {
// name: 'AC_003照明电表',
// value: '18',
// },
// {
// name: 'AC_004给排水电表',
// value: '15',
// },
// ],
// },
// ];
};
type RangeValue = [Dayjs, Dayjs];
@@ -493,7 +394,6 @@
dateRange,
getDianWeiList,
getSelect,
getSelect11,
disabledDate,
onCalendarChange,
onOpenChange,