@huyooo/ui 2.0.0 → 2.0.1

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 (50) hide show
  1. package/dist/{AuthkitAppSetting-rtYZcSAR.js → AuthkitAppSetting-DCQH9IpU.js} +151 -150
  2. package/dist/{Contact-CcWf3UEZ.js → Contact-C7ROEqe-.js} +3 -3
  3. package/dist/{CustomTable-HDwqEcmB.js → CustomTable-GgvDEidl.js} +1 -1
  4. package/dist/FeedbackModal.vue_vue_type_script_setup_true_lang-C1hPqnNT.js +1531 -0
  5. package/dist/{LegalDocViewer-C0tsIbz9.js → LegalDocViewer-D_QUh0uf.js} +10 -10
  6. package/dist/{MessageHandle-BUufez4S.js → MessageHandle-DKoySsCG.js} +3 -3
  7. package/dist/{MessageList-rttvPmxV.js → MessageList-HSiKkUoD.js} +1 -1
  8. package/dist/{PaySubscriptions-p75aBnHm.js → PaySubscriptions-NcATVJGm.js} +6 -6
  9. package/dist/{PricingPlans-CQ0qk9Hb.js → PricingPlans-CZn6eJby.js} +4 -4
  10. package/dist/{ReferrerReferees-BU9IEQgz.js → ReferrerReferees-BoOQIssE.js} +4 -4
  11. package/dist/Upload.vue_vue_type_script_setup_true_lang-CkS2S9Xc.js +83 -0
  12. package/dist/{UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-DG4AuHiO.js → UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-BrNx6JWe.js} +9 -9
  13. package/dist/{WidthContainer-DSE4QbW0.js → WidthContainer-BJLdZfzF.js} +10 -10
  14. package/dist/{apiClients-Ctcq8NZs.js → apiClients-CR-hEwog.js} +5 -5
  15. package/dist/authkit.js +10 -10
  16. package/dist/common.js +2 -2
  17. package/dist/components/Feedback/FeedbackDetails.vue.d.ts +11 -0
  18. package/dist/components/Upload/Upload.vue.d.ts +3 -2
  19. package/dist/composables/uploadFeedbackAttachment.d.ts +7 -1
  20. package/dist/composables.js +13 -13
  21. package/dist/feedback.js +2 -2
  22. package/dist/{fetchAuthPageAboutUs-DiCqMUX3.js → fetchAuthPageAboutUs-BnKWq_TL.js} +2 -2
  23. package/dist/{index-Cn6LcfZO.js → index-BhVwozr0.js} +1 -1
  24. package/dist/main.js +30 -30
  25. package/dist/message.js +5 -5
  26. package/dist/pay.js +4 -4
  27. package/dist/privateCom.js +1 -1
  28. package/dist/referrer.js +1 -1
  29. package/dist/{runtime-BzCSCUNv.js → runtime-DMCyhVcI.js} +1344 -1327
  30. package/dist/runtime.d.ts +6 -2
  31. package/dist/style.css +1 -1
  32. package/dist/upload/browserCosTransport.d.ts +2 -5
  33. package/dist/upload/browserUploadService.d.ts +5 -4
  34. package/dist/upload.d.ts +2 -2
  35. package/dist/upload.js +2 -2
  36. package/dist/{useAuthkitAppsAuthPageInfo-DZ1p-P3Q.js → useAuthkitAppsAuthPageInfo-Byu0yvrx.js} +1 -1
  37. package/dist/{useAuthkitAuth-BPTZUSkM.js → useAuthkitAuth-M2vTpEcb.js} +2 -2
  38. package/dist/{useAuthkitCreateAndUpdate-Bbv7vZZn.js → useAuthkitCreateAndUpdate-D2_Bdazi.js} +1 -1
  39. package/dist/{useAuthkitUsersProfile-CW_exa7E.js → useAuthkitUsersProfile-DdUAENic.js} +2 -2
  40. package/dist/{useBillingStatusOptions-Br-iL77Z.js → useBillingStatusOptions-Jq6Wqfxb.js} +1 -1
  41. package/dist/{useEnsureAuthenticated-CncOvj2H.js → useEnsureAuthenticated-Hel8hWLJ.js} +2 -2
  42. package/dist/{useLegalDocs-D44qU_q0.js → useLegalDocs-BOjqYRyQ.js} +2 -2
  43. package/dist/{useMessageNotifications-D9uikt21.js → useMessageNotifications-AznFeFMD.js} +1 -1
  44. package/dist/{useRoutePermission-BrQX7NTq.js → useRoutePermission-BmUXTwQc.js} +2 -2
  45. package/dist/{useSEO-_TNouXE_.js → useSEO-Chz4Zxuu.js} +2 -2
  46. package/dist/{useSubscriptionCheckout-BDDCRxSs.js → useSubscriptionCheckout-3ivcOcgC.js} +3 -3
  47. package/dist/user.js +1 -1
  48. package/package.json +1 -1
  49. package/dist/FeedbackModal.vue_vue_type_script_setup_true_lang-DpOmbAg-.js +0 -1491
  50. package/dist/Upload.vue_vue_type_script_setup_true_lang-bh0NFq9E.js +0 -78
@@ -1,1491 +0,0 @@
1
- /* empty css */
2
- /* empty css */
3
- import { U as et } from "./userMenuModal-D-nDaYqM.js";
4
- import { defineComponent as j, useModel as tt, openBlock as s, createBlock as T, Teleport as at, createElementBlock as o, withKeys as st, createElementVNode as k, toDisplayString as $, withModifiers as J, createCommentVNode as R, mergeModels as nt, ref as g, computed as F, Fragment as M, renderList as H, createVNode as d, unref as a, normalizeStyle as ae, withCtx as f, createTextVNode as V, normalizeClass as ue, onBeforeUnmount as lt, onUnmounted as rt, watch as ge, readonly as it, nextTick as ne } from "vue";
5
- import { ImagePreviewGroup as _e, Avatar as ce, Space as de, Descriptions as ot, DescriptionsItem as le, Tag as ee, Spin as ut, Empty as ct, Button as ke, Message as fe, Form as dt, FormItem as Z, Input as ft, Select as $e, Option as Fe, Textarea as vt, Breadcrumb as pt, BreadcrumbItem as Ie, Modal as mt } from "@arco-design/web-vue";
6
- import { M as gt } from "./Menu-uCexrsKP.js";
7
- /* empty css */
8
- import { C as ve } from "./index-Cn6LcfZO.js";
9
- /* empty css */
10
- /* empty css */
11
- import { g as K } from "./apiClients-Ctcq8NZs.js";
12
- /* empty css */
13
- import { h as bt, u as Re } from "./runtime-BzCSCUNv.js";
14
- import { _ as X } from "./_plugin-vue_export-helper-CHgC5LLL.js";
15
- import { r as kt, m as Ae, a as yt, M as _t } from "./MessageList-rttvPmxV.js";
16
- import { f as te } from "./index-D56hUMeD.js";
17
- import { Bubble as Be, Sender as ht } from "ant-design-x-vue";
18
- import { u as wt } from "./useAuthkitUsersProfile-CW_exa7E.js";
19
- import { u as Ct } from "./useUserMenu-ClPBlvaM.js";
20
- /* empty css */
21
- import { Icon as St } from "@iconify/vue";
22
- import { _ as xt, g as Ut, i as $t } from "./plugin-vue_export-helper-LjDO2Zua.js";
23
- const Ft = {
24
- class: "video-preview__header"
25
- }, It = {
26
- class: "video-preview__title"
27
- }, At = {
28
- class: "video-preview__stage"
29
- }, Pt = ["src"], Rt = /* @__PURE__ */ j({
30
- __name: "VideoPreview",
31
- props: /* @__PURE__ */ nt({
32
- src: {
33
- type: String,
34
- default: ""
35
- },
36
- title: {
37
- type: String,
38
- default: ""
39
- }
40
- }, {
41
- visible: {
42
- type: Boolean,
43
- default: !1
44
- },
45
- visibleModifiers: {}
46
- }),
47
- emits: ["update:visible"],
48
- setup(e) {
49
- const t = tt(e, "visible"), r = e;
50
- function c() {
51
- t.value = !1;
52
- }
53
- return (v, p) => (s(), T(at, {
54
- to: "body"
55
- }, [t.value ? (s(), o("div", {
56
- key: 0,
57
- class: "video-preview",
58
- tabindex: "0",
59
- onClick: c,
60
- onKeydown: st(c, ["esc"])
61
- }, [k("div", Ft, [k("div", It, $(r.title), 1), k("button", {
62
- type: "button",
63
- class: "video-preview__close",
64
- onClick: J(c, ["stop"])
65
- }, " × ")]), k("div", At, [r.src ? (s(), o("video", {
66
- key: 0,
67
- class: "video-preview__video",
68
- src: r.src,
69
- controls: "",
70
- autoplay: "",
71
- onClick: p[0] || (p[0] = J(() => {
72
- }, ["stop"]))
73
- }, null, 8, Pt)) : R("", !0)])], 32)) : R("", !0)]));
74
- }
75
- }), he = /* @__PURE__ */ X(Rt, [["__scopeId", "data-v-3f517bc8"]]), Bt = {
76
- key: 0,
77
- class: "message-attachments"
78
- }, Tt = ["title", "onClick"], Mt = ["src", "alt"], Lt = ["title", "onClick"], Vt = ["src"], Et = ["href", "title"], Dt = {
79
- class: "message-attachment-main"
80
- }, qt = {
81
- class: "message-attachment-name"
82
- }, Ot = {
83
- class: "message-attachment-meta"
84
- }, zt = /* @__PURE__ */ j({
85
- __name: "FeedbackMessageAttachments",
86
- props: {
87
- attachments: {
88
- type: Array,
89
- default: () => []
90
- }
91
- },
92
- setup(e) {
93
- const t = e, r = g(!1), c = g(0), v = g(!1), p = g(""), y = g(""), w = F(() => t.attachments.filter((m) => m.kind === "image")), C = F(() => t.attachments.filter((m) => m.kind === "video")), S = F(() => t.attachments.filter((m) => m.kind === "file")), B = F(() => w.value.map((m) => m.url || ""));
94
- function _(m) {
95
- c.value = m, r.value = !0;
96
- }
97
- function A(m) {
98
- p.value = m.url || "", y.value = m.name, v.value = !0;
99
- }
100
- function E(m) {
101
- return m < 1024 ? `${m} B` : m < 1024 * 1024 ? `${(m / 1024).toFixed(1)} KB` : m < 1024 * 1024 * 1024 ? `${(m / 1024 / 1024).toFixed(1)} MB` : `${(m / 1024 / 1024 / 1024).toFixed(1)} GB`;
102
- }
103
- return (m, x) => (s(), o(M, null, [t.attachments.length > 0 ? (s(), o("div", Bt, [(s(!0), o(M, null, H(w.value, (l, I) => (s(), o("button", {
104
- key: l.key,
105
- type: "button",
106
- class: "message-media message-media--image",
107
- title: l.name,
108
- onClick: (L) => _(I)
109
- }, [k("img", {
110
- src: l.url,
111
- alt: l.name,
112
- class: "message-media__content"
113
- }, null, 8, Mt)], 8, Tt))), 128)), (s(!0), o(M, null, H(C.value, (l) => (s(), o("button", {
114
- key: l.key,
115
- type: "button",
116
- class: "message-media message-media--video",
117
- title: l.name,
118
- onClick: (I) => A(l)
119
- }, [k("video", {
120
- class: "message-media__content",
121
- src: l.url,
122
- muted: "",
123
- preload: "metadata"
124
- }, null, 8, Vt), x[3] || (x[3] = k("span", {
125
- class: "message-video-play"
126
- }, "播放", -1))], 8, Lt))), 128)), (s(!0), o(M, null, H(S.value, (l) => (s(), o("a", {
127
- key: l.key,
128
- class: "message-file",
129
- href: l.url,
130
- target: "_blank",
131
- rel: "noopener noreferrer",
132
- title: l.name
133
- }, [x[4] || (x[4] = k("span", {
134
- class: "message-file-icon"
135
- }, "FILE", -1)), k("span", Dt, [k("span", qt, $(l.name), 1), k("span", Ot, $(E(l.size)), 1)])], 8, Et))), 128))])) : R("", !0), d(a(_e), {
136
- "src-list": B.value,
137
- visible: r.value,
138
- "onUpdate:visible": x[0] || (x[0] = (l) => r.value = l),
139
- current: c.value,
140
- "onUpdate:current": x[1] || (x[1] = (l) => c.value = l)
141
- }, null, 8, ["src-list", "visible", "current"]), d(he, {
142
- visible: v.value,
143
- "onUpdate:visible": x[2] || (x[2] = (l) => v.value = l),
144
- title: y.value,
145
- src: p.value
146
- }, null, 8, ["visible", "title", "src"])], 64));
147
- }
148
- }), Te = /* @__PURE__ */ X(zt, [["__scopeId", "data-v-49a094a3"]]), Nt = /* @__PURE__ */ j({
149
- __name: "FeedbackRefresh",
150
- setup(e) {
151
- return (t, r) => (s(), T(a(St), {
152
- class: "icon",
153
- icon: "mingcute:refresh-2-line"
154
- }));
155
- }
156
- }), Pe = /* @__PURE__ */ X(Nt, [["__scopeId", "data-v-64bb6fc2"]]), jt = ["src"], Wt = {
157
- key: 1
158
- }, Kt = {
159
- class: "feedback-message-body"
160
- }, Ht = {
161
- key: 0,
162
- class: "feedback-text-bubble"
163
- }, Gt = {
164
- key: 1,
165
- class: "feedback-bubble-stack feedback-bubble-stack--end"
166
- }, Xt = ["src"], Yt = {
167
- key: 1
168
- }, Jt = /* @__PURE__ */ j({
169
- __name: "FeedbackBubbleEnd",
170
- props: {
171
- text: {
172
- type: String,
173
- default: ""
174
- },
175
- attachments: {
176
- type: Array,
177
- default: () => []
178
- },
179
- avatarUrl: {
180
- type: String,
181
- default: ""
182
- },
183
- avatarText: {
184
- type: String,
185
- default: "U"
186
- },
187
- bubbleStyle: {
188
- type: Object,
189
- default: () => ({
190
- paddingLeft: "52px"
191
- })
192
- },
193
- showRefresh: {
194
- type: Boolean,
195
- default: !1
196
- },
197
- showClipboard: {
198
- type: Boolean,
199
- default: !1
200
- }
201
- },
202
- emits: ["refresh"],
203
- setup(e, {
204
- emit: t
205
- }) {
206
- const r = e, c = t;
207
- function v(C) {
208
- return C.startsWith("http://") || C.startsWith("https://") || C.startsWith("data:");
209
- }
210
- const p = F(() => {
211
- const C = r.avatarUrl.trim();
212
- return v(C) ? C : "";
213
- }), y = F(() => r.attachments.length > 0);
214
- function w() {
215
- c("refresh");
216
- }
217
- return (C, S) => y.value ? (s(), o("div", {
218
- key: 0,
219
- class: "feedback-message-group feedback-message-group--end",
220
- style: ae(r.bubbleStyle)
221
- }, [d(a(ce), {
222
- class: "feedback-message-avatar"
223
- }, {
224
- default: f(() => [p.value ? (s(), o("img", {
225
- key: 0,
226
- alt: "avatar",
227
- src: p.value
228
- }, null, 8, jt)) : (s(), o("span", Wt, $(r.avatarText), 1))]),
229
- _: 1
230
- }), k("div", Kt, [r.text ? (s(), o("div", Ht, $(r.text), 1)) : R("", !0), r.showClipboard || r.showRefresh ? (s(), T(a(de), {
231
- key: 1,
232
- class: "feedback-message-footer"
233
- }, {
234
- default: f(() => [r.showClipboard ? (s(), T(ve, {
235
- key: 0,
236
- value: r.text
237
- }, null, 8, ["value"])) : R("", !0), r.showRefresh ? (s(), T(Pe, {
238
- key: 1,
239
- onClick: w
240
- })) : R("", !0)]),
241
- _: 1
242
- })) : R("", !0), d(Te, {
243
- attachments: r.attachments
244
- }, null, 8, ["attachments"])])], 4)) : (s(), o("div", Gt, [d(a(Be), {
245
- placement: "end",
246
- style: ae(r.bubbleStyle)
247
- }, {
248
- avatar: f(() => [d(a(ce), null, {
249
- default: f(() => [p.value ? (s(), o("img", {
250
- key: 0,
251
- alt: "avatar",
252
- src: p.value
253
- }, null, 8, Xt)) : (s(), o("span", Yt, $(r.avatarText), 1))]),
254
- _: 1
255
- })]),
256
- message: f(() => [r.text ? (s(), o(M, {
257
- key: 0
258
- }, [V($(r.text), 1)], 64)) : R("", !0)]),
259
- footer: f(() => [d(a(de), null, {
260
- default: f(() => [r.showClipboard && r.text ? (s(), T(ve, {
261
- key: 0,
262
- value: r.text
263
- }, null, 8, ["value"])) : R("", !0), r.showRefresh ? (s(), T(Pe, {
264
- key: 1,
265
- onClick: w
266
- })) : R("", !0)]),
267
- _: 1
268
- })]),
269
- _: 1
270
- }, 8, ["style"])]));
271
- }
272
- }), Zt = /* @__PURE__ */ X(Jt, [["__scopeId", "data-v-ed8f32cc"]]), Qt = ["src"], ea = {
273
- key: 1
274
- }, ta = {
275
- class: "feedback-message-body"
276
- }, aa = {
277
- key: 0,
278
- class: "feedback-text-bubble"
279
- }, sa = {
280
- key: 1,
281
- class: "feedback-bubble-stack feedback-bubble-stack--start"
282
- }, na = ["src"], la = {
283
- key: 1
284
- }, ra = /* @__PURE__ */ j({
285
- __name: "FeedbackBubbleStart",
286
- props: {
287
- text: {
288
- type: String,
289
- default: ""
290
- },
291
- attachments: {
292
- type: Array,
293
- default: () => []
294
- },
295
- avatarUrl: {
296
- type: String,
297
- default: ""
298
- },
299
- avatarText: {
300
- type: String,
301
- default: "U"
302
- },
303
- bubbleStyle: {
304
- type: Object,
305
- default: () => ({
306
- paddingRight: "52px"
307
- })
308
- },
309
- showClipboard: {
310
- type: Boolean,
311
- default: !1
312
- }
313
- },
314
- setup(e) {
315
- const t = e;
316
- function r(p) {
317
- return p.startsWith("http://") || p.startsWith("https://") || p.startsWith("data:");
318
- }
319
- const c = F(() => {
320
- const p = t.avatarUrl.trim();
321
- return r(p) ? p : "";
322
- }), v = F(() => t.attachments.length > 0);
323
- return (p, y) => v.value ? (s(), o("div", {
324
- key: 0,
325
- class: "feedback-message-group feedback-message-group--start",
326
- style: ae(t.bubbleStyle)
327
- }, [d(a(ce), {
328
- class: "feedback-message-avatar"
329
- }, {
330
- default: f(() => [c.value ? (s(), o("img", {
331
- key: 0,
332
- alt: "avatar",
333
- src: c.value
334
- }, null, 8, Qt)) : (s(), o("span", ea, $(t.avatarText), 1))]),
335
- _: 1
336
- }), k("div", ta, [t.text ? (s(), o("div", aa, $(t.text), 1)) : R("", !0), t.showClipboard ? (s(), T(a(de), {
337
- key: 1,
338
- class: "feedback-message-footer"
339
- }, {
340
- default: f(() => [d(ve, {
341
- value: t.text
342
- }, null, 8, ["value"])]),
343
- _: 1
344
- })) : R("", !0), d(Te, {
345
- attachments: t.attachments
346
- }, null, 8, ["attachments"])])], 4)) : (s(), o("div", sa, [d(a(Be), {
347
- placement: "start",
348
- style: ae(t.bubbleStyle)
349
- }, {
350
- avatar: f(() => [d(a(ce), null, {
351
- default: f(() => [c.value ? (s(), o("img", {
352
- key: 0,
353
- alt: "avatar",
354
- src: c.value
355
- }, null, 8, na)) : (s(), o("span", la, $(t.avatarText), 1))]),
356
- _: 1
357
- })]),
358
- message: f(() => [t.text ? (s(), o(M, {
359
- key: 0
360
- }, [V($(t.text), 1)], 64)) : R("", !0)]),
361
- footer: f(() => [d(a(de), null, {
362
- default: f(() => [t.showClipboard && t.text ? (s(), T(ve, {
363
- key: 0,
364
- value: t.text
365
- }, null, 8, ["value"])) : R("", !0)]),
366
- _: 1
367
- })]),
368
- _: 1
369
- }, 8, ["style"])]));
370
- }
371
- }), ia = /* @__PURE__ */ X(ra, [["__scopeId", "data-v-a88b5650"]]), oa = j({
372
- name: "IconLink",
373
- props: {
374
- size: {
375
- type: [Number, String]
376
- },
377
- strokeWidth: {
378
- type: Number,
379
- default: 4
380
- },
381
- strokeLinecap: {
382
- type: String,
383
- default: "butt",
384
- validator: (e) => ["butt", "round", "square"].includes(e)
385
- },
386
- strokeLinejoin: {
387
- type: String,
388
- default: "miter",
389
- validator: (e) => ["arcs", "bevel", "miter", "miter-clip", "round"].includes(e)
390
- },
391
- rotate: Number,
392
- spin: Boolean
393
- },
394
- emits: {
395
- click: (e) => !0
396
- },
397
- setup(e, {
398
- emit: t
399
- }) {
400
- const r = Ut("icon"), c = F(() => [r, `${r}-link`, {
401
- [`${r}-spin`]: e.spin
402
- }]), v = F(() => {
403
- const y = {};
404
- return e.size && (y.fontSize = $t(e.size) ? `${e.size}px` : e.size), e.rotate && (y.transform = `rotate(${e.rotate}deg)`), y;
405
- });
406
- return {
407
- cls: c,
408
- innerStyle: v,
409
- onClick: (y) => {
410
- t("click", y);
411
- }
412
- };
413
- }
414
- }), ua = ["stroke-width", "stroke-linecap", "stroke-linejoin"];
415
- function ca(e, t, r, c, v, p) {
416
- return s(), o("svg", {
417
- viewBox: "0 0 48 48",
418
- fill: "none",
419
- xmlns: "http://www.w3.org/2000/svg",
420
- stroke: "currentColor",
421
- class: ue(e.cls),
422
- style: ae(e.innerStyle),
423
- "stroke-width": e.strokeWidth,
424
- "stroke-linecap": e.strokeLinecap,
425
- "stroke-linejoin": e.strokeLinejoin,
426
- onClick: t[0] || (t[0] = (...y) => e.onClick && e.onClick(...y))
427
- }, t[1] || (t[1] = [k("path", {
428
- d: "m14.1 25.414-4.95 4.95a6 6 0 0 0 8.486 8.485l8.485-8.485a6 6 0 0 0 0-8.485m7.779.707 4.95-4.95a6 6 0 1 0-8.486-8.485l-8.485 8.485a6 6 0 0 0 0 8.485"
429
- }, null, -1)]), 14, ua);
430
- }
431
- var be = /* @__PURE__ */ xt(oa, [["render", ca]]);
432
- const da = Object.assign(be, {
433
- install: (e, t) => {
434
- var r;
435
- const c = (r = t == null ? void 0 : t.iconPrefix) != null ? r : "";
436
- e.component(c + be.name, be);
437
- }
438
- }), Me = [".jpg", ".jpeg", ".png", ".gif", ".webp", ".mp4", ".webm", ".mov", ".pdf", ".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx", ".txt", ".md", ".csv", ".json", ".zip"], Le = Me.join(","), fa = /* @__PURE__ */ new Set(["image/jpeg", "image/png", "image/gif", "image/webp"]), va = /* @__PURE__ */ new Set(["video/mp4", "video/webm", "video/quicktime"]);
439
- function pa(e) {
440
- const t = e.lastIndexOf(".");
441
- return t < 0 ? "" : e.slice(t).toLowerCase();
442
- }
443
- function ma(e) {
444
- return Me.includes(pa(e.name));
445
- }
446
- function Ve(e, t = e.type) {
447
- return fa.has(t) ? "image" : va.has(t) ? "video" : "file";
448
- }
449
- const re = 9;
450
- function ga(e) {
451
- const t = Ve(e);
452
- return {
453
- id: `${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,
454
- file: e,
455
- kind: t,
456
- previewUrl: t === "image" || t === "video" ? URL.createObjectURL(e) : void 0
457
- };
458
- }
459
- function Ee(e) {
460
- const t = g([]), r = F(() => t.value.length > 0), c = F(() => t.value.filter((_) => _.kind === "image" && !!_.previewUrl)), v = F(() => t.value.filter((_) => _.kind === "video" && !!_.previewUrl)), p = F(() => t.value.filter((_) => _.kind === "file"));
461
- function y(_) {
462
- e == null || e(_);
463
- }
464
- function w(_) {
465
- _.previewUrl && URL.revokeObjectURL(_.previewUrl);
466
- }
467
- function C(_) {
468
- if (_.length === 0) return;
469
- const A = _.filter(ma);
470
- if (_.length - A.length > 0 && y("仅支持常见图片、浏览器可预览视频、文档、文本、CSV、JSON 和 ZIP 文件"), A.length === 0) return;
471
- const m = re - t.value.length;
472
- if (m <= 0) {
473
- y(`最多只能添加 ${re} 个附件`);
474
- return;
475
- }
476
- const x = A.slice(0, m);
477
- A.length > m && y(`最多只能添加 ${re} 个附件,已跳过多余文件`), t.value.push(...x.map(ga));
478
- }
479
- function S(_) {
480
- const A = t.value[_];
481
- A && (w(A), t.value.splice(_, 1));
482
- }
483
- function B() {
484
- t.value.forEach(w), t.value = [];
485
- }
486
- return lt(() => {
487
- B();
488
- }), {
489
- items: t,
490
- imageItems: c,
491
- videoItems: v,
492
- fileItems: p,
493
- hasAttachments: r,
494
- addFiles: C,
495
- removeAt: S,
496
- clear: B,
497
- maxAttachments: re
498
- };
499
- }
500
- async function ba(e, t, r) {
501
- return (await e.upload({
502
- file: t,
503
- bucketId: r
504
- }).result).key;
505
- }
506
- async function De(e, t, r) {
507
- const c = [];
508
- for (const v of t) {
509
- const p = await ba(e, v, r), y = bt(v);
510
- c.push({
511
- key: p,
512
- name: v.name,
513
- size: v.size,
514
- mimeType: y,
515
- kind: Ve(v, y)
516
- });
517
- }
518
- return c;
519
- }
520
- function ka(e, t = {}) {
521
- const {
522
- interval: r = 2e3,
523
- immediate: c = !1,
524
- autoStart: v = !1
525
- } = t, p = g(!1);
526
- let y = null;
527
- async function w() {
528
- try {
529
- await e();
530
- } catch (_) {
531
- console.error("轮询回调执行失败:", _);
532
- }
533
- }
534
- function C() {
535
- if (p.value) {
536
- console.warn("轮询已在运行中");
537
- return;
538
- }
539
- p.value = !0, c && w(), y = setInterval(w, r);
540
- }
541
- function S() {
542
- y && (clearInterval(y), y = null), p.value = !1;
543
- }
544
- function B() {
545
- S(), C();
546
- }
547
- return v && C(), rt(() => {
548
- S();
549
- }), {
550
- isPolling: p,
551
- start: C,
552
- stop: S,
553
- restart: B
554
- };
555
- }
556
- const pe = g(0);
557
- let Q = null, oe = null, ye = !1;
558
- function ya() {
559
- pe.value = 0;
560
- }
561
- async function _a() {
562
- const {
563
- data: e,
564
- error: t
565
- } = await K().ones.feedbackCenter.unreadReplyCount.post({});
566
- return t ? null : typeof (e == null ? void 0 : e.count) == "number" ? e.count : 0;
567
- }
568
- async function Y() {
569
- return Q || (Q = (async () => {
570
- await yt();
571
- const e = await _a();
572
- e !== null && (pe.value = e);
573
- })().finally(() => {
574
- Q = null;
575
- }), Q);
576
- }
577
- function ha() {
578
- ye || (ye = !0, oe = setInterval(() => {
579
- Y();
580
- }, 6e4));
581
- }
582
- function wa() {
583
- oe && (clearInterval(oe), oe = null), ye = !1;
584
- }
585
- function xs() {
586
- const {
587
- isLoggedIn: e
588
- } = wt(), {
589
- isOpen: t,
590
- messagesTrigger: r,
591
- feedbackTrigger: c
592
- } = Ct();
593
- return ge(e, (v) => {
594
- if (v) {
595
- Y(), ha();
596
- return;
597
- }
598
- kt(), ya(), wa();
599
- }, {
600
- immediate: !0
601
- }), ge(t, (v) => {
602
- v && e.value && Y();
603
- }), ge([r, c], () => {
604
- e.value && window.setTimeout(() => {
605
- Y();
606
- }, 1500);
607
- }), {
608
- messageUnreadCount: Ae,
609
- feedbackUnreadCount: it(pe),
610
- hasMessageBadge: F(() => Ae.value > 0),
611
- hasFeedbackBadge: F(() => pe.value > 0),
612
- refreshUserMenuBadgeCounts: Y
613
- };
614
- }
615
- const we = [{
616
- key: "bugReports",
617
- label: "问题报告"
618
- }, {
619
- key: "featureSuggestions",
620
- label: "功能建议"
621
- }, {
622
- key: "technicalSupportRequests",
623
- label: "技术支持请求"
624
- }, {
625
- key: "generalOpinions",
626
- label: "一般意见"
627
- }], qe = [{
628
- key: "urgent",
629
- label: "紧急"
630
- }, {
631
- key: "high",
632
- label: "高"
633
- }, {
634
- key: "normal",
635
- label: "普通"
636
- }, {
637
- key: "low",
638
- label: "低"
639
- }], Oe = [{
640
- key: "newFeedback",
641
- label: "新反馈"
642
- }, {
643
- key: "inProgress",
644
- label: "处理中"
645
- }, {
646
- key: "pending",
647
- label: "待处理"
648
- }, {
649
- key: "resolved",
650
- label: "已解决"
651
- }, {
652
- key: "closed",
653
- label: "已关闭"
654
- }];
655
- function Ca(e) {
656
- return e ? e.startsWith("http://") || e.startsWith("https://") || e.startsWith("data:") : !1;
657
- }
658
- function ie(e) {
659
- const t = (e.attachments ?? []).filter((r) => Ca(r.url));
660
- return {
661
- text: e.content ?? "",
662
- attachments: t
663
- };
664
- }
665
- const Sa = {
666
- class: "FeedBackDetails"
667
- }, xa = {
668
- class: "scrollable-content__inner"
669
- }, Ua = {
670
- class: "content"
671
- }, $a = {
672
- class: "empty-title"
673
- }, Fa = {
674
- class: "empty-tips"
675
- }, Ia = {
676
- key: 1,
677
- class: "Bubbles"
678
- }, Aa = {
679
- class: "sender-container"
680
- }, Pa = {
681
- key: 0,
682
- class: "attachments-preview"
683
- }, Ra = ["onClick"], Ba = ["src"], Ta = ["src"], Ma = {
684
- class: "attachment-file-name"
685
- }, La = ["onClick"], Va = ["accept"], Ea = /* @__PURE__ */ j({
686
- __name: "FeedbackDetails",
687
- props: {
688
- id: {
689
- type: String,
690
- required: !0,
691
- default: () => ""
692
- },
693
- senderRole: {
694
- type: String,
695
- required: !0,
696
- validator: (e) => ["user", "support"].includes(e)
697
- }
698
- },
699
- setup(e) {
700
- const t = ht;
701
- function r(i) {
702
- return i === "inProgress" ? "orangered" : i === "pending" ? "gold" : i === "resolved" ? "green" : i === "closed" ? "gray" : "arcoblue";
703
- }
704
- const c = g(""), v = g(!1), {
705
- config: p,
706
- upload: y
707
- } = Re(), w = g(null), C = g(null), S = g(null), B = g(!1), _ = g(!1), A = g(0), E = g(!1), m = g(""), x = g(""), l = Ee((i) => {
708
- fe.warning(i);
709
- }), I = F(() => l.imageItems.value.map((i) => i.previewUrl || "")), L = F(() => c.value.trim().length > 0 || l.hasAttachments.value), P = () => {
710
- var i;
711
- (i = w.value) == null || i.focus({
712
- cursor: "end"
713
- }), ne(() => {
714
- C.value && (C.value.scrollTop = C.value.scrollHeight);
715
- });
716
- }, D = e, U = F(() => D.senderRole === "support" ? "暂无沟通记录" : "还没有消息"), h = F(() => D.senderRole === "support" ? ["可在下方输入框回复用户", "支持发送文字、图片和文件附件"] : ["请尽量详细描述问题或需求", "可上传多张图片或文件附件,支持与文字一起发送"]), b = F(() => D.senderRole === "support" ? "输入回复内容,Enter 发送" : "补充问题描述或追问,Enter 发送"), z = g(!1), W = g([]), se = g(void 0);
717
- function ze(i, u) {
718
- const n = "seq" in i && typeof i.seq == "number" ? i.seq : u;
719
- return `${i.senderRole}-${n}-${u}`;
720
- }
721
- function Ce(i) {
722
- var u;
723
- return String(((u = i.senderInfo) == null ? void 0 : u.avatarUrl) || "");
724
- }
725
- function Se(i) {
726
- var n;
727
- const u = String(((n = i.senderInfo) == null ? void 0 : n.nickname) || "").trim();
728
- return u ? u.slice(0, 1).toUpperCase() : i.senderRole === "support" ? "S" : "U";
729
- }
730
- const G = g({
731
- id: void 0,
732
- title: "",
733
- description: "",
734
- type: "bugReports",
735
- status: "newFeedback",
736
- reply: "",
737
- createAt: ""
738
- });
739
- function Ne() {
740
- var i;
741
- (i = S.value) == null || i.click();
742
- }
743
- function je(i) {
744
- const u = i.target, n = u.files;
745
- n != null && n.length && l.addFiles(Array.from(n)), u.value = "";
746
- }
747
- function We(i) {
748
- if (i.kind === "image" && i.previewUrl) {
749
- const u = l.imageItems.value.findIndex((n) => n.id === i.id);
750
- if (u < 0) return;
751
- A.value = u, _.value = !0;
752
- return;
753
- }
754
- i.kind === "video" && i.previewUrl && (m.value = i.previewUrl, x.value = i.file.name, E.value = !0);
755
- }
756
- function Ke(i) {
757
- var q;
758
- const u = (q = i.clipboardData) == null ? void 0 : q.items;
759
- if (!u) return;
760
- const n = [];
761
- for (const N of u)
762
- if (N.type.startsWith("image/")) {
763
- const O = N.getAsFile();
764
- O && n.push(O);
765
- }
766
- n.length > 0 && (i.preventDefault(), l.addFiles(n));
767
- }
768
- function He(i) {
769
- var u;
770
- (u = i.dataTransfer) != null && u.types.includes("Files") && (B.value = !0);
771
- }
772
- function Ge() {
773
- B.value = !1;
774
- }
775
- function Xe(i) {
776
- var n;
777
- B.value = !1;
778
- const u = (n = i.dataTransfer) == null ? void 0 : n.files;
779
- u && l.addFiles(Array.from(u));
780
- }
781
- async function Ye() {
782
- D.senderRole === "support" && G.value.status === "newFeedback" && await xe();
783
- }
784
- async function Je() {
785
- const i = c.value, u = l.items.value.map((n) => n.file);
786
- if (!(!i.trim() && u.length === 0)) {
787
- v.value = !0;
788
- try {
789
- const n = u.length > 0 ? await De(y, u, p.feedbackBucketId) : [], q = i.trim(), {
790
- data: N,
791
- error: O
792
- } = await K().ones.feedbackCenter.update.messages.post({
793
- id: D.id,
794
- message: {
795
- type: "text",
796
- content: q,
797
- attachments: n,
798
- senderRole: D.senderRole
799
- }
800
- });
801
- if (O || !N)
802
- return;
803
- const me = N;
804
- W.value.push(me.message), typeof me.message.seq == "number" && (se.value = me.message.seq), c.value = "", l.clear(), ne(() => {
805
- P();
806
- }), await Ye();
807
- } catch {
808
- fe.error("发送失败,请稍后重试");
809
- } finally {
810
- v.value = !1;
811
- }
812
- }
813
- }
814
- async function xe() {
815
- z.value = !0;
816
- const {
817
- data: i,
818
- error: u
819
- } = await K().ones.feedbackCenter.findOne.post({
820
- id: D.id
821
- });
822
- if (z.value = !1, u || !i)
823
- return;
824
- const n = i;
825
- G.value = n;
826
- }
827
- async function Ue() {
828
- if (D.senderRole !== "user")
829
- return;
830
- const {
831
- error: i
832
- } = await K().ones.feedbackCenter.markRead.post({
833
- id: D.id
834
- });
835
- i || Y();
836
- }
837
- async function Ze() {
838
- var q;
839
- const {
840
- data: i,
841
- error: u
842
- } = await K().ones.messages.list.incremental.post({
843
- id: D.id,
844
- lastSeq: se.value
845
- });
846
- if (u || !i)
847
- return;
848
- const n = i;
849
- if ((q = n.messages) != null && q.length) {
850
- const N = n.messages;
851
- W.value.push(...N);
852
- const O = N.at(-1);
853
- O && "seq" in O && typeof O.seq == "number" && (se.value = O.seq), ne(() => {
854
- P();
855
- }), await Ue();
856
- }
857
- }
858
- async function Qe() {
859
- var q;
860
- z.value = !0;
861
- const {
862
- data: i,
863
- error: u
864
- } = await K().ones.messages.list.post({
865
- id: D.id
866
- });
867
- if (z.value = !1, u || !i)
868
- return;
869
- const n = i;
870
- if ((q = n.messages) != null && q.length) {
871
- const N = n.messages;
872
- W.value = N;
873
- const O = N.at(-1);
874
- O && "seq" in O && typeof O.seq == "number" && (se.value = O.seq), ne(() => {
875
- P();
876
- });
877
- }
878
- await Ue();
879
- }
880
- return ka(Ze, {
881
- interval: 2e3,
882
- autoStart: !0
883
- }), xe(), Qe(), (i, u) => (s(), o("div", Sa, [k("div", {
884
- ref_key: "scrollableContentRef",
885
- ref: C,
886
- class: "scrollable-content"
887
- }, [k("div", xa, [d(a(ot), {
888
- title: "基本信息"
889
- }, {
890
- title: f(() => [...u[4] || (u[4] = [k("div", {
891
- class: "title"
892
- }, "基本信息", -1)])]),
893
- default: f(() => [d(a(le), {
894
- label: "标题:",
895
- span: 3
896
- }, {
897
- default: f(() => [V($(G.value.title), 1)]),
898
- _: 1
899
- }), d(a(le), {
900
- label: "问题描述:",
901
- span: 3
902
- }, {
903
- default: f(() => [V($(G.value.description || "-"), 1)]),
904
- _: 1
905
- }), d(a(le), {
906
- label: "反馈类型:",
907
- span: 1
908
- }, {
909
- default: f(() => [d(a(ee), {
910
- color: "arcoblue"
911
- }, {
912
- default: f(() => {
913
- var n;
914
- return [V($((n = a(te)(a(we), G.value.type)) == null ? void 0 : n.label), 1)];
915
- }),
916
- _: 1
917
- })]),
918
- _: 1
919
- }), d(a(le), {
920
- label: "状态:",
921
- span: 1
922
- }, {
923
- default: f(() => [d(a(ee), {
924
- color: r(G.value.status)
925
- }, {
926
- default: f(() => {
927
- var n;
928
- return [V($((n = a(te)(a(Oe), G.value.status)) == null ? void 0 : n.label), 1)];
929
- }),
930
- _: 1
931
- }, 8, ["color"])]),
932
- _: 1
933
- })]),
934
- _: 1
935
- }), k("div", Ua, [u[5] || (u[5] = k("div", {
936
- class: "title"
937
- }, "沟通记录", -1)), d(a(ut), {
938
- class: "messageContent",
939
- loading: z.value
940
- }, {
941
- default: f(() => [W.value.length === 0 ? (s(), T(a(ct), {
942
- key: 0,
943
- class: "message-empty"
944
- }, {
945
- description: f(() => [k("div", $a, $(U.value), 1), k("ul", Fa, [(s(!0), o(M, null, H(h.value, (n) => (s(), o("li", {
946
- key: n
947
- }, $(n), 1))), 128))])]),
948
- _: 1
949
- })) : (s(), o("div", Ia, [(s(!0), o(M, null, H(W.value, (n, q) => (s(), o(M, {
950
- key: ze(n, q)
951
- }, [n.senderRole !== D.senderRole ? (s(), T(ia, {
952
- key: 0,
953
- text: a(ie)(n).text,
954
- attachments: a(ie)(n).attachments,
955
- "avatar-url": Ce(n),
956
- "avatar-text": Se(n)
957
- }, null, 8, ["text", "attachments", "avatar-url", "avatar-text"])) : (s(), T(Zt, {
958
- key: 1,
959
- text: a(ie)(n).text,
960
- attachments: a(ie)(n).attachments,
961
- "avatar-url": Ce(n),
962
- "avatar-text": Se(n)
963
- }, null, 8, ["text", "attachments", "avatar-url", "avatar-text"]))], 64))), 128))]))]),
964
- _: 1
965
- }, 8, ["loading"])])])], 512), k("div", Aa, [k("div", {
966
- class: ue(["sender-panel", {
967
- "is-drag-over": B.value
968
- }]),
969
- onDragover: J(He, ["prevent"]),
970
- onDragleave: Ge,
971
- onDrop: J(Xe, ["prevent"]),
972
- onPaste: Ke
973
- }, [a(l).hasAttachments.value ? (s(), o("div", Pa, [(s(!0), o(M, null, H(a(l).items.value, (n, q) => (s(), o("div", {
974
- key: n.id,
975
- class: ue(["attachment-preview-item", {
976
- "is-image": n.kind === "image",
977
- "is-video": n.kind === "video"
978
- }]),
979
- onClick: (N) => We(n)
980
- }, [n.kind === "image" && n.previewUrl ? (s(), o("img", {
981
- key: 0,
982
- src: n.previewUrl,
983
- alt: "预览",
984
- class: "attachment-thumbnail"
985
- }, null, 8, Ba)) : n.kind === "video" && n.previewUrl ? (s(), o(M, {
986
- key: 1
987
- }, [k("video", {
988
- class: "attachment-thumbnail",
989
- src: n.previewUrl,
990
- muted: "",
991
- preload: "metadata"
992
- }, null, 8, Ta), u[6] || (u[6] = k("span", {
993
- class: "attachment-video-play"
994
- }, "播放", -1))], 64)) : (s(), o(M, {
995
- key: 2
996
- }, [u[7] || (u[7] = k("span", {
997
- class: "attachment-file-icon"
998
- }, "FILE", -1)), k("span", Ma, $(n.file.name), 1)], 64)), k("button", {
999
- type: "button",
1000
- class: "attachment-remove-btn",
1001
- title: "移除附件",
1002
- onClick: J((N) => a(l).removeAt(q), ["stop"])
1003
- }, " × ", 8, La)], 10, Ra))), 128))])) : R("", !0), d(a(_e), {
1004
- "src-list": I.value,
1005
- visible: _.value,
1006
- "onUpdate:visible": u[0] || (u[0] = (n) => _.value = n),
1007
- current: A.value,
1008
- "onUpdate:current": u[1] || (u[1] = (n) => A.value = n)
1009
- }, null, 8, ["src-list", "visible", "current"]), d(he, {
1010
- visible: E.value,
1011
- "onUpdate:visible": u[2] || (u[2] = (n) => E.value = n),
1012
- title: x.value,
1013
- src: m.value
1014
- }, null, 8, ["visible", "title", "src"]), d(a(t), {
1015
- ref_key: "senderRef",
1016
- ref: w,
1017
- value: c.value,
1018
- "onUpdate:value": u[3] || (u[3] = (n) => c.value = n),
1019
- placeholder: b.value,
1020
- loading: v.value,
1021
- "allow-speech": !1,
1022
- "read-only": v.value,
1023
- "send-disabled": !L.value,
1024
- onSubmit: Je
1025
- }, {
1026
- prefix: f(() => [d(a(ke), {
1027
- type: "text",
1028
- class: "IconLink",
1029
- disabled: v.value,
1030
- onClick: Ne
1031
- }, {
1032
- icon: f(() => [d(a(da))]),
1033
- _: 1
1034
- }, 8, ["disabled"])]),
1035
- _: 1
1036
- }, 8, ["value", "placeholder", "loading", "read-only", "send-disabled"]), k("input", {
1037
- ref_key: "fileInputRef",
1038
- ref: S,
1039
- type: "file",
1040
- accept: a(Le),
1041
- multiple: "",
1042
- class: "hidden-file-input",
1043
- onChange: je
1044
- }, null, 40, Va)], 34)])]));
1045
- }
1046
- }), Da = /* @__PURE__ */ X(Ea, [["__scopeId", "data-v-48f2e1bc"]]), qa = {
1047
- class: "FeedBackFrom"
1048
- }, Oa = {
1049
- class: "feedback-attachments-field"
1050
- }, za = {
1051
- key: 0,
1052
- class: "attachments-preview"
1053
- }, Na = ["onClick"], ja = ["src"], Wa = ["src"], Ka = {
1054
- class: "attachment-file-name"
1055
- }, Ha = ["onClick"], Ga = ["accept"], Xa = /* @__PURE__ */ j({
1056
- __name: "FeedbackForm",
1057
- emits: ["confirm"],
1058
- setup(e, {
1059
- emit: t
1060
- }) {
1061
- const r = t, c = g(), v = g(!1), {
1062
- config: p,
1063
- upload: y
1064
- } = Re(), w = g({
1065
- id: void 0,
1066
- title: "",
1067
- type: "bugReports",
1068
- priority: "normal",
1069
- description: ""
1070
- }), C = g(null), S = g(!1), B = g(0), _ = g(!1), A = g(""), E = g(""), m = Ee((U) => {
1071
- fe.warning(U);
1072
- }), x = F(() => m.imageItems.value.map((U) => U.previewUrl || ""));
1073
- function l() {
1074
- var U;
1075
- (U = C.value) == null || U.click();
1076
- }
1077
- function I(U) {
1078
- const h = U.target, b = h.files;
1079
- b != null && b.length && m.addFiles(Array.from(b)), h.value = "";
1080
- }
1081
- function L(U) {
1082
- if (U.kind === "image" && U.previewUrl) {
1083
- const h = m.imageItems.value.findIndex((b) => b.id === U.id);
1084
- if (h < 0) return;
1085
- B.value = h, S.value = !0;
1086
- return;
1087
- }
1088
- U.kind === "video" && U.previewUrl && (A.value = U.previewUrl, E.value = U.file.name, _.value = !0);
1089
- }
1090
- function P() {
1091
- var U, h;
1092
- w.value = {
1093
- id: void 0,
1094
- title: "",
1095
- type: "bugReports",
1096
- priority: "normal",
1097
- description: ""
1098
- }, m.clear(), (h = (U = c.value) == null ? void 0 : U.resetFields) == null || h.call(U);
1099
- }
1100
- async function D() {
1101
- if (!await c.value.validate()) {
1102
- v.value = !0;
1103
- try {
1104
- const h = m.items.value.map((W) => W.file), b = h.length > 0 ? await De(y, h, p.feedbackBucketId) : [], {
1105
- error: z
1106
- } = await K().ones.feedbackCenter.create.post({
1107
- title: w.value.title,
1108
- type: w.value.type,
1109
- priority: w.value.priority,
1110
- description: w.value.description,
1111
- attachments: b
1112
- });
1113
- z || (fe.success("新建反馈成功"), P(), r("confirm"));
1114
- } finally {
1115
- v.value = !1;
1116
- }
1117
- }
1118
- }
1119
- return (U, h) => (s(), o("div", qa, [d(a(dt), {
1120
- ref_key: "formRef",
1121
- ref: c,
1122
- model: w.value,
1123
- "auto-label-width": "",
1124
- layout: "vertical"
1125
- }, {
1126
- default: f(() => [d(a(Z), {
1127
- field: "title",
1128
- label: "标题",
1129
- rules: [{
1130
- required: !0,
1131
- message: "请输入标题"
1132
- }]
1133
- }, {
1134
- default: f(() => [d(a(ft), {
1135
- modelValue: w.value.title,
1136
- "onUpdate:modelValue": h[0] || (h[0] = (b) => w.value.title = b),
1137
- placeholder: "请输入标题"
1138
- }, null, 8, ["modelValue"])]),
1139
- _: 1
1140
- }), d(a(Z), {
1141
- field: "type",
1142
- label: "反馈类型",
1143
- rules: [{
1144
- required: !0,
1145
- message: "请选择反馈类型"
1146
- }]
1147
- }, {
1148
- default: f(() => [d(a($e), {
1149
- modelValue: w.value.type,
1150
- "onUpdate:modelValue": h[1] || (h[1] = (b) => w.value.type = b),
1151
- placeholder: "请选择反馈类型"
1152
- }, {
1153
- default: f(() => [(s(!0), o(M, null, H(a(we), (b, z) => (s(), T(a(Fe), {
1154
- key: z,
1155
- value: b.key
1156
- }, {
1157
- default: f(() => [V($(b.label), 1)]),
1158
- _: 2
1159
- }, 1032, ["value"]))), 128))]),
1160
- _: 1
1161
- }, 8, ["modelValue"])]),
1162
- _: 1
1163
- }), d(a(Z), {
1164
- field: "priority",
1165
- label: "优先级",
1166
- rules: [{
1167
- required: !0,
1168
- message: "请选择优先级"
1169
- }]
1170
- }, {
1171
- default: f(() => [d(a($e), {
1172
- modelValue: w.value.priority,
1173
- "onUpdate:modelValue": h[2] || (h[2] = (b) => w.value.priority = b),
1174
- placeholder: "请选择优先级"
1175
- }, {
1176
- default: f(() => [(s(!0), o(M, null, H(a(qe), (b, z) => (s(), T(a(Fe), {
1177
- key: z,
1178
- value: b.key
1179
- }, {
1180
- default: f(() => [V($(b.label), 1)]),
1181
- _: 2
1182
- }, 1032, ["value"]))), 128))]),
1183
- _: 1
1184
- }, 8, ["modelValue"])]),
1185
- _: 1
1186
- }), d(a(Z), {
1187
- field: "description",
1188
- label: "问题描述",
1189
- rules: [{
1190
- required: !0,
1191
- message: "请输入问题描述"
1192
- }]
1193
- }, {
1194
- default: f(() => [d(a(vt), {
1195
- modelValue: w.value.description,
1196
- "onUpdate:modelValue": h[3] || (h[3] = (b) => w.value.description = b),
1197
- placeholder: "请输入问题描述",
1198
- "allow-clear": "",
1199
- "auto-size": {
1200
- minRows: 5
1201
- }
1202
- }, null, 8, ["modelValue"])]),
1203
- _: 1
1204
- }), d(a(Z), {
1205
- field: "attachments",
1206
- label: "附件"
1207
- }, {
1208
- default: f(() => [k("div", Oa, [d(a(ke), {
1209
- type: "outline",
1210
- disabled: v.value,
1211
- onClick: l
1212
- }, {
1213
- default: f(() => [...h[7] || (h[7] = [V(" 添加图片、视频或文件 ", -1)])]),
1214
- _: 1
1215
- }, 8, ["disabled"]), a(m).hasAttachments.value ? (s(), o("div", za, [(s(!0), o(M, null, H(a(m).items.value, (b, z) => (s(), o("div", {
1216
- key: b.id,
1217
- class: ue(["attachment-preview-item", {
1218
- "is-image": b.kind === "image",
1219
- "is-video": b.kind === "video"
1220
- }]),
1221
- onClick: (W) => L(b)
1222
- }, [b.kind === "image" && b.previewUrl ? (s(), o("img", {
1223
- key: 0,
1224
- src: b.previewUrl,
1225
- alt: "预览",
1226
- class: "attachment-thumbnail"
1227
- }, null, 8, ja)) : b.kind === "video" && b.previewUrl ? (s(), o(M, {
1228
- key: 1
1229
- }, [k("video", {
1230
- class: "attachment-thumbnail",
1231
- src: b.previewUrl,
1232
- muted: "",
1233
- preload: "metadata"
1234
- }, null, 8, Wa), h[8] || (h[8] = k("span", {
1235
- class: "attachment-video-play"
1236
- }, "播放", -1))], 64)) : (s(), o(M, {
1237
- key: 2
1238
- }, [h[9] || (h[9] = k("span", {
1239
- class: "attachment-file-icon"
1240
- }, "FILE", -1)), k("span", Ka, $(b.file.name), 1)], 64)), k("button", {
1241
- type: "button",
1242
- class: "attachment-remove-btn",
1243
- title: "移除附件",
1244
- onClick: J((W) => a(m).removeAt(z), ["stop"])
1245
- }, " × ", 8, Ha)], 10, Na))), 128))])) : R("", !0), d(a(_e), {
1246
- "src-list": x.value,
1247
- visible: S.value,
1248
- "onUpdate:visible": h[4] || (h[4] = (b) => S.value = b),
1249
- current: B.value,
1250
- "onUpdate:current": h[5] || (h[5] = (b) => B.value = b)
1251
- }, null, 8, ["src-list", "visible", "current"]), d(he, {
1252
- visible: _.value,
1253
- "onUpdate:visible": h[6] || (h[6] = (b) => _.value = b),
1254
- title: E.value,
1255
- src: A.value
1256
- }, null, 8, ["visible", "title", "src"]), k("input", {
1257
- ref_key: "fileInputRef",
1258
- ref: C,
1259
- type: "file",
1260
- accept: a(Le),
1261
- multiple: "",
1262
- class: "hidden-file-input",
1263
- onChange: I
1264
- }, null, 40, Ga)])]),
1265
- _: 1
1266
- }), d(a(ke), {
1267
- loading: v.value,
1268
- type: "primary",
1269
- onClick: D
1270
- }, {
1271
- default: f(() => [...h[10] || (h[10] = [V(" 提交 ", -1)])]),
1272
- _: 1
1273
- }, 8, ["loading"])]),
1274
- _: 1
1275
- }, 8, ["model"])]));
1276
- }
1277
- }), Ya = /* @__PURE__ */ X(Xa, [["__scopeId", "data-v-15b544d7"]]), Ja = {
1278
- class: "message-panel"
1279
- }, Za = {
1280
- key: 2,
1281
- class: "message-panel__detail"
1282
- }, Qa = /* @__PURE__ */ j({
1283
- __name: "FeedbackList",
1284
- emits: ["toDetail"],
1285
- setup(e, {
1286
- expose: t,
1287
- emit: r
1288
- }) {
1289
- const c = g(!0), v = g([]), p = g(!1), y = g(!1), w = g(""), C = g({
1290
- total: 0,
1291
- current: 1,
1292
- pageSize: 10
1293
- });
1294
- function S() {
1295
- c.value = !0, C.value.current = 1, m();
1296
- }
1297
- function B(l) {
1298
- w.value = l.id, c.value = !1;
1299
- }
1300
- function _(l) {
1301
- return l === "inProgress" ? "orangered" : l === "pending" ? "gold" : l === "resolved" ? "green" : l === "closed" ? "gray" : "arcoblue";
1302
- }
1303
- function A(l) {
1304
- return l === "urgent" ? "red" : l === "high" ? "orangered" : l === "low" ? "gray" : "blue";
1305
- }
1306
- function E(l) {
1307
- return l.map((I) => ({
1308
- ...I,
1309
- read: I.read ?? !0
1310
- }));
1311
- }
1312
- async function m() {
1313
- p.value = !0;
1314
- const {
1315
- data: l,
1316
- error: I
1317
- } = await K().ones.feedbackCenter.own.post({
1318
- current: C.value.current,
1319
- pageSize: C.value.pageSize
1320
- });
1321
- if (p.value = !1, !I && l) {
1322
- const L = l, P = E(L.items || []);
1323
- v.value = P, C.value.total = L.count || 0, y.value = P.length < C.value.pageSize;
1324
- }
1325
- }
1326
- async function x() {
1327
- if (p.value || y.value) return;
1328
- C.value.current += 1, p.value = !0;
1329
- const {
1330
- data: l,
1331
- error: I
1332
- } = await K().ones.feedbackCenter.own.post({
1333
- current: C.value.current,
1334
- pageSize: C.value.pageSize
1335
- });
1336
- if (p.value = !1, !I && l) {
1337
- const P = E(l.items || []);
1338
- v.value = [...v.value, ...P], y.value = P.length < C.value.pageSize;
1339
- }
1340
- }
1341
- return m(), t({
1342
- refresh: m
1343
- }), (l, I) => (s(), o("div", Ja, [c.value ? R("", !0) : (s(), T(a(pt), {
1344
- key: 0,
1345
- class: "message-panel__breadcrumb"
1346
- }, {
1347
- default: f(() => [d(a(Ie), {
1348
- onClick: S
1349
- }, {
1350
- default: f(() => [...I[0] || (I[0] = [V("我的反馈", -1)])]),
1351
- _: 1
1352
- }), d(a(Ie), null, {
1353
- default: f(() => [...I[1] || (I[1] = [V("反馈详情", -1)])]),
1354
- _: 1
1355
- })]),
1356
- _: 1
1357
- })), c.value ? (s(), T(_t, {
1358
- key: 1,
1359
- "message-list": v.value,
1360
- loading: p.value,
1361
- finished: y.value,
1362
- "show-read-status": !0,
1363
- "show-view-button": !1,
1364
- "empty-description": "暂无反馈",
1365
- onItemClick: B,
1366
- onLoadMore: x
1367
- }, {
1368
- tags: f(({
1369
- item: L
1370
- }) => [d(a(ee), {
1371
- color: "arcoblue",
1372
- size: "small"
1373
- }, {
1374
- default: f(() => {
1375
- var P;
1376
- return [V($((P = a(te)(a(we), L.type)) == null ? void 0 : P.label), 1)];
1377
- }),
1378
- _: 2
1379
- }, 1024), d(a(ee), {
1380
- color: A(L.priority),
1381
- size: "small"
1382
- }, {
1383
- default: f(() => {
1384
- var P;
1385
- return [V($(((P = a(te)(a(qe), L.priority)) == null ? void 0 : P.label) || "普通"), 1)];
1386
- }),
1387
- _: 2
1388
- }, 1032, ["color"]), d(a(ee), {
1389
- color: _(L.status),
1390
- size: "small"
1391
- }, {
1392
- default: f(() => {
1393
- var P;
1394
- return [V($((P = a(te)(a(Oe), L.status)) == null ? void 0 : P.label), 1)];
1395
- }),
1396
- _: 2
1397
- }, 1032, ["color"])]),
1398
- description: f(({
1399
- item: L
1400
- }) => [V($(L.description || "暂无描述"), 1)]),
1401
- _: 1
1402
- }, 8, ["message-list", "loading", "finished"])) : (s(), o("div", Za, [d(Da, {
1403
- id: w.value,
1404
- "sender-role": "user",
1405
- class: "feedback-details-panel"
1406
- }, null, 8, ["id"])]))]));
1407
- }
1408
- }), es = {
1409
- key: 0,
1410
- class: "user-menu-modal-content"
1411
- }, ts = {
1412
- class: "left"
1413
- }, as = {
1414
- key: 1,
1415
- class: "user-menu-modal-form"
1416
- }, Us = /* @__PURE__ */ j({
1417
- __name: "FeedbackModal",
1418
- emits: ["confirm", "cancel"],
1419
- setup(e, {
1420
- expose: t,
1421
- emit: r
1422
- }) {
1423
- const c = g(!1), v = g(Symbol("feedback-list")), p = g(Symbol("feedback-form")), y = r;
1424
- function w() {
1425
- S.value = ["FeedbackList"], v.value = Symbol("feedback-list"), p.value = Symbol("feedback-form");
1426
- }
1427
- function C() {
1428
- w(), y("cancel");
1429
- }
1430
- const S = g(["FeedbackList"]), B = g([{
1431
- name: "我的反馈",
1432
- path: "FeedbackList",
1433
- meta: {
1434
- icon: "mingcute:cube-3d-fill"
1435
- }
1436
- }, {
1437
- name: "新建反馈",
1438
- path: "CreateFeedback",
1439
- meta: {
1440
- icon: "mingcute:cube-3d-fill"
1441
- }
1442
- }]), _ = F(() => S.value.length !== 0 ? S.value[0] : "");
1443
- function A() {
1444
- S.value = ["FeedbackList"], v.value = Symbol("feedback-list");
1445
- }
1446
- function E(x) {
1447
- S.value = [x.path];
1448
- }
1449
- function m(x) {
1450
- c.value = x, x && w();
1451
- }
1452
- return t({
1453
- setData: m
1454
- }), (x, l) => (s(), T(a(mt), {
1455
- visible: c.value,
1456
- "onUpdate:visible": l[1] || (l[1] = (I) => c.value = I),
1457
- loading: !1,
1458
- "body-class": "AppMessagebodyClass",
1459
- "mask-closable": !1,
1460
- footer: !1,
1461
- width: a(et),
1462
- title: "系统反馈",
1463
- "hide-title": !1,
1464
- onCancel: C
1465
- }, {
1466
- default: f(() => [c.value ? (s(), o("div", es, [k("div", ts, [d(gt, {
1467
- "selected-keys": S.value,
1468
- "onUpdate:selectedKeys": l[0] || (l[0] = (I) => S.value = I),
1469
- menus: B.value,
1470
- onChange: E
1471
- }, null, 8, ["selected-keys", "menus"])]), _.value === "FeedbackList" ? (s(), T(Qa, {
1472
- key: v.value
1473
- })) : R("", !0), _.value === "CreateFeedback" ? (s(), o("div", as, [(s(), T(Ya, {
1474
- key: p.value,
1475
- onConfirm: A
1476
- }))])) : R("", !0)])) : R("", !0)]),
1477
- _: 1
1478
- }, 8, ["visible", "width"]));
1479
- }
1480
- });
1481
- export {
1482
- Zt as B,
1483
- Da as F,
1484
- Pe as R,
1485
- he as V,
1486
- Qa as _,
1487
- ia as a,
1488
- Ya as b,
1489
- Us as c,
1490
- xs as u
1491
- };