@ys-knife-crud/element-plus 0.0.1 → 0.0.2
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 +328 -0
- package/dist/element-plus/src/index.d.ts +4 -1
- package/dist/element-plus/src/index.d.ts.map +1 -1
- package/dist/element-plus/src/modal/openDialog.d.ts +25 -0
- package/dist/element-plus/src/modal/openDialog.d.ts.map +1 -0
- package/dist/element-plus/src/modal/openModal.d.ts +5 -0
- package/dist/element-plus/src/modal/openModal.d.ts.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +1608 -1378
- package/dist/index.js.map +1 -1
- package/package.json +5 -4
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useExportExcel as
|
|
3
|
-
import { ElMessage as fe, ElMessageBox as
|
|
4
|
-
import { isConditionGroup as
|
|
5
|
-
import { fromArray as
|
|
6
|
-
import
|
|
7
|
-
import './index.css';const
|
|
1
|
+
import { defineComponent as Z, toRef as ve, computed as Q, resolveComponent as C, openBlock as n, createElementBlock as g, Fragment as L, createVNode as p, isRef as Se, unref as u, withCtx as o, createElementVNode as y, renderList as te, createBlock as h, createTextVNode as V, toDisplayString as z, createCommentVNode as R, resolveDynamicComponent as Qe, normalizeClass as $e, renderSlot as ne, Teleport as Mt, withModifiers as dt, normalizeStyle as ct, ref as Y, onMounted as Me, watch as me, useSlots as At, onBeforeUnmount as Ge, createSlots as Be, Transition as Rt, resolveDirective as pt, withDirectives as Xe, mergeProps as Ze, inject as mt, provide as ft, withKeys as je, nextTick as Ke, shallowRef as Pt, normalizeProps as Ie, guardReactiveProps as Te, createStaticVNode as nt, h as ye, isVNode as zt, render as ot } from "vue";
|
|
2
|
+
import { useExportExcel as Bt, useCustomConfig as Dt, visibleActions as et, isEnabled as vt, useDefault as Et, useSelection as It, useRowActions as Tt, filterNodesByKeyword as Qt, collectGroupKeys as Yt, useMainPanelNodes as Nt, useMainPanelTabs as qt, findNode as at, isGroupNode as st, useAdvancedFilter as yt, useFilterPanel as Ot, FilterPanelKey as gt, useTextFilterItem as Ut, useDateFilterItem as Lt, useDateRangeFilterItem as Ht, useEnumFilterItem as Kt, useImportExcel as jt, getDefaultModalAppContext as Gt, setDefaultModalAppContext as Wt } from "@ys-knife-crud/vue";
|
|
3
|
+
import { ElMessage as fe, ElMessageBox as kt, ElDialog as Jt, ElButton as Xt } from "element-plus";
|
|
4
|
+
import { isConditionGroup as tt, OPERATOR_LABELS as Zt, isNullOperator as el, emptyFilter as lt } from "@ys-knife-crud/core";
|
|
5
|
+
import { fromArray as yo, fromBool as go, fromObjectItems as ko, fromOptions as _o } from "@ys-knife-crud/core";
|
|
6
|
+
import it from "dayjs";
|
|
7
|
+
import './index.css';const tl = { class: "export-options" }, ll = { class: "export-progress-text" }, nl = { class: "export-cancelled-text" }, ol = /* @__PURE__ */ Z({
|
|
8
8
|
__name: "exportExcelDialog",
|
|
9
9
|
props: {
|
|
10
10
|
dataFun: { type: Function },
|
|
@@ -18,24 +18,24 @@ import './index.css';const Kt = { class: "export-options" }, jt = { class: "expo
|
|
|
18
18
|
exportPageSize: {},
|
|
19
19
|
hasMorePage: { type: Boolean }
|
|
20
20
|
},
|
|
21
|
-
setup(e, { expose:
|
|
21
|
+
setup(e, { expose: m }) {
|
|
22
22
|
const t = e, {
|
|
23
23
|
exportOptions: l,
|
|
24
24
|
exportDialogVisible: a,
|
|
25
25
|
exporting: k,
|
|
26
|
-
exportFetched:
|
|
27
|
-
exportTotal:
|
|
28
|
-
exportTotalKnown:
|
|
26
|
+
exportFetched: r,
|
|
27
|
+
exportTotal: $,
|
|
28
|
+
exportTotalKnown: f,
|
|
29
29
|
exportEtaSeconds: x,
|
|
30
30
|
exportPercent: S,
|
|
31
|
-
exportCancelledVisible:
|
|
32
|
-
exportCancelledRows:
|
|
33
|
-
onExportClick:
|
|
31
|
+
exportCancelledVisible: P,
|
|
32
|
+
exportCancelledRows: H,
|
|
33
|
+
onExportClick: A,
|
|
34
34
|
doExport: b,
|
|
35
35
|
cancelExport: _,
|
|
36
|
-
keepPartialExport:
|
|
36
|
+
keepPartialExport: N,
|
|
37
37
|
discardPartialExport: T
|
|
38
|
-
} =
|
|
38
|
+
} = Bt({
|
|
39
39
|
props: t,
|
|
40
40
|
// reactive — dataFun/exportSelected/exportorFunc 自动追踪
|
|
41
41
|
tableName: ve(t, "tableName"),
|
|
@@ -45,33 +45,33 @@ import './index.css';const Kt = { class: "export-options" }, jt = { class: "expo
|
|
|
45
45
|
total: ve(t, "total"),
|
|
46
46
|
exportPageSize: ve(t, "exportPageSize"),
|
|
47
47
|
hasMorePage: ve(t, "hasMorePage")
|
|
48
|
-
}),
|
|
49
|
-
const
|
|
50
|
-
if (
|
|
51
|
-
if (
|
|
52
|
-
const
|
|
53
|
-
return
|
|
48
|
+
}), U = Q(() => {
|
|
49
|
+
const G = x.value;
|
|
50
|
+
if (G == null) return null;
|
|
51
|
+
if (G < 60) return `${G} 秒`;
|
|
52
|
+
const s = Math.floor(G / 60), v = G % 60;
|
|
53
|
+
return v > 0 ? `${s} 分 ${v} 秒` : `${s} 分`;
|
|
54
54
|
});
|
|
55
|
-
return
|
|
56
|
-
const
|
|
57
|
-
return n(),
|
|
58
|
-
|
|
59
|
-
modelValue:
|
|
60
|
-
"onUpdate:modelValue":
|
|
55
|
+
return m({ openExportDialog: A }), (G, s) => {
|
|
56
|
+
const v = C("el-button"), F = C("el-dialog"), q = C("el-progress");
|
|
57
|
+
return n(), g(L, null, [
|
|
58
|
+
p(F, {
|
|
59
|
+
modelValue: u(a),
|
|
60
|
+
"onUpdate:modelValue": s[0] || (s[0] = (E) => Se(a) ? a.value = E : null),
|
|
61
61
|
title: "导出 Excel",
|
|
62
62
|
width: "420px"
|
|
63
63
|
}, {
|
|
64
64
|
default: o(() => [
|
|
65
|
-
|
|
66
|
-
(n(!0),
|
|
65
|
+
y("div", tl, [
|
|
66
|
+
(n(!0), g(L, null, te(u(l), (E) => (n(), h(v, {
|
|
67
67
|
key: E.value,
|
|
68
68
|
class: "export-option",
|
|
69
69
|
"data-scope": E.value,
|
|
70
70
|
disabled: E.disabled,
|
|
71
|
-
onClick: (ue) =>
|
|
71
|
+
onClick: (ue) => u(b)(E.value)
|
|
72
72
|
}, {
|
|
73
73
|
default: o(() => [
|
|
74
|
-
|
|
74
|
+
V(z(E.label), 1)
|
|
75
75
|
]),
|
|
76
76
|
_: 2
|
|
77
77
|
}, 1032, ["data-scope", "disabled", "onClick"]))), 128))
|
|
@@ -79,81 +79,81 @@ import './index.css';const Kt = { class: "export-options" }, jt = { class: "expo
|
|
|
79
79
|
]),
|
|
80
80
|
_: 1
|
|
81
81
|
}, 8, ["modelValue"]),
|
|
82
|
-
|
|
83
|
-
modelValue:
|
|
84
|
-
"onUpdate:modelValue":
|
|
82
|
+
p(F, {
|
|
83
|
+
modelValue: u(k),
|
|
84
|
+
"onUpdate:modelValue": s[1] || (s[1] = (E) => Se(k) ? k.value = E : null),
|
|
85
85
|
title: "正在导出",
|
|
86
86
|
width: "420px",
|
|
87
87
|
"close-on-click-modal": !1,
|
|
88
88
|
"show-close": !1
|
|
89
89
|
}, {
|
|
90
90
|
footer: o(() => [
|
|
91
|
-
|
|
91
|
+
p(v, {
|
|
92
92
|
class: "export-cancel",
|
|
93
|
-
onClick:
|
|
93
|
+
onClick: u(_)
|
|
94
94
|
}, {
|
|
95
|
-
default: o(() => [...
|
|
96
|
-
|
|
95
|
+
default: o(() => [...s[4] || (s[4] = [
|
|
96
|
+
V("取消", -1)
|
|
97
97
|
])]),
|
|
98
98
|
_: 1
|
|
99
99
|
}, 8, ["onClick"])
|
|
100
100
|
]),
|
|
101
101
|
default: o(() => [
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
], 64)) :
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
], 64)) :
|
|
102
|
+
p(q, { percentage: u(S) }, null, 8, ["percentage"]),
|
|
103
|
+
y("p", ll, [
|
|
104
|
+
V(" 已加载 " + z(u(r)), 1),
|
|
105
|
+
u(f) ? (n(), g(L, { key: 0 }, [
|
|
106
|
+
V(" / " + z(u($)), 1)
|
|
107
|
+
], 64)) : R("", !0),
|
|
108
|
+
s[3] || (s[3] = V(" 条", -1)),
|
|
109
|
+
U.value ? (n(), g(L, { key: 1 }, [
|
|
110
|
+
V(",预计剩余约 " + z(U.value), 1)
|
|
111
|
+
], 64)) : R("", !0)
|
|
112
112
|
])
|
|
113
113
|
]),
|
|
114
114
|
_: 1
|
|
115
115
|
}, 8, ["modelValue"]),
|
|
116
|
-
|
|
117
|
-
modelValue:
|
|
118
|
-
"onUpdate:modelValue":
|
|
116
|
+
p(F, {
|
|
117
|
+
modelValue: u(P),
|
|
118
|
+
"onUpdate:modelValue": s[2] || (s[2] = (E) => Se(P) ? P.value = E : null),
|
|
119
119
|
title: "导出已取消",
|
|
120
120
|
width: "420px"
|
|
121
121
|
}, {
|
|
122
122
|
footer: o(() => [
|
|
123
|
-
|
|
123
|
+
p(v, {
|
|
124
124
|
class: "export-discard",
|
|
125
|
-
onClick:
|
|
125
|
+
onClick: u(T)
|
|
126
126
|
}, {
|
|
127
|
-
default: o(() => [...
|
|
128
|
-
|
|
127
|
+
default: o(() => [...s[5] || (s[5] = [
|
|
128
|
+
V("丢弃", -1)
|
|
129
129
|
])]),
|
|
130
130
|
_: 1
|
|
131
131
|
}, 8, ["onClick"]),
|
|
132
|
-
|
|
132
|
+
p(v, {
|
|
133
133
|
class: "export-keep",
|
|
134
134
|
type: "primary",
|
|
135
|
-
onClick:
|
|
135
|
+
onClick: u(N)
|
|
136
136
|
}, {
|
|
137
|
-
default: o(() => [...
|
|
138
|
-
|
|
137
|
+
default: o(() => [...s[6] || (s[6] = [
|
|
138
|
+
V("保留部分文件", -1)
|
|
139
139
|
])]),
|
|
140
140
|
_: 1
|
|
141
141
|
}, 8, ["onClick"])
|
|
142
142
|
]),
|
|
143
143
|
default: o(() => [
|
|
144
|
-
|
|
144
|
+
y("p", nl, " 已写入 " + z(u(H)) + " 条数据,是否保留已导出的部分文件? ", 1)
|
|
145
145
|
]),
|
|
146
146
|
_: 1
|
|
147
147
|
}, 8, ["modelValue"])
|
|
148
148
|
], 64);
|
|
149
149
|
};
|
|
150
150
|
}
|
|
151
|
-
}), ae = (e,
|
|
151
|
+
}), ae = (e, m) => {
|
|
152
152
|
const t = e.__vccOpts || e;
|
|
153
|
-
for (const [l, a] of
|
|
153
|
+
for (const [l, a] of m)
|
|
154
154
|
t[l] = a;
|
|
155
155
|
return t;
|
|
156
|
-
},
|
|
156
|
+
}, al = /* @__PURE__ */ ae(ol, [["__scopeId", "data-v-83eeda9c"]]), sl = /* @__PURE__ */ Z({
|
|
157
157
|
__name: "columnConfigDialog",
|
|
158
158
|
props: {
|
|
159
159
|
/** 加载自定义配置(含列设置与用户默认分页大小;返回 null 按空配置处理) */
|
|
@@ -163,7 +163,7 @@ import './index.css';const Kt = { class: "export-options" }, jt = { class: "expo
|
|
|
163
163
|
/** 列元数据(候选列取 meta 中 showForDisplay=true 的列) */
|
|
164
164
|
meta: { type: Object, default: null }
|
|
165
165
|
},
|
|
166
|
-
setup(e, { expose:
|
|
166
|
+
setup(e, { expose: m }) {
|
|
167
167
|
const t = e, l = {
|
|
168
168
|
get loadCustomConfigFun() {
|
|
169
169
|
return t.loadCustomConfigFun;
|
|
@@ -175,103 +175,103 @@ import './index.css';const Kt = { class: "export-options" }, jt = { class: "expo
|
|
|
175
175
|
// 字段(状态 + 派生)
|
|
176
176
|
columns: a,
|
|
177
177
|
customConfigLoading: k,
|
|
178
|
-
defaultPageSize:
|
|
179
|
-
configDialogVisible:
|
|
180
|
-
draftColumns:
|
|
178
|
+
defaultPageSize: r,
|
|
179
|
+
configDialogVisible: $,
|
|
180
|
+
draftColumns: f,
|
|
181
181
|
// 函数
|
|
182
182
|
loadCustomConfigs: x,
|
|
183
183
|
updateDefaultPageSize: S,
|
|
184
|
-
updateColumnWidth:
|
|
185
|
-
openConfigDialog:
|
|
186
|
-
moveDraft:
|
|
184
|
+
updateColumnWidth: P,
|
|
185
|
+
openConfigDialog: H,
|
|
186
|
+
moveDraft: A,
|
|
187
187
|
resetDraft: b,
|
|
188
188
|
saveConfigDialog: _
|
|
189
|
-
} =
|
|
190
|
-
return
|
|
189
|
+
} = Dt(l, ve(t, "meta"));
|
|
190
|
+
return m({
|
|
191
191
|
// 字段
|
|
192
192
|
columns: a,
|
|
193
|
-
defaultPageSize:
|
|
193
|
+
defaultPageSize: r,
|
|
194
194
|
customConfigLoading: k,
|
|
195
195
|
// 函数
|
|
196
196
|
updateDefaultPageSize: S,
|
|
197
|
-
updateColumnWidth:
|
|
197
|
+
updateColumnWidth: P,
|
|
198
198
|
loadCustomConfigs: x,
|
|
199
|
-
openDialog:
|
|
200
|
-
}), (
|
|
201
|
-
const
|
|
202
|
-
return n(), h(
|
|
203
|
-
modelValue:
|
|
204
|
-
"onUpdate:modelValue": T[1] || (T[1] = (F) =>
|
|
199
|
+
openDialog: H
|
|
200
|
+
}), (N, T) => {
|
|
201
|
+
const U = C("el-checkbox"), G = C("el-input"), s = C("el-button"), v = C("el-dialog");
|
|
202
|
+
return n(), h(v, {
|
|
203
|
+
modelValue: u($),
|
|
204
|
+
"onUpdate:modelValue": T[1] || (T[1] = (F) => Se($) ? $.value = F : null),
|
|
205
205
|
title: "列设置",
|
|
206
206
|
width: "480px"
|
|
207
207
|
}, {
|
|
208
208
|
footer: o(() => [
|
|
209
|
-
|
|
209
|
+
p(s, { onClick: u(b) }, {
|
|
210
210
|
default: o(() => [...T[4] || (T[4] = [
|
|
211
|
-
|
|
211
|
+
V("重置", -1)
|
|
212
212
|
])]),
|
|
213
213
|
_: 1
|
|
214
214
|
}, 8, ["onClick"]),
|
|
215
|
-
|
|
216
|
-
onClick: T[0] || (T[0] = (F) =>
|
|
215
|
+
p(s, {
|
|
216
|
+
onClick: T[0] || (T[0] = (F) => $.value = !1)
|
|
217
217
|
}, {
|
|
218
218
|
default: o(() => [...T[5] || (T[5] = [
|
|
219
|
-
|
|
219
|
+
V("取消", -1)
|
|
220
220
|
])]),
|
|
221
221
|
_: 1
|
|
222
222
|
}),
|
|
223
|
-
|
|
223
|
+
p(s, {
|
|
224
224
|
type: "primary",
|
|
225
225
|
class: "col-config-save",
|
|
226
|
-
onClick:
|
|
226
|
+
onClick: u(_)
|
|
227
227
|
}, {
|
|
228
228
|
default: o(() => [...T[6] || (T[6] = [
|
|
229
|
-
|
|
229
|
+
V("保存", -1)
|
|
230
230
|
])]),
|
|
231
231
|
_: 1
|
|
232
232
|
}, 8, ["onClick"])
|
|
233
233
|
]),
|
|
234
234
|
default: o(() => [
|
|
235
|
-
(n(!0),
|
|
235
|
+
(n(!0), g(L, null, te(u(f), (F, q) => (n(), g("div", {
|
|
236
236
|
key: F.propertyPath,
|
|
237
237
|
class: "col-config-row"
|
|
238
238
|
}, [
|
|
239
|
-
|
|
239
|
+
p(U, {
|
|
240
240
|
modelValue: F.visible,
|
|
241
241
|
"onUpdate:modelValue": (E) => F.visible = E,
|
|
242
242
|
class: "col-config-name"
|
|
243
243
|
}, {
|
|
244
244
|
default: o(() => [
|
|
245
|
-
|
|
245
|
+
V(z(F.displayName), 1)
|
|
246
246
|
]),
|
|
247
247
|
_: 2
|
|
248
248
|
}, 1032, ["modelValue", "onUpdate:modelValue"]),
|
|
249
|
-
|
|
249
|
+
p(G, {
|
|
250
250
|
modelValue: F.width,
|
|
251
251
|
"onUpdate:modelValue": (E) => F.width = E,
|
|
252
252
|
class: "col-config-width",
|
|
253
253
|
placeholder: "宽度(如 120)",
|
|
254
254
|
size: "small"
|
|
255
255
|
}, null, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
256
|
-
|
|
256
|
+
p(s, {
|
|
257
257
|
link: "",
|
|
258
258
|
type: "primary",
|
|
259
|
-
disabled:
|
|
260
|
-
onClick: (E) =>
|
|
259
|
+
disabled: q === 0,
|
|
260
|
+
onClick: (E) => u(A)(q, -1)
|
|
261
261
|
}, {
|
|
262
262
|
default: o(() => [...T[2] || (T[2] = [
|
|
263
|
-
|
|
263
|
+
V("上移", -1)
|
|
264
264
|
])]),
|
|
265
265
|
_: 1
|
|
266
266
|
}, 8, ["disabled", "onClick"]),
|
|
267
|
-
|
|
267
|
+
p(s, {
|
|
268
268
|
link: "",
|
|
269
269
|
type: "primary",
|
|
270
|
-
disabled:
|
|
271
|
-
onClick: (E) =>
|
|
270
|
+
disabled: q === u(f).length - 1,
|
|
271
|
+
onClick: (E) => u(A)(q, 1)
|
|
272
272
|
}, {
|
|
273
273
|
default: o(() => [...T[3] || (T[3] = [
|
|
274
|
-
|
|
274
|
+
V(" 下移 ", -1)
|
|
275
275
|
])]),
|
|
276
276
|
_: 1
|
|
277
277
|
}, 8, ["disabled", "onClick"])
|
|
@@ -281,7 +281,7 @@ import './index.css';const Kt = { class: "export-options" }, jt = { class: "expo
|
|
|
281
281
|
}, 8, ["modelValue"]);
|
|
282
282
|
};
|
|
283
283
|
}
|
|
284
|
-
}),
|
|
284
|
+
}), il = /* @__PURE__ */ ae(sl, [["__scopeId", "data-v-a6f853c4"]]), rl = /* @__PURE__ */ Z({
|
|
285
285
|
__name: "rowActionsColumn",
|
|
286
286
|
props: {
|
|
287
287
|
/** 行操作列表(由 Table 的 useRowActions 加载);为空时不渲染操作列 */
|
|
@@ -292,41 +292,41 @@ import './index.css';const Kt = { class: "export-options" }, jt = { class: "expo
|
|
|
292
292
|
resizable: { type: Boolean, default: !0 }
|
|
293
293
|
},
|
|
294
294
|
setup(e) {
|
|
295
|
-
const
|
|
296
|
-
() =>
|
|
295
|
+
const m = e, t = Q(
|
|
296
|
+
() => m.actions.length === 0 ? void 0 : m.actions.length * 34 + (m.actions.length - 1) * 12 + 30
|
|
297
297
|
);
|
|
298
298
|
return (l, a) => {
|
|
299
|
-
const k =
|
|
300
|
-
return
|
|
299
|
+
const k = C("el-button"), r = C("el-table-column");
|
|
300
|
+
return m.actions.length > 0 ? (n(), h(r, {
|
|
301
301
|
key: 0,
|
|
302
302
|
label: "操作",
|
|
303
303
|
fixed: "right",
|
|
304
304
|
"min-width": t.value,
|
|
305
|
-
resizable:
|
|
305
|
+
resizable: m.resizable
|
|
306
306
|
}, {
|
|
307
|
-
default: o(({ row:
|
|
308
|
-
(n(!0),
|
|
309
|
-
key:
|
|
307
|
+
default: o(({ row: $ }) => [
|
|
308
|
+
(n(!0), g(L, null, te(u(et)(m.actions, $), (f) => (n(), h(k, {
|
|
309
|
+
key: f.name,
|
|
310
310
|
link: "",
|
|
311
|
-
type:
|
|
312
|
-
disabled: !
|
|
313
|
-
onClick: (x) =>
|
|
311
|
+
type: f.type ?? "primary",
|
|
312
|
+
disabled: !u(vt)(f, $),
|
|
313
|
+
onClick: (x) => f.execute($, m.table)
|
|
314
314
|
}, {
|
|
315
315
|
default: o(() => [
|
|
316
|
-
|
|
316
|
+
f.icon ? (n(), h(Qe(f.icon), {
|
|
317
317
|
key: 0,
|
|
318
318
|
class: "yk-row-action__icon"
|
|
319
|
-
})) :
|
|
320
|
-
|
|
319
|
+
})) : R("", !0),
|
|
320
|
+
V(" " + z(f.desc), 1)
|
|
321
321
|
]),
|
|
322
322
|
_: 2
|
|
323
323
|
}, 1032, ["type", "disabled", "onClick"]))), 128))
|
|
324
324
|
]),
|
|
325
325
|
_: 1
|
|
326
|
-
}, 8, ["min-width", "resizable"])) :
|
|
326
|
+
}, 8, ["min-width", "resizable"])) : R("", !0);
|
|
327
327
|
};
|
|
328
328
|
}
|
|
329
|
-
}),
|
|
329
|
+
}), ul = /* @__PURE__ */ ae(rl, [["__scopeId", "data-v-34f3d742"]]), dl = { class: "yk-table__cards" }, cl = ["title", "onContextmenu"], pl = { class: "yk-table__card-json" }, ml = /* @__PURE__ */ Z({
|
|
330
330
|
__name: "cardView",
|
|
331
331
|
props: {
|
|
332
332
|
rows: {},
|
|
@@ -337,43 +337,43 @@ import './index.css';const Kt = { class: "export-options" }, jt = { class: "expo
|
|
|
337
337
|
isSelected: { type: Function }
|
|
338
338
|
},
|
|
339
339
|
emits: ["check", "contextmenu"],
|
|
340
|
-
setup(e, { emit:
|
|
341
|
-
const t = e, l =
|
|
340
|
+
setup(e, { emit: m }) {
|
|
341
|
+
const t = e, l = m;
|
|
342
342
|
return (a, k) => {
|
|
343
|
-
const
|
|
344
|
-
return n(),
|
|
345
|
-
(n(!0),
|
|
346
|
-
key: String(
|
|
347
|
-
class:
|
|
348
|
-
"is-selected": t.showCheckbox && t.isSelected(
|
|
343
|
+
const r = C("el-checkbox"), $ = C("el-empty");
|
|
344
|
+
return n(), g("div", dl, [
|
|
345
|
+
(n(!0), g(L, null, te(t.rows, (f, x) => (n(), g("div", {
|
|
346
|
+
key: String(f[t.rowKey]),
|
|
347
|
+
class: $e(["yk-table__card", {
|
|
348
|
+
"is-selected": t.showCheckbox && t.isSelected(f),
|
|
349
349
|
"has-actions": t.hasActions
|
|
350
350
|
}]),
|
|
351
351
|
title: t.hasActions ? "右键查看行操作" : void 0,
|
|
352
|
-
onContextmenu: (S) => l("contextmenu", S,
|
|
352
|
+
onContextmenu: (S) => l("contextmenu", S, f)
|
|
353
353
|
}, [
|
|
354
|
-
t.showCheckbox ? (n(), h(
|
|
354
|
+
t.showCheckbox ? (n(), h(r, {
|
|
355
355
|
key: 0,
|
|
356
356
|
class: "yk-table__card-checkbox",
|
|
357
|
-
"model-value": t.isSelected(
|
|
358
|
-
onChange: (S) => l("check",
|
|
359
|
-
}, null, 8, ["model-value", "onChange"])) :
|
|
360
|
-
|
|
361
|
-
row:
|
|
357
|
+
"model-value": t.isSelected(f),
|
|
358
|
+
onChange: (S) => l("check", f, S)
|
|
359
|
+
}, null, 8, ["model-value", "onChange"])) : R("", !0),
|
|
360
|
+
ne(a.$slots, "default", {
|
|
361
|
+
row: f,
|
|
362
362
|
index: x
|
|
363
363
|
}, () => [
|
|
364
|
-
|
|
364
|
+
y("pre", pl, z(JSON.stringify(f, null, 2)), 1)
|
|
365
365
|
], !0)
|
|
366
|
-
], 42,
|
|
367
|
-
!t.loading && t.rows.length === 0 ? (n(),
|
|
368
|
-
a.$slots.empty ?
|
|
366
|
+
], 42, cl))), 128)),
|
|
367
|
+
!t.loading && t.rows.length === 0 ? (n(), g(L, { key: 0 }, [
|
|
368
|
+
a.$slots.empty ? ne(a.$slots, "empty", {}, void 0, !0, 0) : (n(), h($, {
|
|
369
369
|
key: 1,
|
|
370
370
|
description: "暂无数据"
|
|
371
371
|
}))
|
|
372
|
-
], 64)) :
|
|
372
|
+
], 64)) : R("", !0)
|
|
373
373
|
]);
|
|
374
374
|
};
|
|
375
375
|
}
|
|
376
|
-
}),
|
|
376
|
+
}), fl = /* @__PURE__ */ ae(ml, [["__scopeId", "data-v-88966e9a"]]), vl = { class: "yk-table__list" }, yl = ["title", "onContextmenu"], gl = { class: "yk-table__list-item-body" }, kl = { class: "yk-table__list-item-json" }, _l = /* @__PURE__ */ Z({
|
|
377
377
|
__name: "listView",
|
|
378
378
|
props: {
|
|
379
379
|
rows: {},
|
|
@@ -384,45 +384,45 @@ import './index.css';const Kt = { class: "export-options" }, jt = { class: "expo
|
|
|
384
384
|
isSelected: { type: Function }
|
|
385
385
|
},
|
|
386
386
|
emits: ["check", "contextmenu"],
|
|
387
|
-
setup(e, { emit:
|
|
388
|
-
const t = e, l =
|
|
387
|
+
setup(e, { emit: m }) {
|
|
388
|
+
const t = e, l = m;
|
|
389
389
|
return (a, k) => {
|
|
390
|
-
const
|
|
391
|
-
return n(),
|
|
392
|
-
(n(!0),
|
|
393
|
-
key: String(
|
|
394
|
-
class:
|
|
395
|
-
"is-selected": t.showCheckbox && t.isSelected(
|
|
390
|
+
const r = C("el-checkbox"), $ = C("el-empty");
|
|
391
|
+
return n(), g("div", vl, [
|
|
392
|
+
(n(!0), g(L, null, te(t.rows, (f, x) => (n(), g("div", {
|
|
393
|
+
key: String(f[t.rowKey]),
|
|
394
|
+
class: $e(["yk-table__list-item", {
|
|
395
|
+
"is-selected": t.showCheckbox && t.isSelected(f),
|
|
396
396
|
"has-actions": t.hasActions
|
|
397
397
|
}]),
|
|
398
398
|
title: t.hasActions ? "右键查看行操作" : void 0,
|
|
399
|
-
onContextmenu: (S) => l("contextmenu", S,
|
|
399
|
+
onContextmenu: (S) => l("contextmenu", S, f)
|
|
400
400
|
}, [
|
|
401
|
-
t.showCheckbox ? (n(), h(
|
|
401
|
+
t.showCheckbox ? (n(), h(r, {
|
|
402
402
|
key: 0,
|
|
403
403
|
class: "yk-table__list-item-checkbox",
|
|
404
|
-
"model-value": t.isSelected(
|
|
405
|
-
onChange: (S) => l("check",
|
|
406
|
-
}, null, 8, ["model-value", "onChange"])) :
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
row:
|
|
404
|
+
"model-value": t.isSelected(f),
|
|
405
|
+
onChange: (S) => l("check", f, S)
|
|
406
|
+
}, null, 8, ["model-value", "onChange"])) : R("", !0),
|
|
407
|
+
y("div", gl, [
|
|
408
|
+
ne(a.$slots, "default", {
|
|
409
|
+
row: f,
|
|
410
410
|
index: x
|
|
411
411
|
}, () => [
|
|
412
|
-
|
|
412
|
+
y("pre", kl, z(JSON.stringify(f, null, 2)), 1)
|
|
413
413
|
], !0)
|
|
414
414
|
])
|
|
415
|
-
], 42,
|
|
416
|
-
!t.loading && t.rows.length === 0 ? (n(),
|
|
417
|
-
a.$slots.empty ?
|
|
415
|
+
], 42, yl))), 128)),
|
|
416
|
+
!t.loading && t.rows.length === 0 ? (n(), g(L, { key: 0 }, [
|
|
417
|
+
a.$slots.empty ? ne(a.$slots, "empty", {}, void 0, !0, 0) : (n(), h($, {
|
|
418
418
|
key: 1,
|
|
419
419
|
description: "暂无数据"
|
|
420
420
|
}))
|
|
421
|
-
], 64)) :
|
|
421
|
+
], 64)) : R("", !0)
|
|
422
422
|
]);
|
|
423
423
|
};
|
|
424
424
|
}
|
|
425
|
-
}),
|
|
425
|
+
}), bl = /* @__PURE__ */ ae(_l, [["__scopeId", "data-v-0488eb89"]]), hl = ["onClick"], wl = /* @__PURE__ */ Z({
|
|
426
426
|
__name: "contextMenu",
|
|
427
427
|
props: {
|
|
428
428
|
menu: {},
|
|
@@ -430,41 +430,41 @@ import './index.css';const Kt = { class: "export-options" }, jt = { class: "expo
|
|
|
430
430
|
isEnabled: { type: Function }
|
|
431
431
|
},
|
|
432
432
|
emits: ["close", "select"],
|
|
433
|
-
setup(e, { emit:
|
|
434
|
-
const t = e, l =
|
|
435
|
-
return (a, k) => (n(), h(
|
|
436
|
-
t.menu ? (n(),
|
|
437
|
-
|
|
433
|
+
setup(e, { emit: m }) {
|
|
434
|
+
const t = e, l = m;
|
|
435
|
+
return (a, k) => (n(), h(Mt, { to: "body" }, [
|
|
436
|
+
t.menu ? (n(), g(L, { key: 0 }, [
|
|
437
|
+
y("div", {
|
|
438
438
|
class: "yk-table__menu-mask",
|
|
439
|
-
onClick: k[0] || (k[0] = (
|
|
440
|
-
onContextmenu: k[1] || (k[1] =
|
|
439
|
+
onClick: k[0] || (k[0] = (r) => l("close")),
|
|
440
|
+
onContextmenu: k[1] || (k[1] = dt((r) => l("close"), ["prevent"]))
|
|
441
441
|
}, null, 32),
|
|
442
|
-
|
|
442
|
+
y("ul", {
|
|
443
443
|
class: "yk-table__context-menu",
|
|
444
|
-
style:
|
|
444
|
+
style: ct({ left: `${t.menu.x}px`, top: `${t.menu.y}px` })
|
|
445
445
|
}, [
|
|
446
|
-
(n(!0),
|
|
447
|
-
key:
|
|
448
|
-
class:
|
|
449
|
-
onClick: (
|
|
446
|
+
(n(!0), g(L, null, te(t.actions, (r) => (n(), g("li", {
|
|
447
|
+
key: r.name,
|
|
448
|
+
class: $e(["yk-table__context-menu-item", { "is-disabled": !t.isEnabled(r, t.menu.row) }]),
|
|
449
|
+
onClick: ($) => t.isEnabled(r, t.menu.row) && l("select", r)
|
|
450
450
|
}, [
|
|
451
|
-
|
|
451
|
+
r.icon ? (n(), h(Qe(r.icon), {
|
|
452
452
|
key: 0,
|
|
453
453
|
class: "yk-table__context-menu-icon"
|
|
454
|
-
})) :
|
|
455
|
-
|
|
456
|
-
], 10,
|
|
454
|
+
})) : R("", !0),
|
|
455
|
+
V(" " + z(r.desc), 1)
|
|
456
|
+
], 10, hl))), 128))
|
|
457
457
|
], 4)
|
|
458
|
-
], 64)) :
|
|
458
|
+
], 64)) : R("", !0)
|
|
459
459
|
]));
|
|
460
460
|
}
|
|
461
|
-
}),
|
|
461
|
+
}), xl = /* @__PURE__ */ ae(wl, [["__scopeId", "data-v-32592dd4"]]), Cl = { class: "yk-table" }, Sl = { class: "yk-table__view-area" }, $l = {
|
|
462
462
|
key: 0,
|
|
463
463
|
class: "yk-table__loading-mask"
|
|
464
|
-
},
|
|
464
|
+
}, Vl = {
|
|
465
465
|
key: 0,
|
|
466
466
|
class: "yk-table__footer"
|
|
467
|
-
},
|
|
467
|
+
}, Fl = { class: "yk-table__footer-extra" }, Ml = /* @__PURE__ */ Z({
|
|
468
468
|
name: "YsTable",
|
|
469
469
|
__name: "table",
|
|
470
470
|
props: {
|
|
@@ -515,205 +515,205 @@ import './index.css';const Kt = { class: "export-options" }, jt = { class: "expo
|
|
|
515
515
|
viewMode: { type: String, default: "table" }
|
|
516
516
|
},
|
|
517
517
|
emits: ["data-loaded", "update:viewMode", "update:showCheckbox", "update:columnResizable", "update:stickyHeader"],
|
|
518
|
-
setup(e, { expose:
|
|
518
|
+
setup(e, { expose: m, emit: t }) {
|
|
519
519
|
const l = e, a = t, {
|
|
520
520
|
meta: k,
|
|
521
|
-
paged:
|
|
522
|
-
rows:
|
|
523
|
-
metaLoading:
|
|
521
|
+
paged: r,
|
|
522
|
+
rows: $,
|
|
523
|
+
metaLoading: f,
|
|
524
524
|
dataLoading: x,
|
|
525
525
|
currentPage: S,
|
|
526
|
-
total:
|
|
527
|
-
totalKnown:
|
|
528
|
-
loadMeta:
|
|
529
|
-
} =
|
|
526
|
+
total: P,
|
|
527
|
+
totalKnown: H,
|
|
528
|
+
loadMeta: A
|
|
529
|
+
} = Et(l), b = Y(null), {
|
|
530
530
|
selectedRows: _,
|
|
531
|
-
onSelectionChange:
|
|
531
|
+
onSelectionChange: N,
|
|
532
532
|
isRowSelected: T,
|
|
533
|
-
toggleRowSelection:
|
|
534
|
-
restoreSelection:
|
|
535
|
-
clearSelection:
|
|
536
|
-
selectAllOnPage:
|
|
533
|
+
toggleRowSelection: U,
|
|
534
|
+
restoreSelection: G,
|
|
535
|
+
clearSelection: s,
|
|
536
|
+
selectAllOnPage: v,
|
|
537
537
|
invertSelectionOnPage: F
|
|
538
|
-
} =
|
|
538
|
+
} = It({ tableEl: b, rows: $, rowKey: ve(l, "rowKey") }), q = {
|
|
539
539
|
get rowActionsFunc() {
|
|
540
540
|
return l.rowActionsFunc;
|
|
541
541
|
}
|
|
542
|
-
}, { actions: E, actionsLoading: ue, loadActions:
|
|
543
|
-
var
|
|
544
|
-
return ((
|
|
545
|
-
}),
|
|
546
|
-
var
|
|
547
|
-
return ((
|
|
548
|
-
}),
|
|
549
|
-
var
|
|
550
|
-
return ((
|
|
551
|
-
}),
|
|
552
|
-
async function D(
|
|
542
|
+
}, { actions: E, actionsLoading: ue, loadActions: de } = Tt(q), ee = Y(null), w = Q(() => {
|
|
543
|
+
var i;
|
|
544
|
+
return ((i = ee.value) == null ? void 0 : i.columns) ?? [];
|
|
545
|
+
}), d = Q(() => {
|
|
546
|
+
var i;
|
|
547
|
+
return ((i = ee.value) == null ? void 0 : i.defaultPageSize) ?? l.pageSize;
|
|
548
|
+
}), j = Q(() => {
|
|
549
|
+
var i;
|
|
550
|
+
return ((i = ee.value) == null ? void 0 : i.customConfigLoading) ?? !1;
|
|
551
|
+
}), se = Y(null);
|
|
552
|
+
async function D(i) {
|
|
553
553
|
x.value = !0;
|
|
554
554
|
try {
|
|
555
|
-
const
|
|
556
|
-
|
|
555
|
+
const J = (S.value - 1) * d.value, re = await l.dataFun({ limit: d.value, offset: J }, i);
|
|
556
|
+
r.value = re, a("data-loaded", re);
|
|
557
557
|
} finally {
|
|
558
558
|
x.value = !1;
|
|
559
559
|
}
|
|
560
560
|
}
|
|
561
|
-
const
|
|
562
|
-
var
|
|
563
|
-
const
|
|
564
|
-
return
|
|
565
|
-
}),
|
|
566
|
-
() =>
|
|
561
|
+
const I = Q(() => {
|
|
562
|
+
var J;
|
|
563
|
+
const i = Math.min(d.value, ...l.pageSizes);
|
|
564
|
+
return P.value > i || (((J = r.value) == null ? void 0 : J.hasNext) ?? !1);
|
|
565
|
+
}), B = Q(
|
|
566
|
+
() => f.value || x.value || ue.value || j.value
|
|
567
567
|
);
|
|
568
|
-
function
|
|
569
|
-
S.value =
|
|
568
|
+
function O(i) {
|
|
569
|
+
S.value = i, D();
|
|
570
570
|
}
|
|
571
|
-
function
|
|
572
|
-
var
|
|
573
|
-
(
|
|
571
|
+
function ie(i) {
|
|
572
|
+
var J;
|
|
573
|
+
(J = ee.value) == null || J.updateDefaultPageSize(i), S.value = 1, D();
|
|
574
574
|
}
|
|
575
|
-
function
|
|
576
|
-
var
|
|
577
|
-
re.property && ((
|
|
575
|
+
function W(i, J, re) {
|
|
576
|
+
var _e;
|
|
577
|
+
re.property && ((_e = ee.value) == null || _e.updateColumnWidth(re.property, i));
|
|
578
578
|
}
|
|
579
|
-
async function
|
|
580
|
-
var
|
|
579
|
+
async function oe() {
|
|
580
|
+
var i;
|
|
581
581
|
await Promise.all([
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
(
|
|
582
|
+
A(),
|
|
583
|
+
de(),
|
|
584
|
+
(i = ee.value) == null ? void 0 : i.loadCustomConfigs()
|
|
585
585
|
]), S.value = 1, D();
|
|
586
586
|
}
|
|
587
|
-
function
|
|
587
|
+
function ke() {
|
|
588
588
|
D();
|
|
589
589
|
}
|
|
590
|
-
|
|
591
|
-
|
|
590
|
+
Me(oe), me(() => l.pageSize, (i) => {
|
|
591
|
+
ie(i);
|
|
592
592
|
}), me(() => l.dataFun, () => {
|
|
593
593
|
S.value = 1, D();
|
|
594
594
|
});
|
|
595
|
-
const
|
|
596
|
-
me(() => l.viewMode, (
|
|
597
|
-
|
|
595
|
+
const Ce = Y(l.viewMode);
|
|
596
|
+
me(() => l.viewMode, (i) => {
|
|
597
|
+
Ce.value = i;
|
|
598
598
|
});
|
|
599
599
|
const pe = Q({
|
|
600
|
-
get: () =>
|
|
601
|
-
set: (
|
|
602
|
-
|
|
600
|
+
get: () => Ce.value,
|
|
601
|
+
set: (i) => {
|
|
602
|
+
Ce.value = i, a("update:viewMode", i);
|
|
603
603
|
}
|
|
604
604
|
});
|
|
605
|
-
me(pe, (
|
|
606
|
-
|
|
605
|
+
me(pe, (i) => {
|
|
606
|
+
i === "table" && G();
|
|
607
607
|
});
|
|
608
|
-
const
|
|
609
|
-
me(() => l.showCheckbox, (
|
|
610
|
-
|
|
608
|
+
const he = Y(l.showCheckbox);
|
|
609
|
+
me(() => l.showCheckbox, (i) => {
|
|
610
|
+
he.value = i;
|
|
611
611
|
});
|
|
612
|
-
const
|
|
613
|
-
get: () =>
|
|
614
|
-
set: (
|
|
615
|
-
|
|
612
|
+
const we = Q({
|
|
613
|
+
get: () => he.value,
|
|
614
|
+
set: (i) => {
|
|
615
|
+
he.value = i, a("update:showCheckbox", i), i || s();
|
|
616
616
|
}
|
|
617
617
|
});
|
|
618
|
-
function
|
|
619
|
-
pe.value =
|
|
618
|
+
function Ve(i) {
|
|
619
|
+
pe.value = i;
|
|
620
620
|
}
|
|
621
|
-
function
|
|
622
|
-
|
|
621
|
+
function Ne(i) {
|
|
622
|
+
we.value = i;
|
|
623
623
|
}
|
|
624
|
-
const
|
|
625
|
-
me(() => l.columnResizable, (
|
|
626
|
-
|
|
624
|
+
const Ae = Y(l.columnResizable);
|
|
625
|
+
me(() => l.columnResizable, (i) => {
|
|
626
|
+
Ae.value = i;
|
|
627
627
|
});
|
|
628
|
-
const
|
|
629
|
-
get: () =>
|
|
630
|
-
set: (
|
|
631
|
-
|
|
628
|
+
const Fe = Q({
|
|
629
|
+
get: () => Ae.value,
|
|
630
|
+
set: (i) => {
|
|
631
|
+
Ae.value = i, a("update:columnResizable", i);
|
|
632
632
|
}
|
|
633
633
|
});
|
|
634
|
-
function
|
|
635
|
-
|
|
634
|
+
function qe(i) {
|
|
635
|
+
Fe.value = i;
|
|
636
636
|
}
|
|
637
|
-
const De =
|
|
638
|
-
me(() => l.stickyHeader, (
|
|
639
|
-
De.value =
|
|
637
|
+
const De = Y(l.stickyHeader);
|
|
638
|
+
me(() => l.stickyHeader, (i) => {
|
|
639
|
+
De.value = i;
|
|
640
640
|
});
|
|
641
|
-
const
|
|
641
|
+
const Re = Q({
|
|
642
642
|
get: () => De.value,
|
|
643
|
-
set: (
|
|
644
|
-
De.value =
|
|
643
|
+
set: (i) => {
|
|
644
|
+
De.value = i, a("update:stickyHeader", i);
|
|
645
645
|
}
|
|
646
646
|
});
|
|
647
|
-
function
|
|
648
|
-
|
|
647
|
+
function Oe(i) {
|
|
648
|
+
Re.value = i;
|
|
649
649
|
}
|
|
650
|
-
const
|
|
651
|
-
() => Object.keys(
|
|
650
|
+
const Ue = At(), Le = Q(
|
|
651
|
+
() => Object.keys(Ue).filter((i) => i !== "_" && typeof Ue[i] == "function")
|
|
652
652
|
);
|
|
653
|
-
function
|
|
654
|
-
var
|
|
655
|
-
(
|
|
653
|
+
function Ee() {
|
|
654
|
+
var i;
|
|
655
|
+
(i = ee.value) == null || i.openDialog();
|
|
656
656
|
}
|
|
657
|
-
function
|
|
658
|
-
var
|
|
659
|
-
(
|
|
657
|
+
function Pe() {
|
|
658
|
+
var i;
|
|
659
|
+
(i = se.value) == null || i.openExportDialog();
|
|
660
660
|
}
|
|
661
|
-
function
|
|
662
|
-
|
|
661
|
+
function ze(i, J) {
|
|
662
|
+
U(i, !!J);
|
|
663
663
|
}
|
|
664
|
-
const
|
|
665
|
-
() =>
|
|
664
|
+
const ge = Y(null), We = Q(
|
|
665
|
+
() => ge.value ? et(E.value, ge.value.row) : []
|
|
666
666
|
);
|
|
667
|
-
function
|
|
667
|
+
function He(i, J) {
|
|
668
668
|
if (E.value.length === 0) return;
|
|
669
|
-
|
|
670
|
-
const re = 176,
|
|
671
|
-
|
|
672
|
-
x: Math.min(
|
|
673
|
-
y: Math.min(
|
|
674
|
-
row:
|
|
669
|
+
i.preventDefault();
|
|
670
|
+
const re = 176, X = Je(J) * 34 + 8;
|
|
671
|
+
ge.value = {
|
|
672
|
+
x: Math.min(i.clientX, window.innerWidth - re - 8),
|
|
673
|
+
y: Math.min(i.clientY, window.innerHeight - X - 8),
|
|
674
|
+
row: J
|
|
675
675
|
};
|
|
676
676
|
}
|
|
677
|
-
function
|
|
678
|
-
return
|
|
677
|
+
function Je(i) {
|
|
678
|
+
return et(E.value, i).length;
|
|
679
679
|
}
|
|
680
|
-
function
|
|
680
|
+
function c(i) {
|
|
681
681
|
var re;
|
|
682
|
-
const
|
|
683
|
-
|
|
682
|
+
const J = (re = ge.value) == null ? void 0 : re.row;
|
|
683
|
+
ge.value = null, J && i.execute(J, le);
|
|
684
684
|
}
|
|
685
|
-
function
|
|
686
|
-
|
|
685
|
+
function M(i) {
|
|
686
|
+
i.key === "Escape" && (ge.value = null);
|
|
687
687
|
}
|
|
688
|
-
|
|
688
|
+
Me(() => window.addEventListener("keydown", M)), Ge(() => window.removeEventListener("keydown", M)), m({
|
|
689
689
|
meta: k,
|
|
690
|
-
paged:
|
|
690
|
+
paged: r,
|
|
691
691
|
currentPage: S,
|
|
692
692
|
viewMode: pe,
|
|
693
|
-
selectable:
|
|
694
|
-
columnResizable:
|
|
695
|
-
stickyHeader:
|
|
696
|
-
slotNames:
|
|
693
|
+
selectable: we,
|
|
694
|
+
columnResizable: Fe,
|
|
695
|
+
stickyHeader: Re,
|
|
696
|
+
slotNames: Le,
|
|
697
697
|
selectedRows: _,
|
|
698
|
-
rows:
|
|
699
|
-
reload:
|
|
700
|
-
refresh:
|
|
701
|
-
setViewMode:
|
|
702
|
-
setSelectable:
|
|
703
|
-
setColumnResizable:
|
|
704
|
-
setStickyHeader:
|
|
705
|
-
clearSelection:
|
|
706
|
-
selectAllOnPage:
|
|
698
|
+
rows: $,
|
|
699
|
+
reload: oe,
|
|
700
|
+
refresh: ke,
|
|
701
|
+
setViewMode: Ve,
|
|
702
|
+
setSelectable: Ne,
|
|
703
|
+
setColumnResizable: qe,
|
|
704
|
+
setStickyHeader: Oe,
|
|
705
|
+
clearSelection: s,
|
|
706
|
+
selectAllOnPage: v,
|
|
707
707
|
invertSelectionOnPage: F,
|
|
708
|
-
openConfigDialog:
|
|
709
|
-
openExportDialog:
|
|
708
|
+
openConfigDialog: Ee,
|
|
709
|
+
openExportDialog: Pe
|
|
710
710
|
});
|
|
711
|
-
const
|
|
711
|
+
const le = {
|
|
712
712
|
get meta() {
|
|
713
713
|
return k.value;
|
|
714
714
|
},
|
|
715
715
|
get paged() {
|
|
716
|
-
return
|
|
716
|
+
return r.value;
|
|
717
717
|
},
|
|
718
718
|
get currentPage() {
|
|
719
719
|
return S.value;
|
|
@@ -722,261 +722,261 @@ import './index.css';const Kt = { class: "export-options" }, jt = { class: "expo
|
|
|
722
722
|
return pe.value;
|
|
723
723
|
},
|
|
724
724
|
get selectable() {
|
|
725
|
-
return
|
|
725
|
+
return we.value;
|
|
726
726
|
},
|
|
727
727
|
get columnResizable() {
|
|
728
|
-
return
|
|
728
|
+
return Fe.value;
|
|
729
729
|
},
|
|
730
730
|
get stickyHeader() {
|
|
731
|
-
return
|
|
731
|
+
return Re.value;
|
|
732
732
|
},
|
|
733
733
|
get slotNames() {
|
|
734
|
-
return
|
|
734
|
+
return Le.value;
|
|
735
735
|
},
|
|
736
736
|
get selectedRows() {
|
|
737
737
|
return _.value;
|
|
738
738
|
},
|
|
739
739
|
get rows() {
|
|
740
|
-
return
|
|
740
|
+
return $.value;
|
|
741
741
|
},
|
|
742
|
-
reload:
|
|
743
|
-
refresh:
|
|
744
|
-
setViewMode:
|
|
745
|
-
setSelectable:
|
|
746
|
-
setColumnResizable:
|
|
747
|
-
setStickyHeader:
|
|
748
|
-
clearSelection:
|
|
749
|
-
selectAllOnPage:
|
|
742
|
+
reload: oe,
|
|
743
|
+
refresh: ke,
|
|
744
|
+
setViewMode: Ve,
|
|
745
|
+
setSelectable: Ne,
|
|
746
|
+
setColumnResizable: qe,
|
|
747
|
+
setStickyHeader: Oe,
|
|
748
|
+
clearSelection: s,
|
|
749
|
+
selectAllOnPage: v,
|
|
750
750
|
invertSelectionOnPage: F,
|
|
751
|
-
openConfigDialog:
|
|
752
|
-
openExportDialog:
|
|
751
|
+
openConfigDialog: Ee,
|
|
752
|
+
openExportDialog: Pe
|
|
753
753
|
};
|
|
754
|
-
return (
|
|
755
|
-
var
|
|
756
|
-
const re =
|
|
757
|
-
return n(),
|
|
758
|
-
|
|
759
|
-
pe.value === "table" ? (n(),
|
|
754
|
+
return (i, J) => {
|
|
755
|
+
var be;
|
|
756
|
+
const re = C("el-table-column"), _e = C("el-table"), X = C("el-pagination");
|
|
757
|
+
return n(), g("div", Cl, [
|
|
758
|
+
y("div", Sl, [
|
|
759
|
+
pe.value === "table" ? (n(), g("div", {
|
|
760
760
|
key: 0,
|
|
761
|
-
class:
|
|
761
|
+
class: $e(["yk-table__table-wrap", { "yk-table__table-wrap--sticky-header": Re.value }])
|
|
762
762
|
}, [
|
|
763
|
-
|
|
763
|
+
p(_e, {
|
|
764
764
|
ref_key: "tableEl",
|
|
765
765
|
ref: b,
|
|
766
|
-
data:
|
|
766
|
+
data: u($),
|
|
767
767
|
"row-key": e.rowKey,
|
|
768
768
|
border: "",
|
|
769
|
-
onSelectionChange:
|
|
770
|
-
onHeaderDragend:
|
|
769
|
+
onSelectionChange: u(N),
|
|
770
|
+
onHeaderDragend: W
|
|
771
771
|
}, Be({
|
|
772
772
|
default: o(() => [
|
|
773
|
-
|
|
773
|
+
we.value ? (n(), h(re, {
|
|
774
774
|
key: 0,
|
|
775
775
|
type: "selection",
|
|
776
776
|
width: "48"
|
|
777
|
-
})) :
|
|
778
|
-
(n(!0),
|
|
779
|
-
key:
|
|
780
|
-
prop:
|
|
781
|
-
label:
|
|
782
|
-
width:
|
|
783
|
-
resizable:
|
|
777
|
+
})) : R("", !0),
|
|
778
|
+
(n(!0), g(L, null, te(w.value, (ce) => (n(), h(re, {
|
|
779
|
+
key: ce.propertyPath,
|
|
780
|
+
prop: ce.propertyPath,
|
|
781
|
+
label: ce.displayName,
|
|
782
|
+
width: ce.width,
|
|
783
|
+
resizable: Fe.value,
|
|
784
784
|
"show-overflow-tooltip": ""
|
|
785
785
|
}, Be({ _: 2 }, [
|
|
786
|
-
|
|
786
|
+
ce.render ? {
|
|
787
787
|
name: "default",
|
|
788
|
-
fn: o(({ row:
|
|
789
|
-
(n(), h(
|
|
788
|
+
fn: o(({ row: xe }) => [
|
|
789
|
+
(n(), h(Qe(() => ce.render(xe, xe[ce.propertyPath]))))
|
|
790
790
|
]),
|
|
791
791
|
key: "0"
|
|
792
792
|
} : void 0
|
|
793
793
|
]), 1032, ["prop", "label", "width", "resizable"]))), 128)),
|
|
794
|
-
l.rowActionsFunc ? (n(), h(
|
|
794
|
+
l.rowActionsFunc ? (n(), h(ul, {
|
|
795
795
|
key: 1,
|
|
796
|
-
actions:
|
|
797
|
-
table:
|
|
798
|
-
resizable:
|
|
799
|
-
}, null, 8, ["actions", "resizable"])) :
|
|
796
|
+
actions: u(E),
|
|
797
|
+
table: le,
|
|
798
|
+
resizable: Fe.value
|
|
799
|
+
}, null, 8, ["actions", "resizable"])) : R("", !0)
|
|
800
800
|
]),
|
|
801
801
|
_: 2
|
|
802
802
|
}, [
|
|
803
|
-
|
|
803
|
+
i.$slots.empty ? {
|
|
804
804
|
name: "empty",
|
|
805
805
|
fn: o(() => [
|
|
806
|
-
|
|
806
|
+
ne(i.$slots, "empty", {}, void 0, !0)
|
|
807
807
|
]),
|
|
808
808
|
key: "0"
|
|
809
809
|
} : void 0
|
|
810
810
|
]), 1032, ["data", "row-key", "onSelectionChange"])
|
|
811
|
-
], 2)) : pe.value === "card" ? (n(), h(
|
|
811
|
+
], 2)) : pe.value === "card" ? (n(), h(fl, {
|
|
812
812
|
key: 1,
|
|
813
|
-
rows:
|
|
813
|
+
rows: u($),
|
|
814
814
|
"row-key": e.rowKey,
|
|
815
|
-
"show-checkbox":
|
|
816
|
-
loading:
|
|
817
|
-
"has-actions":
|
|
818
|
-
"is-selected":
|
|
819
|
-
onCheck:
|
|
820
|
-
onContextmenu:
|
|
815
|
+
"show-checkbox": we.value,
|
|
816
|
+
loading: B.value,
|
|
817
|
+
"has-actions": u(E).length > 0,
|
|
818
|
+
"is-selected": u(T),
|
|
819
|
+
onCheck: ze,
|
|
820
|
+
onContextmenu: He
|
|
821
821
|
}, Be({ _: 2 }, [
|
|
822
|
-
|
|
822
|
+
i.$slots.card ? {
|
|
823
823
|
name: "default",
|
|
824
|
-
fn: o(({ row:
|
|
825
|
-
|
|
826
|
-
row:
|
|
827
|
-
index:
|
|
824
|
+
fn: o(({ row: ce, index: xe }) => [
|
|
825
|
+
ne(i.$slots, "card", {
|
|
826
|
+
row: ce,
|
|
827
|
+
index: xe
|
|
828
828
|
}, void 0, !0)
|
|
829
829
|
]),
|
|
830
830
|
key: "0"
|
|
831
831
|
} : void 0,
|
|
832
|
-
|
|
832
|
+
i.$slots.empty ? {
|
|
833
833
|
name: "empty",
|
|
834
834
|
fn: o(() => [
|
|
835
|
-
|
|
835
|
+
ne(i.$slots, "empty", {}, void 0, !0)
|
|
836
836
|
]),
|
|
837
837
|
key: "1"
|
|
838
838
|
} : void 0
|
|
839
|
-
]), 1032, ["rows", "row-key", "show-checkbox", "loading", "has-actions", "is-selected"])) : (n(), h(
|
|
839
|
+
]), 1032, ["rows", "row-key", "show-checkbox", "loading", "has-actions", "is-selected"])) : (n(), h(bl, {
|
|
840
840
|
key: 2,
|
|
841
|
-
rows:
|
|
841
|
+
rows: u($),
|
|
842
842
|
"row-key": e.rowKey,
|
|
843
|
-
"show-checkbox":
|
|
844
|
-
loading:
|
|
845
|
-
"has-actions":
|
|
846
|
-
"is-selected":
|
|
847
|
-
onCheck:
|
|
848
|
-
onContextmenu:
|
|
843
|
+
"show-checkbox": we.value,
|
|
844
|
+
loading: B.value,
|
|
845
|
+
"has-actions": u(E).length > 0,
|
|
846
|
+
"is-selected": u(T),
|
|
847
|
+
onCheck: ze,
|
|
848
|
+
onContextmenu: He
|
|
849
849
|
}, Be({ _: 2 }, [
|
|
850
|
-
|
|
850
|
+
i.$slots.list ? {
|
|
851
851
|
name: "default",
|
|
852
|
-
fn: o(({ row:
|
|
853
|
-
|
|
854
|
-
row:
|
|
855
|
-
index:
|
|
852
|
+
fn: o(({ row: ce, index: xe }) => [
|
|
853
|
+
ne(i.$slots, "list", {
|
|
854
|
+
row: ce,
|
|
855
|
+
index: xe
|
|
856
856
|
}, void 0, !0)
|
|
857
857
|
]),
|
|
858
858
|
key: "0"
|
|
859
859
|
} : void 0,
|
|
860
|
-
|
|
860
|
+
i.$slots.empty ? {
|
|
861
861
|
name: "empty",
|
|
862
862
|
fn: o(() => [
|
|
863
|
-
|
|
863
|
+
ne(i.$slots, "empty", {}, void 0, !0)
|
|
864
864
|
]),
|
|
865
865
|
key: "1"
|
|
866
866
|
} : void 0
|
|
867
867
|
]), 1032, ["rows", "row-key", "show-checkbox", "loading", "has-actions", "is-selected"])),
|
|
868
|
-
|
|
868
|
+
p(Rt, { name: "yk-loading-fade" }, {
|
|
869
869
|
default: o(() => [
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
870
|
+
B.value ? (n(), g("div", $l, [
|
|
871
|
+
ne(i.$slots, "loading", {}, () => [
|
|
872
|
+
J[1] || (J[1] = y("span", {
|
|
873
873
|
class: "yk-table__loading-spinner",
|
|
874
874
|
"aria-label": "加载中"
|
|
875
875
|
}, null, -1))
|
|
876
876
|
], !0)
|
|
877
|
-
])) :
|
|
877
|
+
])) : R("", !0)
|
|
878
878
|
]),
|
|
879
879
|
_: 3
|
|
880
880
|
})
|
|
881
881
|
]),
|
|
882
|
-
|
|
883
|
-
menu:
|
|
884
|
-
actions:
|
|
885
|
-
"is-enabled":
|
|
886
|
-
onClose:
|
|
887
|
-
onSelect:
|
|
882
|
+
p(xl, {
|
|
883
|
+
menu: ge.value,
|
|
884
|
+
actions: We.value,
|
|
885
|
+
"is-enabled": u(vt),
|
|
886
|
+
onClose: J[0] || (J[0] = (ce) => ge.value = null),
|
|
887
|
+
onSelect: c
|
|
888
888
|
}, null, 8, ["menu", "actions", "is-enabled"]),
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
889
|
+
I.value || i.$slots.footer ? (n(), g("div", Vl, [
|
|
890
|
+
y("div", Fl, [
|
|
891
|
+
ne(i.$slots, "footer", {}, void 0, !0)
|
|
892
892
|
]),
|
|
893
|
-
|
|
893
|
+
I.value ? (n(), h(X, {
|
|
894
894
|
key: 0,
|
|
895
895
|
class: "yk-table__pagination",
|
|
896
|
-
layout:
|
|
897
|
-
total:
|
|
896
|
+
layout: u(H) ? "total, sizes, prev, pager, next" : "sizes, prev, pager, next",
|
|
897
|
+
total: u(P),
|
|
898
898
|
"page-sizes": e.pageSizes,
|
|
899
|
-
"page-size":
|
|
900
|
-
"current-page":
|
|
901
|
-
onCurrentChange:
|
|
902
|
-
onSizeChange:
|
|
903
|
-
}, null, 8, ["layout", "total", "page-sizes", "page-size", "current-page"])) :
|
|
904
|
-
])) :
|
|
905
|
-
|
|
899
|
+
"page-size": d.value,
|
|
900
|
+
"current-page": u(S),
|
|
901
|
+
onCurrentChange: O,
|
|
902
|
+
onSizeChange: ie
|
|
903
|
+
}, null, 8, ["layout", "total", "page-sizes", "page-size", "current-page"])) : R("", !0)
|
|
904
|
+
])) : R("", !0),
|
|
905
|
+
p(al, {
|
|
906
906
|
ref_key: "exportDialogRef",
|
|
907
|
-
ref:
|
|
908
|
-
"current-rows":
|
|
909
|
-
"selected-rows":
|
|
907
|
+
ref: se,
|
|
908
|
+
"current-rows": u($),
|
|
909
|
+
"selected-rows": u(_),
|
|
910
910
|
"data-fun": l.dataFun,
|
|
911
911
|
"export-page-size": l.exportPageSize,
|
|
912
|
-
total:
|
|
912
|
+
total: u(P),
|
|
913
913
|
"exportor-func": l.exportorFunc,
|
|
914
|
-
"table-name": ((
|
|
915
|
-
columns:
|
|
916
|
-
"has-more-page":
|
|
917
|
-
"export-selected":
|
|
914
|
+
"table-name": ((be = u(k)) == null ? void 0 : be.displayName) ?? "数据",
|
|
915
|
+
columns: w.value,
|
|
916
|
+
"has-more-page": I.value,
|
|
917
|
+
"export-selected": we.value
|
|
918
918
|
}, null, 8, ["current-rows", "selected-rows", "data-fun", "export-page-size", "total", "exportor-func", "table-name", "columns", "has-more-page", "export-selected"]),
|
|
919
|
-
|
|
919
|
+
p(il, {
|
|
920
920
|
ref_key: "configDialogRef",
|
|
921
|
-
ref:
|
|
921
|
+
ref: ee,
|
|
922
922
|
"load-custom-config-fun": e.loadCustomConfigFun,
|
|
923
923
|
"save-custom-config-fun": e.saveCustomConfigFun,
|
|
924
|
-
meta:
|
|
924
|
+
meta: u(k)
|
|
925
925
|
}, null, 8, ["load-custom-config-fun", "save-custom-config-fun", "meta"])
|
|
926
926
|
]);
|
|
927
927
|
};
|
|
928
928
|
}
|
|
929
|
-
}),
|
|
929
|
+
}), _t = /* @__PURE__ */ ae(Ml, [["__scopeId", "data-v-6efda66a"]]), Al = { class: "yk-table-action-menu-button__check" }, Rl = { class: "yk-table-action-menu-button__check" }, Pl = { class: "yk-table-action-menu-button__check" }, zl = { class: "yk-table-action-menu-button__check" }, Bl = { class: "yk-table-action-menu-button__check" }, Dl = { class: "yk-table-action-menu-button__check" }, El = /* @__PURE__ */ Z({
|
|
930
930
|
__name: "tableActionMenuButton",
|
|
931
931
|
props: {
|
|
932
932
|
table: {}
|
|
933
933
|
},
|
|
934
934
|
setup(e) {
|
|
935
|
-
const
|
|
935
|
+
const m = e;
|
|
936
936
|
function t(l) {
|
|
937
937
|
switch (l) {
|
|
938
938
|
case "refresh":
|
|
939
|
-
|
|
939
|
+
m.table.refresh();
|
|
940
940
|
break;
|
|
941
941
|
case "config":
|
|
942
|
-
|
|
942
|
+
m.table.openConfigDialog();
|
|
943
943
|
break;
|
|
944
944
|
case "export":
|
|
945
|
-
|
|
945
|
+
m.table.openExportDialog();
|
|
946
946
|
break;
|
|
947
947
|
case "view-table":
|
|
948
|
-
|
|
948
|
+
m.table.setViewMode("table");
|
|
949
949
|
break;
|
|
950
950
|
case "view-card":
|
|
951
|
-
|
|
951
|
+
m.table.setViewMode("card");
|
|
952
952
|
break;
|
|
953
953
|
case "view-list":
|
|
954
|
-
|
|
954
|
+
m.table.setViewMode("list");
|
|
955
955
|
break;
|
|
956
956
|
case "toggle-checkbox":
|
|
957
|
-
|
|
957
|
+
m.table.setSelectable(!m.table.selectable);
|
|
958
958
|
break;
|
|
959
959
|
case "toggle-column-resize":
|
|
960
|
-
|
|
960
|
+
m.table.setColumnResizable(!m.table.columnResizable);
|
|
961
961
|
break;
|
|
962
962
|
case "toggle-sticky-header":
|
|
963
|
-
|
|
963
|
+
m.table.setStickyHeader(!m.table.stickyHeader);
|
|
964
964
|
break;
|
|
965
965
|
}
|
|
966
966
|
}
|
|
967
967
|
return (l, a) => {
|
|
968
|
-
const k =
|
|
969
|
-
return n(), h(
|
|
968
|
+
const k = C("el-button"), r = C("el-dropdown-item"), $ = C("el-dropdown-menu"), f = C("el-dropdown");
|
|
969
|
+
return n(), h(f, {
|
|
970
970
|
trigger: "click",
|
|
971
971
|
placement: "bottom-end",
|
|
972
972
|
onCommand: t
|
|
973
973
|
}, {
|
|
974
974
|
dropdown: o(() => [
|
|
975
|
-
|
|
975
|
+
p($, null, {
|
|
976
976
|
default: o(() => [
|
|
977
|
-
|
|
977
|
+
p(r, { command: "refresh" }, {
|
|
978
978
|
default: o(() => [...a[1] || (a[1] = [
|
|
979
|
-
|
|
979
|
+
y("svg", {
|
|
980
980
|
viewBox: "0 0 24 24",
|
|
981
981
|
width: "14",
|
|
982
982
|
height: "14",
|
|
@@ -987,17 +987,17 @@ import './index.css';const Kt = { class: "export-options" }, jt = { class: "expo
|
|
|
987
987
|
"stroke-linejoin": "round",
|
|
988
988
|
class: "yk-table-action-menu-button__icon"
|
|
989
989
|
}, [
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
990
|
+
y("polyline", { points: "23 4 23 10 17 10" }),
|
|
991
|
+
y("polyline", { points: "1 20 1 14 7 14" }),
|
|
992
|
+
y("path", { d: "M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15" })
|
|
993
993
|
], -1),
|
|
994
|
-
|
|
994
|
+
V(" 刷新 ", -1)
|
|
995
995
|
])]),
|
|
996
996
|
_: 1
|
|
997
997
|
}),
|
|
998
|
-
|
|
998
|
+
p(r, { command: "export" }, {
|
|
999
999
|
default: o(() => [...a[2] || (a[2] = [
|
|
1000
|
-
|
|
1000
|
+
y("svg", {
|
|
1001
1001
|
viewBox: "0 0 24 24",
|
|
1002
1002
|
width: "14",
|
|
1003
1003
|
height: "14",
|
|
@@ -1008,22 +1008,22 @@ import './index.css';const Kt = { class: "export-options" }, jt = { class: "expo
|
|
|
1008
1008
|
"stroke-linejoin": "round",
|
|
1009
1009
|
class: "yk-table-action-menu-button__icon"
|
|
1010
1010
|
}, [
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1011
|
+
y("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
|
|
1012
|
+
y("polyline", { points: "7 10 12 15 17 10" }),
|
|
1013
|
+
y("line", {
|
|
1014
1014
|
x1: "12",
|
|
1015
1015
|
y1: "15",
|
|
1016
1016
|
x2: "12",
|
|
1017
1017
|
y2: "3"
|
|
1018
1018
|
})
|
|
1019
1019
|
], -1),
|
|
1020
|
-
|
|
1020
|
+
V(" 导出 Excel ", -1)
|
|
1021
1021
|
])]),
|
|
1022
1022
|
_: 1
|
|
1023
1023
|
}),
|
|
1024
|
-
|
|
1024
|
+
p(r, { command: "config" }, {
|
|
1025
1025
|
default: o(() => [...a[3] || (a[3] = [
|
|
1026
|
-
|
|
1026
|
+
y("svg", {
|
|
1027
1027
|
viewBox: "0 0 24 24",
|
|
1028
1028
|
width: "14",
|
|
1029
1029
|
height: "14",
|
|
@@ -1034,68 +1034,68 @@ import './index.css';const Kt = { class: "export-options" }, jt = { class: "expo
|
|
|
1034
1034
|
"stroke-linejoin": "round",
|
|
1035
1035
|
class: "yk-table-action-menu-button__icon"
|
|
1036
1036
|
}, [
|
|
1037
|
-
|
|
1037
|
+
y("circle", {
|
|
1038
1038
|
cx: "12",
|
|
1039
1039
|
cy: "12",
|
|
1040
1040
|
r: "3"
|
|
1041
1041
|
}),
|
|
1042
|
-
|
|
1042
|
+
y("path", { d: "M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z" })
|
|
1043
1043
|
], -1),
|
|
1044
|
-
|
|
1044
|
+
V(" 列设置 ", -1)
|
|
1045
1045
|
])]),
|
|
1046
1046
|
_: 1
|
|
1047
1047
|
}),
|
|
1048
|
-
|
|
1048
|
+
p(r, {
|
|
1049
1049
|
command: "view-table",
|
|
1050
1050
|
divided: ""
|
|
1051
1051
|
}, {
|
|
1052
1052
|
default: o(() => [
|
|
1053
|
-
|
|
1054
|
-
a[4] || (a[4] =
|
|
1053
|
+
y("span", Al, z(e.table.viewMode === "table" ? "✓" : ""), 1),
|
|
1054
|
+
a[4] || (a[4] = V("表格视图 ", -1))
|
|
1055
1055
|
]),
|
|
1056
1056
|
_: 1
|
|
1057
1057
|
}),
|
|
1058
|
-
e.table.slotNames.includes("card") ? (n(), h(
|
|
1058
|
+
e.table.slotNames.includes("card") ? (n(), h(r, {
|
|
1059
1059
|
key: 0,
|
|
1060
1060
|
command: "view-card"
|
|
1061
1061
|
}, {
|
|
1062
1062
|
default: o(() => [
|
|
1063
|
-
|
|
1064
|
-
a[5] || (a[5] =
|
|
1063
|
+
y("span", Rl, z(e.table.viewMode === "card" ? "✓" : ""), 1),
|
|
1064
|
+
a[5] || (a[5] = V("卡片视图 ", -1))
|
|
1065
1065
|
]),
|
|
1066
1066
|
_: 1
|
|
1067
|
-
})) :
|
|
1068
|
-
e.table.slotNames.includes("list") ? (n(), h(
|
|
1067
|
+
})) : R("", !0),
|
|
1068
|
+
e.table.slotNames.includes("list") ? (n(), h(r, {
|
|
1069
1069
|
key: 1,
|
|
1070
1070
|
command: "view-list"
|
|
1071
1071
|
}, {
|
|
1072
1072
|
default: o(() => [
|
|
1073
|
-
|
|
1074
|
-
a[6] || (a[6] =
|
|
1073
|
+
y("span", Pl, z(e.table.viewMode === "list" ? "✓" : ""), 1),
|
|
1074
|
+
a[6] || (a[6] = V("列表视图 ", -1))
|
|
1075
1075
|
]),
|
|
1076
1076
|
_: 1
|
|
1077
|
-
})) :
|
|
1078
|
-
|
|
1077
|
+
})) : R("", !0),
|
|
1078
|
+
p(r, {
|
|
1079
1079
|
command: "toggle-checkbox",
|
|
1080
1080
|
divided: ""
|
|
1081
1081
|
}, {
|
|
1082
1082
|
default: o(() => [
|
|
1083
|
-
|
|
1084
|
-
a[7] || (a[7] =
|
|
1083
|
+
y("span", zl, z(e.table.selectable ? "✓" : ""), 1),
|
|
1084
|
+
a[7] || (a[7] = V("选择行 ", -1))
|
|
1085
1085
|
]),
|
|
1086
1086
|
_: 1
|
|
1087
1087
|
}),
|
|
1088
|
-
|
|
1088
|
+
p(r, { command: "toggle-column-resize" }, {
|
|
1089
1089
|
default: o(() => [
|
|
1090
|
-
|
|
1091
|
-
a[8] || (a[8] =
|
|
1090
|
+
y("span", Bl, z(e.table.columnResizable ? "✓" : ""), 1),
|
|
1091
|
+
a[8] || (a[8] = V("列宽拖动 ", -1))
|
|
1092
1092
|
]),
|
|
1093
1093
|
_: 1
|
|
1094
1094
|
}),
|
|
1095
|
-
|
|
1095
|
+
p(r, { command: "toggle-sticky-header" }, {
|
|
1096
1096
|
default: o(() => [
|
|
1097
|
-
|
|
1098
|
-
a[9] || (a[9] =
|
|
1097
|
+
y("span", Dl, z(e.table.stickyHeader ? "✓" : ""), 1),
|
|
1098
|
+
a[9] || (a[9] = V("锁定表头 ", -1))
|
|
1099
1099
|
]),
|
|
1100
1100
|
_: 1
|
|
1101
1101
|
})
|
|
@@ -1104,14 +1104,14 @@ import './index.css';const Kt = { class: "export-options" }, jt = { class: "expo
|
|
|
1104
1104
|
})
|
|
1105
1105
|
]),
|
|
1106
1106
|
default: o(() => [
|
|
1107
|
-
|
|
1108
|
-
|
|
1107
|
+
ne(l.$slots, "trigger", {}, () => [
|
|
1108
|
+
p(k, {
|
|
1109
1109
|
class: "yk-table-action-menu-button__btn",
|
|
1110
1110
|
title: "表格操作",
|
|
1111
1111
|
"aria-label": "表格操作"
|
|
1112
1112
|
}, {
|
|
1113
1113
|
default: o(() => [...a[0] || (a[0] = [
|
|
1114
|
-
|
|
1114
|
+
y("svg", {
|
|
1115
1115
|
viewBox: "0 0 24 24",
|
|
1116
1116
|
width: "16",
|
|
1117
1117
|
height: "16",
|
|
@@ -1120,37 +1120,37 @@ import './index.css';const Kt = { class: "export-options" }, jt = { class: "expo
|
|
|
1120
1120
|
"stroke-width": "2",
|
|
1121
1121
|
"stroke-linecap": "round"
|
|
1122
1122
|
}, [
|
|
1123
|
-
|
|
1123
|
+
y("line", {
|
|
1124
1124
|
x1: "3",
|
|
1125
1125
|
y1: "6",
|
|
1126
1126
|
x2: "21",
|
|
1127
1127
|
y2: "6"
|
|
1128
1128
|
}),
|
|
1129
|
-
|
|
1129
|
+
y("circle", {
|
|
1130
1130
|
cx: "9",
|
|
1131
1131
|
cy: "6",
|
|
1132
1132
|
r: "2.4",
|
|
1133
1133
|
fill: "var(--el-bg-color, #fff)"
|
|
1134
1134
|
}),
|
|
1135
|
-
|
|
1135
|
+
y("line", {
|
|
1136
1136
|
x1: "3",
|
|
1137
1137
|
y1: "12",
|
|
1138
1138
|
x2: "21",
|
|
1139
1139
|
y2: "12"
|
|
1140
1140
|
}),
|
|
1141
|
-
|
|
1141
|
+
y("circle", {
|
|
1142
1142
|
cx: "15",
|
|
1143
1143
|
cy: "12",
|
|
1144
1144
|
r: "2.4",
|
|
1145
1145
|
fill: "var(--el-bg-color, #fff)"
|
|
1146
1146
|
}),
|
|
1147
|
-
|
|
1147
|
+
y("line", {
|
|
1148
1148
|
x1: "3",
|
|
1149
1149
|
y1: "18",
|
|
1150
1150
|
x2: "21",
|
|
1151
1151
|
y2: "18"
|
|
1152
1152
|
}),
|
|
1153
|
-
|
|
1153
|
+
y("circle", {
|
|
1154
1154
|
cx: "9",
|
|
1155
1155
|
cy: "18",
|
|
1156
1156
|
r: "2.4",
|
|
@@ -1166,59 +1166,59 @@ import './index.css';const Kt = { class: "export-options" }, jt = { class: "expo
|
|
|
1166
1166
|
});
|
|
1167
1167
|
};
|
|
1168
1168
|
}
|
|
1169
|
-
}),
|
|
1169
|
+
}), bt = /* @__PURE__ */ ae(El, [["__scopeId", "data-v-fffcf297"]]), Il = {
|
|
1170
1170
|
key: 0,
|
|
1171
1171
|
class: "yk-table__selection-bar"
|
|
1172
|
-
},
|
|
1172
|
+
}, Tl = { class: "yk-table__selection-bar__count" }, Ql = /* @__PURE__ */ Z({
|
|
1173
1173
|
__name: "selectionBar",
|
|
1174
1174
|
props: {
|
|
1175
1175
|
count: {}
|
|
1176
1176
|
},
|
|
1177
1177
|
emits: ["select-all", "invert", "clear"],
|
|
1178
1178
|
setup(e) {
|
|
1179
|
-
return (
|
|
1180
|
-
const l =
|
|
1181
|
-
return e.count > 0 ? (n(),
|
|
1182
|
-
|
|
1183
|
-
t[6] || (t[6] =
|
|
1184
|
-
|
|
1179
|
+
return (m, t) => {
|
|
1180
|
+
const l = C("el-button");
|
|
1181
|
+
return e.count > 0 ? (n(), g("div", Il, [
|
|
1182
|
+
y("span", Tl, "已选 " + z(e.count) + " 项", 1),
|
|
1183
|
+
t[6] || (t[6] = y("span", { class: "yk-table__selection-bar__sep" }, "|", -1)),
|
|
1184
|
+
p(l, {
|
|
1185
1185
|
link: "",
|
|
1186
1186
|
type: "primary",
|
|
1187
1187
|
class: "yk-table__selection-bar__btn",
|
|
1188
|
-
onClick: t[0] || (t[0] = (a) =>
|
|
1188
|
+
onClick: t[0] || (t[0] = (a) => m.$emit("select-all"))
|
|
1189
1189
|
}, {
|
|
1190
1190
|
default: o(() => [...t[3] || (t[3] = [
|
|
1191
|
-
|
|
1191
|
+
V("全选", -1)
|
|
1192
1192
|
])]),
|
|
1193
1193
|
_: 1
|
|
1194
1194
|
}),
|
|
1195
|
-
|
|
1195
|
+
p(l, {
|
|
1196
1196
|
link: "",
|
|
1197
1197
|
type: "primary",
|
|
1198
1198
|
class: "yk-table__selection-bar__btn",
|
|
1199
|
-
onClick: t[1] || (t[1] = (a) =>
|
|
1199
|
+
onClick: t[1] || (t[1] = (a) => m.$emit("invert"))
|
|
1200
1200
|
}, {
|
|
1201
1201
|
default: o(() => [...t[4] || (t[4] = [
|
|
1202
|
-
|
|
1202
|
+
V("反选", -1)
|
|
1203
1203
|
])]),
|
|
1204
1204
|
_: 1
|
|
1205
1205
|
}),
|
|
1206
|
-
t[7] || (t[7] =
|
|
1207
|
-
|
|
1206
|
+
t[7] || (t[7] = y("span", { class: "yk-table__selection-bar__sep" }, "|", -1)),
|
|
1207
|
+
p(l, {
|
|
1208
1208
|
link: "",
|
|
1209
1209
|
type: "primary",
|
|
1210
1210
|
class: "yk-table__selection-bar__btn",
|
|
1211
|
-
onClick: t[2] || (t[2] = (a) =>
|
|
1211
|
+
onClick: t[2] || (t[2] = (a) => m.$emit("clear"))
|
|
1212
1212
|
}, {
|
|
1213
1213
|
default: o(() => [...t[5] || (t[5] = [
|
|
1214
|
-
|
|
1214
|
+
V("清空", -1)
|
|
1215
1215
|
])]),
|
|
1216
1216
|
_: 1
|
|
1217
1217
|
})
|
|
1218
|
-
])) :
|
|
1218
|
+
])) : R("", !0);
|
|
1219
1219
|
};
|
|
1220
1220
|
}
|
|
1221
|
-
}),
|
|
1221
|
+
}), Yl = /* @__PURE__ */ ae(Ql, [["__scopeId", "data-v-3f40dafb"]]), Nl = { class: "yk-command-bar" }, ql = { class: "yk-command-bar__actions" }, Ol = /* @__PURE__ */ Z({
|
|
1222
1222
|
__name: "commandBar",
|
|
1223
1223
|
props: {
|
|
1224
1224
|
/** 表级命令列表,每条渲染为一个 el-button(type/plain/icon/desc),click 调 execute(table) */
|
|
@@ -1229,79 +1229,79 @@ import './index.css';const Kt = { class: "export-options" }, jt = { class: "expo
|
|
|
1229
1229
|
showActionMenuButton: { type: Boolean, default: !0 }
|
|
1230
1230
|
},
|
|
1231
1231
|
setup(e) {
|
|
1232
|
-
const
|
|
1232
|
+
const m = e;
|
|
1233
1233
|
return (t, l) => {
|
|
1234
|
-
const a =
|
|
1235
|
-
return n(),
|
|
1236
|
-
|
|
1237
|
-
(n(!0),
|
|
1234
|
+
const a = C("el-button");
|
|
1235
|
+
return n(), g("div", Nl, [
|
|
1236
|
+
y("div", ql, [
|
|
1237
|
+
(n(!0), g(L, null, te(m.actions, (k) => (n(), h(a, {
|
|
1238
1238
|
key: k.name,
|
|
1239
1239
|
type: k.type === "default" ? void 0 : k.type,
|
|
1240
1240
|
plain: k.plain,
|
|
1241
|
-
onClick: (
|
|
1241
|
+
onClick: (r) => m.table && k.execute(m.table)
|
|
1242
1242
|
}, {
|
|
1243
1243
|
default: o(() => [
|
|
1244
|
-
k.icon ? (n(), h(
|
|
1244
|
+
k.icon ? (n(), h(Qe(k.icon), {
|
|
1245
1245
|
key: 0,
|
|
1246
1246
|
class: "yk-command-bar__icon"
|
|
1247
|
-
})) :
|
|
1248
|
-
|
|
1247
|
+
})) : R("", !0),
|
|
1248
|
+
V(" " + z(k.desc), 1)
|
|
1249
1249
|
]),
|
|
1250
1250
|
_: 2
|
|
1251
1251
|
}, 1032, ["type", "plain", "onClick"]))), 128)),
|
|
1252
|
-
|
|
1252
|
+
m.table ? (n(), h(Yl, {
|
|
1253
1253
|
key: 0,
|
|
1254
|
-
count:
|
|
1254
|
+
count: m.table.selectedRows.length,
|
|
1255
1255
|
onSelectAll: l[0] || (l[0] = (k) => {
|
|
1256
|
-
var
|
|
1257
|
-
return (
|
|
1256
|
+
var r;
|
|
1257
|
+
return (r = m.table) == null ? void 0 : r.selectAllOnPage();
|
|
1258
1258
|
}),
|
|
1259
1259
|
onInvert: l[1] || (l[1] = (k) => {
|
|
1260
|
-
var
|
|
1261
|
-
return (
|
|
1260
|
+
var r;
|
|
1261
|
+
return (r = m.table) == null ? void 0 : r.invertSelectionOnPage();
|
|
1262
1262
|
}),
|
|
1263
1263
|
onClear: l[2] || (l[2] = (k) => {
|
|
1264
|
-
var
|
|
1265
|
-
return (
|
|
1264
|
+
var r;
|
|
1265
|
+
return (r = m.table) == null ? void 0 : r.clearSelection();
|
|
1266
1266
|
})
|
|
1267
|
-
}, null, 8, ["count"])) :
|
|
1268
|
-
|
|
1267
|
+
}, null, 8, ["count"])) : R("", !0),
|
|
1268
|
+
ne(t.$slots, "default", {}, void 0, !0)
|
|
1269
1269
|
]),
|
|
1270
|
-
|
|
1270
|
+
m.showActionMenuButton && m.table ? (n(), h(bt, {
|
|
1271
1271
|
key: 0,
|
|
1272
|
-
table:
|
|
1272
|
+
table: m.table,
|
|
1273
1273
|
class: "yk-command-bar__menu"
|
|
1274
|
-
}, null, 8, ["table"])) :
|
|
1274
|
+
}, null, 8, ["table"])) : R("", !0)
|
|
1275
1275
|
]);
|
|
1276
1276
|
};
|
|
1277
1277
|
}
|
|
1278
|
-
}),
|
|
1278
|
+
}), ht = /* @__PURE__ */ ae(Ol, [["__scopeId", "data-v-cd091888"]]), Ul = {
|
|
1279
1279
|
key: 0,
|
|
1280
1280
|
class: "ys-main-panel__menu-icon"
|
|
1281
|
-
},
|
|
1281
|
+
}, Ll = { class: "ys-main-panel__menu-text" }, Hl = {
|
|
1282
1282
|
key: 0,
|
|
1283
1283
|
class: "ys-main-panel__menu-icon"
|
|
1284
|
-
},
|
|
1284
|
+
}, Kl = { class: "ys-main-panel__menu-text" }, rt = /* @__PURE__ */ Z({
|
|
1285
1285
|
name: "YsMainPanelMenuNode",
|
|
1286
1286
|
__name: "mainPanelMenuNode",
|
|
1287
1287
|
props: {
|
|
1288
1288
|
node: {}
|
|
1289
1289
|
},
|
|
1290
1290
|
setup(e) {
|
|
1291
|
-
return (
|
|
1292
|
-
const l =
|
|
1291
|
+
return (m, t) => {
|
|
1292
|
+
const l = C("main-panel-menu-node", !0), a = C("el-sub-menu"), k = C("el-menu-item");
|
|
1293
1293
|
return e.node.children && e.node.children.length > 0 ? (n(), h(a, {
|
|
1294
1294
|
key: 0,
|
|
1295
1295
|
index: e.node.key
|
|
1296
1296
|
}, {
|
|
1297
1297
|
title: o(() => [
|
|
1298
|
-
e.node.icon ? (n(),
|
|
1299
|
-
|
|
1298
|
+
e.node.icon ? (n(), g("i", Ul, z(e.node.icon), 1)) : R("", !0),
|
|
1299
|
+
y("span", Ll, z(e.node.label), 1)
|
|
1300
1300
|
]),
|
|
1301
1301
|
default: o(() => [
|
|
1302
|
-
(n(!0),
|
|
1303
|
-
key:
|
|
1304
|
-
node:
|
|
1302
|
+
(n(!0), g(L, null, te(e.node.children, (r) => (n(), h(l, {
|
|
1303
|
+
key: r.key,
|
|
1304
|
+
node: r
|
|
1305
1305
|
}, null, 8, ["node"]))), 128))
|
|
1306
1306
|
]),
|
|
1307
1307
|
_: 1
|
|
@@ -1310,20 +1310,20 @@ import './index.css';const Kt = { class: "export-options" }, jt = { class: "expo
|
|
|
1310
1310
|
index: e.node.key
|
|
1311
1311
|
}, {
|
|
1312
1312
|
default: o(() => [
|
|
1313
|
-
e.node.icon ? (n(),
|
|
1314
|
-
|
|
1313
|
+
e.node.icon ? (n(), g("i", Hl, z(e.node.icon), 1)) : R("", !0),
|
|
1314
|
+
y("span", Kl, z(e.node.label), 1)
|
|
1315
1315
|
]),
|
|
1316
1316
|
_: 1
|
|
1317
1317
|
}, 8, ["index"]));
|
|
1318
1318
|
};
|
|
1319
1319
|
}
|
|
1320
|
-
}),
|
|
1320
|
+
}), jl = { class: "ys-main-panel" }, Gl = { class: "ys-main-panel__aside-header" }, Wl = ["title"], Jl = {
|
|
1321
1321
|
key: 0,
|
|
1322
1322
|
class: "ys-main-panel__menu-empty"
|
|
1323
|
-
},
|
|
1323
|
+
}, Xl = { class: "ys-main-panel__main" }, Zl = {
|
|
1324
1324
|
key: 1,
|
|
1325
1325
|
class: "ys-main-panel__empty"
|
|
1326
|
-
},
|
|
1326
|
+
}, en = /* @__PURE__ */ Z({
|
|
1327
1327
|
name: "YsMainPanel",
|
|
1328
1328
|
__name: "mainPanel",
|
|
1329
1329
|
props: {
|
|
@@ -1347,150 +1347,150 @@ import './index.css';const Kt = { class: "export-options" }, jt = { class: "expo
|
|
|
1347
1347
|
menuKeyword: { type: String, default: "" }
|
|
1348
1348
|
},
|
|
1349
1349
|
emits: ["update:menuKeyword"],
|
|
1350
|
-
setup(e, { emit:
|
|
1351
|
-
const t = e, l =
|
|
1350
|
+
setup(e, { emit: m }) {
|
|
1351
|
+
const t = e, l = m, a = Y(!1), k = Y(t.menuKeyword);
|
|
1352
1352
|
me(
|
|
1353
1353
|
() => t.menuKeyword,
|
|
1354
|
-
(
|
|
1355
|
-
k.value =
|
|
1354
|
+
(s) => {
|
|
1355
|
+
k.value = s;
|
|
1356
1356
|
}
|
|
1357
1357
|
);
|
|
1358
|
-
const
|
|
1358
|
+
const r = Q({
|
|
1359
1359
|
get: () => k.value,
|
|
1360
|
-
set: (
|
|
1361
|
-
k.value =
|
|
1360
|
+
set: (s) => {
|
|
1361
|
+
k.value = s, l("update:menuKeyword", s);
|
|
1362
1362
|
}
|
|
1363
|
-
}),
|
|
1364
|
-
function
|
|
1365
|
-
const
|
|
1366
|
-
|
|
1367
|
-
}
|
|
1368
|
-
let
|
|
1369
|
-
return
|
|
1370
|
-
if (await
|
|
1371
|
-
const
|
|
1372
|
-
|
|
1363
|
+
}), $ = Q(() => r.value.trim().length > 0), f = Q(() => Qt(S.value, r.value)), x = Q(() => Yt(f.value)), { nodes: S, menuLoading: P, loadNodes: H } = Nt(t), { openTabs: A, activeKey: b, openTab: _, removeTab: N, getComponent: T } = qt(t);
|
|
1364
|
+
function U(s) {
|
|
1365
|
+
const v = at(S.value, s);
|
|
1366
|
+
v && !st(v) && _(v);
|
|
1367
|
+
}
|
|
1368
|
+
let G = !1;
|
|
1369
|
+
return Me(async () => {
|
|
1370
|
+
if (await H(), !G && t.defaultActive) {
|
|
1371
|
+
const s = at(S.value, t.defaultActive);
|
|
1372
|
+
s && !st(s) && _(s), G = !0;
|
|
1373
1373
|
}
|
|
1374
|
-
}), (
|
|
1375
|
-
const F =
|
|
1376
|
-
return n(),
|
|
1377
|
-
|
|
1378
|
-
class:
|
|
1374
|
+
}), (s, v) => {
|
|
1375
|
+
const F = C("el-input"), q = C("el-menu"), E = C("el-tab-pane"), ue = C("el-tabs"), de = C("el-empty"), ee = pt("loading");
|
|
1376
|
+
return n(), g("div", jl, [
|
|
1377
|
+
y("aside", {
|
|
1378
|
+
class: $e(["ys-main-panel__aside", { "is-collapsed": a.value }])
|
|
1379
1379
|
}, [
|
|
1380
|
-
|
|
1381
|
-
|
|
1380
|
+
y("div", Gl, [
|
|
1381
|
+
y("button", {
|
|
1382
1382
|
class: "ys-main-panel__collapse-btn",
|
|
1383
1383
|
type: "button",
|
|
1384
1384
|
title: a.value ? "展开菜单" : "折叠菜单",
|
|
1385
|
-
onClick:
|
|
1386
|
-
}, "☰", 8,
|
|
1385
|
+
onClick: v[0] || (v[0] = (w) => a.value = !a.value)
|
|
1386
|
+
}, "☰", 8, Wl),
|
|
1387
1387
|
t.showMenuSearch && !a.value ? (n(), h(F, {
|
|
1388
1388
|
key: 0,
|
|
1389
|
-
modelValue:
|
|
1390
|
-
"onUpdate:modelValue":
|
|
1389
|
+
modelValue: r.value,
|
|
1390
|
+
"onUpdate:modelValue": v[1] || (v[1] = (w) => r.value = w),
|
|
1391
1391
|
class: "ys-main-panel__aside-search",
|
|
1392
1392
|
size: "small",
|
|
1393
1393
|
clearable: "",
|
|
1394
1394
|
placeholder: "搜索功能",
|
|
1395
1395
|
"aria-label": "搜索功能"
|
|
1396
1396
|
}, {
|
|
1397
|
-
prefix: o(() => [...
|
|
1398
|
-
|
|
1397
|
+
prefix: o(() => [...v[3] || (v[3] = [
|
|
1398
|
+
y("svg", {
|
|
1399
1399
|
class: "ys-main-panel__search-icon",
|
|
1400
1400
|
viewBox: "0 0 1024 1024",
|
|
1401
1401
|
width: "14",
|
|
1402
1402
|
height: "14",
|
|
1403
1403
|
"aria-hidden": "true"
|
|
1404
1404
|
}, [
|
|
1405
|
-
|
|
1405
|
+
y("path", {
|
|
1406
1406
|
fill: "currentColor",
|
|
1407
1407
|
d: "M909.098 839.904l-181.22-181.248a341.5 341.5 0 1 0-47.734 48.58l180.56 180.588a33.92 0 0 0 48.394-47.92zM454.4 745.6a291.2 291.2 0 1 1 291.2-291.2 291.2 291.2 0 0 1-291.2 291.2z"
|
|
1408
1408
|
})
|
|
1409
1409
|
], -1)
|
|
1410
1410
|
])]),
|
|
1411
1411
|
_: 1
|
|
1412
|
-
}, 8, ["modelValue"])) :
|
|
1412
|
+
}, 8, ["modelValue"])) : R("", !0)
|
|
1413
1413
|
]),
|
|
1414
|
-
|
|
1415
|
-
key: "search-" +
|
|
1416
|
-
"default-active":
|
|
1414
|
+
$.value ? Xe((n(), h(q, {
|
|
1415
|
+
key: "search-" + r.value,
|
|
1416
|
+
"default-active": u(b),
|
|
1417
1417
|
"default-openeds": x.value,
|
|
1418
1418
|
collapse: a.value,
|
|
1419
1419
|
class: "ys-main-panel__menu",
|
|
1420
1420
|
"element-loading-background": "transparent",
|
|
1421
|
-
onSelect:
|
|
1421
|
+
onSelect: U
|
|
1422
1422
|
}, {
|
|
1423
1423
|
default: o(() => [
|
|
1424
|
-
(n(!0),
|
|
1425
|
-
key:
|
|
1426
|
-
node:
|
|
1424
|
+
(n(!0), g(L, null, te(f.value, (w) => (n(), h(rt, {
|
|
1425
|
+
key: w.key,
|
|
1426
|
+
node: w
|
|
1427
1427
|
}, null, 8, ["node"]))), 128)),
|
|
1428
|
-
|
|
1428
|
+
f.value.length === 0 && !u(P) ? (n(), g("div", Jl, " 未找到匹配的功能 ")) : R("", !0)
|
|
1429
1429
|
]),
|
|
1430
1430
|
_: 1
|
|
1431
1431
|
}, 8, ["default-active", "default-openeds", "collapse"])), [
|
|
1432
|
-
[
|
|
1433
|
-
]) :
|
|
1432
|
+
[ee, u(P)]
|
|
1433
|
+
]) : Xe((n(), h(q, {
|
|
1434
1434
|
key: 1,
|
|
1435
|
-
"default-active":
|
|
1435
|
+
"default-active": u(b),
|
|
1436
1436
|
collapse: a.value,
|
|
1437
1437
|
class: "ys-main-panel__menu",
|
|
1438
1438
|
"element-loading-background": "transparent",
|
|
1439
|
-
onSelect:
|
|
1439
|
+
onSelect: U
|
|
1440
1440
|
}, {
|
|
1441
1441
|
default: o(() => [
|
|
1442
|
-
(n(!0),
|
|
1443
|
-
key:
|
|
1444
|
-
node:
|
|
1442
|
+
(n(!0), g(L, null, te(u(S), (w) => (n(), h(rt, {
|
|
1443
|
+
key: w.key,
|
|
1444
|
+
node: w
|
|
1445
1445
|
}, null, 8, ["node"]))), 128))
|
|
1446
1446
|
]),
|
|
1447
1447
|
_: 1
|
|
1448
1448
|
}, 8, ["default-active", "collapse"])), [
|
|
1449
|
-
[
|
|
1449
|
+
[ee, u(P)]
|
|
1450
1450
|
])
|
|
1451
1451
|
], 2),
|
|
1452
|
-
|
|
1453
|
-
|
|
1452
|
+
y("main", Xl, [
|
|
1453
|
+
u(A).length > 0 ? (n(), h(ue, {
|
|
1454
1454
|
key: 0,
|
|
1455
|
-
modelValue:
|
|
1456
|
-
"onUpdate:modelValue":
|
|
1455
|
+
modelValue: u(b),
|
|
1456
|
+
"onUpdate:modelValue": v[2] || (v[2] = (w) => Se(b) ? b.value = w : null),
|
|
1457
1457
|
type: "card",
|
|
1458
1458
|
closable: "",
|
|
1459
1459
|
class: "ys-main-panel__tabs",
|
|
1460
|
-
onTabRemove:
|
|
1460
|
+
onTabRemove: u(N)
|
|
1461
1461
|
}, {
|
|
1462
1462
|
default: o(() => [
|
|
1463
|
-
(n(!0),
|
|
1464
|
-
key:
|
|
1465
|
-
name:
|
|
1463
|
+
(n(!0), g(L, null, te(u(A), (w) => (n(), h(E, {
|
|
1464
|
+
key: w.key,
|
|
1465
|
+
name: w.key
|
|
1466
1466
|
}, {
|
|
1467
1467
|
label: o(() => [
|
|
1468
|
-
|
|
1468
|
+
V(z(w.label), 1)
|
|
1469
1469
|
]),
|
|
1470
1470
|
default: o(() => [
|
|
1471
|
-
|
|
1471
|
+
w.componentPath ? (n(), h(Qe(u(T)(w.componentPath)), Ze({
|
|
1472
1472
|
key: 0,
|
|
1473
1473
|
ref_for: !0
|
|
1474
|
-
},
|
|
1474
|
+
}, w.props), null, 16)) : R("", !0)
|
|
1475
1475
|
]),
|
|
1476
1476
|
_: 2
|
|
1477
1477
|
}, 1032, ["name"]))), 128))
|
|
1478
1478
|
]),
|
|
1479
1479
|
_: 1
|
|
1480
|
-
}, 8, ["modelValue", "onTabRemove"])) : (n(),
|
|
1481
|
-
|
|
1480
|
+
}, 8, ["modelValue", "onTabRemove"])) : (n(), g("div", Zl, [
|
|
1481
|
+
p(de, { description: "暂无打开的功能,从左侧菜单选择" })
|
|
1482
1482
|
]))
|
|
1483
1483
|
])
|
|
1484
1484
|
]);
|
|
1485
1485
|
};
|
|
1486
1486
|
}
|
|
1487
|
-
}),
|
|
1487
|
+
}), tn = /* @__PURE__ */ ae(en, [["__scopeId", "data-v-c36933e0"]]), ln = {
|
|
1488
1488
|
key: 2,
|
|
1489
1489
|
class: "yk-advanced-value-editor yk-advanced-value-editor--range"
|
|
1490
|
-
},
|
|
1490
|
+
}, nn = {
|
|
1491
1491
|
key: 4,
|
|
1492
1492
|
class: "yk-advanced-value-editor yk-advanced-value-editor--daterange"
|
|
1493
|
-
},
|
|
1493
|
+
}, on = { class: "yk-advanced-value-editor__recent-pop" }, an = /* @__PURE__ */ Z({
|
|
1494
1494
|
name: "YsAdvancedValueEditor",
|
|
1495
1495
|
__name: "advancedValueEditor",
|
|
1496
1496
|
props: {
|
|
@@ -1512,85 +1512,85 @@ import './index.css';const Kt = { class: "export-options" }, jt = { class: "expo
|
|
|
1512
1512
|
valueFormat: { type: String, default: "YYYY-MM-DD" }
|
|
1513
1513
|
},
|
|
1514
1514
|
emits: ["update:modelValue"],
|
|
1515
|
-
setup(e, { emit:
|
|
1516
|
-
const t = e, l =
|
|
1515
|
+
setup(e, { emit: m }) {
|
|
1516
|
+
const t = e, l = m, a = Q(() => t.op === "between" || t.op === "not_between"), k = Q(() => t.op === "in" || t.op === "not_in"), r = Q({
|
|
1517
1517
|
get: () => typeof t.modelValue == "string" ? t.modelValue : "",
|
|
1518
|
-
set: (
|
|
1519
|
-
}),
|
|
1518
|
+
set: (s) => l("update:modelValue", s)
|
|
1519
|
+
}), $ = Q({
|
|
1520
1520
|
get: () => typeof t.modelValue == "number" ? t.modelValue : void 0,
|
|
1521
|
-
set: (
|
|
1522
|
-
}),
|
|
1521
|
+
set: (s) => l("update:modelValue", s ?? null)
|
|
1522
|
+
}), f = Q({
|
|
1523
1523
|
get: () => typeof t.modelValue == "string" ? t.modelValue : null,
|
|
1524
|
-
set: (
|
|
1524
|
+
set: (s) => l("update:modelValue", s)
|
|
1525
1525
|
}), x = Q({
|
|
1526
1526
|
get: () => typeof t.modelValue == "boolean" ? t.modelValue : void 0,
|
|
1527
|
-
set: (
|
|
1527
|
+
set: (s) => l("update:modelValue", s ?? null)
|
|
1528
1528
|
}), S = Q({
|
|
1529
1529
|
get: () => {
|
|
1530
|
-
const
|
|
1531
|
-
if (typeof
|
|
1530
|
+
const s = t.modelValue;
|
|
1531
|
+
if (typeof s == "string" || typeof s == "number" || typeof s == "boolean") return s;
|
|
1532
1532
|
},
|
|
1533
|
-
set: (
|
|
1534
|
-
}),
|
|
1533
|
+
set: (s) => l("update:modelValue", s ?? null)
|
|
1534
|
+
}), P = Q({
|
|
1535
1535
|
get: () => Array.isArray(t.modelValue) ? t.modelValue : [],
|
|
1536
|
-
set: (
|
|
1537
|
-
}),
|
|
1536
|
+
set: (s) => l("update:modelValue", s)
|
|
1537
|
+
}), H = Q({
|
|
1538
1538
|
get: () => {
|
|
1539
1539
|
if (!Array.isArray(t.modelValue) || t.modelValue.length !== 2) return null;
|
|
1540
|
-
const
|
|
1541
|
-
return typeof
|
|
1540
|
+
const s = t.modelValue[0], v = t.modelValue[1];
|
|
1541
|
+
return typeof s == "string" && typeof v == "string" ? [s, v] : null;
|
|
1542
1542
|
},
|
|
1543
|
-
set: (
|
|
1544
|
-
}),
|
|
1543
|
+
set: (s) => l("update:modelValue", s)
|
|
1544
|
+
}), A = Q({
|
|
1545
1545
|
get: () => {
|
|
1546
1546
|
if (Array.isArray(t.modelValue)) {
|
|
1547
|
-
const
|
|
1548
|
-
return typeof
|
|
1547
|
+
const s = t.modelValue[0];
|
|
1548
|
+
return typeof s == "number" ? s : void 0;
|
|
1549
1549
|
}
|
|
1550
1550
|
},
|
|
1551
|
-
set: (
|
|
1552
|
-
const
|
|
1553
|
-
l("update:modelValue", [
|
|
1551
|
+
set: (s) => {
|
|
1552
|
+
const v = Array.isArray(t.modelValue) && typeof t.modelValue[1] == "number" ? t.modelValue[1] : null;
|
|
1553
|
+
l("update:modelValue", [s ?? null, v]);
|
|
1554
1554
|
}
|
|
1555
1555
|
}), b = Q({
|
|
1556
1556
|
get: () => {
|
|
1557
1557
|
if (Array.isArray(t.modelValue)) {
|
|
1558
|
-
const
|
|
1559
|
-
return typeof
|
|
1558
|
+
const s = t.modelValue[1];
|
|
1559
|
+
return typeof s == "number" ? s : void 0;
|
|
1560
1560
|
}
|
|
1561
1561
|
},
|
|
1562
|
-
set: (
|
|
1563
|
-
const
|
|
1564
|
-
l("update:modelValue", [
|
|
1562
|
+
set: (s) => {
|
|
1563
|
+
const v = Array.isArray(t.modelValue) && typeof t.modelValue[0] == "number" ? t.modelValue[0] : null;
|
|
1564
|
+
l("update:modelValue", [v, s ?? null]);
|
|
1565
1565
|
}
|
|
1566
1566
|
}), _ = [
|
|
1567
1567
|
{ label: "是", value: !0 },
|
|
1568
1568
|
{ label: "否", value: !1 }
|
|
1569
1569
|
];
|
|
1570
|
-
function
|
|
1571
|
-
const
|
|
1572
|
-
return F.setDate(F.getDate() -
|
|
1570
|
+
function N(s) {
|
|
1571
|
+
const v = /* @__PURE__ */ new Date(), F = /* @__PURE__ */ new Date();
|
|
1572
|
+
return F.setDate(F.getDate() - s), [F, v];
|
|
1573
1573
|
}
|
|
1574
1574
|
const T = [
|
|
1575
|
-
{ text: "最近 7 天", value: () =>
|
|
1576
|
-
{ text: "最近 30 天", value: () =>
|
|
1577
|
-
{ text: "最近 90 天", value: () =>
|
|
1578
|
-
],
|
|
1579
|
-
function
|
|
1580
|
-
const
|
|
1581
|
-
if (!
|
|
1582
|
-
const [
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1575
|
+
{ text: "最近 7 天", value: () => N(7) },
|
|
1576
|
+
{ text: "最近 30 天", value: () => N(30) },
|
|
1577
|
+
{ text: "最近 90 天", value: () => N(90) }
|
|
1578
|
+
], U = Y(7);
|
|
1579
|
+
function G() {
|
|
1580
|
+
const s = U.value;
|
|
1581
|
+
if (!s || s < 1) return;
|
|
1582
|
+
const [v, F] = N(s);
|
|
1583
|
+
H.value = [
|
|
1584
|
+
it(v).format(t.valueFormat),
|
|
1585
|
+
it(F).format(t.valueFormat)
|
|
1586
1586
|
];
|
|
1587
1587
|
}
|
|
1588
|
-
return (
|
|
1589
|
-
const F =
|
|
1588
|
+
return (s, v) => {
|
|
1589
|
+
const F = C("el-select"), q = C("el-input"), E = C("el-input-number"), ue = C("el-date-picker"), de = C("el-button"), ee = C("el-popover"), w = C("el-option");
|
|
1590
1590
|
return e.fieldType === "string" && k.value ? (n(), h(F, {
|
|
1591
1591
|
key: 0,
|
|
1592
|
-
modelValue:
|
|
1593
|
-
"onUpdate:modelValue":
|
|
1592
|
+
modelValue: P.value,
|
|
1593
|
+
"onUpdate:modelValue": v[0] || (v[0] = (d) => P.value = d),
|
|
1594
1594
|
class: "yk-advanced-value-editor",
|
|
1595
1595
|
multiple: "",
|
|
1596
1596
|
filterable: "",
|
|
@@ -1598,39 +1598,39 @@ import './index.css';const Kt = { class: "export-options" }, jt = { class: "expo
|
|
|
1598
1598
|
"default-first-option": "",
|
|
1599
1599
|
"reserve-keyword": !1,
|
|
1600
1600
|
placeholder: "输入后回车添加"
|
|
1601
|
-
}, null, 8, ["modelValue"])) : e.fieldType === "string" ? (n(), h(
|
|
1601
|
+
}, null, 8, ["modelValue"])) : e.fieldType === "string" ? (n(), h(q, {
|
|
1602
1602
|
key: 1,
|
|
1603
|
-
modelValue:
|
|
1604
|
-
"onUpdate:modelValue":
|
|
1603
|
+
modelValue: r.value,
|
|
1604
|
+
"onUpdate:modelValue": v[1] || (v[1] = (d) => r.value = d),
|
|
1605
1605
|
placeholder: "请输入",
|
|
1606
1606
|
clearable: ""
|
|
1607
|
-
}, null, 8, ["modelValue"])) : e.fieldType === "number" && a.value ? (n(),
|
|
1608
|
-
|
|
1609
|
-
modelValue:
|
|
1610
|
-
"onUpdate:modelValue":
|
|
1607
|
+
}, null, 8, ["modelValue"])) : e.fieldType === "number" && a.value ? (n(), g("div", ln, [
|
|
1608
|
+
p(E, {
|
|
1609
|
+
modelValue: A.value,
|
|
1610
|
+
"onUpdate:modelValue": v[2] || (v[2] = (d) => A.value = d),
|
|
1611
1611
|
placeholder: "最小值",
|
|
1612
1612
|
controls: !1,
|
|
1613
1613
|
class: "yk-advanced-value-editor__num"
|
|
1614
1614
|
}, null, 8, ["modelValue"]),
|
|
1615
|
-
|
|
1616
|
-
|
|
1615
|
+
v[11] || (v[11] = y("span", { class: "yk-advanced-value-editor__sep" }, "~", -1)),
|
|
1616
|
+
p(E, {
|
|
1617
1617
|
modelValue: b.value,
|
|
1618
|
-
"onUpdate:modelValue":
|
|
1618
|
+
"onUpdate:modelValue": v[3] || (v[3] = (d) => b.value = d),
|
|
1619
1619
|
placeholder: "最大值",
|
|
1620
1620
|
controls: !1,
|
|
1621
1621
|
class: "yk-advanced-value-editor__num"
|
|
1622
1622
|
}, null, 8, ["modelValue"])
|
|
1623
1623
|
])) : e.fieldType === "number" ? (n(), h(E, {
|
|
1624
1624
|
key: 3,
|
|
1625
|
-
modelValue:
|
|
1626
|
-
"onUpdate:modelValue":
|
|
1625
|
+
modelValue: $.value,
|
|
1626
|
+
"onUpdate:modelValue": v[4] || (v[4] = (d) => $.value = d),
|
|
1627
1627
|
placeholder: "请输入数字",
|
|
1628
1628
|
controls: !1,
|
|
1629
1629
|
class: "yk-advanced-value-editor"
|
|
1630
|
-
}, null, 8, ["modelValue"])) : e.fieldType === "date" && a.value ? (n(),
|
|
1631
|
-
|
|
1632
|
-
modelValue:
|
|
1633
|
-
"onUpdate:modelValue":
|
|
1630
|
+
}, null, 8, ["modelValue"])) : e.fieldType === "date" && a.value ? (n(), g("div", nn, [
|
|
1631
|
+
p(ue, {
|
|
1632
|
+
modelValue: H.value,
|
|
1633
|
+
"onUpdate:modelValue": v[5] || (v[5] = (d) => H.value = d),
|
|
1634
1634
|
type: "daterange",
|
|
1635
1635
|
"value-format": e.valueFormat,
|
|
1636
1636
|
"start-placeholder": "开始日期",
|
|
@@ -1638,37 +1638,37 @@ import './index.css';const Kt = { class: "export-options" }, jt = { class: "expo
|
|
|
1638
1638
|
shortcuts: T,
|
|
1639
1639
|
class: "yk-advanced-value-editor__daterange-picker"
|
|
1640
1640
|
}, null, 8, ["modelValue", "value-format"]),
|
|
1641
|
-
|
|
1641
|
+
p(ee, {
|
|
1642
1642
|
trigger: "click",
|
|
1643
1643
|
placement: "bottom",
|
|
1644
1644
|
width: 240
|
|
1645
1645
|
}, {
|
|
1646
1646
|
reference: o(() => [
|
|
1647
|
-
|
|
1648
|
-
default: o(() => [...
|
|
1649
|
-
|
|
1647
|
+
p(de, { class: "yk-advanced-value-editor__recent-trigger" }, {
|
|
1648
|
+
default: o(() => [...v[12] || (v[12] = [
|
|
1649
|
+
V("最近 N 天", -1)
|
|
1650
1650
|
])]),
|
|
1651
1651
|
_: 1
|
|
1652
1652
|
})
|
|
1653
1653
|
]),
|
|
1654
1654
|
default: o(() => [
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
modelValue:
|
|
1659
|
-
"onUpdate:modelValue":
|
|
1655
|
+
y("div", on, [
|
|
1656
|
+
v[14] || (v[14] = y("span", null, "最近", -1)),
|
|
1657
|
+
p(E, {
|
|
1658
|
+
modelValue: U.value,
|
|
1659
|
+
"onUpdate:modelValue": v[6] || (v[6] = (d) => U.value = d),
|
|
1660
1660
|
min: 1,
|
|
1661
1661
|
controls: !1,
|
|
1662
1662
|
class: "yk-advanced-value-editor__recent-input"
|
|
1663
1663
|
}, null, 8, ["modelValue"]),
|
|
1664
|
-
|
|
1665
|
-
|
|
1664
|
+
v[15] || (v[15] = y("span", null, "天", -1)),
|
|
1665
|
+
p(de, {
|
|
1666
1666
|
type: "primary",
|
|
1667
1667
|
size: "small",
|
|
1668
|
-
onClick:
|
|
1668
|
+
onClick: G
|
|
1669
1669
|
}, {
|
|
1670
|
-
default: o(() => [...
|
|
1671
|
-
|
|
1670
|
+
default: o(() => [...v[13] || (v[13] = [
|
|
1671
|
+
V("应用", -1)
|
|
1672
1672
|
])]),
|
|
1673
1673
|
_: 1
|
|
1674
1674
|
})
|
|
@@ -1678,8 +1678,8 @@ import './index.css';const Kt = { class: "export-options" }, jt = { class: "expo
|
|
|
1678
1678
|
})
|
|
1679
1679
|
])) : e.fieldType === "date" ? (n(), h(ue, {
|
|
1680
1680
|
key: 5,
|
|
1681
|
-
modelValue:
|
|
1682
|
-
"onUpdate:modelValue":
|
|
1681
|
+
modelValue: f.value,
|
|
1682
|
+
"onUpdate:modelValue": v[7] || (v[7] = (d) => f.value = d),
|
|
1683
1683
|
type: "date",
|
|
1684
1684
|
"value-format": e.valueFormat,
|
|
1685
1685
|
placeholder: "选择日期",
|
|
@@ -1687,64 +1687,64 @@ import './index.css';const Kt = { class: "export-options" }, jt = { class: "expo
|
|
|
1687
1687
|
}, null, 8, ["modelValue", "value-format"])) : e.fieldType === "boolean" ? (n(), h(F, {
|
|
1688
1688
|
key: 6,
|
|
1689
1689
|
modelValue: x.value,
|
|
1690
|
-
"onUpdate:modelValue":
|
|
1690
|
+
"onUpdate:modelValue": v[8] || (v[8] = (d) => x.value = d),
|
|
1691
1691
|
placeholder: "请选择",
|
|
1692
1692
|
clearable: ""
|
|
1693
1693
|
}, {
|
|
1694
1694
|
default: o(() => [
|
|
1695
|
-
(n(),
|
|
1696
|
-
key: String(
|
|
1697
|
-
label:
|
|
1698
|
-
value:
|
|
1695
|
+
(n(), g(L, null, te(_, (d) => p(w, {
|
|
1696
|
+
key: String(d.value),
|
|
1697
|
+
label: d.label,
|
|
1698
|
+
value: d.value
|
|
1699
1699
|
}, null, 8, ["label", "value"])), 64))
|
|
1700
1700
|
]),
|
|
1701
1701
|
_: 1
|
|
1702
1702
|
}, 8, ["modelValue"])) : e.fieldType === "enum" && k.value ? (n(), h(F, {
|
|
1703
1703
|
key: 7,
|
|
1704
|
-
modelValue:
|
|
1705
|
-
"onUpdate:modelValue":
|
|
1704
|
+
modelValue: P.value,
|
|
1705
|
+
"onUpdate:modelValue": v[9] || (v[9] = (d) => P.value = d),
|
|
1706
1706
|
multiple: "",
|
|
1707
1707
|
loading: e.optionsLoading,
|
|
1708
1708
|
placeholder: "请选择",
|
|
1709
1709
|
clearable: ""
|
|
1710
1710
|
}, {
|
|
1711
1711
|
default: o(() => [
|
|
1712
|
-
(n(!0),
|
|
1713
|
-
key: String(
|
|
1714
|
-
label:
|
|
1715
|
-
value:
|
|
1712
|
+
(n(!0), g(L, null, te(e.options, (d) => (n(), h(w, {
|
|
1713
|
+
key: String(d.value),
|
|
1714
|
+
label: d.label,
|
|
1715
|
+
value: d.value
|
|
1716
1716
|
}, null, 8, ["label", "value"]))), 128))
|
|
1717
1717
|
]),
|
|
1718
1718
|
_: 1
|
|
1719
1719
|
}, 8, ["modelValue", "loading"])) : e.fieldType === "enum" ? (n(), h(F, {
|
|
1720
1720
|
key: 8,
|
|
1721
1721
|
modelValue: S.value,
|
|
1722
|
-
"onUpdate:modelValue":
|
|
1722
|
+
"onUpdate:modelValue": v[10] || (v[10] = (d) => S.value = d),
|
|
1723
1723
|
loading: e.optionsLoading,
|
|
1724
1724
|
placeholder: "请选择",
|
|
1725
1725
|
clearable: ""
|
|
1726
1726
|
}, {
|
|
1727
1727
|
default: o(() => [
|
|
1728
|
-
(n(!0),
|
|
1729
|
-
key: String(
|
|
1730
|
-
label:
|
|
1731
|
-
value:
|
|
1728
|
+
(n(!0), g(L, null, te(e.options, (d) => (n(), h(w, {
|
|
1729
|
+
key: String(d.value),
|
|
1730
|
+
label: d.label,
|
|
1731
|
+
value: d.value
|
|
1732
1732
|
}, null, 8, ["label", "value"]))), 128))
|
|
1733
1733
|
]),
|
|
1734
1734
|
_: 1
|
|
1735
|
-
}, 8, ["modelValue", "loading"])) :
|
|
1735
|
+
}, 8, ["modelValue", "loading"])) : R("", !0);
|
|
1736
1736
|
};
|
|
1737
1737
|
}
|
|
1738
|
-
}),
|
|
1738
|
+
}), wt = /* @__PURE__ */ ae(an, [["__scopeId", "data-v-dda18bcf"]]), xt = Symbol("YsAdvancedFilter"), sn = { class: "yk-adv-group__header" }, rn = { class: "yk-adv-group__actions" }, un = { class: "yk-adv-group__children" }, dn = {
|
|
1739
1739
|
key: 0,
|
|
1740
1740
|
class: "yk-adv-group__nested"
|
|
1741
|
-
},
|
|
1741
|
+
}, cn = {
|
|
1742
1742
|
key: 1,
|
|
1743
1743
|
class: "yk-adv-group__row"
|
|
1744
|
-
},
|
|
1744
|
+
}, pn = {
|
|
1745
1745
|
key: 0,
|
|
1746
1746
|
class: "yk-adv-group__empty"
|
|
1747
|
-
},
|
|
1747
|
+
}, mn = /* @__PURE__ */ Z({
|
|
1748
1748
|
name: "YsAdvancedConditionGroup",
|
|
1749
1749
|
__name: "advancedConditionGroup",
|
|
1750
1750
|
props: {
|
|
@@ -1754,180 +1754,180 @@ import './index.css';const Kt = { class: "export-options" }, jt = { class: "expo
|
|
|
1754
1754
|
level: { type: Number, default: 0 }
|
|
1755
1755
|
},
|
|
1756
1756
|
setup(e) {
|
|
1757
|
-
const
|
|
1757
|
+
const m = e, t = mt(xt);
|
|
1758
1758
|
function l(b) {
|
|
1759
|
-
(b === "and" || b === "or") && t.api.setGroupCombinator(
|
|
1759
|
+
(b === "and" || b === "or") && t.api.setGroupCombinator(m.group.id, b);
|
|
1760
1760
|
}
|
|
1761
1761
|
function a() {
|
|
1762
|
-
t.api.addLeaf(
|
|
1762
|
+
t.api.addLeaf(m.group.id);
|
|
1763
1763
|
}
|
|
1764
1764
|
function k() {
|
|
1765
|
-
t.api.addNestedGroup(
|
|
1765
|
+
t.api.addNestedGroup(m.group.id);
|
|
1766
1766
|
}
|
|
1767
|
-
function
|
|
1768
|
-
t.api.removeNode(
|
|
1767
|
+
function r() {
|
|
1768
|
+
t.api.removeNode(m.group.id);
|
|
1769
1769
|
}
|
|
1770
|
-
function
|
|
1770
|
+
function $(b, _) {
|
|
1771
1771
|
typeof _ == "string" && t.api.changeField(b.id, _);
|
|
1772
1772
|
}
|
|
1773
|
-
function
|
|
1773
|
+
function f(b, _) {
|
|
1774
1774
|
t.api.changeOperator(b.id, _);
|
|
1775
1775
|
}
|
|
1776
1776
|
function x(b) {
|
|
1777
1777
|
t.api.removeNode(b);
|
|
1778
1778
|
}
|
|
1779
|
-
const S =
|
|
1780
|
-
function
|
|
1779
|
+
const S = tt;
|
|
1780
|
+
function P(b) {
|
|
1781
1781
|
return b;
|
|
1782
1782
|
}
|
|
1783
|
-
function
|
|
1783
|
+
function H(b) {
|
|
1784
1784
|
return t.columns.find((_) => _.propertyPath === b);
|
|
1785
1785
|
}
|
|
1786
|
-
function
|
|
1786
|
+
function A(b) {
|
|
1787
1787
|
var _;
|
|
1788
|
-
return ((_ =
|
|
1788
|
+
return ((_ = H(b)) == null ? void 0 : _.displayFormat) ?? "YYYY-MM-DD";
|
|
1789
1789
|
}
|
|
1790
1790
|
return (b, _) => {
|
|
1791
|
-
const
|
|
1792
|
-
return n(),
|
|
1793
|
-
class:
|
|
1791
|
+
const N = C("el-radio-button"), T = C("el-radio-group"), U = C("el-button"), G = C("YsAdvancedConditionGroup"), s = C("el-option"), v = C("el-select");
|
|
1792
|
+
return n(), g("div", {
|
|
1793
|
+
class: $e(["yk-adv-group", [`level-${e.level}`, { "is-root": e.level === 0 }]])
|
|
1794
1794
|
}, [
|
|
1795
|
-
|
|
1796
|
-
_[5] || (_[5] =
|
|
1797
|
-
|
|
1795
|
+
y("div", sn, [
|
|
1796
|
+
_[5] || (_[5] = y("span", { class: "yk-adv-group__comb-label" }, "满足", -1)),
|
|
1797
|
+
p(T, {
|
|
1798
1798
|
"model-value": e.group.combinator,
|
|
1799
1799
|
size: "small",
|
|
1800
1800
|
"onUpdate:modelValue": l
|
|
1801
1801
|
}, {
|
|
1802
1802
|
default: o(() => [
|
|
1803
|
-
|
|
1803
|
+
p(N, { value: "and" }, {
|
|
1804
1804
|
default: o(() => [..._[0] || (_[0] = [
|
|
1805
|
-
|
|
1805
|
+
V("全部", -1)
|
|
1806
1806
|
])]),
|
|
1807
1807
|
_: 1
|
|
1808
1808
|
}),
|
|
1809
|
-
|
|
1809
|
+
p(N, { value: "or" }, {
|
|
1810
1810
|
default: o(() => [..._[1] || (_[1] = [
|
|
1811
|
-
|
|
1811
|
+
V("任一", -1)
|
|
1812
1812
|
])]),
|
|
1813
1813
|
_: 1
|
|
1814
1814
|
})
|
|
1815
1815
|
]),
|
|
1816
1816
|
_: 1
|
|
1817
1817
|
}, 8, ["model-value"]),
|
|
1818
|
-
_[6] || (_[6] =
|
|
1819
|
-
|
|
1820
|
-
|
|
1818
|
+
_[6] || (_[6] = y("span", { class: "yk-adv-group__comb-label" }, "条件", -1)),
|
|
1819
|
+
y("span", rn, [
|
|
1820
|
+
p(U, {
|
|
1821
1821
|
link: "",
|
|
1822
1822
|
type: "primary",
|
|
1823
1823
|
onClick: a
|
|
1824
1824
|
}, {
|
|
1825
1825
|
default: o(() => [..._[2] || (_[2] = [
|
|
1826
|
-
|
|
1826
|
+
V("+ 条件", -1)
|
|
1827
1827
|
])]),
|
|
1828
1828
|
_: 1
|
|
1829
1829
|
}),
|
|
1830
|
-
|
|
1830
|
+
p(U, {
|
|
1831
1831
|
link: "",
|
|
1832
1832
|
type: "primary",
|
|
1833
1833
|
onClick: k
|
|
1834
1834
|
}, {
|
|
1835
1835
|
default: o(() => [..._[3] || (_[3] = [
|
|
1836
|
-
|
|
1836
|
+
V(" + 嵌套组 ", -1)
|
|
1837
1837
|
])]),
|
|
1838
1838
|
_: 1
|
|
1839
1839
|
}),
|
|
1840
|
-
e.level > 0 ? (n(), h(
|
|
1840
|
+
e.level > 0 ? (n(), h(U, {
|
|
1841
1841
|
key: 0,
|
|
1842
1842
|
link: "",
|
|
1843
1843
|
type: "danger",
|
|
1844
|
-
onClick:
|
|
1844
|
+
onClick: r
|
|
1845
1845
|
}, {
|
|
1846
1846
|
default: o(() => [..._[4] || (_[4] = [
|
|
1847
|
-
|
|
1847
|
+
V(" 删除组 ", -1)
|
|
1848
1848
|
])]),
|
|
1849
1849
|
_: 1
|
|
1850
|
-
})) :
|
|
1850
|
+
})) : R("", !0)
|
|
1851
1851
|
])
|
|
1852
1852
|
]),
|
|
1853
|
-
|
|
1854
|
-
(n(!0),
|
|
1853
|
+
y("div", un, [
|
|
1854
|
+
(n(!0), g(L, null, te(e.group.children, (F) => (n(), g(L, {
|
|
1855
1855
|
key: F.id
|
|
1856
1856
|
}, [
|
|
1857
|
-
|
|
1858
|
-
|
|
1857
|
+
u(S)(F) ? (n(), g("div", dn, [
|
|
1858
|
+
p(G, {
|
|
1859
1859
|
group: F,
|
|
1860
1860
|
level: e.level + 1
|
|
1861
1861
|
}, null, 8, ["group", "level"])
|
|
1862
|
-
])) : (n(),
|
|
1863
|
-
|
|
1862
|
+
])) : (n(), g("div", cn, [
|
|
1863
|
+
p(v, {
|
|
1864
1864
|
"model-value": F.propertyPath,
|
|
1865
1865
|
class: "yk-adv-group__field",
|
|
1866
1866
|
placeholder: "选择字段",
|
|
1867
1867
|
filterable: "",
|
|
1868
|
-
"onUpdate:modelValue": (
|
|
1868
|
+
"onUpdate:modelValue": (q) => $(F, q)
|
|
1869
1869
|
}, {
|
|
1870
1870
|
default: o(() => [
|
|
1871
|
-
(n(!0),
|
|
1872
|
-
key:
|
|
1873
|
-
label:
|
|
1874
|
-
value:
|
|
1871
|
+
(n(!0), g(L, null, te(u(t).columns, (q) => (n(), h(s, {
|
|
1872
|
+
key: q.propertyPath,
|
|
1873
|
+
label: q.displayName ?? q.propertyPath,
|
|
1874
|
+
value: q.propertyPath
|
|
1875
1875
|
}, null, 8, ["label", "value"]))), 128))
|
|
1876
1876
|
]),
|
|
1877
1877
|
_: 1
|
|
1878
1878
|
}, 8, ["model-value", "onUpdate:modelValue"]),
|
|
1879
|
-
|
|
1879
|
+
p(v, {
|
|
1880
1880
|
"model-value": F.op,
|
|
1881
1881
|
class: "yk-adv-group__op",
|
|
1882
1882
|
placeholder: "操作符",
|
|
1883
1883
|
filterable: "",
|
|
1884
|
-
"onUpdate:modelValue": (
|
|
1884
|
+
"onUpdate:modelValue": (q) => f(F, q)
|
|
1885
1885
|
}, {
|
|
1886
1886
|
default: o(() => [
|
|
1887
|
-
(n(!0),
|
|
1888
|
-
key:
|
|
1889
|
-
label:
|
|
1890
|
-
value:
|
|
1887
|
+
(n(!0), g(L, null, te(u(t).api.operatorsOf(F.propertyPath), (q) => (n(), h(s, {
|
|
1888
|
+
key: q,
|
|
1889
|
+
label: u(Zt)[q],
|
|
1890
|
+
value: q
|
|
1891
1891
|
}, null, 8, ["label", "value"]))), 128))
|
|
1892
1892
|
]),
|
|
1893
1893
|
_: 2
|
|
1894
1894
|
}, 1032, ["model-value", "onUpdate:modelValue"]),
|
|
1895
|
-
|
|
1895
|
+
u(el)(F.op) ? R("", !0) : (n(), h(wt, {
|
|
1896
1896
|
key: 0,
|
|
1897
|
-
"field-type":
|
|
1897
|
+
"field-type": u(t).api.fieldTypeOf(F.propertyPath),
|
|
1898
1898
|
op: F.op,
|
|
1899
|
-
options:
|
|
1900
|
-
"options-loading":
|
|
1901
|
-
"value-format":
|
|
1902
|
-
class:
|
|
1899
|
+
options: u(t).optionsMap.value[F.propertyPath] ?? [],
|
|
1900
|
+
"options-loading": u(t).loadingMap.value[F.propertyPath] === !0,
|
|
1901
|
+
"value-format": A(F.propertyPath),
|
|
1902
|
+
class: $e([
|
|
1903
1903
|
"yk-adv-group__value",
|
|
1904
|
-
{ "is-invalid":
|
|
1904
|
+
{ "is-invalid": u(t).api.isConditionEmpty(F) }
|
|
1905
1905
|
]),
|
|
1906
1906
|
modelValue: F.value,
|
|
1907
|
-
"onUpdate:modelValue": (
|
|
1907
|
+
"onUpdate:modelValue": (q) => F.value = q
|
|
1908
1908
|
}, null, 8, ["field-type", "op", "options", "options-loading", "value-format", "class", "modelValue", "onUpdate:modelValue"])),
|
|
1909
|
-
|
|
1909
|
+
p(U, {
|
|
1910
1910
|
link: "",
|
|
1911
1911
|
type: "danger",
|
|
1912
1912
|
class: "yk-adv-group__remove",
|
|
1913
|
-
onClick: (
|
|
1913
|
+
onClick: (q) => x(F.id)
|
|
1914
1914
|
}, {
|
|
1915
1915
|
default: o(() => [..._[7] || (_[7] = [
|
|
1916
|
-
|
|
1916
|
+
V(" 删除 ", -1)
|
|
1917
1917
|
])]),
|
|
1918
1918
|
_: 1
|
|
1919
1919
|
}, 8, ["onClick"])
|
|
1920
1920
|
]))
|
|
1921
1921
|
], 64))), 128)),
|
|
1922
|
-
e.group.children.length === 0 ? (n(),
|
|
1922
|
+
e.group.children.length === 0 ? (n(), g("div", pn, " 暂无条件,点击「+ 条件」或「+ 嵌套组」 ")) : R("", !0)
|
|
1923
1923
|
])
|
|
1924
1924
|
], 2);
|
|
1925
1925
|
};
|
|
1926
1926
|
}
|
|
1927
|
-
}),
|
|
1927
|
+
}), Ct = /* @__PURE__ */ ae(mn, [["__scopeId", "data-v-518d9c97"]]), fn = {
|
|
1928
1928
|
key: 0,
|
|
1929
1929
|
class: "yk-advanced-filter__actions"
|
|
1930
|
-
},
|
|
1930
|
+
}, vn = /* @__PURE__ */ Z({
|
|
1931
1931
|
name: "YsAdvancedFilterPanel",
|
|
1932
1932
|
__name: "advancedFilterPanel",
|
|
1933
1933
|
props: {
|
|
@@ -1955,181 +1955,181 @@ import './index.css';const Kt = { class: "export-options" }, jt = { class: "expo
|
|
|
1955
1955
|
}
|
|
1956
1956
|
},
|
|
1957
1957
|
emits: ["search", "reset", "update:savedQueries"],
|
|
1958
|
-
setup(e, { expose:
|
|
1959
|
-
const l = e, a = t, k =
|
|
1960
|
-
async function
|
|
1961
|
-
var
|
|
1962
|
-
const
|
|
1963
|
-
if (
|
|
1964
|
-
|
|
1958
|
+
setup(e, { expose: m, emit: t }) {
|
|
1959
|
+
const l = e, a = t, k = yt(l), { rootGroup: r, fieldTypeOf: $, filter: f, reset: x } = k, S = Y({}), P = Y({});
|
|
1960
|
+
async function H(w) {
|
|
1961
|
+
var j;
|
|
1962
|
+
const d = (j = l.optionSources) == null ? void 0 : j[w];
|
|
1963
|
+
if (d && !(S.value[w] || P.value[w])) {
|
|
1964
|
+
P.value[w] = !0;
|
|
1965
1965
|
try {
|
|
1966
|
-
S.value[
|
|
1966
|
+
S.value[w] = await d();
|
|
1967
1967
|
} finally {
|
|
1968
|
-
|
|
1968
|
+
P.value[w] = !1;
|
|
1969
1969
|
}
|
|
1970
1970
|
}
|
|
1971
1971
|
}
|
|
1972
|
-
function
|
|
1973
|
-
const
|
|
1974
|
-
function
|
|
1975
|
-
|
|
1972
|
+
function A(w) {
|
|
1973
|
+
const d = /* @__PURE__ */ new Set();
|
|
1974
|
+
function j(se) {
|
|
1975
|
+
tt(se) ? se.children.forEach(j) : $(se.propertyPath) === "enum" && d.add(se.propertyPath);
|
|
1976
1976
|
}
|
|
1977
|
-
return
|
|
1977
|
+
return w.children.forEach(j), [...d];
|
|
1978
1978
|
}
|
|
1979
1979
|
me(
|
|
1980
|
-
|
|
1981
|
-
(
|
|
1982
|
-
for (const
|
|
1983
|
-
|
|
1980
|
+
r,
|
|
1981
|
+
(w) => {
|
|
1982
|
+
for (const d of A(w))
|
|
1983
|
+
H(d);
|
|
1984
1984
|
},
|
|
1985
1985
|
{ deep: !0, immediate: !0 }
|
|
1986
|
-
),
|
|
1986
|
+
), ft(xt, {
|
|
1987
1987
|
columns: l.columns,
|
|
1988
1988
|
optionsMap: S,
|
|
1989
|
-
loadingMap:
|
|
1989
|
+
loadingMap: P,
|
|
1990
1990
|
api: k
|
|
1991
1991
|
});
|
|
1992
1992
|
function b() {
|
|
1993
|
-
a("search",
|
|
1993
|
+
a("search", f.value);
|
|
1994
1994
|
}
|
|
1995
1995
|
function _() {
|
|
1996
1996
|
x(), a("reset");
|
|
1997
1997
|
}
|
|
1998
|
-
const
|
|
1999
|
-
() => l.savedQueries ??
|
|
1998
|
+
const N = Y([]), T = Q(
|
|
1999
|
+
() => l.savedQueries ?? N.value
|
|
2000
2000
|
);
|
|
2001
|
-
function
|
|
2002
|
-
|
|
2001
|
+
function U(w) {
|
|
2002
|
+
N.value = w, a("update:savedQueries", w);
|
|
2003
2003
|
}
|
|
2004
|
-
const
|
|
2004
|
+
const G = Y(!1), s = Y(""), v = Y("");
|
|
2005
2005
|
let F = 0;
|
|
2006
|
-
function
|
|
2007
|
-
function
|
|
2008
|
-
return
|
|
2006
|
+
function q() {
|
|
2007
|
+
function w(d) {
|
|
2008
|
+
return d.children.some((j) => tt(j) ? w(j) : k.isConditionEmpty(j));
|
|
2009
2009
|
}
|
|
2010
|
-
return
|
|
2010
|
+
return w(r.value);
|
|
2011
2011
|
}
|
|
2012
2012
|
function E() {
|
|
2013
|
-
|
|
2013
|
+
s.value = "", v.value = "", G.value = !0;
|
|
2014
2014
|
}
|
|
2015
2015
|
function ue() {
|
|
2016
|
-
const
|
|
2017
|
-
if (
|
|
2018
|
-
|
|
2019
|
-
const
|
|
2016
|
+
const w = s.value.trim();
|
|
2017
|
+
if (!w) return;
|
|
2018
|
+
q() && fe.warning("当前存在未填值的条件行(标红),保存的预设可能不完整");
|
|
2019
|
+
const d = JSON.parse(JSON.stringify(r.value)), j = {
|
|
2020
2020
|
id: `sq-${++F}`,
|
|
2021
|
-
name:
|
|
2022
|
-
description:
|
|
2023
|
-
group:
|
|
2024
|
-
filterInfo:
|
|
2021
|
+
name: w,
|
|
2022
|
+
description: v.value.trim(),
|
|
2023
|
+
group: d,
|
|
2024
|
+
filterInfo: f.value
|
|
2025
2025
|
};
|
|
2026
|
-
|
|
2026
|
+
U([...T.value, j]), G.value = !1;
|
|
2027
2027
|
}
|
|
2028
|
-
function
|
|
2029
|
-
|
|
2028
|
+
function de(w) {
|
|
2029
|
+
r.value = JSON.parse(JSON.stringify(w.group)), b();
|
|
2030
2030
|
}
|
|
2031
|
-
function
|
|
2032
|
-
|
|
2031
|
+
function ee(w) {
|
|
2032
|
+
U(T.value.filter((d) => d.id !== w));
|
|
2033
2033
|
}
|
|
2034
|
-
return
|
|
2034
|
+
return m({
|
|
2035
2035
|
get filter() {
|
|
2036
|
-
return
|
|
2036
|
+
return f.value;
|
|
2037
2037
|
},
|
|
2038
2038
|
reset: _,
|
|
2039
2039
|
openSaveDialog: E,
|
|
2040
|
-
applySavedQuery:
|
|
2041
|
-
removeSavedQuery:
|
|
2040
|
+
applySavedQuery: de,
|
|
2041
|
+
removeSavedQuery: ee,
|
|
2042
2042
|
get savedQueries() {
|
|
2043
2043
|
return T.value;
|
|
2044
2044
|
}
|
|
2045
|
-
}), (
|
|
2046
|
-
const
|
|
2047
|
-
return n(),
|
|
2045
|
+
}), (w, d) => {
|
|
2046
|
+
const j = C("el-button"), se = C("el-input"), D = C("el-form-item"), I = C("el-form"), B = C("el-dialog");
|
|
2047
|
+
return n(), g("div", {
|
|
2048
2048
|
class: "yk-advanced-filter",
|
|
2049
|
-
onKeydown:
|
|
2049
|
+
onKeydown: je(b, ["enter"])
|
|
2050
2050
|
}, [
|
|
2051
|
-
|
|
2052
|
-
group:
|
|
2051
|
+
p(Ct, {
|
|
2052
|
+
group: u(r),
|
|
2053
2053
|
level: 0
|
|
2054
2054
|
}, null, 8, ["group"]),
|
|
2055
|
-
e.showSearch || e.showReset || e.showSaveQuery ? (n(),
|
|
2056
|
-
e.showSearch ? (n(), h(
|
|
2055
|
+
e.showSearch || e.showReset || e.showSaveQuery ? (n(), g("div", fn, [
|
|
2056
|
+
e.showSearch ? (n(), h(j, {
|
|
2057
2057
|
key: 0,
|
|
2058
2058
|
type: "primary",
|
|
2059
2059
|
onClick: b
|
|
2060
2060
|
}, {
|
|
2061
2061
|
default: o(() => [
|
|
2062
|
-
|
|
2062
|
+
V(z(e.searchButtonText), 1)
|
|
2063
2063
|
]),
|
|
2064
2064
|
_: 1
|
|
2065
|
-
})) :
|
|
2066
|
-
e.showReset ? (n(), h(
|
|
2065
|
+
})) : R("", !0),
|
|
2066
|
+
e.showReset ? (n(), h(j, {
|
|
2067
2067
|
key: 1,
|
|
2068
2068
|
onClick: _
|
|
2069
2069
|
}, {
|
|
2070
2070
|
default: o(() => [
|
|
2071
|
-
|
|
2071
|
+
V(z(e.resetButtonText), 1)
|
|
2072
2072
|
]),
|
|
2073
2073
|
_: 1
|
|
2074
|
-
})) :
|
|
2075
|
-
e.showSaveQuery ? (n(), h(
|
|
2074
|
+
})) : R("", !0),
|
|
2075
|
+
e.showSaveQuery ? (n(), h(j, {
|
|
2076
2076
|
key: 2,
|
|
2077
2077
|
onClick: E
|
|
2078
2078
|
}, {
|
|
2079
|
-
default: o(() => [...
|
|
2080
|
-
|
|
2079
|
+
default: o(() => [...d[4] || (d[4] = [
|
|
2080
|
+
V("保存", -1)
|
|
2081
2081
|
])]),
|
|
2082
2082
|
_: 1
|
|
2083
|
-
})) :
|
|
2084
|
-
])) :
|
|
2085
|
-
|
|
2086
|
-
modelValue:
|
|
2087
|
-
"onUpdate:modelValue":
|
|
2083
|
+
})) : R("", !0)
|
|
2084
|
+
])) : R("", !0),
|
|
2085
|
+
p(B, {
|
|
2086
|
+
modelValue: G.value,
|
|
2087
|
+
"onUpdate:modelValue": d[3] || (d[3] = (O) => G.value = O),
|
|
2088
2088
|
title: "保存查询",
|
|
2089
2089
|
width: "440px",
|
|
2090
2090
|
"append-to-body": ""
|
|
2091
2091
|
}, {
|
|
2092
2092
|
footer: o(() => [
|
|
2093
|
-
|
|
2094
|
-
onClick:
|
|
2093
|
+
p(j, {
|
|
2094
|
+
onClick: d[2] || (d[2] = (O) => G.value = !1)
|
|
2095
2095
|
}, {
|
|
2096
|
-
default: o(() => [...
|
|
2097
|
-
|
|
2096
|
+
default: o(() => [...d[5] || (d[5] = [
|
|
2097
|
+
V("取消", -1)
|
|
2098
2098
|
])]),
|
|
2099
2099
|
_: 1
|
|
2100
2100
|
}),
|
|
2101
|
-
|
|
2101
|
+
p(j, {
|
|
2102
2102
|
type: "primary",
|
|
2103
|
-
disabled: !
|
|
2103
|
+
disabled: !s.value.trim(),
|
|
2104
2104
|
onClick: ue
|
|
2105
2105
|
}, {
|
|
2106
|
-
default: o(() => [...
|
|
2107
|
-
|
|
2106
|
+
default: o(() => [...d[6] || (d[6] = [
|
|
2107
|
+
V(" 确定 ", -1)
|
|
2108
2108
|
])]),
|
|
2109
2109
|
_: 1
|
|
2110
2110
|
}, 8, ["disabled"])
|
|
2111
2111
|
]),
|
|
2112
2112
|
default: o(() => [
|
|
2113
|
-
|
|
2113
|
+
p(I, { "label-position": "top" }, {
|
|
2114
2114
|
default: o(() => [
|
|
2115
|
-
|
|
2115
|
+
p(D, { label: "名称" }, {
|
|
2116
2116
|
default: o(() => [
|
|
2117
|
-
|
|
2118
|
-
modelValue:
|
|
2119
|
-
"onUpdate:modelValue":
|
|
2117
|
+
p(se, {
|
|
2118
|
+
modelValue: s.value,
|
|
2119
|
+
"onUpdate:modelValue": d[0] || (d[0] = (O) => s.value = O),
|
|
2120
2120
|
placeholder: "请输入查询名称",
|
|
2121
2121
|
maxlength: "50",
|
|
2122
2122
|
"show-word-limit": "",
|
|
2123
|
-
onKeydown:
|
|
2123
|
+
onKeydown: je(ue, ["enter"])
|
|
2124
2124
|
}, null, 8, ["modelValue"])
|
|
2125
2125
|
]),
|
|
2126
2126
|
_: 1
|
|
2127
2127
|
}),
|
|
2128
|
-
|
|
2128
|
+
p(D, { label: "描述" }, {
|
|
2129
2129
|
default: o(() => [
|
|
2130
|
-
|
|
2131
|
-
modelValue:
|
|
2132
|
-
"onUpdate:modelValue":
|
|
2130
|
+
p(se, {
|
|
2131
|
+
modelValue: v.value,
|
|
2132
|
+
"onUpdate:modelValue": d[1] || (d[1] = (O) => v.value = O),
|
|
2133
2133
|
type: "textarea",
|
|
2134
2134
|
rows: 2,
|
|
2135
2135
|
placeholder: "可选,描述此查询的用途(hover 标签时显示)",
|
|
@@ -2148,7 +2148,7 @@ import './index.css';const Kt = { class: "export-options" }, jt = { class: "expo
|
|
|
2148
2148
|
], 32);
|
|
2149
2149
|
};
|
|
2150
2150
|
}
|
|
2151
|
-
}),
|
|
2151
|
+
}), St = /* @__PURE__ */ ae(vn, [["__scopeId", "data-v-0563cef9"]]), yn = {
|
|
2152
2152
|
key: 0,
|
|
2153
2153
|
viewBox: "0 0 24 24",
|
|
2154
2154
|
width: "16",
|
|
@@ -2158,7 +2158,7 @@ import './index.css';const Kt = { class: "export-options" }, jt = { class: "expo
|
|
|
2158
2158
|
"stroke-width": "2",
|
|
2159
2159
|
"stroke-linecap": "round",
|
|
2160
2160
|
"stroke-linejoin": "round"
|
|
2161
|
-
},
|
|
2161
|
+
}, gn = {
|
|
2162
2162
|
key: 1,
|
|
2163
2163
|
viewBox: "0 0 24 24",
|
|
2164
2164
|
width: "16",
|
|
@@ -2168,16 +2168,16 @@ import './index.css';const Kt = { class: "export-options" }, jt = { class: "expo
|
|
|
2168
2168
|
"stroke-width": "2",
|
|
2169
2169
|
"stroke-linecap": "round",
|
|
2170
2170
|
"stroke-linejoin": "round"
|
|
2171
|
-
},
|
|
2171
|
+
}, kn = {
|
|
2172
2172
|
key: 1,
|
|
2173
2173
|
class: "yk-filter-panel__actions"
|
|
2174
|
-
},
|
|
2174
|
+
}, _n = {
|
|
2175
2175
|
key: 2,
|
|
2176
2176
|
class: "yk-filter-panel__saved"
|
|
2177
|
-
},
|
|
2177
|
+
}, bn = { class: "yk-filter-panel__mode-bar" }, hn = {
|
|
2178
2178
|
key: 0,
|
|
2179
2179
|
class: "yk-filter-panel__saved"
|
|
2180
|
-
},
|
|
2180
|
+
}, wn = /* @__PURE__ */ Z({
|
|
2181
2181
|
name: "YsFilterPanel",
|
|
2182
2182
|
__name: "filterPanel",
|
|
2183
2183
|
props: {
|
|
@@ -2234,270 +2234,270 @@ import './index.css';const Kt = { class: "export-options" }, jt = { class: "expo
|
|
|
2234
2234
|
singleLine: { type: Boolean, default: !1 }
|
|
2235
2235
|
},
|
|
2236
2236
|
emits: ["search", "reset", "update:quickQueries"],
|
|
2237
|
-
setup(e, { expose:
|
|
2238
|
-
const l = e, a = t, { filter: k, register:
|
|
2239
|
-
|
|
2240
|
-
const
|
|
2241
|
-
() => l.quickQueries ??
|
|
2242
|
-
), b =
|
|
2237
|
+
setup(e, { expose: m, emit: t }) {
|
|
2238
|
+
const l = e, a = t, { filter: k, register: r, reset: $ } = Ot();
|
|
2239
|
+
ft(gt, r);
|
|
2240
|
+
const f = Y("simple"), x = Y(!0), S = Y(0), P = Y(null), H = Y([]), A = Q(
|
|
2241
|
+
() => l.quickQueries ?? H.value
|
|
2242
|
+
), b = Y(null), _ = Q(() => {
|
|
2243
2243
|
var D;
|
|
2244
|
-
return
|
|
2244
|
+
return f.value === "advanced" ? ((D = b.value) == null ? void 0 : D.filter) ?? lt() : k.value;
|
|
2245
2245
|
});
|
|
2246
|
-
function
|
|
2246
|
+
function N() {
|
|
2247
2247
|
a("search", _.value);
|
|
2248
2248
|
}
|
|
2249
2249
|
function T() {
|
|
2250
2250
|
var D;
|
|
2251
|
-
|
|
2251
|
+
f.value === "advanced" ? (D = b.value) == null || D.reset() : $(), a("reset");
|
|
2252
2252
|
}
|
|
2253
|
-
function
|
|
2253
|
+
function U(D) {
|
|
2254
2254
|
a("search", D);
|
|
2255
2255
|
}
|
|
2256
|
-
function
|
|
2256
|
+
function G() {
|
|
2257
2257
|
a("reset");
|
|
2258
2258
|
}
|
|
2259
|
-
async function
|
|
2260
|
-
const
|
|
2261
|
-
if (l.saveQuickQueryFun &&
|
|
2262
|
-
const
|
|
2263
|
-
for (const
|
|
2259
|
+
async function s(D) {
|
|
2260
|
+
const I = new Set(A.value.map((O) => O.id)), B = D.filter((O) => !I.has(O.id));
|
|
2261
|
+
if (l.saveQuickQueryFun && B.length > 0) {
|
|
2262
|
+
const O = [];
|
|
2263
|
+
for (const W of B)
|
|
2264
2264
|
try {
|
|
2265
|
-
const
|
|
2266
|
-
|
|
2265
|
+
const oe = await l.saveQuickQueryFun(W);
|
|
2266
|
+
O.push(oe ?? W);
|
|
2267
2267
|
} catch {
|
|
2268
|
-
fe.error(`保存快速查询「${
|
|
2268
|
+
fe.error(`保存快速查询「${W.name}」失败`), O.push(W);
|
|
2269
2269
|
}
|
|
2270
|
-
let
|
|
2271
|
-
if (
|
|
2272
|
-
const
|
|
2273
|
-
|
|
2270
|
+
let ie = D;
|
|
2271
|
+
if (O.some((W, oe) => W !== B[oe])) {
|
|
2272
|
+
const W = new Map(B.map((oe, ke) => [oe.id, O[ke] ?? oe]));
|
|
2273
|
+
ie = D.map((oe) => W.get(oe.id) ?? oe);
|
|
2274
2274
|
}
|
|
2275
|
-
|
|
2275
|
+
H.value = ie, a("update:quickQueries", ie);
|
|
2276
2276
|
} else
|
|
2277
|
-
|
|
2277
|
+
H.value = D, a("update:quickQueries", D);
|
|
2278
2278
|
}
|
|
2279
|
-
let
|
|
2279
|
+
let v = null;
|
|
2280
2280
|
function F() {
|
|
2281
|
-
return !
|
|
2281
|
+
return !v && l.advancedColumns.length && (v = yt({
|
|
2282
2282
|
columns: l.advancedColumns,
|
|
2283
2283
|
optionSources: l.advancedOptionSources
|
|
2284
|
-
})),
|
|
2284
|
+
})), v;
|
|
2285
2285
|
}
|
|
2286
|
-
function
|
|
2287
|
-
const
|
|
2288
|
-
return
|
|
2286
|
+
function q(D) {
|
|
2287
|
+
const I = F();
|
|
2288
|
+
return I ? (I.rootGroup.value = JSON.parse(JSON.stringify(D)), I.filter.value) : { toString: () => "", isEmpty: () => !0 };
|
|
2289
2289
|
}
|
|
2290
|
-
|
|
2290
|
+
Me(async () => {
|
|
2291
2291
|
if (l.loadQuickQueryFun)
|
|
2292
2292
|
try {
|
|
2293
|
-
const
|
|
2294
|
-
...
|
|
2295
|
-
filterInfo:
|
|
2293
|
+
const I = (await l.loadQuickQueryFun()).map((B) => ({
|
|
2294
|
+
...B,
|
|
2295
|
+
filterInfo: B.filterInfo ?? q(B.group)
|
|
2296
2296
|
}));
|
|
2297
|
-
|
|
2297
|
+
H.value = I, a("update:quickQueries", I);
|
|
2298
2298
|
} catch {
|
|
2299
2299
|
fe.error("加载快速查询失败");
|
|
2300
2300
|
}
|
|
2301
2301
|
});
|
|
2302
2302
|
function E() {
|
|
2303
|
-
|
|
2303
|
+
f.value !== "advanced" && N();
|
|
2304
2304
|
}
|
|
2305
2305
|
function ue() {
|
|
2306
|
-
|
|
2306
|
+
f.value = "advanced";
|
|
2307
2307
|
}
|
|
2308
|
-
function
|
|
2309
|
-
|
|
2308
|
+
function de() {
|
|
2309
|
+
f.value = "simple";
|
|
2310
2310
|
}
|
|
2311
|
-
function
|
|
2311
|
+
function ee() {
|
|
2312
2312
|
x.value = !x.value;
|
|
2313
2313
|
}
|
|
2314
|
-
function
|
|
2315
|
-
const D =
|
|
2314
|
+
function w() {
|
|
2315
|
+
const D = P.value;
|
|
2316
2316
|
if (!D) return;
|
|
2317
|
-
for (const
|
|
2318
|
-
|
|
2317
|
+
for (const ke of Array.from(D.children))
|
|
2318
|
+
ke.style.display = "";
|
|
2319
2319
|
if (!l.singleLine || !x.value) {
|
|
2320
2320
|
S.value = 0, D.style.maxWidth = "";
|
|
2321
2321
|
return;
|
|
2322
2322
|
}
|
|
2323
|
-
const
|
|
2324
|
-
D.style.maxWidth = `calc(100% - ${
|
|
2325
|
-
const
|
|
2326
|
-
let
|
|
2327
|
-
for (const
|
|
2328
|
-
const
|
|
2329
|
-
|
|
2323
|
+
const I = D.nextElementSibling, B = I ? I.offsetWidth : 0, O = 16;
|
|
2324
|
+
D.style.maxWidth = `calc(100% - ${B + O}px)`;
|
|
2325
|
+
const ie = D.clientWidth;
|
|
2326
|
+
let W = 0, oe = 0;
|
|
2327
|
+
for (const ke of Array.from(D.children)) {
|
|
2328
|
+
const Ce = ke, pe = Ce.offsetWidth;
|
|
2329
|
+
W > 0 && W + pe + O > ie ? (Ce.style.display = "none", oe++) : W += pe + O;
|
|
2330
2330
|
}
|
|
2331
|
-
S.value =
|
|
2331
|
+
S.value = oe;
|
|
2332
2332
|
}
|
|
2333
|
-
let
|
|
2334
|
-
function
|
|
2335
|
-
var
|
|
2336
|
-
|
|
2333
|
+
let d = null;
|
|
2334
|
+
function j(D) {
|
|
2335
|
+
var I;
|
|
2336
|
+
f.value === "advanced" ? (I = b.value) == null || I.applySavedQuery(D) : a("search", D.filterInfo);
|
|
2337
2337
|
}
|
|
2338
|
-
async function
|
|
2339
|
-
const
|
|
2338
|
+
async function se(D) {
|
|
2339
|
+
const I = A.value.find((O) => O.id === D), B = (I == null ? void 0 : I.name) ?? "该查询";
|
|
2340
2340
|
try {
|
|
2341
|
-
await
|
|
2342
|
-
`确定要删除快速查询「${
|
|
2341
|
+
await kt.confirm(
|
|
2342
|
+
`确定要删除快速查询「${B}」吗?`,
|
|
2343
2343
|
"删除确认",
|
|
2344
2344
|
{ type: "warning", confirmButtonText: "删除", cancelButtonText: "取消" }
|
|
2345
2345
|
);
|
|
2346
2346
|
} catch {
|
|
2347
2347
|
return;
|
|
2348
2348
|
}
|
|
2349
|
-
await
|
|
2349
|
+
await s(A.value.filter((O) => O.id !== D));
|
|
2350
2350
|
}
|
|
2351
|
-
return
|
|
2352
|
-
l.singleLine && (
|
|
2353
|
-
}),
|
|
2354
|
-
|
|
2351
|
+
return Me(() => {
|
|
2352
|
+
l.singleLine && (w(), d = new ResizeObserver(() => w()), P.value && d.observe(P.value));
|
|
2353
|
+
}), Ge(() => {
|
|
2354
|
+
d == null || d.disconnect(), d = null;
|
|
2355
2355
|
}), me([x, () => l.singleLine], () => {
|
|
2356
|
-
|
|
2357
|
-
}),
|
|
2356
|
+
Ke(w);
|
|
2357
|
+
}), m({
|
|
2358
2358
|
filter: _,
|
|
2359
2359
|
reset: T,
|
|
2360
|
-
mode:
|
|
2361
|
-
}), (D,
|
|
2362
|
-
const
|
|
2363
|
-
return n(),
|
|
2364
|
-
class:
|
|
2365
|
-
onKeydown:
|
|
2360
|
+
mode: f
|
|
2361
|
+
}), (D, I) => {
|
|
2362
|
+
const B = C("el-button"), O = C("el-tooltip"), ie = C("el-tag");
|
|
2363
|
+
return n(), g("div", {
|
|
2364
|
+
class: $e(["yk-filter-panel", { "is-single-line": e.singleLine, "is-collapsed": e.singleLine && x.value }]),
|
|
2365
|
+
onKeydown: je(E, ["enter"])
|
|
2366
2366
|
}, [
|
|
2367
|
-
|
|
2368
|
-
e.singleLine ? (n(), h(
|
|
2367
|
+
f.value === "simple" ? (n(), g(L, { key: 0 }, [
|
|
2368
|
+
e.singleLine ? (n(), h(B, {
|
|
2369
2369
|
key: 0,
|
|
2370
2370
|
link: "",
|
|
2371
2371
|
class: "yk-filter-panel__toggle",
|
|
2372
2372
|
"aria-label": x.value ? "展开更多条件" : "折叠",
|
|
2373
2373
|
title: x.value ? S.value ? `展开(${S.value} 个条件被隐藏)` : "展开" : "折叠",
|
|
2374
|
-
onClick:
|
|
2374
|
+
onClick: ee
|
|
2375
2375
|
}, {
|
|
2376
2376
|
default: o(() => [
|
|
2377
|
-
x.value ? (n(),
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
])])) : (n(),
|
|
2381
|
-
|
|
2382
|
-
|
|
2377
|
+
x.value ? (n(), g("svg", yn, [...I[0] || (I[0] = [
|
|
2378
|
+
y("polyline", { points: "6 9 12 15 18 9" }, null, -1),
|
|
2379
|
+
y("polyline", { points: "6 14 12 20 18 14" }, null, -1)
|
|
2380
|
+
])])) : (n(), g("svg", gn, [...I[1] || (I[1] = [
|
|
2381
|
+
y("polyline", { points: "18 15 12 9 6 15" }, null, -1),
|
|
2382
|
+
y("polyline", { points: "18 10 12 4 6 10" }, null, -1)
|
|
2383
2383
|
])]))
|
|
2384
2384
|
]),
|
|
2385
2385
|
_: 1
|
|
2386
|
-
}, 8, ["aria-label", "title"])) :
|
|
2387
|
-
|
|
2386
|
+
}, 8, ["aria-label", "title"])) : R("", !0),
|
|
2387
|
+
y("div", {
|
|
2388
2388
|
class: "yk-filter-panel__items",
|
|
2389
2389
|
ref_key: "itemsEl",
|
|
2390
|
-
ref:
|
|
2390
|
+
ref: P
|
|
2391
2391
|
}, [
|
|
2392
|
-
|
|
2392
|
+
ne(D.$slots, "default", {}, void 0, !0)
|
|
2393
2393
|
], 512),
|
|
2394
|
-
e.showSearch || e.showReset || e.enableAdvancedFilter ? (n(),
|
|
2395
|
-
e.showSearch ? (n(), h(
|
|
2394
|
+
e.showSearch || e.showReset || e.enableAdvancedFilter ? (n(), g("div", kn, [
|
|
2395
|
+
e.showSearch ? (n(), h(B, {
|
|
2396
2396
|
key: 0,
|
|
2397
2397
|
type: "primary",
|
|
2398
|
-
onClick:
|
|
2398
|
+
onClick: N
|
|
2399
2399
|
}, {
|
|
2400
2400
|
default: o(() => [
|
|
2401
|
-
|
|
2401
|
+
V(z(e.searchButtonText), 1)
|
|
2402
2402
|
]),
|
|
2403
2403
|
_: 1
|
|
2404
|
-
})) :
|
|
2405
|
-
e.showReset ? (n(), h(
|
|
2404
|
+
})) : R("", !0),
|
|
2405
|
+
e.showReset ? (n(), h(B, {
|
|
2406
2406
|
key: 1,
|
|
2407
2407
|
onClick: T
|
|
2408
2408
|
}, {
|
|
2409
2409
|
default: o(() => [
|
|
2410
|
-
|
|
2410
|
+
V(z(e.resetButtonText), 1)
|
|
2411
2411
|
]),
|
|
2412
2412
|
_: 1
|
|
2413
|
-
})) :
|
|
2414
|
-
e.enableAdvancedFilter && !(e.singleLine && x.value) ? (n(), h(
|
|
2413
|
+
})) : R("", !0),
|
|
2414
|
+
e.enableAdvancedFilter && !(e.singleLine && x.value) ? (n(), h(B, {
|
|
2415
2415
|
key: 2,
|
|
2416
2416
|
link: "",
|
|
2417
2417
|
type: "primary",
|
|
2418
2418
|
onClick: ue
|
|
2419
2419
|
}, {
|
|
2420
|
-
default: o(() => [...
|
|
2421
|
-
|
|
2420
|
+
default: o(() => [...I[2] || (I[2] = [
|
|
2421
|
+
V(" 高级查询 ", -1)
|
|
2422
2422
|
])]),
|
|
2423
2423
|
_: 1
|
|
2424
|
-
})) :
|
|
2425
|
-
])) :
|
|
2426
|
-
e.showQuickQuery &&
|
|
2427
|
-
|
|
2428
|
-
(n(!0),
|
|
2429
|
-
key:
|
|
2430
|
-
content:
|
|
2431
|
-
disabled: !
|
|
2424
|
+
})) : R("", !0)
|
|
2425
|
+
])) : R("", !0),
|
|
2426
|
+
e.showQuickQuery && A.value.length ? (n(), g("div", _n, [
|
|
2427
|
+
I[3] || (I[3] = y("span", { class: "yk-filter-panel__saved-label" }, "快速查询:", -1)),
|
|
2428
|
+
(n(!0), g(L, null, te(A.value, (W) => (n(), h(O, {
|
|
2429
|
+
key: W.id,
|
|
2430
|
+
content: W.description,
|
|
2431
|
+
disabled: !W.description,
|
|
2432
2432
|
placement: "top"
|
|
2433
2433
|
}, {
|
|
2434
2434
|
default: o(() => [
|
|
2435
|
-
|
|
2435
|
+
p(B, {
|
|
2436
2436
|
size: "small",
|
|
2437
|
-
onClick: (
|
|
2437
|
+
onClick: (oe) => j(W)
|
|
2438
2438
|
}, {
|
|
2439
2439
|
default: o(() => [
|
|
2440
|
-
|
|
2440
|
+
V(z(W.name), 1)
|
|
2441
2441
|
]),
|
|
2442
2442
|
_: 2
|
|
2443
2443
|
}, 1032, ["onClick"])
|
|
2444
2444
|
]),
|
|
2445
2445
|
_: 2
|
|
2446
2446
|
}, 1032, ["content", "disabled"]))), 128))
|
|
2447
|
-
])) :
|
|
2448
|
-
], 64)) : (n(),
|
|
2449
|
-
|
|
2450
|
-
|
|
2447
|
+
])) : R("", !0)
|
|
2448
|
+
], 64)) : (n(), g(L, { key: 1 }, [
|
|
2449
|
+
y("div", bn, [
|
|
2450
|
+
p(B, {
|
|
2451
2451
|
link: "",
|
|
2452
2452
|
type: "primary",
|
|
2453
|
-
onClick:
|
|
2453
|
+
onClick: de
|
|
2454
2454
|
}, {
|
|
2455
|
-
default: o(() => [...
|
|
2456
|
-
|
|
2455
|
+
default: o(() => [...I[4] || (I[4] = [
|
|
2456
|
+
V("← 简单查询", -1)
|
|
2457
2457
|
])]),
|
|
2458
2458
|
_: 1
|
|
2459
2459
|
})
|
|
2460
2460
|
]),
|
|
2461
|
-
|
|
2461
|
+
p(St, {
|
|
2462
2462
|
ref_key: "advancedPanelRef",
|
|
2463
2463
|
ref: b,
|
|
2464
2464
|
columns: e.advancedColumns,
|
|
2465
2465
|
"option-sources": e.advancedOptionSources,
|
|
2466
|
-
"saved-queries":
|
|
2467
|
-
onSearch:
|
|
2468
|
-
onReset:
|
|
2469
|
-
"onUpdate:savedQueries":
|
|
2466
|
+
"saved-queries": A.value,
|
|
2467
|
+
onSearch: U,
|
|
2468
|
+
onReset: G,
|
|
2469
|
+
"onUpdate:savedQueries": s
|
|
2470
2470
|
}, null, 8, ["columns", "option-sources", "saved-queries"]),
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
(n(!0),
|
|
2474
|
-
key:
|
|
2475
|
-
content:
|
|
2476
|
-
disabled: !
|
|
2471
|
+
A.value.length ? (n(), g("div", hn, [
|
|
2472
|
+
I[5] || (I[5] = y("span", { class: "yk-filter-panel__saved-label" }, "已存查询:", -1)),
|
|
2473
|
+
(n(!0), g(L, null, te(A.value, (W) => (n(), h(O, {
|
|
2474
|
+
key: W.id,
|
|
2475
|
+
content: W.description,
|
|
2476
|
+
disabled: !W.description,
|
|
2477
2477
|
placement: "top"
|
|
2478
2478
|
}, {
|
|
2479
2479
|
default: o(() => [
|
|
2480
|
-
|
|
2480
|
+
p(ie, {
|
|
2481
2481
|
class: "yk-filter-panel__saved-tag",
|
|
2482
2482
|
effect: "plain",
|
|
2483
2483
|
closable: "",
|
|
2484
|
-
onClick: (
|
|
2485
|
-
onClose: (
|
|
2484
|
+
onClick: (oe) => j(W),
|
|
2485
|
+
onClose: (oe) => se(W.id)
|
|
2486
2486
|
}, {
|
|
2487
2487
|
default: o(() => [
|
|
2488
|
-
|
|
2488
|
+
V(z(W.name), 1)
|
|
2489
2489
|
]),
|
|
2490
2490
|
_: 2
|
|
2491
2491
|
}, 1032, ["onClick", "onClose"])
|
|
2492
2492
|
]),
|
|
2493
2493
|
_: 2
|
|
2494
2494
|
}, 1032, ["content", "disabled"]))), 128))
|
|
2495
|
-
])) :
|
|
2495
|
+
])) : R("", !0)
|
|
2496
2496
|
], 64))
|
|
2497
2497
|
], 34);
|
|
2498
2498
|
};
|
|
2499
2499
|
}
|
|
2500
|
-
}),
|
|
2500
|
+
}), $t = /* @__PURE__ */ ae(wn, [["__scopeId", "data-v-5ec097a2"]]), xn = { class: "yk-filter-item__label" }, Cn = { class: "yk-filter-item__control" }, Sn = /* @__PURE__ */ Z({
|
|
2501
2501
|
name: "YsFilterItemLayout",
|
|
2502
2502
|
__name: "filterItemLayout",
|
|
2503
2503
|
props: {
|
|
@@ -2512,23 +2512,23 @@ import './index.css';const Kt = { class: "export-options" }, jt = { class: "expo
|
|
|
2512
2512
|
api: { type: Object, required: !0 }
|
|
2513
2513
|
},
|
|
2514
2514
|
setup(e) {
|
|
2515
|
-
const
|
|
2515
|
+
const m = e, t = mt(gt, null);
|
|
2516
2516
|
let l = null;
|
|
2517
|
-
return
|
|
2518
|
-
t && (l = t(
|
|
2519
|
-
}),
|
|
2517
|
+
return Me(() => {
|
|
2518
|
+
t && (l = t(m.api));
|
|
2519
|
+
}), Ge(() => {
|
|
2520
2520
|
l == null || l();
|
|
2521
|
-
}), (a, k) => (n(),
|
|
2521
|
+
}), (a, k) => (n(), g("div", {
|
|
2522
2522
|
class: "yk-filter-item",
|
|
2523
|
-
style:
|
|
2523
|
+
style: ct({ minWidth: e.minWidth + "px" })
|
|
2524
2524
|
}, [
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2525
|
+
y("label", xn, z(e.label), 1),
|
|
2526
|
+
y("div", Cn, [
|
|
2527
|
+
ne(a.$slots, "default", {}, void 0, !0)
|
|
2528
2528
|
])
|
|
2529
2529
|
], 4));
|
|
2530
2530
|
}
|
|
2531
|
-
}),
|
|
2531
|
+
}), Ye = /* @__PURE__ */ ae(Sn, [["__scopeId", "data-v-2f9ea4d2"]]), $n = /* @__PURE__ */ Z({
|
|
2532
2532
|
name: "YsTextFilterItem",
|
|
2533
2533
|
__name: "textFilterItem",
|
|
2534
2534
|
props: {
|
|
@@ -2551,23 +2551,23 @@ import './index.css';const Kt = { class: "export-options" }, jt = { class: "expo
|
|
|
2551
2551
|
/** 占位文本 */
|
|
2552
2552
|
placeholder: { type: String, required: !1 }
|
|
2553
2553
|
},
|
|
2554
|
-
setup(e, { expose:
|
|
2555
|
-
const t = e, { value: l, filter: a, reset: k } =
|
|
2554
|
+
setup(e, { expose: m }) {
|
|
2555
|
+
const t = e, { value: l, filter: a, reset: k } = Ut(t), r = {
|
|
2556
2556
|
get filter() {
|
|
2557
2557
|
return a.value;
|
|
2558
2558
|
},
|
|
2559
2559
|
reset: k
|
|
2560
2560
|
};
|
|
2561
|
-
return
|
|
2562
|
-
const x =
|
|
2563
|
-
return n(), h(
|
|
2561
|
+
return m(r), ($, f) => {
|
|
2562
|
+
const x = C("el-input");
|
|
2563
|
+
return n(), h(Ye, {
|
|
2564
2564
|
label: e.label,
|
|
2565
|
-
api:
|
|
2565
|
+
api: r
|
|
2566
2566
|
}, {
|
|
2567
2567
|
default: o(() => [
|
|
2568
|
-
|
|
2569
|
-
modelValue:
|
|
2570
|
-
"onUpdate:modelValue":
|
|
2568
|
+
p(x, {
|
|
2569
|
+
modelValue: u(l),
|
|
2570
|
+
"onUpdate:modelValue": f[0] || (f[0] = (S) => Se(l) ? l.value = S : null),
|
|
2571
2571
|
placeholder: e.placeholder,
|
|
2572
2572
|
clearable: ""
|
|
2573
2573
|
}, null, 8, ["modelValue", "placeholder"])
|
|
@@ -2576,7 +2576,7 @@ import './index.css';const Kt = { class: "export-options" }, jt = { class: "expo
|
|
|
2576
2576
|
}, 8, ["label"]);
|
|
2577
2577
|
};
|
|
2578
2578
|
}
|
|
2579
|
-
}),
|
|
2579
|
+
}), Vn = /* @__PURE__ */ Z({
|
|
2580
2580
|
name: "YsDateFilterItem",
|
|
2581
2581
|
__name: "dateFilterItem",
|
|
2582
2582
|
props: {
|
|
@@ -2600,23 +2600,23 @@ import './index.css';const Kt = { class: "export-options" }, jt = { class: "expo
|
|
|
2600
2600
|
/** el-date-picker value-format,默认 'YYYY-MM-DD'(v-model 绑字符串) */
|
|
2601
2601
|
valueFormat: { type: String, default: "YYYY-MM-DD" }
|
|
2602
2602
|
},
|
|
2603
|
-
setup(e, { expose:
|
|
2604
|
-
const t = e, { value: l, filter: a, reset: k } =
|
|
2603
|
+
setup(e, { expose: m }) {
|
|
2604
|
+
const t = e, { value: l, filter: a, reset: k } = Lt(t), r = {
|
|
2605
2605
|
get filter() {
|
|
2606
2606
|
return a.value;
|
|
2607
2607
|
},
|
|
2608
2608
|
reset: k
|
|
2609
2609
|
};
|
|
2610
|
-
return
|
|
2611
|
-
const x =
|
|
2612
|
-
return n(), h(
|
|
2610
|
+
return m(r), ($, f) => {
|
|
2611
|
+
const x = C("el-date-picker");
|
|
2612
|
+
return n(), h(Ye, {
|
|
2613
2613
|
label: e.label,
|
|
2614
|
-
api:
|
|
2614
|
+
api: r
|
|
2615
2615
|
}, {
|
|
2616
2616
|
default: o(() => [
|
|
2617
|
-
|
|
2618
|
-
modelValue:
|
|
2619
|
-
"onUpdate:modelValue":
|
|
2617
|
+
p(x, {
|
|
2618
|
+
modelValue: u(l),
|
|
2619
|
+
"onUpdate:modelValue": f[0] || (f[0] = (S) => Se(l) ? l.value = S : null),
|
|
2620
2620
|
type: "date",
|
|
2621
2621
|
placeholder: e.placeholder,
|
|
2622
2622
|
"value-format": e.valueFormat,
|
|
@@ -2627,7 +2627,7 @@ import './index.css';const Kt = { class: "export-options" }, jt = { class: "expo
|
|
|
2627
2627
|
}, 8, ["label"]);
|
|
2628
2628
|
};
|
|
2629
2629
|
}
|
|
2630
|
-
}),
|
|
2630
|
+
}), Fn = /* @__PURE__ */ Z({
|
|
2631
2631
|
name: "YsDateRangeFilterItem",
|
|
2632
2632
|
__name: "dateRangeFilterItem",
|
|
2633
2633
|
props: {
|
|
@@ -2656,24 +2656,24 @@ import './index.css';const Kt = { class: "export-options" }, jt = { class: "expo
|
|
|
2656
2656
|
required: !1
|
|
2657
2657
|
}
|
|
2658
2658
|
},
|
|
2659
|
-
setup(e, { expose:
|
|
2660
|
-
const t = e, { value: l, filter: a, reset: k } =
|
|
2659
|
+
setup(e, { expose: m }) {
|
|
2660
|
+
const t = e, { value: l, filter: a, reset: k } = Ht(t), r = {
|
|
2661
2661
|
get filter() {
|
|
2662
2662
|
return a.value;
|
|
2663
2663
|
},
|
|
2664
2664
|
reset: k
|
|
2665
2665
|
};
|
|
2666
|
-
return
|
|
2667
|
-
const x =
|
|
2668
|
-
return n(), h(
|
|
2666
|
+
return m(r), ($, f) => {
|
|
2667
|
+
const x = C("el-date-picker");
|
|
2668
|
+
return n(), h(Ye, {
|
|
2669
2669
|
label: e.label,
|
|
2670
|
-
api:
|
|
2670
|
+
api: r,
|
|
2671
2671
|
"min-width": 240
|
|
2672
2672
|
}, {
|
|
2673
2673
|
default: o(() => [
|
|
2674
|
-
|
|
2675
|
-
modelValue:
|
|
2676
|
-
"onUpdate:modelValue":
|
|
2674
|
+
p(x, {
|
|
2675
|
+
modelValue: u(l),
|
|
2676
|
+
"onUpdate:modelValue": f[0] || (f[0] = (S) => Se(l) ? l.value = S : null),
|
|
2677
2677
|
type: "daterange",
|
|
2678
2678
|
"start-placeholder": e.startPlaceholder,
|
|
2679
2679
|
"end-placeholder": e.endPlaceholder,
|
|
@@ -2686,7 +2686,7 @@ import './index.css';const Kt = { class: "export-options" }, jt = { class: "expo
|
|
|
2686
2686
|
}, 8, ["label"]);
|
|
2687
2687
|
};
|
|
2688
2688
|
}
|
|
2689
|
-
}),
|
|
2689
|
+
}), Mn = /* @__PURE__ */ Z({
|
|
2690
2690
|
name: "YsEnumFilterItem",
|
|
2691
2691
|
__name: "enumFilterItem",
|
|
2692
2692
|
props: {
|
|
@@ -2723,19 +2723,19 @@ import './index.css';const Kt = { class: "export-options" }, jt = { class: "expo
|
|
|
2723
2723
|
/** 是否多选;默认 false。多选时 2+ 项用 In,1 项用 Equals,0 项返回 null */
|
|
2724
2724
|
multiple: { type: Boolean, default: !1 }
|
|
2725
2725
|
},
|
|
2726
|
-
setup(e, { expose:
|
|
2727
|
-
const t = e, { value: l, filter: a, reset: k } =
|
|
2726
|
+
setup(e, { expose: m }) {
|
|
2727
|
+
const t = e, { value: l, filter: a, reset: k } = Kt(t), r = Q({
|
|
2728
2728
|
get: () => l.value,
|
|
2729
2729
|
set: (S) => {
|
|
2730
2730
|
l.value = S;
|
|
2731
2731
|
}
|
|
2732
|
-
}),
|
|
2733
|
-
|
|
2734
|
-
|
|
2732
|
+
}), $ = Y([]), f = Y(!1);
|
|
2733
|
+
Me(async () => {
|
|
2734
|
+
f.value = !0;
|
|
2735
2735
|
try {
|
|
2736
|
-
|
|
2736
|
+
$.value = await t.optionsSource();
|
|
2737
2737
|
} finally {
|
|
2738
|
-
|
|
2738
|
+
f.value = !1;
|
|
2739
2739
|
}
|
|
2740
2740
|
});
|
|
2741
2741
|
const x = {
|
|
@@ -2744,23 +2744,23 @@ import './index.css';const Kt = { class: "export-options" }, jt = { class: "expo
|
|
|
2744
2744
|
},
|
|
2745
2745
|
reset: k
|
|
2746
2746
|
};
|
|
2747
|
-
return
|
|
2748
|
-
const
|
|
2749
|
-
return n(), h(
|
|
2747
|
+
return m(x), (S, P) => {
|
|
2748
|
+
const H = C("el-option"), A = C("el-select");
|
|
2749
|
+
return n(), h(Ye, {
|
|
2750
2750
|
label: e.label,
|
|
2751
2751
|
api: x
|
|
2752
2752
|
}, {
|
|
2753
2753
|
default: o(() => [
|
|
2754
|
-
|
|
2755
|
-
modelValue:
|
|
2756
|
-
"onUpdate:modelValue":
|
|
2754
|
+
p(A, {
|
|
2755
|
+
modelValue: r.value,
|
|
2756
|
+
"onUpdate:modelValue": P[0] || (P[0] = (b) => r.value = b),
|
|
2757
2757
|
multiple: e.multiple,
|
|
2758
2758
|
placeholder: e.placeholder,
|
|
2759
2759
|
clearable: e.clearable,
|
|
2760
|
-
loading:
|
|
2760
|
+
loading: f.value
|
|
2761
2761
|
}, {
|
|
2762
2762
|
default: o(() => [
|
|
2763
|
-
(n(!0),
|
|
2763
|
+
(n(!0), g(L, null, te($.value, (b) => (n(), h(H, {
|
|
2764
2764
|
key: String(b.value),
|
|
2765
2765
|
value: b.value,
|
|
2766
2766
|
label: b.label
|
|
@@ -2773,7 +2773,7 @@ import './index.css';const Kt = { class: "export-options" }, jt = { class: "expo
|
|
|
2773
2773
|
}, 8, ["label"]);
|
|
2774
2774
|
};
|
|
2775
2775
|
}
|
|
2776
|
-
}),
|
|
2776
|
+
}), An = { class: "yk-table-page" }, Rn = /* @__PURE__ */ Z({
|
|
2777
2777
|
name: "YsTablePage",
|
|
2778
2778
|
__name: "tablePage",
|
|
2779
2779
|
props: {
|
|
@@ -2807,10 +2807,10 @@ import './index.css';const Kt = { class: "export-options" }, jt = { class: "expo
|
|
|
2807
2807
|
singleLine: { type: Boolean, default: !1 }
|
|
2808
2808
|
},
|
|
2809
2809
|
emits: ["search", "reset", "update:quickQueries", "data-loaded", "update:viewMode", "update:showCheckbox", "update:columnResizable", "update:stickyHeader"],
|
|
2810
|
-
setup(e, { expose:
|
|
2811
|
-
const l = e, a = t, k =
|
|
2810
|
+
setup(e, { expose: m, emit: t }) {
|
|
2811
|
+
const l = e, a = t, k = Pt(lt()), r = Y(null), $ = Y(null), f = Q(() => async (A, b) => l.dataFun(A, k.value, b)), x = Q(() => ({
|
|
2812
2812
|
metaFun: l.metaFun,
|
|
2813
|
-
dataFun:
|
|
2813
|
+
dataFun: f.value,
|
|
2814
2814
|
rowActionsFunc: l.rowActionsFunc,
|
|
2815
2815
|
pageSize: l.pageSize,
|
|
2816
2816
|
pageSizes: l.pageSizes,
|
|
@@ -2837,49 +2837,49 @@ import './index.css';const Kt = { class: "export-options" }, jt = { class: "expo
|
|
|
2837
2837
|
saveQuickQueryFun: l.saveQuickQueryFun,
|
|
2838
2838
|
singleLine: l.singleLine
|
|
2839
2839
|
}));
|
|
2840
|
-
function
|
|
2840
|
+
function P(A) {
|
|
2841
2841
|
var b;
|
|
2842
|
-
k.value =
|
|
2842
|
+
k.value = A, a("search", A), (b = r.value) == null || b.reload();
|
|
2843
2843
|
}
|
|
2844
|
-
function
|
|
2845
|
-
var
|
|
2846
|
-
k.value =
|
|
2844
|
+
function H() {
|
|
2845
|
+
var A;
|
|
2846
|
+
k.value = lt(), a("reset"), (A = r.value) == null || A.reload();
|
|
2847
2847
|
}
|
|
2848
|
-
return
|
|
2849
|
-
table:
|
|
2850
|
-
filterPanel:
|
|
2851
|
-
}), (
|
|
2852
|
-
|
|
2848
|
+
return m({
|
|
2849
|
+
table: r,
|
|
2850
|
+
filterPanel: $
|
|
2851
|
+
}), (A, b) => (n(), g("div", An, [
|
|
2852
|
+
p($t, Ze({
|
|
2853
2853
|
ref_key: "filterPanelRef",
|
|
2854
|
-
ref:
|
|
2854
|
+
ref: $,
|
|
2855
2855
|
class: "yk-table-page__filter"
|
|
2856
2856
|
}, S.value, {
|
|
2857
|
-
onSearch:
|
|
2858
|
-
onReset:
|
|
2857
|
+
onSearch: P,
|
|
2858
|
+
onReset: H,
|
|
2859
2859
|
"onUpdate:quickQueries": b[0] || (b[0] = (_) => a("update:quickQueries", _))
|
|
2860
2860
|
}), {
|
|
2861
2861
|
default: o(() => [
|
|
2862
|
-
|
|
2862
|
+
ne(A.$slots, "default", {}, void 0, !0)
|
|
2863
2863
|
]),
|
|
2864
2864
|
_: 3
|
|
2865
2865
|
}, 16),
|
|
2866
|
-
|
|
2866
|
+
p(ht, {
|
|
2867
2867
|
class: "yk-table-page__command",
|
|
2868
2868
|
actions: l.actions,
|
|
2869
|
-
table:
|
|
2869
|
+
table: r.value,
|
|
2870
2870
|
"show-action-menu-button": l.showActionMenuButton
|
|
2871
2871
|
}, Be({ _: 2 }, [
|
|
2872
|
-
|
|
2872
|
+
A.$slots["command-bar"] ? {
|
|
2873
2873
|
name: "default",
|
|
2874
2874
|
fn: o(() => [
|
|
2875
|
-
|
|
2875
|
+
ne(A.$slots, "command-bar", {}, void 0, !0)
|
|
2876
2876
|
]),
|
|
2877
2877
|
key: "0"
|
|
2878
2878
|
} : void 0
|
|
2879
2879
|
]), 1032, ["actions", "table", "show-action-menu-button"]),
|
|
2880
|
-
|
|
2880
|
+
p(_t, Ze({
|
|
2881
2881
|
ref_key: "tableRef",
|
|
2882
|
-
ref:
|
|
2882
|
+
ref: r,
|
|
2883
2883
|
class: "yk-table-page__table"
|
|
2884
2884
|
}, x.value, {
|
|
2885
2885
|
onDataLoaded: b[1] || (b[1] = (_) => a("data-loaded", _)),
|
|
@@ -2888,46 +2888,46 @@ import './index.css';const Kt = { class: "export-options" }, jt = { class: "expo
|
|
|
2888
2888
|
"onUpdate:columnResizable": b[4] || (b[4] = (_) => a("update:columnResizable", _)),
|
|
2889
2889
|
"onUpdate:stickyHeader": b[5] || (b[5] = (_) => a("update:stickyHeader", _))
|
|
2890
2890
|
}), Be({ _: 2 }, [
|
|
2891
|
-
|
|
2891
|
+
A.$slots.card ? {
|
|
2892
2892
|
name: "card",
|
|
2893
2893
|
fn: o((_) => [
|
|
2894
|
-
|
|
2894
|
+
ne(A.$slots, "card", Ie(Te(_)), void 0, !0)
|
|
2895
2895
|
]),
|
|
2896
2896
|
key: "0"
|
|
2897
2897
|
} : void 0,
|
|
2898
|
-
|
|
2898
|
+
A.$slots.list ? {
|
|
2899
2899
|
name: "list",
|
|
2900
2900
|
fn: o((_) => [
|
|
2901
|
-
|
|
2901
|
+
ne(A.$slots, "list", Ie(Te(_)), void 0, !0)
|
|
2902
2902
|
]),
|
|
2903
2903
|
key: "1"
|
|
2904
2904
|
} : void 0,
|
|
2905
|
-
|
|
2905
|
+
A.$slots.empty ? {
|
|
2906
2906
|
name: "empty",
|
|
2907
2907
|
fn: o((_) => [
|
|
2908
|
-
|
|
2908
|
+
ne(A.$slots, "empty", Ie(Te(_)), void 0, !0)
|
|
2909
2909
|
]),
|
|
2910
2910
|
key: "2"
|
|
2911
2911
|
} : void 0,
|
|
2912
|
-
|
|
2912
|
+
A.$slots.loading ? {
|
|
2913
2913
|
name: "loading",
|
|
2914
2914
|
fn: o((_) => [
|
|
2915
|
-
|
|
2915
|
+
ne(A.$slots, "loading", Ie(Te(_)), void 0, !0)
|
|
2916
2916
|
]),
|
|
2917
2917
|
key: "3"
|
|
2918
2918
|
} : void 0,
|
|
2919
|
-
|
|
2919
|
+
A.$slots.footer ? {
|
|
2920
2920
|
name: "footer",
|
|
2921
2921
|
fn: o((_) => [
|
|
2922
|
-
|
|
2922
|
+
ne(A.$slots, "footer", Ie(Te(_)), void 0, !0)
|
|
2923
2923
|
]),
|
|
2924
2924
|
key: "4"
|
|
2925
2925
|
} : void 0
|
|
2926
2926
|
]), 1040)
|
|
2927
2927
|
]));
|
|
2928
2928
|
}
|
|
2929
|
-
}),
|
|
2930
|
-
function
|
|
2929
|
+
}), Pn = /* @__PURE__ */ ae(Rn, [["__scopeId", "data-v-1cfd74f0"]]);
|
|
2930
|
+
function Vt(e) {
|
|
2931
2931
|
if (e == null) return "";
|
|
2932
2932
|
if (typeof e == "object")
|
|
2933
2933
|
try {
|
|
@@ -2937,7 +2937,7 @@ function Ct(e) {
|
|
|
2937
2937
|
}
|
|
2938
2938
|
return String(e);
|
|
2939
2939
|
}
|
|
2940
|
-
const
|
|
2940
|
+
const zn = /* @__PURE__ */ Z({
|
|
2941
2941
|
__name: "importRowEditDialog",
|
|
2942
2942
|
props: {
|
|
2943
2943
|
visible: { type: Boolean },
|
|
@@ -2946,52 +2946,52 @@ const Sn = /* @__PURE__ */ ee({
|
|
|
2946
2946
|
saver: { type: Function }
|
|
2947
2947
|
},
|
|
2948
2948
|
emits: ["update:visible", "saved"],
|
|
2949
|
-
setup(e, { emit:
|
|
2950
|
-
const t = e, l =
|
|
2949
|
+
setup(e, { emit: m }) {
|
|
2950
|
+
const t = e, l = m, a = Y({}), k = Y([]);
|
|
2951
2951
|
me(
|
|
2952
2952
|
() => t.visible,
|
|
2953
|
-
(
|
|
2954
|
-
if (!
|
|
2953
|
+
(f) => {
|
|
2954
|
+
if (!f || !t.row) return;
|
|
2955
2955
|
const x = {};
|
|
2956
2956
|
for (const S of t.columns)
|
|
2957
|
-
x[S.name] =
|
|
2957
|
+
x[S.name] = Vt(t.row.data[S.name]);
|
|
2958
2958
|
a.value = x, k.value = [];
|
|
2959
2959
|
}
|
|
2960
2960
|
);
|
|
2961
|
-
function
|
|
2961
|
+
function r() {
|
|
2962
2962
|
l("update:visible", !1);
|
|
2963
2963
|
}
|
|
2964
|
-
function
|
|
2964
|
+
function $() {
|
|
2965
2965
|
if (!t.row) return;
|
|
2966
|
-
const
|
|
2967
|
-
for (const
|
|
2968
|
-
|
|
2969
|
-
const { row: x, errors: S } = t.saver(t.row,
|
|
2966
|
+
const f = {};
|
|
2967
|
+
for (const P of t.columns)
|
|
2968
|
+
f[P.name] = a.value[P.name] ?? "";
|
|
2969
|
+
const { row: x, errors: S } = t.saver(t.row, f);
|
|
2970
2970
|
k.value = S, !(S.length > 0) && (l("saved", x), l("update:visible", !1));
|
|
2971
2971
|
}
|
|
2972
|
-
return (
|
|
2973
|
-
const S =
|
|
2972
|
+
return (f, x) => {
|
|
2973
|
+
const S = C("el-alert"), P = C("el-input"), H = C("el-form-item"), A = C("el-form"), b = C("el-button"), _ = C("el-dialog");
|
|
2974
2974
|
return n(), h(_, {
|
|
2975
2975
|
"model-value": e.visible,
|
|
2976
2976
|
title: e.row ? `编辑第 ${e.row.rowNumber} 行` : "编辑数据行",
|
|
2977
2977
|
width: "480px",
|
|
2978
2978
|
"append-to-body": "",
|
|
2979
2979
|
"close-on-click-modal": !1,
|
|
2980
|
-
"onUpdate:modelValue": x[1] || (x[1] = (
|
|
2980
|
+
"onUpdate:modelValue": x[1] || (x[1] = (N) => l("update:visible", N))
|
|
2981
2981
|
}, {
|
|
2982
2982
|
footer: o(() => [
|
|
2983
|
-
|
|
2983
|
+
p(b, { onClick: r }, {
|
|
2984
2984
|
default: o(() => [...x[2] || (x[2] = [
|
|
2985
|
-
|
|
2985
|
+
V("取消", -1)
|
|
2986
2986
|
])]),
|
|
2987
2987
|
_: 1
|
|
2988
2988
|
}),
|
|
2989
|
-
|
|
2989
|
+
p(b, {
|
|
2990
2990
|
type: "primary",
|
|
2991
|
-
onClick:
|
|
2991
|
+
onClick: $
|
|
2992
2992
|
}, {
|
|
2993
2993
|
default: o(() => [...x[3] || (x[3] = [
|
|
2994
|
-
|
|
2994
|
+
V("保存并重新校验", -1)
|
|
2995
2995
|
])]),
|
|
2996
2996
|
_: 1
|
|
2997
2997
|
})
|
|
@@ -3005,27 +3005,27 @@ const Sn = /* @__PURE__ */ ee({
|
|
|
3005
3005
|
"show-icon": ""
|
|
3006
3006
|
}, {
|
|
3007
3007
|
default: o(() => [
|
|
3008
|
-
(n(!0),
|
|
3008
|
+
(n(!0), g(L, null, te(k.value, (N, T) => (n(), g("div", { key: T }, z(N), 1))), 128))
|
|
3009
3009
|
]),
|
|
3010
3010
|
_: 1
|
|
3011
|
-
})) :
|
|
3012
|
-
|
|
3011
|
+
})) : R("", !0),
|
|
3012
|
+
p(A, {
|
|
3013
3013
|
"label-width": "92px",
|
|
3014
|
-
onSubmit: x[0] || (x[0] =
|
|
3014
|
+
onSubmit: x[0] || (x[0] = dt(() => {
|
|
3015
3015
|
}, ["prevent"]))
|
|
3016
3016
|
}, {
|
|
3017
3017
|
default: o(() => [
|
|
3018
|
-
(n(!0),
|
|
3019
|
-
key:
|
|
3020
|
-
label:
|
|
3021
|
-
required: !
|
|
3018
|
+
(n(!0), g(L, null, te(e.columns, (N) => (n(), h(H, {
|
|
3019
|
+
key: N.name,
|
|
3020
|
+
label: N.name,
|
|
3021
|
+
required: !N.optional
|
|
3022
3022
|
}, {
|
|
3023
3023
|
default: o(() => [
|
|
3024
|
-
|
|
3025
|
-
modelValue: a.value[
|
|
3026
|
-
"onUpdate:modelValue": (T) => a.value[
|
|
3027
|
-
placeholder:
|
|
3028
|
-
onKeyup:
|
|
3024
|
+
p(P, {
|
|
3025
|
+
modelValue: a.value[N.name],
|
|
3026
|
+
"onUpdate:modelValue": (T) => a.value[N.name] = T,
|
|
3027
|
+
placeholder: N.optional ? "可留空" : `请输入${N.name}`,
|
|
3028
|
+
onKeyup: je($, ["enter"])
|
|
3029
3029
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])
|
|
3030
3030
|
]),
|
|
3031
3031
|
_: 2
|
|
@@ -3038,28 +3038,28 @@ const Sn = /* @__PURE__ */ ee({
|
|
|
3038
3038
|
}, 8, ["model-value", "title"]);
|
|
3039
3039
|
};
|
|
3040
3040
|
}
|
|
3041
|
-
}),
|
|
3041
|
+
}), Bn = /* @__PURE__ */ ae(zn, [["__scopeId", "data-v-24918b65"]]), Dn = ["accept"], En = { class: "yk-import-excel__toolbar" }, In = ["title"], Tn = {
|
|
3042
3042
|
key: 2,
|
|
3043
3043
|
class: "yk-import-excel__stats"
|
|
3044
|
-
},
|
|
3044
|
+
}, Qn = { class: "yk-import-excel__stat" }, Yn = { class: "yk-import-excel__stat" }, Nn = { class: "yk-import-excel__stat yk-import-excel__stat--danger" }, qn = {
|
|
3045
3045
|
key: 0,
|
|
3046
3046
|
class: "yk-import-excel__progress"
|
|
3047
|
-
},
|
|
3047
|
+
}, On = { class: "yk-import-excel__progress-meta" }, Un = { class: "yk-import-excel__danger-text" }, Ln = { class: "yk-import-excel__progress-eta" }, Hn = { class: "yk-import-excel__body" }, Kn = ["title"], jn = {
|
|
3048
3048
|
key: 0,
|
|
3049
3049
|
class: "yk-import-excel__spin"
|
|
3050
|
-
},
|
|
3050
|
+
}, Gn = {
|
|
3051
3051
|
key: 0,
|
|
3052
3052
|
class: "yk-import-excel__msg yk-import-excel__msg--danger"
|
|
3053
|
-
},
|
|
3053
|
+
}, Wn = {
|
|
3054
3054
|
key: 1,
|
|
3055
3055
|
class: "yk-import-excel__msg yk-import-excel__msg--danger"
|
|
3056
|
-
},
|
|
3056
|
+
}, Jn = {
|
|
3057
3057
|
key: 1,
|
|
3058
3058
|
class: "yk-import-excel__action-placeholder"
|
|
3059
|
-
},
|
|
3059
|
+
}, Xn = { class: "yk-import-excel__empty-hint" }, Zn = {
|
|
3060
3060
|
key: 1,
|
|
3061
3061
|
class: "yk-import-excel__drop-mask"
|
|
3062
|
-
},
|
|
3062
|
+
}, eo = /* @__PURE__ */ Z({
|
|
3063
3063
|
__name: "importExcel",
|
|
3064
3064
|
props: {
|
|
3065
3065
|
columns: {},
|
|
@@ -3069,369 +3069,369 @@ const Sn = /* @__PURE__ */ ee({
|
|
|
3069
3069
|
autoScroll: { type: Boolean, default: !0 }
|
|
3070
3070
|
},
|
|
3071
3071
|
emits: ["loaded", "selection-change", "processed", "row-update", "row-remove"],
|
|
3072
|
-
setup(e, { expose:
|
|
3072
|
+
setup(e, { expose: m, emit: t }) {
|
|
3073
3073
|
const l = e, a = t, {
|
|
3074
3074
|
rows: k,
|
|
3075
|
-
fileName:
|
|
3076
|
-
sheetName:
|
|
3077
|
-
loading:
|
|
3075
|
+
fileName: r,
|
|
3076
|
+
sheetName: $,
|
|
3077
|
+
loading: f,
|
|
3078
3078
|
processing: x,
|
|
3079
3079
|
stopping: S,
|
|
3080
|
-
processingTotal:
|
|
3081
|
-
progressDone:
|
|
3082
|
-
progressSuccess:
|
|
3080
|
+
processingTotal: P,
|
|
3081
|
+
progressDone: H,
|
|
3082
|
+
progressSuccess: A,
|
|
3083
3083
|
progressFailed: b,
|
|
3084
3084
|
hasData: _,
|
|
3085
|
-
invalidCount:
|
|
3085
|
+
invalidCount: N,
|
|
3086
3086
|
successCount: T,
|
|
3087
|
-
failedCount:
|
|
3088
|
-
selectedCount:
|
|
3089
|
-
pendingCount:
|
|
3090
|
-
loadFile:
|
|
3087
|
+
failedCount: U,
|
|
3088
|
+
selectedCount: G,
|
|
3089
|
+
pendingCount: s,
|
|
3090
|
+
loadFile: v,
|
|
3091
3091
|
syncSelection: F,
|
|
3092
|
-
saveRowEdit:
|
|
3092
|
+
saveRowEdit: q,
|
|
3093
3093
|
removeRow: E,
|
|
3094
3094
|
startProcessing: ue,
|
|
3095
|
-
stopProcessing:
|
|
3096
|
-
clear:
|
|
3097
|
-
} =
|
|
3095
|
+
stopProcessing: de,
|
|
3096
|
+
clear: ee
|
|
3097
|
+
} = jt({
|
|
3098
3098
|
columns: ve(l, "columns"),
|
|
3099
3099
|
processor: ve(l, "processor"),
|
|
3100
3100
|
parser: ve(l, "parser")
|
|
3101
|
-
}),
|
|
3101
|
+
}), w = Y(), d = Y(), j = {
|
|
3102
3102
|
valid: { label: "待处理", type: "info" },
|
|
3103
3103
|
invalid: { label: "校验失败", type: "danger" },
|
|
3104
3104
|
processing: { label: "处理中", type: "warning" },
|
|
3105
3105
|
success: { label: "成功", type: "success" },
|
|
3106
3106
|
failed: { label: "失败", type: "danger" }
|
|
3107
|
-
},
|
|
3108
|
-
() => Object.keys(
|
|
3109
|
-
text: `${
|
|
3110
|
-
value:
|
|
3107
|
+
}, se = Q(
|
|
3108
|
+
() => Object.keys(j).map((c) => ({
|
|
3109
|
+
text: `${j[c].label}(${k.value.filter((M) => M.status === c).length})`,
|
|
3110
|
+
value: c
|
|
3111
3111
|
}))
|
|
3112
3112
|
);
|
|
3113
|
-
function D(
|
|
3114
|
-
return
|
|
3113
|
+
function D(c, M) {
|
|
3114
|
+
return M.status === c;
|
|
3115
3115
|
}
|
|
3116
|
-
function
|
|
3117
|
-
var
|
|
3116
|
+
function I(c) {
|
|
3117
|
+
var ce, xe;
|
|
3118
3118
|
if (!l.autoScroll) return;
|
|
3119
|
-
const
|
|
3120
|
-
if (!
|
|
3121
|
-
const
|
|
3122
|
-
if (!
|
|
3123
|
-
const re =
|
|
3124
|
-
(
|
|
3119
|
+
const M = (ce = w.value) == null ? void 0 : ce.$el, K = M == null ? void 0 : M.querySelector(".el-table__body-wrapper .el-scrollbar__wrap"), le = M == null ? void 0 : M.querySelector(".el-table__body-wrapper tbody");
|
|
3120
|
+
if (!M || !K || !le) return;
|
|
3121
|
+
const i = k.value.findIndex((Ft) => Ft.rowNumber === c), J = le.querySelectorAll("tr")[i];
|
|
3122
|
+
if (!J) return;
|
|
3123
|
+
const re = K.getBoundingClientRect(), _e = J.getBoundingClientRect(), X = Math.max(0, K.scrollHeight - K.clientHeight), be = K.scrollTop + (_e.top - re.top) - (K.clientHeight - _e.height) / 2;
|
|
3124
|
+
(xe = w.value) == null || xe.setScrollTop(Math.min(X, Math.max(0, Math.round(be))));
|
|
3125
3125
|
}
|
|
3126
3126
|
me(
|
|
3127
3127
|
() => {
|
|
3128
|
-
var
|
|
3129
|
-
return ((
|
|
3128
|
+
var c;
|
|
3129
|
+
return ((c = k.value.find((M) => M.status === "processing")) == null ? void 0 : c.rowNumber) ?? null;
|
|
3130
3130
|
},
|
|
3131
|
-
(
|
|
3132
|
-
|
|
3131
|
+
(c) => {
|
|
3132
|
+
c !== null && Ke(() => I(c));
|
|
3133
3133
|
}
|
|
3134
3134
|
);
|
|
3135
|
-
const
|
|
3136
|
-
let
|
|
3137
|
-
const
|
|
3138
|
-
const
|
|
3139
|
-
return
|
|
3135
|
+
const B = Y(0), O = Y(0);
|
|
3136
|
+
let ie;
|
|
3137
|
+
const W = Q(() => {
|
|
3138
|
+
const c = P.value;
|
|
3139
|
+
return c <= 0 ? 0 : Math.min(100, H.value / c * 100);
|
|
3140
3140
|
});
|
|
3141
|
-
function
|
|
3142
|
-
return `${
|
|
3141
|
+
function oe() {
|
|
3142
|
+
return `${H.value}/${P.value}`;
|
|
3143
3143
|
}
|
|
3144
|
-
const
|
|
3145
|
-
if (!x.value ||
|
|
3146
|
-
const
|
|
3147
|
-
return `预计剩余 ${
|
|
3144
|
+
const ke = Q(() => {
|
|
3145
|
+
if (!x.value || H.value === 0) return "预计剩余 计算中…";
|
|
3146
|
+
const M = (O.value - B.value) / H.value, K = P.value - H.value;
|
|
3147
|
+
return `预计剩余 ${Ce(M * K)}`;
|
|
3148
3148
|
});
|
|
3149
|
-
function
|
|
3150
|
-
const
|
|
3151
|
-
if (
|
|
3152
|
-
const
|
|
3153
|
-
return
|
|
3154
|
-
}
|
|
3155
|
-
me(x, (
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
}, 500)) :
|
|
3159
|
-
}),
|
|
3160
|
-
|
|
3149
|
+
function Ce(c) {
|
|
3150
|
+
const M = Math.max(0, Math.ceil(c / 1e3));
|
|
3151
|
+
if (M < 60) return `${M} 秒`;
|
|
3152
|
+
const K = Math.floor(M / 60), le = M % 60;
|
|
3153
|
+
return le > 0 ? `${K} 分 ${le} 秒` : `${K} 分`;
|
|
3154
|
+
}
|
|
3155
|
+
me(x, (c) => {
|
|
3156
|
+
c ? (B.value = Date.now(), O.value = B.value, ie = setInterval(() => {
|
|
3157
|
+
O.value = Date.now();
|
|
3158
|
+
}, 500)) : ie && (clearInterval(ie), ie = void 0);
|
|
3159
|
+
}), Ge(() => {
|
|
3160
|
+
ie && clearInterval(ie);
|
|
3161
3161
|
});
|
|
3162
3162
|
function pe() {
|
|
3163
|
-
var
|
|
3164
|
-
(
|
|
3165
|
-
}
|
|
3166
|
-
const
|
|
3167
|
-
function
|
|
3168
|
-
var
|
|
3169
|
-
return Array.from(((
|
|
3170
|
-
}
|
|
3171
|
-
function
|
|
3172
|
-
const
|
|
3173
|
-
if (
|
|
3174
|
-
const
|
|
3175
|
-
return
|
|
3176
|
-
}
|
|
3177
|
-
async function
|
|
3178
|
-
var
|
|
3179
|
-
if (!
|
|
3180
|
-
if (!
|
|
3163
|
+
var c;
|
|
3164
|
+
(c = d.value) == null || c.click();
|
|
3165
|
+
}
|
|
3166
|
+
const he = Y(0), we = Q(() => he.value > 0);
|
|
3167
|
+
function Ve(c) {
|
|
3168
|
+
var M;
|
|
3169
|
+
return Array.from(((M = c.dataTransfer) == null ? void 0 : M.types) ?? []).includes("Files");
|
|
3170
|
+
}
|
|
3171
|
+
function Ne(c) {
|
|
3172
|
+
const M = l.accept.split(",").map((le) => le.trim().toLowerCase()).filter(Boolean);
|
|
3173
|
+
if (M.length === 0) return !0;
|
|
3174
|
+
const K = c.name.toLowerCase();
|
|
3175
|
+
return M.some((le) => K.endsWith(le));
|
|
3176
|
+
}
|
|
3177
|
+
async function Ae(c) {
|
|
3178
|
+
var M;
|
|
3179
|
+
if (!f.value) {
|
|
3180
|
+
if (!Ne(c)) {
|
|
3181
3181
|
fe.error(`仅支持 ${l.accept} 格式的文件`);
|
|
3182
3182
|
return;
|
|
3183
3183
|
}
|
|
3184
3184
|
try {
|
|
3185
|
-
const
|
|
3186
|
-
a("loaded",
|
|
3187
|
-
for (const
|
|
3188
|
-
|
|
3189
|
-
fe.success(`已加载 ${
|
|
3190
|
-
} catch (
|
|
3191
|
-
fe.error(
|
|
3185
|
+
const K = await v(c);
|
|
3186
|
+
a("loaded", K), await Ke();
|
|
3187
|
+
for (const le of k.value)
|
|
3188
|
+
le.status !== "invalid" && ((M = w.value) == null || M.toggleRowSelection(le, !0));
|
|
3189
|
+
fe.success(`已加载 ${K.length} 行(工作表「${$.value}」)`);
|
|
3190
|
+
} catch (K) {
|
|
3191
|
+
fe.error(K instanceof Error ? K.message : String(K));
|
|
3192
3192
|
}
|
|
3193
3193
|
}
|
|
3194
3194
|
}
|
|
3195
|
-
async function
|
|
3196
|
-
var
|
|
3197
|
-
const
|
|
3198
|
-
|
|
3195
|
+
async function Fe(c) {
|
|
3196
|
+
var le;
|
|
3197
|
+
const M = c.target, K = (le = M.files) == null ? void 0 : le[0];
|
|
3198
|
+
M.value = "", K && await Ae(K);
|
|
3199
3199
|
}
|
|
3200
|
-
function
|
|
3201
|
-
|
|
3200
|
+
function qe(c) {
|
|
3201
|
+
Ve(c) && (he.value += 1);
|
|
3202
3202
|
}
|
|
3203
|
-
function De(
|
|
3204
|
-
|
|
3203
|
+
function De(c) {
|
|
3204
|
+
Ve(c) && (c.preventDefault(), c.dataTransfer && (c.dataTransfer.dropEffect = "copy"));
|
|
3205
3205
|
}
|
|
3206
|
-
function
|
|
3207
|
-
|
|
3206
|
+
function Re(c) {
|
|
3207
|
+
Ve(c) && (he.value = Math.max(0, he.value - 1));
|
|
3208
3208
|
}
|
|
3209
|
-
function
|
|
3210
|
-
var
|
|
3211
|
-
if (
|
|
3212
|
-
|
|
3213
|
-
const
|
|
3214
|
-
|
|
3209
|
+
function Oe(c) {
|
|
3210
|
+
var K, le;
|
|
3211
|
+
if (!Ve(c)) return;
|
|
3212
|
+
c.preventDefault(), he.value = 0;
|
|
3213
|
+
const M = (le = (K = c.dataTransfer) == null ? void 0 : K.files) == null ? void 0 : le[0];
|
|
3214
|
+
M && Ae(M);
|
|
3215
3215
|
}
|
|
3216
|
-
function
|
|
3217
|
-
F(
|
|
3216
|
+
function Ue(c) {
|
|
3217
|
+
F(c), a("selection-change", c);
|
|
3218
3218
|
}
|
|
3219
|
-
function
|
|
3220
|
-
return
|
|
3219
|
+
function Le(c) {
|
|
3220
|
+
return c.status !== "invalid";
|
|
3221
3221
|
}
|
|
3222
|
-
async function
|
|
3222
|
+
async function Ee() {
|
|
3223
3223
|
try {
|
|
3224
|
-
const
|
|
3225
|
-
if (!
|
|
3226
|
-
if (a("processed",
|
|
3227
|
-
const
|
|
3224
|
+
const c = await ue();
|
|
3225
|
+
if (!c) return;
|
|
3226
|
+
if (a("processed", c), c.stopped) {
|
|
3227
|
+
const M = c.total - c.success - c.failed;
|
|
3228
3228
|
fe.warning(
|
|
3229
|
-
`已停止:成功 ${
|
|
3229
|
+
`已停止:成功 ${c.success} 行,失败 ${c.failed} 行,剩余 ${M} 行未处理(可再次「开始处理」续跑)`
|
|
3230
3230
|
);
|
|
3231
|
-
} else
|
|
3232
|
-
} catch (
|
|
3233
|
-
fe.error(
|
|
3231
|
+
} else c.failed === 0 ? fe.success(`全部处理完成,共 ${c.success} 行`) : fe.warning(`处理完成:成功 ${c.success} 行,失败 ${c.failed} 行`);
|
|
3232
|
+
} catch (c) {
|
|
3233
|
+
fe.error(c instanceof Error ? c.message : String(c));
|
|
3234
3234
|
}
|
|
3235
3235
|
}
|
|
3236
|
-
function
|
|
3237
|
-
return !x.value && (
|
|
3236
|
+
function Pe(c) {
|
|
3237
|
+
return !x.value && (c.status === "invalid" || c.status === "failed");
|
|
3238
3238
|
}
|
|
3239
|
-
const
|
|
3240
|
-
function
|
|
3241
|
-
|
|
3239
|
+
const ze = Y(!1), ge = Y(null);
|
|
3240
|
+
function We(c) {
|
|
3241
|
+
Pe(c) && (ge.value = c, ze.value = !0);
|
|
3242
3242
|
}
|
|
3243
|
-
async function
|
|
3244
|
-
var
|
|
3245
|
-
a("row-update",
|
|
3243
|
+
async function He(c) {
|
|
3244
|
+
var M;
|
|
3245
|
+
a("row-update", c), await Ke(), (M = w.value) == null || M.toggleRowSelection(c, !0), fe.success(`第 ${c.rowNumber} 行已修正,可重新处理`);
|
|
3246
3246
|
}
|
|
3247
|
-
async function
|
|
3248
|
-
if (
|
|
3247
|
+
async function Je(c) {
|
|
3248
|
+
if (Pe(c)) {
|
|
3249
3249
|
try {
|
|
3250
|
-
await
|
|
3251
|
-
`确定删除第 ${
|
|
3250
|
+
await kt.confirm(
|
|
3251
|
+
`确定删除第 ${c.rowNumber} 行吗?删除后不可恢复。`,
|
|
3252
3252
|
"删除数据行",
|
|
3253
3253
|
{ type: "warning", confirmButtonText: "删除", cancelButtonText: "取消" }
|
|
3254
3254
|
);
|
|
3255
3255
|
} catch {
|
|
3256
3256
|
return;
|
|
3257
3257
|
}
|
|
3258
|
-
E(
|
|
3258
|
+
E(c), a("row-remove", c), fe.success(`已删除第 ${c.rowNumber} 行`);
|
|
3259
3259
|
}
|
|
3260
3260
|
}
|
|
3261
|
-
return
|
|
3262
|
-
const
|
|
3263
|
-
return n(),
|
|
3261
|
+
return m({ openFilePicker: pe, startProcessing: Ee, stopProcessing: de, clear: ee }), (c, M) => {
|
|
3262
|
+
const K = C("el-button"), le = C("el-progress"), i = C("el-table-column"), J = C("el-tag"), re = C("el-table"), _e = pt("loading");
|
|
3263
|
+
return n(), g("div", {
|
|
3264
3264
|
class: "yk-import-excel",
|
|
3265
|
-
onDragenter:
|
|
3265
|
+
onDragenter: qe,
|
|
3266
3266
|
onDragover: De,
|
|
3267
|
-
onDragleave:
|
|
3268
|
-
onDrop:
|
|
3267
|
+
onDragleave: Re,
|
|
3268
|
+
onDrop: Oe
|
|
3269
3269
|
}, [
|
|
3270
|
-
|
|
3270
|
+
y("input", {
|
|
3271
3271
|
ref_key: "fileInputRef",
|
|
3272
|
-
ref:
|
|
3272
|
+
ref: d,
|
|
3273
3273
|
class: "yk-import-excel__file",
|
|
3274
3274
|
type: "file",
|
|
3275
3275
|
accept: l.accept,
|
|
3276
|
-
onChange:
|
|
3277
|
-
}, null, 40,
|
|
3278
|
-
|
|
3279
|
-
|
|
3276
|
+
onChange: Fe
|
|
3277
|
+
}, null, 40, Dn),
|
|
3278
|
+
y("div", En, [
|
|
3279
|
+
p(K, {
|
|
3280
3280
|
type: "primary",
|
|
3281
|
-
loading:
|
|
3281
|
+
loading: u(f),
|
|
3282
3282
|
onClick: pe
|
|
3283
3283
|
}, {
|
|
3284
|
-
default: o(() => [...
|
|
3285
|
-
|
|
3284
|
+
default: o(() => [...M[1] || (M[1] = [
|
|
3285
|
+
V(" 选择 Excel 文件 ", -1)
|
|
3286
3286
|
])]),
|
|
3287
3287
|
_: 1
|
|
3288
3288
|
}, 8, ["loading"]),
|
|
3289
|
-
|
|
3289
|
+
p(K, {
|
|
3290
3290
|
type: "success",
|
|
3291
|
-
loading:
|
|
3292
|
-
disabled:
|
|
3293
|
-
onClick:
|
|
3291
|
+
loading: u(x),
|
|
3292
|
+
disabled: u(s) === 0,
|
|
3293
|
+
onClick: Ee
|
|
3294
3294
|
}, {
|
|
3295
3295
|
default: o(() => [
|
|
3296
|
-
|
|
3296
|
+
V(" 开始处理" + z(u(s) > 0 ? `(${u(s)} 行)` : ""), 1)
|
|
3297
3297
|
]),
|
|
3298
3298
|
_: 1
|
|
3299
3299
|
}, 8, ["loading", "disabled"]),
|
|
3300
|
-
|
|
3300
|
+
u(x) ? (n(), h(K, {
|
|
3301
3301
|
key: 0,
|
|
3302
3302
|
type: "danger",
|
|
3303
|
-
disabled:
|
|
3304
|
-
onClick:
|
|
3303
|
+
disabled: u(S),
|
|
3304
|
+
onClick: u(de)
|
|
3305
3305
|
}, {
|
|
3306
3306
|
default: o(() => [
|
|
3307
|
-
|
|
3307
|
+
V(z(u(S) ? "正在停止…" : "停止"), 1)
|
|
3308
3308
|
]),
|
|
3309
3309
|
_: 1
|
|
3310
|
-
}, 8, ["disabled", "onClick"])) :
|
|
3311
|
-
|
|
3312
|
-
disabled: !
|
|
3313
|
-
onClick:
|
|
3310
|
+
}, 8, ["disabled", "onClick"])) : R("", !0),
|
|
3311
|
+
p(K, {
|
|
3312
|
+
disabled: !u(_) || u(x),
|
|
3313
|
+
onClick: u(ee)
|
|
3314
3314
|
}, {
|
|
3315
|
-
default: o(() => [...
|
|
3316
|
-
|
|
3315
|
+
default: o(() => [...M[2] || (M[2] = [
|
|
3316
|
+
V("清空", -1)
|
|
3317
3317
|
])]),
|
|
3318
3318
|
_: 1
|
|
3319
3319
|
}, 8, ["disabled", "onClick"]),
|
|
3320
|
-
|
|
3320
|
+
u(r) ? (n(), g("span", {
|
|
3321
3321
|
key: 1,
|
|
3322
3322
|
class: "yk-import-excel__file-name",
|
|
3323
|
-
title:
|
|
3323
|
+
title: u(r)
|
|
3324
3324
|
}, [
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
], 64)) :
|
|
3329
|
-
], 8,
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
])) :
|
|
3325
|
+
V(" 📄 " + z(u(r)), 1),
|
|
3326
|
+
u($) ? (n(), g(L, { key: 0 }, [
|
|
3327
|
+
V("(工作表:" + z(u($)) + ")", 1)
|
|
3328
|
+
], 64)) : R("", !0)
|
|
3329
|
+
], 8, In)) : R("", !0),
|
|
3330
|
+
u(_) ? (n(), g("div", Tn, [
|
|
3331
|
+
y("span", Qn, "共 " + z(u(k).length) + " 行", 1),
|
|
3332
|
+
y("span", Yn, "已选 " + z(u(G)), 1),
|
|
3333
|
+
y("span", Nn, "校验失败 " + z(u(N)), 1)
|
|
3334
|
+
])) : R("", !0)
|
|
3335
3335
|
]),
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
percentage:
|
|
3336
|
+
u(x) ? (n(), g("div", qn, [
|
|
3337
|
+
p(le, {
|
|
3338
|
+
percentage: W.value,
|
|
3339
3339
|
"stroke-width": 14,
|
|
3340
3340
|
"text-inside": "",
|
|
3341
|
-
format:
|
|
3341
|
+
format: oe,
|
|
3342
3342
|
class: "yk-import-excel__progress-bar"
|
|
3343
3343
|
}, null, 8, ["percentage"]),
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3344
|
+
y("span", On, [
|
|
3345
|
+
V(" 成功 " + z(u(A)), 1),
|
|
3346
|
+
y("span", Un, " / 失败 " + z(u(b)), 1)
|
|
3347
3347
|
]),
|
|
3348
|
-
|
|
3349
|
-
])) :
|
|
3350
|
-
|
|
3351
|
-
|
|
3348
|
+
y("span", Ln, z(ke.value), 1)
|
|
3349
|
+
])) : R("", !0),
|
|
3350
|
+
Xe((n(), g("div", Hn, [
|
|
3351
|
+
u(_) ? (n(), h(re, {
|
|
3352
3352
|
key: 0,
|
|
3353
3353
|
ref_key: "tableRef",
|
|
3354
|
-
ref:
|
|
3355
|
-
data:
|
|
3354
|
+
ref: w,
|
|
3355
|
+
data: u(k),
|
|
3356
3356
|
height: "100%",
|
|
3357
3357
|
"row-key": "rowNumber",
|
|
3358
3358
|
border: "",
|
|
3359
3359
|
stripe: "",
|
|
3360
|
-
onSelectionChange:
|
|
3360
|
+
onSelectionChange: Ue
|
|
3361
3361
|
}, {
|
|
3362
3362
|
default: o(() => [
|
|
3363
|
-
|
|
3363
|
+
p(i, {
|
|
3364
3364
|
type: "selection",
|
|
3365
3365
|
width: "44",
|
|
3366
3366
|
fixed: "left",
|
|
3367
|
-
selectable:
|
|
3367
|
+
selectable: Le
|
|
3368
3368
|
}),
|
|
3369
|
-
|
|
3369
|
+
p(i, {
|
|
3370
3370
|
label: "行号",
|
|
3371
3371
|
width: "70",
|
|
3372
3372
|
align: "center",
|
|
3373
3373
|
fixed: "left"
|
|
3374
3374
|
}, {
|
|
3375
|
-
default: o(({ row:
|
|
3376
|
-
|
|
3377
|
-
title: `Excel 第 ${
|
|
3378
|
-
},
|
|
3375
|
+
default: o(({ row: X, $index: be }) => [
|
|
3376
|
+
y("span", {
|
|
3377
|
+
title: `Excel 第 ${X.rowNumber} 行`
|
|
3378
|
+
}, z(be + 1), 9, Kn)
|
|
3379
3379
|
]),
|
|
3380
3380
|
_: 1
|
|
3381
3381
|
}),
|
|
3382
|
-
(n(!0),
|
|
3383
|
-
key:
|
|
3384
|
-
label:
|
|
3382
|
+
(n(!0), g(L, null, te(l.columns, (X) => (n(), h(i, {
|
|
3383
|
+
key: X.name,
|
|
3384
|
+
label: X.name,
|
|
3385
3385
|
"min-width": "120",
|
|
3386
3386
|
"show-overflow-tooltip": ""
|
|
3387
3387
|
}, {
|
|
3388
|
-
default: o(({ row:
|
|
3389
|
-
|
|
3388
|
+
default: o(({ row: be }) => [
|
|
3389
|
+
V(z(u(Vt)(be.data[X.name])), 1)
|
|
3390
3390
|
]),
|
|
3391
3391
|
_: 2
|
|
3392
3392
|
}, 1032, ["label"]))), 128)),
|
|
3393
|
-
|
|
3393
|
+
p(i, {
|
|
3394
3394
|
label: "状态",
|
|
3395
3395
|
width: "200",
|
|
3396
3396
|
fixed: "right",
|
|
3397
3397
|
"class-name": "yk-import-excel__status-cell",
|
|
3398
|
-
filters:
|
|
3398
|
+
filters: se.value,
|
|
3399
3399
|
"filter-method": D,
|
|
3400
3400
|
"filter-multiple": !1,
|
|
3401
3401
|
"filter-placement": "bottom-end"
|
|
3402
3402
|
}, {
|
|
3403
|
-
default: o(({ row:
|
|
3404
|
-
|
|
3405
|
-
type:
|
|
3403
|
+
default: o(({ row: X }) => [
|
|
3404
|
+
p(J, {
|
|
3405
|
+
type: j[X.status].type,
|
|
3406
3406
|
size: "small",
|
|
3407
3407
|
"disable-transitions": ""
|
|
3408
3408
|
}, {
|
|
3409
3409
|
default: o(() => [
|
|
3410
|
-
|
|
3411
|
-
|
|
3410
|
+
X.status === "processing" ? (n(), g("span", jn)) : R("", !0),
|
|
3411
|
+
V(" " + z(j[X.status].label), 1)
|
|
3412
3412
|
]),
|
|
3413
3413
|
_: 2
|
|
3414
3414
|
}, 1032, ["type"]),
|
|
3415
|
-
|
|
3415
|
+
X.status === "invalid" ? (n(), g("div", Gn, z(X.errors.join(";")), 1)) : X.message ? (n(), g("div", Wn, z(X.message), 1)) : R("", !0)
|
|
3416
3416
|
]),
|
|
3417
3417
|
_: 1
|
|
3418
3418
|
}, 8, ["filters"]),
|
|
3419
|
-
|
|
3419
|
+
p(i, {
|
|
3420
3420
|
label: "操作",
|
|
3421
3421
|
width: "110",
|
|
3422
3422
|
fixed: "right",
|
|
3423
3423
|
align: "center"
|
|
3424
3424
|
}, {
|
|
3425
|
-
default: o(({ row:
|
|
3426
|
-
|
|
3427
|
-
|
|
3425
|
+
default: o(({ row: X }) => [
|
|
3426
|
+
Pe(X) ? (n(), g(L, { key: 0 }, [
|
|
3427
|
+
p(K, {
|
|
3428
3428
|
link: "",
|
|
3429
3429
|
type: "primary",
|
|
3430
3430
|
size: "small",
|
|
3431
|
-
onClick: (
|
|
3431
|
+
onClick: (be) => We(X)
|
|
3432
3432
|
}, {
|
|
3433
|
-
default: o(() => [...
|
|
3434
|
-
|
|
3433
|
+
default: o(() => [...M[3] || (M[3] = [
|
|
3434
|
+
y("svg", {
|
|
3435
3435
|
class: "yk-import-excel__action-icon",
|
|
3436
3436
|
viewBox: "0 0 24 24",
|
|
3437
3437
|
fill: "none",
|
|
@@ -3441,21 +3441,21 @@ const Sn = /* @__PURE__ */ ee({
|
|
|
3441
3441
|
"stroke-linejoin": "round",
|
|
3442
3442
|
"aria-hidden": "true"
|
|
3443
3443
|
}, [
|
|
3444
|
-
|
|
3445
|
-
|
|
3444
|
+
y("path", { d: "M12 20h9" }),
|
|
3445
|
+
y("path", { d: "M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z" })
|
|
3446
3446
|
], -1),
|
|
3447
|
-
|
|
3447
|
+
V(" 编辑 ", -1)
|
|
3448
3448
|
])]),
|
|
3449
3449
|
_: 1
|
|
3450
3450
|
}, 8, ["onClick"]),
|
|
3451
|
-
|
|
3451
|
+
p(K, {
|
|
3452
3452
|
link: "",
|
|
3453
3453
|
type: "danger",
|
|
3454
3454
|
size: "small",
|
|
3455
|
-
onClick: (
|
|
3455
|
+
onClick: (be) => Je(X)
|
|
3456
3456
|
}, {
|
|
3457
|
-
default: o(() => [...
|
|
3458
|
-
|
|
3457
|
+
default: o(() => [...M[4] || (M[4] = [
|
|
3458
|
+
y("svg", {
|
|
3459
3459
|
class: "yk-import-excel__action-icon",
|
|
3460
3460
|
viewBox: "0 0 24 24",
|
|
3461
3461
|
fill: "none",
|
|
@@ -3465,81 +3465,311 @@ const Sn = /* @__PURE__ */ ee({
|
|
|
3465
3465
|
"stroke-linejoin": "round",
|
|
3466
3466
|
"aria-hidden": "true"
|
|
3467
3467
|
}, [
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3468
|
+
y("polyline", { points: "3 6 5 6 21 6" }),
|
|
3469
|
+
y("path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" }),
|
|
3470
|
+
y("line", {
|
|
3471
3471
|
x1: "10",
|
|
3472
3472
|
y1: "11",
|
|
3473
3473
|
x2: "10",
|
|
3474
3474
|
y2: "17"
|
|
3475
3475
|
}),
|
|
3476
|
-
|
|
3476
|
+
y("line", {
|
|
3477
3477
|
x1: "14",
|
|
3478
3478
|
y1: "11",
|
|
3479
3479
|
x2: "14",
|
|
3480
3480
|
y2: "17"
|
|
3481
3481
|
})
|
|
3482
3482
|
], -1),
|
|
3483
|
-
|
|
3483
|
+
V(" 删除 ", -1)
|
|
3484
3484
|
])]),
|
|
3485
3485
|
_: 1
|
|
3486
3486
|
}, 8, ["onClick"])
|
|
3487
|
-
], 64)) : (n(),
|
|
3487
|
+
], 64)) : (n(), g("span", Jn, "—"))
|
|
3488
3488
|
]),
|
|
3489
3489
|
_: 1
|
|
3490
3490
|
})
|
|
3491
3491
|
]),
|
|
3492
3492
|
_: 1
|
|
3493
|
-
}, 8, ["data"])) : (n(),
|
|
3493
|
+
}, 8, ["data"])) : (n(), g("div", {
|
|
3494
3494
|
key: 1,
|
|
3495
3495
|
class: "yk-import-excel__empty",
|
|
3496
3496
|
onClick: pe
|
|
3497
3497
|
}, [
|
|
3498
|
-
|
|
3499
|
-
|
|
3498
|
+
M[5] || (M[5] = nt('<svg class="yk-import-excel__empty-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-2d035039><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" data-v-2d035039></path><polyline points="14 2 14 8 20 8" data-v-2d035039></polyline><path d="M12 18v-6" data-v-2d035039></path><polyline points="9.5 14.5 12 12l2.5 2.5" data-v-2d035039></polyline></svg><p class="yk-import-excel__empty-title" data-v-2d035039>点击选择 Excel 文件,或将文件拖拽到此处</p>', 2)),
|
|
3499
|
+
y("p", Xn, "支持 " + z(l.accept) + " 格式,首行需为表头", 1)
|
|
3500
3500
|
]))
|
|
3501
3501
|
])), [
|
|
3502
|
-
[
|
|
3502
|
+
[_e, u(f)]
|
|
3503
3503
|
]),
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
])])) :
|
|
3507
|
-
|
|
3508
|
-
visible:
|
|
3509
|
-
"onUpdate:visible":
|
|
3510
|
-
row:
|
|
3504
|
+
we.value ? (n(), g("div", Zn, [...M[6] || (M[6] = [
|
|
3505
|
+
nt('<div class="yk-import-excel__drop-tip" data-v-2d035039><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-2d035039><path d="M12 15V3" data-v-2d035039></path><polyline points="7 8 12 3 17 8" data-v-2d035039></polyline><path d="M3 15v4a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-4" data-v-2d035039></path></svg><span data-v-2d035039>松开鼠标,加载 Excel 文件</span></div>', 1)
|
|
3506
|
+
])])) : R("", !0),
|
|
3507
|
+
p(Bn, {
|
|
3508
|
+
visible: ze.value,
|
|
3509
|
+
"onUpdate:visible": M[0] || (M[0] = (X) => ze.value = X),
|
|
3510
|
+
row: ge.value,
|
|
3511
3511
|
columns: l.columns,
|
|
3512
|
-
saver:
|
|
3513
|
-
onSaved:
|
|
3512
|
+
saver: u(q),
|
|
3513
|
+
onSaved: He
|
|
3514
3514
|
}, null, 8, ["visible", "row", "columns", "saver"])
|
|
3515
3515
|
], 32);
|
|
3516
3516
|
};
|
|
3517
3517
|
}
|
|
3518
|
-
}),
|
|
3518
|
+
}), to = /* @__PURE__ */ ae(eo, [["__scopeId", "data-v-2d035039"]]), ut = "ys-modal-style";
|
|
3519
|
+
function lo() {
|
|
3520
|
+
if (document.getElementById(ut)) return;
|
|
3521
|
+
const e = document.createElement("style");
|
|
3522
|
+
e.id = ut, e.textContent = [
|
|
3523
|
+
// 固定高度:height 由内联 CSS 变量 --ys-modal-height 传入(每个弹窗可不同)。
|
|
3524
|
+
// .el-dialog 设为 flex column,body 区 flex:1 + overflow:auto,
|
|
3525
|
+
// 内容超出时在弹窗内纵向滚动,不会撑大弹窗。
|
|
3526
|
+
".ys-modal-dialog--fixed-height{height:var(--ys-modal-height);display:flex;flex-direction:column}",
|
|
3527
|
+
".ys-modal-dialog--fixed-height .el-dialog__body{flex:1;min-height:0;overflow:auto}",
|
|
3528
|
+
// 注意:不要给 .el-dialog__header 加 position:relative——
|
|
3529
|
+
// EP 默认 header 是 static,关闭按钮 .el-dialog__headerbtn 相对 .el-dialog(relative)
|
|
3530
|
+
// 定位;一旦 header 变 relative,关闭按钮包含块改变(多出 header padding 偏移),
|
|
3531
|
+
// 导致「有最大化按钮时关闭按钮位置与无最大化时不一致」。
|
|
3532
|
+
// 最大化按钮同样 absolute,会自动跳过 static 的 header、以 .el-dialog 为包含块,
|
|
3533
|
+
// 与关闭按钮处于完全相同的坐标系。
|
|
3534
|
+
// 最大化 height 用 !important 覆盖固定高度模式(最大化优先铺满视口)
|
|
3535
|
+
".ys-modal-dialog--maximized{--el-dialog-margin-top:0!important;width:100%!important;max-width:100%!important;margin-bottom:0!important;height:100vh!important;display:flex;flex-direction:column}",
|
|
3536
|
+
".ys-modal-dialog--maximized .el-dialog__body{flex:1;min-height:0;overflow:auto}",
|
|
3537
|
+
// 与 EP 关闭按钮同一包含块(.el-dialog)、同一基线(top:0/right:0):
|
|
3538
|
+
// 关闭热区 48x48,最大化按钮右移 48+4=52px 紧贴其左侧
|
|
3539
|
+
".ys-modal-header__maximize{position:absolute;right:52px;top:0;width:48px;height:48px;padding:0;border:none;background:transparent;cursor:pointer;color:var(--el-color-info);display:inline-flex;align-items:center;justify-content:center;border-radius:4px}",
|
|
3540
|
+
".ys-modal-header__maximize:hover{background:var(--el-fill-color-light);color:var(--el-color-primary)}",
|
|
3541
|
+
// EP 关闭图标在其 48px 热区中视觉中心偏上 2px(受其 line-height 影响),
|
|
3542
|
+
// 补偿使两个图标的视觉中心完全水平对齐
|
|
3543
|
+
".ys-modal-header__maximize svg{display:block;margin-top:-2px}"
|
|
3544
|
+
].join(""), document.head.appendChild(e);
|
|
3545
|
+
}
|
|
3546
|
+
function no() {
|
|
3547
|
+
return ye(
|
|
3548
|
+
"svg",
|
|
3549
|
+
{
|
|
3550
|
+
viewBox: "0 0 24 24",
|
|
3551
|
+
width: 16,
|
|
3552
|
+
height: 16,
|
|
3553
|
+
fill: "none",
|
|
3554
|
+
stroke: "currentColor",
|
|
3555
|
+
"stroke-width": 2,
|
|
3556
|
+
"stroke-linecap": "round",
|
|
3557
|
+
"stroke-linejoin": "round"
|
|
3558
|
+
},
|
|
3559
|
+
[ye("rect", { x: 4, y: 4, width: 16, height: 16, rx: 2 })]
|
|
3560
|
+
);
|
|
3561
|
+
}
|
|
3562
|
+
function oo() {
|
|
3563
|
+
return ye(
|
|
3564
|
+
"svg",
|
|
3565
|
+
{
|
|
3566
|
+
viewBox: "0 0 24 24",
|
|
3567
|
+
width: 16,
|
|
3568
|
+
height: 16,
|
|
3569
|
+
fill: "none",
|
|
3570
|
+
stroke: "currentColor",
|
|
3571
|
+
"stroke-width": 2,
|
|
3572
|
+
"stroke-linecap": "round",
|
|
3573
|
+
"stroke-linejoin": "round"
|
|
3574
|
+
},
|
|
3575
|
+
[
|
|
3576
|
+
ye("rect", { x: 8, y: 8, width: 12, height: 12, rx: 2 }),
|
|
3577
|
+
ye("path", { d: "M4 16V6a2 2 0 0 1 2-2h10" })
|
|
3578
|
+
]
|
|
3579
|
+
);
|
|
3580
|
+
}
|
|
3581
|
+
function ao(e) {
|
|
3582
|
+
var E;
|
|
3583
|
+
const {
|
|
3584
|
+
title: m = "",
|
|
3585
|
+
width: t = "500px",
|
|
3586
|
+
height: l,
|
|
3587
|
+
component: a,
|
|
3588
|
+
props: k,
|
|
3589
|
+
actions: r,
|
|
3590
|
+
onCancel: $,
|
|
3591
|
+
onClosed: f,
|
|
3592
|
+
closeOnClickModal: x = !1,
|
|
3593
|
+
closeOnPressEscape: S = !1,
|
|
3594
|
+
maximizable: P = !1,
|
|
3595
|
+
defaultMaximized: H = !1,
|
|
3596
|
+
appContext: A
|
|
3597
|
+
} = e;
|
|
3598
|
+
(P || l != null) && lo();
|
|
3599
|
+
const b = l == null ? void 0 : typeof l == "number" ? `${l}px` : l, _ = document.createElement("div");
|
|
3600
|
+
document.body.appendChild(_);
|
|
3601
|
+
let N = null, T = !1, U;
|
|
3602
|
+
const G = () => {
|
|
3603
|
+
T || (T = !0, ot(null, _), _.remove());
|
|
3604
|
+
}, s = {
|
|
3605
|
+
close: () => U == null ? void 0 : U.close(),
|
|
3606
|
+
toggleMaximize: () => U == null ? void 0 : U.toggleMaximize(),
|
|
3607
|
+
isMaximized: () => (U == null ? void 0 : U.isMaximized()) ?? !1,
|
|
3608
|
+
getContentInstance: () => N
|
|
3609
|
+
}, v = Z({
|
|
3610
|
+
name: "YsModalHost",
|
|
3611
|
+
setup(ue, { expose: de }) {
|
|
3612
|
+
const ee = Y(!0), w = Y(-1), d = Y(P && H), j = () => {
|
|
3613
|
+
P && (d.value = !d.value);
|
|
3614
|
+
}, se = () => {
|
|
3615
|
+
ee.value = !1;
|
|
3616
|
+
}, D = () => {
|
|
3617
|
+
w.value >= 0 || ($ == null || $(), ee.value = !1);
|
|
3618
|
+
}, I = async (B, O) => {
|
|
3619
|
+
if (!(w.value >= 0)) {
|
|
3620
|
+
w.value = O;
|
|
3621
|
+
try {
|
|
3622
|
+
await B.execute(s, N);
|
|
3623
|
+
} finally {
|
|
3624
|
+
w.value = -1;
|
|
3625
|
+
}
|
|
3626
|
+
}
|
|
3627
|
+
};
|
|
3628
|
+
return de({ close: se, toggleMaximize: j, isMaximized: () => d.value }), () => ye(
|
|
3629
|
+
Jt,
|
|
3630
|
+
{
|
|
3631
|
+
// Element Plus 2.x 显隐规范:modelValue + update:modelValue
|
|
3632
|
+
modelValue: ee.value,
|
|
3633
|
+
"onUpdate:modelValue": (B) => {
|
|
3634
|
+
B || D();
|
|
3635
|
+
},
|
|
3636
|
+
title: P ? void 0 : m,
|
|
3637
|
+
width: t,
|
|
3638
|
+
// 最大化时贴顶(配合样式中 --el-dialog-margin-top:0)
|
|
3639
|
+
top: d.value ? "0vh" : void 0,
|
|
3640
|
+
// 最大化 class 优先(height:100vh!important 覆盖固定高度);
|
|
3641
|
+
// 否则若设置了 height 则用固定高度 class + CSS 变量
|
|
3642
|
+
class: d.value ? "ys-modal-dialog--maximized" : b ? "ys-modal-dialog--fixed-height" : void 0,
|
|
3643
|
+
// 固定高度值通过 CSS 变量传递(每个弹窗可不同)
|
|
3644
|
+
style: b && !d.value ? { "--ys-modal-height": b } : void 0,
|
|
3645
|
+
closeOnClickModal: x,
|
|
3646
|
+
closeOnPressEscape: S,
|
|
3647
|
+
// 动作执行中隐藏右上角 ✕,与底部其余按钮禁用保持一致
|
|
3648
|
+
showClose: w.value < 0,
|
|
3649
|
+
destroyOnClose: !0,
|
|
3650
|
+
onClosed: () => {
|
|
3651
|
+
f == null || f(), G();
|
|
3652
|
+
}
|
|
3653
|
+
},
|
|
3654
|
+
{
|
|
3655
|
+
// maximizable 时接管 header 插槽:标题 span + 最大化按钮。
|
|
3656
|
+
// 不额外包裹 div——span 直接作为 header 子元素,与 EP 默认
|
|
3657
|
+
// 标题结构一致,避免 block 包裹改变标题的行盒/换行行为;
|
|
3658
|
+
// 按钮 absolute 脱离文档流,以 .el-dialog 为包含块定位。
|
|
3659
|
+
// EP 的 ✕ 关闭按钮渲染在插槽内容之外,自动保留且定位不受影响。
|
|
3660
|
+
header: P ? () => [
|
|
3661
|
+
ye("span", { class: "el-dialog__title" }, m),
|
|
3662
|
+
ye(
|
|
3663
|
+
"button",
|
|
3664
|
+
{
|
|
3665
|
+
type: "button",
|
|
3666
|
+
class: "ys-modal-header__maximize",
|
|
3667
|
+
title: d.value ? "还原" : "最大化",
|
|
3668
|
+
"aria-label": d.value ? "还原" : "最大化",
|
|
3669
|
+
onClick: j
|
|
3670
|
+
},
|
|
3671
|
+
d.value ? oo() : no()
|
|
3672
|
+
)
|
|
3673
|
+
] : void 0,
|
|
3674
|
+
default: () => ye(a, {
|
|
3675
|
+
...k ?? {},
|
|
3676
|
+
// 注入关闭监听器:内容组件 defineEmits(["close"]) 后
|
|
3677
|
+
// emit("close") 即可关闭;无需在业务 props 里声明。
|
|
3678
|
+
// 注意 onClose 在 props 展开之后,业务 props 里的 onClose
|
|
3679
|
+
// 会被注入值覆盖(关闭行为不交给业务侧)
|
|
3680
|
+
onClose: se,
|
|
3681
|
+
ref: (B) => {
|
|
3682
|
+
N = B;
|
|
3683
|
+
}
|
|
3684
|
+
}),
|
|
3685
|
+
footer: () => r != null && r.length ? r.map(
|
|
3686
|
+
(B, O) => ye(
|
|
3687
|
+
Xt,
|
|
3688
|
+
{
|
|
3689
|
+
key: B.name,
|
|
3690
|
+
// 与 commandBar 同构:'default' 归一化为 undefined
|
|
3691
|
+
type: B.type === "default" ? void 0 : B.type,
|
|
3692
|
+
title: B.desc,
|
|
3693
|
+
// 执行中:当前动作 loading,其余动作禁用
|
|
3694
|
+
disabled: w.value >= 0 && w.value !== O,
|
|
3695
|
+
loading: w.value === O,
|
|
3696
|
+
onClick: () => I(B, O)
|
|
3697
|
+
},
|
|
3698
|
+
{
|
|
3699
|
+
default: () => [
|
|
3700
|
+
// 与模板 <component :is> 行为对齐:VNode 原样嵌入、组件 h() 渲染;
|
|
3701
|
+
// 外包 span 提供与 commandBar 图标一致的间距(teleport 内容无法用 scoped 样式命中)
|
|
3702
|
+
B.icon ? ye(
|
|
3703
|
+
"span",
|
|
3704
|
+
{
|
|
3705
|
+
style: "margin-right:4px;display:inline-flex;align-items:center;vertical-align:-2px"
|
|
3706
|
+
},
|
|
3707
|
+
[zt(B.icon) ? B.icon : ye(B.icon)]
|
|
3708
|
+
) : null,
|
|
3709
|
+
B.desc
|
|
3710
|
+
]
|
|
3711
|
+
}
|
|
3712
|
+
)
|
|
3713
|
+
) : null
|
|
3714
|
+
}
|
|
3715
|
+
);
|
|
3716
|
+
}
|
|
3717
|
+
}), F = p(v), q = A ?? Gt();
|
|
3718
|
+
return q || console.warn(
|
|
3719
|
+
"[openModal] 未检测到 AppContext:弹窗内的全局组件(如 el-form)与 inject 将不可用。请在应用入口 app.use(YsCrudElementPlus),或调用 openModal 时传入 appContext(getCurrentInstance()?.appContext)。"
|
|
3720
|
+
), F.appContext = q, ot(F, _), U = (E = F.component) == null ? void 0 : E.exposed, s;
|
|
3721
|
+
}
|
|
3722
|
+
function po(e) {
|
|
3723
|
+
const {
|
|
3724
|
+
confirmText: m = "确定",
|
|
3725
|
+
cancelText: t = "取消",
|
|
3726
|
+
confirmType: l = "primary",
|
|
3727
|
+
onConfirm: a,
|
|
3728
|
+
...k
|
|
3729
|
+
} = e;
|
|
3730
|
+
return ao({ ...k, actions: [
|
|
3731
|
+
{ name: "cancel", desc: t, execute: ($) => $.close() },
|
|
3732
|
+
{
|
|
3733
|
+
name: "confirm",
|
|
3734
|
+
desc: m,
|
|
3735
|
+
type: l,
|
|
3736
|
+
execute: async ($, f) => {
|
|
3737
|
+
if (!a) {
|
|
3738
|
+
$.close();
|
|
3739
|
+
return;
|
|
3740
|
+
}
|
|
3741
|
+
await a($, f) !== !1 && $.close();
|
|
3742
|
+
}
|
|
3743
|
+
}
|
|
3744
|
+
] });
|
|
3745
|
+
}
|
|
3746
|
+
const mo = {
|
|
3519
3747
|
install(e) {
|
|
3520
|
-
e.component("YsTable",
|
|
3748
|
+
Wt(e._context), e.component("YsTable", _t), e.component("YsTableActionMenuButton", bt), e.component("YsCommandBar", ht), e.component("YsMainPanel", tn), e.component("YsFilterPanel", $t), e.component("YsTextFilterItem", $n), e.component("YsDateFilterItem", Vn), e.component("YsDateRangeFilterItem", Fn), e.component("YsEnumFilterItem", Mn), e.component("YsFilterItemLayout", Ye), e.component("YsAdvancedFilterPanel", St), e.component("YsAdvancedValueEditor", wt), e.component("YsAdvancedConditionGroup", Ct), e.component("YsTablePage", Pn), e.component("YsImportExcel", to);
|
|
3521
3749
|
}
|
|
3522
3750
|
};
|
|
3523
3751
|
export {
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3752
|
+
Ct as YsAdvancedConditionGroup,
|
|
3753
|
+
St as YsAdvancedFilterPanel,
|
|
3754
|
+
wt as YsAdvancedValueEditor,
|
|
3755
|
+
ht as YsCommandBar,
|
|
3756
|
+
Vn as YsDateFilterItem,
|
|
3757
|
+
Fn as YsDateRangeFilterItem,
|
|
3758
|
+
Mn as YsEnumFilterItem,
|
|
3759
|
+
Ye as YsFilterItemLayout,
|
|
3760
|
+
$t as YsFilterPanel,
|
|
3761
|
+
to as YsImportExcel,
|
|
3762
|
+
tn as YsMainPanel,
|
|
3763
|
+
_t as YsTable,
|
|
3764
|
+
bt as YsTableActionMenuButton,
|
|
3765
|
+
Pn as YsTablePage,
|
|
3766
|
+
$n as YsTextFilterItem,
|
|
3767
|
+
mo as default,
|
|
3768
|
+
yo as fromArray,
|
|
3769
|
+
go as fromBool,
|
|
3770
|
+
ko as fromObjectItems,
|
|
3771
|
+
_o as fromOptions,
|
|
3772
|
+
po as openDialog,
|
|
3773
|
+
ao as openModal
|
|
3544
3774
|
};
|
|
3545
3775
|
//# sourceMappingURL=index.js.map
|