update 压机报工的search logic
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user