Showing
8 changed files
with
128 additions
and
73 deletions
src/api/et86ShipmentDesc.js
0 → 100644
| ... | @@ -393,6 +393,13 @@ export function isNumberStr(str) { | ... | @@ -393,6 +393,13 @@ export function isNumberStr(str) { |
| 393 | return /^[+-]?(0|([1-9]\d*))(\.\d+)?$/g.test(str); | 393 | return /^[+-]?(0|([1-9]\d*))(\.\d+)?$/g.test(str); |
| 394 | } | 394 | } |
| 395 | 395 | ||
| 396 | +// Array JsonValue 排序 | ||
| 397 | +export function sortList(arr, key) { | ||
| 398 | + return arr.sort((a, b) => { | ||
| 399 | + return a[key].localeCompare(b[key]); | ||
| 400 | + }); | ||
| 401 | +} | ||
| 402 | + | ||
| 396 | // 获取计算元素的属性的margin + padding + clientHeight | 403 | // 获取计算元素的属性的margin + padding + clientHeight |
| 397 | function getPropertyValue(el) { | 404 | function getPropertyValue(el) { |
| 398 | let style, marginTop, marginBottom, paddingTop, paddingBottom; | 405 | let style, marginTop, marginBottom, paddingTop, paddingBottom; |
| ... | @@ -417,12 +424,21 @@ export function restTableHeight($refs) { | ... | @@ -417,12 +424,21 @@ export function restTableHeight($refs) { |
| 417 | if (key == "ylTable") { | 424 | if (key == "ylTable") { |
| 418 | $refs[key].$children.map((item) => { | 425 | $refs[key].$children.map((item) => { |
| 419 | if (item.$el.id == "group-btn") { | 426 | if (item.$el.id == "group-btn") { |
| 427 | + console.log("group-btn:", getPropertyValue(item.$el)); | ||
| 420 | // table表格组合按钮 | 428 | // table表格组合按钮 |
| 421 | heigth += getPropertyValue(item.$el); | 429 | heigth += getPropertyValue(item.$el); |
| 422 | heigth += item.$el.clientHeight; | 430 | heigth += item.$el.clientHeight; |
| 423 | } else if (item.$el.className == "el-pagination is-background") { | 431 | } else if (item.$el.className == "el-pagination is-background") { |
| 424 | // table表格组合分页 | 432 | // table表格组合分页 |
| 425 | if (item.$el.offsetParent.className == "pagination-container") { | 433 | if (item.$el.offsetParent.className == "pagination-container") { |
| 434 | + console.log( | ||
| 435 | + "pagination:", | ||
| 436 | + getPropertyValue(item.$el.offsetParent) | ||
| 437 | + ); | ||
| 438 | + console.log( | ||
| 439 | + "paginationClientHeight:", | ||
| 440 | + getPropertyValue(item.$el.offsetParent.clientHeight) | ||
| 441 | + ); | ||
| 426 | heigth += getPropertyValue(item.$el.offsetParent); | 442 | heigth += getPropertyValue(item.$el.offsetParent); |
| 427 | heigth += item.$el.offsetParent.clientHeight; | 443 | heigth += item.$el.offsetParent.clientHeight; |
| 428 | } | 444 | } |
| ... | @@ -431,13 +447,23 @@ export function restTableHeight($refs) { | ... | @@ -431,13 +447,23 @@ export function restTableHeight($refs) { |
| 431 | } else { | 447 | } else { |
| 432 | if ($refs[key].hasOwnProperty("$el")) { | 448 | if ($refs[key].hasOwnProperty("$el")) { |
| 433 | heigth += $refs[key].$el.clientHeight; | 449 | heigth += $refs[key].$el.clientHeight; |
| 450 | + heigth += getPropertyValue($refs[key].$el); | ||
| 451 | + console.log( | ||
| 452 | + "ruleForm:", | ||
| 453 | + $refs[key].$el.clientHeight, | ||
| 454 | + getPropertyValue($refs[key].$el) | ||
| 455 | + ); | ||
| 434 | } else { | 456 | } else { |
| 457 | + console.log("ruleForm:", $refs[key]); | ||
| 458 | + heigth += $refs[key].$el.clientHeight; | ||
| 435 | heigth += getPropertyValue($refs[key]); | 459 | heigth += getPropertyValue($refs[key]); |
| 436 | } | 460 | } |
| 437 | } | 461 | } |
| 438 | } else if (key == "formHeaderRef") { | 462 | } else if (key == "formHeaderRef") { |
| 463 | + console.log("formHeaderRef:", getPropertyValue($refs[key])); | ||
| 439 | heigth += getPropertyValue($refs[key]); | 464 | heigth += getPropertyValue($refs[key]); |
| 440 | } | 465 | } |
| 441 | }); | 466 | }); |
| 467 | + console.log("heigth:", heigth); | ||
| 442 | return heigth; | 468 | return heigth; |
| 443 | } | 469 | } | ... | ... |
| ... | @@ -13,6 +13,7 @@ | ... | @@ -13,6 +13,7 @@ |
| 13 | </el-col> | 13 | </el-col> |
| 14 | </el-row> | 14 | </el-row> |
| 15 | <yl-table | 15 | <yl-table |
| 16 | + ref="ylTable" | ||
| 16 | :attrs="tableAttr" | 17 | :attrs="tableAttr" |
| 17 | :loadingTable="tableAttr.loadingTable" | 18 | :loadingTable="tableAttr.loadingTable" |
| 18 | :columns="columns" | 19 | :columns="columns" |
| ... | @@ -89,10 +90,10 @@ import { formConfig } from "./formConfig"; | ... | @@ -89,10 +90,10 @@ import { formConfig } from "./formConfig"; |
| 89 | import { tableAttr, columnHeader } from "./tableConfig"; | 90 | import { tableAttr, columnHeader } from "./tableConfig"; |
| 90 | import { restTableHeight } from "@/utils"; | 91 | import { restTableHeight } from "@/utils"; |
| 91 | import { | 92 | import { |
| 92 | - findHsCodeList, // HScode黑名单查询 | 93 | + findHsCodeList, // ShipmentDesc查询 |
| 93 | - delBlackList, // HScode黑名单删除 | 94 | + delBlackList, // ShipmentDesc删除 |
| 94 | - downLoadTemplate, // HScode黑名单下载模板 | 95 | + downLoadTemplate, // ShipmentDesc下载模板 |
| 95 | - uploadHsCode, // HScode黑名单导入 | 96 | + uploadHsCode, // ShipmentDesc导入 |
| 96 | } from "@/api/et86HsCodeBlack"; | 97 | } from "@/api/et86HsCodeBlack"; |
| 97 | import { downLoadXlsx } from "@/utils/zipdownload"; | 98 | import { downLoadXlsx } from "@/utils/zipdownload"; |
| 98 | export default { | 99 | export default { |
| ... | @@ -140,15 +141,8 @@ export default { | ... | @@ -140,15 +141,8 @@ export default { |
| 140 | }, | 141 | }, |
| 141 | mounted() { | 142 | mounted() { |
| 142 | this.$nextTick(() => { | 143 | this.$nextTick(() => { |
| 143 | - let app = document.querySelector(".app-main"); | 144 | + console.log(this.$refs) |
| 144 | - if (this.$store.getters.appMainBlockClientHeight) { | 145 | + this.tableAttr.maxHeight = window.innerHeight - restTableHeight(this.$refs); |
| 145 | - this.tableAttr.maxHeight = | ||
| 146 | - this.$store.getters.appMainBlockClientHeight - | ||
| 147 | - restTableHeight(this.$refs); | ||
| 148 | - } else { | ||
| 149 | - this.tableAttr.maxHeight = | ||
| 150 | - app.clientHeight - restTableHeight(this.$refs); | ||
| 151 | - } | ||
| 152 | }); | 146 | }); |
| 153 | }, | 147 | }, |
| 154 | methods: { | 148 | methods: { | ... | ... |
This diff is collapsed. Click to expand it.
| ... | @@ -32,7 +32,7 @@ import YlForm from "@/components/YlForm"; | ... | @@ -32,7 +32,7 @@ import YlForm from "@/components/YlForm"; |
| 32 | import YlTable from "@/components/YlTable"; | 32 | import YlTable from "@/components/YlTable"; |
| 33 | import { formConfig } from "./formConfig"; | 33 | import { formConfig } from "./formConfig"; |
| 34 | import { tableAttr, columnHeader } from "./tableConfig"; | 34 | import { tableAttr, columnHeader } from "./tableConfig"; |
| 35 | -import { restTableHeight } from "@/utils"; | 35 | +import { restTableHeight, sortList } from "@/utils"; |
| 36 | import { | 36 | import { |
| 37 | findAllEtesRules, // ET86查询 | 37 | findAllEtesRules, // ET86查询 |
| 38 | deleteEtesRuleById, // 删除 | 38 | deleteEtesRuleById, // 删除 |
| ... | @@ -71,16 +71,9 @@ export default { | ... | @@ -71,16 +71,9 @@ export default { |
| 71 | }, | 71 | }, |
| 72 | mounted() { | 72 | mounted() { |
| 73 | this.$nextTick(() => { | 73 | this.$nextTick(() => { |
| 74 | - let app = document.querySelector(".app-main"); | 74 | + console.log(window.innerHeight); |
| 75 | - if (this.$store.getters.appMainBlockClientHeight) { | 75 | + console.log(restTableHeight(this.$refs)); |
| 76 | - this.tableAttr.maxHeight = | 76 | + // this.tableAttr.maxHeight = window.innerHeight - restTableHeight(this.$refs); |
| 77 | - this.$store.getters.appMainBlockClientHeight - | ||
| 78 | - restTableHeight(this.$refs); | ||
| 79 | - } else { | ||
| 80 | - this.tableAttr.maxHeight = | ||
| 81 | - app.clientHeight - restTableHeight(this.$refs); | ||
| 82 | - } | ||
| 83 | - console.log(this.tableAttr.maxHeight); | ||
| 84 | }); | 77 | }); |
| 85 | }, | 78 | }, |
| 86 | methods: { | 79 | methods: { |
| ... | @@ -92,7 +85,13 @@ export default { | ... | @@ -92,7 +85,13 @@ export default { |
| 92 | this.tableAttr.loadingTable = false; | 85 | this.tableAttr.loadingTable = false; |
| 93 | const { code, data } = res; | 86 | const { code, data } = res; |
| 94 | if (code == 200) { | 87 | if (code == 200) { |
| 95 | - this.tableData = data.list; | 88 | + const valid = data.list.filter((item) => item.status == "1"); // 有效 |
| 89 | + const invalid = data.list.filter((item) => item.status == "0"); // 无效 | ||
| 90 | + valid.reverse(); // 有效航班修改时间排序 | ||
| 91 | + invalid.reverse(); // | ||
| 92 | + const newValid = sortList(valid, "originOfFlightNo"); // 有效原航班按字母排序 | ||
| 93 | + const newInvalid = sortList(invalid, "originOfFlightNo"); | ||
| 94 | + this.tableData = newValid.concat(newInvalid); | ||
| 96 | this.pageConfig.total = data.total; | 95 | this.pageConfig.total = data.total; |
| 97 | } | 96 | } |
| 98 | }) | 97 | }) | ... | ... |
| ... | @@ -7,6 +7,7 @@ export const tableAttr = { | ... | @@ -7,6 +7,7 @@ export const tableAttr = { |
| 7 | loadingTable: false, | 7 | loadingTable: false, |
| 8 | isDragSort: false, // 拖拽tableData数据一定要加id字段 | 8 | isDragSort: false, // 拖拽tableData数据一定要加id字段 |
| 9 | maxHeight: 0, | 9 | maxHeight: 0, |
| 10 | + // defaultSort: { prop: "updateTime", order: "descending" }, | ||
| 10 | btnCofig: { | 11 | btnCofig: { |
| 11 | isBtn: true, | 12 | isBtn: true, |
| 12 | btnGroup: [ | 13 | btnGroup: [ |
| ... | @@ -72,7 +73,8 @@ export const columnHeader = (viewRow, editRow, deleteRow) => [ | ... | @@ -72,7 +73,8 @@ export const columnHeader = (viewRow, editRow, deleteRow) => [ |
| 72 | prop: "updateTime", | 73 | prop: "updateTime", |
| 73 | align: "center", | 74 | align: "center", |
| 74 | minWidth: 120, | 75 | minWidth: 120, |
| 75 | - // "sort-method": (a, b) => b.createTime - a.createTime, | 76 | + // sortable: true, |
| 77 | + // "sort-method": (a, b) => a.createTime - b.createTime, | ||
| 76 | }, | 78 | }, |
| 77 | { | 79 | { |
| 78 | label: "修改人", | 80 | label: "修改人", |
| ... | @@ -87,59 +89,82 @@ export const columnHeader = (viewRow, editRow, deleteRow) => [ | ... | @@ -87,59 +89,82 @@ export const columnHeader = (viewRow, editRow, deleteRow) => [ |
| 87 | minWidth: 125, | 89 | minWidth: 125, |
| 88 | fixed: "right", | 90 | fixed: "right", |
| 89 | render: (h, params) => { | 91 | render: (h, params) => { |
| 90 | - return h("div", [ | 92 | + let operateData = [] |
| 91 | - h( | 93 | + if (params.row.status == "1") { |
| 92 | - "el-button", | 94 | + operateData = [ |
| 93 | - { | 95 | + h( |
| 94 | - props: { | 96 | + "el-button", |
| 95 | - type: "text", | 97 | + { |
| 96 | - size: "mini", | 98 | + props: { |
| 97 | - icon: "el-icon-view", | 99 | + type: "text", |
| 98 | - }, | 100 | + size: "mini", |
| 99 | - on: { | 101 | + icon: "el-icon-view", |
| 100 | - click() { | ||
| 101 | - viewRow(params); | ||
| 102 | }, | 102 | }, |
| 103 | - }, | 103 | + on: { |
| 104 | - }, | 104 | + click() { |
| 105 | - "查看" | 105 | + viewRow(params); |
| 106 | - ), | 106 | + }, |
| 107 | - h( | ||
| 108 | - "el-button", | ||
| 109 | - { | ||
| 110 | - props: { | ||
| 111 | - type: "text", | ||
| 112 | - size: "mini", | ||
| 113 | - icon: "el-icon-edit", | ||
| 114 | - }, | ||
| 115 | - on: { | ||
| 116 | - click() { | ||
| 117 | - editRow(params); | ||
| 118 | }, | 107 | }, |
| 119 | }, | 108 | }, |
| 120 | - }, | 109 | + "查看" |
| 121 | - "修改" | 110 | + ), |
| 122 | - ), | 111 | + h( |
| 123 | - h( | 112 | + "el-button", |
| 124 | - "el-button", | 113 | + { |
| 125 | - { | 114 | + props: { |
| 126 | - style: { | 115 | + type: "text", |
| 127 | - color: "#ff4949", | 116 | + size: "mini", |
| 117 | + icon: "el-icon-edit", | ||
| 118 | + }, | ||
| 119 | + on: { | ||
| 120 | + click() { | ||
| 121 | + editRow(params); | ||
| 122 | + }, | ||
| 123 | + }, | ||
| 128 | }, | 124 | }, |
| 129 | - props: { | 125 | + "修改" |
| 130 | - type: "text", | 126 | + ), |
| 131 | - size: "mini", | 127 | + h( |
| 132 | - icon: "el-icon-delete", | 128 | + "el-button", |
| 129 | + { | ||
| 130 | + style: { | ||
| 131 | + color: "#ff4949", | ||
| 132 | + }, | ||
| 133 | + props: { | ||
| 134 | + type: "text", | ||
| 135 | + size: "mini", | ||
| 136 | + icon: "el-icon-delete", | ||
| 137 | + }, | ||
| 138 | + on: { | ||
| 139 | + click() { | ||
| 140 | + deleteRow(params); | ||
| 141 | + }, | ||
| 142 | + }, | ||
| 133 | }, | 143 | }, |
| 134 | - on: { | 144 | + "删除" |
| 135 | - click() { | 145 | + ), |
| 136 | - deleteRow(params); | 146 | + ]; |
| 147 | + }else{ | ||
| 148 | + operateData = [ | ||
| 149 | + h( | ||
| 150 | + "el-button", | ||
| 151 | + { | ||
| 152 | + props: { | ||
| 153 | + type: "text", | ||
| 154 | + size: "mini", | ||
| 155 | + icon: "el-icon-view", | ||
| 156 | + }, | ||
| 157 | + on: { | ||
| 158 | + click() { | ||
| 159 | + viewRow(params); | ||
| 160 | + }, | ||
| 137 | }, | 161 | }, |
| 138 | }, | 162 | }, |
| 139 | - }, | 163 | + "查看" |
| 140 | - "删除" | 164 | + ), |
| 141 | - ), | 165 | + ]; |
| 142 | - ]); | 166 | + } |
| 167 | + return h("div", operateData); | ||
| 143 | }, | 168 | }, |
| 144 | }, | 169 | }, |
| 145 | ]; | 170 | ]; | ... | ... |
| ... | @@ -13,6 +13,7 @@ | ... | @@ -13,6 +13,7 @@ |
| 13 | </el-col> | 13 | </el-col> |
| 14 | </el-row> | 14 | </el-row> |
| 15 | <yl-table | 15 | <yl-table |
| 16 | + ref="ylTable" | ||
| 16 | :attrs="tableAttr" | 17 | :attrs="tableAttr" |
| 17 | :loadingTable="tableAttr.loadingTable" | 18 | :loadingTable="tableAttr.loadingTable" |
| 18 | :columns="columns" | 19 | :columns="columns" | ... | ... |
-
Please register or login to post a comment