项目列表
This commit is contained in:
@@ -77,6 +77,7 @@ const paginatedData = computed(() => {
|
||||
|
||||
const changePage = (page) => {
|
||||
currentPage.value = page
|
||||
getList();
|
||||
}
|
||||
|
||||
// 模态框
|
||||
@@ -121,8 +122,6 @@ const handleUploadChange = (info) => {
|
||||
}
|
||||
if (info.file.status === "done") {
|
||||
// 模拟上传成功后获取图片URL
|
||||
currentItem.value.cover =
|
||||
"https://img1.baidu.com/it/u=2172818577,3783888802&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=1422"
|
||||
uploading.value = false
|
||||
message.success("封面上传成功")
|
||||
}
|
||||
@@ -206,6 +205,14 @@ const beforeVideoUpload = (file) => {
|
||||
return isVideo && isLt50M
|
||||
}
|
||||
|
||||
const customCoverRequest = ({ file, onSuccess }) => {
|
||||
// 模拟上传
|
||||
uploadImageApi(file).then((res) => {
|
||||
currentItem.value.cover = res.url;
|
||||
onSuccess("ok", { status: "done" })
|
||||
})
|
||||
}
|
||||
|
||||
const customRequest = ({ file, onSuccess }) => {
|
||||
// 模拟上传
|
||||
uploadImageApi(file).then((res) => {
|
||||
@@ -843,7 +850,7 @@ getList();
|
||||
v-model:file-list="fileList"
|
||||
list-type="picture-card"
|
||||
:before-upload="beforeUpload"
|
||||
:custom-request="customRequest"
|
||||
:custom-request="customCoverRequest"
|
||||
@preview="handlePreview"
|
||||
@change="handleUploadChange"
|
||||
:show-upload-list="{ showPreviewIcon: true, showRemoveIcon: true }"
|
||||
|
||||
Reference in New Issue
Block a user