add 压制工艺

This commit is contained in:
lb
2023-02-22 16:11:50 +08:00
parent 921506bd78
commit 38323fdecf
5 changed files with 306 additions and 36 deletions

View File

@@ -121,41 +121,55 @@ export default {
};
if (!queryParams && this.listQueryExtra && this.listQueryExtra.length) {
this.listQueryExtra.map((name) => {
params[name] = "";
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
.get(this.urls.page, {
params,
})
.then(({ data: res }) => {
console.log("[http response] res is: ", res);
// if (this.urls.pageIsPostApi) {
// } else {
// 默认是 get 方式请求 page
this.$http[this.urls.pageIsPostApi ? "post" : "get"](
this.urls.page,
this.urls.pageIsPostApi
? {
...params,
}
: {
params,
}
).then(({ data: res }) => {
console.log("[http response] res is: ", res);
// page 场景:
if ("list" in res.data) {
// real env:
this.dataList = res.data.list.map((item) => {
return {
...item,
id: item._id ?? item.id,
};
// }
});
this.totalPage = res.data.total;
} else if ("records" in res.data) {
this.dataList = res.data.records.map((item) => ({
// page 场景:
if ("list" in res.data) {
// real env:
this.dataList = res.data.list.map((item) => {
return {
...item,
id: item._id ?? item.id,
}));
this.totalPage = res.data.total;
} else {
this.dataList.splice(0);
this.totalPage = 0;
}
this.tableLoading = false;
});
};
// }
});
this.totalPage = res.data.total;
} else if ("records" in res.data) {
this.dataList = res.data.records.map((item) => ({
...item,
id: item._id ?? item.id,
}));
this.totalPage = res.data.total;
} else {
this.dataList.splice(0);
this.totalPage = 0;
}
this.tableLoading = false;
});
// }
},
layoutTable() {
@@ -268,10 +282,16 @@ export default {
case "查询": {
const params = {};
this.listQueryExtra?.map((cond) => {
if (!!payload[cond]) {
params[cond] = payload[cond];
} else {
params[cond] = "";
if (typeof cond === "string") {
if (!!payload[cond]) {
params[cond] = payload[cond];
} else {
params[cond] = "";
}
} else if (typeof cond === 'object') {
Object.keys(cond).forEach(key => {
params[key] = cond[key]
})
}
});
console.log("查询", params);