Jelajahi Sumber

[Mod 0000]修改接入统计页面表格

wangkeyi 3 bulan lalu
induk
melakukan
86d5123817

+ 50 - 59
src/views/dashboard/basicInfo/accessStatistics/access.data.ts

@@ -1,61 +1,52 @@
 import { BasicColumn } from '/@/components/Table/src/types/table';
 
-
-/**
- * 接入统计 - 多级表头配置
- * 一级表头:基础信息、统计数据
- * 二级表头:基础信息包含序号、区域;统计数据包含所有数值字段
- */
-export function getAccessStatisticsColumns(): BasicColumn[] {
-  return [
-    {
-      title: '区域',
-      dataIndex: 'name',
-      width: 150,
-      fixed: 'left',
-      align: 'center',
-    },
-    {
-      title: '煤矿总数',
-      dataIndex: 'mineNum',
-      width: 120,
-      align: 'center',
-    },
-    {
-      title: '应接入数量',
-      dataIndex: 'yjNum',
-      width: 120,
-      align: 'center',
-    },
-    {
-      title: '无需接入数量',
-      dataIndex: 'wxjrNum',
-      width: 120,
-      align: 'center',
-    },
-    {
-      title: '接入数量',
-      dataIndex: 'jrNum',
-      width: 120,
-      align: 'center',
-    },
-    {
-      title: '未接入数量',
-      dataIndex: 'wjNum',
-      width: 120,
-      align: 'center',
-    },
-    {
-      title: '在线数量',
-      dataIndex: 'zxNum',
-      width: 120,
-      align: 'center',
-    },
-    {
-      title: '离线数量',
-      dataIndex: 'lxNum',
-      width: 120,
-      align: 'center',
-    },
-  ];
-}
+export const accessStatisticsColumns: BasicColumn[] = [
+  {
+    title: '区域',
+    dataIndex: 'name',
+    width: 150,
+    align: 'center',
+  },
+  {
+    title: '煤矿总数',
+    dataIndex: 'mineNum',
+    width: 120,
+    align: 'center',
+  },
+  {
+    title: '应接入数量',
+    dataIndex: 'yjNum',
+    width: 120,
+    align: 'center',
+  },
+  {
+    title: '无需接入数量',
+    dataIndex: 'wxjrNum',
+    width: 120,
+    align: 'center',
+  },
+  {
+    title: '接入数量',
+    dataIndex: 'jrNum',
+    width: 120,
+    align: 'center',
+  },
+  {
+    title: '未接入数量',
+    dataIndex: 'wjNum',
+    width: 120,
+    align: 'center',
+  },
+  {
+    title: '在线数量',
+    dataIndex: 'zxNum',
+    width: 120,
+    align: 'center',
+  },
+  {
+    title: '离线数量',
+    dataIndex: 'lxNum',
+    width: 120,
+    align: 'center',
+  },
+]

+ 8 - 25
src/views/dashboard/basicInfo/accessStatistics/index.vue

@@ -3,34 +3,17 @@
     <BasicTable @register="registerTable" :scroll="{ x: 'max-content' }"  />
   </div>
 </template>
-<script lang="ts">
-  import { defineComponent } from 'vue';
+<script setup lang="ts">
   import { BasicTable, useTable } from '/@/components/Table';
-  import { getAccessStatisticsColumns } from './access.data';
+  import { accessStatisticsColumns } from './access.data';
   import { getGoafAccessCount } from '../basicInfo.api';
 
-  export default defineComponent({
-    components: { BasicTable },
-    setup() {
-      const [registerTable] = useTable({
-        api: getGoafAccessCount,
-        columns: getAccessStatisticsColumns(),
-        pagination: true,
-        showIndexColumn: true,
-      });
-
-      return {
-        registerTable,
-      };
-    },
+  const [registerTable] = useTable({
+    api: getGoafAccessCount,
+    columns: accessStatisticsColumns,
+    pagination: true,
+    showIndexColumn: true,
   });
 </script>
 <style scoped>
-  /* 合计行样式优化 */
-  .bg-gray-50 {
-    background-color: #f9fafb;
-  }
-  .font-medium {
-    font-weight: 500;
-  }
-</style>
+</style>