bufix 0705 zentao
This commit is contained in:
@@ -19,8 +19,8 @@
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handlePageChange"
|
||||
:current-page.sync="page"
|
||||
:page-size.sync="size"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="size"
|
||||
:total="totalPage"
|
||||
layout="total, sizes, prev, pager, next, jumper"></el-pagination>
|
||||
|
||||
@@ -126,6 +126,12 @@ export default {
|
||||
this.refreshLayoutKey = this.layoutTable();
|
||||
},
|
||||
watch: {
|
||||
page: val => {
|
||||
console.log('page changed:', val)
|
||||
},
|
||||
size: val => {
|
||||
console.log('size changed:', val)
|
||||
},
|
||||
triggerUpdate(val, oldVal) {
|
||||
if (val && val !== oldVal) {
|
||||
// get list
|
||||
@@ -171,7 +177,7 @@ export default {
|
||||
? { ...queryParams, page: this.page, limit: this.size }
|
||||
: {
|
||||
page: this.page,
|
||||
limit: this.size,
|
||||
limit: this.size
|
||||
};
|
||||
|
||||
if (!queryParams && this.listQueryExtra && this.listQueryExtra.length) {
|
||||
@@ -183,6 +189,7 @@ export default {
|
||||
});
|
||||
}
|
||||
});
|
||||
this.cachedSearchCondition = Object.assign({}, params)
|
||||
}
|
||||
|
||||
this.$http[this.urls.pageIsPostApi ? "post" : "get"](
|
||||
@@ -201,6 +208,14 @@ export default {
|
||||
if (res.code === 0) {
|
||||
// page 场景:
|
||||
if ("list" in res.data) {
|
||||
// if (res.data.list.length == 0 && res.data.total != 0) {
|
||||
// // refresh list
|
||||
// if (this.page > 1) {
|
||||
// this.page -= 1
|
||||
// this.getList()
|
||||
// return
|
||||
// } else return
|
||||
// }
|
||||
/** 破碎记录的特殊需求:数据要结合单位 material + materialUnitDictValue */
|
||||
if ("attachDictValue" in this.tableConfig.column) {
|
||||
this.dataList = res.data.list.map((row) => {
|
||||
@@ -257,6 +272,8 @@ export default {
|
||||
if (deleteConfig && "promptField" in deleteConfig) {
|
||||
promptName = data[deleteConfig.promptField];
|
||||
}
|
||||
|
||||
let currenPageListLength = this.dataList.length
|
||||
// 确认是否删除
|
||||
return this.$confirm(`确定要删除记录 "${promptName}" 吗?`, "提示", {
|
||||
confirmButtonText: "确认",
|
||||
@@ -276,9 +293,11 @@ export default {
|
||||
}).then(({ data: res }) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success("删除成功!");
|
||||
this.page = 1;
|
||||
this.size =
|
||||
"defaultPageSize" in this.tableConfig.column ? this.tableConfig.column.defaultPageSize : 20;
|
||||
// this.page = 1;
|
||||
// this.size =
|
||||
// "defaultPageSize" in this.tableConfig.column ? this.tableConfig.column.defaultPageSize : 20;
|
||||
if (currenPageListLength == 1) this.page = this.page > 1 ? this.page - 1 : 1
|
||||
|
||||
this.getList();
|
||||
} else {
|
||||
this.$message({
|
||||
|
||||
Reference in New Issue
Block a user