Bläddra i källkod

[Feat 0000] 测风装置页面bug修改

bobo04052021@163.com 1 dag sedan
förälder
incheckning
23aea248ad

+ 2 - 2
src/views/vent/deviceManager/comment/warningTabel/warning.data.ts

@@ -50,9 +50,9 @@ export const levelColumns: BasicColumn[] = [
     title: '报警类型',
     width: 180,
     editRow: true,
-    dataIndex: 'alarmType',
+    dataIndex: 'alarm_type',
     editComponent: 'ApiSelect',
-    editComponentProps: { api: initDictOptions.bind(null, 'alarmType') },
+    editComponentProps: { api: initDictOptions.bind(null, 'alarm_type') },
   },
   {
     title: '是否语音播报',

+ 11 - 20
src/views/vent/monitorManager/comment/AlarmNumTable.vue

@@ -1,20 +1,8 @@
 <template>
   <div class="alarm-history-table">
-    <BasicTable ref="alarmHistory" @register="registerTable" :data-source="dataSource">
-      <template #bodyCell="{ column, record }">
-        <a-tag v-if="column.dataIndex === 'warnFlag'" :color="record.warnFlag == '0' ? 'green' : 'red'">{{
-          record.warnFlag == '0' ? '正常' : '报警'
-        }}</a-tag>
-        <a-tag v-if="column.dataIndex === 'netStatus'" :color="record.netStatus == '0' ? '#f00' : 'green'">{{
-          record.netStatus == '0' ? '断开' : '连接'
-        }}</a-tag>
-        <template v-if="column.dataIndex === 'nwartype'">
-          <!-- 除了 101(蓝色预警)其他都是红色字体 -->
-          <span :class="{ 'color-#ff3823': ['102', '103', '104', '201', '1001'].includes(record.nwartype) }">
-            {{ render.renderDictText(record.nwartype, 'leveltype') || '-' }}
-          </span>
-        </template>
-        <slot name="filterCell" v-bind="{ column, record }"></slot>
+    <BasicTable ref="historyTable" @register="registerTable" :data-source="dataSource">
+      <template #form-submitBefore>
+        <a-button type="primary" preIcon="ant-design:search-outlined" @click="getDeviceList">查询</a-button>
       </template>
     </BasicTable>
   </div>
@@ -28,6 +16,7 @@ import { useListPage } from '/@/hooks/system/useListPage';
 import { getTableHeaderColumns } from '/@/hooks/web/useWebColumns';
 import { defHttp } from '/@/utils/http/axios';
 import dayjs from 'dayjs';
+import { render } from '/@/utils/common/renderUtils';
 import { getAutoScrollContainer } from '/@/utils/common/compUtils';
 import { usePermission } from '/@/hooks/web/usePermission';
 
@@ -100,6 +89,7 @@ watch(
     return props.columnsType;
   },
   async (newVal) => {
+    console.log(props.columnsType, 'asdasdadas');
     if (!newVal) return;
     const column = getTableHeaderColumns(props.deviceType + '_alarmNum');
     columns.value = column;
@@ -135,7 +125,7 @@ const { tableContext } = useListPage({
     columns: props.columnsType ? columns : (props.columns as any[]),
     canResize: true,
     showTableSetting: false,
-    showActionColumn: !hasPermission('ventanalyAlarmAnalysis:noShow'),
+    showActionColumn: false,
     bordered: false,
     size: 'small',
     scroll: tableScroll,
@@ -143,7 +133,8 @@ const { tableContext } = useListPage({
     formConfig: {
       labelAlign: 'left',
       showAdvancedButton: false,
-      // autoAdvancedCol: 2,
+      showSubmitButton: false,
+      showResetButton: false,
       schemas: [
         {
           field: 'createTime_begin',
@@ -178,9 +169,9 @@ const { tableContext } = useListPage({
       ],
       // fieldMapToTime: [['createTime', ['createTime_begin', 'createTime_end'], '']],
     },
-    // fetchSetting: {
-    //   listField: 'records',
-    // },
+    fetchSetting: {
+      listField: 'records',
+    },
     pagination: {
       current: 1,
       pageSize: 10,

+ 19 - 9
src/views/vent/monitorManager/windrectMonitor/index.vue

@@ -113,9 +113,9 @@
           <a-tab-pane v-if="hasPermission('windrect:result')" key="6" tab="测风结果">
             <ResultTable v-if="activeKey === '6'" deviceType="windrect_list" :scroll="scroll" />
           </a-tab-pane>
-          <a-tab-pane key="7" tab="报警次数统计">
+          <a-tab-pane v-if="sysOrgCode != 'xjttzhqmk'" key="7" tab="报警次数统计">
             <div class="tab-item" v-if="activeKey === '7'">
-              <AlarmNumTable columns-type="alarm" :device-type="deviceType" designScope="alarm-history" :scroll="280" />
+              <AlarmNumTable columns-type="alarmNum" :device-type="deviceType" designScope="alarm-history" :scroll="280" />
             </div>
           </a-tab-pane>
         </a-tabs>
@@ -175,10 +175,12 @@ import { useRouter } from 'vue-router';
 import { useModal } from '/@/components/Modal';
 import { useCamera } from '/@/hooks/system/useCamera';
 import { usePermission } from '/@/hooks/web/usePermission';
+import { useGlobSetting } from '/@/hooks/setting';
 const { hasPermission } = usePermission();
 
 const globalConfig = inject('globalConfig');
 
+const { sysOrgCode } = useGlobSetting();
 const { currentRoute } = useRouter();
 
 const MonitorDataTable = ref();
@@ -252,16 +254,24 @@ function getMonitor(flag?) {
             // dataSource.value = res.msgTxt[0].datalist || [];
             const getData = res.msgTxt[0].datalist || [];
             getData.forEach((data) => {
-              if (data.limits.m3 && data.limits.m3.limitlevels) {
-                data.limits.m3.limitlevels.forEach((item) => {
-                  if (item.alarmType) {
-                    // 拼接字段名并存入readData
-                    data.readData[`${item.alarmType}_fmin`] = item.fmin;
-                    data.readData[`${item.alarmType}_fmax`] = item.fmax;
+              if (data.limits) {
+                const limitsKeys = Object.keys(data.limits);
+                limitsKeys.forEach((limitKey) => {
+                  const limit = data.limits[limitKey];
+                  if (limit && Array.isArray(limit.limitlevels)) {
+                    // 确保 data.readData 已初始化
+                    data.readData = data.readData || {};
+                    limit.limitlevels.forEach((item) => {
+                      if (item && item.alarmType) {
+                        // 拼接字段名并存入readData
+                        data.readData[`${item.alarmType}_fmin`] = item.fmin;
+                        data.readData[`${item.alarmType}_fmax`] = item.fmax;
+                      }
+                    });
                   }
                 });
+                return data;
               }
-              return data;
             });
             dataSource.value = getData;
             if (dataSource.value.length > 0) {