@touchvue/chat 1.0.0-beta.11 → 1.0.0-beta.13
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/es/package.json.mjs +1 -1
- package/es/packages/components/touchchat/component/ImageFile.vue2.mjs +3 -3
- package/es/packages/components/touchchat/component/ImageFile.vue2.mjs.map +1 -1
- package/es/packages/components/touchchat/component/UploadView.vue2.mjs +36 -12
- package/es/packages/components/touchchat/component/UploadView.vue2.mjs.map +1 -1
- package/es/packages/components/touchchat/src/AiChat/TouchChat.vue2.mjs +11 -3
- package/es/packages/components/touchchat/src/AiChat/TouchChat.vue2.mjs.map +1 -1
- package/es/packages/components/touchchat/src/AiChat/TouchHistory.vue2.mjs +7 -3
- package/es/packages/components/touchchat/src/AiChat/TouchHistory.vue2.mjs.map +1 -1
- package/lib/package.json.js +1 -1
- package/lib/packages/components/touchchat/component/ImageFile.vue2.js +3 -3
- package/lib/packages/components/touchchat/component/ImageFile.vue2.js.map +1 -1
- package/lib/packages/components/touchchat/component/UploadView.vue2.js +36 -12
- package/lib/packages/components/touchchat/component/UploadView.vue2.js.map +1 -1
- package/lib/packages/components/touchchat/src/AiChat/TouchChat.vue2.js +11 -3
- package/lib/packages/components/touchchat/src/AiChat/TouchChat.vue2.js.map +1 -1
- package/lib/packages/components/touchchat/src/AiChat/TouchHistory.vue2.js +7 -3
- package/lib/packages/components/touchchat/src/AiChat/TouchHistory.vue2.js.map +1 -1
- package/package.json +1 -1
package/es/package.json.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { defineComponent, ref, computed, watch, openBlock, createElementBlock, createElementVNode, createCommentVNode, toDisplayString } from 'vue';
|
|
2
|
-
import _imports_0 from '../img/link.png.mjs';
|
|
3
2
|
|
|
4
3
|
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5
4
|
__name: "ImageFile",
|
|
@@ -25,12 +24,13 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
25
24
|
}
|
|
26
25
|
});
|
|
27
26
|
return (_ctx, _cache) => {
|
|
27
|
+
var _a;
|
|
28
28
|
return openBlock(), createElementBlock("div", { class: "image-file" }, [
|
|
29
29
|
createElementVNode("div", { class: "image-file-content" }, [
|
|
30
30
|
createElementVNode("img", {
|
|
31
|
-
src:
|
|
31
|
+
src: (_a = _ctx.item.base64) != null ? _a : "../img/link.png",
|
|
32
32
|
alt: "\u56FE\u7247"
|
|
33
|
-
}),
|
|
33
|
+
}, null, 8, ["src"]),
|
|
34
34
|
!(showLoading.value || showError.value) && _ctx.hasColse ? (openBlock(), createElementBlock("div", {
|
|
35
35
|
key: 0,
|
|
36
36
|
class: "image-file-colse",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageFile.vue2.mjs","sources":["../../../../../../packages/components/touchchat/component/ImageFile.vue"],"sourcesContent":["<template>\n\t<div class=\"image-file\">\n\t\t<div class=\"image-file-content\">\n\t\t\t<img src=\"../img/link.png\" alt=\"图片\" />\n\t\t\t<div v-if=\"!(showLoading || showError) && hasColse\" class=\"image-file-colse\" @click=\"emits('colse', item.id)\">\n\t\t\t\t<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"5\" height=\"6\" viewBox=\"0 0 5 6\" fill=\"none\">\n\t\t\t\t\t<path d=\"M4.42492 5.31718L4.97489 4.76721L3.05002 2.84233L4.97493 0.917422L4.42496 0.36745L2.50005 2.29236L0.575118 0.367432L0.0251465 0.917403L1.95008 2.84233L0.0251875 4.76722L0.575159 5.3172L2.50005 3.39231L4.42492 5.31718Z\" fill=\"white\" />\n\t\t\t\t</svg>\n\t\t\t</div>\n\t\t\t<div v-if=\"showLoading\" class=\"img-file-loading\">\n\t\t\t\t<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"25\" viewBox=\"0 0 24 25\" fill=\"none\">\n\t\t\t\t\t<g clip-path=\"url(#paint0_angular_2715_440_clip_path)\" data-figma-skip-parse=\"true\">\n\t\t\t\t\t\t<g transform=\"matrix(0.0100142 0.00182077 -0.00182077 0.0100142 12 12.8423)\">\n\t\t\t\t\t\t\t<foreignObject x=\"-1427.97\" y=\"-1427.97\" width=\"2855.94\" height=\"2855.94\">\n\t\t\t\t\t\t\t\t<div xmlns=\"http://www.w3.org/1999/xhtml\" style=\"background: conic-gradient(from 90deg, rgba(255, 255, 255, 1) 0deg, rgba(255, 255, 255, 0) 84.375deg, rgba(255, 255, 255, 1) 360deg); height: 100%; width: 100%; opacity: 1\"></div>\n\t\t\t\t\t\t\t</foreignObject>\n\t\t\t\t\t\t</g>\n\t\t\t\t\t</g>\n\t\t\t\t\t<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M12 5.54499C7.96981 5.54499 4.7027 8.8121 4.7027 12.8423C4.7027 16.8725 7.96981 20.1396 12 20.1396C12.7463 20.1396 13.3514 20.7446 13.3514 21.4909C13.3514 22.2373 12.7463 22.8423 12 22.8423C6.47715 22.8423 2 18.3651 2 12.8423C2 7.31944 6.47715 2.84229 12 2.84229C17.5228 2.84229 22 7.31944 22 12.8423C22 13.5886 21.395 14.1936 20.6486 14.1936C19.9023 14.1936 19.2973 13.5886 19.2973 12.8423C19.2973 8.8121 16.0302 5.54499 12 5.54499Z\" data-figma-gradient-fill='{\"type\":\"GRADIENT_ANGULAR\",\"stops\":[{\"color\":{\"r\":1.0,\"g\":1.0,\"b\":1.0,\"a\":0.0},\"position\":0.2343750},{\"color\":{\"r\":1.0,\"g\":1.0,\"b\":1.0,\"a\":1.0},\"position\":1.0}],\"stopsVar\":[],\"transform\":{\"m00\":20.028446197509766,\"m01\":-3.6415407657623291,\"m02\":3.8065481185913086,\"m10\":3.6415374279022217,\"m11\":20.028463363647461,\"m12\":1.0072842836380005},\"opacity\":1.0,\"blendMode\":\"NORMAL\",\"visible\":true}' />\n\t\t\t\t\t<defs>\n\t\t\t\t\t\t<clipPath id=\"paint0_angular_2715_440_clip_path\">\n\t\t\t\t\t\t\t<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M12 5.54499C7.96981 5.54499 4.7027 8.8121 4.7027 12.8423C4.7027 16.8725 7.96981 20.1396 12 20.1396C12.7463 20.1396 13.3514 20.7446 13.3514 21.4909C13.3514 22.2373 12.7463 22.8423 12 22.8423C6.47715 22.8423 2 18.3651 2 12.8423C2 7.31944 6.47715 2.84229 12 2.84229C17.5228 2.84229 22 7.31944 22 12.8423C22 13.5886 21.395 14.1936 20.6486 14.1936C19.9023 14.1936 19.2973 13.5886 19.2973 12.8423C19.2973 8.8121 16.0302 5.54499 12 5.54499Z\" />\n\t\t\t\t\t\t</clipPath>\n\t\t\t\t\t</defs>\n\t\t\t\t</svg>\n\t\t\t\t<p class=\"img-file-title\">{{ progress }}%</p>\n\t\t\t</div>\n\t\t\t<div v-if=\"showError\" class=\"img-file-loading\">\n\t\t\t\t<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"14\" height=\"13\" viewBox=\"0 0 14 13\" fill=\"none\">\n\t\t\t\t\t<path d=\"M10.8891 10.7314C9.89379 11.7267 8.51879 12.3423 7 12.3423C3.96244 12.3423 1.5 9.87984 1.5 6.84229C1.5 3.80473 3.96244 1.34229 7 1.34229C8.51879 1.34229 9.89379 1.95789 10.8891 2.9532C11.3957 3.45982 12.5 4.7034 12.5 4.7034\" stroke=\"#F93920\" stroke-width=\"1.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\n\t\t\t\t\t<path d=\"M12.5 1.95374V4.70374H9.75\" stroke=\"#F93920\" stroke-width=\"1.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\n\t\t\t\t</svg>\n\t\t\t\t<p class=\"img-file-error\">错误</p>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</template>\n<script setup lang=\"ts\">\nimport { ref, watch, defineProps, computed, defineEmits } from 'vue'\nconst props = defineProps<{\n\titem: {\n\t\tfile?: File\n\t\tisUploading: boolean\n\t\tuploadProgress: number\n\t\tuploadSuccess: boolean\n\t\tuploadError: boolean\n\t\tfileSize: string\n\t\tfileType: string\n\t\tname: string\n\t\tid: string\n\t}\n\thasColse: boolean\n}>()\nconst emits = defineEmits(['colse'])\nconst showLoading = ref(false)\nconst showError = ref(false)\nconst progress = computed(() => {\n\treturn props.item.uploadProgress ?? 0\n})\n\nwatch(progress, newVal => {\n\tif (newVal === 100 || newVal === 0) {\n\t\tshowLoading.value = false\n\t} else {\n\t\tshowLoading.value = true\n\t}\n})\n</script>\n"],"names":["_createElementBlock","_createElementVNode","
|
|
1
|
+
{"version":3,"file":"ImageFile.vue2.mjs","sources":["../../../../../../packages/components/touchchat/component/ImageFile.vue"],"sourcesContent":["<template>\n\t<div class=\"image-file\">\n\t\t<div class=\"image-file-content\">\n\t\t\t<img :src=\"item.base64 ?? '../img/link.png'\" alt=\"图片\" />\n\t\t\t<div v-if=\"!(showLoading || showError) && hasColse\" class=\"image-file-colse\" @click=\"emits('colse', item.id)\">\n\t\t\t\t<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"5\" height=\"6\" viewBox=\"0 0 5 6\" fill=\"none\">\n\t\t\t\t\t<path d=\"M4.42492 5.31718L4.97489 4.76721L3.05002 2.84233L4.97493 0.917422L4.42496 0.36745L2.50005 2.29236L0.575118 0.367432L0.0251465 0.917403L1.95008 2.84233L0.0251875 4.76722L0.575159 5.3172L2.50005 3.39231L4.42492 5.31718Z\" fill=\"white\" />\n\t\t\t\t</svg>\n\t\t\t</div>\n\t\t\t<div v-if=\"showLoading\" class=\"img-file-loading\">\n\t\t\t\t<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"25\" viewBox=\"0 0 24 25\" fill=\"none\">\n\t\t\t\t\t<g clip-path=\"url(#paint0_angular_2715_440_clip_path)\" data-figma-skip-parse=\"true\">\n\t\t\t\t\t\t<g transform=\"matrix(0.0100142 0.00182077 -0.00182077 0.0100142 12 12.8423)\">\n\t\t\t\t\t\t\t<foreignObject x=\"-1427.97\" y=\"-1427.97\" width=\"2855.94\" height=\"2855.94\">\n\t\t\t\t\t\t\t\t<div xmlns=\"http://www.w3.org/1999/xhtml\" style=\"background: conic-gradient(from 90deg, rgba(255, 255, 255, 1) 0deg, rgba(255, 255, 255, 0) 84.375deg, rgba(255, 255, 255, 1) 360deg); height: 100%; width: 100%; opacity: 1\"></div>\n\t\t\t\t\t\t\t</foreignObject>\n\t\t\t\t\t\t</g>\n\t\t\t\t\t</g>\n\t\t\t\t\t<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M12 5.54499C7.96981 5.54499 4.7027 8.8121 4.7027 12.8423C4.7027 16.8725 7.96981 20.1396 12 20.1396C12.7463 20.1396 13.3514 20.7446 13.3514 21.4909C13.3514 22.2373 12.7463 22.8423 12 22.8423C6.47715 22.8423 2 18.3651 2 12.8423C2 7.31944 6.47715 2.84229 12 2.84229C17.5228 2.84229 22 7.31944 22 12.8423C22 13.5886 21.395 14.1936 20.6486 14.1936C19.9023 14.1936 19.2973 13.5886 19.2973 12.8423C19.2973 8.8121 16.0302 5.54499 12 5.54499Z\" data-figma-gradient-fill='{\"type\":\"GRADIENT_ANGULAR\",\"stops\":[{\"color\":{\"r\":1.0,\"g\":1.0,\"b\":1.0,\"a\":0.0},\"position\":0.2343750},{\"color\":{\"r\":1.0,\"g\":1.0,\"b\":1.0,\"a\":1.0},\"position\":1.0}],\"stopsVar\":[],\"transform\":{\"m00\":20.028446197509766,\"m01\":-3.6415407657623291,\"m02\":3.8065481185913086,\"m10\":3.6415374279022217,\"m11\":20.028463363647461,\"m12\":1.0072842836380005},\"opacity\":1.0,\"blendMode\":\"NORMAL\",\"visible\":true}' />\n\t\t\t\t\t<defs>\n\t\t\t\t\t\t<clipPath id=\"paint0_angular_2715_440_clip_path\">\n\t\t\t\t\t\t\t<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M12 5.54499C7.96981 5.54499 4.7027 8.8121 4.7027 12.8423C4.7027 16.8725 7.96981 20.1396 12 20.1396C12.7463 20.1396 13.3514 20.7446 13.3514 21.4909C13.3514 22.2373 12.7463 22.8423 12 22.8423C6.47715 22.8423 2 18.3651 2 12.8423C2 7.31944 6.47715 2.84229 12 2.84229C17.5228 2.84229 22 7.31944 22 12.8423C22 13.5886 21.395 14.1936 20.6486 14.1936C19.9023 14.1936 19.2973 13.5886 19.2973 12.8423C19.2973 8.8121 16.0302 5.54499 12 5.54499Z\" />\n\t\t\t\t\t\t</clipPath>\n\t\t\t\t\t</defs>\n\t\t\t\t</svg>\n\t\t\t\t<p class=\"img-file-title\">{{ progress }}%</p>\n\t\t\t</div>\n\t\t\t<div v-if=\"showError\" class=\"img-file-loading\">\n\t\t\t\t<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"14\" height=\"13\" viewBox=\"0 0 14 13\" fill=\"none\">\n\t\t\t\t\t<path d=\"M10.8891 10.7314C9.89379 11.7267 8.51879 12.3423 7 12.3423C3.96244 12.3423 1.5 9.87984 1.5 6.84229C1.5 3.80473 3.96244 1.34229 7 1.34229C8.51879 1.34229 9.89379 1.95789 10.8891 2.9532C11.3957 3.45982 12.5 4.7034 12.5 4.7034\" stroke=\"#F93920\" stroke-width=\"1.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\n\t\t\t\t\t<path d=\"M12.5 1.95374V4.70374H9.75\" stroke=\"#F93920\" stroke-width=\"1.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\n\t\t\t\t</svg>\n\t\t\t\t<p class=\"img-file-error\">错误</p>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</template>\n<script setup lang=\"ts\">\nimport { ref, watch, defineProps, computed, defineEmits } from 'vue'\nconst props = defineProps<{\n\titem: {\n\t\tfile?: File\n\t\tisUploading: boolean\n\t\tuploadProgress: number\n\t\tuploadSuccess: boolean\n\t\tuploadError: boolean\n\t\tfileSize: string\n\t\tfileType: string\n\t\tname: string\n\t\tid: string\n\t\tbase64?: string\n\t}\n\thasColse: boolean\n}>()\nconst emits = defineEmits(['colse'])\nconst showLoading = ref(false)\nconst showError = ref(false)\nconst progress = computed(() => {\n\treturn props.item.uploadProgress ?? 0\n})\n\nwatch(progress, newVal => {\n\tif (newVal === 100 || newVal === 0) {\n\t\tshowLoading.value = false\n\t} else {\n\t\tshowLoading.value = true\n\t}\n})\n</script>\n"],"names":["_createElementBlock","_createElementVNode","item","hasColse","_toDisplayString"],"mappings":";;;;;;;;;;AAuCA,IAAA,MAAM,KAAQ,GAAA,OAAA,CAAA;AAed,IAAA,MAAM,KAAQ,GAAA,MAAA,CAAA;AACd,IAAM,MAAA,WAAA,GAAc,IAAI,KAAK,CAAA,CAAA;AAC7B,IAAM,MAAA,SAAA,GAAY,IAAI,KAAK,CAAA,CAAA;AAC3B,IAAM,MAAA,QAAA,GAAW,SAAS,MAAM;;AAC/B,MAAO,OAAA,CAAA,EAAA,GAAA,KAAA,CAAM,IAAK,CAAA,cAAA,KAAX,IAA6B,GAAA,EAAA,GAAA,CAAA,CAAA;AAAA,KACpC,CAAA,CAAA;AAED,IAAA,KAAA,CAAM,UAAU,CAAU,MAAA,KAAA;AACzB,MAAI,IAAA,MAAA,KAAW,GAAO,IAAA,MAAA,KAAW,CAAG,EAAA;AACnC,QAAA,WAAA,CAAY,KAAQ,GAAA,KAAA,CAAA;AAAA,OACd,MAAA;AACN,QAAA,WAAA,CAAY,KAAQ,GAAA,IAAA,CAAA;AAAA,OACrB;AAAA,KACA,CAAA,CAAA;;;wBAlEA,EAAAA,kBAAA,CAkCM,OAAA,EAlCD,KAAA,EAAM,cAAY,EAAA;AAAA,QACtBC,kBAgCM,CAAA,KAAA,EAAA,EAhCD,KAAA,EAAM,sBAAoB,EAAA;AAAA,UAC9BA,mBAAwD,KAAA,EAAA;AAAA,YAAlD,GAAKC,EAAAA,CAAAA,EAAAA,GAAAA,IAAAA,CAAI,IAAC,CAAA,MAAA,KAALA,IAAW,GAAA,EAAA,GAAA,iBAAA;AAAA,YAAuB,GAAI,EAAA,cAAA;AAAA;YACpC,WAAW,CAAA,KAAA,IAAI,SAAS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A,gBAApH,CAAE,EAAA,4BAAA;AAAA,gBAA6B,MAAO,EAAA,SAAA;AAAA,gBAAU,cAAa,EAAA,KAAA;AAAA,gBAAM,gBAAe,EAAA,OAAA;AAAA,gBAAQ,iBAAgB,EAAA,OAAA;AAAA;;YAEjHA,mBAAgC,GAA7B,EAAA,EAAA,KAAM,EAAA,gBAAA,IAAiB,cAAE,CAAA;AAAA;;;;;;;;;"}
|
|
@@ -17,18 +17,42 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
17
17
|
if (input.files && input.files.length > 0) {
|
|
18
18
|
for (let i = 0; i < input.files.length; i++) {
|
|
19
19
|
const file = input.files[i];
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
20
|
+
if (file.type.startsWith("image/")) {
|
|
21
|
+
const reader = new FileReader();
|
|
22
|
+
reader.onload = (e) => {
|
|
23
|
+
var _a;
|
|
24
|
+
const base64 = (_a = e.target) == null ? void 0 : _a.result;
|
|
25
|
+
fileInfos.value.push({
|
|
26
|
+
file,
|
|
27
|
+
isUploading: false,
|
|
28
|
+
uploadProgress: 0,
|
|
29
|
+
uploadSuccess: false,
|
|
30
|
+
uploadError: false,
|
|
31
|
+
fileSize: "",
|
|
32
|
+
fileType: file.type,
|
|
33
|
+
id: file.lastModified.toString(),
|
|
34
|
+
name: file.name,
|
|
35
|
+
base64
|
|
36
|
+
// 存储 Base64 数据
|
|
37
|
+
});
|
|
38
|
+
uploadFile(fileInfos.value.length - 1);
|
|
39
|
+
};
|
|
40
|
+
reader.readAsDataURL(file);
|
|
41
|
+
} else {
|
|
42
|
+
fileInfos.value.push({
|
|
43
|
+
file,
|
|
44
|
+
isUploading: false,
|
|
45
|
+
uploadProgress: 0,
|
|
46
|
+
uploadSuccess: false,
|
|
47
|
+
uploadError: false,
|
|
48
|
+
fileSize: "",
|
|
49
|
+
fileType: file.type,
|
|
50
|
+
id: file.lastModified.toString(),
|
|
51
|
+
name: file.name,
|
|
52
|
+
base64: null
|
|
53
|
+
});
|
|
54
|
+
uploadFile(fileInfos.value.length - 1);
|
|
55
|
+
}
|
|
32
56
|
}
|
|
33
57
|
}
|
|
34
58
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UploadView.vue2.mjs","sources":["../../../../../../packages/components/touchchat/component/UploadView.vue"],"sourcesContent":["<template>\n\t<div class=\"upload-view\">\n\t\t<!-- <button class=\"upload-button\" @click=\"triggerFileInput\">点击选择文件</button> -->\n\t\t<div @click=\"triggerFileInput\">\n\t\t\t<slot></slot>\n\t\t</div>\n\t\t<input ref=\"fileInput\" type=\"file\" class=\"file-input\" style=\"display: none\" multiple @change=\"handleFileChange\" />\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref } from 'vue'\ninterface FileInfo {\n\tfile: File\n\tisUploading: boolean\n\tuploadProgress: number\n\tuploadSuccess: boolean\n\tuploadError: boolean\n\tfileSize: string\n\tfileType: string\n\tid: string\n\tname: string\n}\n\nconst emit = defineEmits<{\n\t// (e: 'progressFn', value: number): void\n\t(e: 'file', value: any): void\n}>()\n\nconst fileInput = ref<HTMLInputElement | null>(null)\nconst fileInfos = ref<FileInfo[]>([])\n\n// 触发文件选择框\nconst triggerFileInput = () => {\n\tif (fileInput.value) {\n\t\tfileInput.value.click()\n\t}\n}\n\n// 处理文件选择\nconst handleFileChange = (event: Event) => {\n\tconst input = event.target as HTMLInputElement\n\tif (input.files && input.files.length > 0) {\n\t\tfor (let i = 0; i < input.files.length; i++) {\n\t\t\tconst file = input.files[i]\n\t\t\
|
|
1
|
+
{"version":3,"file":"UploadView.vue2.mjs","sources":["../../../../../../packages/components/touchchat/component/UploadView.vue"],"sourcesContent":["<template>\n\t<div class=\"upload-view\">\n\t\t<!-- <button class=\"upload-button\" @click=\"triggerFileInput\">点击选择文件</button> -->\n\t\t<div @click=\"triggerFileInput\">\n\t\t\t<slot></slot>\n\t\t</div>\n\t\t<input ref=\"fileInput\" type=\"file\" class=\"file-input\" style=\"display: none\" multiple @change=\"handleFileChange\" />\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref } from 'vue'\ninterface FileInfo {\n\tfile: File\n\tisUploading: boolean\n\tuploadProgress: number\n\tuploadSuccess: boolean\n\tuploadError: boolean\n\tfileSize: string\n\tfileType: string\n\tid: string\n\tname: string\n\tbase64: string | null\n}\n\nconst emit = defineEmits<{\n\t// (e: 'progressFn', value: number): void\n\t(e: 'file', value: any): void\n}>()\n\nconst fileInput = ref<HTMLInputElement | null>(null)\nconst fileInfos = ref<FileInfo[]>([])\n\n// 触发文件选择框\nconst triggerFileInput = () => {\n\tif (fileInput.value) {\n\t\tfileInput.value.click()\n\t}\n}\n\n// 处理文件选择\nconst handleFileChange = (event: Event) => {\n\tconst input = event.target as HTMLInputElement\n\tif (input.files && input.files.length > 0) {\n\t\tfor (let i = 0; i < input.files.length; i++) {\n\t\t\tconst file = input.files[i]\n\t\t\tif (file.type.startsWith('image/')) {\n\t\t\t\tconst reader = new FileReader()\n\t\t\t\treader.onload = e => {\n\t\t\t\t\tconst base64 = e.target?.result as string\n\t\t\t\t\tfileInfos.value.push({\n\t\t\t\t\t\tfile,\n\t\t\t\t\t\tisUploading: false,\n\t\t\t\t\t\tuploadProgress: 0,\n\t\t\t\t\t\tuploadSuccess: false,\n\t\t\t\t\t\tuploadError: false,\n\t\t\t\t\t\tfileSize: '',\n\t\t\t\t\t\tfileType: file.type,\n\t\t\t\t\t\tid: file.lastModified.toString(),\n\t\t\t\t\t\tname: file.name,\n\t\t\t\t\t\tbase64 // 存储 Base64 数据\n\t\t\t\t\t})\n\t\t\t\t\tuploadFile(fileInfos.value.length - 1)\n\t\t\t\t}\n\t\t\t\treader.readAsDataURL(file)\n\t\t\t} else {\n\t\t\t\tfileInfos.value.push({\n\t\t\t\t\tfile,\n\t\t\t\t\tisUploading: false,\n\t\t\t\t\tuploadProgress: 0,\n\t\t\t\t\tuploadSuccess: false,\n\t\t\t\t\tuploadError: false,\n\t\t\t\t\tfileSize: '',\n\t\t\t\t\tfileType: file.type,\n\t\t\t\t\tid: file.lastModified.toString(),\n\t\t\t\t\tname: file.name,\n\t\t\t\t\tbase64: null\n\t\t\t\t})\n\t\t\t\tuploadFile(fileInfos.value.length - 1)\n\t\t\t}\n\t\t}\n\t}\n}\n\n// 模拟文件上传\nconst uploadFile = (index: number) => {\n\tconst fileInfo = fileInfos.value[index]\n\tif (!fileInfo) return\n\n\tfileInfo.isUploading = true\n\tfileInfo.uploadSuccess = false\n\tfileInfo.uploadError = false\n\tfileInfo.uploadProgress = 0\n\tfileInfo.fileSize = formatFileSize(fileInfo.file.size)\n\tfileInfo.fileType = fileInfo.file.type\n\tfileInfo.id = fileInfo.file.lastModified.toString()\n\tfileInfo.name = fileInfo.file.name\n\n\tconst interval = setInterval(() => {\n\t\tfileInfo.uploadProgress += 10\n\t\t// emit('progressFn', fileInfo.uploadProgress)\n\t\temit('file', fileInfos.value)\n\t\tif (fileInfo.uploadProgress >= 100) {\n\t\t\tclearInterval(interval)\n\t\t\tfileInfo.isUploading = false\n\t\t\tfileInfo.uploadSuccess = true\n\t\t}\n\t}, 100)\n\n\t// 模拟上传失败的情况,可根据需求修改\n\t// setTimeout(() => {\n\t// clearInterval(interval);\n\t// fileInfo.isUploading = false;\n\t// fileInfo.uploadError = true;\n\t// }, 2000);\n}\n\n// 格式化文件大小\nconst formatFileSize = (bytes: number) => {\n\tif (bytes === 0) return '0 Bytes'\n\tconst k = 1024\n\tconst sizes = ['Bytes', 'KB', 'MB', 'GB']\n\tconst i = Math.floor(Math.log(bytes) / Math.log(k))\n\treturn parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i]\n}\n\nconst resetFile = () => {\n\tfileInfos.value = []\n\tif (fileInput.value) {\n\t\tfileInput.value.value = ''\n\t}\n}\ndefineExpose({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C,CAAG,EAAA,OAAA,CAAQ,CAAC,CAAC,CAAI,GAAA,GAAA,GAAM,MAAM,CAAC,CAAA,CAAA;AAAA,KACvE,CAAA;AAEA,IAAA,MAAM,YAAY,MAAM;AACvB,MAAA,SAAA,CAAU,QAAQ,EAAC,CAAA;AACnB,MAAA,IAAI,UAAU,KAAO,EAAA;AACpB,QAAA,SAAA,CAAU,MAAM,KAAQ,GAAA,EAAA,CAAA;AAAA,OACzB;AAAA,KACD,CAAA;AACA,IAAa,QAAA,CAAA;AAAA,MACZ,SAAA;AAAA,KACA,CAAA,CAAA;;wBArIA,EAAAA,kBAAA,CAMM,OAAA,EAND,KAAA,EAAM,eAAa,EAAA;AAAA,QACvBC,mBAAgF,yGAAA,CAAA;AAAA,QAChFC,kBAEM,CAAA,KAAA,EAAA,EAFA,OAAA,EAAO,kBAAgB,EAAA;AAAA,UAC5BC,UAAA,CAAa,IAAA,CAAA,MAAA,EAAA,SAAA,CAAA;AAAA;QAEdD,kBAAA;AAAA,UAAkH,OAAA;AAAA,UAAA;AAAA,mBAAvG,EAAA,WAAA;AAAA,YAAJ,GAAI,EAAA,SAAA;AAAA,YAAY,IAAK,EAAA,MAAA;AAAA,YAAO,KAAM,EAAA,YAAA;AAAA,YAAa,KAAA,EAAA,EAAqB,SAAA,EAAA,MAAA,EAAA;AAAA,YAAC,QAAA,EAAA,EAAA;AAAA,YAAU,QAAQ,EAAA,gBAAA;AAAA;;;;;;;;;;;;"}
|
|
@@ -122,7 +122,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
122
122
|
const aiMessage = item.intro;
|
|
123
123
|
messageUtils.updateMessage(0, {
|
|
124
124
|
content: "",
|
|
125
|
-
isChating:
|
|
125
|
+
isChating: false
|
|
126
126
|
});
|
|
127
127
|
simulateStreamOutput(0, aiMessage);
|
|
128
128
|
};
|
|
@@ -247,7 +247,15 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
247
247
|
break;
|
|
248
248
|
}
|
|
249
249
|
if (nextItem.user === "ai") {
|
|
250
|
-
|
|
250
|
+
if (nextItem.data && nextItem.type) {
|
|
251
|
+
responses.push({
|
|
252
|
+
...nextItem,
|
|
253
|
+
// 标记需要先流式输出文字,再调用组件
|
|
254
|
+
needSequenceProcessing: true
|
|
255
|
+
});
|
|
256
|
+
} else {
|
|
257
|
+
responses.push(nextItem);
|
|
258
|
+
}
|
|
251
259
|
}
|
|
252
260
|
}
|
|
253
261
|
const nextIndex = matchContent.findIndex((contentItem, index) => index > matchedScriptContentIndex && contentItem.user === "i");
|
|
@@ -769,8 +777,8 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
769
777
|
user: "ai",
|
|
770
778
|
type: "text",
|
|
771
779
|
content: content2 || "",
|
|
780
|
+
componentName: response.needSequenceProcessing ? "" : response.type || "",
|
|
772
781
|
// componentName: response.type || '',
|
|
773
|
-
componentName: "",
|
|
774
782
|
isShowLike: true,
|
|
775
783
|
isShowCopy: true,
|
|
776
784
|
needSequenceType: response.type || "",
|