Commit 9d82c7c3 authored by chenqikuai's avatar chenqikuai

fix

parent 92075b6c
...@@ -37,13 +37,18 @@ export function postAuth( ...@@ -37,13 +37,18 @@ export function postAuth(
} }
export function deleteAuth(id: number) { export function deleteAuth(id: number) {
return $ajax({ return $ajax(
type: "delete", {
url: "/api/authentication", type: "delete",
params: { url: "/api/authentication",
id, params: {
id,
},
}, },
}); {
toast: true,
}
);
} }
export function getAuths( export function getAuths(
...@@ -132,13 +137,18 @@ export function getCopyRights(payload: { ...@@ -132,13 +137,18 @@ export function getCopyRights(payload: {
}); });
} }
export function deleteCopyRights(ids: number[]) { export function deleteCopyRights(ids: number[]) {
return $ajax({ return $ajax(
type: "delete", {
url: "/api/copyrights", type: "delete",
params: { url: "/api/copyrights",
ids, params: {
ids,
},
}, },
}); {
toast: true,
}
);
} }
export function getBills(payload: { export function getBills(payload: {
......
...@@ -313,6 +313,7 @@ import { ...@@ -313,6 +313,7 @@ import {
gainSourceMapping, gainSourceMapping,
} from "../copyrightManagement/statusMapping"; } from "../copyrightManagement/statusMapping";
import { router } from "@/router"; import { router } from "@/router";
import { showTip } from "@/components/GlobalMount/api";
const showCert = ref(false); const showCert = ref(false);
...@@ -336,8 +337,14 @@ function handleClickEdit(raw: iCopyRight) { ...@@ -336,8 +337,14 @@ function handleClickEdit(raw: iCopyRight) {
} }
async function handleClickDel(raw: iCopyRight) { async function handleClickDel(raw: iCopyRight) {
await deleteCopyRights([raw.id]); showTip(
router.back(); "此操作将删除该版权, 是否继续?",
async () => {
await deleteCopyRights([raw.id]);
router.back();
},
() => {}
);
} }
</script> </script>
......
...@@ -2,6 +2,7 @@ import { ElMessage } from "element-plus"; ...@@ -2,6 +2,7 @@ import { ElMessage } from "element-plus";
import { eStatusOfFilerCertification } from "@/components/ApproveStatus/status"; import { eStatusOfFilerCertification } from "@/components/ApproveStatus/status";
import { router } from "@/router"; import { router } from "@/router";
import { deleteAuth } from "@/service/copyrightService"; import { deleteAuth } from "@/service/copyrightService";
import { showTip } from "@/components/GlobalMount/api";
export default class Service { export default class Service {
static instance: Service; static instance: Service;
...@@ -62,7 +63,8 @@ export default class Service { ...@@ -62,7 +63,8 @@ export default class Service {
id: slotProps.id, id: slotProps.id,
}); });
} else if (operateValue === "del") { } else if (operateValue === "del") {
deleteAuth(slotProps.id).then((ret) => { showTip("此操作将删除该备案人, 是否继续?", async () => {
const ret = await deleteAuth(slotProps.id);
if (ret && ret.code === 200) { if (ret && ret.code === 200) {
ElMessage.success("删除成功"); ElMessage.success("删除成功");
emit("refresh"); emit("refresh");
......
...@@ -98,6 +98,7 @@ import { router } from "@/router"; ...@@ -98,6 +98,7 @@ import { router } from "@/router";
import { deleteCopyRights } from "@/service/copyrightService"; import { deleteCopyRights } from "@/service/copyrightService";
import { iCopyRight } from "@/types/copyright"; import { iCopyRight } from "@/types/copyright";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import { showTip } from "@/components/GlobalMount/api";
defineProps<{ defineProps<{
data: any[]; data: any[];
...@@ -178,11 +179,18 @@ const handleClickItem = async (value: eOperate, slotProps: iCopyRight) => { ...@@ -178,11 +179,18 @@ const handleClickItem = async (value: eOperate, slotProps: iCopyRight) => {
}); });
break; break;
case eOperate.delete: case eOperate.delete:
const res = await deleteCopyRights([slotProps.id]); showTip(
if (res && res.code === 200) { "此操作将删除该版权, 是否继续?",
ElMessage.success("删除成功"); async () => {
emit("refresh"); const res = await deleteCopyRights([slotProps.id]);
} if (res && res.code === 200) {
ElMessage.success("删除成功");
emit("refresh");
}
},
() => {}
);
break; break;
} }
}; };
......
...@@ -57,6 +57,7 @@ import { workTypeMapping } from "../copyrightManagement/statusMapping"; ...@@ -57,6 +57,7 @@ import { workTypeMapping } from "../copyrightManagement/statusMapping";
import { router } from "@/router"; import { router } from "@/router";
import { deleteCopyRights } from "@/service/copyrightService"; import { deleteCopyRights } from "@/service/copyrightService";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import { showTip } from "@/components/GlobalMount/api";
const emit = defineEmits(["scrollToEnd", "refresh"]); const emit = defineEmits(["scrollToEnd", "refresh"]);
...@@ -100,11 +101,13 @@ const operateList = [ ...@@ -100,11 +101,13 @@ const operateList = [
name: "删除", name: "删除",
value: "删除", value: "删除",
click: async (slotProps: any) => { click: async (slotProps: any) => {
const res = await deleteCopyRights([slotProps.id]); showTip("此操作将删除该版权, 是否继续?", async () => {
if (res && res.code === 200) { const res = await deleteCopyRights([slotProps.id]);
ElMessage.success("删除成功"); if (res && res.code === 200) {
emit("refresh"); ElMessage.success("删除成功");
} emit("refresh");
}
});
}, },
}, },
]; ];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment