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