diff --git a/pages/chat/components/ai-paging.vue b/pages/chat/components/ai-paging.vue
index 585eb7c..81887db 100644
--- a/pages/chat/components/ai-paging.vue
+++ b/pages/chat/components/ai-paging.vue
@@ -241,7 +241,7 @@
-
+
@@ -282,7 +282,7 @@ const emit = defineEmits(['onConfirm']);
const { messages, isTyping, textInput, chatSessionID } = storeToRefs(useChatGroupDBStore());
import successIcon from '@/static/icon/success.png';
import useUserStore from '@/stores/useUserStore';
-const {isMachineEnv} = storeToRefs(useUserStore());
+const { isMachineEnv } = storeToRefs(useUserStore());
// hook
// 语音识别
const {
@@ -463,7 +463,14 @@ function getGuess() {
}
function isImage(type) {
- return new RegExp('image').test(type);
+ if (!type || typeof type !== 'string') return false;
+ const imageTypes = [
+ 'jpg', 'jpeg', 'png', 'gif', 'bmp',
+ 'webp', 'svg', 'tiff', 'tif', 'ico',
+ 'apng', 'avif', 'heic', 'heif', 'jfif'
+ ];
+ const lowerType = type.toLowerCase();
+ return imageTypes.includes(lowerType);
}
function isFile(type) {
@@ -543,6 +550,31 @@ function getUploadFile(type = 'camera') {
});
}
+const handleFileSend = (rows)=>{
+ filesList.value = []
+ try {
+ rows.map(item=>{
+ if(isImage(item.fileSuffix)){
+ filesList.value.push({
+ url: item.fileUrl,
+ type: item.fileSuffix,
+ name: item.fileName,
+ });
+ }else{
+ filesList.value.push({
+ url: item.fileUrl,
+ type: item.fileSuffix,
+ name: item.fileName,
+ });
+ }
+ })
+ textInput.value = state.uploadFileTips;
+
+ } catch (error) {
+ console.log(error)
+ }
+}
+
const tipsPermisson = () => {
uni.showToast({
title: '需要授权麦克风权限才能使用语音功能',
@@ -604,7 +636,7 @@ function changeVoice() {
}
function changeShowFile() {
- if(isMachineEnv){
+ if(isMachineEnv.value){
qrcodeRef.value?.open()
return
}
diff --git a/pages/chat/components/fileIcon.vue b/pages/chat/components/fileIcon.vue
index 888c53b..a49cce1 100644
--- a/pages/chat/components/fileIcon.vue
+++ b/pages/chat/components/fileIcon.vue
@@ -1,5 +1,5 @@
-
+
{
'text/markdown': 'MD',
'text/plain': 'TXT',
'text/html': 'HTML',
+ 'xls': 'XLS',
+ 'xlsx': 'XLSX',
+ 'pdf': 'PDF',
+ 'ppt': 'PPT',
+ 'pptx': 'PPTX',
};
return typeMap[props.type] || 'OTHER';
});
diff --git a/pages/chat/components/uploadQrcode.vue b/pages/chat/components/uploadQrcode.vue
index ddb294e..1fabc84 100644
--- a/pages/chat/components/uploadQrcode.vue
+++ b/pages/chat/components/uploadQrcode.vue
@@ -1,97 +1,259 @@
-
+
+
+
+
+
+
+
+
+
📎 选择文件
+
+
📁
+
点击选择文件
+
支持图片、文档、文本等格式
单个文件不超过10MB
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
✅
+
上传成功!
+
文件已成功上传到电脑端
+
+
+
+
+
+
![预览图片]()
+
+
+
+
+
+