优化 AI 绘图提示词模板,给文件上传增加锁定遮罩层

This commit is contained in:
RockYang
2025-02-28 07:50:10 +08:00
parent 04b364c1cd
commit f98dcee7d4
6 changed files with 38 additions and 51 deletions

View File

@@ -53,6 +53,7 @@ import {isImage, removeArrayItem} from "@/utils/libs";
import {GetFileIcon} from "@/store/system";
import {checkSession} from "@/store/cache";
import {useSharedStore} from "@/store/sharedata";
import {closeLoading, showLoading} from "@/utils/dialog";
const props = defineProps({
userId: Number,
@@ -111,14 +112,17 @@ const onScroll = (options) => {
const afterRead = (file) => {
const formData = new FormData();
formData.append("file", file.file, file.name);
showLoading("文件上传中...");
// 执行上传操作
httpPost("/api/upload", formData)
.then((res) => {
fileData.items.unshift(res.data);
ElMessage.success({ message: "上传成功", duration: 500 });
closeLoading()
})
.catch((e) => {
ElMessage.error("图片上传失败:" + e.message);
closeLoading()
});
};

View File

@@ -663,7 +663,7 @@ import { copyObj, removeArrayItem } from "@/utils/libs";
import { useSharedStore } from "@/store/sharedata";
import TaskList from "@/components/TaskList.vue";
import BackTop from "@/components/BackTop.vue";
import { showMessageError } from "@/utils/dialog";
import {closeLoading, showLoading, showMessageError} from "@/utils/dialog";
const listBoxHeight = ref(0);
const paramBoxHeight = ref(0);
@@ -939,6 +939,7 @@ const uploadImg = (file) => {
success(result) {
const formData = new FormData();
formData.append("file", result, result.name);
showLoading("图片上传中...");
// 执行上传操作
httpPost("/api/upload", formData)
.then((res) => {
@@ -950,9 +951,11 @@ const uploadImg = (file) => {
imgKey.value = "";
}
ElMessage.success("上传成功");
closeLoading();
})
.catch((e) => {
ElMessage.error("上传失败:" + e.message);
closeLoading();
});
},
error(err) {

View File

@@ -284,7 +284,7 @@ import { Plus, InfoFilled } from "@element-plus/icons-vue";
import { httpGet, httpPost, httpDownload } from "@/utils/http";
import { ElMessage, ElMessageBox } from "element-plus";
import { getClientId } from "@/store/cache";
import { showMessageError, showMessageOK } from "@/utils/dialog";
import {closeLoading, showLoading, showMessageError, showMessageOK} from "@/utils/dialog";
// 参数设置
const params = reactive({
@@ -357,11 +357,14 @@ const uploadStartImage = async (file) => {
const formData = new FormData();
formData.append("file", file.file);
try {
showLoading("图片上传中...");
const res = await httpPost("/api/upload", formData);
params.image = res.data.url;
ElMessage.success("上传成功");
closeLoading()
} catch (e) {
showMessageError("上传失败: " + e.message);
closeLoading()
}
};

View File

@@ -231,14 +231,17 @@ const publishJob = (item) => {
const upload = (file) => {
const formData = new FormData();
formData.append("file", file.file, file.name);
showLoading("正在上传文件...")
// 执行上传操作
httpPost("/api/upload", formData)
.then((res) => {
images.value.push(res.data.url);
ElMessage.success({ message: "上传成功", duration: 500 });
closeLoading()
})
.catch((e) => {
ElMessage.error("图片上传失败:" + e.message);
closeLoading()
});
};

View File

@@ -278,7 +278,7 @@ import BlackInput from "@/components/ui/BlackInput.vue";
import MusicPlayer from "@/components/MusicPlayer.vue";
import { compact } from "lodash";
import { httpDownload, httpGet, httpPost } from "@/utils/http";
import { showMessageError, showMessageOK } from "@/utils/dialog";
import {closeLoading, showLoading, showMessageError, showMessageOK} from "@/utils/dialog";
import { checkSession, getClientId } from "@/store/cache";
import { ElMessage, ElMessageBox } from "element-plus";
import { formatTime, replaceImg } from "@/utils/libs";
@@ -473,6 +473,7 @@ const download = (item) => {
const uploadAudio = (file) => {
const formData = new FormData();
formData.append("file", file.file, file.name);
showLoading("正在上传文件...");
// 执行上传操作
httpPost("/api/upload", formData)
.then((res) => {
@@ -484,9 +485,11 @@ const uploadAudio = (file) => {
.then(() => {
fetchData(1);
showMessageOK("歌曲上传成功");
closeLoading();
})
.catch((e) => {
showMessageError("歌曲上传失败:" + e.message);
closeLoading();
});
removeRefSong();
ElMessage.success({ message: "上传成功", duration: 500 });
@@ -597,14 +600,17 @@ const uploadCover = (file) => {
success(result) {
const formData = new FormData();
formData.append("file", result, result.name);
showLoading("图片上传中...");
// 执行上传操作
httpPost("/api/upload", formData)
.then((res) => {
editData.value.cover = res.data.url;
ElMessage.success({ message: "上传成功", duration: 500 });
closeLoading()
})
.catch((e) => {
ElMessage.error("图片上传失败:" + e.message);
closeLoading()
});
},
error(err) {