Commit 3ce01933 authored by chenqikuai's avatar chenqikuai

fix

parent 251721c6
......@@ -89,12 +89,13 @@ export function getCopyRight(id: number) {
});
}
export function putCopyRight(id: number) {
export function putCopyRight(id: number, params: any) {
return $ajax({
type: "put",
url: "/api/copyright",
params: {
id,
...params
},
});
}
......
......@@ -265,6 +265,7 @@ import {
getAuths,
getCopyRight,
postCopyRight,
putCopyRight,
} from "@/service/copyrightService";
import { eStatusOfFilerCertification } from "@/components/ApproveStatus/status";
import { iAuth, iCopyRight, iCopyrightPostData } from "@/types/copyright";
......@@ -450,6 +451,8 @@ const getParams = ({ to_drafts }: { to_drafts: boolean }) => {
return params;
};
const route = useRoute();
const handleClickSave = async () => {
loading2.value = true;
formRef.value?.validate(async (isValid) => {
......@@ -458,7 +461,12 @@ const handleClickSave = async () => {
const params = getParams({
to_drafts: true,
});
const res = await postCopyRight(params);
let res: any;
if (route.query.id) {
res = await putCopyRight(Number(route.query.id), params);
} else {
res = await postCopyRight(params);
}
if (res && res.code === 200) {
ElMessage.success("保存成功");
router.push({
......@@ -477,7 +485,12 @@ const handleSubmit = () => {
const params = getParams({
to_drafts: false,
});
const res = await postCopyRight(params);
let res: any;
if (route.query.id) {
res = await putCopyRight(Number(route.query.id), params);
} else {
res = await postCopyRight(params);
}
loading1.value = false;
if (res && res.code === 200) {
ElMessage.success("添加成功");
......
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