m-eleplus-crud 0.0.13 → 0.0.15
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/dist/index.full.js +3 -2
- package/dist/index.full.min.js +1 -1
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +1 -1
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +3 -2
- package/es/components/crud/src/crud.d.ts +7 -0
- package/es/components/table/src/table.d.ts +7 -0
- package/es/index.mjs +5 -5
- package/es/packages/components/barcode/index.mjs +2 -2
- package/es/packages/components/barcode/src/barcode.mjs +18 -53
- package/es/packages/components/barcode/src/barcode.mjs.map +1 -1
- package/es/packages/components/barcode/src/barcode2.mjs +53 -18
- package/es/packages/components/barcode/src/barcode2.mjs.map +1 -1
- package/es/packages/components/crud/src/crud.mjs.map +1 -1
- package/es/packages/components/dialog/index.mjs +2 -2
- package/es/packages/components/dialog/src/dialog.mjs +75 -116
- package/es/packages/components/dialog/src/dialog.mjs.map +1 -1
- package/es/packages/components/dialog/src/dialog2.mjs +116 -75
- package/es/packages/components/dialog/src/dialog2.mjs.map +1 -1
- package/es/packages/components/form/index.mjs +2 -2
- package/es/packages/components/form/src/form.mjs +25 -640
- package/es/packages/components/form/src/form.mjs.map +1 -1
- package/es/packages/components/form/src/form2.mjs +640 -25
- package/es/packages/components/form/src/form2.mjs.map +1 -1
- package/es/packages/components/index.mjs +5 -5
- package/es/packages/components/picture/index.mjs +2 -2
- package/es/packages/components/picture/src/picture.mjs +26 -19
- package/es/packages/components/picture/src/picture.mjs.map +1 -1
- package/es/packages/components/picture/src/picture2.mjs +19 -26
- package/es/packages/components/picture/src/picture2.mjs.map +1 -1
- package/es/packages/components/search/index.mjs +2 -2
- package/es/packages/components/search/src/search.mjs +25 -438
- package/es/packages/components/search/src/search.mjs.map +1 -1
- package/es/packages/components/search/src/search2.mjs +438 -25
- package/es/packages/components/search/src/search2.mjs.map +1 -1
- package/es/packages/components/table/src/table.mjs.map +1 -1
- package/es/packages/components/table/src/table2.mjs +3 -2
- package/es/packages/components/table/src/table2.mjs.map +1 -1
- package/lib/components/crud/src/crud.d.ts +7 -0
- package/lib/components/table/src/table.d.ts +7 -0
- package/lib/index.js +5 -5
- package/lib/packages/components/barcode/index.js +2 -2
- package/lib/packages/components/barcode/src/barcode.js +19 -57
- package/lib/packages/components/barcode/src/barcode.js.map +1 -1
- package/lib/packages/components/barcode/src/barcode2.js +57 -19
- package/lib/packages/components/barcode/src/barcode2.js.map +1 -1
- package/lib/packages/components/crud/src/crud.js.map +1 -1
- package/lib/packages/components/dialog/index.js +2 -2
- package/lib/packages/components/dialog/src/dialog.js +76 -116
- package/lib/packages/components/dialog/src/dialog.js.map +1 -1
- package/lib/packages/components/dialog/src/dialog2.js +116 -76
- package/lib/packages/components/dialog/src/dialog2.js.map +1 -1
- package/lib/packages/components/form/index.js +2 -2
- package/lib/packages/components/form/src/form.js +26 -640
- package/lib/packages/components/form/src/form.js.map +1 -1
- package/lib/packages/components/form/src/form2.js +640 -26
- package/lib/packages/components/form/src/form2.js.map +1 -1
- package/lib/packages/components/index.js +5 -5
- package/lib/packages/components/picture/index.js +2 -2
- package/lib/packages/components/picture/src/picture.js +26 -20
- package/lib/packages/components/picture/src/picture.js.map +1 -1
- package/lib/packages/components/picture/src/picture2.js +20 -26
- package/lib/packages/components/picture/src/picture2.js.map +1 -1
- package/lib/packages/components/search/index.js +2 -2
- package/lib/packages/components/search/src/search.js +26 -438
- package/lib/packages/components/search/src/search.js.map +1 -1
- package/lib/packages/components/search/src/search2.js +438 -26
- package/lib/packages/components/search/src/search2.js.map +1 -1
- package/lib/packages/components/table/src/table.js.map +1 -1
- package/lib/packages/components/table/src/table2.js +3 -2
- package/lib/packages/components/table/src/table2.js.map +1 -1
- package/package.json +1 -1
- package/web-types.json +1 -1
|
@@ -2,648 +2,34 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var form = require('./form2.js');
|
|
8
|
-
var pluginVue_exportHelper = require('../../../../_virtual/plugin-vue_export-helper.js');
|
|
9
|
-
var useGlobalConfig = require('../../config-provider/src/hooks/use-global-config.js');
|
|
10
|
-
var error = require('../../../utils/error.js');
|
|
5
|
+
var runtime = require('../../../utils/vue/props/runtime.js');
|
|
6
|
+
var index = require('../../../hooks/use-size/index.js');
|
|
11
7
|
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const DATE_TYPES = [
|
|
34
|
-
"year",
|
|
35
|
-
"month",
|
|
36
|
-
"date",
|
|
37
|
-
"datetime",
|
|
38
|
-
"week",
|
|
39
|
-
"datetimerange",
|
|
40
|
-
"daterange",
|
|
41
|
-
"monthrange",
|
|
42
|
-
"yearrange",
|
|
43
|
-
"time",
|
|
44
|
-
"timerange"
|
|
45
|
-
];
|
|
46
|
-
const NEED_DIC_TYPE = ["select", "checkbox", "radio", "switch"];
|
|
47
|
-
const formOption = vue.ref({
|
|
48
|
-
labelWidth: "80px",
|
|
49
|
-
column: []
|
|
50
|
-
});
|
|
51
|
-
const detailTableRows = vue.computed(() => {
|
|
52
|
-
const rows = [];
|
|
53
|
-
let currentRow = [];
|
|
54
|
-
let currentTotal = 0;
|
|
55
|
-
for (const item of formOption.value.column || []) {
|
|
56
|
-
const req = item.span || 12;
|
|
57
|
-
if (currentTotal + req > 24) {
|
|
58
|
-
rows.push(currentRow);
|
|
59
|
-
currentRow = [];
|
|
60
|
-
currentTotal = 0;
|
|
61
|
-
}
|
|
62
|
-
currentRow.push(item);
|
|
63
|
-
currentTotal += req;
|
|
64
|
-
}
|
|
65
|
-
if (currentRow.length)
|
|
66
|
-
rows.push(currentRow);
|
|
67
|
-
return rows;
|
|
68
|
-
});
|
|
69
|
-
const proxys = new Proxy(props.model, {
|
|
70
|
-
get(target, property) {
|
|
71
|
-
return lodashUnified.get(target, property);
|
|
72
|
-
},
|
|
73
|
-
set(target, property, value) {
|
|
74
|
-
lodashUnified.set(target, property, value);
|
|
75
|
-
return true;
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
const initValue = () => {
|
|
79
|
-
var _a;
|
|
80
|
-
if (formOption.value && formOption.value.column) {
|
|
81
|
-
for (let i = 0; i < ((_a = formOption.value.column) == null ? void 0 : _a.length); i++) {
|
|
82
|
-
const column = formOption.value.column[i];
|
|
83
|
-
if (column.prop && proxys[column.prop] === void 0) {
|
|
84
|
-
if (column.value) {
|
|
85
|
-
proxys[column.prop] = column.value;
|
|
86
|
-
} else {
|
|
87
|
-
const ARR_TYPES = [
|
|
88
|
-
"checkbox",
|
|
89
|
-
"datetimerange",
|
|
90
|
-
"daterange",
|
|
91
|
-
"monthrange",
|
|
92
|
-
"yearrange",
|
|
93
|
-
"timerange"
|
|
94
|
-
];
|
|
95
|
-
if (column.type === "select" && column.multiple || ARR_TYPES.includes(column.type || "")) {
|
|
96
|
-
proxys[column.prop] = [];
|
|
97
|
-
} else {
|
|
98
|
-
proxys[column.prop] = "";
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
const getValueFormatByType = (type) => {
|
|
106
|
-
let format = "";
|
|
107
|
-
switch (type) {
|
|
108
|
-
case "yearrange":
|
|
109
|
-
case "year":
|
|
110
|
-
format = "YYYY";
|
|
111
|
-
break;
|
|
112
|
-
case "monthrange":
|
|
113
|
-
case "month":
|
|
114
|
-
format = "YYYY-MM";
|
|
115
|
-
break;
|
|
116
|
-
case "daterange":
|
|
117
|
-
case "week":
|
|
118
|
-
case "date":
|
|
119
|
-
format = "YYYY-MM-DD";
|
|
120
|
-
break;
|
|
121
|
-
case "datetimerange":
|
|
122
|
-
case "datetime":
|
|
123
|
-
format = "YYYY-MM-DD HH:mm:ss";
|
|
124
|
-
break;
|
|
125
|
-
case "time":
|
|
126
|
-
format = "HH:mm:ss";
|
|
127
|
-
break;
|
|
128
|
-
}
|
|
129
|
-
return format;
|
|
130
|
-
};
|
|
131
|
-
const getAllRemoteDics = () => {
|
|
132
|
-
var _a, _b, _c, _d;
|
|
133
|
-
const hasDicUrl = (_b = (_a = formOption.value) == null ? void 0 : _a.column) == null ? void 0 : _b.some((column) => column.dicUrl);
|
|
134
|
-
if (hasDicUrl && !((_c = globalConfig.value) == null ? void 0 : _c.httpGet)) {
|
|
135
|
-
error.debugWarn("MForm", "global config httpGet is null");
|
|
136
|
-
return;
|
|
137
|
-
}
|
|
138
|
-
const updateRemoteDic = (column) => {
|
|
139
|
-
return new Promise((resolve) => {
|
|
140
|
-
let isSuccess = false;
|
|
141
|
-
globalConfig.value.httpGet(column.dicUrl, column.dicQuery, column.dicHeaders).then((e) => {
|
|
142
|
-
const { list, label, value } = column.dicFormatter(e);
|
|
143
|
-
if (list && Array.isArray(list)) {
|
|
144
|
-
column["dicData"] = list.map((item) => {
|
|
145
|
-
const lastLabel = label.replace(/\{(\w+)\}/g, (match, key) => {
|
|
146
|
-
return item[key] || match;
|
|
147
|
-
});
|
|
148
|
-
return {
|
|
149
|
-
label: lastLabel,
|
|
150
|
-
value: item[value]
|
|
151
|
-
};
|
|
152
|
-
});
|
|
153
|
-
isSuccess = true;
|
|
154
|
-
}
|
|
155
|
-
}).finally(() => {
|
|
156
|
-
if (!isSuccess) {
|
|
157
|
-
column["dicData"] = [];
|
|
158
|
-
}
|
|
159
|
-
resolve(null);
|
|
160
|
-
});
|
|
161
|
-
});
|
|
162
|
-
};
|
|
163
|
-
for (let i = 0; i < (((_d = formOption.value) == null ? void 0 : _d.column) || []).length; i++) {
|
|
164
|
-
const column = formOption.value.column[i];
|
|
165
|
-
if (column.dicUrl) {
|
|
166
|
-
if (!column.dicFormatter) {
|
|
167
|
-
error.debugWarn("MForm", "dicUrl and dicFormatter must be used together");
|
|
168
|
-
continue;
|
|
169
|
-
}
|
|
170
|
-
updateRemoteDic(column);
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
};
|
|
174
|
-
const getFormItemEventBind = (column) => {
|
|
175
|
-
const result = {};
|
|
176
|
-
for (const key in column) {
|
|
177
|
-
if (key.startsWith("event")) {
|
|
178
|
-
let funName = key.replace("event", "");
|
|
179
|
-
funName = funName.charAt(0).toLowerCase() + funName.slice(1);
|
|
180
|
-
result[funName] = column[key];
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
return result;
|
|
184
|
-
};
|
|
185
|
-
const formatDicValue = (row, column) => {
|
|
186
|
-
let dictLabel = "";
|
|
187
|
-
const findLabelByValue = (dicData, value) => {
|
|
188
|
-
const dictItem = (dicData || []).find((dict) => dict.value === value);
|
|
189
|
-
if (dictItem === void 0) {
|
|
190
|
-
return dictLabel;
|
|
191
|
-
}
|
|
192
|
-
return dictItem.label;
|
|
193
|
-
};
|
|
194
|
-
if (column.type === "select" && column.multiple || column.type === "checkbox") {
|
|
195
|
-
let values = [];
|
|
196
|
-
if (row[column.prop || ""] != null && row[column.prop || ""] != void 0 && row[column.prop || ""] !== "") {
|
|
197
|
-
if (Array.isArray(row[column.prop || ""])) {
|
|
198
|
-
values = row[column.prop || ""];
|
|
199
|
-
} else if (typeof row[column.prop || ""] === "string") {
|
|
200
|
-
values = row[column.prop || ""].split(",");
|
|
201
|
-
} else {
|
|
202
|
-
values = [row[column.prop || ""]];
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
const result = [];
|
|
206
|
-
for (const value of values) {
|
|
207
|
-
dictLabel = findLabelByValue(column.dicData || [], value);
|
|
208
|
-
if (dictLabel === void 0) {
|
|
209
|
-
break;
|
|
210
|
-
}
|
|
211
|
-
result.push(dictLabel);
|
|
212
|
-
}
|
|
213
|
-
return result.join(",");
|
|
214
|
-
}
|
|
215
|
-
dictLabel = findLabelByValue(column.dicData || [], row[column.prop || ""]);
|
|
216
|
-
return dictLabel;
|
|
217
|
-
};
|
|
218
|
-
const getDetailPic = (row, column) => {
|
|
219
|
-
if (!row || !row[column.prop || ""]) {
|
|
220
|
-
return [];
|
|
221
|
-
}
|
|
222
|
-
const pics = row[column.prop || ""].split(column.imgSuffix || ";").map((pic) => (column.imgPrefix || "") + pic);
|
|
223
|
-
return pics;
|
|
224
|
-
};
|
|
225
|
-
const getValueColspan = (item, rows, index) => {
|
|
226
|
-
const getRemaining = (row) => {
|
|
227
|
-
const used = row.reduce((acc, item2) => acc + (item2.span || 12), 0);
|
|
228
|
-
return 24 - used;
|
|
229
|
-
};
|
|
230
|
-
if (index === rows.length - 1) {
|
|
231
|
-
return (item.span || 12) + getRemaining(rows) - 1;
|
|
232
|
-
}
|
|
233
|
-
return (item.span || 12) - 1;
|
|
234
|
-
};
|
|
235
|
-
const validForm = () => {
|
|
236
|
-
return new Promise((resolve) => {
|
|
237
|
-
formRef.value.validate((valid) => {
|
|
238
|
-
resolve(valid);
|
|
239
|
-
});
|
|
240
|
-
});
|
|
241
|
-
};
|
|
242
|
-
const clear = () => {
|
|
243
|
-
var _a, _b;
|
|
244
|
-
(_a = formRef.value) == null ? void 0 : _a.clearValidate();
|
|
245
|
-
(_b = formRef.value) == null ? void 0 : _b.resetFields();
|
|
246
|
-
};
|
|
247
|
-
vue.watch(
|
|
248
|
-
() => props.option,
|
|
249
|
-
(newVal) => {
|
|
250
|
-
if (newVal) {
|
|
251
|
-
formOption.value = Object.assign({}, formOption.value, newVal);
|
|
252
|
-
if (newVal.column) {
|
|
253
|
-
formOption.value.column = lodashUnified.cloneDeep(
|
|
254
|
-
newVal.column.filter(
|
|
255
|
-
(column) => !(props.permission[column.prop || ""] === false)
|
|
256
|
-
).sort((a, b) => (b.order || 0) - (a.order || 0))
|
|
257
|
-
);
|
|
258
|
-
getAllRemoteDics();
|
|
259
|
-
if (!props.readonly) {
|
|
260
|
-
initValue();
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
},
|
|
265
|
-
{
|
|
266
|
-
immediate: true,
|
|
267
|
-
deep: true
|
|
268
|
-
}
|
|
269
|
-
);
|
|
270
|
-
__expose({
|
|
271
|
-
validForm,
|
|
272
|
-
clear
|
|
273
|
-
});
|
|
274
|
-
return (_ctx, _cache) => {
|
|
275
|
-
const _component_el_input = vue.resolveComponent("el-input");
|
|
276
|
-
const _component_el_option = vue.resolveComponent("el-option");
|
|
277
|
-
const _component_el_select = vue.resolveComponent("el-select");
|
|
278
|
-
const _component_el_radio = vue.resolveComponent("el-radio");
|
|
279
|
-
const _component_el_radio_group = vue.resolveComponent("el-radio-group");
|
|
280
|
-
const _component_el_checkbox = vue.resolveComponent("el-checkbox");
|
|
281
|
-
const _component_el_checkbox_group = vue.resolveComponent("el-checkbox-group");
|
|
282
|
-
const _component_el_switch = vue.resolveComponent("el-switch");
|
|
283
|
-
const _component_el_date_picker = vue.resolveComponent("el-date-picker");
|
|
284
|
-
const _component_el_time_picker = vue.resolveComponent("el-time-picker");
|
|
285
|
-
const _component_el_form_item = vue.resolveComponent("el-form-item");
|
|
286
|
-
const _component_el_col = vue.resolveComponent("el-col");
|
|
287
|
-
const _component_el_row = vue.resolveComponent("el-row");
|
|
288
|
-
const _component_el_form = vue.resolveComponent("el-form");
|
|
289
|
-
const _component_MPicture = vue.resolveComponent("MPicture");
|
|
290
|
-
const _component_MQrcode = vue.resolveComponent("MQrcode");
|
|
291
|
-
const _component_MBarcode = vue.resolveComponent("MBarcode");
|
|
292
|
-
return vue.openBlock(), vue.createElementBlock("div", { class: "m-form" }, [
|
|
293
|
-
vue.createCommentVNode("\u7F16\u8F91\u6A21\u5F0F"),
|
|
294
|
-
!_ctx.readonly ? (vue.openBlock(), vue.createBlock(_component_el_form, {
|
|
295
|
-
key: 0,
|
|
296
|
-
ref_key: "formRef",
|
|
297
|
-
ref: formRef,
|
|
298
|
-
model: vue.unref(proxys),
|
|
299
|
-
disabled: _ctx.loading,
|
|
300
|
-
size: _ctx.size || vue.unref(globalConfig).size,
|
|
301
|
-
"label-width": formOption.value.labelWidth,
|
|
302
|
-
style: { "width": "100%" },
|
|
303
|
-
onSubmit: vue.withModifiers(() => {
|
|
304
|
-
}, ["prevent"])
|
|
305
|
-
}, {
|
|
306
|
-
default: vue.withCtx(() => [
|
|
307
|
-
vue.createVNode(_component_el_row, { gutter: 0 }, {
|
|
308
|
-
default: vue.withCtx(() => [
|
|
309
|
-
(vue.openBlock(true), vue.createElementBlock(
|
|
310
|
-
vue.Fragment,
|
|
311
|
-
null,
|
|
312
|
-
vue.renderList(formOption.value.column, (column, columnIndex) => {
|
|
313
|
-
return vue.openBlock(), vue.createBlock(_component_el_col, {
|
|
314
|
-
key: columnIndex,
|
|
315
|
-
span: column.span || 12
|
|
316
|
-
}, {
|
|
317
|
-
default: vue.withCtx(() => [
|
|
318
|
-
vue.createVNode(_component_el_form_item, {
|
|
319
|
-
style: { "width": "100%" },
|
|
320
|
-
label: column.label + ":",
|
|
321
|
-
prop: column.prop,
|
|
322
|
-
rules: column.rules,
|
|
323
|
-
"label-width": column.labelWidth || formOption.value.labelWidth
|
|
324
|
-
}, {
|
|
325
|
-
default: vue.withCtx(() => [
|
|
326
|
-
vue.createCommentVNode("\u63D2\u69FD\u4FE1\u606F"),
|
|
327
|
-
vue.unref(slots)[column.prop || ""] ? vue.renderSlot(_ctx.$slots, column.prop, vue.mergeProps({
|
|
328
|
-
key: 0,
|
|
329
|
-
ref_for: true
|
|
330
|
-
}, { size: _ctx.size || vue.unref(globalConfig).size, loading: _ctx.loading })) : !column.type || INPUT_TYPES.includes(column.type) ? (vue.openBlock(), vue.createElementBlock(
|
|
331
|
-
vue.Fragment,
|
|
332
|
-
{ key: 1 },
|
|
333
|
-
[
|
|
334
|
-
vue.createCommentVNode(""),
|
|
335
|
-
vue.createCommentVNode("\u8F93\u5165\u6846"),
|
|
336
|
-
vue.createVNode(_component_el_input, vue.mergeProps({
|
|
337
|
-
modelValue: vue.unref(proxys)[column.prop || ""],
|
|
338
|
-
"onUpdate:modelValue": ($event) => vue.unref(proxys)[column.prop || ""] = $event,
|
|
339
|
-
modelModifiers: { trim: true },
|
|
340
|
-
style: { "width": "100%" },
|
|
341
|
-
placeholder: column.placeholder,
|
|
342
|
-
maxlength: column.maxlength,
|
|
343
|
-
"show-word-limit": column.showWordLimit,
|
|
344
|
-
"show-password": column.showPassword,
|
|
345
|
-
disabled: column.disabled || false,
|
|
346
|
-
type: !column.type || column.type === "input" ? "text" : column.type
|
|
347
|
-
}, vue.toHandlers(getFormItemEventBind(column))), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder", "maxlength", "show-word-limit", "show-password", "disabled", "type"])
|
|
348
|
-
],
|
|
349
|
-
2112
|
|
350
|
-
)) : column.type === "select" ? (vue.openBlock(), vue.createElementBlock(
|
|
351
|
-
vue.Fragment,
|
|
352
|
-
{ key: 2 },
|
|
353
|
-
[
|
|
354
|
-
vue.createCommentVNode(""),
|
|
355
|
-
vue.createCommentVNode("\u4E0B\u62C9\u6846"),
|
|
356
|
-
vue.createVNode(_component_el_select, vue.mergeProps({
|
|
357
|
-
modelValue: vue.unref(proxys)[column.prop || ""],
|
|
358
|
-
"onUpdate:modelValue": ($event) => vue.unref(proxys)[column.prop || ""] = $event,
|
|
359
|
-
modelModifiers: { trim: true },
|
|
360
|
-
style: { "width": "100%" },
|
|
361
|
-
disabled: column.disabled || false,
|
|
362
|
-
placeholder: column.placeholder,
|
|
363
|
-
multiple: column.multiple,
|
|
364
|
-
clearable: column.clearable,
|
|
365
|
-
filterable: column.filterable,
|
|
366
|
-
"filter-method": column.filterMethod,
|
|
367
|
-
remote: column.remote,
|
|
368
|
-
"remote-method": column.remoteMethod,
|
|
369
|
-
loading: column.loading
|
|
370
|
-
}, vue.toHandlers(getFormItemEventBind(column))), {
|
|
371
|
-
default: vue.withCtx(() => [
|
|
372
|
-
(vue.openBlock(true), vue.createElementBlock(
|
|
373
|
-
vue.Fragment,
|
|
374
|
-
null,
|
|
375
|
-
vue.renderList(column.dicData || [], (dicItem, dicIndex) => {
|
|
376
|
-
return vue.openBlock(), vue.createBlock(_component_el_option, {
|
|
377
|
-
key: dicIndex,
|
|
378
|
-
label: dicItem.label,
|
|
379
|
-
value: dicItem.value
|
|
380
|
-
}, null, 8, ["label", "value"]);
|
|
381
|
-
}),
|
|
382
|
-
128
|
|
383
|
-
))
|
|
384
|
-
]),
|
|
385
|
-
_: 2
|
|
386
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled", "placeholder", "multiple", "clearable", "filterable", "filter-method", "remote", "remote-method", "loading"])
|
|
387
|
-
],
|
|
388
|
-
2112
|
|
389
|
-
)) : column.type === "radio" ? (vue.openBlock(), vue.createElementBlock(
|
|
390
|
-
vue.Fragment,
|
|
391
|
-
{ key: 3 },
|
|
392
|
-
[
|
|
393
|
-
vue.createCommentVNode(""),
|
|
394
|
-
vue.createCommentVNode("radio"),
|
|
395
|
-
vue.createVNode(_component_el_radio_group, vue.mergeProps({
|
|
396
|
-
modelValue: vue.unref(proxys)[column.prop || ""],
|
|
397
|
-
"onUpdate:modelValue": ($event) => vue.unref(proxys)[column.prop || ""] = $event,
|
|
398
|
-
disabled: column.disabled || false,
|
|
399
|
-
style: { "width": "100%" }
|
|
400
|
-
}, vue.toHandlers(getFormItemEventBind(column))), {
|
|
401
|
-
default: vue.withCtx(() => [
|
|
402
|
-
(vue.openBlock(true), vue.createElementBlock(
|
|
403
|
-
vue.Fragment,
|
|
404
|
-
null,
|
|
405
|
-
vue.renderList(column.dicData || [], (dicItem, dicIndex) => {
|
|
406
|
-
return vue.openBlock(), vue.createBlock(_component_el_radio, {
|
|
407
|
-
key: dicIndex,
|
|
408
|
-
value: dicItem.value,
|
|
409
|
-
label: dicItem.value
|
|
410
|
-
}, {
|
|
411
|
-
default: vue.withCtx(() => [
|
|
412
|
-
vue.createTextVNode(
|
|
413
|
-
vue.toDisplayString(dicItem.label),
|
|
414
|
-
1
|
|
415
|
-
)
|
|
416
|
-
]),
|
|
417
|
-
_: 2
|
|
418
|
-
}, 1032, ["value", "label"]);
|
|
419
|
-
}),
|
|
420
|
-
128
|
|
421
|
-
))
|
|
422
|
-
]),
|
|
423
|
-
_: 2
|
|
424
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])
|
|
425
|
-
],
|
|
426
|
-
2112
|
|
427
|
-
)) : column.type === "checkbox" ? (vue.openBlock(), vue.createElementBlock(
|
|
428
|
-
vue.Fragment,
|
|
429
|
-
{ key: 4 },
|
|
430
|
-
[
|
|
431
|
-
vue.createCommentVNode(""),
|
|
432
|
-
vue.createCommentVNode("checkbox"),
|
|
433
|
-
vue.createVNode(_component_el_checkbox_group, vue.mergeProps({
|
|
434
|
-
modelValue: vue.unref(proxys)[column.prop || ""],
|
|
435
|
-
"onUpdate:modelValue": ($event) => vue.unref(proxys)[column.prop || ""] = $event,
|
|
436
|
-
style: { "width": "100%" },
|
|
437
|
-
disabled: column.disabled || false
|
|
438
|
-
}, vue.toHandlers(getFormItemEventBind(column))), {
|
|
439
|
-
default: vue.withCtx(() => [
|
|
440
|
-
(vue.openBlock(true), vue.createElementBlock(
|
|
441
|
-
vue.Fragment,
|
|
442
|
-
null,
|
|
443
|
-
vue.renderList(column.dicData || [], (dicItem, dicIndex) => {
|
|
444
|
-
return vue.openBlock(), vue.createBlock(_component_el_checkbox, {
|
|
445
|
-
key: dicIndex,
|
|
446
|
-
label: dicItem.label,
|
|
447
|
-
value: dicItem.value
|
|
448
|
-
}, null, 8, ["label", "value"]);
|
|
449
|
-
}),
|
|
450
|
-
128
|
|
451
|
-
))
|
|
452
|
-
]),
|
|
453
|
-
_: 2
|
|
454
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])
|
|
455
|
-
],
|
|
456
|
-
2112
|
|
457
|
-
)) : column.type === "switch" ? (vue.openBlock(), vue.createElementBlock(
|
|
458
|
-
vue.Fragment,
|
|
459
|
-
{ key: 5 },
|
|
460
|
-
[
|
|
461
|
-
vue.createCommentVNode(""),
|
|
462
|
-
vue.createCommentVNode("switch"),
|
|
463
|
-
!column.dicData || column.dicData.length != 2 ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
464
|
-
key: 0,
|
|
465
|
-
style: { "color": "var(--el-text-color-placeholder)", "line-height": "32px", "height": "32px" }
|
|
466
|
-
}, '"dicData/dicUrl\u7684\u7ED3\u679C"\u672A\u8BBE\u7F6E\u6216\u957F\u5EA6\u4E0D\u7B49\u4E8E2')) : (vue.openBlock(), vue.createElementBlock(
|
|
467
|
-
vue.Fragment,
|
|
468
|
-
{ key: 1 },
|
|
469
|
-
[
|
|
470
|
-
vue.createVNode(_component_el_switch, vue.mergeProps({
|
|
471
|
-
modelValue: vue.unref(proxys)[column.prop || ""],
|
|
472
|
-
"onUpdate:modelValue": ($event) => vue.unref(proxys)[column.prop || ""] = $event,
|
|
473
|
-
disabled: column.disabled || false,
|
|
474
|
-
"active-value": column.dicData[0].value,
|
|
475
|
-
"inactive-value": column.dicData[1].value
|
|
476
|
-
}, vue.toHandlers(getFormItemEventBind(column))), null, 16, ["modelValue", "onUpdate:modelValue", "disabled", "active-value", "inactive-value"]),
|
|
477
|
-
vue.createElementVNode(
|
|
478
|
-
"span",
|
|
479
|
-
{ style: { "font-size": "var(--el-font-size-base)", "color": "var(--el-text-color-regular)", "margin-left": "6px" } },
|
|
480
|
-
vue.toDisplayString(vue.unref(proxys)[column.prop || ""] === column.dicData[0].value ? column.dicData[0].label : column.dicData[1].label),
|
|
481
|
-
1
|
|
482
|
-
)
|
|
483
|
-
],
|
|
484
|
-
64
|
|
485
|
-
))
|
|
486
|
-
],
|
|
487
|
-
64
|
|
488
|
-
)) : DATE_TYPES.includes(column.type) ? (vue.openBlock(), vue.createElementBlock(
|
|
489
|
-
vue.Fragment,
|
|
490
|
-
{ key: 6 },
|
|
491
|
-
[
|
|
492
|
-
vue.createCommentVNode(""),
|
|
493
|
-
vue.createCommentVNode("\u65F6\u95F4"),
|
|
494
|
-
column.type !== "time" && column.type !== "timerange" ? (vue.openBlock(), vue.createBlock(_component_el_date_picker, vue.mergeProps({
|
|
495
|
-
key: 0,
|
|
496
|
-
modelValue: vue.unref(proxys)[column.prop || ""],
|
|
497
|
-
"onUpdate:modelValue": ($event) => vue.unref(proxys)[column.prop || ""] = $event,
|
|
498
|
-
type: column.type,
|
|
499
|
-
clearable: column.clearable,
|
|
500
|
-
disabled: column.disabled || false,
|
|
501
|
-
"start-placeholder": column.startPlaceholder,
|
|
502
|
-
"end-placeholder": column.endPlaceholder,
|
|
503
|
-
format: column.format,
|
|
504
|
-
"value-format": column.valueFormat || getValueFormatByType(column.type)
|
|
505
|
-
}, vue.toHandlers(getFormItemEventBind(column))), null, 16, ["modelValue", "onUpdate:modelValue", "type", "clearable", "disabled", "start-placeholder", "end-placeholder", "format", "value-format"])) : (vue.openBlock(), vue.createBlock(_component_el_time_picker, vue.mergeProps({
|
|
506
|
-
key: 1,
|
|
507
|
-
modelValue: vue.unref(proxys)[column.prop || ""],
|
|
508
|
-
"onUpdate:modelValue": ($event) => vue.unref(proxys)[column.prop || ""] = $event,
|
|
509
|
-
disabled: column.disabled || false,
|
|
510
|
-
"is-range": column.type === "timerange",
|
|
511
|
-
clearable: column.clearable,
|
|
512
|
-
"start-placeholder": column.startPlaceholder,
|
|
513
|
-
"end-placeholder": column.endPlaceholder,
|
|
514
|
-
"value-format": column.valueFormat || getValueFormatByType(column.type)
|
|
515
|
-
}, vue.toHandlers(getFormItemEventBind(column))), null, 16, ["modelValue", "onUpdate:modelValue", "disabled", "is-range", "clearable", "start-placeholder", "end-placeholder", "value-format"]))
|
|
516
|
-
],
|
|
517
|
-
64
|
|
518
|
-
)) : column.type === "picture" ? (vue.openBlock(), vue.createElementBlock(
|
|
519
|
-
vue.Fragment,
|
|
520
|
-
{ key: 7 },
|
|
521
|
-
[
|
|
522
|
-
vue.createCommentVNode(""),
|
|
523
|
-
vue.createCommentVNode("picture"),
|
|
524
|
-
vue.createElementVNode("span", { style: { "color": "var(--el-text-color-regular)", "line-height": "32px", "height": "32px" } }, " \u6682\u4E0D\u652F\u6301picture\uFF0C\u8BF7\u4F7F\u7528\u63D2\u69FD\u81EA\u884C\u5B9E\u73B0 ")
|
|
525
|
-
],
|
|
526
|
-
2112
|
|
527
|
-
)) : vue.createCommentVNode("v-if", true),
|
|
528
|
-
vue.createCommentVNode("")
|
|
529
|
-
]),
|
|
530
|
-
_: 2
|
|
531
|
-
}, 1032, ["label", "prop", "rules", "label-width"])
|
|
532
|
-
]),
|
|
533
|
-
_: 2
|
|
534
|
-
}, 1032, ["span"]);
|
|
535
|
-
}),
|
|
536
|
-
128
|
|
537
|
-
))
|
|
538
|
-
]),
|
|
539
|
-
_: 3
|
|
540
|
-
})
|
|
541
|
-
]),
|
|
542
|
-
_: 3
|
|
543
|
-
}, 8, ["model", "disabled", "size", "label-width", "onSubmit"])) : (vue.openBlock(), vue.createElementBlock(
|
|
544
|
-
vue.Fragment,
|
|
545
|
-
{ key: 1 },
|
|
546
|
-
[
|
|
547
|
-
vue.createCommentVNode(""),
|
|
548
|
-
vue.createCommentVNode("\u8BE6\u60C5\u6A21\u5F0F"),
|
|
549
|
-
vue.createElementVNode("table", { class: "detail-desc" }, [
|
|
550
|
-
vue.createElementVNode("tbody", null, [
|
|
551
|
-
(vue.openBlock(true), vue.createElementBlock(
|
|
552
|
-
vue.Fragment,
|
|
553
|
-
null,
|
|
554
|
-
vue.renderList(detailTableRows.value, (row, rowIndex) => {
|
|
555
|
-
return vue.openBlock(), vue.createElementBlock("tr", { key: rowIndex }, [
|
|
556
|
-
(vue.openBlock(true), vue.createElementBlock(
|
|
557
|
-
vue.Fragment,
|
|
558
|
-
null,
|
|
559
|
-
vue.renderList(row, (column, index) => {
|
|
560
|
-
return vue.openBlock(), vue.createElementBlock(
|
|
561
|
-
vue.Fragment,
|
|
562
|
-
{ key: index },
|
|
563
|
-
[
|
|
564
|
-
vue.createElementVNode(
|
|
565
|
-
"td",
|
|
566
|
-
{
|
|
567
|
-
style: vue.normalizeStyle({ width: column.labelWidth || formOption.value.labelWidth }),
|
|
568
|
-
colspan: "1",
|
|
569
|
-
class: "label"
|
|
570
|
-
},
|
|
571
|
-
vue.toDisplayString(column.label),
|
|
572
|
-
5
|
|
573
|
-
),
|
|
574
|
-
vue.createElementVNode("td", {
|
|
575
|
-
colspan: getValueColspan(column, row, index)
|
|
576
|
-
}, [
|
|
577
|
-
column.type === "picture" ? (vue.openBlock(), vue.createBlock(_component_MPicture, {
|
|
578
|
-
key: 0,
|
|
579
|
-
src: getDetailPic(vue.unref(proxys), column)[0],
|
|
580
|
-
"preview-src-list": getDetailPic(vue.unref(proxys), column),
|
|
581
|
-
"img-width": "100px",
|
|
582
|
-
"img-height": "100px"
|
|
583
|
-
}, null, 8, ["src", "preview-src-list"])) : NEED_DIC_TYPE.includes(column.type || "") ? (vue.openBlock(), vue.createElementBlock(
|
|
584
|
-
vue.Fragment,
|
|
585
|
-
{ key: 1 },
|
|
586
|
-
[
|
|
587
|
-
vue.createTextVNode(
|
|
588
|
-
vue.toDisplayString(formatDicValue(vue.unref(proxys), column)),
|
|
589
|
-
1
|
|
590
|
-
)
|
|
591
|
-
],
|
|
592
|
-
64
|
|
593
|
-
)) : column.type === "qrcode" ? (vue.openBlock(), vue.createElementBlock(
|
|
594
|
-
vue.Fragment,
|
|
595
|
-
{ key: 2 },
|
|
596
|
-
[
|
|
597
|
-
vue.unref(proxys)[column.prop || ""] ? (vue.openBlock(), vue.createBlock(_component_MQrcode, {
|
|
598
|
-
key: 0,
|
|
599
|
-
text: vue.unref(proxys)[column.prop || ""],
|
|
600
|
-
align: "center"
|
|
601
|
-
}, null, 8, ["text"])) : vue.createCommentVNode("v-if", true)
|
|
602
|
-
],
|
|
603
|
-
64
|
|
604
|
-
)) : column.type === "barcode" ? (vue.openBlock(), vue.createElementBlock(
|
|
605
|
-
vue.Fragment,
|
|
606
|
-
{ key: 3 },
|
|
607
|
-
[
|
|
608
|
-
vue.unref(proxys)[column.prop || ""] ? (vue.openBlock(), vue.createBlock(_component_MBarcode, {
|
|
609
|
-
key: 0,
|
|
610
|
-
text: vue.unref(proxys)[column.prop || ""],
|
|
611
|
-
align: "center"
|
|
612
|
-
}, null, 8, ["text"])) : vue.createCommentVNode("v-if", true)
|
|
613
|
-
],
|
|
614
|
-
64
|
|
615
|
-
)) : (vue.openBlock(), vue.createElementBlock(
|
|
616
|
-
vue.Fragment,
|
|
617
|
-
{ key: 4 },
|
|
618
|
-
[
|
|
619
|
-
vue.createTextVNode(
|
|
620
|
-
vue.toDisplayString(vue.unref(proxys)[column.prop || ""]),
|
|
621
|
-
1
|
|
622
|
-
)
|
|
623
|
-
],
|
|
624
|
-
64
|
|
625
|
-
))
|
|
626
|
-
], 8, ["colspan"])
|
|
627
|
-
],
|
|
628
|
-
64
|
|
629
|
-
);
|
|
630
|
-
}),
|
|
631
|
-
128
|
|
632
|
-
))
|
|
633
|
-
]);
|
|
634
|
-
}),
|
|
635
|
-
128
|
|
636
|
-
))
|
|
637
|
-
])
|
|
638
|
-
])
|
|
639
|
-
],
|
|
640
|
-
64
|
|
641
|
-
))
|
|
642
|
-
]);
|
|
643
|
-
};
|
|
8
|
+
const formProps = runtime.buildProps({
|
|
9
|
+
size: index.useSizeProp,
|
|
10
|
+
model: {
|
|
11
|
+
type: Object,
|
|
12
|
+
required: true
|
|
13
|
+
},
|
|
14
|
+
loading: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
default: false
|
|
17
|
+
},
|
|
18
|
+
permission: {
|
|
19
|
+
type: Object,
|
|
20
|
+
default: {}
|
|
21
|
+
},
|
|
22
|
+
readonly: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: false
|
|
25
|
+
},
|
|
26
|
+
option: {
|
|
27
|
+
type: runtime.definePropType(Object),
|
|
28
|
+
required: false
|
|
644
29
|
}
|
|
645
30
|
});
|
|
646
|
-
|
|
31
|
+
const formEmits = {};
|
|
647
32
|
|
|
648
|
-
exports
|
|
33
|
+
exports.formEmits = formEmits;
|
|
34
|
+
exports.formProps = formProps;
|
|
649
35
|
//# sourceMappingURL=form.js.map
|