Browse Source

feat: 数据统计静态页

chenlei 2 months ago
parent
commit
2918da9abf

+ 8 - 0
src/pages/A_workbench/A1dataSta/components/Tab1/constants.ts

@@ -0,0 +1,8 @@
+export const NUMBER_OF_COLLECTION_COLUMNS = [
+  ['txt', '藏品总数', 'num'],
+  ['txt', '一级藏品', 'num'],
+  ['txt', '二级藏品', 'num'],
+  ['txt', '三级藏品', 'num'],
+  ['txt', '未定级', 'num'],
+  ['txt', '一般文物', 'num']
+]

+ 6 - 0
src/pages/A_workbench/A1dataSta/components/Tab1/index.module.scss

@@ -0,0 +1,6 @@
+.header {
+  display: flex;
+  align-items: center;
+  gap: 20px;
+  margin: 15px 0;
+}

+ 166 - 0
src/pages/A_workbench/A1dataSta/components/Tab1/index.tsx

@@ -0,0 +1,166 @@
+import { FC } from 'react'
+import style from './index.module.scss'
+import MyTable from '@/components/MyTable'
+import { NUMBER_OF_COLLECTION_COLUMNS } from './constants'
+import { Button, Select, Table } from 'antd'
+
+export const A1Tab1: FC = () => {
+  return (
+    <>
+      <div className={style.header}>
+        <h3>上一年度馆藏数量</h3>
+      </div>
+      <MyTable
+        size='small'
+        bordered
+        pagination={false}
+        columnsTemp={NUMBER_OF_COLLECTION_COLUMNS}
+        list={[]}
+      />
+
+      <div className={style.header}>
+        <h3>核查年度馆藏数量</h3>
+
+        <Select placeholder='请选择核查年度' />
+      </div>
+      <MyTable
+        size='small'
+        bordered
+        pagination={false}
+        columnsTemp={NUMBER_OF_COLLECTION_COLUMNS}
+        list={[]}
+      />
+
+      <div className={style.header}>
+        <h3>馆藏数量增减情况</h3>
+      </div>
+      <Table
+        size='small'
+        columns={[
+          {
+            title: '藏品总数',
+            children: [
+              {
+                title: '增',
+                dataIndex: 'totalIncrease',
+                align: 'center'
+              },
+              {
+                title: '减',
+                dataIndex: 'totalDecrease',
+                align: 'center'
+              }
+            ]
+          },
+          {
+            title: '一级藏品',
+            children: [
+              {
+                title: '增',
+                dataIndex: 'level1Increase',
+                align: 'center'
+              },
+              {
+                title: '减',
+                dataIndex: 'level1Decrease',
+                align: 'center'
+              }
+            ]
+          },
+          {
+            title: '二级藏品',
+            children: [
+              {
+                title: '增',
+                dataIndex: 'level2Increase',
+                align: 'center'
+              },
+              {
+                title: '减',
+                dataIndex: 'level2Decrease',
+                align: 'center'
+              }
+            ]
+          },
+          {
+            title: '三级藏品',
+            children: [
+              {
+                title: '增',
+                dataIndex: 'level3Increase',
+                align: 'center'
+              },
+              {
+                title: '减',
+                dataIndex: 'level3Decrease',
+                align: 'center'
+              }
+            ]
+          },
+          {
+            title: '未定级',
+            children: [
+              {
+                title: '增',
+                dataIndex: 'unclassifiedIncrease',
+                align: 'center'
+              },
+              {
+                title: '减',
+                dataIndex: 'unclassifiedDecrease',
+                align: 'center'
+              }
+            ]
+          },
+          {
+            title: '一般文物',
+            children: [
+              {
+                title: '增',
+                dataIndex: 'generalIncrease',
+                align: 'center'
+              },
+              {
+                title: '减',
+                dataIndex: 'generalDecrease',
+                align: 'center'
+              }
+            ]
+          }
+        ]}
+        dataSource={[]}
+        bordered
+        pagination={false}
+      />
+
+      <div className={style.header}>
+        <h3>馆藏文物增加类别明细</h3>
+
+        <Button type='primary'>设置统计类别</Button>
+      </div>
+      <Table
+        size='small'
+        columns={[
+          {
+            title: '藏品总数',
+            children: [
+              {
+                title: '增',
+                dataIndex: 'totalIncrease',
+                align: 'center'
+              },
+              {
+                title: '减',
+                dataIndex: 'totalDecrease',
+                align: 'center'
+              }
+            ]
+          }
+        ]}
+        dataSource={[]}
+        bordered
+        pagination={false}
+      />
+    </>
+  )
+}

+ 173 - 0
src/pages/A_workbench/A1dataSta/components/Tab2/index.tsx

@@ -0,0 +1,173 @@
+import { Table } from 'antd'
+import { FC } from 'react'
+
+export const A1Tab2: FC = () => {
+  return (
+    <>
+      <Table
+        size='small'
+        columns={[
+          {
+            title: '项目/类目/类别',
+            dataIndex: 'project',
+            rowScope: 'row',
+            onCell: (_, index) => {
+              if (index === 0) return { rowSpan: 2 }
+              if (index === 1) return { rowSpan: 0 }
+              return {}
+            }
+          },
+          {
+            title: '2025年第一季度库存数',
+            children: [
+              {
+                width: 70,
+                title: '合计',
+                dataIndex: 'total'
+              }
+            ]
+          },
+          {
+            title: '2025年第一季度增加数',
+            children: [
+              {
+                title: '新收',
+                children: [
+                  {
+                    title: '征购',
+                    dataIndex: 'a'
+                  },
+                  {
+                    title: '捐赠',
+                    dataIndex: 'b'
+                  },
+                  {
+                    title: '移交',
+                    dataIndex: 'c'
+                  },
+                  {
+                    title: '上交',
+                    dataIndex: 'd'
+                  },
+                  {
+                    title: '调拨',
+                    dataIndex: 'e'
+                  }
+                ]
+              },
+              {
+                title: '其他增加',
+                dataIndex: 'f'
+              },
+              {
+                title: '调入',
+                dataIndex: 'g'
+              }
+            ]
+          },
+          {
+            title: '2025年第一季度减少数',
+            children: [
+              {
+                title: '调出',
+                dataIndex: 'a'
+              },
+              {
+                title: '拨出',
+                dataIndex: 'b'
+              },
+              {
+                title: '其他减少',
+                dataIndex: 'c'
+              }
+            ]
+          },
+          {
+            title: '2025年第一季度库存数',
+            children: [
+              {
+                title: '合计',
+                dataIndex: 'a'
+              }
+            ]
+          },
+          {
+            title: '陈列',
+            children: [
+              {
+                title: '提陈',
+                dataIndex: 'a'
+              },
+              {
+                title: '在陈',
+                dataIndex: 'b'
+              },
+              {
+                title: '退陈',
+                dataIndex: 'c'
+              },
+              {
+                title: '合计',
+                dataIndex: 'c'
+              }
+            ]
+          },
+          {
+            title: '借出',
+            children: [
+              {
+                title: '借出',
+                dataIndex: 'a'
+              },
+              {
+                title: '在借',
+                dataIndex: 'b'
+              },
+              {
+                title: '退还',
+                dataIndex: 'c'
+              },
+              {
+                title: '合计',
+                dataIndex: 'c'
+              }
+            ]
+          },
+          {
+            title: '其他出库',
+            children: [
+              {
+                title: '原出',
+                dataIndex: 'a'
+              },
+              {
+                title: '新出',
+                dataIndex: 'b'
+              },
+              {
+                title: '收回',
+                dataIndex: 'c'
+              },
+              {
+                title: '合计',
+                dataIndex: 'c'
+              }
+            ]
+          },
+          {
+            title: '备注',
+            dataIndex: 'remark',
+            align: 'center',
+            onCell: (_, index) => {
+              if (index === 0) return { rowSpan: 2 }
+              if (index === 1) return { rowSpan: 0 }
+              return {}
+            }
+          }
+        ]}
+        bordered
+        pagination={false}
+      />
+    </>
+  )
+}

+ 98 - 0
src/pages/A_workbench/A1dataSta/components/Tab3/index.tsx

@@ -0,0 +1,98 @@
+import { Table } from 'antd'
+import { isNumber } from 'lodash'
+import { FC } from 'react'
+
+export const A1Tab3: FC = () => {
+  return (
+    <>
+      <Table
+        size='small'
+        columns={[
+          {
+            width: 100,
+            title: '级别/数量/类别',
+            dataIndex: 'custom',
+            colSpan: 2,
+            onCell: (record, index) => {
+              const obj = {
+                rowSpan: 0,
+                colSpan: 1
+              }
+              if (index === 0) {
+                obj.rowSpan = 3
+              } else if (isNumber(index) && index > 2) {
+                obj.rowSpan = 1
+                obj.colSpan = 2
+              }
+              return obj
+            }
+          },
+          {
+            width: 100,
+            dataIndex: 'level',
+            colSpan: 0,
+            onCell: (record, index) => {
+              const obj = {
+                rowSpan: 0,
+                colSpan: 1
+              }
+              if (isNumber(index) && index <= 2) obj.rowSpan = 1
+              return obj
+            }
+          },
+          {
+            title: '库房名称',
+            dataIndex: 'a'
+          },
+          {
+            title: '铜器',
+            dataIndex: 'b'
+          },
+          {
+            title: '金银器',
+            dataIndex: 'c'
+          },
+          {
+            title: '漆器',
+            dataIndex: 'd'
+          },
+          {
+            title: '文具',
+            dataIndex: 'e'
+          }
+        ]}
+        rowKey='id'
+        dataSource={[
+          {
+            id: 1,
+            custom: '珍贵文物',
+            level: '一级',
+            a: 'name'
+          },
+          {
+            id: 2,
+            level: '二级',
+            a: 'name2'
+          },
+          {
+            id: 3,
+            level: '三级',
+            a: 'name3'
+          },
+          {
+            id: 4,
+            custom: '未定级',
+            a: 'name'
+          },
+          {
+            id: 5,
+            custom: '一般文物',
+            a: 'name'
+          }
+        ]}
+        pagination={false}
+        bordered
+      />
+    </>
+  )
+}

+ 0 - 14
src/pages/A_workbench/A1dataSta/constants.ts

@@ -1,14 +0,0 @@
-export const A1DATA_TABS = [
-  {
-    label: '博物馆馆藏文物年度核查统计',
-    value: 0
-  },
-  {
-    label: '库存文物动态统计',
-    value: 1
-  },
-  {
-    label: '年度库房藏品',
-    value: 2
-  }
-]

+ 34 - 0
src/pages/A_workbench/A1dataSta/constants.tsx

@@ -0,0 +1,34 @@
+import { TabsProps } from 'antd'
+import { A1Tab1 } from './components/Tab1'
+import { A1Tab2 } from './components/Tab2'
+import { A1Tab3 } from './components/Tab3'
+
+export const A1DATA_TABS: TabsProps['items'] = [
+  {
+    label: '博物馆馆藏文物年度核查统计',
+    key: '0',
+    children: (
+      <>
+        <A1Tab1 />
+      </>
+    )
+  },
+  {
+    label: '库存文物动态统计',
+    key: '1',
+    children: (
+      <>
+        <A1Tab2 />
+      </>
+    )
+  },
+  {
+    label: '年度库房藏品',
+    key: '2',
+    children: (
+      <>
+        <A1Tab3 />
+      </>
+    )
+  }
+]

+ 1 - 0
src/pages/A_workbench/A1dataSta/panel.module.scss

@@ -3,6 +3,7 @@
   border-radius: 10px;
   padding: 24px 24px 0;
   position: relative;
+  overflow: auto;
   :global {
   }
 }

+ 3 - 1
src/pages/A_workbench/A1dataSta/panel.tsx

@@ -1,12 +1,14 @@
 import React from 'react'
 import styles from './panel.module.scss'
+import { Tabs } from 'antd'
+import { A1DATA_TABS } from './constants'
 
 function A1dataSta() {
   return (
     <div className={styles.A1dataSta}>
       <div className='pageTitle'>数据统计</div>
 
-      <div className='A1card'>123</div>
+      <Tabs items={A1DATA_TABS} />
     </div>
   )
 }

+ 1 - 1
src/pages/Layout/data.ts

@@ -10,7 +10,7 @@ const tabLeftArr: RouterType = [
         id: 110,
         name: '数据统计',
         path: '/',
-        Com: React.lazy(() => import('../A_workbench/A1dataSta'))
+        Com: React.lazy(() => import('../A_workbench/A1dataSta/panel'))
       },
       {
         id: 120,