소스 검색

+ 设备告警

chen.cheng 11 달 전
부모
커밋
6b1e81ada6
3개의 변경된 파일96개의 추가작업 그리고 18개의 파일을 삭제
  1. 0 0
      ems-ui/src/components/Block/BlockTable/index.scss
  2. 4 15
      ems-ui/src/components/Block/BlockTable/index.vue
  3. 92 3
      ems-ui/src/views/analysis/device/warn.vue

+ 0 - 0
ems-ui/src/components/Block/table/index.scss → ems-ui/src/components/Block/BlockTable/index.scss


+ 4 - 15
ems-ui/src/components/Block/table/index.vue → ems-ui/src/components/Block/BlockTable/index.vue

@@ -2,22 +2,10 @@
   <block :title="title" :on-resize="onResize">
     <template v-slot:main>
       <el-table
+          :style="{width: '95%'  }"
           :data="tableData"
           style="width: 100%">
-        <el-table-column
-            prop="date"
-            label="日期"
-            width="180">
-        </el-table-column>
-        <el-table-column
-            prop="name"
-            label="姓名"
-            width="180">
-        </el-table-column>
-        <el-table-column
-            prop="address"
-            label="地址">
-        </el-table-column>
+        <slot name="columns"></slot>
       </el-table>
     </template>
   </block>
@@ -29,6 +17,7 @@
 import Block from '@/components/Block/block.vue';
 
 export default {
+  name: 'BlockTable',
   components: { Block },
   props: {
     title: {
@@ -42,7 +31,7 @@ export default {
         };
       },
     },
-    ds: {
+    tableData: {
       type: Array,
       default: [],
     },

+ 92 - 3
ems-ui/src/views/analysis/device/warn.vue

@@ -29,10 +29,72 @@
     </el-row>
     <el-row type="flex" :gutter="20" style="margin-top: 20px">
       <el-col :span="12">
-        <PieChartBlock title="供应商占比" :opt-cfg="supplyerIndex"></PieChartBlock>
+        <BlockTable title="实时告警" :table-data="realTimeTableData">
+          <template v-slot:columns>
+            <el-table-column
+                type="index"
+                label="序号"
+                align="center"
+            />
+            <el-table-column
+                prop="subSystem"
+                label="子系统"
+                align="center"
+            />
+            <el-table-column
+                prop="devcName"
+                label="设备名称"
+                align="center"
+            />
+            <el-table-column
+                prop="warnDes"
+                label="描述"
+                align="center"
+            />
+            <el-table-column
+                label="操作"
+                align="center"
+            >
+              <template v-slot:default="scope">
+                <el-button
+                    type="text"
+                    size="mini"
+
+                    @click="handleEdit(scope.row)"
+                >
+                  待确认
+                </el-button>
+              </template>
+            </el-table-column>
+          </template>
+        </BlockTable>
       </el-col>
       <el-col :span="12">
-        <LineChartBlock title="故障发生情况" :opt-cfg="devcFault" />
+        <BlockTable title="告警统计" :table-data="alarmTableData">
+          <template v-slot:columns>
+            <el-table-column
+                type="index"
+                label="序号"
+                align="center"
+            />
+            <el-table-column
+                prop="warnType"
+                label="告警部位"
+                align="center"
+            />
+            <el-table-column
+                prop="warnFacsType"
+                label="告警能源类型"
+                align="center"
+            />
+            <el-table-column
+                prop="date"
+                label="日期"
+                align="center"
+            />
+
+          </template>
+        </BlockTable>
       </el-col>
     </el-row>
   </div>
@@ -43,6 +105,7 @@
 import { ApiCode } from '@/api/apiEmums';
 import { get } from '@/api/commonApi';
 import Block from '@/components/Block/block.vue';
+import BlockTable from '@/components/Block/BlockTable/index.vue';
 import BarChartBlock from '@/components/Block/charts/BarChartBlock.vue';
 import PieChartBlock from '@/components/Block/charts/PieChartBlock.vue';
 import { DateTool } from '@/utils/DateTool';
@@ -53,6 +116,7 @@ import SwitchTag from '../../../components/SwitchTag/index.vue';
 
 export default {
   components: {
+    BlockTable,
     DeviceWaring,
     Block,
     BarChartBlock,
@@ -93,7 +157,32 @@ export default {
             data: [20, 182, 131, 144, 130, 140, 90],
           }
         ]
-      }
+      },
+
+      alarmTableData: [
+        {
+          warnType: '研发部照明',
+          warnFacsType: '电',
+          date: '2024年6月1日 12:00:00',
+        },
+        {
+          warnType: '研发部照明',
+          warnFacsType: '电',
+          date: '2024年6月1日 12:00:00',
+        },
+      ],
+      realTimeTableData: [
+        {
+          subSystem: '安防',
+          devcName: '东围墙50',
+          warnDes: '设备故障',
+        },
+        {
+          subSystem: '安防',
+          devcName: '东围墙50',
+          warnDes: '设备故障',
+        },
+      ],
     };
   },
   mounted() {