123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314 |
- <template>
- <div class="flight-view">
- <div class="flight-view-top">
- <div class="flight-info-wrapper">
- <div class="air-line">{{ airLine }}</div>
- <div class="flight-info-box-wrapper">
- <div class="info-box">
- <div>起飞机场简称:{{ flightInfo.C0 }}</div>
- <div>日期:{{ flightInfo.C1 }}</div>
- <div>时间:{{ flightInfo.C2 }}</div>
- <div>停机位:{{ flightInfo.C3 }}</div>
- </div>
- <div class="iconBox">
- <el-icon color="#ffffff" :size="22"><CaretRight /></el-icon>
- </div>
- <div class="info-box">
- <div>特货信息/货物数:{{ flightInfo.C4 }}</div>
- <div>托运运单数/货物数:{{ flightInfo.C5 }}</div>
- <div>中转进运单/货物数:{{ flightInfo.C6 }}</div>
- <div>已配载集装器:{{ flightInfo.C7 }}</div>
- <div>货站已交接集装器:{{ flightInfo.C7 }}</div>
- <div>已装载集装器/运单/货物数:{{ flightInfo.C7 }}</div>
- <div>拉下集装器/运单/货物数:{{ flightInfo.C8 }}</div>
- <div>集装器数量:{{ flightInfo.C9 }}</div>
- </div>
- <div class="iconBox">
- <el-icon color="#ffffff" :size="22"><CaretRight /></el-icon>
- </div>
- <div class="info-box">
- <div>降落机场简称:{{ flightInfo.C10 }}</div>
- <div>日期:{{ flightInfo.C11 }}</div>
- <div>时间:{{ flightInfo.C12 }}</div>
- </div>
- </div>
- </div>
- <div v-if="isDeparture" class="container-list">
- <SimpleTable
- :data="containerTableData"
- :columns="containerTableColumns"
- :row-class-name="flightContainerRowClass"
- :cell-class-name="flightContainerCellClass"
- @cell-click="flightContainerCellClickHandler"
- />
- </div>
- </div>
- <div class="waybill-list-wrapper">
- <div class="waybill-list-header">
- <CommonSwitch v-model:flag="UTCFlag" label="开启UTC" />
- <el-button
- class="button-sqaure"
- :icon="Refresh"
- color="#ac014d"
- @click="refreshHandler"
- />
- <el-button
- class="button-sqaure"
- :icon="Download"
- color="#ac014d"
- @click="downloadHandler"
- />
- <ColumnSet
- class="button-sqaure"
- :table-columns="waybillTableColumns"
- @checked-submit="columnChecked"
- />
- <Search @search="search" @clear="clear" />
- </div>
- <div class="waybill-list">
- <SimpleTable
- ref="waybillTableRef"
- :data="waybillTableData"
- :columns="filteredWaybillColumns"
- :row-class-name="flightWaybillRowClass"
- :cell-class-name="flightWaybillCellClass"
- @cell-click="flightWaybillCellClickHandler"
- />
- </div>
- </div>
- </div>
- </template>
- <script setup lang="ts">
- import Search from '@/components/search/index.vue'
- import { CaretRight, Download, Refresh } from '@element-plus/icons-vue'
- import SimpleTable from '@/components/SimpleTable/index.vue'
- import CommonSwitch from '../../components/CommonSwitch/index.vue'
- import ColumnSet from '../../components/ColumnSet/index.vue'
- import { CommonData } from '~/common'
- import useTable from '../../hooks/useTable'
- import useTableColumnSet from '../../hooks/useTableColumnSet'
- import useTableExport from '../../hooks/useTableExport'
- import useTableStyle from '../../hooks/useTableStyle'
- import useTableCellClick from '../../hooks/useTableCellClick'
- import { Query } from '@/api/webApi'
- import { ElMessage } from 'element-plus'
- const props = defineProps({
- name: {
- type: String,
- required: true,
- },
- })
- const route = useRoute()
- const { flightNO, flightDate, departureAirport, landingAirport } = route.query
- // if (!flightNO || !flightDate) {
- // router.push('/')
- // }
- const dataContent = [
- flightNO,
- flightDate,
- departureAirport,
- landingAirport,
- ] as string[]
- const airLine = ref('SZX - CA4120 - NKG')
- const flightInfo = reactive<CommonData>({
- C0: '深圳机场',
- C1: '2021-12-24',
- C2: '19 : 30 : 25',
- C3: '012',
- C4: '0',
- C5: '0',
- C6: '0',
- C7: '0',
- C8: '0',
- C9: '0',
- C10: '南京机场',
- C11: '2021-12-24',
- C12: '22 : 25 : 25',
- })
- const getFlightInfo = async () => {
- try {
- const {
- code,
- returnData: { listValues },
- message,
- } = await Query({
- id: DATACONTENT_ID.flightInfo,
- dataContent,
- })
- if (Number(code) !== 0) {
- throw new Error(message ?? '失败')
- }
- if (!listValues.length) {
- ElMessage.error('未查询到航班信息')
- return
- }
- Object.assign(flightInfo, listValues[0])
- } catch (error) {
- console.error(error)
- }
- }
- // onMounted(() => {
- // getFlightInfo()
- // })
- const isDeparture = computed(() =>
- ['DepartureFlight', 'InternationalDepartureFlight'].includes(props.name)
- )
- const {
- tableColumns: containerTableColumns,
- tableData: containerTableData,
- } = useTable('flightContainer', dataContent)
- const {
- tableColumns: waybillTableColumns,
- tableData: waybillTableData,
- } = useTable('flightWaybill', dataContent)
- const UTCFlag = ref(true)
- const refreshHandler = () => {}
- const {
- filteredColumns: filteredWaybillColumns,
- columnChecked,
- } = useTableColumnSet(waybillTableColumns)
- //点击刷新按钮
- const refresh = data => {
- console.log(data)
- }
- const waybillTableRef = ref<InstanceType<typeof SimpleTable> | null>(null)
- const { exportToExcel } = useTableExport()
- //点击下载按钮
- const downloadHandler = () => {
- const table = waybillTableRef.value!.table!
- exportToExcel({ table })
- }
- //清空搜索
- const clear = () => {}
- //点击搜索按钮
- const search = (text: string) => {
- console.log(text)
- }
- const {
- rowClass: flightContainerRowClass,
- cellClass: flightContainerCellClass,
- } = useTableStyle('flightContainer')
- const {
- rowClass: flightWaybillRowClass,
- cellClass: flightWaybillCellClass,
- } = useTableStyle('flightWaybill')
- const { cellClickHandler: flightContainerCellClickHandler } = useTableCellClick(
- 'flightContainer'
- )
- const { cellClickHandler: flightWaybillCellClickHandler } = useTableCellClick(
- 'flightWaybill'
- )
- </script>
- <style lang="scss" scoped>
- .flight-view {
- width: 100%;
- height: 100%;
- display: flex;
- flex-direction: column;
- .flight-view-top {
- width: 100%;
- height: 345px;
- display: flex;
- .flight-info-wrapper {
- flex: 0 1 1040px;
- height: 100%;
- background: #410425;
- box-sizing: border-box;
- padding: 18px 32px;
- overflow: hidden;
- .air-line {
- font-size: 18px;
- font-weight: bold;
- color: #ffffff;
- width: 100%;
- margin-bottom: 16px;
- }
- .flight-info-box-wrapper {
- width: 100%;
- max-width: 976px;
- display: flex;
- justify-content: flex-start;
- justify-items: center;
- .info-box {
- width: calc(33.3% - 10px);
- background: #561638;
- padding: 10px 15px;
- box-sizing: border-box;
- font-size: 14px;
- font-weight: 400;
- color: #ffffff;
- line-height: 30px;
- }
- .iconBox {
- display: flex;
- flex-direction: column;
- width: 60px;
- justify-content: center;
- align-items: center;
- }
- }
- }
- .container-list {
- flex: 1;
- height: 100%;
- margin-left: 16px;
- .el-table :deep {
- .el-table__body .el-table__row {
- &.row-warning .el-table__cell {
- background-color: #f0c579;
- }
- }
- }
- }
- }
- .waybill-list-wrapper {
- height: 0;
- flex: 1;
- display: flex;
- flex-direction: column;
- .waybill-list-header :deep {
- height: 72px;
- display: flex;
- justify-content: flex-end;
- align-items: center;
- .button-sqaure {
- margin-left: 24px;
- width: 30px;
- height: 30px;
- border-radius: 4px;
- font-size: 16px;
- &:last-of-type {
- margin-right: 48px;
- }
- }
- }
- .waybill-list {
- height: 0;
- flex: 1;
- .el-table :deep {
- .el-table__body .el-table__row {
- &.row-warning .el-table__cell {
- background-color: #f0c579;
- }
- &.row-alarm .el-table__cell {
- background-color: #f38080;
- }
- }
- }
- }
- }
- }
- </style>
|