@web-utils/form-ui 1.0.0-beta5 → 1.0.0-beta51
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/api/index.d.ts +60 -0
- package/api/index.mjs +42 -0
- package/awesome-button/index.d.ts +60 -0
- package/awesome-button/index.mjs +49 -0
- package/base.css +1 -1
- package/chunks/6yfBZFOB.mjs +56 -0
- package/chunks/B1IPSTA6.mjs +198 -0
- package/chunks/B9gA65rt2.mjs +38 -0
- package/chunks/BBERmTup.mjs +83 -0
- package/chunks/BG8z3V9d2.mjs +643 -0
- package/chunks/BQk3-Ppb2.mjs +146 -0
- package/chunks/BQyL45PF2.mjs +207 -0
- package/chunks/BWh6u1O0.mjs +660 -0
- package/chunks/BbSPWDDZ.mjs +100 -0
- package/chunks/BfxDxIg0.mjs +106 -0
- package/chunks/BqWvBF14.mjs +35 -0
- package/chunks/BsZgAJX_2.mjs +81 -0
- package/chunks/BtcjAHE6.mjs +317 -0
- package/chunks/Bwbtu2cp.mjs +194 -0
- package/chunks/ByHz4mmh.mjs +87 -0
- package/chunks/C2zgFLYO.mjs +185 -0
- package/chunks/C7G-cAoI.mjs +1361 -0
- package/chunks/CAd1zK9Q.mjs +25 -0
- package/chunks/CJdkjadi.mjs +17 -0
- package/chunks/CXsoKP22.mjs +86 -0
- package/chunks/CabldOLo.mjs +157 -0
- package/chunks/CkOD-_VV.mjs +8 -0
- package/chunks/CqVd8D222.mjs +89 -0
- package/chunks/CuAoMR3n.mjs +105 -0
- package/chunks/DA7oGHSX.mjs +141 -0
- package/chunks/DKwp6AMl.mjs +168 -0
- package/chunks/DOP3aBxf.mjs +93 -0
- package/chunks/DOZRzqlo.mjs +37 -0
- package/chunks/D_Fs3bkZ.mjs +57 -0
- package/chunks/D_qiRmiE.mjs +230 -0
- package/chunks/DcTVYqeJ.mjs +113 -0
- package/chunks/Dt3lfDnL.mjs +166 -0
- package/chunks/GI8krYU82.mjs +478 -0
- package/chunks/V2p-PCpL.mjs +176 -0
- package/chunks/YFiU0ngn.mjs +622 -0
- package/chunks/bFbPPcdq.mjs +25 -0
- package/chunks/eae6huQB.mjs +25 -0
- package/chunks/gCeDFHo1.mjs +32 -0
- package/chunks/gLPy4Sus.mjs +164 -0
- package/chunks/hlha6Bhc.mjs +107 -0
- package/chunks/pIzhYsBe.mjs +93 -0
- package/chunks/wDS9KBFw.mjs +67 -0
- package/chunks/wXeqV-_7.mjs +89 -0
- package/confirm-button/index.d.ts +122 -0
- package/confirm-button/index.mjs +35 -0
- package/confirmable/index.d.ts +93 -0
- package/confirmable/index.mjs +8 -0
- package/constants/index.d.ts +54 -0
- package/constants/index.mjs +4 -0
- package/dict-render/index.d.ts +28 -0
- package/dict-render/index.mjs +2 -0
- package/editable-tree/index.d.ts +254 -0
- package/editable-tree/index.mjs +2 -0
- package/editable-tree/style.css +1 -0
- package/element-dialog/index.d.ts +337 -16
- package/element-dialog/index.mjs +2 -91
- package/element-resize-observer/index.d.ts +8 -0
- package/element-resize-observer/index.mjs +40 -0
- package/element-resize-observer/style.css +1 -0
- package/empty-view/index.d.ts +2 -2
- package/empty-view/index.mjs +1 -1
- package/flex-scroll-area/index.d.ts +1 -1
- package/flex-scroll-area/index.mjs +1 -1
- package/form-advice/index.mjs +13 -12
- package/form-button/index.d.ts +123 -0
- package/form-button/index.mjs +36 -0
- package/form-card/index.d.ts +14 -0
- package/form-card/index.mjs +18 -0
- package/form-cascader/index.d.ts +472 -0
- package/form-cascader/index.mjs +2 -0
- package/form-checkbox/index.d.ts +236 -16
- package/form-checkbox/index.mjs +1 -1
- package/form-checkbox-group/index.d.ts +364 -0
- package/form-checkbox-group/index.mjs +2 -0
- package/form-checkbox-group/style.css +1 -0
- package/form-date-picker/index.d.ts +390 -19
- package/form-date-picker/index.mjs +1 -1
- package/form-holder/index.d.ts +87 -20
- package/form-holder/index.mjs +1 -1
- package/form-holder/style.css +1 -1
- package/form-image/index.d.ts +145 -13
- package/form-image/index.mjs +1 -1
- package/form-input/index.d.ts +301 -20
- package/form-input/index.mjs +1 -1
- package/form-input/style.css +1 -0
- package/form-input-cron-expression/index.d.ts +217 -0
- package/form-input-cron-expression/index.mjs +2 -0
- package/form-input-cron-expression/style.css +1 -0
- package/form-input-email/index.d.ts +307 -16
- package/form-input-email/index.mjs +1 -1
- package/form-input-id-card/index.d.ts +307 -16
- package/form-input-id-card/index.mjs +1 -1
- package/form-input-number/index.d.ts +246 -18
- package/form-input-number/index.mjs +1 -1
- package/form-input-phone-number/index.d.ts +307 -16
- package/form-input-phone-number/index.mjs +1 -1
- package/form-input-tag/index.d.ts +263 -1
- package/form-input-tag/index.mjs +1 -3
- package/form-input-time/index.d.ts +434 -1
- package/form-input-time/index.mjs +1 -3
- package/form-item-config-provider/index.d.ts +22 -0
- package/form-item-config-provider/index.mjs +24 -0
- package/form-item-group/index.d.ts +91 -17
- package/form-item-group/index.mjs +2 -78
- package/form-item-group/style.css +1 -1
- package/form-item-x/index.d.ts +141 -11
- package/form-item-x/index.mjs +1 -1
- package/form-item-x/style.css +1 -0
- package/form-radio-group/index.d.ts +303 -16
- package/form-radio-group/index.mjs +1 -1
- package/form-rate/index.d.ts +254 -14
- package/form-rate/index.mjs +1 -1
- package/form-red-table/index.mjs +27 -26
- package/form-row/index.d.ts +2 -2
- package/form-row/index.mjs +1 -1
- package/form-select/index.d.ts +537 -18
- package/form-select/index.mjs +1 -1
- package/form-slider/index.d.ts +283 -16
- package/form-slider/index.mjs +1 -1
- package/form-switch/index.d.ts +272 -14
- package/form-switch/index.mjs +1 -1
- package/form-table/index.d.ts +269 -0
- package/form-table/index.mjs +2 -0
- package/form-table-plus/index.d.ts +266 -0
- package/form-table-plus/index.mjs +2 -0
- package/form-text/index.d.ts +165 -13
- package/form-text/index.mjs +1 -1
- package/form-textarea/index.d.ts +351 -0
- package/form-textarea/index.mjs +2 -0
- package/form-time-select/index.d.ts +319 -0
- package/form-time-select/index.mjs +2 -0
- package/form-view/index.mjs +1 -1
- package/helper/dictionary.d.ts +15 -0
- package/helper/dictionary.mjs +97 -0
- package/hook/useDictionary.d.ts +60 -0
- package/hook/useDictionary.mjs +15 -0
- package/hook/useVisibilityChange.d.ts +4 -0
- package/hook/useVisibilityChange.mjs +14 -0
- package/iframe-window/index.d.ts +9 -0
- package/iframe-window/index.mjs +37 -0
- package/iframe-window/style.css +1 -0
- package/index.css +2 -0
- package/index.d.ts +57 -36
- package/index.mjs +59 -61
- package/package.json +10 -5
- package/pageable-table/index.d.ts +400 -0
- package/pageable-table/index.mjs +2 -0
- package/pageable-table/style.css +1 -0
- package/resolver/index.mjs +29 -0
- package/sub-table/index.d.ts +100 -0
- package/sub-table/index.mjs +537 -0
- package/sub-table/style.css +1 -0
- package/sub-table-plus/index.d.ts +100 -0
- package/sub-table-plus/index.mjs +2 -0
- package/sub-table-plus/style.css +1 -0
- package/table-column/index.d.ts +160 -0
- package/table-column/index.mjs +2 -0
- package/table-column/style.css +1 -0
- package/table-column-def/index.d.ts +95 -0
- package/table-column-def/index.mjs +11 -0
- package/table-view/index.d.ts +341 -1
- package/table-view/index.mjs +457 -6
- package/table-view/style.css +1 -0
- package/toolbar/index.d.ts +128 -1
- package/toolbar/index.mjs +1 -8
- package/toolbar/style.css +1 -0
- package/toolbar-button/index.d.ts +188 -1
- package/toolbar-button/index.mjs +1 -8
- package/vue-cron/index.d.ts +191 -0
- package/vue-cron/index.mjs +2 -0
- package/vue-cron/style.css +1 -0
- package/web-types.json +1 -1
- package/x-input-tag/index.d.ts +2 -0
- package/x-input-tag/index.mjs +228 -0
- package/x-input-tag/style.css +1 -0
- package/year-calendar/index.d.ts +99 -0
- package/year-calendar/index.mjs +2 -0
- package/year-calendar/style.css +1 -0
- package/chunks/B4M_TFeR.mjs +0 -152
- package/chunks/B5BIQCcK.mjs +0 -149
- package/chunks/BHNKrW1j.mjs +0 -61
- package/chunks/BO9jWhBl.mjs +0 -46
- package/chunks/BZ8aOa78.mjs +0 -35
- package/chunks/Bsz7y4Xp.mjs +0 -73
- package/chunks/Bxj372sF.mjs +0 -53
- package/chunks/C33EmJN8.mjs +0 -32
- package/chunks/C6Li3-l7.mjs +0 -28
- package/chunks/CBcdalMX.mjs +0 -35
- package/chunks/CdRsyF0n.mjs +0 -43
- package/chunks/ClNahmiU.mjs +0 -23
- package/chunks/CstztYMu.mjs +0 -28
- package/chunks/DC9b53M6.mjs +0 -32
- package/chunks/DDVAgRED.mjs +0 -36
- package/chunks/DpJQABVD.mjs +0 -91
- package/chunks/ZsLNWI9x.mjs +0 -46
- package/chunks/jn_iQrVZ.mjs +0 -28
- package/constants.d.ts +0 -1
- package/constants.mjs +0 -4
- package/form-check-box-group/index.d.ts +0 -93
- package/form-check-box-group/index.mjs +0 -2
- package/input/style.css +0 -1
- package/resolver.mjs +0 -79
- /package/{resolver.d.ts → resolver/index.d.ts} +0 -0
|
@@ -0,0 +1,643 @@
|
|
|
1
|
+
import e from "../confirmable/index.mjs";
|
|
2
|
+
import t from "../confirm-button/index.mjs";
|
|
3
|
+
import { s as n } from "./DcTVYqeJ.mjs";
|
|
4
|
+
import { t as r } from "./DOZRzqlo.mjs";
|
|
5
|
+
import { cellClickHandlerContextKey as i } from "../constants/index.mjs";
|
|
6
|
+
import { t as a } from "./Dt3lfDnL.mjs";
|
|
7
|
+
import { t as o } from "./CkOD-_VV.mjs";
|
|
8
|
+
import { n as s } from "./D_qiRmiE.mjs";
|
|
9
|
+
import { t as c } from "./Bwbtu2cp.mjs";
|
|
10
|
+
import { t as l } from "./wXeqV-_7.mjs";
|
|
11
|
+
import { t as u } from "./CabldOLo.mjs";
|
|
12
|
+
import { t as ee } from "./V2p-PCpL.mjs";
|
|
13
|
+
import { t as d } from "./B1IPSTA6.mjs";
|
|
14
|
+
import { t as f } from "./BbSPWDDZ.mjs";
|
|
15
|
+
import { t as p } from "./bFbPPcdq.mjs";
|
|
16
|
+
import { t as m } from "./BtcjAHE6.mjs";
|
|
17
|
+
import { t as h } from "./YFiU0ngn.mjs";
|
|
18
|
+
import g from "../table-column-def/index.mjs";
|
|
19
|
+
import { findTreeChildren as _, isFunction as v } from "@web-utils/core";
|
|
20
|
+
import { Fragment as y, createBlock as b, createCommentVNode as x, createElementBlock as S, createElementVNode as C, createSlots as w, createTextVNode as T, createVNode as E, mergeProps as D, normalizeClass as O, openBlock as k, renderList as A, renderSlot as j, resolveComponent as M, toDisplayString as N, toHandlers as P, withCtx as F, withModifiers as I } from "vue";
|
|
21
|
+
import { formContextKey as L, formItemContextKey as R } from "element-plus";
|
|
22
|
+
import { cloneDeep as z } from "@web-utils/integrations/lodash";
|
|
23
|
+
//#region src/components/table/sub-table-plus.ts
|
|
24
|
+
var B = {
|
|
25
|
+
modelValue: Array,
|
|
26
|
+
prop: String,
|
|
27
|
+
columns: Array,
|
|
28
|
+
descs: Array,
|
|
29
|
+
ascs: Array,
|
|
30
|
+
limit: {
|
|
31
|
+
type: Number,
|
|
32
|
+
default: Infinity
|
|
33
|
+
},
|
|
34
|
+
disabled: Boolean,
|
|
35
|
+
showSummary: Boolean,
|
|
36
|
+
selection: Boolean,
|
|
37
|
+
index: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: !0
|
|
40
|
+
},
|
|
41
|
+
selectionWidth: String,
|
|
42
|
+
toolbarMenus: Array,
|
|
43
|
+
handleMenus: Array,
|
|
44
|
+
fetchApi: Function,
|
|
45
|
+
delApi: Function,
|
|
46
|
+
bottomAddButton: Boolean,
|
|
47
|
+
initRow: Function,
|
|
48
|
+
onRowDbClick: Function,
|
|
49
|
+
showMessage: Boolean,
|
|
50
|
+
pageSize: Number
|
|
51
|
+
}, V = {
|
|
52
|
+
name: "SubTablePlus",
|
|
53
|
+
inject: {
|
|
54
|
+
elForm: {
|
|
55
|
+
from: L,
|
|
56
|
+
default: ""
|
|
57
|
+
},
|
|
58
|
+
elFormItem: {
|
|
59
|
+
from: R,
|
|
60
|
+
default: ""
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
provide() {
|
|
64
|
+
return { [i]: this.rowDbClick };
|
|
65
|
+
},
|
|
66
|
+
props: { ...B },
|
|
67
|
+
emits: {
|
|
68
|
+
...s,
|
|
69
|
+
"add-row": null
|
|
70
|
+
},
|
|
71
|
+
data() {
|
|
72
|
+
return {
|
|
73
|
+
rows: [],
|
|
74
|
+
selectedRows: []
|
|
75
|
+
};
|
|
76
|
+
},
|
|
77
|
+
computed: {
|
|
78
|
+
enabled() {
|
|
79
|
+
return !this.disabled;
|
|
80
|
+
},
|
|
81
|
+
hasToolBarMenu() {
|
|
82
|
+
var e;
|
|
83
|
+
return (e = this.toolbarMenus) == null ? void 0 : e.length;
|
|
84
|
+
},
|
|
85
|
+
hasHandleMenus() {
|
|
86
|
+
var e;
|
|
87
|
+
return (e = this.handleMenus) == null ? void 0 : e.length;
|
|
88
|
+
},
|
|
89
|
+
rowProps() {
|
|
90
|
+
let e = {};
|
|
91
|
+
return this.columns && this.columns.map((e) => e.prop).forEach((t) => {
|
|
92
|
+
e[t] = null;
|
|
93
|
+
}), e;
|
|
94
|
+
},
|
|
95
|
+
listeners() {
|
|
96
|
+
return n(this.$attrs);
|
|
97
|
+
},
|
|
98
|
+
filteredColumns() {
|
|
99
|
+
return this.columns.filter((e) => e.label && !e.hide && !e.slot);
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
watch: {
|
|
103
|
+
modelValue: {
|
|
104
|
+
deep: !0,
|
|
105
|
+
immediate: !0,
|
|
106
|
+
handler(e) {
|
|
107
|
+
this.rows = e || [];
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
rows: {
|
|
111
|
+
deep: !0,
|
|
112
|
+
immediate: !0,
|
|
113
|
+
handler(e) {
|
|
114
|
+
this.$emit("update:modelValue", e);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
methods: {
|
|
119
|
+
getCellType(e, t) {
|
|
120
|
+
return v(t.getType) ? t.getType(e, t) : t.type;
|
|
121
|
+
},
|
|
122
|
+
getInputAttr(e, t) {
|
|
123
|
+
return t.attrs && t.getAttrs ? {
|
|
124
|
+
...t.attrs,
|
|
125
|
+
...t.getAttrs(e)
|
|
126
|
+
} : t.attrs ? t.attrs : t.getAttrs ? t.getAttrs(e) : {};
|
|
127
|
+
},
|
|
128
|
+
isInputDisabled(e, t) {
|
|
129
|
+
var n;
|
|
130
|
+
return (n = t.isDisabled) == null ? void 0 : n.call(t, e);
|
|
131
|
+
},
|
|
132
|
+
onInput(e, t, n) {
|
|
133
|
+
n.setValue ? n.setValue(e, t, n, this.rows) : n.setVal !== !1 && (e[n.prop] = t);
|
|
134
|
+
},
|
|
135
|
+
onBlur(e, t) {
|
|
136
|
+
t.onBlur && t.onBlur(e, t, this.rows);
|
|
137
|
+
},
|
|
138
|
+
onSelectionChange(e) {
|
|
139
|
+
this.selectedRows = e;
|
|
140
|
+
},
|
|
141
|
+
async remove(e, t) {
|
|
142
|
+
try {
|
|
143
|
+
if (this.delApi) try {
|
|
144
|
+
await this.delApi([e.id]), this.$message.success("删除成功!"), this.refresh();
|
|
145
|
+
} catch {
|
|
146
|
+
this.$message.error("删除失败!");
|
|
147
|
+
}
|
|
148
|
+
else this.rows.splice(t, 1);
|
|
149
|
+
} catch {}
|
|
150
|
+
},
|
|
151
|
+
async add(e, t) {
|
|
152
|
+
if (this.fetchApi) this.addRow();
|
|
153
|
+
else {
|
|
154
|
+
var n;
|
|
155
|
+
let e = z(this.rowProps), r = await ((n = this.initRow) == null ? void 0 : n.call(this, e, t));
|
|
156
|
+
t === -1 ? this.rows.push(r || e) : this.rows.splice(t + 1, 0, r || e);
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
addRow() {
|
|
160
|
+
this.$emit("add-row");
|
|
161
|
+
},
|
|
162
|
+
async delRow() {
|
|
163
|
+
if (!this.selectedRows.length) {
|
|
164
|
+
this.$message.warning("请选择要删除的记录!");
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
try {
|
|
168
|
+
if (this.delApi) try {
|
|
169
|
+
await this.delApi(this.selectedRows.map((e) => e.id)), this.$message.success("删除成功!"), this.refresh();
|
|
170
|
+
} catch {
|
|
171
|
+
this.$message.error("删除失败!");
|
|
172
|
+
}
|
|
173
|
+
else this.$emit("update:modelValue", this.rows.filter((e) => !this.selectedRows.includes(e)));
|
|
174
|
+
} catch {}
|
|
175
|
+
},
|
|
176
|
+
refresh() {
|
|
177
|
+
this.$refs.table.getPage();
|
|
178
|
+
},
|
|
179
|
+
getVal(e, t, n) {
|
|
180
|
+
var r, i;
|
|
181
|
+
if (n.type === "select" && (r = n.attrs) != null && r.options) {
|
|
182
|
+
let r = n.attrs.options.find((n) => n.modelValue === e[t.property] || n.code === e[t.property]);
|
|
183
|
+
if (r) return r.label || r.name;
|
|
184
|
+
}
|
|
185
|
+
if (n.type === "checkbox1") return e[t.property] === !0 || e[t.property] === "1" || e[t.property] === "Y" ? "是" : "否";
|
|
186
|
+
if (n.type === "cascader" && (i = n.attrs) != null && i.options) {
|
|
187
|
+
let [r] = _(n.attrs.options, (r) => r[n.attrs.valueKey || "value"] === e[t.property]);
|
|
188
|
+
if (r) return r[n.attrs.valueKey || "label"];
|
|
189
|
+
}
|
|
190
|
+
return e[t.property];
|
|
191
|
+
},
|
|
192
|
+
reloadTable() {
|
|
193
|
+
var e;
|
|
194
|
+
(e = this.$refs.table) == null || e.reload();
|
|
195
|
+
},
|
|
196
|
+
async refreshTable() {
|
|
197
|
+
var e;
|
|
198
|
+
await ((e = this.$refs.table) == null ? void 0 : e.getPage());
|
|
199
|
+
},
|
|
200
|
+
removeSelectedRows() {
|
|
201
|
+
this.$emit("update:modelValue", this.modelValue.filter((e) => !this.selectedRows.includes(e)));
|
|
202
|
+
},
|
|
203
|
+
rowDbClick(...e) {
|
|
204
|
+
var t;
|
|
205
|
+
(t = this.onRowDbClick) == null || t.call(this, ...e);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}, H = { class: "table-header flex-row" }, U = { class: "flex-item" }, W = { class: "flex-not-shrink" }, G = {
|
|
209
|
+
key: 0,
|
|
210
|
+
style: { color: "#f56c6c" }
|
|
211
|
+
}, K = ["title"], q = ["onClick"], J = {
|
|
212
|
+
key: 0,
|
|
213
|
+
class: "flex-row vertical-center horizon-center",
|
|
214
|
+
style: {
|
|
215
|
+
padding: "10px",
|
|
216
|
+
border: "1px solid #ebeef5",
|
|
217
|
+
"border-top": "none"
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
function Y(n, i, o, s, _, v) {
|
|
221
|
+
var L, R;
|
|
222
|
+
let z = a, B = t, V = u, Y = l, X = p, Z = M("FormInputUser"), Q = M("FormInputDepartment"), te = m, ne = d, re = c, ie = ee, ae = f, oe = r, $ = g, se = e, ce = h;
|
|
223
|
+
return k(), S("div", { class: O(["sub-table-plus", { "hide-message": !n.showMessage }]) }, [
|
|
224
|
+
E(ce, D(n.$attrs, {
|
|
225
|
+
ref: "table",
|
|
226
|
+
"auto-height": "",
|
|
227
|
+
data: n.fetchApi ? null : _.rows,
|
|
228
|
+
api: n.fetchApi,
|
|
229
|
+
"payload-style": "body",
|
|
230
|
+
"show-summary": n.showSummary,
|
|
231
|
+
descs: n.descs,
|
|
232
|
+
ascs: n.ascs,
|
|
233
|
+
"page-size": n.pageSize,
|
|
234
|
+
"selection-width": n.selectionWidth,
|
|
235
|
+
"hide-on-single-page": "",
|
|
236
|
+
selection: n.selection,
|
|
237
|
+
index: n.index
|
|
238
|
+
}, P(v.listeners), { onSelectionChange: v.onSelectionChange }), w({
|
|
239
|
+
default: F(() => [
|
|
240
|
+
j(n.$slots, "columns", { columns: n.columns }, () => [(k(!0), S(y, null, A(v.filteredColumns, (e) => (k(), b($, {
|
|
241
|
+
key: `${e.prop}-${v.enabled}${e.type ? `-${e.type}` : ""}${e.required ? `-${e.required}` : ""}`,
|
|
242
|
+
label: e.label,
|
|
243
|
+
width: e.width,
|
|
244
|
+
"dict-type": e.dictType,
|
|
245
|
+
clickable: e.clickable,
|
|
246
|
+
align: e.align,
|
|
247
|
+
prop: e.prop,
|
|
248
|
+
options: e.options,
|
|
249
|
+
"show-overflow-tooltip": !e.editable && e.showOverflowTooltip
|
|
250
|
+
}, {
|
|
251
|
+
header: F(() => [!n.disabled && e.required ? (k(), S("span", G, "*")) : x("v-if", !0), C("span", { title: e.label }, N(e.label), 9, K)]),
|
|
252
|
+
default: F(({ row: t, column: r, $index: i }) => [
|
|
253
|
+
x("tag 插槽"),
|
|
254
|
+
j(n.$slots, "tag", {
|
|
255
|
+
row: t,
|
|
256
|
+
column: r,
|
|
257
|
+
index: i
|
|
258
|
+
}),
|
|
259
|
+
x("列默认插槽,名字和 prop 保持一致"),
|
|
260
|
+
j(n.$slots, e.prop, {
|
|
261
|
+
row: t,
|
|
262
|
+
column: r,
|
|
263
|
+
wrapCol: !1,
|
|
264
|
+
index: i,
|
|
265
|
+
prop: n.prop ? `${n.prop}[${i}].${e.prop}` : null,
|
|
266
|
+
required: e.required,
|
|
267
|
+
editable: e.editable
|
|
268
|
+
}, () => {
|
|
269
|
+
var a;
|
|
270
|
+
return [v.enabled && e.editable === !0 ? (k(), S(y, { key: 0 }, [v.getCellType(t, e) === "input" ? (k(), b(V, D({
|
|
271
|
+
key: 0,
|
|
272
|
+
"wrap-col": !1,
|
|
273
|
+
"model-value": t[r.property]
|
|
274
|
+
}, { ref_for: !0 }, v.getInputAttr(t, e), {
|
|
275
|
+
disabled: v.isInputDisabled(t, e),
|
|
276
|
+
prop: n.prop ? `${n.prop}[${i}].${e.prop}` : null,
|
|
277
|
+
required: e.required,
|
|
278
|
+
onBlur: () => v.onBlur(t, e),
|
|
279
|
+
onInput: (n) => v.onInput(t, n, e)
|
|
280
|
+
}), null, 16, [
|
|
281
|
+
"model-value",
|
|
282
|
+
"disabled",
|
|
283
|
+
"prop",
|
|
284
|
+
"required",
|
|
285
|
+
"onBlur",
|
|
286
|
+
"onInput"
|
|
287
|
+
])) : v.getCellType(t, e) === "checkbox1" ? (k(), b(Y, D({
|
|
288
|
+
key: 1,
|
|
289
|
+
"wrap-col": !1,
|
|
290
|
+
"model-value": t[r.property]
|
|
291
|
+
}, { ref_for: !0 }, v.getInputAttr(t, e), {
|
|
292
|
+
disabled: v.isInputDisabled(t, e),
|
|
293
|
+
prop: n.prop ? `${n.prop}[${i}].${e.prop}` : null,
|
|
294
|
+
required: e.required,
|
|
295
|
+
onInput: (n) => v.onInput(t, n, e)
|
|
296
|
+
}), null, 16, [
|
|
297
|
+
"model-value",
|
|
298
|
+
"disabled",
|
|
299
|
+
"prop",
|
|
300
|
+
"required",
|
|
301
|
+
"onInput"
|
|
302
|
+
])) : v.getCellType(t, e) === "inputPhoneNumber" ? (k(), b(X, D({
|
|
303
|
+
key: 2,
|
|
304
|
+
"wrap-col": !1,
|
|
305
|
+
"model-value": t[r.property]
|
|
306
|
+
}, { ref_for: !0 }, v.getInputAttr(t, e), {
|
|
307
|
+
disabled: v.isInputDisabled(t, e),
|
|
308
|
+
prop: n.prop ? `${n.prop}[${i}].${e.prop}` : null,
|
|
309
|
+
required: e.required,
|
|
310
|
+
onInput: (n) => v.onInput(t, n, e)
|
|
311
|
+
}), null, 16, [
|
|
312
|
+
"model-value",
|
|
313
|
+
"disabled",
|
|
314
|
+
"prop",
|
|
315
|
+
"required",
|
|
316
|
+
"onInput"
|
|
317
|
+
])) : v.getCellType(t, e) === "user" ? (k(), S(y, { key: 3 }, [e.single ? (k(), b(Z, D({
|
|
318
|
+
key: 0,
|
|
319
|
+
id: t[r.idProp || `${r.property}Id`],
|
|
320
|
+
"onUpdate:id": (e) => t[r.idProp || `${r.property}Id`] = e,
|
|
321
|
+
name: t[r.property],
|
|
322
|
+
"onUpdate:name": (e) => t[r.property] = e,
|
|
323
|
+
"wrap-col": !1
|
|
324
|
+
}, { ref_for: !0 }, v.getInputAttr(t, e), {
|
|
325
|
+
disabled: v.isInputDisabled(t, e),
|
|
326
|
+
prop: n.prop ? `${n.prop}[${i}].${e.prop}` : null,
|
|
327
|
+
required: e.required,
|
|
328
|
+
onInput: (n) => v.onInput(t, n, e)
|
|
329
|
+
}), null, 16, [
|
|
330
|
+
"id",
|
|
331
|
+
"onUpdate:id",
|
|
332
|
+
"name",
|
|
333
|
+
"onUpdate:name",
|
|
334
|
+
"disabled",
|
|
335
|
+
"prop",
|
|
336
|
+
"required",
|
|
337
|
+
"onInput"
|
|
338
|
+
])) : (k(), b(Z, D({
|
|
339
|
+
key: 1,
|
|
340
|
+
"wrap-col": !1,
|
|
341
|
+
"model-value": t[r.property]
|
|
342
|
+
}, { ref_for: !0 }, v.getInputAttr(t, e), {
|
|
343
|
+
disabled: v.isInputDisabled(t, e),
|
|
344
|
+
prop: n.prop ? `${n.prop}[${i}].${e.prop}` : null,
|
|
345
|
+
required: e.required,
|
|
346
|
+
onInput: (n) => v.onInput(t, n, e)
|
|
347
|
+
}), null, 16, [
|
|
348
|
+
"model-value",
|
|
349
|
+
"disabled",
|
|
350
|
+
"prop",
|
|
351
|
+
"required",
|
|
352
|
+
"onInput"
|
|
353
|
+
]))], 64)) : v.getCellType(t, e) === "department" ? (k(), S(y, { key: 4 }, [e.single ? (k(), b(Q, D({
|
|
354
|
+
key: 0,
|
|
355
|
+
name: t[r.property],
|
|
356
|
+
"onUpdate:name": (e) => t[r.property] = e,
|
|
357
|
+
"wrap-col": !1,
|
|
358
|
+
"ou-type": e.ouType
|
|
359
|
+
}, { ref_for: !0 }, v.getInputAttr(t, e), {
|
|
360
|
+
disabled: v.isInputDisabled(t, e),
|
|
361
|
+
prop: n.prop ? `${n.prop}[${i}].${e.prop}` : null,
|
|
362
|
+
required: e.required,
|
|
363
|
+
onInput: (n) => v.onInput(t, n, e)
|
|
364
|
+
}), null, 16, [
|
|
365
|
+
"name",
|
|
366
|
+
"onUpdate:name",
|
|
367
|
+
"ou-type",
|
|
368
|
+
"disabled",
|
|
369
|
+
"prop",
|
|
370
|
+
"required",
|
|
371
|
+
"onInput"
|
|
372
|
+
])) : (k(), b(Q, D({
|
|
373
|
+
key: 1,
|
|
374
|
+
"wrap-col": !1,
|
|
375
|
+
"model-value": t[r.property]
|
|
376
|
+
}, { ref_for: !0 }, v.getInputAttr(t, e), {
|
|
377
|
+
disabled: v.isInputDisabled(t, e),
|
|
378
|
+
prop: n.prop ? `${n.prop}[${i}].${e.prop}` : null,
|
|
379
|
+
required: e.required,
|
|
380
|
+
onInput: (n) => v.onInput(t, n, e)
|
|
381
|
+
}), null, 16, [
|
|
382
|
+
"model-value",
|
|
383
|
+
"disabled",
|
|
384
|
+
"prop",
|
|
385
|
+
"required",
|
|
386
|
+
"onInput"
|
|
387
|
+
]))], 64)) : v.getCellType(t, e) === "select" ? (k(), b(te, D({
|
|
388
|
+
key: 5,
|
|
389
|
+
"wrap-col": !1,
|
|
390
|
+
"model-value": t[r.property]
|
|
391
|
+
}, { ref_for: !0 }, v.getInputAttr(t, e), {
|
|
392
|
+
disabled: v.isInputDisabled(t, e),
|
|
393
|
+
prop: n.prop ? `${n.prop}[${i}].${e.prop}` : null,
|
|
394
|
+
required: e.required,
|
|
395
|
+
onInput: (n) => v.onInput(t, n, e)
|
|
396
|
+
}), null, 16, [
|
|
397
|
+
"model-value",
|
|
398
|
+
"disabled",
|
|
399
|
+
"prop",
|
|
400
|
+
"required",
|
|
401
|
+
"onInput"
|
|
402
|
+
])) : v.getCellType(t, e) === "datePicker" ? (k(), b(ne, D({
|
|
403
|
+
key: 6,
|
|
404
|
+
ref_for: !0
|
|
405
|
+
}, v.getInputAttr(t, e), {
|
|
406
|
+
start: t[e.start],
|
|
407
|
+
"onUpdate:start": (n) => t[e.start] = n,
|
|
408
|
+
end: t[e.end],
|
|
409
|
+
"onUpdate:end": (n) => t[e.end] = n,
|
|
410
|
+
"wrap-col": !1,
|
|
411
|
+
"model-value": t[r.property],
|
|
412
|
+
disabled: v.isInputDisabled(t, e),
|
|
413
|
+
prop: n.prop ? `${n.prop}[${i}].${e.prop}` : null,
|
|
414
|
+
required: e.required,
|
|
415
|
+
onInput: (n) => v.onInput(t, n, e)
|
|
416
|
+
}), null, 16, [
|
|
417
|
+
"start",
|
|
418
|
+
"onUpdate:start",
|
|
419
|
+
"end",
|
|
420
|
+
"onUpdate:end",
|
|
421
|
+
"model-value",
|
|
422
|
+
"disabled",
|
|
423
|
+
"prop",
|
|
424
|
+
"required",
|
|
425
|
+
"onInput"
|
|
426
|
+
])) : v.getCellType(t, e) === "cascader" ? (k(), b(re, D({
|
|
427
|
+
key: 7,
|
|
428
|
+
"wrap-col": !1,
|
|
429
|
+
"model-value": t[r.property]
|
|
430
|
+
}, { ref_for: !0 }, v.getInputAttr(t, e), {
|
|
431
|
+
disabled: v.isInputDisabled(t, e),
|
|
432
|
+
prop: n.prop ? `${n.prop}[${i}].${e.prop}` : null,
|
|
433
|
+
required: e.required,
|
|
434
|
+
"label-key": e.labelKey,
|
|
435
|
+
"value-key": e.valueKey,
|
|
436
|
+
onInput: (n) => v.onInput(t, n, e)
|
|
437
|
+
}), null, 16, [
|
|
438
|
+
"model-value",
|
|
439
|
+
"disabled",
|
|
440
|
+
"prop",
|
|
441
|
+
"required",
|
|
442
|
+
"label-key",
|
|
443
|
+
"value-key",
|
|
444
|
+
"onInput"
|
|
445
|
+
])) : v.getCellType(t, e) === "checkbox" ? (k(), b(ie, D({
|
|
446
|
+
key: 8,
|
|
447
|
+
"wrap-col": !1,
|
|
448
|
+
"model-value": t[r.property]
|
|
449
|
+
}, { ref_for: !0 }, v.getInputAttr(t, e), {
|
|
450
|
+
disabled: v.isInputDisabled(t, e),
|
|
451
|
+
prop: n.prop ? `${n.prop}[${i}].${e.prop}` : null,
|
|
452
|
+
required: e.required,
|
|
453
|
+
onInput: (n) => v.onInput(t, n, e)
|
|
454
|
+
}), null, 16, [
|
|
455
|
+
"model-value",
|
|
456
|
+
"disabled",
|
|
457
|
+
"prop",
|
|
458
|
+
"required",
|
|
459
|
+
"onInput"
|
|
460
|
+
])) : v.getCellType(t, e) === "number" ? (k(), b(ae, D({
|
|
461
|
+
key: 9,
|
|
462
|
+
"wrap-col": !1,
|
|
463
|
+
"model-value": t[r.property]
|
|
464
|
+
}, { ref_for: !0 }, v.getInputAttr(t, e), {
|
|
465
|
+
disabled: v.isInputDisabled(t, e),
|
|
466
|
+
prop: n.prop ? `${n.prop}[${i}].${e.prop}` : null,
|
|
467
|
+
required: e.required,
|
|
468
|
+
onInput: (n) => v.onInput(t, n, e)
|
|
469
|
+
}), null, 16, [
|
|
470
|
+
"model-value",
|
|
471
|
+
"disabled",
|
|
472
|
+
"prop",
|
|
473
|
+
"required",
|
|
474
|
+
"onInput"
|
|
475
|
+
])) : x("v-if", !0)], 64)) : e.dictType || (a = e.options) != null && a.length ? (k(), b(oe, {
|
|
476
|
+
key: 1,
|
|
477
|
+
"dict-type": e.dictType,
|
|
478
|
+
"id-as-value": e.idAsValue,
|
|
479
|
+
"label-as-value": e.labelAsValue,
|
|
480
|
+
column: r,
|
|
481
|
+
row: t,
|
|
482
|
+
options: e.options
|
|
483
|
+
}, null, 8, [
|
|
484
|
+
"dict-type",
|
|
485
|
+
"id-as-value",
|
|
486
|
+
"label-as-value",
|
|
487
|
+
"column",
|
|
488
|
+
"row",
|
|
489
|
+
"options"
|
|
490
|
+
])) : (k(), S(y, { key: 2 }, [T(N(v.getVal(t, r, e)), 1)], 64))];
|
|
491
|
+
})
|
|
492
|
+
]),
|
|
493
|
+
_: 2
|
|
494
|
+
}, 1032, [
|
|
495
|
+
"label",
|
|
496
|
+
"width",
|
|
497
|
+
"dict-type",
|
|
498
|
+
"clickable",
|
|
499
|
+
"align",
|
|
500
|
+
"prop",
|
|
501
|
+
"options",
|
|
502
|
+
"show-overflow-tooltip"
|
|
503
|
+
]))), 128))]),
|
|
504
|
+
j(n.$slots, "handle", {
|
|
505
|
+
add: v.add,
|
|
506
|
+
remove: v.remove
|
|
507
|
+
}),
|
|
508
|
+
!n.disabled && v.hasHandleMenus ? (k(), b($, {
|
|
509
|
+
key: 0,
|
|
510
|
+
label: "操作",
|
|
511
|
+
width: "80",
|
|
512
|
+
align: "center",
|
|
513
|
+
prop: "menu"
|
|
514
|
+
}, {
|
|
515
|
+
header: F(({ column: e, $index: t }) => [j(n.$slots, "handle-column-header", {
|
|
516
|
+
column: e,
|
|
517
|
+
index: t
|
|
518
|
+
}, () => [T(N(e.label), 1)])]),
|
|
519
|
+
default: F(({ row: e, $index: t }) => {
|
|
520
|
+
var r, i, a;
|
|
521
|
+
return [(r = n.handleMenus) != null && r.includes("add") && ((i = n.modelValue) == null ? void 0 : i.length) < n.limit ? (k(), S("i", {
|
|
522
|
+
key: 0,
|
|
523
|
+
class: "el-icon-circle-plus sub-table-handle-button table-button-add",
|
|
524
|
+
style: {
|
|
525
|
+
"margin-right": "5px",
|
|
526
|
+
"font-size": "20px",
|
|
527
|
+
cursor: "pointer"
|
|
528
|
+
},
|
|
529
|
+
title: "添加",
|
|
530
|
+
onClick: I((n) => v.add(e, t), ["stop"])
|
|
531
|
+
}, null, 8, q)) : x("v-if", !0), (a = n.handleMenus) != null && a.includes("delete") ? (k(), b(se, {
|
|
532
|
+
key: 1,
|
|
533
|
+
class: "el-icon-error sub-table-handle-button table-button-remove",
|
|
534
|
+
title: "删除",
|
|
535
|
+
message: "您确定要删除该行吗?",
|
|
536
|
+
onClick: I((n) => v.remove(e, t), ["stop"])
|
|
537
|
+
}, null, 8, ["onClick"])) : x("v-if", !0)];
|
|
538
|
+
}),
|
|
539
|
+
_: 3
|
|
540
|
+
})) : x("v-if", !0)
|
|
541
|
+
]),
|
|
542
|
+
_: 2
|
|
543
|
+
}, [!n.disabled || v.hasToolBarMenu ? {
|
|
544
|
+
name: "toolbar",
|
|
545
|
+
fn: F(() => [C("div", H, [j(n.$slots, "toolbar", {
|
|
546
|
+
addRow: v.addRow,
|
|
547
|
+
delRow: v.delRow,
|
|
548
|
+
refresh: v.refresh
|
|
549
|
+
}, () => [C("div", U, [j(n.$slots, "toolbar-left", {
|
|
550
|
+
addRow: v.addRow,
|
|
551
|
+
delRow: v.delRow,
|
|
552
|
+
refresh: v.refresh
|
|
553
|
+
}, () => {
|
|
554
|
+
var e, t, r;
|
|
555
|
+
return [
|
|
556
|
+
(e = n.toolbarMenus) != null && e.includes("add") ? (k(), b(z, {
|
|
557
|
+
key: 0,
|
|
558
|
+
class: "table-header-button add",
|
|
559
|
+
icon: "el-icon-circle-plus",
|
|
560
|
+
type: "text",
|
|
561
|
+
onClick: v.addRow
|
|
562
|
+
}, {
|
|
563
|
+
default: F(() => [...i[2] || (i[2] = [T(" 添加 ", -1)])]),
|
|
564
|
+
_: 1
|
|
565
|
+
}, 8, ["onClick"])) : x("v-if", !0),
|
|
566
|
+
(t = n.toolbarMenus) != null && t.includes("delete") ? (k(), b(B, {
|
|
567
|
+
key: 1,
|
|
568
|
+
disabled: _.selectedRows.length <= 0,
|
|
569
|
+
class: "table-header-button remove",
|
|
570
|
+
message: "您确定要删除选中的记录吗?",
|
|
571
|
+
icon: "el-icon-error",
|
|
572
|
+
type: "text",
|
|
573
|
+
onClick: v.delRow
|
|
574
|
+
}, {
|
|
575
|
+
default: F(() => [...i[3] || (i[3] = [T(" 删除 ", -1)])]),
|
|
576
|
+
_: 1
|
|
577
|
+
}, 8, ["disabled", "onClick"])) : x("v-if", !0),
|
|
578
|
+
(r = n.toolbarMenus) != null && r.includes("refresh") ? (k(), b(z, {
|
|
579
|
+
key: 2,
|
|
580
|
+
class: "table-header-button refresh",
|
|
581
|
+
icon: "el-icon-refresh-left",
|
|
582
|
+
type: "text",
|
|
583
|
+
disabled: !1,
|
|
584
|
+
onClick: v.refresh
|
|
585
|
+
}, {
|
|
586
|
+
default: F(() => [...i[4] || (i[4] = [T(" 刷新 ", -1)])]),
|
|
587
|
+
_: 1
|
|
588
|
+
}, 8, ["onClick"])) : x("v-if", !0)
|
|
589
|
+
];
|
|
590
|
+
}), j(n.$slots, "toolbar-left-append", {
|
|
591
|
+
addRow: v.addRow,
|
|
592
|
+
delRow: v.delRow,
|
|
593
|
+
refresh: v.refresh
|
|
594
|
+
})]), C("div", W, [j(n.$slots, "toolbar-right", {
|
|
595
|
+
removeSelectedRows: v.removeSelectedRows,
|
|
596
|
+
selectedRows: _.selectedRows
|
|
597
|
+
})])])])]),
|
|
598
|
+
key: "0"
|
|
599
|
+
} : void 0, n.bottomAddButton ? {
|
|
600
|
+
name: "empty",
|
|
601
|
+
fn: F(() => [C("i", {
|
|
602
|
+
class: "el-icon-circle-plus sub-table-handle-button table-button-add",
|
|
603
|
+
style: {
|
|
604
|
+
"font-size": "20px",
|
|
605
|
+
cursor: "pointer"
|
|
606
|
+
},
|
|
607
|
+
title: "添加",
|
|
608
|
+
onClick: i[0] || (i[0] = I((e) => {
|
|
609
|
+
var t;
|
|
610
|
+
return v.add(null, ((t = n.modelValue) == null ? void 0 : t.length) ?? 0);
|
|
611
|
+
}, ["stop"]))
|
|
612
|
+
})]),
|
|
613
|
+
key: "1"
|
|
614
|
+
} : void 0]), 1040, [
|
|
615
|
+
"data",
|
|
616
|
+
"api",
|
|
617
|
+
"show-summary",
|
|
618
|
+
"descs",
|
|
619
|
+
"ascs",
|
|
620
|
+
"page-size",
|
|
621
|
+
"selection-width",
|
|
622
|
+
"selection",
|
|
623
|
+
"index",
|
|
624
|
+
"onSelectionChange"
|
|
625
|
+
]),
|
|
626
|
+
x("底部添加按钮"),
|
|
627
|
+
!n.disabled && n.bottomAddButton && ((L = n.modelValue) == null ? void 0 : L.length) < n.limit && ((R = n.modelValue) == null ? void 0 : R.length) > 0 ? (k(), S("div", J, [C("i", {
|
|
628
|
+
class: "el-icon-circle-plus sub-table-handle-button table-button-add",
|
|
629
|
+
style: {
|
|
630
|
+
"font-size": "20px",
|
|
631
|
+
cursor: "pointer"
|
|
632
|
+
},
|
|
633
|
+
title: "添加",
|
|
634
|
+
onClick: i[1] || (i[1] = I((e) => {
|
|
635
|
+
var t;
|
|
636
|
+
return v.add(null, ((t = n.modelValue) == null ? void 0 : t.length) ?? 0);
|
|
637
|
+
}, ["stop"]))
|
|
638
|
+
})])) : x("v-if", !0)
|
|
639
|
+
], 2);
|
|
640
|
+
}
|
|
641
|
+
var X = /* @__PURE__ */ o(V, [["render", Y]]);
|
|
642
|
+
//#endregion
|
|
643
|
+
export { B as n, X as t };
|