123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746 |
- import { Query } from '@/api/webApi'
- import { CommonValue, CommonData, CommonTableColumn } from '~/common'
- const idGetter = (name: string) => {
- if (name.endsWith('WaybillGoods')) {
- return DATACONTENT_ID.waybillGoods
- } else {
- return DATACONTENT_ID[name.slice(0, 1).toLowerCase() + name.slice(1)]
- }
- }
- const tableColumnsMap: {
- [tableName: string]: ({
- columnLabel: string
- columnName: string
- } & { [x: string]: any })[]
- } = {
- DepartureFlightContainer: [
- { columnLabel: '集装器编号', columnName: 'stowageNo', width: 120 },
- { columnLabel: '运单数', columnName: 'list', width: 60, needCount: 1 },
- { columnLabel: '件数', columnName: 'number', width: 60, needCount: 1 },
- {
- columnLabel: '加货',
- columnName: 'tally',
- className: 'cell-filter cell-filter-yellow',
- },
- {
- columnLabel: '拉下',
- columnName: 'pull',
- className: 'cell-filter cell-filter-yellow',
- },
- // {
- // columnLabel: '待运区',
- // columnName: 'wait',
- // className: 'cell-filter cell-filter-yellow',
- // },
- {
- columnLabel: '预配载',
- columnName: 'stowage',
- className: 'cell-filter cell-filter-yellow',
- },
- {
- columnLabel: '货站交接',
- columnName: 'depot',
- className: 'cell-filter cell-filter-yellow',
- },
- {
- columnLabel: '运输前复核',
- columnName: 'resure',
- className: 'cell-filter cell-filter-yellow',
- },
- {
- columnLabel: '机下交接',
- columnName: 'planeDown',
- className: 'cell-filter cell-filter-yellow',
- },
- {
- columnLabel: '装机',
- columnName: 'loadPlane',
- className: 'cell-filter cell-filter-yellow',
- },
- {
- columnLabel: '拉回确认',
- columnName: 'pullSure',
- className: 'cell-filter cell-filter-yellow',
- },
- ],
- DepartureFlightWaybill: [
- { columnLabel: '运单号', columnName: 'stockCode', width: 120 },
- { columnLabel: '集装器数量', columnName: 'stowageNum', needCount: 1 },
- {
- columnLabel: '品名',
- columnName: 'typeCode',
- width: 300,
- showOverflowTooltip: true,
- },
- { columnLabel: '特货信息', columnName: 'speCargoInfo' },
- { columnLabel: '货物件数', columnName: 'luggageCount', needCount: 1 },
- { columnLabel: '拉下件数', columnName: 'pullNum', needCount: 1 },
- { columnLabel: '退运件数', columnName: 'returnNum', needCount: 1 },
- { columnLabel: '最新节点', columnName: 'nodeCode' },
- { columnLabel: '最新位置', columnName: 'execPosition' },
- { columnLabel: '处理结果', columnName: 'execResult' },
- { columnLabel: '处理时间', columnName: 'execTime', width: 130 },
- // { columnLabel: '中转进航班号', columnName: 'inFlightNO' },
- // {
- // columnLabel: '中转航班降落时间',
- // columnName: 'inFlightNOLandTime',
- // width: 130,
- // },
- // { columnLabel: '装载序号', columnName: 'queueNo' },
- ],
- DepartureWaybillGoods: [
- {
- columnLabel: '航班号',
- columnName: 'flightNO',
- needFilters: 1,
- width: 70,
- },
- {
- columnLabel: '集装器编号',
- columnName: 'ULDNO',
- width: 100,
- needFilters: 1,
- },
- { columnLabel: '货物编码', columnName: 'CargoSN', needFilters: 1 },
- { columnLabel: '拉下', columnName: 'pullMark', needFilters: 1, width: 60 },
- {
- columnLabel: '退运',
- columnName: 'returnMark',
- needFilters: 1,
- width: 60,
- },
- {
- columnLabel: '收货核单',
- columnName: 'DEH',
- className: 'cell-filter cell-filter-green',
- },
- {
- columnLabel: '查验',
- columnName: 'ACC_CHECK',
- className: 'cell-filter cell-filter-green',
- },
- // {
- // columnLabel: '拒运',
- // columnName: 'ACC_CHECK_2',
- // className: 'cell-filter cell-filter-green',
- // },
- {
- columnLabel: '安检',
- columnName: '安检',
- className: 'cell-filter cell-filter-green',
- },
- {
- columnLabel: '加货',
- columnName: 'ACC_BUP',
- className: 'cell-filter cell-filter-green',
- },
- {
- columnLabel: '预配载',
- columnName: 'LS_CARGO',
- className: 'cell-filter cell-filter-green',
- },
- // {
- // columnLabel: '待运区',
- // columnName: 'WAT_LOC',
- // className: 'cell-filter cell-filter-green',
- // },
- {
- columnLabel: '货站交接',
- columnName: 'CARGOS_HANDOVER_STATUS_02',
- className: 'cell-filter cell-filter-green',
- },
- {
- columnLabel: '运输前复核',
- columnName: 'CARGOS_HANDOVER_STATUS_03',
- className: 'cell-filter cell-filter-green',
- },
- {
- columnLabel: '机下交接',
- columnName: '出港货邮',
- className: 'cell-filter cell-filter-green',
- },
- {
- columnLabel: '装机',
- columnName: '装载完成',
- className: 'cell-filter cell-filter-green',
- },
- {
- columnLabel: '关闭舱门',
- columnName: '关闭舱门',
- className: 'cell-filter cell-filter-green',
- },
- {
- columnLabel: '拉下登记',
- columnName: 'CARGOS_OFFLOAD',
- className: 'cell-filter cell-filter-green',
- },
- {
- columnLabel: '拉回确认',
- columnName: 'OFFLOAD_CONFIRM',
- className: 'cell-filter cell-filter-green',
- },
- // {
- // columnLabel: '起飞',
- // columnName: 'C15',
- // className: 'cell-filter cell-filter-green',
- // },
- {
- columnLabel: '退运',
- columnName: 'BILL_RETURN',
- className: 'cell-filter cell-filter-green',
- },
- {
- columnLabel: '卸机',
- columnName: 'CARGOS_ARR_HANDOVER',
- className: 'cell-filter cell-filter-cyan',
- },
- {
- columnLabel: '机下交接',
- columnName: 'CARGOS_HANDOVER_STATUS_01',
- className: 'cell-filter cell-filter-cyan',
- },
- {
- columnLabel: '货站交接',
- columnName: '货站交接',
- className: 'cell-filter cell-filter-cyan',
- },
- {
- columnLabel: '理货',
- columnName: 'IMP_TALLY',
- className: 'cell-filter cell-filter-cyan',
- },
- {
- columnLabel: '出库',
- columnName: 'FSUDLV',
- className: 'cell-filter cell-filter-cyan',
- },
- ],
- DepartureGoodsFlight: [
- { columnLabel: '航班号', columnName: 'C0' },
- { columnLabel: '航班日期', columnName: 'C1' },
- { columnLabel: '起飞航站\n预计起飞时间', columnName: 'C2' },
- { columnLabel: '目的航站\n预计降落时间', columnName: 'C3' },
- { columnLabel: '节点名称', columnName: 'C4' },
- { columnLabel: '位置码', columnName: 'C5' },
- { columnLabel: '位置描述', columnName: 'C6' },
- { columnLabel: '处理时间', columnName: 'C7' },
- { columnLabel: '处理结果', columnName: 'C8' },
- { columnLabel: '数据来源', columnName: 'C9' },
- { columnLabel: '设备ID', columnName: 'C10' },
- { columnLabel: '操作人', columnName: 'C11' },
- { columnLabel: '发往位置', columnName: 'C12' },
- { columnLabel: '发往位置描述', columnName: 'C13' },
- { columnLabel: '集装器编号', columnName: 'C14' },
- ],
- ArrivalFlightWaybill: [
- { columnLabel: '运单号', columnName: 'stockCode', width: 120 },
- {
- columnLabel: '品名',
- columnName: 'typeCode',
- width: 300,
- showOverflowTooltip: true,
- },
- { columnLabel: '特货信息', columnName: 'speCargoInfo', needCount: 1 },
- {
- columnLabel: '进港报文货物件数',
- columnName: 'messageCargos_in',
- needCount: 1,
- },
- {
- columnLabel: '进港实际货物件数',
- columnName: 'acCargos_in',
- needCount: 1,
- },
- { columnLabel: '最新节点', columnName: 'nodeCode' },
- { columnLabel: '最新位置', columnName: 'execPosition' },
- { columnLabel: '处理结果', columnName: 'execResult' },
- { columnLabel: '处理时间', columnName: 'execTime', width: 130 },
- // { columnLabel: '中转出航班号', columnName: 'transferFlightNO' },
- // {
- // columnLabel: '中转航班起飞时间',
- // columnName: 'transferFlightDepTime',
- // width: 130,
- // },
- // { columnLabel: '装载序号', columnName: 'queueNo' },
- ],
- ArrivalWaybillGoods: [
- {
- columnLabel: '航班号',
- columnName: 'flightNO',
- needFilters: 1,
- width: 70,
- },
- {
- columnLabel: '货物编码',
- columnName: 'CargoSN',
- needFilters: 1,
- width: 100,
- },
- // { columnLabel: '中转', columnName: 'transMark', needFilters: 1 },
- { columnLabel: '拉下', columnName: 'pullMark', needFilters: 1, width: 60 },
- {
- columnLabel: '退运',
- columnName: 'returnMark',
- needFilters: 1,
- width: 60,
- },
- {
- columnLabel: '卸机',
- columnName: 'CARGOS_ARR_HANDOVER',
- className: 'cell-filter cell-filter-cyan',
- },
- {
- columnLabel: '机下交接',
- columnName: 'CARGOS_HANDOVER_STATUS',
- className: 'cell-filter cell-filter-cyan',
- },
- {
- columnLabel: '货站交接',
- columnName: '货站交接',
- className: 'cell-filter cell-filter-cyan',
- },
- {
- columnLabel: '理货',
- columnName: 'IMP_TALLY',
- className: 'cell-filter cell-filter-cyan',
- },
- {
- columnLabel: '出库',
- columnName: 'FSUDLV',
- className: 'cell-filter cell-filter-cyan',
- },
- {
- columnLabel: '收货核单',
- columnName: 'DEH',
- className: 'cell-filter cell-filter-green',
- },
- {
- columnLabel: '查验',
- columnName: 'ACC_CHECK',
- className: 'cell-filter cell-filter-green',
- },
- // {
- // columnLabel: '拒运',
- // columnName: 'ACC_CHECK_2',
- // className: 'cell-filter cell-filter-green',
- // },
- {
- columnLabel: '安检',
- columnName: '安检',
- className: 'cell-filter cell-filter-green',
- },
- {
- columnLabel: '加货',
- columnName: 'ACC_BUP',
- className: 'cell-filter cell-filter-green',
- },
- {
- columnLabel: '预配载',
- columnName: 'LS_CARGO',
- className: 'cell-filter cell-filter-green',
- },
- // {
- // columnLabel: '待运区',
- // columnName: 'WAT_LOC',
- // className: 'cell-filter cell-filter-green',
- // },
- {
- columnLabel: '货站交接',
- columnName: 'CARGOS_HANDOVER_STATUS_02',
- className: 'cell-filter cell-filter-green',
- },
- {
- columnLabel: '运输前复核',
- columnName: 'CARGOS_HANDOVER_STATUS_03',
- className: 'cell-filter cell-filter-green',
- },
- {
- columnLabel: '机下交接',
- columnName: '出港货邮',
- className: 'cell-filter cell-filter-green',
- },
- {
- columnLabel: '装机',
- columnName: '装载完成',
- className: 'cell-filter cell-filter-green',
- },
- {
- columnLabel: '关闭舱门',
- columnName: '关闭舱门',
- className: 'cell-filter cell-filter-green',
- },
- {
- columnLabel: '拉下登记',
- columnName: 'CARGOS_OFFLOAD',
- className: 'cell-filter cell-filter-green',
- },
- {
- columnLabel: '拉回确认',
- columnName: 'OFFLOAD_CONFIRM',
- className: 'cell-filter cell-filter-green',
- },
- // {
- // columnLabel: '起飞',
- // columnName: 'C15',
- // className: 'cell-filter cell-filter-green',
- // },
- {
- columnLabel: '退运',
- columnName: 'BILL_RETURN',
- className: 'cell-filter cell-filter-green',
- },
- ],
- ArrivalGoodsFlight: [
- { columnLabel: '航班号', columnName: 'C0' },
- { columnLabel: '航班日期', columnName: 'C1' },
- { columnLabel: '起飞航站\n预计起飞时间', columnName: 'C2' },
- { columnLabel: '目的航站\n预计降落时间', columnName: 'C3' },
- { columnLabel: '节点名称', columnName: 'C4' },
- { columnLabel: '位置码', columnName: 'C5' },
- { columnLabel: '位置描述', columnName: 'C6' },
- { columnLabel: '处理时间', columnName: 'C7' },
- { columnLabel: '处理结果', columnName: 'C8' },
- { columnLabel: '数据来源', columnName: 'C9' },
- { columnLabel: '设备ID', columnName: 'C10' },
- { columnLabel: '操作人', columnName: 'C11' },
- { columnLabel: '发往位置', columnName: 'C12' },
- { columnLabel: '发往位置描述', columnName: 'C13' },
- ],
- InternationalDepartureFlightContainer: [
- { columnLabel: '集装器编号', columnName: 'stowageNo', width: 120 },
- { columnLabel: '运单数', columnName: 'list', width: 60, needCount: 1 },
- { columnLabel: '件数', columnName: 'number', width: 60, needCount: 1 },
- {
- columnLabel: '加货',
- columnName: 'tally',
- className: 'cell-filter cell-filter-yellow',
- },
- {
- columnLabel: '拉下',
- columnName: 'pull',
- className: 'cell-filter cell-filter-yellow',
- },
- // {
- // columnLabel: '待运区',
- // columnName: 'wait',
- // className: 'cell-filter cell-filter-yellow',
- // },
- {
- columnLabel: '预配载',
- columnName: 'stowage',
- className: 'cell-filter cell-filter-yellow',
- },
- {
- columnLabel: '货站交接',
- columnName: 'depot',
- className: 'cell-filter cell-filter-yellow',
- },
- {
- columnLabel: '运输前复核',
- columnName: 'resure',
- className: 'cell-filter cell-filter-yellow',
- },
- {
- columnLabel: '机下交接',
- columnName: 'planeDown',
- className: 'cell-filter cell-filter-yellow',
- },
- {
- columnLabel: '装机',
- columnName: 'loadPlane',
- className: 'cell-filter cell-filter-yellow',
- },
- {
- columnLabel: '拉回确认',
- columnName: 'pullSure',
- className: 'cell-filter cell-filter-yellow',
- },
- ],
- InternationalDepartureFlightWaybill: [
- { columnLabel: '运单号', columnName: 'stockCode', width: 120 },
- { columnLabel: '集装器数量', columnName: 'stowageNum', needCount: 1 },
- {
- columnLabel: '品名',
- columnName: 'typeCode',
- width: 300,
- showOverflowTooltip: true,
- },
- { columnLabel: '特货信息', columnName: 'speCargoInfo' },
- { columnLabel: '货物件数', columnName: 'luggageCount', needCount: 1 },
- { columnLabel: '拉下件数', columnName: 'pullNum', needCount: 1 },
- { columnLabel: '退运件数', columnName: 'returnNum', needCount: 1 },
- { columnLabel: '最新节点', columnName: 'nodeCode' },
- { columnLabel: '最新位置', columnName: 'execPosition' },
- { columnLabel: '处理结果', columnName: 'execResult' },
- { columnLabel: '处理时间', columnName: 'execTime', width: 130 },
- // { columnLabel: '中转进航班号', columnName: 'inFlightNO' },
- // {
- // columnLabel: '中转航班降落时间',
- // columnName: 'inFlightNOLandTime',
- // width: 130,
- // },
- // { columnLabel: '装载序号', columnName: 'queueNo' },
- ],
- InternationalDepartureWaybillGoods: [
- {
- columnLabel: '航班号',
- columnName: 'flightNO',
- needFilters: 1,
- width: 70,
- },
- {
- columnLabel: '集装器编号',
- columnName: 'ULDNO',
- width: 100,
- needFilters: 1,
- },
- { columnLabel: '货物编码', columnName: 'CargoSN', needFilters: 1 },
- { columnLabel: '拉下', columnName: 'pullMark', needFilters: 1, width: 60 },
- {
- columnLabel: '退运',
- columnName: 'returnMark',
- needFilters: 1,
- width: 60,
- },
- {
- columnLabel: '入园',
- columnName: 'EPORTREL',
- className: 'cell-filter cell-filter-green',
- },
- {
- columnLabel: '海关',
- columnName: 'MTREL_out',
- className: 'cell-filter cell-filter-green',
- },
- {
- columnLabel: '运抵',
- columnName: 'FOH',
- className: 'cell-filter cell-filter-green',
- },
- {
- columnLabel: '安检',
- columnName: 'REH',
- className: 'cell-filter cell-filter-green',
- },
- {
- columnLabel: '收运核单',
- columnName: 'RCS',
- className: 'cell-filter cell-filter-green',
- },
- {
- columnLabel: '理货',
- columnName: '板箱清单XML',
- className: 'cell-filter cell-filter-green',
- },
- {
- columnLabel: '拉下',
- columnName: 'CARGOS_OFFLOAD',
- className: 'cell-filter cell-filter-green',
- },
- {
- columnLabel: '待运区',
- columnName: 'WAT_LOC',
- className: 'cell-filter cell-filter-green',
- },
- {
- columnLabel: '货站交接',
- columnName: 'CARGOS_HANDOVER_STATUS_02',
- className: 'cell-filter cell-filter-green',
- },
- {
- columnLabel: '机下交接',
- columnName: '出港货邮',
- className: 'cell-filter cell-filter-green',
- },
- {
- columnLabel: '装机',
- columnName: '装载完成',
- className: 'cell-filter cell-filter-green',
- },
- ],
- InternationalDepartureGoodsFlight: [
- { columnLabel: '航班号', columnName: 'C0' },
- { columnLabel: '航班日期', columnName: 'C1' },
- { columnLabel: '起飞航站\n预计起飞时间', columnName: 'C2' },
- { columnLabel: '目的航站\n预计降落时间', columnName: 'C3' },
- { columnLabel: '节点名称', columnName: 'C4' },
- { columnLabel: '位置码', columnName: 'C5' },
- { columnLabel: '位置描述', columnName: 'C6' },
- { columnLabel: '处理时间', columnName: 'C7' },
- { columnLabel: '处理结果', columnName: 'C8' },
- { columnLabel: '数据来源', columnName: 'C9' },
- { columnLabel: '设备ID', columnName: 'C10' },
- { columnLabel: '操作人', columnName: 'C11' },
- { columnLabel: '发往位置', columnName: 'C12' },
- { columnLabel: '发往位置描述', columnName: 'C13' },
- { columnLabel: '集装器编号', columnName: 'C14' },
- ],
- InternationalArrivalFlightWaybill: [
- { columnLabel: '运单号', columnName: 'stockCode', width: 120 },
- {
- columnLabel: '品名',
- columnName: 'typeCode',
- width: 160,
- showOverflowTooltip: true,
- },
- { columnLabel: '特货信息', columnName: 'speCargoInfo', needCount: 1 },
- {
- columnLabel: '进港报文货物件数',
- columnName: 'messageCargos_in',
- needCount: 1,
- },
- {
- columnLabel: '进港实际货物件数',
- columnName: 'acCargos_in',
- needCount: 1,
- },
- { columnLabel: '最新节点', columnName: 'nodeCode' },
- { columnLabel: '最新位置', columnName: 'execPosition' },
- { columnLabel: '处理结果', columnName: 'execResult' },
- { columnLabel: '处理时间', columnName: 'execTime', width: 130 },
- { columnLabel: '中转出航班号', columnName: 'transferFlightNO' },
- {
- columnLabel: '中转航班起飞时间',
- columnName: 'transferFlightDepTime',
- width: 130,
- },
- { columnLabel: '装载序号', columnName: 'queueNo' },
- ],
- InternationalArrivalWaybillGoods: [
- {
- columnLabel: '航班号',
- columnName: 'flightNO',
- needFilters: 1,
- width: 70,
- },
- { columnLabel: '货物编码', columnName: 'C1', needFilters: 1, width: 100 },
- // { columnLabel: '中转', columnName: 'C2', needFilters: 1 },
- {
- columnLabel: '退运',
- columnName: 'returnMark',
- needFilters: 1,
- width: 60,
- },
- {
- columnLabel: '海关异常',
- columnName: 'exceptionCustomsMark',
- needFilters: 1,
- width: 60,
- },
- {
- columnLabel: '卸机',
- columnName: 'FFM',
- className: 'cell-filter cell-filter-green',
- },
- {
- columnLabel: '机下交接',
- columnName: 'CARGOS_HANDOVER_STATUS_01',
- className: 'cell-filter cell-filter-green',
- },
- {
- columnLabel: '货站交接',
- columnName: 'CARGOS_HANDOVER_STATUS_99',
- className: 'cell-filter cell-filter-green',
- },
- {
- columnLabel: '理货',
- columnName: 'RCF报',
- className: 'cell-filter cell-filter-green',
- },
- {
- columnLabel: '海关放行',
- columnName: 'MTREL_in',
- className: 'cell-filter cell-filter-green',
- },
- {
- columnLabel: '出库',
- columnName: 'DLV报',
- className: 'cell-filter cell-filter-green',
- },
- // {
- // columnLabel: '海关罚没',
- // columnName: 'C11',
- // className: 'cell-filter cell-filter-green',
- // },
- ],
- InternationalArrivalGoodsFlight: [
- { columnLabel: '航班号', columnName: 'C0' },
- { columnLabel: '航班日期', columnName: 'C1' },
- { columnLabel: '起飞航站\n预计起飞时间', columnName: 'C2' },
- { columnLabel: '目的航站\n预计降落时间', columnName: 'C3' },
- { columnLabel: '节点名称', columnName: 'C4' },
- { columnLabel: '位置码', columnName: 'C5' },
- { columnLabel: '位置描述', columnName: 'C6' },
- { columnLabel: '处理时间', columnName: 'C7' },
- { columnLabel: '处理结果', columnName: 'C8' },
- { columnLabel: '数据来源', columnName: 'C9' },
- { columnLabel: '设备ID', columnName: 'C10' },
- { columnLabel: '操作人', columnName: 'C11' },
- { columnLabel: '发往位置', columnName: 'C12' },
- { columnLabel: '发往位置描述', columnName: 'C13' },
- ],
- }
- export function useTable(tableName: string, dataContent?: CommonValue[]) {
- const tableColumns = ref<CommonTableColumn[]>([])
- const tableData = ref<CommonData[]>([])
- const getTableColumns = () => {
- tableColumns.value = tableColumnsMap[tableName].map(column => ({
- columnDescribe: '',
- dataType: '',
- listqueryTemplateID: null,
- needCount: null,
- needFilters: null,
- needGroup: null,
- needSearch: null,
- needShow: 1,
- needSort: null,
- orderNumber: null,
- queryTemplateColumnSetID: null,
- queryTemplateID: null,
- ...column,
- }))
- }
- const getTableData = async () => {
- if (!idGetter(tableName)) {
- return
- }
- try {
- const {
- code,
- returnData: { listValues },
- message,
- } = await Query<CommonData>({
- id: idGetter(tableName),
- dataContent,
- })
- if (Number(code) !== 0) {
- throw new Error(message || '失败')
- }
- tableData.value = listValues.filter(
- row =>
- !Object.values(row).some(
- cellValue =>
- typeof cellValue === 'string' && cellValue.includes('undefined')
- )
- )
- } catch (error) {
- console.error(error)
- }
- }
- onMounted(() => {
- if (tableColumnsMap[tableName]) {
- getTableColumns()
- // getTableData()
- }
- })
- return {
- tableColumns,
- tableData,
- getTableData,
- }
- }
|