@kg-ui/kg-ui-plus 0.1.55 → 0.1.60

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.
Files changed (36) hide show
  1. package/dist/es/KgCopilot/CopiCanvas/FileSkeletion.vue.mjs +96 -0
  2. package/dist/es/KgCopilot/CopiCanvas/FileSkeletion.vue2.mjs +4 -0
  3. package/dist/es/KgCopilot/CopiCanvas/InitWrap.vue.mjs +7 -0
  4. package/dist/es/KgCopilot/CopiCanvas/InitWrap.vue2.mjs +41 -0
  5. package/dist/es/KgCopilot/CopiCanvas/InitWrap.vue3.mjs +4 -0
  6. package/dist/es/KgCopilot/CopiCanvas/docViewer/index.vue.mjs +7 -0
  7. package/dist/es/KgCopilot/CopiCanvas/docViewer/index.vue2.mjs +74 -0
  8. package/dist/es/KgCopilot/CopiCanvas/docViewer/index.vue3.mjs +4 -0
  9. package/dist/es/KgCopilot/CopiCanvas/docViewer/wpsFileViewer/wpsAi/AiBar.vue.mjs +1 -1
  10. package/dist/es/KgCopilot/CopiCanvas/docViewer/wpsFileViewer/wpsAi/AiBar.vue2.mjs +2 -1
  11. package/dist/es/KgCopilot/CopiCanvas/docViewer/wpsFileViewer/wpsAi/AiBar.vue3.mjs +2 -2
  12. package/dist/es/KgCopilot/CopiCanvas/docViewer/wpsFileViewer/wpsAi/AiInput.vue.mjs +1 -1
  13. package/dist/es/KgCopilot/CopiCanvas/docViewer/wpsFileViewer/wpsAi/AiInput.vue2.mjs +53 -11
  14. package/dist/es/KgCopilot/CopiCanvas/docViewer/wpsFileViewer/wpsAi/AiInput.vue3.mjs +2 -2
  15. package/dist/es/KgCopilot/CopiCanvas/docViewer/wpsFileViewer/wpsPanel.vue.mjs +2 -2
  16. package/dist/es/KgCopilot/CopiCanvas/docViewer/wpsFileViewer/wpsPanel.vue2.mjs +7 -4
  17. package/dist/es/KgCopilot/CopiCanvas/docViewer/wpsFileViewer/wpsPanel.vue3.mjs +2 -2
  18. package/dist/es/KgCopilot/CopiCanvas/index.vue.mjs +1 -1
  19. package/dist/es/KgCopilot/CopiCanvas/index.vue2.mjs +4 -3
  20. package/dist/es/KgCopilot/CopiCanvas/index.vue3.mjs +2 -2
  21. package/dist/es/KgCopilot/dialogue/messageParse/fileBox.vue.mjs +12 -6
  22. package/dist/es/KgCopilot/dialogue/messageParse/fileBox.vue2.mjs +2 -2
  23. package/dist/es/api/copilot.mjs +25 -1
  24. package/dist/es/assets/empty.png.mjs +4 -0
  25. package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/folder-opened.mjs +8 -0
  26. package/dist/es/node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/file-damage-line.mjs +8 -0
  27. package/dist/es/node_modules/.pnpm/call-bind-apply-helpers@1.0.1/node_modules/call-bind-apply-helpers/actualApply.mjs +4 -4
  28. package/dist/es/node_modules/.pnpm/call-bind-apply-helpers@1.0.1/node_modules/call-bind-apply-helpers/functionCall.mjs +10 -2
  29. package/dist/es/node_modules/.pnpm/call-bind-apply-helpers@1.0.1/node_modules/call-bind-apply-helpers/index.mjs +4 -4
  30. package/dist/es/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/implementation.mjs +73 -65
  31. package/dist/es/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/index.mjs +12 -4
  32. package/dist/es/node_modules/.pnpm/get-intrinsic@1.2.6/node_modules/get-intrinsic/index.mjs +4 -4
  33. package/dist/es/node_modules/.pnpm/hasown@2.0.2/node_modules/hasown/index.mjs +2 -2
  34. package/dist/es/store/modules/copilot.mjs +20 -0
  35. package/dist/es/style.css +1 -1
  36. package/package.json +1 -1
@@ -0,0 +1,96 @@
1
+ import { defineComponent, ref, resolveComponent, openBlock, createBlock, withCtx, createVNode, createElementVNode, createElementBlock, Fragment, renderList } from "vue";
2
+ const _hoisted_1 = { class: "flex justify-center mb-3" };
3
+ const _hoisted_2 = { style: { "display": "flex", "align-items": "center", "justify-items": "space-between" } };
4
+ const _hoisted_3 = { style: { "display": "flex", "align-items": "center", "justify-items": "space-between" } };
5
+ const _sfc_main = /* @__PURE__ */ defineComponent({
6
+ __name: "FileSkeletion",
7
+ setup(__props) {
8
+ const fileLoading = ref(true);
9
+ return (_ctx, _cache) => {
10
+ const _component_el_skeleton_item = resolveComponent("el-skeleton-item");
11
+ const _component_el_skeleton = resolveComponent("el-skeleton");
12
+ const _component_el_scrollbar = resolveComponent("el-scrollbar");
13
+ return openBlock(), createBlock(_component_el_scrollbar, {
14
+ height: "100%",
15
+ class: "p-5"
16
+ }, {
17
+ default: withCtx(() => [
18
+ createVNode(_component_el_skeleton, {
19
+ loading: fileLoading.value,
20
+ animated: "",
21
+ throttle: 500,
22
+ count: 1
23
+ }, {
24
+ template: withCtx(() => [
25
+ createElementVNode("div", _hoisted_1, [
26
+ createVNode(_component_el_skeleton_item, {
27
+ variant: "p",
28
+ style: { "width": "50%" }
29
+ })
30
+ ]),
31
+ (openBlock(), createElementBlock(Fragment, null, renderList(3, (index) => {
32
+ return createElementVNode("div", { key: index }, [
33
+ createElementVNode("div", _hoisted_2, [
34
+ createVNode(_component_el_skeleton_item, {
35
+ variant: "p",
36
+ style: { "margin-right": "16px" }
37
+ }),
38
+ createVNode(_component_el_skeleton_item, {
39
+ variant: "p",
40
+ style: { "width": "30%" }
41
+ })
42
+ ]),
43
+ (openBlock(), createElementBlock(Fragment, null, renderList(5, (index2) => {
44
+ return createVNode(_component_el_skeleton_item, {
45
+ key: index2,
46
+ variant: "p"
47
+ });
48
+ }), 64)),
49
+ createElementVNode("div", null, [
50
+ createVNode(_component_el_skeleton_item, {
51
+ variant: "p",
52
+ style: { "width": "50%" }
53
+ }),
54
+ createElementVNode("div", _hoisted_3, [
55
+ createVNode(_component_el_skeleton_item, {
56
+ variant: "p",
57
+ style: { "margin-right": "16px" }
58
+ }),
59
+ createVNode(_component_el_skeleton_item, {
60
+ variant: "p",
61
+ style: { "width": "30%" }
62
+ })
63
+ ]),
64
+ createVNode(_component_el_skeleton_item, {
65
+ variant: "p",
66
+ style: { "width": "50%" }
67
+ }),
68
+ createVNode(_component_el_skeleton_item, {
69
+ variant: "p",
70
+ style: { "width": "30%" }
71
+ })
72
+ ])
73
+ ]);
74
+ }), 64)),
75
+ (openBlock(), createElementBlock(Fragment, null, renderList(3, (index) => {
76
+ return createVNode(_component_el_skeleton_item, {
77
+ key: index,
78
+ variant: "p"
79
+ });
80
+ }), 64)),
81
+ createVNode(_component_el_skeleton_item, {
82
+ variant: "p",
83
+ style: { "width": "80%" }
84
+ })
85
+ ]),
86
+ _: 1
87
+ }, 8, ["loading"])
88
+ ]),
89
+ _: 1
90
+ });
91
+ };
92
+ }
93
+ });
94
+ export {
95
+ _sfc_main as default
96
+ };
@@ -0,0 +1,4 @@
1
+ import _sfc_main from "./FileSkeletion.vue.mjs";
2
+ export {
3
+ _sfc_main as default
4
+ };
@@ -0,0 +1,7 @@
1
+ import _sfc_main from "./InitWrap.vue2.mjs";
2
+ import "./InitWrap.vue3.mjs";
3
+ import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
4
+ const InitWrap = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-cdbe48dd"]]);
5
+ export {
6
+ InitWrap as default
7
+ };
@@ -0,0 +1,41 @@
1
+ import { defineComponent, resolveComponent, openBlock, createElementBlock, createElementVNode, createVNode, unref, pushScopeId, popScopeId } from "vue";
2
+ import _imports_0 from "../../assets/empty.png.mjs";
3
+ import data from "../../node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/folder-opened.mjs";
4
+ const _withScopeId = (n) => (pushScopeId("data-v-cdbe48dd"), n = n(), popScopeId(), n);
5
+ const _hoisted_1 = { class: "flex flex-col justify-center flex-wrap items-center" };
6
+ const _hoisted_2 = { class: "flex justify-center items-center folder" };
7
+ const _hoisted_3 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("h2", null, "文件预览", -1));
8
+ const _hoisted_4 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", { class: "w-3/5 text-gray-500 my-3 text-center" }, [
9
+ /* @__PURE__ */ createElementVNode("span", null, " 您可以在这里预览并阅读AI报告文件,快开启您的对话吧!")
10
+ ], -1));
11
+ const _hoisted_5 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("img", {
12
+ class: "my-5",
13
+ src: _imports_0,
14
+ alt: ""
15
+ }, null, -1));
16
+ const _hoisted_6 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", { class: "text-gray-500" }, [
17
+ /* @__PURE__ */ createElementVNode("span", null, " 暂无预览文件 ")
18
+ ], -1));
19
+ const _sfc_main = /* @__PURE__ */ defineComponent({
20
+ __name: "InitWrap",
21
+ setup(__props) {
22
+ return (_ctx, _cache) => {
23
+ const _component_IconifyIconOffline = resolveComponent("IconifyIconOffline");
24
+ return openBlock(), createElementBlock("div", _hoisted_1, [
25
+ createElementVNode("div", _hoisted_2, [
26
+ createVNode(_component_IconifyIconOffline, {
27
+ class: "icon",
28
+ icon: unref(data)
29
+ }, null, 8, ["icon"])
30
+ ]),
31
+ _hoisted_3,
32
+ _hoisted_4,
33
+ _hoisted_5,
34
+ _hoisted_6
35
+ ]);
36
+ };
37
+ }
38
+ });
39
+ export {
40
+ _sfc_main as default
41
+ };
@@ -0,0 +1,4 @@
1
+ const InitWrap_vue_vue_type_style_index_0_scoped_cdbe48dd_lang = "";
2
+ export {
3
+ InitWrap_vue_vue_type_style_index_0_scoped_cdbe48dd_lang as default
4
+ };
@@ -0,0 +1,7 @@
1
+ import _sfc_main from "./index.vue2.mjs";
2
+ import "./index.vue3.mjs";
3
+ import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.mjs";
4
+ const wpsIndex = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-e8c62309"]]);
5
+ export {
6
+ wpsIndex as default
7
+ };
@@ -0,0 +1,74 @@
1
+ import { defineComponent, ref, watch, resolveComponent, openBlock, createElementBlock, withDirectives, createVNode, vShow, unref, createCommentVNode, createElementVNode, normalizeStyle, createTextVNode, toDisplayString } from "vue";
2
+ import { storeToRefs } from "pinia";
3
+ import { getDocxFileByUrl, updateFileToWps } from "../../../api/copilot.mjs";
4
+ import WpsPanel from "./wpsFileViewer/wpsPanel.vue.mjs";
5
+ import { useCopilotStoreHook } from "../../../store/modules/copilot.mjs";
6
+ import _sfc_main$1 from "../FileSkeletion.vue.mjs";
7
+ import data from "../../../node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/file-damage-line.mjs";
8
+ const _hoisted_1 = { class: "preview-box" };
9
+ const _hoisted_2 = {
10
+ key: 0,
11
+ class: "preview"
12
+ };
13
+ const _hoisted_3 = { class: "err_result" };
14
+ const _hoisted_4 = { class: "w-[50%] text-center" };
15
+ const _sfc_main = /* @__PURE__ */ defineComponent({
16
+ __name: "index",
17
+ setup(__props) {
18
+ const CopilotStore = useCopilotStoreHook();
19
+ const { previewFileUrl, fileUrl, fileName, fileId } = storeToRefs(CopilotStore);
20
+ const { setWpsFileId } = CopilotStore;
21
+ const result = ref("");
22
+ const loading = ref(false);
23
+ watch(
24
+ () => previewFileUrl.value,
25
+ (url) => {
26
+ if (!url)
27
+ return;
28
+ loading.value = true;
29
+ result.value = "";
30
+ getDocxFileByUrl(url).then((res) => {
31
+ updateFileToWps({ url: fileUrl.value, name: fileName.value }).then((res2) => {
32
+ loading.value = false;
33
+ setWpsFileId(res2);
34
+ }).catch((res2) => {
35
+ result.value = res2.response.status === 403 ? "文件已过期" : "获取失败";
36
+ loading.value = false;
37
+ });
38
+ }).catch((res) => {
39
+ result.value = res.response.status === 403 ? "文件已过期" : "获取失败";
40
+ loading.value = false;
41
+ });
42
+ },
43
+ { immediate: true }
44
+ );
45
+ return (_ctx, _cache) => {
46
+ const _component_IconifyIconOffline = resolveComponent("IconifyIconOffline");
47
+ return openBlock(), createElementBlock("div", _hoisted_1, [
48
+ withDirectives(createVNode(_sfc_main$1, null, null, 512), [
49
+ [vShow, loading.value]
50
+ ]),
51
+ !result.value && !loading.value && unref(fileId) ? (openBlock(), createElementBlock("div", _hoisted_2, [
52
+ createVNode(WpsPanel, { fileId: unref(fileId) }, null, 8, ["fileId"])
53
+ ])) : createCommentVNode("", true),
54
+ withDirectives(createElementVNode("div", _hoisted_3, [
55
+ createElementVNode("div", _hoisted_4, [
56
+ createVNode(_component_IconifyIconOffline, {
57
+ icon: unref(data),
58
+ width: "100%",
59
+ style: normalizeStyle({
60
+ color: "rgb(175 176 179)"
61
+ })
62
+ }, null, 8, ["icon", "style"]),
63
+ createTextVNode(" " + toDisplayString(result.value), 1)
64
+ ])
65
+ ], 512), [
66
+ [vShow, result.value]
67
+ ])
68
+ ]);
69
+ };
70
+ }
71
+ });
72
+ export {
73
+ _sfc_main as default
74
+ };
@@ -0,0 +1,4 @@
1
+ const index_vue_vue_type_style_index_0_scoped_e8c62309_lang = "";
2
+ export {
3
+ index_vue_vue_type_style_index_0_scoped_e8c62309_lang as default
4
+ };
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./AiBar.vue2.mjs";
2
2
  import "./AiBar.vue3.mjs";
3
3
  import _export_sfc from "../../../../../_virtual/_plugin-vue_export-helper.mjs";
4
- const AiBar = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-9bbdb993"]]);
4
+ const AiBar = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-424389bd"]]);
5
5
  export {
6
6
  AiBar as default
7
7
  };
@@ -2,7 +2,7 @@ import { defineComponent, ref, computed, onMounted, openBlock, createElementBloc
2
2
  import { onClickOutside } from "../../../../../node_modules/.pnpm/@vueuse_core@9.13.0_vue@3.2.45/node_modules/@vueuse/core/index.mjs";
3
3
  import { aiBarBtnType } from "../../../../../store/modules/copilot.mjs";
4
4
  import { message } from "../../../../../utils/message.mjs";
5
- const _withScopeId = (n) => (pushScopeId("data-v-9bbdb993"), n = n(), popScopeId(), n);
5
+ const _withScopeId = (n) => (pushScopeId("data-v-424389bd"), n = n(), popScopeId(), n);
6
6
  const _hoisted_1 = { class: "ai-bar__buttons flex items-center" };
7
7
  const _hoisted_2 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", { class: "logo mr-2" }, "➤", -1));
8
8
  const _hoisted_3 = { class: "flex gap-2" };
@@ -62,6 +62,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
62
62
  });
63
63
  function toggleInput() {
64
64
  showInput.value = !showInput.value;
65
+ showDropdown.value = false;
65
66
  }
66
67
  const handleCustom = () => {
67
68
  const order = document.querySelector(".editable").innerText;
@@ -1,4 +1,4 @@
1
- const AiBar_vue_vue_type_style_index_0_scoped_9bbdb993_lang = "";
1
+ const AiBar_vue_vue_type_style_index_0_scoped_424389bd_lang = "";
2
2
  export {
3
- AiBar_vue_vue_type_style_index_0_scoped_9bbdb993_lang as default
3
+ AiBar_vue_vue_type_style_index_0_scoped_424389bd_lang as default
4
4
  };
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./AiInput.vue2.mjs";
2
2
  import "./AiInput.vue3.mjs";
3
3
  import _export_sfc from "../../../../../_virtual/_plugin-vue_export-helper.mjs";
4
- const AiInput = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-b8e198cc"]]);
4
+ const AiInput = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-f99c5eee"]]);
5
5
  export {
6
6
  AiInput as default
7
7
  };
@@ -1,16 +1,51 @@
1
- import { defineComponent, ref, computed, onMounted, resolveComponent, openBlock, createElementBlock, normalizeStyle, unref, createElementVNode, toDisplayString, createVNode, createTextVNode, withDirectives, vShow, nextTick, pushScopeId, popScopeId } from "vue";
1
+ import { defineComponent, ref, computed, onMounted, resolveComponent, openBlock, createElementBlock, normalizeStyle, unref, createElementVNode, toDisplayString, createCommentVNode, createVNode, createTextVNode, withDirectives, vShow, nextTick, pushScopeId, popScopeId } from "vue";
2
2
  import { storeToRefs } from "pinia";
3
3
  import { onClickOutside } from "../../../../../node_modules/.pnpm/@vueuse_core@9.13.0_vue@3.2.45/node_modules/@vueuse/core/index.mjs";
4
4
  import { useCopilotStoreHook, aiBarBtnType, wpsAiOpt } from "../../../../../store/modules/copilot.mjs";
5
5
  import data from "../../../../../node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/refresh.mjs";
6
- const _withScopeId = (n) => (pushScopeId("data-v-b8e198cc"), n = n(), popScopeId(), n);
6
+ const _withScopeId = (n) => (pushScopeId("data-v-f99c5eee"), n = n(), popScopeId(), n);
7
7
  const _hoisted_1 = { class: "textarea overflow-y-auto text-gray-800 text-base border-2 border-blue-500 rounded-xl p-3 mb-2 font-serif select-text" };
8
8
  const _hoisted_2 = { class: "flex justify-between items-center mt-4" };
9
- const _hoisted_3 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", { class: "text-sm text-gray-500 mr-2" }, [
10
- /* @__PURE__ */ createElementVNode("span", null, "上述文本是由 AI 自动生成")
9
+ const _hoisted_3 = { class: "flex items-center text-sm text-gray-500 mr-2" };
10
+ const _hoisted_4 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("span", null, "上述文本是由 AI 自动生成", -1));
11
+ const _hoisted_5 = {
12
+ key: 0,
13
+ class: "flex items-center justify-center ml-2"
14
+ };
15
+ const _hoisted_6 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", { class: "w-5 h-5" }, [
16
+ /* @__PURE__ */ createElementVNode("svg", {
17
+ width: "20",
18
+ height: "20",
19
+ viewBox: "0 0 50 50",
20
+ xmlns: "http://www.w3.org/2000/svg"
21
+ }, [
22
+ /* @__PURE__ */ createElementVNode("circle", {
23
+ cx: "25",
24
+ cy: "25",
25
+ r: "20",
26
+ fill: "none",
27
+ stroke: "#4f46e5",
28
+ "stroke-width": "5",
29
+ "stroke-linecap": "round",
30
+ "stroke-dasharray": "90",
31
+ "stroke-dashoffset": "0"
32
+ }, [
33
+ /* @__PURE__ */ createElementVNode("animateTransform", {
34
+ attributeName: "transform",
35
+ type: "rotate",
36
+ from: "0 25 25",
37
+ to: "360 25 25",
38
+ dur: "1s",
39
+ repeatCount: "indefinite"
40
+ })
41
+ ])
42
+ ])
11
43
  ], -1));
12
- const _hoisted_4 = { class: "flex items-center gap-1" };
13
- const _hoisted_5 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("span", { class: "mr-0.5" }, [
44
+ const _hoisted_7 = [
45
+ _hoisted_6
46
+ ];
47
+ const _hoisted_8 = { class: "flex items-center gap-1" };
48
+ const _hoisted_9 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("span", { class: "mr-0.5" }, [
14
49
  /* @__PURE__ */ createElementVNode("svg", {
15
50
  xmlns: "http://www.w3.org/2000/svg",
16
51
  width: "16",
@@ -23,7 +58,7 @@ const _hoisted_5 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElem
23
58
  })
24
59
  ])
25
60
  ], -1));
26
- const _hoisted_6 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", { class: "h-4 w-px bg-gray-300 ml-1 mr-2" }, null, -1));
61
+ const _hoisted_10 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", { class: "h-4 w-px bg-gray-300 ml-1 mr-2" }, null, -1));
27
62
  const _sfc_main = /* @__PURE__ */ defineComponent({
28
63
  __name: "AiInput",
29
64
  props: {
@@ -48,8 +83,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
48
83
  width: `${props.position.w}px`,
49
84
  height: `${props.position.h}px`
50
85
  }));
86
+ const isLoading = ref(true);
51
87
  onMounted(async () => {
52
88
  const mockResponse = await getAiRes();
89
+ isLoading.value = false;
53
90
  typewriterEffect(mockResponse);
54
91
  });
55
92
  const getAiRes = async () => {
@@ -77,9 +114,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
77
114
  if (action === wpsAiOpt.rewrite) {
78
115
  clearInterval(timer);
79
116
  displayedContent.value = "";
117
+ isLoading.value = true;
80
118
  nextTick(async () => {
81
119
  const mockResponse = await getAiRes();
82
120
  typewriterEffect(mockResponse);
121
+ isLoading.value = false;
83
122
  });
84
123
  } else if (action === wpsAiOpt.cancelOpt) {
85
124
  emit("close");
@@ -104,8 +143,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
104
143
  }, [
105
144
  createElementVNode("div", _hoisted_1, toDisplayString(displayedContent.value), 1),
106
145
  createElementVNode("div", _hoisted_2, [
107
- _hoisted_3,
108
- createElementVNode("div", _hoisted_4, [
146
+ createElementVNode("div", _hoisted_3, [
147
+ _hoisted_4,
148
+ isLoading.value ? (openBlock(), createElementBlock("div", _hoisted_5, _hoisted_7)) : createCommentVNode("", true)
149
+ ]),
150
+ createElementVNode("div", _hoisted_8, [
109
151
  createElementVNode("button", {
110
152
  class: "flex items-center text-gray-600 hover:text-black border-none",
111
153
  onClick: _cache[0] || (_cache[0] = ($event) => handleAction(unref(wpsAiOpt).rewrite))
@@ -120,10 +162,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
120
162
  class: "flex items-center text-gray-600 hover:text-black border-none",
121
163
  onClick: _cache[1] || (_cache[1] = ($event) => handleAction(unref(wpsAiOpt).cancelOpt))
122
164
  }, [
123
- _hoisted_5,
165
+ _hoisted_9,
124
166
  createTextVNode(" 弃用 ")
125
167
  ]),
126
- _hoisted_6,
168
+ _hoisted_10,
127
169
  withDirectives(createElementVNode("button", {
128
170
  class: "border !bg-[#8854f4] text-white border-[#ddd] !px-4 py-1 rounded-full",
129
171
  onClick: _cache[2] || (_cache[2] = ($event) => handleAction(unref(wpsAiOpt).insert))
@@ -1,4 +1,4 @@
1
- const AiInput_vue_vue_type_style_index_0_scoped_b8e198cc_lang = "";
1
+ const AiInput_vue_vue_type_style_index_0_scoped_f99c5eee_lang = "";
2
2
  export {
3
- AiInput_vue_vue_type_style_index_0_scoped_b8e198cc_lang as default
3
+ AiInput_vue_vue_type_style_index_0_scoped_f99c5eee_lang as default
4
4
  };
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./wpsPanel.vue2.mjs";
2
2
  import "./wpsPanel.vue3.mjs";
3
3
  import _export_sfc from "../../../../_virtual/_plugin-vue_export-helper.mjs";
4
- const wpsPanel = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-6269dc50"]]);
4
+ const WpsPanel = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-3a524e66"]]);
5
5
  export {
6
- wpsPanel as default
6
+ WpsPanel as default
7
7
  };
@@ -4,20 +4,23 @@ import k from "./lib/web-office-sdk-solution-v2.0.7.es.mjs";
4
4
  import _sfc_main$1 from "./wpsAi/index.vue.mjs";
5
5
  import { useCopilotStoreHook, wpsAiOpt } from "../../../../store/modules/copilot.mjs";
6
6
  import { useThrottleFn } from "../../../../node_modules/.pnpm/@vueuse_shared@9.13.0_vue@3.2.45/node_modules/@vueuse/shared/index.mjs";
7
- const _withScopeId = (n) => (pushScopeId("data-v-6269dc50"), n = n(), popScopeId(), n);
7
+ const _withScopeId = (n) => (pushScopeId("data-v-3a524e66"), n = n(), popScopeId(), n);
8
8
  const _hoisted_1 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", {
9
9
  id: "office-container",
10
10
  class: ""
11
11
  }, null, -1));
12
12
  const _sfc_main = /* @__PURE__ */ defineComponent({
13
13
  __name: "wpsPanel",
14
+ props: {
15
+ fileId: null
16
+ },
14
17
  setup(__props) {
18
+ const props = __props;
15
19
  const copilotStore = useCopilotStoreHook();
16
20
  const { intelligentAnalysisConfig } = storeToRefs(copilotStore);
17
21
  let app;
18
22
  let jssdk;
19
- const appId = ref("SX20250506WZKTKR");
20
- const fileId = ref(123);
23
+ const appId = ref("SX20250610PSFZVK");
21
24
  const title = ref("");
22
25
  const selContextIndex = ref([0, 0]);
23
26
  const selContext = ref("");
@@ -27,7 +30,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
27
30
  jssdk = k.init({
28
31
  officeType: k.OfficeType.Writer,
29
32
  appId: appId.value,
30
- fileId: fileId.value,
33
+ fileId: props.fileId,
31
34
  token: intelligentAnalysisConfig.value.token,
32
35
  isListenResize: true,
33
36
  mount: document.getElementById("office-container"),
@@ -1,4 +1,4 @@
1
- const wpsPanel_vue_vue_type_style_index_0_scoped_6269dc50_lang = "";
1
+ const wpsPanel_vue_vue_type_style_index_0_scoped_3a524e66_lang = "";
2
2
  export {
3
- wpsPanel_vue_vue_type_style_index_0_scoped_6269dc50_lang as default
3
+ wpsPanel_vue_vue_type_style_index_0_scoped_3a524e66_lang as default
4
4
  };
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./index.vue2.mjs";
2
2
  import "./index.vue3.mjs";
3
3
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const CopiCanvas = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-2c5945fc"]]);
4
+ const CopiCanvas = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-b5e8d3a2"]]);
5
5
  export {
6
6
  CopiCanvas as default
7
7
  };
@@ -1,8 +1,9 @@
1
- import { defineComponent, resolveComponent, openBlock, createElementBlock, normalizeClass, unref, createElementVNode, createVNode, toDisplayString, createCommentVNode } from "vue";
1
+ import { defineComponent, resolveComponent, openBlock, createElementBlock, normalizeClass, unref, createElementVNode, createVNode, toDisplayString, createBlock, createCommentVNode } from "vue";
2
2
  import { storeToRefs } from "pinia";
3
3
  import data from "../../node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/reading.mjs";
4
4
  import { useCopilotStoreHook } from "../../store/modules/copilot.mjs";
5
- import wpsPanel from "./docViewer/wpsFileViewer/wpsPanel.vue.mjs";
5
+ import wpsIndex from "./docViewer/index.vue.mjs";
6
+ import InitWrap from "./InitWrap.vue.mjs";
6
7
  const _hoisted_1 = { class: "canvas-icon" };
7
8
  const _hoisted_2 = { class: "canvas-content" };
8
9
  const _hoisted_3 = {
@@ -38,7 +39,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
38
39
  createElementVNode("h3", null, toDisplayString(__props.title), 1)
39
40
  ]),
40
41
  createElementVNode("div", _hoisted_5, [
41
- createVNode(wpsPanel)
42
+ unref(previewFileUrl) ? (openBlock(), createBlock(wpsIndex, { key: 0 })) : (openBlock(), createBlock(InitWrap, { key: 1 }))
42
43
  ])
43
44
  ])) : createCommentVNode("", true)
44
45
  ])
@@ -1,4 +1,4 @@
1
- const index_vue_vue_type_style_index_0_scoped_2c5945fc_lang = "";
1
+ const index_vue_vue_type_style_index_0_scoped_b5e8d3a2_lang = "";
2
2
  export {
3
- index_vue_vue_type_style_index_0_scoped_2c5945fc_lang as default
3
+ index_vue_vue_type_style_index_0_scoped_b5e8d3a2_lang as default
4
4
  };
@@ -3,6 +3,7 @@ import _sfc_main$1 from "./fileIcon.vue.mjs";
3
3
  import { convertBytes, urlDownload } from "../../../utils/home.mjs";
4
4
  import { useCopilotStoreHook } from "../../../store/modules/copilot.mjs";
5
5
  import { storeToRefs } from "pinia";
6
+ import { downloadByWps } from "../../../api/copilot.mjs";
6
7
  import "./fileBox.vue2.mjs";
7
8
  import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.mjs";
8
9
  const _hoisted_1 = { class: "file-box" };
@@ -33,8 +34,8 @@ const _sfc_main = {
33
34
  setup(__props, { emit: emits }) {
34
35
  const props = __props;
35
36
  const CopilotStore = useCopilotStoreHook();
36
- const { sendLonding, fullscreen } = storeToRefs(CopilotStore);
37
- const { getPreviewFileUrl, openCanvasVisible } = CopilotStore;
37
+ const { sendLonding, fullscreen, fileId } = storeToRefs(CopilotStore);
38
+ const { getPreviewFileUrl, getPreviewFileUrl2, openCanvasVisible } = CopilotStore;
38
39
  const fileType = ref("");
39
40
  const size = ref("");
40
41
  watch(
@@ -62,11 +63,16 @@ const _sfc_main = {
62
63
  },
63
64
  { immediate: true }
64
65
  );
65
- const downLoadFilde = () => {
66
- urlDownload(props.desc.fileUrl, props.desc.name);
66
+ const downLoadFilde = async () => {
67
+ if (fileId.value) {
68
+ const res = await downloadByWps(fileId.value);
69
+ urlDownload(res == null ? void 0 : res.url, res == null ? void 0 : res.name);
70
+ } else {
71
+ urlDownload(props.desc.fileUrl, props.desc.name);
72
+ }
67
73
  };
68
74
  const preview = () => {
69
- getPreviewFileUrl(props.desc.fileUrl);
75
+ getPreviewFileUrl2(props.desc.fileUrl, props.desc.name);
70
76
  openCanvasVisible();
71
77
  };
72
78
  onMounted(() => {
@@ -104,7 +110,7 @@ const _sfc_main = {
104
110
  };
105
111
  }
106
112
  };
107
- const FileBox = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-af617a5e"]]);
113
+ const FileBox = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-275f768a"]]);
108
114
  export {
109
115
  FileBox as default
110
116
  };
@@ -1,4 +1,4 @@
1
- const fileBox_vue_vue_type_style_index_0_scoped_af617a5e_lang = "";
1
+ const fileBox_vue_vue_type_style_index_0_scoped_275f768a_lang = "";
2
2
  export {
3
- fileBox_vue_vue_type_style_index_0_scoped_af617a5e_lang as default
3
+ fileBox_vue_vue_type_style_index_0_scoped_275f768a_lang as default
4
4
  };
@@ -78,13 +78,37 @@ const updataHistoryRecord = (data) => {
78
78
  timeout: 6e4
79
79
  });
80
80
  };
81
+ const getDocxFileByUrl = (url) => {
82
+ return http.request("get", url, {
83
+ responseType: "blob",
84
+ timeout: 60 * 1e3 * 10,
85
+ needHeader: true
86
+ });
87
+ };
88
+ const updateFileToWps = (data) => {
89
+ return http.request("post", "/api/uploadFile/save", {
90
+ data,
91
+ timeout: 6e4
92
+ });
93
+ };
94
+ const downloadByWps = (fileId) => {
95
+ return http.request("post", "/api/uploadFile/getUploadFileById", {
96
+ params: {
97
+ fileId
98
+ },
99
+ timeout: 6e4
100
+ });
101
+ };
81
102
  export {
82
103
  createHistoryInfo,
83
104
  createHistoryRecord,
84
105
  deleteHistoryRecord,
106
+ downloadByWps,
107
+ getDocxFileByUrl,
85
108
  getHistoryInfo,
86
109
  getHistoryRecordList,
87
110
  getReport,
88
111
  updataHistoryInfo,
89
- updataHistoryRecord
112
+ updataHistoryRecord,
113
+ updateFileToWps
90
114
  };