feat(projects): 增加意见反馈
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, onBeforeUnmount, reactive, ref } from 'vue';
|
||||
import { ArrowDown, Delete, Document, Loading, Picture, QuestionFilled, Upload } from '@element-plus/icons-vue';
|
||||
import { deleteFile, downloadFile, uploadFile } from '@/service/api/file';
|
||||
import { buildFileProxyUrl, deleteFile, downloadFile, uploadFile } from '@/service/api/file';
|
||||
|
||||
defineOptions({ name: 'BusinessAttachmentUploader' });
|
||||
|
||||
@@ -233,7 +233,7 @@ async function uploadOne(file: File) {
|
||||
return;
|
||||
}
|
||||
|
||||
const { id, url } = result.data;
|
||||
const { id, configId, path, url } = result.data;
|
||||
|
||||
// 组件已卸载(用户上传过程中关弹层):onBeforeUnmount 已跑过且看不到这个 id,
|
||||
// 这里立刻调删除,避免孤儿文件
|
||||
@@ -251,7 +251,9 @@ async function uploadOne(file: File) {
|
||||
url,
|
||||
name: file.name,
|
||||
size: file.size,
|
||||
contentType: file.type || undefined
|
||||
contentType: file.type || undefined,
|
||||
configId,
|
||||
path
|
||||
}
|
||||
];
|
||||
session.addedIds.add(id);
|
||||
@@ -422,6 +424,16 @@ defineExpose({
|
||||
/** 父组件在提交前可读此值判断是否还有 pending 上传 */
|
||||
get hasUploading() {
|
||||
return hasUploading.value;
|
||||
},
|
||||
|
||||
/**
|
||||
* 返回当前已选附件的「永久代理 URL」数组(私有/公开桶都不过期)。
|
||||
* 缺 configId/path 时回退 item.url。供反馈等"按 URL 字符串存储"的场景使用。
|
||||
*/
|
||||
getPermanentUrls(): string[] {
|
||||
return model.value.map(item =>
|
||||
item.configId && item.path ? buildFileProxyUrl(item.configId, item.path) : item.url
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user