+
@@ -37,4 +41,11 @@ watch(
border-radius: var(--el-border-radius-base);
padding: 10px;
}
+
+.res-container.is-plain {
+ padding: 0;
+ background: transparent;
+ border: none;
+ border-radius: 0;
+}
diff --git a/easyflow-ui-usercenter/app/src/components/upload/ChatFileUploader.vue b/easyflow-ui-usercenter/app/src/components/upload/ChatFileUploader.vue
index 2167283..d0d46dc 100644
--- a/easyflow-ui-usercenter/app/src/components/upload/ChatFileUploader.vue
+++ b/easyflow-ui-usercenter/app/src/components/upload/ChatFileUploader.vue
@@ -33,6 +33,7 @@ type SelfFilesCardProps = {
} & FilesCardProps;
const files = ref
([]);
+const fileInputRef = ref();
/**
* 上传前校验
*/
@@ -45,30 +46,11 @@ function handleBeforeUpload(file: File) {
return true;
}
-/**
- * 拖拽上传处理
- */
-async function handleUploadDrop(dropFiles: File[]) {
- if (dropFiles?.length) {
- if (dropFiles[0]?.type === '') {
- ElMessage.error('禁止上传文件夹!');
- return false;
- }
- for (const file of dropFiles) {
- if (handleBeforeUpload(file)) {
- await handleHttpRequest({ file });
- }
- }
- }
-}
-
/**
* 自定义上传请求
*/
async function handleHttpRequest(options: { file: File }) {
const { file } = options;
- const formData = new FormData();
- formData.append('file', file);
try {
const res = await api.upload(props.action, { file }, {});
@@ -104,6 +86,18 @@ async function uploadExternalFiles(fileList: File[]) {
}
}
+/**
+ * 处理原生文件选择
+ */
+async function handleFileInputChange(event: Event) {
+ const target = event.target as HTMLInputElement;
+ const selectedFiles = Array.from(target.files || []);
+ if (selectedFiles.length > 0) {
+ await uploadExternalFiles(selectedFiles);
+ }
+ target.value = '';
+}
+
/**
* 组件内部完成删除逻辑
*/
@@ -122,6 +116,13 @@ function getFileList(): string[] {
return files.value.map((file) => file.url);
}
+/**
+ * 触发原生文件选择
+ */
+function triggerFileSelect() {
+ fileInputRef.value?.click();
+}
+
watch(
() => props.externalFiles,
async (newFiles) => {
@@ -135,6 +136,7 @@ watch(
defineExpose({
getFileList,
+ triggerFileSelect,
clearFiles() {
files.value = [];
},
@@ -142,17 +144,20 @@ defineExpose({
-
+
+
diff --git a/easyflow-ui-usercenter/app/src/views/assistantMarket/assistant/index.vue b/easyflow-ui-usercenter/app/src/views/assistantMarket/assistant/index.vue
index d182da7..fe58bf4 100644
--- a/easyflow-ui-usercenter/app/src/views/assistantMarket/assistant/index.vue
+++ b/easyflow-ui-usercenter/app/src/views/assistantMarket/assistant/index.vue
@@ -1,9 +1,9 @@
@@ -145,11 +117,9 @@ const stopThinking = () => {
diff --git a/easyflow-ui-usercenter/app/src/views/chatAssistant/index.vue b/easyflow-ui-usercenter/app/src/views/chatAssistant/index.vue
index fc0ecfa..5820ac4 100644
--- a/easyflow-ui-usercenter/app/src/views/chatAssistant/index.vue
+++ b/easyflow-ui-usercenter/app/src/views/chatAssistant/index.vue
@@ -1,8 +1,10 @@