update 装载详情

This commit is contained in:
lb
2023-03-23 11:16:19 +08:00
parent 1df948e577
commit 85b9736f09
3 changed files with 63 additions and 80 deletions

View File

@@ -1,6 +1,7 @@
<template>
<el-dialog
class="dialog-car-payload"
title="装载详情"
:visible="dialogVisible"
@close="handleClose"
:destroy-on-close="false"
@@ -19,6 +20,7 @@
<!-- @operate-event="handleOperate" -->
<el-pagination
v-if="showPaination"
class="mt-5 flex justify-end"
@size-change="handleSizeChange"
@current-change="handlePageChange"
@@ -64,6 +66,8 @@ export default {
dataList: [],
tableLoading: false,
refreshLayoutKey: null,
id: null,
showPaination: false,
};
},
created() {},
@@ -83,7 +87,8 @@ export default {
console.log("[*] 传入car payload对话框的id是", id);
return;
}
this.showPaination = false;
this.id = id;
this.tableLoading = true;
this.getList();
},
@@ -99,36 +104,23 @@ export default {
limit: this.size,
};
if (!queryParams && this.listQueryExtra && this.listQueryExtra.length) {
this.listQueryExtra.map((nameOrObj) => {
if (typeof nameOrObj === "string") params[nameOrObj] = "";
else if (typeof nameOrObj === "object") {
Object.keys(nameOrObj).forEach((key) => {
params[key] = nameOrObj[key];
});
}
});
}
this.$http[this.urls.pageIsPostApi ? "post" : "get"](
this.urls.page,
this.urls.pageIsPostApi
? {
...params,
}
: {
params,
}
)
this.$http
.get(this.urls.base + `/${this.id}`, {
params,
})
.then(({ data: res }) => {
console.log("[http response] res is: ", res);
console.log("[car payload dialog] [http response] res is: ", res);
if (res.code === 0) {
// page 场景:
if ("list" in res.data) {
this.dataList = res.data.list;
this.totalPage = res.data.total;
this.showPaination = true;
}
if (Array.isArray(res.data)) {
this.dataList = res.data;
this.totalPage = 0;
} else {
this.dataList.splice(0);
this.totalPage = 0;
@@ -193,4 +185,9 @@ export default {
};
</script>
<style scoped></style>
<style scoped>
.dialog-car-payload >>> .el-dialog__body {
padding: 5px 20px 20px;
}
</style>