@qynpm/ui 1.0.29 → 1.0.33

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 (154) hide show
  1. package/README.md +93 -7
  2. package/dist/index.cjs +7 -5
  3. package/dist/index.mjs +70 -61
  4. package/dist/qy-action-bar/index.cjs +1 -1
  5. package/dist/qy-action-bar/index.mjs +1 -1
  6. package/dist/qy-button/index.cjs +1 -1
  7. package/dist/qy-button/index.mjs +1 -1
  8. package/dist/qy-checkbox/index.cjs +1 -1
  9. package/dist/qy-checkbox/index.mjs +1 -1
  10. package/dist/qy-checkbox-group/index.cjs +1 -1
  11. package/dist/qy-checkbox-group/index.mjs +1 -1
  12. package/dist/qy-dialog/index.cjs +1 -1
  13. package/dist/qy-dialog/index.mjs +1 -1
  14. package/dist/qy-drawer/index.cjs +1 -0
  15. package/dist/qy-drawer/index.mjs +5 -0
  16. package/dist/qy-dropdown/index.cjs +1 -1
  17. package/dist/qy-dropdown/index.mjs +1 -1
  18. package/dist/qy-file-picker/index.cjs +1 -1
  19. package/dist/qy-file-picker/index.mjs +1 -1
  20. package/dist/qy-form-section/index.cjs +1 -1
  21. package/dist/qy-form-section/index.mjs +1 -1
  22. package/dist/qy-fullscreen/index.cjs +1 -1
  23. package/dist/qy-fullscreen/index.mjs +1 -1
  24. package/dist/qy-icon-picker/index.cjs +1 -1
  25. package/dist/qy-icon-picker/index.mjs +1 -1
  26. package/dist/qy-image/index.cjs +1 -1
  27. package/dist/qy-image/index.mjs +1 -1
  28. package/dist/qy-image-upload/index.cjs +1 -1
  29. package/dist/qy-image-upload/index.mjs +1 -1
  30. package/dist/qy-input/index.cjs +1 -1
  31. package/dist/qy-input/index.mjs +1 -1
  32. package/dist/qy-input-number/index.cjs +1 -1
  33. package/dist/qy-input-number/index.mjs +1 -1
  34. package/dist/qy-legacy-selection-dialog/index.cjs +1 -1
  35. package/dist/qy-legacy-selection-dialog/index.mjs +1 -1
  36. package/dist/qy-loading/index.cjs +1 -0
  37. package/dist/qy-loading/index.mjs +9 -0
  38. package/dist/qy-menu-actions/index.cjs +1 -1
  39. package/dist/qy-menu-actions/index.mjs +1 -1
  40. package/dist/qy-money-input/index.cjs +1 -1
  41. package/dist/qy-money-input/index.mjs +1 -1
  42. package/dist/qy-radio/index.cjs +1 -1
  43. package/dist/qy-radio/index.mjs +1 -1
  44. package/dist/qy-radio-group/index.cjs +1 -1
  45. package/dist/qy-radio-group/index.mjs +1 -1
  46. package/dist/qy-record-quote-search/index.cjs +1 -1
  47. package/dist/qy-record-quote-search/index.mjs +1 -1
  48. package/dist/qy-remark-image/index.cjs +1 -1
  49. package/dist/qy-remark-image/index.mjs +1 -1
  50. package/dist/qy-remote-select/index.cjs +1 -1
  51. package/dist/qy-remote-select/index.mjs +1 -1
  52. package/dist/qy-result/index.cjs +1 -0
  53. package/dist/qy-result/index.mjs +7 -0
  54. package/dist/qy-scrollbar/index.cjs +1 -1
  55. package/dist/qy-scrollbar/index.mjs +1 -1
  56. package/dist/qy-search-input/index.cjs +1 -1
  57. package/dist/qy-search-input/index.mjs +1 -1
  58. package/dist/qy-select/index.cjs +1 -1
  59. package/dist/qy-select/index.mjs +1 -1
  60. package/dist/qy-selection-dialog/index.cjs +1 -1
  61. package/dist/qy-selection-dialog/index.mjs +1 -1
  62. package/dist/qy-switch/index.cjs +1 -1
  63. package/dist/qy-switch/index.mjs +1 -1
  64. package/dist/qy-table-column-settings/index.cjs +1 -1
  65. package/dist/qy-table-column-settings/index.mjs +1 -1
  66. package/dist/qy-tag/index.cjs +1 -1
  67. package/dist/qy-tag/index.mjs +1 -1
  68. package/dist/qy-tree/index.cjs +1 -1
  69. package/dist/qy-tree/index.mjs +1 -1
  70. package/dist/qy-tree-select/index.cjs +1 -1
  71. package/dist/qy-tree-select/index.mjs +1 -1
  72. package/dist/qy-upload/index.cjs +1 -1
  73. package/dist/qy-upload/index.mjs +1 -1
  74. package/dist/shared/{index-C7V-LeFg.mjs → index-1LT6Q6XJ.mjs} +1 -1
  75. package/dist/shared/{index-DHJf8Zto.mjs → index-B0zL9hEY.mjs} +1 -1
  76. package/dist/shared/index-B1zDCCqy.mjs +78 -0
  77. package/dist/shared/{index-B9RYNZUh.cjs → index-BWDaV6FO.cjs} +1 -1
  78. package/dist/shared/{index-Czrv5jUt.mjs → index-BmJPEXUM.mjs} +1 -1
  79. package/dist/shared/{index-DJT4yz0h.mjs → index-CaDqecpT.mjs} +8 -8
  80. package/dist/shared/{index-BNQxyXzB.cjs → index-D-YyFaZ6.cjs} +1 -1
  81. package/dist/shared/{index-DjyaOKUS.cjs → index-D5DmmUX2.cjs} +1 -1
  82. package/dist/shared/{index-C509sCx9.cjs → index-DqsG1Mam.cjs} +1 -1
  83. package/dist/shared/index-Dvf1zJ7h.cjs +1 -0
  84. package/dist/shared/index-gcsw_rtX.mjs +3529 -0
  85. package/dist/shared/index-uhxRj2ZT.cjs +1 -0
  86. package/dist/shared/index.vue_vue_type_script_setup_true_lang-BLF3RNlY.mjs +331 -0
  87. package/dist/shared/{index.vue_vue_type_script_setup_true_lang-DXtovY1E.mjs → index.vue_vue_type_script_setup_true_lang-C91DUwOD.mjs} +1 -1
  88. package/dist/shared/{index.vue_vue_type_script_setup_true_lang-DXGjuA2f.cjs → index.vue_vue_type_script_setup_true_lang-CuXBYNXZ.cjs} +1 -1
  89. package/dist/shared/{index.vue_vue_type_script_setup_true_lang-CUox3Lm-.mjs → index.vue_vue_type_script_setup_true_lang-DP-jqqo2.mjs} +1 -1
  90. package/dist/shared/{index.vue_vue_type_script_setup_true_lang-kje3Rtlw.cjs → index.vue_vue_type_script_setup_true_lang-DkDEcB4G.cjs} +1 -1
  91. package/dist/shared/index.vue_vue_type_script_setup_true_lang-S6QPMZay.cjs +1 -0
  92. package/dist/shared/{index.vue_vue_type_style_index_0_lang-BTqKOZ4L.cjs → index.vue_vue_type_style_index_0_lang-CL_IFx-Z.cjs} +1 -1
  93. package/dist/shared/index.vue_vue_type_style_index_0_lang-CUqnwExG.mjs +80 -0
  94. package/dist/shared/{index.vue_vue_type_style_index_0_lang-Bc-Ya_zS.mjs → index.vue_vue_type_style_index_0_lang-DXQ9l1XF.mjs} +1 -1
  95. package/dist/shared/index.vue_vue_type_style_index_0_lang-lmRmXLwB.cjs +1 -0
  96. package/index.d.ts +39 -1
  97. package/package.json +459 -440
  98. package/qy-alert/index.d.ts +64 -64
  99. package/qy-autocomplete/index.d.ts +5 -5
  100. package/qy-avatar/index.d.ts +67 -67
  101. package/qy-badge/index.d.ts +63 -63
  102. package/qy-card/index.d.ts +64 -64
  103. package/qy-cascader/index.d.ts +198 -198
  104. package/qy-collapse/index.d.ts +59 -59
  105. package/qy-collapse-item/index.d.ts +45 -45
  106. package/qy-descriptions/index.d.ts +47 -47
  107. package/qy-descriptions-item/index.d.ts +46 -46
  108. package/qy-dialog/index.d.ts +60 -2
  109. package/qy-divider/index.d.ts +53 -53
  110. package/qy-drawer/index.d.ts +55 -0
  111. package/qy-empty/index.d.ts +51 -51
  112. package/qy-image/index.d.ts +28 -28
  113. package/qy-image-preview/index.d.ts +20 -20
  114. package/qy-link/index.d.ts +69 -69
  115. package/qy-loading/index.d.ts +25 -0
  116. package/qy-menu-actions/index.d.ts +29 -29
  117. package/qy-progress/index.d.ts +74 -74
  118. package/qy-result/index.d.ts +64 -0
  119. package/qy-scrollbar/index.d.ts +85 -85
  120. package/qy-skeleton/index.d.ts +54 -54
  121. package/qy-skeleton-item/index.d.ts +48 -48
  122. package/qy-step/index.d.ts +55 -55
  123. package/qy-steps/index.d.ts +62 -62
  124. package/qy-tab-pane/index.d.ts +40 -40
  125. package/qy-table-column-settings/index.d.ts +18 -18
  126. package/qy-tabs/index.d.ts +84 -84
  127. package/qy-tree/index.d.ts +132 -132
  128. package/qy-tree-select/index.d.ts +123 -123
  129. package/dist/shared/index-BQj_q6rA.mjs +0 -3446
  130. package/dist/shared/index-qwzyfx9S.cjs +0 -1
  131. /package/dist/shared/{index-D7A0RzWH.cjs → index-BDdhBEFr.cjs} +0 -0
  132. /package/dist/shared/{index-PlyLRNmb.cjs → index-Bmw9BNXm.cjs} +0 -0
  133. /package/dist/shared/{index-UGOgNLvm.cjs → index-BpI0jwYK.cjs} +0 -0
  134. /package/dist/shared/{index-C2n0R6rA.mjs → index-Bs2OQHXk.mjs} +0 -0
  135. /package/dist/shared/{index-DA3GVIZY.cjs → index-BxvS3vlc.cjs} +0 -0
  136. /package/dist/shared/{index-DMiZy6gD.cjs → index-Bxz4crCd.cjs} +0 -0
  137. /package/dist/shared/{index-YsBzyp9n.mjs → index-C-ZAw_DP.mjs} +0 -0
  138. /package/dist/shared/{index-CUITnlPr.mjs → index-C31wpivi.mjs} +0 -0
  139. /package/dist/shared/{index-BqV6vW9P.cjs → index-CCZttbsg.cjs} +0 -0
  140. /package/dist/shared/{index-mTWXYnLm.mjs → index-CmRclPWX.mjs} +0 -0
  141. /package/dist/shared/{index-DvA3Wy_F.mjs → index-Co0_4YEV.mjs} +0 -0
  142. /package/dist/shared/{index-YM4DcbBZ.cjs → index-CwzztWPU.cjs} +0 -0
  143. /package/dist/shared/{index-WP9Dbscv.mjs → index-D6ybNdgn.mjs} +0 -0
  144. /package/dist/shared/{index-CtF8Nz3g.mjs → index-DEZF-Fkt.mjs} +0 -0
  145. /package/dist/shared/{index-D30m6gKz.cjs → index-DIs6iPjF.cjs} +0 -0
  146. /package/dist/shared/{index-Bs6yjkZ5.cjs → index-DLLDXfic.cjs} +0 -0
  147. /package/dist/shared/{index-BSxEaYHx.mjs → index-D_rRdrge.mjs} +0 -0
  148. /package/dist/shared/{index-CR6yQfR2.mjs → index-DfR8Z9MN.mjs} +0 -0
  149. /package/dist/shared/{index-4cLP6sJP.cjs → index-rcu9CzSn.cjs} +0 -0
  150. /package/dist/shared/{index-D0L-u1nt.mjs → index-seQHtqdh.mjs} +0 -0
  151. /package/dist/shared/{index.vue_vue_type_style_index_0_lang-CJaF7Ecm.mjs → index.vue_vue_type_style_index_0_lang-B-FeHatv.mjs} +0 -0
  152. /package/dist/shared/{index.vue_vue_type_style_index_0_lang-CqKs13Fp.cjs → index.vue_vue_type_style_index_0_lang-Cn3P9d4L.cjs} +0 -0
  153. /package/dist/shared/{index.vue_vue_type_style_index_0_lang-CC2-igG3.cjs → index.vue_vue_type_style_index_0_lang-DOfJV2oz.cjs} +0 -0
  154. /package/dist/shared/{index.vue_vue_type_style_index_0_lang-Dc84vYSd.mjs → index.vue_vue_type_style_index_0_lang-DzfGx6ce.mjs} +0 -0
@@ -1,3446 +0,0 @@
1
- import { ElUpload as Fa, ElIcon as ct, ElPopover as Pa, ElInput as Da, ElImageViewer as Ma, ElDialog as dt, ElLoadingDirective as Oa } from "element-plus/es";
2
- import { ref as q, onMounted as Xe, computed as F, watch as fe, nextTick as Oe, onBeforeUnmount as ft, openBlock as v, createElementBlock as A, normalizeStyle as Pe, normalizeClass as ke, createVNode as O, withCtx as h, withModifiers as ue, unref as $, Fragment as Re, createElementVNode as z, toDisplayString as pe, createCommentVNode as P, createBlock as ce, createTextVNode as be, useAttrs as Be, mergeProps as Qe, defineComponent as qe, useSlots as mt, useModel as _a, watchEffect as Ua, h as nt, onUnmounted as yt, createSlots as _e, renderSlot as R, withDirectives as Ye, vShow as pt, mergeModels as it, renderList as et, withKeys as Ee, normalizeProps as gt, guardReactiveProps as vt, getCurrentInstance as La, reactive as Ze } from "vue";
3
- import { Plus as Ka, InfoFilled as Ea, Close as ja } from "@element-plus/icons-vue";
4
- import { ElMessage as he, ElLoading as Na, ElButton as Ve, ElSelect as ht, ElOption as bt, ElInput as Me, ElPopover as Ha, ElUpload as Za, ElAutocomplete as Wa, ElForm as wt, ElFormItem as Ie, ElTable as Ga, ElTableColumn as Ja, ElPagination as Xa, ElTreeSelect as Ya } from "element-plus";
5
- import { _ as Te } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
6
- import { I as eo } from "./index-DJT4yz0h.mjs";
7
- import { _ as to } from "./index.vue_vue_type_script_setup_true_lang-DoL8xnpo.mjs";
8
- import ao from "clsx";
9
- import { useBreakpoints as oo, useDraggable as lo } from "@vueuse/core";
10
- import { B as no } from "./index-D0L-u1nt.mjs";
11
- import { D as io } from "./index-CtF8Nz3g.mjs";
12
- import { _ as ro } from "./index-C2n0R6rA.mjs";
13
- import { _ as so } from "./index.vue_vue_type_style_index_0_lang-B0CXLnL1.mjs";
14
- import { _ as uo } from "./index.vue_vue_type_style_index_0_lang-CcVf5MXE.mjs";
15
- import { C as co } from "./index-WP9Dbscv.mjs";
16
- import { _ as fo } from "./index.vue_vue_type_script_setup_true_lang-DXtovY1E.mjs";
17
- import { R as mo } from "./index-CUITnlPr.mjs";
18
- import { _ as yo } from "./index.vue_vue_type_script_setup_true_lang-EiHoQBXt.mjs";
19
- import { M as po } from "./index-CR6yQfR2.mjs";
20
- import { T as go } from "./index-C7V-LeFg.mjs";
21
- import { _ as vo } from "./index.vue_vue_type_script_setup_true_lang-CUox3Lm-.mjs";
22
- import { S as tt } from "./index-BSxEaYHx.mjs";
23
- import { T as St } from "./index-DHJf8Zto.mjs";
24
- import { T as We } from "./index-DvA3Wy_F.mjs";
25
- import { F as ho } from "./index-mTWXYnLm.mjs";
26
- import { S as bo } from "./index-YsBzyp9n.mjs";
27
- import { _ as wo } from "./index.vue_vue_type_script_lang-DIKHRo0o.mjs";
28
- import { _ as So } from "./index.vue_vue_type_style_index_0_lang-CPxbKjvY.mjs";
29
- import { _ as ko } from "./index.vue_vue_type_style_index_0_lang-DSur831A.mjs";
30
- import { _ as xo } from "./index.vue_vue_type_style_index_0_lang-BJXS2dVf.mjs";
31
- import { _ as Qo } from "./index.vue_vue_type_script_setup_true_lang-BJe7Uo6S.mjs";
32
- import { _ as $o } from "./index.vue_vue_type_script_setup_true_lang-Dd_nKJvH.mjs";
33
- import { _ as Co } from "./index.vue_vue_type_style_index_0_lang-gs0YJI91.mjs";
34
- import { _ as Vo } from "./index.vue_vue_type_script_lang-Dfq7D3mJ.mjs";
35
- import { _ as qo } from "./index.vue_vue_type_script_lang-CZK0hDYa.mjs";
36
- import { _ as Bo } from "./index.vue_vue_type_script_lang-69zSOotQ.mjs";
37
- import { F as Ao } from "./index-Czrv5jUt.mjs";
38
- import { Q as kt } from "./index-xuTVtF4x.mjs";
39
- import { _ as Io } from "./index.vue_vue_type_style_index_0_lang-Bc-Ya_zS.mjs";
40
- import { _ as To } from "./index.vue_vue_type_script_lang-Bk0kLg5l.mjs";
41
- import { _ as zo } from "./index.vue_vue_type_script_lang-BaIOvoQn.mjs";
42
- import { _ as Ro } from "./index.vue_vue_type_script_lang-DRvk4-_O.mjs";
43
- import { _ as Fo } from "./index.vue_vue_type_script_lang-ChS-3_vl.mjs";
44
- import { _ as Po } from "./index.vue_vue_type_script_lang-CWnNQBPN.mjs";
45
- import { _ as Do } from "./index.vue_vue_type_script_lang-D7b9ABei.mjs";
46
- import { _ as Mo } from "./index.vue_vue_type_script_lang-chBiq2cG.mjs";
47
- import { _ as Oo } from "./index.vue_vue_type_style_index_0_lang-DWiolYb3.mjs";
48
- import { _ as _o } from "./index.vue_vue_type_script_setup_true_lang-Bdz9oDDW.mjs";
49
- import { _ as Uo } from "./index.vue_vue_type_script_setup_true_lang-BXnZt9UT.mjs";
50
- import { _ as Lo } from "./index.vue_vue_type_script_setup_true_lang-B4JrNUDc.mjs";
51
- import { _ as Ko } from "./index.vue_vue_type_script_lang-D7nzeBUR.mjs";
52
- import { _ as Eo } from "./index.vue_vue_type_script_lang-C9X0V5AK.mjs";
53
- import { _ as jo } from "./index.vue_vue_type_script_lang-C4JHCuXz.mjs";
54
- import { _ as No } from "./index.vue_vue_type_style_index_0_lang-CJaF7Ecm.mjs";
55
- import { _ as Ho } from "./index.vue_vue_type_script_lang-BGAdXWIL.mjs";
56
- import { _ as Zo } from "./index.vue_vue_type_script_lang-BnmY1ndj.mjs";
57
- import { _ as Wo } from "./index.vue_vue_type_script_lang-DOOT2grg.mjs";
58
- import { _ as Go } from "./index.vue_vue_type_style_index_0_lang-Dc84vYSd.mjs";
59
- import { w as S } from "./install-CxBnxbuN.mjs";
60
- import { o as Jo } from "./utils-DUntDntI.mjs";
61
- /*! js-cookie v3.0.8 | MIT */
62
- function Ke(t) {
63
- for (var D = 1; D < arguments.length; D++) {
64
- var W = arguments[D];
65
- for (var e in W)
66
- e !== "__proto__" && (t[e] = W[e]);
67
- }
68
- return t;
69
- }
70
- var Xo = {
71
- read: function(t) {
72
- return t[0] === '"' && (t = t.slice(1, -1)), t.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
73
- },
74
- write: function(t) {
75
- return encodeURIComponent(t).replace(
76
- /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,
77
- decodeURIComponent
78
- );
79
- }
80
- };
81
- function Ge(t, D) {
82
- function W(n, H, d) {
83
- if (!(typeof document > "u")) {
84
- d = Ke({}, D, d), typeof d.expires == "number" && (d.expires = new Date(Date.now() + d.expires * 864e5)), d.expires && (d.expires = d.expires.toUTCString()), n = encodeURIComponent(n).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
85
- var y = "";
86
- for (var f in d)
87
- d[f] && (y += "; " + f, d[f] !== !0 && (y += "=" + d[f].split(";")[0]));
88
- return document.cookie = n + "=" + t.write(H, n) + y;
89
- }
90
- }
91
- function e(n) {
92
- if (!(typeof document > "u" || arguments.length && !n)) {
93
- for (var H = document.cookie ? document.cookie.split("; ") : [], d = {}, y = 0; y < H.length; y++) {
94
- var f = H[y].split("="), I = f.slice(1).join("=");
95
- try {
96
- var Q = decodeURIComponent(f[0]);
97
- if (Q in d || (d[Q] = t.read(I, Q)), n === Q)
98
- break;
99
- } catch {
100
- }
101
- }
102
- return n ? d[n] : d;
103
- }
104
- }
105
- return Object.create(
106
- {
107
- set: W,
108
- get: e,
109
- remove: function(n, H) {
110
- W(
111
- n,
112
- "",
113
- Ke({}, H, {
114
- expires: -1
115
- })
116
- );
117
- },
118
- withAttributes: function(n) {
119
- return Ge(this.converter, Ke({}, this.attributes, n));
120
- },
121
- withConverter: function(n) {
122
- return Ge(Ke({}, this.converter, n), this.attributes);
123
- }
124
- },
125
- {
126
- attributes: { value: Object.freeze(D) },
127
- converter: { value: Object.freeze(t) }
128
- }
129
- );
130
- }
131
- var xt = Ge(Xo, { path: "/" });
132
- const Yo = "Admin-Token";
133
- function el(t = Yo) {
134
- return xt.get(t);
135
- }
136
- const tl = { class: "qy-upload__hint" }, al = ["placeholder", "disabled"], ol = ["src"], ll = {
137
- key: 1,
138
- class: "qy-upload__tip"
139
- }, nl = { class: "error" }, il = { class: "error" }, rl = /* @__PURE__ */ Object.assign({
140
- name: "QyUpload"
141
- }, {
142
- __name: "index",
143
- props: {
144
- /**
145
- * 受控值。valueFormat 为 object 时结构为 { files, text },
146
- * array 时为 string[],string 时为逗号分隔 URL。
147
- */
148
- modelValue: { type: [Object, Array, String], default: void 0 },
149
- /**
150
- * 初始值,结构为 { files: '逗号分隔的URL', text: '文字内容' }
151
- * 非受控模式,仅初始化时读取一次
152
- */
153
- defaultValue: { type: Object, default: () => ({ files: "", text: "" }) },
154
- /** v-model 输出格式:object | array | string */
155
- valueFormat: { type: String, default: "object" },
156
- /** 是否显示底部文字备注区 */
157
- showText: { type: Boolean, default: !0 },
158
- /** 是否显示纯粘贴输入条,不保存文字,仅用于承接 Ctrl+V 图片 */
159
- showPasteInput: { type: Boolean, default: !1 },
160
- /** 文字区占位文案,也用于凭证上传的粘贴提示 */
161
- pastePlaceholder: { type: String, default: "输入文字" },
162
- /** 是否多选 */
163
- multiple: { type: Boolean, default: !0 },
164
- /** 是否禁用 */
165
- disabled: { type: Boolean, default: !1 },
166
- /** 允许的文件类型后缀(如 ['jpg', 'mp4']) */
167
- fileType: { type: Array, default: () => [] },
168
- /** 单个文件大小限制(MB) */
169
- fileSize: { type: Number, default: 10 },
170
- /** 文件数量限制 */
171
- limit: { type: Number, default: 9 },
172
- /** 是否显示格式/大小提示 */
173
- isShowTip: { type: Boolean, default: !1 },
174
- /** 接口路径 */
175
- api: { type: String, default: "/permission-api/common/uploads" },
176
- /** FormData 中文件字段名 */
177
- name: { type: String, default: "file" },
178
- /** token 读取 key,对应 utils/auth 中的存储字段 */
179
- tokenKey: { type: String, default: "Admin-Token" },
180
- /** 是否支持视频模式(强制 limit=1) */
181
- supportVideo: { type: Boolean, default: !1 },
182
- /**
183
- * 卡片尺寸
184
- * 预设:'large'(160px) | 'default'(140px) | 'small'(80px)
185
- * 自定义:任意 CSS 单位,如 '60px'、'8vw'
186
- */
187
- size: { type: String, default: "default" },
188
- /** 禁用拖拽(默认在触发区开启) */
189
- disableDrag: { type: Boolean, default: !1 },
190
- /** 成功回调(用于复杂业务联动) */
191
- callBack: { type: Function, default: null },
192
- /** 上传时附加的额外 FormData 字段 */
193
- extraData: { type: Object, default: () => ({}) },
194
- /** 自定义上传请求,用于接入宿主项目 request / 鉴权 / baseURL。 */
195
- uploadRequest: { type: Function, default: null }
196
- },
197
- emits: [
198
- "update:modelValue",
199
- "change",
200
- "success",
201
- "error",
202
- "remove"
203
- ],
204
- setup(t, { expose: D, emit: W }) {
205
- const e = t, n = W, H = q(null), d = q([]), y = q(null), f = q(null), I = [];
206
- let Q = !1;
207
- const _ = q(!1), E = q([]), M = q(0), j = q(!1), G = q(""), T = q(""), U = /* @__PURE__ */ new Set(), ae = q(!1), J = q(""), X = q(!1);
208
- Xe(() => {
209
- e.modelValue === void 0 && p(e.defaultValue);
210
- });
211
- const le = F(() => ({ large: "160px", default: "140px", small: "80px" })[e.size] ?? e.size), ne = F(() => e.disabled), ie = F(
212
- () => {
213
- var o;
214
- return e.isShowTip && (e.fileSize || ((o = Z.value) == null ? void 0 : o.length));
215
- }
216
- ), Z = F(() => {
217
- var o;
218
- return (o = e.fileType) != null && o.length ? e.fileType.map((r) => r.toLowerCase()) : e.supportVideo ? ["mp4", "mov", "avi"] : ["jpg", "jpeg", "png", "gif", "webp"];
219
- }), b = F(() => {
220
- const o = e.supportVideo ? 1 : e.limit;
221
- return d.value.length >= o;
222
- }), V = F(
223
- () => Z.value.map((o) => `.${o}`).join(",")
224
- ), a = F(() => ({
225
- "qy-upload--reached-limit": b.value,
226
- "qy-upload--disabled": e.disabled,
227
- "qy-upload--video": e.supportVideo,
228
- "qy-upload--without-text": !e.showText && !e.showPasteInput
229
- }));
230
- fe(J, () => {
231
- Q || re();
232
- }), fe(
233
- () => e.modelValue,
234
- (o) => {
235
- o !== void 0 && p(o);
236
- },
237
- { immediate: !0, deep: !0 }
238
- );
239
- function l(o) {
240
- return Array.isArray(o) ? o.filter(Boolean) : o ? String(o).split(",").filter(Boolean) : [];
241
- }
242
- function L(o) {
243
- return Array.isArray(o) ? { files: o, text: "" } : typeof o == "string" ? { files: l(o), text: "" } : o && typeof o == "object" ? {
244
- files: l(o.files),
245
- text: o.text ?? ""
246
- } : { files: [], text: "" };
247
- }
248
- function te(o = []) {
249
- return o.map((r, k) => ({
250
- name: String(r).split("/").pop() || `file-${k}`,
251
- url: r,
252
- status: "success",
253
- uid: Date.now() + k
254
- }));
255
- }
256
- function s(o) {
257
- const r = new Set(o.map((x) => x.url)), k = d.value.filter(
258
- (x) => x.status === "uploading" && !r.has(x.url)
259
- );
260
- return [...o, ...k];
261
- }
262
- function p(o) {
263
- const r = L(o);
264
- Q = !0, J.value = r.text, d.value = s(te(r.files)), Oe(() => {
265
- Q = !1;
266
- });
267
- }
268
- function C(o) {
269
- return e.valueFormat === "array" ? o.files : e.valueFormat === "string" ? o.files.join(",") : o;
270
- }
271
- function g() {
272
- var o;
273
- (o = y.value) == null || o.focus();
274
- }
275
- function B(o) {
276
- o.target.value = "";
277
- }
278
- function re(o) {
279
- const x = { files: (o ?? d.value).filter((K) => K.status === "success" && K.url).map((K) => K.url), text: J.value };
280
- n("update:modelValue", C(x)), n("change", x), e.callBack && e.callBack(x);
281
- }
282
- function me(o, r) {
283
- re(r), n("remove", o, r);
284
- }
285
- function we(o) {
286
- var k;
287
- const r = (o == null ? void 0 : o.name) || "";
288
- return r.includes(".") && ((k = r.split(".").pop()) == null ? void 0 : k.toLowerCase()) || "";
289
- }
290
- function xe(o) {
291
- var K, oe, se;
292
- const r = ((oe = (K = o == null ? void 0 : o.type) == null ? void 0 : K.toLowerCase) == null ? void 0 : oe.call(K)) || "", k = {
293
- "image/jpeg": ["jpg", "jpeg"],
294
- "image/png": ["png"],
295
- "image/gif": ["gif"],
296
- "image/bmp": ["bmp"],
297
- "image/webp": ["webp"],
298
- "video/mp4": ["mp4"],
299
- "video/quicktime": ["mov"],
300
- "video/x-msvideo": ["avi"],
301
- "video/webm": ["webm"]
302
- };
303
- if (k[r]) return k[r];
304
- const x = (se = r.split("/")[1]) == null ? void 0 : se.split("+")[0];
305
- return x ? [x] : [];
306
- }
307
- function m(o) {
308
- const r = we(o), k = xe(o);
309
- return [r, ...k].some(
310
- (x) => Z.value.includes(x)
311
- );
312
- }
313
- function Y(o) {
314
- return o.size / 1024 / 1024 < e.fileSize ? m(o) ? !0 : (he.warning(
315
- `格式不支持,仅允许: ${Z.value.join("/")}`
316
- ), !1) : (he.warning(`文件大小不能超过${e.fileSize}M`), !1);
317
- }
318
- async function i(o, r, k, x) {
319
- const K = w(o);
320
- try {
321
- const oe = await e.uploadRequest({
322
- file: o,
323
- formData: K,
324
- api: e.api,
325
- name: e.name,
326
- tokenKey: e.tokenKey,
327
- extraData: e.extraData
328
- }), se = ee(oe);
329
- if (!se) {
330
- const ge = new Error("上传失败,未返回文件地址");
331
- he.error(ge.message), n("error", ge), k == null || k(ge);
332
- return;
333
- }
334
- he.success("上传成功"), r == null || r({ ...typeof oe == "object" && oe ? oe : {}, url: se });
335
- } catch (oe) {
336
- he.error("上传失败"), n("error", oe), k == null || k(oe);
337
- } finally {
338
- x.close();
339
- }
340
- }
341
- function w(o) {
342
- const r = new FormData();
343
- return r.append(e.name, o), e.extraData && Object.entries(e.extraData).forEach(([k, x]) => r.append(k, x)), r;
344
- }
345
- function ee(o) {
346
- var x, K;
347
- if (typeof o == "string") return o;
348
- const r = o || {}, k = r.urls ?? r.url ?? ((x = r.data) == null ? void 0 : x.urls) ?? ((K = r.data) == null ? void 0 : K.url) ?? "";
349
- return Array.isArray(k) ? k[0] || "" : k || "";
350
- }
351
- function Se(o, r, k, x) {
352
- var ot, lt;
353
- const K = ((ot = H.value) == null ? void 0 : ot.$el.querySelector(".el-upload--picture-card")) || ((lt = H.value) == null ? void 0 : lt.$el), oe = Na.service({
354
- target: K,
355
- text: "上传中",
356
- background: "rgba(255,255,255,0.7)"
357
- });
358
- if (e.uploadRequest) {
359
- i(o, k, x, oe);
360
- return;
361
- }
362
- const se = e.api.startsWith("http") ? e.api : window.location.origin + e.api.replace(/^([^/])/, "/$1"), ge = w(o), ve = new XMLHttpRequest();
363
- I.push(ve);
364
- const Ce = () => {
365
- const ye = I.indexOf(ve);
366
- ye !== -1 && I.splice(ye, 1), oe.close();
367
- };
368
- ve.open("POST", se);
369
- const at = el(e.tokenKey);
370
- at && ve.setRequestHeader("Authorization", `Bearer ${at}`), ve.upload.onprogress = (ye) => {
371
- ye.total > 0 && (r == null || r({ percent: ye.loaded / ye.total * 100 }));
372
- }, ve.onload = () => {
373
- if (Ce(), ve.status < 200 || ve.status >= 300) {
374
- const ye = `上传失败 (HTTP ${ve.status})`;
375
- he.error(ye), n("error", { msg: ye, status: ve.status }), x == null || x(new Error(ye));
376
- return;
377
- }
378
- try {
379
- const ye = JSON.parse(ve.responseText);
380
- ye.code === 200 && ye.urls ? (he.success("上传成功"), k == null || k({ ...ye, url: ye.urls })) : (he.error(ye.msg || "上传失败"), n("error", ye), x == null || x(ye));
381
- } catch {
382
- he.error("上传失败,响应格式错误"), n("error", new Error("Response parse error")), x == null || x(new Error("Response parse error"));
383
- }
384
- }, ve.onerror = () => {
385
- Ce(), he.error("上传失败,网络异常"), n("error", new Error("Network error")), x == null || x(new Error("Network error"));
386
- }, ve.send(ge);
387
- }
388
- function $e(o) {
389
- return e.disabled ? !1 : Y(o);
390
- }
391
- function de(o, r) {
392
- const k = d.value.find(
393
- (x) => {
394
- var K;
395
- return x.uid === (o == null ? void 0 : o.uid) || ((K = x.raw) == null ? void 0 : K.uid) === (o == null ? void 0 : o.uid);
396
- }
397
- );
398
- k && (k.url = r, k.status = "success");
399
- }
400
- function De(o) {
401
- Se(
402
- o.file,
403
- o.onProgress,
404
- (r) => {
405
- de(o.file, r.url), o.onSuccess(r), re(), n("success", r);
406
- },
407
- (r) => o.onError(r)
408
- );
409
- }
410
- function Ue(o) {
411
- var x;
412
- if (!o.url) return;
413
- const r = ((x = o.url.split(".").pop()) == null ? void 0 : x.toLowerCase()) || "";
414
- if (["mp4", "mov", "avi", "webm"].includes(r)) {
415
- G.value = o.url, T.value = o.name || "视频预览", j.value = !0;
416
- return;
417
- }
418
- const k = d.value.filter(
419
- (K) => {
420
- var oe;
421
- return K.status === "success" && K.url && !["mp4", "mov", "avi", "webm"].includes(
422
- (oe = K.url.split(".").pop()) == null ? void 0 : oe.toLowerCase()
423
- );
424
- }
425
- );
426
- E.value = k.map((K) => K.url), M.value = k.findIndex((K) => K.uid === o.uid) || 0, _.value = !0;
427
- }
428
- function Fe() {
429
- _.value = !1, E.value = [];
430
- }
431
- function je(o, r) {
432
- if (o.name && we(o)) return o;
433
- const k = xe(o).find(
434
- (x) => Z.value.includes(x)
435
- );
436
- return k ? new File([o], `paste-${Date.now() + r}.${k}`, {
437
- type: o.type,
438
- lastModified: o.lastModified
439
- }) : o;
440
- }
441
- function Le(o) {
442
- for (let r = 0; r < o.length; r++) {
443
- const k = je(o[r], r);
444
- if (!$e(k)) continue;
445
- const x = Date.now() + r, K = URL.createObjectURL(k);
446
- U.add(K), d.value.push({
447
- uid: x,
448
- name: k.name || `file-${x}`,
449
- status: "uploading",
450
- percentage: 0,
451
- url: K
452
- }), Se(
453
- k,
454
- (oe) => {
455
- const se = d.value.find((ge) => ge.uid === x);
456
- se && (se.percentage = oe.percent);
457
- },
458
- (oe) => {
459
- const se = d.value.find((ge) => ge.uid === x);
460
- se && (se.status = "success", se.url = oe.url, re(), n("success", oe));
461
- },
462
- () => N(x)
463
- );
464
- }
465
- }
466
- function Ne(o) {
467
- const r = Array.from((o == null ? void 0 : o.files) || []).filter(
468
- (oe) => {
469
- var se;
470
- return (se = oe.type) == null ? void 0 : se.startsWith("image/");
471
- }
472
- );
473
- if (r.length) return r;
474
- const k = o == null ? void 0 : o.items;
475
- if (!k) return [];
476
- const x = [], K = /* @__PURE__ */ new Set();
477
- for (let oe = 0; oe < k.length; oe++) {
478
- const se = k[oe];
479
- if (se.kind === "file" && se.type.startsWith("image/")) {
480
- const ge = se.getAsFile();
481
- ge && !K.has(ge) && (K.add(ge), x.push(ge));
482
- }
483
- }
484
- return x;
485
- }
486
- function ze(o) {
487
- if (e.disabled) return;
488
- const r = Ne(o.clipboardData);
489
- r.length && (o.preventDefault(), Le(r));
490
- }
491
- function Ae() {
492
- e.disabled || e.disableDrag || (ae.value = !0);
493
- }
494
- function u() {
495
- ae.value = !1;
496
- }
497
- function c(o) {
498
- var k;
499
- if (ae.value = !1, e.disabled || e.disableDrag || b.value) return;
500
- const r = Array.from(((k = o.dataTransfer) == null ? void 0 : k.files) || []).filter(
501
- (x) => {
502
- var K;
503
- return Z.value.includes((K = x.name.split(".").pop()) == null ? void 0 : K.toLowerCase());
504
- }
505
- );
506
- r.length && Le(r);
507
- }
508
- function N(o) {
509
- var k;
510
- const r = d.value.findIndex((x) => x.uid === o);
511
- r !== -1 && ((k = d.value[r].url) != null && k.startsWith("blob:") && (URL.revokeObjectURL(d.value[r].url), U.delete(d.value[r].url)), d.value.splice(r, 1));
512
- }
513
- return ft(() => {
514
- I.forEach((o) => o.abort()), I.length = 0, U.forEach((o) => URL.revokeObjectURL(o)), U.clear();
515
- }), D({
516
- /** 主动打开文件选择框,供表单或快捷操作调用 */
517
- openFileDialog: () => {
518
- var o, r;
519
- e.disabled || b.value || (r = (o = H.value) == null ? void 0 : o.$el.querySelector('input[type="file"]')) == null || r.click();
520
- },
521
- /** 获取已上传成功的文件 URL 列表 */
522
- getPathList: () => d.value.filter((o) => o.status === "success").map((o) => o.url),
523
- /** 清空文件和文字,并同步 change 事件 */
524
- clearFiles: () => {
525
- d.value = [], J.value = "", re();
526
- },
527
- /** 获取完整值,结构与 change 事件保持一致 */
528
- getValue: () => ({
529
- files: d.value.filter((o) => o.status === "success" && o.url).map((o) => o.url),
530
- text: J.value
531
- }),
532
- /** 获取按 valueFormat 输出的值,便于外部不走 v-model 时读取 */
533
- getModelValue: () => C({
534
- files: d.value.filter((o) => o.status === "success" && o.url).map((o) => o.url),
535
- text: J.value
536
- })
537
- }), (o, r) => {
538
- var ve;
539
- const k = ct, x = Da, K = Pa, oe = Fa, se = Ma, ge = dt;
540
- return v(), A("div", {
541
- class: ke(["qy-upload", a.value]),
542
- style: Pe({ "--qy-upload-size": le.value })
543
- }, [
544
- O(oe, {
545
- ref_key: "uploadRef",
546
- ref: H,
547
- "file-list": d.value,
548
- "onUpdate:fileList": r[6] || (r[6] = (Ce) => d.value = Ce),
549
- action: "#",
550
- multiple: t.supportVideo ? !1 : t.multiple,
551
- limit: t.supportVideo ? 1 : t.limit,
552
- "list-type": t.supportVideo ? "text" : "picture-card",
553
- accept: V.value,
554
- disabled: ne.value,
555
- "http-request": De,
556
- "before-upload": $e,
557
- "on-preview": Ue,
558
- "on-remove": me
559
- }, {
560
- default: h(() => [
561
- b.value ? P("", !0) : (v(), A("div", {
562
- key: 0,
563
- class: ke(["qy-upload__trigger", { "is-dragover": ae.value }]),
564
- onPaste: ze,
565
- onDragover: ue(Ae, ["prevent"]),
566
- onDragleave: ue(u, ["prevent"]),
567
- onDrop: ue(c, ["prevent"])
568
- }, [
569
- O(k, { class: "qy-upload__icon" }, {
570
- default: h(() => [
571
- O($(Ka))
572
- ]),
573
- _: 1
574
- }),
575
- t.supportVideo ? (v(), A(Re, { key: 0 }, [
576
- r[9] || (r[9] = z("span", { class: "qy-upload__label" }, "点击上传视频", -1)),
577
- z("span", tl, "支持 " + pe(Z.value.join(" / ")) + ",不超过 " + pe(t.fileSize) + "MB", 1)
578
- ], 64)) : P("", !0),
579
- t.showText ? (v(), A("div", {
580
- key: 1,
581
- class: "qy-upload__text",
582
- onClick: r[3] || (r[3] = ue(() => {
583
- }, ["stop"])),
584
- onPaste: ue(ze, ["stop"])
585
- }, [
586
- O(K, {
587
- visible: X.value,
588
- "onUpdate:visible": r[2] || (r[2] = (Ce) => X.value = Ce),
589
- placement: "bottom-start",
590
- width: 220,
591
- trigger: "click",
592
- "popper-class": "qy-upload__text-popover",
593
- onAfterEnter: g
594
- }, {
595
- reference: h(() => [
596
- z("div", {
597
- class: ke(["qy-upload__text-preview", { "is-placeholder": !J.value }])
598
- }, pe(J.value || t.pastePlaceholder), 3)
599
- ]),
600
- default: h(() => [
601
- O(x, {
602
- ref_key: "inputRef",
603
- ref: y,
604
- modelValue: J.value,
605
- "onUpdate:modelValue": r[0] || (r[0] = (Ce) => J.value = Ce),
606
- type: "textarea",
607
- autosize: { minRows: 2, maxRows: 5 },
608
- placeholder: t.pastePlaceholder,
609
- disabled: t.disabled,
610
- onBlur: r[1] || (r[1] = (Ce) => X.value = !1),
611
- onPaste: ue(ze, ["stop"])
612
- }, null, 8, ["modelValue", "placeholder", "disabled"])
613
- ]),
614
- _: 1
615
- }, 8, ["visible"])
616
- ], 32)) : t.showPasteInput ? (v(), A("div", {
617
- key: 2,
618
- class: "qy-upload__text",
619
- onClick: r[5] || (r[5] = ue(() => {
620
- }, ["stop"])),
621
- onPaste: ue(ze, ["stop"])
622
- }, [
623
- z("input", {
624
- ref_key: "pasteInputRef",
625
- ref: f,
626
- class: "qy-upload__paste-input",
627
- placeholder: t.pastePlaceholder,
628
- disabled: t.disabled,
629
- onPaste: ue(ze, ["stop"]),
630
- onInput: B,
631
- onClick: r[4] || (r[4] = ue(() => {
632
- }, ["stop"]))
633
- }, null, 40, al)
634
- ], 32)) : P("", !0)
635
- ], 34))
636
- ]),
637
- _: 1
638
- }, 8, ["file-list", "multiple", "limit", "list-type", "accept", "disabled"]),
639
- _.value ? (v(), ce(se, {
640
- key: 0,
641
- "url-list": E.value,
642
- "initial-index": M.value,
643
- onClose: Fe
644
- }, null, 8, ["url-list", "initial-index"])) : P("", !0),
645
- O(ge, {
646
- modelValue: j.value,
647
- "onUpdate:modelValue": r[7] || (r[7] = (Ce) => j.value = Ce),
648
- title: T.value,
649
- width: "640px",
650
- "append-to-body": "",
651
- "destroy-on-close": "",
652
- onClose: r[8] || (r[8] = (Ce) => j.value = !1)
653
- }, {
654
- default: h(() => [
655
- j.value ? (v(), A("video", {
656
- key: 0,
657
- src: G.value,
658
- controls: "",
659
- autoplay: "",
660
- style: { width: "100%", "max-height": "400px", "border-radius": "4px" }
661
- }, null, 8, ol)) : P("", !0)
662
- ]),
663
- _: 1
664
- }, 8, ["modelValue", "title"]),
665
- ie.value ? (v(), A("div", ll, [
666
- O(k, null, {
667
- default: h(() => [
668
- O($(Ea))
669
- ]),
670
- _: 1
671
- }),
672
- z("span", null, [
673
- r[12] || (r[12] = be(" 请上传 ", -1)),
674
- t.fileSize ? (v(), A(Re, { key: 0 }, [
675
- r[10] || (r[10] = be("大小不超过 ", -1)),
676
- z("b", nl, pe(t.fileSize) + "MB", 1)
677
- ], 64)) : P("", !0),
678
- (ve = Z.value) != null && ve.length ? (v(), A(Re, { key: 1 }, [
679
- r[11] || (r[11] = be(",格式为 ", -1)),
680
- z("b", il, pe(Z.value.join("/")), 1)
681
- ], 64)) : P("", !0),
682
- r[13] || (r[13] = be(" 的文件。 ", -1))
683
- ])
684
- ])) : P("", !0)
685
- ], 6);
686
- };
687
- }
688
- }), Qt = /* @__PURE__ */ Te(rl, [["__scopeId", "data-v-1e380be1"]]), sl = /* @__PURE__ */ Object.assign({
689
- name: "QyImageUpload",
690
- inheritAttrs: !1
691
- }, {
692
- __name: "index",
693
- props: {
694
- /** 单图/单文件 URL;multiple=true 时为 URL 数组。 */
695
- modelValue: { type: [String, Array], default: "" },
696
- /** 上传接口路径。 */
697
- api: { type: String, default: "/permission-api/common/uploads" },
698
- /** FormData 中文件字段名。 */
699
- name: { type: String, default: "files" },
700
- /** 是否禁用。 */
701
- disabled: { type: Boolean, default: !1 },
702
- /** 是否多选;开启后 v-model 输出 string[]。 */
703
- multiple: { type: Boolean, default: !1 },
704
- /** 上传模式。voucher 用于承接旧 CopyImgUpload 的凭证图片场景。 */
705
- mode: { type: String, default: "default" },
706
- /** 是否启用凭证图片模式。 */
707
- voucher: { type: Boolean, default: !1 },
708
- /** 允许的文件类型后缀。 */
709
- fileType: { type: Array, default: () => [] },
710
- /** 单个文件大小限制(MB)。 */
711
- fileSize: { type: Number, default: 10 },
712
- /** 是否显示格式/大小提示。 */
713
- isShowTip: { type: Boolean, default: !1 },
714
- /** 文件数量限制;不传时单图为 1,多图为 9。 */
715
- limit: { type: Number, default: void 0 },
716
- /** token 读取 key。 */
717
- tokenKey: { type: String, default: "Admin-Token" },
718
- /** 是否为视频上传。 */
719
- supportVideo: { type: Boolean, default: !1 },
720
- /** 上传卡片尺寸。 */
721
- size: { type: String, default: "128px" },
722
- /** 禁用拖拽。 */
723
- disableDrag: { type: Boolean, default: !1 },
724
- /** 是否显示纯粘贴入口。 */
725
- showPasteInput: { type: Boolean, default: !0 },
726
- /** 粘贴入口提示文案。 */
727
- pastePlaceholder: { type: String, default: "粘贴图片上传" },
728
- /** 成功回调。 */
729
- callBack: { type: Function, default: null },
730
- /** 上传时附加的额外 FormData 字段。 */
731
- extraData: { type: Object, default: () => ({}) },
732
- /** 自定义上传请求,用于接入宿主项目 request / 鉴权 / baseURL。 */
733
- uploadRequest: { type: Function, default: null }
734
- },
735
- emits: [
736
- "update:modelValue",
737
- "change",
738
- "success",
739
- "error",
740
- "remove",
741
- "updateImg"
742
- ],
743
- setup(t, { expose: D, emit: W }) {
744
- const e = t, n = W, H = Be(), d = q(null), y = ["jpg", "jpeg", "png", "gif", "bmp", "webp"], f = F(
745
- () => e.voucher || e.mode === "voucher"
746
- ), I = F(() => Array.isArray(e.modelValue) ? e.modelValue.filter(Boolean) : e.modelValue ? String(e.modelValue).split(",").filter(Boolean) : []), Q = F(() => e.supportVideo ? 1 : f.value ? e.limit ?? 30 : e.limit ?? (e.multiple ? 9 : 1)), _ = F(() => {
747
- var a;
748
- return (a = e.fileType) != null && a.length ? e.fileType : f.value && !e.supportVideo ? y : [];
749
- });
750
- function E(a) {
751
- return Array.isArray(a) ? a.filter(Boolean) : [];
752
- }
753
- function M(a) {
754
- const l = E(a);
755
- return e.multiple ? l : l[0] || "";
756
- }
757
- function j(a) {
758
- n("update:modelValue", M(a));
759
- }
760
- function G(a) {
761
- n("change", M(a == null ? void 0 : a.files));
762
- }
763
- function T(a) {
764
- var te, s;
765
- if (typeof a == "string") return a;
766
- const l = a || {}, L = l.url ?? l.urls ?? ((te = l.data) == null ? void 0 : te.url) ?? ((s = l.data) == null ? void 0 : s.urls) ?? "";
767
- return Array.isArray(L) ? L[0] || "" : L || "";
768
- }
769
- function U(a) {
770
- const l = T(a);
771
- l && n("updateImg", l), n("success", V(), a);
772
- }
773
- function ae(a) {
774
- n("error", a);
775
- }
776
- function J(a, l) {
777
- n("remove", a, l);
778
- }
779
- function X() {
780
- var a, l;
781
- (l = (a = d.value) == null ? void 0 : a.openFileDialog) == null || l.call(a);
782
- }
783
- function le() {
784
- var a, l;
785
- (l = (a = d.value) == null ? void 0 : a.clearFiles) == null || l.call(a);
786
- }
787
- function ne() {
788
- var a, l;
789
- return ((l = (a = d.value) == null ? void 0 : a.getPathList) == null ? void 0 : l.call(a)) || [];
790
- }
791
- const ie = F(() => ne()), Z = F(() => ne());
792
- function b() {
793
- return ne();
794
- }
795
- function V() {
796
- const a = ne();
797
- return e.multiple ? a : a[0] || "";
798
- }
799
- return D({
800
- openFileDialog: X,
801
- clearFiles: le,
802
- getPathList: ne,
803
- getFullPathList: b,
804
- fullPathList: ie,
805
- pathList: Z,
806
- getValue: V
807
- }), (a, l) => (v(), ce(Qt, Qe({
808
- ref_key: "uploadRef",
809
- ref: d
810
- }, $(H), {
811
- "model-value": I.value,
812
- "value-format": "array",
813
- api: t.api,
814
- name: t.name,
815
- multiple: t.multiple,
816
- disabled: t.disabled,
817
- "file-type": _.value,
818
- "file-size": t.fileSize,
819
- limit: Q.value,
820
- "is-show-tip": t.isShowTip,
821
- "token-key": t.tokenKey,
822
- "support-video": t.supportVideo,
823
- size: t.size,
824
- "disable-drag": t.disableDrag,
825
- "call-back": t.callBack,
826
- "extra-data": t.extraData,
827
- "upload-request": t.uploadRequest,
828
- "show-text": !1,
829
- "show-paste-input": t.showPasteInput,
830
- "paste-placeholder": t.pastePlaceholder,
831
- "onUpdate:modelValue": j,
832
- onChange: G,
833
- onSuccess: U,
834
- onError: ae,
835
- onRemove: J
836
- }), null, 16, ["model-value", "api", "name", "multiple", "disabled", "file-type", "file-size", "limit", "is-show-tip", "token-key", "support-video", "size", "disable-drag", "call-back", "extra-data", "upload-request", "show-paste-input", "paste-placeholder"]));
837
- }
838
- }), ul = { class: "text-lg flex items-center pt-2 pl-[var(--content-padding)]" }, cl = { key: 0 }, dl = { key: 1 }, fl = {
839
- key: 0,
840
- class: "icon-[material-symbols--square-outline-rounded]",
841
- role: "img",
842
- "aria-hidden": "true"
843
- }, ml = {
844
- key: 1,
845
- class: "icon-[tdesign--fullscreen-exit-1]",
846
- role: "img",
847
- "aria-hidden": "true"
848
- }, yl = {
849
- key: 0,
850
- class: "fixed -right-12 top-2 h-9 w-9 hover:bg-gray-600/80 transition-all"
851
- }, pl = { class: "flex justify-between h-[var(--footer-height)] px-[var(--content-padding)] items-center" }, gl = { class: "flex items-center justify-between w-full pl-1 pr-4 h-full ml-2" }, vl = { class: "flex items-center gap-2" }, hl = { class: "text-sm text-gray-700 truncate max-w-[200px]" }, bl = { class: "flex items-center gap-2" }, rt = 5, He = 2e3, Je = /* @__PURE__ */ qe({
852
- __name: "index",
853
- props: /* @__PURE__ */ it({
854
- layout: { type: [Array, String, Boolean], default: () => ["confirm", "cancel"] },
855
- fullscreen: { type: Boolean, default: !1 },
856
- showFullscreen: { type: Boolean, default: !1 },
857
- confirmProps: { default: () => ({}) },
858
- size: { default: "default" },
859
- zIndex: { default: 2e3 }
860
- }, {
861
- modelValue: { default: !0 },
862
- modelModifiers: {}
863
- }),
864
- emits: /* @__PURE__ */ it(["confirm", "cancel", "close", "opened", "ok"], ["update:modelValue"]),
865
- setup(t, { expose: D, emit: W }) {
866
- const e = t, n = mt(), H = q(!0), d = q(!1), y = q(He), f = q(null), Q = oo({
867
- mobile: 0,
868
- tablet: 640,
869
- laptop: 1024,
870
- desktop: 1280
871
- }).isSmaller("tablet"), _ = F(() => {
872
- if (Array.isArray(e.layout)) return e.layout;
873
- if (typeof e.layout == "string")
874
- return e.layout.split(",").map((g) => g.trim());
875
- }), E = F(() => ({
876
- CancelButton: O(s),
877
- ConfirmButton: O(te)
878
- })), M = F(() => n.footer || e.layout !== !1), j = q(!1), G = q(
879
- e.showFullscreen && Q ? !0 : e.fullscreen
880
- ), T = W, U = _a(t, "modelValue");
881
- Ua(() => {
882
- U.value && (j.value = !1);
883
- }), D({
884
- handleMinimize: C
885
- });
886
- const ae = Be(), J = `qy-dialog-${Math.random().toString(36).slice(2, 11)}`, X = q(!1), le = q(null);
887
- window.minimizedCount || (window.minimizedCount = 0);
888
- const { x: ne, y: ie } = lo(le, {
889
- initialValue: {
890
- x: 5,
891
- y: window.innerHeight - 100 - (window.minimizedCount || 0) * 60
892
- },
893
- onMove(g) {
894
- var B;
895
- (B = le.value) == null || B.classList.add("dragging"), document.body.classList.add("qy-dialog--dragging"), ne.value = Math.max(
896
- 0,
897
- Math.min(window.innerWidth - 300, g.x)
898
- ), ie.value = Math.max(
899
- 0,
900
- Math.min(window.innerHeight - 50, g.y)
901
- );
902
- },
903
- onEnd() {
904
- var g;
905
- (g = le.value) == null || g.classList.remove("dragging"), document.body.classList.remove("qy-dialog--dragging");
906
- }
907
- }), Z = F(() => ({
908
- transform: `translate(${ne.value}px, ${ie.value}px)`,
909
- willChange: "transform"
910
- }));
911
- function b(g) {
912
- const B = g.target, { scrollTop: re, scrollHeight: me, clientHeight: we } = B;
913
- H.value = re <= rt, d.value = me - (re + we) <= rt;
914
- }
915
- function V() {
916
- const g = document.querySelector(`.${J}.el-dialog`);
917
- g && (f.value = g, g.addEventListener("scroll", b)), p(), T("opened");
918
- }
919
- function a() {
920
- G.value = !G.value, p();
921
- }
922
- function l() {
923
- j.value || (j.value = !0, X.value = !1, U.value = !1, T("cancel"), T("close"));
924
- }
925
- function L(g) {
926
- e.showFullscreen && g.detail >= 2 && a();
927
- }
928
- function te() {
929
- return nt(
930
- Ve,
931
- {
932
- ...$(e.confirmProps),
933
- type: "primary",
934
- class: "dialog__footerBtn",
935
- onClick: () => {
936
- T("confirm"), T("ok");
937
- }
938
- },
939
- () => $(e.confirmProps).title || "确 认"
940
- );
941
- }
942
- function s() {
943
- return nt(
944
- Ve,
945
- { class: "dialog__footerBtn", onClick: () => l() },
946
- () => "取 消"
947
- );
948
- }
949
- Xe(() => {
950
- typeof window.qyDialogMaxZIndex > "u" && (window.qyDialogMaxZIndex = He), p();
951
- });
952
- function p() {
953
- var m;
954
- const g = Array.from(
955
- document.querySelectorAll(".el-overlay")
956
- ).filter((Y) => window.getComputedStyle(Y).display !== "none" && !Y.classList.contains("is-message")), B = (m = document.querySelector(`.${J}`)) == null ? void 0 : m.closest(".el-overlay"), re = document.querySelector(
957
- `.${J}.el-dialog`
958
- );
959
- if (!B || !re) return;
960
- const me = He;
961
- window.qyDialogMaxZIndex = window.qyDialogMaxZIndex || me;
962
- const xe = Math.max(
963
- window.qyDialogMaxZIndex,
964
- ...g.map(
965
- (Y) => parseInt(window.getComputedStyle(Y).zIndex || me.toString())
966
- )
967
- ) + 2;
968
- window.qyDialogMaxZIndex = xe, Oe(() => {
969
- B.style.zIndex = xe.toString(), re.style.zIndex = (xe + 1).toString(), y.value = xe + 1;
970
- });
971
- }
972
- yt(() => {
973
- var g;
974
- (g = f.value) == null || g.removeEventListener("scroll", b), X.value && window.minimizedCount--;
975
- });
976
- function C() {
977
- var B;
978
- X.value = !X.value;
979
- const g = (B = document.querySelector(`.${J}`)) == null ? void 0 : B.closest(".el-overlay");
980
- g && (X.value ? (g.style.display = "none", window.minimizedCount++, ie.value = window.innerHeight - 50 - (window.minimizedCount || 0) * 60) : (g.style.display = "block", window.minimizedCount--, p()));
981
- }
982
- return (g, B) => {
983
- const re = ct, me = dt;
984
- return v(), A("div", null, [
985
- O(me, Qe({
986
- ref: "dialogRef",
987
- class: ["qy-dialog", [
988
- e.size === "small" && "[&_.el-dialog__header]:!hidden",
989
- J
990
- ]],
991
- "model-value": U.value,
992
- "align-center": "",
993
- "append-to-body": "",
994
- style: {
995
- "--el-dialog-padding-primary": 0
996
- },
997
- "show-close": !1,
998
- fullscreen: G.value,
999
- "z-index": y.value,
1000
- onClosed: l,
1001
- onOpened: V,
1002
- draggable: ""
1003
- }, $(ae)), _e({
1004
- header: h(() => [
1005
- e.size === "default" ? (v(), A("div", {
1006
- key: 0,
1007
- style: Pe({
1008
- borderBottom: "1px solid",
1009
- borderColor: H.value ? "transparent" : "var(--block-outline-color)",
1010
- transition: "border-color .2s linear"
1011
- }),
1012
- class: "flex justify-between h-[var(--header-height)]",
1013
- onDblclick: L
1014
- }, [
1015
- z("div", ul, [
1016
- $(n).header ? $(n).header ? (v(), A("div", dl, [
1017
- R(g.$slots, "header")
1018
- ])) : P("", !0) : (v(), A("span", cl, pe($(ae).title), 1))
1019
- ]),
1020
- z("div", {
1021
- class: "flex",
1022
- onMousedown: B[3] || (B[3] = ue(() => {
1023
- }, ["stop"]))
1024
- }, [
1025
- e.size === "default" ? (v(), A("div", {
1026
- key: 0,
1027
- class: "qy-dialog__btn qy-dialog__btn--default",
1028
- onClick: ue(C, ["stop"]),
1029
- onMousedown: B[0] || (B[0] = ue(() => {
1030
- }, ["stop"]))
1031
- }, [...B[4] || (B[4] = [
1032
- z("span", {
1033
- class: "icon-[material-symbols--minimize] text-xl mb-3",
1034
- role: "img",
1035
- "aria-hidden": "true"
1036
- }, null, -1)
1037
- ])], 32)) : P("", !0),
1038
- e.showFullscreen ? (v(), A("div", {
1039
- key: 1,
1040
- class: "qy-dialog__btn qy-dialog__btn--default",
1041
- onClick: ue(a, ["stop"]),
1042
- onMousedown: B[1] || (B[1] = ue(() => {
1043
- }, ["stop"]))
1044
- }, [
1045
- G.value ? (v(), A("span", ml)) : (v(), A("span", fl))
1046
- ], 32)) : P("", !0),
1047
- z("div", {
1048
- class: "qy-dialog__btn qy-dialog__btn--danger",
1049
- onClick: ue(l, ["stop"]),
1050
- onMousedown: B[2] || (B[2] = ue(() => {
1051
- }, ["stop"]))
1052
- }, [...B[5] || (B[5] = [
1053
- z("span", {
1054
- class: "icon-[ri--close-line] text-xl",
1055
- role: "img",
1056
- "aria-hidden": "true"
1057
- }, null, -1)
1058
- ])], 32)
1059
- ], 32)
1060
- ], 36)) : P("", !0)
1061
- ]),
1062
- default: h(() => [
1063
- z("div", {
1064
- class: ke(["qy-dialog__wrapper", $(ao)(G.value && "qy-dialog__wrapper--fullscreen")]),
1065
- style: Pe({
1066
- maxHeight: M.value ? "calc(100vh - var(--header-height) - var(--footer-height) - var(--sides-gap))" : "calc(100vh - var(--header-height) - var(--sides-gap))",
1067
- padding: e.size === "small" ? "var(--small-content-padding)" : "var(--content-padding)"
1068
- })
1069
- }, [
1070
- e.size === "small" ? (v(), A("div", yl, [
1071
- O(re, {
1072
- size: 36,
1073
- class: "cursor-pointer text-gray-100 active:scale-75 rounded-sm transition-all",
1074
- onClick: l
1075
- }, {
1076
- default: h(() => [
1077
- O($(ja))
1078
- ]),
1079
- _: 1
1080
- })
1081
- ])) : P("", !0),
1082
- R(g.$slots, "default")
1083
- ], 6)
1084
- ]),
1085
- _: 2
1086
- }, [
1087
- !g.$slots.footer && Array.isArray(_.value) ? {
1088
- name: "footer",
1089
- fn: h(() => [
1090
- z("div", pl, [
1091
- z("div", null, [
1092
- R(g.$slots, "footer-left")
1093
- ]),
1094
- z("div", {
1095
- class: ke([{
1096
- "qy-dialog__footer--outline": d.value
1097
- }, "qy-dialog__footer flex items-center justify-end"])
1098
- }, [
1099
- _.value.includes("cancel") ? (v(), ce(s, { key: 0 })) : P("", !0),
1100
- _.value.includes("confirm") ? (v(), ce(te, { key: 1 })) : P("", !0),
1101
- R(g.$slots, "footer-append")
1102
- ], 2)
1103
- ])
1104
- ]),
1105
- key: "0"
1106
- } : M.value ? {
1107
- name: "footer",
1108
- fn: h(() => [
1109
- z("div", {
1110
- class: ke([{
1111
- "qy-dialog__footer--outline": d.value
1112
- }, "qy-dialog__footer px-[var(--content-padding)] min-h-[var(--footer-height)] flex items-center justify-end"])
1113
- }, [
1114
- R(g.$slots, "footer", {
1115
- layouts: E.value,
1116
- layoutsNode: Object.values(E.value)
1117
- })
1118
- ], 2)
1119
- ]),
1120
- key: "1"
1121
- } : void 0
1122
- ]), 1040, ["class", "model-value", "fullscreen", "z-index"]),
1123
- Ye(z("div", {
1124
- ref_key: "minimizedRef",
1125
- ref: le,
1126
- class: "fixed left-0 top-0 bg-white rounded shadow-lg cursor-pointer z-[9999] hover:bg-gray-50",
1127
- style: Pe([Z.value, { width: "300px", height: "50px", "will-change": "transform" }])
1128
- }, [
1129
- z("div", gl, [
1130
- z("div", vl, [
1131
- B[6] || (B[6] = z("div", { class: "icon-[mdi--window-restore] text-gray-600" }, null, -1)),
1132
- z("span", hl, pe($(ae).title), 1)
1133
- ]),
1134
- z("div", bl, [
1135
- z("div", {
1136
- class: "p-1 hover:bg-gray-200 rounded",
1137
- onClick: ue(C, ["stop"])
1138
- }, [...B[7] || (B[7] = [
1139
- z("div", { class: "icon-[mdi--window-maximize] text-gray-600" }, null, -1)
1140
- ])]),
1141
- z("div", {
1142
- class: "p-1 hover:bg-red-100 rounded",
1143
- onClick: ue(l, ["stop"])
1144
- }, [...B[8] || (B[8] = [
1145
- z("div", { class: "icon-[mdi--close] text-red-600" }, null, -1)
1146
- ])])
1147
- ])
1148
- ])
1149
- ], 4), [
1150
- [pt, X.value]
1151
- ])
1152
- ]);
1153
- };
1154
- }
1155
- });
1156
- function st(t) {
1157
- const D = t == null ? void 0 : t.match(/(\[url\:(.*?)\])(.*)/);
1158
- return D ? {
1159
- imageUrl: D[2],
1160
- text: D[3]
1161
- } : {
1162
- imageUrl: "",
1163
- text: t || ""
1164
- };
1165
- }
1166
- function wl(t) {
1167
- const D = String(t || "").match(/(\[url\:.*?\])([\s\S]*)/);
1168
- return D ? D[2] : t;
1169
- }
1170
- function ut(t, D) {
1171
- return D ? `[url:${D}]${t}` : t;
1172
- }
1173
- const Sl = { class: "qy-remark-image__field" }, kl = {
1174
- key: 1,
1175
- class: "qy-remark-image__divider"
1176
- }, xl = { class: "qy-remark-image__upload-anchor" }, Ql = {
1177
- key: 0,
1178
- class: "icon-[line-md--loading-twotone-loop]",
1179
- role: "img",
1180
- "aria-hidden": "true"
1181
- }, $l = {
1182
- key: 1,
1183
- class: "icon-[ion--cloud-upload-outline]",
1184
- role: "img",
1185
- "aria-hidden": "true"
1186
- }, Cl = {
1187
- key: 2,
1188
- class: "icon-[ph--images-thin]",
1189
- role: "img",
1190
- "aria-hidden": "true"
1191
- }, Vl = { class: "qy-remark-image__popover" }, ql = ["src"], Bl = { class: "qy-remark-image__popover-footer" }, Al = /* @__PURE__ */ qe({
1192
- __name: "index",
1193
- props: {
1194
- defaultValue: { default: "" },
1195
- defaultImage: { default: "" },
1196
- rows: { default: 6 },
1197
- width: { default: "" },
1198
- autosize: { type: [Boolean, Object], default: !1 },
1199
- disabled: { type: Boolean, default: !1 },
1200
- placeholder: { default: "粘贴图片上传" },
1201
- type: { default: "textarea" },
1202
- layout: { default: "default" },
1203
- selectValue: { type: [String, Number, Boolean], default: "" },
1204
- selectOptions: { default: () => [] },
1205
- selectDisabled: { type: Boolean, default: !1 },
1206
- api: { default: "/permission-api/common/uploads" },
1207
- tokenKey: { default: "Admin-Token" },
1208
- uploadName: { default: "files" },
1209
- uploadRequest: {}
1210
- },
1211
- emits: ["change", "update:selectValue", "select-change"],
1212
- setup(t, { expose: D, emit: W }) {
1213
- const e = t, n = W, H = Be(), d = q(null), y = q(""), f = q(""), I = q(!1), Q = F(
1214
- () => e.layout === "select-prefix"
1215
- ), _ = F(() => ({
1216
- "qy-remark-image--select-prefix": Q.value
1217
- })), E = F(
1218
- () => Q.value || e.type === "text" ? "text" : "textarea"
1219
- ), M = F(() => {
1220
- if (e.width)
1221
- return {
1222
- width: typeof e.width == "number" ? `${e.width}px` : e.width
1223
- };
1224
- });
1225
- fe(
1226
- () => e.defaultValue,
1227
- (b) => {
1228
- const V = st(b || "");
1229
- y.value = V.text, f.value = V.imageUrl || e.defaultImage || "";
1230
- },
1231
- { immediate: !0 }
1232
- ), fe(
1233
- () => e.defaultImage,
1234
- (b) => {
1235
- b !== void 0 && !st(e.defaultValue || "").imageUrl && (f.value = b || "");
1236
- },
1237
- { immediate: !0 }
1238
- ), Xe(() => {
1239
- Oe(G);
1240
- }), yt(() => {
1241
- const b = j();
1242
- b && b.removeEventListener("paste", X);
1243
- });
1244
- function j() {
1245
- var b, V;
1246
- return ((b = d.value) == null ? void 0 : b.textarea) || ((V = d.value) == null ? void 0 : V.input) || null;
1247
- }
1248
- function G() {
1249
- const b = j();
1250
- b && (b.removeEventListener("paste", X), b.addEventListener("paste", X));
1251
- }
1252
- function T(b) {
1253
- y.value = wl(b || "");
1254
- }
1255
- function U(b) {
1256
- n("update:selectValue", b), n("select-change", b);
1257
- }
1258
- function ae() {
1259
- f.value = "", Z();
1260
- }
1261
- function J() {
1262
- y.value = "", f.value = "", Z();
1263
- }
1264
- async function X(b) {
1265
- var l;
1266
- const a = Array.from(((l = b.clipboardData) == null ? void 0 : l.files) || []).find((L) => L.type.startsWith("image/"));
1267
- a && (b.preventDefault(), await le({
1268
- file: a,
1269
- onError: () => {
1270
- },
1271
- onProgress: () => {
1272
- },
1273
- onSuccess: () => {
1274
- }
1275
- }));
1276
- }
1277
- async function le(b) {
1278
- var V, a;
1279
- if (b.file.size > 51200 * 1e3)
1280
- return he.error("图片过大"), !1;
1281
- I.value = !0;
1282
- try {
1283
- const l = await ne(b);
1284
- return f.value = ie(l), Z(), he.success("上传图片成功"), (V = b.onSuccess) == null || V.call(b, l), !0;
1285
- } catch (l) {
1286
- return (a = b.onError) == null || a.call(b, l), he.error("上传失败"), !1;
1287
- } finally {
1288
- I.value = !1;
1289
- }
1290
- }
1291
- async function ne(b) {
1292
- const V = new FormData();
1293
- if (V.append(e.uploadName, b.file), e.uploadRequest)
1294
- return e.uploadRequest({
1295
- file: b.file,
1296
- formData: V,
1297
- options: b,
1298
- api: e.api,
1299
- tokenKey: e.tokenKey
1300
- });
1301
- const a = xt.get(e.tokenKey);
1302
- return (await fetch(e.api, {
1303
- method: "POST",
1304
- body: V,
1305
- credentials: "include",
1306
- headers: a ? { Authorization: `Bearer ${a}` } : void 0
1307
- })).json();
1308
- }
1309
- function ie(b) {
1310
- var l, L;
1311
- if (typeof b == "string") return b;
1312
- const V = b, a = (V == null ? void 0 : V.urls) ?? ((l = V == null ? void 0 : V.data) == null ? void 0 : l.urls) ?? ((L = V == null ? void 0 : V.data) == null ? void 0 : L.url) ?? (V == null ? void 0 : V.url) ?? "";
1313
- return Array.isArray(a) ? a[0] || "" : a || "";
1314
- }
1315
- function Z() {
1316
- n(
1317
- "change",
1318
- ut(y.value || "", f.value || ""),
1319
- f.value || ""
1320
- );
1321
- }
1322
- return D({
1323
- deleteImage: ae,
1324
- // 兼容旧 remarkImage,在表单 reset/clearFrom 时清空文字和图片。
1325
- clearContent: J,
1326
- // 给表单保存或外部调试读取当前拆分值。
1327
- getValue: () => ({
1328
- text: y.value || "",
1329
- imageUrl: f.value || "",
1330
- value: ut(y.value || "", f.value || "")
1331
- })
1332
- }), (b, V) => (v(), A("div", {
1333
- class: ke(["qy-remark-image", _.value]),
1334
- style: Pe(M.value)
1335
- }, [
1336
- z("div", Sl, [
1337
- Q.value ? (v(), ce($(ht), {
1338
- key: 0,
1339
- class: "qy-remark-image__prefix-select",
1340
- "model-value": t.selectValue,
1341
- options: t.selectOptions,
1342
- disabled: t.disabled || t.selectDisabled,
1343
- size: "small",
1344
- "onUpdate:modelValue": U
1345
- }, {
1346
- default: h(() => [
1347
- (v(!0), A(Re, null, et(t.selectOptions, (a) => (v(), ce($(bt), {
1348
- key: String(a.value),
1349
- label: a.label,
1350
- value: a.value,
1351
- disabled: a.disabled
1352
- }, null, 8, ["label", "value", "disabled"]))), 128))
1353
- ]),
1354
- _: 1
1355
- }, 8, ["model-value", "options", "disabled"])) : P("", !0),
1356
- Q.value ? (v(), A("span", kl)) : P("", !0),
1357
- O($(Me), Qe({
1358
- ref_key: "inputRef",
1359
- ref: d,
1360
- "model-value": y.value,
1361
- type: E.value,
1362
- rows: t.rows,
1363
- autosize: t.autosize,
1364
- disabled: t.disabled,
1365
- placeholder: t.placeholder
1366
- }, $(H), {
1367
- "onUpdate:modelValue": T,
1368
- onBlur: Z
1369
- }), null, 16, ["model-value", "type", "rows", "autosize", "disabled", "placeholder"]),
1370
- O($(Ha), {
1371
- placement: "top-start",
1372
- width: 400,
1373
- trigger: "hover",
1374
- disabled: !f.value
1375
- }, {
1376
- reference: h(() => [
1377
- z("div", xl, [
1378
- O($(Za), {
1379
- disabled: I.value || t.disabled,
1380
- class: "qy-remark-image__upload",
1381
- "show-file-list": !1,
1382
- "http-request": le
1383
- }, {
1384
- default: h(() => [
1385
- I.value ? (v(), A("span", Ql)) : f.value ? (v(), A("span", Cl)) : (v(), A("span", $l))
1386
- ]),
1387
- _: 1
1388
- }, 8, ["disabled"])
1389
- ])
1390
- ]),
1391
- default: h(() => [
1392
- z("div", Vl, [
1393
- z("img", {
1394
- src: f.value,
1395
- class: "qy-remark-image__preview-img"
1396
- }, null, 8, ql),
1397
- z("div", Bl, [
1398
- V[1] || (V[1] = z("span", { class: "qy-remark-image__popover-tip" }, "再次点击按钮可更换图片", -1)),
1399
- O($(Ve), {
1400
- link: "",
1401
- size: "small",
1402
- type: "danger",
1403
- disabled: t.disabled,
1404
- onClick: ae
1405
- }, {
1406
- default: h(() => [...V[0] || (V[0] = [
1407
- be(" 删除图片 ", -1)
1408
- ])]),
1409
- _: 1
1410
- }, 8, ["disabled"])
1411
- ])
1412
- ])
1413
- ]),
1414
- _: 1
1415
- }, 8, ["disabled"])
1416
- ])
1417
- ], 6));
1418
- }
1419
- }), Il = /* @__PURE__ */ Te(Al, [["__scopeId", "data-v-3158c066"]]), Tl = /* @__PURE__ */ qe({
1420
- name: "QyMoneyInput",
1421
- inheritAttrs: !1,
1422
- __name: "index",
1423
- props: {
1424
- modelValue: { default: "" },
1425
- precision: { default: 2 },
1426
- min: { default: void 0 },
1427
- max: { default: void 0 },
1428
- allowNegative: { type: Boolean, default: !1 },
1429
- formatTrigger: { default: "blur" },
1430
- emptyValue: { default: "" }
1431
- },
1432
- emits: ["update:modelValue", "input", "change", "focus", "blur", "clear", "enter"],
1433
- setup(t, { expose: D, emit: W }) {
1434
- const e = t, n = W, H = Be(), d = q(null), y = q(I(e.modelValue)), f = F(() => I(e.modelValue));
1435
- fe(
1436
- () => e.modelValue,
1437
- (a) => {
1438
- y.value = I(a);
1439
- }
1440
- );
1441
- function I(a) {
1442
- return a == null ? "" : String(a);
1443
- }
1444
- function Q(a) {
1445
- return Number.isFinite(a) ? Math.max(0, Math.floor(a)) : 2;
1446
- }
1447
- function _(a) {
1448
- const l = I(a);
1449
- let L = "", te = !1, s = !1;
1450
- const p = Q(e.precision);
1451
- for (let C = 0; C < l.length; C += 1) {
1452
- const g = l[C];
1453
- if (g >= "0" && g <= "9") {
1454
- L += g;
1455
- continue;
1456
- }
1457
- if (g === "." && p > 0 && !te) {
1458
- L += g, te = !0;
1459
- continue;
1460
- }
1461
- g === "-" && e.allowNegative && C === 0 && !s && (L += g, s = !0);
1462
- }
1463
- if (p > 0 && te) {
1464
- const [C, g = ""] = L.split(".");
1465
- return `${C}.${g.slice(0, p)}`;
1466
- }
1467
- return L;
1468
- }
1469
- function E(a) {
1470
- let l = a;
1471
- return typeof e.min == "number" && Number.isFinite(e.min) && (l = Math.max(l, e.min)), typeof e.max == "number" && Number.isFinite(e.max) && (l = Math.min(l, e.max)), l;
1472
- }
1473
- function M(a) {
1474
- const l = _(a);
1475
- if (!l || l === "-" || l === ".")
1476
- return I(e.emptyValue);
1477
- const L = Number(l);
1478
- if (Number.isNaN(L)) return I(e.emptyValue);
1479
- const te = Q(e.precision);
1480
- return E(L).toFixed(te);
1481
- }
1482
- function j(a) {
1483
- y.value = a, n("update:modelValue", a);
1484
- }
1485
- function G(a) {
1486
- const l = _(a);
1487
- j(l);
1488
- }
1489
- function T(a) {
1490
- const l = _(a);
1491
- y.value = l, n("input", l);
1492
- }
1493
- function U(a) {
1494
- const l = e.formatTrigger === "change" ? M(a) : _(a);
1495
- l !== I(e.modelValue) && j(l), n("change", l);
1496
- }
1497
- function ae(a) {
1498
- n("focus", a);
1499
- }
1500
- function J(a) {
1501
- if (e.formatTrigger === "blur") {
1502
- const l = M(y.value);
1503
- l !== I(e.modelValue) && j(l);
1504
- }
1505
- n("blur", a);
1506
- }
1507
- function X() {
1508
- const a = I(e.emptyValue);
1509
- y.value = a, n("update:modelValue", a), n("clear");
1510
- }
1511
- function le(a) {
1512
- n("enter", a);
1513
- }
1514
- function ne() {
1515
- var a, l;
1516
- (l = (a = d.value) == null ? void 0 : a.focus) == null || l.call(a);
1517
- }
1518
- function ie() {
1519
- var a, l;
1520
- (l = (a = d.value) == null ? void 0 : a.blur) == null || l.call(a);
1521
- }
1522
- function Z() {
1523
- var a, l;
1524
- (l = (a = d.value) == null ? void 0 : a.select) == null || l.call(a);
1525
- }
1526
- function b() {
1527
- var a, l;
1528
- (l = (a = d.value) == null ? void 0 : a.clear) == null || l.call(a);
1529
- }
1530
- function V() {
1531
- var a;
1532
- return ((a = d.value) == null ? void 0 : a.input) || null;
1533
- }
1534
- return D({
1535
- focus: ne,
1536
- blur: ie,
1537
- select: Z,
1538
- clear: b,
1539
- getNativeInput: V
1540
- }), (a, l) => (v(), ce($(Me), Qe({
1541
- ref_key: "inputRef",
1542
- ref: d
1543
- }, $(H), {
1544
- "model-value": f.value,
1545
- inputmode: "decimal",
1546
- "onUpdate:modelValue": G,
1547
- onInput: T,
1548
- onChange: U,
1549
- onFocus: ae,
1550
- onBlur: J,
1551
- onClear: X,
1552
- onKeydown: Ee(le, ["enter"])
1553
- }), _e({ _: 2 }, [
1554
- a.$slots.prefix ? {
1555
- name: "prefix",
1556
- fn: h(() => [
1557
- R(a.$slots, "prefix")
1558
- ]),
1559
- key: "0"
1560
- } : void 0,
1561
- a.$slots.suffix ? {
1562
- name: "suffix",
1563
- fn: h(() => [
1564
- R(a.$slots, "suffix")
1565
- ]),
1566
- key: "1"
1567
- } : void 0,
1568
- a.$slots.prepend ? {
1569
- name: "prepend",
1570
- fn: h(() => [
1571
- R(a.$slots, "prepend")
1572
- ]),
1573
- key: "2"
1574
- } : void 0,
1575
- a.$slots.append ? {
1576
- name: "append",
1577
- fn: h(() => [
1578
- R(a.$slots, "append")
1579
- ]),
1580
- key: "3"
1581
- } : void 0
1582
- ]), 1040, ["model-value"]));
1583
- }
1584
- }), zl = /* @__PURE__ */ qe({
1585
- name: "QyRemoteSelect",
1586
- inheritAttrs: !1,
1587
- __name: "index",
1588
- props: {
1589
- modelValue: { type: [String, Number, Boolean, Array, null], default: void 0 },
1590
- fetchMethod: {},
1591
- defaultOptions: { default: () => [] },
1592
- labelKey: { default: "label" },
1593
- valueKey: { default: "value" },
1594
- disabledKey: { default: "disabled" },
1595
- placeholder: { default: "请选择" },
1596
- disabled: { type: Boolean, default: !1 },
1597
- clearable: { type: Boolean, default: !0 },
1598
- multiple: { type: Boolean, default: !1 },
1599
- collapseTags: { type: Boolean, default: !1 },
1600
- collapseTagsTooltip: { type: Boolean, default: !1 },
1601
- autoSelectSingle: { type: Boolean, default: !1 },
1602
- size: { default: void 0 },
1603
- teleported: { type: Boolean, default: !0 },
1604
- appendTo: { default: "body" },
1605
- fitInputWidth: { type: Boolean, default: !0 },
1606
- popperClass: { default: "" },
1607
- debounce: { default: 300 },
1608
- minLength: { default: 1 },
1609
- remoteOnFocus: { type: Boolean, default: !1 },
1610
- remoteShowSuffix: { type: Boolean, default: !0 },
1611
- loading: { type: Boolean, default: !1 },
1612
- reserveSelectedOption: { type: Boolean, default: !0 },
1613
- allowCreate: { type: Boolean, default: !1 },
1614
- commitOnBlur: { type: Boolean, default: !1 }
1615
- },
1616
- emits: ["update:modelValue", "change", "clear", "visible-change", "focus", "blur", "options-change", "loading-change", "error"],
1617
- setup(t, { expose: D, emit: W }) {
1618
- const e = t, n = W, H = Be(), d = q(null), y = q([]), f = q(/* @__PURE__ */ new Map()), I = q(!1), Q = q(""), _ = q("");
1619
- let E = 0, M = null;
1620
- const j = F(() => e.loading || I.value), G = q(!1), T = F(() => Q.value !== ""), U = F(() => {
1621
- if (T.value) return y.value;
1622
- const m = /* @__PURE__ */ new Map(), Y = (i) => {
1623
- m.set(ae(i), i);
1624
- };
1625
- return e.defaultOptions.forEach(Y), e.reserveSelectedOption && f.value.forEach((i) => Y(i)), y.value.forEach(Y), Array.from(m.values());
1626
- });
1627
- fe(
1628
- () => e.defaultOptions,
1629
- (m) => {
1630
- m.forEach(X);
1631
- },
1632
- { immediate: !0 }
1633
- ), fe(
1634
- () => e.modelValue,
1635
- () => {
1636
- U.value.forEach(X);
1637
- },
1638
- { immediate: !0 }
1639
- );
1640
- function ae(m) {
1641
- return (m == null ? void 0 : m[e.valueKey]) ?? (m == null ? void 0 : m.value) ?? (m == null ? void 0 : m.label);
1642
- }
1643
- function J(m) {
1644
- return Array.isArray(e.modelValue) ? e.modelValue.includes(m) : e.modelValue === m;
1645
- }
1646
- function X(m) {
1647
- if (!e.reserveSelectedOption) return;
1648
- const Y = ae(m);
1649
- J(Y) && f.value.set(Y, m);
1650
- }
1651
- function le(m) {
1652
- return e.disabled ? !1 : m ? m.length >= e.minLength : e.remoteOnFocus;
1653
- }
1654
- function ne(m) {
1655
- I.value !== m && (I.value = m, n("loading-change", m));
1656
- }
1657
- async function ie(m) {
1658
- const Y = B(m), i = ++E;
1659
- if (re(Y), !le(Y)) {
1660
- y.value = [], ne(!1), n("options-change", U.value);
1661
- return;
1662
- }
1663
- ne(!0);
1664
- try {
1665
- const w = await e.fetchMethod(Y);
1666
- if (i !== E) return;
1667
- y.value = Array.isArray(w) ? w : [], y.value.forEach(X), n("options-change", U.value);
1668
- } catch (w) {
1669
- if (i !== E) return;
1670
- y.value = [], n("error", w), n("options-change", U.value);
1671
- } finally {
1672
- i === E && ne(!1);
1673
- }
1674
- }
1675
- function Z() {
1676
- G.value || (G.value = !0, ie(""));
1677
- }
1678
- function b(m) {
1679
- const Y = B(m);
1680
- _.value = Y, E += 1, re(Y), M && (clearTimeout(M), M = null), M = setTimeout(() => {
1681
- ie(Y);
1682
- }, e.debounce);
1683
- }
1684
- function V() {
1685
- G.value = !0, ie("");
1686
- }
1687
- function a() {
1688
- ie(Q.value);
1689
- }
1690
- function l(m) {
1691
- _.value = "", n("update:modelValue", m);
1692
- }
1693
- function L(m) {
1694
- _.value = "", U.value.forEach(X), n("change", m);
1695
- }
1696
- function te() {
1697
- _.value = "", n("clear");
1698
- }
1699
- function s(m) {
1700
- m && e.remoteOnFocus && !Q.value && Z(), n("visible-change", m);
1701
- }
1702
- function p(m) {
1703
- e.remoteOnFocus && !Q.value && Z(), n("focus", m);
1704
- }
1705
- function C(m) {
1706
- g(), n("blur", m);
1707
- }
1708
- function g() {
1709
- if (!e.allowCreate || !e.commitOnBlur || e.disabled) return;
1710
- const m = _.value;
1711
- m.trim() && (_.value = "", n("update:modelValue", m), n("change", m));
1712
- }
1713
- function B(m) {
1714
- return String(m ?? "");
1715
- }
1716
- function re(m) {
1717
- Q.value = m, y.value = [], n("options-change", U.value);
1718
- }
1719
- function me() {
1720
- var m, Y;
1721
- (Y = (m = d.value) == null ? void 0 : m.focus) == null || Y.call(m);
1722
- }
1723
- function we() {
1724
- var m, Y;
1725
- (Y = (m = d.value) == null ? void 0 : m.blur) == null || Y.call(m);
1726
- }
1727
- function xe() {
1728
- n("update:modelValue", e.multiple ? [] : ""), n("clear");
1729
- }
1730
- return ft(() => {
1731
- M && clearTimeout(M);
1732
- }), D({
1733
- // 暴露远程选择常用控制方法,供弹窗打开后聚焦或请求失败后重试。
1734
- focus: me,
1735
- blur: we,
1736
- clear: xe,
1737
- retryFetch: a,
1738
- fetchDefaultOptions: V
1739
- }), (m, Y) => (v(), ce(tt, Qe({
1740
- ref_key: "selectRef",
1741
- ref: d
1742
- }, $(H), {
1743
- "model-value": t.modelValue,
1744
- options: U.value,
1745
- "label-key": t.labelKey,
1746
- "value-key": t.valueKey,
1747
- "disabled-key": t.disabledKey,
1748
- placeholder: t.placeholder,
1749
- disabled: t.disabled,
1750
- clearable: t.clearable,
1751
- filterable: !0,
1752
- multiple: t.multiple,
1753
- "collapse-tags": t.collapseTags,
1754
- "collapse-tags-tooltip": t.collapseTagsTooltip,
1755
- "auto-select-single": t.autoSelectSingle,
1756
- size: t.size,
1757
- teleported: t.teleported,
1758
- "append-to": t.appendTo,
1759
- "fit-input-width": t.fitInputWidth,
1760
- "popper-class": t.popperClass,
1761
- remote: "",
1762
- debounce: 0,
1763
- "remote-show-suffix": t.remoteShowSuffix,
1764
- "remote-method": b,
1765
- loading: j.value,
1766
- "onUpdate:modelValue": l,
1767
- onChange: L,
1768
- onClear: te,
1769
- onVisibleChange: s,
1770
- onFocus: p,
1771
- onBlur: C
1772
- }), _e({
1773
- default: h(() => [
1774
- m.$slots.default ? R(m.$slots, "default", {}, void 0, void 0, 0) : P("", !0)
1775
- ]),
1776
- _: 2
1777
- }, [
1778
- m.$slots.prefix ? {
1779
- name: "prefix",
1780
- fn: h(() => [
1781
- R(m.$slots, "prefix")
1782
- ]),
1783
- key: "0"
1784
- } : void 0,
1785
- m.$slots.empty ? {
1786
- name: "empty",
1787
- fn: h(() => [
1788
- R(m.$slots, "empty")
1789
- ]),
1790
- key: "1"
1791
- } : void 0,
1792
- m.$slots.loading ? {
1793
- name: "loading",
1794
- fn: h(() => [
1795
- R(m.$slots, "loading")
1796
- ]),
1797
- key: "2"
1798
- } : void 0,
1799
- m.$slots.tag ? {
1800
- name: "tag",
1801
- fn: h((i) => [
1802
- R(m.$slots, "tag", gt(vt(i)))
1803
- ]),
1804
- key: "3"
1805
- } : void 0
1806
- ]), 1040, ["model-value", "options", "label-key", "value-key", "disabled-key", "placeholder", "disabled", "clearable", "multiple", "collapse-tags", "collapse-tags-tooltip", "auto-select-single", "size", "teleported", "append-to", "fit-input-width", "popper-class", "remote-show-suffix", "loading"]));
1807
- }
1808
- }), Rl = { class: "qy-search-input__item" }, Fl = ["innerHTML"], Pl = {
1809
- key: 0,
1810
- class: "qy-search-input__item-description"
1811
- }, Dl = /* @__PURE__ */ qe({
1812
- name: "QySearchInput",
1813
- inheritAttrs: !1,
1814
- __name: "index",
1815
- props: {
1816
- modelValue: { default: "" },
1817
- loading: { type: Boolean, default: !1 },
1818
- disabled: { type: Boolean, default: !1 },
1819
- placeholder: { default: "请输入搜索内容" },
1820
- removeSpace: { type: Boolean, default: !1 },
1821
- trimMode: { default: "none" },
1822
- clearable: { type: Boolean, default: !0 },
1823
- showButton: { type: Boolean, default: !0 },
1824
- buttonText: { default: "搜索" },
1825
- buttonProps: { default: () => ({}) },
1826
- suggestions: { default: () => [] },
1827
- fetchSuggestions: { type: [Function, null], default: null },
1828
- fetchSuggestionsMethod: { type: [Function, null], default: null },
1829
- debounce: { default: 300 },
1830
- minLength: { default: 1 },
1831
- triggerOnFocus: { type: Boolean, default: !1 },
1832
- searchOnEnter: { type: Boolean, default: !0 },
1833
- searchOnSelect: { type: Boolean, default: !1 },
1834
- highlightKeyword: { type: Boolean, default: !0 },
1835
- teleported: { type: Boolean, default: !0 },
1836
- appendTo: { default: "body" },
1837
- popperClass: { default: "" },
1838
- fitInputWidth: { type: Boolean, default: !0 }
1839
- },
1840
- emits: ["update:modelValue", "search", "clear", "input", "change", "focus", "blur", "enter", "select", "visible-change", "suggestions-change", "error"],
1841
- setup(t, { expose: D, emit: W }) {
1842
- const e = t, n = W, H = Be(), d = q(null), y = q(E(e.modelValue)), f = F(() => E(e.modelValue)), I = F(
1843
- () => ["qy-search-input__popper", e.popperClass].filter(Boolean).join(" ")
1844
- ), Q = F(() => E(e.modelValue)), _ = q("");
1845
- fe(
1846
- () => e.modelValue,
1847
- (i) => {
1848
- y.value = E(i);
1849
- }
1850
- );
1851
- function E(i) {
1852
- return i == null ? "" : String(i);
1853
- }
1854
- function M(i) {
1855
- return e.removeSpace ? i.replace(/\s+/g, "") : i;
1856
- }
1857
- function j(i, w) {
1858
- return e.trimMode !== w ? i : i.trim();
1859
- }
1860
- function G(i) {
1861
- return M(E(i));
1862
- }
1863
- function T(i) {
1864
- y.value = i, n("update:modelValue", i);
1865
- }
1866
- function U(i, w = "") {
1867
- return {
1868
- ...i,
1869
- label: i.label || i.value,
1870
- value: i.value || i.label,
1871
- description: i.description || w
1872
- };
1873
- }
1874
- function ae(i = []) {
1875
- return i.flatMap((w) => {
1876
- if (Array.isArray(w.items)) {
1877
- const ee = w;
1878
- return ee.items.map((Se) => U(Se, ee.groupLabel));
1879
- }
1880
- return U(w);
1881
- });
1882
- }
1883
- function J(i) {
1884
- const w = i.toLowerCase();
1885
- return (ee) => [ee.label, ee.value, ee.description].filter(Boolean).some((Se) => String(Se).toLowerCase().includes(w));
1886
- }
1887
- function X(i) {
1888
- return i ? i.length >= e.minLength : e.triggerOnFocus;
1889
- }
1890
- function le(i) {
1891
- n("suggestions-change", i), n("visible-change", i.length > 0);
1892
- }
1893
- async function ne(i) {
1894
- if (!X(i))
1895
- return le([]), [];
1896
- if (e.fetchSuggestionsMethod) {
1897
- const Se = await new Promise(($e) => {
1898
- var de;
1899
- (de = e.fetchSuggestionsMethod) == null || de.call(e, i, (De) => {
1900
- $e(ae(De));
1901
- });
1902
- });
1903
- return le(Se), Se;
1904
- }
1905
- if (e.fetchSuggestions) {
1906
- const Se = await e.fetchSuggestions(i), $e = ae(Array.isArray(Se) ? Se : []);
1907
- return le($e), $e;
1908
- }
1909
- const w = ae(e.suggestions), ee = i ? w.filter(J(i)) : w;
1910
- return le(ee), ee;
1911
- }
1912
- async function ie(i, w) {
1913
- _.value = i;
1914
- try {
1915
- const ee = await ne(i);
1916
- w(ee);
1917
- } catch (ee) {
1918
- n("error", ee), le([]), w([]);
1919
- }
1920
- }
1921
- function Z() {
1922
- var i, w;
1923
- _.value && ((w = (i = d.value) == null ? void 0 : i.getData) == null || w.call(i, _.value));
1924
- }
1925
- function b(i) {
1926
- const w = G(i);
1927
- T(w);
1928
- }
1929
- function V(i) {
1930
- const w = G(i);
1931
- y.value = w, n("input", w);
1932
- }
1933
- function a(i) {
1934
- const w = j(G(i), "change");
1935
- w !== E(e.modelValue) && T(w), n("change", w);
1936
- }
1937
- function l(i) {
1938
- n("focus", i);
1939
- }
1940
- function L(i) {
1941
- const w = j(y.value, "blur");
1942
- w !== E(e.modelValue) && T(w), n("blur", i), n("visible-change", !1);
1943
- }
1944
- function te() {
1945
- y.value = "", n("update:modelValue", ""), n("clear"), le([]);
1946
- }
1947
- function s(i) {
1948
- n("enter", i), e.searchOnEnter && p();
1949
- }
1950
- function p() {
1951
- n("search", E(e.modelValue));
1952
- }
1953
- function C(i) {
1954
- n("select", i), e.searchOnSelect && n("search", i.value);
1955
- }
1956
- function g(i) {
1957
- return i.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
1958
- }
1959
- function B(i) {
1960
- return i.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
1961
- }
1962
- function re(i) {
1963
- const w = g(i || "");
1964
- if (!e.highlightKeyword || !f.value) return w;
1965
- const ee = B(g(f.value));
1966
- return ee ? w.replace(
1967
- new RegExp(`(${ee})`, "ig"),
1968
- '<mark class="qy-search-input__mark">$1</mark>'
1969
- ) : w;
1970
- }
1971
- function me() {
1972
- var i, w;
1973
- (w = (i = d.value) == null ? void 0 : i.focus) == null || w.call(i);
1974
- }
1975
- function we() {
1976
- var i, w;
1977
- (w = (i = d.value) == null ? void 0 : i.blur) == null || w.call(i);
1978
- }
1979
- function xe() {
1980
- var i, w, ee;
1981
- (ee = (w = (i = d.value) == null ? void 0 : i.inputRef) == null ? void 0 : w.select) == null || ee.call(w);
1982
- }
1983
- function m() {
1984
- var i, w;
1985
- (w = (i = d.value) == null ? void 0 : i.clear) == null || w.call(i);
1986
- }
1987
- function Y() {
1988
- var i, w;
1989
- (w = (i = d.value) == null ? void 0 : i.close) == null || w.call(i);
1990
- }
1991
- return D({
1992
- // 暴露搜索框常用控制方法,供弹窗打开后聚焦或失败后重试建议项。
1993
- focus: me,
1994
- blur: we,
1995
- select: xe,
1996
- clear: m,
1997
- closePanel: Y,
1998
- retryFetch: Z
1999
- }), (i, w) => (v(), A("div", {
2000
- class: ke(["qy-search-input", { "is-disabled": t.disabled }])
2001
- }, [
2002
- O($(Wa), Qe({
2003
- ref_key: "autocompleteRef",
2004
- ref: d
2005
- }, $(H), {
2006
- "model-value": Q.value,
2007
- disabled: t.disabled,
2008
- placeholder: t.placeholder,
2009
- clearable: t.clearable,
2010
- debounce: t.debounce,
2011
- "fetch-suggestions": ie,
2012
- "trigger-on-focus": t.triggerOnFocus,
2013
- teleported: t.teleported,
2014
- "fit-input-width": t.fitInputWidth,
2015
- "popper-class": I.value,
2016
- "append-to": t.appendTo,
2017
- "value-key": "value",
2018
- "onUpdate:modelValue": b,
2019
- onInput: V,
2020
- onChange: a,
2021
- onFocus: l,
2022
- onBlur: L,
2023
- onClear: te,
2024
- onSelect: C,
2025
- onKeydown: Ee(s, ["enter"])
2026
- }), _e({
2027
- default: h(({ item: ee }) => [
2028
- R(i.$slots, "item", {
2029
- item: ee,
2030
- keyword: f.value
2031
- }, () => [
2032
- z("div", Rl, [
2033
- z("div", {
2034
- class: "qy-search-input__item-label",
2035
- innerHTML: re(ee.label || ee.value || "")
2036
- }, null, 8, Fl),
2037
- ee.description ? (v(), A("div", Pl, pe(ee.description), 1)) : P("", !0)
2038
- ])
2039
- ], !0)
2040
- ]),
2041
- _: 2
2042
- }, [
2043
- i.$slots.prefix ? {
2044
- name: "prefix",
2045
- fn: h(() => [
2046
- R(i.$slots, "prefix", {}, void 0, !0)
2047
- ]),
2048
- key: "0"
2049
- } : void 0,
2050
- i.$slots.suffix ? {
2051
- name: "suffix",
2052
- fn: h(() => [
2053
- R(i.$slots, "suffix", {}, void 0, !0)
2054
- ]),
2055
- key: "1"
2056
- } : void 0,
2057
- i.$slots.prepend ? {
2058
- name: "prepend",
2059
- fn: h(() => [
2060
- R(i.$slots, "prepend", {}, void 0, !0)
2061
- ]),
2062
- key: "2"
2063
- } : void 0,
2064
- i.$slots.append || t.showButton ? {
2065
- name: "append",
2066
- fn: h(() => [
2067
- i.$slots.append ? R(i.$slots, "append", {}, void 0, !0, 0) : (v(), ce($(Ve), Qe({ key: 1 }, t.buttonProps, {
2068
- loading: t.loading,
2069
- disabled: t.disabled,
2070
- onClick: p
2071
- }), {
2072
- default: h(() => [
2073
- be(pe(t.buttonText), 1)
2074
- ]),
2075
- _: 1
2076
- }, 16, ["loading", "disabled"]))
2077
- ]),
2078
- key: "3"
2079
- } : void 0
2080
- ]), 1040, ["model-value", "disabled", "placeholder", "clearable", "debounce", "trigger-on-focus", "teleported", "fit-input-width", "popper-class", "append-to"])
2081
- ], 2));
2082
- }
2083
- }), $t = /* @__PURE__ */ Te(Dl, [["__scopeId", "data-v-cd7f5dfc"]]), Ml = { class: "qy-record-quote-search" }, Ol = {
2084
- key: 0,
2085
- class: "qy-record-quote-search__header"
2086
- }, _l = {
2087
- key: 0,
2088
- class: "qy-record-quote-search__label"
2089
- }, Ul = {
2090
- key: 1,
2091
- class: "qy-record-quote-search__description"
2092
- }, Ll = /* @__PURE__ */ qe({
2093
- name: "QyRecordQuoteSearch",
2094
- inheritAttrs: !1,
2095
- __name: "index",
2096
- props: {
2097
- modelValue: { default: "" },
2098
- loading: { type: Boolean, default: !1 },
2099
- disabled: { type: Boolean, default: !1 },
2100
- placeholder: { default: "请输入报价单号" },
2101
- buttonText: { default: "查询报价单" },
2102
- autoNormalize: { type: Boolean, default: !0 },
2103
- showStatus: { type: Boolean, default: !0 },
2104
- status: { default: "default" },
2105
- statusText: { default: "" },
2106
- suggestions: { default: () => [] },
2107
- fetchSuggestions: { type: [Function, null], default: null },
2108
- fetchSuggestionsMethod: { type: [Function, null], default: null },
2109
- debounce: { default: 300 },
2110
- minLength: { default: 1 },
2111
- searchOnSelect: { type: Boolean, default: !0 },
2112
- searchMethod: { type: [Function, null], default: null },
2113
- extractMethod: { type: [Function, null], default: null },
2114
- normalizeMethod: { type: [Function, null], default: null },
2115
- label: { default: "报价单号" },
2116
- description: { default: "" },
2117
- trimMode: { default: "blur" }
2118
- },
2119
- emits: ["update:modelValue", "search", "clear", "normalize", "enter", "select", "error", "success"],
2120
- setup(t, { expose: D, emit: W }) {
2121
- const e = t, n = W, H = Be(), d = q(null), y = q(!1), f = F(() => e.statusText || ""), I = F(() => e.loading || y.value);
2122
- function Q(a) {
2123
- return a == null ? "" : String(a);
2124
- }
2125
- function _(a) {
2126
- const l = Q(a).trim(), L = E(l), te = L.match(/BJ\d{8}[A-Z0-9]{4}/i);
2127
- return te ? te[0] : L;
2128
- }
2129
- function E(a) {
2130
- return Q(a).replace(/\s+/g, "").trim().toUpperCase();
2131
- }
2132
- function M(a) {
2133
- return e.extractMethod ? e.extractMethod(a) : _(a);
2134
- }
2135
- function j(a) {
2136
- return e.normalizeMethod ? e.normalizeMethod(a) : E(a);
2137
- }
2138
- function G(a, l) {
2139
- const L = Q(a), te = M(L), s = e.autoNormalize ? j(te) : te;
2140
- return n("normalize", { rawValue: L, code: s }), {
2141
- rawValue: L,
2142
- code: s,
2143
- item: l
2144
- };
2145
- }
2146
- function T(a) {
2147
- n("update:modelValue", a);
2148
- }
2149
- async function U(a) {
2150
- if (n("search", a), !!e.searchMethod) {
2151
- y.value = !0;
2152
- try {
2153
- const l = await e.searchMethod(a);
2154
- n("success", l);
2155
- } catch (l) {
2156
- n("error", l);
2157
- } finally {
2158
- y.value = !1;
2159
- }
2160
- }
2161
- }
2162
- function ae(a) {
2163
- const l = G(a);
2164
- l.code !== Q(e.modelValue) && n("update:modelValue", l.code), U(l);
2165
- }
2166
- function J() {
2167
- n("clear");
2168
- }
2169
- function X(a) {
2170
- n("enter", a);
2171
- }
2172
- function le(a) {
2173
- if (n("select", a), !e.searchOnSelect) return;
2174
- const l = G(a.value, a);
2175
- l.code !== Q(e.modelValue) && n("update:modelValue", l.code), U(l);
2176
- }
2177
- function ne(a) {
2178
- n("error", a);
2179
- }
2180
- function ie() {
2181
- var a, l;
2182
- (l = (a = d.value) == null ? void 0 : a.focus) == null || l.call(a);
2183
- }
2184
- function Z() {
2185
- var a, l;
2186
- (l = (a = d.value) == null ? void 0 : a.blur) == null || l.call(a);
2187
- }
2188
- function b() {
2189
- var a, l;
2190
- (l = (a = d.value) == null ? void 0 : a.select) == null || l.call(a);
2191
- }
2192
- function V() {
2193
- var a, l;
2194
- (l = (a = d.value) == null ? void 0 : a.clear) == null || l.call(a);
2195
- }
2196
- return D({
2197
- focus: ie,
2198
- blur: Z,
2199
- select: b,
2200
- clear: V,
2201
- extractQuoteOrderCode: M,
2202
- normalizeQuoteOrderCode: j
2203
- }), (a, l) => (v(), A("div", Ml, [
2204
- R(a.$slots, "label", {}, () => [
2205
- t.label || t.description ? (v(), A("div", Ol, [
2206
- t.label ? (v(), A("div", _l, pe(t.label), 1)) : P("", !0),
2207
- t.description ? (v(), A("div", Ul, pe(t.description), 1)) : P("", !0)
2208
- ])) : P("", !0)
2209
- ], !0),
2210
- O($t, Qe({
2211
- ref_key: "searchRef",
2212
- ref: d
2213
- }, $(H), {
2214
- "model-value": t.modelValue,
2215
- loading: I.value,
2216
- disabled: t.disabled,
2217
- placeholder: t.placeholder,
2218
- "remove-space": !0,
2219
- "trim-mode": t.trimMode,
2220
- "button-text": t.buttonText,
2221
- suggestions: t.suggestions,
2222
- "fetch-suggestions": t.fetchSuggestions,
2223
- "fetch-suggestions-method": t.fetchSuggestionsMethod,
2224
- debounce: t.debounce,
2225
- "min-length": t.minLength,
2226
- "search-on-select": !1,
2227
- "onUpdate:modelValue": T,
2228
- onSearch: ae,
2229
- onClear: J,
2230
- onEnter: X,
2231
- onSelect: le,
2232
- onError: ne
2233
- }), _e({ _: 2 }, [
2234
- a.$slots.prefix ? {
2235
- name: "prefix",
2236
- fn: h(() => [
2237
- R(a.$slots, "prefix", {}, void 0, !0)
2238
- ]),
2239
- key: "0"
2240
- } : void 0,
2241
- a.$slots.suffix ? {
2242
- name: "suffix",
2243
- fn: h(() => [
2244
- R(a.$slots, "suffix", {}, void 0, !0)
2245
- ]),
2246
- key: "1"
2247
- } : void 0,
2248
- a.$slots.item ? {
2249
- name: "item",
2250
- fn: h((L) => [
2251
- R(a.$slots, "item", gt(vt(L)), void 0, !0)
2252
- ]),
2253
- key: "2"
2254
- } : void 0,
2255
- a.$slots.empty ? {
2256
- name: "empty",
2257
- fn: h(() => [
2258
- R(a.$slots, "empty", {}, void 0, !0)
2259
- ]),
2260
- key: "3"
2261
- } : void 0,
2262
- a.$slots.loading ? {
2263
- name: "loading",
2264
- fn: h(() => [
2265
- R(a.$slots, "loading", {}, void 0, !0)
2266
- ]),
2267
- key: "4"
2268
- } : void 0
2269
- ]), 1040, ["model-value", "loading", "disabled", "placeholder", "trim-mode", "button-text", "suggestions", "fetch-suggestions", "fetch-suggestions-method", "debounce", "min-length"]),
2270
- t.showStatus && f.value ? R(a.$slots, "status", {
2271
- status: t.status,
2272
- statusText: f.value
2273
- }, () => [
2274
- z("div", {
2275
- class: ke(["qy-record-quote-search__status", `is-${t.status}`])
2276
- }, pe(f.value), 3)
2277
- ], !0, 0) : P("", !0)
2278
- ]));
2279
- }
2280
- }), Kl = /* @__PURE__ */ Te(Ll, [["__scopeId", "data-v-3a314f64"]]), El = { class: "qy-selection-dialog" }, jl = { class: "qy-selection-dialog__main" }, Nl = {
2281
- key: 0,
2282
- class: "qy-selection-dialog__selected"
2283
- }, Hl = { class: "qy-selection-dialog__selected-tags" }, Zl = {
2284
- key: 0,
2285
- class: "qy-selection-dialog__selected-actions"
2286
- }, Wl = {
2287
- key: 1,
2288
- class: "qy-selection-dialog__search-row"
2289
- }, Gl = {
2290
- key: 0,
2291
- class: "qy-selection-dialog__toolbar"
2292
- }, Jl = {
2293
- key: 2,
2294
- class: "qy-selection-dialog__pagination"
2295
- }, Xl = { class: "qy-selection-dialog__paste-actions" }, Yl = /* @__PURE__ */ qe({
2296
- name: "QySelectionDialog",
2297
- inheritAttrs: !1,
2298
- __name: "index",
2299
- props: {
2300
- modelValue: { default: () => [] },
2301
- open: { type: Boolean, default: !0 },
2302
- title: { default: "选择数据" },
2303
- width: { default: "1200px" },
2304
- fetchMethod: { type: Function, default: void 0 },
2305
- query: { type: Function, default: void 0 },
2306
- responseFormatter: { type: Function, default: void 0 },
2307
- selectionMode: { default: void 0 },
2308
- selection: { default: "single" },
2309
- selected: { default: () => [] },
2310
- rowKey: { default: "id" },
2311
- mainKey: { default: void 0 },
2312
- labelKey: { default: "name" },
2313
- tagName: { default: void 0 },
2314
- searchKey: { default: "conditions" },
2315
- queryParams: { default: () => ({}) },
2316
- category: { type: [Array, Function, Boolean], default: !1 },
2317
- categoryFormatter: { type: [Function, Array], default: void 0 },
2318
- categoryOptions: { default: () => [] },
2319
- categoryFetchMethod: { type: [Function, null], default: null },
2320
- type: { type: [Array, Boolean], default: !1 },
2321
- typeOptions: { default: () => [] },
2322
- typeSelectionProps: { default: () => ({}) },
2323
- typeSelectProps: { default: () => ({}) },
2324
- tableProps: { default: () => ({}) },
2325
- showSelected: { type: Boolean, default: !0 },
2326
- showSearch: { type: Boolean, default: !0 },
2327
- showPagination: { type: Boolean, default: !0 },
2328
- showCopyPaste: { type: Boolean, default: !1 },
2329
- append: { type: Boolean, default: !1 },
2330
- showAppend: { type: Boolean, default: !1 },
2331
- pageSizes: { default: () => [10, 20, 50, 100] }
2332
- },
2333
- emits: ["update:modelValue", "selection-change", "confirm", "submit", "cancel", "close", "append", "loaded"],
2334
- setup(t, { expose: D, emit: W }) {
2335
- const e = t, n = W, H = Be(), d = mt(), y = La(), f = q(null), I = q([]), Q = q([]), _ = q([]), E = q(!1), M = q(0), j = q(!1), G = q(""), T = Ze({
2336
- category: [],
2337
- type: "",
2338
- page: 1,
2339
- pageSize: 10,
2340
- ...e.searchKey ? { [e.searchKey]: "" } : {},
2341
- ...e.queryParams
2342
- }), U = F(() => e.selectionMode ? e.selectionMode : e.selection === "multi" ? "multiple" : e.selection), ae = F(() => e.mainKey || e.rowKey), J = F(() => e.tagName || e.labelKey), X = F(() => e.typeOptions.length ? e.typeOptions : e.type || []), le = F(() => ({
2343
- ...e.typeSelectionProps,
2344
- ...e.typeSelectProps
2345
- })), ne = F(() => e.tableProps || {}), ie = F(
2346
- () => e.showSearch || !!H["search-visible"]
2347
- ), Z = F(() => e.showAppend || e.append), b = F(
2348
- () => Z.value || !!d.toolbar || !!d.bar
2349
- ), V = F(() => e.fetchMethod || e.query), a = F(() => l() ? e.modelValue : e.selected);
2350
- function l() {
2351
- const u = (y == null ? void 0 : y.vnode.props) || {};
2352
- return Object.prototype.hasOwnProperty.call(u, "modelValue") || Object.prototype.hasOwnProperty.call(u, "model-value") || Object.prototype.hasOwnProperty.call(u, "onUpdate:modelValue");
2353
- }
2354
- fe(
2355
- [() => e.modelValue, () => e.selected, () => e.open],
2356
- () => {
2357
- e.open && (Q.value = Ae(a.value), ee());
2358
- },
2359
- { immediate: !0, deep: !0 }
2360
- ), fe(
2361
- [() => e.categoryOptions, () => e.category],
2362
- (u) => {
2363
- if (Array.isArray(e.category) && e.category.length) {
2364
- _.value = e.category;
2365
- return;
2366
- }
2367
- _.value = e.categoryOptions || [];
2368
- },
2369
- { immediate: !0 }
2370
- ), fe(j, (u) => {
2371
- u || (G.value = "");
2372
- });
2373
- async function L() {
2374
- Q.value = Ae(a.value), await te(), await s(), ee();
2375
- }
2376
- async function te() {
2377
- const u = e.categoryFetchMethod || (typeof e.category == "function" ? e.category : null);
2378
- if (!u) return;
2379
- const c = await u();
2380
- _.value = me(c);
2381
- }
2382
- async function s() {
2383
- if (V.value) {
2384
- E.value = !0;
2385
- try {
2386
- const u = await V.value(xe()), c = e.responseFormatter ? await e.responseFormatter(u) : u, { rows: N, total: o } = re(c);
2387
- return I.value = N, M.value = o, n("loaded", N), ee(), c;
2388
- } finally {
2389
- E.value = !1;
2390
- }
2391
- }
2392
- }
2393
- function p() {
2394
- return T.page = 1, s();
2395
- }
2396
- function C() {
2397
- return T.page = 1, s();
2398
- }
2399
- function g() {
2400
- return Object.assign(T, {
2401
- category: [],
2402
- type: "",
2403
- page: 1,
2404
- pageSize: T.pageSize,
2405
- ...e.searchKey ? { [e.searchKey]: "" } : {},
2406
- ...e.queryParams
2407
- }), s();
2408
- }
2409
- function B() {
2410
- n("append");
2411
- }
2412
- function re(u) {
2413
- if (Array.isArray(u))
2414
- return { rows: u, total: u.length };
2415
- const c = u == null ? void 0 : u.data;
2416
- if (Array.isArray(c))
2417
- return { rows: c, total: (u == null ? void 0 : u.total) ?? c.length };
2418
- const N = (u == null ? void 0 : u.records) || (u == null ? void 0 : u.rows) || (c == null ? void 0 : c.records) || [], o = (u == null ? void 0 : u.total) ?? (c == null ? void 0 : c.total) ?? N.length;
2419
- return { rows: N, total: o };
2420
- }
2421
- function me(u) {
2422
- const c = (u == null ? void 0 : u.data) ?? u;
2423
- if (!Array.isArray(c)) return [];
2424
- if (typeof e.categoryFormatter == "function")
2425
- return e.categoryFormatter(c);
2426
- if (Array.isArray(e.categoryFormatter)) {
2427
- const [N, o] = e.categoryFormatter;
2428
- return c.map((r) => ({
2429
- ...r,
2430
- label: r[N],
2431
- value: r[o],
2432
- children: Array.isArray(r.children) ? we(r.children, N, o) : r.children
2433
- }));
2434
- }
2435
- return c;
2436
- }
2437
- function we(u, c, N) {
2438
- return u.map((o) => ({
2439
- ...o,
2440
- label: o[c],
2441
- value: o[N],
2442
- children: Array.isArray(o.children) ? we(o.children, c, N) : o.children
2443
- }));
2444
- }
2445
- function xe() {
2446
- const u = { ...e.queryParams, ...T };
2447
- return e.searchKey && (u[e.searchKey] = String(u[e.searchKey] || "").trim()), u.category = m(), u;
2448
- }
2449
- function m() {
2450
- if (Object.prototype.hasOwnProperty.call(e.queryParams, "category"))
2451
- return e.queryParams.category;
2452
- const u = T.category;
2453
- return Array.isArray(u) ? u : u ? [u] : [];
2454
- }
2455
- function Y(u) {
2456
- var c, N;
2457
- if (U.value !== "none") {
2458
- if (U.value === "single") {
2459
- Q.value = [u], (c = f.value) == null || c.setCurrentRow(u), Fe();
2460
- return;
2461
- }
2462
- Se(u) && ((N = f.value) == null || N.toggleRowSelection(u, !$e(u)));
2463
- }
2464
- }
2465
- function i(u) {
2466
- if (U.value !== "multiple") return;
2467
- const c = new Set(I.value.map(de)), N = new Set(u.map(de));
2468
- Q.value = Q.value.filter(
2469
- (o) => !c.has(de(o)) || N.has(de(o))
2470
- ), u.forEach((o) => {
2471
- $e(o) || Q.value.push(o);
2472
- }), Fe();
2473
- }
2474
- function w(u) {
2475
- var N, o;
2476
- Q.value = Q.value.filter(
2477
- (r) => de(r) !== de(u)
2478
- );
2479
- const c = I.value.find((r) => de(r) === de(u));
2480
- c && (U.value === "multiple" ? (N = f.value) == null || N.toggleRowSelection(c, !1) : (o = f.value) == null || o.setCurrentRow()), Fe();
2481
- }
2482
- function ee() {
2483
- Oe(() => {
2484
- var u;
2485
- if (f.value) {
2486
- if (U.value === "single") {
2487
- const [c] = Q.value, N = I.value.find(
2488
- (o) => c && de(o) === de(c)
2489
- );
2490
- (u = f.value) == null || u.setCurrentRow(N);
2491
- return;
2492
- }
2493
- U.value === "multiple" && I.value.forEach((c) => {
2494
- var N;
2495
- (N = f.value) == null || N.toggleRowSelection(c, $e(c));
2496
- });
2497
- }
2498
- });
2499
- }
2500
- function Se(u) {
2501
- var N;
2502
- const c = (N = ne.value) == null ? void 0 : N.selectable;
2503
- return typeof c == "function" ? c(u) !== !1 : !0;
2504
- }
2505
- function $e(u) {
2506
- return Q.value.some((c) => de(c) === de(u));
2507
- }
2508
- function de(u) {
2509
- return Ue(u, ae.value);
2510
- }
2511
- function De(u) {
2512
- return Ue(u, J.value) ?? de(u);
2513
- }
2514
- function Ue(u, c) {
2515
- if (!(!u || !c))
2516
- return c.split(".").reduce((N, o) => N == null ? void 0 : N[o], u);
2517
- }
2518
- function Fe() {
2519
- const u = Ae(Q.value);
2520
- n("selection-change", u);
2521
- }
2522
- function je() {
2523
- const u = Ae(Q.value);
2524
- n("update:modelValue", u), n("confirm", u), n("submit", { selection: u, rows: u, query: { ...T } });
2525
- }
2526
- function Le() {
2527
- Q.value = Ae(a.value), n("cancel"), n("close");
2528
- }
2529
- async function Ne() {
2530
- var c;
2531
- const u = JSON.stringify(Q.value);
2532
- await ((c = navigator.clipboard) == null ? void 0 : c.writeText(u)), he.success("复制成功");
2533
- }
2534
- function ze() {
2535
- try {
2536
- const u = JSON.parse(G.value);
2537
- if (!Array.isArray(u)) {
2538
- he.error("粘贴内容需要是数组");
2539
- return;
2540
- }
2541
- u.forEach((c) => {
2542
- $e(c) || Q.value.push(c);
2543
- }), j.value = !1, Fe(), ee();
2544
- } catch (u) {
2545
- he.error(`粘贴错误: ${(u == null ? void 0 : u.message) || "内容格式错误"}`);
2546
- }
2547
- }
2548
- function Ae(u = []) {
2549
- return u.map((c) => ({ ...c }));
2550
- }
2551
- return D({
2552
- search: p,
2553
- handleSearch: s,
2554
- handleQuerySearch: p,
2555
- resetSearch: g,
2556
- getTableRef: () => f.value,
2557
- getTableData: () => I.value,
2558
- getSelection: () => Ae(Q.value)
2559
- }), (u, c) => {
2560
- const N = Oa;
2561
- return v(), ce(Je, Qe($(H), {
2562
- "model-value": t.open,
2563
- title: t.title,
2564
- width: t.width,
2565
- "destroy-on-close": "",
2566
- draggable: "",
2567
- "align-center": "",
2568
- "append-to-body": "",
2569
- onOpened: L,
2570
- onConfirm: je,
2571
- onCancel: Le
2572
- }), {
2573
- default: h(() => [
2574
- z("div", El, [
2575
- R(u.$slots, "side", {}, void 0, !0),
2576
- z("div", jl, [
2577
- t.showSelected ? (v(), A("div", Nl, [
2578
- c[12] || (c[12] = z("span", { class: "qy-selection-dialog__selected-label" }, "已选项", -1)),
2579
- z("div", Hl, [
2580
- (v(!0), A(Re, null, et(Q.value, (o) => (v(), ce(We, {
2581
- key: de(o),
2582
- closable: "",
2583
- class: "qy-selection-dialog__selected-tag",
2584
- onClose: (r) => w(o)
2585
- }, {
2586
- default: h(() => [
2587
- be(pe(De(o)), 1)
2588
- ]),
2589
- _: 2
2590
- }, 1032, ["onClose"]))), 128)),
2591
- Q.value.length ? P("", !0) : (v(), ce(We, {
2592
- key: 0,
2593
- tone: "info"
2594
- }, {
2595
- default: h(() => [...c[9] || (c[9] = [
2596
- be("无", -1)
2597
- ])]),
2598
- _: 1
2599
- }))
2600
- ]),
2601
- t.showCopyPaste ? (v(), A("div", Zl, [
2602
- O($(Ve), {
2603
- size: "small",
2604
- onClick: Ne
2605
- }, {
2606
- default: h(() => [...c[10] || (c[10] = [
2607
- be("复制", -1)
2608
- ])]),
2609
- _: 1
2610
- }),
2611
- O($(Ve), {
2612
- size: "small",
2613
- onClick: c[0] || (c[0] = (o) => j.value = !0)
2614
- }, {
2615
- default: h(() => [...c[11] || (c[11] = [
2616
- be("粘贴", -1)
2617
- ])]),
2618
- _: 1
2619
- })
2620
- ])) : P("", !0)
2621
- ])) : P("", !0),
2622
- ie.value ? (v(), A("div", Wl, [
2623
- O($(wt), {
2624
- class: "qy-selection-dialog__search",
2625
- inline: "",
2626
- model: T
2627
- }, {
2628
- default: h(() => [
2629
- R(u.$slots, "search", {
2630
- query: T,
2631
- search: p,
2632
- reset: g
2633
- }, () => [
2634
- _.value.length ? (v(), ce($(Ie), {
2635
- key: 0,
2636
- label: "分类"
2637
- }, {
2638
- default: h(() => [
2639
- O(St, {
2640
- modelValue: T.category,
2641
- "onUpdate:modelValue": c[1] || (c[1] = (o) => T.category = o),
2642
- class: "qy-selection-dialog__category",
2643
- options: _.value,
2644
- clearable: "",
2645
- filterable: "",
2646
- "check-strictly": "",
2647
- "render-after-expand": !1,
2648
- onChange: p
2649
- }, null, 8, ["modelValue", "options"])
2650
- ]),
2651
- _: 1
2652
- })) : P("", !0),
2653
- X.value.length ? (v(), ce($(Ie), {
2654
- key: 1,
2655
- label: "类型"
2656
- }, {
2657
- default: h(() => [
2658
- O(tt, Qe({
2659
- modelValue: T.type,
2660
- "onUpdate:modelValue": c[2] || (c[2] = (o) => T.type = o),
2661
- class: "qy-selection-dialog__type",
2662
- options: X.value,
2663
- placeholder: "请选择类型",
2664
- clearable: ""
2665
- }, le.value, { onChange: p }), null, 16, ["modelValue", "options"])
2666
- ]),
2667
- _: 1
2668
- })) : P("", !0),
2669
- t.searchKey ? (v(), ce($(Ie), {
2670
- key: 2,
2671
- label: "搜索"
2672
- }, {
2673
- default: h(() => [
2674
- O($(Me), {
2675
- modelValue: T[t.searchKey],
2676
- "onUpdate:modelValue": c[3] || (c[3] = (o) => T[t.searchKey] = o),
2677
- clearable: "",
2678
- placeholder: "请输入",
2679
- class: "qy-selection-dialog__search-input",
2680
- onKeydown: Ee(ue(p, ["prevent"]), ["enter"])
2681
- }, null, 8, ["modelValue", "onKeydown"])
2682
- ]),
2683
- _: 1
2684
- })) : P("", !0),
2685
- O($(Ie), null, {
2686
- default: h(() => [
2687
- O($(Ve), {
2688
- type: "primary",
2689
- onClick: p
2690
- }, {
2691
- default: h(() => [...c[13] || (c[13] = [
2692
- be("查询", -1)
2693
- ])]),
2694
- _: 1
2695
- }),
2696
- O($(Ve), { onClick: g }, {
2697
- default: h(() => [...c[14] || (c[14] = [
2698
- be("重置", -1)
2699
- ])]),
2700
- _: 1
2701
- })
2702
- ]),
2703
- _: 1
2704
- })
2705
- ], !0)
2706
- ]),
2707
- _: 3
2708
- }, 8, ["model"]),
2709
- b.value ? (v(), A("div", Gl, [
2710
- Z.value ? (v(), ce($(Ve), {
2711
- key: 0,
2712
- type: "primary",
2713
- onClick: B
2714
- }, {
2715
- default: h(() => [...c[15] || (c[15] = [
2716
- be(" 新增 ", -1)
2717
- ])]),
2718
- _: 1
2719
- })) : P("", !0),
2720
- R(u.$slots, "toolbar", {
2721
- query: T,
2722
- search: p
2723
- }, void 0, !0),
2724
- R(u.$slots, "bar", {
2725
- query: T,
2726
- search: p
2727
- }, void 0, !0)
2728
- ])) : P("", !0)
2729
- ])) : P("", !0),
2730
- Ye((v(), ce($(Ga), Qe({
2731
- ref_key: "tableRef",
2732
- ref: f,
2733
- data: I.value,
2734
- "row-key": ae.value,
2735
- border: "",
2736
- "highlight-current-row": "",
2737
- "max-height": "550px"
2738
- }, ne.value, {
2739
- onSelectionChange: i,
2740
- onRowClick: Y
2741
- }), {
2742
- default: h(() => {
2743
- var o;
2744
- return [
2745
- U.value === "multiple" ? (v(), ce($(Ja), {
2746
- key: 0,
2747
- type: "selection",
2748
- "reserve-selection": "",
2749
- width: "42",
2750
- selectable: (o = ne.value) == null ? void 0 : o.selectable
2751
- }, null, 8, ["selectable"])) : P("", !0),
2752
- R(u.$slots, "columns", {}, void 0, !0),
2753
- R(u.$slots, "cols", {}, void 0, !0)
2754
- ];
2755
- }),
2756
- _: 3
2757
- }, 16, ["data", "row-key"])), [
2758
- [N, E.value]
2759
- ]),
2760
- t.showPagination && M.value > 0 ? (v(), A("div", Jl, [
2761
- O($(Xa), {
2762
- "current-page": T.page,
2763
- "onUpdate:currentPage": c[4] || (c[4] = (o) => T.page = o),
2764
- "page-size": T.pageSize,
2765
- "onUpdate:pageSize": c[5] || (c[5] = (o) => T.pageSize = o),
2766
- total: M.value,
2767
- "page-sizes": t.pageSizes,
2768
- layout: "total, sizes, prev, pager, next, jumper",
2769
- onSizeChange: C,
2770
- onCurrentChange: s
2771
- }, null, 8, ["current-page", "page-size", "total", "page-sizes"])
2772
- ])) : P("", !0)
2773
- ])
2774
- ]),
2775
- O(Je, {
2776
- modelValue: j.value,
2777
- "onUpdate:modelValue": c[8] || (c[8] = (o) => j.value = o),
2778
- title: "粘贴数据",
2779
- layout: !1,
2780
- width: "560px"
2781
- }, {
2782
- default: h(() => [
2783
- O($(Me), {
2784
- modelValue: G.value,
2785
- "onUpdate:modelValue": c[6] || (c[6] = (o) => G.value = o),
2786
- type: "textarea",
2787
- rows: 8
2788
- }, null, 8, ["modelValue"]),
2789
- z("div", Xl, [
2790
- O($(Ve), {
2791
- onClick: c[7] || (c[7] = (o) => j.value = !1)
2792
- }, {
2793
- default: h(() => [...c[16] || (c[16] = [
2794
- be("取消", -1)
2795
- ])]),
2796
- _: 1
2797
- }),
2798
- O($(Ve), {
2799
- type: "primary",
2800
- onClick: ze
2801
- }, {
2802
- default: h(() => [...c[17] || (c[17] = [
2803
- be("确认", -1)
2804
- ])]),
2805
- _: 1
2806
- })
2807
- ])
2808
- ]),
2809
- _: 1
2810
- }, 8, ["modelValue"])
2811
- ]),
2812
- _: 3
2813
- }, 16, ["model-value", "title", "width"]);
2814
- };
2815
- }
2816
- }), Ct = /* @__PURE__ */ Te(Yl, [["__scopeId", "data-v-31ee3945"]]), en = /* @__PURE__ */ qe({
2817
- name: "QyLegacySelectionDialog",
2818
- inheritAttrs: !1,
2819
- __name: "index",
2820
- props: {
2821
- open: { type: Boolean, default: !0 },
2822
- title: { default: "选择数据" },
2823
- width: { default: "1200px" },
2824
- query: { type: Function, default: void 0 },
2825
- responseFormatter: { type: Function, default: void 0 },
2826
- selection: { default: "single" },
2827
- selected: { default: () => [] },
2828
- mainKey: { default: "" },
2829
- tagName: { default: "" },
2830
- searchKey: { default: "conditions" },
2831
- queryParams: { default: () => ({}) },
2832
- category: { type: [Array, Function, Boolean], default: !1 },
2833
- categoryFormatter: { type: [Function, Array], default: void 0 },
2834
- type: { type: [Array, Boolean], default: !1 },
2835
- typeSelectionProps: { default: () => ({}) },
2836
- tableProps: { default: () => ({}) },
2837
- append: { type: Boolean, default: !1 },
2838
- delete: { type: Boolean, default: !1 },
2839
- select: { default: null }
2840
- },
2841
- emits: ["close", "submit", "openDialog", "changeIndexShow"],
2842
- setup(t, { expose: D, emit: W }) {
2843
- const e = t, n = W, H = Be(), d = q(null), y = Ze({
2844
- category: [],
2845
- code: "",
2846
- ...e.searchKey ? { [e.searchKey]: "" } : {},
2847
- page: 1,
2848
- pageSize: 10,
2849
- type: "",
2850
- ...e.queryParams
2851
- }), f = Ze({
2852
- total: 0,
2853
- tableData: [],
2854
- open: !1,
2855
- selection: [],
2856
- categories: [],
2857
- types: [],
2858
- tableRef: null,
2859
- drag: !1,
2860
- dialogOpen: !1,
2861
- pasteData: "",
2862
- pasteDataDialog: !1
2863
- }), I = F(() => e.type || []), Q = F(() => f.categories), _ = async (s) => {
2864
- if (!e.query) return { data: { records: [], total: 0 } };
2865
- const p = await e.query(le(s)), C = e.responseFormatter ? await e.responseFormatter(p) : p;
2866
- return f.total = L(C), C;
2867
- };
2868
- fe(
2869
- () => e.open,
2870
- (s) => {
2871
- f.open = s;
2872
- },
2873
- { immediate: !0 }
2874
- ), fe(
2875
- I,
2876
- (s) => {
2877
- f.types = [...s];
2878
- },
2879
- { immediate: !0, deep: !0 }
2880
- ), fe(
2881
- [() => e.selected, () => e.open],
2882
- () => {
2883
- e.open && (f.selection = te(e.selected));
2884
- },
2885
- { immediate: !0, deep: !0 }
2886
- ), fe(
2887
- () => e.queryParams,
2888
- () => {
2889
- Object.assign(y, e.queryParams);
2890
- },
2891
- { deep: !0 }
2892
- ), fe(
2893
- () => f.pasteDataDialog,
2894
- (s) => {
2895
- s || (f.pasteData = "");
2896
- }
2897
- ), fe(
2898
- () => e.select,
2899
- async () => {
2900
- e.select && await X(e.select);
2901
- },
2902
- { deep: !0 }
2903
- ), fe(
2904
- () => e.open,
2905
- async (s) => {
2906
- s && (f.dialogOpen = !1, await E());
2907
- },
2908
- { immediate: !0 }
2909
- );
2910
- async function E() {
2911
- if (!e.category) {
2912
- f.categories = [];
2913
- return;
2914
- }
2915
- const s = typeof e.category == "function" ? await e.category() : e.category;
2916
- f.categories = b(s);
2917
- }
2918
- async function M() {
2919
- var s;
2920
- return await Oe(), (s = d.value) == null ? void 0 : s.handleQuerySearch();
2921
- }
2922
- function j(s) {
2923
- f.selection = te(s);
2924
- }
2925
- function G(s) {
2926
- var p;
2927
- f.tableData = s, f.tableRef = (p = d.value) == null ? void 0 : p.getTableRef();
2928
- }
2929
- function T(s) {
2930
- f.selection = te(s), n("submit", f);
2931
- }
2932
- function U() {
2933
- n("close");
2934
- }
2935
- function ae() {
2936
- f.dialogOpen = !0, n("openDialog");
2937
- }
2938
- function J(s) {
2939
- n("changeIndexShow", s);
2940
- }
2941
- async function X(s) {
2942
- if (!e.query || !e.searchKey || !e.mainKey) return;
2943
- const p = await e.query({
2944
- ...y,
2945
- [e.searchKey]: s[e.mainKey],
2946
- category: []
2947
- }), C = e.responseFormatter ? await e.responseFormatter(p) : p, [g] = l(C);
2948
- g && (e.selection === "multi" ? (f.selection = f.selection.filter(
2949
- (B) => B[e.mainKey] !== g[e.mainKey]
2950
- ), f.selection.push(g)) : f.selection = [g]);
2951
- }
2952
- function le(s = {}) {
2953
- y.page = s.page ?? y.page, y.pageSize = s.pageSize ?? y.pageSize;
2954
- const p = {
2955
- ...y,
2956
- category: ne()
2957
- };
2958
- return e.searchKey && (p[e.searchKey] = String(p[e.searchKey] || "").trim()), p;
2959
- }
2960
- function ne() {
2961
- if (e.queryParams.category)
2962
- return e.queryParams.category;
2963
- const s = y.category;
2964
- if (Array.isArray(s)) return s;
2965
- if (!s) return [];
2966
- const p = ie(f.categories, s);
2967
- return p ? Z(p) : [s];
2968
- }
2969
- function ie(s, p) {
2970
- for (const C of s || []) {
2971
- if (C.value === p) return C;
2972
- const g = ie(C.children || [], p);
2973
- if (g) return g;
2974
- }
2975
- }
2976
- function Z(s) {
2977
- return [s.value, ...(s.children || []).flatMap(Z)];
2978
- }
2979
- function b(s) {
2980
- const p = (s == null ? void 0 : s.data) ?? s;
2981
- if (!Array.isArray(p)) return [];
2982
- if (typeof e.categoryFormatter == "function")
2983
- return e.categoryFormatter(p);
2984
- if (Array.isArray(e.categoryFormatter)) {
2985
- const [C, g] = e.categoryFormatter;
2986
- return a(V(p, g), C, g);
2987
- }
2988
- return p;
2989
- }
2990
- function V(s, p) {
2991
- const C = s.map((B) => ({ ...B })), g = [];
2992
- return C.forEach((B) => {
2993
- const re = B.parentCateCode;
2994
- if (!re) {
2995
- g.push(B);
2996
- return;
2997
- }
2998
- const me = C.find((we) => we[p] === re);
2999
- me ? (me.children || (me.children = [])).push(B) : g.push(B);
3000
- }), g;
3001
- }
3002
- function a(s, p, C) {
3003
- return s.map((g) => ({
3004
- ...g,
3005
- label: g[p],
3006
- value: g[C],
3007
- children: Array.isArray(g.children) ? a(g.children, p, C) : g.children
3008
- }));
3009
- }
3010
- function l(s) {
3011
- if (Array.isArray(s)) return s;
3012
- const p = s == null ? void 0 : s.data;
3013
- return Array.isArray(p) ? p : (s == null ? void 0 : s.records) || (s == null ? void 0 : s.rows) || (p == null ? void 0 : p.records) || [];
3014
- }
3015
- function L(s) {
3016
- if (Array.isArray(s)) return s.length;
3017
- const p = l(s), C = s == null ? void 0 : s.data;
3018
- return (s == null ? void 0 : s.total) ?? (Array.isArray(C) ? C.length : C == null ? void 0 : C.total) ?? p.length;
3019
- }
3020
- function te(s = []) {
3021
- return s.map((p) => ({ ...p }));
3022
- }
3023
- return D({
3024
- search: M,
3025
- handleSearch: M,
3026
- handleConditionChange: M,
3027
- getTableRef: () => f.tableRef,
3028
- getTableData: () => f.tableData,
3029
- getSelection: () => te(f.selection)
3030
- }), (s, p) => (v(), A(Re, null, [
3031
- O(Ct, Qe({
3032
- ref_key: "selectionDialogRef",
3033
- ref: d
3034
- }, $(H), {
3035
- modelValue: f.selection,
3036
- "onUpdate:modelValue": p[3] || (p[3] = (C) => f.selection = C),
3037
- open: t.open,
3038
- title: t.title,
3039
- width: t.width,
3040
- query: _,
3041
- "response-formatter": t.responseFormatter,
3042
- selection: t.selection,
3043
- "row-key": t.mainKey,
3044
- "label-key": t.tagName,
3045
- "search-key": t.searchKey,
3046
- "query-params": {},
3047
- "category-options": Q.value,
3048
- "type-options": I.value,
3049
- "type-select-props": t.typeSelectionProps,
3050
- "table-props": t.tableProps,
3051
- "show-copy-paste": !0,
3052
- "show-append": t.append,
3053
- onSelectionChange: j,
3054
- onConfirm: T,
3055
- onCancel: U,
3056
- onAppend: ae,
3057
- onLoaded: G
3058
- }), {
3059
- side: h(() => [
3060
- R(s.$slots, "side", {
3061
- state: f,
3062
- cate: f.categories,
3063
- form: y,
3064
- query: y,
3065
- getData: M,
3066
- search: M,
3067
- changeIndexShow: J
3068
- }, void 0, !0)
3069
- ]),
3070
- search: h(() => [
3071
- O($(wt), {
3072
- inline: "",
3073
- model: y
3074
- }, {
3075
- default: h(() => [
3076
- f.categories.length ? (v(), ce($(Ie), {
3077
- key: 0,
3078
- label: "分类"
3079
- }, {
3080
- default: h(() => [
3081
- O($(Ya), {
3082
- modelValue: y.category,
3083
- "onUpdate:modelValue": p[0] || (p[0] = (C) => y.category = C),
3084
- class: "qy-legacy-selection-dialog__category",
3085
- data: f.categories,
3086
- clearable: "",
3087
- filterable: "",
3088
- "check-strictly": "",
3089
- "render-after-expand": !1,
3090
- onChange: M
3091
- }, null, 8, ["modelValue", "data"])
3092
- ]),
3093
- _: 1
3094
- })) : P("", !0),
3095
- I.value.length ? (v(), ce($(Ie), {
3096
- key: 1,
3097
- label: "类型"
3098
- }, {
3099
- default: h(() => [
3100
- O($(ht), Qe({
3101
- modelValue: y.type,
3102
- "onUpdate:modelValue": p[1] || (p[1] = (C) => y.type = C),
3103
- clearable: ""
3104
- }, t.typeSelectionProps, { onChange: M }), {
3105
- default: h(() => [
3106
- (v(!0), A(Re, null, et(I.value, (C) => (v(), ce($(bt), {
3107
- key: C.value,
3108
- label: C.label,
3109
- value: C.value
3110
- }, null, 8, ["label", "value"]))), 128))
3111
- ]),
3112
- _: 1
3113
- }, 16, ["modelValue"])
3114
- ]),
3115
- _: 1
3116
- })) : P("", !0),
3117
- t.searchKey ? (v(), ce($(Ie), {
3118
- key: 2,
3119
- label: "搜索"
3120
- }, {
3121
- default: h(() => [
3122
- O($(Me), {
3123
- modelValue: y[t.searchKey],
3124
- "onUpdate:modelValue": p[2] || (p[2] = (C) => y[t.searchKey] = C),
3125
- clearable: "",
3126
- class: "qy-legacy-selection-dialog__search-input",
3127
- onKeydown: Ee(ue(M, ["prevent"]), ["enter"])
3128
- }, null, 8, ["modelValue", "onKeydown"])
3129
- ]),
3130
- _: 1
3131
- })) : P("", !0),
3132
- O($(Ie), null, {
3133
- default: h(() => [
3134
- O($(Ve), {
3135
- type: "primary",
3136
- onClick: M
3137
- }, {
3138
- default: h(() => [...p[4] || (p[4] = [
3139
- be("查询", -1)
3140
- ])]),
3141
- _: 1
3142
- })
3143
- ]),
3144
- _: 1
3145
- })
3146
- ]),
3147
- _: 1
3148
- }, 8, ["model"])
3149
- ]),
3150
- toolbar: h(() => [
3151
- R(s.$slots, "bar", {
3152
- query: y,
3153
- search: M
3154
- }, void 0, !0)
3155
- ]),
3156
- columns: h(() => [
3157
- R(s.$slots, "cols", {}, void 0, !0),
3158
- R(s.$slots, "columns", {}, void 0, !0)
3159
- ]),
3160
- _: 3
3161
- }, 16, ["modelValue", "open", "title", "width", "response-formatter", "selection", "row-key", "label-key", "search-key", "category-options", "type-options", "type-select-props", "table-props", "show-append"]),
3162
- R(s.$slots, "dialog", {
3163
- state: f,
3164
- form: y,
3165
- getData: M
3166
- }, void 0, !0)
3167
- ], 64));
3168
- }
3169
- }), tn = /* @__PURE__ */ Te(en, [["__scopeId", "data-v-b54ca11b"]]), an = { class: "qy-form-section__heading" }, on = {
3170
- key: 0,
3171
- class: "qy-form-section__title"
3172
- }, ln = {
3173
- key: 0,
3174
- class: "qy-form-section__description"
3175
- }, nn = { class: "qy-form-section__actions" }, rn = /* @__PURE__ */ qe({
3176
- name: "QyFormSection",
3177
- __name: "index",
3178
- props: {
3179
- title: { default: "" },
3180
- description: { default: "" },
3181
- tip: { default: "" },
3182
- tipType: { default: "info" },
3183
- collapsible: { type: Boolean, default: !1 },
3184
- defaultExpanded: { type: Boolean, default: !0 },
3185
- bordered: { type: Boolean, default: !0 },
3186
- background: { default: "white" },
3187
- bodyClass: { default: "" },
3188
- headerClass: { default: "" }
3189
- },
3190
- emits: ["toggle"],
3191
- setup(t, { emit: D }) {
3192
- const W = t, e = D, n = q(W.defaultExpanded);
3193
- fe(
3194
- () => W.defaultExpanded,
3195
- (y) => {
3196
- n.value = y;
3197
- }
3198
- );
3199
- function H() {
3200
- W.collapsible && (n.value = !n.value, e("toggle", n.value));
3201
- }
3202
- function d() {
3203
- W.collapsible && H();
3204
- }
3205
- return (y, f) => (v(), A("section", {
3206
- class: ke(["qy-form-section", [
3207
- `is-bg-${t.background}`,
3208
- {
3209
- "is-bordered": t.bordered,
3210
- "is-collapsible": t.collapsible
3211
- }
3212
- ]])
3213
- }, [
3214
- z("header", {
3215
- class: ke(["qy-form-section__header", t.headerClass]),
3216
- onClick: d
3217
- }, [
3218
- z("div", an, [
3219
- R(y.$slots, "title", {}, () => [
3220
- t.title ? (v(), A("div", on, pe(t.title), 1)) : P("", !0)
3221
- ], !0),
3222
- R(y.$slots, "description", {}, () => [
3223
- t.description ? (v(), A("div", ln, pe(t.description), 1)) : P("", !0)
3224
- ], !0)
3225
- ]),
3226
- z("div", nn, [
3227
- R(y.$slots, "actions", {}, void 0, !0),
3228
- t.collapsible ? (v(), A("button", {
3229
- key: 0,
3230
- type: "button",
3231
- class: "qy-form-section__toggle",
3232
- onClick: ue(H, ["stop"])
3233
- }, pe(n.value ? "收起" : "展开"), 1)) : P("", !0)
3234
- ])
3235
- ], 2),
3236
- Ye(z("div", {
3237
- class: ke(["qy-form-section__body", t.bodyClass])
3238
- }, [
3239
- R(y.$slots, "tip", {}, () => [
3240
- t.tip ? (v(), A("div", {
3241
- key: 0,
3242
- class: ke(["qy-form-section__tip", `is-${t.tipType}`])
3243
- }, pe(t.tip), 3)) : P("", !0)
3244
- ], !0),
3245
- R(y.$slots, "default", {}, void 0, !0)
3246
- ], 2), [
3247
- [pt, n.value]
3248
- ])
3249
- ], 2));
3250
- }
3251
- }), sn = /* @__PURE__ */ Te(rn, [["__scopeId", "data-v-8149aa01"]]), un = {
3252
- key: 0,
3253
- class: "qy-action-bar__left"
3254
- }, cn = {
3255
- key: 1,
3256
- class: "qy-action-bar__center"
3257
- }, dn = {
3258
- key: 2,
3259
- class: "qy-action-bar__right"
3260
- }, fn = /* @__PURE__ */ qe({
3261
- name: "QyActionBar",
3262
- __name: "index",
3263
- props: {
3264
- sticky: { type: Boolean, default: !0 },
3265
- offsetBottom: { default: 0 },
3266
- bordered: { type: Boolean, default: !0 },
3267
- shadow: { type: Boolean, default: !1 },
3268
- wrap: { type: Boolean, default: !0 },
3269
- justify: { default: "between" },
3270
- background: { default: "#fff" }
3271
- },
3272
- setup(t) {
3273
- const D = t, W = F(() => ({
3274
- // offsetBottom 只负责业务偏移,安全区补偿由 CSS padding 处理。
3275
- bottom: `${D.offsetBottom}px`,
3276
- background: D.background
3277
- }));
3278
- return (e, n) => (v(), A("div", {
3279
- class: ke(["qy-action-bar", [
3280
- `is-justify-${t.justify}`,
3281
- {
3282
- "is-sticky": t.sticky,
3283
- "is-bordered": t.bordered,
3284
- "is-shadow": t.shadow,
3285
- "is-wrap": t.wrap
3286
- }
3287
- ]]),
3288
- style: Pe(W.value)
3289
- }, [
3290
- e.$slots.left ? (v(), A("div", un, [
3291
- R(e.$slots, "left", {}, void 0, !0)
3292
- ])) : P("", !0),
3293
- e.$slots.default ? (v(), A("div", cn, [
3294
- R(e.$slots, "default", {}, void 0, !0)
3295
- ])) : P("", !0),
3296
- e.$slots.right ? (v(), A("div", dn, [
3297
- R(e.$slots, "right", {}, void 0, !0)
3298
- ])) : P("", !0)
3299
- ], 6));
3300
- }
3301
- }), mn = /* @__PURE__ */ Te(fn, [["__scopeId", "data-v-ecba8f49"]]), Vt = S(Qt, "QyUpload"), qt = S(eo, "QyImage"), Bt = S(to, "QyImagePreview"), At = S(sl, "QyImageUpload"), It = S(Je, "QyDialog"), Tt = S(Il, "QyRemarkImage"), zt = S(no, "QyButton"), Rt = S(io, "QyDropdown"), Ft = S(ro, "QyInput"), Pt = S(so, "QyInputNumber"), Dt = S(Tl, "QyMoneyInput"), Mt = S(uo, "QyDatePicker"), Ot = S(co, "QyCheckbox"), _t = S(fo, "QyCheckboxGroup"), Ut = S(mo, "QyRadio"), Lt = S(yo, "QyAutocomplete"), Kt = S(po, "QyMenuActions"), Et = S(
3302
- go,
3303
- "QyTableColumnSettings"
3304
- ), jt = S(vo, "QyRadioGroup"), Nt = S(zl, "QyRemoteSelect"), Ht = S($t, "QySearchInput"), Zt = S(
3305
- Kl,
3306
- "QyRecordQuoteSearch"
3307
- ), Wt = S(tt, "QySelect"), Gt = S(St, "QyTreeSelect"), Jt = S(Ct, "QySelectionDialog"), Xt = S(
3308
- tn,
3309
- "QyLegacySelectionDialog"
3310
- ), Yt = S(sn, "QyFormSection"), ea = S(mn, "QyActionBar"), ta = S(ho, "QyFilePicker"), aa = S(bo, "QySwitch"), oa = S(We, "QyTag"), la = S(wo, "QyBadge"), na = S(So, "QyCascader"), ia = S(ko, "QyTooltip"), ra = S(xo, "QyPopover"), sa = S(Qo, "QySkeleton"), ua = S($o, "QySkeletonItem"), ca = S(Co, "QyTabs"), da = S(Vo, "QyTabPane"), fa = S(qo, "QySteps"), ma = S(Bo, "QyStep"), ya = S(Ao, "QyFullscreen"), pa = S(To, "QyRow"), ga = S(zo, "QyCol"), va = S(Ro, "QyContainer"), ha = S(Fo, "QyAside"), ba = S(Po, "QyMain"), wa = S(Do, "QyDescriptions"), Sa = S(Mo, "QyDescriptionsItem"), ka = S(Oo, "QyCollapse"), xa = S(_o, "QyCollapseItem"), Qa = S(Uo, "QyLink"), $a = S(Lo, "QyDivider"), Ca = S(Ko, "QyEmpty"), Va = S(Eo, "QyAlert"), qa = S(jo, "QyCard"), Ba = S(No, "QyScrollbar"), Aa = S(Ho, "QyProgress"), Ia = S(Zo, "QyStatistic"), Ta = S(Wo, "QyAvatar"), za = S(Go, "QyTree"), Ra = S(Io, "QyIconPicker"), yn = (t) => {
3311
- t.component("QyDialog", It), t.component("QyUpload", Vt), t.component("QyImage", qt), t.component("QyImagePreview", Bt), t.component("QyImageUpload", At), t.component("QyRemarkImage", Tt), t.component("QyButton", zt), t.component("QyDropdown", Rt), t.component("QyInput", Ft), t.component("QyInputNumber", Pt), t.component("QyMoneyInput", Dt), t.component("QyDatePicker", Mt), t.component("QyCheckbox", Ot), t.component("QyCheckboxGroup", _t), t.component("QyRadio", Ut), t.component("QyAutocomplete", Lt), t.component("QyMenuActions", Kt), t.component("QyTableColumnSettings", Et), t.component("QyRadioGroup", jt), t.component("QyRemoteSelect", Nt), t.component("QySearchInput", Ht), t.component("QyRecordQuoteSearch", Zt), t.component("QySelect", Wt), t.component("QyTreeSelect", Gt), t.component("QySelectionDialog", Jt), t.component("QyLegacySelectionDialog", Xt), t.component("QyFormSection", Yt), t.component("QyActionBar", ea), t.component("QyFilePicker", ta), t.component("QySwitch", aa), t.component("QyTag", oa), t.component("QyBadge", la), t.component("QyCascader", na), t.component("QyTooltip", ia), t.component("QyPopover", ra), t.component("QySkeleton", sa), t.component("QySkeletonItem", ua), t.component("QyTabs", ca), t.component("QyTabPane", da), t.component("QySteps", fa), t.component("QyStep", ma), t.component("QyFullscreen", ya), t.component("QyIcon", kt), t.component("QyIconPicker", Ra), t.component("QyRow", pa), t.component("QyCol", ga), t.component("QyContainer", va), t.component("QyAside", ha), t.component("QyMain", ba), t.component("QyDescriptions", wa), t.component("QyDescriptionsItem", Sa), t.component("QyCollapse", ka), t.component("QyCollapseItem", xa), t.component("QyLink", Qa), t.component("QyDivider", $a), t.component("QyEmpty", Ca), t.component("QyAlert", Va), t.component("QyCard", qa), t.component("QyScrollbar", Ba), t.component("QyProgress", Aa), t.component("QyStatistic", Ia), t.component("QyAvatar", Ta), t.component("QyTree", za);
3312
- }, Si = {
3313
- install: yn,
3314
- QyUpload: Vt,
3315
- QyImage: qt,
3316
- QyImagePreview: Bt,
3317
- openQyImagePreview: Jo,
3318
- QyImageUpload: At,
3319
- QyDialog: It,
3320
- QyButton: zt,
3321
- QyDropdown: Rt,
3322
- QyInput: Ft,
3323
- QyInputNumber: Pt,
3324
- QyMoneyInput: Dt,
3325
- QyDatePicker: Mt,
3326
- QyCheckbox: Ot,
3327
- QyCheckboxGroup: _t,
3328
- QyRadio: Ut,
3329
- QyAutocomplete: Lt,
3330
- QyMenuActions: Kt,
3331
- QyTableColumnSettings: Et,
3332
- QyRadioGroup: jt,
3333
- QyRemoteSelect: Nt,
3334
- QySearchInput: Ht,
3335
- QyRecordQuoteSearch: Zt,
3336
- QySelect: Wt,
3337
- QyTreeSelect: Gt,
3338
- QySelectionDialog: Jt,
3339
- QyLegacySelectionDialog: Xt,
3340
- QyFormSection: Yt,
3341
- QyActionBar: ea,
3342
- QyFilePicker: ta,
3343
- QySwitch: aa,
3344
- QyTag: oa,
3345
- QyBadge: la,
3346
- QyCascader: na,
3347
- QyTooltip: ia,
3348
- QyPopover: ra,
3349
- QySkeleton: sa,
3350
- QySkeletonItem: ua,
3351
- QyTabs: ca,
3352
- QyTabPane: da,
3353
- QySteps: fa,
3354
- QyStep: ma,
3355
- QyFullscreen: ya,
3356
- QyIcon: kt,
3357
- QyIconPicker: Ra,
3358
- QyRow: pa,
3359
- QyCol: ga,
3360
- QyContainer: va,
3361
- QyAside: ha,
3362
- QyMain: ba,
3363
- QyDescriptions: wa,
3364
- QyDescriptionsItem: Sa,
3365
- QyCollapse: ka,
3366
- QyCollapseItem: xa,
3367
- QyLink: Qa,
3368
- QyDivider: $a,
3369
- QyEmpty: Ca,
3370
- QyAlert: Va,
3371
- QyCard: qa,
3372
- QyScrollbar: Ba,
3373
- QyProgress: Aa,
3374
- QyStatistic: Ia,
3375
- QyAvatar: Ta,
3376
- QyTree: za,
3377
- QyRemarkImage: Tt
3378
- };
3379
- export {
3380
- aa as $,
3381
- Bt as A,
3382
- At as B,
3383
- Ft as C,
3384
- Pt as D,
3385
- Xt as E,
3386
- Qa as F,
3387
- ba as G,
3388
- Kt as H,
3389
- Dt as I,
3390
- ra as J,
3391
- Aa as K,
3392
- Ut as L,
3393
- jt as M,
3394
- Zt as N,
3395
- Tt as O,
3396
- Nt as P,
3397
- ea as Q,
3398
- pa as R,
3399
- Ba as S,
3400
- Ht as T,
3401
- Wt as U,
3402
- Jt as V,
3403
- sa as W,
3404
- ua as X,
3405
- Ia as Y,
3406
- ma as Z,
3407
- fa as _,
3408
- Va as a,
3409
- da as a0,
3410
- Et as a1,
3411
- ca as a2,
3412
- oa as a3,
3413
- ia as a4,
3414
- za as a5,
3415
- Gt as a6,
3416
- Vt as a7,
3417
- Si as a8,
3418
- wl as a9,
3419
- st as aa,
3420
- ut as ab,
3421
- ha as b,
3422
- Lt as c,
3423
- Ta as d,
3424
- la as e,
3425
- zt as f,
3426
- qa as g,
3427
- na as h,
3428
- Ot as i,
3429
- _t as j,
3430
- ga as k,
3431
- ka as l,
3432
- xa as m,
3433
- va as n,
3434
- Mt as o,
3435
- wa as p,
3436
- Sa as q,
3437
- It as r,
3438
- $a as s,
3439
- Rt as t,
3440
- Ca as u,
3441
- ta as v,
3442
- Yt as w,
3443
- ya as x,
3444
- Ra as y,
3445
- qt as z
3446
- };