fix:作品、公司简介模块优化
This commit is contained in:
parent
675f0cdfdf
commit
baa2e726ab
@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<span class="dialog-footer">
|
<span class="dialog-footer">
|
||||||
<el-button type="primary" @click="handleAddClick(formRef)">添加</el-button>
|
<el-button type="primary" @click="handleAddClick(formRef)" :loading="isBtnLod">添加</el-button>
|
||||||
<el-button @click="handleResetClick(formRef)">重置</el-button>
|
<el-button @click="handleResetClick(formRef)">重置</el-button>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
@ -112,6 +112,7 @@ const closeDialog = () => {
|
|||||||
emits("update:modelValue", false);
|
emits("update:modelValue", false);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const isBtnLod = ref(false);
|
||||||
const handleAddClick = async (formEl) => {
|
const handleAddClick = async (formEl) => {
|
||||||
console.log(formData);
|
console.log(formData);
|
||||||
if (!formEl) return;
|
if (!formEl) return;
|
||||||
@ -119,12 +120,16 @@ const handleAddClick = async (formEl) => {
|
|||||||
if (!valid) {
|
if (!valid) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
isBtnLod.value = true;
|
||||||
const { code } = await addCompanyProfile(formData);
|
const { code, msg } = await addCompanyProfile(formData);
|
||||||
if (code == 0) {
|
if (code == 0) {
|
||||||
closeDialog();
|
closeDialog();
|
||||||
props.done();
|
props.done();
|
||||||
|
ElMessage.success(msg);
|
||||||
|
} else {
|
||||||
|
ElMessage.error(msg);
|
||||||
}
|
}
|
||||||
|
isBtnLod.value = false;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<span class="dialog-footer">
|
<span class="dialog-footer">
|
||||||
<el-button type="primary" @click="handleEditClick(formRef)">编辑</el-button>
|
<el-button type="primary" @click="handleEditClick(formRef)" :loading="isBtnLod">编辑</el-button>
|
||||||
<el-button @click="handleResetClick(formRef)">重置</el-button>
|
<el-button @click="handleResetClick(formRef)">重置</el-button>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
@ -109,6 +109,7 @@ const rules = reactive({
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const isBtnLod = ref(false);
|
||||||
const handleEditClick = async (formEl) => {
|
const handleEditClick = async (formEl) => {
|
||||||
console.log(formData.value);
|
console.log(formData.value);
|
||||||
if (!formEl) return;
|
if (!formEl) return;
|
||||||
@ -116,12 +117,16 @@ const handleEditClick = async (formEl) => {
|
|||||||
if (!valid) {
|
if (!valid) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
isBtnLod.value = true;
|
||||||
const { code } = await editCompanyProfile(formData.value);
|
const { code ,msg} = await editCompanyProfile(formData.value);
|
||||||
if (code == 0) {
|
if (code == 0) {
|
||||||
closeDialog();
|
closeDialog();
|
||||||
props.done();
|
props.done();
|
||||||
|
ElMessage.success(msg);
|
||||||
|
} else {
|
||||||
|
ElMessage.error(msg);
|
||||||
}
|
}
|
||||||
|
isBtnLod.value = false;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const handleResetClick = async (formEl) => {
|
const handleResetClick = async (formEl) => {
|
||||||
|
@ -203,10 +203,13 @@ const handleAddClick = async (formEl) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
isBtnLod.value = true;
|
isBtnLod.value = true;
|
||||||
const { code } = await addWorks(formData);
|
const { code,msg } = await addWorks(formData);
|
||||||
if (code == 0) {
|
if (code == 0) {
|
||||||
closeDialog();
|
closeDialog();
|
||||||
props.done();
|
props.done();
|
||||||
|
ElMessage.success(msg);
|
||||||
|
} else {
|
||||||
|
ElMessage.error(msg);
|
||||||
}
|
}
|
||||||
isBtnLod.value = false;
|
isBtnLod.value = false;
|
||||||
});
|
});
|
||||||
|
@ -199,10 +199,13 @@ const handleEditClick = async (formEl) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
isBtnLod.value = true;
|
isBtnLod.value = true;
|
||||||
const { code } = await editWorks(formData.value);
|
const { code,msg } = await editWorks(formData.value);
|
||||||
if (code == 0) {
|
if (code == 0) {
|
||||||
closeDialog();
|
closeDialog();
|
||||||
props.done();
|
props.done();
|
||||||
|
ElMessage.success(msg);
|
||||||
|
} else {
|
||||||
|
ElMessage.error(msg);
|
||||||
}
|
}
|
||||||
isBtnLod.value = false;
|
isBtnLod.value = false;
|
||||||
});
|
});
|
||||||
|
@ -31,8 +31,8 @@ export function deleteCompanyProfile(data) {
|
|||||||
*/
|
*/
|
||||||
export function addCompanyProfile(data) {
|
export function addCompanyProfile(data) {
|
||||||
return api.post('AboutUs.CompanyProfile/addCompanyProfile', data, {
|
return api.post('AboutUs.CompanyProfile/addCompanyProfile', data, {
|
||||||
isTransformResponse: true,
|
// isTransformResponse: true,
|
||||||
isShowSuccessMessage: true,
|
// isShowSuccessMessage: true,
|
||||||
errorMessageText: '添加失败'
|
errorMessageText: '添加失败'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -43,8 +43,8 @@ export function addCompanyProfile(data) {
|
|||||||
*/
|
*/
|
||||||
export function editCompanyProfile(data) {
|
export function editCompanyProfile(data) {
|
||||||
return api.post('AboutUs.CompanyProfile/editCompanyProfile', data, {
|
return api.post('AboutUs.CompanyProfile/editCompanyProfile', data, {
|
||||||
isTransformResponse: true,
|
// isTransformResponse: true,
|
||||||
isShowSuccessMessage: true,
|
// isShowSuccessMessage: true,
|
||||||
errorMessageText: '编辑失败'
|
errorMessageText: '编辑失败'
|
||||||
});
|
});
|
||||||
}
|
}
|
@ -59,8 +59,8 @@ export function deleteWorks(data) {
|
|||||||
*/
|
*/
|
||||||
export function addWorks(data) {
|
export function addWorks(data) {
|
||||||
return api.post('Works.Works/addWorks', data, {
|
return api.post('Works.Works/addWorks', data, {
|
||||||
isTransformResponse: true,
|
// isTransformResponse: true,
|
||||||
isShowSuccessMessage: true,
|
// isShowSuccessMessage: true,
|
||||||
errorMessageText: '添加失败'
|
errorMessageText: '添加失败'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -71,8 +71,8 @@ export function addWorks(data) {
|
|||||||
*/
|
*/
|
||||||
export function editWorks(data) {
|
export function editWorks(data) {
|
||||||
return api.post('Works.Works/editWorks', data, {
|
return api.post('Works.Works/editWorks', data, {
|
||||||
isTransformResponse: true,
|
// isTransformResponse: true,
|
||||||
isShowSuccessMessage: true,
|
// isShowSuccessMessage: true,
|
||||||
errorMessageText: '编辑失败'
|
errorMessageText: '编辑失败'
|
||||||
});
|
});
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user