@kg-ui/kg-ui-plus 0.1.49 → 0.1.51
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/dist/es/KgCopilot/CopiCanvas/FilePreview.vue.mjs +7 -0
- package/dist/es/KgCopilot/CopiCanvas/FilePreview.vue2.mjs +295 -0
- package/dist/es/KgCopilot/CopiCanvas/FilePreview.vue3.mjs +4 -0
- package/dist/es/KgCopilot/CopiCanvas/FileSkeletion.vue.mjs +96 -0
- package/dist/es/KgCopilot/CopiCanvas/FileSkeletion.vue2.mjs +4 -0
- package/dist/es/KgCopilot/CopiCanvas/InitWrap.vue.mjs +7 -0
- package/dist/es/KgCopilot/CopiCanvas/InitWrap.vue2.mjs +41 -0
- package/dist/es/KgCopilot/CopiCanvas/InitWrap.vue3.mjs +4 -0
- package/dist/es/KgCopilot/CopiCanvas/index.vue.mjs +1 -1
- package/dist/es/KgCopilot/CopiCanvas/index.vue2.mjs +4 -3
- package/dist/es/KgCopilot/CopiCanvas/index.vue3.mjs +2 -2
- package/dist/es/_virtual/_commonjs-dynamic-modules.mjs +6 -0
- package/dist/es/_virtual/jszip.min.mjs +13 -0
- package/dist/es/api/copilot.mjs +8 -0
- package/dist/es/assets/empty.png.mjs +4 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/folder-opened.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/file-damage-line.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@vueuse_core@9.13.0_vue@3.2.45/node_modules/@vueuse/core/index.mjs +3 -1
- package/dist/es/node_modules/.pnpm/@vueuse_shared@9.13.0_vue@3.2.45/node_modules/@vueuse/shared/index.mjs +52 -1
- package/dist/es/node_modules/.pnpm/docx-preview@0.3.3/node_modules/docx-preview/dist/docx-preview.mjs +3877 -0
- package/dist/es/node_modules/.pnpm/jszip@3.10.1/node_modules/jszip/dist/jszip.min.mjs +2649 -0
- package/dist/es/style.css +1 -1
- package/package.json +116 -124
- package/dist/es/KgCopilot/CopiCanvas/testWPS.vue.mjs +0 -7
- package/dist/es/KgCopilot/CopiCanvas/testWPS.vue2.mjs +0 -50
- package/dist/es/KgCopilot/CopiCanvas/testWPS.vue3.mjs +0 -4
- package/dist/es/KgCopilot/CopiCanvas/web-office-sdk-solution-v2.0.7.es.mjs +0 -854
@@ -0,0 +1,7 @@
|
|
1
|
+
import _sfc_main from "./FilePreview.vue2.mjs";
|
2
|
+
import "./FilePreview.vue3.mjs";
|
3
|
+
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
|
4
|
+
const FilePreview = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-e4b6ab79"]]);
|
5
|
+
export {
|
6
|
+
FilePreview as default
|
7
|
+
};
|
@@ -0,0 +1,295 @@
|
|
1
|
+
import { defineComponent, ref, watch, onMounted, onBeforeUnmount, resolveComponent, openBlock, createElementBlock, withDirectives, createVNode, vShow, createElementVNode, normalizeStyle, unref, createCommentVNode, withKeys, vModelText, createTextVNode, toDisplayString, pushScopeId, popScopeId } from "vue";
|
2
|
+
import { ClickOutside } from "element-plus";
|
3
|
+
import { renderAsync } from "../../node_modules/.pnpm/docx-preview@0.3.3/node_modules/docx-preview/dist/docx-preview.mjs";
|
4
|
+
import { getDocxFileByUrl } from "../../api/copilot.mjs";
|
5
|
+
import { storeToRefs } from "pinia";
|
6
|
+
import { useCopilotStoreHook } from "../../store/modules/copilot.mjs";
|
7
|
+
import _sfc_main$1 from "./FileSkeletion.vue.mjs";
|
8
|
+
import data from "../../node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/edit.mjs";
|
9
|
+
import data$1 from "../../node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/promotion.mjs";
|
10
|
+
import data$2 from "../../node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/file-damage-line.mjs";
|
11
|
+
import { useThrottleFn } from "../../node_modules/.pnpm/@vueuse_shared@9.13.0_vue@3.2.45/node_modules/@vueuse/shared/index.mjs";
|
12
|
+
const _withScopeId = (n) => (pushScopeId("data-v-e4b6ab79"), n = n(), popScopeId(), n);
|
13
|
+
const _hoisted_1 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("span", null, " 询问AI助手", -1));
|
14
|
+
const _hoisted_2 = ["onKeydown"];
|
15
|
+
const _hoisted_3 = { class: "err_result" };
|
16
|
+
const _hoisted_4 = { class: "w-[50%] text-center" };
|
17
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
18
|
+
__name: "FilePreview",
|
19
|
+
setup(__props) {
|
20
|
+
const CopilotStore = useCopilotStoreHook();
|
21
|
+
const { previewFileUrl, reviseReport } = storeToRefs(CopilotStore);
|
22
|
+
const { sendMsg } = CopilotStore;
|
23
|
+
const docPreviewRef = ref();
|
24
|
+
const docPreviewBoxRef = ref();
|
25
|
+
const result = ref("");
|
26
|
+
const zoom = ref(1);
|
27
|
+
const getZoom = useThrottleFn(() => {
|
28
|
+
const num = docPreviewBoxRef.value.clientWidth / 850;
|
29
|
+
zoom.value = num;
|
30
|
+
}, 100);
|
31
|
+
const loading = ref(false);
|
32
|
+
watch(
|
33
|
+
() => previewFileUrl.value,
|
34
|
+
(url) => {
|
35
|
+
if (!url)
|
36
|
+
return;
|
37
|
+
loading.value = true;
|
38
|
+
result.value = "";
|
39
|
+
getDocxFileByUrl(url).then((res) => {
|
40
|
+
const blob = res.data;
|
41
|
+
renderAsync(blob, docPreviewRef.value).then(() => {
|
42
|
+
getZoom();
|
43
|
+
loading.value = false;
|
44
|
+
}).catch(() => {
|
45
|
+
result.value = "解析失败";
|
46
|
+
loading.value = false;
|
47
|
+
});
|
48
|
+
}).catch((res) => {
|
49
|
+
result.value = res.response.status === 403 ? "文件已过期" : "获取失败";
|
50
|
+
loading.value = false;
|
51
|
+
});
|
52
|
+
},
|
53
|
+
{ immediate: true }
|
54
|
+
);
|
55
|
+
const resizeObserver = new ResizeObserver(() => {
|
56
|
+
getZoom();
|
57
|
+
});
|
58
|
+
onMounted(() => {
|
59
|
+
resizeObserver.observe(docPreviewBoxRef.value);
|
60
|
+
getZoom();
|
61
|
+
});
|
62
|
+
onBeforeUnmount(() => {
|
63
|
+
resizeObserver.disconnect();
|
64
|
+
});
|
65
|
+
const selectWordVisible = ref(false);
|
66
|
+
const selectionPos = ref({ top: "", left: "" });
|
67
|
+
const selectTxt = ref("");
|
68
|
+
const range = ref();
|
69
|
+
const selection = ref();
|
70
|
+
const handleSelectText = (e) => {
|
71
|
+
if (!reviseReport.value)
|
72
|
+
return;
|
73
|
+
selection.value = window.getSelection();
|
74
|
+
if (!selection.value)
|
75
|
+
return;
|
76
|
+
range.value = selection.value.getRangeAt(0);
|
77
|
+
const text = selection.value.toString();
|
78
|
+
if (!text.length)
|
79
|
+
return false;
|
80
|
+
setTimeout(() => {
|
81
|
+
selectTxt.value = "“" + text + "”";
|
82
|
+
showSelectMenu(e);
|
83
|
+
}, 100);
|
84
|
+
};
|
85
|
+
const menuInputRef = ref();
|
86
|
+
const showSelectMenu = (event) => {
|
87
|
+
if (!selection.value)
|
88
|
+
return;
|
89
|
+
const menuWidth = 350;
|
90
|
+
const menuHeight = 45;
|
91
|
+
let top = event.clientY;
|
92
|
+
let left = event.clientX;
|
93
|
+
const viewportWidth = window.innerWidth;
|
94
|
+
const viewportHeight = window.innerHeight;
|
95
|
+
if (left + menuWidth > viewportWidth) {
|
96
|
+
left = viewportWidth - menuWidth;
|
97
|
+
}
|
98
|
+
if (top + menuHeight > viewportHeight) {
|
99
|
+
top = viewportHeight - menuHeight;
|
100
|
+
}
|
101
|
+
selectionPos.value.top = top + 5 + "px";
|
102
|
+
selectionPos.value.left = left + 5 + "px";
|
103
|
+
selectWordVisible.value = true;
|
104
|
+
};
|
105
|
+
const highlightSelectedText = () => {
|
106
|
+
if (!selection.value.rangeCount)
|
107
|
+
return;
|
108
|
+
range.value.value = selection.value.getRangeAt(0);
|
109
|
+
const highlightSpan = document.createElement("span");
|
110
|
+
highlightSpan.className = "highlight";
|
111
|
+
const cloneStyle = ["fontSize", "fontFamily", "minHeight", "color"];
|
112
|
+
const startContainer = range.value.startContainer;
|
113
|
+
const endContainer = range.value.endContainer;
|
114
|
+
const startOffset = range.value.startOffset;
|
115
|
+
const endOffset = range.value.endOffset;
|
116
|
+
if (startContainer === endContainer) {
|
117
|
+
const selectedText = range.value.extractContents();
|
118
|
+
cloneStyle.forEach((key) => {
|
119
|
+
highlightSpan.style[key] = (startContainer.style || startContainer.parentNode.style)[key];
|
120
|
+
});
|
121
|
+
highlightSpan.appendChild(selectedText);
|
122
|
+
range.value.insertNode(highlightSpan);
|
123
|
+
} else {
|
124
|
+
const commonAncestor = range.value.commonAncestorContainer;
|
125
|
+
const walker = document.createTreeWalker(
|
126
|
+
commonAncestor,
|
127
|
+
NodeFilter.SHOW_TEXT,
|
128
|
+
{
|
129
|
+
acceptNode: (node) => range.value.intersectsNode(node) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_REJECT
|
130
|
+
}
|
131
|
+
);
|
132
|
+
const nodesToHighlight = [];
|
133
|
+
while (walker.nextNode()) {
|
134
|
+
nodesToHighlight.push(walker.currentNode);
|
135
|
+
}
|
136
|
+
nodesToHighlight.forEach((node, index) => {
|
137
|
+
const parent = node.parentNode;
|
138
|
+
if (parent) {
|
139
|
+
const span = document.createElement("span");
|
140
|
+
span.className = "highlight";
|
141
|
+
for (const key of cloneStyle) {
|
142
|
+
span.style[key] = parent.style[key];
|
143
|
+
}
|
144
|
+
if (index === 0) {
|
145
|
+
const text = node.textContent.slice(startOffset);
|
146
|
+
span.textContent = text;
|
147
|
+
const remainingText = document.createTextNode(
|
148
|
+
node.textContent.slice(0, startOffset)
|
149
|
+
);
|
150
|
+
parent.insertBefore(remainingText, node);
|
151
|
+
} else if (index === nodesToHighlight.length - 1) {
|
152
|
+
const text = node.textContent.slice(0, endOffset);
|
153
|
+
span.textContent = text;
|
154
|
+
const remainingText = document.createTextNode(
|
155
|
+
node.textContent.slice(endOffset)
|
156
|
+
);
|
157
|
+
parent.appendChild(remainingText);
|
158
|
+
} else {
|
159
|
+
span.textContent = node.textContent;
|
160
|
+
}
|
161
|
+
parent.replaceChild(span, node);
|
162
|
+
}
|
163
|
+
});
|
164
|
+
}
|
165
|
+
};
|
166
|
+
const removeHighlight = () => {
|
167
|
+
const highlightedElements = document.querySelectorAll(".highlight");
|
168
|
+
highlightedElements.forEach((element) => {
|
169
|
+
const parent = element.parentNode;
|
170
|
+
if (parent) {
|
171
|
+
const fragment = document.createDocumentFragment();
|
172
|
+
while (element.firstChild) {
|
173
|
+
fragment.appendChild(element.firstChild);
|
174
|
+
}
|
175
|
+
parent.replaceChild(fragment, element);
|
176
|
+
parent.normalize();
|
177
|
+
}
|
178
|
+
});
|
179
|
+
};
|
180
|
+
const inputRef = ref();
|
181
|
+
const showSuggestInput = ref(false);
|
182
|
+
const handleClickSuggestBtn = () => {
|
183
|
+
showSuggestInput.value = true;
|
184
|
+
highlightSelectedText();
|
185
|
+
setTimeout(() => {
|
186
|
+
if (inputRef.value) {
|
187
|
+
inputRef.value.focus();
|
188
|
+
}
|
189
|
+
}, 100);
|
190
|
+
};
|
191
|
+
const suggestInputValue = ref("");
|
192
|
+
const sendSuggest = () => {
|
193
|
+
if (!suggestInputValue.value.length)
|
194
|
+
return;
|
195
|
+
sendMsg(suggestInputValue.value, selectTxt.value);
|
196
|
+
onClickOutside();
|
197
|
+
};
|
198
|
+
const onClickOutside = () => {
|
199
|
+
if (selectWordVisible.value) {
|
200
|
+
selectWordVisible.value = false;
|
201
|
+
showSuggestInput.value = false;
|
202
|
+
suggestInputValue.value = "";
|
203
|
+
selection.value = null;
|
204
|
+
removeHighlight();
|
205
|
+
}
|
206
|
+
};
|
207
|
+
return (_ctx, _cache) => {
|
208
|
+
const _component_IconifyIconOffline = resolveComponent("IconifyIconOffline");
|
209
|
+
return openBlock(), createElementBlock("div", {
|
210
|
+
ref_key: "docPreviewBoxRef",
|
211
|
+
ref: docPreviewBoxRef,
|
212
|
+
class: "preview-box"
|
213
|
+
}, [
|
214
|
+
withDirectives(createVNode(_sfc_main$1, null, null, 512), [
|
215
|
+
[vShow, loading.value]
|
216
|
+
]),
|
217
|
+
withDirectives(createElementVNode("div", {
|
218
|
+
ref_key: "docPreviewRef",
|
219
|
+
ref: docPreviewRef,
|
220
|
+
class: "preview",
|
221
|
+
style: normalizeStyle({ zoom: zoom.value }),
|
222
|
+
onMouseup: handleSelectText
|
223
|
+
}, null, 36), [
|
224
|
+
[vShow, !result.value && !loading.value]
|
225
|
+
]),
|
226
|
+
selectWordVisible.value ? withDirectives((openBlock(), createElementBlock("div", {
|
227
|
+
key: 0,
|
228
|
+
class: "select-word",
|
229
|
+
style: normalizeStyle({ ...selectionPos.value })
|
230
|
+
}, [
|
231
|
+
!showSuggestInput.value ? (openBlock(), createElementBlock("button", {
|
232
|
+
key: 0,
|
233
|
+
onClick: handleClickSuggestBtn,
|
234
|
+
class: "flex items-center edit-button"
|
235
|
+
}, [
|
236
|
+
createVNode(_component_IconifyIconOffline, {
|
237
|
+
class: "mr-1",
|
238
|
+
icon: unref(data)
|
239
|
+
}, null, 8, ["icon"]),
|
240
|
+
_hoisted_1
|
241
|
+
])) : createCommentVNode("", true),
|
242
|
+
showSuggestInput.value ? (openBlock(), createElementBlock("div", {
|
243
|
+
key: 1,
|
244
|
+
ref_key: "menuInputRef",
|
245
|
+
ref: menuInputRef,
|
246
|
+
class: "flex justify-between items-center input-box"
|
247
|
+
}, [
|
248
|
+
withDirectives(createElementVNode("input", {
|
249
|
+
ref_key: "inputRef",
|
250
|
+
ref: inputRef,
|
251
|
+
class: "edit-input",
|
252
|
+
type: "text",
|
253
|
+
placeholder: "编辑和说明...",
|
254
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => suggestInputValue.value = $event),
|
255
|
+
onKeydown: withKeys(sendSuggest, ["enter"])
|
256
|
+
}, null, 40, _hoisted_2), [
|
257
|
+
[vModelText, suggestInputValue.value]
|
258
|
+
]),
|
259
|
+
createElementVNode("button", {
|
260
|
+
class: "send-button",
|
261
|
+
onClick: sendSuggest
|
262
|
+
}, [
|
263
|
+
createVNode(_component_IconifyIconOffline, {
|
264
|
+
class: "icon",
|
265
|
+
icon: unref(data$1),
|
266
|
+
style: normalizeStyle({
|
267
|
+
color: suggestInputValue.value.length ? "#1e56ea" : "#dbdbdb"
|
268
|
+
})
|
269
|
+
}, null, 8, ["icon", "style"])
|
270
|
+
])
|
271
|
+
], 512)) : createCommentVNode("", true)
|
272
|
+
], 4)), [
|
273
|
+
[unref(ClickOutside), onClickOutside]
|
274
|
+
]) : createCommentVNode("", true),
|
275
|
+
withDirectives(createElementVNode("div", _hoisted_3, [
|
276
|
+
createElementVNode("div", _hoisted_4, [
|
277
|
+
createVNode(_component_IconifyIconOffline, {
|
278
|
+
icon: unref(data$2),
|
279
|
+
width: "100%",
|
280
|
+
style: normalizeStyle({
|
281
|
+
color: "rgb(175 176 179)"
|
282
|
+
})
|
283
|
+
}, null, 8, ["icon", "style"]),
|
284
|
+
createTextVNode(" " + toDisplayString(result.value), 1)
|
285
|
+
])
|
286
|
+
], 512), [
|
287
|
+
[vShow, result.value]
|
288
|
+
])
|
289
|
+
], 512);
|
290
|
+
};
|
291
|
+
}
|
292
|
+
});
|
293
|
+
export {
|
294
|
+
_sfc_main as default
|
295
|
+
};
|
@@ -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,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
|
+
};
|
@@ -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-
|
4
|
+
const CopiCanvas = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-05c63178"]]);
|
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
|
5
|
+
import FilePreview from "./FilePreview.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
|
-
|
42
|
+
unref(previewFileUrl) ? (openBlock(), createBlock(FilePreview, { key: 0 })) : (openBlock(), createBlock(InitWrap, { key: 1 }))
|
42
43
|
])
|
43
44
|
])) : createCommentVNode("", true)
|
44
45
|
])
|
@@ -1,4 +1,4 @@
|
|
1
|
-
const
|
1
|
+
const index_vue_vue_type_style_index_0_scoped_05c63178_lang = "";
|
2
2
|
export {
|
3
|
-
|
3
|
+
index_vue_vue_type_style_index_0_scoped_05c63178_lang as default
|
4
4
|
};
|
@@ -0,0 +1,6 @@
|
|
1
|
+
function commonjsRequire(path) {
|
2
|
+
throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
|
3
|
+
}
|
4
|
+
export {
|
5
|
+
commonjsRequire
|
6
|
+
};
|
package/dist/es/api/copilot.mjs
CHANGED
@@ -78,10 +78,18 @@ 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
|
+
};
|
81
88
|
export {
|
82
89
|
createHistoryInfo,
|
83
90
|
createHistoryRecord,
|
84
91
|
deleteHistoryRecord,
|
92
|
+
getDocxFileByUrl,
|
85
93
|
getHistoryInfo,
|
86
94
|
getHistoryRecordList,
|
87
95
|
getReport,
|