ai-chat-bot-interface 1.4.6 → 1.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/App.vue +1 -1
- package/src/components/OperateModule.vue +6 -4
package/package.json
CHANGED
package/src/App.vue
CHANGED
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
:key="index"
|
|
24
24
|
class="file_card"
|
|
25
25
|
>
|
|
26
|
-
<img class="
|
|
26
|
+
<img v-if="(item.file_type).toLocaleLowerCase().includes('pdf')" class="pdf" :src="pdfIcon" width="100%" alt="img" />
|
|
27
|
+
<img v-else class="img" :src="item.file_url" width="100%" alt="img" />
|
|
27
28
|
<div v-if="item.percent < 100" class="process">
|
|
28
29
|
<progress-ring :percent="item.percent" />
|
|
29
30
|
</div>
|
|
@@ -80,7 +81,7 @@
|
|
|
80
81
|
<input
|
|
81
82
|
ref="uploadInput"
|
|
82
83
|
type="file"
|
|
83
|
-
accept="image
|
|
84
|
+
accept="image/*,application/pdf"
|
|
84
85
|
style="display: none"
|
|
85
86
|
@change="handleFileChange"
|
|
86
87
|
/>
|
|
@@ -112,7 +113,7 @@ import AddIcon from './icons/addIcon.vue';
|
|
|
112
113
|
import CloseBorderIcon from './icons/closeBorderIcon.vue';
|
|
113
114
|
import CloseIcon from './icons/CloseIcon.vue';
|
|
114
115
|
import NewChat from './icons/newChat.vue';
|
|
115
|
-
|
|
116
|
+
const pdfIcon = 'https://prodstatic.weis1606.cn/api/smartFood/icon/pdf_icon.png';
|
|
116
117
|
const extraList = [
|
|
117
118
|
// { name: '相機', icon: CameraIcon, type: 'camera' },
|
|
118
119
|
{ name: '相冊', icon: PictureIcon, type: 'photo' },
|
|
@@ -237,10 +238,11 @@ const triggerUploadInput = () => {
|
|
|
237
238
|
|
|
238
239
|
const handleFileChange = (e) => {
|
|
239
240
|
const selFile = e.target.files[0];
|
|
240
|
-
|
|
241
|
+
console.log('=== file ===', e);
|
|
241
242
|
if (selFile) {
|
|
242
243
|
uFileList.value.push({
|
|
243
244
|
file: selFile,
|
|
245
|
+
file_type: selFile.type,
|
|
244
246
|
file_url: URL.createObjectURL(selFile),
|
|
245
247
|
size: (selFile.size / 1024).toFixed(2),
|
|
246
248
|
percent: 0,
|