bm-admin-ui 1.0.50-alpha → 1.0.52-alpha
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/es/components/button/index.d.ts +1 -1
- package/es/components/button/src/button.vue.d.ts +1 -1
- package/es/components/edit-form/index.d.ts +150 -0
- package/es/components/edit-form/index.js +1186 -0
- package/es/components/edit-form/src/composables/api.d.ts +13 -0
- package/es/components/edit-form/src/composables/config.d.ts +13 -0
- package/es/components/edit-form/src/composables/event.d.ts +10 -0
- package/es/components/edit-form/src/composables/utils.d.ts +12 -0
- package/es/components/edit-form/src/edit-form.vue.d.ts +148 -0
- package/es/components/edit-form/src/group.vue.d.ts +6 -0
- package/es/components/edit-form/src/props.d.ts +17 -0
- package/es/components/edit-form/src/types.d.ts +77 -0
- package/es/components/editor/index.d.ts +9 -9
- package/es/components/editor/src/editor.vue.d.ts +9 -9
- package/es/components/feedback/index.d.ts +7 -7
- package/es/components/feedback/src/bmAlert.vue.d.ts +4 -4
- package/es/components/feedback/src/bmModal.vue.d.ts +3 -3
- package/es/components/flow-designer/src/bm-nodes/BmConditionNode.vue.d.ts +4 -4
- package/es/components/form-create/index.js +17 -11
- package/es/components/form-designer/index.js +39 -20
- package/es/components/index.d.ts +1 -0
- package/es/components/index.js +1 -0
- package/es/components/input-tags-display/index.d.ts +3 -3
- package/es/components/input-tags-display/src/input-tags-display.vue.d.ts +3 -3
- package/es/components/search-filter/index.d.ts +4 -4
- package/es/components/search-filter/src/search-filter.vue.d.ts +4 -4
- package/es/components/select-all/index.d.ts +13 -13
- package/es/components/select-all/src/selectAll.vue.d.ts +13 -13
- package/es/components/shops-filter/index.d.ts +1 -1
- package/es/components/shops-filter/src/shops-filter.vue.d.ts +1 -1
- package/es/components/staffs-selector/index.d.ts +3 -3
- package/es/components/staffs-selector/index.js +2 -2
- package/es/components/staffs-selector/src/staffs-selector.vue.d.ts +3 -3
- package/es/components/timeline/index.d.ts +1 -1
- package/es/components/timeline/src/timeline-item.vue.d.ts +1 -1
- package/lib/components/button/index.d.ts +1 -1
- package/lib/components/button/src/button.vue.d.ts +1 -1
- package/lib/components/edit-form/index.d.ts +150 -0
- package/lib/components/edit-form/index.js +1195 -0
- package/lib/components/edit-form/src/composables/api.d.ts +13 -0
- package/lib/components/edit-form/src/composables/config.d.ts +13 -0
- package/lib/components/edit-form/src/composables/event.d.ts +10 -0
- package/lib/components/edit-form/src/composables/utils.d.ts +12 -0
- package/lib/components/edit-form/src/edit-form.vue.d.ts +148 -0
- package/lib/components/edit-form/src/group.vue.d.ts +6 -0
- package/lib/components/edit-form/src/props.d.ts +17 -0
- package/lib/components/edit-form/src/types.d.ts +77 -0
- package/lib/components/editor/index.d.ts +9 -9
- package/lib/components/editor/src/editor.vue.d.ts +9 -9
- package/lib/components/feedback/index.d.ts +7 -7
- package/lib/components/feedback/src/bmAlert.vue.d.ts +4 -4
- package/lib/components/feedback/src/bmModal.vue.d.ts +3 -3
- package/lib/components/flow-designer/src/bm-nodes/BmConditionNode.vue.d.ts +4 -4
- package/lib/components/form-create/index.js +17 -11
- package/lib/components/form-designer/index.js +29 -10
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.js +7 -0
- package/lib/components/input-tags-display/index.d.ts +3 -3
- package/lib/components/input-tags-display/src/input-tags-display.vue.d.ts +3 -3
- package/lib/components/search-filter/index.d.ts +4 -4
- package/lib/components/search-filter/src/search-filter.vue.d.ts +4 -4
- package/lib/components/select-all/index.d.ts +13 -13
- package/lib/components/select-all/src/selectAll.vue.d.ts +13 -13
- package/lib/components/shops-filter/index.d.ts +1 -1
- package/lib/components/shops-filter/src/shops-filter.vue.d.ts +1 -1
- package/lib/components/staffs-selector/index.d.ts +3 -3
- package/lib/components/staffs-selector/index.js +1 -1
- package/lib/components/staffs-selector/src/staffs-selector.vue.d.ts +3 -3
- package/lib/components/timeline/index.d.ts +1 -1
- package/lib/components/timeline/src/timeline-item.vue.d.ts +1 -1
- package/package.json +1 -1
- package/theme-chalk/edit-form.css +1 -0
- package/theme-chalk/index.css +1 -1
- package/types/components/button/index.d.ts +1 -1
- package/types/components/button/src/button.vue.d.ts +1 -1
- package/types/components/edit-form/index.d.ts +150 -0
- package/types/components/edit-form/src/composables/api.d.ts +13 -0
- package/types/components/edit-form/src/composables/config.d.ts +13 -0
- package/types/components/edit-form/src/composables/event.d.ts +10 -0
- package/types/components/edit-form/src/composables/utils.d.ts +12 -0
- package/types/components/edit-form/src/edit-form.vue.d.ts +148 -0
- package/types/components/edit-form/src/group.vue.d.ts +6 -0
- package/types/components/edit-form/src/props.d.ts +17 -0
- package/types/components/edit-form/src/types.d.ts +77 -0
- package/types/components/editor/index.d.ts +9 -9
- package/types/components/editor/src/editor.vue.d.ts +9 -9
- package/types/components/feedback/index.d.ts +7 -7
- package/types/components/feedback/src/bmAlert.vue.d.ts +4 -4
- package/types/components/feedback/src/bmModal.vue.d.ts +3 -3
- package/types/components/flow-designer/src/bm-nodes/BmConditionNode.vue.d.ts +4 -4
- package/types/components/index.d.ts +1 -0
- package/types/components/input-tags-display/index.d.ts +3 -3
- package/types/components/input-tags-display/src/input-tags-display.vue.d.ts +3 -3
- package/types/components/search-filter/index.d.ts +4 -4
- package/types/components/search-filter/src/search-filter.vue.d.ts +4 -4
- package/types/components/select-all/index.d.ts +13 -13
- package/types/components/select-all/src/selectAll.vue.d.ts +13 -13
- package/types/components/shops-filter/index.d.ts +1 -1
- package/types/components/shops-filter/src/shops-filter.vue.d.ts +1 -1
- package/types/components/staffs-selector/index.d.ts +3 -3
- package/types/components/staffs-selector/src/staffs-selector.vue.d.ts +3 -3
- package/types/components/timeline/index.d.ts +1 -1
- package/types/components/timeline/src/timeline-item.vue.d.ts +1 -1
|
@@ -0,0 +1,1186 @@
|
|
|
1
|
+
import { withInstall } from 'bm-admin-ui/es/utils/with-install';
|
|
2
|
+
import { computed, defineComponent, resolveComponent, openBlock, createBlock, withCtx, renderSlot, ref, watch, createElementBlock, Fragment, renderList, unref, normalizeClass, toDisplayString, createCommentVNode, createElementVNode, normalizeStyle, createTextVNode, createVNode, createSlots } from 'vue';
|
|
3
|
+
import { QuestionCircleOutlined, ClockCircleOutlined, CalendarOutlined } from '@ant-design/icons-vue';
|
|
4
|
+
import { Form } from 'ant-design-vue';
|
|
5
|
+
import BmOverTooltips from 'bm-admin-ui/es/components/over-tooltips';
|
|
6
|
+
|
|
7
|
+
const editFormProps = () => ({
|
|
8
|
+
config: {
|
|
9
|
+
type: Object,
|
|
10
|
+
default() {
|
|
11
|
+
return {};
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
form: {
|
|
15
|
+
type: Object,
|
|
16
|
+
default() {
|
|
17
|
+
return {};
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
groupRules: {
|
|
21
|
+
type: Object,
|
|
22
|
+
default() {
|
|
23
|
+
return [];
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
function isNil(value) {
|
|
29
|
+
return value == null;
|
|
30
|
+
}
|
|
31
|
+
function useUtils(props, colCount, tmpForm) {
|
|
32
|
+
function getValueOfOption(key, defaultKey, option) {
|
|
33
|
+
return key && !isNil(option[key]) ? option[key] : option[defaultKey];
|
|
34
|
+
}
|
|
35
|
+
function getPopupContainer(e) {
|
|
36
|
+
while (e.parentNode && !e.classList.contains('ant-form-item')) {
|
|
37
|
+
e = e.parentNode;
|
|
38
|
+
}
|
|
39
|
+
return e;
|
|
40
|
+
}
|
|
41
|
+
const defaultCol = {
|
|
42
|
+
labelCol: { flex: '82px' },
|
|
43
|
+
};
|
|
44
|
+
function getColConfigFromCols(type, positionIndex, index) {
|
|
45
|
+
var _a, _b, _c;
|
|
46
|
+
let cols = ((_b = (_a = props.config) === null || _a === void 0 ? void 0 : _a.global) === null || _b === void 0 ? void 0 : _b.cols) || [];
|
|
47
|
+
if (cols.length === 0) {
|
|
48
|
+
cols = [defaultCol];
|
|
49
|
+
}
|
|
50
|
+
let tempIndex = cols.length - 1;
|
|
51
|
+
if (positionIndex !== undefined && positionIndex < cols.length) {
|
|
52
|
+
tempIndex = positionIndex;
|
|
53
|
+
}
|
|
54
|
+
else if (index !== undefined && index < cols.length) {
|
|
55
|
+
tempIndex = index;
|
|
56
|
+
}
|
|
57
|
+
return Object.assign(Object.assign({}, defaultCol[type]), (_c = cols[tempIndex]) === null || _c === void 0 ? void 0 : _c[type]);
|
|
58
|
+
}
|
|
59
|
+
function getWidthFromFlexString(text) {
|
|
60
|
+
const reg = /\d+(px|%)/;
|
|
61
|
+
const regRet = text.match(reg);
|
|
62
|
+
if (regRet) {
|
|
63
|
+
return regRet[0].replace('width:', '').trim();
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
return '';
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
function getSpecialWrapperColConfig(item) {
|
|
70
|
+
var _a, _b;
|
|
71
|
+
if (colCount.value <= 1 || !item.specialRow || item.wrapperCol) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
let width = '100%';
|
|
75
|
+
let cols = ((_b = (_a = props.config) === null || _a === void 0 ? void 0 : _a.global) === null || _b === void 0 ? void 0 : _b.cols) || [];
|
|
76
|
+
if (cols.length === 0) {
|
|
77
|
+
cols = [defaultCol];
|
|
78
|
+
}
|
|
79
|
+
const positionIndex = item.positionIndex !== undefined ? item.positionIndex : cols.length - 1;
|
|
80
|
+
const startLabelCol = getColConfigFromCols('labelCol', positionIndex);
|
|
81
|
+
const endLabelCol = getColConfigFromCols('labelCol', positionIndex + 1);
|
|
82
|
+
const endWrapperCol = getColConfigFromCols('wrapperCol', positionIndex + 1);
|
|
83
|
+
const startLabelWidth = getWidthFromFlexString((startLabelCol.flex || '') + '');
|
|
84
|
+
const endLabelWidth = getWidthFromFlexString((endLabelCol.flex || '') + '');
|
|
85
|
+
const endWrapperWidth = getWidthFromFlexString((endWrapperCol.flex || '') + '');
|
|
86
|
+
if (startLabelWidth && endLabelWidth && endWrapperWidth) {
|
|
87
|
+
width = `calc(50% - ${startLabelWidth} + ${endLabelWidth} + ${endWrapperWidth})`;
|
|
88
|
+
return { flex: '0 0 ' + width };
|
|
89
|
+
}
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
function getColsConfig(type, item, index) {
|
|
93
|
+
var _a, _b;
|
|
94
|
+
if (((_b = (_a = props.config) === null || _a === void 0 ? void 0 : _a.global) === null || _b === void 0 ? void 0 : _b.layout) === 'vertical') {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
if (item[type]) {
|
|
98
|
+
return item[type];
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
if (colCount.value > 1) {
|
|
102
|
+
if (type === 'wrapperCol') {
|
|
103
|
+
if (item.wholeRow) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
else if (item.specialRow) {
|
|
107
|
+
return getSpecialWrapperColConfig(item);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return getColConfigFromCols(type, item.positionIndex, index);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
function getControlWidth(item) {
|
|
115
|
+
let width = 100 / colCount.value;
|
|
116
|
+
if (item.wholeRow) {
|
|
117
|
+
width = 100;
|
|
118
|
+
}
|
|
119
|
+
else if (item.specialRow) {
|
|
120
|
+
width *= 2;
|
|
121
|
+
}
|
|
122
|
+
return Math.floor(width * 100) / 100 + '%';
|
|
123
|
+
}
|
|
124
|
+
function getShowValue(item) {
|
|
125
|
+
var _a;
|
|
126
|
+
if (item.textFormatter && typeof item.textFormatter === 'function') {
|
|
127
|
+
const res = item.textFormatter(tmpForm.value);
|
|
128
|
+
if (res === false) {
|
|
129
|
+
return item.placeholder || '-';
|
|
130
|
+
}
|
|
131
|
+
return res;
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
return ((_a = tmpForm.value) === null || _a === void 0 ? void 0 : _a[item.prop]) || item.placeholder || '-';
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return {
|
|
138
|
+
getValueOfOption,
|
|
139
|
+
getPopupContainer,
|
|
140
|
+
getColsConfig,
|
|
141
|
+
getControlWidth,
|
|
142
|
+
getShowValue,
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function useConfig(props, colCount) {
|
|
147
|
+
const config = computed(() => {
|
|
148
|
+
var _a;
|
|
149
|
+
const config = ((_a = props.config) === null || _a === void 0 ? void 0 : _a.config) || [];
|
|
150
|
+
const ret = config.map((item) => {
|
|
151
|
+
const newRows = [[]];
|
|
152
|
+
const rows = item.rows || [];
|
|
153
|
+
rows.forEach((item) => {
|
|
154
|
+
item.positionIndex = 0;
|
|
155
|
+
const lastRow = newRows[newRows.length - 1];
|
|
156
|
+
const lastRowSpan = lastRow.reduce((pre, cur) => pre +
|
|
157
|
+
(cur.hide
|
|
158
|
+
? 0
|
|
159
|
+
: cur.singleRow || cur.wholeRow
|
|
160
|
+
? colCount.value
|
|
161
|
+
: cur.specialRow
|
|
162
|
+
? 2
|
|
163
|
+
: 1), 0);
|
|
164
|
+
const curSpan = item.hide ? 0 : item.specialRow ? 2 : 1;
|
|
165
|
+
if (item.singleRow || item.wholeRow || item.newRow) {
|
|
166
|
+
if (lastRowSpan === 0) {
|
|
167
|
+
lastRow.push(item);
|
|
168
|
+
}
|
|
169
|
+
else {
|
|
170
|
+
newRows.push([item]);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
if (lastRowSpan === 0 || lastRowSpan + curSpan <= colCount.value) {
|
|
175
|
+
item.positionIndex = lastRowSpan;
|
|
176
|
+
lastRow.push(item);
|
|
177
|
+
}
|
|
178
|
+
else {
|
|
179
|
+
newRows.push([item]);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
return Object.assign(Object.assign({}, item), { rows: newRows });
|
|
184
|
+
});
|
|
185
|
+
return ret;
|
|
186
|
+
});
|
|
187
|
+
return { config };
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
function useApi(formRef) {
|
|
191
|
+
function clearValidate(nameList) {
|
|
192
|
+
var _a;
|
|
193
|
+
(_a = formRef.value) === null || _a === void 0 ? void 0 : _a.clearValidate(nameList);
|
|
194
|
+
}
|
|
195
|
+
function resetFields(nameList) {
|
|
196
|
+
var _a;
|
|
197
|
+
(_a = formRef.value) === null || _a === void 0 ? void 0 : _a.resetFields(nameList);
|
|
198
|
+
}
|
|
199
|
+
function scrollToField(name, options) {
|
|
200
|
+
var _a;
|
|
201
|
+
(_a = formRef.value) === null || _a === void 0 ? void 0 : _a.scrollToField(name, options);
|
|
202
|
+
}
|
|
203
|
+
function validate(nameList) {
|
|
204
|
+
var _a;
|
|
205
|
+
if (formRef.value) {
|
|
206
|
+
return (_a = formRef.value) === null || _a === void 0 ? void 0 : _a.validate(nameList);
|
|
207
|
+
}
|
|
208
|
+
else {
|
|
209
|
+
return Promise.reject(new Error('获取表单失败'));
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
function validateFields(nameList) {
|
|
213
|
+
var _a;
|
|
214
|
+
if (formRef.value) {
|
|
215
|
+
return (_a = formRef.value) === null || _a === void 0 ? void 0 : _a.validate(nameList);
|
|
216
|
+
}
|
|
217
|
+
else {
|
|
218
|
+
return Promise.reject(new Error('获取表单失败'));
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
return { clearValidate, resetFields, scrollToField, validate, validateFields };
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
function useEvent(tmpForm, emits) {
|
|
225
|
+
function onFormItemChange(e, item, selectedOptions) {
|
|
226
|
+
emits('update:form', tmpForm.value || {});
|
|
227
|
+
emits(`change:formItem`, e, item.prop, selectedOptions);
|
|
228
|
+
if (item.onChange) {
|
|
229
|
+
item.onChange(e, tmpForm.value, selectedOptions);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
function onFormItemClick(e, item) {
|
|
233
|
+
emits(`click:formItem`, e, item.prop);
|
|
234
|
+
if (item.onClick) {
|
|
235
|
+
item.onClick(e, tmpForm.value);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
function onFormItemBlur(e, item) {
|
|
239
|
+
emits(`blur:formItem`, e, item.prop);
|
|
240
|
+
if (item.onBlur) {
|
|
241
|
+
item.onBlur(e, tmpForm.value);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
function onFormItemPressEnter(e, item) {
|
|
245
|
+
emits(`pressEnter:formItem`, e, item.prop);
|
|
246
|
+
if (item.onPressEnter) {
|
|
247
|
+
item.onPressEnter(e, tmpForm.value);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
function onFormItemKeyup(e, item) {
|
|
251
|
+
emits(`keyup:formItem`, e, item.prop);
|
|
252
|
+
if (item.onKeyup) {
|
|
253
|
+
item.onKeyup(e, tmpForm.value);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
function onFormItemFocus(e, item) {
|
|
257
|
+
emits(`focus:formItem`, e, item.prop);
|
|
258
|
+
if (item.onFocus) {
|
|
259
|
+
item.onFocus(e, tmpForm.value);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
return {
|
|
263
|
+
onFormItemChange,
|
|
264
|
+
onFormItemClick,
|
|
265
|
+
onFormItemBlur,
|
|
266
|
+
onFormItemPressEnter,
|
|
267
|
+
onFormItemKeyup,
|
|
268
|
+
onFormItemFocus,
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
var _export_sfc = (sfc, props) => {
|
|
273
|
+
const target = sfc.__vccOpts || sfc;
|
|
274
|
+
for (const [key, val] of props) {
|
|
275
|
+
target[key] = val;
|
|
276
|
+
}
|
|
277
|
+
return target;
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
281
|
+
__name: "group",
|
|
282
|
+
setup(__props) {
|
|
283
|
+
const formItemContext = Form.useInjectFormItemContext();
|
|
284
|
+
function onFieldChange() {
|
|
285
|
+
formItemContext.onFieldChange();
|
|
286
|
+
}
|
|
287
|
+
function onFieldBlur() {
|
|
288
|
+
formItemContext.onFieldBlur();
|
|
289
|
+
}
|
|
290
|
+
return (_ctx, _cache) => {
|
|
291
|
+
const _component_a_input_group = resolveComponent("a-input-group");
|
|
292
|
+
return openBlock(), createBlock(_component_a_input_group, { compact: "" }, {
|
|
293
|
+
default: withCtx(() => [
|
|
294
|
+
renderSlot(_ctx.$slots, "default", {
|
|
295
|
+
onFieldChange,
|
|
296
|
+
onFieldBlur
|
|
297
|
+
})
|
|
298
|
+
]),
|
|
299
|
+
_: 3
|
|
300
|
+
});
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
});
|
|
304
|
+
var Group = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__file", "group.vue"]]);
|
|
305
|
+
|
|
306
|
+
const _hoisted_1 = {
|
|
307
|
+
key: 1,
|
|
308
|
+
class: "block-inner"
|
|
309
|
+
};
|
|
310
|
+
const _hoisted_2 = {
|
|
311
|
+
key: 0,
|
|
312
|
+
class: "block-title"
|
|
313
|
+
};
|
|
314
|
+
const _hoisted_3 = { class: "block-main" };
|
|
315
|
+
const __default__ = {
|
|
316
|
+
name: "BmEditForm"
|
|
317
|
+
};
|
|
318
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
319
|
+
...__default__,
|
|
320
|
+
props: editFormProps(),
|
|
321
|
+
emits: ["update:form", "change:formItem", "click:formItem", "blur:formItem", "pressEnter:formItem", "keyup:formItem", "focus:formItem"],
|
|
322
|
+
setup(__props, { expose, emit: emits }) {
|
|
323
|
+
const props = __props;
|
|
324
|
+
const tmpForm = ref({});
|
|
325
|
+
const formRef = ref(null);
|
|
326
|
+
const colCount = computed(() => {
|
|
327
|
+
return props.config?.global?.colCount || 1;
|
|
328
|
+
});
|
|
329
|
+
watch(
|
|
330
|
+
() => props.form,
|
|
331
|
+
(val = {}) => {
|
|
332
|
+
tmpForm.value = val || {};
|
|
333
|
+
},
|
|
334
|
+
{ deep: true, immediate: true }
|
|
335
|
+
);
|
|
336
|
+
const {
|
|
337
|
+
getValueOfOption,
|
|
338
|
+
getPopupContainer,
|
|
339
|
+
getColsConfig,
|
|
340
|
+
getControlWidth,
|
|
341
|
+
getShowValue
|
|
342
|
+
} = useUtils(props, colCount, tmpForm);
|
|
343
|
+
const { config } = useConfig(props, colCount);
|
|
344
|
+
const {
|
|
345
|
+
onFormItemChange,
|
|
346
|
+
onFormItemClick,
|
|
347
|
+
onFormItemBlur,
|
|
348
|
+
onFormItemPressEnter,
|
|
349
|
+
onFormItemKeyup,
|
|
350
|
+
onFormItemFocus
|
|
351
|
+
} = useEvent(tmpForm, emits);
|
|
352
|
+
const { clearValidate, resetFields, scrollToField, validate, validateFields } = useApi(formRef);
|
|
353
|
+
function updateSlot(key, value) {
|
|
354
|
+
tmpForm.value[key] = value;
|
|
355
|
+
emits("update:form", tmpForm.value || {});
|
|
356
|
+
}
|
|
357
|
+
expose({
|
|
358
|
+
clearValidate,
|
|
359
|
+
resetFields,
|
|
360
|
+
scrollToField,
|
|
361
|
+
validate,
|
|
362
|
+
validateFields
|
|
363
|
+
});
|
|
364
|
+
return (_ctx, _cache) => {
|
|
365
|
+
const _component_a_tooltip = resolveComponent("a-tooltip");
|
|
366
|
+
const _component_a_space = resolveComponent("a-space");
|
|
367
|
+
const _component_a_switch = resolveComponent("a-switch");
|
|
368
|
+
const _component_a_select_option = resolveComponent("a-select-option");
|
|
369
|
+
const _component_a_select = resolveComponent("a-select");
|
|
370
|
+
const _component_a_input = resolveComponent("a-input");
|
|
371
|
+
const _component_a_input_number = resolveComponent("a-input-number");
|
|
372
|
+
const _component_a_textarea = resolveComponent("a-textarea");
|
|
373
|
+
const _component_a_checkbox = resolveComponent("a-checkbox");
|
|
374
|
+
const _component_a_checkbox_group = resolveComponent("a-checkbox-group");
|
|
375
|
+
const _component_a_radio = resolveComponent("a-radio");
|
|
376
|
+
const _component_a_radio_group = resolveComponent("a-radio-group");
|
|
377
|
+
const _component_a_cascader = resolveComponent("a-cascader");
|
|
378
|
+
const _component_a_date_picker = resolveComponent("a-date-picker");
|
|
379
|
+
const _component_a_time_picker = resolveComponent("a-time-picker");
|
|
380
|
+
const _component_a_range_picker = resolveComponent("a-range-picker");
|
|
381
|
+
const _component_a_form_item = resolveComponent("a-form-item");
|
|
382
|
+
const _component_a_form = resolveComponent("a-form");
|
|
383
|
+
return openBlock(), createBlock(_component_a_form, {
|
|
384
|
+
ref_key: "formRef",
|
|
385
|
+
ref: formRef,
|
|
386
|
+
class: "edit-form",
|
|
387
|
+
model: tmpForm.value,
|
|
388
|
+
rules: { ...props.config?.rules, ...props.groupRules },
|
|
389
|
+
layout: props.config?.global?.layout || "horizontal",
|
|
390
|
+
autocomplete: props.config?.global?.autocomplete || "off"
|
|
391
|
+
}, {
|
|
392
|
+
default: withCtx(() => [
|
|
393
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(config), (block, blockIndex) => {
|
|
394
|
+
return openBlock(), createElementBlock(Fragment, { key: blockIndex }, [
|
|
395
|
+
!block.hide && (block.visibleControl ? block.visibleControl(tmpForm.value) : true) ? (openBlock(), createElementBlock("div", {
|
|
396
|
+
key: 0,
|
|
397
|
+
class: normalizeClass(["block", [
|
|
398
|
+
block.class || "",
|
|
399
|
+
block.slot ? "block--slot" : "",
|
|
400
|
+
block.slot ? "block--slot--" + block.slot : ""
|
|
401
|
+
]])
|
|
402
|
+
}, [
|
|
403
|
+
block.slot ? renderSlot(_ctx.$slots, block.slot, {
|
|
404
|
+
key: 0,
|
|
405
|
+
update: updateSlot,
|
|
406
|
+
tmpForm: tmpForm.value
|
|
407
|
+
}) : (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
408
|
+
block.title ? (openBlock(), createElementBlock("div", _hoisted_2, toDisplayString(block.title), 1)) : createCommentVNode("v-if", true),
|
|
409
|
+
createElementVNode("div", _hoisted_3, [
|
|
410
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(block.rows, (row, rowIndex) => {
|
|
411
|
+
return openBlock(), createElementBlock("div", {
|
|
412
|
+
key: rowIndex,
|
|
413
|
+
class: "row"
|
|
414
|
+
}, [
|
|
415
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(row, (item, itemIndex) => {
|
|
416
|
+
return openBlock(), createElementBlock(Fragment, {
|
|
417
|
+
key: item.prop
|
|
418
|
+
}, [
|
|
419
|
+
!item.hide && (item.visibleControl ? item.visibleControl(tmpForm.value) : true) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
420
|
+
item.slot ? renderSlot(_ctx.$slots, item.slot, {
|
|
421
|
+
key: 0,
|
|
422
|
+
update: updateSlot,
|
|
423
|
+
tmpForm: tmpForm.value,
|
|
424
|
+
injectProps: {
|
|
425
|
+
id: item.slot,
|
|
426
|
+
class: [
|
|
427
|
+
"row-item",
|
|
428
|
+
item.formItemClass || "",
|
|
429
|
+
item.align === "right" ? "row-item--right" : "",
|
|
430
|
+
item.type === "text" ? "row-item--text" : "",
|
|
431
|
+
item.type === "placeholder" ? "row-item--placeholder" : "",
|
|
432
|
+
item.prop ? "row-item--" + item.prop : ""
|
|
433
|
+
],
|
|
434
|
+
name: item.slot,
|
|
435
|
+
required: item.required,
|
|
436
|
+
colon: item.colon,
|
|
437
|
+
labelCol: unref(getColsConfig)("labelCol", item, itemIndex),
|
|
438
|
+
wrapperCol: unref(getColsConfig)("wrapperCol", item, itemIndex),
|
|
439
|
+
style: { width: unref(getControlWidth)(item) }
|
|
440
|
+
},
|
|
441
|
+
config: item
|
|
442
|
+
}) : (openBlock(), createBlock(_component_a_form_item, {
|
|
443
|
+
key: 1,
|
|
444
|
+
id: item.prop,
|
|
445
|
+
class: normalizeClass(["row-item", [
|
|
446
|
+
item.formItemClass || "",
|
|
447
|
+
item.align === "right" ? "row-item--right" : "",
|
|
448
|
+
item.type === "text" ? "row-item--text" : "",
|
|
449
|
+
item.type === "placeholder" ? "row-item--placeholder" : "",
|
|
450
|
+
item.prop ? "row-item--" + item.prop : ""
|
|
451
|
+
]]),
|
|
452
|
+
name: item.prop,
|
|
453
|
+
required: item.required,
|
|
454
|
+
colon: item.colon,
|
|
455
|
+
"label-col": unref(getColsConfig)("labelCol", item, itemIndex),
|
|
456
|
+
"wrapper-col": unref(getColsConfig)("wrapperCol", item, itemIndex),
|
|
457
|
+
style: normalizeStyle({ width: unref(getControlWidth)(item) })
|
|
458
|
+
}, {
|
|
459
|
+
label: withCtx(() => [
|
|
460
|
+
item.tip ? (openBlock(), createBlock(_component_a_space, {
|
|
461
|
+
key: 0,
|
|
462
|
+
size: 4
|
|
463
|
+
}, {
|
|
464
|
+
default: withCtx(() => [
|
|
465
|
+
createTextVNode(toDisplayString(item.label) + " ", 1),
|
|
466
|
+
createVNode(_component_a_tooltip, {
|
|
467
|
+
placement: item.tipPlacement || "top",
|
|
468
|
+
"get-popup-container": props.config?.global?.getPopupContainer || unref(getPopupContainer),
|
|
469
|
+
"arrow-point-at-center": true,
|
|
470
|
+
"overlay-style": {
|
|
471
|
+
width: item.tipWidth,
|
|
472
|
+
"max-width": item.tipWidth
|
|
473
|
+
}
|
|
474
|
+
}, {
|
|
475
|
+
title: withCtx(() => [
|
|
476
|
+
createElementVNode("div", null, toDisplayString(item.tip), 1)
|
|
477
|
+
]),
|
|
478
|
+
default: withCtx(() => [
|
|
479
|
+
createVNode(unref(QuestionCircleOutlined), { style: { "color": "#9393a3", "margin-right": "5px" } })
|
|
480
|
+
]),
|
|
481
|
+
_: 2
|
|
482
|
+
}, 1032, ["placement", "get-popup-container", "overlay-style"])
|
|
483
|
+
]),
|
|
484
|
+
_: 2
|
|
485
|
+
}, 1024)) : (openBlock(), createBlock(_component_a_space, { key: 1 }, {
|
|
486
|
+
default: withCtx(() => [
|
|
487
|
+
createTextVNode(toDisplayString(item.label), 1)
|
|
488
|
+
]),
|
|
489
|
+
_: 2
|
|
490
|
+
}, 1024))
|
|
491
|
+
]),
|
|
492
|
+
default: withCtx(() => [
|
|
493
|
+
item.slotBefore ? renderSlot(_ctx.$slots, item.slotBefore, {
|
|
494
|
+
key: 0,
|
|
495
|
+
update: updateSlot,
|
|
496
|
+
tmpForm: tmpForm.value,
|
|
497
|
+
validate: (nameList = [item.prop]) => unref(validate)(nameList)
|
|
498
|
+
}) : createCommentVNode("v-if", true),
|
|
499
|
+
item.type === "slot" ? renderSlot(_ctx.$slots, item.prop, {
|
|
500
|
+
key: 1,
|
|
501
|
+
update: updateSlot,
|
|
502
|
+
tmpForm: tmpForm.value,
|
|
503
|
+
validate: (nameList = [item.prop]) => unref(validate)(nameList)
|
|
504
|
+
}) : createCommentVNode("v-if", true),
|
|
505
|
+
item.type === "switch" ? (openBlock(), createBlock(_component_a_switch, {
|
|
506
|
+
key: 2,
|
|
507
|
+
checked: tmpForm.value[item.prop],
|
|
508
|
+
"onUpdate:checked": ($event) => tmpForm.value[item.prop] = $event,
|
|
509
|
+
class: normalizeClass([
|
|
510
|
+
item.class || "",
|
|
511
|
+
item.getClass ? item.getClass(tmpForm.value, item.prop) : ""
|
|
512
|
+
]),
|
|
513
|
+
style: normalizeStyle({
|
|
514
|
+
...item.style,
|
|
515
|
+
...item.getStyle?.(tmpForm.value, item.prop)
|
|
516
|
+
}),
|
|
517
|
+
disabled: item.disabled || item.disabledControl?.(tmpForm.value),
|
|
518
|
+
onChange: (checked) => unref(onFormItemChange)(checked, item),
|
|
519
|
+
onClick: (checked) => unref(onFormItemClick)(checked, item),
|
|
520
|
+
onFocus: (e) => unref(onFormItemFocus)(e, item)
|
|
521
|
+
}, null, 8, ["checked", "onUpdate:checked", "class", "style", "disabled", "onChange", "onClick", "onFocus"])) : createCommentVNode("v-if", true),
|
|
522
|
+
item.type === "select" ? (openBlock(), createBlock(_component_a_select, {
|
|
523
|
+
key: 3,
|
|
524
|
+
value: tmpForm.value[item.prop],
|
|
525
|
+
"onUpdate:value": ($event) => tmpForm.value[item.prop] = $event,
|
|
526
|
+
class: normalizeClass([
|
|
527
|
+
item.class || "",
|
|
528
|
+
item.getClass ? item.getClass(tmpForm.value, item.prop) : ""
|
|
529
|
+
]),
|
|
530
|
+
style: normalizeStyle({
|
|
531
|
+
...item.style,
|
|
532
|
+
...item.getStyle?.(tmpForm.value, item.prop)
|
|
533
|
+
}),
|
|
534
|
+
mode: item.mode,
|
|
535
|
+
"max-tag-count": item.maxTagCount,
|
|
536
|
+
"max-tag-placeholder": (omittedValues) => "+ " + omittedValues.length,
|
|
537
|
+
"show-search": item.showSearch,
|
|
538
|
+
disabled: item.disabled || item.disabledControl?.(tmpForm.value),
|
|
539
|
+
"allow-clear": item.allowClear,
|
|
540
|
+
"show-arrow": "",
|
|
541
|
+
"option-filter-prop": item.optionFilterProp || "label",
|
|
542
|
+
placeholder: item.placeholder || "\u8BF7\u9009\u62E9",
|
|
543
|
+
"get-popup-container": props.config?.global?.getPopupContainer || item.getPopupContainer || void 0,
|
|
544
|
+
onChange: (e) => unref(onFormItemChange)(e, item),
|
|
545
|
+
onFocus: (e) => unref(onFormItemFocus)(e, item)
|
|
546
|
+
}, {
|
|
547
|
+
default: withCtx(() => [
|
|
548
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(item.options, (option) => {
|
|
549
|
+
return openBlock(), createBlock(_component_a_select_option, {
|
|
550
|
+
key: unref(getValueOfOption)(
|
|
551
|
+
item.optionValueName,
|
|
552
|
+
"value",
|
|
553
|
+
option
|
|
554
|
+
),
|
|
555
|
+
value: unref(getValueOfOption)(
|
|
556
|
+
item.optionValueName,
|
|
557
|
+
"value",
|
|
558
|
+
option
|
|
559
|
+
),
|
|
560
|
+
label: unref(getValueOfOption)(
|
|
561
|
+
item.optionLabelName,
|
|
562
|
+
"label",
|
|
563
|
+
option
|
|
564
|
+
),
|
|
565
|
+
disabled: option?.disabled,
|
|
566
|
+
class: normalizeClass([
|
|
567
|
+
option.class || "",
|
|
568
|
+
option.getClass ? option.getClass(tmpForm.value, item.prop, option) : ""
|
|
569
|
+
])
|
|
570
|
+
}, {
|
|
571
|
+
default: withCtx(() => [
|
|
572
|
+
createVNode(unref(BmOverTooltips), {
|
|
573
|
+
title: unref(getValueOfOption)(
|
|
574
|
+
item.optionLabelName,
|
|
575
|
+
"label",
|
|
576
|
+
option
|
|
577
|
+
)
|
|
578
|
+
}, null, 8, ["title"])
|
|
579
|
+
]),
|
|
580
|
+
_: 2
|
|
581
|
+
}, 1032, ["value", "label", "disabled", "class"]);
|
|
582
|
+
}), 128))
|
|
583
|
+
]),
|
|
584
|
+
_: 2
|
|
585
|
+
}, 1032, ["value", "onUpdate:value", "class", "style", "mode", "max-tag-count", "max-tag-placeholder", "show-search", "disabled", "allow-clear", "option-filter-prop", "placeholder", "get-popup-container", "onChange", "onFocus"])) : createCommentVNode("v-if", true),
|
|
586
|
+
item.type === "input" ? (openBlock(), createBlock(_component_a_input, {
|
|
587
|
+
key: 4,
|
|
588
|
+
value: tmpForm.value[item.prop],
|
|
589
|
+
"onUpdate:value": ($event) => tmpForm.value[item.prop] = $event,
|
|
590
|
+
class: normalizeClass([
|
|
591
|
+
item.class || "",
|
|
592
|
+
item.getClass ? item.getClass(tmpForm.value, item.prop) : ""
|
|
593
|
+
]),
|
|
594
|
+
style: normalizeStyle({
|
|
595
|
+
...item.style,
|
|
596
|
+
...item.getStyle?.(tmpForm.value, item.prop)
|
|
597
|
+
}),
|
|
598
|
+
maxlength: item.maxlength,
|
|
599
|
+
disabled: item.disabled || item.disabledControl?.(tmpForm.value),
|
|
600
|
+
"allow-clear": item.allowClear,
|
|
601
|
+
type: item.inputType,
|
|
602
|
+
placeholder: item.placeholder || "\u8BF7\u8F93\u5165",
|
|
603
|
+
prefix: item.prefix || "",
|
|
604
|
+
suffix: item.suffix || "",
|
|
605
|
+
"addon-before": item.addonBefore || "",
|
|
606
|
+
"addon-after": item.addonAfter || "",
|
|
607
|
+
onChange: (e) => unref(onFormItemChange)(e, item),
|
|
608
|
+
onBlur: (e) => unref(onFormItemBlur)(e, item),
|
|
609
|
+
onPressEnter: (e) => unref(onFormItemPressEnter)(e, item),
|
|
610
|
+
onKeyup: (e) => unref(onFormItemKeyup)(e, item),
|
|
611
|
+
onFocus: (e) => unref(onFormItemFocus)(e, item)
|
|
612
|
+
}, null, 8, ["value", "onUpdate:value", "class", "style", "maxlength", "disabled", "allow-clear", "type", "placeholder", "prefix", "suffix", "addon-before", "addon-after", "onChange", "onBlur", "onPressEnter", "onKeyup", "onFocus"])) : createCommentVNode("v-if", true),
|
|
613
|
+
item.type === "inputNumber" ? (openBlock(), createBlock(_component_a_input_number, {
|
|
614
|
+
key: 5,
|
|
615
|
+
value: tmpForm.value[item.prop],
|
|
616
|
+
"onUpdate:value": ($event) => tmpForm.value[item.prop] = $event,
|
|
617
|
+
class: normalizeClass([
|
|
618
|
+
item.class || "",
|
|
619
|
+
item.getClass ? item.getClass(tmpForm.value, item.prop) : ""
|
|
620
|
+
]),
|
|
621
|
+
style: normalizeStyle({
|
|
622
|
+
...item.style,
|
|
623
|
+
...item.getStyle?.(tmpForm.value, item.prop)
|
|
624
|
+
}),
|
|
625
|
+
disabled: item.disabled || item.disabledControl?.(tmpForm.value),
|
|
626
|
+
precision: item.precision || 0,
|
|
627
|
+
parser: item.parser,
|
|
628
|
+
placeholder: item.placeholder || "\u8BF7\u8F93\u5165",
|
|
629
|
+
prefix: item.prefix || "",
|
|
630
|
+
suffix: item.suffix || "",
|
|
631
|
+
"addon-before": item.addonBefore || "",
|
|
632
|
+
"addon-after": item.addonAfter || "",
|
|
633
|
+
"allow-clear": item.allowClear,
|
|
634
|
+
formatter: item.formatter,
|
|
635
|
+
min: item.min || 0,
|
|
636
|
+
max: item.max || 99999.99,
|
|
637
|
+
step: item.step || 1,
|
|
638
|
+
onChange: (e) => unref(onFormItemChange)(e, item),
|
|
639
|
+
onBlur: (e) => unref(onFormItemBlur)(e, item),
|
|
640
|
+
onPressEnter: (e) => unref(onFormItemPressEnter)(e, item),
|
|
641
|
+
onKeyup: (e) => unref(onFormItemKeyup)(e, item),
|
|
642
|
+
onFocus: (e) => unref(onFormItemFocus)(e, item)
|
|
643
|
+
}, null, 8, ["value", "onUpdate:value", "class", "style", "disabled", "precision", "parser", "placeholder", "prefix", "suffix", "addon-before", "addon-after", "allow-clear", "formatter", "min", "max", "step", "onChange", "onBlur", "onPressEnter", "onKeyup", "onFocus"])) : createCommentVNode("v-if", true),
|
|
644
|
+
item.type === "textarea" ? (openBlock(), createBlock(_component_a_textarea, {
|
|
645
|
+
key: 6,
|
|
646
|
+
value: tmpForm.value[item.prop],
|
|
647
|
+
"onUpdate:value": ($event) => tmpForm.value[item.prop] = $event,
|
|
648
|
+
class: normalizeClass([
|
|
649
|
+
item.class || "",
|
|
650
|
+
item.getClass ? item.getClass(tmpForm.value, item.prop) : ""
|
|
651
|
+
]),
|
|
652
|
+
style: normalizeStyle([{
|
|
653
|
+
...item.style,
|
|
654
|
+
...item.getStyle?.(tmpForm.value, item.prop)
|
|
655
|
+
}, { "min-height": "88px" }]),
|
|
656
|
+
disabled: item.disabled || item.disabledControl?.(tmpForm.value),
|
|
657
|
+
maxlength: item.maxlength,
|
|
658
|
+
"show-count": item.showCount,
|
|
659
|
+
placeholder: item.placeholder || "\u8BF7\u8F93\u5165",
|
|
660
|
+
"allow-clear": item.allowClear,
|
|
661
|
+
"auto-size": item.autoSize,
|
|
662
|
+
onChange: (e) => unref(onFormItemChange)(e, item),
|
|
663
|
+
onBlur: (e) => unref(onFormItemBlur)(e, item),
|
|
664
|
+
onPressEnter: (e) => unref(onFormItemPressEnter)(e, item),
|
|
665
|
+
onKeyup: (e) => unref(onFormItemKeyup)(e, item),
|
|
666
|
+
onFocus: (e) => unref(onFormItemFocus)(e, item)
|
|
667
|
+
}, null, 8, ["value", "onUpdate:value", "class", "style", "disabled", "maxlength", "show-count", "placeholder", "allow-clear", "auto-size", "onChange", "onBlur", "onPressEnter", "onKeyup", "onFocus"])) : createCommentVNode("v-if", true),
|
|
668
|
+
item.type === "checkbox" ? (openBlock(), createBlock(_component_a_checkbox_group, {
|
|
669
|
+
key: 7,
|
|
670
|
+
value: tmpForm.value[item.prop],
|
|
671
|
+
"onUpdate:value": ($event) => tmpForm.value[item.prop] = $event,
|
|
672
|
+
class: normalizeClass([
|
|
673
|
+
item.class || "",
|
|
674
|
+
item.getClass ? item.getClass(tmpForm.value, item.prop) : ""
|
|
675
|
+
]),
|
|
676
|
+
style: normalizeStyle({
|
|
677
|
+
...item.style,
|
|
678
|
+
...item.getStyle?.(tmpForm.value, item.prop)
|
|
679
|
+
}),
|
|
680
|
+
disabled: item.disabled || item.disabledControl?.(tmpForm.value),
|
|
681
|
+
onChange: (e) => unref(onFormItemChange)(e, item),
|
|
682
|
+
onFocus: (e) => unref(onFormItemFocus)(e, item)
|
|
683
|
+
}, {
|
|
684
|
+
default: withCtx(() => [
|
|
685
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(item.options, (option) => {
|
|
686
|
+
return openBlock(), createBlock(_component_a_checkbox, {
|
|
687
|
+
key: unref(getValueOfOption)(
|
|
688
|
+
item.optionValueName,
|
|
689
|
+
"value",
|
|
690
|
+
option
|
|
691
|
+
),
|
|
692
|
+
value: unref(getValueOfOption)(
|
|
693
|
+
item.optionValueName,
|
|
694
|
+
"value",
|
|
695
|
+
option
|
|
696
|
+
),
|
|
697
|
+
label: unref(getValueOfOption)(
|
|
698
|
+
item.optionLabelName,
|
|
699
|
+
"label",
|
|
700
|
+
option
|
|
701
|
+
),
|
|
702
|
+
disabled: option?.disabled,
|
|
703
|
+
class: normalizeClass([
|
|
704
|
+
option.class || "",
|
|
705
|
+
option.getClass ? option.getClass(tmpForm.value, item.prop, option) : ""
|
|
706
|
+
])
|
|
707
|
+
}, {
|
|
708
|
+
default: withCtx(() => [
|
|
709
|
+
createTextVNode(toDisplayString(unref(getValueOfOption)(
|
|
710
|
+
item.optionLabelName,
|
|
711
|
+
"label",
|
|
712
|
+
option
|
|
713
|
+
)), 1)
|
|
714
|
+
]),
|
|
715
|
+
_: 2
|
|
716
|
+
}, 1032, ["value", "label", "disabled", "class"]);
|
|
717
|
+
}), 128))
|
|
718
|
+
]),
|
|
719
|
+
_: 2
|
|
720
|
+
}, 1032, ["value", "onUpdate:value", "class", "style", "disabled", "onChange", "onFocus"])) : createCommentVNode("v-if", true),
|
|
721
|
+
item.type === "radio" ? (openBlock(), createBlock(_component_a_radio_group, {
|
|
722
|
+
key: 8,
|
|
723
|
+
value: tmpForm.value[item.prop],
|
|
724
|
+
"onUpdate:value": ($event) => tmpForm.value[item.prop] = $event,
|
|
725
|
+
class: normalizeClass([
|
|
726
|
+
item.class || "",
|
|
727
|
+
item.getClass ? item.getClass(tmpForm.value, item.prop) : ""
|
|
728
|
+
]),
|
|
729
|
+
style: normalizeStyle({
|
|
730
|
+
...item.style,
|
|
731
|
+
...item.getStyle?.(tmpForm.value, item.prop)
|
|
732
|
+
}),
|
|
733
|
+
disabled: item.disabled || item.disabledControl?.(tmpForm.value),
|
|
734
|
+
onChange: (e) => unref(onFormItemChange)(e, item),
|
|
735
|
+
onFocus: (e) => unref(onFormItemFocus)(e, item)
|
|
736
|
+
}, {
|
|
737
|
+
default: withCtx(() => [
|
|
738
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(item.options, (option) => {
|
|
739
|
+
return openBlock(), createBlock(_component_a_radio, {
|
|
740
|
+
key: unref(getValueOfOption)(
|
|
741
|
+
item.optionValueName,
|
|
742
|
+
"value",
|
|
743
|
+
option
|
|
744
|
+
),
|
|
745
|
+
value: unref(getValueOfOption)(
|
|
746
|
+
item.optionValueName,
|
|
747
|
+
"value",
|
|
748
|
+
option
|
|
749
|
+
),
|
|
750
|
+
label: unref(getValueOfOption)(
|
|
751
|
+
item.optionLabelName,
|
|
752
|
+
"label",
|
|
753
|
+
option
|
|
754
|
+
),
|
|
755
|
+
disabled: option?.disabled,
|
|
756
|
+
class: normalizeClass([
|
|
757
|
+
option.class || "",
|
|
758
|
+
option.getClass ? option.getClass(tmpForm.value, item.prop, option) : ""
|
|
759
|
+
])
|
|
760
|
+
}, {
|
|
761
|
+
default: withCtx(() => [
|
|
762
|
+
createTextVNode(toDisplayString(unref(getValueOfOption)(
|
|
763
|
+
item.optionLabelName,
|
|
764
|
+
"label",
|
|
765
|
+
option
|
|
766
|
+
)), 1)
|
|
767
|
+
]),
|
|
768
|
+
_: 2
|
|
769
|
+
}, 1032, ["value", "label", "disabled", "class"]);
|
|
770
|
+
}), 128))
|
|
771
|
+
]),
|
|
772
|
+
_: 2
|
|
773
|
+
}, 1032, ["value", "onUpdate:value", "class", "style", "disabled", "onChange", "onFocus"])) : createCommentVNode("v-if", true),
|
|
774
|
+
item.type === "cascader" ? (openBlock(), createBlock(_component_a_cascader, {
|
|
775
|
+
key: 9,
|
|
776
|
+
value: tmpForm.value[item.prop],
|
|
777
|
+
"onUpdate:value": ($event) => tmpForm.value[item.prop] = $event,
|
|
778
|
+
class: normalizeClass([
|
|
779
|
+
item.class || "",
|
|
780
|
+
item.getClass ? item.getClass(tmpForm.value, item.prop) : ""
|
|
781
|
+
]),
|
|
782
|
+
style: normalizeStyle({
|
|
783
|
+
...item.style,
|
|
784
|
+
...item.getStyle?.(tmpForm.value, item.prop)
|
|
785
|
+
}),
|
|
786
|
+
"field-names": {
|
|
787
|
+
label: item.optionLabelName || "label",
|
|
788
|
+
value: item.optionValueName || "value",
|
|
789
|
+
children: item.optionChildrenName || "children"
|
|
790
|
+
},
|
|
791
|
+
"show-search": item.showSearch,
|
|
792
|
+
disabled: item.disabled || item.disabledControl?.(tmpForm.value),
|
|
793
|
+
placeholder: item.placeholder || "\u8BF7\u9009\u62E9",
|
|
794
|
+
options: item.options,
|
|
795
|
+
"change-on-select": item.changeOnSelect,
|
|
796
|
+
"expand-trigger": item.expandTrigger || "click",
|
|
797
|
+
"get-popup-container": props.config?.global?.getPopupContainer || item.getPopupContainer || void 0,
|
|
798
|
+
onChange: (e, selectedOptions) => unref(onFormItemChange)(e, item, selectedOptions),
|
|
799
|
+
onFocus: (e) => unref(onFormItemFocus)(e, item)
|
|
800
|
+
}, null, 8, ["value", "onUpdate:value", "class", "style", "field-names", "show-search", "disabled", "placeholder", "options", "change-on-select", "expand-trigger", "get-popup-container", "onChange", "onFocus"])) : createCommentVNode("v-if", true),
|
|
801
|
+
item.type === "datePicker" ? (openBlock(), createBlock(_component_a_date_picker, {
|
|
802
|
+
key: 10,
|
|
803
|
+
value: tmpForm.value[item.prop],
|
|
804
|
+
"onUpdate:value": ($event) => tmpForm.value[item.prop] = $event,
|
|
805
|
+
class: normalizeClass([
|
|
806
|
+
item.class || "",
|
|
807
|
+
item.getClass ? item.getClass(tmpForm.value, item.prop) : ""
|
|
808
|
+
]),
|
|
809
|
+
style: normalizeStyle([{
|
|
810
|
+
...item.style,
|
|
811
|
+
...item.getStyle?.(tmpForm.value, item.prop)
|
|
812
|
+
}, { "width": "100%" }]),
|
|
813
|
+
disabled: item.disabled || item.disabledControl?.(tmpForm.value),
|
|
814
|
+
"show-time": item.showTime,
|
|
815
|
+
"value-format": item.valueFormat,
|
|
816
|
+
"disabled-date": item.disabledDate,
|
|
817
|
+
"disabled-time": item.disabledTime,
|
|
818
|
+
"allow-clear": item.allowClear,
|
|
819
|
+
type: "date",
|
|
820
|
+
placeholder: item.placeholder || "\u8BF7\u9009\u62E9",
|
|
821
|
+
"get-popup-container": props.config?.global?.getPopupContainer || item.getPopupContainer || void 0,
|
|
822
|
+
onChange: (e) => unref(onFormItemChange)(e, item),
|
|
823
|
+
onFocus: (e) => unref(onFormItemFocus)(e, item)
|
|
824
|
+
}, createSlots({ _: 2 }, [
|
|
825
|
+
item.showTime ? {
|
|
826
|
+
name: "suffixIcon",
|
|
827
|
+
fn: withCtx(() => [
|
|
828
|
+
createVNode(unref(ClockCircleOutlined))
|
|
829
|
+
]),
|
|
830
|
+
key: "0"
|
|
831
|
+
} : void 0
|
|
832
|
+
]), 1032, ["value", "onUpdate:value", "class", "style", "disabled", "show-time", "value-format", "disabled-date", "disabled-time", "allow-clear", "placeholder", "get-popup-container", "onChange", "onFocus"])) : createCommentVNode("v-if", true),
|
|
833
|
+
item.type === "timePicker" ? (openBlock(), createBlock(_component_a_time_picker, {
|
|
834
|
+
key: 11,
|
|
835
|
+
value: tmpForm.value[item.prop],
|
|
836
|
+
"onUpdate:value": ($event) => tmpForm.value[item.prop] = $event,
|
|
837
|
+
class: normalizeClass([
|
|
838
|
+
item.class || "",
|
|
839
|
+
item.getClass ? item.getClass(tmpForm.value, item.prop) : ""
|
|
840
|
+
]),
|
|
841
|
+
style: normalizeStyle([{
|
|
842
|
+
...item.style,
|
|
843
|
+
...item.getStyle?.(tmpForm.value, item.prop)
|
|
844
|
+
}, { "width": "100%" }]),
|
|
845
|
+
disabled: item.disabled || item.disabledControl?.(tmpForm.value),
|
|
846
|
+
format: item.format,
|
|
847
|
+
"value-format": item.valueFormat,
|
|
848
|
+
"hour-step": item.hourStep,
|
|
849
|
+
"minute-step": item.minuteStep,
|
|
850
|
+
"second-step": item.secondStep,
|
|
851
|
+
"allow-clear": item.allowClear,
|
|
852
|
+
"use12-hours": item.use12Hours,
|
|
853
|
+
placeholder: item.placeholder || "\u8BF7\u9009\u62E9",
|
|
854
|
+
"get-popup-container": props.config?.global?.getPopupContainer || item.getPopupContainer || void 0,
|
|
855
|
+
onChange: (e) => unref(onFormItemChange)(e, item),
|
|
856
|
+
onFocus: (e) => unref(onFormItemFocus)(e, item)
|
|
857
|
+
}, createSlots({ _: 2 }, [
|
|
858
|
+
item.showTime ? {
|
|
859
|
+
name: "suffixIcon",
|
|
860
|
+
fn: withCtx(() => [
|
|
861
|
+
createVNode(unref(ClockCircleOutlined))
|
|
862
|
+
]),
|
|
863
|
+
key: "0"
|
|
864
|
+
} : void 0
|
|
865
|
+
]), 1032, ["value", "onUpdate:value", "class", "style", "disabled", "format", "value-format", "hour-step", "minute-step", "second-step", "allow-clear", "use12-hours", "placeholder", "get-popup-container", "onChange", "onFocus"])) : createCommentVNode("v-if", true),
|
|
866
|
+
item.type === "rangePicker" ? (openBlock(), createBlock(_component_a_range_picker, {
|
|
867
|
+
key: 12,
|
|
868
|
+
value: tmpForm.value[item.prop],
|
|
869
|
+
"onUpdate:value": ($event) => tmpForm.value[item.prop] = $event,
|
|
870
|
+
class: normalizeClass([
|
|
871
|
+
item.class || "",
|
|
872
|
+
item.getClass ? item.getClass(tmpForm.value, item.prop) : ""
|
|
873
|
+
]),
|
|
874
|
+
style: normalizeStyle([{
|
|
875
|
+
...item.style,
|
|
876
|
+
...item.getStyle?.(tmpForm.value, item.prop)
|
|
877
|
+
}, { "width": "100%" }]),
|
|
878
|
+
disabled: item.disabled || item.disabledControl?.(tmpForm.value),
|
|
879
|
+
"show-time": item.showTime,
|
|
880
|
+
"value-format": item.valueFormat,
|
|
881
|
+
"disabled-date": item.disabledDate,
|
|
882
|
+
"disabled-time": item.disabledTime,
|
|
883
|
+
"allow-clear": item.allowClear,
|
|
884
|
+
type: "date",
|
|
885
|
+
placeholder: item.placeholder || "\u8BF7\u9009\u62E9",
|
|
886
|
+
"get-popup-container": props.config?.global?.getPopupContainer || item.getPopupContainer || void 0,
|
|
887
|
+
onChange: (e) => unref(onFormItemChange)(e, item),
|
|
888
|
+
onFocus: (e) => unref(onFormItemFocus)(e, item)
|
|
889
|
+
}, {
|
|
890
|
+
suffixIcon: withCtx(() => [
|
|
891
|
+
createVNode(unref(CalendarOutlined))
|
|
892
|
+
]),
|
|
893
|
+
_: 2
|
|
894
|
+
}, 1032, ["value", "onUpdate:value", "class", "style", "disabled", "show-time", "value-format", "disabled-date", "disabled-time", "allow-clear", "placeholder", "get-popup-container", "onChange", "onFocus"])) : createCommentVNode("v-if", true),
|
|
895
|
+
item.type === "group" ? (openBlock(), createBlock(Group, {
|
|
896
|
+
key: 13,
|
|
897
|
+
fields: item.group?.map((i) => i.prop)
|
|
898
|
+
}, {
|
|
899
|
+
default: withCtx(({ onFieldChange, onFieldBlur }) => [
|
|
900
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(item.group || [], (groupItem) => {
|
|
901
|
+
return openBlock(), createElementBlock(Fragment, {
|
|
902
|
+
key: groupItem.prop
|
|
903
|
+
}, [
|
|
904
|
+
groupItem.type === "slot" ? renderSlot(_ctx.$slots, groupItem.prop, {
|
|
905
|
+
key: 0,
|
|
906
|
+
update: updateSlot,
|
|
907
|
+
tmpForm: tmpForm.value,
|
|
908
|
+
validate: (nameList = [item.prop, groupItem.prop]) => unref(validate)(nameList)
|
|
909
|
+
}) : createCommentVNode("v-if", true),
|
|
910
|
+
groupItem.type === "select" ? (openBlock(), createBlock(_component_a_select, {
|
|
911
|
+
key: 1,
|
|
912
|
+
value: tmpForm.value[groupItem.prop],
|
|
913
|
+
"onUpdate:value": ($event) => tmpForm.value[groupItem.prop] = $event,
|
|
914
|
+
class: normalizeClass([
|
|
915
|
+
groupItem.class || "",
|
|
916
|
+
groupItem.getClass ? groupItem.getClass(tmpForm.value, groupItem.prop) : ""
|
|
917
|
+
]),
|
|
918
|
+
style: normalizeStyle({
|
|
919
|
+
...groupItem.style,
|
|
920
|
+
...groupItem.getStyle?.(
|
|
921
|
+
tmpForm.value,
|
|
922
|
+
groupItem.prop
|
|
923
|
+
)
|
|
924
|
+
}),
|
|
925
|
+
mode: groupItem.mode,
|
|
926
|
+
"max-tag-count": groupItem.maxTagCount,
|
|
927
|
+
"max-tag-placeholder": (omittedValues) => "+ " + omittedValues.length,
|
|
928
|
+
"show-search": groupItem.showSearch,
|
|
929
|
+
disabled: groupItem.disabled || groupItem.disabledControl?.(tmpForm.value),
|
|
930
|
+
"allow-clear": groupItem.allowClear,
|
|
931
|
+
"show-arrow": "",
|
|
932
|
+
"option-filter-prop": groupItem.optionFilterProp || "label",
|
|
933
|
+
placeholder: groupItem.placeholder || "\u8BF7\u9009\u62E9",
|
|
934
|
+
"get-popup-container": props.config?.global?.getPopupContainer || item.getPopupContainer || void 0,
|
|
935
|
+
onChange: (e) => {
|
|
936
|
+
onFieldChange();
|
|
937
|
+
unref(onFormItemChange)(e, item);
|
|
938
|
+
},
|
|
939
|
+
onFocus: (e) => unref(onFormItemFocus)(e, item)
|
|
940
|
+
}, {
|
|
941
|
+
default: withCtx(() => [
|
|
942
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(groupItem.options, (option) => {
|
|
943
|
+
return openBlock(), createBlock(_component_a_select_option, {
|
|
944
|
+
key: unref(getValueOfOption)(
|
|
945
|
+
groupItem.optionValueName,
|
|
946
|
+
"value",
|
|
947
|
+
option
|
|
948
|
+
),
|
|
949
|
+
value: unref(getValueOfOption)(
|
|
950
|
+
groupItem.optionValueName,
|
|
951
|
+
"value",
|
|
952
|
+
option
|
|
953
|
+
),
|
|
954
|
+
label: unref(getValueOfOption)(
|
|
955
|
+
groupItem.optionLabelName,
|
|
956
|
+
"label",
|
|
957
|
+
option
|
|
958
|
+
),
|
|
959
|
+
disabled: option?.disabled,
|
|
960
|
+
class: normalizeClass([
|
|
961
|
+
option.class || "",
|
|
962
|
+
option.getClass ? option.getClass(
|
|
963
|
+
tmpForm.value,
|
|
964
|
+
groupItem.prop,
|
|
965
|
+
option
|
|
966
|
+
) : ""
|
|
967
|
+
])
|
|
968
|
+
}, {
|
|
969
|
+
default: withCtx(() => [
|
|
970
|
+
createVNode(unref(BmOverTooltips), {
|
|
971
|
+
title: unref(getValueOfOption)(
|
|
972
|
+
groupItem.optionLabelName,
|
|
973
|
+
"label",
|
|
974
|
+
option
|
|
975
|
+
)
|
|
976
|
+
}, null, 8, ["title"])
|
|
977
|
+
]),
|
|
978
|
+
_: 2
|
|
979
|
+
}, 1032, ["value", "label", "disabled", "class"]);
|
|
980
|
+
}), 128))
|
|
981
|
+
]),
|
|
982
|
+
_: 2
|
|
983
|
+
}, 1032, ["value", "onUpdate:value", "class", "style", "mode", "max-tag-count", "max-tag-placeholder", "show-search", "disabled", "allow-clear", "option-filter-prop", "placeholder", "get-popup-container", "onChange", "onFocus"])) : createCommentVNode("v-if", true),
|
|
984
|
+
groupItem.type === "input" ? (openBlock(), createBlock(_component_a_input, {
|
|
985
|
+
key: 2,
|
|
986
|
+
value: tmpForm.value[groupItem.prop],
|
|
987
|
+
"onUpdate:value": ($event) => tmpForm.value[groupItem.prop] = $event,
|
|
988
|
+
class: normalizeClass([
|
|
989
|
+
groupItem.class || "",
|
|
990
|
+
groupItem.getClass ? groupItem.getClass(tmpForm.value, groupItem.prop) : ""
|
|
991
|
+
]),
|
|
992
|
+
style: normalizeStyle({
|
|
993
|
+
...groupItem.style,
|
|
994
|
+
...groupItem.getStyle?.(tmpForm.value, groupItem.prop)
|
|
995
|
+
}),
|
|
996
|
+
maxlength: groupItem.maxlength,
|
|
997
|
+
disabled: groupItem.disabled || groupItem.disabledControl?.(tmpForm.value),
|
|
998
|
+
"allow-clear": groupItem.allowClear,
|
|
999
|
+
type: groupItem.inputType,
|
|
1000
|
+
placeholder: groupItem.placeholder || "\u8BF7\u8F93\u5165",
|
|
1001
|
+
prefix: groupItem.prefix || "",
|
|
1002
|
+
suffix: groupItem.suffix || "",
|
|
1003
|
+
"addon-before": groupItem.addonBefore || "",
|
|
1004
|
+
"addon-after": groupItem.addonAfter || "",
|
|
1005
|
+
onChange: (e) => {
|
|
1006
|
+
onFieldChange();
|
|
1007
|
+
unref(onFormItemChange)(e, item);
|
|
1008
|
+
},
|
|
1009
|
+
onBlur: (e) => {
|
|
1010
|
+
onFieldBlur();
|
|
1011
|
+
unref(onFormItemBlur)(e, item);
|
|
1012
|
+
},
|
|
1013
|
+
onPressEnter: (e) => unref(onFormItemPressEnter)(e, item),
|
|
1014
|
+
onKeyup: (e) => unref(onFormItemKeyup)(e, item),
|
|
1015
|
+
onFocus: (e) => unref(onFormItemFocus)(e, item)
|
|
1016
|
+
}, null, 8, ["value", "onUpdate:value", "class", "style", "maxlength", "disabled", "allow-clear", "type", "placeholder", "prefix", "suffix", "addon-before", "addon-after", "onChange", "onBlur", "onPressEnter", "onKeyup", "onFocus"])) : createCommentVNode("v-if", true),
|
|
1017
|
+
groupItem.type === "inputNumber" ? (openBlock(), createBlock(_component_a_input_number, {
|
|
1018
|
+
key: 3,
|
|
1019
|
+
value: tmpForm.value[groupItem.prop],
|
|
1020
|
+
"onUpdate:value": ($event) => tmpForm.value[groupItem.prop] = $event,
|
|
1021
|
+
class: normalizeClass([
|
|
1022
|
+
groupItem.class || "",
|
|
1023
|
+
groupItem.getClass ? groupItem.getClass(tmpForm.value, groupItem.prop) : ""
|
|
1024
|
+
]),
|
|
1025
|
+
style: normalizeStyle({
|
|
1026
|
+
...groupItem.style,
|
|
1027
|
+
...groupItem.getStyle?.(tmpForm.value, groupItem.prop)
|
|
1028
|
+
}),
|
|
1029
|
+
disabled: groupItem.disabled || groupItem.disabledControl?.(tmpForm.value),
|
|
1030
|
+
precision: groupItem.precision,
|
|
1031
|
+
parser: groupItem.parser,
|
|
1032
|
+
placeholder: groupItem.placeholder || "\u8BF7\u8F93\u5165",
|
|
1033
|
+
prefix: groupItem.prefix || "",
|
|
1034
|
+
suffix: groupItem.suffix || "",
|
|
1035
|
+
"addon-before": groupItem.addonBefore || "",
|
|
1036
|
+
"addon-after": groupItem.addonAfter || "",
|
|
1037
|
+
"allow-clear": groupItem.allowClear,
|
|
1038
|
+
formatter: groupItem.formatter,
|
|
1039
|
+
min: groupItem.min || 0,
|
|
1040
|
+
max: groupItem.max || 99999,
|
|
1041
|
+
onChange: (e) => {
|
|
1042
|
+
onFieldChange();
|
|
1043
|
+
unref(onFormItemChange)(e, item);
|
|
1044
|
+
},
|
|
1045
|
+
onBlur: (e) => {
|
|
1046
|
+
onFieldBlur();
|
|
1047
|
+
unref(onFormItemBlur)(e, item);
|
|
1048
|
+
},
|
|
1049
|
+
onPressEnter: (e) => unref(onFormItemPressEnter)(e, item),
|
|
1050
|
+
onKeyup: (e) => unref(onFormItemKeyup)(e, item),
|
|
1051
|
+
onFocus: (e) => unref(onFormItemFocus)(e, item)
|
|
1052
|
+
}, null, 8, ["value", "onUpdate:value", "class", "style", "disabled", "precision", "parser", "placeholder", "prefix", "suffix", "addon-before", "addon-after", "allow-clear", "formatter", "min", "max", "onChange", "onBlur", "onPressEnter", "onKeyup", "onFocus"])) : createCommentVNode("v-if", true)
|
|
1053
|
+
], 64);
|
|
1054
|
+
}), 128))
|
|
1055
|
+
]),
|
|
1056
|
+
_: 2
|
|
1057
|
+
}, 1032, ["fields"])) : createCommentVNode("v-if", true),
|
|
1058
|
+
item.type === "text" ? (openBlock(), createElementBlock("div", {
|
|
1059
|
+
key: 14,
|
|
1060
|
+
class: normalizeClass([
|
|
1061
|
+
"row-text",
|
|
1062
|
+
item.class || "",
|
|
1063
|
+
item.getClass ? item.getClass(tmpForm.value, item.prop) : ""
|
|
1064
|
+
]),
|
|
1065
|
+
style: normalizeStyle({
|
|
1066
|
+
...item.style,
|
|
1067
|
+
...item.getStyle?.(tmpForm.value, item.prop)
|
|
1068
|
+
})
|
|
1069
|
+
}, [
|
|
1070
|
+
createVNode(unref(BmOverTooltips), {
|
|
1071
|
+
title: unref(getShowValue)(item) || tmpForm.value[item.prop]
|
|
1072
|
+
}, null, 8, ["title"]),
|
|
1073
|
+
createCommentVNode(' <AutoTooltip\n :tooltip="getShowValue(item) || tmpForm[item.prop]"\n /> ')
|
|
1074
|
+
], 6)) : createCommentVNode("v-if", true),
|
|
1075
|
+
item.type === "multiText" ? (openBlock(), createElementBlock("div", {
|
|
1076
|
+
key: 15,
|
|
1077
|
+
class: normalizeClass([
|
|
1078
|
+
"row-multiText",
|
|
1079
|
+
item.class || "",
|
|
1080
|
+
item.getClass ? item.getClass(tmpForm.value, item.prop) : ""
|
|
1081
|
+
]),
|
|
1082
|
+
style: normalizeStyle({
|
|
1083
|
+
...item.style,
|
|
1084
|
+
...item.getStyle?.(tmpForm.value, item.prop)
|
|
1085
|
+
})
|
|
1086
|
+
}, toDisplayString(unref(getShowValue)(item) || tmpForm.value[item.prop]), 7)) : createCommentVNode("v-if", true),
|
|
1087
|
+
item.type === "placeholder" ? (openBlock(), createElementBlock("div", {
|
|
1088
|
+
key: 16,
|
|
1089
|
+
class: normalizeClass([
|
|
1090
|
+
"row-placeholder",
|
|
1091
|
+
item.class || "",
|
|
1092
|
+
item.getClass ? item.getClass(tmpForm.value, item.prop) : ""
|
|
1093
|
+
]),
|
|
1094
|
+
style: normalizeStyle({
|
|
1095
|
+
...item.style,
|
|
1096
|
+
...item.getStyle?.(tmpForm.value, item.prop)
|
|
1097
|
+
})
|
|
1098
|
+
}, toDisplayString(unref(getShowValue)(item) || tmpForm.value[item.prop]), 7)) : createCommentVNode("v-if", true),
|
|
1099
|
+
item.type === "selectText" ? (openBlock(), createBlock(_component_a_select, {
|
|
1100
|
+
key: 17,
|
|
1101
|
+
value: tmpForm.value[item.prop],
|
|
1102
|
+
"onUpdate:value": ($event) => tmpForm.value[item.prop] = $event,
|
|
1103
|
+
class: normalizeClass([
|
|
1104
|
+
"select-text",
|
|
1105
|
+
item.class || "",
|
|
1106
|
+
item.getClass ? item.getClass(tmpForm.value, item.prop) : ""
|
|
1107
|
+
]),
|
|
1108
|
+
style: normalizeStyle({
|
|
1109
|
+
...item.style,
|
|
1110
|
+
...item.getStyle?.(tmpForm.value, item.prop)
|
|
1111
|
+
}),
|
|
1112
|
+
disabled: "",
|
|
1113
|
+
bordered: false,
|
|
1114
|
+
"show-arrow": false,
|
|
1115
|
+
"option-filter-prop": item.optionFilterProp || "label",
|
|
1116
|
+
placeholder: item.placeholder || "\u8BF7\u9009\u62E9"
|
|
1117
|
+
}, {
|
|
1118
|
+
default: withCtx(() => [
|
|
1119
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(item.options, (option) => {
|
|
1120
|
+
return openBlock(), createBlock(_component_a_select_option, {
|
|
1121
|
+
key: unref(getValueOfOption)(
|
|
1122
|
+
item.optionValueName,
|
|
1123
|
+
"value",
|
|
1124
|
+
option
|
|
1125
|
+
),
|
|
1126
|
+
value: unref(getValueOfOption)(
|
|
1127
|
+
item.optionValueName,
|
|
1128
|
+
"value",
|
|
1129
|
+
option
|
|
1130
|
+
),
|
|
1131
|
+
label: unref(getValueOfOption)(
|
|
1132
|
+
item.optionLabelName,
|
|
1133
|
+
"label",
|
|
1134
|
+
option
|
|
1135
|
+
),
|
|
1136
|
+
disabled: option?.disabled,
|
|
1137
|
+
class: normalizeClass([
|
|
1138
|
+
option.class || "",
|
|
1139
|
+
option.getClass ? option.getClass(tmpForm.value, item.prop, option) : ""
|
|
1140
|
+
])
|
|
1141
|
+
}, {
|
|
1142
|
+
default: withCtx(() => [
|
|
1143
|
+
createVNode(unref(BmOverTooltips), {
|
|
1144
|
+
title: unref(getValueOfOption)(
|
|
1145
|
+
item.optionLabelName,
|
|
1146
|
+
"label",
|
|
1147
|
+
option
|
|
1148
|
+
)
|
|
1149
|
+
}, null, 8, ["title"])
|
|
1150
|
+
]),
|
|
1151
|
+
_: 2
|
|
1152
|
+
}, 1032, ["value", "label", "disabled", "class"]);
|
|
1153
|
+
}), 128))
|
|
1154
|
+
]),
|
|
1155
|
+
_: 2
|
|
1156
|
+
}, 1032, ["value", "onUpdate:value", "class", "style", "option-filter-prop", "placeholder"])) : createCommentVNode("v-if", true),
|
|
1157
|
+
item.slotAfter ? renderSlot(_ctx.$slots, item.slotAfter, {
|
|
1158
|
+
key: 18,
|
|
1159
|
+
update: updateSlot,
|
|
1160
|
+
tmpForm: tmpForm.value,
|
|
1161
|
+
validate: (nameList = [item.prop]) => unref(validate)(nameList)
|
|
1162
|
+
}) : createCommentVNode("v-if", true)
|
|
1163
|
+
]),
|
|
1164
|
+
_: 2
|
|
1165
|
+
}, 1032, ["id", "class", "name", "required", "colon", "label-col", "wrapper-col", "style"]))
|
|
1166
|
+
], 64)) : createCommentVNode("v-if", true)
|
|
1167
|
+
], 64);
|
|
1168
|
+
}), 128))
|
|
1169
|
+
]);
|
|
1170
|
+
}), 128))
|
|
1171
|
+
])
|
|
1172
|
+
]))
|
|
1173
|
+
], 2)) : createCommentVNode("v-if", true)
|
|
1174
|
+
], 64);
|
|
1175
|
+
}), 128))
|
|
1176
|
+
]),
|
|
1177
|
+
_: 3
|
|
1178
|
+
}, 8, ["model", "rules", "layout", "autocomplete"]);
|
|
1179
|
+
};
|
|
1180
|
+
}
|
|
1181
|
+
});
|
|
1182
|
+
var EditForm = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "edit-form.vue"]]);
|
|
1183
|
+
|
|
1184
|
+
const BmEditForm = withInstall(EditForm);
|
|
1185
|
+
|
|
1186
|
+
export { BmEditForm, BmEditForm as default };
|