Просмотр исходного кода

[Mod 0000] 全系生产状态字段对接

houzekong 3 месяцев назад
Родитель
Сommit
fdc1553626

+ 103 - 110
src/views/dashboard/basicInfo/dataQuality/dataQuality.data.ts

@@ -1,6 +1,6 @@
 import { BasicColumn, FormSchema } from '/@/components/Table';
 import { h } from 'vue';
-import { Ref } from 'vue';
+// import { Ref } from 'vue';
 // import dayjs from 'dayjs';
 
 // 1. 颜色映射(固定规则,可根据业务调整)
@@ -24,120 +24,113 @@ export type ProductionStatusMap = Record<
 >;
 
 // 3. 生成表格列(支持传入动态映射)
-export function getColumns(dynamicStatusMap: Ref<ProductionStatusMap>) {
-  const columns: BasicColumn[] = [
-    {
-      title: '煤矿名称',
-      dataIndex: 'mineName',
-      width: 250,
-    },
-    {
-      title: '煤矿简称',
-      dataIndex: 'mineNameAbbr',
-      width: 150,
-      ifShow: false,
-    },
-    {
-      title: '生产状态',
-      dataIndex: 'mineProStatus',
-      width: 120,
-      customRender: ({ record }) => {
-        // 空值/异常值处理
-        const status = record.mineProStatus;
-        // 从动态映射中取值,兜底未知状态
-        const { label, color } = dynamicStatusMap.value[status] || {
-          label: '-',
-        };
-        return h(
-          'span',
-          {
-            style: { color: colorHexMap[color] },
-          },
-          label
-        );
-      },
-    },
-    {
-      title: '在线状态',
-      dataIndex: 'mineLinkStatus',
-      width: 100,
-      customRender: ({ record }) => {
-        const status = record.mineLinkStatus;
-        if (status === undefined || status === null) {
-          return h('span', { style: { color: colorHexMap.black } }, '-');
-        }
-        const text = status === 1 ? '在线' : '离线';
-        const textColor = status === 1 ? colorHexMap.green : colorHexMap.red;
-        return h('span', { style: { color: textColor } }, text);
-      },
-    },
-    {
-      title: '质量问题详情',
-      dataIndex: 'queJson',
-      width: 400,
-      ellipsis: true,
-      slots: { customRender: 'queJson' },
-    },
-    {
-      title: '当前状态',
-      dataIndex: 'isOk',
-      width: 100,
-      customRender: ({ record }) => {
-        const status = record.isOk;
-        const text = status ? '已解决' : '未解决';
-        const textColor = status ? colorHexMap.green : colorHexMap.red;
-        return h('span', { style: { color: textColor } }, text);
-      },
+export const columns: BasicColumn[] = [
+  {
+    title: '煤矿名称',
+    dataIndex: 'mineName',
+    width: 250,
+  },
+  {
+    title: '煤矿简称',
+    dataIndex: 'mineNameAbbr',
+    width: 150,
+    ifShow: false,
+  },
+  {
+    title: '生产状态',
+    dataIndex: 'gjMineStatus',
+    width: 120,
+    // customRender: ({ record }) => {
+    //   // 空值/异常值处理
+    //   const status = record.mineProStatus;
+    //   // 从动态映射中取值,兜底未知状态
+    //   const { label, color } = dynamicStatusMap.value[status] || {
+    //     label: '-',
+    //   };
+    //   return h(
+    //     'span',
+    //     {
+    //       style: { color: colorHexMap[color] },
+    //     },
+    //     label
+    //   );
+    // },
+  },
+  {
+    title: '在线状态',
+    dataIndex: 'mineLinkStatus',
+    width: 100,
+    customRender: ({ record }) => {
+      const status = record.mineLinkStatus;
+      if (status === undefined || status === null) {
+        return h('span', { style: { color: colorHexMap.black } }, '-');
+      }
+      const text = status === 1 ? '在线' : '离线';
+      const textColor = status === 1 ? colorHexMap.green : colorHexMap.red;
+      return h('span', { style: { color: textColor } }, text);
     },
-    {
-      title: '处理时间',
-      dataIndex: 'updateTime',
-      width: 180,
+  },
+  {
+    title: '质量问题详情',
+    dataIndex: 'queJson',
+    width: 400,
+    ellipsis: true,
+    slots: { customRender: 'queJson' },
+  },
+  {
+    title: '当前状态',
+    dataIndex: 'isOk',
+    width: 100,
+    customRender: ({ record }) => {
+      const status = record.isOk;
+      const text = status ? '已解决' : '未解决';
+      const textColor = status ? colorHexMap.green : colorHexMap.red;
+      return h('span', { style: { color: textColor } }, text);
     },
-  ];
-  return columns;
-}
+  },
+  {
+    title: '处理时间',
+    dataIndex: 'updateTime',
+    width: 180,
+  },
+];
 
 // 4. 查询表单配置(下拉框改为动态options)
-export function getSearchFormSchema(dynamicStatusOptions: Ref<{ label: string; value: string | number }[]>) {
-  const searchFormSchema: FormSchema[] = [
-    {
-      field: 'mineCodeList',
-      label: '煤矿名称',
-      component: 'MineCascader',
-      colProps: { span: 6 },
-      groupName: '常规查询',
-    },
-    // 启用生产状态下拉框(动态options)
-    {
-      field: 'productionStatus',
-      label: '生产状态',
-      component: 'Select',
-      componentProps: {
-        // 动态绑定下拉选项
-        options: dynamicStatusOptions,
-      },
-      colProps: { span: 6 },
-      groupName: '常规查询',
-      show: false,
-    },
-    {
-      field: 'mineLinkStatus',
-      label: '在线状态',
-      component: 'Select',
-      componentProps: {
-        options: [
-          { label: '离线', value: '0' },
-          { label: '在线', value: '1' },
-        ],
-      },
-      colProps: { span: 6 },
-      groupName: '常规查询',
-      show: false,
+export const searchFormSchema: FormSchema[] = [
+  {
+    field: 'mineCodeList',
+    label: '煤矿名称',
+    component: 'MineCascader',
+    colProps: { span: 6 },
+    groupName: '常规查询',
+  },
+  // 启用生产状态下拉框(动态options)
+  {
+    field: 'gjMineStatus',
+    label: '生产状态',
+    component: 'JDictSelectTag',
+    componentProps: {
+      dictCode: 'mineProStatus',
+      placeholder: '请选择生产状态',
     },
-  ];
-  return searchFormSchema;
-}
+    colProps: { span: 6 },
+  },
+  {
+    field: 'mineLinkStatus',
+    label: '在线状态',
+    component: 'Select',
+    componentProps: {
+      options: [
+        { label: '离线', value: '0' },
+        { label: '在线', value: '1' },
+      ],
+    },
+    colProps: { span: 6 },
+    groupName: '常规查询',
+    show: false,
+  },
+];
+
 export const topFormSchema: FormSchema[] = [
   {
     field: 'mineCode',

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

@@ -126,11 +126,11 @@
   import type { FormInstance } from 'ant-design-vue/es/form';
   import DataQualityModal from './components/DataQualityModal.vue';
   import { SvgIcon } from '/@/components/Icon';
-  import { getColumns, getSearchFormSchema, type ProductionStatusMap, exportFormSchema } from './dataQuality.data';
+  import { columns, searchFormSchema, exportFormSchema } from './dataQuality.data';
   import { getDataQuaQueList, addDataQuaQue, deleteDataQuaQue, editDataQuaQue } from '../basicInfo.api';
   import { findNode } from '/@/utils/helper/treeHelper';
   import { useMineDepartmentStore } from '/@/store/modules/mine';
-  import { getDictItemsByCode } from '/@/utils/dict';
+  // import { getDictItemsByCode } from '/@/utils/dict';
   import dayjs, { Dayjs } from 'dayjs';
   import { useListPage } from '/@/hooks/system/useListPage';
 
@@ -179,58 +179,6 @@
     return exportFormComponentMap[componentName as keyof typeof exportFormComponentMap];
   };
 
-  // ========== 定义动态状态映射/下拉选项 ==========
-  // 1. 动态生产状态映射(key: 状态value,value: 包含label/color的配置)
-  const dynamicProductionStatusMap = ref<ProductionStatusMap>({});
-  // 2. 动态下拉选项(供搜索表单使用)
-  const dynamicProductionStatusOptions = ref<{ label: string; value: string | number }[]>([]);
-
-  // 3. 颜色分配规则(可根据业务灵活调整)
-  const getStatusColor = (statusText: string) => {
-    if (statusText.includes('正常生产')) return 'green'; // 正常生产 → 绿色
-    if (statusText.includes('拟建矿井'))
-      return 'blue'; // 拟建矿井 → 蓝色
-    else return 'red'; // 停产/停建/关闭/整改/责令 → 红色
-  };
-
-  // 4. 从接口获取生产状态列表并生成动态映射/下拉选项
-  const fetchProductionStatus = async () => {
-    try {
-      // 调用接口获取状态列表
-      const statusList = await getDictItemsByCode('mineProStatus');
-      if (!Array.isArray(statusList)) return;
-
-      // 生成动态映射和下拉选项
-      const statusMap: ProductionStatusMap = {};
-      const statusOptions: { label: string; value: string | number }[] = [];
-
-      statusList.forEach((item) => {
-        const value = item.value; // 接口返回的value(数字/字符串)
-        const label = item.text || item.label; // 接口返回的文本
-        const color = getStatusColor(label); // 按规则分配颜色
-
-        // 填充映射表
-        statusMap[value] = { label, value, color };
-        // 填充下拉选项
-        statusOptions.push({ label, value });
-      });
-
-      // 赋值到响应式变量
-      dynamicProductionStatusMap.value = statusMap;
-      dynamicProductionStatusOptions.value = statusOptions;
-
-      // 刷新表格(确保表格使用最新的映射)
-      await safeReloadActiveTable();
-    } catch (error) {
-      console.error('获取生产状态列表失败:', error);
-      message.error('生产状态数据加载失败');
-    }
-  };
-
-  // 生成动态列和搜索表单配置
-  const columns = computed(() => getColumns(dynamicProductionStatusMap));
-  const searchFormSchema = computed(() => getSearchFormSchema(dynamicProductionStatusOptions));
-
   // 未解决表格注册
   const { tableContext: tableContextA, onExportXls: onExportXlsA } = useListPage({
     tableProps: {
@@ -240,7 +188,7 @@
       columns: columns, // 绑定动态列
       formConfig: {
         labelWidth: 120,
-        schemas: searchFormSchema.value,
+        schemas: searchFormSchema,
         showAdvancedButton: false,
         schemaGroupNames: ['常规查询'],
         actionColOptions: { span: 6 },
@@ -273,7 +221,7 @@
       columns: columns,
       formConfig: {
         labelWidth: 120,
-        schemas: searchFormSchema.value,
+        schemas: searchFormSchema,
         showAdvancedButton: false,
         schemaGroupNames: ['常规查询'],
       },
@@ -537,7 +485,6 @@
 
   // ========== 初始化:先获取状态数据,再加载表格 ==========
   onMounted(async () => {
-    await fetchProductionStatus(); // 先获取动态状态数据
     await safeReloadActiveTable();
   });
 </script>

+ 3 - 4
src/views/dashboard/basicInfo/minesInfo/index.vue

@@ -25,7 +25,7 @@
   import { SvgIcon } from '/@/components/Icon';
   import { message } from 'ant-design-vue';
   // 引入动态列/表单配置函数 + 类型
-  import { getColumns, getSearchFormSchema, type ProductionStatusMap } from './minesInfo.data';
+  import { getColumns, searchFormSchema, type ProductionStatusMap } from './minesInfo.data';
   import { getMineData } from '../basicInfo.api';
   // 引入字典获取方法
   import { getDictItemsByCode } from '/@/utils/dict';
@@ -81,7 +81,6 @@
 
   // 5. 生成动态列和搜索表单(computed响应式更新)
   const columns = computed(() => getColumns(dynamicProductionStatusMap));
-  const searchFormSchema = computed(() => getSearchFormSchema(dynamicProductionStatusOptions));
   // ========== 表格注册 ==========
   const { tableContext: ctxRealtime, onExportXls } = useListPage({
     tableProps: {
@@ -89,7 +88,7 @@
       columns, // 绑定动态列
       formConfig: {
         labelWidth: 120,
-        schemas: searchFormSchema.value, // 绑定动态搜索表单
+        schemas: searchFormSchema, // 绑定动态搜索表单
         showAdvancedButton: false,
         schemaGroupNames: ['常规查询'],
       },
@@ -110,7 +109,7 @@
   async function safeReloadTable() {
     await nextTick();
     try {
-      await reloadTable();
+      await realtimeTable.reload();
     } catch (e) {
       console.warn('矿山信息表格重载失败:', e);
     }

+ 80 - 82
src/views/dashboard/basicInfo/minesInfo/minesInfo.data.ts

@@ -51,24 +51,24 @@ export function getColumns(dynamicStatusMap: Ref<ProductionStatusMap>): BasicCol
     },
     {
       title: '生产状态',
-      dataIndex: 'productionStatus',
+      dataIndex: 'gjMineStatus',
       width: 100,
-      customRender: ({ record }) => {
-        // 空值/异常值处理
-        const status = String(record.productionStatus || '');
-        // 从动态映射取值,兜底未知状态
-        const { label, color } = dynamicStatusMap.value[status] || {
-          label: '-',
-        };
-        // 渲染带颜色的文字
-        return h(
-          'span',
-          {
-            style: { color: StatusColorEnum[color] },
-          },
-          label
-        );
-      },
+      // customRender: ({ record }) => {
+      //   // 空值/异常值处理
+      //   const status = String(record.productionStatus || '');
+      //   // 从动态映射取值,兜底未知状态
+      //   const { label, color } = dynamicStatusMap.value[status] || {
+      //     label: '-',
+      //   };
+      //   // 渲染带颜色的文字
+      //   return h(
+      //     'span',
+      //     {
+      //       style: { color: StatusColorEnum[color] },
+      //     },
+      //     label
+      //   );
+      // },
     },
     {
       title: '自燃倾向性',
@@ -123,68 +123,66 @@ export function getColumns(dynamicStatusMap: Ref<ProductionStatusMap>): BasicCol
 }
 
 // 4. 生成动态搜索表单配置(接收动态下拉选项)
-export function getSearchFormSchema(dynamicStatusOptions: Ref<{ label: string; value: string | number }[]>): FormSchema[] {
-  return [
-    {
-      field: 'mineCode',
-      label: '煤矿名称',
-      component: 'MineCascader',
-      colProps: { span: 6 },
-    },
-    {
-      field: 'mineNameAbbr',
-      label: '煤矿简称',
-      component: 'Input',
-      colProps: { span: 6 },
-      show: false,
-    },
-    {
-      field: 'productionStatus',
-      label: '生产状态',
-      component: 'Select',
-      componentProps: {
-        // 动态绑定下拉选项
-        options: dynamicStatusOptions,
-      },
-      colProps: { span: 6 },
-    },
-    {
-      field: 'accessStatus',
-      label: '接入状态',
-      component: 'Select',
-      componentProps: {
-        options: [
-          { label: '接入', value: 1 },
-          { label: '未接入', value: 0 },
-        ],
-      },
-      colProps: { span: 6 },
-    },
-    {
-      field: 'status',
-      label: '在线状态',
-      component: 'Select',
-      componentProps: {
-        options: [
-          { label: '离线', value: '0' },
-          { label: '在线', value: '1' },
-        ],
-      },
-      colProps: { span: 6 },
-    },
-    {
-      field: 'riskLevel',
-      label: '风险等级',
-      component: 'Select',
-      componentProps: {
-        options: [
-          { label: 'Ⅰ类容易自燃', value: '0' },
-          { label: 'Ⅱ类自燃', value: '1' },
-          { label: 'Ⅲ类不易自燃', value: '2' },
-        ],
-      },
-      colProps: { span: 6 },
-      show: false,
-    },
-  ];
-}
+export const searchFormSchema: FormSchema[] = [
+  {
+    field: 'mineCode',
+    label: '煤矿名称',
+    component: 'MineCascader',
+    colProps: { span: 6 },
+  },
+  {
+    field: 'mineNameAbbr',
+    label: '煤矿简称',
+    component: 'Input',
+    colProps: { span: 6 },
+    show: false,
+  },
+  {
+    field: 'gjMineStatus',
+    label: '生产状态',
+    component: 'JDictSelectTag',
+    componentProps: {
+      dictCode: 'mineProStatus',
+      placeholder: '请选择生产状态',
+    },
+    colProps: { span: 6 },
+  },
+  {
+    field: 'accessStatus',
+    label: '接入状态',
+    component: 'Select',
+    componentProps: {
+      options: [
+        { label: '接入', value: 1 },
+        { label: '未接入', value: 0 },
+      ],
+    },
+    colProps: { span: 6 },
+  },
+  {
+    field: 'status',
+    label: '在线状态',
+    component: 'Select',
+    componentProps: {
+      options: [
+        { label: '离线', value: '0' },
+        { label: '在线', value: '1' },
+      ],
+    },
+    colProps: { span: 6 },
+  },
+  {
+    field: 'riskLevel',
+    label: '风险等级',
+    component: 'Select',
+    componentProps: {
+      options: [
+        { label: 'Ⅰ类容易自燃', value: '0' },
+        { label: 'Ⅱ类自燃', value: '1' },
+        { label: 'Ⅲ类不易自燃', value: '2' },
+      ],
+    },
+    colProps: { span: 6 },
+    show: false,
+  },
+];

+ 10 - 63
src/views/dashboard/basicInfo/problemReport/index.vue

@@ -126,11 +126,11 @@
   import type { FormInstance } from 'ant-design-vue/es/form';
   import ProblemReportModal from './components/ProblemReportModal.vue';
   import { SvgIcon } from '/@/components/Icon';
-  import { getColumns, getSearchFormSchema, type ProductionStatusMap, exportFormSchema } from './problemReport.data';
+  import { columns, searchFormSchema, exportFormSchema } from './problemReport.data';
   import { getDataQuaQueList, addDataQuaQue, deleteDataQuaQue, editDataQuaQue } from '../basicInfo.api';
   import { findNode } from '/@/utils/helper/treeHelper';
   import { useMineDepartmentStore } from '/@/store/modules/mine';
-  import { getDictItemsByCode } from '/@/utils/dict';
+  // import { getDictItemsByCode } from '/@/utils/dict';
   import dayjs, { Dayjs } from 'dayjs';
   import { useListPage } from '/@/hooks/system/useListPage';
 
@@ -149,7 +149,7 @@
   const exportType = ref<'resolved' | 'unresolved'>('unresolved'); // 记录当前导出类型
   const exportConfig = ref({
     url: '/province/dataQuaQue/exportDataQuaQueList',
-    name: '问题反馈',
+    name: '数据质量',
     params: {
       isOk: 0,
       startTime: '',
@@ -157,7 +157,7 @@
     },
   });
 
-  // 导出表单数据和规则(参考DataQualityModal写法)
+  // 导出表单数据和规则(参考ProblemReportModal写法)
   const exportFormData = reactive({
     startTime: null as Dayjs | null,
     endTime: null as Dayjs | null,
@@ -179,58 +179,6 @@
     return exportFormComponentMap[componentName as keyof typeof exportFormComponentMap];
   };
 
-  // ========== 定义动态状态映射/下拉选项 ==========
-  // 1. 动态生产状态映射(key: 状态value,value: 包含label/color的配置)
-  const dynamicProductionStatusMap = ref<ProductionStatusMap>({});
-  // 2. 动态下拉选项(供搜索表单使用)
-  const dynamicProductionStatusOptions = ref<{ label: string; value: string | number }[]>([]);
-
-  // 3. 颜色分配规则(可根据业务灵活调整)
-  const getStatusColor = (statusText: string) => {
-    if (statusText.includes('正常生产')) return 'green'; // 正常生产 → 绿色
-    if (statusText.includes('拟建矿井'))
-      return 'blue'; // 拟建矿井 → 蓝色
-    else return 'red'; // 停产/停建/关闭/整改/责令 → 红色
-  };
-
-  // 4. 从接口获取生产状态列表并生成动态映射/下拉选项
-  const fetchProductionStatus = async () => {
-    try {
-      // 调用接口获取状态列表
-      const statusList = await getDictItemsByCode('mineProStatus');
-      if (!Array.isArray(statusList)) return;
-
-      // 生成动态映射和下拉选项
-      const statusMap: ProductionStatusMap = {};
-      const statusOptions: { label: string; value: string | number }[] = [];
-
-      statusList.forEach((item) => {
-        const value = item.value; // 接口返回的value(数字/字符串)
-        const label = item.text || item.label; // 接口返回的文本
-        const color = getStatusColor(label); // 按规则分配颜色
-
-        // 填充映射表
-        statusMap[value] = { label, value, color };
-        // 填充下拉选项
-        statusOptions.push({ label, value });
-      });
-
-      // 赋值到响应式变量
-      dynamicProductionStatusMap.value = statusMap;
-      dynamicProductionStatusOptions.value = statusOptions;
-
-      // 刷新表格(确保表格使用最新的映射)
-      await safeReloadActiveTable();
-    } catch (error) {
-      console.error('获取生产状态列表失败:', error);
-      message.error('生产状态数据加载失败');
-    }
-  };
-
-  // 生成动态列和搜索表单配置
-  const columns = computed(() => getColumns(dynamicProductionStatusMap));
-  const searchFormSchema = computed(() => getSearchFormSchema(dynamicProductionStatusOptions));
-
   // 未解决表格注册
   const { tableContext: tableContextA, onExportXls: onExportXlsA } = useListPage({
     tableProps: {
@@ -240,7 +188,7 @@
       columns: columns, // 绑定动态列
       formConfig: {
         labelWidth: 120,
-        schemas: searchFormSchema.value,
+        schemas: searchFormSchema,
         showAdvancedButton: false,
         schemaGroupNames: ['常规查询'],
         actionColOptions: { span: 6 },
@@ -273,7 +221,7 @@
       columns: columns,
       formConfig: {
         labelWidth: 120,
-        schemas: searchFormSchema.value,
+        schemas: searchFormSchema,
         showAdvancedButton: false,
         schemaGroupNames: ['常规查询'],
       },
@@ -322,7 +270,7 @@
   async function handleExportConfirm() {
     try {
       exportConfirmLoading.value = true;
-      // 表单校验(参考DataQualityModal的校验方式)
+      // 表单校验(参考ProblemReportModal的校验方式)
       if (!exportFormRef.value) return;
       const validateResult = await exportFormRef.value.validate();
       if (!validateResult) return;
@@ -375,13 +323,13 @@
   // 解析queJson并拼接orderNum+queCon的辅助函数
   function formatQueJson(queJsonStr: string) {
     // 空值处理
-    if (!queJsonStr) return '无问题反馈';
+    if (!queJsonStr) return '无质量问题';
     try {
       const queList = JSON.parse(queJsonStr);
       // 非数组格式处理
       if (!Array.isArray(queList)) return '问题格式异常';
       // 空数组处理
-      if (queList.length === 0) return '无问题反馈';
+      if (queList.length === 0) return '无质量问题';
       return queList
         .map((item) => {
           const goafName = item.goafName;
@@ -390,7 +338,7 @@
         })
         .join('\n'); // 多个问题分行显示
     } catch (error) {
-      console.error('解析问题反馈JSON失败:', error);
+      console.error('解析质量问题JSON失败:', error);
       return '问题数据解析失败';
     }
   }
@@ -537,7 +485,6 @@
 
   // ========== 初始化:先获取状态数据,再加载表格 ==========
   onMounted(async () => {
-    await fetchProductionStatus(); // 先获取动态状态数据
     await safeReloadActiveTable();
   });
 </script>

+ 103 - 110
src/views/dashboard/basicInfo/problemReport/problemReport.data.ts

@@ -1,6 +1,6 @@
 import { BasicColumn, FormSchema } from '/@/components/Table';
 import { h } from 'vue';
-import { Ref } from 'vue';
+// import { Ref } from 'vue';
 // import dayjs from 'dayjs';
 
 // 1. 颜色映射(固定规则,可根据业务调整)
@@ -24,120 +24,113 @@ export type ProductionStatusMap = Record<
 >;
 
 // 3. 生成表格列(支持传入动态映射)
-export function getColumns(dynamicStatusMap: Ref<ProductionStatusMap>) {
-  const columns: BasicColumn[] = [
-    {
-      title: '煤矿名称',
-      dataIndex: 'mineName',
-      width: 250,
-    },
-    {
-      title: '煤矿简称',
-      dataIndex: 'mineNameAbbr',
-      width: 150,
-      ifShow: false,
-    },
-    {
-      title: '生产状态',
-      dataIndex: 'mineProStatus',
-      width: 120,
-      customRender: ({ record }) => {
-        // 空值/异常值处理
-        const status = record.mineProStatus;
-        // 从动态映射中取值,兜底未知状态
-        const { label, color } = dynamicStatusMap.value[status] || {
-          label: '-',
-        };
-        return h(
-          'span',
-          {
-            style: { color: colorHexMap[color] },
-          },
-          label
-        );
-      },
-    },
-    {
-      title: '在线状态',
-      dataIndex: 'mineLinkStatus',
-      width: 100,
-      customRender: ({ record }) => {
-        const status = record.mineLinkStatus;
-        if (status === undefined || status === null) {
-          return h('span', { style: { color: colorHexMap.black } }, '-');
-        }
-        const text = status === 1 ? '在线' : '离线';
-        const textColor = status === 1 ? colorHexMap.green : colorHexMap.red;
-        return h('span', { style: { color: textColor } }, text);
-      },
-    },
-    {
-      title: '质量问题详情',
-      dataIndex: 'queJson',
-      width: 400,
-      ellipsis: true,
-      slots: { customRender: 'queJson' },
-    },
-    {
-      title: '当前状态',
-      dataIndex: 'isOk',
-      width: 100,
-      customRender: ({ record }) => {
-        const status = record.isOk;
-        const text = status ? '已解决' : '未解决';
-        const textColor = status ? colorHexMap.green : colorHexMap.red;
-        return h('span', { style: { color: textColor } }, text);
-      },
+export const columns: BasicColumn[] = [
+  {
+    title: '煤矿名称',
+    dataIndex: 'mineName',
+    width: 250,
+  },
+  {
+    title: '煤矿简称',
+    dataIndex: 'mineNameAbbr',
+    width: 150,
+    ifShow: false,
+  },
+  {
+    title: '生产状态',
+    dataIndex: 'gjMineStatus',
+    width: 120,
+    // customRender: ({ record }) => {
+    //   // 空值/异常值处理
+    //   const status = record.mineProStatus;
+    //   // 从动态映射中取值,兜底未知状态
+    //   const { label, color } = dynamicStatusMap.value[status] || {
+    //     label: '-',
+    //   };
+    //   return h(
+    //     'span',
+    //     {
+    //       style: { color: colorHexMap[color] },
+    //     },
+    //     label
+    //   );
+    // },
+  },
+  {
+    title: '在线状态',
+    dataIndex: 'mineLinkStatus',
+    width: 100,
+    customRender: ({ record }) => {
+      const status = record.mineLinkStatus;
+      if (status === undefined || status === null) {
+        return h('span', { style: { color: colorHexMap.black } }, '-');
+      }
+      const text = status === 1 ? '在线' : '离线';
+      const textColor = status === 1 ? colorHexMap.green : colorHexMap.red;
+      return h('span', { style: { color: textColor } }, text);
     },
-    {
-      title: '处理时间',
-      dataIndex: 'updateTime',
-      width: 180,
+  },
+  {
+    title: '质量问题详情',
+    dataIndex: 'queJson',
+    width: 400,
+    ellipsis: true,
+    slots: { customRender: 'queJson' },
+  },
+  {
+    title: '当前状态',
+    dataIndex: 'isOk',
+    width: 100,
+    customRender: ({ record }) => {
+      const status = record.isOk;
+      const text = status ? '已解决' : '未解决';
+      const textColor = status ? colorHexMap.green : colorHexMap.red;
+      return h('span', { style: { color: textColor } }, text);
     },
-  ];
-  return columns;
-}
+  },
+  {
+    title: '处理时间',
+    dataIndex: 'updateTime',
+    width: 180,
+  },
+];
 
 // 4. 查询表单配置(下拉框改为动态options)
-export function getSearchFormSchema(dynamicStatusOptions: Ref<{ label: string; value: string | number }[]>) {
-  const searchFormSchema: FormSchema[] = [
-    {
-      field: 'mineCodeList',
-      label: '煤矿名称',
-      component: 'MineCascader',
-      colProps: { span: 6 },
-      groupName: '常规查询',
-    },
-    // 启用生产状态下拉框(动态options)
-    {
-      field: 'productionStatus',
-      label: '生产状态',
-      component: 'Select',
-      componentProps: {
-        // 动态绑定下拉选项
-        options: dynamicStatusOptions,
-      },
-      colProps: { span: 6 },
-      groupName: '常规查询',
-      show: false,
-    },
-    {
-      field: 'mineLinkStatus',
-      label: '在线状态',
-      component: 'Select',
-      componentProps: {
-        options: [
-          { label: '离线', value: '0' },
-          { label: '在线', value: '1' },
-        ],
-      },
-      colProps: { span: 6 },
-      groupName: '常规查询',
-      show: false,
+export const searchFormSchema: FormSchema[] = [
+  {
+    field: 'mineCodeList',
+    label: '煤矿名称',
+    component: 'MineCascader',
+    colProps: { span: 6 },
+    groupName: '常规查询',
+  },
+  // 启用生产状态下拉框(动态options)
+  {
+    field: 'gjMineStatus',
+    label: '生产状态',
+    component: 'JDictSelectTag',
+    componentProps: {
+      dictCode: 'mineProStatus',
+      placeholder: '请选择生产状态',
     },
-  ];
-  return searchFormSchema;
-}
+    colProps: { span: 6 },
+  },
+  {
+    field: 'mineLinkStatus',
+    label: '在线状态',
+    component: 'Select',
+    componentProps: {
+      options: [
+        { label: '离线', value: '0' },
+        { label: '在线', value: '1' },
+      ],
+    },
+    colProps: { span: 6 },
+    groupName: '常规查询',
+    show: false,
+  },
+];
+
 export const topFormSchema: FormSchema[] = [
   {
     field: 'mineCode',

+ 3 - 3
src/views/monitor/sealedMonitor/monitor.data.ts

@@ -5,8 +5,8 @@ import { TreeItem } from '/@/components/Tree/index';
 import { ModuleDataChart } from '/@/components/Configurable/types';
 import { h } from 'vue';
 import { StatusColorEnum } from '/@/enums/jeecgEnum';
-import { getDictItemsByCode } from '/@/utils/dict';
-import { get } from 'lodash-es';
+// import { getDictItemsByCode } from '/@/utils/dict';
+// import { get } from 'lodash-es';
 
 const riskMap = {
   '1': '低风险',
@@ -20,7 +20,7 @@ const linkMap = {
   '2': '标校',
 };
 
-const dictMap = getDictItemsByCode('mineProStatus');
+// const dictMap = getDictItemsByCode('mineProStatus');
 
 // 实时数据相关
 export const columns: BasicColumn[] = [