m-eleplus-crud 0.0.1 → 0.0.3

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.
Files changed (54) hide show
  1. package/dist/index.full.js +4 -2
  2. package/dist/index.full.min.js +6 -6
  3. package/dist/index.full.min.js.map +1 -1
  4. package/dist/index.full.min.mjs +1 -1
  5. package/dist/index.full.min.mjs.map +1 -1
  6. package/dist/index.full.mjs +4 -2
  7. package/es/components/table/src/table.d.ts +4 -0
  8. package/es/index.mjs +4 -4
  9. package/es/packages/components/form/index.mjs +2 -2
  10. package/es/packages/components/form/src/form.mjs +622 -25
  11. package/es/packages/components/form/src/form.mjs.map +1 -1
  12. package/es/packages/components/form/src/form2.mjs +25 -622
  13. package/es/packages/components/form/src/form2.mjs.map +1 -1
  14. package/es/packages/components/index.mjs +4 -4
  15. package/es/packages/components/picture/index.mjs +2 -2
  16. package/es/packages/components/picture/src/picture.mjs +26 -19
  17. package/es/packages/components/picture/src/picture.mjs.map +1 -1
  18. package/es/packages/components/picture/src/picture2.mjs +19 -26
  19. package/es/packages/components/picture/src/picture2.mjs.map +1 -1
  20. package/es/packages/components/qrcode/index.mjs +2 -2
  21. package/es/packages/components/qrcode/src/qrcode.mjs +22 -62
  22. package/es/packages/components/qrcode/src/qrcode.mjs.map +1 -1
  23. package/es/packages/components/qrcode/src/qrcode2.mjs +62 -22
  24. package/es/packages/components/qrcode/src/qrcode2.mjs.map +1 -1
  25. package/es/packages/components/table/index.mjs +2 -2
  26. package/es/packages/components/table/src/table.mjs +37 -417
  27. package/es/packages/components/table/src/table.mjs.map +1 -1
  28. package/es/packages/components/table/src/table2.mjs +419 -37
  29. package/es/packages/components/table/src/table2.mjs.map +1 -1
  30. package/lib/components/table/src/table.d.ts +4 -0
  31. package/lib/index.js +4 -4
  32. package/lib/packages/components/form/index.js +2 -2
  33. package/lib/packages/components/form/src/form.js +622 -26
  34. package/lib/packages/components/form/src/form.js.map +1 -1
  35. package/lib/packages/components/form/src/form2.js +26 -622
  36. package/lib/packages/components/form/src/form2.js.map +1 -1
  37. package/lib/packages/components/index.js +4 -4
  38. package/lib/packages/components/picture/index.js +2 -2
  39. package/lib/packages/components/picture/src/picture.js +26 -20
  40. package/lib/packages/components/picture/src/picture.js.map +1 -1
  41. package/lib/packages/components/picture/src/picture2.js +20 -26
  42. package/lib/packages/components/picture/src/picture2.js.map +1 -1
  43. package/lib/packages/components/qrcode/index.js +2 -2
  44. package/lib/packages/components/qrcode/src/qrcode.js +23 -66
  45. package/lib/packages/components/qrcode/src/qrcode.js.map +1 -1
  46. package/lib/packages/components/qrcode/src/qrcode2.js +66 -23
  47. package/lib/packages/components/qrcode/src/qrcode2.js.map +1 -1
  48. package/lib/packages/components/table/index.js +2 -2
  49. package/lib/packages/components/table/src/table.js +38 -422
  50. package/lib/packages/components/table/src/table.js.map +1 -1
  51. package/lib/packages/components/table/src/table2.js +424 -38
  52. package/lib/packages/components/table/src/table2.js.map +1 -1
  53. package/package.json +1 -1
  54. package/web-types.json +1 -1
@@ -2,630 +2,34 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var vue = require('vue');
6
- var lodashUnified = require('lodash-unified');
7
- var form = require('./form.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 COMPONENT_NAME = "MForm";
13
- const __default__ = vue.defineComponent({
14
- name: COMPONENT_NAME
15
- });
16
- const _sfc_main = vue.defineComponent({
17
- ...__default__,
18
- props: form.formProps,
19
- emits: form.formEmits,
20
- setup(__props, { expose: __expose }) {
21
- const props = __props;
22
- const slots = vue.useSlots();
23
- const globalConfig = useGlobalConfig.useGlobalConfig();
24
- const formRef = vue.ref();
25
- const INPUT_TYPES = [
26
- "input",
27
- "textarea",
28
- "number",
29
- "password",
30
- "qrcode",
31
- "barcode"
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 formatDicValue = (row, column) => {
175
- let dictLabel = "";
176
- const findLabelByValue = (dicData, value) => {
177
- const dictItem = (dicData || []).find((dict) => dict.value === value);
178
- if (dictItem === void 0) {
179
- return dictLabel;
180
- }
181
- return dictItem.label;
182
- };
183
- if (column.type === "select" && column.multiple || column.type === "checkbox") {
184
- let values = [];
185
- if (row[column.prop || ""] != null && row[column.prop || ""] != void 0 && row[column.prop || ""] !== "") {
186
- if (Array.isArray(row[column.prop || ""])) {
187
- values = row[column.prop || ""];
188
- } else if (typeof row[column.prop || ""] === "string") {
189
- values = row[column.prop || ""].split(",");
190
- } else {
191
- values = [row[column.prop || ""]];
192
- }
193
- }
194
- const result = [];
195
- for (const value of values) {
196
- dictLabel = findLabelByValue(column.dicData || [], value);
197
- if (dictLabel === void 0) {
198
- break;
199
- }
200
- result.push(dictLabel);
201
- }
202
- return result.join(",");
203
- }
204
- dictLabel = findLabelByValue(column.dicData || [], row[column.prop || ""]);
205
- return dictLabel;
206
- };
207
- const getDetailPic = (row, column) => {
208
- if (!row || !row[column.prop || ""]) {
209
- return [];
210
- }
211
- const pics = row[column.prop || ""].split(column.imgSuffix || ";").map((pic) => (column.imgPrefix || "") + pic);
212
- return pics;
213
- };
214
- const getValueColspan = (item, rows, index) => {
215
- const getRemaining = (row) => {
216
- const used = row.reduce((acc, item2) => acc + (item2.span || 12), 0);
217
- return 24 - used;
218
- };
219
- if (index === rows.length - 1) {
220
- return (item.span || 12) + getRemaining(rows) - 1;
221
- }
222
- return (item.span || 12) - 1;
223
- };
224
- const validForm = () => {
225
- return new Promise((resolve) => {
226
- formRef.value.validate((valid) => {
227
- resolve(valid);
228
- });
229
- });
230
- };
231
- const clear = () => {
232
- var _a, _b;
233
- (_a = formRef.value) == null ? void 0 : _a.clearValidate();
234
- (_b = formRef.value) == null ? void 0 : _b.resetFields();
235
- };
236
- vue.watch(
237
- () => props.option,
238
- (newVal) => {
239
- if (newVal) {
240
- formOption.value = Object.assign({}, formOption.value, newVal);
241
- if (newVal.column) {
242
- formOption.value.column = lodashUnified.cloneDeep(
243
- newVal.column.filter(
244
- (column) => !(props.permission[column.prop || ""] === false)
245
- ).sort((a, b) => (b.order || 0) - (a.order || 0))
246
- );
247
- getAllRemoteDics();
248
- if (!props.readonly) {
249
- initValue();
250
- }
251
- }
252
- }
253
- },
254
- {
255
- immediate: true,
256
- deep: true
257
- }
258
- );
259
- __expose({
260
- validForm,
261
- clear
262
- });
263
- return (_ctx, _cache) => {
264
- const _component_el_input = vue.resolveComponent("el-input");
265
- const _component_el_option = vue.resolveComponent("el-option");
266
- const _component_el_select = vue.resolveComponent("el-select");
267
- const _component_el_radio = vue.resolveComponent("el-radio");
268
- const _component_el_radio_group = vue.resolveComponent("el-radio-group");
269
- const _component_el_checkbox = vue.resolveComponent("el-checkbox");
270
- const _component_el_checkbox_group = vue.resolveComponent("el-checkbox-group");
271
- const _component_el_switch = vue.resolveComponent("el-switch");
272
- const _component_el_date_picker = vue.resolveComponent("el-date-picker");
273
- const _component_el_time_picker = vue.resolveComponent("el-time-picker");
274
- const _component_el_form_item = vue.resolveComponent("el-form-item");
275
- const _component_el_col = vue.resolveComponent("el-col");
276
- const _component_el_row = vue.resolveComponent("el-row");
277
- const _component_el_form = vue.resolveComponent("el-form");
278
- const _component_MPicture = vue.resolveComponent("MPicture");
279
- const _component_MQrcode = vue.resolveComponent("MQrcode");
280
- const _component_MBarcode = vue.resolveComponent("MBarcode");
281
- return vue.openBlock(), vue.createElementBlock("div", { class: "m-form" }, [
282
- vue.createCommentVNode("\u7F16\u8F91\u6A21\u5F0F"),
283
- !_ctx.readonly ? (vue.openBlock(), vue.createBlock(_component_el_form, {
284
- key: 0,
285
- ref_key: "formRef",
286
- ref: formRef,
287
- model: vue.unref(proxys),
288
- disabled: _ctx.loading,
289
- size: _ctx.size || vue.unref(globalConfig).size,
290
- "label-width": formOption.value.labelWidth,
291
- style: { "width": "100%" },
292
- onSubmit: vue.withModifiers(() => {
293
- }, ["prevent"])
294
- }, {
295
- default: vue.withCtx(() => [
296
- vue.createVNode(_component_el_row, { gutter: 0 }, {
297
- default: vue.withCtx(() => [
298
- (vue.openBlock(true), vue.createElementBlock(
299
- vue.Fragment,
300
- null,
301
- vue.renderList(formOption.value.column, (column, columnIndex) => {
302
- return vue.openBlock(), vue.createBlock(_component_el_col, {
303
- key: columnIndex,
304
- span: column.span || 12
305
- }, {
306
- default: vue.withCtx(() => [
307
- vue.createVNode(_component_el_form_item, {
308
- style: { "width": "100%" },
309
- label: column.label + ":",
310
- prop: column.prop,
311
- rules: column.rules,
312
- "label-width": column.labelWidth || formOption.value.labelWidth
313
- }, {
314
- default: vue.withCtx(() => [
315
- vue.createCommentVNode("\u63D2\u69FD\u4FE1\u606F"),
316
- vue.unref(slots)[column.prop || ""] ? vue.renderSlot(_ctx.$slots, column.prop, vue.mergeProps({
317
- key: 0,
318
- ref_for: true
319
- }, { size: _ctx.size || vue.unref(globalConfig).size, loading: _ctx.loading })) : !column.type || INPUT_TYPES.includes(column.type) ? (vue.openBlock(), vue.createElementBlock(
320
- vue.Fragment,
321
- { key: 1 },
322
- [
323
- vue.createCommentVNode(""),
324
- vue.createCommentVNode("\u8F93\u5165\u6846"),
325
- vue.createVNode(_component_el_input, {
326
- modelValue: vue.unref(proxys)[column.prop || ""],
327
- "onUpdate:modelValue": ($event) => vue.unref(proxys)[column.prop || ""] = $event,
328
- modelModifiers: { trim: true },
329
- style: { "width": "100%" },
330
- placeholder: column.placeholder,
331
- maxlength: column.maxlength,
332
- "show-word-limit": column.showWordLimit,
333
- "show-password": column.showPassword,
334
- type: !column.type || column.type === "input" ? "text" : column.type
335
- }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "maxlength", "show-word-limit", "show-password", "type"])
336
- ],
337
- 2112
338
- )) : column.type === "select" ? (vue.openBlock(), vue.createElementBlock(
339
- vue.Fragment,
340
- { key: 2 },
341
- [
342
- vue.createCommentVNode(""),
343
- vue.createCommentVNode("\u4E0B\u62C9\u6846"),
344
- vue.createVNode(_component_el_select, {
345
- modelValue: vue.unref(proxys)[column.prop || ""],
346
- "onUpdate:modelValue": ($event) => vue.unref(proxys)[column.prop || ""] = $event,
347
- modelModifiers: { trim: true },
348
- style: { "width": "100%" },
349
- placeholder: column.placeholder,
350
- multiple: column.multiple,
351
- clearable: column.clearable,
352
- filterable: column.filterable,
353
- "filter-method": column.filterMethod,
354
- remote: column.remote,
355
- "remote-method": column.remoteMethod,
356
- loading: column.loading
357
- }, {
358
- default: vue.withCtx(() => [
359
- (vue.openBlock(true), vue.createElementBlock(
360
- vue.Fragment,
361
- null,
362
- vue.renderList(column.dicData || [], (dicItem, dicIndex) => {
363
- return vue.openBlock(), vue.createBlock(_component_el_option, {
364
- key: dicIndex,
365
- label: dicItem.label,
366
- value: dicItem.value
367
- }, null, 8, ["label", "value"]);
368
- }),
369
- 128
370
- ))
371
- ]),
372
- _: 2
373
- }, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "multiple", "clearable", "filterable", "filter-method", "remote", "remote-method", "loading"])
374
- ],
375
- 2112
376
- )) : column.type === "radio" ? (vue.openBlock(), vue.createElementBlock(
377
- vue.Fragment,
378
- { key: 3 },
379
- [
380
- vue.createCommentVNode(""),
381
- vue.createCommentVNode("radio"),
382
- vue.createVNode(_component_el_radio_group, {
383
- modelValue: vue.unref(proxys)[column.prop || ""],
384
- "onUpdate:modelValue": ($event) => vue.unref(proxys)[column.prop || ""] = $event,
385
- style: { "width": "100%" }
386
- }, {
387
- default: vue.withCtx(() => [
388
- (vue.openBlock(true), vue.createElementBlock(
389
- vue.Fragment,
390
- null,
391
- vue.renderList(column.dicData || [], (dicItem, dicIndex) => {
392
- return vue.openBlock(), vue.createBlock(_component_el_radio, {
393
- key: dicIndex,
394
- value: dicItem.value,
395
- label: dicItem.value
396
- }, {
397
- default: vue.withCtx(() => [
398
- vue.createTextVNode(
399
- vue.toDisplayString(dicItem.label),
400
- 1
401
- )
402
- ]),
403
- _: 2
404
- }, 1032, ["value", "label"]);
405
- }),
406
- 128
407
- ))
408
- ]),
409
- _: 2
410
- }, 1032, ["modelValue", "onUpdate:modelValue"])
411
- ],
412
- 2112
413
- )) : column.type === "checkbox" ? (vue.openBlock(), vue.createElementBlock(
414
- vue.Fragment,
415
- { key: 4 },
416
- [
417
- vue.createCommentVNode(""),
418
- vue.createCommentVNode("checkbox"),
419
- vue.createVNode(_component_el_checkbox_group, {
420
- modelValue: vue.unref(proxys)[column.prop || ""],
421
- "onUpdate:modelValue": ($event) => vue.unref(proxys)[column.prop || ""] = $event,
422
- style: { "width": "100%" }
423
- }, {
424
- default: vue.withCtx(() => [
425
- (vue.openBlock(true), vue.createElementBlock(
426
- vue.Fragment,
427
- null,
428
- vue.renderList(column.dicData || [], (dicItem, dicIndex) => {
429
- return vue.openBlock(), vue.createBlock(_component_el_checkbox, {
430
- key: dicIndex,
431
- label: dicItem.label,
432
- value: dicItem.value
433
- }, null, 8, ["label", "value"]);
434
- }),
435
- 128
436
- ))
437
- ]),
438
- _: 2
439
- }, 1032, ["modelValue", "onUpdate:modelValue"])
440
- ],
441
- 2112
442
- )) : column.type === "switch" ? (vue.openBlock(), vue.createElementBlock(
443
- vue.Fragment,
444
- { key: 5 },
445
- [
446
- vue.createCommentVNode(""),
447
- vue.createCommentVNode("switch"),
448
- !column.dicData || column.dicData.length != 2 ? (vue.openBlock(), vue.createElementBlock("span", {
449
- key: 0,
450
- style: { "color": "var(--el-text-color-placeholder)", "line-height": "32px", "height": "32px" }
451
- }, '"dicData/dicUrl\u7684\u7ED3\u679C"\u672A\u8BBE\u7F6E\u6216\u957F\u5EA6\u4E0D\u7B49\u4E8E2')) : (vue.openBlock(), vue.createElementBlock(
452
- vue.Fragment,
453
- { key: 1 },
454
- [
455
- vue.createVNode(_component_el_switch, {
456
- modelValue: vue.unref(proxys)[column.prop || ""],
457
- "onUpdate:modelValue": ($event) => vue.unref(proxys)[column.prop || ""] = $event,
458
- "active-value": column.dicData[0].value,
459
- "inactive-value": column.dicData[1].value
460
- }, null, 8, ["modelValue", "onUpdate:modelValue", "active-value", "inactive-value"]),
461
- vue.createElementVNode(
462
- "span",
463
- { style: { "font-size": "var(--el-font-size-base)", "color": "var(--el-text-color-regular)", "margin-left": "6px" } },
464
- vue.toDisplayString(vue.unref(proxys)[column.prop || ""] === column.dicData[0].value ? column.dicData[0].label : column.dicData[1].label),
465
- 1
466
- )
467
- ],
468
- 64
469
- ))
470
- ],
471
- 64
472
- )) : DATE_TYPES.includes(column.type) ? (vue.openBlock(), vue.createElementBlock(
473
- vue.Fragment,
474
- { key: 6 },
475
- [
476
- vue.createCommentVNode(""),
477
- vue.createCommentVNode("\u65F6\u95F4"),
478
- column.type !== "time" && column.type !== "timerange" ? (vue.openBlock(), vue.createBlock(_component_el_date_picker, {
479
- key: 0,
480
- modelValue: vue.unref(proxys)[column.prop || ""],
481
- "onUpdate:modelValue": ($event) => vue.unref(proxys)[column.prop || ""] = $event,
482
- type: column.type,
483
- clearable: column.clearable,
484
- "start-placeholder": column.startPlaceholder,
485
- "end-placeholder": column.endPlaceholder,
486
- format: column.format,
487
- "value-format": column.valueFormat || getValueFormatByType(column.type)
488
- }, null, 8, ["modelValue", "onUpdate:modelValue", "type", "clearable", "start-placeholder", "end-placeholder", "format", "value-format"])) : (vue.openBlock(), vue.createBlock(_component_el_time_picker, {
489
- key: 1,
490
- modelValue: vue.unref(proxys)[column.prop || ""],
491
- "onUpdate:modelValue": ($event) => vue.unref(proxys)[column.prop || ""] = $event,
492
- "is-range": column.type === "timerange",
493
- clearable: column.clearable,
494
- "start-placeholder": column.startPlaceholder,
495
- "end-placeholder": column.endPlaceholder,
496
- "value-format": column.valueFormat || getValueFormatByType(column.type)
497
- }, null, 8, ["modelValue", "onUpdate:modelValue", "is-range", "clearable", "start-placeholder", "end-placeholder", "value-format"]))
498
- ],
499
- 64
500
- )) : column.type === "picture" ? (vue.openBlock(), vue.createElementBlock(
501
- vue.Fragment,
502
- { key: 7 },
503
- [
504
- vue.createCommentVNode(""),
505
- vue.createCommentVNode("picture"),
506
- 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 ")
507
- ],
508
- 2112
509
- )) : vue.createCommentVNode("v-if", true),
510
- vue.createCommentVNode("")
511
- ]),
512
- _: 2
513
- }, 1032, ["label", "prop", "rules", "label-width"])
514
- ]),
515
- _: 2
516
- }, 1032, ["span"]);
517
- }),
518
- 128
519
- ))
520
- ]),
521
- _: 3
522
- })
523
- ]),
524
- _: 3
525
- }, 8, ["model", "disabled", "size", "label-width", "onSubmit"])) : (vue.openBlock(), vue.createElementBlock(
526
- vue.Fragment,
527
- { key: 1 },
528
- [
529
- vue.createCommentVNode(""),
530
- vue.createCommentVNode("\u8BE6\u60C5\u6A21\u5F0F"),
531
- vue.createElementVNode("table", { class: "detail-desc" }, [
532
- vue.createElementVNode("tbody", null, [
533
- (vue.openBlock(true), vue.createElementBlock(
534
- vue.Fragment,
535
- null,
536
- vue.renderList(detailTableRows.value, (row, rowIndex) => {
537
- return vue.openBlock(), vue.createElementBlock("tr", { key: rowIndex }, [
538
- (vue.openBlock(true), vue.createElementBlock(
539
- vue.Fragment,
540
- null,
541
- vue.renderList(row, (column, index) => {
542
- return vue.openBlock(), vue.createElementBlock(
543
- vue.Fragment,
544
- { key: index },
545
- [
546
- vue.createElementVNode(
547
- "td",
548
- {
549
- style: vue.normalizeStyle({ width: column.labelWidth || formOption.value.labelWidth }),
550
- colspan: "1",
551
- class: "label"
552
- },
553
- vue.toDisplayString(column.label),
554
- 5
555
- ),
556
- vue.createElementVNode("td", {
557
- colspan: getValueColspan(column, row, index)
558
- }, [
559
- column.type === "picture" ? (vue.openBlock(), vue.createBlock(_component_MPicture, {
560
- key: 0,
561
- src: getDetailPic(vue.unref(proxys), column)[0],
562
- "preview-src-list": getDetailPic(vue.unref(proxys), column)[0],
563
- "img-width": "100px",
564
- "img-height": "100px"
565
- }, null, 8, ["src", "preview-src-list"])) : NEED_DIC_TYPE.includes(column.type || "") ? (vue.openBlock(), vue.createElementBlock(
566
- vue.Fragment,
567
- { key: 1 },
568
- [
569
- vue.createTextVNode(
570
- vue.toDisplayString(formatDicValue(vue.unref(proxys), column)),
571
- 1
572
- )
573
- ],
574
- 64
575
- )) : column.type === "qrcode" ? (vue.openBlock(), vue.createElementBlock(
576
- vue.Fragment,
577
- { key: 2 },
578
- [
579
- vue.unref(proxys)[column.prop || ""] ? (vue.openBlock(), vue.createBlock(_component_MQrcode, {
580
- key: 0,
581
- text: vue.unref(proxys)[column.prop || ""],
582
- align: "center"
583
- }, null, 8, ["text"])) : vue.createCommentVNode("v-if", true)
584
- ],
585
- 64
586
- )) : column.type === "barcode" ? (vue.openBlock(), vue.createElementBlock(
587
- vue.Fragment,
588
- { key: 3 },
589
- [
590
- vue.unref(proxys)[column.prop || ""] ? (vue.openBlock(), vue.createBlock(_component_MBarcode, {
591
- key: 0,
592
- text: vue.unref(proxys)[column.prop || ""],
593
- align: "center"
594
- }, null, 8, ["text"])) : vue.createCommentVNode("v-if", true)
595
- ],
596
- 64
597
- )) : (vue.openBlock(), vue.createElementBlock(
598
- vue.Fragment,
599
- { key: 4 },
600
- [
601
- vue.createTextVNode(
602
- vue.toDisplayString(vue.unref(proxys)[column.prop || ""]),
603
- 1
604
- )
605
- ],
606
- 64
607
- ))
608
- ], 8, ["colspan"])
609
- ],
610
- 64
611
- );
612
- }),
613
- 128
614
- ))
615
- ]);
616
- }),
617
- 128
618
- ))
619
- ])
620
- ])
621
- ],
622
- 64
623
- ))
624
- ]);
625
- };
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
626
29
  }
627
30
  });
628
- var Form = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "form.vue"]]);
31
+ const formEmits = {};
629
32
 
630
- exports["default"] = Form;
33
+ exports.formEmits = formEmits;
34
+ exports.formProps = formProps;
631
35
  //# sourceMappingURL=form2.js.map