update 3.27 窑车加删除

This commit is contained in:
lb
2023-03-27 15:09:38 +08:00
parent 4a6f395119
commit d2c0978321
11 changed files with 603 additions and 14 deletions

View File

@@ -235,8 +235,14 @@ export default {
// payload: { type: string, data: string | number | object }
switch (type) {
case "delete": {
// 找到删除的 prompt 字段
const deleteConfig = data.head?.options?.find((item) => item.name === "delete");
let promptName = data.name ?? data.id;
if (deleteConfig && "promptField" in deleteConfig) {
promptName = data[deleteConfig.promptField];
}
// 确认是否删除
return this.$confirm(`确定要删除记录 "${data.name ?? data.id}" 吗?`, "提示", {
return this.$confirm(`确定要删除记录 "${promptName}" 吗?`, "提示", {
confirmButtonText: "确认",
cancelButtonText: "我再想想",
type: "warning",
@@ -246,7 +252,11 @@ export default {
this.$http({
url: this.urls.base,
method: "DELETE",
// data: data.id,
data: [`${data.id}`],
// headers: {
// "Content-Type": "application/json"
// }
}).then(({ data: res }) => {
if (res.code === 0) {
this.$message.success("删除成功!");