index.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823
  1. <!--
  2. * @Author: zk
  3. * @Date: 2022-01-17 10:39:22
  4. * @LastEditTime: 2022-06-28 10:04:17
  5. * @LastEditors: your name
  6. * @Description: 中转进港
  7. -->
  8. <template>
  9. <div class="transfer-in">
  10. <!--功能区-表单-->
  11. <div ref="formWrap" class="terminal-form-wrap">
  12. <el-form ref="form" :inline="true" :model="formData" :rules="rules" class="form">
  13. <div class="form-left">
  14. <el-form-item prop="currentAirport">
  15. <!-- <el-cascader
  16. v-model="formData.currentAirport"
  17. style="width:144px;margin-left:10px"
  18. placeholder="全部机场"
  19. size="small"
  20. :options="currentAirportList"
  21. :props="currentAirportProps"
  22. collapse-tags
  23. clearable
  24. filterable
  25. @change="setCurrentAirport"
  26. /> -->
  27. <el-select v-model="formData.currentAirport" class="input-shadow" size="small" style="width: 100px" filterable default-first-option placeholder="请选择机场" @change="airPortChange">
  28. <el-option v-for="(item, index) in AirportList" :key="index" :label="item.planDepartureApt" :value="item.planDepartureApt" />
  29. </el-select>
  30. </el-form-item>
  31. <el-form-item prop="inboundCarrier">
  32. <el-cascader v-model="formData.inboundCarrier" class="input-shadow" style="width: 150px" size="small" :options="carrierProps" :props="optionProps" placeholder="进港承运航司" collapse-tags clearable filterable default-first-option @change="resetLoopEvent" />
  33. </el-form-item>
  34. <el-form-item prop="outgoingAirline">
  35. <el-cascader v-model="formData.outgoingAirline" class="input-shadow" style="width: 150px" size="small" :options="carrierPropsop" :props="optionPropser" placeholder="离港承运航司" collapse-tags clearable filterable default-first-option @change="resetLoopEvent" />
  36. </el-form-item>
  37. <!-- <el-form-item prop="startDate">
  38. <el-date-picker
  39. v-model="formData.startDate"
  40. class="input-shadow"
  41. style="width: 216px"
  42. size="small"
  43. type="date"
  44. value-format="yyyy-MM-dd"
  45. placeholder="开始时间"
  46. @change="startDateChangeHandler"
  47. />
  48. </el-form-item>
  49. <el-form-item prop="endDate">
  50. <el-date-picker
  51. v-model="formData.endDate"
  52. class="input-shadow"
  53. style="width: 216px"
  54. size="small"
  55. type="date"
  56. value-format="yyyy-MM-dd"
  57. placeholder="结束时间"
  58. @change="endDateChangeHandler"
  59. />
  60. </el-form-item> -->
  61. <el-form-item prop="flightDate" label="航班日期">
  62. <el-date-picker v-model="formData.flightDate" :clearable="false" size="small" style="width: 300px" type="daterange" value-format="yyyy-MM-dd" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="dateRangePickerOptions" @change="dateChangeHandler" />
  63. </el-form-item>
  64. <el-form-item>
  65. <div class="box-item">
  66. <p>预计中转数:</p>
  67. <li v-for="(item, index) in orderNum" :key="index" :class="{ 'number-item': !isNaN(item), 'mark-item': isNaN(item) }">
  68. <span v-if="!isNaN(item)">
  69. <i ref="numberItem">0123456789</i>
  70. </span>
  71. <span v-else class="comma">{{ item }}</span>
  72. </li>
  73. </div>
  74. </el-form-item>
  75. </div>
  76. <div class="form-right" @keyup.enter="onSubmit(1)">
  77. <el-form-item prop="search">
  78. <el-popover :value="popoverVisible" placement="bottom" trigger="manual">
  79. <span>请输入航班号(示例:CA1234)或行李牌号(示例:1234567890)</span>
  80. <el-input slot="reference" v-model="formData.search" class="input-shadow" style="width: 240px" size="small" placeholder="请输入内容" prefix-icon="el-icon-search" clearable @focus="popoverVisible = true" @blur="popoverVisible = false" />
  81. </el-popover>
  82. </el-form-item>
  83. <el-form-item>
  84. <el-button class="btn-shadow" size="mini" type="primary" @click="onSubmit(1)">搜索</el-button>
  85. </el-form-item>
  86. <el-form-item>
  87. <el-button class="btn-shadow" size="mini" type="primary" @click="changeView">切换视角</el-button>
  88. </el-form-item>
  89. <!-- <el-form-item v-is="['ti_timeIcon']">
  90. <TimeZoneSelector />
  91. </el-form-item> -->
  92. <el-form-item>
  93. <TimeZoneSelector />
  94. </el-form-item>
  95. <!-- <el-form-item v-is="['ti_columnSettings']">
  96. <img class="btn-img btn-shadow" src="@/assets/baggage/ic_setting.png" title="列设置" @click="show" />
  97. </el-form-item> -->
  98. <el-form-item>
  99. <img class="btn-img btn-shadow" src="@/assets/baggage/ic_setting.png" title="列设置" @click="show" />
  100. </el-form-item>
  101. <!-- <el-form-item v-is="['dm_dt_columnSettings']">
  102. <img class="btn-img btn-shadow" src="@/assets/baggage/ic_export.png" title="导出" @click="exportHandler('table', '航站中转进港列表')" />
  103. </el-form-item> -->
  104. <el-form-item>
  105. <img class="btn-img btn-shadow" src="@/assets/baggage/ic_export.png" title="导出" @click="exportHandler('table', '航站中转进港列表')" />
  106. </el-form-item>
  107. </div>
  108. </el-form>
  109. </div>
  110. <!--表格-->
  111. <div v-loading="loading" class="terminal-table" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading" element-loading-background="rgba(0, 0, 0, 0.8)">
  112. <el-table ref="table" class="table" :data="dealedTableData" :height="computedTableHeight" show-summary :summary-method="summaryMethod" :span-method="arraySpanMethod" :header-cell-class-name="headerCellClass" :row-class-name="tableRowClassName" :cell-class-name="cellClass" border stripe fit @cell-click="cellClickHandler">
  113. <el-table-column v-for="col in tableColsCopy" :key="col.prop" :prop="col.prop" :label="col.label" :width="col.width" :fixed="col.fixed">
  114. <el-table-column v-for="childCol in col.children" :key="childCol.prop" :prop="childCol.prop" :label="childCol.label" :width="childCol.width" :formatter="tableFormat">
  115. <template #header>
  116. <el-tooltip :content="childCol.desc || childCol.label" placement="top">
  117. <TableHeaderCell :label="childCol.label" :filter-options="tableDataFilters[childCol.prop]" :filter-values.sync="filterValues[childCol.prop]" :sortable="childCol.sortable" :sort-rule.sync="tableDataSortRules[childCol.prop]" />
  118. </el-tooltip>
  119. </template>
  120. </el-table-column>
  121. </el-table-column>
  122. </el-table>
  123. </div>
  124. <!--列设置-->
  125. <Dialog :flag="dialogFlag" class="dialog-check-group">
  126. <div class="dialog-wrapper">
  127. <div class="title">列设置</div>
  128. <div class="content">
  129. <el-tree :data="tableCols" :class="colsCheckClass" show-checkbox node-key="index" :default-expand-all="true" :props="{
  130. label: 'label',
  131. children: 'children',
  132. }" :default-checked-keys="checkedKeysTemp" @check="handleCheck" />
  133. </div>
  134. <div class="foot right t30">
  135. <el-button size="medium" class="r24" type="primary" @click="onCheck">确定</el-button>
  136. <el-button size="medium" @click="hide">取消</el-button>
  137. </div>
  138. </div>
  139. </Dialog>
  140. </div>
  141. </template>
  142. <script>
  143. import Dialog from "@/layout/components/Dialog";
  144. import TimeZoneSelector from "@/components/TimeZoneSelector";
  145. import terminalMixin from "../../mixins/terminal";
  146. import formMixin from "../../mixins/form";
  147. import tableColsMixin from "../../mixins/tableCols";
  148. import timeZoneMixin from "../../mixins/timeZone";
  149. import { getQuery } from "@/api/flight";
  150. import TableHeaderCell from "@/components/TableHeaderCell";
  151. import { setTableFilters, throttledExportToExcel } from "@/utils/table";
  152. export default {
  153. name: "DepartureTerminalView",
  154. components: { Dialog, TimeZoneSelector, TableHeaderCell },
  155. mixins: [terminalMixin, formMixin, tableColsMixin, timeZoneMixin],
  156. data () {
  157. return {
  158. optionProps: {
  159. value: "inAicompanyCode2",
  160. label: "inAicompanyCode2",
  161. },
  162. optionPropser: {
  163. value: "outAicompanyCode2",
  164. label: "outAicompanyCode2",
  165. },
  166. popoverVisible: false,
  167. orderNum: ["0", "0", "0", "0", "0", "0"], // 默认总数
  168. // 初始表头
  169. tableCols: [
  170. {
  171. prop: "arrivalInfo",
  172. label: "进港航班",
  173. width: 180,
  174. fixed: "left",
  175. children: [
  176. {
  177. prop: "preFlightNO",
  178. label: "航班号",
  179. desc: "进港航班编号",
  180. width: 80,
  181. filterable: true,
  182. sortable: true,
  183. },
  184. {
  185. prop: "preFlightDate",
  186. label: "航班日期",
  187. desc: "指航班计划起飞日期(不变的,机票上),不是预计起飞日期(预计起飞时间可能多个),也不是实际起飞日期(实际起飞等于最后预计)",
  188. width: 100,
  189. },
  190. {
  191. prop: "preAirport",
  192. label: "起飞航站",
  193. desc: "指进港航班的起飞机场三字码",
  194. width: 100,
  195. filterable: true,
  196. sortable: true,
  197. },
  198. {
  199. prop: "actualLandingTime",
  200. label: "降落时间",
  201. desc: "根据优先级别显示时间。优先级别:1.实际降落时间,2.预计降落时间,3.计划降落时间",
  202. width: 100,
  203. },
  204. {
  205. prop: "landingBuild",
  206. label: "降落航站楼",
  207. desc: "指航班降落后位于机场的哪个航站楼",
  208. width: 98,
  209. filterable: true,
  210. sortable: true,
  211. },
  212. {
  213. prop: "carousel",
  214. label: "行李转盘",
  215. desc: "指航班到达后行李提取的地方,仅显示最新信息",
  216. width: 100,
  217. filterable: true,
  218. sortable: true,
  219. },
  220. {
  221. prop: "standForLanding",
  222. label: "降落停机位",
  223. desc: "指航班的停机位代码,数据是变化的,仅显示最新信息",
  224. width: 98,
  225. filterable: true,
  226. sortable: true,
  227. },
  228. {
  229. prop: "inTransferBaggageCount",
  230. label: "中转行李数",
  231. desc: "指航班在本航站预计需要中转至对应航班的行李数量",
  232. },
  233. ],
  234. },
  235. {
  236. prop: "departureInfo",
  237. label: "离港航班",
  238. children: [
  239. {
  240. prop: "inTransferredBaggageCount",
  241. label: "已中转行李数",
  242. desc: "指航班在本航站实际已经中转至对应航班的行李数量",
  243. width: 100,
  244. },
  245. {
  246. prop: "flightNO",
  247. label: "航班号",
  248. desc: "指航班编号",
  249. width: 80,
  250. filterable: true,
  251. sortable: true,
  252. },
  253. {
  254. prop: "flightDate",
  255. label: "航班日期",
  256. desc: "指航班计划起飞日期(不变的,机票上),不是预计起飞日期(预计起飞时间可能多个),也不是实际起飞日期(实际起飞等于最后预计)",
  257. width: 100,
  258. },
  259. {
  260. prop: "actualDepartureTime",
  261. label: "起飞时间",
  262. desc: "指航班预计起飞时间,数据是变化的,仅显示最新结果",
  263. width: 100,
  264. },
  265. {
  266. prop: "targetAirport",
  267. label: "目的站",
  268. desc: "指航班执飞航段的目的航站,以航站三字码+航站简称显示",
  269. filterable: true,
  270. sortable: true,
  271. },
  272. {
  273. prop: "departureBuild",
  274. label: "起飞航站楼",
  275. desc: "指航班执飞航段的起飞航站的航站楼",
  276. width: 98,
  277. filterable: true,
  278. sortable: true,
  279. },
  280. {
  281. prop: "bordingGate",
  282. label: "起飞登机口",
  283. desc: "指航班的登机口代码,数据是变化的,仅显示最新信息",
  284. width: 98,
  285. filterable: true,
  286. sortable: true,
  287. },
  288. {
  289. prop: "standForDepartrue",
  290. label: "起飞停机位",
  291. desc: "指航班的停机位代码,数据是变化的,仅显示最新信息",
  292. width: 98,
  293. filterable: true,
  294. sortable: true,
  295. },
  296. // {
  297. // prop: 'outTransferBaggageCount',
  298. // label: '中转进行李数',
  299. // desc: '指其它航班预计中转至本航班的行李数量',
  300. // width: 100
  301. // },
  302. // {
  303. // prop: 'outTransferredBaggageCount',
  304. // label: '已中转进行李数',
  305. // desc: '指其它航班实际已中转至本航班的行李数量',
  306. // width: 120
  307. // },
  308. {
  309. prop: "timeDifference",
  310. label: "转运时间",
  311. desc: "指中转动作完成时间",
  312. },
  313. ],
  314. },
  315. ],
  316. loading: false,
  317. AirportList: [],
  318. carrierProps: [],
  319. carrierPropsop: [],
  320. loopEvent: null,
  321. arrivalCount: 0,
  322. baggageCount: 0,
  323. hasSetTableScroll: false,
  324. spanArr: [],
  325. contactDot: 0,
  326. flag: 0,
  327. table: null,
  328. };
  329. },
  330. computed: {
  331. singleDay () {
  332. return this.startDate === this.endDate;
  333. },
  334. },
  335. watch: {
  336. dealedTableData: {
  337. handler (val) {
  338. this.spanArr = [];
  339. let contactDot = this.contactDot;
  340. val.forEach((item, index, arr) => {
  341. if (index === 0) {
  342. this.spanArr.push(1);
  343. } else {
  344. if (item["preFlightNO"] === arr[index - 1]["preFlightNO"] && item["preFlightDate"] === arr[index - 1]["preFlightDate"]) {
  345. this.spanArr[contactDot] += 1;
  346. this.spanArr.push(0);
  347. } else {
  348. this.spanArr.push(1);
  349. contactDot = index;
  350. }
  351. }
  352. });
  353. },
  354. deep: true,
  355. },
  356. },
  357. created () {
  358. // this.getAirPortData()
  359. },
  360. mounted () {
  361. this.$refs["form"].validateField("flightDate");
  362. this.getAirPortData();
  363. this.table = this.$refs.table.bodyWrapper;
  364. const that = this;
  365. this.table.addEventListener("scroll", () => {
  366. that.scrollTop = this.table.scrollTop;
  367. });
  368. },
  369. activated () {
  370. this.table.scrollTop = this.scrollTop;
  371. this.getTableData();
  372. this.loopEvent = setInterval(this.getTableData, LOOP_INTERVAL.transferArrivalTable);
  373. // const { startDate, endDate } = this.$route.query
  374. // Object.entries(this.$route.query).forEach(([key, value]) => {
  375. // if ((value ?? '') !== '' && JSON.stringify(value) !== '[]') {
  376. // this.formData[key] = value
  377. // }
  378. // })
  379. // if (startDate !== null && startDate !== undefined) {
  380. // this.formData.flightDate[0] = startDate
  381. // }
  382. // if (endDate !== null && endDate !== undefined) {
  383. // this.formData.flightDate[1] = endDate
  384. // }
  385. },
  386. deactivated () {
  387. if (this.loopEvent) {
  388. clearInterval(this.loopEvent);
  389. this.loopEvent = null;
  390. }
  391. },
  392. beforeDestroy () {
  393. if (this.loopEvent) {
  394. clearInterval(this.loopEvent);
  395. this.loopEvent = null;
  396. }
  397. },
  398. methods: {
  399. resetLoopEvent () {
  400. this.loading = true;
  401. this.hasSetTableScroll = false;
  402. this.loopEvent && clearInterval(this.loopEvent);
  403. this.getTableData();
  404. this.loopEvent = setInterval(this.getTableData, LOOP_INTERVAL.transferArrivalTable);
  405. },
  406. headerCellClass ({ row, column }) {
  407. const classes = [];
  408. const rule = this.tableDataSortRules[column.property];
  409. if (rule) {
  410. classes.push(rule);
  411. }
  412. return classes.join(" ");
  413. },
  414. tableRowClassName ({ row, rowIndex }) {
  415. const classes = [];
  416. if (row.hasArrived) {
  417. classes.push("bgl-hui");
  418. if (rowIndex === this.arrivalCount - 1) {
  419. classes.push("redBorder");
  420. }
  421. }
  422. return classes.join(" ");
  423. },
  424. changeView () {
  425. // const query = {
  426. // ...this.formData,
  427. // startDate: this.startDate,
  428. // endDate: this.endDate
  429. // }
  430. // delete query.flightDate
  431. // this.$router.replace({
  432. // path: '/transfer/departure',
  433. // query
  434. // })
  435. this.$router.push("/transfer/departure");
  436. },
  437. airPortChange () {
  438. this.getAviationData();
  439. this.upAviationData();
  440. this.resetLoopEvent();
  441. },
  442. dateChangeHandler () {
  443. this.getAviationData();
  444. this.upAviationData();
  445. this.resetLoopEvent();
  446. },
  447. // 选择机场
  448. async getAirPortData () {
  449. try {
  450. const res = await getQuery({
  451. id: DATACONTENT_ID.departureAirId,
  452. dataContent: [],
  453. });
  454. if (Number(res.code) === 0) {
  455. this.AirportList = res.returnData.listValues;
  456. this.formData.currentAirport = "PEK";
  457. this.getAviationData();
  458. this.upAviationData();
  459. this.resetLoopEvent();
  460. } else {
  461. this.$message.error(res.message);
  462. }
  463. } catch (error) {
  464. this.$message.error("失败");
  465. }
  466. },
  467. // 选择航司
  468. async getAviationData () {
  469. try {
  470. const res = await getQuery({
  471. id: DATACONTENT_ID.departureAviJoinId,
  472. dataContent: [this.formData.currentAirport],
  473. });
  474. if (Number(res.code) === 0) {
  475. this.carrierProps = res.returnData.listValues;
  476. } else {
  477. this.$message.error(res.message);
  478. }
  479. } catch (error) {
  480. this.$message.error("失败");
  481. }
  482. },
  483. // 选择航司
  484. async upAviationData () {
  485. try {
  486. const res = await getQuery({
  487. id: DATACONTENT_ID.departureAviLeaveId,
  488. dataContent: [this.formData.currentAirport],
  489. });
  490. if (Number(res.code) === 0) {
  491. this.carrierPropsop = res.returnData.listValues;
  492. } else {
  493. this.$message.error(res.message);
  494. }
  495. } catch (error) {
  496. this.$message.error("失败");
  497. }
  498. },
  499. // 获取表单下拉框数据
  500. // getFormData(params) {
  501. // this.relatedAirportQuery({
  502. // ...params,
  503. // type: 'OUT'
  504. // })
  505. // this.outgoingAirlineQuery(params)
  506. // this.craftTypeQuery(params)
  507. // this.flightAttrQuery(params)
  508. // },
  509. // 获取表格数据
  510. async getTableData () {
  511. if (!this.formData.currentAirport || !this.startDate || !this.endDate) {
  512. return;
  513. }
  514. const arrs1 = [this.formData.inboundCarrier.length === 0 ? "" : this.formData.inboundCarrier[0]];
  515. const arrs2 = [this.formData.outgoingAirline.length === 0 ? "" : this.formData.outgoingAirline[0]];
  516. const arr = [
  517. this.formData.currentAirport,
  518. this.startDate,
  519. this.endDate,
  520. ...arrs1,
  521. ...arrs1,
  522. ...arrs1,
  523. ...arrs2,
  524. ...arrs2,
  525. ...arrs2,
  526. // this.formData.inboundCarrier,
  527. // this.formData.outgoingAirline,
  528. // JSON.stringify(this.formData.inboundCarrier),
  529. // JSON.stringify(this.formData.outgoingAirline),
  530. ];
  531. try {
  532. const res = await getQuery({
  533. id: DATACONTENT_ID.departureTableId,
  534. dataContent: [...arr],
  535. });
  536. if (Number(res.code) === 0) {
  537. this.initTableData(res.returnData.listValues);
  538. } else {
  539. }
  540. this.loading = false;
  541. } catch (error) {
  542. if (this.loopEvent) {
  543. clearInterval(this.loopEvent);
  544. this.loopEvent = null;
  545. }
  546. this.loading = false;
  547. }
  548. },
  549. initTableData (tableData) {
  550. this.arrivalCount = 0;
  551. this.baggageCount = 0;
  552. tableData.forEach((item) => {
  553. if (this.hasArrived(item)) {
  554. this.arrivalCount++;
  555. }
  556. this.baggageCount = this.baggageCount + item.inTransferBaggageCount;
  557. });
  558. this.tableData = this._.sortBy(tableData, ["actualLandingTime", "preFlightNO", "actualDepartureTime", "flightNO"]);
  559. setTableFilters(this.tableData, this.tableDataFilters);
  560. this.toOrderNum(this.baggageCount);
  561. this.$nextTick(() => {
  562. this.setTableScroll();
  563. });
  564. },
  565. hasArrived (flight) {
  566. if (flight.actualLandingTime) {
  567. const now = new Date();
  568. const actualLandingTime = new Date(flight.actualLandingTime.replace("T", " "));
  569. flight["hasArrived"] = now > actualLandingTime && !flight["flightCanceled"];
  570. } else {
  571. flight["hasArrived"] = false;
  572. }
  573. return flight["hasArrived"];
  574. },
  575. setTableScroll () {
  576. if (!this.singleDay || this.hasSetTableScroll || this.arrivalCount === 0) {
  577. return;
  578. }
  579. const table = this.$refs["table"].$el;
  580. const scrollParent = table.querySelector(".el-table__body-wrapper");
  581. if (scrollParent.scrollHeight <= scrollParent.offsetHeight) {
  582. return;
  583. }
  584. const lastRow = table.querySelectorAll(".el-table__body tr")[this.arrivalCount - 1];
  585. setTimeout(() => {
  586. const scrollMid = lastRow.offsetTop + lastRow.offsetHeight - scrollParent.offsetHeight / 2;
  587. const scrollMax = scrollParent.scrollHeight - scrollParent.offsetHeight;
  588. if (scrollMid > 0) {
  589. const scrollHeight = Math.min(scrollMid, scrollMax);
  590. scrollParent.scrollTo(0, scrollHeight);
  591. }
  592. }, 0);
  593. this.hasSetTableScroll = true;
  594. },
  595. setNumberTransform () {
  596. const numberItems = this.$refs.numberItem; // 拿到数字的ref,计算元素数量
  597. const numberArr = this.orderNum.filter((item) => !isNaN(item));
  598. // 结合CSS 对数字字符进行滚动,显示订单数量
  599. for (let index = 0; index < numberItems.length; index++) {
  600. const elem = numberItems[index];
  601. elem.style.transform = `translate(-50%, -${numberArr[index] * 10}%)`;
  602. }
  603. },
  604. toOrderNum (num) {
  605. num = num.toString();
  606. if (num.length < 6) {
  607. num = "0" + num; // 如未满八位数,添加"0"补位
  608. this.toOrderNum(num); // 递归添加"0"补位
  609. } else if (num.length >= 6) {
  610. this.orderNum = num.split(""); // 将其便变成数据,渲染至滚动数组
  611. } else {
  612. // 订单总量数字超过八位显示异常
  613. this.$message.warning("总量数字过大");
  614. }
  615. this.setNumberTransform();
  616. },
  617. arraySpanMethod ({ row, column, rowIndex, columnIndex }) {
  618. for (let i = 0; i < 7; i++) {
  619. if (columnIndex === i) {
  620. const _row = this.spanArr[rowIndex];
  621. const _col = _row > 0 ? 1 : 0;
  622. return {
  623. rowspan: _row,
  624. colspan: _col,
  625. };
  626. }
  627. }
  628. },
  629. exportHandler (refName, tableName) {
  630. if (this.loading) {
  631. return;
  632. }
  633. const table = this.$refs[refName].$el.cloneNode(true);
  634. const fileName = `${tableName}-${this.currentAirport}-${this.startDate}-${this.endDate}.xlsx`;
  635. throttledExportToExcel(table, tableName, fileName, 2);
  636. },
  637. },
  638. };
  639. </script>
  640. <style lang="scss" scoped>
  641. .terminal-form-wrap {
  642. padding-top: 11px;
  643. padding-left: 5px;
  644. ::v-deep .form {
  645. display: flex;
  646. justify-content: space-between;
  647. .form-left {
  648. flex: 1;
  649. }
  650. .form-right {
  651. flex: 0 1 auto;
  652. }
  653. .el-form-item {
  654. margin-bottom: 0px;
  655. margin-right: 8px;
  656. button,
  657. input,
  658. optgroup,
  659. select,
  660. textarea {
  661. font-family: Helvetica, "Microsoft YaHei";
  662. font-size: 14px;
  663. }
  664. .el-switch__label {
  665. color: #303133;
  666. }
  667. .el-form-item__error {
  668. z-index: 10;
  669. }
  670. }
  671. .btn-img {
  672. position: relative;
  673. top: 6px;
  674. }
  675. }
  676. .box-item {
  677. position: relative;
  678. height: 50px;
  679. font-size: 18px;
  680. line-height: 32px;
  681. text-align: center;
  682. list-style: none;
  683. color: #2d7cff;
  684. writing-mode: vertical-lr;
  685. text-orientation: upright;
  686. /*文字禁止编辑*/
  687. -moz-user-select: none; /*火狐*/
  688. -webkit-user-select: none; /*webkit浏览器*/
  689. -ms-user-select: none; /*IE10*/
  690. -khtml-user-select: none; /*早期浏览器*/
  691. user-select: none;
  692. /* overflow: hidden; */
  693. p {
  694. line-height: 32px;
  695. writing-mode: horizontal-tb !important;
  696. text-orientation: none !important;
  697. /*文字禁止编辑*/
  698. -moz-user-select: none; /*火狐*/
  699. -webkit-user-select: none; /*webkit浏览器*/
  700. -ms-user-select: none; /*IE10*/
  701. -khtml-user-select: none; /*早期浏览器*/
  702. user-select: none;
  703. margin-top: 5px;
  704. }
  705. }
  706. /* 默认逗号设置 */
  707. .mark-item {
  708. width: 10px;
  709. height: 32px;
  710. margin-right: 5px;
  711. line-height: 10px;
  712. font-size: 18px;
  713. position: relative;
  714. & > span {
  715. position: absolute;
  716. width: 100%;
  717. bottom: 0;
  718. writing-mode: vertical-rl;
  719. text-orientation: upright;
  720. }
  721. }
  722. /*滚动数字设置*/
  723. .number-item {
  724. width: 41px;
  725. height: 42px;
  726. /* 背景图片 */
  727. // background: url(/images/text-bg-blue.png) no-repeat center center;
  728. // background-size: 100% 100%;
  729. // background: #ccc;
  730. list-style: none;
  731. margin-right: 5px;
  732. // background:rgba(250,250,250,1);
  733. border-radius: 4px;
  734. border: 3px solid rgb(221, 221, 221);
  735. & > span {
  736. position: relative;
  737. display: inline-block;
  738. margin-right: 10px;
  739. width: 100%;
  740. height: 100%;
  741. writing-mode: vertical-rl;
  742. text-orientation: upright;
  743. overflow: hidden;
  744. & > i {
  745. font-style: normal;
  746. position: absolute;
  747. top: 11px;
  748. left: 50%;
  749. transform: translate(-50%, -1%);
  750. transition: transform 1s ease-in-out;
  751. letter-spacing: 10px;
  752. }
  753. }
  754. }
  755. .number-item:last-child {
  756. margin-right: 0;
  757. }
  758. }
  759. .terminal-table {
  760. width: 100%;
  761. ::v-deep .table {
  762. width: 100%;
  763. .cell {
  764. padding: 0;
  765. text-align: center;
  766. font-size: 14px;
  767. font-family: Helvetica, "Microsoft YaHei";
  768. letter-spacing: 0;
  769. }
  770. .cell-click {
  771. cursor: pointer;
  772. color: #2d7cff;
  773. &.cell-clicked {
  774. color: purple;
  775. }
  776. }
  777. .el-table__header-wrapper,
  778. .el-table__fixed-header-wrapper {
  779. .cell {
  780. font-weight: bold;
  781. color: #101116;
  782. }
  783. .has-gutter {
  784. tr {
  785. .bgl-huang {
  786. background: #fcf0b1;
  787. }
  788. }
  789. }
  790. }
  791. .el-table__body-wrapper,
  792. .el-table__fixed-body-wrapper {
  793. tr.bgl-hui {
  794. background: #d2d6df;
  795. td {
  796. background: #d2d6df;
  797. }
  798. &.redBorder {
  799. position: relative;
  800. &::after {
  801. content: "";
  802. position: absolute;
  803. left: 0;
  804. bottom: 0;
  805. width: 100%;
  806. height: 2px;
  807. background: #e83f82;
  808. }
  809. }
  810. }
  811. }
  812. .el-table__cell.is-hidden > * {
  813. visibility: visible;
  814. }
  815. }
  816. }
  817. </style>