diff --git a/.vscode/settings.json b/.vscode/settings.json index 76b609d..e08940f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,10 +3,7 @@ "source.fixAll.eslint": "explicit", "source.fixAll.stylelint": "explicit" }, - "stylelint.validate": [ - "css", - "scss", - "vue" - ], - "editor.inlayHints.enabled": "off" + "stylelint.validate": ["css", "scss", "vue"], + "editor.inlayHints.enabled": "off", + "typescript.tsdk": "node_modules/typescript/lib" } diff --git a/.vscode/settings.json b/.vscode/settings.json index 76b609d..e08940f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,10 +3,7 @@ "source.fixAll.eslint": "explicit", "source.fixAll.stylelint": "explicit" }, - "stylelint.validate": [ - "css", - "scss", - "vue" - ], - "editor.inlayHints.enabled": "off" + "stylelint.validate": ["css", "scss", "vue"], + "editor.inlayHints.enabled": "off", + "typescript.tsdk": "node_modules/typescript/lib" } diff --git a/src/api/laboratory/data.ts b/src/api/laboratory/data.ts index 3e64dd1..570f35a 100644 --- a/src/api/laboratory/data.ts +++ b/src/api/laboratory/data.ts @@ -32,3 +32,12 @@ responseType: 'blob', }) } + +// 查询ups监测详情 +export function getUpsMonitorDetail(data: { id: string }) { + return request({ + url: `${prefix}/ups/monitor/detail`, + method: 'post', + data, + }) +} diff --git a/.vscode/settings.json b/.vscode/settings.json index 76b609d..e08940f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,10 +3,7 @@ "source.fixAll.eslint": "explicit", "source.fixAll.stylelint": "explicit" }, - "stylelint.validate": [ - "css", - "scss", - "vue" - ], - "editor.inlayHints.enabled": "off" + "stylelint.validate": ["css", "scss", "vue"], + "editor.inlayHints.enabled": "off", + "typescript.tsdk": "node_modules/typescript/lib" } diff --git a/src/api/laboratory/data.ts b/src/api/laboratory/data.ts index 3e64dd1..570f35a 100644 --- a/src/api/laboratory/data.ts +++ b/src/api/laboratory/data.ts @@ -32,3 +32,12 @@ responseType: 'blob', }) } + +// 查询ups监测详情 +export function getUpsMonitorDetail(data: { id: string }) { + return request({ + url: `${prefix}/ups/monitor/detail`, + method: 'post', + data, + }) +} diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index 77e6179..5fc1842 100644 --- a/src/components/NormalTable/index.vue +++ b/src/components/NormalTable/index.vue @@ -103,7 +103,7 @@ }, }, }) -const emit = defineEmits(['change', 'selectionChange', 'rowClick', 'multiSelect', 'sortChange']) +const emit = defineEmits(['cellClick', 'change', 'selectionChange', 'rowClick', 'multiSelect', 'sortChange']) // -------定义数据-------------- interface columnsCheckInfo { text: string @@ -159,6 +159,9 @@ function rowClick(row: object, column?: any, event?: any) { emit('rowClick', row) } +function cellClick(row: any, column: any, cell: any, event: any) { + emit('cellClick', row, column, cell, event) +} // 监听columns watch(props.columns, (val) => { initColumnsState() @@ -232,6 +235,7 @@ @select="selectClick" @row-click="rowClick" @sort-change="sortClick" + @cell-click="cellClick" > diff --git a/.vscode/settings.json b/.vscode/settings.json index 76b609d..e08940f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,10 +3,7 @@ "source.fixAll.eslint": "explicit", "source.fixAll.stylelint": "explicit" }, - "stylelint.validate": [ - "css", - "scss", - "vue" - ], - "editor.inlayHints.enabled": "off" + "stylelint.validate": ["css", "scss", "vue"], + "editor.inlayHints.enabled": "off", + "typescript.tsdk": "node_modules/typescript/lib" } diff --git a/src/api/laboratory/data.ts b/src/api/laboratory/data.ts index 3e64dd1..570f35a 100644 --- a/src/api/laboratory/data.ts +++ b/src/api/laboratory/data.ts @@ -32,3 +32,12 @@ responseType: 'blob', }) } + +// 查询ups监测详情 +export function getUpsMonitorDetail(data: { id: string }) { + return request({ + url: `${prefix}/ups/monitor/detail`, + method: 'post', + data, + }) +} diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index 77e6179..5fc1842 100644 --- a/src/components/NormalTable/index.vue +++ b/src/components/NormalTable/index.vue @@ -103,7 +103,7 @@ }, }, }) -const emit = defineEmits(['change', 'selectionChange', 'rowClick', 'multiSelect', 'sortChange']) +const emit = defineEmits(['cellClick', 'change', 'selectionChange', 'rowClick', 'multiSelect', 'sortChange']) // -------定义数据-------------- interface columnsCheckInfo { text: string @@ -159,6 +159,9 @@ function rowClick(row: object, column?: any, event?: any) { emit('rowClick', row) } +function cellClick(row: any, column: any, cell: any, event: any) { + emit('cellClick', row, column, cell, event) +} // 监听columns watch(props.columns, (val) => { initColumnsState() @@ -232,6 +235,7 @@ @select="selectClick" @row-click="rowClick" @sort-change="sortClick" + @cell-click="cellClick" > diff --git a/src/views/laboratory/data/dialog/upsMonitorDetailDialog.vue b/src/views/laboratory/data/dialog/upsMonitorDetailDialog.vue new file mode 100644 index 0000000..7d4fa50 --- /dev/null +++ b/src/views/laboratory/data/dialog/upsMonitorDetailDialog.vue @@ -0,0 +1,212 @@ + + + + + + + + + {{ item.name }} + + + + + + + + + + + + {{ scope.row[item.value] }} + {{ item.filter(scope.row) }} + + + + + + + + + + diff --git a/.vscode/settings.json b/.vscode/settings.json index 76b609d..e08940f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,10 +3,7 @@ "source.fixAll.eslint": "explicit", "source.fixAll.stylelint": "explicit" }, - "stylelint.validate": [ - "css", - "scss", - "vue" - ], - "editor.inlayHints.enabled": "off" + "stylelint.validate": ["css", "scss", "vue"], + "editor.inlayHints.enabled": "off", + "typescript.tsdk": "node_modules/typescript/lib" } diff --git a/src/api/laboratory/data.ts b/src/api/laboratory/data.ts index 3e64dd1..570f35a 100644 --- a/src/api/laboratory/data.ts +++ b/src/api/laboratory/data.ts @@ -32,3 +32,12 @@ responseType: 'blob', }) } + +// 查询ups监测详情 +export function getUpsMonitorDetail(data: { id: string }) { + return request({ + url: `${prefix}/ups/monitor/detail`, + method: 'post', + data, + }) +} diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index 77e6179..5fc1842 100644 --- a/src/components/NormalTable/index.vue +++ b/src/components/NormalTable/index.vue @@ -103,7 +103,7 @@ }, }, }) -const emit = defineEmits(['change', 'selectionChange', 'rowClick', 'multiSelect', 'sortChange']) +const emit = defineEmits(['cellClick', 'change', 'selectionChange', 'rowClick', 'multiSelect', 'sortChange']) // -------定义数据-------------- interface columnsCheckInfo { text: string @@ -159,6 +159,9 @@ function rowClick(row: object, column?: any, event?: any) { emit('rowClick', row) } +function cellClick(row: any, column: any, cell: any, event: any) { + emit('cellClick', row, column, cell, event) +} // 监听columns watch(props.columns, (val) => { initColumnsState() @@ -232,6 +235,7 @@ @select="selectClick" @row-click="rowClick" @sort-change="sortClick" + @cell-click="cellClick" > diff --git a/src/views/laboratory/data/dialog/upsMonitorDetailDialog.vue b/src/views/laboratory/data/dialog/upsMonitorDetailDialog.vue new file mode 100644 index 0000000..7d4fa50 --- /dev/null +++ b/src/views/laboratory/data/dialog/upsMonitorDetailDialog.vue @@ -0,0 +1,212 @@ + + + + + + + + + {{ item.name }} + + + + + + + + + + + + {{ scope.row[item.value] }} + {{ item.filter(scope.row) }} + + + + + + + + + + diff --git a/src/views/laboratory/data/list-interface.ts b/src/views/laboratory/data/list-interface.ts index 9ed8845..01f4f85 100644 --- a/src/views/laboratory/data/list-interface.ts +++ b/src/views/laboratory/data/list-interface.ts @@ -92,13 +92,20 @@ // 列表请求参数 export interface IListQuery { - deptId: string // 负责部门id(西昌组织下拉选择) - deviceName: string // 设备名称 - deviceNo: string // 设备编号 - uploadEndTime: string // 上传结束时间 - uploadStartTime: string // 上传开始时间 - userId: string // 负责人id(西昌组织下人员下拉选择) - labName: string // 所属实验室 + deptId: string // 负责部门id(西昌组织下拉选择) + deviceName: string // 设备名称 + deviceNo: string // 设备编号 + labName: string // 所属实验室 + startResistance: number | undefined // 起始内阻 + endResistance: number | undefined // 结束内阻 + startTemperature: number | undefined // 起始温度 + endTemperature: number | undefined // 结束温度 + startVoltage: number | undefined // 起始电压 + endVoltage: number | undefined // 结束电压 + uploadEndTime: string // 上传结束时间 + uploadStartTime: string // 上传开始时间 + userId: string // 负责人id(西昌组织下人员下拉选择) + status: string // ups监测列表状态 limit: number offset: number } diff --git a/.vscode/settings.json b/.vscode/settings.json index 76b609d..e08940f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,10 +3,7 @@ "source.fixAll.eslint": "explicit", "source.fixAll.stylelint": "explicit" }, - "stylelint.validate": [ - "css", - "scss", - "vue" - ], - "editor.inlayHints.enabled": "off" + "stylelint.validate": ["css", "scss", "vue"], + "editor.inlayHints.enabled": "off", + "typescript.tsdk": "node_modules/typescript/lib" } diff --git a/src/api/laboratory/data.ts b/src/api/laboratory/data.ts index 3e64dd1..570f35a 100644 --- a/src/api/laboratory/data.ts +++ b/src/api/laboratory/data.ts @@ -32,3 +32,12 @@ responseType: 'blob', }) } + +// 查询ups监测详情 +export function getUpsMonitorDetail(data: { id: string }) { + return request({ + url: `${prefix}/ups/monitor/detail`, + method: 'post', + data, + }) +} diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index 77e6179..5fc1842 100644 --- a/src/components/NormalTable/index.vue +++ b/src/components/NormalTable/index.vue @@ -103,7 +103,7 @@ }, }, }) -const emit = defineEmits(['change', 'selectionChange', 'rowClick', 'multiSelect', 'sortChange']) +const emit = defineEmits(['cellClick', 'change', 'selectionChange', 'rowClick', 'multiSelect', 'sortChange']) // -------定义数据-------------- interface columnsCheckInfo { text: string @@ -159,6 +159,9 @@ function rowClick(row: object, column?: any, event?: any) { emit('rowClick', row) } +function cellClick(row: any, column: any, cell: any, event: any) { + emit('cellClick', row, column, cell, event) +} // 监听columns watch(props.columns, (val) => { initColumnsState() @@ -232,6 +235,7 @@ @select="selectClick" @row-click="rowClick" @sort-change="sortClick" + @cell-click="cellClick" > diff --git a/src/views/laboratory/data/dialog/upsMonitorDetailDialog.vue b/src/views/laboratory/data/dialog/upsMonitorDetailDialog.vue new file mode 100644 index 0000000..7d4fa50 --- /dev/null +++ b/src/views/laboratory/data/dialog/upsMonitorDetailDialog.vue @@ -0,0 +1,212 @@ + + + + + + + + + {{ item.name }} + + + + + + + + + + + + {{ scope.row[item.value] }} + {{ item.filter(scope.row) }} + + + + + + + + + + diff --git a/src/views/laboratory/data/list-interface.ts b/src/views/laboratory/data/list-interface.ts index 9ed8845..01f4f85 100644 --- a/src/views/laboratory/data/list-interface.ts +++ b/src/views/laboratory/data/list-interface.ts @@ -92,13 +92,20 @@ // 列表请求参数 export interface IListQuery { - deptId: string // 负责部门id(西昌组织下拉选择) - deviceName: string // 设备名称 - deviceNo: string // 设备编号 - uploadEndTime: string // 上传结束时间 - uploadStartTime: string // 上传开始时间 - userId: string // 负责人id(西昌组织下人员下拉选择) - labName: string // 所属实验室 + deptId: string // 负责部门id(西昌组织下拉选择) + deviceName: string // 设备名称 + deviceNo: string // 设备编号 + labName: string // 所属实验室 + startResistance: number | undefined // 起始内阻 + endResistance: number | undefined // 结束内阻 + startTemperature: number | undefined // 起始温度 + endTemperature: number | undefined // 结束温度 + startVoltage: number | undefined // 起始电压 + endVoltage: number | undefined // 结束电压 + uploadEndTime: string // 上传结束时间 + uploadStartTime: string // 上传开始时间 + userId: string // 负责人id(西昌组织下人员下拉选择) + status: string // ups监测列表状态 limit: number offset: number } diff --git a/src/views/laboratory/data/list.vue b/src/views/laboratory/data/list.vue index 8db5f6e..31818ec 100644 --- a/src/views/laboratory/data/list.vue +++ b/src/views/laboratory/data/list.vue @@ -11,6 +11,7 @@ ITemperatureHumidityList, IUPSList, } from './list-interface' +import upsMonitorDetailDialog from './dialog/upsMonitorDetailDialog.vue' import type { TableColumn } from '@/components/NormalTable/table_interface' import { exportFile } from '@/utils/exportUtils' import useTemplateDownload from '@/utils/useTemplateDownload' @@ -109,10 +110,10 @@ { text: '负责部门', value: 'deptName', align: 'center' }, { text: '负责人', value: 'userName', align: 'center' }, { text: '安装地点', value: 'locationName', align: 'center' }, - { text: '所属实验室', value: 'labName', align: 'center' }, - { text: '电压(V)', value: 'labName', align: 'center' }, - { text: '内阻(mΩ)', value: 'labName', align: 'center' }, - { text: '温度(℃)', value: 'labName', align: 'center' }, + { text: '所属实验室', value: 'labName', align: 'center', width: '120' }, + { text: '电压(V)', value: 'voltage', align: 'center' }, + { text: '内阻(mΩ)', value: 'resistance', align: 'center' }, + { text: '温度(℃)', value: 'temperature', align: 'center' }, { text: '状态', value: 'deviceStatusName', align: 'center', styleFilter: (row: IUPSList) => { return `${row.deviceStatus}` === '0' ? 'color: red' : `${row.deviceStatus}` === '1' ? 'color: #00a846' : '' } }, { text: '上传时间', value: 'uploadTime', align: 'center', width: '180' }, ]), @@ -127,7 +128,7 @@ { text: '负责部门', value: 'deptName', align: 'center' }, { text: '负责人', value: 'userName', align: 'center' }, { text: '安装地点', value: 'locationName', align: 'center' }, - { text: '所属实验室', value: 'labName', align: 'center' }, + { text: '所属实验室', value: 'labName', align: 'center', width: '120' }, { text: '参数', value: 'params', align: 'center', width: '160' }, { text: '状态', value: 'upsMonitorDeviceStatusName', align: 'center', styleFilter: (row: IUPSList) => { return `${row.status}` === '1' ? 'color: red' : `${row.status}` === '0' ? 'color: #00a846' : '' } }, { text: '上传时间', value: 'uploadTime', align: 'center', width: '180' }, @@ -141,13 +142,20 @@ // 查询条件 const listQuery: Ref = ref({ - deptId: '', // 负责部门id(西昌组织下拉选择) - deviceName: '', // 设备名称 - deviceNo: '', // 设备编号 - uploadEndTime: '', // 上传结束时间 - uploadStartTime: '', // 上传开始时间 - labName: user.lab, // 所属实验室 - userId: '', // 负责人id(西昌组织下人员下拉选择) + deptId: '', // 负责部门id(西昌组织下拉选择) + deviceName: '', // 设备名称 + deviceNo: '', // 设备编号 + labName: user.lab, // 所属实验室 + startResistance: undefined, // 起始内阻 + endResistance: undefined, // 结束内阻 + startTemperature: undefined, // 起始温度 + endTemperature: undefined, // 结束温度 + startVoltage: undefined, // 起始电压 + endVoltage: undefined, // 结束电压 + uploadEndTime: '', // 上传结束时间 + uploadStartTime: '', // 上传开始时间 + userId: '', // 负责人id(西昌组织下人员下拉选择) + status: '', // 状态 limit: 20, offset: 1, }) @@ -206,13 +214,13 @@ listQuery.value.offset = 1 } getDataList(listQuery.value, currentMenu.value).then((response) => { - menu.value[currentIndex.value].list = response.data.rows.map((item: { deviceStatus: string; status: string }) => { + menu.value[currentIndex.value].list = response.data.rows.map((item: { deviceStatus: string; status: string; labName: string; resistance: string | number }) => { return { ...item, deviceStatusName: `${item.deviceStatus}` === '1' ? '在线' : `${item.deviceStatus}` === '0' ? '离线' : '未知', upsMonitorDeviceStatusName: `${item.status}` === '0' ? '正常' : `${item.status}` === '1' ? '异常' : '未知', params: '电池电压、电池电流...', - labName: listQuery.value.labName, // 所属实验室 + resistance: item.labName === '海口实验室' ? '/' : item.resistance, } }) total.value = parseInt(response.data.total) @@ -222,13 +230,20 @@ // 清除条件 function clearList() { listQuery.value = { - deptId: '', // 负责部门id(西昌组织下拉选择) - deviceName: '', // 设备名称 - deviceNo: '', // 设备编号 - uploadEndTime: '', // 上传结束时间 - uploadStartTime: '', // 上传开始时间 - labName: user.lab, // 所属实验室 - userId: '', // 负责人id(西昌组织下人员下拉选择) + deptId: '', // 负责部门id(西昌组织下拉选择) + deviceName: '', // 设备名称 + deviceNo: '', // 设备编号 + labName: user.lab, // 所属实验室 + startResistance: undefined, // 起始内阻 + endResistance: undefined, // 结束内阻 + startTemperature: undefined, // 起始温度 + endTemperature: undefined, // 结束温度 + startVoltage: undefined, // 起始电压 + endVoltage: undefined, // 结束电压 + uploadEndTime: '', // 上传结束时间 + uploadStartTime: '', // 上传开始时间 + userId: '', // 负责人id(西昌组织下人员下拉选择) + status: '', // 状态 limit: 20, offset: 1, } @@ -260,13 +275,20 @@ }) if (menu.value[currentIndex.value].list.length > 0) { const params = { - deptId: listQuery.value.deptId, // 负责部门id(西昌组织下拉选择) - deviceName: listQuery.value.deviceName, // 设备名称 - deviceNo: listQuery.value.deviceNo, // 设备编号 - uploadEndTime: listQuery.value.uploadEndTime, // 上传结束时间 - uploadStartTime: listQuery.value.uploadStartTime, // 上传开始时间 - userId: listQuery.value.userId, // 负责人id(西昌组织下人员下拉选择) - labName: listQuery.value.labName, // 所属实验室 + deptId: listQuery.value.deptId, // 负责部门id(西昌组织下拉选择) + deviceName: listQuery.value.deviceName, // 设备名称 + deviceNo: listQuery.value.deviceNo, // 设备编号 + labName: listQuery.value.labName, // 所属实验室 + startResistance: listQuery.value.startResistance, // 起始内阻 + endResistance: listQuery.value.endResistance, // 结束内阻 + startTemperature: listQuery.value.startTemperature, // 起始温度 + endTemperature: listQuery.value.endTemperature, // 结束温度 + startVoltage: listQuery.value.startVoltage, // 起始电压 + endVoltage: listQuery.value.endVoltage, // 结束电压 + uploadEndTime: listQuery.value.uploadEndTime, // 上传结束时间 + uploadStartTime: listQuery.value.uploadStartTime, // 上传开始时间 + userId: listQuery.value.userId, // 负责人id(西昌组织下人员下拉选择) + status: listQuery.value.status, // ups监测列表状态 offset: 1, limit: 20, ids: checkoutList.value, @@ -283,6 +305,19 @@ } } +// ---------------------------------ups检测详情------------------------------------------------ +const upsMonitorDetailDialogRef = ref() // ups检测详情组件ref +// 点击详情 +const checkDetail = (id: string) => { + upsMonitorDetailDialogRef.value.initDialog(id) +} + +// 点击列表单元格 +const cellClick = (row: any, column: any) => { + if (column.property === 'params' && row.id) { + upsMonitorDetailDialogRef.value.initDialog(row.id) + } +} // ---------------------------------------钩子---------------------------------------------- watch(dateRange, (val) => { if (val) { @@ -344,13 +379,22 @@ - + - + - + + + + + + + + + + - + @@ -390,17 +434,39 @@ is-showmulti-select @change="changePage" @multi-select="handleSelectionChange" + @cell-click="cellClick" > - + {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }} + + + + + 详情 + + + + + +