Explorar el Código

[Style 0000] 全系页面样式统一及优化

ruienger hace 3 meses
padre
commit
b9b4ff52a9

+ 20 - 17
src/views/analysis/warningAnalysis/airLeakStatus/airLeakStatus.data.ts

@@ -1,5 +1,6 @@
 import { BasicColumn } from '/@/components/Table';
 import { FormSchema } from '/@/components/Table';
+import { alarmCellRender } from '/@/views/monitor/sealedMonitor/monitor.data';
 // 实时数据相关
 export const columns: BasicColumn[] = [
   {
@@ -47,30 +48,32 @@ export const columns: BasicColumn[] = [
     title: '是否漏风',
     dataIndex: 'alarmName',
     width: 100,
-    customRender: ({ text }) => {
+    customRender: ({ record }) => {
+      return alarmCellRender(record, (r) => r.alarmName.split('-')[0]);
       // 解构获取字符串值
-      if (typeof text !== 'string') {
-        return '-';
-      }
-      if (!text.includes('-')) {
-        return text;
-      }
-      return text.split('-')[0];
+      // if (typeof text !== 'string') {
+      //   return '-';
+      // }
+      // if (!text.includes('-')) {
+      //   return text;
+      // }
+      // return text.split('-')[0];
     },
   },
   {
     title: '风险分析',
     dataIndex: 'alarmName',
     width: 100,
-    customRender: ({ text }) => {
-      if (typeof text !== 'string') {
-        return '-';
-      }
-      if (!text.includes('-')) {
-        return text;
-      }
-      const parts = text.split('-');
-      return parts.slice(1).join('-');
+    customRender: ({ record }) => {
+      return alarmCellRender(record, (r) => r.alarmName.split('-')[1]);
+      // if (typeof text !== 'string') {
+      //   return '-';
+      // }
+      // if (!text.includes('-')) {
+      //   return text;
+      // }
+      // const parts = text.split('-');
+      // return parts.slice(1).join('-');
     },
   },
   {

+ 7 - 5
src/views/analysis/warningAnalysis/autoFireAnalysis/autoFireAnalysis.data.ts

@@ -1,5 +1,6 @@
 import { BasicColumn } from '/@/components/Table';
 import { FormSchema } from '/@/components/Table';
+import { alarmCellRender } from '/@/views/monitor/sealedMonitor/monitor.data';
 
 export const boardData = [
   {
@@ -85,17 +86,18 @@ export const columns: BasicColumn[] = [
     title: '风险分析',
     dataIndex: 'alarmName',
     width: 100,
-    customRender: ({ text }) => {
-      if (typeof text !== 'string') {
-        return '-';
-      }
+    customRender: ({ record }) => {
       const riskMap = {
         '1': '低风险',
         '2': '一般风险',
         '3': '较高风险',
         '4': '高风险',
       };
-      return riskMap[text] || text;
+      return alarmCellRender(record, (r) => riskMap[r.alarmName] || r.alarmName);
+      // if (typeof text !== 'string') {
+      //   return '-';
+      // }
+      // return riskMap[text] || text;
     },
   },
   {

+ 4 - 0
src/views/analysis/warningAnalysis/fireAreaJudgeAnalysis/fireAreaJudgeAnalysis.data.ts

@@ -1,5 +1,6 @@
 import { BasicColumn } from '/@/components/Table';
 import { FormSchema } from '/@/components/Table';
+import { alarmCellRender } from '/@/views/monitor/sealedMonitor/monitor.data';
 
 export const boardData = [
   {
@@ -113,6 +114,9 @@ export const columns: BasicColumn[] = [
     title: '风险分析',
     dataIndex: 'alarmName',
     width: 100,
+    customRender({ record }) {
+      return alarmCellRender(record);
+    },
   },
   {
     title: '预警时间',

+ 4 - 0
src/views/analysis/warningAnalysis/overlimitAlarm/overlimitAlarm.data.ts

@@ -1,5 +1,6 @@
 import { BasicColumn } from '/@/components/Table';
 import { FormSchema } from '/@/components/Table';
+import { alarmCellRender } from '/@/views/monitor/sealedMonitor/monitor.data';
 
 export const boardData = [
   {
@@ -85,6 +86,9 @@ export const columns: BasicColumn[] = [
     title: '风险分析',
     dataIndex: 'alarmName',
     width: 100,
+    customRender({ record }) {
+      return alarmCellRender(record);
+    },
   },
   {
     title: '预警时间',

+ 8 - 5
src/views/analysis/warningAnalysis/pressureDiffAnalysis/pressureDiffAnalysis.data.ts

@@ -1,5 +1,6 @@
 import { BasicColumn } from '/@/components/Table';
 import { FormSchema } from '/@/components/Table';
+import { alarmCellRender } from '/@/views/monitor/sealedMonitor/monitor.data';
 
 export const boardData = [
   {
@@ -75,17 +76,19 @@ export const columns: BasicColumn[] = [
     title: '风险分析',
     dataIndex: 'alarmName',
     width: 100,
-    customRender: ({ text }) => {
-      if (typeof text !== 'string') {
-        return '-';
-      }
+    customRender: ({ record }) => {
       const riskMap = {
         '1': '低风险',
         '2': '一般风险',
         '3': '较高风险',
         '4': '高风险',
       };
-      return riskMap[text] || text;
+      return alarmCellRender(record, (r) => riskMap[r.alarmName] || r.alarmName);
+
+      // if (typeof text !== 'string') {
+      //   return '-';
+      // }
+      // return riskMap[text] || text;
     },
   },
   {

+ 4 - 0
src/views/analysis/warningAnalysis/sealRiskJudgeAnalysis/sealRiskJudgeAnalysis.data.ts

@@ -1,5 +1,6 @@
 import { BasicColumn } from '/@/components/Table';
 import { FormSchema } from '/@/components/Table';
+import { alarmCellRender } from '/@/views/monitor/sealedMonitor/monitor.data';
 
 export const boardData = [
   {
@@ -85,6 +86,9 @@ export const columns: BasicColumn[] = [
     title: '爆炸危险性',
     dataIndex: 'alarmName',
     width: 100,
+    customRender({ record }) {
+      return alarmCellRender(record);
+    },
   },
   {
     title: '处置意见',

+ 8 - 4
src/views/dashboard/basicInfo/dataQuality/index.vue

@@ -3,11 +3,14 @@
   <!-- Tab标签页 -->
   <Tabs v-model:activeKey="activeKey" class="common-page-tabs" type="line" @change="handleTabChange">
     <TabPane key="unresolved" tab="未解决">
-      <div class="add-button">
-        <a-button type="default" preIcon="mdi:download" @click="handleExportExcel" style="margin-right: 8px"> 导出 </a-button>
-        <a-button type="primary" preIcon="mdi:page-next-outline" @click="handleOpenModal({}, 'add')"> 新增问题 </a-button>
-      </div>
       <BasicTable style="padding: 0" @register="registerUnresolvedTable">
+        <template #resetBefore>
+          <a-button type="primary" class="ml-8px" preIcon="mdi:page-next-outline" @click="handleOpenModal({}, 'add')"> 新增问题 </a-button>
+          <a-button type="default" class="ml-8px" preIcon="mdi:download" @click="handleExportExcel"> 导出 </a-button>
+        </template>
+        <!-- <template #submitBefore>
+          <a-button type="primary" preIcon="mdi:page-next-outline" @click="handleOpenModal({}, 'add')"> 新增问题 </a-button>
+        </template> -->
         <template #queJson="{ record }">
           <div style="display: flex; align-items: center; gap: 8px; width: 100%">
             <span style="flex: 1; text-align: center">
@@ -171,6 +174,7 @@
       schemas: searchFormSchema.value,
       showAdvancedButton: false,
       schemaGroupNames: ['常规查询'],
+      actionColOptions: { span: 6 },
     },
     useSearchForm: true,
     pagination: true,

+ 5 - 5
src/views/dashboard/basicInfo/minesInfo/index.vue

@@ -5,7 +5,7 @@
       <button @click="handleGoToPageQuery(record, `/sealed/${record.areaId}`)" class="action-btn">
         <SvgIcon name="data" />
       </button>
-      <button @click="handleGoToPage(record, '/basicInfo/accessStatistics')" class="action-btn">
+      <button @click="handleGoToPage(record, '/basicinfo/access-statistics')" class="action-btn">
         <SvgIcon name="info" />
       </button>
       <button @click="handleGoToPageQuery(record, '/warningAnalysis/connectAnalysis')" class="action-btn">
@@ -51,12 +51,12 @@
 
       const statusMap: ProductionStatusMap = {};
       const statusOptions: { label: string; value: string | number }[] = [];
-      
+
       statusList.forEach((item) => {
         const value = item.value;
         const label = item.text || item.label;
         const color = getStatusColor(label);
-        
+
         statusMap[value] = { label, value, color };
         statusOptions.push({ label, value });
       });
@@ -125,7 +125,7 @@
   }
 
   function handleGoToPageQuery(record: any, path: string) {
-    const mineCode = record.mineCode
+    const mineCode = record.mineCode;
     router.push({
       path,
       query: { mineCode },
@@ -149,4 +149,4 @@
       margin-right: 0;
     }
   }
-</style>
+</style>

+ 3 - 3
src/views/monitor/sealedMonitor/components/RealtimeDetailsModal.vue

@@ -35,7 +35,7 @@
         <div class="chart-placeholder">
           <BlastDelta
             :posMonitor="dataRef"
-            :canvas-size="{ width: 311, height: 149 }"
+            :canvas-size="{ width: 225, height: 149 }"
             :legendStyle="{ left: '50%', top: '10px' }"
             text-color="#000"
           />
@@ -81,7 +81,7 @@
   import MiniBoard from '/@/components/Configurable/detail/MiniBoard.vue';
   import BlastDelta from '/@/components/Configurable/preset/BlastDelta.vue';
   import CustomChart from '/@/components/Configurable/detail/CustomChart.vue';
-  import { modalDetailsData, tagCellRender } from '../monitor.data';
+  import { modalDetailsData, alarmCellRender } from '../monitor.data';
   import { concat, get, last, takeRight } from 'lodash-es';
   import { h } from 'vue';
   import { getGoafData } from '../monitor.api';
@@ -132,7 +132,7 @@
       });
 
       function contextRender({ value, tag }: any) {
-        if (tag) return tagCellRender(get(dataRef.value, value));
+        if (tag) return alarmCellRender(get(dataRef.value, value));
         return h('span', get(dataRef.value, value));
       }
 

+ 8 - 6
src/views/monitor/sealedMonitor/hooks/form.ts

@@ -7,15 +7,16 @@ import { useMineDepartmentStore } from '/@/store/modules/mine';
 export function useInitForm() {
   const mineStore = useMineDepartmentStore();
   const route = useRoute();
-  const departId = last(route.fullPath.split('/'));
+  const departId = last(route.path.split('/')) as string;
   const dep = mineStore.findDepartById(departId, mineStore.departTree);
-  const code = route.params.mineCode as string;
+  const rawcode = route.query.mineCode as string;
   // 给历史数据默认填充的矿码
-  const historyMineCode = !code ? first(get(dep, 'id', '').split(',')) : code;
+  const hiscode = !rawcode ? first(get(dep, 'id', '').split(',')) : rawcode;
+  console.log('debug r', route, rawcode, hiscode);
 
-  if (historyMineCode) {
+  if (hiscode) {
     // mineStore.setDepartById(code as string);
-    initGoafOptions(historyMineCode);
+    initGoafOptions(hiscode);
   }
 
   // 采空区选择器
@@ -33,7 +34,8 @@ export function useInitForm() {
     departId,
     goafOptions,
     goafId,
-    historyMineCode,
+    rawcode,
+    hiscode,
     initGoafOptions,
   };
 }

+ 3 - 2
src/views/monitor/sealedMonitor/index.vue

@@ -56,7 +56,7 @@
   // 激活的Tab页签
 
   // 处理矿名选择器相关的逻辑
-  const { departId, goafOptions, goafId, historyMineCode, initGoafOptions } = useInitForm();
+  const { departId, goafOptions, goafId, rawcode, hiscode, initGoafOptions } = useInitForm();
   const activeTab = ref('realtime');
 
   // 注册实时数据表格
@@ -65,6 +65,7 @@
       api: getGoafData,
       columns,
       formConfig: {
+        model: { mineCodeList: rawcode },
         schemas: [
           {
             field: 'mineCodeList',
@@ -104,7 +105,7 @@
       columns: historicalColumns,
       formConfig: {
         model: {
-          mineCodeList: historyMineCode,
+          mineCodeList: hiscode,
         },
         schemas: [
           {

+ 37 - 15
src/views/monitor/sealedMonitor/monitor.data.ts

@@ -78,7 +78,13 @@ export const columns: BasicColumn[] = [
     dataIndex: 'fireAlarm',
     width: 100,
     customRender({ record }) {
-      return tagCellRender(record.fireAlarm);
+      const riskMap = {
+        '1': '低风险',
+        '2': '一般风险',
+        '3': '较高风险',
+        '4': '高风险',
+      };
+      return alarmCellRender(record.fireAlarm, (r) => riskMap[r.alarmName] || r.alarmName);
     },
   },
   {
@@ -86,7 +92,8 @@ export const columns: BasicColumn[] = [
     dataIndex: 'leakageAlarm',
     width: 100,
     customRender({ record }) {
-      return tagCellRender(record.leakageAlarm);
+      // return alarmTextRender(record.leakageAlarm?.alarmLevel, record.leakageAlarm?.split('-')[0]);
+      return alarmCellRender(record.leakageAlarm, (r) => r.alarmName.split('-')[1]);
     },
   },
   {
@@ -94,7 +101,13 @@ export const columns: BasicColumn[] = [
     dataIndex: 'sourcePressureAlarm',
     width: 100,
     customRender({ record }) {
-      return tagCellRender(record.sourcePressureAlarm);
+      const riskMap = {
+        '1': '低风险',
+        '2': '一般风险',
+        '3': '较高风险',
+        '4': '高风险',
+      };
+      return alarmCellRender(record.sourcePressureAlarm, (r) => riskMap[r.alarmName] || r.alarmName);
     },
   },
   {
@@ -102,7 +115,7 @@ export const columns: BasicColumn[] = [
     dataIndex: 'unsealAlarm',
     width: 100,
     customRender({ record }) {
-      return tagCellRender(record.unsealAlarm);
+      return alarmCellRender(record.unsealAlarm);
     },
   },
   // {
@@ -505,19 +518,28 @@ export const treeData: TreeItem[] = [
 
 function getTagType(level: string) {
   switch (level) {
-    case '1':
-      return 'red';
-    case '2':
-      return 'volcano';
-    case '3':
-      return 'orange';
     case '4':
-      return 'success';
+      return '#f5222d';
+    case '3':
+      return '#fa5914';
+    case '2':
+      return '#faad14';
+    case '1':
+      return '#208840';
     default:
-      return 'default';
+      return 'inhert';
   }
 }
-export function tagCellRender(record: any) {
-  if (!record) return h(Tag, { bordered: false, color: 'default' }, () => '-');
-  return h(Tag, { bordered: false, color: getTagType(record.alarmLevel) }, () => record.alarmName);
+
+export function alarmCellRender(
+  record: any,
+  valFn: (record: any) => string = (r) => r.alarmName,
+  lvFn: (record: any) => string = (r) => r.alarmLevel
+) {
+  // if (!record) return h(Tag, { bordered: false, color: 'default' }, () => '-');
+  // return h(Tag, { bordered: false, color: getTagType(record.alarmLevel) }, () => record.alarmName);
+  if (!record) return h('span', '-');
+  const val = valFn(record);
+  const lv = lvFn(record);
+  return h('span', { style: { color: getTagType(lv) } }, val);
 }