@web-utils/form-ui 1.0.0-beta51 → 1.0.0-beta52
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/chunks/{eae6huQB.mjs → B1k8ydde.mjs} +2 -2
- package/chunks/{B1IPSTA6.mjs → B75qfA0z.mjs} +2 -2
- package/chunks/{pIzhYsBe.mjs → BAw6wxW1.mjs} +2 -2
- package/chunks/{B9gA65rt2.mjs → BSU2FqMP2.mjs} +2 -2
- package/chunks/{DA7oGHSX.mjs → BXVB-H8_.mjs} +2 -2
- package/chunks/B_RAcbs_.mjs +108 -0
- package/chunks/{BtcjAHE6.mjs → BshE3RnA.mjs} +2 -2
- package/chunks/{CuAoMR3n.mjs → C6hLXCPk.mjs} +5 -16
- package/chunks/{CAd1zK9Q.mjs → CBFbSsTJ.mjs} +2 -2
- package/chunks/CGDnQr1c.mjs +67 -0
- package/chunks/CGHcOyNC2.mjs +87 -0
- package/chunks/{ByHz4mmh.mjs → CVKPpQdS.mjs} +2 -2
- package/chunks/{BG8z3V9d2.mjs → CjRZ71IY2.mjs} +47 -178
- package/chunks/CkjtCuMs.mjs +416 -0
- package/chunks/{D_Fs3bkZ.mjs → CtHmTtVP.mjs} +2 -2
- package/chunks/{V2p-PCpL.mjs → CzHaJsnD.mjs} +3 -3
- package/chunks/{Bwbtu2cp.mjs → D2MB3CnR.mjs} +2 -2
- package/chunks/{D_qiRmiE.mjs → D3mFJzGr.mjs} +32 -26
- package/chunks/{BbSPWDDZ.mjs → DLgFBI_X.mjs} +2 -2
- package/chunks/{BfxDxIg0.mjs → DVbw6xIr.mjs} +2 -2
- package/chunks/{BQk3-Ppb2.mjs → DZJ-ShZA2.mjs} +38 -39
- package/chunks/{CqVd8D222.mjs → DcFllKOf2.mjs} +2 -2
- package/chunks/DhVmHzB7.mjs +653 -0
- package/chunks/{6yfBZFOB.mjs → DitpKWMd.mjs} +4 -3
- package/chunks/{bFbPPcdq.mjs → DkXlFWjs.mjs} +2 -2
- package/chunks/{DKwp6AMl.mjs → GMFHxPJq.mjs} +2 -2
- package/chunks/{BqWvBF14.mjs → JKFepPeL.mjs} +2 -2
- package/chunks/{CJdkjadi.mjs → KuAMIZnG.mjs} +1 -1
- package/chunks/{BBERmTup.mjs → XoImEoke.mjs} +19 -4
- package/chunks/{wXeqV-_7.mjs → eBESsR-G.mjs} +2 -2
- package/chunks/{CabldOLo.mjs → v-O82KSn.mjs} +4 -3
- package/element-dialog/index.d.ts +2 -2
- package/form-cascader/index.d.ts +8 -2
- package/form-cascader/index.mjs +1 -1
- package/form-checkbox/index.d.ts +8 -2
- package/form-checkbox/index.mjs +1 -1
- package/form-checkbox-group/index.d.ts +8 -2
- package/form-checkbox-group/index.mjs +1 -1
- package/form-date-picker/index.d.ts +8 -2
- package/form-date-picker/index.mjs +1 -1
- package/form-image/index.d.ts +8 -2
- package/form-image/index.mjs +1 -1
- package/form-input/index.d.ts +8 -2
- package/form-input/index.mjs +1 -1
- package/form-input-cron-expression/index.d.ts +8 -2
- package/form-input-cron-expression/index.mjs +1 -1
- package/form-input-email/index.d.ts +8 -2
- package/form-input-email/index.mjs +1 -1
- package/form-input-id-card/index.d.ts +8 -2
- package/form-input-id-card/index.mjs +1 -1
- package/form-input-number/index.d.ts +8 -2
- package/form-input-number/index.mjs +1 -1
- package/form-input-phone-number/index.d.ts +8 -2
- package/form-input-phone-number/index.mjs +1 -1
- package/form-input-tag/index.d.ts +8 -2
- package/form-input-tag/index.mjs +1 -1
- package/form-input-time/index.d.ts +8 -2
- package/form-input-time/index.mjs +1 -1
- package/form-item-group/index.mjs +1 -1
- package/form-item-x/index.d.ts +8 -2
- package/form-item-x/index.mjs +1 -1
- package/form-radio-group/index.d.ts +8 -2
- package/form-radio-group/index.mjs +1 -1
- package/form-rate/index.d.ts +8 -2
- package/form-rate/index.mjs +1 -1
- package/form-select/index.d.ts +8 -2
- package/form-select/index.mjs +1 -1
- package/form-slider/index.d.ts +8 -2
- package/form-slider/index.mjs +1 -1
- package/form-switch/index.d.ts +8 -2
- package/form-switch/index.mjs +1 -1
- package/form-table/index.d.ts +43 -25
- package/form-table/index.mjs +1 -1
- package/form-table-plus/index.d.ts +8 -8
- package/form-table-plus/index.mjs +1 -1
- package/form-text/index.d.ts +8 -2
- package/form-text/index.mjs +1 -1
- package/form-textarea/index.d.ts +12 -12
- package/form-textarea/index.mjs +1 -1
- package/form-time-select/index.d.ts +8 -2
- package/form-time-select/index.mjs +1 -1
- package/helper/sub-table-plus.d.ts +38 -0
- package/helper/sub-table-plus.mjs +4 -0
- package/index.mjs +29 -29
- package/package.json +1 -1
- package/pageable-table/index.d.ts +11 -11
- package/pageable-table/index.mjs +1 -1
- package/sub-table/index.d.ts +36 -30
- package/sub-table/index.mjs +2 -537
- package/sub-table-plus/index.d.ts +11 -2
- package/sub-table-plus/index.mjs +1 -1
- package/table-column/index.d.ts +8 -5
- package/table-column/index.mjs +1 -1
- package/table-column-def/index.d.ts +14 -12
- package/table-column-def/index.mjs +1 -1
- package/table-view/index.d.ts +4 -0
- package/table-view/index.mjs +13 -5
- package/web-types.json +1 -1
- package/chunks/BsZgAJX_2.mjs +0 -81
- package/chunks/YFiU0ngn.mjs +0 -622
- package/chunks/gCeDFHo1.mjs +0 -32
- package/chunks/hlha6Bhc.mjs +0 -107
- package/chunks/wDS9KBFw.mjs +0 -67
|
@@ -0,0 +1,416 @@
|
|
|
1
|
+
import e from "../confirmable/index.mjs";
|
|
2
|
+
import t from "../confirm-button/index.mjs";
|
|
3
|
+
import { t as n } from "./DOZRzqlo.mjs";
|
|
4
|
+
import { t as r } from "./Dt3lfDnL.mjs";
|
|
5
|
+
import { t as i } from "./CkOD-_VV.mjs";
|
|
6
|
+
import { n as a } from "./D3mFJzGr.mjs";
|
|
7
|
+
import { t as o } from "./D2MB3CnR.mjs";
|
|
8
|
+
import { t as s } from "./v-O82KSn.mjs";
|
|
9
|
+
import { t as c } from "./CzHaJsnD.mjs";
|
|
10
|
+
import { t as l } from "./B75qfA0z.mjs";
|
|
11
|
+
import { t as u } from "./DLgFBI_X.mjs";
|
|
12
|
+
import { t as d } from "./DkXlFWjs.mjs";
|
|
13
|
+
import { t as f } from "./BshE3RnA.mjs";
|
|
14
|
+
import { t as p } from "./DhVmHzB7.mjs";
|
|
15
|
+
import m from "../table-column-def/index.mjs";
|
|
16
|
+
import { t as h } from "./C6hLXCPk.mjs";
|
|
17
|
+
import { findTreeChildren as g, isFunction as _ } from "@web-utils/core";
|
|
18
|
+
import { Fragment as v, createBlock as y, createCommentVNode as b, createElementBlock as x, createElementVNode as S, createSlots as C, createTextVNode as w, createVNode as T, mergeProps as E, openBlock as D, renderList as O, renderSlot as k, resolveComponent as A, toDisplayString as j, withCtx as M, withModifiers as N } from "vue";
|
|
19
|
+
import { formContextKey as P, formItemContextKey as F } from "element-plus";
|
|
20
|
+
import { cloneDeep as I } from "@web-utils/integrations/lodash";
|
|
21
|
+
//#region src/components/table/sub-table.ts
|
|
22
|
+
var L = {
|
|
23
|
+
modelValue: Array,
|
|
24
|
+
columns: Array,
|
|
25
|
+
allowEmpty: Boolean,
|
|
26
|
+
handleColumn: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: !0
|
|
29
|
+
},
|
|
30
|
+
editable: Boolean,
|
|
31
|
+
showHandleColumnAddButton: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
default: !0
|
|
34
|
+
},
|
|
35
|
+
showEmptyAddButton: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
default: !0
|
|
38
|
+
},
|
|
39
|
+
prop: String,
|
|
40
|
+
limit: {
|
|
41
|
+
type: Number,
|
|
42
|
+
default: Infinity
|
|
43
|
+
},
|
|
44
|
+
maxLimit: {
|
|
45
|
+
type: Number,
|
|
46
|
+
default: Infinity
|
|
47
|
+
},
|
|
48
|
+
disabled: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: void 0
|
|
51
|
+
},
|
|
52
|
+
showSummary: Boolean,
|
|
53
|
+
selectionWidth: String,
|
|
54
|
+
fetchApi: Function,
|
|
55
|
+
delApi: Function
|
|
56
|
+
}, R = {
|
|
57
|
+
name: "SubTable",
|
|
58
|
+
emits: {
|
|
59
|
+
...a,
|
|
60
|
+
"add-row": null
|
|
61
|
+
},
|
|
62
|
+
inject: {
|
|
63
|
+
elForm: {
|
|
64
|
+
from: P,
|
|
65
|
+
default: ""
|
|
66
|
+
},
|
|
67
|
+
elFormItem: {
|
|
68
|
+
from: F,
|
|
69
|
+
default: ""
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
props: { ...L },
|
|
73
|
+
data() {
|
|
74
|
+
return {
|
|
75
|
+
rows: [],
|
|
76
|
+
selectedRows: []
|
|
77
|
+
};
|
|
78
|
+
},
|
|
79
|
+
computed: {
|
|
80
|
+
available() {
|
|
81
|
+
return this.editable && this.enabled;
|
|
82
|
+
},
|
|
83
|
+
enabled() {
|
|
84
|
+
return !this.disabled;
|
|
85
|
+
},
|
|
86
|
+
rowProps() {
|
|
87
|
+
let e = {};
|
|
88
|
+
return this.columns && this.columns.map((e) => e.prop).forEach((t) => {
|
|
89
|
+
e[t] = null;
|
|
90
|
+
}), e;
|
|
91
|
+
},
|
|
92
|
+
filteredColumns() {
|
|
93
|
+
return this.columns.filter((e) => e.label && !e.hide && !e.slot);
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
watch: {
|
|
97
|
+
modelValue: {
|
|
98
|
+
deep: !0,
|
|
99
|
+
immediate: !0,
|
|
100
|
+
handler(e) {
|
|
101
|
+
this.rows = e || [];
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
rows: {
|
|
105
|
+
deep: !0,
|
|
106
|
+
immediate: !0,
|
|
107
|
+
handler(e) {
|
|
108
|
+
this.$emit("update:modelValue", e);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
methods: {
|
|
113
|
+
getCellType(e, t) {
|
|
114
|
+
return _(t.getType) ? t.getType(e, t) : t.type;
|
|
115
|
+
},
|
|
116
|
+
getInputAttr(e, t, n) {
|
|
117
|
+
var r;
|
|
118
|
+
let i = {
|
|
119
|
+
...t.attrs,
|
|
120
|
+
...t.getAttrs ? t.getAttrs(e) : {}
|
|
121
|
+
};
|
|
122
|
+
return i.modelValue = e[t.prop], i.label = t.label, i.wrapCol = !1, i.required = t.required, i.disabled = (r = t.isDisabled) == null ? void 0 : r.call(t, e), i.prop = `${this.prop}[${n}].${t.prop}`, this.getCellType(e, t) === "select" ? i.options = t.options : this.getCellType(e, t) === "textarea" ? i.rows = t.rows || "3" : this.getCellType(e, t) === "cascader" ? (i.labelKey = t.labelKey, i.valueKey = t.valueKey) : this.getCellType(e, t) === "department" && (i.ouType = t.ouType), i;
|
|
123
|
+
},
|
|
124
|
+
isInputDisabled(e, t) {
|
|
125
|
+
return t.isDisabled && t.isDisabled(e);
|
|
126
|
+
},
|
|
127
|
+
onInput(e, t, n) {
|
|
128
|
+
n.setValue ? n.setValue(e, t, n, this.rows) : e[n.prop] = t;
|
|
129
|
+
},
|
|
130
|
+
onSelectionChange(e) {
|
|
131
|
+
this.selectedRows = e;
|
|
132
|
+
},
|
|
133
|
+
remove(e, t) {
|
|
134
|
+
try {
|
|
135
|
+
this.rows.splice(t, 1);
|
|
136
|
+
} catch {}
|
|
137
|
+
},
|
|
138
|
+
add(e, t) {
|
|
139
|
+
let n = I(this.rowProps);
|
|
140
|
+
this.rows.splice(t + 1, 0, n);
|
|
141
|
+
},
|
|
142
|
+
addRow() {
|
|
143
|
+
this.$emit("add-row");
|
|
144
|
+
},
|
|
145
|
+
async delRow() {
|
|
146
|
+
if (!this.selectedRows.length) {
|
|
147
|
+
this.$message.warning("请选择要删除的记录!");
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
try {
|
|
151
|
+
if (this.delApi) try {
|
|
152
|
+
await this.delApi(this.selectedRows.map((e) => e.id).join(",")), this.refresh();
|
|
153
|
+
} catch {
|
|
154
|
+
this.$message.error("删除失败!");
|
|
155
|
+
}
|
|
156
|
+
else this.$emit("update:modelValue", this.rows.filter((e) => !this.selectedRows.includes(e)));
|
|
157
|
+
this.$message.success("删除成功!");
|
|
158
|
+
} catch {}
|
|
159
|
+
},
|
|
160
|
+
refresh() {
|
|
161
|
+
this.$refs.table.getPage();
|
|
162
|
+
},
|
|
163
|
+
getVal(e, t, n) {
|
|
164
|
+
var r, i;
|
|
165
|
+
if (n.type === "select" && (r = n.attrs) != null && r.options) {
|
|
166
|
+
let r = n.attrs.options.find((n) => n.code === e[t.property]);
|
|
167
|
+
if (r) return r.name;
|
|
168
|
+
}
|
|
169
|
+
if (n.type === "cascader" && (i = n.attrs) != null && i.options) {
|
|
170
|
+
let [r] = g(n.attrs.options, (r) => r[n.attrs.valueKey || "value"] === e[t.property]);
|
|
171
|
+
if (r) return r[n.attrs.valueKey || "label"];
|
|
172
|
+
}
|
|
173
|
+
return e[t.property];
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}, z = {
|
|
177
|
+
key: 0,
|
|
178
|
+
class: "table-header"
|
|
179
|
+
}, B = {
|
|
180
|
+
key: 0,
|
|
181
|
+
style: { color: "#f56c6c" }
|
|
182
|
+
}, V = ["onClick"];
|
|
183
|
+
function H(i, a, g, _, P, F) {
|
|
184
|
+
let I = r, L = t, R = s, H = d, U = A("FormInputUser"), W = A("FormInputDepartment"), G = f, K = l, q = o, J = c, Y = u, X = h, Z = n, Q = m, $ = e, ee = p;
|
|
185
|
+
return D(), y(ee, E({
|
|
186
|
+
ref: "table",
|
|
187
|
+
class: "sub-table",
|
|
188
|
+
"auto-height": "",
|
|
189
|
+
data: P.rows,
|
|
190
|
+
api: i.fetchApi,
|
|
191
|
+
"show-summary": i.showSummary,
|
|
192
|
+
"selection-width": i.selectionWidth
|
|
193
|
+
}, i.$attrs, {
|
|
194
|
+
"hide-on-single-page": "",
|
|
195
|
+
selection: F.enabled,
|
|
196
|
+
"row-db-click": i.rowDbClick,
|
|
197
|
+
onSelectionChange: F.onSelectionChange
|
|
198
|
+
}), C({
|
|
199
|
+
default: M(() => [
|
|
200
|
+
k(i.$slots, "columns", { columns: i.columns }, () => [(D(!0), x(v, null, O(F.filteredColumns, (e) => (D(), y(Q, {
|
|
201
|
+
key: e.prop,
|
|
202
|
+
label: e.label,
|
|
203
|
+
width: e.width,
|
|
204
|
+
"dict-type": e.dictType,
|
|
205
|
+
clickable: e.clickable,
|
|
206
|
+
align: e.align,
|
|
207
|
+
prop: e.prop,
|
|
208
|
+
options: e.options,
|
|
209
|
+
"show-overflow-tooltip": !F.available && e.showOverflowTooltip
|
|
210
|
+
}, {
|
|
211
|
+
header: M(() => [!i.disabled && e.required ? (D(), x("span", B, "*")) : b("v-if", !0), w(" " + j(e.label), 1)]),
|
|
212
|
+
default: M(({ row: t, column: n, $index: r }) => [
|
|
213
|
+
b("tag 插槽"),
|
|
214
|
+
k(i.$slots, "tag", {
|
|
215
|
+
row: t,
|
|
216
|
+
column: n,
|
|
217
|
+
index: r
|
|
218
|
+
}),
|
|
219
|
+
b("列默认插槽,名字和 prop 保持一致"),
|
|
220
|
+
k(i.$slots, e.prop, {
|
|
221
|
+
row: t,
|
|
222
|
+
column: n,
|
|
223
|
+
index: r
|
|
224
|
+
}, () => {
|
|
225
|
+
var i;
|
|
226
|
+
return [F.available ? (D(), x(v, { key: 0 }, [F.getCellType(t, e) === "input" ? (D(), y(R, E({
|
|
227
|
+
key: 0,
|
|
228
|
+
ref_for: !0
|
|
229
|
+
}, F.getInputAttr(t, e, r), { onInput: (n) => F.onInput(t, n, e) }), null, 16, ["onInput"])) : F.getCellType(t, e) === "inputPhoneNumber" ? (D(), y(H, E({
|
|
230
|
+
key: 1,
|
|
231
|
+
ref_for: !0
|
|
232
|
+
}, F.getInputAttr(t, e, r), { onInput: (n) => F.onInput(t, n, e) }), null, 16, ["onInput"])) : F.getCellType(t, e) === "user" ? (D(), x(v, { key: 2 }, [e.single ? (D(), y(U, E({
|
|
233
|
+
key: 0,
|
|
234
|
+
ref_for: !0
|
|
235
|
+
}, F.getInputAttr(t, e, r), { onInput: (n) => F.onInput(t, n, e) }), null, 16, ["onInput"])) : (D(), y(U, E({
|
|
236
|
+
key: 1,
|
|
237
|
+
ref_for: !0
|
|
238
|
+
}, F.getInputAttr(t, e, r), { onInput: (n) => F.onInput(t, n, e) }), null, 16, ["onInput"]))], 64)) : F.getCellType(t, e) === "department" ? (D(), x(v, { key: 3 }, [e.single ? (D(), y(W, E({
|
|
239
|
+
key: 0,
|
|
240
|
+
ref_for: !0
|
|
241
|
+
}, F.getInputAttr(t, e, r), {
|
|
242
|
+
name: t[n.property],
|
|
243
|
+
"onUpdate:name": (e) => t[n.property] = e,
|
|
244
|
+
onInput: (n) => F.onInput(t, n, e)
|
|
245
|
+
}), null, 16, [
|
|
246
|
+
"name",
|
|
247
|
+
"onUpdate:name",
|
|
248
|
+
"onInput"
|
|
249
|
+
])) : (D(), y(W, E({
|
|
250
|
+
key: 1,
|
|
251
|
+
ref_for: !0
|
|
252
|
+
}, F.getInputAttr(t, e, r), {
|
|
253
|
+
disabled: F.isInputDisabled(t, e),
|
|
254
|
+
onInput: (n) => F.onInput(t, n, e)
|
|
255
|
+
}), null, 16, ["disabled", "onInput"]))], 64)) : F.getCellType(t, e) === "select" ? (D(), y(G, E({
|
|
256
|
+
key: 4,
|
|
257
|
+
ref_for: !0
|
|
258
|
+
}, F.getInputAttr(t, e, r), { onInput: (n) => F.onInput(t, n, e) }), null, 16, ["onInput"])) : F.getCellType(t, e) === "datePicker" ? (D(), y(K, E({
|
|
259
|
+
key: 5,
|
|
260
|
+
ref_for: !0
|
|
261
|
+
}, F.getInputAttr(t, e, r), {
|
|
262
|
+
start: t[e.start],
|
|
263
|
+
"onUpdate:start": (n) => t[e.start] = n,
|
|
264
|
+
end: t[e.end],
|
|
265
|
+
"onUpdate:end": (n) => t[e.end] = n,
|
|
266
|
+
onInput: (n) => F.onInput(t, n, e)
|
|
267
|
+
}), null, 16, [
|
|
268
|
+
"start",
|
|
269
|
+
"onUpdate:start",
|
|
270
|
+
"end",
|
|
271
|
+
"onUpdate:end",
|
|
272
|
+
"onInput"
|
|
273
|
+
])) : F.getCellType(t, e) === "cascader" ? (D(), y(q, E({
|
|
274
|
+
key: 6,
|
|
275
|
+
ref_for: !0
|
|
276
|
+
}, F.getInputAttr(t, e, r), { onInput: (n) => F.onInput(t, n, e) }), null, 16, ["onInput"])) : F.getCellType(t, e) === "checkbox" ? (D(), y(J, E({
|
|
277
|
+
key: 7,
|
|
278
|
+
ref_for: !0
|
|
279
|
+
}, F.getInputAttr(t, e, r), { onInput: (n) => F.onInput(t, n, e) }), null, 16, ["onInput"])) : F.getCellType(t, e) === "number" ? (D(), y(Y, E({
|
|
280
|
+
key: 8,
|
|
281
|
+
ref_for: !0
|
|
282
|
+
}, F.getInputAttr(t, e, r), { onInput: (n) => F.onInput(t, n, e) }), null, 16, ["onInput"])) : F.getCellType(t, e) === "textarea" ? (D(), y(X, E({
|
|
283
|
+
key: 9,
|
|
284
|
+
ref_for: !0
|
|
285
|
+
}, F.getInputAttr(t, e, r), { onInput: (n) => F.onInput(t, n, e) }), null, 16, ["onInput"])) : (D(), x(v, { key: 10 }, [w(j(F.getVal(t, n, e)), 1)], 64))], 64)) : e.dicType || (i = e.options) != null && i.length ? (D(), y(Z, {
|
|
286
|
+
key: 1,
|
|
287
|
+
"dict-type": e.dicType,
|
|
288
|
+
"id-as-value": e.idAsValue,
|
|
289
|
+
"label-as-value": e.labelAsValue,
|
|
290
|
+
column: n,
|
|
291
|
+
row: t,
|
|
292
|
+
options: e.options
|
|
293
|
+
}, null, 8, [
|
|
294
|
+
"dict-type",
|
|
295
|
+
"id-as-value",
|
|
296
|
+
"label-as-value",
|
|
297
|
+
"column",
|
|
298
|
+
"row",
|
|
299
|
+
"options"
|
|
300
|
+
])) : (D(), x(v, { key: 2 }, [w(j(F.getVal(t, n, e)), 1)], 64))];
|
|
301
|
+
})
|
|
302
|
+
]),
|
|
303
|
+
_: 2
|
|
304
|
+
}, 1032, [
|
|
305
|
+
"label",
|
|
306
|
+
"width",
|
|
307
|
+
"dict-type",
|
|
308
|
+
"clickable",
|
|
309
|
+
"align",
|
|
310
|
+
"prop",
|
|
311
|
+
"options",
|
|
312
|
+
"show-overflow-tooltip"
|
|
313
|
+
]))), 128))]),
|
|
314
|
+
b(" 自定义操作列 "),
|
|
315
|
+
k(i.$slots, "handle", {
|
|
316
|
+
add: F.add,
|
|
317
|
+
remove: F.remove
|
|
318
|
+
}),
|
|
319
|
+
b(" 操作列 "),
|
|
320
|
+
(!i.modelValue || i.modelValue.length < i.limit) && !i.disabled && F.enabled && i.editable && i.handleColumn ? (D(), y(Q, {
|
|
321
|
+
key: 0,
|
|
322
|
+
label: "操作",
|
|
323
|
+
fixed: "right",
|
|
324
|
+
width: "80",
|
|
325
|
+
align: "center",
|
|
326
|
+
prop: "menu"
|
|
327
|
+
}, {
|
|
328
|
+
header: M(({ column: e, $index: t }) => [k(i.$slots, "handle-column-header", {
|
|
329
|
+
column: e,
|
|
330
|
+
index: t
|
|
331
|
+
}, () => [w(j(e.label), 1)])]),
|
|
332
|
+
default: M(({ row: e, $index: t }) => [i.showHandleColumnAddButton && i.modelValue.length < i.maxLimit ? (D(), x("i", {
|
|
333
|
+
key: 0,
|
|
334
|
+
class: "el-icon-circle-plus sub-table-handle-button table-button-add",
|
|
335
|
+
style: {
|
|
336
|
+
"margin-right": "5px",
|
|
337
|
+
"font-size": "20px",
|
|
338
|
+
cursor: "pointer"
|
|
339
|
+
},
|
|
340
|
+
title: "添加",
|
|
341
|
+
onClick: N((n) => F.add(e, t), ["stop"])
|
|
342
|
+
}, null, 8, V)) : b("v-if", !0), i.modelValue && i.modelValue.length > 1 || i.allowEmpty ? (D(), y($, {
|
|
343
|
+
key: 1,
|
|
344
|
+
class: "el-icon-error sub-table-handle-button table-button-remove",
|
|
345
|
+
style: {
|
|
346
|
+
"font-size": "20px",
|
|
347
|
+
cursor: "pointer"
|
|
348
|
+
},
|
|
349
|
+
title: "删除",
|
|
350
|
+
message: "您确定要删除该行吗?",
|
|
351
|
+
onClick: N((n) => F.remove(e, t), ["stop"])
|
|
352
|
+
}, null, 8, ["onClick"])) : b("v-if", !0)]),
|
|
353
|
+
_: 3
|
|
354
|
+
})) : b("v-if", !0)
|
|
355
|
+
]),
|
|
356
|
+
_: 2
|
|
357
|
+
}, [i.editable ? void 0 : {
|
|
358
|
+
name: "toolbar",
|
|
359
|
+
fn: M(() => [F.enabled || i.fetchApi ? (D(), x("div", z, [k(i.$slots, "toolbar", {
|
|
360
|
+
addRow: F.addRow,
|
|
361
|
+
delRow: F.delRow,
|
|
362
|
+
refresh: F.refresh
|
|
363
|
+
}, () => [F.enabled ? (D(), x(v, { key: 0 }, [T(I, {
|
|
364
|
+
class: "table-header-button add",
|
|
365
|
+
icon: "el-icon-circle-plus",
|
|
366
|
+
type: "text",
|
|
367
|
+
onClick: F.addRow
|
|
368
|
+
}, {
|
|
369
|
+
default: M(() => [...a[1] || (a[1] = [w(" 添加 ", -1)])]),
|
|
370
|
+
_: 1
|
|
371
|
+
}, 8, ["onClick"]), T(L, {
|
|
372
|
+
class: "table-header-button remove",
|
|
373
|
+
message: "您确定要删除选中的记录吗?",
|
|
374
|
+
icon: "el-icon-error",
|
|
375
|
+
type: "text",
|
|
376
|
+
onClick: F.delRow
|
|
377
|
+
}, {
|
|
378
|
+
default: M(() => [...a[2] || (a[2] = [w(" 删除 ", -1)])]),
|
|
379
|
+
_: 1
|
|
380
|
+
}, 8, ["onClick"])], 64)) : b("v-if", !0), i.fetchApi ? (D(), y(I, {
|
|
381
|
+
key: 1,
|
|
382
|
+
class: "table-header-button refresh",
|
|
383
|
+
icon: "el-icon-refresh-left",
|
|
384
|
+
type: "text",
|
|
385
|
+
disabled: !1,
|
|
386
|
+
onClick: F.refresh
|
|
387
|
+
}, {
|
|
388
|
+
default: M(() => [...a[3] || (a[3] = [w(" 刷新 ", -1)])]),
|
|
389
|
+
_: 1
|
|
390
|
+
}, 8, ["onClick"])) : b("v-if", !0)])])) : b("v-if", !0)]),
|
|
391
|
+
key: "0"
|
|
392
|
+
}, i.allowEmpty && !i.disabled && i.showEmptyAddButton ? {
|
|
393
|
+
name: "empty",
|
|
394
|
+
fn: M(() => [S("i", {
|
|
395
|
+
class: "el-icon-circle-plus sub-table-handle-button table-button-add",
|
|
396
|
+
style: {
|
|
397
|
+
"font-size": "20px",
|
|
398
|
+
cursor: "pointer"
|
|
399
|
+
},
|
|
400
|
+
title: "添加",
|
|
401
|
+
onClick: a[0] || (a[0] = N((e) => F.add(null, 0), ["stop"]))
|
|
402
|
+
})]),
|
|
403
|
+
key: "1"
|
|
404
|
+
} : void 0]), 1040, [
|
|
405
|
+
"data",
|
|
406
|
+
"api",
|
|
407
|
+
"show-summary",
|
|
408
|
+
"selection-width",
|
|
409
|
+
"selection",
|
|
410
|
+
"row-db-click",
|
|
411
|
+
"onSelectionChange"
|
|
412
|
+
]);
|
|
413
|
+
}
|
|
414
|
+
var U = /* @__PURE__ */ i(R, [["render", H]]);
|
|
415
|
+
//#endregion
|
|
416
|
+
export { L as n, U as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as e, n as t } from "./
|
|
2
|
-
import { n, t as r } from "./
|
|
1
|
+
import { i as e, n as t } from "./D3mFJzGr.mjs";
|
|
2
|
+
import { n, t as r } from "./KuAMIZnG.mjs";
|
|
3
3
|
import { t as i } from "./C7G-cAoI.mjs";
|
|
4
4
|
import { createVNode as a, mergeProps as o, ref as s } from "vue";
|
|
5
5
|
import { ElInput as c, ElPopover as l } from "element-plus/es";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { i as e, n as t } from "./
|
|
2
|
-
import { n } from "./
|
|
1
|
+
import { i as e, n as t } from "./D3mFJzGr.mjs";
|
|
2
|
+
import { n } from "./KuAMIZnG.mjs";
|
|
3
3
|
import { useDictionary as r } from "../hook/useDictionary.mjs";
|
|
4
|
-
import { t as i } from "./
|
|
4
|
+
import { t as i } from "./v-O82KSn.mjs";
|
|
5
5
|
import { computed as a, createVNode as o, defineComponent as s, isVNode as c, mergeProps as l, useModel as u } from "vue";
|
|
6
6
|
import { ElCheckbox as d, ElCheckboxButton as f, ElCheckboxGroup as p } from "element-plus/es";
|
|
7
7
|
//#region src/components/form/props/checkbox-group.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as e, n as t } from "./
|
|
2
|
-
import { n, t as r } from "./
|
|
1
|
+
import { i as e, n as t } from "./D3mFJzGr.mjs";
|
|
2
|
+
import { n, t as r } from "./KuAMIZnG.mjs";
|
|
3
3
|
import { useDictionary as i } from "../hook/useDictionary.mjs";
|
|
4
4
|
import { findTreeChildren as a, isArray as o, isString as s, setParent as c } from "@web-utils/core";
|
|
5
5
|
import { computed as l, createVNode as u, mergeProps as d } from "vue";
|
|
@@ -37,7 +37,10 @@ var S = {
|
|
|
37
37
|
default: !0
|
|
38
38
|
},
|
|
39
39
|
fixedSpan: Number,
|
|
40
|
-
block:
|
|
40
|
+
block: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: void 0
|
|
43
|
+
},
|
|
41
44
|
unwrap: Boolean,
|
|
42
45
|
half: Boolean,
|
|
43
46
|
formItemClass: String,
|
|
@@ -100,18 +103,18 @@ var S = {
|
|
|
100
103
|
return l(() => e.required === !0 ? !0 : (t == null ? void 0 : t.requiredFieldsMap[e.prop]) === !0);
|
|
101
104
|
}, j = (e, t) => {
|
|
102
105
|
c(t) ? e.push(t) : o(t) ? e.push(...t) : s(t) && e.push(t);
|
|
103
|
-
}, M = (e, { rules: t, attrs: n,
|
|
104
|
-
let
|
|
106
|
+
}, M = (e, { rules: t, attrs: n, block: r, class: i, messagePrefix: a, message: o } = {}) => {
|
|
107
|
+
let s = A(e);
|
|
105
108
|
return l(() => {
|
|
106
|
-
let
|
|
109
|
+
let c = { message: o }, l = h(t);
|
|
107
110
|
Object.keys({
|
|
108
111
|
...S,
|
|
109
112
|
...E
|
|
110
113
|
}).forEach((t) => {
|
|
111
|
-
t === "rules" ? e[t] &&
|
|
114
|
+
t === "rules" ? e[t] && l ? c[t] = [...e[t], ...l] : e[t] ? c[t] = e[t] : l && (c[t] = l) : t === "messagePrefix" ? c[t] = e.messagePrefix || a : t === "block" ? c[t] = r ?? e.block : c[t] = e[t];
|
|
112
115
|
});
|
|
113
|
-
let
|
|
114
|
-
return j(
|
|
116
|
+
let u = [];
|
|
117
|
+
return j(u, h(n == null ? void 0 : n.class)), j(u, h(i)), c.required = s.value, c.class = u, c.style = n == null ? void 0 : n.style, c;
|
|
115
118
|
});
|
|
116
119
|
}, N = {
|
|
117
120
|
name: "FormItemX",
|
|
@@ -203,27 +206,30 @@ var S = {
|
|
|
203
206
|
error: r.error,
|
|
204
207
|
tips: r.tips,
|
|
205
208
|
below: r.below
|
|
206
|
-
}) : t, z = (r, { emit: i, slots: a,
|
|
207
|
-
let
|
|
208
|
-
rules:
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
209
|
+
}) : t, z = (r, { emit: i, slots: a, events: o, predicate: s, removeOn: c = !1, attrs: u, block: f, class: p, rules: m, messagePrefix: h = "请输入", extraFormItemProps: g }) => {
|
|
210
|
+
let v = F(r), y = l(() => v.value ? "" : `${h}${r.label}`), b = M(r, {
|
|
211
|
+
rules: m,
|
|
212
|
+
block: f === void 0 ? r.type === "textarea" && r.block === void 0 ? !0 : r.block : f,
|
|
213
|
+
attrs: u,
|
|
214
|
+
class: p,
|
|
215
|
+
message: y.value,
|
|
216
|
+
messagePrefix: h,
|
|
217
|
+
...g
|
|
218
|
+
}), x = (e) => L(i, e), S = (e) => r.col ? d(_, { span: r.block ? 24 : r.span }, { default: () => e }) : e, C = ({ vNodes: e }) => R(r, {
|
|
219
|
+
vNodes: S(e),
|
|
220
|
+
formItemProps: b,
|
|
215
221
|
slots: a,
|
|
216
|
-
disabled:
|
|
217
|
-
}),
|
|
222
|
+
disabled: v
|
|
223
|
+
}), w = l(() => t(r, s, o, i)), T = n({ removeOn: c });
|
|
218
224
|
return {
|
|
219
|
-
emitInput:
|
|
220
|
-
render:
|
|
221
|
-
placeholder:
|
|
222
|
-
disabled:
|
|
223
|
-
formItemProps:
|
|
224
|
-
autoBind:
|
|
225
|
-
inputProps: e(r,
|
|
226
|
-
listeners:
|
|
225
|
+
emitInput: x,
|
|
226
|
+
render: C,
|
|
227
|
+
placeholder: y,
|
|
228
|
+
disabled: v,
|
|
229
|
+
formItemProps: b,
|
|
230
|
+
autoBind: w,
|
|
231
|
+
inputProps: e(r, s),
|
|
232
|
+
listeners: T
|
|
227
233
|
};
|
|
228
234
|
}, B = (e) => e.icon ? d("i", { class: e.icon }) : null;
|
|
229
235
|
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as e, n as t } from "./
|
|
2
|
-
import { n, t as r } from "./
|
|
1
|
+
import { i as e, n as t } from "./D3mFJzGr.mjs";
|
|
2
|
+
import { n, t as r } from "./KuAMIZnG.mjs";
|
|
3
3
|
import { isString as i } from "@web-utils/core";
|
|
4
4
|
import { computed as a, createVNode as o, mergeProps as s } from "vue";
|
|
5
5
|
import { ElInputNumber as c } from "element-plus/es";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as e, n as t } from "./
|
|
2
|
-
import { n } from "./
|
|
1
|
+
import { i as e, n as t } from "./D3mFJzGr.mjs";
|
|
2
|
+
import { n } from "./KuAMIZnG.mjs";
|
|
3
3
|
import { createVNode as r, mergeProps as i, useModel as a } from "vue";
|
|
4
4
|
import { ElSwitch as o } from "element-plus/es";
|
|
5
5
|
//#region src/components/form/props/switch.ts
|
|
@@ -1,33 +1,30 @@
|
|
|
1
1
|
import { i as e } from "./DcTVYqeJ.mjs";
|
|
2
|
-
import { i as t, n } from "./
|
|
3
|
-
import { n as r, t as i } from "./
|
|
4
|
-
import { r as a } from "./
|
|
5
|
-
import { n as o } from "./
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
import { i as t, n } from "./D3mFJzGr.mjs";
|
|
3
|
+
import { n as r, t as i } from "./KuAMIZnG.mjs";
|
|
4
|
+
import { r as a } from "./v-O82KSn.mjs";
|
|
5
|
+
import { n as o, t as s } from "./CjRZ71IY2.mjs";
|
|
6
|
+
import { isArray as c, isString as l, trace as u, warning as d } from "@web-utils/core";
|
|
7
|
+
import { computed as f, createVNode as p, getCurrentInstance as m, mergeProps as h, useModel as g, useTemplateRef as _ } from "vue";
|
|
8
|
+
import { useEventBus as v } from "@web-utils/vue/hooks/useEventBus";
|
|
9
|
+
//#region src/components/table/form-table-plus.ts
|
|
10
|
+
var y = {
|
|
11
|
+
...r,
|
|
12
|
+
...i,
|
|
13
|
+
...o,
|
|
14
|
+
rowDbClick: Function,
|
|
15
|
+
viewId: [String, Array],
|
|
16
|
+
formPath: [String, Function]
|
|
17
|
+
}, b = {
|
|
18
|
+
readonly: !0,
|
|
19
|
+
block: !0
|
|
20
|
+
}, x = (e) => r[e] === void 0 && b[e] !== !0, S = {
|
|
13
21
|
name: "FormTablePlus",
|
|
14
|
-
props: {
|
|
15
|
-
...r,
|
|
16
|
-
...i,
|
|
17
|
-
...s,
|
|
18
|
-
rowDbClick: Function,
|
|
19
|
-
viewId: [String, Array],
|
|
20
|
-
block: {
|
|
21
|
-
type: Boolean,
|
|
22
|
-
default: !0
|
|
23
|
-
},
|
|
24
|
-
formPath: [String, Function]
|
|
25
|
-
},
|
|
22
|
+
props: { ...y },
|
|
26
23
|
emits: { ...n },
|
|
27
|
-
setup(n, { emit: r, slots: i, attrs:
|
|
28
|
-
let
|
|
24
|
+
setup(n, { emit: r, slots: i, attrs: o, expose: y }) {
|
|
25
|
+
let b = g(n, "modelValue"), S = _("table"), C = [];
|
|
29
26
|
n.viewId && C.push(n.viewId);
|
|
30
|
-
let w =
|
|
27
|
+
let w = m();
|
|
31
28
|
C.includes(w.parent.proxy.$options.name) || C.push(w.parent.proxy.$options.name);
|
|
32
29
|
let T = () => {
|
|
33
30
|
var e;
|
|
@@ -36,27 +33,28 @@ var b = {
|
|
|
36
33
|
var e;
|
|
37
34
|
return await ((e = S.value.table) == null ? void 0 : e.refreshTable());
|
|
38
35
|
};
|
|
39
|
-
|
|
40
|
-
if (C) if (
|
|
36
|
+
v("reloadTableView", (e) => {
|
|
37
|
+
if (C) if (l(e) || c(e)) {
|
|
41
38
|
let t = e;
|
|
42
|
-
|
|
43
|
-
} else
|
|
39
|
+
l(t) && (t = t.split(",")), C.some((e) => t.includes(e)) && (u.call(w.parent.proxy || {}, "reloadTableView"), T());
|
|
40
|
+
} else d.call(w.parent.proxy || {}, "`viewId`的类型必须是字符串或数组");
|
|
44
41
|
});
|
|
45
42
|
let D = (...t) => {
|
|
46
43
|
n.rowDbClick ? n.rowDbClick(...t) : w.proxy.$router.push(e(n.formPath, t[0]));
|
|
47
44
|
}, O = () => {
|
|
48
45
|
w.proxy.$router.push(e(n.formPath));
|
|
49
46
|
}, { render: k, placeholder: A, disabled: j, listeners: M, inputProps: N } = t(n, {
|
|
50
|
-
rules:
|
|
47
|
+
rules: f(() => [n.fetchApi ? {
|
|
51
48
|
required: !0,
|
|
52
49
|
validator: a
|
|
53
50
|
} : { required: !0 }]),
|
|
54
51
|
emit: r,
|
|
55
52
|
slots: i,
|
|
56
|
-
attrs:
|
|
57
|
-
predicate:
|
|
53
|
+
attrs: o,
|
|
54
|
+
predicate: x,
|
|
55
|
+
block: n.block === void 0 ? !0 : n.block
|
|
58
56
|
});
|
|
59
|
-
return
|
|
57
|
+
return y({
|
|
60
58
|
reloadTable: T,
|
|
61
59
|
refreshTable: E
|
|
62
60
|
}), () => {
|
|
@@ -75,12 +73,13 @@ var b = {
|
|
|
75
73
|
});
|
|
76
74
|
};
|
|
77
75
|
}
|
|
78
|
-
return k({ vNodes:
|
|
76
|
+
return k({ vNodes: p(s, h({ ref: "table" }, M.value, N.value, {
|
|
79
77
|
prop: n.prop,
|
|
80
78
|
disabled: j.value,
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
79
|
+
onRowDbClick: D,
|
|
80
|
+
rowDbClick: D,
|
|
81
|
+
modelValue: b.value,
|
|
82
|
+
"onUpdate:modelValue": (e) => b.value = e,
|
|
84
83
|
placeholder: A.value,
|
|
85
84
|
onAddRow: O
|
|
86
85
|
}), {
|
|
@@ -143,4 +142,4 @@ var b = {
|
|
|
143
142
|
}
|
|
144
143
|
};
|
|
145
144
|
//#endregion
|
|
146
|
-
export {
|
|
145
|
+
export { S as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as e, n as t } from "./
|
|
2
|
-
import { n, t as r } from "./
|
|
1
|
+
import { i as e, n as t } from "./D3mFJzGr.mjs";
|
|
2
|
+
import { n, t as r } from "./KuAMIZnG.mjs";
|
|
3
3
|
import { createVNode as i, mergeProps as a } from "vue";
|
|
4
4
|
import { ElTimeSelect as o } from "element-plus/es";
|
|
5
5
|
//#region src/components/form/props/time-select.ts
|