Elements-SY

【IMAC-ET86】配舱设置-新增ET86配舱modify

......@@ -17,7 +17,7 @@
</el-row>
<el-table
:max-height="attrs.maxHeight"
empty-text
:empty-text="emptyText"
v-bind="attrs"
v-loading="loadingTable"
:data="tableData"
......@@ -82,6 +82,10 @@ export default {
},
},
},
emptyText: {
type: String,
default: "暂无数据",
},
loadingTable: {
type: Boolean,
default: false,
......@@ -93,7 +97,6 @@ export default {
tableData: {
type: Array,
default: () => [],
required: true,
},
pageConfig: {
type: Object,
......@@ -127,8 +130,6 @@ export default {
}
},
mounted() {
this.getTrCurrentHeight();
window.addEventListener("resize", this.getTrCurrentHeight);
//阻止火狐拖拽新建新页面
document.body.addEventListener(
"drop",
......@@ -138,13 +139,19 @@ export default {
},
false
);
// 拖拽行更新排序
// this.rowDrop();
// 拖拽列更新排序
this.columnDrop();
if (this.tableData.length) {
this.getTrCurrentHeight();
window.addEventListener("resize", this.getTrCurrentHeight);
// 拖拽行更新排序
// this.rowDrop();
// 拖拽列更新排序
this.columnDrop();
}
},
destroyed() {
window.removeEventListener("resize", this.getTrCurrentHeight);
if (this.tableData.length) {
window.removeEventListener("resize", this.getTrCurrentHeight);
}
},
methods: {
......
......@@ -6,15 +6,6 @@ export const tableAttr = {
btnCofig: {
isBtn: true,
btnGroup: [
// {
// type: "primary", // text、primary、danger
// icon: "el-icon-search", // el-icon-edit 、el-icon-delete、el-icon-plus、el-icon-download、el-icon-upload el-icon--right
// btnName: "搜索",
// size: "mini", // medium / small / mini
// round: false,
// loading: false,
// event: "search",
// },
{
type: "primary",
icon: "el-icon-plus",
......@@ -24,15 +15,6 @@ export const tableAttr = {
loading: false,
event: "add",
},
// {
// type: "danger",
// icon: "el-icon-delete",
// btnName: "删除",
// size: "mini",
// round: false,
// loading: false,
// event: "delete",
// },
],
},
};
......@@ -104,7 +86,8 @@ export const tableData = [
id: "1",
fltNo: "A380",
fltNoDate: "3",
fltRoute: "CAN",
fltRoute: "",
routeList: [],
isOn: "1",
sort: "1", // 排序字段
},
......
......@@ -27,15 +27,11 @@ export const formConfig = [
data: [
{
value: "1",
label: "新增",
},
{
value: "2",
label: "修改",
label: "有效",
},
{
value: "3",
label: "删除",
label: "无效",
},
],
label: "",
......
......@@ -22,8 +22,6 @@
@search="searchBtn"
@restForm="restForm"
@add="addBtn"
@upload="uploadBtn"
@download="downloadBtn"
>
</yl-table>
</div>
......@@ -134,14 +132,6 @@ export default {
},
});
},
// 上传
uploadBtn(item) {
console.log("upload:", item);
},
// 导出
downloadBtn(item) {
console.log("download:", item);
},
// 编辑
editRow(item) {
this.$router.push({
......
const state = {
1: "新增",
2: "修改",
3: "删除",
1: "有效",
3: "无效",
};
export const tableAttr = {
border: true,
......@@ -38,28 +37,10 @@ export const tableAttr = {
loading: false,
event: "add",
},
{
type: "primary",
icon: "el-icon-upload",
btnName: "上传",
size: "mini",
round: false,
loading: false,
event: "upload",
},
{
type: "primary",
icon: "el-icon-download",
btnName: "导出",
size: "mini",
round: false,
loading: false,
event: "download",
},
],
},
};
export const columnHeader = (editRow, deleteRow, viewRow) => [
export const columnHeader = (viewRow, editRow, deleteRow) => [
{
type: "selection",
align: "center",
......@@ -74,12 +55,30 @@ export const columnHeader = (editRow, deleteRow, viewRow) => [
width: "50",
},
{
label: "原航班号",
prop: "fltNo",
align: "center",
minWidth: 100,
},
{
label: "顺位航班",
prop: "flightRand",
align: "center",
minWidth: 100,
},
{
label: "URSA包含",
prop: "includeUrsa",
align: "center",
minWidth: 100,
},
{
label: "URSA不包含",
prop: "notIncludeUrsa",
align: "center",
minWidth: 100,
},
{
label: "状态",
prop: "status",
align: "center",
......@@ -98,14 +97,14 @@ export const columnHeader = (editRow, deleteRow, viewRow) => [
"sort-method": (a, b) => b.createTime - a.createTime,
},
{
label: "修改时间",
prop: "updateTime",
label: "创建人",
prop: "createUserName",
align: "center",
minWidth: 100,
},
{
label: "创建人",
prop: "createUserName",
label: "修改时间",
prop: "updateTime",
align: "center",
minWidth: 100,
},
......@@ -129,50 +128,50 @@ export const columnHeader = (editRow, deleteRow, viewRow) => [
props: {
type: "text",
size: "mini",
icon: "el-icon-edit",
icon: "el-icon-view",
},
on: {
click() {
editRow(params);
viewRow(params);
},
},
},
"修改"
"查看"
),
h(
"el-button",
{
style: {
color: "#ff4949",
},
props: {
type: "text",
size: "mini",
icon: "el-icon-delete",
icon: "el-icon-edit",
},
on: {
click() {
deleteRow(params);
editRow(params);
},
},
},
"删除"
"修改"
),
h(
"el-button",
{
style: {
color: "#ff4949",
},
props: {
type: "text",
size: "mini",
icon: "el-icon-view",
icon: "el-icon-delete",
},
on: {
click() {
viewRow(params);
deleteRow(params);
},
},
},
"查看"
"删除"
),
]);
},
......@@ -184,81 +183,108 @@ export const tableData = [
id: "1",
flightRand: "LZ003;LZ00",
status: "1",
createTime: "2023-08-11",
updateTime: "2023-08-11",
fltNo: "FX0090",
includeUrsa: "URSACODE191",
notIncludeUrsa: "P_3",
createTime: "2023-08-14",
createUserName: "wjh",
updateTime: "2023-08-14",
updateUserName: "wjh",
},
{
id: "2",
flightRand: "LP001;LP004+1",
status: "3",
createTime: "2023-08-11",
updateTime: "2023-08-11",
fltNo: "FX0090",
includeUrsa: "P_;URSACODE105",
notIncludeUrsa: "P_21",
createTime: "2023-08-14",
createUserName: "wjh",
updateTime: "2023-08-14",
updateUserName: "wjh",
},
{
id: "3",
flightRand: "LZ002;LZ003;LZ001",
flightRand: "CQ00;LZ003;CS0004",
status: "1",
createTime: "2023-08-10",
updateTime: "2023-08-10",
fltNo: "CS0002",
includeUrsa: "URSACODE12",
notIncludeUrsa: "P_2",
createTime: "2023-08-14",
createUserName: "wjh",
updateTime: "2023-08-14",
updateUserName: "wjh",
},
{
id: "4",
flightRand: "LZ001;LZ002;LZ004",
status: "2",
status: "1",
fltNo: "FX0090",
includeUrsa: "URSACODE192",
notIncludeUrsa: "P_17",
createTime: "2023-08-11",
updateTime: "2023-08-11",
createUserName: "wjh",
updateTime: "2023-08-11",
updateUserName: "wjh",
},
{
id: "5",
flightRand: "PS001;PS003",
status: "1",
fltNo: "FX0091",
includeUrsa: "URSACODE10",
notIncludeUrsa: "P_28",
createTime: "2023-08-11",
updateTime: "2023-08-11",
createUserName: "wjh",
updateTime: "2023-08-11",
updateUserName: "wjh",
},
{
id: "6",
flightRand: "PS002;PS003",
status: "3",
fltNo: "XN007",
includeUrsa: "URSACODE27",
notIncludeUrsa: "P_4",
createTime: "2023-08-11",
updateTime: "2023-08-11",
createUserName: "wjh",
updateTime: "2023-08-11",
updateUserName: "wjh",
},
{
id: "7",
flightRand: "FX0092;FX0095;FX0094;FX0090",
flightRand: "XN001;XN002;XN003;XN004",
status: "1",
fltNo: "XN001",
includeUrsa: "URSACODE34",
notIncludeUrsa: "P_7",
createTime: "2023-08-10",
updateTime: "2023-08-10",
createUserName: "wjh",
updateTime: "2023-08-10",
updateUserName: "wjh",
},
{
id: "8",
flightRand: "AB060;AC005;AC204",
status: "2",
flightRand: "HA004",
status: "3",
fltNo: "LZ007",
includeUrsa: "URSACODE71",
notIncludeUrsa: "P_2",
createTime: "2023-08-10",
updateTime: "2023-08-10",
createUserName: "wjh",
updateTime: "2023-08-10",
updateUserName: "wjh",
},
{
id: "9",
flightRand: "FX0090;FX0092",
flightRand: "AB0001;AB123",
status: "1",
fltNo: "AB0001",
includeUrsa: "URSACODE87",
notIncludeUrsa: "P_26",
createTime: "2023-08-10",
updateTime: "2023-08-10",
createUserName: "wjh",
updateTime: "2023-08-10",
updateUserName: "wjh",
},
];
......