@qynpm/ui 1.0.18 → 1.0.21
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 +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/dist/qy-action-bar/index.cjs +1 -1
- package/dist/qy-action-bar/index.mjs +1 -1
- package/dist/qy-autocomplete/index.cjs +1 -1
- package/dist/qy-autocomplete/index.mjs +1 -1
- package/dist/qy-checkbox/index.cjs +1 -1
- package/dist/qy-checkbox/index.mjs +1 -1
- package/dist/qy-date-picker/index.cjs +1 -1
- package/dist/qy-date-picker/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-preview/index.cjs +1 -1
- package/dist/qy-image-preview/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-input/index.cjs +1 -1
- package/dist/qy-input/index.mjs +1 -1
- package/dist/qy-input-number/index.cjs +1 -1
- package/dist/qy-input-number/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-radio-group/index.cjs +1 -1
- package/dist/qy-radio-group/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-select/index.cjs +1 -1
- package/dist/qy-select/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-COjhEDRy.cjs +1 -0
- package/dist/shared/index-D6KfrXN6.mjs +4429 -0
- package/package.json +1 -1
- package/dist/shared/index-BycHYJ4s.cjs +0 -1
- package/dist/shared/index-D4tsKXQA.mjs +0 -4369
|
@@ -1,4369 +0,0 @@
|
|
|
1
|
-
import { ElUpload as _t, ElIcon as pt, ElPopover as el, ElInput as tl, ElImageViewer as ll, ElDialog as yt, ElLoadingDirective as al } from "element-plus/es";
|
|
2
|
-
import { ref as U, onMounted as Je, computed as F, watch as re, nextTick as De, onBeforeUnmount as Ye, openBlock as V, createElementBlock as H, normalizeStyle as Ae, normalizeClass as he, createVNode as J, withCtx as S, withModifiers as ue, unref as C, Fragment as Be, createElementVNode as W, toDisplayString as fe, createCommentVNode as X, createBlock as ee, createTextVNode as me, h as We, createApp as nl, defineComponent as se, renderSlot as O, useAttrs as pe, mergeProps as ie, useSlots as _e, useModel as ol, watchEffect as rl, onUnmounted as gt, resolveComponent as ul, createSlots as Re, withDirectives as et, vShow as ht, mergeModels as ut, renderList as Ue, withKeys as Ke, resolveDynamicComponent as il, Comment as sl, normalizeProps as Oe, guardReactiveProps as Qe, getCurrentInstance as dl, reactive as Ze } from "vue";
|
|
3
|
-
import { Plus as cl, InfoFilled as fl, PictureFilled as it } from "@element-plus/icons-vue";
|
|
4
|
-
import { ElMessage as ge, ElLoading as ml, ElImageViewer as vt, ElImage as pl, ElIcon as st, ElButton as ke, ElSelect as tt, ElOption as lt, ElInput as Me, ElPopover as yl, ElUpload as gl, ElInputNumber as hl, ElDatePicker as vl, ElCheckbox as bl, ElAutocomplete as bt, ElRadioButton as wl, ElRadio as kl, ElRadioGroup as Sl, ElTreeSelect as wt, ElTag as dt, ElForm as kt, ElFormItem as Ie, ElTable as Vl, ElTableColumn as xl, ElPagination as Cl } from "element-plus";
|
|
5
|
-
import { _ as ze, w as oe } from "./install-DMq9RQ-h.mjs";
|
|
6
|
-
import $l from "clsx";
|
|
7
|
-
import { useBreakpoints as Bl, useDraggable as zl } from "@vueuse/core";
|
|
8
|
-
import { M as ql } from "./index-B4JNbDHG.mjs";
|
|
9
|
-
import { T as Il } from "./index-BWIOoRpy.mjs";
|
|
10
|
-
/*! js-cookie v3.0.5 | MIT */
|
|
11
|
-
function Ee(t) {
|
|
12
|
-
for (var b = 1; b < arguments.length; b++) {
|
|
13
|
-
var w = arguments[b];
|
|
14
|
-
for (var e in w)
|
|
15
|
-
t[e] = w[e];
|
|
16
|
-
}
|
|
17
|
-
return t;
|
|
18
|
-
}
|
|
19
|
-
var Rl = {
|
|
20
|
-
read: function(t) {
|
|
21
|
-
return t[0] === '"' && (t = t.slice(1, -1)), t.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
|
|
22
|
-
},
|
|
23
|
-
write: function(t) {
|
|
24
|
-
return encodeURIComponent(t).replace(
|
|
25
|
-
/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,
|
|
26
|
-
decodeURIComponent
|
|
27
|
-
);
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
function Ge(t, b) {
|
|
31
|
-
function w(a, A, u) {
|
|
32
|
-
if (!(typeof document > "u")) {
|
|
33
|
-
u = Ee({}, b, u), typeof u.expires == "number" && (u.expires = new Date(Date.now() + u.expires * 864e5)), u.expires && (u.expires = u.expires.toUTCString()), a = encodeURIComponent(a).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
|
|
34
|
-
var c = "";
|
|
35
|
-
for (var f in u)
|
|
36
|
-
u[f] && (c += "; " + f, u[f] !== !0 && (c += "=" + u[f].split(";")[0]));
|
|
37
|
-
return document.cookie = a + "=" + t.write(A, a) + c;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
function e(a) {
|
|
41
|
-
if (!(typeof document > "u" || arguments.length && !a)) {
|
|
42
|
-
for (var A = document.cookie ? document.cookie.split("; ") : [], u = {}, c = 0; c < A.length; c++) {
|
|
43
|
-
var f = A[c].split("="), B = f.slice(1).join("=");
|
|
44
|
-
try {
|
|
45
|
-
var R = decodeURIComponent(f[0]);
|
|
46
|
-
if (u[R] = t.read(B, R), a === R)
|
|
47
|
-
break;
|
|
48
|
-
} catch {
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
return a ? u[a] : u;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
return Object.create(
|
|
55
|
-
{
|
|
56
|
-
set: w,
|
|
57
|
-
get: e,
|
|
58
|
-
remove: function(a, A) {
|
|
59
|
-
w(
|
|
60
|
-
a,
|
|
61
|
-
"",
|
|
62
|
-
Ee({}, A, {
|
|
63
|
-
expires: -1
|
|
64
|
-
})
|
|
65
|
-
);
|
|
66
|
-
},
|
|
67
|
-
withAttributes: function(a) {
|
|
68
|
-
return Ge(this.converter, Ee({}, this.attributes, a));
|
|
69
|
-
},
|
|
70
|
-
withConverter: function(a) {
|
|
71
|
-
return Ge(Ee({}, this.converter, a), this.attributes);
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
attributes: { value: Object.freeze(b) },
|
|
76
|
-
converter: { value: Object.freeze(t) }
|
|
77
|
-
}
|
|
78
|
-
);
|
|
79
|
-
}
|
|
80
|
-
var St = Ge(Rl, { path: "/" });
|
|
81
|
-
const Al = "Admin-Token";
|
|
82
|
-
function Tl(t = Al) {
|
|
83
|
-
return St.get(t);
|
|
84
|
-
}
|
|
85
|
-
const Pl = { class: "qy-upload__hint" }, Ml = ["placeholder", "disabled"], Fl = ["src"], Ol = {
|
|
86
|
-
key: 1,
|
|
87
|
-
class: "qy-upload__tip"
|
|
88
|
-
}, Ql = { class: "error" }, Dl = { class: "error" }, Ul = /* @__PURE__ */ Object.assign({
|
|
89
|
-
name: "QyUpload"
|
|
90
|
-
}, {
|
|
91
|
-
__name: "index",
|
|
92
|
-
props: {
|
|
93
|
-
/**
|
|
94
|
-
* 受控值。valueFormat 为 object 时结构为 { files, text },
|
|
95
|
-
* array 时为 string[],string 时为逗号分隔 URL。
|
|
96
|
-
*/
|
|
97
|
-
modelValue: { type: [Object, Array, String], default: void 0 },
|
|
98
|
-
/**
|
|
99
|
-
* 初始值,结构为 { files: '逗号分隔的URL', text: '文字内容' }
|
|
100
|
-
* 非受控模式,仅初始化时读取一次
|
|
101
|
-
*/
|
|
102
|
-
defaultValue: { type: Object, default: () => ({ files: "", text: "" }) },
|
|
103
|
-
/** v-model 输出格式:object | array | string */
|
|
104
|
-
valueFormat: { type: String, default: "object" },
|
|
105
|
-
/** 是否显示底部文字备注区 */
|
|
106
|
-
showText: { type: Boolean, default: !0 },
|
|
107
|
-
/** 是否显示纯粘贴输入条,不保存文字,仅用于承接 Ctrl+V 图片 */
|
|
108
|
-
showPasteInput: { type: Boolean, default: !1 },
|
|
109
|
-
/** 文字区占位文案,也用于凭证上传的粘贴提示 */
|
|
110
|
-
pastePlaceholder: { type: String, default: "输入文字" },
|
|
111
|
-
/** 是否多选 */
|
|
112
|
-
multiple: { type: Boolean, default: !0 },
|
|
113
|
-
/** 是否禁用 */
|
|
114
|
-
disabled: { type: Boolean, default: !1 },
|
|
115
|
-
/** 允许的文件类型后缀(如 ['jpg', 'mp4']) */
|
|
116
|
-
fileType: { type: Array, default: () => [] },
|
|
117
|
-
/** 单个文件大小限制(MB) */
|
|
118
|
-
fileSize: { type: Number, default: 10 },
|
|
119
|
-
/** 文件数量限制 */
|
|
120
|
-
limit: { type: Number, default: 9 },
|
|
121
|
-
/** 是否显示格式/大小提示 */
|
|
122
|
-
isShowTip: { type: Boolean, default: !1 },
|
|
123
|
-
/** 接口路径 */
|
|
124
|
-
api: { type: String, default: "/permission-api/common/uploads" },
|
|
125
|
-
/** FormData 中文件字段名 */
|
|
126
|
-
name: { type: String, default: "file" },
|
|
127
|
-
/** token 读取 key,对应 utils/auth 中的存储字段 */
|
|
128
|
-
tokenKey: { type: String, default: "Admin-Token" },
|
|
129
|
-
/** 是否支持视频模式(强制 limit=1) */
|
|
130
|
-
supportVideo: { type: Boolean, default: !1 },
|
|
131
|
-
/**
|
|
132
|
-
* 卡片尺寸
|
|
133
|
-
* 预设:'large'(160px) | 'default'(140px) | 'small'(80px)
|
|
134
|
-
* 自定义:任意 CSS 单位,如 '60px'、'8vw'
|
|
135
|
-
*/
|
|
136
|
-
size: { type: String, default: "default" },
|
|
137
|
-
/** 禁用拖拽(默认在触发区开启) */
|
|
138
|
-
disableDrag: { type: Boolean, default: !1 },
|
|
139
|
-
/** 成功回调(用于复杂业务联动) */
|
|
140
|
-
callBack: { type: Function, default: null },
|
|
141
|
-
/** 上传时附加的额外 FormData 字段 */
|
|
142
|
-
extraData: { type: Object, default: () => ({}) },
|
|
143
|
-
/** 自定义上传请求,用于接入宿主项目 request / 鉴权 / baseURL。 */
|
|
144
|
-
uploadRequest: { type: Function, default: null }
|
|
145
|
-
},
|
|
146
|
-
emits: [
|
|
147
|
-
"update:modelValue",
|
|
148
|
-
"change",
|
|
149
|
-
"success",
|
|
150
|
-
"error",
|
|
151
|
-
"remove"
|
|
152
|
-
],
|
|
153
|
-
setup(t, { expose: b, emit: w }) {
|
|
154
|
-
const e = t, a = w, A = U(null), u = U([]), c = U(null), f = U(null), B = [];
|
|
155
|
-
let R = !1;
|
|
156
|
-
const K = U(!1), I = U([]), Q = U(0), h = U(!1), j = U(""), P = U(""), G = /* @__PURE__ */ new Set(), E = U(!1), d = U(""), x = U(!1);
|
|
157
|
-
Je(() => {
|
|
158
|
-
e.modelValue === void 0 && $(e.defaultValue);
|
|
159
|
-
});
|
|
160
|
-
const i = F(() => ({ large: "160px", default: "140px", small: "80px" })[e.size] ?? e.size), Z = F(() => e.disabled), Y = F(
|
|
161
|
-
() => {
|
|
162
|
-
var s;
|
|
163
|
-
return e.isShowTip && (e.fileSize || ((s = k.value) == null ? void 0 : s.length));
|
|
164
|
-
}
|
|
165
|
-
), k = F(() => {
|
|
166
|
-
var s;
|
|
167
|
-
return (s = e.fileType) != null && s.length ? e.fileType.map((g) => g.toLowerCase()) : e.supportVideo ? ["mp4", "mov", "avi"] : ["jpg", "jpeg", "png", "gif", "webp"];
|
|
168
|
-
}), v = F(() => {
|
|
169
|
-
const s = e.supportVideo ? 1 : e.limit;
|
|
170
|
-
return u.value.length >= s;
|
|
171
|
-
}), D = F(
|
|
172
|
-
() => k.value.map((s) => `.${s}`).join(",")
|
|
173
|
-
), l = F(() => ({
|
|
174
|
-
"qy-upload--reached-limit": v.value,
|
|
175
|
-
"qy-upload--disabled": e.disabled,
|
|
176
|
-
"qy-upload--video": e.supportVideo,
|
|
177
|
-
"qy-upload--without-text": !e.showText && !e.showPasteInput
|
|
178
|
-
}));
|
|
179
|
-
re(d, () => {
|
|
180
|
-
R || _();
|
|
181
|
-
}), re(
|
|
182
|
-
() => e.modelValue,
|
|
183
|
-
(s) => {
|
|
184
|
-
s !== void 0 && $(s);
|
|
185
|
-
},
|
|
186
|
-
{ immediate: !0, deep: !0 }
|
|
187
|
-
);
|
|
188
|
-
function n(s) {
|
|
189
|
-
return Array.isArray(s) ? s.filter(Boolean) : s ? String(s).split(",").filter(Boolean) : [];
|
|
190
|
-
}
|
|
191
|
-
function M(s) {
|
|
192
|
-
return Array.isArray(s) ? { files: s, text: "" } : typeof s == "string" ? { files: n(s), text: "" } : s && typeof s == "object" ? {
|
|
193
|
-
files: n(s.files),
|
|
194
|
-
text: s.text ?? ""
|
|
195
|
-
} : { files: [], text: "" };
|
|
196
|
-
}
|
|
197
|
-
function le(s = []) {
|
|
198
|
-
return s.map((g, o) => ({
|
|
199
|
-
name: String(g).split("/").pop() || `file-${o}`,
|
|
200
|
-
url: g,
|
|
201
|
-
status: "success",
|
|
202
|
-
uid: Date.now() + o
|
|
203
|
-
}));
|
|
204
|
-
}
|
|
205
|
-
function y(s) {
|
|
206
|
-
const g = new Set(s.map((r) => r.url)), o = u.value.filter(
|
|
207
|
-
(r) => r.status === "uploading" && !g.has(r.url)
|
|
208
|
-
);
|
|
209
|
-
return [...s, ...o];
|
|
210
|
-
}
|
|
211
|
-
function $(s) {
|
|
212
|
-
const g = M(s);
|
|
213
|
-
R = !0, d.value = g.text, u.value = y(le(g.files)), De(() => {
|
|
214
|
-
R = !1;
|
|
215
|
-
});
|
|
216
|
-
}
|
|
217
|
-
function N(s) {
|
|
218
|
-
return e.valueFormat === "array" ? s.files : e.valueFormat === "string" ? s.files.join(",") : s;
|
|
219
|
-
}
|
|
220
|
-
function z() {
|
|
221
|
-
var s;
|
|
222
|
-
(s = c.value) == null || s.focus();
|
|
223
|
-
}
|
|
224
|
-
function m(s) {
|
|
225
|
-
s.target.value = "";
|
|
226
|
-
}
|
|
227
|
-
function _(s) {
|
|
228
|
-
const r = { files: (s ?? u.value).filter((T) => T.status === "success" && T.url).map((T) => T.url), text: d.value };
|
|
229
|
-
a("update:modelValue", N(r)), a("change", r), e.callBack && e.callBack(r);
|
|
230
|
-
}
|
|
231
|
-
function ae(s, g) {
|
|
232
|
-
_(g), a("remove", s, g);
|
|
233
|
-
}
|
|
234
|
-
function ve(s) {
|
|
235
|
-
var r;
|
|
236
|
-
if (!(s.size / 1024 / 1024 < e.fileSize))
|
|
237
|
-
return ge.warning(`文件大小不能超过${e.fileSize}M`), !1;
|
|
238
|
-
const o = ((r = s.name.split(".").pop()) == null ? void 0 : r.toLowerCase()) || "";
|
|
239
|
-
return k.value.includes(o) ? !0 : (ge.warning(
|
|
240
|
-
`格式不支持,仅允许: ${k.value.join("/")}`
|
|
241
|
-
), !1);
|
|
242
|
-
}
|
|
243
|
-
async function xe(s, g, o, r) {
|
|
244
|
-
const T = $e(s);
|
|
245
|
-
try {
|
|
246
|
-
const q = await e.uploadRequest({
|
|
247
|
-
file: s,
|
|
248
|
-
formData: T,
|
|
249
|
-
api: e.api,
|
|
250
|
-
name: e.name,
|
|
251
|
-
tokenKey: e.tokenKey,
|
|
252
|
-
extraData: e.extraData
|
|
253
|
-
}), ne = Ce(q);
|
|
254
|
-
if (!ne) {
|
|
255
|
-
const Ve = new Error("上传失败,未返回文件地址");
|
|
256
|
-
ge.error(Ve.message), a("error", Ve), o == null || o(Ve);
|
|
257
|
-
return;
|
|
258
|
-
}
|
|
259
|
-
ge.success("上传成功"), g == null || g({ ...typeof q == "object" && q ? q : {}, url: ne });
|
|
260
|
-
} catch (q) {
|
|
261
|
-
ge.error("上传失败"), a("error", q), o == null || o(q);
|
|
262
|
-
} finally {
|
|
263
|
-
r.close();
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
function $e(s) {
|
|
267
|
-
const g = new FormData();
|
|
268
|
-
return g.append(e.name, s), e.extraData && Object.entries(e.extraData).forEach(([o, r]) => g.append(o, r)), g;
|
|
269
|
-
}
|
|
270
|
-
function Ce(s) {
|
|
271
|
-
var r, T;
|
|
272
|
-
if (typeof s == "string") return s;
|
|
273
|
-
const g = s || {}, o = g.urls ?? g.url ?? ((r = g.data) == null ? void 0 : r.urls) ?? ((T = g.data) == null ? void 0 : T.url) ?? "";
|
|
274
|
-
return Array.isArray(o) ? o[0] || "" : o || "";
|
|
275
|
-
}
|
|
276
|
-
function p(s, g, o, r) {
|
|
277
|
-
var ot, rt;
|
|
278
|
-
const T = ((ot = A.value) == null ? void 0 : ot.$el.querySelector(".el-upload--picture-card")) || ((rt = A.value) == null ? void 0 : rt.$el), q = ml.service({
|
|
279
|
-
target: T,
|
|
280
|
-
text: "上传中",
|
|
281
|
-
background: "rgba(255,255,255,0.7)"
|
|
282
|
-
});
|
|
283
|
-
if (e.uploadRequest) {
|
|
284
|
-
xe(s, o, r, q);
|
|
285
|
-
return;
|
|
286
|
-
}
|
|
287
|
-
const ne = e.api.startsWith("http") ? e.api : window.location.origin + e.api.replace(/^([^/])/, "/$1"), Ve = $e(s), ye = new XMLHttpRequest();
|
|
288
|
-
B.push(ye);
|
|
289
|
-
const we = () => {
|
|
290
|
-
const ce = B.indexOf(ye);
|
|
291
|
-
ce !== -1 && B.splice(ce, 1), q.close();
|
|
292
|
-
};
|
|
293
|
-
ye.open("POST", ne);
|
|
294
|
-
const nt = Tl(e.tokenKey);
|
|
295
|
-
nt && ye.setRequestHeader("Authorization", `Bearer ${nt}`), ye.upload.onprogress = (ce) => {
|
|
296
|
-
ce.total > 0 && (g == null || g({ percent: ce.loaded / ce.total * 100 }));
|
|
297
|
-
}, ye.onload = () => {
|
|
298
|
-
if (we(), ye.status < 200 || ye.status >= 300) {
|
|
299
|
-
const ce = `上传失败 (HTTP ${ye.status})`;
|
|
300
|
-
ge.error(ce), a("error", { msg: ce, status: ye.status }), r == null || r(new Error(ce));
|
|
301
|
-
return;
|
|
302
|
-
}
|
|
303
|
-
try {
|
|
304
|
-
const ce = JSON.parse(ye.responseText);
|
|
305
|
-
ce.code === 200 && ce.urls ? (ge.success("上传成功"), o == null || o({ ...ce, url: ce.urls })) : (ge.error(ce.msg || "上传失败"), a("error", ce), r == null || r(ce));
|
|
306
|
-
} catch {
|
|
307
|
-
ge.error("上传失败,响应格式错误"), a("error", new Error("Response parse error")), r == null || r(new Error("Response parse error"));
|
|
308
|
-
}
|
|
309
|
-
}, ye.onerror = () => {
|
|
310
|
-
we(), ge.error("上传失败,网络异常"), a("error", new Error("Network error")), r == null || r(new Error("Network error"));
|
|
311
|
-
}, ye.send(Ve);
|
|
312
|
-
}
|
|
313
|
-
function L(s) {
|
|
314
|
-
return e.disabled ? !1 : ve(s);
|
|
315
|
-
}
|
|
316
|
-
function te(s, g) {
|
|
317
|
-
const o = u.value.find(
|
|
318
|
-
(r) => {
|
|
319
|
-
var T;
|
|
320
|
-
return r.uid === (s == null ? void 0 : s.uid) || ((T = r.raw) == null ? void 0 : T.uid) === (s == null ? void 0 : s.uid);
|
|
321
|
-
}
|
|
322
|
-
);
|
|
323
|
-
o && (o.url = g, o.status = "success");
|
|
324
|
-
}
|
|
325
|
-
function be(s) {
|
|
326
|
-
p(
|
|
327
|
-
s.file,
|
|
328
|
-
s.onProgress,
|
|
329
|
-
(g) => {
|
|
330
|
-
te(s.file, g.url), s.onSuccess(g), _(), a("success", g);
|
|
331
|
-
},
|
|
332
|
-
(g) => s.onError(g)
|
|
333
|
-
);
|
|
334
|
-
}
|
|
335
|
-
function Se(s) {
|
|
336
|
-
var r;
|
|
337
|
-
if (!s.url) return;
|
|
338
|
-
const g = ((r = s.url.split(".").pop()) == null ? void 0 : r.toLowerCase()) || "";
|
|
339
|
-
if (["mp4", "mov", "avi", "webm"].includes(g)) {
|
|
340
|
-
j.value = s.url, P.value = s.name || "视频预览", h.value = !0;
|
|
341
|
-
return;
|
|
342
|
-
}
|
|
343
|
-
const o = u.value.filter(
|
|
344
|
-
(T) => {
|
|
345
|
-
var q;
|
|
346
|
-
return T.status === "success" && T.url && !["mp4", "mov", "avi", "webm"].includes(
|
|
347
|
-
(q = T.url.split(".").pop()) == null ? void 0 : q.toLowerCase()
|
|
348
|
-
);
|
|
349
|
-
}
|
|
350
|
-
);
|
|
351
|
-
I.value = o.map((T) => T.url), Q.value = o.findIndex((T) => T.uid === s.uid) || 0, K.value = !0;
|
|
352
|
-
}
|
|
353
|
-
function de() {
|
|
354
|
-
K.value = !1, I.value = [];
|
|
355
|
-
}
|
|
356
|
-
function Te(s) {
|
|
357
|
-
for (let g = 0; g < s.length; g++) {
|
|
358
|
-
const o = s[g];
|
|
359
|
-
if (!L(o)) continue;
|
|
360
|
-
const r = Date.now() + g, T = URL.createObjectURL(o);
|
|
361
|
-
G.add(T), u.value.push({
|
|
362
|
-
uid: r,
|
|
363
|
-
name: o.name || `file-${r}`,
|
|
364
|
-
status: "uploading",
|
|
365
|
-
percentage: 0,
|
|
366
|
-
url: T
|
|
367
|
-
}), p(
|
|
368
|
-
o,
|
|
369
|
-
(q) => {
|
|
370
|
-
const ne = u.value.find((Ve) => Ve.uid === r);
|
|
371
|
-
ne && (ne.percentage = q.percent);
|
|
372
|
-
},
|
|
373
|
-
(q) => {
|
|
374
|
-
const ne = u.value.find((Ve) => Ve.uid === r);
|
|
375
|
-
ne && (ne.status = "success", ne.url = q.url, _(), a("success", q));
|
|
376
|
-
},
|
|
377
|
-
() => Ne(r)
|
|
378
|
-
);
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
function qe(s) {
|
|
382
|
-
var r;
|
|
383
|
-
if (e.disabled) return;
|
|
384
|
-
const g = (r = s.clipboardData) == null ? void 0 : r.items;
|
|
385
|
-
if (!g) return;
|
|
386
|
-
const o = [];
|
|
387
|
-
for (let T = 0; T < g.length; T++) {
|
|
388
|
-
const q = g[T];
|
|
389
|
-
if (q.kind === "file" && q.type.startsWith("image/")) {
|
|
390
|
-
const ne = q.getAsFile();
|
|
391
|
-
ne && o.push(ne);
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
o.length && (s.preventDefault(), Te(o));
|
|
395
|
-
}
|
|
396
|
-
function Pe() {
|
|
397
|
-
e.disabled || e.disableDrag || (E.value = !0);
|
|
398
|
-
}
|
|
399
|
-
function Le() {
|
|
400
|
-
E.value = !1;
|
|
401
|
-
}
|
|
402
|
-
function je(s) {
|
|
403
|
-
var o;
|
|
404
|
-
if (E.value = !1, e.disabled || e.disableDrag || v.value) return;
|
|
405
|
-
const g = Array.from(((o = s.dataTransfer) == null ? void 0 : o.files) || []).filter(
|
|
406
|
-
(r) => {
|
|
407
|
-
var T;
|
|
408
|
-
return k.value.includes((T = r.name.split(".").pop()) == null ? void 0 : T.toLowerCase());
|
|
409
|
-
}
|
|
410
|
-
);
|
|
411
|
-
g.length && Te(g);
|
|
412
|
-
}
|
|
413
|
-
function Ne(s) {
|
|
414
|
-
var o;
|
|
415
|
-
const g = u.value.findIndex((r) => r.uid === s);
|
|
416
|
-
g !== -1 && ((o = u.value[g].url) != null && o.startsWith("blob:") && (URL.revokeObjectURL(u.value[g].url), G.delete(u.value[g].url)), u.value.splice(g, 1));
|
|
417
|
-
}
|
|
418
|
-
return Ye(() => {
|
|
419
|
-
B.forEach((s) => s.abort()), B.length = 0, G.forEach((s) => URL.revokeObjectURL(s)), G.clear();
|
|
420
|
-
}), b({
|
|
421
|
-
/** 主动打开文件选择框,供表单或快捷操作调用 */
|
|
422
|
-
openFileDialog: () => {
|
|
423
|
-
var s, g;
|
|
424
|
-
e.disabled || v.value || (g = (s = A.value) == null ? void 0 : s.$el.querySelector('input[type="file"]')) == null || g.click();
|
|
425
|
-
},
|
|
426
|
-
/** 获取已上传成功的文件 URL 列表 */
|
|
427
|
-
getPathList: () => u.value.filter((s) => s.status === "success").map((s) => s.url),
|
|
428
|
-
/** 清空文件和文字,并同步 change 事件 */
|
|
429
|
-
clearFiles: () => {
|
|
430
|
-
u.value = [], d.value = "", _();
|
|
431
|
-
},
|
|
432
|
-
/** 获取完整值,结构与 change 事件保持一致 */
|
|
433
|
-
getValue: () => ({
|
|
434
|
-
files: u.value.filter((s) => s.status === "success" && s.url).map((s) => s.url),
|
|
435
|
-
text: d.value
|
|
436
|
-
}),
|
|
437
|
-
/** 获取按 valueFormat 输出的值,便于外部不走 v-model 时读取 */
|
|
438
|
-
getModelValue: () => N({
|
|
439
|
-
files: u.value.filter((s) => s.status === "success" && s.url).map((s) => s.url),
|
|
440
|
-
text: d.value
|
|
441
|
-
})
|
|
442
|
-
}), (s, g) => {
|
|
443
|
-
var ye;
|
|
444
|
-
const o = pt, r = tl, T = el, q = _t, ne = ll, Ve = yt;
|
|
445
|
-
return V(), H("div", {
|
|
446
|
-
class: he(["qy-upload", l.value]),
|
|
447
|
-
style: Ae({ "--qy-upload-size": i.value })
|
|
448
|
-
}, [
|
|
449
|
-
J(q, {
|
|
450
|
-
ref_key: "uploadRef",
|
|
451
|
-
ref: A,
|
|
452
|
-
"file-list": u.value,
|
|
453
|
-
"onUpdate:fileList": g[6] || (g[6] = (we) => u.value = we),
|
|
454
|
-
action: "#",
|
|
455
|
-
multiple: t.supportVideo ? !1 : t.multiple,
|
|
456
|
-
limit: t.supportVideo ? 1 : t.limit,
|
|
457
|
-
"list-type": t.supportVideo ? "text" : "picture-card",
|
|
458
|
-
accept: D.value,
|
|
459
|
-
disabled: Z.value,
|
|
460
|
-
"http-request": be,
|
|
461
|
-
"before-upload": L,
|
|
462
|
-
"on-preview": Se,
|
|
463
|
-
"on-remove": ae
|
|
464
|
-
}, {
|
|
465
|
-
default: S(() => [
|
|
466
|
-
v.value ? X("", !0) : (V(), H("div", {
|
|
467
|
-
key: 0,
|
|
468
|
-
class: he(["qy-upload__trigger", { "is-dragover": E.value }]),
|
|
469
|
-
onPaste: qe,
|
|
470
|
-
onDragover: ue(Pe, ["prevent"]),
|
|
471
|
-
onDragleave: ue(Le, ["prevent"]),
|
|
472
|
-
onDrop: ue(je, ["prevent"])
|
|
473
|
-
}, [
|
|
474
|
-
J(o, { class: "qy-upload__icon" }, {
|
|
475
|
-
default: S(() => [
|
|
476
|
-
J(C(cl))
|
|
477
|
-
]),
|
|
478
|
-
_: 1
|
|
479
|
-
}),
|
|
480
|
-
t.supportVideo ? (V(), H(Be, { key: 0 }, [
|
|
481
|
-
g[9] || (g[9] = W("span", { class: "qy-upload__label" }, "点击上传视频", -1)),
|
|
482
|
-
W("span", Pl, "支持 " + fe(k.value.join(" / ")) + ",不超过 " + fe(t.fileSize) + "MB", 1)
|
|
483
|
-
], 64)) : X("", !0),
|
|
484
|
-
t.showText ? (V(), H("div", {
|
|
485
|
-
key: 1,
|
|
486
|
-
class: "qy-upload__text",
|
|
487
|
-
onClick: g[3] || (g[3] = ue(() => {
|
|
488
|
-
}, ["stop"])),
|
|
489
|
-
onPaste: ue(qe, ["stop"])
|
|
490
|
-
}, [
|
|
491
|
-
J(T, {
|
|
492
|
-
visible: x.value,
|
|
493
|
-
"onUpdate:visible": g[2] || (g[2] = (we) => x.value = we),
|
|
494
|
-
placement: "bottom-start",
|
|
495
|
-
width: 220,
|
|
496
|
-
trigger: "click",
|
|
497
|
-
"popper-class": "qy-upload__text-popover",
|
|
498
|
-
onAfterEnter: z
|
|
499
|
-
}, {
|
|
500
|
-
reference: S(() => [
|
|
501
|
-
W("div", {
|
|
502
|
-
class: he(["qy-upload__text-preview", { "is-placeholder": !d.value }])
|
|
503
|
-
}, fe(d.value || t.pastePlaceholder), 3)
|
|
504
|
-
]),
|
|
505
|
-
default: S(() => [
|
|
506
|
-
J(r, {
|
|
507
|
-
ref_key: "inputRef",
|
|
508
|
-
ref: c,
|
|
509
|
-
modelValue: d.value,
|
|
510
|
-
"onUpdate:modelValue": g[0] || (g[0] = (we) => d.value = we),
|
|
511
|
-
type: "textarea",
|
|
512
|
-
autosize: { minRows: 2, maxRows: 5 },
|
|
513
|
-
placeholder: t.pastePlaceholder,
|
|
514
|
-
disabled: t.disabled,
|
|
515
|
-
onBlur: g[1] || (g[1] = (we) => x.value = !1),
|
|
516
|
-
onPaste: ue(qe, ["stop"])
|
|
517
|
-
}, null, 8, ["modelValue", "placeholder", "disabled"])
|
|
518
|
-
]),
|
|
519
|
-
_: 1
|
|
520
|
-
}, 8, ["visible"])
|
|
521
|
-
], 32)) : t.showPasteInput ? (V(), H("div", {
|
|
522
|
-
key: 2,
|
|
523
|
-
class: "qy-upload__text",
|
|
524
|
-
onClick: g[5] || (g[5] = ue(() => {
|
|
525
|
-
}, ["stop"])),
|
|
526
|
-
onPaste: ue(qe, ["stop"])
|
|
527
|
-
}, [
|
|
528
|
-
W("input", {
|
|
529
|
-
ref_key: "pasteInputRef",
|
|
530
|
-
ref: f,
|
|
531
|
-
class: "qy-upload__paste-input",
|
|
532
|
-
placeholder: t.pastePlaceholder,
|
|
533
|
-
disabled: t.disabled,
|
|
534
|
-
onPaste: ue(qe, ["stop"]),
|
|
535
|
-
onInput: m,
|
|
536
|
-
onClick: g[4] || (g[4] = ue(() => {
|
|
537
|
-
}, ["stop"]))
|
|
538
|
-
}, null, 40, Ml)
|
|
539
|
-
], 32)) : X("", !0)
|
|
540
|
-
], 34))
|
|
541
|
-
]),
|
|
542
|
-
_: 1
|
|
543
|
-
}, 8, ["file-list", "multiple", "limit", "list-type", "accept", "disabled"]),
|
|
544
|
-
K.value ? (V(), ee(ne, {
|
|
545
|
-
key: 0,
|
|
546
|
-
"url-list": I.value,
|
|
547
|
-
"initial-index": Q.value,
|
|
548
|
-
onClose: de
|
|
549
|
-
}, null, 8, ["url-list", "initial-index"])) : X("", !0),
|
|
550
|
-
J(Ve, {
|
|
551
|
-
modelValue: h.value,
|
|
552
|
-
"onUpdate:modelValue": g[7] || (g[7] = (we) => h.value = we),
|
|
553
|
-
title: P.value,
|
|
554
|
-
width: "640px",
|
|
555
|
-
"append-to-body": "",
|
|
556
|
-
"destroy-on-close": "",
|
|
557
|
-
onClose: g[8] || (g[8] = (we) => h.value = !1)
|
|
558
|
-
}, {
|
|
559
|
-
default: S(() => [
|
|
560
|
-
h.value ? (V(), H("video", {
|
|
561
|
-
key: 0,
|
|
562
|
-
src: j.value,
|
|
563
|
-
controls: "",
|
|
564
|
-
autoplay: "",
|
|
565
|
-
style: { width: "100%", "max-height": "400px", "border-radius": "4px" }
|
|
566
|
-
}, null, 8, Fl)) : X("", !0)
|
|
567
|
-
]),
|
|
568
|
-
_: 1
|
|
569
|
-
}, 8, ["modelValue", "title"]),
|
|
570
|
-
Y.value ? (V(), H("div", Ol, [
|
|
571
|
-
J(o, null, {
|
|
572
|
-
default: S(() => [
|
|
573
|
-
J(C(fl))
|
|
574
|
-
]),
|
|
575
|
-
_: 1
|
|
576
|
-
}),
|
|
577
|
-
W("span", null, [
|
|
578
|
-
g[12] || (g[12] = me(" 请上传 ", -1)),
|
|
579
|
-
t.fileSize ? (V(), H(Be, { key: 0 }, [
|
|
580
|
-
g[10] || (g[10] = me("大小不超过 ", -1)),
|
|
581
|
-
W("b", Ql, fe(t.fileSize) + "MB", 1)
|
|
582
|
-
], 64)) : X("", !0),
|
|
583
|
-
(ye = k.value) != null && ye.length ? (V(), H(Be, { key: 1 }, [
|
|
584
|
-
g[11] || (g[11] = me(",格式为 ", -1)),
|
|
585
|
-
W("b", Dl, fe(k.value.join("/")), 1)
|
|
586
|
-
], 64)) : X("", !0),
|
|
587
|
-
g[13] || (g[13] = me(" 的文件。 ", -1))
|
|
588
|
-
])
|
|
589
|
-
])) : X("", !0)
|
|
590
|
-
], 6);
|
|
591
|
-
};
|
|
592
|
-
}
|
|
593
|
-
}), Vt = /* @__PURE__ */ ze(Ul, [["__scopeId", "data-v-3b975429"]]), Kl = {
|
|
594
|
-
w: 200,
|
|
595
|
-
h: 200,
|
|
596
|
-
q: 50
|
|
597
|
-
};
|
|
598
|
-
function Fe(t) {
|
|
599
|
-
return String(t || "").trim().replace(/http:\/\//, "https://").replace("ys.diansan.com", "admin.qiyinbz.com");
|
|
600
|
-
}
|
|
601
|
-
function El(t, b = !0) {
|
|
602
|
-
const w = String(t || "").trim();
|
|
603
|
-
if (!w) return "";
|
|
604
|
-
const e = Fe(w);
|
|
605
|
-
if (!b) return e;
|
|
606
|
-
const a = Ct(b);
|
|
607
|
-
return w.includes("ys.diansan.com") ? `${e}?small=true&style=image/resize,h_${a.h},w_${a.w}` : `${e}?w=${a.w}`;
|
|
608
|
-
}
|
|
609
|
-
async function Ll(t, b = {}) {
|
|
610
|
-
const w = Fe(t);
|
|
611
|
-
if (!w) throw new Error("图片地址不能为空");
|
|
612
|
-
const e = b.compressor ?? !0;
|
|
613
|
-
if (!e)
|
|
614
|
-
return {
|
|
615
|
-
src: w,
|
|
616
|
-
source: "original"
|
|
617
|
-
};
|
|
618
|
-
const a = El(t, e), A = b.loadBlob ?? Nl, u = b.compressBlob ?? Hl;
|
|
619
|
-
try {
|
|
620
|
-
return await A(a), {
|
|
621
|
-
src: a,
|
|
622
|
-
source: "thumbnail"
|
|
623
|
-
};
|
|
624
|
-
} catch {
|
|
625
|
-
const c = await A(w);
|
|
626
|
-
return {
|
|
627
|
-
src: await u(c, Ct(e)),
|
|
628
|
-
source: "fallback"
|
|
629
|
-
};
|
|
630
|
-
}
|
|
631
|
-
}
|
|
632
|
-
function xt(t = {}) {
|
|
633
|
-
if (typeof document > "u") return { close() {
|
|
634
|
-
} };
|
|
635
|
-
const b = jl(t.urlList, t.url);
|
|
636
|
-
if (!b.length) return { close() {
|
|
637
|
-
} };
|
|
638
|
-
const w = globalThis.__QY_IMAGE_PREVIEW_CREATE_APP__ ?? nl, e = document.createElement("div"), a = document.body.style.overflow;
|
|
639
|
-
let A = !1, u;
|
|
640
|
-
const c = () => {
|
|
641
|
-
var f;
|
|
642
|
-
A || (A = !0, document.body.style.overflow = a, (f = u == null ? void 0 : u.unmount) == null || f.call(u), e.parentNode && e.parentNode.removeChild(e));
|
|
643
|
-
};
|
|
644
|
-
return document.body.appendChild(e), document.body.style.overflow = "hidden", u = w({
|
|
645
|
-
setup() {
|
|
646
|
-
return () => We(vt, {
|
|
647
|
-
urlList: b,
|
|
648
|
-
initialIndex: t.initialIndex ?? 0,
|
|
649
|
-
hideOnClickModal: t.hideOnClickModal ?? !0,
|
|
650
|
-
teleport: "body",
|
|
651
|
-
onClose: c
|
|
652
|
-
});
|
|
653
|
-
}
|
|
654
|
-
}), u.mount(e), { close: c };
|
|
655
|
-
}
|
|
656
|
-
function Ct(t) {
|
|
657
|
-
return {
|
|
658
|
-
...Kl,
|
|
659
|
-
...typeof t == "object" ? t : {}
|
|
660
|
-
};
|
|
661
|
-
}
|
|
662
|
-
function jl(t, b) {
|
|
663
|
-
return (Array.isArray(t) ? t : [b]).map((e) => Fe(e)).filter(Boolean);
|
|
664
|
-
}
|
|
665
|
-
async function Nl(t) {
|
|
666
|
-
const b = await fetch(t, { redirect: "follow" });
|
|
667
|
-
if (!b.ok) throw new Error(t);
|
|
668
|
-
return b.blob();
|
|
669
|
-
}
|
|
670
|
-
async function Hl(t, b) {
|
|
671
|
-
if (typeof document > "u" || typeof Image > "u")
|
|
672
|
-
return Gl(t);
|
|
673
|
-
const w = URL.createObjectURL(t);
|
|
674
|
-
try {
|
|
675
|
-
const e = await Wl(w), a = document.createElement("canvas"), A = Zl(e, b);
|
|
676
|
-
return a.width = Math.max(1, Math.round(e.naturalWidth * A)), a.height = Math.max(1, Math.round(e.naturalHeight * A)), a.getContext("2d").drawImage(e, 0, 0, a.width, a.height), a.toDataURL(t.type || "image/jpeg", b.q / 100);
|
|
677
|
-
} finally {
|
|
678
|
-
URL.revokeObjectURL(w);
|
|
679
|
-
}
|
|
680
|
-
}
|
|
681
|
-
function Wl(t) {
|
|
682
|
-
return new Promise((b, w) => {
|
|
683
|
-
const e = new Image();
|
|
684
|
-
e.onload = () => b(e), e.onerror = w, e.src = t;
|
|
685
|
-
});
|
|
686
|
-
}
|
|
687
|
-
function Zl(t, b) {
|
|
688
|
-
const w = b.w ? b.w / t.naturalWidth : 1, e = b.h ? b.h / t.naturalHeight : 1;
|
|
689
|
-
return Math.min(1, w, e);
|
|
690
|
-
}
|
|
691
|
-
function Gl(t) {
|
|
692
|
-
return new Promise((b, w) => {
|
|
693
|
-
const e = new FileReader();
|
|
694
|
-
e.onloadend = () => b(e.result), e.onerror = w, e.readAsDataURL(t);
|
|
695
|
-
});
|
|
696
|
-
}
|
|
697
|
-
const Xl = { class: "qy-image__state qy-image__state--error" }, Jl = { class: "qy-image__state qy-image__state--empty" }, Yl = /* @__PURE__ */ se({
|
|
698
|
-
name: "QyImage",
|
|
699
|
-
__name: "index",
|
|
700
|
-
props: {
|
|
701
|
-
src: { default: "" },
|
|
702
|
-
width: {},
|
|
703
|
-
height: {},
|
|
704
|
-
size: { default: 64 },
|
|
705
|
-
fit: { default: "cover" },
|
|
706
|
-
placeholder: { type: Boolean, default: !0 },
|
|
707
|
-
lazy: { type: Boolean, default: !0 },
|
|
708
|
-
compressor: { type: [Boolean, Object], default: !0 },
|
|
709
|
-
preview: { type: Boolean, default: !1 },
|
|
710
|
-
previewList: { default: () => [] },
|
|
711
|
-
initialIndex: { default: 0 }
|
|
712
|
-
},
|
|
713
|
-
emits: ["load", "error", "fallback", "preview"],
|
|
714
|
-
setup(t, { emit: b }) {
|
|
715
|
-
const w = t, e = b, a = U(!1), A = U("");
|
|
716
|
-
let u = 0;
|
|
717
|
-
const c = F(() => Fe(w.src)), f = F(() => ({
|
|
718
|
-
width: w.width ?? w.size,
|
|
719
|
-
height: w.height ?? w.size
|
|
720
|
-
})), B = F(() => ({
|
|
721
|
-
width: G(f.value.width),
|
|
722
|
-
height: G(f.value.height)
|
|
723
|
-
})), R = F(() => w.placeholder || a.value), K = F(() => w.preview && !!c.value), I = F(() => (w.previewList.length ? w.previewList : [w.src]).map((d) => Fe(d)).filter(Boolean));
|
|
724
|
-
re(
|
|
725
|
-
() => [w.src, w.compressor],
|
|
726
|
-
Q,
|
|
727
|
-
{
|
|
728
|
-
immediate: !0,
|
|
729
|
-
deep: !0
|
|
730
|
-
}
|
|
731
|
-
);
|
|
732
|
-
async function Q() {
|
|
733
|
-
const E = ++u;
|
|
734
|
-
if (A.value = "", a.value = !1, !!w.src)
|
|
735
|
-
try {
|
|
736
|
-
const d = await Ll(w.src, {
|
|
737
|
-
compressor: w.compressor
|
|
738
|
-
});
|
|
739
|
-
if (E !== u) return;
|
|
740
|
-
A.value = d.src, d.source === "fallback" && e("fallback", d.src);
|
|
741
|
-
} catch {
|
|
742
|
-
if (E !== u) return;
|
|
743
|
-
a.value = !1, A.value = c.value;
|
|
744
|
-
}
|
|
745
|
-
}
|
|
746
|
-
function h(E) {
|
|
747
|
-
e("load", E);
|
|
748
|
-
}
|
|
749
|
-
function j(E) {
|
|
750
|
-
a.value = !0, e("error", E);
|
|
751
|
-
}
|
|
752
|
-
function P() {
|
|
753
|
-
K.value && (xt({
|
|
754
|
-
urlList: I.value,
|
|
755
|
-
initialIndex: w.initialIndex
|
|
756
|
-
}), e("preview", c.value));
|
|
757
|
-
}
|
|
758
|
-
function G(E) {
|
|
759
|
-
return typeof E == "number" ? `${E}px` : E;
|
|
760
|
-
}
|
|
761
|
-
return (E, d) => (V(), H("div", {
|
|
762
|
-
class: he(["qy-image", { "qy-image--previewable": K.value }]),
|
|
763
|
-
style: Ae(B.value),
|
|
764
|
-
onClick: P
|
|
765
|
-
}, [
|
|
766
|
-
A.value && !a.value ? (V(), ee(C(pl), {
|
|
767
|
-
key: 0,
|
|
768
|
-
class: "qy-image__inner",
|
|
769
|
-
src: A.value,
|
|
770
|
-
fit: t.fit,
|
|
771
|
-
lazy: t.lazy,
|
|
772
|
-
onLoad: h,
|
|
773
|
-
onError: j
|
|
774
|
-
}, {
|
|
775
|
-
placeholder: S(() => [
|
|
776
|
-
O(E.$slots, "placeholder", {}, () => [
|
|
777
|
-
d[0] || (d[0] = W("div", { class: "qy-image__state" }, [
|
|
778
|
-
W("span", { class: "qy-image__loading" })
|
|
779
|
-
], -1))
|
|
780
|
-
], !0)
|
|
781
|
-
]),
|
|
782
|
-
error: S(() => [
|
|
783
|
-
O(E.$slots, "error", {}, () => [
|
|
784
|
-
W("div", Xl, [
|
|
785
|
-
J(C(st), { size: 20 }, {
|
|
786
|
-
default: S(() => [
|
|
787
|
-
J(C(it))
|
|
788
|
-
]),
|
|
789
|
-
_: 1
|
|
790
|
-
})
|
|
791
|
-
])
|
|
792
|
-
], !0)
|
|
793
|
-
]),
|
|
794
|
-
_: 3
|
|
795
|
-
}, 8, ["src", "fit", "lazy"])) : R.value ? O(E.$slots, "empty", { key: 1 }, () => [
|
|
796
|
-
W("div", Jl, [
|
|
797
|
-
J(C(st), { size: 20 }, {
|
|
798
|
-
default: S(() => [
|
|
799
|
-
J(C(it))
|
|
800
|
-
]),
|
|
801
|
-
_: 1
|
|
802
|
-
})
|
|
803
|
-
])
|
|
804
|
-
], !0) : X("", !0)
|
|
805
|
-
], 6));
|
|
806
|
-
}
|
|
807
|
-
}), _l = /* @__PURE__ */ ze(Yl, [["__scopeId", "data-v-02c4930c"]]), ea = /* @__PURE__ */ se({
|
|
808
|
-
name: "QyImagePreview",
|
|
809
|
-
__name: "index",
|
|
810
|
-
props: {
|
|
811
|
-
open: { type: Boolean, default: !1 },
|
|
812
|
-
urlList: { default: () => [] },
|
|
813
|
-
initialIndex: { default: 0 },
|
|
814
|
-
hideOnClickModal: { type: Boolean, default: !0 }
|
|
815
|
-
},
|
|
816
|
-
emits: ["update:open", "close"],
|
|
817
|
-
setup(t, { emit: b }) {
|
|
818
|
-
const w = t, e = b;
|
|
819
|
-
let a = "";
|
|
820
|
-
const A = F(
|
|
821
|
-
() => w.urlList.map((f) => Fe(f)).filter(Boolean)
|
|
822
|
-
);
|
|
823
|
-
re(
|
|
824
|
-
() => w.open,
|
|
825
|
-
(f) => {
|
|
826
|
-
if (f) {
|
|
827
|
-
a = document.body.style.overflow, document.body.style.overflow = "hidden";
|
|
828
|
-
return;
|
|
829
|
-
}
|
|
830
|
-
c();
|
|
831
|
-
}
|
|
832
|
-
), Ye(c);
|
|
833
|
-
function u() {
|
|
834
|
-
c(), e("update:open", !1), e("close");
|
|
835
|
-
}
|
|
836
|
-
function c() {
|
|
837
|
-
typeof document > "u" || (document.body.style.overflow = a);
|
|
838
|
-
}
|
|
839
|
-
return (f, B) => t.open && A.value.length ? (V(), ee(C(vt), {
|
|
840
|
-
key: 0,
|
|
841
|
-
"url-list": A.value,
|
|
842
|
-
"initial-index": t.initialIndex,
|
|
843
|
-
"hide-on-click-modal": t.hideOnClickModal,
|
|
844
|
-
teleport: "body",
|
|
845
|
-
onClose: u
|
|
846
|
-
}, null, 8, ["url-list", "initial-index", "hide-on-click-modal"])) : X("", !0);
|
|
847
|
-
}
|
|
848
|
-
}), ta = /* @__PURE__ */ Object.assign({
|
|
849
|
-
name: "QyImageUpload",
|
|
850
|
-
inheritAttrs: !1
|
|
851
|
-
}, {
|
|
852
|
-
__name: "index",
|
|
853
|
-
props: {
|
|
854
|
-
/** 单图/单文件 URL;multiple=true 时为 URL 数组。 */
|
|
855
|
-
modelValue: { type: [String, Array], default: "" },
|
|
856
|
-
/** 上传接口路径。 */
|
|
857
|
-
api: { type: String, default: "/permission-api/common/uploads" },
|
|
858
|
-
/** FormData 中文件字段名。 */
|
|
859
|
-
name: { type: String, default: "files" },
|
|
860
|
-
/** 是否禁用。 */
|
|
861
|
-
disabled: { type: Boolean, default: !1 },
|
|
862
|
-
/** 是否多选;开启后 v-model 输出 string[]。 */
|
|
863
|
-
multiple: { type: Boolean, default: !1 },
|
|
864
|
-
/** 上传模式。voucher 用于承接旧 CopyImgUpload 的凭证图片场景。 */
|
|
865
|
-
mode: { type: String, default: "default" },
|
|
866
|
-
/** 是否启用凭证图片模式。 */
|
|
867
|
-
voucher: { type: Boolean, default: !1 },
|
|
868
|
-
/** 允许的文件类型后缀。 */
|
|
869
|
-
fileType: { type: Array, default: () => [] },
|
|
870
|
-
/** 单个文件大小限制(MB)。 */
|
|
871
|
-
fileSize: { type: Number, default: 10 },
|
|
872
|
-
/** 是否显示格式/大小提示。 */
|
|
873
|
-
isShowTip: { type: Boolean, default: !1 },
|
|
874
|
-
/** 文件数量限制;不传时单图为 1,多图为 9。 */
|
|
875
|
-
limit: { type: Number, default: void 0 },
|
|
876
|
-
/** token 读取 key。 */
|
|
877
|
-
tokenKey: { type: String, default: "Admin-Token" },
|
|
878
|
-
/** 是否为视频上传。 */
|
|
879
|
-
supportVideo: { type: Boolean, default: !1 },
|
|
880
|
-
/** 上传卡片尺寸。 */
|
|
881
|
-
size: { type: String, default: "128px" },
|
|
882
|
-
/** 禁用拖拽。 */
|
|
883
|
-
disableDrag: { type: Boolean, default: !1 },
|
|
884
|
-
/** 是否显示纯粘贴入口。 */
|
|
885
|
-
showPasteInput: { type: Boolean, default: !0 },
|
|
886
|
-
/** 粘贴入口提示文案。 */
|
|
887
|
-
pastePlaceholder: { type: String, default: "粘贴图片上传" },
|
|
888
|
-
/** 成功回调。 */
|
|
889
|
-
callBack: { type: Function, default: null },
|
|
890
|
-
/** 上传时附加的额外 FormData 字段。 */
|
|
891
|
-
extraData: { type: Object, default: () => ({}) },
|
|
892
|
-
/** 自定义上传请求,用于接入宿主项目 request / 鉴权 / baseURL。 */
|
|
893
|
-
uploadRequest: { type: Function, default: null }
|
|
894
|
-
},
|
|
895
|
-
emits: [
|
|
896
|
-
"update:modelValue",
|
|
897
|
-
"change",
|
|
898
|
-
"success",
|
|
899
|
-
"error",
|
|
900
|
-
"remove",
|
|
901
|
-
"updateImg"
|
|
902
|
-
],
|
|
903
|
-
setup(t, { expose: b, emit: w }) {
|
|
904
|
-
const e = t, a = w, A = pe(), u = U(null), c = ["jpg", "jpeg", "png", "gif", "bmp", "webp"], f = F(
|
|
905
|
-
() => e.voucher || e.mode === "voucher"
|
|
906
|
-
), B = F(() => Array.isArray(e.modelValue) ? e.modelValue.filter(Boolean) : e.modelValue ? String(e.modelValue).split(",").filter(Boolean) : []), R = F(() => e.supportVideo ? 1 : f.value ? e.limit ?? 30 : e.limit ?? (e.multiple ? 9 : 1)), K = F(() => {
|
|
907
|
-
var l;
|
|
908
|
-
return (l = e.fileType) != null && l.length ? e.fileType : f.value && !e.supportVideo ? c : [];
|
|
909
|
-
});
|
|
910
|
-
function I(l) {
|
|
911
|
-
return Array.isArray(l) ? l.filter(Boolean) : [];
|
|
912
|
-
}
|
|
913
|
-
function Q(l) {
|
|
914
|
-
const n = I(l);
|
|
915
|
-
return e.multiple ? n : n[0] || "";
|
|
916
|
-
}
|
|
917
|
-
function h(l) {
|
|
918
|
-
a("update:modelValue", Q(l));
|
|
919
|
-
}
|
|
920
|
-
function j(l) {
|
|
921
|
-
a("change", Q(l == null ? void 0 : l.files));
|
|
922
|
-
}
|
|
923
|
-
function P(l) {
|
|
924
|
-
var le, y;
|
|
925
|
-
if (typeof l == "string") return l;
|
|
926
|
-
const n = l || {}, M = n.url ?? n.urls ?? ((le = n.data) == null ? void 0 : le.url) ?? ((y = n.data) == null ? void 0 : y.urls) ?? "";
|
|
927
|
-
return Array.isArray(M) ? M[0] || "" : M || "";
|
|
928
|
-
}
|
|
929
|
-
function G(l) {
|
|
930
|
-
const n = P(l);
|
|
931
|
-
n && a("updateImg", n), a("success", D(), l);
|
|
932
|
-
}
|
|
933
|
-
function E(l) {
|
|
934
|
-
a("error", l);
|
|
935
|
-
}
|
|
936
|
-
function d(l, n) {
|
|
937
|
-
a("remove", l, n);
|
|
938
|
-
}
|
|
939
|
-
function x() {
|
|
940
|
-
var l, n;
|
|
941
|
-
(n = (l = u.value) == null ? void 0 : l.openFileDialog) == null || n.call(l);
|
|
942
|
-
}
|
|
943
|
-
function i() {
|
|
944
|
-
var l, n;
|
|
945
|
-
(n = (l = u.value) == null ? void 0 : l.clearFiles) == null || n.call(l);
|
|
946
|
-
}
|
|
947
|
-
function Z() {
|
|
948
|
-
var l, n;
|
|
949
|
-
return ((n = (l = u.value) == null ? void 0 : l.getPathList) == null ? void 0 : n.call(l)) || [];
|
|
950
|
-
}
|
|
951
|
-
const Y = F(() => Z()), k = F(() => Z());
|
|
952
|
-
function v() {
|
|
953
|
-
return Z();
|
|
954
|
-
}
|
|
955
|
-
function D() {
|
|
956
|
-
const l = Z();
|
|
957
|
-
return e.multiple ? l : l[0] || "";
|
|
958
|
-
}
|
|
959
|
-
return b({
|
|
960
|
-
openFileDialog: x,
|
|
961
|
-
clearFiles: i,
|
|
962
|
-
getPathList: Z,
|
|
963
|
-
getFullPathList: v,
|
|
964
|
-
fullPathList: Y,
|
|
965
|
-
pathList: k,
|
|
966
|
-
getValue: D
|
|
967
|
-
}), (l, n) => (V(), ee(Vt, ie({
|
|
968
|
-
ref_key: "uploadRef",
|
|
969
|
-
ref: u
|
|
970
|
-
}, C(A), {
|
|
971
|
-
"model-value": B.value,
|
|
972
|
-
"value-format": "array",
|
|
973
|
-
api: t.api,
|
|
974
|
-
name: t.name,
|
|
975
|
-
multiple: t.multiple,
|
|
976
|
-
disabled: t.disabled,
|
|
977
|
-
"file-type": K.value,
|
|
978
|
-
"file-size": t.fileSize,
|
|
979
|
-
limit: R.value,
|
|
980
|
-
"is-show-tip": t.isShowTip,
|
|
981
|
-
"token-key": t.tokenKey,
|
|
982
|
-
"support-video": t.supportVideo,
|
|
983
|
-
size: t.size,
|
|
984
|
-
"disable-drag": t.disableDrag,
|
|
985
|
-
"call-back": t.callBack,
|
|
986
|
-
"extra-data": t.extraData,
|
|
987
|
-
"upload-request": t.uploadRequest,
|
|
988
|
-
"show-text": !1,
|
|
989
|
-
"show-paste-input": t.showPasteInput,
|
|
990
|
-
"paste-placeholder": t.pastePlaceholder,
|
|
991
|
-
"onUpdate:modelValue": h,
|
|
992
|
-
onChange: j,
|
|
993
|
-
onSuccess: G,
|
|
994
|
-
onError: E,
|
|
995
|
-
onRemove: d
|
|
996
|
-
}), 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"]));
|
|
997
|
-
}
|
|
998
|
-
}), la = { class: "text-lg flex items-center pt-2 pl-[var(--content-padding)]" }, aa = { key: 0 }, na = { key: 1 }, oa = {
|
|
999
|
-
key: 0,
|
|
1000
|
-
class: "icon-[material-symbols--square-outline-rounded]",
|
|
1001
|
-
role: "img",
|
|
1002
|
-
"aria-hidden": "true"
|
|
1003
|
-
}, ra = {
|
|
1004
|
-
key: 1,
|
|
1005
|
-
class: "icon-[tdesign--fullscreen-exit-1]",
|
|
1006
|
-
role: "img",
|
|
1007
|
-
"aria-hidden": "true"
|
|
1008
|
-
}, ua = {
|
|
1009
|
-
key: 0,
|
|
1010
|
-
class: "fixed -right-12 top-2 h-9 w-9 hover:bg-gray-600/80 transition-all"
|
|
1011
|
-
}, ia = { class: "flex justify-between h-[var(--footer-height)] px-[var(--content-padding)] items-center" }, sa = { class: "flex items-center justify-between w-full pl-1 pr-4 h-full ml-2" }, da = { class: "flex items-center gap-2" }, ca = { class: "text-sm text-gray-700 truncate max-w-[200px]" }, fa = { class: "flex items-center gap-2" }, ct = 5, He = 2e3, Xe = /* @__PURE__ */ se({
|
|
1012
|
-
__name: "index",
|
|
1013
|
-
props: /* @__PURE__ */ ut({
|
|
1014
|
-
layout: { type: [Array, String, Boolean], default: () => ["confirm", "cancel"] },
|
|
1015
|
-
fullscreen: { type: Boolean, default: !1 },
|
|
1016
|
-
showFullscreen: { type: Boolean, default: !1 },
|
|
1017
|
-
confirmProps: { default: () => ({}) },
|
|
1018
|
-
size: { default: "default" },
|
|
1019
|
-
zIndex: { default: 2e3 }
|
|
1020
|
-
}, {
|
|
1021
|
-
modelValue: { default: !0 },
|
|
1022
|
-
modelModifiers: {}
|
|
1023
|
-
}),
|
|
1024
|
-
emits: /* @__PURE__ */ ut(["confirm", "cancel", "close", "opened", "ok"], ["update:modelValue"]),
|
|
1025
|
-
setup(t, { expose: b, emit: w }) {
|
|
1026
|
-
const e = t, a = _e(), A = U(!0), u = U(!1), c = U(He), f = U(null), R = Bl({
|
|
1027
|
-
mobile: 0,
|
|
1028
|
-
tablet: 640,
|
|
1029
|
-
laptop: 1024,
|
|
1030
|
-
desktop: 1280
|
|
1031
|
-
}).isSmaller("tablet"), K = F(() => {
|
|
1032
|
-
if (Array.isArray(e.layout)) return e.layout;
|
|
1033
|
-
if (typeof e.layout == "string")
|
|
1034
|
-
return e.layout.split(",").map((z) => z.trim());
|
|
1035
|
-
}), I = F(() => ({
|
|
1036
|
-
CancelButton: J(y),
|
|
1037
|
-
ConfirmButton: J(le)
|
|
1038
|
-
})), Q = F(() => a.footer || e.layout !== !1), h = U(!1), j = U(
|
|
1039
|
-
e.showFullscreen && R ? !0 : e.fullscreen
|
|
1040
|
-
), P = w, G = ol(t, "modelValue");
|
|
1041
|
-
rl(() => {
|
|
1042
|
-
G.value && (h.value = !1);
|
|
1043
|
-
}), b({
|
|
1044
|
-
handleMinimize: N
|
|
1045
|
-
});
|
|
1046
|
-
const E = pe(), d = `qy-dialog-${Math.random().toString(36).slice(2, 11)}`, x = U(!1), i = U(null);
|
|
1047
|
-
window.minimizedCount || (window.minimizedCount = 0);
|
|
1048
|
-
const { x: Z, y: Y } = zl(i, {
|
|
1049
|
-
initialValue: {
|
|
1050
|
-
x: 5,
|
|
1051
|
-
y: window.innerHeight - 100 - (window.minimizedCount || 0) * 60
|
|
1052
|
-
},
|
|
1053
|
-
onMove(z) {
|
|
1054
|
-
var m;
|
|
1055
|
-
(m = i.value) == null || m.classList.add("dragging"), document.body.classList.add("qy-dialog--dragging"), Z.value = Math.max(
|
|
1056
|
-
0,
|
|
1057
|
-
Math.min(window.innerWidth - 300, z.x)
|
|
1058
|
-
), Y.value = Math.max(
|
|
1059
|
-
0,
|
|
1060
|
-
Math.min(window.innerHeight - 50, z.y)
|
|
1061
|
-
);
|
|
1062
|
-
},
|
|
1063
|
-
onEnd() {
|
|
1064
|
-
var z;
|
|
1065
|
-
(z = i.value) == null || z.classList.remove("dragging"), document.body.classList.remove("qy-dialog--dragging");
|
|
1066
|
-
}
|
|
1067
|
-
}), k = F(() => ({
|
|
1068
|
-
transform: `translate(${Z.value}px, ${Y.value}px)`,
|
|
1069
|
-
willChange: "transform"
|
|
1070
|
-
}));
|
|
1071
|
-
function v(z) {
|
|
1072
|
-
const m = z.target, { scrollTop: _, scrollHeight: ae, clientHeight: ve } = m;
|
|
1073
|
-
A.value = _ <= ct, u.value = ae - (_ + ve) <= ct;
|
|
1074
|
-
}
|
|
1075
|
-
function D() {
|
|
1076
|
-
const z = document.querySelector(`.${d}.el-dialog`);
|
|
1077
|
-
z && (f.value = z, z.addEventListener("scroll", v)), $(), P("opened");
|
|
1078
|
-
}
|
|
1079
|
-
function l() {
|
|
1080
|
-
j.value = !j.value, $();
|
|
1081
|
-
}
|
|
1082
|
-
function n() {
|
|
1083
|
-
h.value || (h.value = !0, x.value = !1, G.value = !1, P("cancel"), P("close"));
|
|
1084
|
-
}
|
|
1085
|
-
function M(z) {
|
|
1086
|
-
e.showFullscreen && z.detail >= 2 && l();
|
|
1087
|
-
}
|
|
1088
|
-
function le() {
|
|
1089
|
-
return We(
|
|
1090
|
-
ke,
|
|
1091
|
-
{
|
|
1092
|
-
...C(e.confirmProps),
|
|
1093
|
-
type: "primary",
|
|
1094
|
-
class: "dialog__footerBtn",
|
|
1095
|
-
onClick: () => {
|
|
1096
|
-
P("confirm"), P("ok");
|
|
1097
|
-
}
|
|
1098
|
-
},
|
|
1099
|
-
() => C(e.confirmProps).title || "确 认"
|
|
1100
|
-
);
|
|
1101
|
-
}
|
|
1102
|
-
function y() {
|
|
1103
|
-
return We(
|
|
1104
|
-
ke,
|
|
1105
|
-
{ class: "dialog__footerBtn", onClick: () => n() },
|
|
1106
|
-
() => "取 消"
|
|
1107
|
-
);
|
|
1108
|
-
}
|
|
1109
|
-
Je(() => {
|
|
1110
|
-
typeof window.qyDialogMaxZIndex > "u" && (window.qyDialogMaxZIndex = He), $();
|
|
1111
|
-
});
|
|
1112
|
-
function $() {
|
|
1113
|
-
var $e;
|
|
1114
|
-
const z = Array.from(
|
|
1115
|
-
document.querySelectorAll(".el-overlay")
|
|
1116
|
-
).filter((Ce) => window.getComputedStyle(Ce).display !== "none" && !Ce.classList.contains("is-message")), m = ($e = document.querySelector(`.${d}`)) == null ? void 0 : $e.closest(".el-overlay"), _ = document.querySelector(
|
|
1117
|
-
`.${d}.el-dialog`
|
|
1118
|
-
);
|
|
1119
|
-
if (!m || !_) return;
|
|
1120
|
-
const ae = He;
|
|
1121
|
-
window.qyDialogMaxZIndex = window.qyDialogMaxZIndex || ae;
|
|
1122
|
-
const xe = Math.max(
|
|
1123
|
-
window.qyDialogMaxZIndex,
|
|
1124
|
-
...z.map(
|
|
1125
|
-
(Ce) => parseInt(window.getComputedStyle(Ce).zIndex || ae.toString())
|
|
1126
|
-
)
|
|
1127
|
-
) + 2;
|
|
1128
|
-
window.qyDialogMaxZIndex = xe, De(() => {
|
|
1129
|
-
m.style.zIndex = xe.toString(), _.style.zIndex = (xe + 1).toString(), c.value = xe + 1;
|
|
1130
|
-
});
|
|
1131
|
-
}
|
|
1132
|
-
gt(() => {
|
|
1133
|
-
var z;
|
|
1134
|
-
(z = f.value) == null || z.removeEventListener("scroll", v), x.value && window.minimizedCount--;
|
|
1135
|
-
});
|
|
1136
|
-
function N() {
|
|
1137
|
-
var m;
|
|
1138
|
-
x.value = !x.value;
|
|
1139
|
-
const z = (m = document.querySelector(`.${d}`)) == null ? void 0 : m.closest(".el-overlay");
|
|
1140
|
-
z && (x.value ? (z.style.display = "none", window.minimizedCount++, Y.value = window.innerHeight - 50 - (window.minimizedCount || 0) * 60) : (z.style.display = "block", window.minimizedCount--, $()));
|
|
1141
|
-
}
|
|
1142
|
-
return (z, m) => {
|
|
1143
|
-
const _ = ul("Close"), ae = pt, ve = yt;
|
|
1144
|
-
return V(), H("div", null, [
|
|
1145
|
-
J(ve, ie({
|
|
1146
|
-
ref: "dialogRef",
|
|
1147
|
-
class: ["qy-dialog", [
|
|
1148
|
-
e.size === "small" && "[&_.el-dialog__header]:!hidden",
|
|
1149
|
-
d
|
|
1150
|
-
]],
|
|
1151
|
-
"model-value": G.value,
|
|
1152
|
-
"align-center": "",
|
|
1153
|
-
"append-to-body": "",
|
|
1154
|
-
style: {
|
|
1155
|
-
"--el-dialog-padding-primary": 0
|
|
1156
|
-
},
|
|
1157
|
-
"show-close": !1,
|
|
1158
|
-
fullscreen: j.value,
|
|
1159
|
-
"z-index": c.value,
|
|
1160
|
-
onClosed: n,
|
|
1161
|
-
onOpened: D,
|
|
1162
|
-
draggable: ""
|
|
1163
|
-
}, C(E)), Re({
|
|
1164
|
-
header: S(() => [
|
|
1165
|
-
e.size === "default" ? (V(), H("div", {
|
|
1166
|
-
key: 0,
|
|
1167
|
-
style: Ae({
|
|
1168
|
-
borderBottom: "1px solid",
|
|
1169
|
-
borderColor: A.value ? "transparent" : "var(--block-outline-color)",
|
|
1170
|
-
transition: "border-color .2s linear"
|
|
1171
|
-
}),
|
|
1172
|
-
class: "flex justify-between h-[var(--header-height)]",
|
|
1173
|
-
onDblclick: M
|
|
1174
|
-
}, [
|
|
1175
|
-
W("div", la, [
|
|
1176
|
-
C(a).header ? C(a).header ? (V(), H("div", na, [
|
|
1177
|
-
O(z.$slots, "header")
|
|
1178
|
-
])) : X("", !0) : (V(), H("span", aa, fe(C(E).title), 1))
|
|
1179
|
-
]),
|
|
1180
|
-
W("div", {
|
|
1181
|
-
class: "flex",
|
|
1182
|
-
onMousedown: m[3] || (m[3] = ue(() => {
|
|
1183
|
-
}, ["stop"]))
|
|
1184
|
-
}, [
|
|
1185
|
-
e.size === "default" ? (V(), H("div", {
|
|
1186
|
-
key: 0,
|
|
1187
|
-
class: "qy-dialog__btn qy-dialog__btn--default",
|
|
1188
|
-
onClick: ue(N, ["stop"]),
|
|
1189
|
-
onMousedown: m[0] || (m[0] = ue(() => {
|
|
1190
|
-
}, ["stop"]))
|
|
1191
|
-
}, [...m[4] || (m[4] = [
|
|
1192
|
-
W("span", {
|
|
1193
|
-
class: "icon-[material-symbols--minimize] text-xl mb-3",
|
|
1194
|
-
role: "img",
|
|
1195
|
-
"aria-hidden": "true"
|
|
1196
|
-
}, null, -1)
|
|
1197
|
-
])], 32)) : X("", !0),
|
|
1198
|
-
e.showFullscreen ? (V(), H("div", {
|
|
1199
|
-
key: 1,
|
|
1200
|
-
class: "qy-dialog__btn qy-dialog__btn--default",
|
|
1201
|
-
onClick: ue(l, ["stop"]),
|
|
1202
|
-
onMousedown: m[1] || (m[1] = ue(() => {
|
|
1203
|
-
}, ["stop"]))
|
|
1204
|
-
}, [
|
|
1205
|
-
j.value ? (V(), H("span", ra)) : (V(), H("span", oa))
|
|
1206
|
-
], 32)) : X("", !0),
|
|
1207
|
-
W("div", {
|
|
1208
|
-
class: "qy-dialog__btn qy-dialog__btn--danger",
|
|
1209
|
-
onClick: ue(n, ["stop"]),
|
|
1210
|
-
onMousedown: m[2] || (m[2] = ue(() => {
|
|
1211
|
-
}, ["stop"]))
|
|
1212
|
-
}, [...m[5] || (m[5] = [
|
|
1213
|
-
W("span", {
|
|
1214
|
-
class: "icon-[ri--close-line] text-xl",
|
|
1215
|
-
role: "img",
|
|
1216
|
-
"aria-hidden": "true"
|
|
1217
|
-
}, null, -1)
|
|
1218
|
-
])], 32)
|
|
1219
|
-
], 32)
|
|
1220
|
-
], 36)) : X("", !0)
|
|
1221
|
-
]),
|
|
1222
|
-
default: S(() => [
|
|
1223
|
-
W("div", {
|
|
1224
|
-
class: he(["qy-dialog__wrapper", C($l)(j.value && "qy-dialog__wrapper--fullscreen")]),
|
|
1225
|
-
style: Ae({
|
|
1226
|
-
maxHeight: Q.value ? "calc(100vh - var(--header-height) - var(--footer-height) - var(--sides-gap))" : "calc(100vh - var(--header-height) - var(--sides-gap))",
|
|
1227
|
-
padding: e.size === "small" ? "var(--small-content-padding)" : "var(--content-padding)"
|
|
1228
|
-
})
|
|
1229
|
-
}, [
|
|
1230
|
-
e.size === "small" ? (V(), H("div", ua, [
|
|
1231
|
-
J(ae, {
|
|
1232
|
-
size: 36,
|
|
1233
|
-
class: "cursor-pointer text-gray-100 active:scale-75 rounded-sm transition-all",
|
|
1234
|
-
onClick: n
|
|
1235
|
-
}, {
|
|
1236
|
-
default: S(() => [
|
|
1237
|
-
J(_)
|
|
1238
|
-
]),
|
|
1239
|
-
_: 1
|
|
1240
|
-
})
|
|
1241
|
-
])) : X("", !0),
|
|
1242
|
-
O(z.$slots, "default")
|
|
1243
|
-
], 6)
|
|
1244
|
-
]),
|
|
1245
|
-
_: 2
|
|
1246
|
-
}, [
|
|
1247
|
-
!z.$slots.footer && Array.isArray(K.value) ? {
|
|
1248
|
-
name: "footer",
|
|
1249
|
-
fn: S(() => [
|
|
1250
|
-
W("div", ia, [
|
|
1251
|
-
W("div", null, [
|
|
1252
|
-
O(z.$slots, "footer-left")
|
|
1253
|
-
]),
|
|
1254
|
-
W("div", {
|
|
1255
|
-
class: he([{
|
|
1256
|
-
"qy-dialog__footer--outline": u.value
|
|
1257
|
-
}, "qy-dialog__footer flex items-center justify-end"])
|
|
1258
|
-
}, [
|
|
1259
|
-
K.value.includes("cancel") ? (V(), ee(y, { key: 0 })) : X("", !0),
|
|
1260
|
-
K.value.includes("confirm") ? (V(), ee(le, { key: 1 })) : X("", !0),
|
|
1261
|
-
O(z.$slots, "footer-append")
|
|
1262
|
-
], 2)
|
|
1263
|
-
])
|
|
1264
|
-
]),
|
|
1265
|
-
key: "0"
|
|
1266
|
-
} : Q.value ? {
|
|
1267
|
-
name: "footer",
|
|
1268
|
-
fn: S(() => [
|
|
1269
|
-
W("div", {
|
|
1270
|
-
class: he([{
|
|
1271
|
-
"qy-dialog__footer--outline": u.value
|
|
1272
|
-
}, "qy-dialog__footer px-[var(--content-padding)] min-h-[var(--footer-height)] flex items-center justify-end"])
|
|
1273
|
-
}, [
|
|
1274
|
-
O(z.$slots, "footer", {
|
|
1275
|
-
layouts: I.value,
|
|
1276
|
-
layoutsNode: Object.values(I.value)
|
|
1277
|
-
})
|
|
1278
|
-
], 2)
|
|
1279
|
-
]),
|
|
1280
|
-
key: "1"
|
|
1281
|
-
} : void 0
|
|
1282
|
-
]), 1040, ["class", "model-value", "fullscreen", "z-index"]),
|
|
1283
|
-
et(W("div", {
|
|
1284
|
-
ref_key: "minimizedRef",
|
|
1285
|
-
ref: i,
|
|
1286
|
-
class: "fixed left-0 top-0 bg-white rounded shadow-lg cursor-pointer z-[9999] hover:bg-gray-50",
|
|
1287
|
-
style: Ae([k.value, { width: "300px", height: "50px", "will-change": "transform" }])
|
|
1288
|
-
}, [
|
|
1289
|
-
W("div", sa, [
|
|
1290
|
-
W("div", da, [
|
|
1291
|
-
m[6] || (m[6] = W("div", { class: "icon-[mdi--window-restore] text-gray-600" }, null, -1)),
|
|
1292
|
-
W("span", ca, fe(C(E).title), 1)
|
|
1293
|
-
]),
|
|
1294
|
-
W("div", fa, [
|
|
1295
|
-
W("div", {
|
|
1296
|
-
class: "p-1 hover:bg-gray-200 rounded",
|
|
1297
|
-
onClick: ue(N, ["stop"])
|
|
1298
|
-
}, [...m[7] || (m[7] = [
|
|
1299
|
-
W("div", { class: "icon-[mdi--window-maximize] text-gray-600" }, null, -1)
|
|
1300
|
-
])]),
|
|
1301
|
-
W("div", {
|
|
1302
|
-
class: "p-1 hover:bg-red-100 rounded",
|
|
1303
|
-
onClick: ue(n, ["stop"])
|
|
1304
|
-
}, [...m[8] || (m[8] = [
|
|
1305
|
-
W("div", { class: "icon-[mdi--close] text-red-600" }, null, -1)
|
|
1306
|
-
])])
|
|
1307
|
-
])
|
|
1308
|
-
])
|
|
1309
|
-
], 4), [
|
|
1310
|
-
[ht, x.value]
|
|
1311
|
-
])
|
|
1312
|
-
]);
|
|
1313
|
-
};
|
|
1314
|
-
}
|
|
1315
|
-
});
|
|
1316
|
-
function ft(t) {
|
|
1317
|
-
const b = t == null ? void 0 : t.match(/(\[url\:(.*?)\])(.*)/);
|
|
1318
|
-
return b ? {
|
|
1319
|
-
imageUrl: b[2],
|
|
1320
|
-
text: b[3]
|
|
1321
|
-
} : {
|
|
1322
|
-
imageUrl: "",
|
|
1323
|
-
text: t || ""
|
|
1324
|
-
};
|
|
1325
|
-
}
|
|
1326
|
-
function ma(t) {
|
|
1327
|
-
const b = String(t || "").match(/(\[url\:.*?\])([\s\S]*)/);
|
|
1328
|
-
return b ? b[2] : t;
|
|
1329
|
-
}
|
|
1330
|
-
function mt(t, b) {
|
|
1331
|
-
return b ? `[url:${b}]${t}` : t;
|
|
1332
|
-
}
|
|
1333
|
-
const pa = { class: "qy-remark-image__field" }, ya = {
|
|
1334
|
-
key: 1,
|
|
1335
|
-
class: "qy-remark-image__divider"
|
|
1336
|
-
}, ga = { class: "qy-remark-image__upload-anchor" }, ha = {
|
|
1337
|
-
key: 0,
|
|
1338
|
-
class: "icon-[line-md--loading-twotone-loop]",
|
|
1339
|
-
role: "img",
|
|
1340
|
-
"aria-hidden": "true"
|
|
1341
|
-
}, va = {
|
|
1342
|
-
key: 1,
|
|
1343
|
-
class: "icon-[ion--cloud-upload-outline]",
|
|
1344
|
-
role: "img",
|
|
1345
|
-
"aria-hidden": "true"
|
|
1346
|
-
}, ba = {
|
|
1347
|
-
key: 2,
|
|
1348
|
-
class: "icon-[ph--images-thin]",
|
|
1349
|
-
role: "img",
|
|
1350
|
-
"aria-hidden": "true"
|
|
1351
|
-
}, wa = { class: "qy-remark-image__popover" }, ka = ["src"], Sa = { class: "qy-remark-image__popover-footer" }, Va = /* @__PURE__ */ se({
|
|
1352
|
-
__name: "index",
|
|
1353
|
-
props: {
|
|
1354
|
-
defaultValue: { default: "" },
|
|
1355
|
-
defaultImage: { default: "" },
|
|
1356
|
-
rows: { default: 6 },
|
|
1357
|
-
width: { default: "" },
|
|
1358
|
-
autosize: { type: [Boolean, Object], default: !1 },
|
|
1359
|
-
disabled: { type: Boolean, default: !1 },
|
|
1360
|
-
placeholder: { default: "粘贴图片上传" },
|
|
1361
|
-
type: { default: "textarea" },
|
|
1362
|
-
layout: { default: "default" },
|
|
1363
|
-
selectValue: { type: [String, Number, Boolean], default: "" },
|
|
1364
|
-
selectOptions: { default: () => [] },
|
|
1365
|
-
selectDisabled: { type: Boolean, default: !1 },
|
|
1366
|
-
api: { default: "/permission-api/common/uploads" },
|
|
1367
|
-
tokenKey: { default: "Admin-Token" },
|
|
1368
|
-
uploadName: { default: "files" },
|
|
1369
|
-
uploadRequest: {}
|
|
1370
|
-
},
|
|
1371
|
-
emits: ["change", "update:selectValue", "select-change"],
|
|
1372
|
-
setup(t, { expose: b, emit: w }) {
|
|
1373
|
-
const e = t, a = w, A = pe(), u = U(null), c = U(""), f = U(""), B = U(!1), R = F(
|
|
1374
|
-
() => e.layout === "select-prefix"
|
|
1375
|
-
), K = F(() => ({
|
|
1376
|
-
"qy-remark-image--select-prefix": R.value
|
|
1377
|
-
})), I = F(
|
|
1378
|
-
() => R.value || e.type === "text" ? "text" : "textarea"
|
|
1379
|
-
), Q = F(() => {
|
|
1380
|
-
if (e.width)
|
|
1381
|
-
return {
|
|
1382
|
-
width: typeof e.width == "number" ? `${e.width}px` : e.width
|
|
1383
|
-
};
|
|
1384
|
-
});
|
|
1385
|
-
re(
|
|
1386
|
-
() => e.defaultValue,
|
|
1387
|
-
(v) => {
|
|
1388
|
-
const D = ft(v || "");
|
|
1389
|
-
c.value = D.text, f.value = D.imageUrl || e.defaultImage || "";
|
|
1390
|
-
},
|
|
1391
|
-
{ immediate: !0 }
|
|
1392
|
-
), re(
|
|
1393
|
-
() => e.defaultImage,
|
|
1394
|
-
(v) => {
|
|
1395
|
-
v !== void 0 && !ft(e.defaultValue || "").imageUrl && (f.value = v || "");
|
|
1396
|
-
},
|
|
1397
|
-
{ immediate: !0 }
|
|
1398
|
-
), Je(() => {
|
|
1399
|
-
De(j);
|
|
1400
|
-
}), gt(() => {
|
|
1401
|
-
const v = h();
|
|
1402
|
-
v && v.removeEventListener("paste", x);
|
|
1403
|
-
});
|
|
1404
|
-
function h() {
|
|
1405
|
-
var v, D;
|
|
1406
|
-
return ((v = u.value) == null ? void 0 : v.textarea) || ((D = u.value) == null ? void 0 : D.input) || null;
|
|
1407
|
-
}
|
|
1408
|
-
function j() {
|
|
1409
|
-
const v = h();
|
|
1410
|
-
v && (v.removeEventListener("paste", x), v.addEventListener("paste", x));
|
|
1411
|
-
}
|
|
1412
|
-
function P(v) {
|
|
1413
|
-
c.value = ma(v || "");
|
|
1414
|
-
}
|
|
1415
|
-
function G(v) {
|
|
1416
|
-
a("update:selectValue", v), a("select-change", v);
|
|
1417
|
-
}
|
|
1418
|
-
function E() {
|
|
1419
|
-
f.value = "", k();
|
|
1420
|
-
}
|
|
1421
|
-
function d() {
|
|
1422
|
-
c.value = "", f.value = "", k();
|
|
1423
|
-
}
|
|
1424
|
-
async function x(v) {
|
|
1425
|
-
var n;
|
|
1426
|
-
const l = Array.from(((n = v.clipboardData) == null ? void 0 : n.files) || []).find((M) => M.type.startsWith("image/"));
|
|
1427
|
-
l && (v.preventDefault(), await i({
|
|
1428
|
-
file: l,
|
|
1429
|
-
onError: () => {
|
|
1430
|
-
},
|
|
1431
|
-
onProgress: () => {
|
|
1432
|
-
},
|
|
1433
|
-
onSuccess: () => {
|
|
1434
|
-
}
|
|
1435
|
-
}));
|
|
1436
|
-
}
|
|
1437
|
-
async function i(v) {
|
|
1438
|
-
var D, l;
|
|
1439
|
-
if (v.file.size > 51200 * 1e3)
|
|
1440
|
-
return ge.error("图片过大"), !1;
|
|
1441
|
-
B.value = !0;
|
|
1442
|
-
try {
|
|
1443
|
-
const n = await Z(v);
|
|
1444
|
-
return f.value = Y(n), k(), ge.success("上传图片成功"), (D = v.onSuccess) == null || D.call(v, n), !0;
|
|
1445
|
-
} catch (n) {
|
|
1446
|
-
return (l = v.onError) == null || l.call(v, n), ge.error("上传失败"), !1;
|
|
1447
|
-
} finally {
|
|
1448
|
-
B.value = !1;
|
|
1449
|
-
}
|
|
1450
|
-
}
|
|
1451
|
-
async function Z(v) {
|
|
1452
|
-
const D = new FormData();
|
|
1453
|
-
if (D.append(e.uploadName, v.file), e.uploadRequest)
|
|
1454
|
-
return e.uploadRequest({
|
|
1455
|
-
file: v.file,
|
|
1456
|
-
formData: D,
|
|
1457
|
-
options: v,
|
|
1458
|
-
api: e.api,
|
|
1459
|
-
tokenKey: e.tokenKey
|
|
1460
|
-
});
|
|
1461
|
-
const l = St.get(e.tokenKey);
|
|
1462
|
-
return (await fetch(e.api, {
|
|
1463
|
-
method: "POST",
|
|
1464
|
-
body: D,
|
|
1465
|
-
credentials: "include",
|
|
1466
|
-
headers: l ? { Authorization: `Bearer ${l}` } : void 0
|
|
1467
|
-
})).json();
|
|
1468
|
-
}
|
|
1469
|
-
function Y(v) {
|
|
1470
|
-
var n, M;
|
|
1471
|
-
if (typeof v == "string") return v;
|
|
1472
|
-
const D = v, l = (D == null ? void 0 : D.urls) ?? ((n = D == null ? void 0 : D.data) == null ? void 0 : n.urls) ?? ((M = D == null ? void 0 : D.data) == null ? void 0 : M.url) ?? (D == null ? void 0 : D.url) ?? "";
|
|
1473
|
-
return Array.isArray(l) ? l[0] || "" : l || "";
|
|
1474
|
-
}
|
|
1475
|
-
function k() {
|
|
1476
|
-
a(
|
|
1477
|
-
"change",
|
|
1478
|
-
mt(c.value || "", f.value || ""),
|
|
1479
|
-
f.value || ""
|
|
1480
|
-
);
|
|
1481
|
-
}
|
|
1482
|
-
return b({
|
|
1483
|
-
deleteImage: E,
|
|
1484
|
-
// 兼容旧 remarkImage,在表单 reset/clearFrom 时清空文字和图片。
|
|
1485
|
-
clearContent: d,
|
|
1486
|
-
// 给表单保存或外部调试读取当前拆分值。
|
|
1487
|
-
getValue: () => ({
|
|
1488
|
-
text: c.value || "",
|
|
1489
|
-
imageUrl: f.value || "",
|
|
1490
|
-
value: mt(c.value || "", f.value || "")
|
|
1491
|
-
})
|
|
1492
|
-
}), (v, D) => (V(), H("div", {
|
|
1493
|
-
class: he(["qy-remark-image", K.value]),
|
|
1494
|
-
style: Ae(Q.value)
|
|
1495
|
-
}, [
|
|
1496
|
-
W("div", pa, [
|
|
1497
|
-
R.value ? (V(), ee(C(tt), {
|
|
1498
|
-
key: 0,
|
|
1499
|
-
class: "qy-remark-image__prefix-select",
|
|
1500
|
-
"model-value": t.selectValue,
|
|
1501
|
-
options: t.selectOptions,
|
|
1502
|
-
disabled: t.disabled || t.selectDisabled,
|
|
1503
|
-
size: "small",
|
|
1504
|
-
"onUpdate:modelValue": G
|
|
1505
|
-
}, {
|
|
1506
|
-
default: S(() => [
|
|
1507
|
-
(V(!0), H(Be, null, Ue(t.selectOptions, (l) => (V(), ee(C(lt), {
|
|
1508
|
-
key: String(l.value),
|
|
1509
|
-
label: l.label,
|
|
1510
|
-
value: l.value,
|
|
1511
|
-
disabled: l.disabled
|
|
1512
|
-
}, null, 8, ["label", "value", "disabled"]))), 128))
|
|
1513
|
-
]),
|
|
1514
|
-
_: 1
|
|
1515
|
-
}, 8, ["model-value", "options", "disabled"])) : X("", !0),
|
|
1516
|
-
R.value ? (V(), H("span", ya)) : X("", !0),
|
|
1517
|
-
J(C(Me), ie({
|
|
1518
|
-
ref_key: "inputRef",
|
|
1519
|
-
ref: u,
|
|
1520
|
-
"model-value": c.value,
|
|
1521
|
-
type: I.value,
|
|
1522
|
-
rows: t.rows,
|
|
1523
|
-
autosize: t.autosize,
|
|
1524
|
-
disabled: t.disabled,
|
|
1525
|
-
placeholder: t.placeholder
|
|
1526
|
-
}, C(A), {
|
|
1527
|
-
"onUpdate:modelValue": P,
|
|
1528
|
-
onBlur: k
|
|
1529
|
-
}), null, 16, ["model-value", "type", "rows", "autosize", "disabled", "placeholder"]),
|
|
1530
|
-
J(C(yl), {
|
|
1531
|
-
placement: "top-start",
|
|
1532
|
-
width: 400,
|
|
1533
|
-
trigger: "hover",
|
|
1534
|
-
disabled: !f.value
|
|
1535
|
-
}, {
|
|
1536
|
-
reference: S(() => [
|
|
1537
|
-
W("div", ga, [
|
|
1538
|
-
J(C(gl), {
|
|
1539
|
-
disabled: B.value || t.disabled,
|
|
1540
|
-
class: "qy-remark-image__upload",
|
|
1541
|
-
"show-file-list": !1,
|
|
1542
|
-
"http-request": i
|
|
1543
|
-
}, {
|
|
1544
|
-
default: S(() => [
|
|
1545
|
-
B.value ? (V(), H("span", ha)) : f.value ? (V(), H("span", ba)) : (V(), H("span", va))
|
|
1546
|
-
]),
|
|
1547
|
-
_: 1
|
|
1548
|
-
}, 8, ["disabled"])
|
|
1549
|
-
])
|
|
1550
|
-
]),
|
|
1551
|
-
default: S(() => [
|
|
1552
|
-
W("div", wa, [
|
|
1553
|
-
W("img", {
|
|
1554
|
-
src: f.value,
|
|
1555
|
-
class: "qy-remark-image__preview-img"
|
|
1556
|
-
}, null, 8, ka),
|
|
1557
|
-
W("div", Sa, [
|
|
1558
|
-
D[1] || (D[1] = W("span", { class: "qy-remark-image__popover-tip" }, "再次点击按钮可更换图片", -1)),
|
|
1559
|
-
J(C(ke), {
|
|
1560
|
-
link: "",
|
|
1561
|
-
size: "small",
|
|
1562
|
-
type: "danger",
|
|
1563
|
-
disabled: t.disabled,
|
|
1564
|
-
onClick: E
|
|
1565
|
-
}, {
|
|
1566
|
-
default: S(() => [...D[0] || (D[0] = [
|
|
1567
|
-
me(" 删除图片 ", -1)
|
|
1568
|
-
])]),
|
|
1569
|
-
_: 1
|
|
1570
|
-
}, 8, ["disabled"])
|
|
1571
|
-
])
|
|
1572
|
-
])
|
|
1573
|
-
]),
|
|
1574
|
-
_: 1
|
|
1575
|
-
}, 8, ["disabled"])
|
|
1576
|
-
])
|
|
1577
|
-
], 6));
|
|
1578
|
-
}
|
|
1579
|
-
}), xa = /* @__PURE__ */ ze(Va, [["__scopeId", "data-v-3158c066"]]), Ca = /* @__PURE__ */ se({
|
|
1580
|
-
name: "QyInput",
|
|
1581
|
-
inheritAttrs: !1,
|
|
1582
|
-
__name: "index",
|
|
1583
|
-
props: {
|
|
1584
|
-
modelValue: { default: "" },
|
|
1585
|
-
removeSpace: { type: Boolean, default: !1 },
|
|
1586
|
-
trimMode: { default: "none" }
|
|
1587
|
-
},
|
|
1588
|
-
emits: ["update:modelValue", "input", "change", "focus", "blur", "clear", "enter"],
|
|
1589
|
-
setup(t, { expose: b, emit: w }) {
|
|
1590
|
-
const e = t, a = w, A = pe(), u = U(null), c = U(B(e.modelValue)), f = F(() => B(e.modelValue));
|
|
1591
|
-
re(
|
|
1592
|
-
() => e.modelValue,
|
|
1593
|
-
(n) => {
|
|
1594
|
-
c.value = B(n);
|
|
1595
|
-
}
|
|
1596
|
-
);
|
|
1597
|
-
function B(n) {
|
|
1598
|
-
return n == null ? "" : String(n);
|
|
1599
|
-
}
|
|
1600
|
-
function R(n) {
|
|
1601
|
-
return e.removeSpace ? n.replace(/\s+/g, "") : n;
|
|
1602
|
-
}
|
|
1603
|
-
function K(n, M) {
|
|
1604
|
-
return e.trimMode !== M ? n : n.trim();
|
|
1605
|
-
}
|
|
1606
|
-
function I(n) {
|
|
1607
|
-
return R(B(n));
|
|
1608
|
-
}
|
|
1609
|
-
function Q(n) {
|
|
1610
|
-
c.value = n, a("update:modelValue", n);
|
|
1611
|
-
}
|
|
1612
|
-
function h(n) {
|
|
1613
|
-
const M = I(n);
|
|
1614
|
-
Q(M);
|
|
1615
|
-
}
|
|
1616
|
-
function j(n) {
|
|
1617
|
-
c.value = B(n), a("input", B(n));
|
|
1618
|
-
}
|
|
1619
|
-
function P(n) {
|
|
1620
|
-
const M = K(I(n), "change");
|
|
1621
|
-
M !== B(e.modelValue) && Q(M), a("change", M);
|
|
1622
|
-
}
|
|
1623
|
-
function G(n) {
|
|
1624
|
-
a("focus", n);
|
|
1625
|
-
}
|
|
1626
|
-
function E(n) {
|
|
1627
|
-
const M = K(c.value, "blur");
|
|
1628
|
-
M !== B(e.modelValue) && Q(M), a("blur", n);
|
|
1629
|
-
}
|
|
1630
|
-
function d() {
|
|
1631
|
-
c.value = "", a("update:modelValue", ""), a("clear");
|
|
1632
|
-
}
|
|
1633
|
-
function x(n) {
|
|
1634
|
-
a("enter", n);
|
|
1635
|
-
}
|
|
1636
|
-
function i() {
|
|
1637
|
-
var n, M;
|
|
1638
|
-
(M = (n = u.value) == null ? void 0 : n.focus) == null || M.call(n);
|
|
1639
|
-
}
|
|
1640
|
-
function Z() {
|
|
1641
|
-
var n, M;
|
|
1642
|
-
(M = (n = u.value) == null ? void 0 : n.blur) == null || M.call(n);
|
|
1643
|
-
}
|
|
1644
|
-
function Y() {
|
|
1645
|
-
var n, M;
|
|
1646
|
-
(M = (n = u.value) == null ? void 0 : n.select) == null || M.call(n);
|
|
1647
|
-
}
|
|
1648
|
-
function k() {
|
|
1649
|
-
var n, M;
|
|
1650
|
-
(M = (n = u.value) == null ? void 0 : n.clear) == null || M.call(n);
|
|
1651
|
-
}
|
|
1652
|
-
function v() {
|
|
1653
|
-
var n, M;
|
|
1654
|
-
(M = (n = u.value) == null ? void 0 : n.resizeTextarea) == null || M.call(n);
|
|
1655
|
-
}
|
|
1656
|
-
function D() {
|
|
1657
|
-
var n;
|
|
1658
|
-
return ((n = u.value) == null ? void 0 : n.input) || null;
|
|
1659
|
-
}
|
|
1660
|
-
function l() {
|
|
1661
|
-
var n;
|
|
1662
|
-
return ((n = u.value) == null ? void 0 : n.textarea) || null;
|
|
1663
|
-
}
|
|
1664
|
-
return b({
|
|
1665
|
-
// 暴露 Element Plus 常用输入框方法,方便业务弹窗做聚焦、选中和 textarea 重算高度。
|
|
1666
|
-
focus: i,
|
|
1667
|
-
blur: Z,
|
|
1668
|
-
select: Y,
|
|
1669
|
-
clear: k,
|
|
1670
|
-
resizeTextarea: v,
|
|
1671
|
-
getNativeInput: D,
|
|
1672
|
-
getTextarea: l
|
|
1673
|
-
}), (n, M) => (V(), ee(C(Me), ie({
|
|
1674
|
-
ref_key: "inputRef",
|
|
1675
|
-
ref: u
|
|
1676
|
-
}, C(A), {
|
|
1677
|
-
"model-value": f.value,
|
|
1678
|
-
"onUpdate:modelValue": h,
|
|
1679
|
-
onInput: j,
|
|
1680
|
-
onChange: P,
|
|
1681
|
-
onFocus: G,
|
|
1682
|
-
onBlur: E,
|
|
1683
|
-
onClear: d,
|
|
1684
|
-
onKeydown: Ke(x, ["enter"])
|
|
1685
|
-
}), Re({ _: 2 }, [
|
|
1686
|
-
n.$slots.prefix ? {
|
|
1687
|
-
name: "prefix",
|
|
1688
|
-
fn: S(() => [
|
|
1689
|
-
O(n.$slots, "prefix")
|
|
1690
|
-
]),
|
|
1691
|
-
key: "0"
|
|
1692
|
-
} : void 0,
|
|
1693
|
-
n.$slots.suffix ? {
|
|
1694
|
-
name: "suffix",
|
|
1695
|
-
fn: S(() => [
|
|
1696
|
-
O(n.$slots, "suffix")
|
|
1697
|
-
]),
|
|
1698
|
-
key: "1"
|
|
1699
|
-
} : void 0,
|
|
1700
|
-
n.$slots.prepend ? {
|
|
1701
|
-
name: "prepend",
|
|
1702
|
-
fn: S(() => [
|
|
1703
|
-
O(n.$slots, "prepend")
|
|
1704
|
-
]),
|
|
1705
|
-
key: "2"
|
|
1706
|
-
} : void 0,
|
|
1707
|
-
n.$slots.append ? {
|
|
1708
|
-
name: "append",
|
|
1709
|
-
fn: S(() => [
|
|
1710
|
-
O(n.$slots, "append")
|
|
1711
|
-
]),
|
|
1712
|
-
key: "3"
|
|
1713
|
-
} : void 0
|
|
1714
|
-
]), 1040, ["model-value"]));
|
|
1715
|
-
}
|
|
1716
|
-
}), $a = /* @__PURE__ */ se({
|
|
1717
|
-
name: "QyInputNumber",
|
|
1718
|
-
inheritAttrs: !1,
|
|
1719
|
-
__name: "index",
|
|
1720
|
-
props: {
|
|
1721
|
-
modelValue: { default: void 0 },
|
|
1722
|
-
min: { default: void 0 },
|
|
1723
|
-
max: { default: void 0 },
|
|
1724
|
-
step: { default: 1 },
|
|
1725
|
-
stepStrictly: { type: Boolean, default: !1 },
|
|
1726
|
-
precision: { default: void 0 },
|
|
1727
|
-
controls: { type: Boolean, default: !0 },
|
|
1728
|
-
controlsPosition: { default: "" },
|
|
1729
|
-
placeholder: { default: "请输入数字" },
|
|
1730
|
-
disabled: { type: Boolean, default: !1 },
|
|
1731
|
-
size: { default: void 0 }
|
|
1732
|
-
},
|
|
1733
|
-
emits: ["update:modelValue", "change", "focus", "blur"],
|
|
1734
|
-
setup(t, { expose: b, emit: w }) {
|
|
1735
|
-
const e = w, a = pe(), A = U(null);
|
|
1736
|
-
function u(I) {
|
|
1737
|
-
e("update:modelValue", I);
|
|
1738
|
-
}
|
|
1739
|
-
function c(I, Q) {
|
|
1740
|
-
e("change", I, Q);
|
|
1741
|
-
}
|
|
1742
|
-
function f(I) {
|
|
1743
|
-
e("focus", I);
|
|
1744
|
-
}
|
|
1745
|
-
function B(I) {
|
|
1746
|
-
e("blur", I);
|
|
1747
|
-
}
|
|
1748
|
-
function R() {
|
|
1749
|
-
var I, Q;
|
|
1750
|
-
(Q = (I = A.value) == null ? void 0 : I.focus) == null || Q.call(I);
|
|
1751
|
-
}
|
|
1752
|
-
function K() {
|
|
1753
|
-
var I, Q;
|
|
1754
|
-
(Q = (I = A.value) == null ? void 0 : I.blur) == null || Q.call(I);
|
|
1755
|
-
}
|
|
1756
|
-
return b({
|
|
1757
|
-
focus: R,
|
|
1758
|
-
blur: K
|
|
1759
|
-
}), (I, Q) => (V(), ee(C(hl), ie({
|
|
1760
|
-
ref_key: "inputNumberRef",
|
|
1761
|
-
ref: A
|
|
1762
|
-
}, C(a), {
|
|
1763
|
-
"model-value": t.modelValue,
|
|
1764
|
-
min: t.min,
|
|
1765
|
-
max: t.max,
|
|
1766
|
-
step: t.step,
|
|
1767
|
-
"step-strictly": t.stepStrictly,
|
|
1768
|
-
precision: t.precision,
|
|
1769
|
-
controls: t.controls,
|
|
1770
|
-
"controls-position": t.controlsPosition,
|
|
1771
|
-
placeholder: t.placeholder,
|
|
1772
|
-
disabled: t.disabled,
|
|
1773
|
-
size: t.size,
|
|
1774
|
-
"onUpdate:modelValue": u,
|
|
1775
|
-
onChange: c,
|
|
1776
|
-
onFocus: f,
|
|
1777
|
-
onBlur: B
|
|
1778
|
-
}), null, 16, ["model-value", "min", "max", "step", "step-strictly", "precision", "controls", "controls-position", "placeholder", "disabled", "size"]));
|
|
1779
|
-
}
|
|
1780
|
-
}), Ba = /* @__PURE__ */ se({
|
|
1781
|
-
name: "QyMoneyInput",
|
|
1782
|
-
inheritAttrs: !1,
|
|
1783
|
-
__name: "index",
|
|
1784
|
-
props: {
|
|
1785
|
-
modelValue: { default: "" },
|
|
1786
|
-
precision: { default: 2 },
|
|
1787
|
-
min: { default: void 0 },
|
|
1788
|
-
max: { default: void 0 },
|
|
1789
|
-
allowNegative: { type: Boolean, default: !1 },
|
|
1790
|
-
formatTrigger: { default: "blur" },
|
|
1791
|
-
emptyValue: { default: "" }
|
|
1792
|
-
},
|
|
1793
|
-
emits: ["update:modelValue", "input", "change", "focus", "blur", "clear", "enter"],
|
|
1794
|
-
setup(t, { expose: b, emit: w }) {
|
|
1795
|
-
const e = t, a = w, A = pe(), u = U(null), c = U(B(e.modelValue)), f = F(() => B(e.modelValue));
|
|
1796
|
-
re(
|
|
1797
|
-
() => e.modelValue,
|
|
1798
|
-
(l) => {
|
|
1799
|
-
c.value = B(l);
|
|
1800
|
-
}
|
|
1801
|
-
);
|
|
1802
|
-
function B(l) {
|
|
1803
|
-
return l == null ? "" : String(l);
|
|
1804
|
-
}
|
|
1805
|
-
function R(l) {
|
|
1806
|
-
return Number.isFinite(l) ? Math.max(0, Math.floor(l)) : 2;
|
|
1807
|
-
}
|
|
1808
|
-
function K(l) {
|
|
1809
|
-
const n = B(l);
|
|
1810
|
-
let M = "", le = !1, y = !1;
|
|
1811
|
-
const $ = R(e.precision);
|
|
1812
|
-
for (let N = 0; N < n.length; N += 1) {
|
|
1813
|
-
const z = n[N];
|
|
1814
|
-
if (z >= "0" && z <= "9") {
|
|
1815
|
-
M += z;
|
|
1816
|
-
continue;
|
|
1817
|
-
}
|
|
1818
|
-
if (z === "." && $ > 0 && !le) {
|
|
1819
|
-
M += z, le = !0;
|
|
1820
|
-
continue;
|
|
1821
|
-
}
|
|
1822
|
-
z === "-" && e.allowNegative && N === 0 && !y && (M += z, y = !0);
|
|
1823
|
-
}
|
|
1824
|
-
if ($ > 0 && le) {
|
|
1825
|
-
const [N, z = ""] = M.split(".");
|
|
1826
|
-
return `${N}.${z.slice(0, $)}`;
|
|
1827
|
-
}
|
|
1828
|
-
return M;
|
|
1829
|
-
}
|
|
1830
|
-
function I(l) {
|
|
1831
|
-
let n = l;
|
|
1832
|
-
return typeof e.min == "number" && Number.isFinite(e.min) && (n = Math.max(n, e.min)), typeof e.max == "number" && Number.isFinite(e.max) && (n = Math.min(n, e.max)), n;
|
|
1833
|
-
}
|
|
1834
|
-
function Q(l) {
|
|
1835
|
-
const n = K(l);
|
|
1836
|
-
if (!n || n === "-" || n === ".")
|
|
1837
|
-
return B(e.emptyValue);
|
|
1838
|
-
const M = Number(n);
|
|
1839
|
-
if (Number.isNaN(M)) return B(e.emptyValue);
|
|
1840
|
-
const le = R(e.precision);
|
|
1841
|
-
return I(M).toFixed(le);
|
|
1842
|
-
}
|
|
1843
|
-
function h(l) {
|
|
1844
|
-
c.value = l, a("update:modelValue", l);
|
|
1845
|
-
}
|
|
1846
|
-
function j(l) {
|
|
1847
|
-
const n = K(l);
|
|
1848
|
-
h(n);
|
|
1849
|
-
}
|
|
1850
|
-
function P(l) {
|
|
1851
|
-
const n = K(l);
|
|
1852
|
-
c.value = n, a("input", n);
|
|
1853
|
-
}
|
|
1854
|
-
function G(l) {
|
|
1855
|
-
const n = e.formatTrigger === "change" ? Q(l) : K(l);
|
|
1856
|
-
n !== B(e.modelValue) && h(n), a("change", n);
|
|
1857
|
-
}
|
|
1858
|
-
function E(l) {
|
|
1859
|
-
a("focus", l);
|
|
1860
|
-
}
|
|
1861
|
-
function d(l) {
|
|
1862
|
-
if (e.formatTrigger === "blur") {
|
|
1863
|
-
const n = Q(c.value);
|
|
1864
|
-
n !== B(e.modelValue) && h(n);
|
|
1865
|
-
}
|
|
1866
|
-
a("blur", l);
|
|
1867
|
-
}
|
|
1868
|
-
function x() {
|
|
1869
|
-
const l = B(e.emptyValue);
|
|
1870
|
-
c.value = l, a("update:modelValue", l), a("clear");
|
|
1871
|
-
}
|
|
1872
|
-
function i(l) {
|
|
1873
|
-
a("enter", l);
|
|
1874
|
-
}
|
|
1875
|
-
function Z() {
|
|
1876
|
-
var l, n;
|
|
1877
|
-
(n = (l = u.value) == null ? void 0 : l.focus) == null || n.call(l);
|
|
1878
|
-
}
|
|
1879
|
-
function Y() {
|
|
1880
|
-
var l, n;
|
|
1881
|
-
(n = (l = u.value) == null ? void 0 : l.blur) == null || n.call(l);
|
|
1882
|
-
}
|
|
1883
|
-
function k() {
|
|
1884
|
-
var l, n;
|
|
1885
|
-
(n = (l = u.value) == null ? void 0 : l.select) == null || n.call(l);
|
|
1886
|
-
}
|
|
1887
|
-
function v() {
|
|
1888
|
-
var l, n;
|
|
1889
|
-
(n = (l = u.value) == null ? void 0 : l.clear) == null || n.call(l);
|
|
1890
|
-
}
|
|
1891
|
-
function D() {
|
|
1892
|
-
var l;
|
|
1893
|
-
return ((l = u.value) == null ? void 0 : l.input) || null;
|
|
1894
|
-
}
|
|
1895
|
-
return b({
|
|
1896
|
-
focus: Z,
|
|
1897
|
-
blur: Y,
|
|
1898
|
-
select: k,
|
|
1899
|
-
clear: v,
|
|
1900
|
-
getNativeInput: D
|
|
1901
|
-
}), (l, n) => (V(), ee(C(Me), ie({
|
|
1902
|
-
ref_key: "inputRef",
|
|
1903
|
-
ref: u
|
|
1904
|
-
}, C(A), {
|
|
1905
|
-
"model-value": f.value,
|
|
1906
|
-
inputmode: "decimal",
|
|
1907
|
-
"onUpdate:modelValue": j,
|
|
1908
|
-
onInput: P,
|
|
1909
|
-
onChange: G,
|
|
1910
|
-
onFocus: E,
|
|
1911
|
-
onBlur: d,
|
|
1912
|
-
onClear: x,
|
|
1913
|
-
onKeydown: Ke(i, ["enter"])
|
|
1914
|
-
}), Re({ _: 2 }, [
|
|
1915
|
-
l.$slots.prefix ? {
|
|
1916
|
-
name: "prefix",
|
|
1917
|
-
fn: S(() => [
|
|
1918
|
-
O(l.$slots, "prefix")
|
|
1919
|
-
]),
|
|
1920
|
-
key: "0"
|
|
1921
|
-
} : void 0,
|
|
1922
|
-
l.$slots.suffix ? {
|
|
1923
|
-
name: "suffix",
|
|
1924
|
-
fn: S(() => [
|
|
1925
|
-
O(l.$slots, "suffix")
|
|
1926
|
-
]),
|
|
1927
|
-
key: "1"
|
|
1928
|
-
} : void 0,
|
|
1929
|
-
l.$slots.prepend ? {
|
|
1930
|
-
name: "prepend",
|
|
1931
|
-
fn: S(() => [
|
|
1932
|
-
O(l.$slots, "prepend")
|
|
1933
|
-
]),
|
|
1934
|
-
key: "2"
|
|
1935
|
-
} : void 0,
|
|
1936
|
-
l.$slots.append ? {
|
|
1937
|
-
name: "append",
|
|
1938
|
-
fn: S(() => [
|
|
1939
|
-
O(l.$slots, "append")
|
|
1940
|
-
]),
|
|
1941
|
-
key: "3"
|
|
1942
|
-
} : void 0
|
|
1943
|
-
]), 1040, ["model-value"]));
|
|
1944
|
-
}
|
|
1945
|
-
}), za = /* @__PURE__ */ se({
|
|
1946
|
-
name: "QyDatePicker",
|
|
1947
|
-
inheritAttrs: !1,
|
|
1948
|
-
__name: "index",
|
|
1949
|
-
props: {
|
|
1950
|
-
modelValue: { default: void 0 },
|
|
1951
|
-
type: { default: "date" },
|
|
1952
|
-
placeholder: { default: "请选择日期" },
|
|
1953
|
-
startPlaceholder: { default: "开始时间" },
|
|
1954
|
-
endPlaceholder: { default: "结束时间" },
|
|
1955
|
-
rangeSeparator: { default: "-" },
|
|
1956
|
-
format: { default: void 0 },
|
|
1957
|
-
valueFormat: { default: void 0 },
|
|
1958
|
-
defaultTime: { default: void 0 },
|
|
1959
|
-
disabledDate: { type: Function, default: void 0 },
|
|
1960
|
-
shortcuts: { default: void 0 },
|
|
1961
|
-
clearable: { type: Boolean, default: !0 },
|
|
1962
|
-
disabled: { type: Boolean, default: !1 },
|
|
1963
|
-
size: { default: void 0 },
|
|
1964
|
-
teleported: { type: Boolean, default: !0 },
|
|
1965
|
-
appendTo: { default: "body" },
|
|
1966
|
-
popperClass: { default: "" },
|
|
1967
|
-
normalizeRangeEndTime: { type: Boolean, default: !1 }
|
|
1968
|
-
},
|
|
1969
|
-
emits: ["update:modelValue", "change", "clear", "calendar-change", "panel-change", "visible-change", "focus", "blur"],
|
|
1970
|
-
setup(t, { expose: b, emit: w }) {
|
|
1971
|
-
const e = t, a = w, A = pe(), u = U(null), c = F(
|
|
1972
|
-
() => ["qy-date-picker__popper", e.popperClass].filter(Boolean).join(" ")
|
|
1973
|
-
);
|
|
1974
|
-
function f(k) {
|
|
1975
|
-
return Array.isArray(k);
|
|
1976
|
-
}
|
|
1977
|
-
function B(k) {
|
|
1978
|
-
const v = new Date(k);
|
|
1979
|
-
return v.getHours() === 0 && v.getMinutes() === 0 && v.getSeconds() === 0 && v.setHours(23, 59, 59, 0), v;
|
|
1980
|
-
}
|
|
1981
|
-
function R(k) {
|
|
1982
|
-
return /\s00:00:00$/.test(k) ? k.replace(/\s00:00:00$/, " 23:59:59") : /T00:00:00(?:\.000)?(?:Z|[+-]\d{2}:?\d{2})?$/.test(k) ? k.replace(
|
|
1983
|
-
/T00:00:00(\.000)?(Z|[+-]\d{2}:?\d{2})?$/,
|
|
1984
|
-
"T23:59:59$1$2"
|
|
1985
|
-
) : k;
|
|
1986
|
-
}
|
|
1987
|
-
function K(k) {
|
|
1988
|
-
if (!e.normalizeRangeEndTime || !f(k) || k.length < 2)
|
|
1989
|
-
return k;
|
|
1990
|
-
const v = [...k], D = v[1];
|
|
1991
|
-
return D instanceof Date ? v[1] = B(D) : typeof D == "string" && (v[1] = R(D)), v;
|
|
1992
|
-
}
|
|
1993
|
-
function I(k) {
|
|
1994
|
-
a("update:modelValue", K(k));
|
|
1995
|
-
}
|
|
1996
|
-
function Q(k) {
|
|
1997
|
-
a("change", K(k));
|
|
1998
|
-
}
|
|
1999
|
-
function h() {
|
|
2000
|
-
a("clear");
|
|
2001
|
-
}
|
|
2002
|
-
function j(k) {
|
|
2003
|
-
a("calendar-change", k);
|
|
2004
|
-
}
|
|
2005
|
-
function P(k, v, D) {
|
|
2006
|
-
a("panel-change", k, v, D);
|
|
2007
|
-
}
|
|
2008
|
-
function G(k) {
|
|
2009
|
-
a("visible-change", k);
|
|
2010
|
-
}
|
|
2011
|
-
function E(k) {
|
|
2012
|
-
a("focus", k);
|
|
2013
|
-
}
|
|
2014
|
-
function d(k) {
|
|
2015
|
-
a("blur", k);
|
|
2016
|
-
}
|
|
2017
|
-
function x() {
|
|
2018
|
-
var k, v;
|
|
2019
|
-
(v = (k = u.value) == null ? void 0 : k.focus) == null || v.call(k);
|
|
2020
|
-
}
|
|
2021
|
-
function i() {
|
|
2022
|
-
var k, v;
|
|
2023
|
-
(v = (k = u.value) == null ? void 0 : k.blur) == null || v.call(k);
|
|
2024
|
-
}
|
|
2025
|
-
function Z() {
|
|
2026
|
-
var k, v;
|
|
2027
|
-
(v = (k = u.value) == null ? void 0 : k.handleOpen) == null || v.call(k);
|
|
2028
|
-
}
|
|
2029
|
-
function Y() {
|
|
2030
|
-
var k, v;
|
|
2031
|
-
(v = (k = u.value) == null ? void 0 : k.handleClose) == null || v.call(k);
|
|
2032
|
-
}
|
|
2033
|
-
return b({
|
|
2034
|
-
focus: x,
|
|
2035
|
-
blur: i,
|
|
2036
|
-
handleOpen: Z,
|
|
2037
|
-
handleClose: Y
|
|
2038
|
-
}), (k, v) => (V(), ee(C(vl), ie({
|
|
2039
|
-
ref_key: "datePickerRef",
|
|
2040
|
-
ref: u
|
|
2041
|
-
}, C(A), {
|
|
2042
|
-
"model-value": t.modelValue,
|
|
2043
|
-
type: t.type,
|
|
2044
|
-
placeholder: t.placeholder,
|
|
2045
|
-
"start-placeholder": t.startPlaceholder,
|
|
2046
|
-
"end-placeholder": t.endPlaceholder,
|
|
2047
|
-
"range-separator": t.rangeSeparator,
|
|
2048
|
-
format: t.format,
|
|
2049
|
-
"value-format": t.valueFormat,
|
|
2050
|
-
"default-time": t.defaultTime,
|
|
2051
|
-
"disabled-date": t.disabledDate,
|
|
2052
|
-
shortcuts: t.shortcuts,
|
|
2053
|
-
clearable: t.clearable,
|
|
2054
|
-
disabled: t.disabled,
|
|
2055
|
-
size: t.size,
|
|
2056
|
-
teleported: t.teleported,
|
|
2057
|
-
"append-to": t.appendTo,
|
|
2058
|
-
"popper-class": c.value,
|
|
2059
|
-
"onUpdate:modelValue": I,
|
|
2060
|
-
onChange: Q,
|
|
2061
|
-
onClear: h,
|
|
2062
|
-
onCalendarChange: j,
|
|
2063
|
-
onPanelChange: P,
|
|
2064
|
-
onVisibleChange: G,
|
|
2065
|
-
onFocus: E,
|
|
2066
|
-
onBlur: d
|
|
2067
|
-
}), null, 16, ["model-value", "type", "placeholder", "start-placeholder", "end-placeholder", "range-separator", "format", "value-format", "default-time", "disabled-date", "shortcuts", "clearable", "disabled", "size", "teleported", "append-to", "popper-class"]));
|
|
2068
|
-
}
|
|
2069
|
-
}), qa = /* @__PURE__ */ se({
|
|
2070
|
-
name: "QyCheckbox",
|
|
2071
|
-
inheritAttrs: !1,
|
|
2072
|
-
__name: "index",
|
|
2073
|
-
props: {
|
|
2074
|
-
modelValue: { type: [String, Number, Boolean], default: !1 },
|
|
2075
|
-
disabled: { type: Boolean, default: !1 },
|
|
2076
|
-
size: { default: void 0 },
|
|
2077
|
-
trueValue: { type: [String, Number, Boolean], default: !0 },
|
|
2078
|
-
falseValue: { type: [String, Number, Boolean], default: !1 }
|
|
2079
|
-
},
|
|
2080
|
-
emits: ["update:modelValue", "change", "focus", "blur"],
|
|
2081
|
-
setup(t, { expose: b, emit: w }) {
|
|
2082
|
-
const e = t, a = w, A = pe(), u = U(null), c = F(() => typeof e.trueValue == "boolean" && typeof e.falseValue == "boolean" ? {} : {
|
|
2083
|
-
trueValue: e.trueValue,
|
|
2084
|
-
falseValue: e.falseValue
|
|
2085
|
-
}), f = F(() => ({
|
|
2086
|
-
...A,
|
|
2087
|
-
...c.value
|
|
2088
|
-
}));
|
|
2089
|
-
function B(h) {
|
|
2090
|
-
a("update:modelValue", h);
|
|
2091
|
-
}
|
|
2092
|
-
function R(h) {
|
|
2093
|
-
a("change", h);
|
|
2094
|
-
}
|
|
2095
|
-
function K(h) {
|
|
2096
|
-
a("focus", h);
|
|
2097
|
-
}
|
|
2098
|
-
function I(h) {
|
|
2099
|
-
a("blur", h);
|
|
2100
|
-
}
|
|
2101
|
-
function Q() {
|
|
2102
|
-
return u.value;
|
|
2103
|
-
}
|
|
2104
|
-
return b({
|
|
2105
|
-
getCheckboxInstance: Q
|
|
2106
|
-
}), (h, j) => (V(), ee(C(bl), ie({
|
|
2107
|
-
ref_key: "checkboxRef",
|
|
2108
|
-
ref: u
|
|
2109
|
-
}, f.value, {
|
|
2110
|
-
"model-value": t.modelValue,
|
|
2111
|
-
disabled: t.disabled,
|
|
2112
|
-
size: t.size,
|
|
2113
|
-
"onUpdate:modelValue": B,
|
|
2114
|
-
onChange: R,
|
|
2115
|
-
onFocus: K,
|
|
2116
|
-
onBlur: I
|
|
2117
|
-
}), {
|
|
2118
|
-
default: S(() => [
|
|
2119
|
-
O(h.$slots, "default")
|
|
2120
|
-
]),
|
|
2121
|
-
_: 3
|
|
2122
|
-
}, 16, ["model-value", "disabled", "size"]));
|
|
2123
|
-
}
|
|
2124
|
-
}), Ia = /* @__PURE__ */ se({
|
|
2125
|
-
name: "QyAutocomplete",
|
|
2126
|
-
inheritAttrs: !1,
|
|
2127
|
-
__name: "index",
|
|
2128
|
-
props: {
|
|
2129
|
-
modelValue: { default: "" },
|
|
2130
|
-
options: { default: () => [] },
|
|
2131
|
-
valueKey: { default: "value" },
|
|
2132
|
-
labelKey: { default: "label" },
|
|
2133
|
-
placeholder: { default: "请输入" },
|
|
2134
|
-
disabled: { type: Boolean, default: !1 },
|
|
2135
|
-
clearable: { type: Boolean, default: !0 },
|
|
2136
|
-
size: { default: void 0 },
|
|
2137
|
-
teleported: { type: Boolean, default: !0 },
|
|
2138
|
-
appendTo: { default: "body" },
|
|
2139
|
-
popperClass: { default: "" },
|
|
2140
|
-
filterMethod: { type: Function, default: void 0 }
|
|
2141
|
-
},
|
|
2142
|
-
emits: ["update:modelValue", "input", "change", "select", "focus", "blur", "clear"],
|
|
2143
|
-
setup(t, { expose: b, emit: w }) {
|
|
2144
|
-
const e = t, a = w, A = pe(), u = U(null), c = F(
|
|
2145
|
-
() => ["qy-autocomplete__popper", e.popperClass].filter(Boolean).join(" ")
|
|
2146
|
-
), f = F(() => {
|
|
2147
|
-
const d = C(e.options);
|
|
2148
|
-
return (Array.isArray(d) ? d : C(d == null ? void 0 : d.value) || []).map((i) => ({
|
|
2149
|
-
...i,
|
|
2150
|
-
value: (i == null ? void 0 : i[e.valueKey]) ?? (i == null ? void 0 : i.value) ?? (i == null ? void 0 : i[e.labelKey]) ?? (i == null ? void 0 : i.label) ?? ""
|
|
2151
|
-
}));
|
|
2152
|
-
});
|
|
2153
|
-
function B(d, x) {
|
|
2154
|
-
const i = String(d ?? ""), Z = f.value.filter((Y) => e.filterMethod ? e.filterMethod(i, Y) : i ? String(Y.value ?? "").includes(i) : !0);
|
|
2155
|
-
x(Z);
|
|
2156
|
-
}
|
|
2157
|
-
function R(d) {
|
|
2158
|
-
a("update:modelValue", d);
|
|
2159
|
-
}
|
|
2160
|
-
function K(d) {
|
|
2161
|
-
a("input", d);
|
|
2162
|
-
}
|
|
2163
|
-
function I(d) {
|
|
2164
|
-
a("change", d);
|
|
2165
|
-
}
|
|
2166
|
-
function Q(d) {
|
|
2167
|
-
a("select", d);
|
|
2168
|
-
}
|
|
2169
|
-
function h(d) {
|
|
2170
|
-
a("focus", d);
|
|
2171
|
-
}
|
|
2172
|
-
function j(d) {
|
|
2173
|
-
a("blur", d);
|
|
2174
|
-
}
|
|
2175
|
-
function P() {
|
|
2176
|
-
a("clear");
|
|
2177
|
-
}
|
|
2178
|
-
function G() {
|
|
2179
|
-
var d, x;
|
|
2180
|
-
(x = (d = u.value) == null ? void 0 : d.focus) == null || x.call(d);
|
|
2181
|
-
}
|
|
2182
|
-
function E() {
|
|
2183
|
-
var d, x;
|
|
2184
|
-
(x = (d = u.value) == null ? void 0 : d.blur) == null || x.call(d);
|
|
2185
|
-
}
|
|
2186
|
-
return b({
|
|
2187
|
-
querySearch: B,
|
|
2188
|
-
focus: G,
|
|
2189
|
-
blur: E
|
|
2190
|
-
}), (d, x) => (V(), ee(C(bt), ie({
|
|
2191
|
-
ref_key: "autocompleteRef",
|
|
2192
|
-
ref: u
|
|
2193
|
-
}, C(A), {
|
|
2194
|
-
"model-value": t.modelValue,
|
|
2195
|
-
"fetch-suggestions": B,
|
|
2196
|
-
placeholder: t.placeholder,
|
|
2197
|
-
disabled: t.disabled,
|
|
2198
|
-
clearable: t.clearable,
|
|
2199
|
-
size: t.size,
|
|
2200
|
-
teleported: t.teleported,
|
|
2201
|
-
"append-to": t.appendTo,
|
|
2202
|
-
"popper-class": c.value,
|
|
2203
|
-
"onUpdate:modelValue": R,
|
|
2204
|
-
onInput: K,
|
|
2205
|
-
onChange: I,
|
|
2206
|
-
onSelect: Q,
|
|
2207
|
-
onFocus: h,
|
|
2208
|
-
onBlur: j,
|
|
2209
|
-
onClear: P
|
|
2210
|
-
}), null, 16, ["model-value", "placeholder", "disabled", "clearable", "size", "teleported", "append-to", "popper-class"]));
|
|
2211
|
-
}
|
|
2212
|
-
}), Ra = /* @__PURE__ */ se({
|
|
2213
|
-
name: "QyRadioGroup",
|
|
2214
|
-
inheritAttrs: !1,
|
|
2215
|
-
__name: "index",
|
|
2216
|
-
props: {
|
|
2217
|
-
modelValue: { type: [String, Number, Boolean, null], default: void 0 },
|
|
2218
|
-
options: { default: () => [] },
|
|
2219
|
-
labelKey: { default: "label" },
|
|
2220
|
-
valueKey: { default: "value" },
|
|
2221
|
-
disabledKey: { default: "disabled" },
|
|
2222
|
-
disabled: { type: Boolean, default: !1 },
|
|
2223
|
-
size: { default: void 0 },
|
|
2224
|
-
name: { default: void 0 },
|
|
2225
|
-
type: { default: "radio" },
|
|
2226
|
-
border: { type: Boolean, default: !1 }
|
|
2227
|
-
},
|
|
2228
|
-
emits: ["update:modelValue", "change"],
|
|
2229
|
-
setup(t, { expose: b, emit: w }) {
|
|
2230
|
-
const e = t, a = w, A = pe(), u = U(null), c = F(
|
|
2231
|
-
() => e.type === "button" ? wl : kl
|
|
2232
|
-
), f = F(
|
|
2233
|
-
() => (e.options || []).map((h) => ({
|
|
2234
|
-
raw: h,
|
|
2235
|
-
label: (h == null ? void 0 : h[e.labelKey]) ?? (h == null ? void 0 : h.label) ?? (h == null ? void 0 : h.value) ?? "",
|
|
2236
|
-
value: (h == null ? void 0 : h[e.valueKey]) ?? (h == null ? void 0 : h.value) ?? (h == null ? void 0 : h.label),
|
|
2237
|
-
disabled: !!(h != null && h[e.disabledKey])
|
|
2238
|
-
}))
|
|
2239
|
-
);
|
|
2240
|
-
function B(h) {
|
|
2241
|
-
const j = {
|
|
2242
|
-
value: h.value,
|
|
2243
|
-
label: h.value,
|
|
2244
|
-
disabled: h.disabled
|
|
2245
|
-
};
|
|
2246
|
-
return e.type === "button" ? j : {
|
|
2247
|
-
...j,
|
|
2248
|
-
border: e.border
|
|
2249
|
-
};
|
|
2250
|
-
}
|
|
2251
|
-
function R(h, j) {
|
|
2252
|
-
return `${String(h.value ?? h.label ?? "")}-${j}`;
|
|
2253
|
-
}
|
|
2254
|
-
function K(h) {
|
|
2255
|
-
a("update:modelValue", h);
|
|
2256
|
-
}
|
|
2257
|
-
function I(h) {
|
|
2258
|
-
a("change", h);
|
|
2259
|
-
}
|
|
2260
|
-
function Q() {
|
|
2261
|
-
return u.value;
|
|
2262
|
-
}
|
|
2263
|
-
return b({
|
|
2264
|
-
getRadioGroupInstance: Q
|
|
2265
|
-
}), (h, j) => (V(), ee(C(Sl), ie({
|
|
2266
|
-
ref_key: "radioGroupRef",
|
|
2267
|
-
ref: u
|
|
2268
|
-
}, C(A), {
|
|
2269
|
-
"model-value": t.modelValue,
|
|
2270
|
-
disabled: t.disabled,
|
|
2271
|
-
size: t.size,
|
|
2272
|
-
name: t.name,
|
|
2273
|
-
"onUpdate:modelValue": K,
|
|
2274
|
-
onChange: I
|
|
2275
|
-
}), {
|
|
2276
|
-
default: S(() => [
|
|
2277
|
-
h.$slots.default ? O(h.$slots, "default", { key: 0 }) : (V(!0), H(Be, { key: 1 }, Ue(f.value, (P, G) => (V(), ee(il(c.value), ie({
|
|
2278
|
-
key: R(P, G)
|
|
2279
|
-
}, { ref_for: !0 }, B(P)), {
|
|
2280
|
-
default: S(() => [
|
|
2281
|
-
O(h.$slots, "option", {
|
|
2282
|
-
option: P.raw,
|
|
2283
|
-
label: P.label,
|
|
2284
|
-
value: P.value,
|
|
2285
|
-
disabled: P.disabled
|
|
2286
|
-
}, () => [
|
|
2287
|
-
me(fe(P.label), 1)
|
|
2288
|
-
])
|
|
2289
|
-
]),
|
|
2290
|
-
_: 2
|
|
2291
|
-
}, 1040))), 128))
|
|
2292
|
-
]),
|
|
2293
|
-
_: 3
|
|
2294
|
-
}, 16, ["model-value", "disabled", "size", "name"]));
|
|
2295
|
-
}
|
|
2296
|
-
}), at = /* @__PURE__ */ se({
|
|
2297
|
-
name: "QySelect",
|
|
2298
|
-
inheritAttrs: !1,
|
|
2299
|
-
__name: "index",
|
|
2300
|
-
props: {
|
|
2301
|
-
modelValue: { type: [String, Number, Boolean, Array, null], default: void 0 },
|
|
2302
|
-
options: { default: () => [] },
|
|
2303
|
-
labelKey: { default: "label" },
|
|
2304
|
-
valueKey: { default: "value" },
|
|
2305
|
-
disabledKey: { default: "disabled" },
|
|
2306
|
-
placeholder: { default: "请选择" },
|
|
2307
|
-
disabled: { type: Boolean, default: !1 },
|
|
2308
|
-
clearable: { type: Boolean, default: !0 },
|
|
2309
|
-
filterable: { type: Boolean, default: !1 },
|
|
2310
|
-
multiple: { type: Boolean, default: !1 },
|
|
2311
|
-
collapseTags: { type: Boolean, default: !1 },
|
|
2312
|
-
collapseTagsTooltip: { type: Boolean, default: !1 },
|
|
2313
|
-
autoSelectSingle: { type: Boolean, default: !1 },
|
|
2314
|
-
size: { default: void 0 },
|
|
2315
|
-
teleported: { type: Boolean, default: !0 },
|
|
2316
|
-
appendTo: { default: "body" },
|
|
2317
|
-
fitInputWidth: { type: Boolean, default: !0 },
|
|
2318
|
-
popperClass: { default: "" }
|
|
2319
|
-
},
|
|
2320
|
-
emits: ["update:modelValue", "change", "clear", "visible-change", "focus", "blur"],
|
|
2321
|
-
setup(t, { expose: b, emit: w }) {
|
|
2322
|
-
const e = t, a = w, A = pe(), u = _e(), c = U(null), f = F(
|
|
2323
|
-
() => ["qy-select__popper", e.popperClass].filter(Boolean).join(" ")
|
|
2324
|
-
), B = F(
|
|
2325
|
-
() => (e.options || []).map((i) => ({
|
|
2326
|
-
raw: i,
|
|
2327
|
-
label: (i == null ? void 0 : i[e.labelKey]) ?? (i == null ? void 0 : i.label) ?? (i == null ? void 0 : i.value) ?? "",
|
|
2328
|
-
value: (i == null ? void 0 : i[e.valueKey]) ?? (i == null ? void 0 : i.value) ?? (i == null ? void 0 : i.label),
|
|
2329
|
-
disabled: !!(i != null && i[e.disabledKey])
|
|
2330
|
-
}))
|
|
2331
|
-
), R = F(() => {
|
|
2332
|
-
const i = u.default;
|
|
2333
|
-
return i ? i().some((Z) => Z.type !== sl) : !1;
|
|
2334
|
-
});
|
|
2335
|
-
function K(i) {
|
|
2336
|
-
return Array.isArray(i) ? i.length === 0 : i === "" || i === null || i === void 0;
|
|
2337
|
-
}
|
|
2338
|
-
re(
|
|
2339
|
-
[
|
|
2340
|
-
B,
|
|
2341
|
-
() => e.modelValue,
|
|
2342
|
-
() => e.autoSelectSingle,
|
|
2343
|
-
() => e.disabled,
|
|
2344
|
-
() => e.multiple
|
|
2345
|
-
],
|
|
2346
|
-
([i]) => {
|
|
2347
|
-
if (!e.autoSelectSingle || e.disabled || !K(e.modelValue) || i.length !== 1) return;
|
|
2348
|
-
const [Z] = i;
|
|
2349
|
-
if (Z.disabled) return;
|
|
2350
|
-
const Y = e.multiple ? [Z.value] : Z.value;
|
|
2351
|
-
a("update:modelValue", Y), a("change", Y);
|
|
2352
|
-
},
|
|
2353
|
-
{ immediate: !0 }
|
|
2354
|
-
);
|
|
2355
|
-
function I(i, Z) {
|
|
2356
|
-
return `${String(i.value ?? i.label ?? "")}-${Z}`;
|
|
2357
|
-
}
|
|
2358
|
-
function Q(i) {
|
|
2359
|
-
a("update:modelValue", i);
|
|
2360
|
-
}
|
|
2361
|
-
function h(i) {
|
|
2362
|
-
a("change", i);
|
|
2363
|
-
}
|
|
2364
|
-
function j() {
|
|
2365
|
-
a("clear");
|
|
2366
|
-
}
|
|
2367
|
-
function P(i) {
|
|
2368
|
-
a("visible-change", i);
|
|
2369
|
-
}
|
|
2370
|
-
function G(i) {
|
|
2371
|
-
a("focus", i);
|
|
2372
|
-
}
|
|
2373
|
-
function E(i) {
|
|
2374
|
-
a("blur", i);
|
|
2375
|
-
}
|
|
2376
|
-
function d() {
|
|
2377
|
-
var i, Z;
|
|
2378
|
-
(Z = (i = c.value) == null ? void 0 : i.focus) == null || Z.call(i);
|
|
2379
|
-
}
|
|
2380
|
-
function x() {
|
|
2381
|
-
var i, Z;
|
|
2382
|
-
(Z = (i = c.value) == null ? void 0 : i.blur) == null || Z.call(i);
|
|
2383
|
-
}
|
|
2384
|
-
return b({
|
|
2385
|
-
// 仅暴露业务常用焦点方法,复杂下拉行为仍交给 Element Plus 自身处理。
|
|
2386
|
-
focus: d,
|
|
2387
|
-
blur: x
|
|
2388
|
-
}), (i, Z) => (V(), ee(C(tt), ie({
|
|
2389
|
-
ref_key: "selectRef",
|
|
2390
|
-
ref: c
|
|
2391
|
-
}, C(A), {
|
|
2392
|
-
"model-value": t.modelValue,
|
|
2393
|
-
placeholder: t.placeholder,
|
|
2394
|
-
disabled: t.disabled,
|
|
2395
|
-
clearable: t.clearable,
|
|
2396
|
-
filterable: t.filterable,
|
|
2397
|
-
multiple: t.multiple,
|
|
2398
|
-
"collapse-tags": t.collapseTags,
|
|
2399
|
-
"collapse-tags-tooltip": t.collapseTagsTooltip,
|
|
2400
|
-
size: t.size,
|
|
2401
|
-
teleported: t.teleported,
|
|
2402
|
-
"fit-input-width": t.fitInputWidth,
|
|
2403
|
-
"popper-class": f.value,
|
|
2404
|
-
"append-to": t.appendTo,
|
|
2405
|
-
"onUpdate:modelValue": Q,
|
|
2406
|
-
onChange: h,
|
|
2407
|
-
onClear: j,
|
|
2408
|
-
onVisibleChange: P,
|
|
2409
|
-
onFocus: G,
|
|
2410
|
-
onBlur: E
|
|
2411
|
-
}), Re({
|
|
2412
|
-
default: S(() => [
|
|
2413
|
-
R.value ? O(i.$slots, "default", { key: 0 }) : (V(!0), H(Be, { key: 1 }, Ue(B.value, (Y, k) => (V(), ee(C(lt), {
|
|
2414
|
-
key: I(Y, k),
|
|
2415
|
-
label: Y.label,
|
|
2416
|
-
value: Y.value,
|
|
2417
|
-
disabled: Y.disabled
|
|
2418
|
-
}, null, 8, ["label", "value", "disabled"]))), 128))
|
|
2419
|
-
]),
|
|
2420
|
-
_: 2
|
|
2421
|
-
}, [
|
|
2422
|
-
i.$slots.prefix ? {
|
|
2423
|
-
name: "prefix",
|
|
2424
|
-
fn: S(() => [
|
|
2425
|
-
O(i.$slots, "prefix")
|
|
2426
|
-
]),
|
|
2427
|
-
key: "0"
|
|
2428
|
-
} : void 0,
|
|
2429
|
-
i.$slots.empty ? {
|
|
2430
|
-
name: "empty",
|
|
2431
|
-
fn: S(() => [
|
|
2432
|
-
O(i.$slots, "empty")
|
|
2433
|
-
]),
|
|
2434
|
-
key: "1"
|
|
2435
|
-
} : void 0,
|
|
2436
|
-
i.$slots.loading ? {
|
|
2437
|
-
name: "loading",
|
|
2438
|
-
fn: S(() => [
|
|
2439
|
-
O(i.$slots, "loading")
|
|
2440
|
-
]),
|
|
2441
|
-
key: "2"
|
|
2442
|
-
} : void 0,
|
|
2443
|
-
i.$slots.tag ? {
|
|
2444
|
-
name: "tag",
|
|
2445
|
-
fn: S((Y) => [
|
|
2446
|
-
O(i.$slots, "tag", Oe(Qe(Y)))
|
|
2447
|
-
]),
|
|
2448
|
-
key: "3"
|
|
2449
|
-
} : void 0
|
|
2450
|
-
]), 1040, ["model-value", "placeholder", "disabled", "clearable", "filterable", "multiple", "collapse-tags", "collapse-tags-tooltip", "size", "teleported", "fit-input-width", "popper-class", "append-to"]));
|
|
2451
|
-
}
|
|
2452
|
-
}), Aa = /* @__PURE__ */ se({
|
|
2453
|
-
name: "QyRemoteSelect",
|
|
2454
|
-
inheritAttrs: !1,
|
|
2455
|
-
__name: "index",
|
|
2456
|
-
props: {
|
|
2457
|
-
modelValue: { type: [String, Number, Boolean, Array, null], default: void 0 },
|
|
2458
|
-
fetchMethod: {},
|
|
2459
|
-
defaultOptions: { default: () => [] },
|
|
2460
|
-
labelKey: { default: "label" },
|
|
2461
|
-
valueKey: { default: "value" },
|
|
2462
|
-
disabledKey: { default: "disabled" },
|
|
2463
|
-
placeholder: { default: "请选择" },
|
|
2464
|
-
disabled: { type: Boolean, default: !1 },
|
|
2465
|
-
clearable: { type: Boolean, default: !0 },
|
|
2466
|
-
multiple: { type: Boolean, default: !1 },
|
|
2467
|
-
collapseTags: { type: Boolean, default: !1 },
|
|
2468
|
-
collapseTagsTooltip: { type: Boolean, default: !1 },
|
|
2469
|
-
autoSelectSingle: { type: Boolean, default: !1 },
|
|
2470
|
-
size: { default: void 0 },
|
|
2471
|
-
teleported: { type: Boolean, default: !0 },
|
|
2472
|
-
appendTo: { default: "body" },
|
|
2473
|
-
fitInputWidth: { type: Boolean, default: !0 },
|
|
2474
|
-
popperClass: { default: "" },
|
|
2475
|
-
debounce: { default: 300 },
|
|
2476
|
-
minLength: { default: 1 },
|
|
2477
|
-
remoteOnFocus: { type: Boolean, default: !1 },
|
|
2478
|
-
remoteShowSuffix: { type: Boolean, default: !0 },
|
|
2479
|
-
loading: { type: Boolean, default: !1 },
|
|
2480
|
-
reserveSelectedOption: { type: Boolean, default: !0 }
|
|
2481
|
-
},
|
|
2482
|
-
emits: ["update:modelValue", "change", "clear", "visible-change", "focus", "blur", "options-change", "loading-change", "error"],
|
|
2483
|
-
setup(t, { expose: b, emit: w }) {
|
|
2484
|
-
const e = t, a = w, A = pe(), u = U(null), c = U([]), f = U(/* @__PURE__ */ new Map()), B = U(!1), R = U("");
|
|
2485
|
-
let K = 0, I = null;
|
|
2486
|
-
const Q = F(() => e.loading || B.value), h = U(!1), j = F(() => {
|
|
2487
|
-
const m = /* @__PURE__ */ new Map(), _ = (ae) => {
|
|
2488
|
-
m.set(P(ae), ae);
|
|
2489
|
-
};
|
|
2490
|
-
return e.defaultOptions.forEach(_), e.reserveSelectedOption && f.value.forEach((ae) => _(ae)), c.value.forEach(_), Array.from(m.values());
|
|
2491
|
-
});
|
|
2492
|
-
re(
|
|
2493
|
-
() => e.defaultOptions,
|
|
2494
|
-
(m) => {
|
|
2495
|
-
m.forEach(E);
|
|
2496
|
-
},
|
|
2497
|
-
{ immediate: !0 }
|
|
2498
|
-
), re(
|
|
2499
|
-
() => e.modelValue,
|
|
2500
|
-
() => {
|
|
2501
|
-
j.value.forEach(E);
|
|
2502
|
-
},
|
|
2503
|
-
{ immediate: !0 }
|
|
2504
|
-
);
|
|
2505
|
-
function P(m) {
|
|
2506
|
-
return (m == null ? void 0 : m[e.valueKey]) ?? (m == null ? void 0 : m.value) ?? (m == null ? void 0 : m.label);
|
|
2507
|
-
}
|
|
2508
|
-
function G(m) {
|
|
2509
|
-
return Array.isArray(e.modelValue) ? e.modelValue.includes(m) : e.modelValue === m;
|
|
2510
|
-
}
|
|
2511
|
-
function E(m) {
|
|
2512
|
-
if (!e.reserveSelectedOption) return;
|
|
2513
|
-
const _ = P(m);
|
|
2514
|
-
G(_) && f.value.set(_, m);
|
|
2515
|
-
}
|
|
2516
|
-
function d(m) {
|
|
2517
|
-
return e.disabled ? !1 : m ? m.length >= e.minLength : e.remoteOnFocus;
|
|
2518
|
-
}
|
|
2519
|
-
function x(m) {
|
|
2520
|
-
B.value !== m && (B.value = m, a("loading-change", m));
|
|
2521
|
-
}
|
|
2522
|
-
async function i(m) {
|
|
2523
|
-
if (R.value = m, !d(m)) {
|
|
2524
|
-
K += 1, c.value = [], x(!1), a("options-change", j.value);
|
|
2525
|
-
return;
|
|
2526
|
-
}
|
|
2527
|
-
const _ = ++K;
|
|
2528
|
-
x(!0);
|
|
2529
|
-
try {
|
|
2530
|
-
const ae = await e.fetchMethod(m);
|
|
2531
|
-
if (_ !== K) return;
|
|
2532
|
-
c.value = Array.isArray(ae) ? ae : [], c.value.forEach(E), a("options-change", j.value);
|
|
2533
|
-
} catch (ae) {
|
|
2534
|
-
if (_ !== K) return;
|
|
2535
|
-
c.value = [], a("error", ae), a("options-change", j.value);
|
|
2536
|
-
} finally {
|
|
2537
|
-
_ === K && x(!1);
|
|
2538
|
-
}
|
|
2539
|
-
}
|
|
2540
|
-
function Z() {
|
|
2541
|
-
h.value || (h.value = !0, i(""));
|
|
2542
|
-
}
|
|
2543
|
-
function Y(m) {
|
|
2544
|
-
I && (clearTimeout(I), I = null), I = setTimeout(() => {
|
|
2545
|
-
i(m);
|
|
2546
|
-
}, e.debounce);
|
|
2547
|
-
}
|
|
2548
|
-
function k() {
|
|
2549
|
-
h.value = !0, i("");
|
|
2550
|
-
}
|
|
2551
|
-
function v() {
|
|
2552
|
-
i(R.value);
|
|
2553
|
-
}
|
|
2554
|
-
function D(m) {
|
|
2555
|
-
a("update:modelValue", m);
|
|
2556
|
-
}
|
|
2557
|
-
function l(m) {
|
|
2558
|
-
j.value.forEach(E), a("change", m);
|
|
2559
|
-
}
|
|
2560
|
-
function n() {
|
|
2561
|
-
a("clear");
|
|
2562
|
-
}
|
|
2563
|
-
function M(m) {
|
|
2564
|
-
m && e.remoteOnFocus && !R.value && Z(), a("visible-change", m);
|
|
2565
|
-
}
|
|
2566
|
-
function le(m) {
|
|
2567
|
-
e.remoteOnFocus && !R.value && Z(), a("focus", m);
|
|
2568
|
-
}
|
|
2569
|
-
function y(m) {
|
|
2570
|
-
a("blur", m);
|
|
2571
|
-
}
|
|
2572
|
-
function $() {
|
|
2573
|
-
var m, _;
|
|
2574
|
-
(_ = (m = u.value) == null ? void 0 : m.focus) == null || _.call(m);
|
|
2575
|
-
}
|
|
2576
|
-
function N() {
|
|
2577
|
-
var m, _;
|
|
2578
|
-
(_ = (m = u.value) == null ? void 0 : m.blur) == null || _.call(m);
|
|
2579
|
-
}
|
|
2580
|
-
function z() {
|
|
2581
|
-
a("update:modelValue", e.multiple ? [] : ""), a("clear");
|
|
2582
|
-
}
|
|
2583
|
-
return Ye(() => {
|
|
2584
|
-
I && clearTimeout(I);
|
|
2585
|
-
}), b({
|
|
2586
|
-
// 暴露远程选择常用控制方法,供弹窗打开后聚焦或请求失败后重试。
|
|
2587
|
-
focus: $,
|
|
2588
|
-
blur: N,
|
|
2589
|
-
clear: z,
|
|
2590
|
-
retryFetch: v,
|
|
2591
|
-
fetchDefaultOptions: k
|
|
2592
|
-
}), (m, _) => (V(), ee(at, ie({
|
|
2593
|
-
ref_key: "selectRef",
|
|
2594
|
-
ref: u
|
|
2595
|
-
}, C(A), {
|
|
2596
|
-
"model-value": t.modelValue,
|
|
2597
|
-
options: j.value,
|
|
2598
|
-
"label-key": t.labelKey,
|
|
2599
|
-
"value-key": t.valueKey,
|
|
2600
|
-
"disabled-key": t.disabledKey,
|
|
2601
|
-
placeholder: t.placeholder,
|
|
2602
|
-
disabled: t.disabled,
|
|
2603
|
-
clearable: t.clearable,
|
|
2604
|
-
filterable: !0,
|
|
2605
|
-
multiple: t.multiple,
|
|
2606
|
-
"collapse-tags": t.collapseTags,
|
|
2607
|
-
"collapse-tags-tooltip": t.collapseTagsTooltip,
|
|
2608
|
-
"auto-select-single": t.autoSelectSingle,
|
|
2609
|
-
size: t.size,
|
|
2610
|
-
teleported: t.teleported,
|
|
2611
|
-
"append-to": t.appendTo,
|
|
2612
|
-
"fit-input-width": t.fitInputWidth,
|
|
2613
|
-
"popper-class": t.popperClass,
|
|
2614
|
-
remote: "",
|
|
2615
|
-
"remote-show-suffix": t.remoteShowSuffix,
|
|
2616
|
-
"remote-method": Y,
|
|
2617
|
-
loading: Q.value,
|
|
2618
|
-
"onUpdate:modelValue": D,
|
|
2619
|
-
onChange: l,
|
|
2620
|
-
onClear: n,
|
|
2621
|
-
onVisibleChange: M,
|
|
2622
|
-
onFocus: le,
|
|
2623
|
-
onBlur: y
|
|
2624
|
-
}), Re({
|
|
2625
|
-
default: S(() => [
|
|
2626
|
-
m.$slots.default ? O(m.$slots, "default", { key: 0 }) : X("", !0)
|
|
2627
|
-
]),
|
|
2628
|
-
_: 2
|
|
2629
|
-
}, [
|
|
2630
|
-
m.$slots.prefix ? {
|
|
2631
|
-
name: "prefix",
|
|
2632
|
-
fn: S(() => [
|
|
2633
|
-
O(m.$slots, "prefix")
|
|
2634
|
-
]),
|
|
2635
|
-
key: "0"
|
|
2636
|
-
} : void 0,
|
|
2637
|
-
m.$slots.empty ? {
|
|
2638
|
-
name: "empty",
|
|
2639
|
-
fn: S(() => [
|
|
2640
|
-
O(m.$slots, "empty")
|
|
2641
|
-
]),
|
|
2642
|
-
key: "1"
|
|
2643
|
-
} : void 0,
|
|
2644
|
-
m.$slots.loading ? {
|
|
2645
|
-
name: "loading",
|
|
2646
|
-
fn: S(() => [
|
|
2647
|
-
O(m.$slots, "loading")
|
|
2648
|
-
]),
|
|
2649
|
-
key: "2"
|
|
2650
|
-
} : void 0,
|
|
2651
|
-
m.$slots.tag ? {
|
|
2652
|
-
name: "tag",
|
|
2653
|
-
fn: S((ae) => [
|
|
2654
|
-
O(m.$slots, "tag", Oe(Qe(ae)))
|
|
2655
|
-
]),
|
|
2656
|
-
key: "3"
|
|
2657
|
-
} : void 0
|
|
2658
|
-
]), 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"]));
|
|
2659
|
-
}
|
|
2660
|
-
}), Ta = { class: "qy-search-input__item" }, Pa = ["innerHTML"], Ma = {
|
|
2661
|
-
key: 0,
|
|
2662
|
-
class: "qy-search-input__item-description"
|
|
2663
|
-
}, Fa = /* @__PURE__ */ se({
|
|
2664
|
-
name: "QySearchInput",
|
|
2665
|
-
inheritAttrs: !1,
|
|
2666
|
-
__name: "index",
|
|
2667
|
-
props: {
|
|
2668
|
-
modelValue: { default: "" },
|
|
2669
|
-
loading: { type: Boolean, default: !1 },
|
|
2670
|
-
disabled: { type: Boolean, default: !1 },
|
|
2671
|
-
placeholder: { default: "请输入搜索内容" },
|
|
2672
|
-
removeSpace: { type: Boolean, default: !1 },
|
|
2673
|
-
trimMode: { default: "none" },
|
|
2674
|
-
clearable: { type: Boolean, default: !0 },
|
|
2675
|
-
showButton: { type: Boolean, default: !0 },
|
|
2676
|
-
buttonText: { default: "搜索" },
|
|
2677
|
-
buttonProps: { default: () => ({}) },
|
|
2678
|
-
suggestions: { default: () => [] },
|
|
2679
|
-
fetchSuggestions: { type: [Function, null], default: null },
|
|
2680
|
-
fetchSuggestionsMethod: { type: [Function, null], default: null },
|
|
2681
|
-
debounce: { default: 300 },
|
|
2682
|
-
minLength: { default: 1 },
|
|
2683
|
-
triggerOnFocus: { type: Boolean, default: !1 },
|
|
2684
|
-
searchOnEnter: { type: Boolean, default: !0 },
|
|
2685
|
-
searchOnSelect: { type: Boolean, default: !1 },
|
|
2686
|
-
highlightKeyword: { type: Boolean, default: !0 },
|
|
2687
|
-
teleported: { type: Boolean, default: !0 },
|
|
2688
|
-
appendTo: { default: "body" },
|
|
2689
|
-
popperClass: { default: "" },
|
|
2690
|
-
fitInputWidth: { type: Boolean, default: !0 }
|
|
2691
|
-
},
|
|
2692
|
-
emits: ["update:modelValue", "search", "clear", "input", "change", "focus", "blur", "enter", "select", "visible-change", "suggestions-change", "error"],
|
|
2693
|
-
setup(t, { expose: b, emit: w }) {
|
|
2694
|
-
const e = t, a = w, A = pe(), u = U(null), c = U(I(e.modelValue)), f = F(() => I(e.modelValue)), B = F(
|
|
2695
|
-
() => ["qy-search-input__popper", e.popperClass].filter(Boolean).join(" ")
|
|
2696
|
-
), R = F(() => I(e.modelValue)), K = U("");
|
|
2697
|
-
re(
|
|
2698
|
-
() => e.modelValue,
|
|
2699
|
-
(p) => {
|
|
2700
|
-
c.value = I(p);
|
|
2701
|
-
}
|
|
2702
|
-
);
|
|
2703
|
-
function I(p) {
|
|
2704
|
-
return p == null ? "" : String(p);
|
|
2705
|
-
}
|
|
2706
|
-
function Q(p) {
|
|
2707
|
-
return e.removeSpace ? p.replace(/\s+/g, "") : p;
|
|
2708
|
-
}
|
|
2709
|
-
function h(p, L) {
|
|
2710
|
-
return e.trimMode !== L ? p : p.trim();
|
|
2711
|
-
}
|
|
2712
|
-
function j(p) {
|
|
2713
|
-
return Q(I(p));
|
|
2714
|
-
}
|
|
2715
|
-
function P(p) {
|
|
2716
|
-
c.value = p, a("update:modelValue", p);
|
|
2717
|
-
}
|
|
2718
|
-
function G(p, L = "") {
|
|
2719
|
-
return {
|
|
2720
|
-
...p,
|
|
2721
|
-
label: p.label || p.value,
|
|
2722
|
-
value: p.value || p.label,
|
|
2723
|
-
description: p.description || L
|
|
2724
|
-
};
|
|
2725
|
-
}
|
|
2726
|
-
function E(p = []) {
|
|
2727
|
-
return p.flatMap((L) => {
|
|
2728
|
-
if (Array.isArray(L.items)) {
|
|
2729
|
-
const te = L;
|
|
2730
|
-
return te.items.map((be) => G(be, te.groupLabel));
|
|
2731
|
-
}
|
|
2732
|
-
return G(L);
|
|
2733
|
-
});
|
|
2734
|
-
}
|
|
2735
|
-
function d(p) {
|
|
2736
|
-
const L = p.toLowerCase();
|
|
2737
|
-
return (te) => [te.label, te.value, te.description].filter(Boolean).some((be) => String(be).toLowerCase().includes(L));
|
|
2738
|
-
}
|
|
2739
|
-
function x(p) {
|
|
2740
|
-
return p ? p.length >= e.minLength : e.triggerOnFocus;
|
|
2741
|
-
}
|
|
2742
|
-
function i(p) {
|
|
2743
|
-
a("suggestions-change", p), a("visible-change", p.length > 0);
|
|
2744
|
-
}
|
|
2745
|
-
async function Z(p) {
|
|
2746
|
-
if (!x(p))
|
|
2747
|
-
return i([]), [];
|
|
2748
|
-
if (e.fetchSuggestionsMethod) {
|
|
2749
|
-
const be = await new Promise((Se) => {
|
|
2750
|
-
var de;
|
|
2751
|
-
(de = e.fetchSuggestionsMethod) == null || de.call(e, p, (Te) => {
|
|
2752
|
-
Se(E(Te));
|
|
2753
|
-
});
|
|
2754
|
-
});
|
|
2755
|
-
return i(be), be;
|
|
2756
|
-
}
|
|
2757
|
-
if (e.fetchSuggestions) {
|
|
2758
|
-
const be = await e.fetchSuggestions(p), Se = E(Array.isArray(be) ? be : []);
|
|
2759
|
-
return i(Se), Se;
|
|
2760
|
-
}
|
|
2761
|
-
const L = E(e.suggestions), te = p ? L.filter(d(p)) : L;
|
|
2762
|
-
return i(te), te;
|
|
2763
|
-
}
|
|
2764
|
-
async function Y(p, L) {
|
|
2765
|
-
K.value = p;
|
|
2766
|
-
try {
|
|
2767
|
-
const te = await Z(p);
|
|
2768
|
-
L(te);
|
|
2769
|
-
} catch (te) {
|
|
2770
|
-
a("error", te), i([]), L([]);
|
|
2771
|
-
}
|
|
2772
|
-
}
|
|
2773
|
-
function k() {
|
|
2774
|
-
var p, L;
|
|
2775
|
-
K.value && ((L = (p = u.value) == null ? void 0 : p.getData) == null || L.call(p, K.value));
|
|
2776
|
-
}
|
|
2777
|
-
function v(p) {
|
|
2778
|
-
const L = j(p);
|
|
2779
|
-
P(L);
|
|
2780
|
-
}
|
|
2781
|
-
function D(p) {
|
|
2782
|
-
const L = j(p);
|
|
2783
|
-
c.value = L, a("input", L);
|
|
2784
|
-
}
|
|
2785
|
-
function l(p) {
|
|
2786
|
-
const L = h(j(p), "change");
|
|
2787
|
-
L !== I(e.modelValue) && P(L), a("change", L);
|
|
2788
|
-
}
|
|
2789
|
-
function n(p) {
|
|
2790
|
-
a("focus", p);
|
|
2791
|
-
}
|
|
2792
|
-
function M(p) {
|
|
2793
|
-
const L = h(c.value, "blur");
|
|
2794
|
-
L !== I(e.modelValue) && P(L), a("blur", p), a("visible-change", !1);
|
|
2795
|
-
}
|
|
2796
|
-
function le() {
|
|
2797
|
-
c.value = "", a("update:modelValue", ""), a("clear"), i([]);
|
|
2798
|
-
}
|
|
2799
|
-
function y(p) {
|
|
2800
|
-
a("enter", p), e.searchOnEnter && $();
|
|
2801
|
-
}
|
|
2802
|
-
function $() {
|
|
2803
|
-
a("search", I(e.modelValue));
|
|
2804
|
-
}
|
|
2805
|
-
function N(p) {
|
|
2806
|
-
a("select", p), e.searchOnSelect && a("search", p.value);
|
|
2807
|
-
}
|
|
2808
|
-
function z(p) {
|
|
2809
|
-
return p.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
2810
|
-
}
|
|
2811
|
-
function m(p) {
|
|
2812
|
-
return p.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
2813
|
-
}
|
|
2814
|
-
function _(p) {
|
|
2815
|
-
const L = z(p || "");
|
|
2816
|
-
if (!e.highlightKeyword || !f.value) return L;
|
|
2817
|
-
const te = m(z(f.value));
|
|
2818
|
-
return te ? L.replace(
|
|
2819
|
-
new RegExp(`(${te})`, "ig"),
|
|
2820
|
-
'<mark class="qy-search-input__mark">$1</mark>'
|
|
2821
|
-
) : L;
|
|
2822
|
-
}
|
|
2823
|
-
function ae() {
|
|
2824
|
-
var p, L;
|
|
2825
|
-
(L = (p = u.value) == null ? void 0 : p.focus) == null || L.call(p);
|
|
2826
|
-
}
|
|
2827
|
-
function ve() {
|
|
2828
|
-
var p, L;
|
|
2829
|
-
(L = (p = u.value) == null ? void 0 : p.blur) == null || L.call(p);
|
|
2830
|
-
}
|
|
2831
|
-
function xe() {
|
|
2832
|
-
var p, L, te;
|
|
2833
|
-
(te = (L = (p = u.value) == null ? void 0 : p.inputRef) == null ? void 0 : L.select) == null || te.call(L);
|
|
2834
|
-
}
|
|
2835
|
-
function $e() {
|
|
2836
|
-
var p, L;
|
|
2837
|
-
(L = (p = u.value) == null ? void 0 : p.clear) == null || L.call(p);
|
|
2838
|
-
}
|
|
2839
|
-
function Ce() {
|
|
2840
|
-
var p, L;
|
|
2841
|
-
(L = (p = u.value) == null ? void 0 : p.close) == null || L.call(p);
|
|
2842
|
-
}
|
|
2843
|
-
return b({
|
|
2844
|
-
// 暴露搜索框常用控制方法,供弹窗打开后聚焦或失败后重试建议项。
|
|
2845
|
-
focus: ae,
|
|
2846
|
-
blur: ve,
|
|
2847
|
-
select: xe,
|
|
2848
|
-
clear: $e,
|
|
2849
|
-
closePanel: Ce,
|
|
2850
|
-
retryFetch: k
|
|
2851
|
-
}), (p, L) => (V(), H("div", {
|
|
2852
|
-
class: he(["qy-search-input", { "is-disabled": t.disabled }])
|
|
2853
|
-
}, [
|
|
2854
|
-
J(C(bt), ie({
|
|
2855
|
-
ref_key: "autocompleteRef",
|
|
2856
|
-
ref: u
|
|
2857
|
-
}, C(A), {
|
|
2858
|
-
"model-value": R.value,
|
|
2859
|
-
disabled: t.disabled,
|
|
2860
|
-
placeholder: t.placeholder,
|
|
2861
|
-
clearable: t.clearable,
|
|
2862
|
-
debounce: t.debounce,
|
|
2863
|
-
"fetch-suggestions": Y,
|
|
2864
|
-
"trigger-on-focus": t.triggerOnFocus,
|
|
2865
|
-
teleported: t.teleported,
|
|
2866
|
-
"fit-input-width": t.fitInputWidth,
|
|
2867
|
-
"popper-class": B.value,
|
|
2868
|
-
"append-to": t.appendTo,
|
|
2869
|
-
"value-key": "value",
|
|
2870
|
-
"onUpdate:modelValue": v,
|
|
2871
|
-
onInput: D,
|
|
2872
|
-
onChange: l,
|
|
2873
|
-
onFocus: n,
|
|
2874
|
-
onBlur: M,
|
|
2875
|
-
onClear: le,
|
|
2876
|
-
onSelect: N,
|
|
2877
|
-
onKeydown: Ke(y, ["enter"])
|
|
2878
|
-
}), Re({
|
|
2879
|
-
default: S(({ item: te }) => [
|
|
2880
|
-
O(p.$slots, "item", {
|
|
2881
|
-
item: te,
|
|
2882
|
-
keyword: f.value
|
|
2883
|
-
}, () => [
|
|
2884
|
-
W("div", Ta, [
|
|
2885
|
-
W("div", {
|
|
2886
|
-
class: "qy-search-input__item-label",
|
|
2887
|
-
innerHTML: _(te.label || te.value || "")
|
|
2888
|
-
}, null, 8, Pa),
|
|
2889
|
-
te.description ? (V(), H("div", Ma, fe(te.description), 1)) : X("", !0)
|
|
2890
|
-
])
|
|
2891
|
-
], !0)
|
|
2892
|
-
]),
|
|
2893
|
-
_: 2
|
|
2894
|
-
}, [
|
|
2895
|
-
p.$slots.prefix ? {
|
|
2896
|
-
name: "prefix",
|
|
2897
|
-
fn: S(() => [
|
|
2898
|
-
O(p.$slots, "prefix", {}, void 0, !0)
|
|
2899
|
-
]),
|
|
2900
|
-
key: "0"
|
|
2901
|
-
} : void 0,
|
|
2902
|
-
p.$slots.suffix ? {
|
|
2903
|
-
name: "suffix",
|
|
2904
|
-
fn: S(() => [
|
|
2905
|
-
O(p.$slots, "suffix", {}, void 0, !0)
|
|
2906
|
-
]),
|
|
2907
|
-
key: "1"
|
|
2908
|
-
} : void 0,
|
|
2909
|
-
p.$slots.prepend ? {
|
|
2910
|
-
name: "prepend",
|
|
2911
|
-
fn: S(() => [
|
|
2912
|
-
O(p.$slots, "prepend", {}, void 0, !0)
|
|
2913
|
-
]),
|
|
2914
|
-
key: "2"
|
|
2915
|
-
} : void 0,
|
|
2916
|
-
p.$slots.append || t.showButton ? {
|
|
2917
|
-
name: "append",
|
|
2918
|
-
fn: S(() => [
|
|
2919
|
-
p.$slots.append ? O(p.$slots, "append", { key: 0 }, void 0, !0) : (V(), ee(C(ke), ie({ key: 1 }, t.buttonProps, {
|
|
2920
|
-
loading: t.loading,
|
|
2921
|
-
disabled: t.disabled,
|
|
2922
|
-
onClick: $
|
|
2923
|
-
}), {
|
|
2924
|
-
default: S(() => [
|
|
2925
|
-
me(fe(t.buttonText), 1)
|
|
2926
|
-
]),
|
|
2927
|
-
_: 1
|
|
2928
|
-
}, 16, ["loading", "disabled"]))
|
|
2929
|
-
]),
|
|
2930
|
-
key: "3"
|
|
2931
|
-
} : void 0
|
|
2932
|
-
]), 1040, ["model-value", "disabled", "placeholder", "clearable", "debounce", "trigger-on-focus", "teleported", "fit-input-width", "popper-class", "append-to"])
|
|
2933
|
-
], 2));
|
|
2934
|
-
}
|
|
2935
|
-
}), $t = /* @__PURE__ */ ze(Fa, [["__scopeId", "data-v-cd7f5dfc"]]), Oa = { class: "qy-record-quote-search" }, Qa = {
|
|
2936
|
-
key: 0,
|
|
2937
|
-
class: "qy-record-quote-search__header"
|
|
2938
|
-
}, Da = {
|
|
2939
|
-
key: 0,
|
|
2940
|
-
class: "qy-record-quote-search__label"
|
|
2941
|
-
}, Ua = {
|
|
2942
|
-
key: 1,
|
|
2943
|
-
class: "qy-record-quote-search__description"
|
|
2944
|
-
}, Ka = /* @__PURE__ */ se({
|
|
2945
|
-
name: "QyRecordQuoteSearch",
|
|
2946
|
-
inheritAttrs: !1,
|
|
2947
|
-
__name: "index",
|
|
2948
|
-
props: {
|
|
2949
|
-
modelValue: { default: "" },
|
|
2950
|
-
loading: { type: Boolean, default: !1 },
|
|
2951
|
-
disabled: { type: Boolean, default: !1 },
|
|
2952
|
-
placeholder: { default: "请输入报价单号" },
|
|
2953
|
-
buttonText: { default: "查询报价单" },
|
|
2954
|
-
autoNormalize: { type: Boolean, default: !0 },
|
|
2955
|
-
showStatus: { type: Boolean, default: !0 },
|
|
2956
|
-
status: { default: "default" },
|
|
2957
|
-
statusText: { default: "" },
|
|
2958
|
-
suggestions: { default: () => [] },
|
|
2959
|
-
fetchSuggestions: { type: [Function, null], default: null },
|
|
2960
|
-
fetchSuggestionsMethod: { type: [Function, null], default: null },
|
|
2961
|
-
debounce: { default: 300 },
|
|
2962
|
-
minLength: { default: 1 },
|
|
2963
|
-
searchOnSelect: { type: Boolean, default: !0 },
|
|
2964
|
-
searchMethod: { type: [Function, null], default: null },
|
|
2965
|
-
extractMethod: { type: [Function, null], default: null },
|
|
2966
|
-
normalizeMethod: { type: [Function, null], default: null },
|
|
2967
|
-
label: { default: "报价单号" },
|
|
2968
|
-
description: { default: "" },
|
|
2969
|
-
trimMode: { default: "blur" }
|
|
2970
|
-
},
|
|
2971
|
-
emits: ["update:modelValue", "search", "clear", "normalize", "enter", "select", "error", "success"],
|
|
2972
|
-
setup(t, { expose: b, emit: w }) {
|
|
2973
|
-
const e = t, a = w, A = pe(), u = U(null), c = U(!1), f = F(() => e.statusText || ""), B = F(() => e.loading || c.value);
|
|
2974
|
-
function R(l) {
|
|
2975
|
-
return l == null ? "" : String(l);
|
|
2976
|
-
}
|
|
2977
|
-
function K(l) {
|
|
2978
|
-
const n = R(l).trim(), M = I(n), le = M.match(/BJ\d{8}[A-Z0-9]{4}/i);
|
|
2979
|
-
return le ? le[0] : M;
|
|
2980
|
-
}
|
|
2981
|
-
function I(l) {
|
|
2982
|
-
return R(l).replace(/\s+/g, "").trim().toUpperCase();
|
|
2983
|
-
}
|
|
2984
|
-
function Q(l) {
|
|
2985
|
-
return e.extractMethod ? e.extractMethod(l) : K(l);
|
|
2986
|
-
}
|
|
2987
|
-
function h(l) {
|
|
2988
|
-
return e.normalizeMethod ? e.normalizeMethod(l) : I(l);
|
|
2989
|
-
}
|
|
2990
|
-
function j(l, n) {
|
|
2991
|
-
const M = R(l), le = Q(M), y = e.autoNormalize ? h(le) : le;
|
|
2992
|
-
return a("normalize", { rawValue: M, code: y }), {
|
|
2993
|
-
rawValue: M,
|
|
2994
|
-
code: y,
|
|
2995
|
-
item: n
|
|
2996
|
-
};
|
|
2997
|
-
}
|
|
2998
|
-
function P(l) {
|
|
2999
|
-
a("update:modelValue", l);
|
|
3000
|
-
}
|
|
3001
|
-
async function G(l) {
|
|
3002
|
-
if (a("search", l), !!e.searchMethod) {
|
|
3003
|
-
c.value = !0;
|
|
3004
|
-
try {
|
|
3005
|
-
const n = await e.searchMethod(l);
|
|
3006
|
-
a("success", n);
|
|
3007
|
-
} catch (n) {
|
|
3008
|
-
a("error", n);
|
|
3009
|
-
} finally {
|
|
3010
|
-
c.value = !1;
|
|
3011
|
-
}
|
|
3012
|
-
}
|
|
3013
|
-
}
|
|
3014
|
-
function E(l) {
|
|
3015
|
-
const n = j(l);
|
|
3016
|
-
n.code !== R(e.modelValue) && a("update:modelValue", n.code), G(n);
|
|
3017
|
-
}
|
|
3018
|
-
function d() {
|
|
3019
|
-
a("clear");
|
|
3020
|
-
}
|
|
3021
|
-
function x(l) {
|
|
3022
|
-
a("enter", l);
|
|
3023
|
-
}
|
|
3024
|
-
function i(l) {
|
|
3025
|
-
if (a("select", l), !e.searchOnSelect) return;
|
|
3026
|
-
const n = j(l.value, l);
|
|
3027
|
-
n.code !== R(e.modelValue) && a("update:modelValue", n.code), G(n);
|
|
3028
|
-
}
|
|
3029
|
-
function Z(l) {
|
|
3030
|
-
a("error", l);
|
|
3031
|
-
}
|
|
3032
|
-
function Y() {
|
|
3033
|
-
var l, n;
|
|
3034
|
-
(n = (l = u.value) == null ? void 0 : l.focus) == null || n.call(l);
|
|
3035
|
-
}
|
|
3036
|
-
function k() {
|
|
3037
|
-
var l, n;
|
|
3038
|
-
(n = (l = u.value) == null ? void 0 : l.blur) == null || n.call(l);
|
|
3039
|
-
}
|
|
3040
|
-
function v() {
|
|
3041
|
-
var l, n;
|
|
3042
|
-
(n = (l = u.value) == null ? void 0 : l.select) == null || n.call(l);
|
|
3043
|
-
}
|
|
3044
|
-
function D() {
|
|
3045
|
-
var l, n;
|
|
3046
|
-
(n = (l = u.value) == null ? void 0 : l.clear) == null || n.call(l);
|
|
3047
|
-
}
|
|
3048
|
-
return b({
|
|
3049
|
-
focus: Y,
|
|
3050
|
-
blur: k,
|
|
3051
|
-
select: v,
|
|
3052
|
-
clear: D,
|
|
3053
|
-
extractQuoteOrderCode: Q,
|
|
3054
|
-
normalizeQuoteOrderCode: h
|
|
3055
|
-
}), (l, n) => (V(), H("div", Oa, [
|
|
3056
|
-
O(l.$slots, "label", {}, () => [
|
|
3057
|
-
t.label || t.description ? (V(), H("div", Qa, [
|
|
3058
|
-
t.label ? (V(), H("div", Da, fe(t.label), 1)) : X("", !0),
|
|
3059
|
-
t.description ? (V(), H("div", Ua, fe(t.description), 1)) : X("", !0)
|
|
3060
|
-
])) : X("", !0)
|
|
3061
|
-
], !0),
|
|
3062
|
-
J($t, ie({
|
|
3063
|
-
ref_key: "searchRef",
|
|
3064
|
-
ref: u
|
|
3065
|
-
}, C(A), {
|
|
3066
|
-
"model-value": t.modelValue,
|
|
3067
|
-
loading: B.value,
|
|
3068
|
-
disabled: t.disabled,
|
|
3069
|
-
placeholder: t.placeholder,
|
|
3070
|
-
"remove-space": !0,
|
|
3071
|
-
"trim-mode": t.trimMode,
|
|
3072
|
-
"button-text": t.buttonText,
|
|
3073
|
-
suggestions: t.suggestions,
|
|
3074
|
-
"fetch-suggestions": t.fetchSuggestions,
|
|
3075
|
-
"fetch-suggestions-method": t.fetchSuggestionsMethod,
|
|
3076
|
-
debounce: t.debounce,
|
|
3077
|
-
"min-length": t.minLength,
|
|
3078
|
-
"search-on-select": !1,
|
|
3079
|
-
"onUpdate:modelValue": P,
|
|
3080
|
-
onSearch: E,
|
|
3081
|
-
onClear: d,
|
|
3082
|
-
onEnter: x,
|
|
3083
|
-
onSelect: i,
|
|
3084
|
-
onError: Z
|
|
3085
|
-
}), Re({ _: 2 }, [
|
|
3086
|
-
l.$slots.prefix ? {
|
|
3087
|
-
name: "prefix",
|
|
3088
|
-
fn: S(() => [
|
|
3089
|
-
O(l.$slots, "prefix", {}, void 0, !0)
|
|
3090
|
-
]),
|
|
3091
|
-
key: "0"
|
|
3092
|
-
} : void 0,
|
|
3093
|
-
l.$slots.suffix ? {
|
|
3094
|
-
name: "suffix",
|
|
3095
|
-
fn: S(() => [
|
|
3096
|
-
O(l.$slots, "suffix", {}, void 0, !0)
|
|
3097
|
-
]),
|
|
3098
|
-
key: "1"
|
|
3099
|
-
} : void 0,
|
|
3100
|
-
l.$slots.item ? {
|
|
3101
|
-
name: "item",
|
|
3102
|
-
fn: S((M) => [
|
|
3103
|
-
O(l.$slots, "item", Oe(Qe(M)), void 0, !0)
|
|
3104
|
-
]),
|
|
3105
|
-
key: "2"
|
|
3106
|
-
} : void 0,
|
|
3107
|
-
l.$slots.empty ? {
|
|
3108
|
-
name: "empty",
|
|
3109
|
-
fn: S(() => [
|
|
3110
|
-
O(l.$slots, "empty", {}, void 0, !0)
|
|
3111
|
-
]),
|
|
3112
|
-
key: "3"
|
|
3113
|
-
} : void 0,
|
|
3114
|
-
l.$slots.loading ? {
|
|
3115
|
-
name: "loading",
|
|
3116
|
-
fn: S(() => [
|
|
3117
|
-
O(l.$slots, "loading", {}, void 0, !0)
|
|
3118
|
-
]),
|
|
3119
|
-
key: "4"
|
|
3120
|
-
} : void 0
|
|
3121
|
-
]), 1040, ["model-value", "loading", "disabled", "placeholder", "trim-mode", "button-text", "suggestions", "fetch-suggestions", "fetch-suggestions-method", "debounce", "min-length"]),
|
|
3122
|
-
t.showStatus && f.value ? O(l.$slots, "status", {
|
|
3123
|
-
key: 0,
|
|
3124
|
-
status: t.status,
|
|
3125
|
-
statusText: f.value
|
|
3126
|
-
}, () => [
|
|
3127
|
-
W("div", {
|
|
3128
|
-
class: he(["qy-record-quote-search__status", `is-${t.status}`])
|
|
3129
|
-
}, fe(f.value), 3)
|
|
3130
|
-
], !0) : X("", !0)
|
|
3131
|
-
]));
|
|
3132
|
-
}
|
|
3133
|
-
}), Ea = /* @__PURE__ */ ze(Ka, [["__scopeId", "data-v-3a314f64"]]), Bt = /* @__PURE__ */ se({
|
|
3134
|
-
name: "QyTreeSelect",
|
|
3135
|
-
inheritAttrs: !1,
|
|
3136
|
-
__name: "index",
|
|
3137
|
-
props: {
|
|
3138
|
-
modelValue: { type: [String, Number, Boolean, Array, null], default: void 0 },
|
|
3139
|
-
options: { default: () => [] },
|
|
3140
|
-
data: { default: void 0 },
|
|
3141
|
-
labelKey: { default: "label" },
|
|
3142
|
-
valueKey: { default: "value" },
|
|
3143
|
-
childrenKey: { default: "children" },
|
|
3144
|
-
disabledKey: { default: "disabled" },
|
|
3145
|
-
props: { default: () => ({}) },
|
|
3146
|
-
placeholder: { default: "请选择" },
|
|
3147
|
-
disabled: { type: Boolean, default: !1 },
|
|
3148
|
-
clearable: { type: Boolean, default: !1 },
|
|
3149
|
-
filterable: { type: Boolean, default: !1 },
|
|
3150
|
-
multiple: { type: Boolean, default: !1 },
|
|
3151
|
-
collapseTags: { type: Boolean, default: !1 },
|
|
3152
|
-
collapseTagsTooltip: { type: Boolean, default: !1 },
|
|
3153
|
-
checkStrictly: { type: Boolean, default: !1 },
|
|
3154
|
-
defaultExpandAll: { type: Boolean, default: !1 },
|
|
3155
|
-
renderAfterExpand: { type: Boolean, default: !0 },
|
|
3156
|
-
size: { default: void 0 },
|
|
3157
|
-
teleported: { type: Boolean, default: !0 },
|
|
3158
|
-
appendTo: { default: void 0 },
|
|
3159
|
-
fitInputWidth: { type: Boolean, default: !1 },
|
|
3160
|
-
popperClass: { default: "" }
|
|
3161
|
-
},
|
|
3162
|
-
emits: ["update:modelValue", "change", "clear", "visible-change", "focus", "blur"],
|
|
3163
|
-
setup(t, { expose: b, emit: w }) {
|
|
3164
|
-
const e = t, a = w, A = pe(), u = U(null), c = F(
|
|
3165
|
-
() => ["qy-tree-select__popper", e.popperClass].filter(Boolean).join(" ")
|
|
3166
|
-
), f = F(() => ({
|
|
3167
|
-
label: "label",
|
|
3168
|
-
value: "value",
|
|
3169
|
-
children: "children",
|
|
3170
|
-
disabled: "disabled",
|
|
3171
|
-
...e.props
|
|
3172
|
-
})), B = F(
|
|
3173
|
-
() => {
|
|
3174
|
-
var d;
|
|
3175
|
-
return R((d = e.options) != null && d.length ? e.options : e.data || []);
|
|
3176
|
-
}
|
|
3177
|
-
);
|
|
3178
|
-
function R(d) {
|
|
3179
|
-
return d.map((x) => {
|
|
3180
|
-
const i = x == null ? void 0 : x[e.childrenKey];
|
|
3181
|
-
return {
|
|
3182
|
-
...x,
|
|
3183
|
-
label: (x == null ? void 0 : x[e.labelKey]) ?? (x == null ? void 0 : x.label) ?? (x == null ? void 0 : x.value) ?? "",
|
|
3184
|
-
value: (x == null ? void 0 : x[e.valueKey]) ?? (x == null ? void 0 : x.value) ?? (x == null ? void 0 : x.label),
|
|
3185
|
-
disabled: !!(x != null && x[e.disabledKey]),
|
|
3186
|
-
children: Array.isArray(i) ? R(i) : i
|
|
3187
|
-
};
|
|
3188
|
-
});
|
|
3189
|
-
}
|
|
3190
|
-
function K(d) {
|
|
3191
|
-
a("update:modelValue", d);
|
|
3192
|
-
}
|
|
3193
|
-
function I(d) {
|
|
3194
|
-
a("change", d);
|
|
3195
|
-
}
|
|
3196
|
-
function Q() {
|
|
3197
|
-
a("clear");
|
|
3198
|
-
}
|
|
3199
|
-
function h(d) {
|
|
3200
|
-
a("visible-change", d);
|
|
3201
|
-
}
|
|
3202
|
-
function j(d) {
|
|
3203
|
-
a("focus", d);
|
|
3204
|
-
}
|
|
3205
|
-
function P(d) {
|
|
3206
|
-
a("blur", d);
|
|
3207
|
-
}
|
|
3208
|
-
function G() {
|
|
3209
|
-
var d, x;
|
|
3210
|
-
(x = (d = u.value) == null ? void 0 : d.focus) == null || x.call(d);
|
|
3211
|
-
}
|
|
3212
|
-
function E() {
|
|
3213
|
-
var d, x;
|
|
3214
|
-
(x = (d = u.value) == null ? void 0 : d.blur) == null || x.call(d);
|
|
3215
|
-
}
|
|
3216
|
-
return b({
|
|
3217
|
-
// 暴露最常用的焦点控制;复杂树选择能力仍通过 attrs 透传给 Element Plus。
|
|
3218
|
-
focus: G,
|
|
3219
|
-
blur: E
|
|
3220
|
-
}), (d, x) => (V(), ee(C(wt), ie({
|
|
3221
|
-
ref_key: "treeSelectRef",
|
|
3222
|
-
ref: u
|
|
3223
|
-
}, C(A), {
|
|
3224
|
-
"model-value": t.modelValue,
|
|
3225
|
-
data: B.value,
|
|
3226
|
-
props: f.value,
|
|
3227
|
-
placeholder: t.placeholder,
|
|
3228
|
-
disabled: t.disabled,
|
|
3229
|
-
clearable: t.clearable,
|
|
3230
|
-
filterable: t.filterable,
|
|
3231
|
-
multiple: t.multiple,
|
|
3232
|
-
"collapse-tags": t.collapseTags,
|
|
3233
|
-
"collapse-tags-tooltip": t.collapseTagsTooltip,
|
|
3234
|
-
"check-strictly": t.checkStrictly,
|
|
3235
|
-
"default-expand-all": t.defaultExpandAll,
|
|
3236
|
-
"render-after-expand": t.renderAfterExpand,
|
|
3237
|
-
size: t.size,
|
|
3238
|
-
teleported: t.teleported,
|
|
3239
|
-
"append-to": t.appendTo,
|
|
3240
|
-
"fit-input-width": t.fitInputWidth,
|
|
3241
|
-
"popper-class": c.value,
|
|
3242
|
-
"onUpdate:modelValue": K,
|
|
3243
|
-
onChange: I,
|
|
3244
|
-
onClear: Q,
|
|
3245
|
-
onVisibleChange: h,
|
|
3246
|
-
onFocus: j,
|
|
3247
|
-
onBlur: P
|
|
3248
|
-
}), Re({ _: 2 }, [
|
|
3249
|
-
d.$slots.prefix ? {
|
|
3250
|
-
name: "prefix",
|
|
3251
|
-
fn: S(() => [
|
|
3252
|
-
O(d.$slots, "prefix")
|
|
3253
|
-
]),
|
|
3254
|
-
key: "0"
|
|
3255
|
-
} : void 0,
|
|
3256
|
-
d.$slots.empty ? {
|
|
3257
|
-
name: "empty",
|
|
3258
|
-
fn: S(() => [
|
|
3259
|
-
O(d.$slots, "empty")
|
|
3260
|
-
]),
|
|
3261
|
-
key: "1"
|
|
3262
|
-
} : void 0,
|
|
3263
|
-
d.$slots.tag ? {
|
|
3264
|
-
name: "tag",
|
|
3265
|
-
fn: S((i) => [
|
|
3266
|
-
O(d.$slots, "tag", Oe(Qe(i)))
|
|
3267
|
-
]),
|
|
3268
|
-
key: "2"
|
|
3269
|
-
} : void 0,
|
|
3270
|
-
d.$slots.default ? {
|
|
3271
|
-
name: "default",
|
|
3272
|
-
fn: S((i) => [
|
|
3273
|
-
O(d.$slots, "default", Oe(Qe(i)))
|
|
3274
|
-
]),
|
|
3275
|
-
key: "3"
|
|
3276
|
-
} : void 0
|
|
3277
|
-
]), 1040, ["model-value", "data", "props", "placeholder", "disabled", "clearable", "filterable", "multiple", "collapse-tags", "collapse-tags-tooltip", "check-strictly", "default-expand-all", "render-after-expand", "size", "teleported", "append-to", "fit-input-width", "popper-class"]));
|
|
3278
|
-
}
|
|
3279
|
-
}), La = { class: "qy-selection-dialog" }, ja = { class: "qy-selection-dialog__main" }, Na = {
|
|
3280
|
-
key: 0,
|
|
3281
|
-
class: "qy-selection-dialog__selected"
|
|
3282
|
-
}, Ha = { class: "qy-selection-dialog__selected-tags" }, Wa = {
|
|
3283
|
-
key: 0,
|
|
3284
|
-
class: "qy-selection-dialog__selected-actions"
|
|
3285
|
-
}, Za = {
|
|
3286
|
-
key: 1,
|
|
3287
|
-
class: "qy-selection-dialog__search-row"
|
|
3288
|
-
}, Ga = {
|
|
3289
|
-
key: 0,
|
|
3290
|
-
class: "qy-selection-dialog__toolbar"
|
|
3291
|
-
}, Xa = {
|
|
3292
|
-
key: 2,
|
|
3293
|
-
class: "qy-selection-dialog__pagination"
|
|
3294
|
-
}, Ja = { class: "qy-selection-dialog__paste-actions" }, Ya = /* @__PURE__ */ se({
|
|
3295
|
-
name: "QySelectionDialog",
|
|
3296
|
-
inheritAttrs: !1,
|
|
3297
|
-
__name: "index",
|
|
3298
|
-
props: {
|
|
3299
|
-
modelValue: { default: () => [] },
|
|
3300
|
-
open: { type: Boolean, default: !0 },
|
|
3301
|
-
title: { default: "选择数据" },
|
|
3302
|
-
width: { default: "1200px" },
|
|
3303
|
-
fetchMethod: { type: Function, default: void 0 },
|
|
3304
|
-
query: { type: Function, default: void 0 },
|
|
3305
|
-
responseFormatter: { type: Function, default: void 0 },
|
|
3306
|
-
selectionMode: { default: void 0 },
|
|
3307
|
-
selection: { default: "single" },
|
|
3308
|
-
selected: { default: () => [] },
|
|
3309
|
-
rowKey: { default: "id" },
|
|
3310
|
-
mainKey: { default: void 0 },
|
|
3311
|
-
labelKey: { default: "name" },
|
|
3312
|
-
tagName: { default: void 0 },
|
|
3313
|
-
searchKey: { default: "conditions" },
|
|
3314
|
-
queryParams: { default: () => ({}) },
|
|
3315
|
-
category: { type: [Array, Function, Boolean], default: !1 },
|
|
3316
|
-
categoryFormatter: { type: [Function, Array], default: void 0 },
|
|
3317
|
-
categoryOptions: { default: () => [] },
|
|
3318
|
-
categoryFetchMethod: { type: [Function, null], default: null },
|
|
3319
|
-
type: { type: [Array, Boolean], default: !1 },
|
|
3320
|
-
typeOptions: { default: () => [] },
|
|
3321
|
-
typeSelectionProps: { default: () => ({}) },
|
|
3322
|
-
typeSelectProps: { default: () => ({}) },
|
|
3323
|
-
tableProps: { default: () => ({}) },
|
|
3324
|
-
showSelected: { type: Boolean, default: !0 },
|
|
3325
|
-
showSearch: { type: Boolean, default: !0 },
|
|
3326
|
-
showPagination: { type: Boolean, default: !0 },
|
|
3327
|
-
showCopyPaste: { type: Boolean, default: !1 },
|
|
3328
|
-
append: { type: Boolean, default: !1 },
|
|
3329
|
-
showAppend: { type: Boolean, default: !1 },
|
|
3330
|
-
pageSizes: { default: () => [10, 20, 50, 100] }
|
|
3331
|
-
},
|
|
3332
|
-
emits: ["update:modelValue", "selection-change", "confirm", "submit", "cancel", "close", "append", "loaded"],
|
|
3333
|
-
setup(t, { expose: b, emit: w }) {
|
|
3334
|
-
const e = t, a = w, A = pe(), u = _e(), c = dl(), f = U(null), B = U([]), R = U([]), K = U([]), I = U(!1), Q = U(0), h = U(!1), j = U(""), P = Ze({
|
|
3335
|
-
category: [],
|
|
3336
|
-
type: "",
|
|
3337
|
-
page: 1,
|
|
3338
|
-
pageSize: 10,
|
|
3339
|
-
...e.searchKey ? { [e.searchKey]: "" } : {},
|
|
3340
|
-
...e.queryParams
|
|
3341
|
-
}), G = F(() => e.selectionMode ? e.selectionMode : e.selection === "multi" ? "multiple" : e.selection), E = F(() => e.mainKey || e.rowKey), d = F(() => e.tagName || e.labelKey), x = F(() => e.typeOptions.length ? e.typeOptions : e.type || []), i = F(() => ({
|
|
3342
|
-
...e.typeSelectionProps,
|
|
3343
|
-
...e.typeSelectProps
|
|
3344
|
-
})), Z = F(() => e.tableProps || {}), Y = F(
|
|
3345
|
-
() => e.showSearch || !!A["search-visible"]
|
|
3346
|
-
), k = F(() => e.showAppend || e.append), v = F(
|
|
3347
|
-
() => k.value || !!u.toolbar || !!u.bar
|
|
3348
|
-
), D = F(() => e.fetchMethod || e.query), l = F(() => n() ? e.modelValue : e.selected);
|
|
3349
|
-
function n() {
|
|
3350
|
-
const o = (c == null ? void 0 : c.vnode.props) || {};
|
|
3351
|
-
return Object.prototype.hasOwnProperty.call(o, "modelValue") || Object.prototype.hasOwnProperty.call(o, "model-value") || Object.prototype.hasOwnProperty.call(o, "onUpdate:modelValue");
|
|
3352
|
-
}
|
|
3353
|
-
re(
|
|
3354
|
-
[() => e.modelValue, () => e.selected, () => e.open],
|
|
3355
|
-
() => {
|
|
3356
|
-
e.open && (R.value = g(l.value), te());
|
|
3357
|
-
},
|
|
3358
|
-
{ immediate: !0, deep: !0 }
|
|
3359
|
-
), re(
|
|
3360
|
-
[() => e.categoryOptions, () => e.category],
|
|
3361
|
-
(o) => {
|
|
3362
|
-
if (Array.isArray(e.category) && e.category.length) {
|
|
3363
|
-
K.value = e.category;
|
|
3364
|
-
return;
|
|
3365
|
-
}
|
|
3366
|
-
K.value = e.categoryOptions || [];
|
|
3367
|
-
},
|
|
3368
|
-
{ immediate: !0 }
|
|
3369
|
-
), re(h, (o) => {
|
|
3370
|
-
o || (j.value = "");
|
|
3371
|
-
});
|
|
3372
|
-
async function M() {
|
|
3373
|
-
R.value = g(l.value), await le(), await y(), te();
|
|
3374
|
-
}
|
|
3375
|
-
async function le() {
|
|
3376
|
-
const o = e.categoryFetchMethod || (typeof e.category == "function" ? e.category : null);
|
|
3377
|
-
if (!o) return;
|
|
3378
|
-
const r = await o();
|
|
3379
|
-
K.value = ae(r);
|
|
3380
|
-
}
|
|
3381
|
-
async function y() {
|
|
3382
|
-
if (D.value) {
|
|
3383
|
-
I.value = !0;
|
|
3384
|
-
try {
|
|
3385
|
-
const o = await D.value(xe()), r = e.responseFormatter ? await e.responseFormatter(o) : o, { rows: T, total: q } = _(r);
|
|
3386
|
-
return B.value = T, Q.value = q, a("loaded", T), te(), r;
|
|
3387
|
-
} finally {
|
|
3388
|
-
I.value = !1;
|
|
3389
|
-
}
|
|
3390
|
-
}
|
|
3391
|
-
}
|
|
3392
|
-
function $() {
|
|
3393
|
-
return P.page = 1, y();
|
|
3394
|
-
}
|
|
3395
|
-
function N() {
|
|
3396
|
-
return P.page = 1, y();
|
|
3397
|
-
}
|
|
3398
|
-
function z() {
|
|
3399
|
-
return Object.assign(P, {
|
|
3400
|
-
category: [],
|
|
3401
|
-
type: "",
|
|
3402
|
-
page: 1,
|
|
3403
|
-
pageSize: P.pageSize,
|
|
3404
|
-
...e.searchKey ? { [e.searchKey]: "" } : {},
|
|
3405
|
-
...e.queryParams
|
|
3406
|
-
}), y();
|
|
3407
|
-
}
|
|
3408
|
-
function m() {
|
|
3409
|
-
a("append");
|
|
3410
|
-
}
|
|
3411
|
-
function _(o) {
|
|
3412
|
-
if (Array.isArray(o))
|
|
3413
|
-
return { rows: o, total: o.length };
|
|
3414
|
-
const r = o == null ? void 0 : o.data;
|
|
3415
|
-
if (Array.isArray(r))
|
|
3416
|
-
return { rows: r, total: (o == null ? void 0 : o.total) ?? r.length };
|
|
3417
|
-
const T = (o == null ? void 0 : o.records) || (o == null ? void 0 : o.rows) || (r == null ? void 0 : r.records) || [], q = (o == null ? void 0 : o.total) ?? (r == null ? void 0 : r.total) ?? T.length;
|
|
3418
|
-
return { rows: T, total: q };
|
|
3419
|
-
}
|
|
3420
|
-
function ae(o) {
|
|
3421
|
-
const r = (o == null ? void 0 : o.data) ?? o;
|
|
3422
|
-
if (!Array.isArray(r)) return [];
|
|
3423
|
-
if (typeof e.categoryFormatter == "function")
|
|
3424
|
-
return e.categoryFormatter(r);
|
|
3425
|
-
if (Array.isArray(e.categoryFormatter)) {
|
|
3426
|
-
const [T, q] = e.categoryFormatter;
|
|
3427
|
-
return r.map((ne) => ({
|
|
3428
|
-
...ne,
|
|
3429
|
-
label: ne[T],
|
|
3430
|
-
value: ne[q],
|
|
3431
|
-
children: Array.isArray(ne.children) ? ve(ne.children, T, q) : ne.children
|
|
3432
|
-
}));
|
|
3433
|
-
}
|
|
3434
|
-
return r;
|
|
3435
|
-
}
|
|
3436
|
-
function ve(o, r, T) {
|
|
3437
|
-
return o.map((q) => ({
|
|
3438
|
-
...q,
|
|
3439
|
-
label: q[r],
|
|
3440
|
-
value: q[T],
|
|
3441
|
-
children: Array.isArray(q.children) ? ve(q.children, r, T) : q.children
|
|
3442
|
-
}));
|
|
3443
|
-
}
|
|
3444
|
-
function xe() {
|
|
3445
|
-
const o = { ...e.queryParams, ...P };
|
|
3446
|
-
return e.searchKey && (o[e.searchKey] = String(o[e.searchKey] || "").trim()), o.category = $e(), o;
|
|
3447
|
-
}
|
|
3448
|
-
function $e() {
|
|
3449
|
-
if (Object.prototype.hasOwnProperty.call(e.queryParams, "category"))
|
|
3450
|
-
return e.queryParams.category;
|
|
3451
|
-
const o = P.category;
|
|
3452
|
-
return Array.isArray(o) ? o : o ? [o] : [];
|
|
3453
|
-
}
|
|
3454
|
-
function Ce(o) {
|
|
3455
|
-
var r, T;
|
|
3456
|
-
if (G.value !== "none") {
|
|
3457
|
-
if (G.value === "single") {
|
|
3458
|
-
R.value = [o], (r = f.value) == null || r.setCurrentRow(o), Pe();
|
|
3459
|
-
return;
|
|
3460
|
-
}
|
|
3461
|
-
be(o) && ((T = f.value) == null || T.toggleRowSelection(o, !Se(o)));
|
|
3462
|
-
}
|
|
3463
|
-
}
|
|
3464
|
-
function p(o) {
|
|
3465
|
-
if (G.value !== "multiple") return;
|
|
3466
|
-
const r = new Set(B.value.map(de)), T = new Set(o.map(de));
|
|
3467
|
-
R.value = R.value.filter(
|
|
3468
|
-
(q) => !r.has(de(q)) || T.has(de(q))
|
|
3469
|
-
), o.forEach((q) => {
|
|
3470
|
-
Se(q) || R.value.push(q);
|
|
3471
|
-
}), Pe();
|
|
3472
|
-
}
|
|
3473
|
-
function L(o) {
|
|
3474
|
-
var T, q;
|
|
3475
|
-
R.value = R.value.filter(
|
|
3476
|
-
(ne) => de(ne) !== de(o)
|
|
3477
|
-
);
|
|
3478
|
-
const r = B.value.find((ne) => de(ne) === de(o));
|
|
3479
|
-
r && (G.value === "multiple" ? (T = f.value) == null || T.toggleRowSelection(r, !1) : (q = f.value) == null || q.setCurrentRow()), Pe();
|
|
3480
|
-
}
|
|
3481
|
-
function te() {
|
|
3482
|
-
De(() => {
|
|
3483
|
-
var o;
|
|
3484
|
-
if (f.value) {
|
|
3485
|
-
if (G.value === "single") {
|
|
3486
|
-
const [r] = R.value, T = B.value.find(
|
|
3487
|
-
(q) => r && de(q) === de(r)
|
|
3488
|
-
);
|
|
3489
|
-
(o = f.value) == null || o.setCurrentRow(T);
|
|
3490
|
-
return;
|
|
3491
|
-
}
|
|
3492
|
-
G.value === "multiple" && B.value.forEach((r) => {
|
|
3493
|
-
var T;
|
|
3494
|
-
(T = f.value) == null || T.toggleRowSelection(r, Se(r));
|
|
3495
|
-
});
|
|
3496
|
-
}
|
|
3497
|
-
});
|
|
3498
|
-
}
|
|
3499
|
-
function be(o) {
|
|
3500
|
-
var T;
|
|
3501
|
-
const r = (T = Z.value) == null ? void 0 : T.selectable;
|
|
3502
|
-
return typeof r == "function" ? r(o) !== !1 : !0;
|
|
3503
|
-
}
|
|
3504
|
-
function Se(o) {
|
|
3505
|
-
return R.value.some((r) => de(r) === de(o));
|
|
3506
|
-
}
|
|
3507
|
-
function de(o) {
|
|
3508
|
-
return qe(o, E.value);
|
|
3509
|
-
}
|
|
3510
|
-
function Te(o) {
|
|
3511
|
-
return qe(o, d.value) ?? de(o);
|
|
3512
|
-
}
|
|
3513
|
-
function qe(o, r) {
|
|
3514
|
-
if (!(!o || !r))
|
|
3515
|
-
return r.split(".").reduce((T, q) => T == null ? void 0 : T[q], o);
|
|
3516
|
-
}
|
|
3517
|
-
function Pe() {
|
|
3518
|
-
const o = g(R.value);
|
|
3519
|
-
a("selection-change", o);
|
|
3520
|
-
}
|
|
3521
|
-
function Le() {
|
|
3522
|
-
const o = g(R.value);
|
|
3523
|
-
a("update:modelValue", o), a("confirm", o), a("submit", { selection: o, rows: o, query: { ...P } });
|
|
3524
|
-
}
|
|
3525
|
-
function je() {
|
|
3526
|
-
R.value = g(l.value), a("cancel"), a("close");
|
|
3527
|
-
}
|
|
3528
|
-
async function Ne() {
|
|
3529
|
-
var r;
|
|
3530
|
-
const o = JSON.stringify(R.value);
|
|
3531
|
-
await ((r = navigator.clipboard) == null ? void 0 : r.writeText(o)), ge.success("复制成功");
|
|
3532
|
-
}
|
|
3533
|
-
function s() {
|
|
3534
|
-
try {
|
|
3535
|
-
const o = JSON.parse(j.value);
|
|
3536
|
-
if (!Array.isArray(o)) {
|
|
3537
|
-
ge.error("粘贴内容需要是数组");
|
|
3538
|
-
return;
|
|
3539
|
-
}
|
|
3540
|
-
o.forEach((r) => {
|
|
3541
|
-
Se(r) || R.value.push(r);
|
|
3542
|
-
}), h.value = !1, Pe(), te();
|
|
3543
|
-
} catch (o) {
|
|
3544
|
-
ge.error(`粘贴错误: ${(o == null ? void 0 : o.message) || "内容格式错误"}`);
|
|
3545
|
-
}
|
|
3546
|
-
}
|
|
3547
|
-
function g(o = []) {
|
|
3548
|
-
return o.map((r) => ({ ...r }));
|
|
3549
|
-
}
|
|
3550
|
-
return b({
|
|
3551
|
-
search: $,
|
|
3552
|
-
handleSearch: y,
|
|
3553
|
-
handleQuerySearch: $,
|
|
3554
|
-
resetSearch: z,
|
|
3555
|
-
getTableRef: () => f.value,
|
|
3556
|
-
getTableData: () => B.value,
|
|
3557
|
-
getSelection: () => g(R.value)
|
|
3558
|
-
}), (o, r) => {
|
|
3559
|
-
const T = al;
|
|
3560
|
-
return V(), ee(Xe, ie(C(A), {
|
|
3561
|
-
"model-value": t.open,
|
|
3562
|
-
title: t.title,
|
|
3563
|
-
width: t.width,
|
|
3564
|
-
"destroy-on-close": "",
|
|
3565
|
-
draggable: "",
|
|
3566
|
-
"align-center": "",
|
|
3567
|
-
"append-to-body": "",
|
|
3568
|
-
onOpened: M,
|
|
3569
|
-
onConfirm: Le,
|
|
3570
|
-
onCancel: je
|
|
3571
|
-
}), {
|
|
3572
|
-
default: S(() => [
|
|
3573
|
-
W("div", La, [
|
|
3574
|
-
O(o.$slots, "side", {}, void 0, !0),
|
|
3575
|
-
W("div", ja, [
|
|
3576
|
-
t.showSelected ? (V(), H("div", Na, [
|
|
3577
|
-
r[12] || (r[12] = W("span", { class: "qy-selection-dialog__selected-label" }, "已选项", -1)),
|
|
3578
|
-
W("div", Ha, [
|
|
3579
|
-
(V(!0), H(Be, null, Ue(R.value, (q) => (V(), ee(C(dt), {
|
|
3580
|
-
key: de(q),
|
|
3581
|
-
closable: "",
|
|
3582
|
-
class: "qy-selection-dialog__selected-tag",
|
|
3583
|
-
onClose: (ne) => L(q)
|
|
3584
|
-
}, {
|
|
3585
|
-
default: S(() => [
|
|
3586
|
-
me(fe(Te(q)), 1)
|
|
3587
|
-
]),
|
|
3588
|
-
_: 2
|
|
3589
|
-
}, 1032, ["onClose"]))), 128)),
|
|
3590
|
-
R.value.length ? X("", !0) : (V(), ee(C(dt), {
|
|
3591
|
-
key: 0,
|
|
3592
|
-
type: "info"
|
|
3593
|
-
}, {
|
|
3594
|
-
default: S(() => [...r[9] || (r[9] = [
|
|
3595
|
-
me("无", -1)
|
|
3596
|
-
])]),
|
|
3597
|
-
_: 1
|
|
3598
|
-
}))
|
|
3599
|
-
]),
|
|
3600
|
-
t.showCopyPaste ? (V(), H("div", Wa, [
|
|
3601
|
-
J(C(ke), {
|
|
3602
|
-
size: "small",
|
|
3603
|
-
onClick: Ne
|
|
3604
|
-
}, {
|
|
3605
|
-
default: S(() => [...r[10] || (r[10] = [
|
|
3606
|
-
me("复制", -1)
|
|
3607
|
-
])]),
|
|
3608
|
-
_: 1
|
|
3609
|
-
}),
|
|
3610
|
-
J(C(ke), {
|
|
3611
|
-
size: "small",
|
|
3612
|
-
onClick: r[0] || (r[0] = (q) => h.value = !0)
|
|
3613
|
-
}, {
|
|
3614
|
-
default: S(() => [...r[11] || (r[11] = [
|
|
3615
|
-
me("粘贴", -1)
|
|
3616
|
-
])]),
|
|
3617
|
-
_: 1
|
|
3618
|
-
})
|
|
3619
|
-
])) : X("", !0)
|
|
3620
|
-
])) : X("", !0),
|
|
3621
|
-
Y.value ? (V(), H("div", Za, [
|
|
3622
|
-
J(C(kt), {
|
|
3623
|
-
class: "qy-selection-dialog__search",
|
|
3624
|
-
inline: "",
|
|
3625
|
-
model: P
|
|
3626
|
-
}, {
|
|
3627
|
-
default: S(() => [
|
|
3628
|
-
O(o.$slots, "search", {
|
|
3629
|
-
query: P,
|
|
3630
|
-
search: $,
|
|
3631
|
-
reset: z
|
|
3632
|
-
}, () => [
|
|
3633
|
-
K.value.length ? (V(), ee(C(Ie), {
|
|
3634
|
-
key: 0,
|
|
3635
|
-
label: "分类"
|
|
3636
|
-
}, {
|
|
3637
|
-
default: S(() => [
|
|
3638
|
-
J(Bt, {
|
|
3639
|
-
modelValue: P.category,
|
|
3640
|
-
"onUpdate:modelValue": r[1] || (r[1] = (q) => P.category = q),
|
|
3641
|
-
class: "qy-selection-dialog__category",
|
|
3642
|
-
options: K.value,
|
|
3643
|
-
clearable: "",
|
|
3644
|
-
filterable: "",
|
|
3645
|
-
"check-strictly": "",
|
|
3646
|
-
"render-after-expand": !1,
|
|
3647
|
-
onChange: $
|
|
3648
|
-
}, null, 8, ["modelValue", "options"])
|
|
3649
|
-
]),
|
|
3650
|
-
_: 1
|
|
3651
|
-
})) : X("", !0),
|
|
3652
|
-
x.value.length ? (V(), ee(C(Ie), {
|
|
3653
|
-
key: 1,
|
|
3654
|
-
label: "类型"
|
|
3655
|
-
}, {
|
|
3656
|
-
default: S(() => [
|
|
3657
|
-
J(at, ie({
|
|
3658
|
-
modelValue: P.type,
|
|
3659
|
-
"onUpdate:modelValue": r[2] || (r[2] = (q) => P.type = q),
|
|
3660
|
-
class: "qy-selection-dialog__type",
|
|
3661
|
-
options: x.value,
|
|
3662
|
-
placeholder: "请选择类型",
|
|
3663
|
-
clearable: ""
|
|
3664
|
-
}, i.value, { onChange: $ }), null, 16, ["modelValue", "options"])
|
|
3665
|
-
]),
|
|
3666
|
-
_: 1
|
|
3667
|
-
})) : X("", !0),
|
|
3668
|
-
t.searchKey ? (V(), ee(C(Ie), {
|
|
3669
|
-
key: 2,
|
|
3670
|
-
label: "搜索"
|
|
3671
|
-
}, {
|
|
3672
|
-
default: S(() => [
|
|
3673
|
-
J(C(Me), {
|
|
3674
|
-
modelValue: P[t.searchKey],
|
|
3675
|
-
"onUpdate:modelValue": r[3] || (r[3] = (q) => P[t.searchKey] = q),
|
|
3676
|
-
clearable: "",
|
|
3677
|
-
placeholder: "请输入",
|
|
3678
|
-
class: "qy-selection-dialog__search-input",
|
|
3679
|
-
onKeydown: Ke(ue($, ["prevent"]), ["enter"])
|
|
3680
|
-
}, null, 8, ["modelValue", "onKeydown"])
|
|
3681
|
-
]),
|
|
3682
|
-
_: 1
|
|
3683
|
-
})) : X("", !0),
|
|
3684
|
-
J(C(Ie), null, {
|
|
3685
|
-
default: S(() => [
|
|
3686
|
-
J(C(ke), {
|
|
3687
|
-
type: "primary",
|
|
3688
|
-
onClick: $
|
|
3689
|
-
}, {
|
|
3690
|
-
default: S(() => [...r[13] || (r[13] = [
|
|
3691
|
-
me("查询", -1)
|
|
3692
|
-
])]),
|
|
3693
|
-
_: 1
|
|
3694
|
-
}),
|
|
3695
|
-
J(C(ke), { onClick: z }, {
|
|
3696
|
-
default: S(() => [...r[14] || (r[14] = [
|
|
3697
|
-
me("重置", -1)
|
|
3698
|
-
])]),
|
|
3699
|
-
_: 1
|
|
3700
|
-
})
|
|
3701
|
-
]),
|
|
3702
|
-
_: 1
|
|
3703
|
-
})
|
|
3704
|
-
], !0)
|
|
3705
|
-
]),
|
|
3706
|
-
_: 3
|
|
3707
|
-
}, 8, ["model"]),
|
|
3708
|
-
v.value ? (V(), H("div", Ga, [
|
|
3709
|
-
k.value ? (V(), ee(C(ke), {
|
|
3710
|
-
key: 0,
|
|
3711
|
-
type: "primary",
|
|
3712
|
-
onClick: m
|
|
3713
|
-
}, {
|
|
3714
|
-
default: S(() => [...r[15] || (r[15] = [
|
|
3715
|
-
me(" 新增 ", -1)
|
|
3716
|
-
])]),
|
|
3717
|
-
_: 1
|
|
3718
|
-
})) : X("", !0),
|
|
3719
|
-
O(o.$slots, "toolbar", {
|
|
3720
|
-
query: P,
|
|
3721
|
-
search: $
|
|
3722
|
-
}, void 0, !0),
|
|
3723
|
-
O(o.$slots, "bar", {
|
|
3724
|
-
query: P,
|
|
3725
|
-
search: $
|
|
3726
|
-
}, void 0, !0)
|
|
3727
|
-
])) : X("", !0)
|
|
3728
|
-
])) : X("", !0),
|
|
3729
|
-
et((V(), ee(C(Vl), ie({
|
|
3730
|
-
ref_key: "tableRef",
|
|
3731
|
-
ref: f,
|
|
3732
|
-
data: B.value,
|
|
3733
|
-
"row-key": E.value,
|
|
3734
|
-
border: "",
|
|
3735
|
-
"highlight-current-row": "",
|
|
3736
|
-
"max-height": "550px"
|
|
3737
|
-
}, Z.value, {
|
|
3738
|
-
onSelectionChange: p,
|
|
3739
|
-
onRowClick: Ce
|
|
3740
|
-
}), {
|
|
3741
|
-
default: S(() => {
|
|
3742
|
-
var q;
|
|
3743
|
-
return [
|
|
3744
|
-
G.value === "multiple" ? (V(), ee(C(xl), {
|
|
3745
|
-
key: 0,
|
|
3746
|
-
type: "selection",
|
|
3747
|
-
"reserve-selection": "",
|
|
3748
|
-
width: "42",
|
|
3749
|
-
selectable: (q = Z.value) == null ? void 0 : q.selectable
|
|
3750
|
-
}, null, 8, ["selectable"])) : X("", !0),
|
|
3751
|
-
O(o.$slots, "columns", {}, void 0, !0),
|
|
3752
|
-
O(o.$slots, "cols", {}, void 0, !0)
|
|
3753
|
-
];
|
|
3754
|
-
}),
|
|
3755
|
-
_: 3
|
|
3756
|
-
}, 16, ["data", "row-key"])), [
|
|
3757
|
-
[T, I.value]
|
|
3758
|
-
]),
|
|
3759
|
-
t.showPagination && Q.value > 0 ? (V(), H("div", Xa, [
|
|
3760
|
-
J(C(Cl), {
|
|
3761
|
-
"current-page": P.page,
|
|
3762
|
-
"onUpdate:currentPage": r[4] || (r[4] = (q) => P.page = q),
|
|
3763
|
-
"page-size": P.pageSize,
|
|
3764
|
-
"onUpdate:pageSize": r[5] || (r[5] = (q) => P.pageSize = q),
|
|
3765
|
-
total: Q.value,
|
|
3766
|
-
"page-sizes": t.pageSizes,
|
|
3767
|
-
layout: "total, sizes, prev, pager, next, jumper",
|
|
3768
|
-
onSizeChange: N,
|
|
3769
|
-
onCurrentChange: y
|
|
3770
|
-
}, null, 8, ["current-page", "page-size", "total", "page-sizes"])
|
|
3771
|
-
])) : X("", !0)
|
|
3772
|
-
])
|
|
3773
|
-
]),
|
|
3774
|
-
J(Xe, {
|
|
3775
|
-
modelValue: h.value,
|
|
3776
|
-
"onUpdate:modelValue": r[8] || (r[8] = (q) => h.value = q),
|
|
3777
|
-
title: "粘贴数据",
|
|
3778
|
-
layout: !1,
|
|
3779
|
-
width: "560px"
|
|
3780
|
-
}, {
|
|
3781
|
-
default: S(() => [
|
|
3782
|
-
J(C(Me), {
|
|
3783
|
-
modelValue: j.value,
|
|
3784
|
-
"onUpdate:modelValue": r[6] || (r[6] = (q) => j.value = q),
|
|
3785
|
-
type: "textarea",
|
|
3786
|
-
rows: 8
|
|
3787
|
-
}, null, 8, ["modelValue"]),
|
|
3788
|
-
W("div", Ja, [
|
|
3789
|
-
J(C(ke), {
|
|
3790
|
-
onClick: r[7] || (r[7] = (q) => h.value = !1)
|
|
3791
|
-
}, {
|
|
3792
|
-
default: S(() => [...r[16] || (r[16] = [
|
|
3793
|
-
me("取消", -1)
|
|
3794
|
-
])]),
|
|
3795
|
-
_: 1
|
|
3796
|
-
}),
|
|
3797
|
-
J(C(ke), {
|
|
3798
|
-
type: "primary",
|
|
3799
|
-
onClick: s
|
|
3800
|
-
}, {
|
|
3801
|
-
default: S(() => [...r[17] || (r[17] = [
|
|
3802
|
-
me("确认", -1)
|
|
3803
|
-
])]),
|
|
3804
|
-
_: 1
|
|
3805
|
-
})
|
|
3806
|
-
])
|
|
3807
|
-
]),
|
|
3808
|
-
_: 1
|
|
3809
|
-
}, 8, ["modelValue"])
|
|
3810
|
-
]),
|
|
3811
|
-
_: 3
|
|
3812
|
-
}, 16, ["model-value", "title", "width"]);
|
|
3813
|
-
};
|
|
3814
|
-
}
|
|
3815
|
-
}), zt = /* @__PURE__ */ ze(Ya, [["__scopeId", "data-v-30377f54"]]), _a = /* @__PURE__ */ se({
|
|
3816
|
-
name: "QyLegacySelectionDialog",
|
|
3817
|
-
inheritAttrs: !1,
|
|
3818
|
-
__name: "index",
|
|
3819
|
-
props: {
|
|
3820
|
-
open: { type: Boolean, default: !0 },
|
|
3821
|
-
title: { default: "选择数据" },
|
|
3822
|
-
width: { default: "1200px" },
|
|
3823
|
-
query: { type: Function, default: void 0 },
|
|
3824
|
-
responseFormatter: { type: Function, default: void 0 },
|
|
3825
|
-
selection: { default: "single" },
|
|
3826
|
-
selected: { default: () => [] },
|
|
3827
|
-
mainKey: { default: "" },
|
|
3828
|
-
tagName: { default: "" },
|
|
3829
|
-
searchKey: { default: "conditions" },
|
|
3830
|
-
queryParams: { default: () => ({}) },
|
|
3831
|
-
category: { type: [Array, Function, Boolean], default: !1 },
|
|
3832
|
-
categoryFormatter: { type: [Function, Array], default: void 0 },
|
|
3833
|
-
type: { type: [Array, Boolean], default: !1 },
|
|
3834
|
-
typeSelectionProps: { default: () => ({}) },
|
|
3835
|
-
tableProps: { default: () => ({}) },
|
|
3836
|
-
append: { type: Boolean, default: !1 },
|
|
3837
|
-
delete: { type: Boolean, default: !1 },
|
|
3838
|
-
select: { default: null }
|
|
3839
|
-
},
|
|
3840
|
-
emits: ["close", "submit", "openDialog", "changeIndexShow"],
|
|
3841
|
-
setup(t, { expose: b, emit: w }) {
|
|
3842
|
-
const e = t, a = w, A = pe(), u = U(null), c = Ze({
|
|
3843
|
-
category: [],
|
|
3844
|
-
code: "",
|
|
3845
|
-
...e.searchKey ? { [e.searchKey]: "" } : {},
|
|
3846
|
-
page: 1,
|
|
3847
|
-
pageSize: 10,
|
|
3848
|
-
type: "",
|
|
3849
|
-
...e.queryParams
|
|
3850
|
-
}), f = Ze({
|
|
3851
|
-
total: 0,
|
|
3852
|
-
tableData: [],
|
|
3853
|
-
open: !1,
|
|
3854
|
-
selection: [],
|
|
3855
|
-
categories: [],
|
|
3856
|
-
types: [],
|
|
3857
|
-
tableRef: null,
|
|
3858
|
-
drag: !1,
|
|
3859
|
-
dialogOpen: !1,
|
|
3860
|
-
pasteData: "",
|
|
3861
|
-
pasteDataDialog: !1
|
|
3862
|
-
}), B = F(() => e.type || []), R = F(() => f.categories), K = async (y) => {
|
|
3863
|
-
if (!e.query) return { data: { records: [], total: 0 } };
|
|
3864
|
-
const $ = await e.query(i(y)), N = e.responseFormatter ? await e.responseFormatter($) : $;
|
|
3865
|
-
return f.total = M(N), N;
|
|
3866
|
-
};
|
|
3867
|
-
re(
|
|
3868
|
-
() => e.open,
|
|
3869
|
-
(y) => {
|
|
3870
|
-
f.open = y;
|
|
3871
|
-
},
|
|
3872
|
-
{ immediate: !0 }
|
|
3873
|
-
), re(
|
|
3874
|
-
B,
|
|
3875
|
-
(y) => {
|
|
3876
|
-
f.types = [...y];
|
|
3877
|
-
},
|
|
3878
|
-
{ immediate: !0, deep: !0 }
|
|
3879
|
-
), re(
|
|
3880
|
-
[() => e.selected, () => e.open],
|
|
3881
|
-
() => {
|
|
3882
|
-
e.open && (f.selection = le(e.selected));
|
|
3883
|
-
},
|
|
3884
|
-
{ immediate: !0, deep: !0 }
|
|
3885
|
-
), re(
|
|
3886
|
-
() => e.queryParams,
|
|
3887
|
-
() => {
|
|
3888
|
-
Object.assign(c, e.queryParams);
|
|
3889
|
-
},
|
|
3890
|
-
{ deep: !0 }
|
|
3891
|
-
), re(
|
|
3892
|
-
() => f.pasteDataDialog,
|
|
3893
|
-
(y) => {
|
|
3894
|
-
y || (f.pasteData = "");
|
|
3895
|
-
}
|
|
3896
|
-
), re(
|
|
3897
|
-
() => e.select,
|
|
3898
|
-
async () => {
|
|
3899
|
-
e.select && await x(e.select);
|
|
3900
|
-
},
|
|
3901
|
-
{ deep: !0 }
|
|
3902
|
-
), re(
|
|
3903
|
-
() => e.open,
|
|
3904
|
-
async (y) => {
|
|
3905
|
-
y && (f.dialogOpen = !1, await I());
|
|
3906
|
-
},
|
|
3907
|
-
{ immediate: !0 }
|
|
3908
|
-
);
|
|
3909
|
-
async function I() {
|
|
3910
|
-
if (!e.category) {
|
|
3911
|
-
f.categories = [];
|
|
3912
|
-
return;
|
|
3913
|
-
}
|
|
3914
|
-
const y = typeof e.category == "function" ? await e.category() : e.category;
|
|
3915
|
-
f.categories = v(y);
|
|
3916
|
-
}
|
|
3917
|
-
async function Q() {
|
|
3918
|
-
var y;
|
|
3919
|
-
return await De(), (y = u.value) == null ? void 0 : y.handleQuerySearch();
|
|
3920
|
-
}
|
|
3921
|
-
function h(y) {
|
|
3922
|
-
f.selection = le(y);
|
|
3923
|
-
}
|
|
3924
|
-
function j(y) {
|
|
3925
|
-
var $;
|
|
3926
|
-
f.tableData = y, f.tableRef = ($ = u.value) == null ? void 0 : $.getTableRef();
|
|
3927
|
-
}
|
|
3928
|
-
function P(y) {
|
|
3929
|
-
f.selection = le(y), a("submit", f);
|
|
3930
|
-
}
|
|
3931
|
-
function G() {
|
|
3932
|
-
a("close");
|
|
3933
|
-
}
|
|
3934
|
-
function E() {
|
|
3935
|
-
f.dialogOpen = !0, a("openDialog");
|
|
3936
|
-
}
|
|
3937
|
-
function d(y) {
|
|
3938
|
-
a("changeIndexShow", y);
|
|
3939
|
-
}
|
|
3940
|
-
async function x(y) {
|
|
3941
|
-
if (!e.query || !e.searchKey || !e.mainKey) return;
|
|
3942
|
-
const $ = await e.query({
|
|
3943
|
-
...c,
|
|
3944
|
-
[e.searchKey]: y[e.mainKey],
|
|
3945
|
-
category: []
|
|
3946
|
-
}), N = e.responseFormatter ? await e.responseFormatter($) : $, [z] = n(N);
|
|
3947
|
-
z && (e.selection === "multi" ? (f.selection = f.selection.filter(
|
|
3948
|
-
(m) => m[e.mainKey] !== z[e.mainKey]
|
|
3949
|
-
), f.selection.push(z)) : f.selection = [z]);
|
|
3950
|
-
}
|
|
3951
|
-
function i(y = {}) {
|
|
3952
|
-
c.page = y.page ?? c.page, c.pageSize = y.pageSize ?? c.pageSize;
|
|
3953
|
-
const $ = {
|
|
3954
|
-
...c,
|
|
3955
|
-
category: Z()
|
|
3956
|
-
};
|
|
3957
|
-
return e.searchKey && ($[e.searchKey] = String($[e.searchKey] || "").trim()), $;
|
|
3958
|
-
}
|
|
3959
|
-
function Z() {
|
|
3960
|
-
if (e.queryParams.category)
|
|
3961
|
-
return e.queryParams.category;
|
|
3962
|
-
const y = c.category;
|
|
3963
|
-
if (Array.isArray(y)) return y;
|
|
3964
|
-
if (!y) return [];
|
|
3965
|
-
const $ = Y(f.categories, y);
|
|
3966
|
-
return $ ? k($) : [y];
|
|
3967
|
-
}
|
|
3968
|
-
function Y(y, $) {
|
|
3969
|
-
for (const N of y || []) {
|
|
3970
|
-
if (N.value === $) return N;
|
|
3971
|
-
const z = Y(N.children || [], $);
|
|
3972
|
-
if (z) return z;
|
|
3973
|
-
}
|
|
3974
|
-
}
|
|
3975
|
-
function k(y) {
|
|
3976
|
-
return [y.value, ...(y.children || []).flatMap(k)];
|
|
3977
|
-
}
|
|
3978
|
-
function v(y) {
|
|
3979
|
-
const $ = (y == null ? void 0 : y.data) ?? y;
|
|
3980
|
-
if (!Array.isArray($)) return [];
|
|
3981
|
-
if (typeof e.categoryFormatter == "function")
|
|
3982
|
-
return e.categoryFormatter($);
|
|
3983
|
-
if (Array.isArray(e.categoryFormatter)) {
|
|
3984
|
-
const [N, z] = e.categoryFormatter;
|
|
3985
|
-
return l(D($, z), N, z);
|
|
3986
|
-
}
|
|
3987
|
-
return $;
|
|
3988
|
-
}
|
|
3989
|
-
function D(y, $) {
|
|
3990
|
-
const N = y.map((m) => ({ ...m })), z = [];
|
|
3991
|
-
return N.forEach((m) => {
|
|
3992
|
-
const _ = m.parentCateCode;
|
|
3993
|
-
if (!_) {
|
|
3994
|
-
z.push(m);
|
|
3995
|
-
return;
|
|
3996
|
-
}
|
|
3997
|
-
const ae = N.find((ve) => ve[$] === _);
|
|
3998
|
-
ae ? (ae.children || (ae.children = [])).push(m) : z.push(m);
|
|
3999
|
-
}), z;
|
|
4000
|
-
}
|
|
4001
|
-
function l(y, $, N) {
|
|
4002
|
-
return y.map((z) => ({
|
|
4003
|
-
...z,
|
|
4004
|
-
label: z[$],
|
|
4005
|
-
value: z[N],
|
|
4006
|
-
children: Array.isArray(z.children) ? l(z.children, $, N) : z.children
|
|
4007
|
-
}));
|
|
4008
|
-
}
|
|
4009
|
-
function n(y) {
|
|
4010
|
-
if (Array.isArray(y)) return y;
|
|
4011
|
-
const $ = y == null ? void 0 : y.data;
|
|
4012
|
-
return Array.isArray($) ? $ : (y == null ? void 0 : y.records) || (y == null ? void 0 : y.rows) || ($ == null ? void 0 : $.records) || [];
|
|
4013
|
-
}
|
|
4014
|
-
function M(y) {
|
|
4015
|
-
if (Array.isArray(y)) return y.length;
|
|
4016
|
-
const $ = n(y), N = y == null ? void 0 : y.data;
|
|
4017
|
-
return (y == null ? void 0 : y.total) ?? (Array.isArray(N) ? N.length : N == null ? void 0 : N.total) ?? $.length;
|
|
4018
|
-
}
|
|
4019
|
-
function le(y = []) {
|
|
4020
|
-
return y.map(($) => ({ ...$ }));
|
|
4021
|
-
}
|
|
4022
|
-
return b({
|
|
4023
|
-
search: Q,
|
|
4024
|
-
handleSearch: Q,
|
|
4025
|
-
handleConditionChange: Q,
|
|
4026
|
-
getTableRef: () => f.tableRef,
|
|
4027
|
-
getTableData: () => f.tableData,
|
|
4028
|
-
getSelection: () => le(f.selection)
|
|
4029
|
-
}), (y, $) => (V(), H(Be, null, [
|
|
4030
|
-
J(zt, ie({
|
|
4031
|
-
ref_key: "selectionDialogRef",
|
|
4032
|
-
ref: u
|
|
4033
|
-
}, C(A), {
|
|
4034
|
-
modelValue: f.selection,
|
|
4035
|
-
"onUpdate:modelValue": $[3] || ($[3] = (N) => f.selection = N),
|
|
4036
|
-
open: t.open,
|
|
4037
|
-
title: t.title,
|
|
4038
|
-
width: t.width,
|
|
4039
|
-
query: K,
|
|
4040
|
-
"response-formatter": t.responseFormatter,
|
|
4041
|
-
selection: t.selection,
|
|
4042
|
-
"row-key": t.mainKey,
|
|
4043
|
-
"label-key": t.tagName,
|
|
4044
|
-
"search-key": t.searchKey,
|
|
4045
|
-
"query-params": {},
|
|
4046
|
-
"category-options": R.value,
|
|
4047
|
-
"type-options": B.value,
|
|
4048
|
-
"type-select-props": t.typeSelectionProps,
|
|
4049
|
-
"table-props": t.tableProps,
|
|
4050
|
-
"show-copy-paste": !0,
|
|
4051
|
-
"show-append": t.append,
|
|
4052
|
-
onSelectionChange: h,
|
|
4053
|
-
onConfirm: P,
|
|
4054
|
-
onCancel: G,
|
|
4055
|
-
onAppend: E,
|
|
4056
|
-
onLoaded: j
|
|
4057
|
-
}), {
|
|
4058
|
-
side: S(() => [
|
|
4059
|
-
O(y.$slots, "side", {
|
|
4060
|
-
state: f,
|
|
4061
|
-
cate: f.categories,
|
|
4062
|
-
form: c,
|
|
4063
|
-
query: c,
|
|
4064
|
-
getData: Q,
|
|
4065
|
-
search: Q,
|
|
4066
|
-
changeIndexShow: d
|
|
4067
|
-
}, void 0, !0)
|
|
4068
|
-
]),
|
|
4069
|
-
search: S(() => [
|
|
4070
|
-
J(C(kt), {
|
|
4071
|
-
inline: "",
|
|
4072
|
-
model: c
|
|
4073
|
-
}, {
|
|
4074
|
-
default: S(() => [
|
|
4075
|
-
f.categories.length ? (V(), ee(C(Ie), {
|
|
4076
|
-
key: 0,
|
|
4077
|
-
label: "分类"
|
|
4078
|
-
}, {
|
|
4079
|
-
default: S(() => [
|
|
4080
|
-
J(C(wt), {
|
|
4081
|
-
modelValue: c.category,
|
|
4082
|
-
"onUpdate:modelValue": $[0] || ($[0] = (N) => c.category = N),
|
|
4083
|
-
class: "qy-legacy-selection-dialog__category",
|
|
4084
|
-
data: f.categories,
|
|
4085
|
-
clearable: "",
|
|
4086
|
-
filterable: "",
|
|
4087
|
-
"check-strictly": "",
|
|
4088
|
-
"render-after-expand": !1,
|
|
4089
|
-
onChange: Q
|
|
4090
|
-
}, null, 8, ["modelValue", "data"])
|
|
4091
|
-
]),
|
|
4092
|
-
_: 1
|
|
4093
|
-
})) : X("", !0),
|
|
4094
|
-
B.value.length ? (V(), ee(C(Ie), {
|
|
4095
|
-
key: 1,
|
|
4096
|
-
label: "类型"
|
|
4097
|
-
}, {
|
|
4098
|
-
default: S(() => [
|
|
4099
|
-
J(C(tt), ie({
|
|
4100
|
-
modelValue: c.type,
|
|
4101
|
-
"onUpdate:modelValue": $[1] || ($[1] = (N) => c.type = N),
|
|
4102
|
-
clearable: ""
|
|
4103
|
-
}, t.typeSelectionProps, { onChange: Q }), {
|
|
4104
|
-
default: S(() => [
|
|
4105
|
-
(V(!0), H(Be, null, Ue(B.value, (N) => (V(), ee(C(lt), {
|
|
4106
|
-
key: N.value,
|
|
4107
|
-
label: N.label,
|
|
4108
|
-
value: N.value
|
|
4109
|
-
}, null, 8, ["label", "value"]))), 128))
|
|
4110
|
-
]),
|
|
4111
|
-
_: 1
|
|
4112
|
-
}, 16, ["modelValue"])
|
|
4113
|
-
]),
|
|
4114
|
-
_: 1
|
|
4115
|
-
})) : X("", !0),
|
|
4116
|
-
t.searchKey ? (V(), ee(C(Ie), {
|
|
4117
|
-
key: 2,
|
|
4118
|
-
label: "搜索"
|
|
4119
|
-
}, {
|
|
4120
|
-
default: S(() => [
|
|
4121
|
-
J(C(Me), {
|
|
4122
|
-
modelValue: c[t.searchKey],
|
|
4123
|
-
"onUpdate:modelValue": $[2] || ($[2] = (N) => c[t.searchKey] = N),
|
|
4124
|
-
clearable: "",
|
|
4125
|
-
class: "qy-legacy-selection-dialog__search-input",
|
|
4126
|
-
onKeydown: Ke(ue(Q, ["prevent"]), ["enter"])
|
|
4127
|
-
}, null, 8, ["modelValue", "onKeydown"])
|
|
4128
|
-
]),
|
|
4129
|
-
_: 1
|
|
4130
|
-
})) : X("", !0),
|
|
4131
|
-
J(C(Ie), null, {
|
|
4132
|
-
default: S(() => [
|
|
4133
|
-
J(C(ke), {
|
|
4134
|
-
type: "primary",
|
|
4135
|
-
onClick: Q
|
|
4136
|
-
}, {
|
|
4137
|
-
default: S(() => [...$[4] || ($[4] = [
|
|
4138
|
-
me("查询", -1)
|
|
4139
|
-
])]),
|
|
4140
|
-
_: 1
|
|
4141
|
-
})
|
|
4142
|
-
]),
|
|
4143
|
-
_: 1
|
|
4144
|
-
})
|
|
4145
|
-
]),
|
|
4146
|
-
_: 1
|
|
4147
|
-
}, 8, ["model"])
|
|
4148
|
-
]),
|
|
4149
|
-
toolbar: S(() => [
|
|
4150
|
-
O(y.$slots, "bar", {
|
|
4151
|
-
query: c,
|
|
4152
|
-
search: Q
|
|
4153
|
-
}, void 0, !0)
|
|
4154
|
-
]),
|
|
4155
|
-
columns: S(() => [
|
|
4156
|
-
O(y.$slots, "cols", {}, void 0, !0),
|
|
4157
|
-
O(y.$slots, "columns", {}, void 0, !0)
|
|
4158
|
-
]),
|
|
4159
|
-
_: 3
|
|
4160
|
-
}, 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"]),
|
|
4161
|
-
O(y.$slots, "dialog", {
|
|
4162
|
-
state: f,
|
|
4163
|
-
form: c,
|
|
4164
|
-
getData: Q
|
|
4165
|
-
}, void 0, !0)
|
|
4166
|
-
], 64));
|
|
4167
|
-
}
|
|
4168
|
-
}), en = /* @__PURE__ */ ze(_a, [["__scopeId", "data-v-b54ca11b"]]), tn = { class: "qy-form-section__heading" }, ln = {
|
|
4169
|
-
key: 0,
|
|
4170
|
-
class: "qy-form-section__title"
|
|
4171
|
-
}, an = {
|
|
4172
|
-
key: 0,
|
|
4173
|
-
class: "qy-form-section__description"
|
|
4174
|
-
}, nn = { class: "qy-form-section__actions" }, on = /* @__PURE__ */ se({
|
|
4175
|
-
name: "QyFormSection",
|
|
4176
|
-
__name: "index",
|
|
4177
|
-
props: {
|
|
4178
|
-
title: { default: "" },
|
|
4179
|
-
description: { default: "" },
|
|
4180
|
-
tip: { default: "" },
|
|
4181
|
-
tipType: { default: "info" },
|
|
4182
|
-
collapsible: { type: Boolean, default: !1 },
|
|
4183
|
-
defaultExpanded: { type: Boolean, default: !0 },
|
|
4184
|
-
bordered: { type: Boolean, default: !0 },
|
|
4185
|
-
background: { default: "white" },
|
|
4186
|
-
bodyClass: { default: "" },
|
|
4187
|
-
headerClass: { default: "" }
|
|
4188
|
-
},
|
|
4189
|
-
emits: ["toggle"],
|
|
4190
|
-
setup(t, { emit: b }) {
|
|
4191
|
-
const w = t, e = b, a = U(w.defaultExpanded);
|
|
4192
|
-
re(
|
|
4193
|
-
() => w.defaultExpanded,
|
|
4194
|
-
(c) => {
|
|
4195
|
-
a.value = c;
|
|
4196
|
-
}
|
|
4197
|
-
);
|
|
4198
|
-
function A() {
|
|
4199
|
-
w.collapsible && (a.value = !a.value, e("toggle", a.value));
|
|
4200
|
-
}
|
|
4201
|
-
function u() {
|
|
4202
|
-
w.collapsible && A();
|
|
4203
|
-
}
|
|
4204
|
-
return (c, f) => (V(), H("section", {
|
|
4205
|
-
class: he(["qy-form-section", [
|
|
4206
|
-
`is-bg-${t.background}`,
|
|
4207
|
-
{
|
|
4208
|
-
"is-bordered": t.bordered,
|
|
4209
|
-
"is-collapsible": t.collapsible
|
|
4210
|
-
}
|
|
4211
|
-
]])
|
|
4212
|
-
}, [
|
|
4213
|
-
W("header", {
|
|
4214
|
-
class: he(["qy-form-section__header", t.headerClass]),
|
|
4215
|
-
onClick: u
|
|
4216
|
-
}, [
|
|
4217
|
-
W("div", tn, [
|
|
4218
|
-
O(c.$slots, "title", {}, () => [
|
|
4219
|
-
t.title ? (V(), H("div", ln, fe(t.title), 1)) : X("", !0)
|
|
4220
|
-
], !0),
|
|
4221
|
-
O(c.$slots, "description", {}, () => [
|
|
4222
|
-
t.description ? (V(), H("div", an, fe(t.description), 1)) : X("", !0)
|
|
4223
|
-
], !0)
|
|
4224
|
-
]),
|
|
4225
|
-
W("div", nn, [
|
|
4226
|
-
O(c.$slots, "actions", {}, void 0, !0),
|
|
4227
|
-
t.collapsible ? (V(), H("button", {
|
|
4228
|
-
key: 0,
|
|
4229
|
-
type: "button",
|
|
4230
|
-
class: "qy-form-section__toggle",
|
|
4231
|
-
onClick: ue(A, ["stop"])
|
|
4232
|
-
}, fe(a.value ? "收起" : "展开"), 1)) : X("", !0)
|
|
4233
|
-
])
|
|
4234
|
-
], 2),
|
|
4235
|
-
et(W("div", {
|
|
4236
|
-
class: he(["qy-form-section__body", t.bodyClass])
|
|
4237
|
-
}, [
|
|
4238
|
-
O(c.$slots, "tip", {}, () => [
|
|
4239
|
-
t.tip ? (V(), H("div", {
|
|
4240
|
-
key: 0,
|
|
4241
|
-
class: he(["qy-form-section__tip", `is-${t.tipType}`])
|
|
4242
|
-
}, fe(t.tip), 3)) : X("", !0)
|
|
4243
|
-
], !0),
|
|
4244
|
-
O(c.$slots, "default", {}, void 0, !0)
|
|
4245
|
-
], 2), [
|
|
4246
|
-
[ht, a.value]
|
|
4247
|
-
])
|
|
4248
|
-
], 2));
|
|
4249
|
-
}
|
|
4250
|
-
}), rn = /* @__PURE__ */ ze(on, [["__scopeId", "data-v-8149aa01"]]), un = {
|
|
4251
|
-
key: 0,
|
|
4252
|
-
class: "qy-action-bar__left"
|
|
4253
|
-
}, sn = {
|
|
4254
|
-
key: 1,
|
|
4255
|
-
class: "qy-action-bar__center"
|
|
4256
|
-
}, dn = {
|
|
4257
|
-
key: 2,
|
|
4258
|
-
class: "qy-action-bar__right"
|
|
4259
|
-
}, cn = /* @__PURE__ */ se({
|
|
4260
|
-
name: "QyActionBar",
|
|
4261
|
-
__name: "index",
|
|
4262
|
-
props: {
|
|
4263
|
-
sticky: { type: Boolean, default: !0 },
|
|
4264
|
-
offsetBottom: { default: 0 },
|
|
4265
|
-
bordered: { type: Boolean, default: !0 },
|
|
4266
|
-
shadow: { type: Boolean, default: !1 },
|
|
4267
|
-
wrap: { type: Boolean, default: !0 },
|
|
4268
|
-
justify: { default: "between" },
|
|
4269
|
-
background: { default: "#fff" }
|
|
4270
|
-
},
|
|
4271
|
-
setup(t) {
|
|
4272
|
-
const b = t, w = F(() => ({
|
|
4273
|
-
// offsetBottom 只负责业务偏移,安全区补偿由 CSS padding 处理。
|
|
4274
|
-
bottom: `${b.offsetBottom}px`,
|
|
4275
|
-
background: b.background
|
|
4276
|
-
}));
|
|
4277
|
-
return (e, a) => (V(), H("div", {
|
|
4278
|
-
class: he(["qy-action-bar", [
|
|
4279
|
-
`is-justify-${t.justify}`,
|
|
4280
|
-
{
|
|
4281
|
-
"is-sticky": t.sticky,
|
|
4282
|
-
"is-bordered": t.bordered,
|
|
4283
|
-
"is-shadow": t.shadow,
|
|
4284
|
-
"is-wrap": t.wrap
|
|
4285
|
-
}
|
|
4286
|
-
]]),
|
|
4287
|
-
style: Ae(w.value)
|
|
4288
|
-
}, [
|
|
4289
|
-
e.$slots.left ? (V(), H("div", un, [
|
|
4290
|
-
O(e.$slots, "left", {}, void 0, !0)
|
|
4291
|
-
])) : X("", !0),
|
|
4292
|
-
e.$slots.default ? (V(), H("div", sn, [
|
|
4293
|
-
O(e.$slots, "default", {}, void 0, !0)
|
|
4294
|
-
])) : X("", !0),
|
|
4295
|
-
e.$slots.right ? (V(), H("div", dn, [
|
|
4296
|
-
O(e.$slots, "right", {}, void 0, !0)
|
|
4297
|
-
])) : X("", !0)
|
|
4298
|
-
], 6));
|
|
4299
|
-
}
|
|
4300
|
-
}), fn = /* @__PURE__ */ ze(cn, [["__scopeId", "data-v-ecba8f49"]]), qt = oe(Vt, "QyUpload"), It = oe(_l, "QyImage"), Rt = oe(ea, "QyImagePreview"), At = oe(ta, "QyImageUpload"), Tt = oe(Xe, "QyDialog"), Pt = oe(xa, "QyRemarkImage"), Mt = oe(Ca, "QyInput"), Ft = oe($a, "QyInputNumber"), Ot = oe(Ba, "QyMoneyInput"), Qt = oe(za, "QyDatePicker"), Dt = oe(qa, "QyCheckbox"), Ut = oe(Ia, "QyAutocomplete"), Kt = oe(ql, "QyMenuActions"), Et = oe(
|
|
4301
|
-
Il,
|
|
4302
|
-
"QyTableColumnSettings"
|
|
4303
|
-
), Lt = oe(Ra, "QyRadioGroup"), jt = oe(Aa, "QyRemoteSelect"), Nt = oe($t, "QySearchInput"), Ht = oe(
|
|
4304
|
-
Ea,
|
|
4305
|
-
"QyRecordQuoteSearch"
|
|
4306
|
-
), Wt = oe(at, "QySelect"), Zt = oe(Bt, "QyTreeSelect"), Gt = oe(zt, "QySelectionDialog"), Xt = oe(
|
|
4307
|
-
en,
|
|
4308
|
-
"QyLegacySelectionDialog"
|
|
4309
|
-
), Jt = oe(rn, "QyFormSection"), Yt = oe(fn, "QyActionBar"), mn = (t) => {
|
|
4310
|
-
t.component("QyDialog", Tt), t.component("QyUpload", qt), t.component("QyImage", It), t.component("QyImagePreview", Rt), t.component("QyImageUpload", At), t.component("QyRemarkImage", Pt), t.component("QyInput", Mt), t.component("QyInputNumber", Ft), t.component("QyMoneyInput", Ot), t.component("QyDatePicker", Qt), t.component("QyCheckbox", Dt), t.component("QyAutocomplete", Ut), t.component("QyMenuActions", Kt), t.component("QyTableColumnSettings", Et), t.component("QyRadioGroup", Lt), t.component("QyRemoteSelect", jt), t.component("QySearchInput", Nt), t.component("QyRecordQuoteSearch", Ht), t.component("QySelect", Wt), t.component("QyTreeSelect", Zt), t.component("QySelectionDialog", Gt), t.component("QyLegacySelectionDialog", Xt), t.component("QyFormSection", Jt), t.component("QyActionBar", Yt);
|
|
4311
|
-
}, Vn = {
|
|
4312
|
-
install: mn,
|
|
4313
|
-
QyUpload: qt,
|
|
4314
|
-
QyImage: It,
|
|
4315
|
-
QyImagePreview: Rt,
|
|
4316
|
-
openQyImagePreview: xt,
|
|
4317
|
-
QyImageUpload: At,
|
|
4318
|
-
QyDialog: Tt,
|
|
4319
|
-
QyInput: Mt,
|
|
4320
|
-
QyInputNumber: Ft,
|
|
4321
|
-
QyMoneyInput: Ot,
|
|
4322
|
-
QyDatePicker: Qt,
|
|
4323
|
-
QyCheckbox: Dt,
|
|
4324
|
-
QyAutocomplete: Ut,
|
|
4325
|
-
QyMenuActions: Kt,
|
|
4326
|
-
QyTableColumnSettings: Et,
|
|
4327
|
-
QyRadioGroup: Lt,
|
|
4328
|
-
QyRemoteSelect: jt,
|
|
4329
|
-
QySearchInput: Nt,
|
|
4330
|
-
QyRecordQuoteSearch: Ht,
|
|
4331
|
-
QySelect: Wt,
|
|
4332
|
-
QyTreeSelect: Zt,
|
|
4333
|
-
QySelectionDialog: Gt,
|
|
4334
|
-
QyLegacySelectionDialog: Xt,
|
|
4335
|
-
QyFormSection: Jt,
|
|
4336
|
-
QyActionBar: Yt,
|
|
4337
|
-
QyRemarkImage: Pt
|
|
4338
|
-
};
|
|
4339
|
-
export {
|
|
4340
|
-
ft as A,
|
|
4341
|
-
mt as B,
|
|
4342
|
-
Yt as Q,
|
|
4343
|
-
Ut as a,
|
|
4344
|
-
Dt as b,
|
|
4345
|
-
Qt as c,
|
|
4346
|
-
Tt as d,
|
|
4347
|
-
Jt as e,
|
|
4348
|
-
It as f,
|
|
4349
|
-
Rt as g,
|
|
4350
|
-
At as h,
|
|
4351
|
-
Mt as i,
|
|
4352
|
-
Ft as j,
|
|
4353
|
-
Xt as k,
|
|
4354
|
-
Kt as l,
|
|
4355
|
-
Ot as m,
|
|
4356
|
-
Lt as n,
|
|
4357
|
-
Ht as o,
|
|
4358
|
-
Pt as p,
|
|
4359
|
-
jt as q,
|
|
4360
|
-
Nt as r,
|
|
4361
|
-
Wt as s,
|
|
4362
|
-
Gt as t,
|
|
4363
|
-
Et as u,
|
|
4364
|
-
Zt as v,
|
|
4365
|
-
qt as w,
|
|
4366
|
-
Vn as x,
|
|
4367
|
-
ma as y,
|
|
4368
|
-
xt as z
|
|
4369
|
-
};
|