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