diff --git a/PVDEMCSUI/quasar.config.js b/PVDEMCSUI/quasar.config.js index c464ebf..91c3ddf 100644 --- a/PVDEMCSUI/quasar.config.js +++ b/PVDEMCSUI/quasar.config.js @@ -92,7 +92,7 @@ module.exports = configure(function (/* ctx */) { // Full list of options: https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#devServer devServer: { // https: true, - port: 8080, + port: 8088, open: true, // opens browser window automatically // proxy: { // '/api': { diff --git a/PVDEMCSUI/src/api/equipmentRecord/equipmentRecordApi.ts b/PVDEMCSUI/src/api/equipmentRecord/equipmentRecordApi.ts new file mode 100644 index 0000000..0fe7720 --- /dev/null +++ b/PVDEMCSUI/src/api/equipmentRecord/equipmentRecordApi.ts @@ -0,0 +1,49 @@ +import helper from 'src/Utils/helper'; +import { request } from '../../boot/axios'; +import { Pagination } from '../class'; +import { EquipmentRecord } from './model/equipmentRecord'; +const pathName = 'EquipmentRecord/'; + +class EquipmentRecordApi { + // 获取设备状态记录统计分页 哪台设备+时间跨度 + getEquipmentRecordDayTotalPageList = (val: Pagination) => { + let format = `?page=${val.page}&size=${val.rowsPerPage}`; + if (val.data.equipmentName) { + format += `&equipmentName=${val.data.equipmentName}`; + } + if (val.data.equipmentCode) { + format += `&equipmentCode=${val.data.equipmentCode}`; + } + if (val.data.equipmentType) { + format += `&equipmentType=${val.data.equipmentType}`; + } + if (val.data.begTime) { + format += `&begTime=${val.data.begTime}`; + } + if (val.data.endTime) { + format += `&endTime=${val.data.endTime}`; + } + return request.get( + `${pathName}GetEquipmentRecordDayTotalPageList${format}` + ); + }; + + // 获取设备状态记录统计列表 全部设备+时间跨度 + getEquipmentRecordDayTotalList = (val: EquipmentRecord) => { + const format = helper.params(val); + return request.get(`${pathName}GetEquipmentRecordDayTotalList${format}`); + }; + + // 获取设备总览 + getEquipmentStateView = () => { + return request.get(`${pathName}GetEquipmentStateView`); + }; + + // 获取报警设备列表 + getEquipmentAlarmList = () => { + return request.get(`${pathName}GetEquipmentAlarmList`); + }; +} +const equipmentRecordApi = new EquipmentRecordApi(); + +export { equipmentRecordApi }; diff --git a/PVDEMCSUI/src/api/equipmentRecord/model/equipmentRecord.ts b/PVDEMCSUI/src/api/equipmentRecord/model/equipmentRecord.ts new file mode 100644 index 0000000..953c201 --- /dev/null +++ b/PVDEMCSUI/src/api/equipmentRecord/model/equipmentRecord.ts @@ -0,0 +1,7 @@ +export class EquipmentRecord { + equipmentName!: string; + equipmentCode!: string; + equipmentType!: string; + begTime!: string; + endTime!: string; +} diff --git a/PVDEMCSUI/src/pages/screen/screen1/index.vue b/PVDEMCSUI/src/pages/screen/screen1/index.vue index 18c45b4..84731a2 100644 --- a/PVDEMCSUI/src/pages/screen/screen1/index.vue +++ b/PVDEMCSUI/src/pages/screen/screen1/index.vue @@ -59,7 +59,8 @@ {{ props.rowIndex + 1 }} - {{ props.row.name + {{ + props.row.equipmentName }} @@ -106,6 +107,7 @@ import { onMounted, ref, computed, nextTick } from 'vue'; import { Screen } from 'quasar'; import screen1 from 'src/json/screen1.json' +import { equipmentRecordApi } from 'src/api/equipmentRecord/equipmentRecordApi'; // 按需引入 echarts import * as echarts from 'echarts'; @@ -123,6 +125,12 @@ onMounted(() => { device2(); // device3(); monthlyOverview(); + + getEquipmentAlarmList(); + setInterval(() => { + console.log('刷新' + new Date()); + getEquipmentAlarmList(); + }, 10000); }) const loading = ref(false); @@ -135,17 +143,23 @@ const columns = ref([ headerStyle: 'background-color: #5186ec;color: white;font-weight: bold;font-size:16px;', }, { - name: 'name', + name: 'equipmentName', align: 'center', label: '设备名称', - field: 'name', + field: 'equipmentName', headerClasses: 'text-h4 text-weight-bold', headerStyle: 'background-color: #5186ec;color: white;font-weight: bold;font-size:16px;', }, // { name: 'calories', align: 'center', label: '设备类型', field: 'calories', headerStyle: 'background-color: #5186ec;color: white;font-weight: bold;font-size:16px;' }, ]) -const list = ref(screen1); +const list = ref(); + +const getEquipmentAlarmList = () => { + equipmentRecordApi.getEquipmentAlarmList().then((res: any) => { + list.value = res + }) +} // const list = ref([ // { name: '设备1', type: 'Yaq-123' }, diff --git a/PVDEMCSUI/src/pages/screen/screen2/index.vue b/PVDEMCSUI/src/pages/screen/screen2/index.vue index acc951a..f802814 100644 --- a/PVDEMCSUI/src/pages/screen/screen2/index.vue +++ b/PVDEMCSUI/src/pages/screen/screen2/index.vue @@ -80,40 +80,15 @@