@es-plus/vue3 1.4.0
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 +1279 -0
- package/dist/es-plus.js +2922 -0
- package/dist/es-plus.js.map +1 -0
- package/dist/es-plus.umd.cjs +2 -0
- package/dist/es-plus.umd.cjs.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/resolver.cjs +101 -0
- package/dist/resolver.d.ts +25 -0
- package/dist/resolver.mjs +78 -0
- package/dist/src/components/es-crud-page/index.d.ts +4 -0
- package/dist/src/components/es-crud-page/src/es-crud-page.vue.d.ts +78 -0
- package/dist/src/components/es-crud-page/src/types.d.ts +180 -0
- package/dist/src/components/es-dialog/index.d.ts +3 -0
- package/dist/src/components/es-dialog/src/component.vue.d.ts +60 -0
- package/dist/src/components/es-dialog/src/use-dialog.d.ts +16 -0
- package/dist/src/components/es-form/index.d.ts +3 -0
- package/dist/src/components/es-form/src/es-form.vue.d.ts +83 -0
- package/dist/src/components/es-table/index.d.ts +3 -0
- package/dist/src/components/es-table/src/column-item.vue.d.ts +82 -0
- package/dist/src/components/es-table/src/component.vue.d.ts +154 -0
- package/dist/src/components/es-table/src/engines/types.d.ts +25 -0
- package/dist/src/components/es-table/src/engines/use-column-adapter.d.ts +44 -0
- package/dist/src/components/es-table/src/engines/use-virtual-selection.d.ts +13 -0
- package/dist/src/components/es-table/src/engines/use-virtual-sort.d.ts +24 -0
- package/dist/src/components/es-table/src/engines/virtual-engine.vue.d.ts +63 -0
- package/dist/src/components/es-table/src/table-btns.vue.d.ts +19 -0
- package/dist/src/components/svg-icon/index.d.ts +3 -0
- package/dist/src/components/svg-icon/src/svg-icon.vue.d.ts +17 -0
- package/dist/src/composables/use-form-inputs.d.ts +12 -0
- package/dist/src/composables/use-form-layout.d.ts +51 -0
- package/dist/src/composables/use-form-request.d.ts +18 -0
- package/dist/src/composables/use-table-resize.d.ts +19 -0
- package/dist/src/composables/use-table-selection.d.ts +16 -0
- package/dist/src/config.d.ts +10 -0
- package/dist/src/index.d.ts +17 -0
- package/dist/src/resolver.d.ts +44 -0
- package/dist/src/style.d.ts +0 -0
- package/dist/src/types/index.d.ts +174 -0
- package/dist/src/utils/shared.d.ts +17 -0
- package/dist/style.css +1 -0
- package/package.json +90 -0
- package/schemas/README.md +83 -0
- package/schemas/api-params.schema.json +36 -0
- package/schemas/btn-config.schema.json +77 -0
- package/schemas/dialog-options.schema.json +149 -0
- package/schemas/form-item.schema.json +146 -0
- package/schemas/index.schema.json +71 -0
- package/schemas/table-column.schema.json +118 -0
- package/schemas/table-options.schema.json +141 -0
package/dist/es-plus.js
ADDED
|
@@ -0,0 +1,2922 @@
|
|
|
1
|
+
import { defineComponent as be, reactive as tt, onMounted as bt, onUpdated as Yt, h as U, isVNode as Jt, inject as ue, openBlock as S, createBlock as $, unref as b, normalizeProps as Be, mergeProps as ne, withCtx as z, createElementBlock as q, Fragment as ae, renderList as Se, createSlots as nt, renderSlot as Ee, computed as R, createElementVNode as G, toDisplayString as we, normalizeStyle as Re, createTextVNode as se, createCommentVNode as X, ref as A, toRef as Pt, createVNode as J, normalizeClass as ot, createStaticVNode as Xt, onBeforeUnmount as Zt, nextTick as Ue, useSlots as $t, getCurrentInstance as Ke, watch as Ie, useAttrs as jt, provide as ft, withDirectives as kt, toRaw as ze, render as pt, guardReactiveProps as qt, withModifiers as en, vShow as Nt } from "vue";
|
|
2
|
+
import { ElConfigProvider as Xe, ElTableColumn as Le, ElButton as ke, ElCheckbox as mt, ElIcon as gt, ElTooltip as tn, ElAutoResizer as nn, ElTableV2 as on, ElTable as ln, ElPagination as an, vLoading as rn, ElInput as ht, ElSelect as sn, ElOption as cn, ElDatePicker as un, ElTimePicker as dn, ElSlider as fn, ElColorPicker as pn, ElTransfer as mn, ElCascader as gn, ElRadioGroup as hn, ElRadio as yn, ElCheckboxGroup as vn, ElSwitch as bn, ElRate as kn, ElUpload as wn, ElForm as Sn, ElRow as xn, ElCol as Bt, ElFormItem as Je, ElDropdown as Et, ElDropdownMenu as Ot, ElDropdownItem as He, ElDialog as Cn, ElMessageBox as Tt } from "element-plus";
|
|
3
|
+
import * as yt from "@element-plus/icons-vue";
|
|
4
|
+
import { FullScreen as In, CopyDocument as Rn, Close as Fn } from "@element-plus/icons-vue";
|
|
5
|
+
const Pn = "1.4.0";
|
|
6
|
+
var qe = {
|
|
7
|
+
name: "zh-cn",
|
|
8
|
+
el: {
|
|
9
|
+
breadcrumb: { label: "面包屑" },
|
|
10
|
+
colorpicker: {
|
|
11
|
+
confirm: "确定",
|
|
12
|
+
clear: "清空",
|
|
13
|
+
defaultLabel: "颜色选择器",
|
|
14
|
+
description: "当前颜色 {color},按 Enter 键选择新颜色",
|
|
15
|
+
alphaLabel: "选择透明度的值",
|
|
16
|
+
alphaDescription: "透明度 {alpha}, 当前颜色 {color}",
|
|
17
|
+
hueLabel: "选择色相值",
|
|
18
|
+
hueDescription: "色相 {hue}, 当前颜色 {color}",
|
|
19
|
+
svLabel: "选择饱和度与明度的值",
|
|
20
|
+
svDescription: "饱和度 {saturation}, 明度 {brightness}, 当前颜色 {color}",
|
|
21
|
+
predefineDescription: "选择 {value} 作为颜色"
|
|
22
|
+
},
|
|
23
|
+
datepicker: {
|
|
24
|
+
now: "此刻",
|
|
25
|
+
today: "今天",
|
|
26
|
+
cancel: "取消",
|
|
27
|
+
clear: "清空",
|
|
28
|
+
confirm: "确定",
|
|
29
|
+
dateTablePrompt: "使用方向键与 Enter 键可选择日期",
|
|
30
|
+
monthTablePrompt: "使用方向键与 Enter 键可选择月份",
|
|
31
|
+
yearTablePrompt: "使用方向键与 Enter 键可选择年份",
|
|
32
|
+
selectedDate: "已选日期",
|
|
33
|
+
selectDate: "选择日期",
|
|
34
|
+
selectTime: "选择时间",
|
|
35
|
+
startDate: "开始日期",
|
|
36
|
+
startTime: "开始时间",
|
|
37
|
+
endDate: "结束日期",
|
|
38
|
+
endTime: "结束时间",
|
|
39
|
+
prevYear: "前一年",
|
|
40
|
+
nextYear: "后一年",
|
|
41
|
+
prevMonth: "上个月",
|
|
42
|
+
nextMonth: "下个月",
|
|
43
|
+
year: "年",
|
|
44
|
+
month1: "1 月",
|
|
45
|
+
month2: "2 月",
|
|
46
|
+
month3: "3 月",
|
|
47
|
+
month4: "4 月",
|
|
48
|
+
month5: "5 月",
|
|
49
|
+
month6: "6 月",
|
|
50
|
+
month7: "7 月",
|
|
51
|
+
month8: "8 月",
|
|
52
|
+
month9: "9 月",
|
|
53
|
+
month10: "10 月",
|
|
54
|
+
month11: "11 月",
|
|
55
|
+
month12: "12 月",
|
|
56
|
+
weeks: {
|
|
57
|
+
sun: "日",
|
|
58
|
+
mon: "一",
|
|
59
|
+
tue: "二",
|
|
60
|
+
wed: "三",
|
|
61
|
+
thu: "四",
|
|
62
|
+
fri: "五",
|
|
63
|
+
sat: "六"
|
|
64
|
+
},
|
|
65
|
+
weeksFull: {
|
|
66
|
+
sun: "星期日",
|
|
67
|
+
mon: "星期一",
|
|
68
|
+
tue: "星期二",
|
|
69
|
+
wed: "星期三",
|
|
70
|
+
thu: "星期四",
|
|
71
|
+
fri: "星期五",
|
|
72
|
+
sat: "星期六"
|
|
73
|
+
},
|
|
74
|
+
months: {
|
|
75
|
+
jan: "一月",
|
|
76
|
+
feb: "二月",
|
|
77
|
+
mar: "三月",
|
|
78
|
+
apr: "四月",
|
|
79
|
+
may: "五月",
|
|
80
|
+
jun: "六月",
|
|
81
|
+
jul: "七月",
|
|
82
|
+
aug: "八月",
|
|
83
|
+
sep: "九月",
|
|
84
|
+
oct: "十月",
|
|
85
|
+
nov: "十一月",
|
|
86
|
+
dec: "十二月"
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
inputNumber: {
|
|
90
|
+
decrease: "减少数值",
|
|
91
|
+
increase: "增加数值"
|
|
92
|
+
},
|
|
93
|
+
select: {
|
|
94
|
+
loading: "加载中",
|
|
95
|
+
noMatch: "无匹配数据",
|
|
96
|
+
noData: "无数据",
|
|
97
|
+
placeholder: "请选择"
|
|
98
|
+
},
|
|
99
|
+
mention: { loading: "加载中" },
|
|
100
|
+
dropdown: { toggleDropdown: "切换下拉选项" },
|
|
101
|
+
cascader: {
|
|
102
|
+
noMatch: "无匹配数据",
|
|
103
|
+
loading: "加载中",
|
|
104
|
+
placeholder: "请选择",
|
|
105
|
+
noData: "暂无数据"
|
|
106
|
+
},
|
|
107
|
+
pagination: {
|
|
108
|
+
goto: "前往",
|
|
109
|
+
pagesize: "条/页",
|
|
110
|
+
total: "共 {total} 条",
|
|
111
|
+
pageClassifier: "页",
|
|
112
|
+
page: "页",
|
|
113
|
+
prev: "上一页",
|
|
114
|
+
next: "下一页",
|
|
115
|
+
currentPage: "第 {pager} 页",
|
|
116
|
+
prevPages: "向前 {pager} 页",
|
|
117
|
+
nextPages: "向后 {pager} 页",
|
|
118
|
+
deprecationWarning: "你使用了一些已被废弃的用法,请参考 el-pagination 的官方文档"
|
|
119
|
+
},
|
|
120
|
+
dialog: { close: "关闭此对话框" },
|
|
121
|
+
drawer: { close: "关闭此对话框" },
|
|
122
|
+
messagebox: {
|
|
123
|
+
title: "提示",
|
|
124
|
+
confirm: "确定",
|
|
125
|
+
cancel: "取消",
|
|
126
|
+
error: "输入的数据不合法!",
|
|
127
|
+
close: "关闭此对话框"
|
|
128
|
+
},
|
|
129
|
+
upload: {
|
|
130
|
+
deleteTip: "按 Delete 键可删除",
|
|
131
|
+
delete: "删除",
|
|
132
|
+
preview: "查看图片",
|
|
133
|
+
continue: "继续上传"
|
|
134
|
+
},
|
|
135
|
+
slider: {
|
|
136
|
+
defaultLabel: "滑块介于 {min} 至 {max}",
|
|
137
|
+
defaultRangeStartLabel: "选择起始值",
|
|
138
|
+
defaultRangeEndLabel: "选择结束值"
|
|
139
|
+
},
|
|
140
|
+
table: {
|
|
141
|
+
emptyText: "暂无数据",
|
|
142
|
+
confirmFilter: "筛选",
|
|
143
|
+
resetFilter: "重置",
|
|
144
|
+
clearFilter: "全部",
|
|
145
|
+
sumText: "合计",
|
|
146
|
+
selectAllLabel: "选择所有行",
|
|
147
|
+
selectRowLabel: "选择当前行",
|
|
148
|
+
expandRowLabel: "展开当前行",
|
|
149
|
+
collapseRowLabel: "收起当前行",
|
|
150
|
+
sortLabel: "按 {column} 排序",
|
|
151
|
+
filterLabel: "按 {column} 过滤"
|
|
152
|
+
},
|
|
153
|
+
tag: { close: "关闭此标签" },
|
|
154
|
+
tour: {
|
|
155
|
+
next: "下一步",
|
|
156
|
+
previous: "上一步",
|
|
157
|
+
finish: "结束导览",
|
|
158
|
+
close: "关闭此对话框"
|
|
159
|
+
},
|
|
160
|
+
tree: { emptyText: "暂无数据" },
|
|
161
|
+
transfer: {
|
|
162
|
+
noMatch: "无匹配数据",
|
|
163
|
+
noData: "无数据",
|
|
164
|
+
titles: ["列表 1", "列表 2"],
|
|
165
|
+
filterPlaceholder: "请输入搜索内容",
|
|
166
|
+
noCheckedFormat: "共 {total} 项",
|
|
167
|
+
hasCheckedFormat: "已选 {checked}/{total} 项"
|
|
168
|
+
},
|
|
169
|
+
image: { error: "加载失败" },
|
|
170
|
+
pageHeader: { title: "返回" },
|
|
171
|
+
popconfirm: {
|
|
172
|
+
confirmButtonText: "确定",
|
|
173
|
+
cancelButtonText: "取消"
|
|
174
|
+
},
|
|
175
|
+
carousel: {
|
|
176
|
+
leftArrow: "上一张幻灯片",
|
|
177
|
+
rightArrow: "下一张幻灯片",
|
|
178
|
+
indicator: "幻灯片切换至索引 {index}"
|
|
179
|
+
},
|
|
180
|
+
inputOTP: {
|
|
181
|
+
groupLabel: "一次性密码输入框",
|
|
182
|
+
defaultLabel: "请输入第 {index} 位 OTP 字符"
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
const ut = be({
|
|
187
|
+
name: "RenderJsx",
|
|
188
|
+
props: {
|
|
189
|
+
refs: { type: [Function, Object], default: null },
|
|
190
|
+
row: { type: Object, default: () => ({}) },
|
|
191
|
+
render: { type: Function, default: () => {
|
|
192
|
+
} },
|
|
193
|
+
model: { type: Object, default: () => ({}) },
|
|
194
|
+
instance: { type: Object, default: () => ({}) },
|
|
195
|
+
components: { type: Object, default: () => ({}) },
|
|
196
|
+
locale: { type: Object, default: null }
|
|
197
|
+
},
|
|
198
|
+
setup(e) {
|
|
199
|
+
const r = e.refs && typeof e.refs == "object" ? e.refs : tt({});
|
|
200
|
+
function d(l) {
|
|
201
|
+
if (!l) return null;
|
|
202
|
+
if (typeof l == "function") return l;
|
|
203
|
+
if (l.r) {
|
|
204
|
+
if (typeof l.r == "function") return l.r;
|
|
205
|
+
if (l.r && typeof l.r == "object" && "value" in l.r) {
|
|
206
|
+
const s = l.r;
|
|
207
|
+
return (u) => {
|
|
208
|
+
s.value = u;
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
return null;
|
|
213
|
+
}
|
|
214
|
+
let t = null, o = null;
|
|
215
|
+
function n() {
|
|
216
|
+
if (!t) return;
|
|
217
|
+
const l = t.component;
|
|
218
|
+
if (!l) return;
|
|
219
|
+
const s = l.exposed || l.proxy;
|
|
220
|
+
s && (r.currentRef = s, typeof o == "function" && o(s));
|
|
221
|
+
}
|
|
222
|
+
return bt(() => n()), Yt(() => n()), () => {
|
|
223
|
+
var p;
|
|
224
|
+
const { instance: l } = e, s = {
|
|
225
|
+
...l,
|
|
226
|
+
registerRef: (w, c) => {
|
|
227
|
+
c != null && (r[w] = c);
|
|
228
|
+
},
|
|
229
|
+
getRefs: () => r
|
|
230
|
+
}, u = e.render(U, s, e.components || {}) || "";
|
|
231
|
+
return typeof u == "string" ? (t = null, U(Xe, {
|
|
232
|
+
locale: e.locale || qe
|
|
233
|
+
}, () => U("span", {
|
|
234
|
+
ref: (w) => {
|
|
235
|
+
r.currentRef = w;
|
|
236
|
+
}
|
|
237
|
+
}, u))) : Jt(u) ? typeof u.type != "string" ? (t = u, o = d(u.ref) || d((p = u.props) == null ? void 0 : p.ref), u) : (t = null, U(Xe, {
|
|
238
|
+
locale: e.locale || qe
|
|
239
|
+
}, () => U("div", {
|
|
240
|
+
ref: (c) => {
|
|
241
|
+
r.currentRef = c;
|
|
242
|
+
}
|
|
243
|
+
}, [u]))) : (t = null, U(Xe, {
|
|
244
|
+
locale: e.locale || qe
|
|
245
|
+
}, () => U(u, {
|
|
246
|
+
ref: (w) => {
|
|
247
|
+
r.currentRef = w;
|
|
248
|
+
}
|
|
249
|
+
})));
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
let vt = {};
|
|
254
|
+
function Bn(e) {
|
|
255
|
+
vt = { ...vt, ...e };
|
|
256
|
+
}
|
|
257
|
+
function Pe() {
|
|
258
|
+
return vt;
|
|
259
|
+
}
|
|
260
|
+
const En = { key: 1 }, On = { key: 1 }, Tn = { key: 1 }, Ln = { key: 1 }, Hn = /* @__PURE__ */ be({
|
|
261
|
+
__name: "column-item",
|
|
262
|
+
props: {
|
|
263
|
+
cols: {}
|
|
264
|
+
},
|
|
265
|
+
setup(e) {
|
|
266
|
+
const r = ue("$EsPlus", null) ?? Pe() ?? {}, d = be({
|
|
267
|
+
props: {
|
|
268
|
+
row: { type: Object, default: () => ({}) },
|
|
269
|
+
index: { type: Number, default: 0 },
|
|
270
|
+
dataKey: String,
|
|
271
|
+
render: { type: Function, required: !0 }
|
|
272
|
+
},
|
|
273
|
+
setup(n) {
|
|
274
|
+
return () => {
|
|
275
|
+
const { row: l, index: s, dataKey: u, render: p } = n;
|
|
276
|
+
if (!l) return U("span", "-");
|
|
277
|
+
const w = u ? l[u] : null;
|
|
278
|
+
try {
|
|
279
|
+
const c = p(U, { value: w, row: l, index: s });
|
|
280
|
+
return typeof c == "string" ? U("span", c) : c;
|
|
281
|
+
} catch {
|
|
282
|
+
return U("span", "-");
|
|
283
|
+
}
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
}), t = (n) => n.charAt(0).toUpperCase() + n.slice(1).toLowerCase(), o = (n) => {
|
|
287
|
+
const l = {};
|
|
288
|
+
for (const s in n)
|
|
289
|
+
if (!(s === "groups" || s === "scopedSlots" || s === "render"))
|
|
290
|
+
if (s.includes("-")) {
|
|
291
|
+
const u = s.split("-");
|
|
292
|
+
let p = u[0];
|
|
293
|
+
for (let w = 1; w < u.length; w++)
|
|
294
|
+
p += t(u[w]);
|
|
295
|
+
l[p] = n[s];
|
|
296
|
+
} else s === "key" ? (l.prop = n[s], l[s] = n[s]) : s === "label" && n.labelKey && typeof r.t == "function" ? l.label = r.t(n.labelKey) : l[s] = n[s];
|
|
297
|
+
return l.align || (l.align = "center"), l;
|
|
298
|
+
};
|
|
299
|
+
return (n, l) => e.cols.groups && Array.isArray(e.cols.groups) ? (S(), $(b(Le), Be(ne({ key: 0 }, o(e.cols))), {
|
|
300
|
+
default: z(() => [
|
|
301
|
+
(S(!0), q(ae, null, Se(e.cols.groups, (s, u) => (S(), $(b(Le), ne({
|
|
302
|
+
key: s.prop || s.key || u
|
|
303
|
+
}, { ref_for: !0 }, o({ ...s, columnIndex: u })), nt({ _: 2 }, [
|
|
304
|
+
s.render && typeof s.render == "function" ? {
|
|
305
|
+
name: "default",
|
|
306
|
+
fn: z((p) => [
|
|
307
|
+
p && p.row ? (S(), $(b(d), {
|
|
308
|
+
key: 0,
|
|
309
|
+
row: p.row,
|
|
310
|
+
index: p.$index,
|
|
311
|
+
"data-key": s.key,
|
|
312
|
+
render: s.render
|
|
313
|
+
}, null, 8, ["row", "index", "data-key", "render"])) : (S(), q("span", En, "-"))
|
|
314
|
+
]),
|
|
315
|
+
key: "0"
|
|
316
|
+
} : s.scopedSlots && s.scopedSlots.customRender ? {
|
|
317
|
+
name: "default",
|
|
318
|
+
fn: z((p) => [
|
|
319
|
+
p && p.row ? Ee(n.$slots, s.scopedSlots.customRender, ne({
|
|
320
|
+
key: 0,
|
|
321
|
+
ref_for: !0
|
|
322
|
+
}, { ...s, row: p.row, column: p.column, scope: p })) : (S(), q("span", On, "-"))
|
|
323
|
+
]),
|
|
324
|
+
key: "1"
|
|
325
|
+
} : void 0
|
|
326
|
+
]), 1040))), 128))
|
|
327
|
+
]),
|
|
328
|
+
_: 3
|
|
329
|
+
}, 16)) : e.cols.render && typeof e.cols.render == "function" ? (S(), $(b(Le), Be(ne({ key: 1 }, o(e.cols))), {
|
|
330
|
+
default: z((s) => [
|
|
331
|
+
s && s.row ? (S(), $(b(d), {
|
|
332
|
+
key: 0,
|
|
333
|
+
row: s.row,
|
|
334
|
+
index: s.$index,
|
|
335
|
+
"data-key": e.cols.key,
|
|
336
|
+
render: e.cols.render
|
|
337
|
+
}, null, 8, ["row", "index", "data-key", "render"])) : (S(), q("span", Tn, "-"))
|
|
338
|
+
]),
|
|
339
|
+
_: 1
|
|
340
|
+
}, 16)) : e.cols.scopedSlots && e.cols.scopedSlots.customRender ? (S(), $(b(Le), Be(ne({ key: 2 }, o(e.cols))), {
|
|
341
|
+
default: z((s) => [
|
|
342
|
+
s && s.row ? Ee(n.$slots, e.cols.scopedSlots.customRender, Be(ne({ key: 0 }, { ...e.cols, row: s.row, column: s.column, scope: s }))) : (S(), q("span", Ln, "-"))
|
|
343
|
+
]),
|
|
344
|
+
_: 3
|
|
345
|
+
}, 16)) : e.cols.ellipsis && typeof e.cols.ellipsis == "boolean" ? (S(), $(b(Le), ne({
|
|
346
|
+
key: 3,
|
|
347
|
+
"show-overflow-tooltip": ""
|
|
348
|
+
}, o(e.cols)), null, 16)) : (S(), $(b(Le), Be(ne({ key: 4 }, o(e.cols))), null, 16));
|
|
349
|
+
}
|
|
350
|
+
}), zn = {
|
|
351
|
+
key: 0,
|
|
352
|
+
class: "flex-float btns"
|
|
353
|
+
}, _n = { class: "left-text" }, Dn = { class: "btn-container_block" }, Vn = { class: "btn-left" }, An = { class: "btn-right" }, $n = /* @__PURE__ */ be({
|
|
354
|
+
__name: "table-btns",
|
|
355
|
+
props: {
|
|
356
|
+
leftText: {},
|
|
357
|
+
btnConfig: {},
|
|
358
|
+
instance: {}
|
|
359
|
+
},
|
|
360
|
+
setup(e) {
|
|
361
|
+
const r = e, d = (c) => {
|
|
362
|
+
if (!c.render || typeof c.render != "function") return null;
|
|
363
|
+
try {
|
|
364
|
+
return c.render();
|
|
365
|
+
} catch {
|
|
366
|
+
return null;
|
|
367
|
+
}
|
|
368
|
+
};
|
|
369
|
+
d.props = {
|
|
370
|
+
render: { type: Function, required: !0 }
|
|
371
|
+
};
|
|
372
|
+
const t = ue("$EsPlus", null) ?? Pe() ?? {}, o = (c, y) => {
|
|
373
|
+
if (!y) return !0;
|
|
374
|
+
const a = t.permission;
|
|
375
|
+
return typeof a == "function" ? a(y) : !0;
|
|
376
|
+
}, n = (c) => c.map((y) => {
|
|
377
|
+
const a = { ...y };
|
|
378
|
+
return o([], y.permissionValue) ? typeof y.isHide == "function" ? a.isHide = y.isHide() : a.isHide = y.isHide || !1 : a.isHide = !0, a;
|
|
379
|
+
}), l = R(() => n((r.btnConfig || []).filter((c) => c.code === 1)).filter((c) => !c.isHide)), s = R(() => n((r.btnConfig || []).filter((c) => c.code === 2)).filter((c) => !c.isHide)), u = R(() => r.leftText || l.value.length > 0 || s.value.length > 0), p = (c) => typeof c.disabled == "function" ? c.disabled() : c.disabled || !1, w = (c) => ({
|
|
380
|
+
display: "inline-block",
|
|
381
|
+
marginLeft: c !== 0 ? "8px" : "0px"
|
|
382
|
+
});
|
|
383
|
+
return (c, y) => u.value ? (S(), q("div", zn, [
|
|
384
|
+
G("div", _n, we(e.leftText), 1),
|
|
385
|
+
G("div", Dn, [
|
|
386
|
+
G("div", Vn, [
|
|
387
|
+
(S(!0), q(ae, null, Se(l.value, (a, x) => (S(), q(ae, {
|
|
388
|
+
key: a.name
|
|
389
|
+
}, [
|
|
390
|
+
a.isHide ? X("", !0) : (S(), q("div", {
|
|
391
|
+
key: 0,
|
|
392
|
+
style: Re(w(x))
|
|
393
|
+
}, [
|
|
394
|
+
a.render && typeof a.render == "function" ? (S(), $(d, {
|
|
395
|
+
key: 0,
|
|
396
|
+
render: a.render
|
|
397
|
+
}, null, 8, ["render"])) : (S(), $(b(ke), ne({
|
|
398
|
+
key: 1,
|
|
399
|
+
type: a.type,
|
|
400
|
+
size: a.size || "small",
|
|
401
|
+
icon: a.icon,
|
|
402
|
+
loading: a.loading || !1
|
|
403
|
+
}, { ref_for: !0 }, a, {
|
|
404
|
+
disabled: p(a),
|
|
405
|
+
onClick: () => a.click(e.instance)
|
|
406
|
+
}), {
|
|
407
|
+
default: z(() => [
|
|
408
|
+
se(we(a.name), 1)
|
|
409
|
+
]),
|
|
410
|
+
_: 2
|
|
411
|
+
}, 1040, ["type", "size", "icon", "loading", "disabled", "onClick"]))
|
|
412
|
+
], 4))
|
|
413
|
+
], 64))), 128))
|
|
414
|
+
]),
|
|
415
|
+
G("div", An, [
|
|
416
|
+
(S(!0), q(ae, null, Se(s.value, (a, x) => (S(), q(ae, {
|
|
417
|
+
key: a.name
|
|
418
|
+
}, [
|
|
419
|
+
a.isHide ? X("", !0) : (S(), q("div", {
|
|
420
|
+
key: 0,
|
|
421
|
+
style: Re(w(x))
|
|
422
|
+
}, [
|
|
423
|
+
a.render && typeof a.render == "function" ? (S(), $(d, {
|
|
424
|
+
key: 0,
|
|
425
|
+
render: a.render
|
|
426
|
+
}, null, 8, ["render"])) : (S(), $(b(ke), ne({
|
|
427
|
+
key: 1,
|
|
428
|
+
type: a.type,
|
|
429
|
+
size: a.size || "small"
|
|
430
|
+
}, { ref_for: !0 }, a, {
|
|
431
|
+
icon: a.icon,
|
|
432
|
+
loading: a.loading || !1,
|
|
433
|
+
disabled: p(a),
|
|
434
|
+
onClick: () => a.click(e.instance)
|
|
435
|
+
}), {
|
|
436
|
+
default: z(() => [
|
|
437
|
+
se(we(a.name), 1)
|
|
438
|
+
]),
|
|
439
|
+
_: 2
|
|
440
|
+
}, 1040, ["type", "size", "icon", "loading", "disabled", "onClick"]))
|
|
441
|
+
], 4))
|
|
442
|
+
], 64))), 128))
|
|
443
|
+
])
|
|
444
|
+
])
|
|
445
|
+
])) : X("", !0);
|
|
446
|
+
}
|
|
447
|
+
}), De = (e, r) => {
|
|
448
|
+
const d = e.__vccOpts || e;
|
|
449
|
+
for (const [t, o] of r)
|
|
450
|
+
d[t] = o;
|
|
451
|
+
return d;
|
|
452
|
+
}, jn = /* @__PURE__ */ De($n, [["__scopeId", "data-v-8f7dddb8"]]), dt = 150;
|
|
453
|
+
function qn(e, r) {
|
|
454
|
+
return R(() => {
|
|
455
|
+
const d = [], t = e.value.some((l) => l.type === "selection"), o = e.value.some((l) => l.type === "index"), n = e.value.some((l) => l.type === "expand");
|
|
456
|
+
r.multiSelect && !t && d.push(Ht(r)), r.expand && !n && d.push(_t(r)), r.snIndex && !o && d.push(zt());
|
|
457
|
+
for (const l of e.value) {
|
|
458
|
+
if (l.type === "selection") {
|
|
459
|
+
d.push(Ht(r, l));
|
|
460
|
+
continue;
|
|
461
|
+
}
|
|
462
|
+
if (l.type === "index") {
|
|
463
|
+
d.push(zt(l));
|
|
464
|
+
continue;
|
|
465
|
+
}
|
|
466
|
+
if (l.type === "expand") {
|
|
467
|
+
d.push(_t(r, l));
|
|
468
|
+
continue;
|
|
469
|
+
}
|
|
470
|
+
if (l.groups && l.groups.length > 0)
|
|
471
|
+
for (const s of l.groups)
|
|
472
|
+
d.push(Lt(s, r));
|
|
473
|
+
else
|
|
474
|
+
d.push(Lt(l, r));
|
|
475
|
+
}
|
|
476
|
+
return d;
|
|
477
|
+
});
|
|
478
|
+
}
|
|
479
|
+
function Lt(e, r) {
|
|
480
|
+
var l;
|
|
481
|
+
const d = e.prop || e.key || "", t = e.labelKey && r.t ? r.t(e.labelKey) : e.label || "", o = typeof e.width == "number" ? e.width : typeof e.width == "string" ? parseInt(e.width, 10) || dt : typeof e.minWidth == "number" ? e.minWidth : typeof e.minWidth == "string" && parseInt(e.minWidth, 10) || dt, n = {
|
|
482
|
+
key: d,
|
|
483
|
+
dataKey: d,
|
|
484
|
+
title: t,
|
|
485
|
+
width: o,
|
|
486
|
+
align: e.align || "center"
|
|
487
|
+
};
|
|
488
|
+
return e.fixed && (n.fixed = e.fixed === !0 ? "left" : e.fixed), e.sortable && (n.sortable = !0), e.render ? n.cellRenderer = Nn(e) : (l = e.scopedSlots) != null && l.customRender && r.parentSlots ? n.cellRenderer = Un(e, r.parentSlots) : e.ellipsis ? n.cellRenderer = Kn(e) : e.formatter && (n.cellRenderer = Mn(e)), n;
|
|
489
|
+
}
|
|
490
|
+
function Ht(e, r) {
|
|
491
|
+
const d = typeof (r == null ? void 0 : r.width) == "number" ? r.width : typeof (r == null ? void 0 : r.width) == "string" && parseInt(r.width, 10) || 50, t = (r == null ? void 0 : r.fixed) != null ? r.fixed === !0 ? "left" : r.fixed : "left";
|
|
492
|
+
return {
|
|
493
|
+
key: "__selection__",
|
|
494
|
+
dataKey: "__selection__",
|
|
495
|
+
title: "",
|
|
496
|
+
width: d,
|
|
497
|
+
fixed: t,
|
|
498
|
+
align: "center",
|
|
499
|
+
cellRenderer: ({ rowData: o }) => {
|
|
500
|
+
const n = String(o[e.rowkey] ?? ""), l = e.selectedKeys.value.has(n);
|
|
501
|
+
return U(mt, {
|
|
502
|
+
modelValue: l,
|
|
503
|
+
"onUpdate:modelValue": (s) => e.onSelectRow(n, s),
|
|
504
|
+
onClick: (s) => s.stopPropagation()
|
|
505
|
+
});
|
|
506
|
+
},
|
|
507
|
+
headerCellRenderer: () => U(mt, {
|
|
508
|
+
modelValue: e.allSelected.value,
|
|
509
|
+
indeterminate: e.indeterminate.value,
|
|
510
|
+
"onUpdate:modelValue": (o) => e.onSelectAll(o)
|
|
511
|
+
})
|
|
512
|
+
};
|
|
513
|
+
}
|
|
514
|
+
function zt(e) {
|
|
515
|
+
return {
|
|
516
|
+
key: "__index__",
|
|
517
|
+
dataKey: "__index__",
|
|
518
|
+
title: (e == null ? void 0 : e.label) || "#",
|
|
519
|
+
width: typeof (e == null ? void 0 : e.width) == "number" ? e.width : 60,
|
|
520
|
+
align: "center",
|
|
521
|
+
cellRenderer: ({ rowIndex: r }) => U("span", String(r + 1))
|
|
522
|
+
};
|
|
523
|
+
}
|
|
524
|
+
function _t(e, r) {
|
|
525
|
+
return {
|
|
526
|
+
key: "__expand__",
|
|
527
|
+
dataKey: "__expand__",
|
|
528
|
+
title: (r == null ? void 0 : r.label) || "",
|
|
529
|
+
width: typeof (r == null ? void 0 : r.width) == "number" ? r.width : 50,
|
|
530
|
+
fixed: "left",
|
|
531
|
+
align: "center",
|
|
532
|
+
cellRenderer: ({ rowData: d }) => {
|
|
533
|
+
var n;
|
|
534
|
+
const t = String(d[e.rowkey] ?? ""), o = ((n = e.expandedKeys) == null ? void 0 : n.value.has(t)) ?? !1;
|
|
535
|
+
return U("span", {
|
|
536
|
+
class: ["es-virtual-expand-icon", o ? "is-expanded" : ""],
|
|
537
|
+
style: {
|
|
538
|
+
cursor: "pointer",
|
|
539
|
+
display: "inline-flex",
|
|
540
|
+
alignItems: "center",
|
|
541
|
+
transition: "transform 0.2s",
|
|
542
|
+
transform: o ? "rotate(90deg)" : "rotate(0deg)"
|
|
543
|
+
},
|
|
544
|
+
onClick: (l) => {
|
|
545
|
+
var s;
|
|
546
|
+
l.stopPropagation(), (s = e.onToggleExpand) == null || s.call(e, t);
|
|
547
|
+
}
|
|
548
|
+
}, U(gt, { size: 14 }, () => U("svg", {
|
|
549
|
+
viewBox: "0 0 1024 1024",
|
|
550
|
+
width: "1em",
|
|
551
|
+
height: "1em"
|
|
552
|
+
}, U("path", {
|
|
553
|
+
fill: "currentColor",
|
|
554
|
+
d: "M384 192v640l384-320z"
|
|
555
|
+
}))));
|
|
556
|
+
}
|
|
557
|
+
};
|
|
558
|
+
}
|
|
559
|
+
function Nn(e) {
|
|
560
|
+
return ({ cellData: r, rowData: d, rowIndex: t }) => {
|
|
561
|
+
const o = e.render;
|
|
562
|
+
return o(U, { value: r, row: d, index: t });
|
|
563
|
+
};
|
|
564
|
+
}
|
|
565
|
+
function Un(e, r) {
|
|
566
|
+
const d = e.scopedSlots.customRender;
|
|
567
|
+
return ({ cellData: t, rowData: o, rowIndex: n }) => {
|
|
568
|
+
const l = r[d];
|
|
569
|
+
return l ? l({ row: o, column: e, scope: { row: o, $index: n }, value: t }) : U("span", String(t ?? ""));
|
|
570
|
+
};
|
|
571
|
+
}
|
|
572
|
+
function Kn(e) {
|
|
573
|
+
return ({ cellData: r, rowData: d }) => {
|
|
574
|
+
let t;
|
|
575
|
+
if (e.formatter) {
|
|
576
|
+
const o = e.formatter;
|
|
577
|
+
t = String(o(d, e, r, 0) ?? "");
|
|
578
|
+
} else
|
|
579
|
+
t = String(r ?? "");
|
|
580
|
+
return U(tn, { content: t, placement: "top", showAfter: 300 }, {
|
|
581
|
+
default: () => U("div", {
|
|
582
|
+
style: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }
|
|
583
|
+
}, t)
|
|
584
|
+
});
|
|
585
|
+
};
|
|
586
|
+
}
|
|
587
|
+
function Mn(e) {
|
|
588
|
+
const r = e.formatter;
|
|
589
|
+
return ({ cellData: d, rowData: t, rowIndex: o }) => {
|
|
590
|
+
const n = r(t, e, d, o);
|
|
591
|
+
return U("span", String(n ?? ""));
|
|
592
|
+
};
|
|
593
|
+
}
|
|
594
|
+
function Wn(e, r) {
|
|
595
|
+
const d = A(/* @__PURE__ */ new Set()), t = R(() => e.value.length === 0 ? !1 : d.value.size === e.value.length), o = R(() => {
|
|
596
|
+
const c = d.value.size;
|
|
597
|
+
return c > 0 && c < e.value.length;
|
|
598
|
+
});
|
|
599
|
+
function n(c, y) {
|
|
600
|
+
const a = new Set(d.value);
|
|
601
|
+
y ? a.add(c) : a.delete(c), d.value = a;
|
|
602
|
+
}
|
|
603
|
+
function l(c) {
|
|
604
|
+
if (c) {
|
|
605
|
+
const y = new Set(d.value);
|
|
606
|
+
for (const a of e.value)
|
|
607
|
+
y.add(String(a[r] ?? ""));
|
|
608
|
+
d.value = y;
|
|
609
|
+
} else
|
|
610
|
+
d.value = /* @__PURE__ */ new Set();
|
|
611
|
+
}
|
|
612
|
+
function s() {
|
|
613
|
+
const c = d.value;
|
|
614
|
+
if (c.size === 0) return [];
|
|
615
|
+
const y = [];
|
|
616
|
+
for (const a of e.value)
|
|
617
|
+
if (c.has(String(a[r] ?? "")) && y.push(a), y.length === c.size) break;
|
|
618
|
+
return y;
|
|
619
|
+
}
|
|
620
|
+
function u() {
|
|
621
|
+
d.value = /* @__PURE__ */ new Set();
|
|
622
|
+
}
|
|
623
|
+
function p(c, y) {
|
|
624
|
+
const a = String(c[r] ?? "");
|
|
625
|
+
y === void 0 ? n(a, !d.value.has(a)) : n(a, y);
|
|
626
|
+
}
|
|
627
|
+
function w(c) {
|
|
628
|
+
d.value = new Set(c);
|
|
629
|
+
}
|
|
630
|
+
return {
|
|
631
|
+
selectedKeys: d,
|
|
632
|
+
allSelected: t,
|
|
633
|
+
indeterminate: o,
|
|
634
|
+
onSelectRow: n,
|
|
635
|
+
onSelectAll: l,
|
|
636
|
+
getSelectedRows: s,
|
|
637
|
+
clearSelection: u,
|
|
638
|
+
toggleRowSelection: p,
|
|
639
|
+
restoreSelections: w
|
|
640
|
+
};
|
|
641
|
+
}
|
|
642
|
+
function Qn() {
|
|
643
|
+
const e = A(void 0);
|
|
644
|
+
function r({ key: t, order: o }) {
|
|
645
|
+
var l, s;
|
|
646
|
+
const n = String(t);
|
|
647
|
+
((l = e.value) == null ? void 0 : l.key) === n && ((s = e.value) == null ? void 0 : s.order) === o ? e.value = void 0 : e.value = { key: n, order: o };
|
|
648
|
+
}
|
|
649
|
+
function d(t) {
|
|
650
|
+
var s, u;
|
|
651
|
+
const o = ((s = e.value) == null ? void 0 : s.key) || "", n = ((u = e.value) == null ? void 0 : u.order) || "";
|
|
652
|
+
return {
|
|
653
|
+
column: t.find((p) => (p.prop || p.key) === o) || null,
|
|
654
|
+
prop: o,
|
|
655
|
+
order: n === "asc" ? "ascending" : n === "desc" ? "descending" : null
|
|
656
|
+
};
|
|
657
|
+
}
|
|
658
|
+
return { sortState: e, onColumnSort: r, toSortChangePayload: d };
|
|
659
|
+
}
|
|
660
|
+
const Gn = { class: "es-virtual-table-wrapper" }, Yn = {
|
|
661
|
+
key: 0,
|
|
662
|
+
class: "es-virtual-table__empty"
|
|
663
|
+
}, Jn = 50, Xn = /* @__PURE__ */ be({
|
|
664
|
+
__name: "virtual-engine",
|
|
665
|
+
props: {
|
|
666
|
+
columns: {},
|
|
667
|
+
dataSource: {},
|
|
668
|
+
tableHeight: {},
|
|
669
|
+
options: {},
|
|
670
|
+
parentSlots: {}
|
|
671
|
+
},
|
|
672
|
+
emits: ["sort-change", "selection-change", "row-click", "row-dblclick", "row-contextmenu", "expand-change"],
|
|
673
|
+
setup(e, { expose: r, emit: d }) {
|
|
674
|
+
const t = e, o = d, n = A(null), l = ue("$EsPlus", null) ?? Pe() ?? {}, s = R(() => l.t || void 0), u = R(() => t.options.rowkey || "id"), p = Pt(t, "dataSource"), w = Pt(t, "columns"), {
|
|
675
|
+
selectedKeys: c,
|
|
676
|
+
allSelected: y,
|
|
677
|
+
indeterminate: a,
|
|
678
|
+
onSelectRow: x,
|
|
679
|
+
onSelectAll: _,
|
|
680
|
+
getSelectedRows: O,
|
|
681
|
+
clearSelection: C,
|
|
682
|
+
toggleRowSelection: j
|
|
683
|
+
} = Wn(p, u.value), { sortState: W, onColumnSort: Q, toSortChangePayload: Y } = Qn(), ee = A(/* @__PURE__ */ new Set());
|
|
684
|
+
function ie(P) {
|
|
685
|
+
const V = new Set(ee.value), K = t.dataSource.find((N) => String(N[u.value] ?? "") === P);
|
|
686
|
+
V.has(P) ? (V.delete(P), K && o("expand-change", K, !1)) : (V.add(P), K && o("expand-change", K, !0)), ee.value = V;
|
|
687
|
+
}
|
|
688
|
+
let te = null;
|
|
689
|
+
function oe() {
|
|
690
|
+
te && clearTimeout(te), te = setTimeout(() => {
|
|
691
|
+
o("selection-change", O());
|
|
692
|
+
}, 0);
|
|
693
|
+
}
|
|
694
|
+
const fe = qn(w, {
|
|
695
|
+
multiSelect: !!t.options.multiSelect,
|
|
696
|
+
snIndex: !!t.options.snIndex,
|
|
697
|
+
expand: !!t.options.expand,
|
|
698
|
+
selectedKeys: c,
|
|
699
|
+
allSelected: y,
|
|
700
|
+
indeterminate: a,
|
|
701
|
+
onSelectAll: (P) => {
|
|
702
|
+
_(P), oe();
|
|
703
|
+
},
|
|
704
|
+
onSelectRow: (P, V) => {
|
|
705
|
+
x(P, V), oe();
|
|
706
|
+
},
|
|
707
|
+
rowkey: u.value,
|
|
708
|
+
parentSlots: t.parentSlots,
|
|
709
|
+
t: s.value,
|
|
710
|
+
expandedKeys: ee,
|
|
711
|
+
onToggleExpand: ie
|
|
712
|
+
}), m = R(() => {
|
|
713
|
+
const P = ["es-virtual-table"];
|
|
714
|
+
return t.options.border && P.push("es-virtual-table--border"), t.options.stripe && P.push("es-virtual-table--stripe"), t.options.highlightCurrentRow && P.push("es-virtual-table--highlight"), P.join(" ");
|
|
715
|
+
}), f = A(""), h = R(() => ({ rowData: P, rowIndex: V }) => {
|
|
716
|
+
const K = [];
|
|
717
|
+
t.options.highlightCurrentRow && String(P[u.value] ?? "") === f.value && K.push("current-row");
|
|
718
|
+
const N = t.options.rowClassName;
|
|
719
|
+
if (typeof N == "function") {
|
|
720
|
+
const ce = N({ row: P, rowIndex: V });
|
|
721
|
+
ce && K.push(ce);
|
|
722
|
+
} else typeof N == "string" && N && K.push(N);
|
|
723
|
+
return K.join(" ");
|
|
724
|
+
}), D = R(() => ({
|
|
725
|
+
onClick: (P) => {
|
|
726
|
+
const V = String(P.rowData[u.value] ?? "");
|
|
727
|
+
f.value = V, o("row-click", P.rowData, P.event);
|
|
728
|
+
},
|
|
729
|
+
onDblclick: (P) => {
|
|
730
|
+
o("row-dblclick", P.rowData, P.event);
|
|
731
|
+
},
|
|
732
|
+
onContextmenu: (P) => {
|
|
733
|
+
o("row-contextmenu", P.rowData, P.event);
|
|
734
|
+
}
|
|
735
|
+
}));
|
|
736
|
+
function T(P) {
|
|
737
|
+
Q(P);
|
|
738
|
+
const V = Y(t.columns);
|
|
739
|
+
o("sort-change", V);
|
|
740
|
+
}
|
|
741
|
+
return r({
|
|
742
|
+
getTableRef: () => n.value,
|
|
743
|
+
doLayout: () => {
|
|
744
|
+
},
|
|
745
|
+
toggleRowSelection: j,
|
|
746
|
+
clearSelection: C,
|
|
747
|
+
getSelectedRows: O,
|
|
748
|
+
scrollToRow: (P) => {
|
|
749
|
+
var V, K;
|
|
750
|
+
(K = (V = n.value) == null ? void 0 : V.scrollToRow) == null || K.call(V, P);
|
|
751
|
+
}
|
|
752
|
+
}), (P, V) => (S(), q("div", Gn, [
|
|
753
|
+
J(b(nn), { "disable-height": !0 }, {
|
|
754
|
+
default: z(({ width: K }) => [
|
|
755
|
+
J(b(on), {
|
|
756
|
+
ref_key: "tableV2Ref",
|
|
757
|
+
ref: n,
|
|
758
|
+
columns: b(fe),
|
|
759
|
+
data: e.dataSource,
|
|
760
|
+
width: K || 800,
|
|
761
|
+
height: e.tableHeight || 400,
|
|
762
|
+
"row-height": e.options.rowHeight || 50,
|
|
763
|
+
"estimated-row-height": e.options.estimatedRowHeight,
|
|
764
|
+
cache: e.options.overscanCount || 2,
|
|
765
|
+
"row-key": e.options.rowkey || "id",
|
|
766
|
+
"sort-by": b(W),
|
|
767
|
+
"header-height": Jn,
|
|
768
|
+
class: ot(m.value),
|
|
769
|
+
"row-class": h.value,
|
|
770
|
+
"row-event-handlers": D.value,
|
|
771
|
+
onColumnSort: T
|
|
772
|
+
}, null, 8, ["columns", "data", "width", "height", "row-height", "estimated-row-height", "cache", "row-key", "sort-by", "class", "row-class", "row-event-handlers", "onColumnSort"])
|
|
773
|
+
]),
|
|
774
|
+
_: 1
|
|
775
|
+
}),
|
|
776
|
+
!e.dataSource || e.dataSource.length === 0 ? (S(), q("div", Yn, [
|
|
777
|
+
Ee(P.$slots, "empty", {}, () => [
|
|
778
|
+
V[0] || (V[0] = Xt('<div class="ant-empty ant-empty-normal"><div class="ant-empty-image"><svg class="ant-empty-img-simple" width="64" height="41" viewBox="0 0 64 41" xmlns="http://www.w3.org/2000/svg"><g transform="translate(0 1)" fill="none" fill-rule="evenodd"><ellipse class="ant-empty-img-simple-ellipse" cx="32" cy="33" rx="32" ry="7"></ellipse><g class="ant-empty-img-simple-g" fill-rule="nonzero"><path d="M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"></path><path d="M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z" class="ant-empty-img-simple-path"></path></g></g></svg></div><div class="ant-empty-description">暂无数据</div></div>', 1))
|
|
779
|
+
])
|
|
780
|
+
])) : X("", !0)
|
|
781
|
+
]));
|
|
782
|
+
}
|
|
783
|
+
});
|
|
784
|
+
function Zn(e, r, d, t, o) {
|
|
785
|
+
const n = A(400), l = A(null), s = (y) => Math.sign(y) === -1, u = () => {
|
|
786
|
+
var _, O, C, j;
|
|
787
|
+
const y = ((_ = r.value) == null ? void 0 : _.offsetHeight) || 0, a = ((C = (O = d.value) == null ? void 0 : O.$el) == null ? void 0 : C.offsetHeight) || 0, x = ((j = t.value) == null ? void 0 : j.offsetHeight) || 0;
|
|
788
|
+
return Math.round(x + y + a);
|
|
789
|
+
}, p = () => {
|
|
790
|
+
var Y, ee, ie, te, oe;
|
|
791
|
+
const y = e.value;
|
|
792
|
+
if (!y) return;
|
|
793
|
+
const a = typeof o.tabHeight == "number" ? o.tabHeight : o.heightType === "height" ? ((Y = y.parentElement) == null ? void 0 : Y.offsetHeight) || y.offsetHeight : parseInt(o.tabHeight, 10) || 450, x = isNaN(a) ? 450 : a, _ = x - u(), O = s(_) ? u() + 300 : x, C = ((ee = t.value) == null ? void 0 : ee.offsetHeight) || 0, j = ((ie = r.value) == null ? void 0 : ie.offsetHeight) || 0, W = ((oe = (te = d.value) == null ? void 0 : te.$el) == null ? void 0 : oe.offsetHeight) || 0, Q = Math.floor(O) - Math.round(C + j + W);
|
|
794
|
+
n.value !== Q && (n.value = Q);
|
|
795
|
+
}, w = () => {
|
|
796
|
+
Ue(() => {
|
|
797
|
+
if (!e.value || typeof ResizeObserver > "u") return;
|
|
798
|
+
l.value = new ResizeObserver(() => {
|
|
799
|
+
requestAnimationFrame(() => {
|
|
800
|
+
e.value && p();
|
|
801
|
+
});
|
|
802
|
+
});
|
|
803
|
+
const y = o.heightType === "height" && e.value.parentElement || e.value;
|
|
804
|
+
l.value.observe(y), r.value && l.value.observe(r.value);
|
|
805
|
+
});
|
|
806
|
+
}, c = () => {
|
|
807
|
+
l.value && (l.value.disconnect(), l.value = null);
|
|
808
|
+
};
|
|
809
|
+
return bt(() => w()), Zt(() => c()), {
|
|
810
|
+
tableHeight: n,
|
|
811
|
+
resizeObservers: p,
|
|
812
|
+
startObserver: w,
|
|
813
|
+
stopObserver: c
|
|
814
|
+
};
|
|
815
|
+
}
|
|
816
|
+
function eo(e) {
|
|
817
|
+
const r = A([]), d = A({}), t = A(!1), o = (u, p) => {
|
|
818
|
+
if (e) {
|
|
819
|
+
if (t.value) return;
|
|
820
|
+
d.value[p] = u;
|
|
821
|
+
let w = [];
|
|
822
|
+
const c = {};
|
|
823
|
+
Object.values(d.value).forEach((y) => {
|
|
824
|
+
y.forEach((a) => {
|
|
825
|
+
const x = a[e];
|
|
826
|
+
x && !c[x] && (w.push(a), c[x] = !0);
|
|
827
|
+
});
|
|
828
|
+
}), r.value = w;
|
|
829
|
+
} else
|
|
830
|
+
r.value = u;
|
|
831
|
+
}, n = (u, p) => {
|
|
832
|
+
if (u != null && u.length && e && r.value.length) {
|
|
833
|
+
const w = [];
|
|
834
|
+
u.forEach((c) => {
|
|
835
|
+
r.value.forEach((y) => {
|
|
836
|
+
c[e] === y[e] && w.push(c);
|
|
837
|
+
});
|
|
838
|
+
}), w.forEach((c) => {
|
|
839
|
+
var y;
|
|
840
|
+
(y = p.toggleRowSelection) == null || y.call(p, c, !0);
|
|
841
|
+
});
|
|
842
|
+
}
|
|
843
|
+
};
|
|
844
|
+
return {
|
|
845
|
+
multipleSelection: r,
|
|
846
|
+
selectionsByPage: d,
|
|
847
|
+
isInitChange: t,
|
|
848
|
+
handleSelectionChange: o,
|
|
849
|
+
handleSelectData: n,
|
|
850
|
+
clearAllSelection: (u) => {
|
|
851
|
+
var p;
|
|
852
|
+
r.value = [], d.value = {}, (p = u.clearSelection) == null || p.call(u);
|
|
853
|
+
},
|
|
854
|
+
initSelection: (u, p) => {
|
|
855
|
+
if (t.value = !0, !p) {
|
|
856
|
+
t.value = !1;
|
|
857
|
+
return;
|
|
858
|
+
}
|
|
859
|
+
e ? Ue(() => {
|
|
860
|
+
n(u, p), t.value = !1;
|
|
861
|
+
}) : Ue(() => {
|
|
862
|
+
var w;
|
|
863
|
+
(w = p.clearSelection) == null || w.call(p), t.value = !1;
|
|
864
|
+
});
|
|
865
|
+
}
|
|
866
|
+
};
|
|
867
|
+
}
|
|
868
|
+
const re = (e) => typeof e == "object" && e !== null && Object.prototype.toString.call(e) === "[object Object]", wt = (e, r, d = 0) => {
|
|
869
|
+
if (d > 3 || !re(e)) return;
|
|
870
|
+
const t = Object.prototype.hasOwnProperty.call(e, r) ? e[r] : void 0;
|
|
871
|
+
for (const o in e)
|
|
872
|
+
if (Object.prototype.hasOwnProperty.call(e, o) && re(e[o])) {
|
|
873
|
+
const n = wt(e[o], r, d + 1);
|
|
874
|
+
if (n !== void 0) return n;
|
|
875
|
+
}
|
|
876
|
+
return t;
|
|
877
|
+
}, to = (e) => e.then((r) => ({ status: "fulfilled", value: r })).catch((r) => ({ status: "rejected", reason: r })), no = { class: "table_containers" }, oo = {
|
|
878
|
+
"element-loading-background": "rgba(0, 0, 0, 0.03)",
|
|
879
|
+
"element-loading-text": "努力加载中...",
|
|
880
|
+
class: "page-loading-con tableContainer"
|
|
881
|
+
}, lo = { class: "table_inner_containers" }, Dt = {
|
|
882
|
+
multiSelect: !1,
|
|
883
|
+
expand: !1,
|
|
884
|
+
snIndex: !1,
|
|
885
|
+
loading: !1,
|
|
886
|
+
border: !1,
|
|
887
|
+
size: "small",
|
|
888
|
+
headerCellStyle: { background: "#f5f7fa" },
|
|
889
|
+
highlightCurrentRow: !0,
|
|
890
|
+
cachePageSelection: !0
|
|
891
|
+
}, ao = /* @__PURE__ */ be({
|
|
892
|
+
__name: "component",
|
|
893
|
+
props: {
|
|
894
|
+
initTabHeight: { default: 400 },
|
|
895
|
+
headBarClass: {},
|
|
896
|
+
showHeaderBar: { type: Boolean, default: !0 },
|
|
897
|
+
dataSource: { default: () => [] },
|
|
898
|
+
columns: { default: () => [] },
|
|
899
|
+
options: { default: () => ({ ...Dt }) },
|
|
900
|
+
pagination: { default: () => ({}) }
|
|
901
|
+
},
|
|
902
|
+
emits: ["update:dataSource", "update:pagination", "pagination-current-change", "size-change", "change-table-sort"],
|
|
903
|
+
setup(e, { expose: r, emit: d }) {
|
|
904
|
+
const t = e, o = d, n = $t(), l = A(qe), s = ue("elLocale", null);
|
|
905
|
+
s && (l.value = s);
|
|
906
|
+
const u = Ke(), p = ue("$esPlusTable", null) ?? Pe().EsTable ?? {}, w = ue("$EsPlus", null) ?? Pe() ?? {}, c = (i) => {
|
|
907
|
+
if (!i) return !0;
|
|
908
|
+
const B = w.permission;
|
|
909
|
+
return typeof B == "function" ? B(i) : !0;
|
|
910
|
+
}, y = R(
|
|
911
|
+
() => t.options.virtual === !0 || t.options.engine === "virtual"
|
|
912
|
+
), a = A(null), x = A(null), _ = A(null), O = A(null), C = A(null), j = A(null), W = A(`table_${Math.random().toString(36).substring(2, 12)}`), Q = A([]), Y = A([...t.columns]);
|
|
913
|
+
Ie(
|
|
914
|
+
() => t.columns,
|
|
915
|
+
(i) => {
|
|
916
|
+
Y.value = [...i];
|
|
917
|
+
},
|
|
918
|
+
{ deep: !0 }
|
|
919
|
+
);
|
|
920
|
+
const ee = A(!1), ie = A(!1), te = A(!1), oe = (i) => {
|
|
921
|
+
i && (j.value = i);
|
|
922
|
+
}, fe = ue("bodyFormInstance", () => {
|
|
923
|
+
}), m = ue("getVisibleShow", !1), f = R(() => typeof m == "function" ? m() : m), h = A({
|
|
924
|
+
pageSize: 10,
|
|
925
|
+
current: 1,
|
|
926
|
+
total: 0,
|
|
927
|
+
pageSizes: [],
|
|
928
|
+
size: "small",
|
|
929
|
+
isSmall: !0,
|
|
930
|
+
...t.pagination
|
|
931
|
+
}), D = A(null), T = R(() => t.options.entryQuery && re(t.options.entryQuery) && Object.keys(t.options.entryQuery).length ? t.options.entryQuery : {}), P = R(() => {
|
|
932
|
+
if (t.options.configTableOut && re(t.options.configTableOut) && Object.keys(t.options.configTableOut).length && k(t.options.configTableOut))
|
|
933
|
+
return t.options.configTableOut;
|
|
934
|
+
if (p != null && p.configQueryFieldOutput && typeof p.configQueryFieldOutput == "function") {
|
|
935
|
+
const i = p.configQueryFieldOutput({
|
|
936
|
+
total: "records",
|
|
937
|
+
pageSize: "pageSize",
|
|
938
|
+
current: "pageNo",
|
|
939
|
+
tableData: "rows"
|
|
940
|
+
});
|
|
941
|
+
if (k(i)) return i;
|
|
942
|
+
}
|
|
943
|
+
return {
|
|
944
|
+
total: "records",
|
|
945
|
+
pageSize: "pageSize",
|
|
946
|
+
current: "pageNo",
|
|
947
|
+
tableData: "rows"
|
|
948
|
+
};
|
|
949
|
+
}), V = R(() => {
|
|
950
|
+
var v, E, L, le;
|
|
951
|
+
const B = (((E = (v = u == null ? void 0 : u.slots) == null ? void 0 : v.default) == null ? void 0 : E.call(v)) || []).find((me) => {
|
|
952
|
+
const ge = me.type;
|
|
953
|
+
return (ge == null ? void 0 : ge.name) === "EsForm" || (ge == null ? void 0 : ge.displayName) === "EsForm";
|
|
954
|
+
});
|
|
955
|
+
return B && ((L = B.props) != null && L.ref) && (D.value = (le = B.ctx) == null ? void 0 : le.refs[B.props.ref], fe(D.value)), B || {};
|
|
956
|
+
}), K = R(() => {
|
|
957
|
+
var i;
|
|
958
|
+
return !!((i = n.default) != null && i.call(n));
|
|
959
|
+
}), N = R(() => t.options.heightType || "auto"), ce = R(() => typeof t.options.tabHeight == "number" ? `${t.options.tabHeight}px` : N.value === "height" && typeof t.options.height == "number" ? `${t.options.height}px` : "100%"), pe = R(() => t.headBarClass ? {
|
|
960
|
+
type: typeof t.headBarClass == "string" ? "string" : "object",
|
|
961
|
+
value: t.headBarClass
|
|
962
|
+
} : { type: "string", value: "" }), Oe = R(() => {
|
|
963
|
+
const i = p == null ? void 0 : p.paginationLayout;
|
|
964
|
+
return i ? typeof i == "function" ? i() : i : null;
|
|
965
|
+
}), lt = R(() => {
|
|
966
|
+
var i;
|
|
967
|
+
return ((i = Oe.value) == null ? void 0 : i.layout) || "prev, pager, next, jumper, sizes, ->, total";
|
|
968
|
+
}), at = R(() => {
|
|
969
|
+
var i;
|
|
970
|
+
return ((i = Oe.value) == null ? void 0 : i.pageSizes) || h.value.pageSizes;
|
|
971
|
+
}), rt = R(() => {
|
|
972
|
+
var i;
|
|
973
|
+
return ((i = Oe.value) == null ? void 0 : i.isSmall) ?? h.value.isSmall;
|
|
974
|
+
}), Me = R(() => {
|
|
975
|
+
var i;
|
|
976
|
+
return ((i = Oe.value) == null ? void 0 : i.background) ?? !0;
|
|
977
|
+
}), st = R(() => t.options.loading || ee.value), Ve = R(() => !!t.options.actionUrl || t.options.apiParams && re(t.options.apiParams) && Object.keys(t.options.apiParams).length > 0);
|
|
978
|
+
R(() => {
|
|
979
|
+
var i;
|
|
980
|
+
return !!((i = t.options) != null && i.httpRequest) && typeof t.options.httpRequest == "function";
|
|
981
|
+
});
|
|
982
|
+
const Ae = R(() => {
|
|
983
|
+
const i = Y.value.filter((v) => !v.hidCol);
|
|
984
|
+
if (i.forEach((v) => {
|
|
985
|
+
v.prop !== "operate" && v.key !== "operate" && (v.prop || v.key) && !v.formatter && (v.formatter = (E) => {
|
|
986
|
+
const L = E[v.prop] || E[v.key];
|
|
987
|
+
return L == null || L === "" ? v.emptyPlaceholder || "-" : L;
|
|
988
|
+
}), (v.prop === "operate" || v.key === "operate") && v.btns && !v.render && (v.render = (E, { row: L }) => {
|
|
989
|
+
var le;
|
|
990
|
+
return U("div", [
|
|
991
|
+
(le = v.btns) == null ? void 0 : le.filter((me) => c(me.permissionValue)).map(
|
|
992
|
+
(me) => U(ke, {
|
|
993
|
+
onClick: () => {
|
|
994
|
+
var ge;
|
|
995
|
+
return (ge = me.clickEvent) == null ? void 0 : ge.call(me, L);
|
|
996
|
+
},
|
|
997
|
+
text: !0,
|
|
998
|
+
type: me.type || "primary"
|
|
999
|
+
}, () => me.name)
|
|
1000
|
+
)
|
|
1001
|
+
]);
|
|
1002
|
+
});
|
|
1003
|
+
}), i.length > 0 && i.every((v) => v.width && !v.minWidth)) {
|
|
1004
|
+
let v = -1;
|
|
1005
|
+
for (let E = i.length - 1; E >= 0; E--) {
|
|
1006
|
+
const L = i[E];
|
|
1007
|
+
if (!L.fixed && L.prop !== "operate" && L.key !== "operate") {
|
|
1008
|
+
v = E;
|
|
1009
|
+
break;
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
1012
|
+
if (v === -1 && (v = i.length - 1), v >= 0) {
|
|
1013
|
+
const E = i[v];
|
|
1014
|
+
E.minWidth = E.width, delete E.width;
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
return i;
|
|
1018
|
+
}), it = /* @__PURE__ */ new Set([
|
|
1019
|
+
"multiSelect",
|
|
1020
|
+
"expand",
|
|
1021
|
+
"snIndex",
|
|
1022
|
+
"loading",
|
|
1023
|
+
"cachePageSelection",
|
|
1024
|
+
"httpRequest",
|
|
1025
|
+
"configTableOut",
|
|
1026
|
+
"listenToCallBack",
|
|
1027
|
+
"apiParams",
|
|
1028
|
+
"actionUrl",
|
|
1029
|
+
"heightType",
|
|
1030
|
+
"tabHeight",
|
|
1031
|
+
"isInitRun",
|
|
1032
|
+
"entryQuery",
|
|
1033
|
+
"configBtn",
|
|
1034
|
+
"leftText",
|
|
1035
|
+
"rowkey",
|
|
1036
|
+
"virtual",
|
|
1037
|
+
"engine",
|
|
1038
|
+
"rowHeight",
|
|
1039
|
+
"estimatedRowHeight",
|
|
1040
|
+
"overscanCount",
|
|
1041
|
+
"rowClassName"
|
|
1042
|
+
]), ct = R(() => {
|
|
1043
|
+
const i = Wt({ ...Dt, ...t.options }), { align: B, ...v } = i, E = {};
|
|
1044
|
+
for (const L in v)
|
|
1045
|
+
it.has(L) || (E[L] = v[L]);
|
|
1046
|
+
return E;
|
|
1047
|
+
}), We = jt(), Qe = R(() => {
|
|
1048
|
+
const i = { ...ct.value, ...We };
|
|
1049
|
+
return t.options.rowkey && (i.rowKey = t.options.rowkey), N.value === "height" ? i.height = $e.value : N.value === "maxHeight" && (i.maxHeight = $e.value), i;
|
|
1050
|
+
}), { tableHeight: $e } = Zn(
|
|
1051
|
+
j,
|
|
1052
|
+
O,
|
|
1053
|
+
_,
|
|
1054
|
+
C,
|
|
1055
|
+
{ heightType: N.value, tabHeight: t.options.tabHeight }
|
|
1056
|
+
);
|
|
1057
|
+
Ie(
|
|
1058
|
+
f,
|
|
1059
|
+
async (i, B) => {
|
|
1060
|
+
var v, E;
|
|
1061
|
+
i && i !== B && (t.options.actionUrl && await Z(), (E = (v = x.value) == null ? void 0 : v.doLayout) == null || E.call(v));
|
|
1062
|
+
}
|
|
1063
|
+
), Ie(
|
|
1064
|
+
() => t.pagination,
|
|
1065
|
+
(i) => {
|
|
1066
|
+
h.value = { ...h.value, ...i }, te.value = i.total !== void 0;
|
|
1067
|
+
},
|
|
1068
|
+
{ deep: !0, immediate: !0 }
|
|
1069
|
+
), Ie(
|
|
1070
|
+
() => t.dataSource,
|
|
1071
|
+
(i) => {
|
|
1072
|
+
Fe(i, x.value);
|
|
1073
|
+
},
|
|
1074
|
+
{ deep: !0 }
|
|
1075
|
+
), Ie(
|
|
1076
|
+
Q,
|
|
1077
|
+
(i) => {
|
|
1078
|
+
Array.isArray(i) && o("update:dataSource", i);
|
|
1079
|
+
},
|
|
1080
|
+
{ deep: !0 }
|
|
1081
|
+
), bt(() => {
|
|
1082
|
+
Ve.value && t.options.isInitRun !== !1 && Z();
|
|
1083
|
+
});
|
|
1084
|
+
const { multipleSelection: Ge, handleSelectionChange: Ye, initSelection: Fe, clearAllSelection: je } = eo(t.options.rowkey), g = (i) => {
|
|
1085
|
+
Ye(i, h.value.current || 1);
|
|
1086
|
+
}, I = (i) => {
|
|
1087
|
+
Ye(i, h.value.current || 1);
|
|
1088
|
+
}, k = (i) => {
|
|
1089
|
+
const B = ["total", "pageSize", "current", "tableData"];
|
|
1090
|
+
return re(i) ? Object.keys(i).every((v) => B.find((E) => E === v) && i[v] && typeof i[v] == "string") : !1;
|
|
1091
|
+
}, M = (i, B) => {
|
|
1092
|
+
const v = [
|
|
1093
|
+
{ eventName: "brcb", isReturn: !0 },
|
|
1094
|
+
{ eventName: "qrcb", isReturn: !0 }
|
|
1095
|
+
], E = v.findIndex((L) => L.eventName === i);
|
|
1096
|
+
if (t.options.listenToCallBack && t.options.listenToCallBack[i] && E !== -1 && v[E].isReturn)
|
|
1097
|
+
return t.options.listenToCallBack[i](B);
|
|
1098
|
+
}, F = (i, B) => {
|
|
1099
|
+
re(P.value) && Object.keys(P.value).length && Object.entries(P.value).forEach(([v, E]) => {
|
|
1100
|
+
if (!B.includes(v)) return;
|
|
1101
|
+
const le = i[E] ?? wt(i, E);
|
|
1102
|
+
v === "tableData" ? Q.value = Array.isArray(le) ? le : [] : h.value[v] = typeof le == "number" ? le : parseInt(le, 10) || 0;
|
|
1103
|
+
});
|
|
1104
|
+
}, H = (i, B = {}) => {
|
|
1105
|
+
var Rt, Ft;
|
|
1106
|
+
const { success: v, fail: E } = B, L = ((Rt = t.options) == null ? void 0 : Rt.apiParams) || {}, le = ((Ft = t.options) == null ? void 0 : Ft.actionUrl) || L.url || "";
|
|
1107
|
+
if (!le || !Object.keys(L).length) return;
|
|
1108
|
+
const me = Object.keys(V.value).length ? ze(b(V.value.props.model)) : T.value || {}, ge = M("brcb", { ...me, ...i, ...ze(b(L.model || {})) }), xt = re(ge) ? ge : { ...me, ...ze(b(L.model || {})), ...i }, Ct = { ...ze(b(L.options || {})) };
|
|
1109
|
+
L != null && L.method && (Ct.method = L == null ? void 0 : L.method);
|
|
1110
|
+
const It = async (Qt) => {
|
|
1111
|
+
if (!ee.value) {
|
|
1112
|
+
ee.value = !0, console.log("formData///", xt);
|
|
1113
|
+
try {
|
|
1114
|
+
const Te = await Qt({
|
|
1115
|
+
url: le,
|
|
1116
|
+
formParams: xt,
|
|
1117
|
+
headers: L.headers || {},
|
|
1118
|
+
...Ct,
|
|
1119
|
+
...i
|
|
1120
|
+
}), Gt = M("qrcb", Te) || Te;
|
|
1121
|
+
re(Te) && Object.keys(Te).length && typeof v == "function" && v(Gt);
|
|
1122
|
+
} catch (Te) {
|
|
1123
|
+
typeof E == "function" && E(Te);
|
|
1124
|
+
} finally {
|
|
1125
|
+
ee.value = !1;
|
|
1126
|
+
}
|
|
1127
|
+
}
|
|
1128
|
+
};
|
|
1129
|
+
t.options.httpRequest ? It(t.options.httpRequest) : p.$httpRequest && It(p.$httpRequest);
|
|
1130
|
+
}, Z = (i) => new Promise((B, v) => {
|
|
1131
|
+
h.value.current = 1, H(
|
|
1132
|
+
{ ...i || {}, pageIndex: h.value.current, pageSize: h.value.pageSize },
|
|
1133
|
+
{
|
|
1134
|
+
success: (E) => {
|
|
1135
|
+
F(E, ["total", "tableData"]), Object.keys(t.pagination).length && o("update:pagination", h.value), B(E);
|
|
1136
|
+
},
|
|
1137
|
+
fail: (E) => {
|
|
1138
|
+
v(E);
|
|
1139
|
+
}
|
|
1140
|
+
}
|
|
1141
|
+
);
|
|
1142
|
+
}), xe = () => {
|
|
1143
|
+
H(
|
|
1144
|
+
{ pageIndex: h.value.current, pageSize: h.value.pageSize },
|
|
1145
|
+
{
|
|
1146
|
+
success: (i) => {
|
|
1147
|
+
F(i, ["total", "tableData"]), o("update:pagination", h.value), o("pagination-current-change", h.value);
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
);
|
|
1151
|
+
}, Ce = () => {
|
|
1152
|
+
H(
|
|
1153
|
+
{ pageIndex: h.value.current, pageSize: h.value.pageSize },
|
|
1154
|
+
{
|
|
1155
|
+
success: (i) => {
|
|
1156
|
+
F(i, ["total", "tableData"]), o("update:pagination", h.value);
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
1159
|
+
);
|
|
1160
|
+
}, Ut = (i) => {
|
|
1161
|
+
h.value.pageSize = i, h.value.current = 1, Ve.value ? Ce() : (o("update:pagination", h.value), o("size-change", h.value, i));
|
|
1162
|
+
}, Kt = (i) => {
|
|
1163
|
+
h.value.current = i, Ve.value ? (console.log("indexPages//", i), xe()) : (o("update:pagination", h.value), o("pagination-current-change", h.value));
|
|
1164
|
+
}, St = (i) => {
|
|
1165
|
+
o("change-table-sort", i);
|
|
1166
|
+
}, Mt = (i) => i.toLowerCase().replace(/(\s|^)[a-z]/g, (B) => B.toUpperCase()), Wt = (i) => {
|
|
1167
|
+
const B = {};
|
|
1168
|
+
for (const v in i)
|
|
1169
|
+
if (!(v === "groups" || v === "scopedSlots" || v === "render"))
|
|
1170
|
+
if (v.includes("-")) {
|
|
1171
|
+
const E = v.split("-");
|
|
1172
|
+
let L = E[0];
|
|
1173
|
+
for (let le = 1; le < E.length; le++)
|
|
1174
|
+
L += Mt(E[le]);
|
|
1175
|
+
B[L] = i[v];
|
|
1176
|
+
} else v === "key" && (B.prop = i[v]), B[v] = i[v];
|
|
1177
|
+
return B.align || (B.align = "center"), B;
|
|
1178
|
+
};
|
|
1179
|
+
return ft("getTableInstantce", () => ({
|
|
1180
|
+
...(u == null ? void 0 : u.setupState) || {},
|
|
1181
|
+
tableRef: y.value ? a : x,
|
|
1182
|
+
toggleSelection: (i) => {
|
|
1183
|
+
var B, v;
|
|
1184
|
+
y.value ? i ? i.forEach((E) => {
|
|
1185
|
+
var L;
|
|
1186
|
+
(L = a.value) == null || L.toggleRowSelection(E, !0);
|
|
1187
|
+
}) : (B = a.value) == null || B.clearSelection() : i ? i.forEach((E) => {
|
|
1188
|
+
var L;
|
|
1189
|
+
(L = x.value) == null || L.toggleRowSelection(E);
|
|
1190
|
+
}) : (v = x.value) == null || v.clearSelection();
|
|
1191
|
+
},
|
|
1192
|
+
clearAllSelection: () => {
|
|
1193
|
+
var i;
|
|
1194
|
+
return y.value ? (i = a.value) == null ? void 0 : i.clearSelection() : je(x.value);
|
|
1195
|
+
},
|
|
1196
|
+
refsInstance: () => {
|
|
1197
|
+
var i;
|
|
1198
|
+
return y.value ? (i = a.value) == null ? void 0 : i.getTableRef() : x.value;
|
|
1199
|
+
},
|
|
1200
|
+
httpRequestInstance: Z
|
|
1201
|
+
})), r({
|
|
1202
|
+
httpRequestInstance: Z,
|
|
1203
|
+
getSelectionRows: () => {
|
|
1204
|
+
var i;
|
|
1205
|
+
return y.value ? ((i = a.value) == null ? void 0 : i.getSelectedRows()) ?? [] : Ge.value;
|
|
1206
|
+
},
|
|
1207
|
+
clearSelection: () => {
|
|
1208
|
+
var i, B, v;
|
|
1209
|
+
return y.value ? (i = a.value) == null ? void 0 : i.clearSelection() : (v = (B = x.value) == null ? void 0 : B.clearSelection) == null ? void 0 : v.call(B);
|
|
1210
|
+
},
|
|
1211
|
+
clearAllSelection: () => {
|
|
1212
|
+
var i;
|
|
1213
|
+
return y.value ? (i = a.value) == null ? void 0 : i.clearSelection() : je(x.value);
|
|
1214
|
+
},
|
|
1215
|
+
refresh: () => {
|
|
1216
|
+
var i, B, v;
|
|
1217
|
+
return y.value ? (i = a.value) == null ? void 0 : i.doLayout() : (v = (B = x.value) == null ? void 0 : B.doLayout) == null ? void 0 : v.call(B);
|
|
1218
|
+
},
|
|
1219
|
+
scrollToRow: (i) => {
|
|
1220
|
+
var B;
|
|
1221
|
+
return (B = a.value) == null ? void 0 : B.scrollToRow(i);
|
|
1222
|
+
}
|
|
1223
|
+
}), (i, B) => (S(), $(b(Xe), { locale: l.value }, {
|
|
1224
|
+
default: z(() => [
|
|
1225
|
+
G("div", {
|
|
1226
|
+
ref: oe,
|
|
1227
|
+
class: "table_component",
|
|
1228
|
+
style: Re({ [N.value]: ce.value })
|
|
1229
|
+
}, [
|
|
1230
|
+
G("div", no, [
|
|
1231
|
+
e.showHeaderBar ? (S(), q("div", {
|
|
1232
|
+
key: 0,
|
|
1233
|
+
ref_key: "headBarRef",
|
|
1234
|
+
ref: O,
|
|
1235
|
+
class: ot(["btn-slot", pe.value.type === "string" ? pe.value.value : { slotClass: ie.value && pe.value.type !== "object" }]),
|
|
1236
|
+
style: Re(pe.value.value && pe.value.type === "object" && pe.value.value)
|
|
1237
|
+
}, [
|
|
1238
|
+
K.value ? (S(), q("div", {
|
|
1239
|
+
key: 0,
|
|
1240
|
+
class: "headerBar",
|
|
1241
|
+
style: Re({ paddingBottom: K.value ? "10px" : "0px" })
|
|
1242
|
+
}, [
|
|
1243
|
+
Ee(i.$slots, "default", {}, void 0, !0)
|
|
1244
|
+
], 4)) : X("", !0)
|
|
1245
|
+
], 6)) : X("", !0),
|
|
1246
|
+
kt((S(), q("div", oo, [
|
|
1247
|
+
G("div", lo, [
|
|
1248
|
+
e.options.configBtn && e.options.configBtn.length || e.options.leftText ? (S(), $(jn, {
|
|
1249
|
+
key: 0,
|
|
1250
|
+
ref_key: "tbBtnRef",
|
|
1251
|
+
ref: _,
|
|
1252
|
+
instance: { tableRef: b(u), formInstance: D.value },
|
|
1253
|
+
"btn-config": e.options.configBtn,
|
|
1254
|
+
"left-text": e.options.leftText
|
|
1255
|
+
}, null, 8, ["instance", "btn-config", "left-text"])) : X("", !0),
|
|
1256
|
+
y.value ? (S(), $(Xn, {
|
|
1257
|
+
key: 1,
|
|
1258
|
+
ref_key: "virtualEngineRef",
|
|
1259
|
+
ref: a,
|
|
1260
|
+
columns: Ae.value,
|
|
1261
|
+
"data-source": e.dataSource,
|
|
1262
|
+
"table-height": b($e),
|
|
1263
|
+
options: t.options,
|
|
1264
|
+
"parent-slots": i.$slots,
|
|
1265
|
+
onSortChange: St,
|
|
1266
|
+
onSelectionChange: I
|
|
1267
|
+
}, null, 8, ["columns", "data-source", "table-height", "options", "parent-slots"])) : (S(), $(b(ln), ne({
|
|
1268
|
+
class: "el-dp_tables",
|
|
1269
|
+
id: W.value,
|
|
1270
|
+
key: W.value,
|
|
1271
|
+
ref_key: "tableRef",
|
|
1272
|
+
ref: x,
|
|
1273
|
+
style: { width: "100%" }
|
|
1274
|
+
}, Qe.value, {
|
|
1275
|
+
data: e.dataSource,
|
|
1276
|
+
onSortChange: St,
|
|
1277
|
+
onSelectionChange: g
|
|
1278
|
+
}), {
|
|
1279
|
+
empty: z(() => [...B[2] || (B[2] = [
|
|
1280
|
+
G("div", { class: "ant-empty ant-empty-normal" }, [
|
|
1281
|
+
G("div", { class: "ant-empty-image" }, [
|
|
1282
|
+
G("svg", {
|
|
1283
|
+
class: "ant-empty-img-simple",
|
|
1284
|
+
width: "64",
|
|
1285
|
+
height: "41",
|
|
1286
|
+
viewBox: "0 0 64 41",
|
|
1287
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
1288
|
+
}, [
|
|
1289
|
+
G("g", {
|
|
1290
|
+
transform: "translate(0 1)",
|
|
1291
|
+
fill: "none",
|
|
1292
|
+
"fill-rule": "evenodd"
|
|
1293
|
+
}, [
|
|
1294
|
+
G("ellipse", {
|
|
1295
|
+
class: "ant-empty-img-simple-ellipse",
|
|
1296
|
+
cx: "32",
|
|
1297
|
+
cy: "33",
|
|
1298
|
+
rx: "32",
|
|
1299
|
+
ry: "7"
|
|
1300
|
+
}),
|
|
1301
|
+
G("g", {
|
|
1302
|
+
class: "ant-empty-img-simple-g",
|
|
1303
|
+
"fill-rule": "nonzero"
|
|
1304
|
+
}, [
|
|
1305
|
+
G("path", { d: "M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z" }),
|
|
1306
|
+
G("path", {
|
|
1307
|
+
d: "M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",
|
|
1308
|
+
class: "ant-empty-img-simple-path"
|
|
1309
|
+
})
|
|
1310
|
+
])
|
|
1311
|
+
])
|
|
1312
|
+
])
|
|
1313
|
+
]),
|
|
1314
|
+
G("div", { class: "ant-empty-description" }, "暂无数据")
|
|
1315
|
+
], -1)
|
|
1316
|
+
])]),
|
|
1317
|
+
default: z(() => [
|
|
1318
|
+
(S(!0), q(ae, null, Se(Ae.value, (v, E) => (S(), $(Hn, {
|
|
1319
|
+
key: v.prop || v.key || E,
|
|
1320
|
+
cols: { ...v, columnIndex: E }
|
|
1321
|
+
}, nt({ _: 2 }, [
|
|
1322
|
+
v.scopedSlots && v.scopedSlots.customRender ? {
|
|
1323
|
+
name: v.scopedSlots.customRender,
|
|
1324
|
+
fn: z(({ scope: L }) => [
|
|
1325
|
+
Ee(i.$slots, v.scopedSlots.customRender, ne({ ref_for: !0 }, { ...v, columnIndex: E, row: L.row, column: L.column }, { scope: L }), void 0, !0)
|
|
1326
|
+
]),
|
|
1327
|
+
key: "0"
|
|
1328
|
+
} : void 0
|
|
1329
|
+
]), 1032, ["cols"]))), 128))
|
|
1330
|
+
]),
|
|
1331
|
+
_: 3
|
|
1332
|
+
}, 16, ["id", "data"]))
|
|
1333
|
+
]),
|
|
1334
|
+
te.value ? (S(), q("div", {
|
|
1335
|
+
key: 0,
|
|
1336
|
+
ref_key: "paginationRef",
|
|
1337
|
+
ref: C,
|
|
1338
|
+
class: "pagination_page",
|
|
1339
|
+
style: Re({
|
|
1340
|
+
position: N.value === "height" ? "absolute" : "static",
|
|
1341
|
+
bottom: "0px",
|
|
1342
|
+
left: "0px",
|
|
1343
|
+
zIndex: 5,
|
|
1344
|
+
background: "#fff"
|
|
1345
|
+
})
|
|
1346
|
+
}, [
|
|
1347
|
+
J(b(an), {
|
|
1348
|
+
background: Me.value,
|
|
1349
|
+
size: rt.value ? "small" : h.value.size,
|
|
1350
|
+
total: h.value.total,
|
|
1351
|
+
"page-size": h.value.pageSize,
|
|
1352
|
+
"onUpdate:pageSize": B[0] || (B[0] = (v) => h.value.pageSize = v),
|
|
1353
|
+
"page-sizes": at.value,
|
|
1354
|
+
"current-page": h.value.current,
|
|
1355
|
+
"onUpdate:currentPage": B[1] || (B[1] = (v) => h.value.current = v),
|
|
1356
|
+
layout: lt.value,
|
|
1357
|
+
style: { padding: "0", margin: "10px 0", "text-align": "center" },
|
|
1358
|
+
onSizeChange: Ut,
|
|
1359
|
+
onCurrentChange: Kt
|
|
1360
|
+
}, null, 8, ["background", "size", "total", "page-size", "page-sizes", "current-page", "layout"])
|
|
1361
|
+
], 4)) : X("", !0)
|
|
1362
|
+
])), [
|
|
1363
|
+
[b(rn), st.value]
|
|
1364
|
+
])
|
|
1365
|
+
])
|
|
1366
|
+
], 4)
|
|
1367
|
+
]),
|
|
1368
|
+
_: 3
|
|
1369
|
+
}, 8, ["locale"]));
|
|
1370
|
+
}
|
|
1371
|
+
}), de = /* @__PURE__ */ De(ao, [["__scopeId", "data-v-8904b77a"]]);
|
|
1372
|
+
de.install = function(e) {
|
|
1373
|
+
e.component(de.name, de);
|
|
1374
|
+
};
|
|
1375
|
+
de.isPlugin = !0;
|
|
1376
|
+
de.Plugin = {
|
|
1377
|
+
install(e, r = {}) {
|
|
1378
|
+
e.provide("$esPlusTable", {
|
|
1379
|
+
...r.methods || {}
|
|
1380
|
+
}), e.component(de.name, { ...de, methods: { ...de.methods, ...r.methods || {} } });
|
|
1381
|
+
}
|
|
1382
|
+
};
|
|
1383
|
+
const he = (e, r) => {
|
|
1384
|
+
const d = r.split(/\.|\[|\]/).filter(Boolean);
|
|
1385
|
+
let t = e;
|
|
1386
|
+
for (const o of d) {
|
|
1387
|
+
if (t == null) return;
|
|
1388
|
+
t = t[o];
|
|
1389
|
+
}
|
|
1390
|
+
return t;
|
|
1391
|
+
}, ye = (e, r, d) => {
|
|
1392
|
+
const t = r.split(/\.|\[|\]/).filter(Boolean), o = t.pop();
|
|
1393
|
+
let n = e;
|
|
1394
|
+
for (const l of t)
|
|
1395
|
+
n[l] == null && (n[l] = {}), n = n[l];
|
|
1396
|
+
o && (n[o] = d);
|
|
1397
|
+
};
|
|
1398
|
+
function ro() {
|
|
1399
|
+
return { formInputComponents: (r) => (/* @__PURE__ */ new Map([
|
|
1400
|
+
[
|
|
1401
|
+
"Input",
|
|
1402
|
+
(t, o, { row: n }) => t(ht, {
|
|
1403
|
+
modelValue: he(o, n.prop),
|
|
1404
|
+
...n.attrs,
|
|
1405
|
+
...n.on,
|
|
1406
|
+
"onUpdate:modelValue": (l) => {
|
|
1407
|
+
ye(o, n.prop, l);
|
|
1408
|
+
}
|
|
1409
|
+
})
|
|
1410
|
+
],
|
|
1411
|
+
[
|
|
1412
|
+
"Select",
|
|
1413
|
+
(t, o, { row: n }) => t(
|
|
1414
|
+
sn,
|
|
1415
|
+
{
|
|
1416
|
+
modelValue: he(o, n.prop),
|
|
1417
|
+
...n.attrs,
|
|
1418
|
+
...n.on,
|
|
1419
|
+
"onUpdate:modelValue": (l) => {
|
|
1420
|
+
ye(o, n.prop, l);
|
|
1421
|
+
}
|
|
1422
|
+
},
|
|
1423
|
+
() => {
|
|
1424
|
+
var l;
|
|
1425
|
+
return (l = n.dataOptions) == null ? void 0 : l.map(
|
|
1426
|
+
(s, u) => t(cn, { key: u, value: s.value, label: s.label })
|
|
1427
|
+
);
|
|
1428
|
+
}
|
|
1429
|
+
)
|
|
1430
|
+
],
|
|
1431
|
+
[
|
|
1432
|
+
"datePicker",
|
|
1433
|
+
(t, o, { row: n }) => t(un, {
|
|
1434
|
+
modelValue: he(o, n.prop),
|
|
1435
|
+
...n.attrs,
|
|
1436
|
+
...n.on,
|
|
1437
|
+
"onUpdate:modelValue": (l) => {
|
|
1438
|
+
ye(o, n.prop, l);
|
|
1439
|
+
}
|
|
1440
|
+
})
|
|
1441
|
+
],
|
|
1442
|
+
[
|
|
1443
|
+
"timePicker",
|
|
1444
|
+
(t, o, { row: n }) => t(dn, {
|
|
1445
|
+
modelValue: he(o, n.prop),
|
|
1446
|
+
...n.attrs,
|
|
1447
|
+
...n.on,
|
|
1448
|
+
"onUpdate:modelValue": (l) => {
|
|
1449
|
+
ye(o, n.prop, l);
|
|
1450
|
+
}
|
|
1451
|
+
})
|
|
1452
|
+
],
|
|
1453
|
+
[
|
|
1454
|
+
"Slider",
|
|
1455
|
+
(t, o, { row: n }) => t(fn, {
|
|
1456
|
+
modelValue: he(o, n.prop),
|
|
1457
|
+
...n.attrs,
|
|
1458
|
+
...n.on,
|
|
1459
|
+
"onUpdate:modelValue": (l) => {
|
|
1460
|
+
ye(o, n.prop, l);
|
|
1461
|
+
}
|
|
1462
|
+
})
|
|
1463
|
+
],
|
|
1464
|
+
[
|
|
1465
|
+
"ColorPicker",
|
|
1466
|
+
(t, o, { row: n }) => t(pn, {
|
|
1467
|
+
modelValue: he(o, n.prop),
|
|
1468
|
+
...n.attrs,
|
|
1469
|
+
...n.on,
|
|
1470
|
+
"onUpdate:modelValue": (l) => {
|
|
1471
|
+
ye(o, n.prop, l);
|
|
1472
|
+
}
|
|
1473
|
+
})
|
|
1474
|
+
],
|
|
1475
|
+
[
|
|
1476
|
+
"Transfer",
|
|
1477
|
+
(t, o, { row: n }) => t(mn, {
|
|
1478
|
+
modelValue: he(o, n.prop),
|
|
1479
|
+
...n.attrs,
|
|
1480
|
+
...n.on,
|
|
1481
|
+
"onUpdate:modelValue": (l) => {
|
|
1482
|
+
ye(o, n.prop, l);
|
|
1483
|
+
}
|
|
1484
|
+
})
|
|
1485
|
+
],
|
|
1486
|
+
[
|
|
1487
|
+
"Cascader",
|
|
1488
|
+
(t, o, { row: n }) => t(gn, {
|
|
1489
|
+
modelValue: he(o, n.prop),
|
|
1490
|
+
options: n.dataOptions,
|
|
1491
|
+
...n.attrs,
|
|
1492
|
+
...n.on,
|
|
1493
|
+
"onUpdate:modelValue": (l) => {
|
|
1494
|
+
ye(o, n.prop, l);
|
|
1495
|
+
}
|
|
1496
|
+
})
|
|
1497
|
+
],
|
|
1498
|
+
[
|
|
1499
|
+
"Radio",
|
|
1500
|
+
(t, o, { row: n }) => t(
|
|
1501
|
+
hn,
|
|
1502
|
+
{
|
|
1503
|
+
modelValue: he(o, n.prop),
|
|
1504
|
+
...n.attrs,
|
|
1505
|
+
...n.on,
|
|
1506
|
+
"onUpdate:modelValue": (l) => {
|
|
1507
|
+
ye(o, n.prop, l);
|
|
1508
|
+
}
|
|
1509
|
+
},
|
|
1510
|
+
() => {
|
|
1511
|
+
var l;
|
|
1512
|
+
return (l = n.dataOptions) == null ? void 0 : l.map(
|
|
1513
|
+
(s, u) => t(yn, { key: u, value: s.value }, () => s.label)
|
|
1514
|
+
);
|
|
1515
|
+
}
|
|
1516
|
+
)
|
|
1517
|
+
],
|
|
1518
|
+
[
|
|
1519
|
+
"Checkbox",
|
|
1520
|
+
(t, o, { row: n }) => t(
|
|
1521
|
+
vn,
|
|
1522
|
+
{
|
|
1523
|
+
modelValue: he(o, n.prop),
|
|
1524
|
+
...n.attrs,
|
|
1525
|
+
...n.on,
|
|
1526
|
+
"onUpdate:modelValue": (l) => {
|
|
1527
|
+
ye(o, n.prop, l);
|
|
1528
|
+
}
|
|
1529
|
+
},
|
|
1530
|
+
() => {
|
|
1531
|
+
var l;
|
|
1532
|
+
return (l = n.dataOptions) == null ? void 0 : l.map(
|
|
1533
|
+
(s, u) => t(mt, { key: u, value: s.value }, () => s.label)
|
|
1534
|
+
);
|
|
1535
|
+
}
|
|
1536
|
+
)
|
|
1537
|
+
],
|
|
1538
|
+
[
|
|
1539
|
+
"Switch",
|
|
1540
|
+
(t, o, { row: n }) => t(bn, {
|
|
1541
|
+
modelValue: he(o, n.prop),
|
|
1542
|
+
...n.attrs,
|
|
1543
|
+
...n.on,
|
|
1544
|
+
"onUpdate:modelValue": (l) => {
|
|
1545
|
+
ye(o, n.prop, l);
|
|
1546
|
+
}
|
|
1547
|
+
})
|
|
1548
|
+
],
|
|
1549
|
+
[
|
|
1550
|
+
"Rate",
|
|
1551
|
+
(t, o, { row: n }) => t(kn, {
|
|
1552
|
+
modelValue: he(o, n.prop),
|
|
1553
|
+
...n.attrs,
|
|
1554
|
+
...n.on,
|
|
1555
|
+
"onUpdate:modelValue": (l) => {
|
|
1556
|
+
ye(o, n.prop, l);
|
|
1557
|
+
}
|
|
1558
|
+
})
|
|
1559
|
+
],
|
|
1560
|
+
[
|
|
1561
|
+
"Upload",
|
|
1562
|
+
(t, o, { row: n }) => {
|
|
1563
|
+
const { props: l, httpRequest: s, triggerRender: u, fileRender: p, ...w } = n;
|
|
1564
|
+
let c = null;
|
|
1565
|
+
const y = {
|
|
1566
|
+
...l,
|
|
1567
|
+
// props 中的配置:action, accept, listType, limit, multiple 等
|
|
1568
|
+
...w.attrs,
|
|
1569
|
+
// attrs 中的配置(兼容两种方式)
|
|
1570
|
+
ref: (x) => {
|
|
1571
|
+
c = x;
|
|
1572
|
+
}
|
|
1573
|
+
};
|
|
1574
|
+
if (w.on)
|
|
1575
|
+
for (const [x, _] of Object.entries(w.on))
|
|
1576
|
+
y[`on${x.charAt(0).toUpperCase()}${x.slice(1)}`] = _;
|
|
1577
|
+
s && (y["http-request"] = s);
|
|
1578
|
+
const a = {};
|
|
1579
|
+
return u && ((y.listType || y["list-type"]) === "picture-card" ? a.trigger = () => u(t) : a.default = () => u(t)), p && (a.file = ({ file: x }) => p(t, x, () => {
|
|
1580
|
+
c == null || c.handleRemove(x);
|
|
1581
|
+
})), t(wn, y, a);
|
|
1582
|
+
}
|
|
1583
|
+
]
|
|
1584
|
+
])).get(r.formtype) || (() => null) };
|
|
1585
|
+
}
|
|
1586
|
+
function so(e) {
|
|
1587
|
+
const r = A(!1), d = R(() => {
|
|
1588
|
+
var c, y;
|
|
1589
|
+
return ((y = (c = e.layoutFormProps) == null ? void 0 : c.fromLayProps) == null ? void 0 : y.isBtnHidden) ?? !1;
|
|
1590
|
+
}), t = R(() => {
|
|
1591
|
+
var c;
|
|
1592
|
+
return ((c = e.layoutFormProps) == null ? void 0 : c.rowLayProps) || { gutter: 20 };
|
|
1593
|
+
}), o = R(() => {
|
|
1594
|
+
var c;
|
|
1595
|
+
return ((c = e.layoutFormProps) == null ? void 0 : c.fromLayProps) || {};
|
|
1596
|
+
}), n = R(() => {
|
|
1597
|
+
var c;
|
|
1598
|
+
return (c = e.layoutFormProps) == null ? void 0 : c.setOptions;
|
|
1599
|
+
}), l = R(() => {
|
|
1600
|
+
let c = 0;
|
|
1601
|
+
const y = [], a = [], x = e.formItemList;
|
|
1602
|
+
for (let C = 0; C < x.length; C++) {
|
|
1603
|
+
const j = x[C];
|
|
1604
|
+
if (c += j.span || 24, c > 24) {
|
|
1605
|
+
const W = a.length ? a[a.length - 1].endIndex : 0;
|
|
1606
|
+
a.push({ statIndex: W, endIndex: C }), c = j.span || 24, C === x.length - 1 && a.push({ statIndex: C, endIndex: C + 1 });
|
|
1607
|
+
} else if (C === x.length - 1) {
|
|
1608
|
+
const W = a.length ? a[a.length - 1].endIndex : 0;
|
|
1609
|
+
a.push({ statIndex: W, endIndex: C + 1 });
|
|
1610
|
+
} else if (c === 24) {
|
|
1611
|
+
const W = a.length ? a[a.length - 1].endIndex : 0;
|
|
1612
|
+
a.push({ statIndex: W, endIndex: C + 1 }), c = 0;
|
|
1613
|
+
}
|
|
1614
|
+
}
|
|
1615
|
+
a.forEach((C) => {
|
|
1616
|
+
y.push(x.slice(C.statIndex, C.endIndex));
|
|
1617
|
+
});
|
|
1618
|
+
const _ = y.map((C) => C.map(() => 0));
|
|
1619
|
+
let O = -1;
|
|
1620
|
+
return _.forEach((C) => {
|
|
1621
|
+
C.forEach((j, W) => {
|
|
1622
|
+
C[W] = O += 1;
|
|
1623
|
+
});
|
|
1624
|
+
}), {
|
|
1625
|
+
columnRow: _,
|
|
1626
|
+
rowNum: _.length,
|
|
1627
|
+
columnNodeIndex: _.map((C) => C[C.length - 1])
|
|
1628
|
+
};
|
|
1629
|
+
}), s = R(() => {
|
|
1630
|
+
var y, a;
|
|
1631
|
+
const c = ((a = (y = e.layoutFormProps) == null ? void 0 : y.fromLayProps) == null ? void 0 : a.minFoldRows) || 0;
|
|
1632
|
+
return c > 0 && c < l.value.rowNum;
|
|
1633
|
+
}), u = R(() => {
|
|
1634
|
+
var C, j;
|
|
1635
|
+
const { rowNum: c, columnRow: y } = l.value, a = y[c - 1] || [], x = ((j = (C = e.layoutFormProps) == null ? void 0 : C.fromLayProps) == null ? void 0 : j.btnColSpan) || 0, O = 24 - a.reduce((W, Q) => {
|
|
1636
|
+
var Y;
|
|
1637
|
+
return W + (((Y = e.formItemList[Q]) == null ? void 0 : Y.span) || 24);
|
|
1638
|
+
}, 0);
|
|
1639
|
+
return !r.value && x <= O ? O : 24;
|
|
1640
|
+
}), p = R(() => {
|
|
1641
|
+
var a, x;
|
|
1642
|
+
const c = ((x = (a = e.layoutFormProps) == null ? void 0 : a.fromLayProps) == null ? void 0 : x.minFoldRows) || 0, { columnNodeIndex: y } = l.value;
|
|
1643
|
+
if (r.value) {
|
|
1644
|
+
const _ = y[c - 1] ?? y[y.length - 1] ?? 9999;
|
|
1645
|
+
return e.formItemList.map((O, C) => ({
|
|
1646
|
+
...O,
|
|
1647
|
+
isFold: C > _
|
|
1648
|
+
}));
|
|
1649
|
+
}
|
|
1650
|
+
return e.formItemList.map((_) => ({ ..._, isFold: !1 }));
|
|
1651
|
+
});
|
|
1652
|
+
return Ie(
|
|
1653
|
+
s,
|
|
1654
|
+
(c) => {
|
|
1655
|
+
r.value = c;
|
|
1656
|
+
},
|
|
1657
|
+
{ immediate: !0 }
|
|
1658
|
+
), {
|
|
1659
|
+
folded: r,
|
|
1660
|
+
isBtnHidden: d,
|
|
1661
|
+
rowLayout: t,
|
|
1662
|
+
formLayout: o,
|
|
1663
|
+
getSetOptionsStatus: n,
|
|
1664
|
+
getRowColsAlgorithm: l,
|
|
1665
|
+
isFold: s,
|
|
1666
|
+
getBtnColSpan: u,
|
|
1667
|
+
formItem: p,
|
|
1668
|
+
changeFolded: () => {
|
|
1669
|
+
r.value = !r.value;
|
|
1670
|
+
}
|
|
1671
|
+
};
|
|
1672
|
+
}
|
|
1673
|
+
function io(e) {
|
|
1674
|
+
const r = (s, u = {}, p) => {
|
|
1675
|
+
const { success: w, fail: c, ...y } = u || {};
|
|
1676
|
+
if (re(u.apiParams) && Object.keys(u.apiParams).length && u.apiParams.url) {
|
|
1677
|
+
const a = { ...s, ...ze(b(u.apiParams.model || {})) }, x = { ...ze(b(u.apiParams.options || {})) };
|
|
1678
|
+
u.apiParams.method && (x.method = u.apiParams.method);
|
|
1679
|
+
const _ = {
|
|
1680
|
+
url: u.apiParams.url,
|
|
1681
|
+
headers: { ...u.apiParams.headers || {} },
|
|
1682
|
+
formParams: a,
|
|
1683
|
+
...x
|
|
1684
|
+
}, O = u.httpRequest || e;
|
|
1685
|
+
if (!O) return;
|
|
1686
|
+
O(_).then((C) => {
|
|
1687
|
+
typeof w == "function" && C && (re(C) || Array.isArray(C)) && w(C);
|
|
1688
|
+
}).catch((C) => {
|
|
1689
|
+
typeof c == "function" && c(C);
|
|
1690
|
+
});
|
|
1691
|
+
}
|
|
1692
|
+
}, d = (s) => {
|
|
1693
|
+
const u = ["total", "pageSize", "current", "listData"];
|
|
1694
|
+
return re(s) ? Object.keys(s).every((p) => u.find((w) => w === p) && s[p] && typeof s[p] == "string") : !1;
|
|
1695
|
+
}, t = (s = {}, u) => {
|
|
1696
|
+
if (re(s.configFormOut) && Object.keys(s.configFormOut).length && d(s.configFormOut))
|
|
1697
|
+
return s.configFormOut;
|
|
1698
|
+
if (typeof u == "function") {
|
|
1699
|
+
const p = u({
|
|
1700
|
+
total: "records",
|
|
1701
|
+
pageSize: "pageSize",
|
|
1702
|
+
current: "pageNo",
|
|
1703
|
+
listData: "rows"
|
|
1704
|
+
});
|
|
1705
|
+
if (d(p))
|
|
1706
|
+
return p;
|
|
1707
|
+
}
|
|
1708
|
+
return {
|
|
1709
|
+
total: "records",
|
|
1710
|
+
pageSize: "pageSize",
|
|
1711
|
+
current: "pageNo",
|
|
1712
|
+
listData: "rows"
|
|
1713
|
+
};
|
|
1714
|
+
}, o = (s, u, p = {}, w) => {
|
|
1715
|
+
const c = t(p, w), y = {};
|
|
1716
|
+
if (u.includes("listData") && Array.isArray(s))
|
|
1717
|
+
return y.listData = s, y;
|
|
1718
|
+
if (re(c) && Object.keys(c).length)
|
|
1719
|
+
for (const [a, x] of Object.entries(c)) {
|
|
1720
|
+
if (u.findIndex((C) => C === a) === -1) continue;
|
|
1721
|
+
const O = s[x];
|
|
1722
|
+
if (O != null)
|
|
1723
|
+
a === "listData" ? y[a] = Array.isArray(O) ? O : [] : y[a] = typeof O == "number" ? O : parseInt(O, 10) || 0;
|
|
1724
|
+
else {
|
|
1725
|
+
const C = wt(s, x);
|
|
1726
|
+
a === "listData" ? y[a] = Array.isArray(C) ? C : [] : y[a] = typeof C == "number" ? C : parseInt(C, 10) || 0;
|
|
1727
|
+
}
|
|
1728
|
+
}
|
|
1729
|
+
return y;
|
|
1730
|
+
}, n = (s, u, p, w) => new Promise((c, y) => {
|
|
1731
|
+
Ue(() => {
|
|
1732
|
+
r(
|
|
1733
|
+
{ pageIndex: 1, pageSize: 1e3, ...s || {} },
|
|
1734
|
+
{
|
|
1735
|
+
...u || {},
|
|
1736
|
+
success: (a) => {
|
|
1737
|
+
const x = o(a, ["total", "listData"], p, w);
|
|
1738
|
+
c({ data: a, configRows: x });
|
|
1739
|
+
},
|
|
1740
|
+
fail: (a) => {
|
|
1741
|
+
y(a);
|
|
1742
|
+
}
|
|
1743
|
+
}
|
|
1744
|
+
);
|
|
1745
|
+
});
|
|
1746
|
+
});
|
|
1747
|
+
return {
|
|
1748
|
+
queryTableListMethod: r,
|
|
1749
|
+
getEveryFormQueryField: async (s, u) => {
|
|
1750
|
+
try {
|
|
1751
|
+
if (!Array.isArray(s)) return [];
|
|
1752
|
+
const p = s.filter((a) => a && a.apiParams && re(a.apiParams) && a.apiParams.url), w = [], c = p.map((a) => {
|
|
1753
|
+
var O, C;
|
|
1754
|
+
const { httpRequest: x } = a, _ = n(
|
|
1755
|
+
{ ...((O = a.apiParams) == null ? void 0 : O.model) || {} },
|
|
1756
|
+
{ httpRequest: x, apiParams: a.apiParams, ...((C = a.apiParams) == null ? void 0 : C.options) || {} },
|
|
1757
|
+
a,
|
|
1758
|
+
u
|
|
1759
|
+
);
|
|
1760
|
+
return to(_);
|
|
1761
|
+
});
|
|
1762
|
+
return (await Promise.all(c)).forEach((a, x) => {
|
|
1763
|
+
var _;
|
|
1764
|
+
if (a.status === "fulfilled") {
|
|
1765
|
+
const { configRows: O, data: C } = a.value, j = p[x], W = j == null ? void 0 : j.listenToCallBack;
|
|
1766
|
+
let Q = [];
|
|
1767
|
+
W != null && W.crtn && (Q = W.crtn(C));
|
|
1768
|
+
const Y = Array.isArray(Q) && Q.length > 0 ? Q : typeof (j == null ? void 0 : j.callOptionListFormat) == "function" ? j.callOptionListFormat((O == null ? void 0 : O.listData) || (j == null ? void 0 : j.dataOptions) || []) : void 0;
|
|
1769
|
+
w.push({
|
|
1770
|
+
prop: p[x].prop,
|
|
1771
|
+
listData: Array.isArray(Y) ? Y : (O == null ? void 0 : O.listData) || ((_ = p[x]) == null ? void 0 : _.dataOptions) || []
|
|
1772
|
+
});
|
|
1773
|
+
}
|
|
1774
|
+
}), w;
|
|
1775
|
+
} catch {
|
|
1776
|
+
return [];
|
|
1777
|
+
}
|
|
1778
|
+
},
|
|
1779
|
+
formatConfigOut: o,
|
|
1780
|
+
configFormField: t
|
|
1781
|
+
};
|
|
1782
|
+
}
|
|
1783
|
+
const co = (e) => typeof e == "string" ? document.querySelector(e) || document.body : e instanceof HTMLElement ? e : document.body, Vt = (e, r, d, t) => {
|
|
1784
|
+
var l;
|
|
1785
|
+
const o = J(e, r);
|
|
1786
|
+
if (t) {
|
|
1787
|
+
o.appContext = t, o.appContext.provides || (o.appContext.provides = {});
|
|
1788
|
+
const s = (l = t.provides) == null ? void 0 : l.elLocale;
|
|
1789
|
+
s && (o.appContext.provides.elLocale = s), o.appContext.config || (o.appContext.config = {}), o.appContext.config.globalProperties || (o.appContext.config.globalProperties = {});
|
|
1790
|
+
}
|
|
1791
|
+
return pt(o, d), co(r.appendTo).appendChild(d), o;
|
|
1792
|
+
};
|
|
1793
|
+
function _e(e, r = {}) {
|
|
1794
|
+
if (e = e || Ne, Object.assign({ onlyInstance: !1 }, r).onlyInstance) {
|
|
1795
|
+
const t = Ke(), o = (t == null ? void 0 : t.appContext) || null, n = document.createElement("div"), l = () => {
|
|
1796
|
+
pt(null, n), n.remove();
|
|
1797
|
+
}, s = (u) => {
|
|
1798
|
+
u.visible === void 0 && (u.visible = !0);
|
|
1799
|
+
const p = u.onClosed, w = u.onSubmit;
|
|
1800
|
+
return u.onClosed = (...c) => {
|
|
1801
|
+
p == null || p(...c), l();
|
|
1802
|
+
}, u.onSubmit = (c = l) => {
|
|
1803
|
+
w == null || w(c);
|
|
1804
|
+
}, Vt(e, u, n, o);
|
|
1805
|
+
};
|
|
1806
|
+
return s.close = l, s;
|
|
1807
|
+
} else {
|
|
1808
|
+
const t = document.createElement("div");
|
|
1809
|
+
t.className = "dialog-containers";
|
|
1810
|
+
const o = Ke(), n = (o == null ? void 0 : o.appContext) || null;
|
|
1811
|
+
let l = null;
|
|
1812
|
+
const s = () => {
|
|
1813
|
+
l && l.component && (l.component.props.visible = !1);
|
|
1814
|
+
}, u = () => {
|
|
1815
|
+
l && (pt(null, t), t.remove(), l = null);
|
|
1816
|
+
}, p = (w) => {
|
|
1817
|
+
if (l && l.component)
|
|
1818
|
+
return Object.assign(l.component.props, w), l.component.props.visible = !0, l;
|
|
1819
|
+
const c = {
|
|
1820
|
+
visible: !0,
|
|
1821
|
+
width: "50%",
|
|
1822
|
+
destroyOnClose: !0,
|
|
1823
|
+
...w
|
|
1824
|
+
}, { onClosed: y, onSubmit: a } = c;
|
|
1825
|
+
return c.onClosed = () => {
|
|
1826
|
+
y == null || y(), s();
|
|
1827
|
+
}, c.onSubmit = (x = s) => {
|
|
1828
|
+
a == null || a(x);
|
|
1829
|
+
}, l = Vt(e, c, t, n), l;
|
|
1830
|
+
};
|
|
1831
|
+
return p.close = s, p.destroy = u, p;
|
|
1832
|
+
}
|
|
1833
|
+
}
|
|
1834
|
+
const uo = { class: "flex-center" }, fo = {
|
|
1835
|
+
key: 0,
|
|
1836
|
+
class: "buttonOperate leftRightBtn"
|
|
1837
|
+
}, po = { class: "btn-left" }, mo = { class: "btn-right" }, go = { name: "EsForm" }, ho = /* @__PURE__ */ be({
|
|
1838
|
+
...go,
|
|
1839
|
+
props: {
|
|
1840
|
+
model: { default: () => ({}) },
|
|
1841
|
+
formItemList: { default: () => [] },
|
|
1842
|
+
layoutFormProps: { default: () => ({}) },
|
|
1843
|
+
configBtn: { default: () => [] },
|
|
1844
|
+
renderBtn: { type: [Function, Boolean], default: !1 },
|
|
1845
|
+
btnColSpanRow: { type: Boolean, default: !0 },
|
|
1846
|
+
rules: { default: () => ({}) },
|
|
1847
|
+
fieldFieldOutput: {}
|
|
1848
|
+
},
|
|
1849
|
+
emits: ["confirm", "reset"],
|
|
1850
|
+
setup(e, { expose: r, emit: d }) {
|
|
1851
|
+
var je;
|
|
1852
|
+
const t = e, o = Ke(), n = ue("$esPlusForm", null) ?? Pe().EsForm ?? {}, l = ue("$EsPlus", null) ?? Pe() ?? {}, s = (g) => {
|
|
1853
|
+
if (!g) return !0;
|
|
1854
|
+
const I = l.permission;
|
|
1855
|
+
return typeof I == "function" ? I(g) : !0;
|
|
1856
|
+
}, u = (g) => g.labelKey && typeof l.t == "function" ? l.t(g.labelKey) : g.label, p = ue("getTableInstantce", null), w = R(() => {
|
|
1857
|
+
if (p)
|
|
1858
|
+
return typeof p == "function" ? p() : p;
|
|
1859
|
+
const g = o == null ? void 0 : o.ctx;
|
|
1860
|
+
return typeof (g == null ? void 0 : g.getTableInstantce) == "function" ? g == null ? void 0 : g.getTableInstantce() : g == null ? void 0 : g.getTableInstantce;
|
|
1861
|
+
}), c = R(() => !!(w.value && Object.keys(w.value).length)), y = Object.fromEntries(Object.entries(yt)), a = (g) => g ? y[g] || g : void 0, x = (g) => {
|
|
1862
|
+
const { icon: I, ...k } = g;
|
|
1863
|
+
return k.size || (k.size = "small"), k;
|
|
1864
|
+
}, _ = A(null), O = A({}), C = A(t.formItemList), j = (g) => {
|
|
1865
|
+
g && (_.value = g);
|
|
1866
|
+
}, { formInputComponents: W } = ro(), Q = (n == null ? void 0 : n.$httpRequest) || void 0, Y = t.fieldFieldOutput || (n == null ? void 0 : n.fieldFieldOutput), { getEveryFormQueryField: ee } = io(Q), ie = A(((je = t.layoutFormProps) == null ? void 0 : je.fromLayProps) || {}), te = R(() => ({
|
|
1867
|
+
size: "small",
|
|
1868
|
+
...ie.value,
|
|
1869
|
+
model: t.model,
|
|
1870
|
+
rules: t.rules,
|
|
1871
|
+
validateOnRuleChange: !1
|
|
1872
|
+
})), oe = A(/* @__PURE__ */ new Set());
|
|
1873
|
+
Ie(
|
|
1874
|
+
() => t.formItemList,
|
|
1875
|
+
async (g) => {
|
|
1876
|
+
const I = Array.isArray(g) ? g : [], k = I.filter((F) => F && F.isInitRun !== !1 && !oe.value.has(F.prop));
|
|
1877
|
+
if (!k.length) {
|
|
1878
|
+
C.value = I.map((F) => {
|
|
1879
|
+
var Z;
|
|
1880
|
+
if (!F) return null;
|
|
1881
|
+
const H = C.value.find((xe) => xe && xe.prop === F.prop);
|
|
1882
|
+
return (Z = H == null ? void 0 : H.dataOptions) != null && Z.length ? { ...F, dataOptions: H.dataOptions } : F;
|
|
1883
|
+
}).filter((F) => !!F);
|
|
1884
|
+
return;
|
|
1885
|
+
}
|
|
1886
|
+
const M = await ee(k, Y);
|
|
1887
|
+
k.forEach((F) => oe.value.add(F.prop)), C.value = I.map((F) => {
|
|
1888
|
+
var xe;
|
|
1889
|
+
if (!F) return null;
|
|
1890
|
+
const H = M.find((Ce) => Ce && Ce.prop === F.prop), Z = C.value.find((Ce) => Ce && Ce.prop === F.prop);
|
|
1891
|
+
return H ? { ...F, dataOptions: H.listData } : (xe = Z == null ? void 0 : Z.dataOptions) != null && xe.length ? { ...F, dataOptions: Z.dataOptions } : F;
|
|
1892
|
+
}).filter((F) => !!F);
|
|
1893
|
+
},
|
|
1894
|
+
{ immediate: !0, deep: !0 }
|
|
1895
|
+
);
|
|
1896
|
+
const fe = R(() => {
|
|
1897
|
+
const I = (C.value || []).map((H) => H ? { ...H, dataOptions: H.dataOptions || [] } : null).filter((H) => H ? H.isHidden && typeof H.isHidden == "function" ? !H.isHidden(t.model, H, te.value) : !0 : !1), M = I.filter((H) => !H.span).length;
|
|
1898
|
+
let F = 6;
|
|
1899
|
+
if (M > 0) {
|
|
1900
|
+
const H = I.reduce((xe, Ce) => xe + (Ce.span || 0), 0), Z = 24 - (H % 24 || (H ? 24 : 0));
|
|
1901
|
+
H === 0 ? M === 1 ? F = 24 : M === 2 ? F = 12 : M === 3 ? F = 8 : F = 6 : (F = Z >= M ? Math.floor(Z / M) : 6, F > 12 && (F = 12), F < 4 && (F = 6));
|
|
1902
|
+
}
|
|
1903
|
+
return I.map((H) => ({ ...H, span: H.span || F }));
|
|
1904
|
+
}), {
|
|
1905
|
+
folded: m,
|
|
1906
|
+
isBtnHidden: f,
|
|
1907
|
+
rowLayout: h,
|
|
1908
|
+
formLayout: D,
|
|
1909
|
+
getSetOptionsStatus: T,
|
|
1910
|
+
getRowColsAlgorithm: P,
|
|
1911
|
+
isFold: V,
|
|
1912
|
+
getBtnColSpan: K,
|
|
1913
|
+
formItem: N,
|
|
1914
|
+
changeFolded: ce
|
|
1915
|
+
} = so({
|
|
1916
|
+
layoutFormProps: t.layoutFormProps,
|
|
1917
|
+
get formItemList() {
|
|
1918
|
+
return fe.value;
|
|
1919
|
+
}
|
|
1920
|
+
});
|
|
1921
|
+
Ie(
|
|
1922
|
+
D,
|
|
1923
|
+
(g) => {
|
|
1924
|
+
ie.value = g;
|
|
1925
|
+
},
|
|
1926
|
+
{ immediate: !0 }
|
|
1927
|
+
);
|
|
1928
|
+
const pe = R(() => ({
|
|
1929
|
+
colRightBtn: t.configBtn.filter((g) => g.direction === "right" || !g.direction),
|
|
1930
|
+
colLeftBtn: t.configBtn.filter((g) => g.direction === "left")
|
|
1931
|
+
})), Oe = R(() => typeof t.renderBtn == "function"), lt = async (g) => {
|
|
1932
|
+
var I, k;
|
|
1933
|
+
g.triggerEvent && ["query", "rest"].includes(g.key || "") ? at(t.model, _.value, g.key) : (g.key === "rest" && _.value && _.value.resetFields(), (k = g.click) == null || k.call(g, t.model, _.value, (I = w.value) == null ? void 0 : I.httpRequestInstance));
|
|
1934
|
+
}, at = async (g, I, k) => {
|
|
1935
|
+
var M, F, H, Z;
|
|
1936
|
+
k === "query" ? c.value && ((F = (M = w.value) == null ? void 0 : M.httpRequestInstance) == null || F.call(M, g)) : k === "rest" && I && (c.value && ((Z = (H = w.value) == null ? void 0 : H.httpRequestInstance) == null || Z.call(H, g)), I.resetFields());
|
|
1937
|
+
}, rt = (g) => {
|
|
1938
|
+
if (c.value) {
|
|
1939
|
+
const { style: I, ...k } = g;
|
|
1940
|
+
return { style: { marginBottom: "10px", ...I }, ...k };
|
|
1941
|
+
}
|
|
1942
|
+
return g;
|
|
1943
|
+
}, Me = (() => {
|
|
1944
|
+
var g;
|
|
1945
|
+
return (g = o == null ? void 0 : o.ctx) != null && g.dialogInstance ? o.ctx.dialogInstance() : _e;
|
|
1946
|
+
})(), st = Me(), Ve = Me(), Ae = () => {
|
|
1947
|
+
}, it = () => ({
|
|
1948
|
+
data: C.value.map((g) => ({
|
|
1949
|
+
...g,
|
|
1950
|
+
label: g.label,
|
|
1951
|
+
prop: g.prop,
|
|
1952
|
+
isHidden: !!g.isHidden,
|
|
1953
|
+
width: g.width
|
|
1954
|
+
})),
|
|
1955
|
+
columns: [
|
|
1956
|
+
{ type: "selection", width: 50 },
|
|
1957
|
+
{ label: "名称(列)", key: "label" },
|
|
1958
|
+
{ label: "属性(Key)", key: "prop" },
|
|
1959
|
+
{
|
|
1960
|
+
label: "列宽",
|
|
1961
|
+
width: 180,
|
|
1962
|
+
render: (g, I) => U("div", [
|
|
1963
|
+
U(ht, {
|
|
1964
|
+
size: "small",
|
|
1965
|
+
maxlength: 3,
|
|
1966
|
+
formatter: (k) => k.replace(/^0|[^0-9]/g, ""),
|
|
1967
|
+
modelValue: I.width,
|
|
1968
|
+
"onUpdate:modelValue": (k) => {
|
|
1969
|
+
I.width = k;
|
|
1970
|
+
}
|
|
1971
|
+
}, {
|
|
1972
|
+
prepend: () => "宽度",
|
|
1973
|
+
append: () => "px"
|
|
1974
|
+
})
|
|
1975
|
+
])
|
|
1976
|
+
}
|
|
1977
|
+
]
|
|
1978
|
+
}), ct = () => ({
|
|
1979
|
+
dataSource: [],
|
|
1980
|
+
columns: [
|
|
1981
|
+
{ type: "selection", width: 50 },
|
|
1982
|
+
{ label: "名称(列)", key: "label" },
|
|
1983
|
+
{ label: "属性(Key)", key: "tableProp" },
|
|
1984
|
+
{
|
|
1985
|
+
label: "列宽",
|
|
1986
|
+
width: 180,
|
|
1987
|
+
render: (g, I) => U("div", [
|
|
1988
|
+
U(ht, {
|
|
1989
|
+
size: "small",
|
|
1990
|
+
maxlength: 3,
|
|
1991
|
+
formatter: (k) => k.replace(/^0|[^0-9]/g, ""),
|
|
1992
|
+
modelValue: I.width,
|
|
1993
|
+
"onUpdate:modelValue": (k) => {
|
|
1994
|
+
I.width = k;
|
|
1995
|
+
}
|
|
1996
|
+
}, {
|
|
1997
|
+
prepend: () => "宽度",
|
|
1998
|
+
append: () => "px"
|
|
1999
|
+
})
|
|
2000
|
+
])
|
|
2001
|
+
}
|
|
2002
|
+
]
|
|
2003
|
+
}), We = () => {
|
|
2004
|
+
const g = it();
|
|
2005
|
+
st({
|
|
2006
|
+
title: "自定义查询",
|
|
2007
|
+
width: "800px",
|
|
2008
|
+
isDraggable: !0,
|
|
2009
|
+
render: () => {
|
|
2010
|
+
var I;
|
|
2011
|
+
return U(de, {
|
|
2012
|
+
dataSource: g.data,
|
|
2013
|
+
columns: g.columns,
|
|
2014
|
+
options: {
|
|
2015
|
+
multiSelect: !0,
|
|
2016
|
+
expand: !1,
|
|
2017
|
+
snIndex: !1,
|
|
2018
|
+
loading: !1,
|
|
2019
|
+
border: !0,
|
|
2020
|
+
size: "small"
|
|
2021
|
+
},
|
|
2022
|
+
pagination: {
|
|
2023
|
+
pageSize: 10,
|
|
2024
|
+
current: 1,
|
|
2025
|
+
total: ((I = g.data) == null ? void 0 : I.length) || 0
|
|
2026
|
+
}
|
|
2027
|
+
});
|
|
2028
|
+
},
|
|
2029
|
+
configBtn: [
|
|
2030
|
+
{
|
|
2031
|
+
name: "取消",
|
|
2032
|
+
icon: "Close",
|
|
2033
|
+
click: (I, { close: k }) => k()
|
|
2034
|
+
},
|
|
2035
|
+
{
|
|
2036
|
+
name: "确认",
|
|
2037
|
+
type: "primary",
|
|
2038
|
+
icon: "Check",
|
|
2039
|
+
click: (I, { close: k }) => k()
|
|
2040
|
+
}
|
|
2041
|
+
]
|
|
2042
|
+
});
|
|
2043
|
+
}, Qe = () => {
|
|
2044
|
+
const g = ct();
|
|
2045
|
+
Ve({
|
|
2046
|
+
title: "自定义表格",
|
|
2047
|
+
width: "800px",
|
|
2048
|
+
render: () => U(de, {
|
|
2049
|
+
dataSource: g.dataSource,
|
|
2050
|
+
columns: g.columns
|
|
2051
|
+
})
|
|
2052
|
+
});
|
|
2053
|
+
};
|
|
2054
|
+
Ue(() => {
|
|
2055
|
+
var g, I;
|
|
2056
|
+
O.value = _.value, (I = (g = o == null ? void 0 : o.ctx) == null ? void 0 : g.bodyFormInstance) == null || I.call(g, O.value);
|
|
2057
|
+
});
|
|
2058
|
+
const $e = be({
|
|
2059
|
+
props: {
|
|
2060
|
+
row: Object,
|
|
2061
|
+
formItemList: Array,
|
|
2062
|
+
formModel: Object,
|
|
2063
|
+
render: Function,
|
|
2064
|
+
ellipsis: Boolean
|
|
2065
|
+
},
|
|
2066
|
+
setup(g) {
|
|
2067
|
+
return () => {
|
|
2068
|
+
var H;
|
|
2069
|
+
const { formItemList: I, formModel: k, row: M } = g, F = ((H = g.render) == null ? void 0 : H.call(g, M, k, I, U)) || "";
|
|
2070
|
+
return typeof F == "string" ? U("span", F) : F;
|
|
2071
|
+
};
|
|
2072
|
+
}
|
|
2073
|
+
}), Ge = be({
|
|
2074
|
+
props: {
|
|
2075
|
+
row: Object,
|
|
2076
|
+
index: Number,
|
|
2077
|
+
datakey: String,
|
|
2078
|
+
render: Function,
|
|
2079
|
+
model: Object,
|
|
2080
|
+
ellipsis: Boolean
|
|
2081
|
+
},
|
|
2082
|
+
setup(g) {
|
|
2083
|
+
return () => {
|
|
2084
|
+
var H;
|
|
2085
|
+
const { row: I, index: k, model: M } = g, F = ((H = g.render) == null ? void 0 : H.call(g, U, M, { row: I, index: k })) || "";
|
|
2086
|
+
return typeof F == "string" ? U("span", F) : F;
|
|
2087
|
+
};
|
|
2088
|
+
}
|
|
2089
|
+
}), Ye = async (g) => {
|
|
2090
|
+
const k = fe.value.filter((F) => F && g.includes(F.prop));
|
|
2091
|
+
if (!k.length) return;
|
|
2092
|
+
(await ee(k, Y)).forEach((F) => {
|
|
2093
|
+
if (!F) return;
|
|
2094
|
+
const H = C.value.findIndex((Z) => Z && Z.prop === F.prop);
|
|
2095
|
+
H !== -1 && (C.value[H] = {
|
|
2096
|
+
...C.value[H],
|
|
2097
|
+
dataOptions: F.listData
|
|
2098
|
+
});
|
|
2099
|
+
});
|
|
2100
|
+
}, Fe = () => _.value;
|
|
2101
|
+
return r({
|
|
2102
|
+
formItmeRequestInstance: Ye,
|
|
2103
|
+
getFormRef: Fe,
|
|
2104
|
+
validate: () => {
|
|
2105
|
+
var g;
|
|
2106
|
+
return (g = Fe()) == null ? void 0 : g.validate();
|
|
2107
|
+
},
|
|
2108
|
+
resetFields: () => {
|
|
2109
|
+
var g;
|
|
2110
|
+
return (g = Fe()) == null ? void 0 : g.resetFields();
|
|
2111
|
+
},
|
|
2112
|
+
clearValidate: (g) => {
|
|
2113
|
+
var I;
|
|
2114
|
+
return (I = Fe()) == null ? void 0 : I.clearValidate(g);
|
|
2115
|
+
},
|
|
2116
|
+
validateField: (g) => {
|
|
2117
|
+
var I;
|
|
2118
|
+
return (I = Fe()) == null ? void 0 : I.validateField(g);
|
|
2119
|
+
},
|
|
2120
|
+
scrollToField: (g) => {
|
|
2121
|
+
var I;
|
|
2122
|
+
return (I = Fe()) == null ? void 0 : I.scrollToField(g);
|
|
2123
|
+
}
|
|
2124
|
+
}), (g, I) => (S(), $(b(Sn), ne({ ref: j }, te.value, { class: "es-form" }), {
|
|
2125
|
+
default: z(() => [
|
|
2126
|
+
G("div", uo, [
|
|
2127
|
+
J(b(xn), Be(qt(b(h))), {
|
|
2128
|
+
default: z(() => [
|
|
2129
|
+
(S(!0), q(ae, null, Se(b(N), (k, M) => kt((S(), $(b(Bt), {
|
|
2130
|
+
key: k.prop,
|
|
2131
|
+
span: k.span
|
|
2132
|
+
}, {
|
|
2133
|
+
default: z(() => [
|
|
2134
|
+
J(b(Je), ne({
|
|
2135
|
+
label: u(k)
|
|
2136
|
+
}, { ref_for: !0 }, rt(k.formItemOptions || {}), {
|
|
2137
|
+
prop: k.prop,
|
|
2138
|
+
onClick: en(() => {
|
|
2139
|
+
}, ["stop"])
|
|
2140
|
+
}), {
|
|
2141
|
+
default: z(() => [
|
|
2142
|
+
k.formtype ? (S(), $(b(Ge), {
|
|
2143
|
+
key: 0,
|
|
2144
|
+
row: k,
|
|
2145
|
+
render: b(W)(k),
|
|
2146
|
+
index: M,
|
|
2147
|
+
model: e.model
|
|
2148
|
+
}, null, 8, ["row", "render", "index", "model"])) : (S(), $(b(Ge), {
|
|
2149
|
+
key: 1,
|
|
2150
|
+
row: k,
|
|
2151
|
+
render: k.render,
|
|
2152
|
+
index: M,
|
|
2153
|
+
model: e.model
|
|
2154
|
+
}, null, 8, ["row", "render", "index", "model"]))
|
|
2155
|
+
]),
|
|
2156
|
+
_: 2
|
|
2157
|
+
}, 1040, ["label", "prop"])
|
|
2158
|
+
]),
|
|
2159
|
+
_: 2
|
|
2160
|
+
}, 1032, ["span"])), [
|
|
2161
|
+
[Nt, !(k != null && k.isFold)]
|
|
2162
|
+
])), 128)),
|
|
2163
|
+
b(f) ? X("", !0) : (S(), q(ae, { key: 0 }, [
|
|
2164
|
+
Oe.value ? (S(), $(b($e), {
|
|
2165
|
+
key: 0,
|
|
2166
|
+
row: { isFold: b(V), folded: b(m), getBtnColSpan: b(K), getRowColsAlgorithm: b(P), changeFolded: b(ce), refsForm: O.value },
|
|
2167
|
+
"form-model": e.model,
|
|
2168
|
+
"form-item-list": b(N),
|
|
2169
|
+
render: e.renderBtn
|
|
2170
|
+
}, null, 8, ["row", "form-model", "form-item-list", "render"])) : (S(), $(b(Bt), {
|
|
2171
|
+
key: 1,
|
|
2172
|
+
span: e.btnColSpanRow ? 24 : b(K)
|
|
2173
|
+
}, {
|
|
2174
|
+
default: z(() => [
|
|
2175
|
+
e.btnColSpanRow && e.configBtn.length ? (S(), q("div", fo, [
|
|
2176
|
+
G("div", po, [
|
|
2177
|
+
J(b(Je), {
|
|
2178
|
+
"label-width": "0px",
|
|
2179
|
+
class: "btn-formItem"
|
|
2180
|
+
}, {
|
|
2181
|
+
default: z(() => [
|
|
2182
|
+
(S(!0), q(ae, null, Se(pe.value.colLeftBtn, (k, M) => (S(), q(ae, {
|
|
2183
|
+
key: k.key || M
|
|
2184
|
+
}, [
|
|
2185
|
+
s(k.permissionValue) ? (S(), $(b(ke), ne({
|
|
2186
|
+
key: 0,
|
|
2187
|
+
ref_for: !0
|
|
2188
|
+
}, x(k), {
|
|
2189
|
+
icon: a(k.icon),
|
|
2190
|
+
disabled: typeof k.disabled == "function" ? k.disabled() || !1 : k.disabled || !1,
|
|
2191
|
+
onClick: () => {
|
|
2192
|
+
var F;
|
|
2193
|
+
return k.click(e.model, _.value, (F = w.value) == null ? void 0 : F.httpRequestInstance);
|
|
2194
|
+
}
|
|
2195
|
+
}), {
|
|
2196
|
+
default: z(() => [
|
|
2197
|
+
se(we(k.name), 1)
|
|
2198
|
+
]),
|
|
2199
|
+
_: 2
|
|
2200
|
+
}, 1040, ["icon", "disabled", "onClick"])) : X("", !0)
|
|
2201
|
+
], 64))), 128))
|
|
2202
|
+
]),
|
|
2203
|
+
_: 1
|
|
2204
|
+
})
|
|
2205
|
+
]),
|
|
2206
|
+
G("div", mo, [
|
|
2207
|
+
J(b(Je), {
|
|
2208
|
+
"label-width": "0px",
|
|
2209
|
+
class: "btn-formItem"
|
|
2210
|
+
}, {
|
|
2211
|
+
default: z(() => [
|
|
2212
|
+
(S(!0), q(ae, null, Se(pe.value.colRightBtn, (k, M) => (S(), q(ae, {
|
|
2213
|
+
key: k.key || M
|
|
2214
|
+
}, [
|
|
2215
|
+
s(k.permissionValue) ? (S(), $(b(ke), ne({
|
|
2216
|
+
key: 0,
|
|
2217
|
+
ref_for: !0
|
|
2218
|
+
}, x(k), {
|
|
2219
|
+
icon: a(k.icon),
|
|
2220
|
+
disabled: typeof k.disabled == "function" ? k.disabled() || !1 : k.disabled || !1,
|
|
2221
|
+
onClick: () => lt(k)
|
|
2222
|
+
}), {
|
|
2223
|
+
default: z(() => [
|
|
2224
|
+
se(we(k.name), 1)
|
|
2225
|
+
]),
|
|
2226
|
+
_: 2
|
|
2227
|
+
}, 1040, ["icon", "disabled", "onClick"])) : X("", !0)
|
|
2228
|
+
], 64))), 128)),
|
|
2229
|
+
b(V) ? (S(), $(b(ke), {
|
|
2230
|
+
key: 0,
|
|
2231
|
+
link: "",
|
|
2232
|
+
type: "primary",
|
|
2233
|
+
icon: a(b(m) ? "ArrowDown" : "ArrowUp"),
|
|
2234
|
+
style: { "padding-left": "0", border: "none" },
|
|
2235
|
+
onClick: b(ce)
|
|
2236
|
+
}, {
|
|
2237
|
+
default: z(() => [
|
|
2238
|
+
se(we(b(m) ? "展开" : "收起"), 1)
|
|
2239
|
+
]),
|
|
2240
|
+
_: 1
|
|
2241
|
+
}, 8, ["icon", "onClick"])) : X("", !0),
|
|
2242
|
+
b(T) ? (S(), $(b(Et), {
|
|
2243
|
+
key: 1,
|
|
2244
|
+
placement: "bottom-start"
|
|
2245
|
+
}, {
|
|
2246
|
+
dropdown: z(() => [
|
|
2247
|
+
J(b(Ot), null, {
|
|
2248
|
+
default: z(() => [
|
|
2249
|
+
J(b(He), { onClick: We }, {
|
|
2250
|
+
default: z(() => [...I[0] || (I[0] = [
|
|
2251
|
+
se("自定义查询", -1)
|
|
2252
|
+
])]),
|
|
2253
|
+
_: 1
|
|
2254
|
+
}),
|
|
2255
|
+
J(b(He), { onClick: Qe }, {
|
|
2256
|
+
default: z(() => [...I[1] || (I[1] = [
|
|
2257
|
+
se("自定义表格", -1)
|
|
2258
|
+
])]),
|
|
2259
|
+
_: 1
|
|
2260
|
+
}),
|
|
2261
|
+
J(b(He), { onClick: Ae }, {
|
|
2262
|
+
default: z(() => [...I[2] || (I[2] = [
|
|
2263
|
+
se("重置(刷新)", -1)
|
|
2264
|
+
])]),
|
|
2265
|
+
_: 1
|
|
2266
|
+
})
|
|
2267
|
+
]),
|
|
2268
|
+
_: 1
|
|
2269
|
+
})
|
|
2270
|
+
]),
|
|
2271
|
+
default: z(() => [
|
|
2272
|
+
J(b(ke), {
|
|
2273
|
+
link: "",
|
|
2274
|
+
type: "primary",
|
|
2275
|
+
style: { "margin-left": "2px", "margin-right": "5px", outline: "none" },
|
|
2276
|
+
icon: a("Tools")
|
|
2277
|
+
}, null, 8, ["icon"])
|
|
2278
|
+
]),
|
|
2279
|
+
_: 1
|
|
2280
|
+
})) : X("", !0)
|
|
2281
|
+
]),
|
|
2282
|
+
_: 1
|
|
2283
|
+
})
|
|
2284
|
+
])
|
|
2285
|
+
])) : X("", !0),
|
|
2286
|
+
!e.btnColSpanRow && e.configBtn.length ? (S(), $(b(Je), {
|
|
2287
|
+
key: 1,
|
|
2288
|
+
label: " ",
|
|
2289
|
+
"label-width": te.value.labelBtnWidth ? te.value.labelBtnWidth : te.value.labelWidth,
|
|
2290
|
+
class: ot([{ formItemCols: e.btnColSpanRow ? !0 : b(K) === 24 }, "btn-formItem"])
|
|
2291
|
+
}, {
|
|
2292
|
+
default: z(() => [
|
|
2293
|
+
G("div", {
|
|
2294
|
+
class: "buttonOperate",
|
|
2295
|
+
style: Re({ "text-align": b(K) === 24 ? "right" : "left" })
|
|
2296
|
+
}, [
|
|
2297
|
+
e.configBtn.length ? (S(!0), q(ae, { key: 0 }, Se(e.configBtn, (k, M) => (S(), q(ae, {
|
|
2298
|
+
key: k.key || M
|
|
2299
|
+
}, [
|
|
2300
|
+
s(k.permissionValue) ? (S(), $(b(ke), ne({
|
|
2301
|
+
key: 0,
|
|
2302
|
+
ref_for: !0
|
|
2303
|
+
}, x(k), {
|
|
2304
|
+
icon: a(k.icon),
|
|
2305
|
+
disabled: typeof k.disabled == "function" ? k.disabled() || !1 : k.disabled || !1,
|
|
2306
|
+
onClick: () => {
|
|
2307
|
+
var F;
|
|
2308
|
+
return k == null ? void 0 : k.click(e.model, _.value, (F = w.value) == null ? void 0 : F.httpRequestInstance);
|
|
2309
|
+
}
|
|
2310
|
+
}), {
|
|
2311
|
+
default: z(() => [
|
|
2312
|
+
se(we(k.name), 1)
|
|
2313
|
+
]),
|
|
2314
|
+
_: 2
|
|
2315
|
+
}, 1040, ["icon", "disabled", "onClick"])) : X("", !0)
|
|
2316
|
+
], 64))), 128)) : X("", !0),
|
|
2317
|
+
b(V) ? (S(), $(b(ke), {
|
|
2318
|
+
key: 1,
|
|
2319
|
+
type: "primary",
|
|
2320
|
+
link: "",
|
|
2321
|
+
icon: a(b(m) ? "ArrowDown" : "ArrowUp"),
|
|
2322
|
+
style: { "padding-left": "0", border: "none" },
|
|
2323
|
+
onClick: b(ce)
|
|
2324
|
+
}, {
|
|
2325
|
+
default: z(() => [
|
|
2326
|
+
se(we(b(m) ? "展开" : "收起"), 1)
|
|
2327
|
+
]),
|
|
2328
|
+
_: 1
|
|
2329
|
+
}, 8, ["icon", "onClick"])) : X("", !0),
|
|
2330
|
+
b(T) ? (S(), $(b(Et), {
|
|
2331
|
+
key: 2,
|
|
2332
|
+
placement: "bottom-start"
|
|
2333
|
+
}, {
|
|
2334
|
+
dropdown: z(() => [
|
|
2335
|
+
J(b(Ot), null, {
|
|
2336
|
+
default: z(() => [
|
|
2337
|
+
J(b(He), { onClick: We }, {
|
|
2338
|
+
default: z(() => [...I[3] || (I[3] = [
|
|
2339
|
+
se("自定义查询", -1)
|
|
2340
|
+
])]),
|
|
2341
|
+
_: 1
|
|
2342
|
+
}),
|
|
2343
|
+
J(b(He), { onClick: Qe }, {
|
|
2344
|
+
default: z(() => [...I[4] || (I[4] = [
|
|
2345
|
+
se("自定义表格", -1)
|
|
2346
|
+
])]),
|
|
2347
|
+
_: 1
|
|
2348
|
+
}),
|
|
2349
|
+
J(b(He), { onClick: Ae }, {
|
|
2350
|
+
default: z(() => [...I[5] || (I[5] = [
|
|
2351
|
+
se("重置(刷新)", -1)
|
|
2352
|
+
])]),
|
|
2353
|
+
_: 1
|
|
2354
|
+
})
|
|
2355
|
+
]),
|
|
2356
|
+
_: 1
|
|
2357
|
+
})
|
|
2358
|
+
]),
|
|
2359
|
+
default: z(() => [
|
|
2360
|
+
J(b(ke), {
|
|
2361
|
+
link: "",
|
|
2362
|
+
type: "primary",
|
|
2363
|
+
style: { "margin-left": "2px", "margin-right": "5px", outline: "none" },
|
|
2364
|
+
icon: a("Tools")
|
|
2365
|
+
}, null, 8, ["icon"])
|
|
2366
|
+
]),
|
|
2367
|
+
_: 1
|
|
2368
|
+
})) : X("", !0)
|
|
2369
|
+
], 4)
|
|
2370
|
+
]),
|
|
2371
|
+
_: 1
|
|
2372
|
+
}, 8, ["label-width", "class"])) : X("", !0)
|
|
2373
|
+
]),
|
|
2374
|
+
_: 1
|
|
2375
|
+
}, 8, ["span"]))
|
|
2376
|
+
], 64))
|
|
2377
|
+
]),
|
|
2378
|
+
_: 1
|
|
2379
|
+
}, 16)
|
|
2380
|
+
])
|
|
2381
|
+
]),
|
|
2382
|
+
_: 1
|
|
2383
|
+
}, 16));
|
|
2384
|
+
}
|
|
2385
|
+
}), ve = /* @__PURE__ */ De(ho, [["__scopeId", "data-v-490779d8"]]);
|
|
2386
|
+
ve.install = function(e) {
|
|
2387
|
+
e.component(ve.name, ve);
|
|
2388
|
+
};
|
|
2389
|
+
ve.isPlugin = !0;
|
|
2390
|
+
ve.Plugin = {
|
|
2391
|
+
install(e, r = {}) {
|
|
2392
|
+
e.provide("$esPlusForm", {
|
|
2393
|
+
...r.methods,
|
|
2394
|
+
useDialog: () => _e()
|
|
2395
|
+
}), e.component(ve.name, { ...ve, methods: { ...ve.methods, ...r.methods || {}, useDialog: () => _e() } });
|
|
2396
|
+
}
|
|
2397
|
+
};
|
|
2398
|
+
const yo = { class: "dp-dialog_wrapper" }, vo = { class: "dialog-title" }, bo = { class: "btns" }, ko = {
|
|
2399
|
+
key: 0,
|
|
2400
|
+
class: "dialog-footer"
|
|
2401
|
+
}, wo = /* @__PURE__ */ be({
|
|
2402
|
+
__name: "component",
|
|
2403
|
+
props: {
|
|
2404
|
+
title: {},
|
|
2405
|
+
visible: { type: Boolean },
|
|
2406
|
+
appendTo: {},
|
|
2407
|
+
hiddenFullBtn: { type: Boolean },
|
|
2408
|
+
width: {},
|
|
2409
|
+
isDraggable: { type: Boolean },
|
|
2410
|
+
confirmText: {},
|
|
2411
|
+
cancelText: {},
|
|
2412
|
+
configBtn: {},
|
|
2413
|
+
maxHeight: {},
|
|
2414
|
+
isHiddenFooter: { type: Boolean },
|
|
2415
|
+
renderHeader: { type: Function },
|
|
2416
|
+
renderFooter: { type: Function },
|
|
2417
|
+
render: { type: Function },
|
|
2418
|
+
fullscreen: { type: Boolean }
|
|
2419
|
+
},
|
|
2420
|
+
emits: ["update:visible", "closed", "submit"],
|
|
2421
|
+
setup(e, { emit: r }) {
|
|
2422
|
+
const d = e, t = r, o = $t(), n = Ke(), l = jt(), s = Object.fromEntries(Object.entries(yt).map(([f]) => [f, yt[f]])), u = A(null), p = tt({}), w = A(!1), c = n, y = A(qe), a = ue("$EsPlus", null) ?? Pe() ?? {}, x = (f) => {
|
|
2423
|
+
if (!f) return !0;
|
|
2424
|
+
const h = a.permission;
|
|
2425
|
+
return typeof h == "function" ? h(f) : !0;
|
|
2426
|
+
}, _ = ue("elLocale", null);
|
|
2427
|
+
_ && (y.value = _), ft("elLocale", y.value);
|
|
2428
|
+
const O = (f) => f ? s[f] || f : void 0, C = (f) => {
|
|
2429
|
+
const { icon: h, ...D } = f;
|
|
2430
|
+
return D;
|
|
2431
|
+
}, j = () => {
|
|
2432
|
+
setTimeout(() => {
|
|
2433
|
+
w.value && (w.value = !1);
|
|
2434
|
+
}, 500);
|
|
2435
|
+
}, W = () => {
|
|
2436
|
+
l != null && l.fullscreen || (w.value = !w.value);
|
|
2437
|
+
}, Q = () => {
|
|
2438
|
+
t("closed", !1), j();
|
|
2439
|
+
}, Y = () => {
|
|
2440
|
+
t("closed", !1), j();
|
|
2441
|
+
}, ee = R(() => {
|
|
2442
|
+
const { ...f } = l;
|
|
2443
|
+
return f;
|
|
2444
|
+
}), ie = R(() => w.value ? "dialogFull" : d.maxHeight ? "dialogShadow" : "dialogAuto"), te = () => {
|
|
2445
|
+
const f = window.innerHeight;
|
|
2446
|
+
return Math.max(f - 135, 200);
|
|
2447
|
+
}, oe = R(() => {
|
|
2448
|
+
const f = te();
|
|
2449
|
+
return w.value ? { height: f + "px" } : d.maxHeight ? { maxHeight: typeof d.maxHeight == "number" ? `${d.maxHeight}px` : d.maxHeight } : { maxHeight: f + "px" };
|
|
2450
|
+
}), fe = R({
|
|
2451
|
+
get: () => d.visible || !1,
|
|
2452
|
+
set: (f) => {
|
|
2453
|
+
t("update:visible", f), f || (t("closed", f), j());
|
|
2454
|
+
}
|
|
2455
|
+
}), m = R(() => ({
|
|
2456
|
+
renderBodyRefs: p.currentRef,
|
|
2457
|
+
renderBodyRefsObject: p,
|
|
2458
|
+
lyFormInstance: u,
|
|
2459
|
+
dialogInstance: c,
|
|
2460
|
+
getRefs: () => p
|
|
2461
|
+
}));
|
|
2462
|
+
return ft("bodyFormInstance", (f) => {
|
|
2463
|
+
u.value = f;
|
|
2464
|
+
}), n && (n.exposed = {
|
|
2465
|
+
closed: Q
|
|
2466
|
+
}), (f, h) => {
|
|
2467
|
+
var D;
|
|
2468
|
+
return S(), q("div", yo, [
|
|
2469
|
+
J(b(Cn), ne({
|
|
2470
|
+
class: ["dg-dialog", ie.value]
|
|
2471
|
+
}, ee.value, {
|
|
2472
|
+
modelValue: fe.value,
|
|
2473
|
+
"onUpdate:modelValue": h[0] || (h[0] = (T) => fe.value = T),
|
|
2474
|
+
draggable: d.isDraggable,
|
|
2475
|
+
width: d.width,
|
|
2476
|
+
"show-close": !1,
|
|
2477
|
+
onClose: Y,
|
|
2478
|
+
fullscreen: ((D = ee.value) == null ? void 0 : D.fullscreen) ?? w.value
|
|
2479
|
+
}), nt({
|
|
2480
|
+
header: z(() => [
|
|
2481
|
+
d.renderHeader ? (S(), $(ut, {
|
|
2482
|
+
key: 0,
|
|
2483
|
+
render: d.renderHeader,
|
|
2484
|
+
instance: m.value
|
|
2485
|
+
}, null, 8, ["render", "instance"])) : (S(), q(ae, { key: 1 }, [
|
|
2486
|
+
G("div", null, [
|
|
2487
|
+
G("span", vo, we(d.title), 1)
|
|
2488
|
+
]),
|
|
2489
|
+
G("div", bo, [
|
|
2490
|
+
kt(J(b(gt), { onClick: W }, {
|
|
2491
|
+
default: z(() => [
|
|
2492
|
+
w.value ? (S(), $(b(Rn), { key: 1 })) : (S(), $(b(In), { key: 0 }))
|
|
2493
|
+
]),
|
|
2494
|
+
_: 1
|
|
2495
|
+
}, 512), [
|
|
2496
|
+
[Nt, !d.hiddenFullBtn]
|
|
2497
|
+
]),
|
|
2498
|
+
J(b(gt), { onClick: Q }, {
|
|
2499
|
+
default: z(() => [
|
|
2500
|
+
J(b(Fn))
|
|
2501
|
+
]),
|
|
2502
|
+
_: 1
|
|
2503
|
+
})
|
|
2504
|
+
])
|
|
2505
|
+
], 64))
|
|
2506
|
+
]),
|
|
2507
|
+
default: z(() => [
|
|
2508
|
+
G("div", {
|
|
2509
|
+
class: "dialog_body_layouts",
|
|
2510
|
+
style: Re(oe.value)
|
|
2511
|
+
}, [
|
|
2512
|
+
d.render && typeof d.render == "function" ? (S(), $(ut, {
|
|
2513
|
+
key: 0,
|
|
2514
|
+
refs: p,
|
|
2515
|
+
instance: m.value,
|
|
2516
|
+
render: d.render,
|
|
2517
|
+
components: { EsTable: b(de), EsForm: b(ve) },
|
|
2518
|
+
locale: y.value
|
|
2519
|
+
}, null, 8, ["refs", "instance", "render", "components", "locale"])) : X("", !0)
|
|
2520
|
+
], 4)
|
|
2521
|
+
]),
|
|
2522
|
+
_: 2
|
|
2523
|
+
}, [
|
|
2524
|
+
b(l).isHiddenFooter ? void 0 : {
|
|
2525
|
+
name: "footer",
|
|
2526
|
+
fn: z(() => [
|
|
2527
|
+
o.footer ? Ee(f.$slots, "footer", { key: 1 }, void 0, !0) : (S(), q("span", ko, [
|
|
2528
|
+
d.renderFooter && typeof d.renderFooter == "function" ? (S(), $(ut, {
|
|
2529
|
+
key: 0,
|
|
2530
|
+
render: d.renderFooter,
|
|
2531
|
+
instance: m.value
|
|
2532
|
+
}, null, 8, ["render", "instance"])) : d.configBtn && d.configBtn.length ? (S(!0), q(ae, { key: 1 }, Se(e.configBtn, (T, P) => (S(), q(ae, {
|
|
2533
|
+
key: T.key || P
|
|
2534
|
+
}, [
|
|
2535
|
+
x(T.permissionValue) ? (S(), $(b(ke), ne({
|
|
2536
|
+
key: 0,
|
|
2537
|
+
size: "small"
|
|
2538
|
+
}, { ref_for: !0 }, C(T), {
|
|
2539
|
+
icon: O(T.icon),
|
|
2540
|
+
disabled: typeof T.disabled == "function" ? T.disabled() : T.disabled || !1,
|
|
2541
|
+
onClick: () => {
|
|
2542
|
+
var V;
|
|
2543
|
+
(V = T.click) == null || V.call(T, p.currentRef, {
|
|
2544
|
+
close: Q,
|
|
2545
|
+
getRefs: (K) => K ? p[K] || null : p,
|
|
2546
|
+
dialogInstance: b(c)
|
|
2547
|
+
});
|
|
2548
|
+
}
|
|
2549
|
+
}), {
|
|
2550
|
+
default: z(() => [
|
|
2551
|
+
se(we(T.name), 1)
|
|
2552
|
+
]),
|
|
2553
|
+
_: 2
|
|
2554
|
+
}, 1040, ["icon", "disabled", "onClick"])) : X("", !0)
|
|
2555
|
+
], 64))), 128)) : X("", !0)
|
|
2556
|
+
]))
|
|
2557
|
+
]),
|
|
2558
|
+
key: "0"
|
|
2559
|
+
}
|
|
2560
|
+
]), 1040, ["class", "modelValue", "draggable", "width", "fullscreen"])
|
|
2561
|
+
]);
|
|
2562
|
+
};
|
|
2563
|
+
}
|
|
2564
|
+
}), Ne = /* @__PURE__ */ De(wo, [["__scopeId", "data-v-8464358d"]]);
|
|
2565
|
+
Ne.install = function(e) {
|
|
2566
|
+
e.component(Ne.name, Ne);
|
|
2567
|
+
};
|
|
2568
|
+
const So = { class: "es-crud-page" }, xo = /* @__PURE__ */ be({
|
|
2569
|
+
name: "EsCrudPage",
|
|
2570
|
+
__name: "es-crud-page",
|
|
2571
|
+
props: {
|
|
2572
|
+
schema: {},
|
|
2573
|
+
httpRequest: {},
|
|
2574
|
+
autoLoad: { type: Boolean, default: !0 }
|
|
2575
|
+
},
|
|
2576
|
+
emits: ["query", "add", "edit", "delete", "view", "export", "row-click", "btn-click", "dialog-confirm", "dialog-cancel", "dialog-open"],
|
|
2577
|
+
setup(e, { expose: r, emit: d }) {
|
|
2578
|
+
const t = e, o = d, n = A(null), l = A(null), s = A([]), u = tt({});
|
|
2579
|
+
Ie(
|
|
2580
|
+
() => t.schema.formItems,
|
|
2581
|
+
(m) => {
|
|
2582
|
+
m && m.forEach((f) => {
|
|
2583
|
+
f.prop && !(f.prop in u) && (u[f.prop] = "");
|
|
2584
|
+
});
|
|
2585
|
+
},
|
|
2586
|
+
{ immediate: !0 }
|
|
2587
|
+
);
|
|
2588
|
+
const p = A({
|
|
2589
|
+
current: 1,
|
|
2590
|
+
pageSize: 10,
|
|
2591
|
+
total: 0,
|
|
2592
|
+
...t.schema.pagination || {}
|
|
2593
|
+
}), w = R(() => {
|
|
2594
|
+
var D, T;
|
|
2595
|
+
if (t.schema.dialogs) return t.schema.dialogs;
|
|
2596
|
+
if (!((D = t.schema.dialogFormItems) != null && D.length)) return {};
|
|
2597
|
+
const m = {
|
|
2598
|
+
width: ((T = t.schema.dialogOptions) == null ? void 0 : T.width) || "600px",
|
|
2599
|
+
formItems: t.schema.dialogFormItems,
|
|
2600
|
+
...t.schema.dialogOptions || {}
|
|
2601
|
+
}, f = {}, h = t.schema.actions || ["add", "edit", "delete"];
|
|
2602
|
+
return h.includes("add") && (f.add = { ...m, title: "新增" }), h.includes("edit") && (f.edit = { ...m, title: "编辑" }), h.includes("view") && (f.view = { ...m, title: "查看", isHiddenFooter: !0 }), f;
|
|
2603
|
+
}), c = R(() => {
|
|
2604
|
+
if (t.schema.toolbarBtns) return t.schema.toolbarBtns;
|
|
2605
|
+
if (t.schema.dialogs || t.schema.operationColumn !== void 0) return [];
|
|
2606
|
+
const m = t.schema.actions || ["add", "edit", "delete"], f = [];
|
|
2607
|
+
return m.includes("add") && f.push({ name: "新增", type: "primary", key: "add", icon: "Plus", dialogKey: "add" }), m.includes("export") && f.push({ name: "导出", key: "export", icon: "Download", actionType: "export" }), m.includes("import") && f.push({ name: "导入", key: "import", icon: "Upload", actionType: "import" }), f;
|
|
2608
|
+
}), y = R(() => {
|
|
2609
|
+
var T;
|
|
2610
|
+
if (t.schema.operationColumn !== void 0) return t.schema.operationColumn;
|
|
2611
|
+
const m = t.schema.actions || ["add", "edit", "delete"];
|
|
2612
|
+
if ((T = t.schema.columns) == null ? void 0 : T.some((P) => P.prop === "action" || P.prop === "operate" || P.btns)) return;
|
|
2613
|
+
if (m.filter((P) => ["edit", "delete", "view"].includes(P)).length === 0) return !1;
|
|
2614
|
+
const D = [];
|
|
2615
|
+
return m.includes("view") && D.push({ name: "查看", type: "primary", key: "view", dialogKey: "view" }), m.includes("edit") && D.push({ name: "编辑", type: "primary", key: "edit", dialogKey: "edit" }), m.includes("delete") && D.push({ name: "删除", type: "danger", key: "delete", confirm: "确定删除该条数据吗?" }), {
|
|
2616
|
+
label: "操作",
|
|
2617
|
+
width: D.length * 80 + 20,
|
|
2618
|
+
fixed: "right",
|
|
2619
|
+
btns: D
|
|
2620
|
+
};
|
|
2621
|
+
}), a = R(() => {
|
|
2622
|
+
if (t.schema.queryBtns) return t.schema.queryBtns;
|
|
2623
|
+
const m = [
|
|
2624
|
+
{ name: "查询", type: "primary", key: "query", triggerEvent: !0 },
|
|
2625
|
+
{ name: "重置", key: "rest", triggerEvent: !0 }
|
|
2626
|
+
], f = c.value.map((h) => {
|
|
2627
|
+
const D = { ...h };
|
|
2628
|
+
return D.click || (D.click = () => j(h)), D;
|
|
2629
|
+
});
|
|
2630
|
+
return [...m, ...f];
|
|
2631
|
+
}), x = R(() => {
|
|
2632
|
+
const m = [...t.schema.columns || []], f = y.value;
|
|
2633
|
+
if (f === !1 || f === void 0) return m;
|
|
2634
|
+
const h = f.btns.map((D) => ({
|
|
2635
|
+
name: D.name,
|
|
2636
|
+
type: D.type,
|
|
2637
|
+
permissionValue: D.permissionValue,
|
|
2638
|
+
clickEvent: (T) => W(D, T)
|
|
2639
|
+
}));
|
|
2640
|
+
return m.push({
|
|
2641
|
+
prop: "operate",
|
|
2642
|
+
label: f.label || "操作",
|
|
2643
|
+
width: f.width || h.length * 80 + 20,
|
|
2644
|
+
fixed: f.fixed || "right",
|
|
2645
|
+
btns: h
|
|
2646
|
+
}), m;
|
|
2647
|
+
}), _ = R(() => {
|
|
2648
|
+
var m;
|
|
2649
|
+
return (m = t.schema.tableBtns) != null && m.length ? t.schema.tableBtns.map((f) => ({
|
|
2650
|
+
name: f.name,
|
|
2651
|
+
type: f.type,
|
|
2652
|
+
size: f.size || "small",
|
|
2653
|
+
icon: f.icon,
|
|
2654
|
+
code: f.code || 1,
|
|
2655
|
+
permissionValue: f.permissionValue,
|
|
2656
|
+
loading: f.loading,
|
|
2657
|
+
disabled: f.disabled,
|
|
2658
|
+
click: () => j(f)
|
|
2659
|
+
})) : [];
|
|
2660
|
+
}), O = R(() => {
|
|
2661
|
+
const m = {
|
|
2662
|
+
border: !0,
|
|
2663
|
+
isInitRun: t.autoLoad,
|
|
2664
|
+
...t.schema.tableOptions || {}
|
|
2665
|
+
};
|
|
2666
|
+
t.httpRequest && (m.httpRequest = t.httpRequest);
|
|
2667
|
+
const f = _.value;
|
|
2668
|
+
if (f.length > 0) {
|
|
2669
|
+
const h = m.configBtn || [];
|
|
2670
|
+
m.configBtn = [...h, ...f];
|
|
2671
|
+
}
|
|
2672
|
+
return m;
|
|
2673
|
+
}), C = R(() => {
|
|
2674
|
+
const m = t.schema.formLayout;
|
|
2675
|
+
if (m)
|
|
2676
|
+
return {
|
|
2677
|
+
rowLayProps: { gutter: 16 },
|
|
2678
|
+
fromLayProps: {
|
|
2679
|
+
labelBtnWidth: m.labelWidth,
|
|
2680
|
+
...m.minFoldRows ? { minFoldRows: m.minFoldRows } : {}
|
|
2681
|
+
}
|
|
2682
|
+
};
|
|
2683
|
+
});
|
|
2684
|
+
async function j(m) {
|
|
2685
|
+
const f = m.key || m.actionType || "";
|
|
2686
|
+
if (m.confirm) {
|
|
2687
|
+
const h = typeof m.confirm == "string" ? m.confirm : "确定执行此操作吗?";
|
|
2688
|
+
try {
|
|
2689
|
+
await Tt.confirm(h, "提示", { type: "warning" });
|
|
2690
|
+
} catch {
|
|
2691
|
+
return;
|
|
2692
|
+
}
|
|
2693
|
+
}
|
|
2694
|
+
if (m.dialogKey) {
|
|
2695
|
+
f === "add" && o("add"), Y(m.dialogKey);
|
|
2696
|
+
return;
|
|
2697
|
+
}
|
|
2698
|
+
f === "export" || m.actionType === "export" ? o("export", { ...u }) : f === "add" && o("add"), o("btn-click", f, { ...u });
|
|
2699
|
+
}
|
|
2700
|
+
async function W(m, f) {
|
|
2701
|
+
const h = m.key || "";
|
|
2702
|
+
if (m.confirm) {
|
|
2703
|
+
const D = typeof m.confirm == "string" ? m.confirm : "确定执行此操作吗?";
|
|
2704
|
+
try {
|
|
2705
|
+
await Tt.confirm(D, "提示", { type: "warning" });
|
|
2706
|
+
} catch {
|
|
2707
|
+
return;
|
|
2708
|
+
}
|
|
2709
|
+
}
|
|
2710
|
+
if (m.click) {
|
|
2711
|
+
m.click(f, {
|
|
2712
|
+
refresh: oe,
|
|
2713
|
+
getSelectedRows: fe,
|
|
2714
|
+
openDialog: Y
|
|
2715
|
+
});
|
|
2716
|
+
return;
|
|
2717
|
+
}
|
|
2718
|
+
if (m.dialogKey) {
|
|
2719
|
+
Y(m.dialogKey, f);
|
|
2720
|
+
return;
|
|
2721
|
+
}
|
|
2722
|
+
h === "edit" ? o("edit", f) : h === "delete" ? o("delete", f) : h === "view" && o("view", f), o("btn-click", h, f);
|
|
2723
|
+
}
|
|
2724
|
+
const Q = /* @__PURE__ */ new Map();
|
|
2725
|
+
function Y(m, f) {
|
|
2726
|
+
var K;
|
|
2727
|
+
const h = w.value[m];
|
|
2728
|
+
if (!h) return;
|
|
2729
|
+
o("dialog-open", m, f);
|
|
2730
|
+
const D = _e();
|
|
2731
|
+
Q.set(m, D);
|
|
2732
|
+
const T = tt({});
|
|
2733
|
+
h.formItems && h.formItems.forEach((N) => {
|
|
2734
|
+
N.prop && (T[N.prop] = (f == null ? void 0 : f[N.prop]) ?? "");
|
|
2735
|
+
});
|
|
2736
|
+
const P = typeof h.title == "function" ? h.title(f) : h.title || "";
|
|
2737
|
+
(K = h.onOpen) == null || K.call(h, f);
|
|
2738
|
+
const V = ie(m, h, T, f || {});
|
|
2739
|
+
D({
|
|
2740
|
+
title: P,
|
|
2741
|
+
width: h.width || "600px",
|
|
2742
|
+
isDraggable: h.isDraggable,
|
|
2743
|
+
maxHeight: h.maxHeight,
|
|
2744
|
+
fullscreen: h.fullscreen,
|
|
2745
|
+
isHiddenFooter: h.isHiddenFooter,
|
|
2746
|
+
render: h.render ? (N, ce) => h.render(N, {
|
|
2747
|
+
row: f || {},
|
|
2748
|
+
model: T,
|
|
2749
|
+
registerRef: ce.registerRef,
|
|
2750
|
+
close: () => ee(m),
|
|
2751
|
+
refresh: oe
|
|
2752
|
+
}) : h.formItems ? (N, { registerRef: ce }) => N(ve, {
|
|
2753
|
+
ref: (pe) => pe && ce("dialogForm", pe),
|
|
2754
|
+
model: T,
|
|
2755
|
+
formItemList: h.formItems,
|
|
2756
|
+
layoutFormProps: {
|
|
2757
|
+
rowLayProps: { gutter: 16 },
|
|
2758
|
+
fromLayProps: {
|
|
2759
|
+
isBtnHidden: !0,
|
|
2760
|
+
...h.formLayout || {}
|
|
2761
|
+
}
|
|
2762
|
+
}
|
|
2763
|
+
}) : void 0,
|
|
2764
|
+
configBtn: V,
|
|
2765
|
+
onClosed: () => {
|
|
2766
|
+
var N;
|
|
2767
|
+
Q.delete(m), (N = h.onClose) == null || N.call(h);
|
|
2768
|
+
}
|
|
2769
|
+
});
|
|
2770
|
+
}
|
|
2771
|
+
function ee(m) {
|
|
2772
|
+
const f = Q.get(m);
|
|
2773
|
+
f && (f.close(), Q.delete(m));
|
|
2774
|
+
}
|
|
2775
|
+
function ie(m, f, h, D) {
|
|
2776
|
+
if (!f.isHiddenFooter)
|
|
2777
|
+
return f.configBtn ? f.configBtn.map((T) => T.action === "cancel" ? {
|
|
2778
|
+
...T,
|
|
2779
|
+
click: (P, { close: V }) => {
|
|
2780
|
+
o("dialog-cancel", m), V();
|
|
2781
|
+
}
|
|
2782
|
+
} : T.action === "confirm" ? {
|
|
2783
|
+
...T,
|
|
2784
|
+
click: async (P, { close: V, getRefs: K }) => {
|
|
2785
|
+
await te(m, f, h, D, V, K);
|
|
2786
|
+
}
|
|
2787
|
+
} : T) : [
|
|
2788
|
+
{
|
|
2789
|
+
name: "取消",
|
|
2790
|
+
click: (T, { close: P }) => {
|
|
2791
|
+
o("dialog-cancel", m), P();
|
|
2792
|
+
}
|
|
2793
|
+
},
|
|
2794
|
+
{
|
|
2795
|
+
name: "确定",
|
|
2796
|
+
type: "primary",
|
|
2797
|
+
click: async (T, { close: P, getRefs: V }) => {
|
|
2798
|
+
await te(m, f, h, D, P, V);
|
|
2799
|
+
}
|
|
2800
|
+
}
|
|
2801
|
+
];
|
|
2802
|
+
}
|
|
2803
|
+
async function te(m, f, h, D, T, P) {
|
|
2804
|
+
var K;
|
|
2805
|
+
if ((K = f.formItems) != null && K.length) {
|
|
2806
|
+
const N = P("dialogForm");
|
|
2807
|
+
N != null && N.validate && await N.validate();
|
|
2808
|
+
}
|
|
2809
|
+
const V = { close: T, refresh: oe, getRefs: P, row: D };
|
|
2810
|
+
if (f.onConfirm)
|
|
2811
|
+
await f.onConfirm(h, V);
|
|
2812
|
+
else {
|
|
2813
|
+
const N = m === "add" ? "add-confirm" : m === "edit" ? "edit-confirm" : `${m}-confirm`;
|
|
2814
|
+
o("btn-click", N, h), T(), oe();
|
|
2815
|
+
}
|
|
2816
|
+
o("dialog-confirm", m, h);
|
|
2817
|
+
}
|
|
2818
|
+
function oe() {
|
|
2819
|
+
var m, f;
|
|
2820
|
+
(f = (m = n.value) == null ? void 0 : m.httpRequestInstance) == null || f.call(m);
|
|
2821
|
+
}
|
|
2822
|
+
function fe() {
|
|
2823
|
+
var m, f;
|
|
2824
|
+
return ((f = (m = n.value) == null ? void 0 : m.getSelectionRows) == null ? void 0 : f.call(m)) || [];
|
|
2825
|
+
}
|
|
2826
|
+
return r({
|
|
2827
|
+
refresh: oe,
|
|
2828
|
+
getSelectedRows: fe,
|
|
2829
|
+
tableRef: n,
|
|
2830
|
+
formRef: l,
|
|
2831
|
+
queryModel: u,
|
|
2832
|
+
openDialog: Y,
|
|
2833
|
+
closeDialog: ee
|
|
2834
|
+
}), (m, f) => (S(), q("div", So, [
|
|
2835
|
+
J(de, ne({
|
|
2836
|
+
ref_key: "tableRef",
|
|
2837
|
+
ref: n,
|
|
2838
|
+
columns: x.value,
|
|
2839
|
+
options: O.value,
|
|
2840
|
+
"data-source": s.value,
|
|
2841
|
+
"onUpdate:dataSource": f[0] || (f[0] = (h) => s.value = h),
|
|
2842
|
+
pagination: p.value,
|
|
2843
|
+
"onUpdate:pagination": f[1] || (f[1] = (h) => p.value = h)
|
|
2844
|
+
}, m.$attrs), nt({
|
|
2845
|
+
default: z(() => [
|
|
2846
|
+
e.schema.formItems && e.schema.formItems.length ? (S(), $(ve, {
|
|
2847
|
+
key: 0,
|
|
2848
|
+
ref_key: "formRef",
|
|
2849
|
+
ref: l,
|
|
2850
|
+
model: u,
|
|
2851
|
+
"form-item-list": e.schema.formItems,
|
|
2852
|
+
"config-btn": a.value,
|
|
2853
|
+
"layout-form-props": C.value
|
|
2854
|
+
}, null, 8, ["model", "form-item-list", "config-btn", "layout-form-props"])) : X("", !0)
|
|
2855
|
+
]),
|
|
2856
|
+
_: 2
|
|
2857
|
+
}, [
|
|
2858
|
+
Se(m.$slots, (h, D) => ({
|
|
2859
|
+
name: D,
|
|
2860
|
+
fn: z((T) => [
|
|
2861
|
+
Ee(m.$slots, D, Be(qt(T || {})), void 0, !0)
|
|
2862
|
+
])
|
|
2863
|
+
}))
|
|
2864
|
+
]), 1040, ["columns", "options", "data-source", "pagination"])
|
|
2865
|
+
]));
|
|
2866
|
+
}
|
|
2867
|
+
}), Ze = /* @__PURE__ */ De(xo, [["__scopeId", "data-v-7dea095a"]]);
|
|
2868
|
+
Ze.install = function(e) {
|
|
2869
|
+
e.component(Ze.name, Ze);
|
|
2870
|
+
};
|
|
2871
|
+
const Co = ["xlink:href"], Io = /* @__PURE__ */ be({
|
|
2872
|
+
__name: "svg-icon",
|
|
2873
|
+
props: {
|
|
2874
|
+
iconClass: {},
|
|
2875
|
+
className: {}
|
|
2876
|
+
},
|
|
2877
|
+
setup(e) {
|
|
2878
|
+
const r = e, d = R(() => l(r.iconClass)), t = R(() => `#icon-${r.iconClass}`), o = R(() => r.className ? "svg-icon " + r.className : "svg-icon"), n = R(() => ({
|
|
2879
|
+
mask: `url(${r.iconClass}) no-repeat 50% 50%`,
|
|
2880
|
+
"-webkit-mask": `url(${r.iconClass}) no-repeat 50% 50%`
|
|
2881
|
+
})), l = (s) => /^(https?:|mailto:|tel:|open)/.test(s);
|
|
2882
|
+
return (s, u) => d.value ? (S(), q("div", {
|
|
2883
|
+
key: 0,
|
|
2884
|
+
style: Re(n.value),
|
|
2885
|
+
class: "svg-external-icon svg-icon"
|
|
2886
|
+
}, null, 4)) : (S(), q("svg", {
|
|
2887
|
+
key: 1,
|
|
2888
|
+
class: ot(o.value),
|
|
2889
|
+
"aria-hidden": "true"
|
|
2890
|
+
}, [
|
|
2891
|
+
G("use", { "xlink:href": t.value }, null, 8, Co)
|
|
2892
|
+
], 2));
|
|
2893
|
+
}
|
|
2894
|
+
}), et = /* @__PURE__ */ De(Io, [["__scopeId", "data-v-50f5fe3f"]]);
|
|
2895
|
+
et.install = function(e) {
|
|
2896
|
+
e.component(et.name, et);
|
|
2897
|
+
};
|
|
2898
|
+
const At = [Ne, ve, de, Ze, et], Ro = (e, r = {}) => {
|
|
2899
|
+
Bn(r), r.skipComponentRegistration || At.forEach((d) => {
|
|
2900
|
+
d.name && e.component(d.name, d);
|
|
2901
|
+
}), r.globalProperties !== !1 && (e.config.globalProperties.$useDialog = _e, At.forEach((d) => {
|
|
2902
|
+
d.isPlugin && d.Plugin && e.use(d.Plugin, r[d.name] || {});
|
|
2903
|
+
})), e.provide("$EsPlus", {
|
|
2904
|
+
useDialog: _e,
|
|
2905
|
+
...r
|
|
2906
|
+
});
|
|
2907
|
+
}, Eo = {
|
|
2908
|
+
version: Pn,
|
|
2909
|
+
install: Ro
|
|
2910
|
+
};
|
|
2911
|
+
export {
|
|
2912
|
+
Ze as EsCrudPage,
|
|
2913
|
+
Ne as EsDialog,
|
|
2914
|
+
ve as EsForm,
|
|
2915
|
+
de as EsTable,
|
|
2916
|
+
et as SvgIcon,
|
|
2917
|
+
Bn as configureEsPlus,
|
|
2918
|
+
Eo as default,
|
|
2919
|
+
Ro as install,
|
|
2920
|
+
_e as useDialog
|
|
2921
|
+
};
|
|
2922
|
+
//# sourceMappingURL=es-plus.js.map
|