Ver código fonte

[Mod 0000]修改密闭统计和矿山信息页面表格

wangkeyi 3 meses atrás
pai
commit
9a33b080eb

+ 2 - 2
src/views/dashboard/basicInfo/basicInfo.api.ts

@@ -17,13 +17,13 @@ enum Api {
 
 export const getMineData = (params) => 
   defHttp.post({ 
-    headers: { 'Content-Type': 'x-www-form-urlencoded' },
+    headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
     url: Api.getMineData, 
     params
   });
 
 // 接入统计
-export const getGoafAccessCount = () =>
+export const getGoafAccessCount = (params) =>
   defHttp.get({
     url: Api.getGoafAccessCount,
   });

+ 0 - 3
src/views/dashboard/basicInfo/closedStatistics/closed.data.ts

@@ -1,7 +1,4 @@
 import { BasicColumn } from '/@/components/Table/src/types/table';
-import { EyeOutlined } from '@ant-design/icons-vue';
-import { h } from 'vue';
-
 /**
  * 密闭统计表格列配置
  */

+ 9 - 8
src/views/dashboard/basicInfo/closedStatistics/index.vue

@@ -1,12 +1,13 @@
 <template>
-    <!-- 表格:适配多列,设置横向滚动 & 边框 -->
+  <div class="p-4">
     <BasicTable @register="registerTable" :scroll="{ x: 'max-content' }">
       <template #action="{ record }">
-        <button @click="handleGoToPage(record, `/sealed/${record.code}`)" class="action-btn">
-          <SvgIcon name="view" />
-        </button>
-      </template>
-  </BasicTable>
+          <button @click="handleGoToPage(record, `/sealed/${record.code}`)" class="action-btn">
+            <SvgIcon name="view" />
+          </button>
+        </template>
+    </BasicTable>
+  </div>
 </template>
 
 <script setup lang="ts">
@@ -20,8 +21,8 @@
   const router = useRouter();
   // 注册表格并获取相关方法
   const [registerTable] = useTable({
-    title: '密闭统计表格',
-    api: getClosedAccessCount, // 密闭统计接口
+    title: '密闭统计',
+    api: getClosedAccessCount, // 数据统计接口
     columns: dataColumns,
     pagination: true,
     useSearchForm: false,

+ 23 - 22
src/views/dashboard/basicInfo/minesInfo/minesInfo.data.ts

@@ -3,25 +3,30 @@ import { FormSchema } from '/@/components/Table';
 import { h } from 'vue';
 
 // 生产状态映射表(扩展所有状态)
-const productionStatusMap: Record<string | number, { text: string; color: string }> = {
-  0: { text: '正常生产矿井', color: 'green' },
-  1: { text: '拟建矿井', color: 'blue' },
-  2: { text: '正常建设煤矿', color: 'green' },
-  3: { text: '自行停产矿井', color: 'green' },
-  4: { text: '正在关闭', color: 'green' },
-  5: { text: '责令停产整顿', color: 'green' },
-  6: { text: '责令停止建设', color: 'green' },
-  7: { text: '已关闭矿井', color: 'green' },
-  8: { text: '长期停产矿井', color: 'green' },
-  9: { text: '长期停建矿井', color: 'green' },
-  10: { text: '停产整改矿井', color: 'green' },
-  11: { text: '长期停建无法联系', color: 'green' },
-  12: { text: '停建整改', color: 'green' },
-  13: { text: '自行停建', color: 'green' },
-  14: { text: '正在实施关闭', color: 'green' },
+const productionStatusMap: Record<string | number, { text: string; value: number; color: string }> = {
+  0: { text: '正常生产矿井', value: 0, color: 'green' },
+  1: { text: '拟建矿井', value: 1, color: 'blue' },
+  2: { text: '正常建设煤矿', value: 2, color: 'green' },
+  3: { text: '自行停产矿井', value: 3, color: 'green' },
+  4: { text: '正在关闭', value: 4, color: 'green' },
+  5: { text: '责令停产整顿', value: 5, color: 'green' },
+  6: { text: '责令停止建设', value: 6, color: 'green' },
+  7: { text: '已关闭矿井', value: 7, color: 'green' },
+  8: { text: '长期停产矿井', value: 8, color: 'green' },
+  9: { text: '长期停建矿井', value: 9, color: 'green' },
+  10: { text: '停产整改矿井', value: 10, color: 'green' },
+  11: { text: '长期停建无法联系', value: 11, color: 'green' },
+  12: { text: '停建整改', value: 12, color: 'green' },
+  13: { text: '自行停建', value: 13, color: 'green' },
+  14: { text: '正在实施关闭', value: 14, color: 'green' },
   // 15: { text: '已关闭矿井', color: 'green' },
 };
 
+// 基于productionStatusMap生成下拉选项
+export const productionStatusOptions = Object.entries(productionStatusMap).map(([key, item]) => ({
+  label: item.text, // 状态名称
+  value: key,        // 状态值
+}));
 // 颜色映射
 const colorHexMap: Record<string, string> = {
   blue: '#1890ff',
@@ -107,7 +112,7 @@ export const columns: BasicColumn[] = [
 
 export const searchFormSchema: FormSchema[] = [
   {
-    field: 'mineName',
+    field: 'mineCode',
     label: '煤矿名称',
     component: 'MineCascader',
     colProps: { span: 6 },
@@ -123,11 +128,7 @@ export const searchFormSchema: FormSchema[] = [
     label: '生产状态',
     component: 'Select',
     componentProps: {
-      options: [
-        { label: '拟建矿井', value: '0' },
-        { label: '正常生产矿井', value: '1' },
-        { label: '长期停产矿井', value: '8' },
-      ],
+      options: productionStatusOptions,
     },
     colProps: { span: 6 },
   },