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