refactor(src): 优化代码格式和功能

- 调整了部分组件中的代码格式,提高了可读性
- 优化了图像上传功能,增加了对高度的处理逻辑
- 移除了不必要的注释代码
- 统一了异步函数的定义方式
This commit is contained in:
陈昱达
2025-03-20 17:15:29 +08:00
parent 70e0ebda62
commit 0952a2f523
5 changed files with 46 additions and 36 deletions

View File

@@ -141,7 +141,7 @@ const onLoad = () => {
fetchSurveys();
}, 500);
};
const fetchSurveys = async () => {
const fetchSurveys = async() => {
const params = {
page: form.value.page,
per_page: form.value.pageSize,
@@ -179,7 +179,7 @@ const deleteItem = (item) => {
showCancelButton: true,
confirmButtonColor: '#03B03C'
})
.then(async () => {
.then(async() => {
const res = await deleteSurveys(item.sn);
if (res.data.message) {
showToast(res.data.message);
@@ -203,7 +203,7 @@ const copyItem = (item) => {
showCancelButton: true,
confirmButtonColor: '#03B03C'
})
.then(async () => {
.then(async() => {
const res = await copySurveys(item.sn);
if (res.data.code === 200 || res.data.code === 201) {
showSuccessToast('复制成功');
@@ -262,7 +262,7 @@ const editItem = (item) => {
});
};
// 保存为模板
const saveTemplate = async (item) => {
const saveTemplate = async(item) => {
const data = JSON.parse(JSON.stringify(item));
const res = await saveTemplates(item.sn, data);
if (res.data.code === 200 || res.data.code === 201) {