@qynpm/ui 1.0.22 → 1.0.24

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