Commit 9d82c7c3 authored by chenqikuai's avatar chenqikuai

fix

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