diff --git a/src/views/AlarmInformation/index.vue b/src/views/AlarmInformation/index.vue index 74c7393..d07929d 100644 --- a/src/views/AlarmInformation/index.vue +++ b/src/views/AlarmInformation/index.vue @@ -31,7 +31,7 @@ 批量删除 - + @@ -53,7 +53,7 @@ --> - + @@ -103,19 +103,25 @@ const commit_uid = sessionStorage.getItem('central_control_comm_uid') const loading = ref(false) const total = ref(0) -const pageSize = ref(8) +const pageSize = ref(6) const currentPage = ref(1) -const handleSizeChange = () => { +const tableData = ref([]) +const showTableData = ref([]) + +const applyPageData = () => { + const start = (currentPage.value - 1) * pageSize.value + showTableData.value = tableData.value.slice(start, start + pageSize.value) +} + +const handleSizeChange = (size) => { + pageSize.value = size currentPage.value = 1 - // getData() + applyPageData() } const handleCurrentChange = () => { - // getData() - showTableData.value = tableData.value.slice((currentPage.value - 1) * 8, (currentPage.value - 1) * 8 + 8) + applyPageData() } -const tableData = ref([]) - const multipleTableRef = ref(null) const multipleSelection = ref([]) const selectable = (row) => true @@ -167,8 +173,6 @@ const handleDeal = () => { }) } -const showTableData = ref([]) - const getData = () => { currentPage.value = 1 const params = { @@ -190,9 +194,10 @@ const getData = () => { loading.value = true tableData.value = [] RPC.post('/m9z/fault/list', params).then(res => { - total.value = res.rows.length || 0 - tableData.value = res.rows || [] - showTableData.value = tableData.value.slice(0, 8) + const rows = res?.rows || [] + total.value = rows.length + tableData.value = rows + applyPageData() }).finally(() => { loading.value = false }) @@ -267,7 +272,7 @@ onUnmounted(() => { height: 100vh; box-sizing: border-box; position: relative; - overflow: auto; + overflow: hidden; background: center / cover url('@/assets/images/背景小@2x.png') no-repeat; background-color: #0A3933; } @@ -276,15 +281,19 @@ onUnmounted(() => { position: relative; z-index: 2; width: 100%; - height: 100%; + height: calc(100vh - 50px); padding: 10px 20px; box-sizing: border-box; + display: flex; + flex-direction: column; + overflow: hidden; } .header-status { display: flex; justify-content: space-between; align-items: center; + flex-shrink: 0; margin-bottom: 20px; color: rgba(255, 255, 255, 0.9); } @@ -312,11 +321,13 @@ onUnmounted(() => { .control-content { width: 100%; + flex: 1; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; gap: 10px; + overflow: hidden; :deep(.el-table__header) { .el-table__cell { diff --git a/src/views/Monitoring/index.vue b/src/views/Monitoring/index.vue index 9c42735..fa4394d 100644 --- a/src/views/Monitoring/index.vue +++ b/src/views/Monitoring/index.vue @@ -99,40 +99,11 @@
当前无故障
- -
-
+
+
- 直流回路{{ index + 1 }}:{{ circuit.is_open ? '打开' : '关闭' }} + 直流回路{{ loopNo(circuit, index) }}:{{ circuit.is_open ? '打开' : '关闭' }}
- -
-
-
电压: {{ circuit.V ? circuit.V?.toFixed(2) : 0 }}V
-
电流: {{ circuit.A ? circuit.A?.toFixed(2) : 0 }}A
-
-
-
功率: {{ circuit.Kw ? circuit.Kw?.toFixed(3) : 0 }}kW
-
-
-
-
- - -
-
-
- 直流回路{{ index + 6 }}:{{ circuit.is_open ? '打开' : '关闭' }} -
-
电压: {{ circuit.V ? circuit.V?.toFixed(2) : 0 }}V
@@ -146,20 +117,9 @@
- -
-
-
调光通道{{ index + 1 }}
-
- {{ channel.pwm }}% -
-
-
- - -
-
-
调光通道{{ index + 6 }}
+
+
+
调光通道{{ loopNo(channel, index) }}
{{ channel.pwm }}%
@@ -406,6 +366,15 @@ const scanDeviceCount = computed(() => { return info.value?.scan_device_count ?? info.value?.ScanDeviceCount ?? info.value?.Loops?.length ?? 0 }) +const monitorLoops = computed(() => { + return info.value?.Loops || [] +}) + +const loopNo = (loop, index) => { + const loopIndex = loop?.index ?? loop?.Index + return Number.isInteger(loopIndex) ? loopIndex + 1 : index + 1 +} + const currentFaults = computed(() => { const loops = info.value?.Loops || [] return loops.flatMap((loop, index) => { @@ -701,7 +670,7 @@ onUnmounted(() => { flex-direction: column; // justify-content: space-between; /* width: 500px; */ - gap: 20px; + gap: 12px; height: 100%; overflow-y: auto; } @@ -844,12 +813,13 @@ onUnmounted(() => { .circuit-section { display: flex; flex-direction: column; - gap: 10px; + gap: 8px; } -.circuit-row { - display: flex; - justify-content: space-between; +.circuit-grid { + display: grid; + grid-template-columns: repeat(5, minmax(0, 1fr)); + gap: 8px; font-size: 12px; .circuitStatus { @@ -859,12 +829,11 @@ onUnmounted(() => { .line { width: 100%; display: flex; - margin-top: 10px; - display: flex; + margin-top: 6px; justify-content: space-between; .line_item { - width: 45%; + width: 48%; // flex: 1; flex-shrink: 0; display: flex; @@ -879,14 +848,14 @@ onUnmounted(() => { flex-direction: column; align-items: center; // gap: 10px; - width: 18%; + min-width: 0; } .circuit-status { background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 8px; - padding: 8px 12px; + padding: 6px 8px; color: rgba(255, 255, 255, 0.7); text-align: center; width: 100%; @@ -928,21 +897,22 @@ onUnmounted(() => { .dimming-section { display: flex; flex-direction: column; - gap: 10px; + gap: 8px; font-size: 12px; } -.dimming-row { - display: flex; - justify-content: space-between; +.dimming-grid { + display: grid; + grid-template-columns: repeat(5, minmax(0, 1fr)); + gap: 8px; } .dimming-item { display: flex; flex-direction: column; align-items: center; - gap: 10px; - width: 18%; + gap: 8px; + min-width: 0; } .channel-label {