@qynpm/ui 1.0.4 → 1.0.5
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 +228 -59
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +19 -15
- package/dist/lib/dialog/index.vue.cjs +1 -1
- package/dist/lib/dialog/index.vue.mjs +24 -25
- package/dist/lib/dialog/index.vue3.cjs +1 -0
- package/dist/lib/dialog/index.vue3.mjs +5 -0
- package/dist/lib/index.cjs +1 -1
- package/dist/lib/index.mjs +43 -30
- package/dist/lib/qy-action-bar/index.vue.cjs +1 -1
- package/dist/lib/qy-action-bar/index.vue.mjs +4 -53
- package/dist/lib/qy-action-bar/index.vue2.cjs +1 -0
- package/dist/lib/qy-action-bar/index.vue2.mjs +55 -0
- package/dist/lib/qy-form-section/index.vue.cjs +1 -1
- package/dist/lib/qy-form-section/index.vue.mjs +4 -86
- package/dist/lib/qy-form-section/index.vue2.cjs +1 -0
- package/dist/lib/qy-form-section/index.vue2.mjs +87 -0
- package/dist/lib/qy-input/index.vue.mjs +2 -1
- package/dist/lib/qy-input/index.vue2.cjs +1 -0
- package/dist/lib/qy-input/index.vue2.mjs +4 -0
- package/dist/lib/qy-money-input/index.vue.cjs +1 -0
- package/dist/lib/qy-money-input/index.vue.mjs +171 -0
- package/dist/lib/qy-money-input/index.vue2.cjs +1 -0
- package/dist/lib/qy-money-input/index.vue2.mjs +4 -0
- package/dist/lib/qy-radio-group/index.vue.cjs +1 -0
- package/dist/lib/qy-radio-group/index.vue.mjs +90 -0
- package/dist/lib/qy-radio-group/index.vue2.cjs +1 -0
- package/dist/lib/qy-radio-group/index.vue2.mjs +4 -0
- package/dist/lib/qy-record-quote-search/index.vue.cjs +1 -1
- package/dist/lib/qy-record-quote-search/index.vue.mjs +4 -203
- package/dist/lib/qy-record-quote-search/index.vue2.cjs +1 -0
- package/dist/lib/qy-record-quote-search/index.vue2.mjs +204 -0
- package/dist/lib/qy-remote-select/index.vue.cjs +1 -0
- package/dist/lib/qy-remote-select/index.vue.mjs +214 -0
- package/dist/lib/qy-remote-select/index.vue2.cjs +1 -0
- package/dist/lib/qy-remote-select/index.vue2.mjs +4 -0
- package/dist/lib/qy-search-input/index.vue.cjs +1 -1
- package/dist/lib/qy-search-input/index.vue.mjs +4 -274
- package/dist/lib/qy-search-input/index.vue2.cjs +1 -0
- package/dist/lib/qy-search-input/index.vue2.mjs +276 -0
- package/dist/lib/qy-select/index.vue.cjs +1 -1
- package/dist/lib/qy-select/index.vue.mjs +80 -55
- package/dist/lib/qy-select/index.vue2.cjs +1 -0
- package/dist/lib/qy-select/index.vue2.mjs +4 -0
- package/dist/lib/qy-voucher-upload/index.vue.cjs +1 -0
- package/dist/lib/qy-voucher-upload/index.vue.mjs +123 -0
- package/dist/lib/remark-image/index.vue.cjs +1 -1
- package/dist/lib/remark-image/index.vue.mjs +4 -195
- package/dist/lib/remark-image/index.vue2.cjs +1 -0
- package/dist/lib/remark-image/index.vue2.mjs +197 -0
- package/dist/lib/upload/index.vue.cjs +1 -1
- package/dist/lib/upload/index.vue.mjs +317 -217
- package/dist/lib/utils/auth.cjs +1 -1
- package/dist/lib/utils/auth.mjs +1 -1
- package/dist/node_modules/.pnpm/{js-cookie@3.0.1 → js-cookie@3.0.5}/node_modules/js-cookie/dist/js.cookie.cjs +1 -1
- package/dist/node_modules/.pnpm/{js-cookie@3.0.1 → js-cookie@3.0.5}/node_modules/js-cookie/dist/js.cookie.mjs +6 -6
- package/dist/qy-dialog/index.cjs +1 -1
- package/dist/qy-dialog/index.mjs +3 -2
- package/dist/qy-input/index.cjs +1 -1
- package/dist/qy-money-input/index.cjs +1 -0
- package/dist/qy-money-input/index.mjs +6 -0
- package/dist/qy-radio-group/index.cjs +1 -0
- package/dist/qy-radio-group/index.mjs +6 -0
- 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 -0
- package/dist/qy-remote-select/index.mjs +6 -0
- package/dist/qy-select/index.cjs +1 -1
- package/dist/qy-voucher-upload/index.cjs +1 -0
- package/dist/qy-voucher-upload/index.mjs +6 -0
- package/index.d.ts +20 -11
- package/package.json +25 -1
- package/qy-money-input/index.d.ts +12 -0
- package/qy-money-input/index.js +15 -0
- package/qy-radio-group/index.d.ts +12 -0
- package/qy-radio-group/index.js +15 -0
- package/qy-remote-select/index.d.ts +12 -0
- package/qy-remote-select/index.js +15 -0
- package/qy-voucher-upload/index.d.ts +12 -0
- package/qy-voucher-upload/index.js +15 -0
- /package/dist/_virtual/{plugin-vue_export-helper.cjs → _plugin-vue_export-helper.cjs} +0 -0
- /package/dist/_virtual/{plugin-vue_export-helper.mjs → _plugin-vue_export-helper.mjs} +0 -0
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
import { defineComponent as ae, useAttrs as re, ref as y, computed as b, watch as ue, createElementBlock as M, openBlock as V, normalizeClass as se, createVNode as ie, unref as w, mergeProps as E, withKeys as ce, createSlots as de, withCtx as i, renderSlot as d, createElementVNode as F, createCommentVNode as fe, toDisplayString as L, createBlock as pe, createTextVNode as ge } from "vue";
|
|
2
|
+
import { ElAutocomplete as he, ElButton as me } from "element-plus";
|
|
3
|
+
const ve = { class: "qy-search-input__item" }, ye = ["innerHTML"], be = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "qy-search-input__item-description"
|
|
6
|
+
}, ke = /* @__PURE__ */ ae({
|
|
7
|
+
name: "QySearchInput",
|
|
8
|
+
inheritAttrs: !1,
|
|
9
|
+
__name: "index",
|
|
10
|
+
props: {
|
|
11
|
+
modelValue: { default: "" },
|
|
12
|
+
loading: { type: Boolean, default: !1 },
|
|
13
|
+
disabled: { type: Boolean, default: !1 },
|
|
14
|
+
placeholder: { default: "请输入搜索内容" },
|
|
15
|
+
removeSpace: { type: Boolean, default: !1 },
|
|
16
|
+
trimMode: { default: "none" },
|
|
17
|
+
clearable: { type: Boolean, default: !0 },
|
|
18
|
+
buttonText: { default: "搜索" },
|
|
19
|
+
buttonProps: { default: () => ({}) },
|
|
20
|
+
suggestions: { default: () => [] },
|
|
21
|
+
fetchSuggestions: { type: [Function, null], default: null },
|
|
22
|
+
fetchSuggestionsMethod: { type: [Function, null], default: null },
|
|
23
|
+
debounce: { default: 300 },
|
|
24
|
+
minLength: { default: 1 },
|
|
25
|
+
triggerOnFocus: { type: Boolean, default: !1 },
|
|
26
|
+
searchOnEnter: { type: Boolean, default: !0 },
|
|
27
|
+
searchOnSelect: { type: Boolean, default: !1 },
|
|
28
|
+
highlightKeyword: { type: Boolean, default: !0 },
|
|
29
|
+
teleported: { type: Boolean, default: !0 },
|
|
30
|
+
appendTo: { default: "body" },
|
|
31
|
+
popperClass: { default: "" },
|
|
32
|
+
fitInputWidth: { type: Boolean, default: !0 }
|
|
33
|
+
},
|
|
34
|
+
emits: ["update:modelValue", "search", "clear", "input", "change", "focus", "blur", "enter", "select", "visible-change", "suggestions-change", "error"],
|
|
35
|
+
setup(T, { expose: A, emit: I }) {
|
|
36
|
+
const l = T, o = I, O = re(), u = y(null), c = y(r(l.modelValue)), p = b(() => r(l.modelValue)), z = b(
|
|
37
|
+
() => ["qy-search-input__popper", l.popperClass].filter(Boolean).join(" ")
|
|
38
|
+
), P = b(() => r(l.modelValue)), g = y("");
|
|
39
|
+
ue(
|
|
40
|
+
() => l.modelValue,
|
|
41
|
+
(e) => {
|
|
42
|
+
c.value = r(e);
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
function r(e) {
|
|
46
|
+
return e == null ? "" : String(e);
|
|
47
|
+
}
|
|
48
|
+
function K(e) {
|
|
49
|
+
return l.removeSpace ? e.replace(/\s+/g, "") : e;
|
|
50
|
+
}
|
|
51
|
+
function k(e, t) {
|
|
52
|
+
return l.trimMode !== t ? e : e.trim();
|
|
53
|
+
}
|
|
54
|
+
function h(e) {
|
|
55
|
+
return K(r(e));
|
|
56
|
+
}
|
|
57
|
+
function m(e) {
|
|
58
|
+
c.value = e, o("update:modelValue", e);
|
|
59
|
+
}
|
|
60
|
+
function B(e, t = "") {
|
|
61
|
+
return {
|
|
62
|
+
...e,
|
|
63
|
+
label: e.label || e.value,
|
|
64
|
+
value: e.value || e.label,
|
|
65
|
+
description: e.description || t
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
function v(e = []) {
|
|
69
|
+
return e.flatMap((t) => {
|
|
70
|
+
if (Array.isArray(t.items)) {
|
|
71
|
+
const n = t;
|
|
72
|
+
return n.items.map((a) => B(a, n.groupLabel));
|
|
73
|
+
}
|
|
74
|
+
return B(t);
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
function R(e) {
|
|
78
|
+
const t = e.toLowerCase();
|
|
79
|
+
return (n) => [n.label, n.value, n.description].filter(Boolean).some((a) => String(a).toLowerCase().includes(t));
|
|
80
|
+
}
|
|
81
|
+
function H(e) {
|
|
82
|
+
return e ? e.length >= l.minLength : l.triggerOnFocus;
|
|
83
|
+
}
|
|
84
|
+
function s(e) {
|
|
85
|
+
o("suggestions-change", e), o("visible-change", e.length > 0);
|
|
86
|
+
}
|
|
87
|
+
async function N(e) {
|
|
88
|
+
if (!H(e))
|
|
89
|
+
return s([]), [];
|
|
90
|
+
if (l.fetchSuggestionsMethod) {
|
|
91
|
+
const a = await new Promise((f) => {
|
|
92
|
+
var $;
|
|
93
|
+
($ = l.fetchSuggestionsMethod) == null || $.call(l, e, (oe) => {
|
|
94
|
+
f(v(oe));
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
return s(a), a;
|
|
98
|
+
}
|
|
99
|
+
if (l.fetchSuggestions) {
|
|
100
|
+
const a = await l.fetchSuggestions(e), f = v(Array.isArray(a) ? a : []);
|
|
101
|
+
return s(f), f;
|
|
102
|
+
}
|
|
103
|
+
const t = v(l.suggestions), n = e ? t.filter(R(e)) : t;
|
|
104
|
+
return s(n), n;
|
|
105
|
+
}
|
|
106
|
+
async function Q(e, t) {
|
|
107
|
+
g.value = e;
|
|
108
|
+
try {
|
|
109
|
+
const n = await N(e);
|
|
110
|
+
t(n);
|
|
111
|
+
} catch (n) {
|
|
112
|
+
o("error", n), s([]), t([]);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
function _() {
|
|
116
|
+
var e, t;
|
|
117
|
+
g.value && ((t = (e = u.value) == null ? void 0 : e.getData) == null || t.call(e, g.value));
|
|
118
|
+
}
|
|
119
|
+
function q(e) {
|
|
120
|
+
const t = h(e);
|
|
121
|
+
m(t);
|
|
122
|
+
}
|
|
123
|
+
function D(e) {
|
|
124
|
+
const t = h(e);
|
|
125
|
+
c.value = t, o("input", t);
|
|
126
|
+
}
|
|
127
|
+
function U(e) {
|
|
128
|
+
const t = k(h(e), "change");
|
|
129
|
+
t !== r(l.modelValue) && m(t), o("change", t);
|
|
130
|
+
}
|
|
131
|
+
function W(e) {
|
|
132
|
+
o("focus", e);
|
|
133
|
+
}
|
|
134
|
+
function j(e) {
|
|
135
|
+
const t = k(c.value, "blur");
|
|
136
|
+
t !== r(l.modelValue) && m(t), o("blur", e), o("visible-change", !1);
|
|
137
|
+
}
|
|
138
|
+
function G() {
|
|
139
|
+
c.value = "", o("update:modelValue", ""), o("clear"), s([]);
|
|
140
|
+
}
|
|
141
|
+
function J(e) {
|
|
142
|
+
o("enter", e), l.searchOnEnter && S();
|
|
143
|
+
}
|
|
144
|
+
function S() {
|
|
145
|
+
o("search", r(l.modelValue));
|
|
146
|
+
}
|
|
147
|
+
function X(e) {
|
|
148
|
+
o("select", e), l.searchOnSelect && o("search", e.value);
|
|
149
|
+
}
|
|
150
|
+
function C(e) {
|
|
151
|
+
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
152
|
+
}
|
|
153
|
+
function Y(e) {
|
|
154
|
+
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
155
|
+
}
|
|
156
|
+
function Z(e) {
|
|
157
|
+
const t = C(e || "");
|
|
158
|
+
if (!l.highlightKeyword || !p.value) return t;
|
|
159
|
+
const n = Y(C(p.value));
|
|
160
|
+
return n ? t.replace(
|
|
161
|
+
new RegExp(`(${n})`, "ig"),
|
|
162
|
+
'<mark class="qy-search-input__mark">$1</mark>'
|
|
163
|
+
) : t;
|
|
164
|
+
}
|
|
165
|
+
function x() {
|
|
166
|
+
var e, t;
|
|
167
|
+
(t = (e = u.value) == null ? void 0 : e.focus) == null || t.call(e);
|
|
168
|
+
}
|
|
169
|
+
function ee() {
|
|
170
|
+
var e, t;
|
|
171
|
+
(t = (e = u.value) == null ? void 0 : e.blur) == null || t.call(e);
|
|
172
|
+
}
|
|
173
|
+
function te() {
|
|
174
|
+
var e, t, n;
|
|
175
|
+
(n = (t = (e = u.value) == null ? void 0 : e.inputRef) == null ? void 0 : t.select) == null || n.call(t);
|
|
176
|
+
}
|
|
177
|
+
function ne() {
|
|
178
|
+
var e, t;
|
|
179
|
+
(t = (e = u.value) == null ? void 0 : e.clear) == null || t.call(e);
|
|
180
|
+
}
|
|
181
|
+
function le() {
|
|
182
|
+
var e, t;
|
|
183
|
+
(t = (e = u.value) == null ? void 0 : e.close) == null || t.call(e);
|
|
184
|
+
}
|
|
185
|
+
return A({
|
|
186
|
+
// 暴露搜索框常用控制方法,供弹窗打开后聚焦或失败后重试建议项。
|
|
187
|
+
focus: x,
|
|
188
|
+
blur: ee,
|
|
189
|
+
select: te,
|
|
190
|
+
clear: ne,
|
|
191
|
+
closePanel: le,
|
|
192
|
+
retryFetch: _
|
|
193
|
+
}), (e, t) => (V(), M("div", {
|
|
194
|
+
class: se(["qy-search-input", { "is-disabled": e.disabled }])
|
|
195
|
+
}, [
|
|
196
|
+
ie(w(he), E({
|
|
197
|
+
ref_key: "autocompleteRef",
|
|
198
|
+
ref: u
|
|
199
|
+
}, w(O), {
|
|
200
|
+
"model-value": P.value,
|
|
201
|
+
disabled: e.disabled,
|
|
202
|
+
placeholder: e.placeholder,
|
|
203
|
+
clearable: e.clearable,
|
|
204
|
+
debounce: e.debounce,
|
|
205
|
+
"fetch-suggestions": Q,
|
|
206
|
+
"trigger-on-focus": e.triggerOnFocus,
|
|
207
|
+
teleported: e.teleported,
|
|
208
|
+
"fit-input-width": e.fitInputWidth,
|
|
209
|
+
"popper-class": z.value,
|
|
210
|
+
"append-to": e.appendTo,
|
|
211
|
+
"value-key": "value",
|
|
212
|
+
"onUpdate:modelValue": q,
|
|
213
|
+
onInput: D,
|
|
214
|
+
onChange: U,
|
|
215
|
+
onFocus: W,
|
|
216
|
+
onBlur: j,
|
|
217
|
+
onClear: G,
|
|
218
|
+
onSelect: X,
|
|
219
|
+
onKeydown: ce(J, ["enter"])
|
|
220
|
+
}), de({
|
|
221
|
+
append: i(() => [
|
|
222
|
+
e.$slots.append ? d(e.$slots, "append", { key: 0 }, void 0, !0) : (V(), pe(w(me), E({ key: 1 }, e.buttonProps, {
|
|
223
|
+
loading: e.loading,
|
|
224
|
+
disabled: e.disabled,
|
|
225
|
+
onClick: S
|
|
226
|
+
}), {
|
|
227
|
+
default: i(() => [
|
|
228
|
+
ge(L(e.buttonText), 1)
|
|
229
|
+
]),
|
|
230
|
+
_: 1
|
|
231
|
+
}, 16, ["loading", "disabled"]))
|
|
232
|
+
]),
|
|
233
|
+
default: i(({ item: n }) => [
|
|
234
|
+
d(e.$slots, "item", {
|
|
235
|
+
item: n,
|
|
236
|
+
keyword: p.value
|
|
237
|
+
}, () => [
|
|
238
|
+
F("div", ve, [
|
|
239
|
+
F("div", {
|
|
240
|
+
class: "qy-search-input__item-label",
|
|
241
|
+
innerHTML: Z(n.label || n.value || "")
|
|
242
|
+
}, null, 8, ye),
|
|
243
|
+
n.description ? (V(), M("div", be, L(n.description), 1)) : fe("", !0)
|
|
244
|
+
])
|
|
245
|
+
], !0)
|
|
246
|
+
]),
|
|
247
|
+
_: 2
|
|
248
|
+
}, [
|
|
249
|
+
e.$slots.prefix ? {
|
|
250
|
+
name: "prefix",
|
|
251
|
+
fn: i(() => [
|
|
252
|
+
d(e.$slots, "prefix", {}, void 0, !0)
|
|
253
|
+
]),
|
|
254
|
+
key: "0"
|
|
255
|
+
} : void 0,
|
|
256
|
+
e.$slots.suffix ? {
|
|
257
|
+
name: "suffix",
|
|
258
|
+
fn: i(() => [
|
|
259
|
+
d(e.$slots, "suffix", {}, void 0, !0)
|
|
260
|
+
]),
|
|
261
|
+
key: "1"
|
|
262
|
+
} : void 0,
|
|
263
|
+
e.$slots.prepend ? {
|
|
264
|
+
name: "prepend",
|
|
265
|
+
fn: i(() => [
|
|
266
|
+
d(e.$slots, "prepend", {}, void 0, !0)
|
|
267
|
+
]),
|
|
268
|
+
key: "2"
|
|
269
|
+
} : void 0
|
|
270
|
+
]), 1040, ["model-value", "disabled", "placeholder", "clearable", "debounce", "trigger-on-focus", "teleported", "fit-input-width", "popper-class", "append-to"])
|
|
271
|
+
], 2));
|
|
272
|
+
}
|
|
273
|
+
});
|
|
274
|
+
export {
|
|
275
|
+
ke as default
|
|
276
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("vue"),n=require("element-plus"),T=l.defineComponent({name:"QySelect",inheritAttrs:!1,__name:"index",props:{modelValue:{type:[String,Number,Boolean,Array,null],default:void 0},options:{default:()=>[]},labelKey:{default:"label"},valueKey:{default:"value"},disabledKey:{default:"disabled"},placeholder:{default:"请选择"},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},filterable:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},collapseTags:{type:Boolean,default:!1},collapseTagsTooltip:{type:Boolean,default:!1},autoSelectSingle:{type:Boolean,default:!1},size:{default:"default"},teleported:{type:Boolean,default:!0},appendTo:{default:"body"},fitInputWidth:{type:Boolean,default:!0},popperClass:{default:""}},emits:["update:modelValue","change","clear","visible-change","focus","blur"],setup(o,{expose:f,emit:i}){const t=o,s=i,c=l.useAttrs(),p=l.useSlots(),r=l.ref(null),m=l.computed(()=>["qy-select__popper",t.popperClass].filter(Boolean).join(" ")),d=l.computed(()=>(t.options||[]).map(e=>({raw:e,label:(e==null?void 0:e[t.labelKey])??(e==null?void 0:e.label)??(e==null?void 0:e.value)??"",value:(e==null?void 0:e[t.valueKey])??(e==null?void 0:e.value)??(e==null?void 0:e.label),disabled:!!(e!=null&&e[t.disabledKey])}))),b=l.computed(()=>{const e=p.default;return e?e().some(a=>a.type!==l.Comment):!1});function g(e){return Array.isArray(e)?e.length===0:e===""||e===null||e===void 0}l.watch([d,()=>t.modelValue,()=>t.autoSelectSingle,()=>t.disabled,()=>t.multiple],([e])=>{if(!t.autoSelectSingle||t.disabled||!g(t.modelValue)||e.length!==1)return;const[a]=e;if(a.disabled)return;const u=t.multiple?[a.value]:a.value;s("update:modelValue",u),s("change",u)},{immediate:!0});function y(e,a){return`${String(e.value??e.label??"")}-${a}`}function h(e){s("update:modelValue",e)}function v(e){s("change",e)}function S(){s("clear")}function B(e){s("visible-change",e)}function C(e){s("focus",e)}function k(e){s("blur",e)}function V(){var e,a;(a=(e=r.value)==null?void 0:e.focus)==null||a.call(e)}function $(){var e,a;(a=(e=r.value)==null?void 0:e.blur)==null||a.call(e)}return f({focus:V,blur:$}),(e,a)=>(l.openBlock(),l.createBlock(l.unref(n.ElSelect),l.mergeProps({ref_key:"selectRef",ref:r},l.unref(c),{"model-value":e.modelValue,placeholder:e.placeholder,disabled:e.disabled,clearable:e.clearable,filterable:e.filterable,multiple:e.multiple,"collapse-tags":e.collapseTags,"collapse-tags-tooltip":e.collapseTagsTooltip,size:e.size,teleported:e.teleported,"fit-input-width":e.fitInputWidth,"popper-class":m.value,"append-to":e.appendTo,"onUpdate:modelValue":h,onChange:v,onClear:S,onVisibleChange:B,onFocus:C,onBlur:k}),l.createSlots({default:l.withCtx(()=>[b.value?l.renderSlot(e.$slots,"default",{key:0}):(l.openBlock(!0),l.createElementBlock(l.Fragment,{key:1},l.renderList(d.value,(u,w)=>(l.openBlock(),l.createBlock(l.unref(n.ElOption),{key:y(u,w),label:u.label,value:u.value,disabled:u.disabled},null,8,["label","value","disabled"]))),128))]),_:2},[e.$slots.prefix?{name:"prefix",fn:l.withCtx(()=>[l.renderSlot(e.$slots,"prefix")]),key:"0"}:void 0,e.$slots.empty?{name:"empty",fn:l.withCtx(()=>[l.renderSlot(e.$slots,"empty")]),key:"1"}:void 0,e.$slots.loading?{name:"loading",fn:l.withCtx(()=>[l.renderSlot(e.$slots,"loading")]),key:"2"}:void 0,e.$slots.tag?{name:"tag",fn:l.withCtx(u=>[l.renderSlot(e.$slots,"tag",l.normalizeProps(l.guardReactiveProps(u)))]),key:"3"}:void 0]),1040,["model-value","placeholder","disabled","clearable","filterable","multiple","collapse-tags","collapse-tags-tooltip","size","teleported","fit-input-width","popper-class","append-to"]))}});exports.default=T;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ElSelect as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as E, useAttrs as P, useSlots as F, ref as O, computed as n, Comment as R, watch as I, createBlock as p, openBlock as o, unref as f, mergeProps as U, createSlots as W, withCtx as u, renderSlot as d, createElementBlock as j, Fragment as q, renderList as D, normalizeProps as L, guardReactiveProps as M } from "vue";
|
|
2
|
+
import { ElSelect as N, ElOption as Q } from "element-plus";
|
|
3
|
+
const J = /* @__PURE__ */ E({
|
|
4
4
|
name: "QySelect",
|
|
5
5
|
inheritAttrs: !1,
|
|
6
6
|
__name: "index",
|
|
@@ -17,60 +17,85 @@ const M = S({
|
|
|
17
17
|
multiple: { type: Boolean, default: !1 },
|
|
18
18
|
collapseTags: { type: Boolean, default: !1 },
|
|
19
19
|
collapseTagsTooltip: { type: Boolean, default: !1 },
|
|
20
|
-
|
|
20
|
+
autoSelectSingle: { type: Boolean, default: !1 },
|
|
21
|
+
size: { default: "default" },
|
|
21
22
|
teleported: { type: Boolean, default: !0 },
|
|
22
23
|
appendTo: { default: "body" },
|
|
23
24
|
fitInputWidth: { type: Boolean, default: !0 },
|
|
24
25
|
popperClass: { default: "" }
|
|
25
26
|
},
|
|
26
27
|
emits: ["update:modelValue", "change", "clear", "visible-change", "focus", "blur"],
|
|
27
|
-
setup(
|
|
28
|
-
const
|
|
29
|
-
() => ["qy-select__popper",
|
|
30
|
-
),
|
|
31
|
-
() => (
|
|
28
|
+
setup(c, { expose: m, emit: b }) {
|
|
29
|
+
const a = c, s = b, y = P(), g = F(), r = O(null), h = n(
|
|
30
|
+
() => ["qy-select__popper", a.popperClass].filter(Boolean).join(" ")
|
|
31
|
+
), i = n(
|
|
32
|
+
() => (a.options || []).map((e) => ({
|
|
32
33
|
raw: e,
|
|
33
|
-
label: (e == null ? void 0 : e[
|
|
34
|
-
value: (e == null ? void 0 : e[
|
|
35
|
-
disabled: !!(e != null && e[
|
|
34
|
+
label: (e == null ? void 0 : e[a.labelKey]) ?? (e == null ? void 0 : e.label) ?? (e == null ? void 0 : e.value) ?? "",
|
|
35
|
+
value: (e == null ? void 0 : e[a.valueKey]) ?? (e == null ? void 0 : e.value) ?? (e == null ? void 0 : e.label),
|
|
36
|
+
disabled: !!(e != null && e[a.disabledKey])
|
|
36
37
|
}))
|
|
38
|
+
), v = n(() => {
|
|
39
|
+
const e = g.default;
|
|
40
|
+
return e ? e().some((l) => l.type !== R) : !1;
|
|
41
|
+
});
|
|
42
|
+
function B(e) {
|
|
43
|
+
return Array.isArray(e) ? e.length === 0 : e === "" || e === null || e === void 0;
|
|
44
|
+
}
|
|
45
|
+
I(
|
|
46
|
+
[
|
|
47
|
+
i,
|
|
48
|
+
() => a.modelValue,
|
|
49
|
+
() => a.autoSelectSingle,
|
|
50
|
+
() => a.disabled,
|
|
51
|
+
() => a.multiple
|
|
52
|
+
],
|
|
53
|
+
([e]) => {
|
|
54
|
+
if (!a.autoSelectSingle || a.disabled || !B(a.modelValue) || e.length !== 1) return;
|
|
55
|
+
const [l] = e;
|
|
56
|
+
if (l.disabled) return;
|
|
57
|
+
const t = a.multiple ? [l.value] : l.value;
|
|
58
|
+
s("update:modelValue", t), s("change", t);
|
|
59
|
+
},
|
|
60
|
+
{ immediate: !0 }
|
|
37
61
|
);
|
|
38
|
-
function
|
|
62
|
+
function S(e, l) {
|
|
39
63
|
return `${String(e.value ?? e.label ?? "")}-${l}`;
|
|
40
64
|
}
|
|
41
|
-
function
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
function B(e) {
|
|
45
|
-
a("change", e);
|
|
65
|
+
function C(e) {
|
|
66
|
+
s("update:modelValue", e);
|
|
46
67
|
}
|
|
47
|
-
function
|
|
48
|
-
|
|
68
|
+
function V(e) {
|
|
69
|
+
s("change", e);
|
|
49
70
|
}
|
|
50
|
-
function k(
|
|
51
|
-
|
|
71
|
+
function k() {
|
|
72
|
+
s("clear");
|
|
52
73
|
}
|
|
53
|
-
function
|
|
54
|
-
|
|
74
|
+
function $(e) {
|
|
75
|
+
s("visible-change", e);
|
|
55
76
|
}
|
|
56
77
|
function T(e) {
|
|
57
|
-
|
|
78
|
+
s("focus", e);
|
|
79
|
+
}
|
|
80
|
+
function K(e) {
|
|
81
|
+
s("blur", e);
|
|
58
82
|
}
|
|
59
|
-
function
|
|
83
|
+
function z() {
|
|
60
84
|
var e, l;
|
|
61
85
|
(l = (e = r.value) == null ? void 0 : e.focus) == null || l.call(e);
|
|
62
86
|
}
|
|
63
|
-
function
|
|
87
|
+
function w() {
|
|
64
88
|
var e, l;
|
|
65
89
|
(l = (e = r.value) == null ? void 0 : e.blur) == null || l.call(e);
|
|
66
90
|
}
|
|
67
|
-
return
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
91
|
+
return m({
|
|
92
|
+
// 仅暴露业务常用焦点方法,复杂下拉行为仍交给 Element Plus 自身处理。
|
|
93
|
+
focus: z,
|
|
94
|
+
blur: w
|
|
95
|
+
}), (e, l) => (o(), p(f(N), U({
|
|
71
96
|
ref_key: "selectRef",
|
|
72
97
|
ref: r
|
|
73
|
-
}, f(
|
|
98
|
+
}, f(y), {
|
|
74
99
|
"model-value": e.modelValue,
|
|
75
100
|
placeholder: e.placeholder,
|
|
76
101
|
disabled: e.disabled,
|
|
@@ -82,50 +107,50 @@ const M = S({
|
|
|
82
107
|
size: e.size,
|
|
83
108
|
teleported: e.teleported,
|
|
84
109
|
"fit-input-width": e.fitInputWidth,
|
|
85
|
-
"popper-class":
|
|
110
|
+
"popper-class": h.value,
|
|
86
111
|
"append-to": e.appendTo,
|
|
87
|
-
"onUpdate:modelValue":
|
|
88
|
-
onChange:
|
|
89
|
-
onClear:
|
|
90
|
-
onVisibleChange:
|
|
91
|
-
onFocus:
|
|
92
|
-
onBlur:
|
|
93
|
-
}),
|
|
94
|
-
default:
|
|
95
|
-
|
|
96
|
-
key:
|
|
97
|
-
label:
|
|
98
|
-
value:
|
|
99
|
-
disabled:
|
|
112
|
+
"onUpdate:modelValue": C,
|
|
113
|
+
onChange: V,
|
|
114
|
+
onClear: k,
|
|
115
|
+
onVisibleChange: $,
|
|
116
|
+
onFocus: T,
|
|
117
|
+
onBlur: K
|
|
118
|
+
}), W({
|
|
119
|
+
default: u(() => [
|
|
120
|
+
v.value ? d(e.$slots, "default", { key: 0 }) : (o(!0), j(q, { key: 1 }, D(i.value, (t, A) => (o(), p(f(Q), {
|
|
121
|
+
key: S(t, A),
|
|
122
|
+
label: t.label,
|
|
123
|
+
value: t.value,
|
|
124
|
+
disabled: t.disabled
|
|
100
125
|
}, null, 8, ["label", "value", "disabled"]))), 128))
|
|
101
126
|
]),
|
|
102
127
|
_: 2
|
|
103
128
|
}, [
|
|
104
129
|
e.$slots.prefix ? {
|
|
105
130
|
name: "prefix",
|
|
106
|
-
fn:
|
|
107
|
-
|
|
131
|
+
fn: u(() => [
|
|
132
|
+
d(e.$slots, "prefix")
|
|
108
133
|
]),
|
|
109
134
|
key: "0"
|
|
110
135
|
} : void 0,
|
|
111
136
|
e.$slots.empty ? {
|
|
112
137
|
name: "empty",
|
|
113
|
-
fn:
|
|
114
|
-
|
|
138
|
+
fn: u(() => [
|
|
139
|
+
d(e.$slots, "empty")
|
|
115
140
|
]),
|
|
116
141
|
key: "1"
|
|
117
142
|
} : void 0,
|
|
118
143
|
e.$slots.loading ? {
|
|
119
144
|
name: "loading",
|
|
120
|
-
fn:
|
|
121
|
-
|
|
145
|
+
fn: u(() => [
|
|
146
|
+
d(e.$slots, "loading")
|
|
122
147
|
]),
|
|
123
148
|
key: "2"
|
|
124
149
|
} : void 0,
|
|
125
150
|
e.$slots.tag ? {
|
|
126
151
|
name: "tag",
|
|
127
|
-
fn:
|
|
128
|
-
|
|
152
|
+
fn: u((t) => [
|
|
153
|
+
d(e.$slots, "tag", L(M(t)))
|
|
129
154
|
]),
|
|
130
155
|
key: "3"
|
|
131
156
|
} : void 0
|
|
@@ -133,5 +158,5 @@ const M = S({
|
|
|
133
158
|
}
|
|
134
159
|
});
|
|
135
160
|
export {
|
|
136
|
-
|
|
161
|
+
J as default
|
|
137
162
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./index.vue.cjs");exports.default=e.default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("vue"),k=require("../upload/index.vue.cjs"),S=Object.assign({name:"QyVoucherUpload",inheritAttrs:!1},{__name:"index",props:{modelValue:{type:Array,default:()=>[]},api:{type:String,default:"/permission-api/common/uploads"},name:{type:String,default:"files"},multiple:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},fileType:{type:Array,default:()=>[]},fileSize:{type:Number,default:10},limit:{type:Number,default:9},isShowTip:{type:Boolean,default:!1},tokenKey:{type:String,default:"Admin-Token"},supportVideo:{type:Boolean,default:!1},size:{type:String,default:"90px"},disableDrag:{type:Boolean,default:!1},callBack:{type:Function,default:null},extraData:{type:Object,default:()=>({})},pastePlaceholder:{type:String,default:"粘贴图片上传"}},emits:["update:modelValue","change","success","error","remove"],setup(t,{expose:r,emit:d}){const i=d,s=l.useAttrs(),n=l.ref(null);function o(e){return Array.isArray(e)?e:[]}function c(e){i("update:modelValue",o(e))}function f(e){const a=o(e==null?void 0:e.files);i("change",a)}function m(e){i("success",e)}function p(e){i("error",e)}function y(e,a){i("remove",e,a)}function h(){var e,a;(a=(e=n.value)==null?void 0:e.openFileDialog)==null||a.call(e)}function u(){var e,a;return((a=(e=n.value)==null?void 0:e.getPathList)==null?void 0:a.call(e))||[]}function g(){var e,a;(a=(e=n.value)==null?void 0:e.clearFiles)==null||a.call(e)}function b(){return u()}return r({openFileDialog:h,getPathList:u,clearFiles:g,getValue:b}),(e,a)=>(l.openBlock(),l.createBlock(k.default,l.mergeProps({ref_key:"uploadRef",ref:n},l.unref(s),{"model-value":t.modelValue,"value-format":"array",api:t.api,name:t.name,multiple:t.multiple,disabled:t.disabled,"file-type":t.fileType,"file-size":t.fileSize,limit:t.limit,"is-show-tip":t.isShowTip,"token-key":t.tokenKey,"support-video":t.supportVideo,size:t.size,"disable-drag":t.disableDrag,"call-back":t.callBack,"extra-data":t.extraData,"show-text":!1,"show-paste-input":!0,"paste-placeholder":t.pastePlaceholder,"onUpdate:modelValue":c,onChange:f,onSuccess:m,onError:p,onRemove:y}),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","paste-placeholder"]))}});exports.default=S;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { useAttrs as b, ref as k, createBlock as S, openBlock as V, mergeProps as x, unref as z } from "vue";
|
|
2
|
+
import B from "../upload/index.vue.mjs";
|
|
3
|
+
const w = /* @__PURE__ */ Object.assign({
|
|
4
|
+
name: "QyVoucherUpload",
|
|
5
|
+
inheritAttrs: !1
|
|
6
|
+
}, {
|
|
7
|
+
__name: "index",
|
|
8
|
+
props: {
|
|
9
|
+
/** 凭证图片 URL 数组。 */
|
|
10
|
+
modelValue: { type: Array, default: () => [] },
|
|
11
|
+
/** 上传接口路径。 */
|
|
12
|
+
api: { type: String, default: "/permission-api/common/uploads" },
|
|
13
|
+
/** 凭证上传沿用老业务字段名 files。 */
|
|
14
|
+
name: { type: String, default: "files" },
|
|
15
|
+
/** 是否多选。 */
|
|
16
|
+
multiple: { type: Boolean, default: !0 },
|
|
17
|
+
/** 是否禁用。 */
|
|
18
|
+
disabled: { type: Boolean, default: !1 },
|
|
19
|
+
/** 允许的文件类型后缀。 */
|
|
20
|
+
fileType: { type: Array, default: () => [] },
|
|
21
|
+
/** 单个文件大小限制(MB)。 */
|
|
22
|
+
fileSize: { type: Number, default: 10 },
|
|
23
|
+
/** 文件数量限制。 */
|
|
24
|
+
limit: { type: Number, default: 9 },
|
|
25
|
+
/** 是否显示格式/大小提示。 */
|
|
26
|
+
isShowTip: { type: Boolean, default: !1 },
|
|
27
|
+
/** token 读取 key。 */
|
|
28
|
+
tokenKey: { type: String, default: "Admin-Token" },
|
|
29
|
+
/** 是否支持视频模式。 */
|
|
30
|
+
supportVideo: { type: Boolean, default: !1 },
|
|
31
|
+
/** 凭证默认尺寸,贴近财审凭证里的紧凑图片格。 */
|
|
32
|
+
size: { type: String, default: "90px" },
|
|
33
|
+
/** 禁用拖拽。 */
|
|
34
|
+
disableDrag: { type: Boolean, default: !1 },
|
|
35
|
+
/** 成功回调。 */
|
|
36
|
+
callBack: { type: Function, default: null },
|
|
37
|
+
/** 上传时附加的额外 FormData 字段。 */
|
|
38
|
+
extraData: { type: Object, default: () => ({}) },
|
|
39
|
+
/** 凭证上传底部提示文案,默认对齐 CopyImgUpload 的旧交互。 */
|
|
40
|
+
pastePlaceholder: { type: String, default: "粘贴图片上传" }
|
|
41
|
+
},
|
|
42
|
+
emits: [
|
|
43
|
+
"update:modelValue",
|
|
44
|
+
"change",
|
|
45
|
+
"success",
|
|
46
|
+
"error",
|
|
47
|
+
"remove"
|
|
48
|
+
],
|
|
49
|
+
setup(a, { expose: u, emit: r }) {
|
|
50
|
+
const l = r, d = b(), i = k(null);
|
|
51
|
+
function n(e) {
|
|
52
|
+
return Array.isArray(e) ? e : [];
|
|
53
|
+
}
|
|
54
|
+
function s(e) {
|
|
55
|
+
l("update:modelValue", n(e));
|
|
56
|
+
}
|
|
57
|
+
function f(e) {
|
|
58
|
+
const t = n(e == null ? void 0 : e.files);
|
|
59
|
+
l("change", t);
|
|
60
|
+
}
|
|
61
|
+
function c(e) {
|
|
62
|
+
l("success", e);
|
|
63
|
+
}
|
|
64
|
+
function m(e) {
|
|
65
|
+
l("error", e);
|
|
66
|
+
}
|
|
67
|
+
function p(e, t) {
|
|
68
|
+
l("remove", e, t);
|
|
69
|
+
}
|
|
70
|
+
function y() {
|
|
71
|
+
var e, t;
|
|
72
|
+
(t = (e = i.value) == null ? void 0 : e.openFileDialog) == null || t.call(e);
|
|
73
|
+
}
|
|
74
|
+
function o() {
|
|
75
|
+
var e, t;
|
|
76
|
+
return ((t = (e = i.value) == null ? void 0 : e.getPathList) == null ? void 0 : t.call(e)) || [];
|
|
77
|
+
}
|
|
78
|
+
function h() {
|
|
79
|
+
var e, t;
|
|
80
|
+
(t = (e = i.value) == null ? void 0 : e.clearFiles) == null || t.call(e);
|
|
81
|
+
}
|
|
82
|
+
function g() {
|
|
83
|
+
return o();
|
|
84
|
+
}
|
|
85
|
+
return u({
|
|
86
|
+
openFileDialog: y,
|
|
87
|
+
getPathList: o,
|
|
88
|
+
clearFiles: h,
|
|
89
|
+
getValue: g
|
|
90
|
+
}), (e, t) => (V(), S(B, x({
|
|
91
|
+
ref_key: "uploadRef",
|
|
92
|
+
ref: i
|
|
93
|
+
}, z(d), {
|
|
94
|
+
"model-value": a.modelValue,
|
|
95
|
+
"value-format": "array",
|
|
96
|
+
api: a.api,
|
|
97
|
+
name: a.name,
|
|
98
|
+
multiple: a.multiple,
|
|
99
|
+
disabled: a.disabled,
|
|
100
|
+
"file-type": a.fileType,
|
|
101
|
+
"file-size": a.fileSize,
|
|
102
|
+
limit: a.limit,
|
|
103
|
+
"is-show-tip": a.isShowTip,
|
|
104
|
+
"token-key": a.tokenKey,
|
|
105
|
+
"support-video": a.supportVideo,
|
|
106
|
+
size: a.size,
|
|
107
|
+
"disable-drag": a.disableDrag,
|
|
108
|
+
"call-back": a.callBack,
|
|
109
|
+
"extra-data": a.extraData,
|
|
110
|
+
"show-text": !1,
|
|
111
|
+
"show-paste-input": !0,
|
|
112
|
+
"paste-placeholder": a.pastePlaceholder,
|
|
113
|
+
"onUpdate:modelValue": s,
|
|
114
|
+
onChange: f,
|
|
115
|
+
onSuccess: c,
|
|
116
|
+
onError: m,
|
|
117
|
+
onRemove: p
|
|
118
|
+
}), 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", "paste-placeholder"]));
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
export {
|
|
122
|
+
w as default
|
|
123
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=;/* empty css */;/* empty css */const t=require("../../_virtual/_plugin-vue_export-helper.cjs"),u=t.default(e.default,[["__scopeId","data-v-dd0a0a37"]]);exports.default=u;
|