@huyooo/ui 0.15.1 → 0.16.0

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 (42) hide show
  1. package/dist/{AuthkitAppSetting-Ds7mYFV5.js → AuthkitAppSetting-v80fEiq0.js} +1 -1
  2. package/dist/{AuthkitGithubBinding-LVDS1PNQ.js → AuthkitGithubBinding-CVhCM6AX.js} +1 -1
  3. package/dist/{FeedbackItem-DkvSQT33.js → FeedbackItem-BP-SiJ2u.js} +98 -184
  4. package/dist/FeedbackModal.vue_vue_type_script_setup_true_lang-CAGBbiZD.js +1396 -0
  5. package/dist/{MessageHandle-CEQtGyVZ.js → MessageHandle-BMhGWVHD.js} +54 -54
  6. package/dist/{MessageNoticeNotificationsDetails.vue_vue_type_script_setup_true_lang-87v_RIQa.js → MessageNoticeNotificationsDetails.vue_vue_type_script_setup_true_lang-ByB_YaVb.js} +1 -1
  7. package/dist/{PricingPlans-ClKLdoVv.js → PricingPlans-DXea7rl0.js} +76 -77
  8. package/dist/{Upload.vue_vue_type_script_setup_true_lang-DLKSHzxG.js → Upload.vue_vue_type_script_setup_true_lang-CXr8D4VG.js} +1 -1
  9. package/dist/{UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-C7mV8kGe.js → UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-6xQNhFk3.js} +16 -16
  10. package/dist/{WidthContainer-DKasAIgU.js → WidthContainer-DVZQV6sM.js} +2 -2
  11. package/dist/authkit.js +2 -2
  12. package/dist/common.js +1 -1
  13. package/dist/components/Feedback/FeedbackBubbleEnd.vue.d.ts +11 -14
  14. package/dist/components/Feedback/FeedbackBubbleStart.vue.d.ts +11 -14
  15. package/dist/components/Feedback/FeedbackDetails.vue.d.ts +1 -0
  16. package/dist/components/Feedback/FeedbackForm.vue.d.ts +1 -0
  17. package/dist/components/Feedback/FeedbackMessageAttachments.vue.d.ts +15 -0
  18. package/dist/components/Feedback/FeedbackVideoPreview.vue.d.ts +33 -0
  19. package/dist/components/LandingPage/LandingPageContainer.vue.d.ts +1 -1
  20. package/dist/components/LandingPage/LandingPagePageContent.vue.d.ts +1 -1
  21. package/dist/composables/Billing/useBillingPlans.d.ts +1 -19
  22. package/dist/composables/feedbackAttachmentPolicy.d.ts +6 -0
  23. package/dist/composables/uploadFeedbackAttachment.d.ts +9 -0
  24. package/dist/composables/useFeedbackPendingAttachments.d.ts +98 -0
  25. package/dist/composables.js +2 -2
  26. package/dist/feedback.d.ts +0 -1
  27. package/dist/feedback.js +8 -9
  28. package/dist/main.js +119 -120
  29. package/dist/message.js +3 -3
  30. package/dist/pay.js +2 -2
  31. package/dist/style.css +1 -1
  32. package/dist/types/api/billing.generated.d.ts +0 -4
  33. package/dist/types/api/ones.generated.d.ts +46 -8
  34. package/dist/types/feedback.d.ts +12 -44
  35. package/dist/upload.js +2 -2
  36. package/dist/{useSubscriptionCheckout-CfFdAhTR.js → useSubscriptionCheckout-BjPiHSjA.js} +103 -104
  37. package/dist/{useUploadCos-CvG6EL5Q.js → useUploadCos-DOHnz2MP.js} +5 -3
  38. package/dist/user.js +1 -1
  39. package/dist/utils/feedbackMessage.d.ts +8 -0
  40. package/package.json +1 -1
  41. package/dist/FeedbackModal-C45pNoiw.js +0 -1050
  42. package/dist/components/Feedback/FeedbackScreenshots.vue.d.ts +0 -19
@@ -1,1050 +0,0 @@
1
- /* empty css */
2
- /* empty css */
3
- import { U as Fe } from "./index-D3Kp6R4z.js";
4
- import { defineComponent as B, computed as E, openBlock as r, createElementBlock as h, normalizeStyle as P, normalizeClass as ce, createElementVNode as z, createBlock as _, unref as a, withCtx as o, createVNode as f, createCommentVNode as $, Fragment as q, createTextVNode as S, toDisplayString as R, ref as b, onUnmounted as $e, h as te, renderList as Q, nextTick as O } from "vue";
5
- import { Space as de, Image as pe, Avatar as fe, Descriptions as Le, DescriptionsItem as H, Tag as T, Spin as Be, Button as me, Form as ze, FormItem as N, Input as Ve, Select as ae, Option as le, Textarea as qe, Message as De, Breadcrumb as Ee, BreadcrumbItem as se, Modal as Me } from "@arco-design/web-vue";
6
- import { M as Oe } from "./Menu-Cy2ZPeaz.js";
7
- /* empty css */
8
- /* empty css */
9
- /* empty css */
10
- /* empty css */
11
- import { o as V, g as Te } from "./apiClients-DT7o0IpO.js";
12
- /* empty css */
13
- /* empty css */
14
- /* empty css */
15
- import { u as je } from "./useUploadCos-CvG6EL5Q.js";
16
- import { _ as M } from "./_plugin-vue_export-helper-CHgC5LLL.js";
17
- import { M as Ae } from "./MessageList-CrCF8mU6.js";
18
- import { f as j } from "./index-D56hUMeD.js";
19
- import { Bubble as ve, Prompts as Ne, Sender as Pe } from "ant-design-x-vue";
20
- import { C as ye } from "./Clipboard-R3AURqvU.js";
21
- import { Icon as We } from "@iconify/vue";
22
- import { _ as ge, g as be, i as ke } from "./plugin-vue_export-helper-LjDO2Zua.js";
23
- const Ke = B({
24
- name: "IconExclamationCircle",
25
- props: {
26
- size: {
27
- type: [Number, String]
28
- },
29
- strokeWidth: {
30
- type: Number,
31
- default: 4
32
- },
33
- strokeLinecap: {
34
- type: String,
35
- default: "butt",
36
- validator: (e) => ["butt", "round", "square"].includes(e)
37
- },
38
- strokeLinejoin: {
39
- type: String,
40
- default: "miter",
41
- validator: (e) => ["arcs", "bevel", "miter", "miter-clip", "round"].includes(e)
42
- },
43
- rotate: Number,
44
- spin: Boolean
45
- },
46
- emits: {
47
- click: (e) => !0
48
- },
49
- setup(e, {
50
- emit: t
51
- }) {
52
- const l = be("icon"), n = E(() => [l, `${l}-exclamation-circle`, {
53
- [`${l}-spin`]: e.spin
54
- }]), s = E(() => {
55
- const i = {};
56
- return e.size && (i.fontSize = ke(e.size) ? `${e.size}px` : e.size), e.rotate && (i.transform = `rotate(${e.rotate}deg)`), i;
57
- });
58
- return {
59
- cls: n,
60
- innerStyle: s,
61
- onClick: (i) => {
62
- t("click", i);
63
- }
64
- };
65
- }
66
- }), He = ["stroke-width", "stroke-linecap", "stroke-linejoin"];
67
- function Ze(e, t, l, n, s, c) {
68
- return r(), h("svg", {
69
- viewBox: "0 0 48 48",
70
- fill: "none",
71
- xmlns: "http://www.w3.org/2000/svg",
72
- stroke: "currentColor",
73
- class: ce(e.cls),
74
- style: P(e.innerStyle),
75
- "stroke-width": e.strokeWidth,
76
- "stroke-linecap": e.strokeLinecap,
77
- "stroke-linejoin": e.strokeLinejoin,
78
- onClick: t[0] || (t[0] = (...i) => e.onClick && e.onClick(...i))
79
- }, t[1] || (t[1] = [z("path", {
80
- d: "M24 28V14m0 16v4M6 24c0-9.941 8.059-18 18-18s18 8.059 18 18-8.059 18-18 18S6 33.941 6 24Z"
81
- }, null, -1)]), 14, He);
82
- }
83
- var Z = /* @__PURE__ */ ge(Ke, [["render", Ze]]);
84
- const ne = Object.assign(Z, {
85
- install: (e, t) => {
86
- var l;
87
- const n = (l = t == null ? void 0 : t.iconPrefix) != null ? l : "";
88
- e.component(n + Z.name, Z);
89
- }
90
- }), Ge = B({
91
- name: "IconLink",
92
- props: {
93
- size: {
94
- type: [Number, String]
95
- },
96
- strokeWidth: {
97
- type: Number,
98
- default: 4
99
- },
100
- strokeLinecap: {
101
- type: String,
102
- default: "butt",
103
- validator: (e) => ["butt", "round", "square"].includes(e)
104
- },
105
- strokeLinejoin: {
106
- type: String,
107
- default: "miter",
108
- validator: (e) => ["arcs", "bevel", "miter", "miter-clip", "round"].includes(e)
109
- },
110
- rotate: Number,
111
- spin: Boolean
112
- },
113
- emits: {
114
- click: (e) => !0
115
- },
116
- setup(e, {
117
- emit: t
118
- }) {
119
- const l = be("icon"), n = E(() => [l, `${l}-link`, {
120
- [`${l}-spin`]: e.spin
121
- }]), s = E(() => {
122
- const i = {};
123
- return e.size && (i.fontSize = ke(e.size) ? `${e.size}px` : e.size), e.rotate && (i.transform = `rotate(${e.rotate}deg)`), i;
124
- });
125
- return {
126
- cls: n,
127
- innerStyle: s,
128
- onClick: (i) => {
129
- t("click", i);
130
- }
131
- };
132
- }
133
- }), Je = ["stroke-width", "stroke-linecap", "stroke-linejoin"];
134
- function Qe(e, t, l, n, s, c) {
135
- return r(), h("svg", {
136
- viewBox: "0 0 48 48",
137
- fill: "none",
138
- xmlns: "http://www.w3.org/2000/svg",
139
- stroke: "currentColor",
140
- class: ce(e.cls),
141
- style: P(e.innerStyle),
142
- "stroke-width": e.strokeWidth,
143
- "stroke-linecap": e.strokeLinecap,
144
- "stroke-linejoin": e.strokeLinejoin,
145
- onClick: t[0] || (t[0] = (...i) => e.onClick && e.onClick(...i))
146
- }, t[1] || (t[1] = [z("path", {
147
- 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"
148
- }, null, -1)]), 14, Je);
149
- }
150
- var G = /* @__PURE__ */ ge(Ge, [["render", Qe]]);
151
- const Xe = Object.assign(G, {
152
- install: (e, t) => {
153
- var l;
154
- const n = (l = t == null ? void 0 : t.iconPrefix) != null ? l : "";
155
- e.component(n + G.name, G);
156
- }
157
- }), Ye = /* @__PURE__ */ B({
158
- __name: "FeedbackRefresh",
159
- setup(e) {
160
- return (t, l) => (r(), _(a(We), {
161
- class: "icon",
162
- icon: "mingcute:refresh-2-line"
163
- }));
164
- }
165
- }), et = /* @__PURE__ */ M(Ye, [["__scopeId", "data-v-64bb6fc2"]]), tt = ["src"], at = {
166
- key: 1
167
- }, lt = /* @__PURE__ */ B({
168
- __name: "FeedbackBubbleEnd",
169
- props: {
170
- value: {
171
- type: String,
172
- required: !1,
173
- default: ""
174
- },
175
- type: {
176
- type: String,
177
- default: "text",
178
- validator: (e) => ["text", "image"].includes(e)
179
- },
180
- avatarUrl: {
181
- type: String,
182
- default: ""
183
- },
184
- avatarText: {
185
- type: String,
186
- default: "U"
187
- },
188
- bubbleStyle: {
189
- type: Object,
190
- default: () => ({
191
- paddingLeft: "52px"
192
- })
193
- },
194
- showRefresh: {
195
- type: Boolean,
196
- default: !1
197
- },
198
- showClipboard: {
199
- type: Boolean,
200
- default: !1
201
- }
202
- },
203
- emits: ["refresh"],
204
- setup(e, {
205
- emit: t
206
- }) {
207
- const l = e, n = t;
208
- function s(m) {
209
- return m.startsWith("http://") || m.startsWith("https://") || m.startsWith("data:");
210
- }
211
- const c = E(() => {
212
- const m = l.avatarUrl.trim();
213
- return s(m) ? m : "";
214
- });
215
- function i() {
216
- n("refresh");
217
- }
218
- return (m, v) => (r(), _(a(ve), {
219
- placement: "end",
220
- style: P(l.bubbleStyle),
221
- styles: {
222
- content: {
223
- padding: l.type === "image" ? "0px" : void 0
224
- }
225
- }
226
- }, {
227
- avatar: o(() => [f(a(fe), null, {
228
- default: o(() => [c.value ? (r(), h("img", {
229
- key: 0,
230
- alt: "avatar",
231
- src: c.value
232
- }, null, 8, tt)) : (r(), h("span", at, R(l.avatarText), 1))]),
233
- _: 1
234
- })]),
235
- message: o(() => [l.type === "text" ? (r(), h(q, {
236
- key: 0
237
- }, [S(R(l.value), 1)], 64)) : l.type === "image" ? (r(), _(a(pe), {
238
- key: 1,
239
- width: "100",
240
- src: l.value,
241
- "show-loader": ""
242
- }, null, 8, ["src"])) : $("", !0)]),
243
- footer: o(() => [f(a(de), null, {
244
- default: o(() => [l.showClipboard && l.type === "text" ? (r(), _(ye, {
245
- key: 0,
246
- value: e.value
247
- }, null, 8, ["value"])) : $("", !0), l.showRefresh ? (r(), _(et, {
248
- key: 1,
249
- onClick: i
250
- })) : $("", !0)]),
251
- _: 1
252
- })]),
253
- _: 1
254
- }, 8, ["style", "styles"]));
255
- }
256
- }), re = /* @__PURE__ */ M(lt, [["__scopeId", "data-v-f21e82f8"]]), st = ["src"], nt = {
257
- key: 1
258
- }, rt = /* @__PURE__ */ B({
259
- __name: "FeedbackBubbleStart",
260
- props: {
261
- value: {
262
- type: String,
263
- required: !1,
264
- default: ""
265
- },
266
- type: {
267
- type: String,
268
- default: "text",
269
- validator: (e) => ["text", "image"].includes(e)
270
- },
271
- avatarUrl: {
272
- type: String,
273
- default: ""
274
- },
275
- avatarText: {
276
- type: String,
277
- default: "U"
278
- },
279
- bubbleStyle: {
280
- type: Object,
281
- default: () => ({
282
- paddingRight: "52px"
283
- })
284
- },
285
- showClipboard: {
286
- type: Boolean,
287
- default: !1
288
- }
289
- },
290
- setup(e) {
291
- const t = e;
292
- function l(s) {
293
- return s.startsWith("http://") || s.startsWith("https://") || s.startsWith("data:");
294
- }
295
- const n = E(() => {
296
- const s = t.avatarUrl.trim();
297
- return l(s) ? s : "";
298
- });
299
- return (s, c) => (r(), _(a(ve), {
300
- placement: "start",
301
- style: P(t.bubbleStyle),
302
- styles: {
303
- content: {
304
- padding: t.type === "image" ? "0px" : void 0
305
- }
306
- }
307
- }, {
308
- avatar: o(() => [f(a(fe), null, {
309
- default: o(() => [n.value ? (r(), h("img", {
310
- key: 0,
311
- alt: "avatar",
312
- src: n.value
313
- }, null, 8, st)) : (r(), h("span", nt, R(t.avatarText), 1))]),
314
- _: 1
315
- })]),
316
- message: o(() => [t.type === "text" ? (r(), h(q, {
317
- key: 0
318
- }, [S(R(t.value), 1)], 64)) : t.type === "image" ? (r(), _(a(pe), {
319
- key: 1,
320
- width: "100",
321
- src: t.value,
322
- "show-loader": ""
323
- }, null, 8, ["src"])) : $("", !0)]),
324
- footer: o(() => [f(a(de), null, {
325
- default: o(() => [t.showClipboard && t.type === "text" ? (r(), _(ye, {
326
- key: 0,
327
- value: t.value
328
- }, null, 8, ["value"])) : $("", !0)]),
329
- _: 1
330
- })]),
331
- _: 1
332
- }, 8, ["style", "styles"]));
333
- }
334
- }), oe = /* @__PURE__ */ M(rt, [["__scopeId", "data-v-edaf59de"]]), C = [];
335
- for (let e = 0; e < 256; ++e)
336
- C.push((e + 256).toString(16).slice(1));
337
- function ot(e, t = 0) {
338
- return (C[e[t + 0]] + C[e[t + 1]] + C[e[t + 2]] + C[e[t + 3]] + "-" + C[e[t + 4]] + C[e[t + 5]] + "-" + C[e[t + 6]] + C[e[t + 7]] + "-" + C[e[t + 8]] + C[e[t + 9]] + "-" + C[e[t + 10]] + C[e[t + 11]] + C[e[t + 12]] + C[e[t + 13]] + C[e[t + 14]] + C[e[t + 15]]).toLowerCase();
339
- }
340
- let J;
341
- const it = new Uint8Array(16);
342
- function ut() {
343
- if (!J) {
344
- if (typeof crypto > "u" || !crypto.getRandomValues)
345
- throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
346
- J = crypto.getRandomValues.bind(crypto);
347
- }
348
- return J(it);
349
- }
350
- const ct = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), ie = {
351
- randomUUID: ct
352
- };
353
- function ue(e, t, l) {
354
- var s;
355
- if (ie.randomUUID && !e)
356
- return ie.randomUUID();
357
- e = e || {};
358
- const n = e.random ?? ((s = e.rng) == null ? void 0 : s.call(e)) ?? ut();
359
- if (n.length < 16)
360
- throw new Error("Random bytes length must be >= 16");
361
- return n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128, ot(n);
362
- }
363
- function dt(e, t = {}) {
364
- const {
365
- interval: l = 2e3,
366
- immediate: n = !1,
367
- autoStart: s = !1
368
- } = t, c = b(!1);
369
- let i = null;
370
- async function m() {
371
- try {
372
- await e();
373
- } catch (F) {
374
- console.error("轮询回调执行失败:", F);
375
- }
376
- }
377
- function v() {
378
- if (c.value) {
379
- console.warn("轮询已在运行中");
380
- return;
381
- }
382
- c.value = !0, n && m(), i = setInterval(m, l);
383
- }
384
- function p() {
385
- i && (clearInterval(i), i = null), c.value = !1;
386
- }
387
- function U() {
388
- p(), v();
389
- }
390
- return s && v(), $e(() => {
391
- p();
392
- }), {
393
- isPolling: c,
394
- start: v,
395
- stop: p,
396
- restart: U
397
- };
398
- }
399
- const X = [{
400
- key: "bugReports",
401
- label: "问题报告"
402
- }, {
403
- key: "featureSuggestions",
404
- label: "功能建议"
405
- }, {
406
- key: "technicalSupportRequests",
407
- label: "技术支持请求"
408
- }, {
409
- key: "generalOpinions",
410
- label: "一般意见"
411
- }], _e = [{
412
- key: "urgent",
413
- label: "紧急"
414
- }, {
415
- key: "high",
416
- label: "高"
417
- }, {
418
- key: "normal",
419
- label: "普通"
420
- }, {
421
- key: "low",
422
- label: "低"
423
- }], he = [{
424
- key: "newFeedback",
425
- label: "新反馈"
426
- }, {
427
- key: "inProgress",
428
- label: "处理中"
429
- }, {
430
- key: "pending",
431
- label: "待处理"
432
- }, {
433
- key: "resolved",
434
- label: "已解决"
435
- }, {
436
- key: "closed",
437
- label: "已关闭"
438
- }], pt = {
439
- class: "FeedBackDetails"
440
- }, ft = {
441
- class: "content"
442
- }, mt = {
443
- key: 1,
444
- class: "Bubbles"
445
- }, vt = {
446
- class: "sender-container"
447
- }, yt = /* @__PURE__ */ B({
448
- __name: "FeedbackDetails",
449
- props: {
450
- id: {
451
- type: String,
452
- required: !0,
453
- default: () => ""
454
- },
455
- senderRole: {
456
- type: String,
457
- required: !0,
458
- validator: (e) => ["user", "support"].includes(e)
459
- }
460
- },
461
- setup(e) {
462
- const t = {
463
- color: "var(--huyooo-accent-primary)"
464
- };
465
- function l(u) {
466
- return u === "inProgress" ? "orangered" : u === "pending" ? "gold" : u === "resolved" ? "green" : u === "closed" ? "gray" : "arcoblue";
467
- }
468
- const n = b(""), s = b(!1), c = [{
469
- key: "1",
470
- label: "如何补充更多信息",
471
- description: "请详细描述您的问题或需求,以便我们更好地为您服务。",
472
- disabled: !0,
473
- icon: te(ne, {
474
- style: t
475
- })
476
- }, {
477
- key: "3",
478
- label: "如何补充附件",
479
- description: "如有相关附件(如日志、截图等),请一并上传以便加快处理速度。",
480
- disabled: !0,
481
- icon: te(ne, {
482
- style: t
483
- })
484
- }], i = b(null), m = b(null), v = () => {
485
- var u;
486
- (u = i.value) == null || u.focus({
487
- cursor: "end"
488
- }), O(() => {
489
- m.value && (m.value.scrollTop = m.value.scrollHeight);
490
- });
491
- }, p = e;
492
- function U() {
493
- }
494
- const F = b(!1), w = b([]), x = b(void 0);
495
- function y(u) {
496
- var g;
497
- return String(((g = u.senderInfo) == null ? void 0 : g.avatarUrl) || "");
498
- }
499
- function I(u) {
500
- var d;
501
- const g = String(((d = u.senderInfo) == null ? void 0 : d.nickname) || "").trim();
502
- return g ? g.slice(0, 1).toUpperCase() : u.senderRole === "support" ? "S" : "U";
503
- }
504
- const k = b({
505
- id: void 0,
506
- title: "",
507
- description: "",
508
- type: "bugReports",
509
- status: "newFeedback",
510
- reply: "",
511
- createAt: ""
512
- }), L = () => {
513
- const {
514
- uploadFile: u
515
- } = je(), g = document.createElement("input");
516
- g.type = "file", g.accept = "image/*", g.style.display = "none", document.body.append(g), g.addEventListener("change", async (d) => {
517
- var ee;
518
- const Y = (ee = d.target.files) == null ? void 0 : ee[0];
519
- if (Y) {
520
- s.value = !0;
521
- try {
522
- u({
523
- bucketId: Te.feedbackBucketId,
524
- file: Y,
525
- onFileFinish(Ie, Ut, Re) {
526
- const K = {
527
- messageId: ue(),
528
- senderRole: p.senderRole,
529
- type: "image",
530
- key: Re.Key
531
- }, Ue = {
532
- id: p.id,
533
- message: {
534
- type: K.type,
535
- key: K.key,
536
- senderRole: K.senderRole
537
- }
538
- };
539
- (async () => {
540
- const {
541
- data: A
542
- } = await V.feedbackCenter.update.messages.post(Ue);
543
- A ? (w.value.push(A.message), typeof A.message.seq == "number" && (x.value = A.message.seq), O(() => {
544
- v();
545
- }), s.value = !1, p.senderRole === "support" && k.value.status === "newFeedback" && W()) : s.value = !1;
546
- })();
547
- },
548
- onError(Ie) {
549
- s.value = !1;
550
- }
551
- });
552
- } catch {
553
- s.value = !1;
554
- }
555
- }
556
- g.remove();
557
- }), g.click();
558
- };
559
- async function Ce(u) {
560
- s.value = !0, ue();
561
- const g = {
562
- senderRole: p.senderRole,
563
- type: "text",
564
- content: u
565
- }, d = {
566
- id: p.id,
567
- message: {
568
- type: g.type,
569
- content: g.content,
570
- senderRole: g.senderRole
571
- }
572
- }, {
573
- data: D
574
- } = await V.feedbackCenter.update.messages.post(d);
575
- s.value = !1, D && (w.value.push(D.message), typeof D.message.seq == "number" && (x.value = D.message.seq), O(() => {
576
- v();
577
- }), n.value = "", p.senderRole === "support" && k.value.status === "newFeedback" && W());
578
- }
579
- function we() {
580
- Ce(n.value);
581
- }
582
- async function W() {
583
- F.value = !0;
584
- const {
585
- data: u
586
- } = await V.feedbackCenter.findOne.post({
587
- id: p.id
588
- });
589
- F.value = !1, u && (k.value = u, u.messages && u.messages.length > 0 && (w.value = u.messages, x.value = u.messages.at(-1).seq));
590
- }
591
- async function Se() {
592
- const {
593
- data: u
594
- } = await V.messages.list.incremental.post({
595
- id: p.id,
596
- lastSeq: x.value
597
- });
598
- u && u.messages && u.messages.length > 0 && (w.value.push(...u.messages), x.value = u.messages.at(-1).seq, O(() => {
599
- v();
600
- }));
601
- }
602
- async function xe() {
603
- F.value = !0;
604
- const {
605
- data: u
606
- } = await V.messages.list.post({
607
- id: p.id
608
- });
609
- F.value = !1, u && u.messages && u.messages.length > 0 && (w.value.push(...u.messages), x.value = u.messages.at(-1).seq, O(() => {
610
- v();
611
- }));
612
- }
613
- return dt(Se, {
614
- interval: 2e3,
615
- autoStart: !0
616
- }), W(), xe(), (u, g) => (r(), h("div", pt, [z("div", {
617
- ref_key: "scrollableContentRef",
618
- ref: m,
619
- class: "scrollable-content"
620
- }, [f(a(Le), {
621
- title: "基本信息"
622
- }, {
623
- title: o(() => [...g[1] || (g[1] = [z("div", {
624
- class: "title"
625
- }, "基本信息", -1)])]),
626
- default: o(() => [f(a(H), {
627
- label: "标题:",
628
- span: 3
629
- }, {
630
- default: o(() => [S(R(k.value.title), 1)]),
631
- _: 1
632
- }), f(a(H), {
633
- label: "反馈类型:",
634
- span: 1
635
- }, {
636
- default: o(() => [f(a(T), {
637
- color: "arcoblue"
638
- }, {
639
- default: o(() => {
640
- var d;
641
- return [S(R((d = a(j)(a(X), k.value.type)) == null ? void 0 : d.label), 1)];
642
- }),
643
- _: 1
644
- })]),
645
- _: 1
646
- }), f(a(H), {
647
- label: "状态:",
648
- span: 1
649
- }, {
650
- default: o(() => [f(a(T), {
651
- color: l(k.value.status)
652
- }, {
653
- default: o(() => {
654
- var d;
655
- return [S(R((d = a(j)(a(he), k.value.status)) == null ? void 0 : d.label), 1)];
656
- }),
657
- _: 1
658
- }, 8, ["color"])]),
659
- _: 1
660
- })]),
661
- _: 1
662
- }), z("div", ft, [g[2] || (g[2] = z("div", {
663
- class: "title"
664
- }, "沟通记录", -1)), f(a(Be), {
665
- class: "messageContent",
666
- loading: F.value
667
- }, {
668
- default: o(() => [w.value.length == 0 ? (r(), _(a(Ne), {
669
- key: 0,
670
- title: "☕️ 温馨提示!",
671
- items: c,
672
- wrap: "",
673
- vertical: !1,
674
- onOnItemClick: U
675
- })) : (r(), h("div", mt, [(r(!0), h(q, null, Q(w.value, (d, D) => (r(), h(q, {
676
- key: D
677
- }, [d.type === "text" ? (r(), h(q, {
678
- key: 0
679
- }, [d.senderRole !== p.senderRole ? (r(), _(oe, {
680
- key: 0,
681
- value: d.content,
682
- type: d.type,
683
- "avatar-url": y(d),
684
- "avatar-text": I(d)
685
- }, null, 8, ["value", "type", "avatar-url", "avatar-text"])) : (r(), _(re, {
686
- key: 1,
687
- value: d.content,
688
- "avatar-url": y(d),
689
- "avatar-text": I(d),
690
- type: d.type
691
- }, null, 8, ["value", "avatar-url", "avatar-text", "type"]))], 64)) : (r(), h(q, {
692
- key: 1
693
- }, [d.senderRole !== p.senderRole ? (r(), _(oe, {
694
- key: 0,
695
- type: d.type,
696
- value: d.url,
697
- "avatar-url": y(d),
698
- "avatar-text": I(d)
699
- }, null, 8, ["type", "value", "avatar-url", "avatar-text"])) : (r(), _(re, {
700
- key: 1,
701
- type: d.type,
702
- value: d.url,
703
- "avatar-url": y(d),
704
- "avatar-text": I(d)
705
- }, null, 8, ["type", "value", "avatar-url", "avatar-text"]))], 64))], 64))), 128))]))]),
706
- _: 1
707
- }, 8, ["loading"])])], 512), z("div", vt, [f(a(Pe), {
708
- ref_key: "senderRef",
709
- ref: i,
710
- value: n.value,
711
- "onUpdate:value": g[0] || (g[0] = (d) => n.value = d),
712
- placeholder: "请输入你要咨询的问题?",
713
- loading: s.value,
714
- "allow-speech": !1,
715
- "read-only": s.value,
716
- onSubmit: we
717
- }, {
718
- prefix: o(() => [f(a(me), {
719
- type: "text",
720
- class: "IconLink",
721
- onClick: L
722
- }, {
723
- icon: o(() => [f(a(Xe))]),
724
- _: 1
725
- })]),
726
- _: 1
727
- }, 8, ["value", "loading", "read-only"])])]));
728
- }
729
- }), gt = /* @__PURE__ */ M(yt, [["__scopeId", "data-v-e7eb30bd"]]), bt = {
730
- class: "FeedBackFrom"
731
- }, kt = /* @__PURE__ */ B({
732
- __name: "FeedbackForm",
733
- emits: ["confirm"],
734
- setup(e, {
735
- emit: t
736
- }) {
737
- const l = t, n = b(), s = b(!1), c = b({
738
- id: void 0,
739
- title: "",
740
- type: "bugReports",
741
- priority: "normal",
742
- description: "",
743
- screenshots: []
744
- });
745
- b([]);
746
- async function i() {
747
- if (!await n.value.validate()) {
748
- s.value = !0;
749
- const {
750
- error: v
751
- } = await V.feedbackCenter.create.post({
752
- title: c.value.title,
753
- type: c.value.type,
754
- priority: c.value.priority,
755
- description: c.value.description
756
- // screenshots 字段暂不支持,后续可能需要通过消息发送
757
- });
758
- s.value = !1, v || (De.success("新建反馈成功"), l("confirm"));
759
- }
760
- }
761
- return (m, v) => (r(), h("div", bt, [f(a(ze), {
762
- ref_key: "formRef",
763
- ref: n,
764
- model: c.value,
765
- "auto-label-width": "",
766
- layout: "vertical"
767
- }, {
768
- default: o(() => [f(a(N), {
769
- field: "title",
770
- label: "标题",
771
- rules: [{
772
- required: !0,
773
- message: "请输入标题"
774
- }]
775
- }, {
776
- default: o(() => [f(a(Ve), {
777
- modelValue: c.value.title,
778
- "onUpdate:modelValue": v[0] || (v[0] = (p) => c.value.title = p),
779
- placeholder: "请输入标题"
780
- }, null, 8, ["modelValue"])]),
781
- _: 1
782
- }), f(a(N), {
783
- field: "type",
784
- label: "反馈类型",
785
- rules: [{
786
- required: !0,
787
- message: "请选择反馈类型"
788
- }]
789
- }, {
790
- default: o(() => [f(a(ae), {
791
- modelValue: c.value.type,
792
- "onUpdate:modelValue": v[1] || (v[1] = (p) => c.value.type = p),
793
- placeholder: "请选择反馈类型"
794
- }, {
795
- default: o(() => [(r(!0), h(q, null, Q(a(X), (p, U) => (r(), _(a(le), {
796
- key: U,
797
- value: p.key
798
- }, {
799
- default: o(() => [S(R(p.label), 1)]),
800
- _: 2
801
- }, 1032, ["value"]))), 128))]),
802
- _: 1
803
- }, 8, ["modelValue"])]),
804
- _: 1
805
- }), f(a(N), {
806
- field: "priority",
807
- label: "优先级",
808
- rules: [{
809
- required: !0,
810
- message: "请选择优先级"
811
- }]
812
- }, {
813
- default: o(() => [f(a(ae), {
814
- modelValue: c.value.priority,
815
- "onUpdate:modelValue": v[2] || (v[2] = (p) => c.value.priority = p),
816
- placeholder: "请选择优先级"
817
- }, {
818
- default: o(() => [(r(!0), h(q, null, Q(a(_e), (p, U) => (r(), _(a(le), {
819
- key: U,
820
- value: p.key
821
- }, {
822
- default: o(() => [S(R(p.label), 1)]),
823
- _: 2
824
- }, 1032, ["value"]))), 128))]),
825
- _: 1
826
- }, 8, ["modelValue"])]),
827
- _: 1
828
- }), f(a(N), {
829
- field: "description",
830
- label: "问题描述",
831
- rules: [{
832
- required: !0,
833
- message: "请输入问题描述"
834
- }]
835
- }, {
836
- default: o(() => [f(a(qe), {
837
- modelValue: c.value.description,
838
- "onUpdate:modelValue": v[3] || (v[3] = (p) => c.value.description = p),
839
- placeholder: "请输入问题描述",
840
- "allow-clear": "",
841
- "auto-size": {
842
- minRows: 5
843
- }
844
- }, null, 8, ["modelValue"])]),
845
- _: 1
846
- }), $("", !0), f(a(me), {
847
- loading: s.value,
848
- type: "primary",
849
- onClick: i
850
- }, {
851
- default: o(() => [...v[4] || (v[4] = [S(" 提交 ", -1)])]),
852
- _: 1
853
- }, 8, ["loading"])]),
854
- _: 1
855
- }, 8, ["model"])]));
856
- }
857
- }), _t = /* @__PURE__ */ M(kt, [["__scopeId", "data-v-bb436f35"]]), ht = {
858
- class: "message-panel"
859
- }, Ct = /* @__PURE__ */ B({
860
- __name: "FeedbackList",
861
- emits: ["toDetail"],
862
- setup(e, {
863
- emit: t
864
- }) {
865
- const l = b(!0), n = b([]), s = b(!1), c = b(!1), i = b(""), m = b({
866
- total: 0,
867
- current: 1,
868
- pageSize: 10
869
- });
870
- function v() {
871
- l.value = !0;
872
- }
873
- function p(y) {
874
- i.value = y.id, l.value = !1;
875
- }
876
- function U(y) {
877
- return y === "inProgress" ? "orangered" : y === "pending" ? "gold" : y === "resolved" ? "green" : y === "closed" ? "gray" : "arcoblue";
878
- }
879
- function F(y) {
880
- return y === "urgent" ? "red" : y === "high" ? "orangered" : y === "low" ? "gray" : "blue";
881
- }
882
- async function w() {
883
- s.value = !0;
884
- const {
885
- data: y
886
- } = await V.feedbackCenter.own.post({
887
- current: m.value.current,
888
- pageSize: m.value.pageSize
889
- });
890
- if (s.value = !1, y) {
891
- const I = y, k = I.items || [];
892
- n.value = k, m.value.total = I.count || 0, c.value = k.length < m.value.pageSize;
893
- }
894
- }
895
- async function x() {
896
- if (s.value || c.value) return;
897
- m.value.current += 1, s.value = !0;
898
- const {
899
- data: y
900
- } = await V.feedbackCenter.own.post({
901
- current: m.value.current,
902
- pageSize: m.value.pageSize
903
- });
904
- if (s.value = !1, y) {
905
- const k = y.items || [];
906
- n.value = [...n.value, ...k], c.value = k.length < m.value.pageSize;
907
- }
908
- }
909
- return w(), (y, I) => (r(), h("div", ht, [l.value ? $("", !0) : (r(), _(a(Ee), {
910
- key: 0,
911
- class: "message-panel__breadcrumb"
912
- }, {
913
- default: o(() => [f(a(se), {
914
- onClick: v
915
- }, {
916
- default: o(() => [...I[0] || (I[0] = [S("我的反馈", -1)])]),
917
- _: 1
918
- }), f(a(se), null, {
919
- default: o(() => [...I[1] || (I[1] = [S("反馈详情", -1)])]),
920
- _: 1
921
- })]),
922
- _: 1
923
- })), l.value ? (r(), _(Ae, {
924
- key: 1,
925
- "message-list": n.value,
926
- loading: s.value,
927
- finished: c.value,
928
- "show-view-button": !1,
929
- onItemClick: p,
930
- onLoadMore: x
931
- }, {
932
- tags: o(({
933
- item: k
934
- }) => [f(a(T), {
935
- color: "arcoblue",
936
- size: "small"
937
- }, {
938
- default: o(() => {
939
- var L;
940
- return [S(R((L = a(j)(a(X), k.type)) == null ? void 0 : L.label), 1)];
941
- }),
942
- _: 2
943
- }, 1024), f(a(T), {
944
- color: F(k.priority),
945
- size: "small"
946
- }, {
947
- default: o(() => {
948
- var L;
949
- return [S(R(((L = a(j)(a(_e), k.priority)) == null ? void 0 : L.label) || "普通"), 1)];
950
- }),
951
- _: 2
952
- }, 1032, ["color"]), f(a(T), {
953
- color: U(k.status),
954
- size: "small"
955
- }, {
956
- default: o(() => {
957
- var L;
958
- return [S(R((L = a(j)(a(he), k.status)) == null ? void 0 : L.label), 1)];
959
- }),
960
- _: 2
961
- }, 1032, ["color"])]),
962
- description: o(({
963
- item: k
964
- }) => [S(R(k.description || "暂无描述"), 1)]),
965
- _: 1
966
- }, 8, ["message-list", "loading", "finished"])) : (r(), _(gt, {
967
- key: 2,
968
- id: i.value,
969
- "sender-role": "user"
970
- }, null, 8, ["id"]))]));
971
- }
972
- }), wt = /* @__PURE__ */ M(Ct, [["__scopeId", "data-v-71d4ad7f"]]), St = {
973
- key: 0,
974
- class: "content"
975
- }, xt = {
976
- class: "left"
977
- }, It = {
978
- key: 1,
979
- class: "right"
980
- }, Rt = /* @__PURE__ */ B({
981
- __name: "FeedbackModal",
982
- emits: ["confirm", "cancel"],
983
- setup(e, {
984
- expose: t,
985
- emit: l
986
- }) {
987
- const n = b(!1), s = l;
988
- function c() {
989
- s("cancel");
990
- }
991
- const i = b(["FeedbackList"]), m = b([{
992
- name: "我的反馈",
993
- path: "FeedbackList",
994
- meta: {
995
- icon: "mingcute:cube-3d-fill"
996
- }
997
- }, {
998
- name: "新建反馈",
999
- path: "CreateFeedback",
1000
- meta: {
1001
- icon: "mingcute:cube-3d-fill"
1002
- }
1003
- }]), v = E(() => i.value.length !== 0 ? i.value[0] : "");
1004
- function p() {
1005
- i.value = ["FeedbackList"];
1006
- }
1007
- function U(w) {
1008
- i.value = [w.path];
1009
- }
1010
- function F(w) {
1011
- n.value = w;
1012
- }
1013
- return t({
1014
- setData: F
1015
- }), (w, x) => (r(), _(a(Me), {
1016
- visible: n.value,
1017
- "onUpdate:visible": x[1] || (x[1] = (y) => n.value = y),
1018
- loading: !1,
1019
- "body-class": "AppMessagebodyClass",
1020
- "mask-closable": !1,
1021
- footer: !1,
1022
- width: a(Fe),
1023
- title: "用户反馈",
1024
- "hide-title": !1,
1025
- onCancel: c
1026
- }, {
1027
- default: o(() => [n.value ? (r(), h("div", St, [z("div", xt, [f(Oe, {
1028
- "selected-keys": i.value,
1029
- "onUpdate:selectedKeys": x[0] || (x[0] = (y) => i.value = y),
1030
- menus: m.value,
1031
- onChange: U
1032
- }, null, 8, ["selected-keys", "menus"])]), v.value === "FeedbackList" ? (r(), _(wt, {
1033
- key: 0
1034
- })) : $("", !0), v.value === "CreateFeedback" ? (r(), h("div", It, [v.value === "CreateFeedback" ? (r(), _(_t, {
1035
- key: 0,
1036
- onConfirm: p
1037
- })) : $("", !0)])) : $("", !0)])) : $("", !0)]),
1038
- _: 1
1039
- }, 8, ["visible", "width"]));
1040
- }
1041
- }), Xt = /* @__PURE__ */ M(Rt, [["__scopeId", "data-v-2a74b1d4"]]);
1042
- export {
1043
- re as B,
1044
- gt as F,
1045
- et as R,
1046
- oe as a,
1047
- _t as b,
1048
- wt as c,
1049
- Xt as d
1050
- };