update 压机报工的search logic

This commit is contained in:
lb
2023-08-16 11:30:16 +08:00
parent 84a4b2999d
commit cdaa2c1f6c
3 changed files with 68 additions and 40 deletions

View File

@@ -216,6 +216,7 @@ export default {
this.cachedSearchCondition = Object.assign({}, params);
}
console.log("[http request] params is: ", params);
this.$http[this.urls.pageIsPostApi ? "post" : "get"](
this.urls.page,
this.urls.pageIsPostApi
@@ -664,7 +665,21 @@ export default {
}
case "查询": {
if (typeof payload === "object") {
// BaseSearchForm 给这个组件传递了数据
/** 必须先处理 listQueryExtra 里的数据 */
this.listQueryExtra?.map((cond) => {
if (typeof cond === "string") {
if (!!payload[cond]) {
this.cachedSearchCondition[cond] = payload[cond];
} else {
this.cachedSearchCondition[cond] = "";
}
} else if (typeof cond === "object") {
Object.keys(cond).forEach((key) => {
this.cachedSearchCondition[key] = cond[key];
});
}
});
// 再处理 payload 里的数据,用于刷新 上面的 数据
Object.assign(this.cachedSearchCondition, payload);
if ("timerange" in payload) {
if (!!payload.timerange) {
@@ -679,20 +694,6 @@ export default {
}
}
/** 处理 listQueryExtra 里的数据 */
this.listQueryExtra?.map((cond) => {
if (typeof cond === "string") {
if (!!payload[cond]) {
this.cachedSearchCondition[cond] = payload[cond];
} else {
this.cachedSearchCondition[cond] = "";
}
} else if (typeof cond === "object") {
Object.keys(cond).forEach((key) => {
this.cachedSearchCondition[key] = cond[key];
});
}
});
console.log("查询", this.cachedSearchCondition);
this.getList(this.cachedSearchCondition);
break;