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