|
@@ -1,15 +1,16 @@
|
|
|
+import { Column } from 'element-plus'
|
|
|
import type { KeyType } from '../components/ColumnSet/index.vue'
|
|
|
import { tableColumnInGroup } from '../components/ColumnSet/index.vue'
|
|
|
|
|
|
-type tableColumnsGroups = {
|
|
|
+type tableColumnsGroup = {
|
|
|
groupTitle: string
|
|
|
children: {
|
|
|
key: KeyType
|
|
|
title: string
|
|
|
width?: number
|
|
|
- headerClass: string
|
|
|
+ headerClass?: string
|
|
|
}[]
|
|
|
-}[]
|
|
|
+}
|
|
|
|
|
|
enum Alignment {
|
|
|
LEFT = 'left',
|
|
@@ -17,26 +18,408 @@ enum Alignment {
|
|
|
RIGHT = 'right',
|
|
|
}
|
|
|
|
|
|
-const gourpNumber = 3
|
|
|
-const groupColumnNumber = 6
|
|
|
const headerClassReflect = ['bg-yellow', 'bg-green', 'bg-cyan']
|
|
|
|
|
|
-export default function useTableData() {
|
|
|
- const tableColumns = ref<tableColumnInGroup[]>([])
|
|
|
+const groupsObj = {
|
|
|
+ departure: [
|
|
|
+ {
|
|
|
+ groupTitle: '航班相关',
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ key: 'flightNO',
|
|
|
+ title: '航班号',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: 'flightDate',
|
|
|
+ title: '执飞日期',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: 'takeOffTime',
|
|
|
+ title: '起飞时间',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: 'desitination',
|
|
|
+ title: '目的站',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: 'gate',
|
|
|
+ title: '停机位',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: 'preFlightNO',
|
|
|
+ title: '前序航班',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: 'landingTime',
|
|
|
+ title: '实际降落\n时间',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ groupTitle: '货站相关',
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ key: 'special',
|
|
|
+ title: '特货信息',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: 'projectLoad',
|
|
|
+ title: '预计装载数\n(运单/件)',
|
|
|
+ width: 100,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: 'transferIn',
|
|
|
+ title: '中转进\n(运单/件)',
|
|
|
+ width: 100,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: 'cancel',
|
|
|
+ title: '退运\n(板卡/件)',
|
|
|
+ width: 100,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ groupTitle: '地服相关',
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ key: 'receive',
|
|
|
+ title: '收运核单\n(运单/件/重量)',
|
|
|
+ width: 140,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: 'check',
|
|
|
+ title: '查验\n(拒运/查验)',
|
|
|
+ width: 120,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: 'security',
|
|
|
+ title: '安检\n(运单/件)',
|
|
|
+ width: 100,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: 'add',
|
|
|
+ title: '加货\n(运单/板卡/件/重量)',
|
|
|
+ width: 160,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: 'wait',
|
|
|
+ title: '待运区\n(板卡/件)',
|
|
|
+ width: 100,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: 'stowage',
|
|
|
+ title: '配载\n(板卡/件)',
|
|
|
+ width: 100,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: 'handOverTime',
|
|
|
+ title: '计划交接\n时间',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: 'stationHandOver',
|
|
|
+ title: '货站交接\n(板卡/件)',
|
|
|
+ width: 100,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: 'recheck',
|
|
|
+ title: '运输前复核\n(板卡/件)',
|
|
|
+ width: 100,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: 'flightHandOver',
|
|
|
+ title: '机下交接\n(板卡/件)',
|
|
|
+ width: 100,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: 'load',
|
|
|
+ title: '装机\n(板卡/件)',
|
|
|
+ width: 100,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: 'goodsRegister',
|
|
|
+ title: '拉货登记\n(板卡/件)',
|
|
|
+ width: 100,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: 'pullBack',
|
|
|
+ title: '拉回确认\n(板卡/件)',
|
|
|
+ width: 100,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ arrival: [
|
|
|
+ {
|
|
|
+ groupTitle: '航班相关',
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ key: 'flightNO',
|
|
|
+ title: '航班号',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: 'flightDate',
|
|
|
+ title: '执飞日期',
|
|
|
+ width: 100,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: 'landingTime',
|
|
|
+ title: '降落时间',
|
|
|
+ width: 100,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: 'desitination',
|
|
|
+ title: '目的站',
|
|
|
+ width: 100,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: 'gate',
|
|
|
+ title: '停机位',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ groupTitle: '货站相关',
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ key: 'special',
|
|
|
+ title: '特货信息',
|
|
|
+ width: 100,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: 'projectUnload',
|
|
|
+ title: '预计卸载数\n(运单/件)',
|
|
|
+ width: 100,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: 'transferOut',
|
|
|
+ title: '中转出\n(运单/件)',
|
|
|
+ width: 100,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: 'difference',
|
|
|
+ title: '收货差异\n(板卡/件)',
|
|
|
+ width: 100,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ groupTitle: '地服相关',
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ key: 'unload',
|
|
|
+ title: '卸机\n(板/箱/卡)',
|
|
|
+ width: 160,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: 'flightHandOver',
|
|
|
+ title: '机下交接\n(板/箱/卡)',
|
|
|
+ width: 160,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: 'stationHandOver',
|
|
|
+ title: '货站交接\n(板/箱/卡)',
|
|
|
+ width: 160,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: 'settle',
|
|
|
+ title: '理货\n(板卡/运单/件/重量)',
|
|
|
+ width: 160,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: 'outCargo',
|
|
|
+ title: '出库\n(批/运单/件)',
|
|
|
+ width: 160,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ ],
|
|
|
+}
|
|
|
+
|
|
|
+const tableDatas = {
|
|
|
+ departure: [
|
|
|
+ {
|
|
|
+ flightNO: 'ZH3423',
|
|
|
+ flightDate: '2022/09/10',
|
|
|
+ takeOffTime: '22/09/10 12:01',
|
|
|
+ desitination: '-NGK-PEK',
|
|
|
+ gate: '84',
|
|
|
+ preFlightNO: 'HU2451',
|
|
|
+ landingTime: '2022/09/10 11:01',
|
|
|
+ special: '锂2/冷1',
|
|
|
+ projectLoad: '365/536',
|
|
|
+ transferIn: '1/2',
|
|
|
+ cancel: '',
|
|
|
+ receive: '364/534/1254KG',
|
|
|
+ check: '0/7',
|
|
|
+ security: '364/534',
|
|
|
+ add: '8/365/536/1254KG',
|
|
|
+ wait: '8/536',
|
|
|
+ stowage: '8/536',
|
|
|
+ handOverTime: '11:45',
|
|
|
+ stationHandOver: '8/536',
|
|
|
+ recheck: '8/536',
|
|
|
+ flightHandOver: '8/536',
|
|
|
+ load: '8/536',
|
|
|
+ goodsRegister: '0/358/5',
|
|
|
+ pullBack: '0/5',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ flightNO: 'CA1512',
|
|
|
+ flightDate: '2022/09/10',
|
|
|
+ takeOffTime: '22/09/10 12:01',
|
|
|
+ desitination: '-NGK-PEK',
|
|
|
+ gate: '84',
|
|
|
+ preFlightNO: 'HU2451',
|
|
|
+ landingTime: '2022/09/10 11:01',
|
|
|
+ special: '锂2/冷1',
|
|
|
+ projectLoad: '365/536',
|
|
|
+ transferIn: '1/2',
|
|
|
+ cancel: '',
|
|
|
+ receive: '364/534/1254KG',
|
|
|
+ check: '0/7',
|
|
|
+ security: '364/534',
|
|
|
+ add: '8/365/536/1254KG',
|
|
|
+ wait: '4/243',
|
|
|
+ stowage: '8/536',
|
|
|
+ handOverTime: '11:45',
|
|
|
+ stationHandOver: '8/536',
|
|
|
+ recheck: '8/536',
|
|
|
+ flightHandOver: '8/536',
|
|
|
+ load: '8/536',
|
|
|
+ goodsRegister: '0/358/5',
|
|
|
+ pullBack: '0/5',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ flightNO: 'ZH3456',
|
|
|
+ flightDate: '2022/09/10',
|
|
|
+ takeOffTime: '22/09/10 12:01',
|
|
|
+ desitination: '-NGK-PEK',
|
|
|
+ gate: '84',
|
|
|
+ preFlightNO: 'HU2451',
|
|
|
+ landingTime: '2022/09/10 11:01',
|
|
|
+ special: '锂2/冷1',
|
|
|
+ projectLoad: '365/536',
|
|
|
+ transferIn: '1/2',
|
|
|
+ cancel: '',
|
|
|
+ receive: '364/534/1254KG',
|
|
|
+ check: '0/7',
|
|
|
+ security: '364/534',
|
|
|
+ add: '8/365/536/1254KG',
|
|
|
+ wait: '8/536',
|
|
|
+ stowage: '5/357',
|
|
|
+ handOverTime: '11:45',
|
|
|
+ stationHandOver: '8/536',
|
|
|
+ recheck: '8/536',
|
|
|
+ flightHandOver: '8/536',
|
|
|
+ load: '8/536',
|
|
|
+ goodsRegister: '0/358/5',
|
|
|
+ pullBack: '0/5',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ arrival: [
|
|
|
+ {
|
|
|
+ flightNO: 'ZH3423',
|
|
|
+ flightDate: '2022/09/10',
|
|
|
+ landingTime: '22/09/10 12:01',
|
|
|
+ desitination: 'NKG-PEK-',
|
|
|
+ gate: '84',
|
|
|
+ special: '锂2/冷1',
|
|
|
+ projectUnload: '363/543',
|
|
|
+ transferOut: '',
|
|
|
+ difference: '0/6',
|
|
|
+ unload: '8/8/8',
|
|
|
+ flightHandOver: '8/8/8',
|
|
|
+ stationHandOver: '8/8/8',
|
|
|
+ settle: '8/363/537/1254KG',
|
|
|
+ outCargo: '3/363/537',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ flightNO: 'CA1512',
|
|
|
+ flightDate: '2022/09/10',
|
|
|
+ landingTime: '22/09/10 12:01',
|
|
|
+ desitination: 'NKG-PEK-',
|
|
|
+ gate: '84',
|
|
|
+ special: '锂2/冷1',
|
|
|
+ projectUnload: '363/543',
|
|
|
+ transferOut: '',
|
|
|
+ difference: '',
|
|
|
+ unload: '8/8/8',
|
|
|
+ flightHandOver: '8/8/8',
|
|
|
+ stationHandOver: '8/8/8',
|
|
|
+ settle: '8/363/537/1254KG',
|
|
|
+ outCargo: '3/363/537',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ flightNO: 'ZH3456',
|
|
|
+ flightDate: '2022/09/10',
|
|
|
+ landingTime: '22/09/10 12:01',
|
|
|
+ desitination: 'NKG-PEK-',
|
|
|
+ gate: '84',
|
|
|
+ special: '锂2/冷1',
|
|
|
+ projectUnload: '363/543',
|
|
|
+ transferOut: '',
|
|
|
+ difference: '',
|
|
|
+ unload: '8/8/8',
|
|
|
+ flightHandOver: '8/8/8',
|
|
|
+ stationHandOver: '8/8/8',
|
|
|
+ settle: '8/363/537/1254KG',
|
|
|
+ outCargo: '3/363/537',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+}
|
|
|
+
|
|
|
+export default function useTableData(stationType: string = 'dearture') {
|
|
|
+ const tableColumns = ref<tableColumnInGroup[] | Column[]>([])
|
|
|
const tableData = ref<{}[]>([])
|
|
|
const getTableData = () => {
|
|
|
- const groups: tableColumnsGroups = Array.from({ length: gourpNumber }).map(
|
|
|
- (_, groupIndex) => ({
|
|
|
- groupTitle: `group${groupIndex + 1}`,
|
|
|
- children: Array.from({ length: groupColumnNumber }).map(
|
|
|
- (_, columnIndex) => ({
|
|
|
- key: `group${groupIndex}-column${columnIndex}`,
|
|
|
- title: `${groupIndex + 1}组-${columnIndex + 1}列`,
|
|
|
- width: 100,
|
|
|
- headerClass: headerClassReflect[groupIndex] || '',
|
|
|
- })
|
|
|
- ),
|
|
|
- })
|
|
|
+ if (stationType === 'test') {
|
|
|
+ tableColumns.value = [
|
|
|
+ {
|
|
|
+ key: 'flightNO',
|
|
|
+ title: '航班号',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: 'flightDate',
|
|
|
+ title: '执飞日期',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: 'takeOffTime',
|
|
|
+ title: '起飞时间',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: 'desitination',
|
|
|
+ title: '目的站',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: 'gate',
|
|
|
+ title: '停机位',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: 'preFlightNO',
|
|
|
+ title: '前序航班',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: 'landingTime',
|
|
|
+ title: '实际降落\n时间',
|
|
|
+ },
|
|
|
+ ].map(({ key, title }) => ({
|
|
|
+ key,
|
|
|
+ dataKey: key,
|
|
|
+ title,
|
|
|
+ width: 80,
|
|
|
+ align: Alignment.CENTER,
|
|
|
+ }))
|
|
|
+ tableData.value = tableDatas.arrival
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const groups: tableColumnsGroup[] = groupsObj[stationType].map(
|
|
|
+ (group: tableColumnsGroup, groupIndex: number) => {
|
|
|
+ group.children.forEach(column => {
|
|
|
+ column.headerClass = headerClassReflect[groupIndex]
|
|
|
+ })
|
|
|
+ return group
|
|
|
+ }
|
|
|
)
|
|
|
tableColumns.value = groups.reduce(
|
|
|
(columns: tableColumnInGroup[], group) => {
|
|
@@ -56,15 +439,7 @@ export default function useTableData() {
|
|
|
[]
|
|
|
)
|
|
|
|
|
|
- tableData.value = Array.from({ length: 20 }).map((_, rowIndex) =>
|
|
|
- tableColumns.value.reduce((rowData, column, columnIndex) => {
|
|
|
- rowData[column.dataKey] = `${rowIndex + 1}行-${
|
|
|
- Math.floor(columnIndex / groupColumnNumber) + 1
|
|
|
- }组-${(columnIndex % groupColumnNumber) + 1}列`
|
|
|
-
|
|
|
- return rowData
|
|
|
- }, {})
|
|
|
- )
|
|
|
+ tableData.value = tableDatas[stationType]
|
|
|
}
|
|
|
onMounted(() => {
|
|
|
getTableData()
|