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