Переглянути джерело

若干页面细小BUG修复

Koishi 1 рік тому
батько
коміт
eb96fbb8cc

+ 1 - 1
README.md

@@ -12,7 +12,7 @@
         - 无
 - 状态检修
     - 原始报警分析
-        - 替换了部分字段、修改了部分BUG。
+        - 替换了部分字段、修改了部分BUG,表格新增列排序功能,点击对应的列将会以次数为基准进行升序或者降序排序
 - 预警配置
     - 自定义预警
         - 无

+ 1 - 0
src/api/api.js

@@ -813,6 +813,7 @@ export const getAlarmConfig = () => {
 export const confirmAlart = (data) => {
     return request({
         method: "post",
+        baseURL,
         url: "/alarm/history/updateAlarms",
         data,
         timeout: 60000

+ 2 - 1
src/components/alarmPopupa/index.vue

@@ -6,7 +6,7 @@
       :key="index"
     >
       <template v-if="index < 6">
-        <div class="alarmTitle">{{ item.alarmName }}</div>
+        <div class="alarmTitle">{{ item.wpName }}&nbsp;{{ item.code }}</div>
         <div class="alarmContent">
           <div class="contentItem" @click="goToAlertDescPage(item)">
             报警描述:
@@ -271,6 +271,7 @@ export default {
               resolvent: alarmItem.resolvent,
               characteristic: alarmItem.characteristic,
               code: alarmItem.code,
+              wpName: alarmItem.wpName,
             };
             if (
               configItem.isAlarmSound ||

+ 1 - 1
src/pages/alarmConfig/bj_windturbine/windturbine_components.vue

@@ -229,7 +229,7 @@ export default {
         stationId: [
           {
             required: true,
-            message: "制造商不可为空",
+            message: "场站不可为空",
             trigger: "change",
           },
         ],

+ 20 - 1
src/pages/baseData/FanDataStatisticTable.vue

@@ -117,6 +117,12 @@
           :key="index"
           header-align="center"
           show-overflow-tooltip
+          sortable
+          :sort-method="
+            (a, b) => {
+              return thSort(a, b, item);
+            }
+          "
         >
           <template #default="{ row }">
             <div class="bar">
@@ -318,11 +324,12 @@ function getTableList() {
     stationid: state.changZhan || "",
     begin: state.starttime,
     end: state.endtime,
-    timeType: "s",
+    timeType: "m",
     components: state.components,
     modelId: state.modelId,
     alarmIds: state.alarmIds,
   }).then((res) => {
+    console.log(11111, res);
     if (res.length) {
       let tableData = [];
       let tHeard = [];
@@ -346,6 +353,8 @@ function getTableList() {
             }
             wtItem[`${cEle.alarmid}_count`] = cEle.count;
             wtItem[`${cEle.alarmid}_time`] = cEle.time;
+            // wtItem[`${cEle.alarmid}_count`] = getRandomInt(1, 1000);
+            // wtItem[`${cEle.alarmid}_time`] = getRandomInt(1, 1000);
             wtItem["wtname"] = cEle.windturbineCode;
           });
           tableData.push(wtItem);
@@ -360,6 +369,16 @@ function getTableList() {
   });
 }
 
+const getRandomInt = function (min, max) {
+  min = Math.ceil(min);
+  max = Math.floor(max);
+  return Math.floor(Math.random() * (max - min + 1)) + min;
+};
+
+const thSort = function (a, b, item) {
+  return a[`${item.code}_count`] - b[`${item.code}_count`];
+};
+
 //     // 单元格点击事件
 //     handle(row, column, event, cell) {
 //       let parts =

+ 7 - 2
src/pages/safe/historywaring.vue

@@ -302,7 +302,9 @@ watch(
     state.deviceId = route.params.deviceId || "";
     state.alarmId = route.params.alarmId || "";
     nextTick(async () => {
-      await getAlarmHistoryt();
+      if (route.params.deviceId && route.params.alarmId) {
+        await getAlarmHistoryt();
+      }
     });
   },
   {
@@ -353,12 +355,15 @@ const query = reactive({
 
 // 获取历史记录表
 const getAlarmHistoryt = async () => {
+  if (route.params.deviceId && route.params.alarmId) {
+    state.stationId = "";
+  }
   let params = {
     pageNum: query.page,
     pageSize: query.limit,
     alarmId: state.alarmId,
     alarmType: state.typeVal,
-    // stationid: state.stationId,
+    stationid: state.stationId,
     deviceid:
       state.deviceId ||
       (state.typeVal == "booststation" ? "" : state.windturbineId),

+ 46 - 9
src/pages/safe/safecomponent.vue

@@ -21,23 +21,47 @@
         width="150"
         show-overflow-tooltip
       />
-      <el-table-column prop="lvName" label="报警等级" show-overflow-tooltip />
+      <el-table-column label="报警等级" show-overflow-tooltip>
+        <template #default="scope">
+          <el-tag
+            class="ml-2"
+            :type="
+              scope.row.lv === 5
+                ? 'danger'
+                : scope.row.lv === 4
+                ? 'warning'
+                : 'info'
+            "
+            >{{ scope.row.lvName }}</el-tag
+          >
+        </template>
+      </el-table-column>
       <el-table-column
         prop="description"
         label="报警描述"
         show-overflow-tooltip
       />
       <el-table-column
-        prop="isCloseName"
         label="是否解除"
         show-overflow-tooltip
-      />
+      >
+        <template #default="scope">
+          <span
+            :style="`color:${
+              scope.row.isClose
+                ? 'var(--el-color-success)'
+                : 'var(--el-color-danger)'
+            }`"
+            >{{ scope.row.isCloseName }}</span
+          >
+        </template>
+      </el-table-column>
     </el-table>
     <el-dialog
       v-model="showDialog"
       :title="title"
       top="50px"
-      width="75%"
+      width="90%"
       modal-class="alarmDialog"
       :show-close="false"
       draggable
@@ -55,6 +79,12 @@
           border
         >
           <el-table-column
+            prop="wpName"
+            label="场站"
+            width="150"
+            show-overflow-tooltip
+          />
+          <el-table-column
             prop="tsName"
             label="报警时间"
             width="150"
@@ -75,11 +105,18 @@
               >
             </template>
           </el-table-column>
-          <el-table-column
-            prop="isCloseName"
-            label="报警是否解除"
-            show-overflow-tooltip
-          />
+          <el-table-column label="报警是否解除" show-overflow-tooltip>
+            <template #default="scope">
+              <span
+                :style="`color:${
+                  scope.row.isClose
+                    ? 'var(--el-color-success)'
+                    : 'var(--el-color-danger)'
+                }`"
+                >{{ scope.row.isCloseName }}</span
+              >
+            </template>
+          </el-table-column>
           <el-table-column
             prop="faultCause"
             label="报警故障原因"