Commit 3ce01933 authored by chenqikuai's avatar chenqikuai

fix

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