bm-admin-ui 1.0.20-alpha → 1.0.22-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.
Files changed (49) hide show
  1. package/es/components/feedback/index.js +25 -1306
  2. package/es/components/float-table/index.js +36 -27
  3. package/es/components/form-create/index.js +2769 -0
  4. package/es/components/form-designer/index.js +4178 -9
  5. package/es/components/index.js +1 -0
  6. package/es/components/input-tags-display/index.js +27 -1187
  7. package/es/components/multi-cascader-compose/index.js +31 -1199
  8. package/es/components/over-tooltips/index.js +27 -20
  9. package/es/components/search-filter/index.js +52 -1253
  10. package/es/components/shops-filter/index.js +24 -1182
  11. package/es/components/staffs-selector/index.js +131 -1241
  12. package/es/components/timeline/index.js +6 -6
  13. package/es/components/upload/index.js +101 -1334
  14. package/es/utils/uniqueId.js +5 -0
  15. package/es/utils/vxe-table.js +4 -3
  16. package/lib/components/feedback/index.js +23 -1304
  17. package/lib/components/float-table/index.js +36 -27
  18. package/lib/components/form-create/index.js +2781 -0
  19. package/lib/components/form-designer/index.js +4183 -8
  20. package/lib/components/index.js +7 -0
  21. package/lib/components/input-tags-display/index.js +26 -1186
  22. package/lib/components/multi-cascader-compose/index.js +30 -1198
  23. package/lib/components/over-tooltips/index.js +27 -20
  24. package/lib/components/search-filter/index.js +51 -1252
  25. package/lib/components/shops-filter/index.js +23 -1181
  26. package/lib/components/staffs-selector/index.js +130 -1240
  27. package/lib/components/timeline/index.js +6 -6
  28. package/lib/components/upload/index.js +100 -1333
  29. package/lib/utils/uniqueId.js +8 -0
  30. package/lib/utils/vxe-table.js +3 -2
  31. package/package.json +9 -4
  32. package/theme-chalk/button.css +1 -1
  33. package/theme-chalk/feedback.css +1 -1
  34. package/theme-chalk/float-table.css +1 -1
  35. package/theme-chalk/floating-vue.css +1 -1
  36. package/theme-chalk/flow-designer.css +1 -1
  37. package/theme-chalk/form-create.css +1 -0
  38. package/theme-chalk/form-designer.css +1 -0
  39. package/theme-chalk/index.css +1 -1
  40. package/theme-chalk/input-tags-display.css +1 -1
  41. package/theme-chalk/modal.css +1 -1
  42. package/theme-chalk/multi-cascader-compose.css +1 -1
  43. package/theme-chalk/over-tooltips.css +1 -1
  44. package/theme-chalk/search-filter.css +1 -1
  45. package/theme-chalk/staffs-selector.css +1 -1
  46. package/theme-chalk/timeline.css +1 -1
  47. package/theme-chalk/upload.css +1 -1
  48. package/index.esm.js +0 -46662
  49. package/index.js +0 -46692
@@ -4,6 +4,71 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var withInstall = require('bm-admin-ui/lib/utils/with-install');
6
6
  var vue = require('vue');
7
+ var uniqueId = require('bm-admin-ui/lib/utils/uniqueId');
8
+ var Draggable = require('vuedraggable');
9
+ var antDesignVue = require('ant-design-vue');
10
+ var iconsVue = require('@ant-design/icons-vue');
11
+ var components = require('bm-admin-ui/lib/components');
12
+ var lodashEs = require('lodash-es');
13
+ var FC = require('@form-create/ant-design-vue');
14
+
15
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
16
+
17
+ var uniqueId__default = /*#__PURE__*/_interopDefaultLegacy(uniqueId);
18
+ var Draggable__default = /*#__PURE__*/_interopDefaultLegacy(Draggable);
19
+ var FC__default = /*#__PURE__*/_interopDefaultLegacy(FC);
20
+
21
+ var WidgetType;
22
+ (function (WidgetType) {
23
+ WidgetType["RowWidget"] = "RowWidget";
24
+ WidgetType["TableWidget"] = "TableWidget";
25
+ WidgetType["UploadFile"] = "UploadFile";
26
+ })(WidgetType || (WidgetType = {}));
27
+ function getFieldRatioRule(rule, parentRule) {
28
+ let defaultValue = rule.config.fieldRatio;
29
+ const propRule = {
30
+ type: 'radio',
31
+ title: '字段占比',
32
+ options: [],
33
+ props: {
34
+ optionType: 'button',
35
+ buttonStyle: 'solid',
36
+ },
37
+ };
38
+ switch (parentRule === null || parentRule === void 0 ? void 0 : parentRule.type) {
39
+ case WidgetType.RowWidget:
40
+ defaultValue = defaultValue || 12;
41
+ propRule.options = [
42
+ { value: 6, label: '25%' },
43
+ { value: 12, label: '50%' },
44
+ { value: 18, label: '75%' },
45
+ { value: 24, label: '100%' },
46
+ ];
47
+ propRule.value = defaultValue;
48
+ break;
49
+ case WidgetType.TableWidget:
50
+ defaultValue = defaultValue || '140px';
51
+ propRule.title = '子字段宽度';
52
+ propRule.options = [
53
+ { value: '140px', label: '小' },
54
+ { value: '212px', label: '中' },
55
+ { value: '392px', label: '大' },
56
+ { value: '572px', label: '超大 ' },
57
+ ];
58
+ propRule.value = defaultValue;
59
+ break;
60
+ default:
61
+ defaultValue = defaultValue || '100%';
62
+ propRule.options = [
63
+ { value: '25%', label: '25%' },
64
+ { value: '50%', label: '50%' },
65
+ { value: '75%', label: '75%' },
66
+ { value: '100%', label: '100%' },
67
+ ];
68
+ propRule.value = defaultValue;
69
+ }
70
+ return propRule;
71
+ }
7
72
 
8
73
  var _export_sfc = (sfc, props) => {
9
74
  const target = sfc.__vccOpts || sfc;
@@ -13,22 +78,4132 @@ var _export_sfc = (sfc, props) => {
13
78
  return target;
14
79
  };
15
80
 
81
+ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
82
+ __name: "widget-instruction",
83
+ props: ["rule"],
84
+ setup(__props) {
85
+ return (_ctx, _cache) => {
86
+ return vue.openBlock(), vue.createElementBlock("div", {
87
+ style: vue.normalizeStyle({ minHeight: "22px", color: __props.rule.style.color })
88
+ }, vue.toDisplayString(__props.rule.value), 5);
89
+ };
90
+ }
91
+ });
92
+ var WidgetInstruction = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__file", "widget-instruction.vue"]]);
93
+
94
+ const _hoisted_1$g = {
95
+ key: 2,
96
+ class: "bm-drag-tool-mask"
97
+ };
98
+ const _hoisted_2$d = /* @__PURE__ */ vue.createTextVNode("\u590D\u5236");
99
+ const _hoisted_3$b = /* @__PURE__ */ vue.createTextVNode("\u5220\u9664");
100
+ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
101
+ __name: "drag-tool",
102
+ props: ["rule", "activeRule", "parentRule"],
103
+ emits: [
104
+ "copy",
105
+ "delete",
106
+ "mouseenter",
107
+ "mouseleave",
108
+ "setActiveRule",
109
+ "widgetAdd"
110
+ ],
111
+ setup(__props, { emit: emits }) {
112
+ const props = __props;
113
+ const isActive = vue.computed(() => props.rule.field === props.activeRule?.field);
114
+ const option = vue.computed(() => ({
115
+ form: {
116
+ layout: "vertical"
117
+ },
118
+ submitBtn: {
119
+ show: false
120
+ },
121
+ parentType: props.parentRule?.type,
122
+ childRules: props.parentRule?.config?.childRules
123
+ }));
124
+ function emitCopyEvt(rule, parentRule = void 0) {
125
+ emits("copy", rule, parentRule);
126
+ }
127
+ function emitDeleteEvt(rule, parentRule = void 0) {
128
+ emits("delete", rule, parentRule);
129
+ }
130
+ function handleCopy() {
131
+ emitCopyEvt(props.rule);
132
+ }
133
+ function handleDelete() {
134
+ emitDeleteEvt(props.rule);
135
+ }
136
+ function handleMouseenter() {
137
+ props.rule.config.isHover = true;
138
+ emits("mouseenter");
139
+ }
140
+ function handleMouseleave() {
141
+ props.rule.config.isHover = false;
142
+ emits("mouseleave");
143
+ }
144
+ function handleRowWidgetMouseenter() {
145
+ props.rule.config.isHover = false;
146
+ }
147
+ function handleRowWidgetMouseleave() {
148
+ props.rule.config.isHover = true;
149
+ }
150
+ function handleRowWidgetSetActiveRule(element) {
151
+ emits("setActiveRule", element, props.rule);
152
+ }
153
+ function handleRowWidgetCopy(rule) {
154
+ emitCopyEvt(rule, props.rule);
155
+ }
156
+ function handleRowWidgetDelete(rule) {
157
+ emitDeleteEvt(rule, props.rule);
158
+ }
159
+ function handleRowWidgetAdd(rule) {
160
+ emits("widgetAdd", rule, props.rule);
161
+ }
162
+ return (_ctx, _cache) => {
163
+ const _component_FormCreate = vue.resolveComponent("FormCreate");
164
+ const _component_Copy = vue.resolveComponent("Copy");
165
+ const _component_ACol = vue.resolveComponent("ACol");
166
+ const _component_Delete = vue.resolveComponent("Delete");
167
+ const _component_ARow = vue.resolveComponent("ARow");
168
+ return vue.openBlock(), vue.createElementBlock("div", {
169
+ class: vue.normalizeClass([
170
+ "bm-drag-tool",
171
+ __props.rule.type === vue.unref(WidgetType).RowWidget ? "is-row" : "",
172
+ vue.unref(isActive) ? "is-active" : "",
173
+ __props.rule?.config?.putDisabled ? "is-put-disabled" : ""
174
+ ]),
175
+ onMouseenter: handleMouseenter,
176
+ onMouseleave: handleMouseleave
177
+ }, [
178
+ __props.rule.type ? (vue.openBlock(), vue.createBlock(_component_FormCreate, {
179
+ key: 0,
180
+ option: vue.unref(option),
181
+ rule: [__props.rule],
182
+ onNestMouseenter: handleRowWidgetMouseenter,
183
+ onNestMouseleave: handleRowWidgetMouseleave,
184
+ onNestSetActiveRule: handleRowWidgetSetActiveRule,
185
+ onNestCopy: handleRowWidgetCopy,
186
+ onNestDelete: handleRowWidgetDelete,
187
+ onNestAdd: handleRowWidgetAdd
188
+ }, null, 8, ["option", "rule"])) : (vue.openBlock(), vue.createBlock(WidgetInstruction, {
189
+ key: 1,
190
+ rule: __props.rule
191
+ }, null, 8, ["rule"])),
192
+ __props.rule.type !== vue.unref(WidgetType).RowWidget && __props.rule.type !== vue.unref(WidgetType).TableWidget ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$g)) : vue.createCommentVNode("v-if", true),
193
+ __props.rule.config.isHover || vue.unref(isActive) ? (vue.openBlock(), vue.createBlock(_component_ARow, {
194
+ key: 3,
195
+ class: "bm-drag-tool-btn",
196
+ gutter: [16, 0]
197
+ }, {
198
+ default: vue.withCtx(() => [
199
+ vue.createVNode(_component_ACol, { class: "bm-drag-tool-btn-col" }, {
200
+ default: vue.withCtx(() => [
201
+ vue.createVNode(vue.unref(antDesignVue.Tooltip), { placement: "top" }, {
202
+ title: vue.withCtx(() => [
203
+ _hoisted_2$d
204
+ ]),
205
+ default: vue.withCtx(() => [
206
+ vue.createVNode(_component_Copy, {
207
+ class: "bm-drag-tool-btn-icon is-copy",
208
+ onClick: vue.withModifiers(handleCopy, ["stop"])
209
+ }, null, 8, ["onClick"])
210
+ ]),
211
+ _: 1
212
+ })
213
+ ]),
214
+ _: 1
215
+ }),
216
+ vue.createVNode(_component_ACol, { class: "bm-drag-tool-btn-col" }, {
217
+ default: vue.withCtx(() => [
218
+ vue.createVNode(vue.unref(antDesignVue.Tooltip), { placement: "top" }, {
219
+ title: vue.withCtx(() => [
220
+ _hoisted_3$b
221
+ ]),
222
+ default: vue.withCtx(() => [
223
+ vue.createVNode(_component_Delete, {
224
+ class: "bm-drag-tool-btn-icon is-delete",
225
+ onClick: vue.withModifiers(handleDelete, ["stop"])
226
+ }, null, 8, ["onClick"])
227
+ ]),
228
+ _: 1
229
+ })
230
+ ]),
231
+ _: 1
232
+ })
233
+ ]),
234
+ _: 1
235
+ })) : vue.createCommentVNode("v-if", true)
236
+ ], 34);
237
+ };
238
+ }
239
+ });
240
+ var DragTool = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__file", "drag-tool.vue"]]);
241
+
242
+ const _hoisted_1$f = { class: "bm-drag-placeholder" };
243
+ const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
244
+ __name: "drag-placeholder",
245
+ props: {},
246
+ setup(__props) {
247
+ return (_ctx, _cache) => {
248
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$f);
249
+ };
250
+ }
251
+ });
252
+ var DragPlaceholder = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__file", "drag-placeholder.vue"]]);
253
+
254
+ const _hoisted_1$e = { class: "bm-widget-row-wrap" };
255
+ const _hoisted_2$c = {
256
+ key: 0,
257
+ class: "bm-widget-row-tip"
258
+ };
259
+ const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
260
+ __name: "widget-row",
261
+ props: ["activeRule", "formCreateInject"],
262
+ emits: [
263
+ "mouseenter",
264
+ "mouseleave",
265
+ "set-active-rule",
266
+ "copy",
267
+ "delete",
268
+ "add"
269
+ ],
270
+ setup(__props, { emit: emits }) {
271
+ const props = __props;
272
+ const childRules = vue.computed(() => props.formCreateInject.rule.config.childRules);
273
+ function handleMouseenter() {
274
+ emits("mouseenter");
275
+ }
276
+ function handleMouseleave() {
277
+ emits("mouseleave");
278
+ }
279
+ function emitSetActiveRuleEvt(rule) {
280
+ emits("set-active-rule", rule);
281
+ }
282
+ function handleClick(element) {
283
+ emitSetActiveRuleEvt(element);
284
+ }
285
+ function handleRowWidgetAdd({ newIndex }) {
286
+ emits("add", childRules.value[newIndex]);
287
+ }
288
+ function handleRowWidgetUpdate({ newIndex }) {
289
+ const rule = childRules.value[newIndex];
290
+ if (rule)
291
+ emitSetActiveRuleEvt(rule);
292
+ }
293
+ function handleCopy(rule) {
294
+ emits("copy", rule);
295
+ }
296
+ function handleDelete(rule) {
297
+ emits("delete", rule);
298
+ }
299
+ return (_ctx, _cache) => {
300
+ const _component_ACol = vue.resolveComponent("ACol");
301
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$e, [
302
+ !vue.unref(childRules).length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$c, " \u53EF\u62D6\u5165\u591A\u4E2A\u63A7\u4EF6 ")) : vue.createCommentVNode("v-if", true),
303
+ vue.createVNode(vue.unref(Draggable__default["default"]), {
304
+ "component-data": {
305
+ field: __props.formCreateInject.rule.field,
306
+ type: vue.unref(WidgetType).RowWidget
307
+ },
308
+ class: "bm-widget-row",
309
+ tag: "ARow",
310
+ group: {
311
+ name: "rowWidget",
312
+ pull: true,
313
+ put: ["widget", "rowWidget", "formWidget"]
314
+ },
315
+ "ghost-class": vue.unref(childRules).length ? "row-drag-ghost" : "row-drag-ghost__is-empty",
316
+ list: vue.unref(childRules),
317
+ "force-fallback": true,
318
+ delay: 50,
319
+ "item-key": "field",
320
+ direction: "vertical",
321
+ onAdd: handleRowWidgetAdd,
322
+ onUpdate: handleRowWidgetUpdate
323
+ }, {
324
+ item: vue.withCtx(({ element }) => [
325
+ vue.createVNode(_component_ACol, {
326
+ span: element.config.fieldRatio
327
+ }, {
328
+ default: vue.withCtx(() => [
329
+ vue.createVNode(DragTool, {
330
+ rule: element,
331
+ "active-rule": __props.activeRule,
332
+ "parent-rule": __props.formCreateInject.rule,
333
+ onMouseenter: handleMouseenter,
334
+ onMouseleave: handleMouseleave,
335
+ onClick: vue.withModifiers(($event) => handleClick(element), ["stop"]),
336
+ onCopy: handleCopy,
337
+ onDelete: handleDelete
338
+ }, null, 8, ["rule", "active-rule", "parent-rule", "onClick"]),
339
+ vue.createVNode(DragPlaceholder)
340
+ ]),
341
+ _: 2
342
+ }, 1032, ["span"])
343
+ ]),
344
+ _: 1
345
+ }, 8, ["component-data", "ghost-class", "list"])
346
+ ]);
347
+ };
348
+ }
349
+ });
350
+ var WidgetRow = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__file", "widget-row.vue"]]);
351
+
352
+ const label$h = '分栏';
353
+ const fieldsMap$h = {
354
+ 'title.title': 'title.title',
355
+ 'config.title': 'config.title',
356
+ 'config.showTitle': 'config.showTitle',
357
+ };
358
+ function handleTitle(title) {
359
+ return title + '(该标题不会显示在表单)';
360
+ }
361
+ const name$h = 'row';
362
+ var row = {
363
+ icon: 'RowIcon',
364
+ name: name$h,
365
+ label: label$h,
366
+ rule() {
367
+ return {
368
+ type: WidgetType.RowWidget,
369
+ component: WidgetRow,
370
+ title: {
371
+ title: label$h,
372
+ },
373
+ field: uniqueId__default["default"](),
374
+ props: {
375
+ field: '',
376
+ list: [],
377
+ activeRule: {},
378
+ },
379
+ emit: [
380
+ 'mouseenter',
381
+ 'mouseleave',
382
+ 'set-active-rule',
383
+ 'copy',
384
+ 'delete',
385
+ 'add',
386
+ ],
387
+ emitPrefix: 'nest',
388
+ config: {
389
+ title: label$h,
390
+ showTitle: true,
391
+ childRules: [],
392
+ propsFields: Object.values(fieldsMap$h),
393
+ },
394
+ };
395
+ },
396
+ props(rule) {
397
+ return [
398
+ {
399
+ type: 'input',
400
+ title: '标题',
401
+ field: fieldsMap$h['config.title'],
402
+ value: rule.config.title,
403
+ effect: {
404
+ required: '请输入标题',
405
+ },
406
+ props: {
407
+ placeholder: '请输入',
408
+ maxlength: 10,
409
+ },
410
+ inject: true,
411
+ on: {
412
+ change({ api, self }, $event) {
413
+ const showTitle = rule.config.showTitle;
414
+ let title = $event.target.value;
415
+ if (!showTitle) {
416
+ title = handleTitle(title);
417
+ }
418
+ api.emit('change', 'title.title', title, self, api, true);
419
+ },
420
+ },
421
+ },
422
+ {
423
+ type: 'switch',
424
+ title: '是否显示标题',
425
+ field: fieldsMap$h['config.showTitle'],
426
+ value: rule.config.showTitle,
427
+ inject: true,
428
+ on: {
429
+ change({ api, self }, value) {
430
+ let title = rule.config.title;
431
+ if (!value) {
432
+ title = handleTitle(title);
433
+ }
434
+ api.emit('change', 'title.title', title, self, api, true);
435
+ },
436
+ },
437
+ },
438
+ ];
439
+ },
440
+ parse(rule) {
441
+ return {
442
+ name: name$h,
443
+ field: rule.field,
444
+ title: {
445
+ title: rule.title.title,
446
+ },
447
+ config: {
448
+ title: rule.config.title,
449
+ showTitle: rule.config.showTitle,
450
+ },
451
+ };
452
+ },
453
+ };
454
+
455
+ const label$g = '单行输入框';
456
+ const fieldsMap$g = {
457
+ 'title.title': 'title.title',
458
+ 'props.placeholder': 'props.placeholder',
459
+ value: 'value',
460
+ 'config.fieldRatio': 'config.fieldRatio',
461
+ 'effect.required': 'effect.required',
462
+ };
463
+ const name$g = 'input';
464
+ var input = {
465
+ icon: 'InputIcon',
466
+ name: name$g,
467
+ label: label$g,
468
+ rule() {
469
+ return {
470
+ type: 'input',
471
+ field: uniqueId__default["default"](),
472
+ title: {
473
+ title: label$g,
474
+ style: {
475
+ overflow: 'hidden',
476
+ textOverflow: 'ellipsis',
477
+ whiteSpace: 'nowrap',
478
+ },
479
+ },
480
+ effect: {
481
+ required: true,
482
+ formRule: 'formRule',
483
+ },
484
+ props: {
485
+ maxlength: 200,
486
+ placeholder: '请输入',
487
+ },
488
+ config: {
489
+ propsFields: Object.values(fieldsMap$g),
490
+ },
491
+ };
492
+ },
493
+ props(rule, parentRule) {
494
+ return [
495
+ {
496
+ type: 'input',
497
+ title: '标题',
498
+ field: fieldsMap$g['title.title'],
499
+ value: rule.title.title,
500
+ effect: {
501
+ required: '请输入标题',
502
+ },
503
+ props: {
504
+ placeholder: '请输入',
505
+ maxlength: 10,
506
+ },
507
+ },
508
+ {
509
+ type: 'input',
510
+ title: '提示文字',
511
+ field: fieldsMap$g['props.placeholder'],
512
+ props: {
513
+ placeholder: '请输入',
514
+ },
515
+ value: rule.props.placeholder,
516
+ },
517
+ {
518
+ type: 'input',
519
+ title: '默认值',
520
+ field: fieldsMap$g['value'],
521
+ props: {
522
+ placeholder: '请输入',
523
+ },
524
+ value: rule.value,
525
+ },
526
+ Object.assign({ field: fieldsMap$g['config.fieldRatio'] }, getFieldRatioRule(rule, parentRule)),
527
+ {
528
+ type: 'switch',
529
+ title: '是否必填',
530
+ field: fieldsMap$g['effect.required'],
531
+ value: rule.effect.required,
532
+ },
533
+ ];
534
+ },
535
+ parse(rule) {
536
+ return {
537
+ name: name$g,
538
+ field: rule.field,
539
+ title: {
540
+ title: rule.title.title,
541
+ },
542
+ props: {
543
+ placeholder: rule.props.placeholder,
544
+ },
545
+ value: rule.value,
546
+ config: {
547
+ fieldRatio: rule.config.fieldRatio,
548
+ },
549
+ effect: {
550
+ required: rule.effect.required,
551
+ },
552
+ };
553
+ },
554
+ };
555
+
556
+ const label$f = '多行输入框';
557
+ const fieldsMap$f = {
558
+ 'title.title': 'title.title',
559
+ 'props.placeholder': 'props.placeholder',
560
+ value: 'value',
561
+ 'config.fieldRatio': 'config.fieldRatio',
562
+ 'effect.required': 'effect.required',
563
+ };
564
+ const name$f = 'textarea';
565
+ var textarea = {
566
+ icon: 'TextareaIcon',
567
+ name: name$f,
568
+ label: label$f,
569
+ rule() {
570
+ return {
571
+ type: 'input',
572
+ field: uniqueId__default["default"](),
573
+ title: {
574
+ title: label$f,
575
+ style: {
576
+ overflow: 'hidden',
577
+ textOverflow: 'ellipsis',
578
+ whiteSpace: 'nowrap',
579
+ },
580
+ },
581
+ effect: {
582
+ required: true,
583
+ formRule: 'formRule',
584
+ },
585
+ props: {
586
+ type: 'textarea',
587
+ placeholder: '请输入',
588
+ maxlength: 5000,
589
+ },
590
+ config: {
591
+ propsFields: Object.values(fieldsMap$f),
592
+ },
593
+ };
594
+ },
595
+ props(rule, parentRule) {
596
+ return [
597
+ {
598
+ type: 'input',
599
+ title: '标题',
600
+ field: fieldsMap$f['title.title'],
601
+ value: rule.title.title,
602
+ effect: {
603
+ required: '请输入标题',
604
+ },
605
+ props: {
606
+ placeholder: '请输入',
607
+ maxlength: 10,
608
+ },
609
+ },
610
+ {
611
+ type: 'input',
612
+ title: '提示文字',
613
+ field: fieldsMap$f['props.placeholder'],
614
+ props: {
615
+ placeholder: '请输入',
616
+ },
617
+ value: rule.props.placeholder,
618
+ },
619
+ {
620
+ type: 'input',
621
+ title: '默认值',
622
+ field: fieldsMap$f['value'],
623
+ props: {
624
+ placeholder: '请输入',
625
+ },
626
+ value: rule.value,
627
+ },
628
+ Object.assign({ field: fieldsMap$f['config.fieldRatio'] }, getFieldRatioRule(rule, parentRule)),
629
+ {
630
+ type: 'switch',
631
+ title: '是否必填',
632
+ field: fieldsMap$f['effect.required'],
633
+ value: rule.effect.required,
634
+ },
635
+ ];
636
+ },
637
+ parse(rule) {
638
+ return {
639
+ name: name$f,
640
+ field: rule.field,
641
+ title: {
642
+ title: rule.title.title,
643
+ },
644
+ props: {
645
+ placeholder: rule.props.placeholder,
646
+ },
647
+ value: rule.value,
648
+ config: {
649
+ fieldRatio: rule.config.fieldRatio,
650
+ },
651
+ effect: {
652
+ required: rule.effect.required,
653
+ },
654
+ };
655
+ },
656
+ };
657
+
658
+ const label$e = '数字输入框';
659
+ const fieldsMap$e = {
660
+ 'title.title': 'title.title',
661
+ 'props.placeholder': 'props.placeholder',
662
+ value: 'value',
663
+ 'config.fieldRatio': 'config.fieldRatio',
664
+ 'config.count': 'config.count',
665
+ 'effect.required': 'effect.required',
666
+ };
667
+ const name$e = 'numInput';
668
+ var numInput = {
669
+ icon: 'NumInput',
670
+ name: name$e,
671
+ label: label$e,
672
+ rule() {
673
+ return {
674
+ type: 'inputNumber',
675
+ field: uniqueId__default["default"](),
676
+ title: {
677
+ title: label$e,
678
+ style: {
679
+ overflow: 'hidden',
680
+ textOverflow: 'ellipsis',
681
+ whiteSpace: 'nowrap',
682
+ },
683
+ },
684
+ effect: {
685
+ required: true,
686
+ formRule: 'formRule',
687
+ },
688
+ props: {
689
+ placeholder: '请输入',
690
+ },
691
+ config: {
692
+ propsFields: Object.values(fieldsMap$e),
693
+ },
694
+ style: {
695
+ width: '100%',
696
+ },
697
+ };
698
+ },
699
+ props(rule, parentRule) {
700
+ return [
701
+ {
702
+ type: 'input',
703
+ title: '标题',
704
+ field: fieldsMap$e['title.title'],
705
+ value: rule.title.title,
706
+ effect: {
707
+ required: '请输入标题',
708
+ },
709
+ props: {
710
+ placeholder: '请输入',
711
+ maxlength: 10,
712
+ },
713
+ },
714
+ {
715
+ type: 'input',
716
+ title: '提示文字',
717
+ field: fieldsMap$e['props.placeholder'],
718
+ props: {
719
+ placeholder: '请输入',
720
+ },
721
+ value: rule.props.placeholder,
722
+ },
723
+ {
724
+ type: 'input',
725
+ title: '默认值',
726
+ field: fieldsMap$e['value'],
727
+ props: {
728
+ placeholder: '请输入',
729
+ },
730
+ value: rule.value,
731
+ },
732
+ Object.assign({ field: fieldsMap$e['config.fieldRatio'] }, getFieldRatioRule(rule, parentRule)),
733
+ {
734
+ type: 'switch',
735
+ title: '统计总数',
736
+ info: '仅当该控件结合“表格”控件使用时应用',
737
+ field: fieldsMap$e['config.count'],
738
+ value: rule.config.count,
739
+ props: {
740
+ disabled: (parentRule === null || parentRule === void 0 ? void 0 : parentRule.type) !== WidgetType.TableWidget,
741
+ },
742
+ },
743
+ {
744
+ type: 'switch',
745
+ title: '是否必填',
746
+ field: fieldsMap$e['effect.required'],
747
+ value: rule.effect.required,
748
+ info: '勾选后可作为流程条件',
749
+ },
750
+ ];
751
+ },
752
+ parse(rule) {
753
+ return {
754
+ name: name$e,
755
+ field: rule.field,
756
+ title: {
757
+ title: rule.title.title,
758
+ },
759
+ props: {
760
+ placeholder: rule.props.placeholder,
761
+ },
762
+ value: rule.value,
763
+ config: {
764
+ count: rule.config.count,
765
+ fieldRatio: rule.config.fieldRatio,
766
+ },
767
+ effect: {
768
+ required: rule.effect.required,
769
+ },
770
+ };
771
+ },
772
+ };
773
+
774
+ const _hoisted_1$d = { class: "bm-handle-options" };
775
+ const _hoisted_2$b = {
776
+ key: 0,
777
+ class: "bm-handle-options__error-tip"
778
+ };
779
+ const _hoisted_3$a = /* @__PURE__ */ vue.createTextVNode(" \u6279\u91CF\u7F16\u8F91 ");
780
+ const _hoisted_4$7 = /* @__PURE__ */ vue.createTextVNode(" \u6DFB\u52A0\u9009\u9879 ");
781
+ const _hoisted_5$4 = /* @__PURE__ */ vue.createTextVNode(" \u6BCF\u884C\u5BF9\u5E94\u4E00\u4E2A\u9009\u9879 ");
782
+ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
783
+ __name: "handle-options",
784
+ props: ["options"],
785
+ emits: ["setValue"],
786
+ setup(__props, { emit: emits }) {
787
+ const props = __props;
788
+ const handleClass = "bm-handle-options__drag-icon";
789
+ const visible = vue.ref(false);
790
+ const text = vue.ref("");
791
+ const repeatOption = vue.ref([]);
792
+ function edit() {
793
+ visible.value = true;
794
+ text.value = makeText(props.options);
795
+ }
796
+ function add() {
797
+ const index = props.options.length;
798
+ const value = `\u9009\u9879${index + 1}`;
799
+ props.options.push({ value, label: value });
800
+ }
801
+ function makeText(options) {
802
+ return options.reduce((pre, cur) => {
803
+ if (!pre) {
804
+ return cur.label;
805
+ } else {
806
+ return pre + "\n" + cur.label;
807
+ }
808
+ }, "");
809
+ }
810
+ function handleOk() {
811
+ const options = text.value.split("\n").reduce((pre, cur) => {
812
+ if (cur) {
813
+ pre.push({ value: cur, label: cur });
814
+ }
815
+ return pre;
816
+ }, []);
817
+ props.options.splice(0, props.options.length);
818
+ props.options.push(...options);
819
+ visible.value = false;
820
+ }
821
+ function handleBlur(element) {
822
+ element.value = element.label;
823
+ }
824
+ function handleRepeatOption(val) {
825
+ repeatOption.value = [];
826
+ const cache = {};
827
+ val.forEach(({ value }) => {
828
+ if (!cache[value]) {
829
+ cache[value] = 1;
830
+ } else {
831
+ cache[value]++;
832
+ if (cache[value] === 2) {
833
+ repeatOption.value.push(value);
834
+ }
835
+ }
836
+ });
837
+ }
838
+ function emitSetValue(val) {
839
+ emits("setValue", val);
840
+ }
841
+ vue.watch(
842
+ props.options,
843
+ (val) => {
844
+ handleRepeatOption(val);
845
+ emitSetValue(val);
846
+ },
847
+ { deep: true }
848
+ );
849
+ return (_ctx, _cache) => {
850
+ const _component_Delete = vue.resolveComponent("Delete");
851
+ const _component_ARow = vue.resolveComponent("ARow");
852
+ const _component_a_textarea = vue.resolveComponent("a-textarea");
853
+ const _component_a_modal = vue.resolveComponent("a-modal");
854
+ return vue.openBlock(), vue.createElementBlock("div", null, [
855
+ vue.createVNode(vue.unref(Draggable__default["default"]), {
856
+ tag: "transition-group",
857
+ "component-data": {
858
+ name: "flip-list"
859
+ },
860
+ animation: 200,
861
+ list: __props.options,
862
+ handle: `.${handleClass}`,
863
+ "force-fallback": true
864
+ }, {
865
+ item: vue.withCtx(({ element, index }) => [
866
+ vue.createElementVNode("div", _hoisted_1$d, [
867
+ vue.createVNode(_component_ARow, { align: "middle" }, {
868
+ default: vue.withCtx(() => [
869
+ vue.createVNode(vue.unref(iconsVue.HolderOutlined), {
870
+ class: vue.normalizeClass([handleClass])
871
+ }, null, 8, ["class"]),
872
+ vue.createVNode(vue.unref(antDesignVue.FormItemRest), null, {
873
+ default: vue.withCtx(() => [
874
+ vue.createVNode(vue.unref(antDesignVue.Input), {
875
+ value: element.label,
876
+ "onUpdate:value": ($event) => element.label = $event,
877
+ class: vue.normalizeClass([
878
+ "bm-handle-options__input",
879
+ repeatOption.value.length && repeatOption.value.includes(element.value) ? "is-error" : ""
880
+ ]),
881
+ onBlur: ($event) => handleBlur(element)
882
+ }, null, 8, ["value", "onUpdate:value", "class", "onBlur"])
883
+ ]),
884
+ _: 2
885
+ }, 1024),
886
+ vue.createVNode(_component_Delete, {
887
+ class: "bm-handle-options__del-icon",
888
+ onClick: ($event) => __props.options.splice(index, 1)
889
+ }, null, 8, ["onClick"])
890
+ ]),
891
+ _: 2
892
+ }, 1024),
893
+ repeatOption.value.length && repeatOption.value.includes(element.value) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$b, " \u8BF7\u66F4\u6539\u91CD\u590D\u9009\u9879 ")) : vue.createCommentVNode("v-if", true)
894
+ ])
895
+ ]),
896
+ _: 1
897
+ }, 8, ["list", "handle"]),
898
+ vue.createVNode(vue.unref(antDesignVue.Button), {
899
+ style: { "margin-left": "24px", "margin-top": "8px" },
900
+ onClick: edit
901
+ }, {
902
+ icon: vue.withCtx(() => [
903
+ vue.createVNode(vue.unref(iconsVue.EditOutlined))
904
+ ]),
905
+ default: vue.withCtx(() => [
906
+ _hoisted_3$a
907
+ ]),
908
+ _: 1
909
+ }),
910
+ vue.createVNode(vue.unref(antDesignVue.Button), {
911
+ style: { "margin-left": "8px", "margin-top": "8px" },
912
+ onClick: add
913
+ }, {
914
+ icon: vue.withCtx(() => [
915
+ vue.createVNode(vue.unref(iconsVue.PlusOutlined))
916
+ ]),
917
+ default: vue.withCtx(() => [
918
+ _hoisted_4$7
919
+ ]),
920
+ _: 1
921
+ }),
922
+ vue.createVNode(_component_a_modal, {
923
+ visible: visible.value,
924
+ "onUpdate:visible": _cache[1] || (_cache[1] = ($event) => visible.value = $event),
925
+ title: "\u9009\u9879\u6279\u91CF\u7F16\u8F91",
926
+ onOk: handleOk
927
+ }, {
928
+ default: vue.withCtx(() => [
929
+ _hoisted_5$4,
930
+ vue.createVNode(_component_a_textarea, {
931
+ value: text.value,
932
+ "onUpdate:value": _cache[0] || (_cache[0] = ($event) => text.value = $event),
933
+ style: { "margin-top": "8px" },
934
+ placeholder: "\u8BF7\u8F93\u5165",
935
+ "auto-size": { minRows: 8 }
936
+ }, null, 8, ["value"])
937
+ ]),
938
+ _: 1
939
+ }, 8, ["visible"])
940
+ ]);
941
+ };
942
+ }
943
+ });
944
+ var HandleOptionsCom = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__file", "handle-options.vue"]]);
945
+
946
+ const label$d = '单选框';
947
+ const ruleType$1 = {
948
+ checkedValue: 'radio',
949
+ unCheckedValue: 'select',
950
+ };
951
+ const fieldsMap$d = {
952
+ 'title.title': 'title.title',
953
+ 'props.placeholder': 'props.placeholder',
954
+ options: 'options',
955
+ type: 'type',
956
+ 'config.fieldRatio': 'config.fieldRatio',
957
+ 'effect.required': 'effect.required',
958
+ };
959
+ const name$d = 'radio';
960
+ var radio = {
961
+ icon: 'RadioIcon',
962
+ name: name$d,
963
+ label: label$d,
964
+ rule() {
965
+ return {
966
+ type: ruleType$1.unCheckedValue,
967
+ field: uniqueId__default["default"](),
968
+ title: {
969
+ title: label$d,
970
+ style: {
971
+ overflow: 'hidden',
972
+ textOverflow: 'ellipsis',
973
+ whiteSpace: 'nowrap',
974
+ },
975
+ },
976
+ effect: {
977
+ required: true,
978
+ formRule: 'formRule',
979
+ },
980
+ options: [
981
+ {
982
+ value: '选项1',
983
+ label: '选项1',
984
+ },
985
+ {
986
+ value: '选项2',
987
+ label: '选项2',
988
+ },
989
+ {
990
+ value: '选项3',
991
+ label: '选项3',
992
+ },
993
+ ],
994
+ props: {
995
+ placeholder: '请选择',
996
+ },
997
+ config: {
998
+ propsFields: Object.values(fieldsMap$d),
999
+ },
1000
+ };
1001
+ },
1002
+ props(rule, parentRule) {
1003
+ return [
1004
+ {
1005
+ type: 'input',
1006
+ title: '标题',
1007
+ field: fieldsMap$d['title.title'],
1008
+ value: rule.title.title,
1009
+ effect: {
1010
+ required: '请输入标题',
1011
+ },
1012
+ props: {
1013
+ placeholder: '请输入',
1014
+ maxlength: 10,
1015
+ },
1016
+ },
1017
+ {
1018
+ type: 'input',
1019
+ title: '提示文字',
1020
+ field: fieldsMap$d['props.placeholder'],
1021
+ props: {
1022
+ placeholder: '请输入',
1023
+ },
1024
+ value: rule.props.placeholder,
1025
+ },
1026
+ {
1027
+ type: 'HandleOptions',
1028
+ component: HandleOptionsCom,
1029
+ title: '选项',
1030
+ field: fieldsMap$d['options'],
1031
+ props: {
1032
+ options: rule.options,
1033
+ },
1034
+ value: rule.options,
1035
+ inject: true,
1036
+ on: {
1037
+ setValue(inject, options) {
1038
+ const rule = inject.self;
1039
+ const api = inject.api;
1040
+ api.changeValue(rule.field, options);
1041
+ api.emit('change', rule.field, rule.value, rule, api, true);
1042
+ },
1043
+ },
1044
+ },
1045
+ {
1046
+ hidden: (parentRule === null || parentRule === void 0 ? void 0 : parentRule.type) === WidgetType.TableWidget,
1047
+ type: 'switch',
1048
+ title: '选项平铺',
1049
+ field: fieldsMap$d['type'],
1050
+ value: rule.type,
1051
+ props: Object.assign({}, ruleType$1),
1052
+ },
1053
+ Object.assign({ field: fieldsMap$d['config.fieldRatio'] }, getFieldRatioRule(rule, parentRule)),
1054
+ {
1055
+ type: 'switch',
1056
+ title: '是否必填',
1057
+ field: fieldsMap$d['effect.required'],
1058
+ value: rule.effect.required,
1059
+ },
1060
+ ];
1061
+ },
1062
+ parse(rule) {
1063
+ return {
1064
+ name: name$d,
1065
+ field: rule.field,
1066
+ type: rule.type,
1067
+ title: {
1068
+ title: rule.title.title,
1069
+ },
1070
+ props: {
1071
+ placeholder: rule.props.placeholder,
1072
+ },
1073
+ options: rule.options,
1074
+ config: {
1075
+ fieldRatio: rule.config.fieldRatio,
1076
+ },
1077
+ effect: {
1078
+ required: rule.effect.required,
1079
+ },
1080
+ };
1081
+ },
1082
+ };
1083
+
1084
+ const label$c = '多选框';
1085
+ const ruleType = {
1086
+ checkedValue: 'checkbox',
1087
+ unCheckedValue: 'select',
1088
+ };
1089
+ const fieldsMap$c = {
1090
+ 'title.title': 'title.title',
1091
+ 'props.placeholder': 'props.placeholder',
1092
+ options: 'options',
1093
+ type: 'type',
1094
+ 'config.fieldRatio': 'config.fieldRatio',
1095
+ 'effect.required': 'effect.required',
1096
+ };
1097
+ const name$c = 'checkbox';
1098
+ var checkbox = {
1099
+ icon: 'CheckboxIcon',
1100
+ name: name$c,
1101
+ label: label$c,
1102
+ rule() {
1103
+ return {
1104
+ type: ruleType.unCheckedValue,
1105
+ field: uniqueId__default["default"](),
1106
+ title: {
1107
+ title: label$c,
1108
+ style: {
1109
+ overflow: 'hidden',
1110
+ textOverflow: 'ellipsis',
1111
+ whiteSpace: 'nowrap',
1112
+ },
1113
+ },
1114
+ effect: {
1115
+ required: true,
1116
+ formRule: 'formRule',
1117
+ },
1118
+ options: [
1119
+ {
1120
+ value: '选项1',
1121
+ label: '选项1',
1122
+ },
1123
+ {
1124
+ value: '选项2',
1125
+ label: '选项2',
1126
+ },
1127
+ {
1128
+ value: '选项3',
1129
+ label: '选项3',
1130
+ },
1131
+ ],
1132
+ props: {
1133
+ placeholder: '请选择',
1134
+ },
1135
+ config: {
1136
+ propsFields: Object.values(fieldsMap$c),
1137
+ },
1138
+ };
1139
+ },
1140
+ props(rule, parentRule) {
1141
+ return [
1142
+ {
1143
+ type: 'input',
1144
+ title: '标题',
1145
+ field: fieldsMap$c['title.title'],
1146
+ value: rule.title.title,
1147
+ effect: {
1148
+ required: '请输入标题',
1149
+ },
1150
+ props: {
1151
+ placeholder: '请输入',
1152
+ maxlength: 10,
1153
+ },
1154
+ },
1155
+ {
1156
+ type: 'input',
1157
+ title: '提示文字',
1158
+ field: fieldsMap$c['props.placeholder'],
1159
+ props: {
1160
+ placeholder: '请输入',
1161
+ },
1162
+ value: rule.props.placeholder,
1163
+ },
1164
+ {
1165
+ type: 'HandleOptions',
1166
+ component: HandleOptionsCom,
1167
+ title: '选项',
1168
+ field: fieldsMap$c['options'],
1169
+ props: {
1170
+ options: rule.options,
1171
+ },
1172
+ value: rule.options,
1173
+ inject: true,
1174
+ on: {
1175
+ setValue(inject, options) {
1176
+ const rule = inject.self;
1177
+ const api = inject.api;
1178
+ api.changeValue(rule.field, options);
1179
+ api.emit('change', rule.field, rule.value, rule, api, true);
1180
+ },
1181
+ },
1182
+ },
1183
+ {
1184
+ hidden: (parentRule === null || parentRule === void 0 ? void 0 : parentRule.type) === WidgetType.TableWidget,
1185
+ type: 'switch',
1186
+ title: '选项平铺',
1187
+ field: fieldsMap$c['type'],
1188
+ value: rule.type,
1189
+ props: Object.assign({}, ruleType),
1190
+ },
1191
+ Object.assign({ field: fieldsMap$c['config.fieldRatio'] }, getFieldRatioRule(rule, parentRule)),
1192
+ {
1193
+ type: 'switch',
1194
+ title: '是否必填',
1195
+ field: fieldsMap$c['effect.required'],
1196
+ value: rule.effect.required,
1197
+ },
1198
+ ];
1199
+ },
1200
+ parse(rule) {
1201
+ return {
1202
+ name: name$c,
1203
+ field: rule.field,
1204
+ type: rule.type,
1205
+ title: {
1206
+ title: rule.title.title,
1207
+ },
1208
+ props: {
1209
+ placeholder: rule.props.placeholder,
1210
+ },
1211
+ options: rule.options,
1212
+ config: {
1213
+ fieldRatio: rule.config.fieldRatio,
1214
+ },
1215
+ effect: {
1216
+ required: rule.effect.required,
1217
+ },
1218
+ };
1219
+ },
1220
+ };
1221
+
1222
+ const _hoisted_1$c = { class: "bm-default-date" };
1223
+ const _hoisted_2$a = /* @__PURE__ */ vue.createTextVNode(" \u5F53\u524D\u65F6\u95F4(\u5E74/\u6708/\u65E5) ");
1224
+ const _hoisted_3$9 = /* @__PURE__ */ vue.createTextVNode(" \u83B7\u53D6\u7528\u6237\u5B9E\u9645\u586B\u5199\u65F6\u7684\u65F6\u95F4 ");
1225
+ const _hoisted_4$6 = /* @__PURE__ */ vue.createTextVNode("\u81EA\u5B9A\u4E49");
1226
+ const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
1227
+ __name: "default-date",
1228
+ props: ["defaultRadioValue", "defalueDateValue"],
1229
+ emits: ["change"],
1230
+ setup(__props, { emit: emits }) {
1231
+ const props = __props;
1232
+ const radioValue = vue.ref(props.defaultRadioValue);
1233
+ const dateValue = vue.ref(props.defalueDateValue);
1234
+ function emitChange(dateValue2) {
1235
+ emits("change", radioValue.value, dateValue2);
1236
+ }
1237
+ function handleRadioChange(evt) {
1238
+ radioValue.value = evt.target.value;
1239
+ dateValue.value = "";
1240
+ emitChange("");
1241
+ }
1242
+ function handleDateChange(date) {
1243
+ dateValue.value = date;
1244
+ emitChange(date);
1245
+ }
1246
+ return (_ctx, _cache) => {
1247
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$c, [
1248
+ vue.createVNode(vue.unref(antDesignVue.FormItemRest), null, {
1249
+ default: vue.withCtx(() => [
1250
+ vue.createVNode(vue.unref(antDesignVue.RadioGroup), {
1251
+ value: radioValue.value,
1252
+ onChange: handleRadioChange
1253
+ }, {
1254
+ default: vue.withCtx(() => [
1255
+ vue.createVNode(vue.unref(antDesignVue.Radio), { value: 0 }, {
1256
+ default: vue.withCtx(() => [
1257
+ _hoisted_2$a,
1258
+ vue.createVNode(vue.unref(antDesignVue.Tooltip), null, {
1259
+ title: vue.withCtx(() => [
1260
+ _hoisted_3$9
1261
+ ]),
1262
+ default: vue.withCtx(() => [
1263
+ vue.createVNode(vue.unref(iconsVue.QuestionCircleOutlined), { style: { "color": "#babac1" } })
1264
+ ]),
1265
+ _: 1
1266
+ })
1267
+ ]),
1268
+ _: 1
1269
+ }),
1270
+ vue.createVNode(vue.unref(antDesignVue.Radio), { value: 1 }, {
1271
+ default: vue.withCtx(() => [
1272
+ _hoisted_4$6
1273
+ ]),
1274
+ _: 1
1275
+ })
1276
+ ]),
1277
+ _: 1
1278
+ }, 8, ["value"]),
1279
+ radioValue.value === 1 ? (vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.DatePicker), {
1280
+ key: 0,
1281
+ style: { width: "100%", marginTop: "8px" },
1282
+ value: dateValue.value,
1283
+ format: "YYYY-MM-DD",
1284
+ "value-format": "YYYY-MM-DD",
1285
+ placeholder: "\u8BF7\u9009\u62E9",
1286
+ onChange: handleDateChange
1287
+ }, null, 8, ["value"])) : vue.createCommentVNode("v-if", true)
1288
+ ]),
1289
+ _: 1
1290
+ })
1291
+ ]);
1292
+ };
1293
+ }
1294
+ });
1295
+ var DefaultDate = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__file", "default-date.vue"]]);
1296
+
1297
+ const label$b = '日期';
1298
+ const fieldsMap$b = {
1299
+ 'title.title': 'title.title',
1300
+ 'props.format': 'props.format',
1301
+ 'props.placeholder': 'props.placeholder',
1302
+ value: 'value',
1303
+ 'config.defaultValue': 'config.defaultValue',
1304
+ 'config.fieldRatio': 'config.fieldRatio',
1305
+ 'effect.required': 'effect.required',
1306
+ };
1307
+ const name$b = 'date';
1308
+ var date = {
1309
+ icon: 'Date',
1310
+ name: name$b,
1311
+ label: label$b,
1312
+ rule() {
1313
+ return {
1314
+ type: 'datePicker',
1315
+ field: uniqueId__default["default"](),
1316
+ title: {
1317
+ title: label$b,
1318
+ style: {
1319
+ overflow: 'hidden',
1320
+ textOverflow: 'ellipsis',
1321
+ whiteSpace: 'nowrap',
1322
+ },
1323
+ },
1324
+ effect: {
1325
+ required: true,
1326
+ formRule: 'formRule',
1327
+ },
1328
+ props: {
1329
+ placeholder: '请选择',
1330
+ format: 'YYYY-MM',
1331
+ },
1332
+ config: {
1333
+ propsFields: Object.values(fieldsMap$b),
1334
+ defaultValue: 1,
1335
+ },
1336
+ style: {
1337
+ width: '100%',
1338
+ },
1339
+ };
1340
+ },
1341
+ props(rule, parentRule) {
1342
+ return [
1343
+ {
1344
+ type: 'input',
1345
+ title: '标题',
1346
+ field: fieldsMap$b['title.title'],
1347
+ value: rule.title.title,
1348
+ effect: {
1349
+ required: '请输入标题',
1350
+ },
1351
+ props: {
1352
+ placeholder: '请输入',
1353
+ maxlength: 10,
1354
+ },
1355
+ },
1356
+ {
1357
+ type: 'select',
1358
+ title: '日期类型',
1359
+ field: fieldsMap$b['props.format'],
1360
+ effect: {
1361
+ required: '请选择日期类型',
1362
+ },
1363
+ props: {
1364
+ placeholder: '请选择',
1365
+ },
1366
+ options: [
1367
+ {
1368
+ value: 'YYYY-MM',
1369
+ label: '年-月',
1370
+ },
1371
+ {
1372
+ value: 'YYYY-MM-DD',
1373
+ label: '年-月-日',
1374
+ },
1375
+ {
1376
+ value: 'YYYY-MM-DD HH:mm',
1377
+ label: '年-月-日 时:分',
1378
+ },
1379
+ ],
1380
+ value: rule.props.format,
1381
+ },
1382
+ {
1383
+ type: 'input',
1384
+ title: '提示文字',
1385
+ field: fieldsMap$b['props.placeholder'],
1386
+ props: {
1387
+ placeholder: '请输入',
1388
+ },
1389
+ value: rule.props.placeholder,
1390
+ },
1391
+ {
1392
+ type: 'DefaultDate',
1393
+ component: DefaultDate,
1394
+ title: '默认值',
1395
+ field: fieldsMap$b['config.defaultValue'],
1396
+ props: {
1397
+ defaultRadioValue: rule.config.defaultValue,
1398
+ defalueDateValue: rule.value,
1399
+ },
1400
+ inject: true,
1401
+ on: {
1402
+ change({ api, self }, radioValue, dateValue) {
1403
+ self.props.defaultRadioValue = radioValue;
1404
+ self.props.defalueDateValue = dateValue;
1405
+ api.emit('change', 'config.defaultValue', radioValue, self, api, true);
1406
+ api.emit('change', 'value', dateValue, self, api, true);
1407
+ },
1408
+ },
1409
+ },
1410
+ Object.assign({ field: fieldsMap$b['config.fieldRatio'] }, getFieldRatioRule(rule, parentRule)),
1411
+ {
1412
+ type: 'switch',
1413
+ title: '是否必填',
1414
+ field: fieldsMap$b['effect.required'],
1415
+ value: rule.effect.required,
1416
+ },
1417
+ ];
1418
+ },
1419
+ parse(rule) {
1420
+ return {
1421
+ name: name$b,
1422
+ field: rule.field,
1423
+ title: {
1424
+ title: rule.title.title,
1425
+ },
1426
+ props: {
1427
+ format: rule.props.format,
1428
+ placeholder: rule.props.placeholder,
1429
+ },
1430
+ value: rule.value,
1431
+ config: {
1432
+ defaultValue: rule.config.defaultValue,
1433
+ fieldRatio: rule.config.fieldRatio,
1434
+ },
1435
+ effect: {
1436
+ required: rule.effect.required,
1437
+ },
1438
+ };
1439
+ },
1440
+ };
1441
+
1442
+ const label$a = '日期区间';
1443
+ const fieldsMap$a = {
1444
+ 'title.title': 'title.title',
1445
+ 'props.format': 'props.format',
1446
+ 'props.placeholder.0': 'props.placeholder.0',
1447
+ 'props.placeholder.1': 'props.placeholder.1',
1448
+ 'config.fieldRatio': 'config.fieldRatio',
1449
+ 'effect.required': 'effect.required',
1450
+ };
1451
+ const name$a = 'dateRange';
1452
+ var dateRange = {
1453
+ icon: 'DateRange',
1454
+ name: name$a,
1455
+ label: label$a,
1456
+ rule() {
1457
+ return {
1458
+ type: 'datePicker',
1459
+ field: uniqueId__default["default"](),
1460
+ title: {
1461
+ title: label$a,
1462
+ style: {
1463
+ overflow: 'hidden',
1464
+ textOverflow: 'ellipsis',
1465
+ whiteSpace: 'nowrap',
1466
+ },
1467
+ },
1468
+ effect: {
1469
+ required: true,
1470
+ formRule: 'formRule',
1471
+ },
1472
+ props: {
1473
+ range: true,
1474
+ placeholder: ['开始日期', '结束日期'],
1475
+ format: 'YYYY-MM',
1476
+ separator: '~',
1477
+ },
1478
+ config: {
1479
+ propsFields: Object.values(fieldsMap$a),
1480
+ defaultValue: 1,
1481
+ },
1482
+ style: {
1483
+ width: '100%',
1484
+ },
1485
+ };
1486
+ },
1487
+ props(rule, parentRule) {
1488
+ return [
1489
+ {
1490
+ type: 'input',
1491
+ title: '标题',
1492
+ field: fieldsMap$a['title.title'],
1493
+ value: rule.title.title,
1494
+ effect: {
1495
+ required: '请输入标题',
1496
+ },
1497
+ props: {
1498
+ placeholder: '请输入',
1499
+ maxlength: 10,
1500
+ },
1501
+ },
1502
+ {
1503
+ type: 'select',
1504
+ title: '日期类型',
1505
+ field: fieldsMap$a['props.format'],
1506
+ effect: {
1507
+ required: '请选择日期类型',
1508
+ },
1509
+ props: {
1510
+ placeholder: '请选择',
1511
+ },
1512
+ options: [
1513
+ {
1514
+ value: 'YYYY-MM',
1515
+ label: '年-月',
1516
+ },
1517
+ {
1518
+ value: 'YYYY-MM-DD',
1519
+ label: '年-月-日',
1520
+ },
1521
+ {
1522
+ value: 'YYYY-MM-DD HH:mm',
1523
+ label: '年-月-日 时:分',
1524
+ },
1525
+ ],
1526
+ value: rule.props.format,
1527
+ },
1528
+ {
1529
+ type: 'input',
1530
+ title: '提示文字1',
1531
+ field: fieldsMap$a['props.placeholder.0'],
1532
+ props: {
1533
+ placeholder: '请输入',
1534
+ },
1535
+ value: rule.props.placeholder[0],
1536
+ },
1537
+ {
1538
+ type: 'input',
1539
+ title: '提示文字2',
1540
+ field: fieldsMap$a['props.placeholder.1'],
1541
+ props: {
1542
+ placeholder: '请输入',
1543
+ },
1544
+ value: rule.props.placeholder[1],
1545
+ },
1546
+ Object.assign({ field: fieldsMap$a['config.fieldRatio'] }, getFieldRatioRule(rule, parentRule)),
1547
+ {
1548
+ type: 'switch',
1549
+ title: '是否必填',
1550
+ field: fieldsMap$a['effect.required'],
1551
+ value: rule.effect.required,
1552
+ },
1553
+ ];
1554
+ },
1555
+ parse(rule) {
1556
+ return {
1557
+ name: name$a,
1558
+ field: rule.field,
1559
+ title: {
1560
+ title: rule.title.title,
1561
+ },
1562
+ props: {
1563
+ format: rule.props.format,
1564
+ placeholder: rule.props.placeholder,
1565
+ },
1566
+ config: {
1567
+ fieldRatio: rule.config.fieldRatio,
1568
+ },
1569
+ effect: {
1570
+ required: rule.effect.required,
1571
+ },
1572
+ };
1573
+ },
1574
+ };
1575
+
1576
+ const label$9 = '说明文字';
1577
+ const fieldsMap$9 = {
1578
+ value: 'value',
1579
+ 'style.color': 'style.color',
1580
+ };
1581
+ const name$9 = 'instruction';
1582
+ var Colors;
1583
+ (function (Colors) {
1584
+ Colors["Black"] = "#242633";
1585
+ Colors["Blue"] = "#2F4EED";
1586
+ })(Colors || (Colors = {}));
1587
+ var instruction = {
1588
+ icon: 'Instruction',
1589
+ name: name$9,
1590
+ label: label$9,
1591
+ rule() {
1592
+ return {
1593
+ field: uniqueId__default["default"](),
1594
+ config: {
1595
+ propsFields: Object.values(fieldsMap$9),
1596
+ },
1597
+ style: {
1598
+ color: Colors.Black,
1599
+ },
1600
+ value: '请输入说明文字',
1601
+ };
1602
+ },
1603
+ props(rule, parentRule) {
1604
+ return [
1605
+ {
1606
+ type: 'input',
1607
+ props: {
1608
+ type: 'textarea',
1609
+ autoSize: {
1610
+ minRows: 5,
1611
+ },
1612
+ },
1613
+ title: label$9,
1614
+ field: fieldsMap$9.value,
1615
+ value: rule.value,
1616
+ prefix: {
1617
+ type: 'TextColor',
1618
+ props: {
1619
+ rule,
1620
+ },
1621
+ },
1622
+ },
1623
+ ];
1624
+ },
1625
+ parse(rule) {
1626
+ return {
1627
+ name: name$9,
1628
+ field: rule.field,
1629
+ value: rule.value,
1630
+ style: {
1631
+ color: rule.style.color,
1632
+ },
1633
+ };
1634
+ },
1635
+ };
1636
+
1637
+ const label$8 = '图片';
1638
+ const fieldsMap$8 = {
1639
+ 'title.title': 'title.title',
1640
+ 'props.extraProps.maxCount': 'props.extraProps.maxCount',
1641
+ 'effect.required': 'effect.required',
1642
+ };
1643
+ const name$8 = 'picture';
1644
+ var picture = {
1645
+ icon: 'Picture',
1646
+ name: name$8,
1647
+ label: label$8,
1648
+ rule() {
1649
+ return {
1650
+ type: 'UploadPicture',
1651
+ component: components.BmUpload,
1652
+ field: uniqueId__default["default"](),
1653
+ title: {
1654
+ title: label$8,
1655
+ style: {
1656
+ overflow: 'hidden',
1657
+ textOverflow: 'ellipsis',
1658
+ whiteSpace: 'nowrap',
1659
+ },
1660
+ },
1661
+ effect: {
1662
+ required: true,
1663
+ formRule: 'formRule',
1664
+ },
1665
+ props: {
1666
+ uploadProps: {
1667
+ listType: 'picture-card',
1668
+ text: '请选择',
1669
+ },
1670
+ extraProps: {
1671
+ maxCount: 9,
1672
+ },
1673
+ },
1674
+ config: {
1675
+ propsFields: Object.values(fieldsMap$8),
1676
+ },
1677
+ };
1678
+ },
1679
+ props(rule, parentRule) {
1680
+ return [
1681
+ {
1682
+ type: 'input',
1683
+ title: '标题',
1684
+ field: fieldsMap$8['title.title'],
1685
+ value: rule.title.title,
1686
+ effect: {
1687
+ required: '请输入标题',
1688
+ },
1689
+ props: {
1690
+ placeholder: '请输入',
1691
+ maxlength: 10,
1692
+ },
1693
+ },
1694
+ {
1695
+ type: 'radio',
1696
+ field: 'props.extraProps.maxCount',
1697
+ title: '图片上传限制',
1698
+ info: '单张图片的大小需在10M以内',
1699
+ options: [
1700
+ {
1701
+ label: '最多可上传9张',
1702
+ value: 9,
1703
+ },
1704
+ {
1705
+ label: '仅允许上传1张图片',
1706
+ value: 1,
1707
+ },
1708
+ ],
1709
+ value: rule.props.extraProps.maxCount,
1710
+ className: 'form-designer-props-radio-label',
1711
+ inject: true,
1712
+ on: {
1713
+ change({ api, self }, { target }) {
1714
+ const value = target.value;
1715
+ self.value = value;
1716
+ api.emit('change', self.field, value, self, api, true);
1717
+ },
1718
+ },
1719
+ },
1720
+ {
1721
+ type: 'switch',
1722
+ title: '是否必填',
1723
+ field: fieldsMap$8['effect.required'],
1724
+ value: rule.effect.required,
1725
+ },
1726
+ ];
1727
+ },
1728
+ parse(rule) {
1729
+ return {
1730
+ name: name$8,
1731
+ field: rule.field,
1732
+ title: {
1733
+ title: rule.title.title,
1734
+ },
1735
+ props: {
1736
+ extraProps: {
1737
+ maxCount: rule.props.extraProps.maxCount,
1738
+ },
1739
+ },
1740
+ effect: {
1741
+ required: rule.effect.required,
1742
+ },
1743
+ };
1744
+ },
1745
+ };
1746
+
1747
+ const _hoisted_1$b = { class: "bm-widget-table-wrap" };
1748
+ const _hoisted_2$9 = { class: "bm-widget-table-top-bar" };
1749
+ const _hoisted_3$8 = /* @__PURE__ */ vue.createTextVNode(" \u65B0\u589E ");
1750
+ const _hoisted_4$5 = /* @__PURE__ */ vue.createTextVNode(" \u6279\u91CF\u5220\u9664 ");
1751
+ const _hoisted_5$3 = /* @__PURE__ */ vue.createTextVNode(" \u6279\u91CF\u5BFC\u5165 ");
1752
+ const _hoisted_6$3 = /* @__PURE__ */ vue.createTextVNode(" \u4E0B\u8F7D\u5BFC\u5165\u6A21\u677F ");
1753
+ const _hoisted_7$2 = { class: "bm-widget-table-outer" };
1754
+ const _hoisted_8$2 = { class: "bm-widget-table" };
1755
+ const _hoisted_9$1 = {
1756
+ key: 0,
1757
+ class: "bm-widget-table__virtual"
1758
+ };
1759
+ const _hoisted_10 = /* @__PURE__ */ vue.createElementVNode("div", { class: "bm-widget-table__virtual__head" }, null, -1);
1760
+ const _hoisted_11 = /* @__PURE__ */ vue.createElementVNode("div", { class: "bm-widget-table__virtual__content" }, null, -1);
1761
+ const _hoisted_12 = [
1762
+ _hoisted_10,
1763
+ _hoisted_11
1764
+ ];
1765
+ const _hoisted_13 = {
1766
+ key: 1,
1767
+ class: "bm-widget-table__tip"
1768
+ };
1769
+ const _hoisted_14 = {
1770
+ key: 0,
1771
+ class: "bm-widget-table__checkbox"
1772
+ };
1773
+ const _hoisted_15 = { class: "bm-widget-table__checkbox__head" };
1774
+ const _hoisted_16 = { class: "bm-widget-table__checkbox__content" };
1775
+ const _hoisted_17 = { class: "bm-widget-table__operateColumn" };
1776
+ const _hoisted_18 = /* @__PURE__ */ vue.createElementVNode("div", { class: "bm-widget-table__operateColumn__head" }, "\u64CD\u4F5C", -1);
1777
+ const _hoisted_19 = { class: "bm-widget-table__operateColumn__content" };
1778
+ const _hoisted_20 = /* @__PURE__ */ vue.createElementVNode("a", null, "\u590D\u5236", -1);
1779
+ const _hoisted_21 = /* @__PURE__ */ vue.createElementVNode("span", null, null, -1);
1780
+ const _hoisted_22 = /* @__PURE__ */ vue.createElementVNode("a", null, "\u5220\u9664", -1);
1781
+ const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
1782
+ __name: "widget-table",
1783
+ props: ["formCreateInject", "activeRule"],
1784
+ emits: [
1785
+ "add",
1786
+ "mouseenter",
1787
+ "mouseleave",
1788
+ "set-active-rule",
1789
+ "copy",
1790
+ "delete"
1791
+ ],
1792
+ setup(__props, { emit: emits }) {
1793
+ const props = __props;
1794
+ const rule = vue.computed(() => props.formCreateInject.rule);
1795
+ const childRules = vue.computed(() => rule.value.config.childRules);
1796
+ const showDelete = vue.computed(() => showFeature("delete"));
1797
+ const showImport = vue.computed(() => showFeature("import"));
1798
+ const showCopy = vue.computed(() => showFeature("copy"));
1799
+ function showFeature(featureId) {
1800
+ return rule.value.config.tableAdvancedFeatures.includes(featureId);
1801
+ }
1802
+ function handleAdd({ newIndex }) {
1803
+ emits("add", childRules.value[newIndex]);
1804
+ }
1805
+ function handleMouseenter() {
1806
+ emits("mouseenter");
1807
+ }
1808
+ function handleMouseleave() {
1809
+ emits("mouseleave");
1810
+ }
1811
+ function emitSetActiveRuleEvt(rule2) {
1812
+ emits("set-active-rule", rule2);
1813
+ }
1814
+ function handleClick(element) {
1815
+ emitSetActiveRuleEvt(element);
1816
+ }
1817
+ function handleUpdate({ newIndex }) {
1818
+ emitSetActiveRuleEvt(childRules.value[newIndex]);
1819
+ }
1820
+ function handleCopy(rule2) {
1821
+ emits("copy", rule2);
1822
+ }
1823
+ function handleDelete(rule2) {
1824
+ emits("delete", rule2);
1825
+ }
1826
+ return (_ctx, _cache) => {
1827
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$b, [
1828
+ vue.createElementVNode("div", _hoisted_2$9, [
1829
+ vue.createVNode(vue.unref(antDesignVue.Button), { type: "primary" }, {
1830
+ icon: vue.withCtx(() => [
1831
+ vue.createVNode(vue.unref(iconsVue.PlusOutlined))
1832
+ ]),
1833
+ default: vue.withCtx(() => [
1834
+ _hoisted_3$8
1835
+ ]),
1836
+ _: 1
1837
+ }),
1838
+ vue.unref(showDelete) ? (vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.Button), { key: 0 }, {
1839
+ default: vue.withCtx(() => [
1840
+ _hoisted_4$5
1841
+ ]),
1842
+ _: 1
1843
+ })) : vue.createCommentVNode("v-if", true),
1844
+ vue.unref(showImport) ? (vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.Button), { key: 1 }, {
1845
+ default: vue.withCtx(() => [
1846
+ _hoisted_5$3
1847
+ ]),
1848
+ _: 1
1849
+ })) : vue.createCommentVNode("v-if", true),
1850
+ vue.unref(showImport) ? (vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.Button), { key: 2 }, {
1851
+ default: vue.withCtx(() => [
1852
+ _hoisted_6$3
1853
+ ]),
1854
+ _: 1
1855
+ })) : vue.createCommentVNode("v-if", true)
1856
+ ]),
1857
+ vue.createElementVNode("div", _hoisted_7$2, [
1858
+ vue.createElementVNode("div", {
1859
+ class: "bm-widget-table-inner",
1860
+ style: vue.normalizeStyle({
1861
+ paddingLeft: vue.unref(showDelete) ? "32px" : 0,
1862
+ paddingRight: vue.unref(showCopy) ? "81px" : "60px"
1863
+ })
1864
+ }, [
1865
+ vue.createElementVNode("div", _hoisted_8$2, [
1866
+ vue.unref(childRules).length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_9$1, _hoisted_12)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_13, "\u53EF\u62D6\u5165\u591A\u4E2A\u63A7\u4EF6")),
1867
+ vue.createVNode(vue.unref(Draggable__default["default"]), {
1868
+ "component-data": {
1869
+ field: vue.unref(rule).field,
1870
+ type: vue.unref(WidgetType).TableWidget
1871
+ },
1872
+ class: "bm-widget-table__drag-content",
1873
+ group: {
1874
+ name: "tableWidget",
1875
+ pull: true,
1876
+ put: ["widget", "tableWidget"]
1877
+ },
1878
+ list: vue.unref(childRules),
1879
+ "ghost-class": vue.unref(childRules).length ? "table-drag-ghost" : "table-drag-ghost__is-empty",
1880
+ "item-key": "field",
1881
+ direction: "vertical",
1882
+ "force-fallback": true,
1883
+ "scroll-sensitivity": 100,
1884
+ delay: 50,
1885
+ onAdd: handleAdd,
1886
+ onUpdate: handleUpdate
1887
+ }, {
1888
+ item: vue.withCtx(({ element }) => [
1889
+ vue.createElementVNode("div", {
1890
+ class: "bm-widget-table__drag-item",
1891
+ style: vue.normalizeStyle({ width: element.config.fieldRatio })
1892
+ }, [
1893
+ vue.createVNode(DragTool, {
1894
+ rule: element,
1895
+ "active-rule": __props.activeRule,
1896
+ "parent-rule": __props.formCreateInject.rule,
1897
+ onMouseenter: handleMouseenter,
1898
+ onMouseleave: handleMouseleave,
1899
+ onClick: vue.withModifiers(($event) => handleClick(element), ["stop"]),
1900
+ onCopy: handleCopy,
1901
+ onDelete: handleDelete
1902
+ }, null, 8, ["rule", "active-rule", "parent-rule", "onClick"]),
1903
+ vue.createVNode(DragPlaceholder)
1904
+ ], 4)
1905
+ ]),
1906
+ _: 1
1907
+ }, 8, ["component-data", "list", "ghost-class"])
1908
+ ])
1909
+ ], 4),
1910
+ vue.unref(showDelete) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_14, [
1911
+ vue.createElementVNode("div", _hoisted_15, [
1912
+ vue.createVNode(vue.unref(antDesignVue.FormItemRest), null, {
1913
+ default: vue.withCtx(() => [
1914
+ vue.createVNode(vue.unref(antDesignVue.Checkbox))
1915
+ ]),
1916
+ _: 1
1917
+ })
1918
+ ]),
1919
+ vue.createElementVNode("div", _hoisted_16, [
1920
+ vue.createVNode(vue.unref(antDesignVue.FormItemRest), null, {
1921
+ default: vue.withCtx(() => [
1922
+ vue.createVNode(vue.unref(antDesignVue.Checkbox))
1923
+ ]),
1924
+ _: 1
1925
+ })
1926
+ ])
1927
+ ])) : vue.createCommentVNode("v-if", true),
1928
+ vue.createElementVNode("div", _hoisted_17, [
1929
+ _hoisted_18,
1930
+ vue.createElementVNode("div", _hoisted_19, [
1931
+ vue.unref(showCopy) ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
1932
+ _hoisted_20,
1933
+ _hoisted_21
1934
+ ], 64)) : vue.createCommentVNode("v-if", true),
1935
+ _hoisted_22
1936
+ ])
1937
+ ])
1938
+ ])
1939
+ ]);
1940
+ };
1941
+ }
1942
+ });
1943
+ var WidgetTable = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__file", "widget-table.vue"]]);
1944
+
1945
+ const label$7 = '表格';
1946
+ const fieldsMap$7 = {
1947
+ 'title.title': 'title.title',
1948
+ 'config.childRules': 'config.childRules',
1949
+ 'config.tableAdvancedFeatures': 'config.tableAdvancedFeatures',
1950
+ };
1951
+ const name$7 = 'table';
1952
+ var table = {
1953
+ icon: 'Table',
1954
+ name: name$7,
1955
+ label: label$7,
1956
+ rule() {
1957
+ const childRules = [];
1958
+ return {
1959
+ type: WidgetType.TableWidget,
1960
+ component: WidgetTable,
1961
+ field: uniqueId__default["default"](),
1962
+ title: {
1963
+ type: 'TableHeadCount',
1964
+ title: label$7,
1965
+ props: {
1966
+ childRules,
1967
+ },
1968
+ style: {
1969
+ overflow: 'hidden',
1970
+ textOverflow: 'ellipsis',
1971
+ whiteSpace: 'nowrap',
1972
+ },
1973
+ },
1974
+ effect: {
1975
+ formRule: 'formRule',
1976
+ },
1977
+ config: {
1978
+ childRules,
1979
+ tableAdvancedFeatures: ['copy', 'delete', 'import'],
1980
+ propsFields: Object.values(fieldsMap$7),
1981
+ },
1982
+ emit: [
1983
+ 'mouseenter',
1984
+ 'mouseleave',
1985
+ 'set-active-rule',
1986
+ 'copy',
1987
+ 'delete',
1988
+ 'add',
1989
+ ],
1990
+ emitPrefix: 'nest',
1991
+ };
1992
+ },
1993
+ props(rule) {
1994
+ return [
1995
+ {
1996
+ type: 'input',
1997
+ title: '标题',
1998
+ field: fieldsMap$7['title.title'],
1999
+ value: rule.title.title,
2000
+ effect: {
2001
+ required: '请输入标题',
2002
+ },
2003
+ props: {
2004
+ placeholder: '请输入',
2005
+ maxlength: 10,
2006
+ },
2007
+ },
2008
+ {
2009
+ type: 'TableColumn',
2010
+ title: '子字段设置',
2011
+ field: fieldsMap$7['config.childRules'],
2012
+ effect: {
2013
+ required: true,
2014
+ },
2015
+ value: rule.config.childRules,
2016
+ },
2017
+ {
2018
+ type: 'checkbox',
2019
+ title: '表格的高级操作',
2020
+ field: fieldsMap$7['config.tableAdvancedFeatures'],
2021
+ value: rule.config.tableAdvancedFeatures,
2022
+ options: [
2023
+ {
2024
+ value: 'copy',
2025
+ label: '复制行',
2026
+ },
2027
+ {
2028
+ value: 'delete',
2029
+ label: '批量删除',
2030
+ },
2031
+ {
2032
+ value: 'import',
2033
+ label: '批量导入',
2034
+ },
2035
+ ],
2036
+ className: 'bfd-sider-right__form__table-checkbox',
2037
+ },
2038
+ ];
2039
+ },
2040
+ parse(rule) {
2041
+ return {
2042
+ name: name$7,
2043
+ field: rule.field,
2044
+ title: {
2045
+ title: rule.title.title,
2046
+ },
2047
+ config: {
2048
+ tableAdvancedFeatures: rule.config.tableAdvancedFeatures,
2049
+ },
2050
+ };
2051
+ },
2052
+ };
2053
+
2054
+ const label$6 = '附件';
2055
+ const fieldsMap$6 = {
2056
+ 'title.title': 'title.title',
2057
+ 'effect.required': 'effect.required',
2058
+ };
2059
+ const name$6 = 'file';
2060
+ var file = {
2061
+ icon: 'File',
2062
+ name: name$6,
2063
+ label: label$6,
2064
+ rule() {
2065
+ return {
2066
+ type: WidgetType.UploadFile,
2067
+ component: components.BmUpload,
2068
+ field: uniqueId__default["default"](),
2069
+ title: {
2070
+ title: label$6,
2071
+ style: {
2072
+ overflow: 'hidden',
2073
+ textOverflow: 'ellipsis',
2074
+ whiteSpace: 'nowrap',
2075
+ },
2076
+ },
2077
+ effect: {
2078
+ required: true,
2079
+ formRule: 'formRule',
2080
+ },
2081
+ config: {
2082
+ propsFields: Object.values(fieldsMap$6),
2083
+ },
2084
+ };
2085
+ },
2086
+ props(rule, parentRule) {
2087
+ return [
2088
+ {
2089
+ type: 'input',
2090
+ title: '标题',
2091
+ field: fieldsMap$6['title.title'],
2092
+ value: rule.title.title,
2093
+ effect: {
2094
+ required: '请输入标题',
2095
+ },
2096
+ props: {
2097
+ placeholder: '请输入',
2098
+ maxlength: 10,
2099
+ },
2100
+ },
2101
+ {
2102
+ type: 'switch',
2103
+ title: '是否必填',
2104
+ field: fieldsMap$6['effect.required'],
2105
+ value: rule.effect.required,
2106
+ },
2107
+ ];
2108
+ },
2109
+ parse(rule) {
2110
+ return {
2111
+ name: name$6,
2112
+ field: rule.field,
2113
+ title: {
2114
+ title: rule.title.title,
2115
+ },
2116
+ effect: {
2117
+ required: rule.effect.required,
2118
+ },
2119
+ };
2120
+ },
2121
+ };
2122
+
2123
+ const label$5 = '员工';
2124
+ const fieldsMap$5 = {
2125
+ 'title.title': 'title.title',
2126
+ 'props.placeholder': 'props.placeholder',
2127
+ 'props.limit': 'props.limit',
2128
+ 'config.fieldRatio': 'config.fieldRatio',
2129
+ 'effect.required': 'effect.required',
2130
+ };
2131
+ const name$5 = 'people';
2132
+ var people = {
2133
+ icon: 'People',
2134
+ name: name$5,
2135
+ label: label$5,
2136
+ rule() {
2137
+ return {
2138
+ type: 'select',
2139
+ field: uniqueId__default["default"](),
2140
+ title: {
2141
+ title: label$5,
2142
+ style: {
2143
+ overflow: 'hidden',
2144
+ textOverflow: 'ellipsis',
2145
+ whiteSpace: 'nowrap',
2146
+ },
2147
+ },
2148
+ effect: {
2149
+ required: true,
2150
+ formRule: 'formRule',
2151
+ },
2152
+ props: {
2153
+ limit: 0,
2154
+ placeholder: '请选择',
2155
+ },
2156
+ config: {
2157
+ propsFields: Object.values(fieldsMap$5),
2158
+ },
2159
+ };
2160
+ },
2161
+ props(rule, parentRule) {
2162
+ return [
2163
+ {
2164
+ type: 'input',
2165
+ title: '标题',
2166
+ field: fieldsMap$5['title.title'],
2167
+ value: rule.title.title,
2168
+ effect: {
2169
+ required: '请输入标题',
2170
+ },
2171
+ props: {
2172
+ placeholder: '请输入',
2173
+ maxlength: 10,
2174
+ },
2175
+ },
2176
+ {
2177
+ type: 'input',
2178
+ title: '提示文字',
2179
+ field: fieldsMap$5['props.placeholder'],
2180
+ props: {
2181
+ placeholder: '请输入',
2182
+ },
2183
+ value: rule.props.placeholder,
2184
+ },
2185
+ {
2186
+ type: 'radio',
2187
+ title: '选项',
2188
+ field: fieldsMap$5['props.limit'],
2189
+ options: [
2190
+ {
2191
+ value: 1,
2192
+ label: '只能选择一人',
2193
+ },
2194
+ {
2195
+ value: 0,
2196
+ label: '可同时选择多人',
2197
+ },
2198
+ ],
2199
+ value: rule.props.limit,
2200
+ effect: {
2201
+ required: true,
2202
+ },
2203
+ inject: true,
2204
+ on: {
2205
+ change({ api, self }, { target }) {
2206
+ const value = target.value;
2207
+ self.value = value;
2208
+ api.emit('change', self.field, value, self, api, true);
2209
+ },
2210
+ },
2211
+ className: 'form-designer-props-radio-label',
2212
+ },
2213
+ Object.assign({ field: fieldsMap$5['config.fieldRatio'] }, getFieldRatioRule(rule, parentRule)),
2214
+ {
2215
+ type: 'switch',
2216
+ title: '是否必填',
2217
+ info: '勾选后可作为流程条件',
2218
+ field: fieldsMap$5['effect.required'],
2219
+ value: rule.effect.required,
2220
+ },
2221
+ ];
2222
+ },
2223
+ parse(rule) {
2224
+ return {
2225
+ name: name$5,
2226
+ field: rule.field,
2227
+ title: {
2228
+ title: rule.title.title,
2229
+ },
2230
+ props: {
2231
+ placeholder: rule.props.placeholder,
2232
+ limit: rule.props.limit,
2233
+ },
2234
+ config: {
2235
+ fieldRatio: rule.config.fieldRatio,
2236
+ },
2237
+ effect: {
2238
+ required: rule.effect.required,
2239
+ },
2240
+ };
2241
+ },
2242
+ };
2243
+
2244
+ const label$4 = '部门';
2245
+ const fieldsMap$4 = {
2246
+ 'title.title': 'title.title',
2247
+ 'props.placeholder': 'props.placeholder',
2248
+ 'props.limit': 'props.limit',
2249
+ 'config.fieldRatio': 'config.fieldRatio',
2250
+ 'effect.required': 'effect.required',
2251
+ };
2252
+ const name$4 = 'department';
2253
+ var department = {
2254
+ icon: 'Department',
2255
+ name: name$4,
2256
+ label: label$4,
2257
+ rule() {
2258
+ return {
2259
+ type: 'select',
2260
+ field: uniqueId__default["default"](),
2261
+ title: {
2262
+ title: label$4,
2263
+ style: {
2264
+ overflow: 'hidden',
2265
+ textOverflow: 'ellipsis',
2266
+ whiteSpace: 'nowrap',
2267
+ },
2268
+ },
2269
+ effect: {
2270
+ required: true,
2271
+ formRule: 'formRule',
2272
+ },
2273
+ props: {
2274
+ limit: 0,
2275
+ placeholder: '请选择',
2276
+ },
2277
+ config: {
2278
+ propsFields: Object.values(fieldsMap$4),
2279
+ },
2280
+ };
2281
+ },
2282
+ props(rule, parentRule) {
2283
+ return [
2284
+ {
2285
+ type: 'input',
2286
+ title: '标题',
2287
+ field: fieldsMap$4['title.title'],
2288
+ value: rule.title.title,
2289
+ effect: {
2290
+ required: '请输入标题',
2291
+ },
2292
+ props: {
2293
+ placeholder: '请输入',
2294
+ maxlength: 10,
2295
+ },
2296
+ },
2297
+ {
2298
+ type: 'input',
2299
+ title: '提示文字',
2300
+ field: fieldsMap$4['props.placeholder'],
2301
+ props: {
2302
+ placeholder: '请输入',
2303
+ },
2304
+ value: rule.props.placeholder,
2305
+ },
2306
+ {
2307
+ type: 'radio',
2308
+ title: '选项',
2309
+ field: fieldsMap$4['props.limit'],
2310
+ options: [
2311
+ {
2312
+ value: 1,
2313
+ label: '只能选择一部门',
2314
+ },
2315
+ {
2316
+ value: 0,
2317
+ label: '可同时选择多个部门',
2318
+ },
2319
+ ],
2320
+ value: rule.props.limit,
2321
+ effect: {
2322
+ required: true,
2323
+ },
2324
+ inject: true,
2325
+ on: {
2326
+ change({ api, self }, { target }) {
2327
+ const value = target.value;
2328
+ self.value = value;
2329
+ api.emit('change', self.field, value, self, api, true);
2330
+ },
2331
+ },
2332
+ className: 'form-designer-props-radio-label',
2333
+ },
2334
+ Object.assign({ field: fieldsMap$4['config.fieldRatio'] }, getFieldRatioRule(rule, parentRule)),
2335
+ {
2336
+ type: 'switch',
2337
+ title: '是否必填',
2338
+ info: '勾选后可作为流程条件',
2339
+ field: fieldsMap$4['effect.required'],
2340
+ value: rule.effect.required,
2341
+ },
2342
+ ];
2343
+ },
2344
+ parse(rule) {
2345
+ return {
2346
+ name: name$4,
2347
+ field: rule.field,
2348
+ title: {
2349
+ title: rule.title.title,
2350
+ },
2351
+ props: {
2352
+ placeholder: rule.props.placeholder,
2353
+ limit: rule.props.limit,
2354
+ },
2355
+ config: {
2356
+ fieldRatio: rule.config.fieldRatio,
2357
+ },
2358
+ effect: {
2359
+ required: rule.effect.required,
2360
+ },
2361
+ };
2362
+ },
2363
+ };
2364
+
2365
+ const _hoisted_1$a = { style: { "margin-top": "16px", "line-height": "32px" } };
2366
+ const _hoisted_2$8 = /* @__PURE__ */ vue.createTextVNode(" \u660E\u7EC6\u5217\u8868 ");
2367
+ const _hoisted_3$7 = { style: { "float": "right" } };
2368
+ const _hoisted_4$4 = /* @__PURE__ */ vue.createTextVNode(" \u4E0B\u8F7D\u5BFC\u5165\u6A21\u677F ");
2369
+ const _hoisted_5$2 = /* @__PURE__ */ vue.createTextVNode(" \u5BFC\u5165\u660E\u7EC6 ");
2370
+ const _hoisted_6$2 = /* @__PURE__ */ vue.createTextVNode(" \u6279\u91CF\u5220\u9664 ");
2371
+ const _hoisted_7$1 = /* @__PURE__ */ vue.createTextVNode(" \u65B0\u589E ");
2372
+ const _hoisted_8$1 = /* @__PURE__ */ vue.createElementVNode("div", { class: "bm-material-temp__table-tip" }, "\u7CFB\u7EDF\u81EA\u52A8\u83B7\u53D6\u8868\u683C\u5B57\u6BB5", -1);
2373
+ const _hoisted_9 = { class: "bm-material-temp__add" };
2374
+ const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
2375
+ __name: "widget-material-temp",
2376
+ props: ["formCreateInject"],
2377
+ setup(__props) {
2378
+ const props = __props;
2379
+ const panes = [
2380
+ {
2381
+ key: "\u7D20\u67501",
2382
+ title: "\u7D20\u67501"
2383
+ }
2384
+ ];
2385
+ let activeKey = "\u7D20\u67501";
2386
+ const option = {
2387
+ form: {
2388
+ layout: "vertical"
2389
+ },
2390
+ submitBtn: {
2391
+ show: false
2392
+ },
2393
+ row: {
2394
+ gutter: [24, 24]
2395
+ },
2396
+ col: {
2397
+ span: 12
2398
+ }
2399
+ };
2400
+ const uploadPicField = "uploadPicture";
2401
+ const rules = vue.reactive([
2402
+ {
2403
+ type: "button",
2404
+ field: "materialTemp",
2405
+ title: "\u7D20\u6750\u6A21\u677F",
2406
+ effect: {
2407
+ required: true
2408
+ },
2409
+ children: [
2410
+ {
2411
+ type: "PlusOutlined",
2412
+ component: iconsVue.PlusOutlined
2413
+ },
2414
+ "\u9009\u62E9\u6A21\u677F"
2415
+ ]
2416
+ },
2417
+ {
2418
+ type: "span",
2419
+ field: "materialType",
2420
+ title: "\u7D20\u6750\u7C7B\u578B",
2421
+ children: ["\u7CFB\u7EDF\u81EA\u52A8\u83B7\u53D6"],
2422
+ style: {
2423
+ color: "#9393A3"
2424
+ }
2425
+ },
2426
+ {
2427
+ type: "span",
2428
+ field: "size",
2429
+ title: "\u5C3A\u5BF8",
2430
+ children: ["\u7CFB\u7EDF\u81EA\u52A8\u83B7\u53D6"],
2431
+ style: {
2432
+ color: "#9393A3"
2433
+ }
2434
+ },
2435
+ {
2436
+ type: "span",
2437
+ field: "coverPicture",
2438
+ title: "\u5C01\u9762\u56FE",
2439
+ children: ["\u7CFB\u7EDF\u81EA\u52A8\u83B7\u53D6"],
2440
+ style: {
2441
+ color: "#9393A3"
2442
+ }
2443
+ },
2444
+ {
2445
+ type: "span",
2446
+ field: "templateStructureDiagram",
2447
+ title: "\u6A21\u677F\u7ED3\u6784\u56FE",
2448
+ children: ["\u7CFB\u7EDF\u81EA\u52A8\u83B7\u53D6"],
2449
+ style: {
2450
+ color: "#9393A3"
2451
+ }
2452
+ },
2453
+ {
2454
+ type: "UploadPicture",
2455
+ component: components.BmUpload,
2456
+ field: uploadPicField,
2457
+ title: "\u4E0A\u4F20\u53C2\u8003\u56FE",
2458
+ effect: {
2459
+ required: false
2460
+ },
2461
+ props: {
2462
+ uploadProps: {
2463
+ listType: "picture-card",
2464
+ text: "\u4E0A\u4F20\u7167\u7247"
2465
+ },
2466
+ extraProps: {
2467
+ maxSize: 9
2468
+ }
2469
+ }
2470
+ }
2471
+ ]);
2472
+ const uploadPicRule = vue.computed(
2473
+ () => rules.find((rule) => rule.field === uploadPicField)
2474
+ );
2475
+ function handleUploadPicRule(uploadPictureRule) {
2476
+ uploadPicRule.value.effect.required = uploadPictureRule.required;
2477
+ uploadPicRule.value.hidden = uploadPictureRule.hidden;
2478
+ }
2479
+ vue.watch(
2480
+ () => props.formCreateInject.rule.config.uploadPictureRule,
2481
+ handleUploadPicRule,
2482
+ {
2483
+ deep: true
2484
+ }
2485
+ );
2486
+ return (_ctx, _cache) => {
2487
+ const _component_FormCreate = vue.resolveComponent("FormCreate");
2488
+ return vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.Tabs), {
2489
+ activeKey: vue.unref(activeKey),
2490
+ "onUpdate:activeKey": _cache[0] || (_cache[0] = ($event) => vue.isRef(activeKey) ? activeKey.value = $event : activeKey = $event),
2491
+ class: "bm-material-temp",
2492
+ type: "editable-card",
2493
+ "hide-add": "",
2494
+ size: "small"
2495
+ }, {
2496
+ rightExtra: vue.withCtx(() => [
2497
+ vue.createElementVNode("span", _hoisted_9, [
2498
+ vue.createVNode(vue.unref(iconsVue.PlusOutlined))
2499
+ ])
2500
+ ]),
2501
+ default: vue.withCtx(() => [
2502
+ (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(panes, (pane) => {
2503
+ return vue.createVNode(vue.unref(antDesignVue.TabPane), {
2504
+ key: pane.key,
2505
+ tab: pane.title
2506
+ }, {
2507
+ default: vue.withCtx(() => [
2508
+ vue.createVNode(_component_FormCreate, {
2509
+ option,
2510
+ rule: rules
2511
+ }, null, 8, ["rule"]),
2512
+ vue.createElementVNode("div", _hoisted_1$a, [
2513
+ _hoisted_2$8,
2514
+ vue.createElementVNode("div", _hoisted_3$7, [
2515
+ vue.createVNode(vue.unref(antDesignVue.Button), null, {
2516
+ default: vue.withCtx(() => [
2517
+ _hoisted_4$4
2518
+ ]),
2519
+ _: 1
2520
+ }),
2521
+ vue.createVNode(vue.unref(antDesignVue.Button), null, {
2522
+ default: vue.withCtx(() => [
2523
+ _hoisted_5$2
2524
+ ]),
2525
+ _: 1
2526
+ }),
2527
+ vue.createVNode(vue.unref(antDesignVue.Button), null, {
2528
+ default: vue.withCtx(() => [
2529
+ _hoisted_6$2
2530
+ ]),
2531
+ _: 1
2532
+ }),
2533
+ vue.createVNode(vue.unref(antDesignVue.Button), { type: "primary" }, {
2534
+ default: vue.withCtx(() => [
2535
+ vue.createVNode(vue.unref(iconsVue.PlusOutlined)),
2536
+ _hoisted_7$1
2537
+ ]),
2538
+ _: 1
2539
+ })
2540
+ ])
2541
+ ]),
2542
+ _hoisted_8$1
2543
+ ]),
2544
+ _: 2
2545
+ }, 1032, ["tab"]);
2546
+ }), 64))
2547
+ ]),
2548
+ _: 1
2549
+ }, 8, ["activeKey"]);
2550
+ };
2551
+ }
2552
+ });
2553
+ var WidgetMaterialTemp = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__file", "widget-material-temp.vue"]]);
2554
+
2555
+ const _hoisted_1$9 = { class: "bm-use-instruction" };
2556
+ const _hoisted_2$7 = { class: "bm-use-instruction__title" };
2557
+ const _hoisted_3$6 = /* @__PURE__ */ vue.createTextVNode(" \u4F7F\u7528\u8BF4\u660E ");
2558
+ const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
2559
+ __name: "use-instruction",
2560
+ setup(__props) {
2561
+ return (_ctx, _cache) => {
2562
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$9, [
2563
+ vue.createElementVNode("div", _hoisted_2$7, [
2564
+ vue.createVNode(vue.unref(iconsVue.InfoCircleFilled), { class: "bm-use-instruction__title__icon" }),
2565
+ _hoisted_3$6
2566
+ ]),
2567
+ vue.renderSlot(_ctx.$slots, "default")
2568
+ ]);
2569
+ };
2570
+ }
2571
+ });
2572
+ var UseInstruction = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__file", "use-instruction.vue"]]);
2573
+
2574
+ const label$3 = '素材模板';
2575
+ const fieldsMap$3 = {
2576
+ 'config.uploadPictureRule.required': 'config.uploadPictureRule.required',
2577
+ 'config.uploadPictureRule.hidden': 'config.uploadPictureRule.hidden',
2578
+ };
2579
+ const name$3 = 'materialTemp';
2580
+ var materialTemp = {
2581
+ icon: 'MaterialTemp',
2582
+ name: name$3,
2583
+ label: label$3,
2584
+ rule() {
2585
+ return {
2586
+ type: 'WidgetMaterialTemp',
2587
+ component: WidgetMaterialTemp,
2588
+ title: {
2589
+ title: label$3,
2590
+ },
2591
+ field: uniqueId__default["default"](),
2592
+ config: {
2593
+ propsFields: Object.values(fieldsMap$3),
2594
+ uploadPictureRule: {
2595
+ required: false,
2596
+ hidden: false,
2597
+ },
2598
+ },
2599
+ };
2600
+ },
2601
+ props(rule) {
2602
+ return [
2603
+ {
2604
+ type: 'UseInstruction',
2605
+ component: UseInstruction,
2606
+ children: [
2607
+ {
2608
+ type: 'span',
2609
+ children: [
2610
+ '·该套件打通店铺与素材模板的数据关联,可根据店铺获取该店铺可用的素材模板。',
2611
+ ],
2612
+ },
2613
+ {
2614
+ type: 'span',
2615
+ children: [
2616
+ '·满足一个素材申请单可使用多个素材类型对应的素材模板申请素材。',
2617
+ ],
2618
+ style: {
2619
+ display: 'inline-block',
2620
+ marginTop: '8px',
2621
+ },
2622
+ },
2623
+ ],
2624
+ style: {
2625
+ marginBottom: '24px',
2626
+ },
2627
+ },
2628
+ {
2629
+ type: 'span',
2630
+ title: '素材模板',
2631
+ field: 'materialTemp',
2632
+ children: [
2633
+ '用于选择对应可用的素材模板信息(编号、名称、尺寸、封面图、结构图)。此项必填并获取所选择的模板的编号及名称显示。',
2634
+ ],
2635
+ style: {
2636
+ color: '#505259',
2637
+ },
2638
+ },
2639
+ {
2640
+ type: 'span',
2641
+ title: '素材类型/尺寸/封面图/结构图',
2642
+ field: 'systemGeneration',
2643
+ children: ['通过所选模板,系统自动获取此模板对应的相关内容。'],
2644
+ style: {
2645
+ color: '#505259',
2646
+ },
2647
+ },
2648
+ {
2649
+ type: 'span',
2650
+ title: '上传参考图',
2651
+ field: 'uploadPicture',
2652
+ prefix: {
2653
+ type: 'CheckboxSwitch',
2654
+ props: {
2655
+ rule,
2656
+ },
2657
+ },
2658
+ children: ['用于上传当次申请的素材参考的图片。可最多上传9张图。'],
2659
+ style: {
2660
+ color: '#505259',
2661
+ },
2662
+ },
2663
+ {
2664
+ type: 'span',
2665
+ title: '明细列表',
2666
+ field: 'detailList',
2667
+ children: [
2668
+ '根据所选的素材模板,系统自动获取该模板需填写的内容字段列表以及批量导入的模板。列表允许操作:下载所选素材模板的导入模板、批量导入明细、新增、编辑、删除。',
2669
+ ],
2670
+ style: {
2671
+ color: '#505259',
2672
+ },
2673
+ },
2674
+ ];
2675
+ },
2676
+ parse(rule) {
2677
+ return {
2678
+ name: name$3,
2679
+ field: rule.field,
2680
+ config: {
2681
+ uploadPictureRule: {
2682
+ hidden: rule.config.uploadPictureRule.hidden,
2683
+ required: rule.config.uploadPictureRule.required,
2684
+ },
2685
+ },
2686
+ };
2687
+ },
2688
+ };
2689
+
2690
+ const _hoisted_1$8 = /* @__PURE__ */ vue.createElementVNode("div", { class: "bm-product-info-item__title" }, "\u5546\u54C1\u7F16\u53F7", -1);
2691
+ const _hoisted_2$6 = { class: "bm-product-info-item__content" };
2692
+ const _hoisted_3$5 = { class: "bm-product-info-item__title" };
2693
+ const _hoisted_4$3 = /* @__PURE__ */ vue.createElementVNode("div", { class: "bm-product-info-item__content" }, "\u7CFB\u7EDF\u81EA\u52A8\u5E26\u51FA", -1);
2694
+ const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
2695
+ __name: "product-info",
2696
+ props: ["formCreateInject"],
2697
+ setup(__props) {
2698
+ return (_ctx, _cache) => {
2699
+ return vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.Row), null, {
2700
+ default: vue.withCtx(() => [
2701
+ vue.createVNode(vue.unref(antDesignVue.Col), {
2702
+ class: "bm-product-info-item",
2703
+ span: 12
2704
+ }, {
2705
+ default: vue.withCtx(() => [
2706
+ _hoisted_1$8,
2707
+ vue.createElementVNode("div", _hoisted_2$6, [
2708
+ vue.createVNode(vue.unref(antDesignVue.Input), { placeholder: "\u8BF7\u8F93\u5165\u5546\u54C1\u7F16\u53F7" })
2709
+ ])
2710
+ ]),
2711
+ _: 1
2712
+ }),
2713
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.formCreateInject.rule.config.associatedFields, (item) => {
2714
+ return vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.Col), {
2715
+ key: item.value,
2716
+ class: "bm-product-info-item",
2717
+ span: 12
2718
+ }, {
2719
+ default: vue.withCtx(() => [
2720
+ vue.createElementVNode("div", _hoisted_3$5, vue.toDisplayString(item.label), 1),
2721
+ _hoisted_4$3
2722
+ ]),
2723
+ _: 2
2724
+ }, 1024);
2725
+ }), 128))
2726
+ ]),
2727
+ _: 1
2728
+ });
2729
+ };
2730
+ }
2731
+ });
2732
+ var ProductInfo = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__file", "product-info.vue"]]);
2733
+
2734
+ const _hoisted_1$7 = /* @__PURE__ */ vue.createElementVNode("div", { class: "bm-associated-fields-item" }, [
2735
+ /* @__PURE__ */ vue.createElementVNode("span", { class: "bm-associated-fields-item__content" }, "\u5546\u54C1\u7F16\u53F7")
2736
+ ], -1);
2737
+ const _hoisted_2$5 = { class: "bm-associated-fields-item__content" };
2738
+ const _hoisted_3$4 = /* @__PURE__ */ vue.createTextVNode(" \u6DFB\u52A0\u5B50\u5B57\u6BB5 ");
2739
+ const _hoisted_4$2 = { style: { "text-align": "right", "margin": "6px 0 4px", "padding-right": "8px" } };
2740
+ const _hoisted_5$1 = /* @__PURE__ */ vue.createTextVNode("\u53D6\u6D88");
2741
+ const _hoisted_6$1 = /* @__PURE__ */ vue.createTextVNode("\u786E\u5B9A");
2742
+ const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
2743
+ __name: "associated-fields",
2744
+ props: ["rule"],
2745
+ emits: ["change"],
2746
+ setup(__props, { emit: emits }) {
2747
+ const props = __props;
2748
+ const visible = vue.ref(false);
2749
+ const checkList = vue.ref([]);
2750
+ const options = [
2751
+ {
2752
+ value: "\u5546\u54C1\u540D\u79F0",
2753
+ label: "\u5546\u54C1\u540D\u79F0"
2754
+ },
2755
+ {
2756
+ value: "\u5546\u54C1\u7B80\u79F0",
2757
+ label: "\u5546\u54C1\u7B80\u79F0"
2758
+ },
2759
+ {
2760
+ value: "\u5546\u54C1\u56FE\u7247",
2761
+ label: "\u5546\u54C1\u56FE\u7247"
2762
+ },
2763
+ {
2764
+ value: "\u5EFA\u8BAE\u96F6\u552E\u4EF7",
2765
+ label: "\u5EFA\u8BAE\u96F6\u552E\u4EF7"
2766
+ },
2767
+ {
2768
+ value: "\u5546\u54C1\u7BB1\u89C4",
2769
+ label: "\u5546\u54C1\u7BB1\u89C4"
2770
+ },
2771
+ {
2772
+ value: "\u5546\u54C1\u5355\u4F4D",
2773
+ label: "\u5546\u54C1\u5355\u4F4D"
2774
+ }
2775
+ ];
2776
+ function emitChangeEvt() {
2777
+ emits(
2778
+ "change",
2779
+ options.filter((op) => checkList.value.includes(op.value))
2780
+ );
2781
+ }
2782
+ function handOk() {
2783
+ visible.value = false;
2784
+ emitChangeEvt();
2785
+ }
2786
+ function init() {
2787
+ checkList.value = props.rule.config.associatedFields.map((item) => item.value);
2788
+ }
2789
+ function visibleChange(visible2) {
2790
+ if (visible2) {
2791
+ init();
2792
+ }
2793
+ }
2794
+ function handleDel(value) {
2795
+ checkList.value = checkList.value.filter((cl) => cl !== value);
2796
+ emitChangeEvt();
2797
+ }
2798
+ init();
2799
+ vue.watch(visible, (val) => {
2800
+ visibleChange(val);
2801
+ });
2802
+ return (_ctx, _cache) => {
2803
+ const _component_Delete = vue.resolveComponent("Delete");
2804
+ return vue.openBlock(), vue.createElementBlock("div", null, [
2805
+ _hoisted_1$7,
2806
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.rule.config.associatedFields, (item) => {
2807
+ return vue.openBlock(), vue.createElementBlock("div", {
2808
+ key: item.value,
2809
+ class: "bm-associated-fields-item"
2810
+ }, [
2811
+ vue.createElementVNode("span", _hoisted_2$5, vue.toDisplayString(item.label), 1),
2812
+ vue.createVNode(_component_Delete, {
2813
+ class: "bm-associated-fields-item__icon",
2814
+ onClick: ($event) => handleDel(item.value)
2815
+ }, null, 8, ["onClick"])
2816
+ ]);
2817
+ }), 128)),
2818
+ vue.createVNode(vue.unref(antDesignVue.Dropdown), {
2819
+ visible: visible.value,
2820
+ "onUpdate:visible": _cache[2] || (_cache[2] = ($event) => visible.value = $event),
2821
+ trigger: ["click"]
2822
+ }, {
2823
+ overlay: vue.withCtx(() => [
2824
+ vue.createVNode(vue.unref(antDesignVue.Menu), null, {
2825
+ default: vue.withCtx(() => [
2826
+ vue.createVNode(vue.unref(antDesignVue.FormItemRest), null, {
2827
+ default: vue.withCtx(() => [
2828
+ vue.createVNode(vue.unref(antDesignVue.CheckboxGroup), {
2829
+ value: checkList.value,
2830
+ "onUpdate:value": _cache[0] || (_cache[0] = ($event) => checkList.value = $event),
2831
+ style: { "width": "100%" }
2832
+ }, {
2833
+ default: vue.withCtx(() => [
2834
+ (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(options, (item) => {
2835
+ return vue.createVNode(vue.unref(antDesignVue.MenuItem), {
2836
+ key: item.value
2837
+ }, {
2838
+ default: vue.withCtx(() => [
2839
+ vue.createVNode(vue.unref(antDesignVue.Checkbox), {
2840
+ value: item.value,
2841
+ style: { "width": "100%" }
2842
+ }, {
2843
+ default: vue.withCtx(() => [
2844
+ vue.createTextVNode(vue.toDisplayString(item.label), 1)
2845
+ ]),
2846
+ _: 2
2847
+ }, 1032, ["value"])
2848
+ ]),
2849
+ _: 2
2850
+ }, 1024);
2851
+ }), 64))
2852
+ ]),
2853
+ _: 1
2854
+ }, 8, ["value"])
2855
+ ]),
2856
+ _: 1
2857
+ }),
2858
+ vue.createVNode(vue.unref(antDesignVue.Divider), { style: { "margin": "0" } }),
2859
+ vue.createElementVNode("div", _hoisted_4$2, [
2860
+ vue.createVNode(vue.unref(antDesignVue.Button), {
2861
+ onClick: _cache[1] || (_cache[1] = ($event) => visible.value = false)
2862
+ }, {
2863
+ default: vue.withCtx(() => [
2864
+ _hoisted_5$1
2865
+ ]),
2866
+ _: 1
2867
+ }),
2868
+ vue.createVNode(vue.unref(antDesignVue.Button), {
2869
+ type: "primary",
2870
+ style: { "margin-left": "8px" },
2871
+ onClick: handOk
2872
+ }, {
2873
+ default: vue.withCtx(() => [
2874
+ _hoisted_6$1
2875
+ ]),
2876
+ _: 1
2877
+ })
2878
+ ])
2879
+ ]),
2880
+ _: 1
2881
+ })
2882
+ ]),
2883
+ default: vue.withCtx(() => [
2884
+ vue.createVNode(vue.unref(antDesignVue.Button), {
2885
+ style: { "margin-top": "8px" },
2886
+ block: ""
2887
+ }, {
2888
+ default: vue.withCtx(() => [
2889
+ vue.createVNode(vue.unref(iconsVue.PlusOutlined)),
2890
+ _hoisted_3$4
2891
+ ]),
2892
+ _: 1
2893
+ })
2894
+ ]),
2895
+ _: 1
2896
+ }, 8, ["visible"])
2897
+ ]);
2898
+ };
2899
+ }
2900
+ });
2901
+ var AssociatedFields = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__file", "associated-fields.vue"]]);
2902
+
2903
+ const _hoisted_1$6 = /* @__PURE__ */ vue.createElementVNode("div", { style: { "margin": "18px 0 6px" } }, "\u4EC5\u83B7\u53D6", -1);
2904
+ const _hoisted_2$4 = /* @__PURE__ */ vue.createElementVNode("div", { style: { "margin-top": "7px" } }, "\u4E2D\u53EF\u5206\u9500\u7684\u5546\u54C1\u6570\u636E", -1);
2905
+ const _hoisted_3$3 = /* @__PURE__ */ vue.createTextVNode("\u8BF7\u5148\u6DFB\u52A0\u5173\u8054\u8868\u5355\u4E2D\u7684\u5E97\u94FA\u7EC4\u4EF6");
2906
+ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
2907
+ __name: "shop-data-filter",
2908
+ props: ["widgetFormRules", "defaultSelectValue"],
2909
+ emits: ["change"],
2910
+ setup(__props, { emit: emits }) {
2911
+ const props = __props;
2912
+ const checkedValue = vue.ref(false);
2913
+ const selectValue = vue.ref(props.defaultSelectValue);
2914
+ const shopRules = vue.computed(
2915
+ () => props.widgetFormRules.reduce((pre, cur) => {
2916
+ const name = cur.config.config.name;
2917
+ if (name === "row" || name === "table") {
2918
+ cur.config.childRules.forEach((rule) => {
2919
+ getShop(rule, pre);
2920
+ });
2921
+ } else {
2922
+ getShop(cur, pre);
2923
+ }
2924
+ return pre;
2925
+ }, [])
2926
+ );
2927
+ const shops = vue.computed(() => {
2928
+ return shopRules.value.map((shopRule) => ({
2929
+ value: shopRule.field,
2930
+ label: shopRule.title.title
2931
+ }));
2932
+ });
2933
+ function getShop(rule, target) {
2934
+ if (rule.config.config.name === "shop")
2935
+ target.push(rule);
2936
+ }
2937
+ function checkedValueChange(val) {
2938
+ if (!val)
2939
+ selectValue.value = void 0;
2940
+ }
2941
+ function selectValueChange(val) {
2942
+ if (val) {
2943
+ checkedValue.value = true;
2944
+ }
2945
+ }
2946
+ function handleChange(val) {
2947
+ emits("change", val);
2948
+ }
2949
+ function shopLinkProduct(newField, oldField) {
2950
+ shopRules.value.forEach((shop) => {
2951
+ if (shop.field === oldField) {
2952
+ shop.config.linkProductCount--;
2953
+ }
2954
+ if (shop.field === newField) {
2955
+ if (!shop.config.linkProductCount) {
2956
+ shop.config.linkProductCount = 0;
2957
+ }
2958
+ shop.config.linkProductCount++;
2959
+ }
2960
+ });
2961
+ }
2962
+ vue.watch(checkedValue, (checkedValue2) => {
2963
+ checkedValueChange(checkedValue2);
2964
+ });
2965
+ vue.watch(
2966
+ selectValue,
2967
+ (selectValue2, oldSelectValue) => {
2968
+ selectValueChange(selectValue2);
2969
+ shopLinkProduct(selectValue2, oldSelectValue);
2970
+ },
2971
+ {
2972
+ immediate: true
2973
+ }
2974
+ );
2975
+ return (_ctx, _cache) => {
2976
+ const _component_a_tooltip = vue.resolveComponent("a-tooltip");
2977
+ return vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.FormItemRest), null, {
2978
+ default: vue.withCtx(() => [
2979
+ vue.unref(shops).length ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
2980
+ vue.createVNode(vue.unref(antDesignVue.Switch), {
2981
+ checked: checkedValue.value,
2982
+ "onUpdate:checked": _cache[0] || (_cache[0] = ($event) => checkedValue.value = $event)
2983
+ }, null, 8, ["checked"]),
2984
+ checkedValue.value ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
2985
+ _hoisted_1$6,
2986
+ vue.createVNode(vue.unref(antDesignVue.Select), {
2987
+ value: selectValue.value,
2988
+ "onUpdate:value": _cache[1] || (_cache[1] = ($event) => selectValue.value = $event),
2989
+ options: vue.unref(shops),
2990
+ placeholder: "\u8BF7\u9009\u62E9",
2991
+ onChange: handleChange
2992
+ }, null, 8, ["value", "options"]),
2993
+ _hoisted_2$4
2994
+ ], 64)) : vue.createCommentVNode("v-if", true)
2995
+ ], 64)) : (vue.openBlock(), vue.createBlock(_component_a_tooltip, {
2996
+ key: 1,
2997
+ placement: "bottomLeft"
2998
+ }, {
2999
+ title: vue.withCtx(() => [
3000
+ _hoisted_3$3
3001
+ ]),
3002
+ default: vue.withCtx(() => [
3003
+ vue.createVNode(vue.unref(antDesignVue.Switch), { disabled: "" })
3004
+ ]),
3005
+ _: 1
3006
+ }))
3007
+ ]),
3008
+ _: 1
3009
+ });
3010
+ };
3011
+ }
3012
+ });
3013
+ var ShopDataFilter = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__file", "shop-data-filter.vue"]]);
3014
+
3015
+ const label$2 = '商品';
3016
+ const fieldsMap$2 = {
3017
+ 'effect.required': 'effect.required',
3018
+ 'config.associatedFields': 'config.associatedFields',
3019
+ 'config.dataFiltering': 'config.dataFiltering',
3020
+ };
3021
+ const name$2 = 'product';
3022
+ var product = {
3023
+ icon: 'Product',
3024
+ name: name$2,
3025
+ label: label$2,
3026
+ rule() {
3027
+ return {
3028
+ type: 'ProductInfo',
3029
+ component: ProductInfo,
3030
+ field: uniqueId__default["default"](),
3031
+ title: {
3032
+ title: label$2,
3033
+ style: {
3034
+ overflow: 'hidden',
3035
+ textOverflow: 'ellipsis',
3036
+ whiteSpace: 'nowrap',
3037
+ },
3038
+ },
3039
+ effect: {
3040
+ required: true,
3041
+ formRule: 'formRule',
3042
+ },
3043
+ config: {
3044
+ propsFields: Object.values(fieldsMap$2),
3045
+ associatedFields: [],
3046
+ },
3047
+ };
3048
+ },
3049
+ props(rule, parentRule, widgetFormRules) {
3050
+ return [
3051
+ {
3052
+ type: 'AssociatedFields',
3053
+ component: AssociatedFields,
3054
+ title: '关联字段',
3055
+ field: fieldsMap$2['config.associatedFields'],
3056
+ props: {
3057
+ rule,
3058
+ },
3059
+ effect: {
3060
+ required: true,
3061
+ },
3062
+ inject: true,
3063
+ on: {
3064
+ change({ api, self }, list) {
3065
+ api.emit('change', self.field, list, self, api, true);
3066
+ },
3067
+ },
3068
+ },
3069
+ {
3070
+ type: 'ShopDataFilter',
3071
+ component: ShopDataFilter,
3072
+ title: '数据过滤',
3073
+ field: fieldsMap$2['config.dataFiltering'],
3074
+ info: '1.开启后,可以与当前表单的“店铺”控件关联进行商品数据过滤,在填写表单时满足仅可选择所选店铺下的可分销商品。' +
3075
+ '2.若不启用数据过滤,则不进行店铺限制,用户填写表单时可选择所有未冻结的商品数据。' +
3076
+ '3.开启前,请确认当前表单中已存在“店铺”控件。',
3077
+ props: {
3078
+ widgetFormRules: widgetFormRules,
3079
+ defaultSelectValue: rule.config.dataFiltering,
3080
+ },
3081
+ inject: true,
3082
+ on: {
3083
+ change({ api, self }, value) {
3084
+ self.props.defaultSelectValue = value;
3085
+ api.emit('change', self.field, value, self, api, true);
3086
+ },
3087
+ },
3088
+ },
3089
+ {
3090
+ type: 'switch',
3091
+ title: '是否必填',
3092
+ field: fieldsMap$2['effect.required'],
3093
+ value: rule.effect.required,
3094
+ },
3095
+ ];
3096
+ },
3097
+ parse(rule) {
3098
+ return {
3099
+ name: name$2,
3100
+ field: rule.field,
3101
+ effect: {
3102
+ required: rule.effect.required,
3103
+ },
3104
+ config: {
3105
+ associatedFields: rule.config.associatedFields,
3106
+ dataFiltering: rule.config.dataFiltering,
3107
+ },
3108
+ };
3109
+ },
3110
+ };
3111
+
3112
+ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
3113
+ __name: "shop-associated-fields",
3114
+ setup(__props) {
3115
+ const associatedFields = [
3116
+ {
3117
+ value: "\u5E97\u94FA\u7F16\u53F7",
3118
+ label: "\u5E97\u94FA\u7F16\u53F7"
3119
+ },
3120
+ {
3121
+ value: "\u5E97\u94FA\u540D\u79F0",
3122
+ label: "\u5E97\u94FA\u540D\u79F0"
3123
+ }
3124
+ ];
3125
+ return (_ctx, _cache) => {
3126
+ return vue.openBlock(), vue.createElementBlock("div", null, [
3127
+ (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(associatedFields, (item) => {
3128
+ return vue.createElementVNode("span", {
3129
+ key: item.value,
3130
+ class: "bm-shop-associated-fields-item"
3131
+ }, vue.toDisplayString(item.label), 1);
3132
+ }), 64))
3133
+ ]);
3134
+ };
3135
+ }
3136
+ });
3137
+ var ShopAssociatedFields = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__file", "shop-associated-fields.vue"]]);
3138
+
3139
+ let i = 0;
3140
+ const label$1 = '店铺';
3141
+ const fieldsMap$1 = {
3142
+ 'effect.required': 'effect.required',
3143
+ 'config.dataFiltering': 'config.dataFiltering',
3144
+ 'config.isMain': 'config.isMain',
3145
+ };
3146
+ const name$1 = 'shop';
3147
+ var shop = {
3148
+ icon: 'Shop',
3149
+ name: name$1,
3150
+ label: label$1,
3151
+ rule() {
3152
+ return {
3153
+ type: 'Select',
3154
+ field: uniqueId__default["default"](),
3155
+ title: {
3156
+ title: label$1 + ++i,
3157
+ style: {
3158
+ overflow: 'hidden',
3159
+ textOverflow: 'ellipsis',
3160
+ whiteSpace: 'nowrap',
3161
+ },
3162
+ },
3163
+ effect: {
3164
+ required: true,
3165
+ formRule: 'formRule',
3166
+ },
3167
+ props: {
3168
+ placeholder: '请选择',
3169
+ },
3170
+ config: {
3171
+ propsFields: Object.values(fieldsMap$1),
3172
+ },
3173
+ };
3174
+ },
3175
+ props(rule, parentRule) {
3176
+ return [
3177
+ {
3178
+ type: 'ShopAssociatedFields',
3179
+ component: ShopAssociatedFields,
3180
+ title: '关联字段',
3181
+ field: 'config.associatedFields',
3182
+ effect: {
3183
+ required: true,
3184
+ },
3185
+ },
3186
+ {
3187
+ type: 'checkbox',
3188
+ title: '数据过滤',
3189
+ field: fieldsMap$1['config.dataFiltering'],
3190
+ options: [
3191
+ {
3192
+ value: true,
3193
+ label: '当前节点操作人所负责的店铺',
3194
+ },
3195
+ ],
3196
+ value: [rule.config.dataFiltering],
3197
+ inject: true,
3198
+ on: {
3199
+ change({ api, self }, value) {
3200
+ api.emit('change', self.field, value[0], self, api, true);
3201
+ },
3202
+ },
3203
+ },
3204
+ {
3205
+ type: 'switch',
3206
+ title: '设为主控件',
3207
+ info: '店铺控件在流程流转过程中涉及数据权限的控制,当表单中设置了多个店铺控件时,需设置其中1个店铺控件作为主控件。被设为主控件的店铺控件,流程流转过程中将以此店铺控件输入的数据作为数据权限判断依据。',
3208
+ field: fieldsMap$1['config.isMain'],
3209
+ value: rule.config.isMain,
3210
+ hidden: !!parentRule,
3211
+ },
3212
+ {
3213
+ type: 'switch',
3214
+ title: '是否必填',
3215
+ field: fieldsMap$1['effect.required'],
3216
+ value: rule.effect.required,
3217
+ },
3218
+ ];
3219
+ },
3220
+ parse(rule) {
3221
+ return {
3222
+ name: name$1,
3223
+ field: rule.field,
3224
+ title: {
3225
+ title: rule.title.title,
3226
+ },
3227
+ effect: {
3228
+ required: rule.effect.required,
3229
+ },
3230
+ config: {
3231
+ dataFiltering: rule.config.dataFiltering,
3232
+ isMain: rule.config.isMain,
3233
+ },
3234
+ };
3235
+ },
3236
+ };
3237
+ function resetIndex() {
3238
+ i = 0;
3239
+ }
3240
+
3241
+ const label = '素材类型';
3242
+ const fieldsMap = {
3243
+ 'effect.required': 'effect.required',
3244
+ 'config.format': 'config.format',
3245
+ 'props.multiple': 'props.multiple',
3246
+ };
3247
+ const name = 'materialType';
3248
+ var materialType = {
3249
+ icon: 'MaterialType',
3250
+ name,
3251
+ label,
3252
+ rule() {
3253
+ return {
3254
+ type: 'Select',
3255
+ field: uniqueId__default["default"](),
3256
+ title: {
3257
+ title: label,
3258
+ style: {
3259
+ overflow: 'hidden',
3260
+ textOverflow: 'ellipsis',
3261
+ whiteSpace: 'nowrap',
3262
+ },
3263
+ },
3264
+ effect: {
3265
+ required: true,
3266
+ formRule: 'formRule',
3267
+ },
3268
+ props: {
3269
+ placeholder: '请选择',
3270
+ multiple: false,
3271
+ },
3272
+ config: {
3273
+ propsFields: Object.values(fieldsMap),
3274
+ format: 1,
3275
+ },
3276
+ };
3277
+ },
3278
+ props(rule, parentRule) {
3279
+ return [
3280
+ {
3281
+ type: 'radio',
3282
+ title: '格式',
3283
+ field: fieldsMap['config.format'],
3284
+ effect: {
3285
+ required: true,
3286
+ },
3287
+ options: [
3288
+ {
3289
+ value: 1,
3290
+ label: '一级分类',
3291
+ },
3292
+ {
3293
+ value: 2,
3294
+ label: '一级分类-二级分类',
3295
+ },
3296
+ {
3297
+ value: 3,
3298
+ label: '一级分类-二级分类-三级分类',
3299
+ },
3300
+ ],
3301
+ value: rule.config.format,
3302
+ className: 'form-designer-props-radio-label',
3303
+ },
3304
+ {
3305
+ type: 'radio',
3306
+ title: '选项',
3307
+ field: fieldsMap['props.multiple'],
3308
+ effect: {
3309
+ required: true,
3310
+ },
3311
+ options: [
3312
+ {
3313
+ value: false,
3314
+ label: '只能选择一种类型',
3315
+ },
3316
+ {
3317
+ value: true,
3318
+ label: '可同时选择多种类型',
3319
+ },
3320
+ ],
3321
+ value: rule.props.multiple,
3322
+ className: 'form-designer-props-radio-label',
3323
+ },
3324
+ {
3325
+ type: 'switch',
3326
+ title: '是否必填',
3327
+ info: '勾选后可作为流程条件',
3328
+ field: fieldsMap['effect.required'],
3329
+ value: rule.effect.required,
3330
+ },
3331
+ ];
3332
+ },
3333
+ parse(rule) {
3334
+ return {
3335
+ name,
3336
+ field: rule.field,
3337
+ props: {
3338
+ multiple: rule.props.multiple,
3339
+ },
3340
+ config: {
3341
+ format: rule.config.format,
3342
+ },
3343
+ effect: {
3344
+ required: rule.effect.required,
3345
+ },
3346
+ };
3347
+ },
3348
+ };
3349
+
3350
+ function createTab() {
3351
+ return [
3352
+ {
3353
+ key: 'controlLibrary',
3354
+ tab: '控件库',
3355
+ menuList: [
3356
+ {
3357
+ name: 'layout',
3358
+ title: '布局控件',
3359
+ list: [row],
3360
+ },
3361
+ {
3362
+ name: 'basic',
3363
+ title: '基础控件',
3364
+ list: [
3365
+ input,
3366
+ textarea,
3367
+ numInput,
3368
+ radio,
3369
+ checkbox,
3370
+ date,
3371
+ dateRange,
3372
+ instruction,
3373
+ ],
3374
+ },
3375
+ {
3376
+ name: 'enhance',
3377
+ title: '增强控件',
3378
+ list: [picture, table, file, people, department],
3379
+ },
3380
+ ],
3381
+ },
3382
+ {
3383
+ key: 'kit',
3384
+ tab: '套件',
3385
+ menuList: [
3386
+ {
3387
+ name: 'materialKit',
3388
+ title: '素材套件',
3389
+ list: [materialTemp],
3390
+ },
3391
+ ],
3392
+ },
3393
+ {
3394
+ key: 'associatedForm',
3395
+ tab: '关联表单',
3396
+ menuList: [
3397
+ {
3398
+ name: 'dataForm',
3399
+ title: '数据表单',
3400
+ list: [product, shop, materialType],
3401
+ },
3402
+ ],
3403
+ },
3404
+ ];
3405
+ }
3406
+
3407
+ const _hoisted_1$5 = {
3408
+ style: { "vertical-align": "middle" },
3409
+ width: "199px",
3410
+ height: "107px",
3411
+ viewBox: "0 0 199 107",
3412
+ xmlns: "http://www.w3.org/2000/svg"
3413
+ };
3414
+ const _hoisted_2$3 = /* @__PURE__ */ vue.createStaticVNode('<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g transform="translate(-826.000000, -249.000000)"><g transform="translate(667.000000, 71.000000)"><g transform="translate(159.000000, 178.000000)"><path d="M2,0 L197,0 C198.104569,-6.46995335e-16 199,0.8954305 199,2 L199,105 C199,106.104569 198.104569,107 197,107 L2,107 C0.8954305,107 1.3527075e-16,106.104569 0,105 L0,2 C-1.3527075e-16,0.8954305 0.8954305,2.02906125e-16 2,0 Z" fill="#F9FBFF"></path><path d="M41,6 C41.5522847,6 42,6.44771525 42,7 L42,100 C42,100.552285 41.5522847,101 41,101 L7,101 C6.44771525,101 6,100.552285 6,100 L6,7 C6,6.44771525 6.44771525,6 7,6 L41,6 Z M192,6 C192.552285,6 193,6.44771525 193,7 L193,100 C193,100.552285 192.552285,101 192,101 L159,101 C158.447715,101 158,100.552285 158,100 L158,7 C158,6.44771525 158.447715,6 159,6 L192,6 Z M151,35 C151.552285,35 152,35.4477153 152,36 L152,100 C152,100.552285 151.552285,101 151,101 L49,101 C48.4477153,101 48,100.552285 48,100 L48,36 C48,35.4477153 48.4477153,35 49,35 L151,35 Z M151,6 C151.552285,6 152,6.44771525 152,7 L152,30 C152,30.5522847 151.552285,31 151,31 L49,31 C48.4477153,31 48,30.5522847 48,30 L48,7 C48,6.44771525 48.4477153,6 49,6 L151,6 Z" fill="#EFF3FF"></path><rect stroke="#8FAAFF" fill="#D0DCFF" x="12.5" y="17.5" width="23" height="13" rx="0.5"></rect><rect fill="#E4E8F7" x="12" y="47" width="24" height="14" rx="0.5"></rect><rect fill="#E4E8F7" x="12" y="75" width="24" height="14" rx="0.5"></rect><use stroke="#AEC2FF" mask="url(#mask-2)" stroke-width="2" fill-opacity="0.26" fill="#AFC3FF" stroke-dasharray="2" xlink:href="#path-1"></use><path d="M33.5,20 C35.9852814,20 38,22.0147186 38,24.5 C38,26.9852814 35.9852814,29 33.5,29 C31.0147186,29 29,26.9852814 29,24.5 C29,22.0147186 31.0147186,20 33.5,20 Z M33.5,22 C32.1192881,22 31,23.1192881 31,24.5 C31,25.8807119 32.1192881,27 33.5,27 C34.8807119,27 36,25.8807119 36,24.5 C36,23.1192881 34.8807119,22 33.5,22 Z" fill="#2F4EED"></path><circle fill="#F9FBFF" cx="33.5" cy="24.5" r="2.5"></circle><path d="M42.5,22 C65.8354499,22 85.7454723,36.6659986 93.5155164,57.2834451 L93.7801465,55.3991118 C93.8570096,54.8522019 94.3626777,54.4711537 94.9095876,54.5480169 C95.4564976,54.6248801 95.8375458,55.1305481 95.7606826,55.677458 L94.925644,61.6190665 C94.8487808,62.1659764 94.3431128,62.5470246 93.7962028,62.4701614 L93.7673315,62.4658857 C93.5875459,62.4468789 93.4107192,62.3789077 93.2577621,62.2594045 L88.5296976,58.5654356 C88.0944913,58.2254152 88.0173279,57.5969697 88.3573483,57.1617634 C88.6973688,56.7265571 89.3258142,56.6493937 89.7610205,56.9894141 L91.887337,58.6494477 C84.582156,38.4419045 65.2276218,24 42.5,24 C40.4254117,24 38.3789284,24.1203318 36.367149,24.3543965 L36.022518,22.3809268 C38.1466458,22.1293826 40.3082134,22 42.5,22 Z" fill="#2F4EED"></path></g></g></g></g>', 1);
3415
+ const _hoisted_3$2 = [
3416
+ _hoisted_2$3
3417
+ ];
3418
+ const _hoisted_4$1 = /* @__PURE__ */ vue.createElementVNode("div", { style: { "line-height": "20px", "margin-top": "12px", "color": "#505259" } }, " \u8BF7\u62D6\u62FD\u6216\u70B9\u51FB\u5DE6\u4FA7\u5B57\u6BB5\u521B\u5EFA\u8868\u5355 ", -1);
3419
+ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
3420
+ __name: "no-data-tip",
3421
+ props: {},
3422
+ setup(__props) {
3423
+ return (_ctx, _cache) => {
3424
+ return vue.openBlock(), vue.createElementBlock("div", null, [
3425
+ (vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$5, _hoisted_3$2)),
3426
+ _hoisted_4$1
3427
+ ]);
3428
+ };
3429
+ }
3430
+ });
3431
+ var NoDataTip = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__file", "no-data-tip.vue"]]);
3432
+
3433
+ const formDesignerProps = {
3434
+ formRules: {
3435
+ type: Array,
3436
+ default() {
3437
+ return [];
3438
+ },
3439
+ },
3440
+ presetRules: {
3441
+ type: Array,
3442
+ default() {
3443
+ return [];
3444
+ },
3445
+ },
3446
+ flowCondition: {
3447
+ type: Object,
3448
+ default() {
3449
+ return {};
3450
+ },
3451
+ },
3452
+ };
3453
+
3454
+ const _hoisted_1$4 = {
3455
+ key: 0,
3456
+ style: { "font-weight": "normal" }
3457
+ };
3458
+ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
3459
+ __name: "table-head-count",
3460
+ props: ["childRules"],
3461
+ setup(__props) {
3462
+ const props = __props;
3463
+ const text = vue.computed(
3464
+ () => props.childRules.filter((rule) => rule.type === "inputNumber" && rule.config.count).reduce((pre, item, index) => {
3465
+ if (index > 0)
3466
+ pre += "\u3001";
3467
+ return pre + `${item.title.title}: 0`;
3468
+ }, "")
3469
+ );
3470
+ return (_ctx, _cache) => {
3471
+ return vue.openBlock(), vue.createElementBlock("div", null, [
3472
+ vue.renderSlot(_ctx.$slots, "default"),
3473
+ vue.unref(text) ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$4, "\uFF08" + vue.toDisplayString(vue.unref(text)) + "\uFF09", 1)) : vue.createCommentVNode("v-if", true)
3474
+ ]);
3475
+ };
3476
+ }
3477
+ });
3478
+ var TableHeadCount = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__file", "table-head-count.vue"]]);
3479
+
3480
+ const _hoisted_1$3 = { style: { "position": "absolute", "right": "0", "top": "-30px", "display": "flex", "align-items": "center" } };
3481
+ const _hoisted_2$2 = /* @__PURE__ */ vue.createTextVNode("\u5FC5\u586B");
3482
+ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
3483
+ __name: "checkbox-switch",
3484
+ props: ["rule"],
3485
+ setup(__props) {
3486
+ return (_ctx, _cache) => {
3487
+ return vue.openBlock(), vue.createElementBlock("span", _hoisted_1$3, [
3488
+ vue.createVNode(vue.unref(antDesignVue.FormItemRest), null, {
3489
+ default: vue.withCtx(() => [
3490
+ vue.createVNode(vue.unref(antDesignVue.Checkbox), {
3491
+ checked: __props.rule.config.uploadPictureRule.required,
3492
+ "onUpdate:checked": _cache[0] || (_cache[0] = ($event) => __props.rule.config.uploadPictureRule.required = $event)
3493
+ }, {
3494
+ default: vue.withCtx(() => [
3495
+ _hoisted_2$2
3496
+ ]),
3497
+ _: 1
3498
+ }, 8, ["checked"]),
3499
+ vue.createVNode(vue.unref(antDesignVue.Switch), {
3500
+ checked: __props.rule.config.uploadPictureRule.hidden,
3501
+ "onUpdate:checked": _cache[1] || (_cache[1] = ($event) => __props.rule.config.uploadPictureRule.hidden = $event),
3502
+ style: { "margin-left": "8px" },
3503
+ "checked-children": "\u5F00",
3504
+ "un-checked-children": "\u5173",
3505
+ "checked-value": false,
3506
+ "un-checked-value": true
3507
+ }, null, 8, ["checked"])
3508
+ ]),
3509
+ _: 1
3510
+ })
3511
+ ]);
3512
+ };
3513
+ }
3514
+ });
3515
+ var CheckboxSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__file", "checkbox-switch.vue"]]);
3516
+
3517
+ const widgetsTableAccept = {
3518
+ [input.name]: input,
3519
+ [textarea.name]: textarea,
3520
+ [numInput.name]: numInput,
3521
+ [radio.name]: radio,
3522
+ [checkbox.name]: checkbox,
3523
+ [date.name]: date,
3524
+ [dateRange.name]: dateRange,
3525
+ [people.name]: people,
3526
+ [department.name]: department,
3527
+ [product.name]: product,
3528
+ [shop.name]: shop,
3529
+ [materialType.name]: materialType,
3530
+ };
3531
+ const widgetNamesRowAccept = [
3532
+ input.name,
3533
+ textarea.name,
3534
+ numInput.name,
3535
+ radio.name,
3536
+ checkbox.name,
3537
+ date.name,
3538
+ dateRange.name,
3539
+ picture.name,
3540
+ table.name,
3541
+ file.name,
3542
+ people.name,
3543
+ department.name,
3544
+ product.name,
3545
+ shop.name,
3546
+ materialType.name,
3547
+ ];
3548
+ var ruleList = {
3549
+ [row.name]: row,
3550
+ [input.name]: input,
3551
+ [textarea.name]: textarea,
3552
+ [numInput.name]: numInput,
3553
+ [radio.name]: radio,
3554
+ [checkbox.name]: checkbox,
3555
+ [date.name]: date,
3556
+ [dateRange.name]: dateRange,
3557
+ [instruction.name]: instruction,
3558
+ [picture.name]: picture,
3559
+ [table.name]: table,
3560
+ [file.name]: file,
3561
+ [people.name]: people,
3562
+ [department.name]: department,
3563
+ [materialTemp.name]: materialTemp,
3564
+ [product.name]: product,
3565
+ [shop.name]: shop,
3566
+ [materialType.name]: materialType,
3567
+ };
3568
+
3569
+ const _hoisted_1$2 = { class: "bm-table-column__main" };
3570
+ const _hoisted_2$1 = { class: "bm-table-column-btn-wrap" };
3571
+ const _hoisted_3$1 = /* @__PURE__ */ vue.createTextVNode(" \u6DFB\u52A0\u5B50\u5B57\u6BB5 ");
3572
+ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
3573
+ __name: "table-column",
3574
+ props: ["formCreateInject"],
3575
+ setup(__props) {
3576
+ const props = __props;
3577
+ const handleClass = "bm-table-column__drag-icon";
3578
+ const btnCom = vue.ref();
3579
+ const open = vue.ref(false);
3580
+ const childRules = vue.computed(() => props.formCreateInject.rule.value);
3581
+ const api = vue.computed(() => props.formCreateInject.api);
3582
+ const options = vue.computed(() => Object.values(widgetsTableAccept));
3583
+ function handleEdit(rule) {
3584
+ api.value.emit("setActive", rule);
3585
+ }
3586
+ function add() {
3587
+ open.value = true;
3588
+ }
3589
+ function handleSelect(value, config) {
3590
+ api.value.emit("addChildRule", config);
3591
+ open.value = false;
3592
+ btnCom.value.$el.blur();
3593
+ }
3594
+ return (_ctx, _cache) => {
3595
+ const _component_Delete = vue.resolveComponent("Delete");
3596
+ const _component_ARow = vue.resolveComponent("ARow");
3597
+ return vue.openBlock(), vue.createElementBlock("div", null, [
3598
+ vue.createVNode(vue.unref(Draggable__default["default"]), {
3599
+ tag: "transition-group",
3600
+ "component-data": {
3601
+ name: "flip-list"
3602
+ },
3603
+ animation: 200,
3604
+ list: vue.unref(childRules),
3605
+ handle: `.${handleClass}`,
3606
+ "force-fallback": true
3607
+ }, {
3608
+ item: vue.withCtx(({ element, index }) => [
3609
+ vue.createVNode(_component_ARow, {
3610
+ class: "bm-table-column",
3611
+ align: "middle"
3612
+ }, {
3613
+ default: vue.withCtx(() => [
3614
+ vue.createVNode(vue.unref(iconsVue.HolderOutlined), {
3615
+ class: vue.normalizeClass([handleClass])
3616
+ }, null, 8, ["class"]),
3617
+ vue.createElementVNode("div", _hoisted_1$2, vue.toDisplayString(element.title.title), 1),
3618
+ vue.createVNode(vue.unref(iconsVue.EditOutlined), {
3619
+ class: "bm-table-column__icon is-edit",
3620
+ onClick: ($event) => handleEdit(element)
3621
+ }, null, 8, ["onClick"]),
3622
+ vue.createVNode(_component_Delete, {
3623
+ class: "bm-table-column__icon is-del",
3624
+ onClick: ($event) => vue.unref(childRules).splice(index, 1)
3625
+ }, null, 8, ["onClick"])
3626
+ ]),
3627
+ _: 2
3628
+ }, 1024)
3629
+ ]),
3630
+ _: 1
3631
+ }, 8, ["list", "handle"]),
3632
+ vue.createElementVNode("div", _hoisted_2$1, [
3633
+ vue.createVNode(vue.unref(antDesignVue.FormItemRest), null, {
3634
+ default: vue.withCtx(() => [
3635
+ vue.createVNode(vue.unref(antDesignVue.Select), {
3636
+ value: "",
3637
+ class: "bm-table-column__select",
3638
+ options: vue.unref(options),
3639
+ "field-names": { value: "name" },
3640
+ open: open.value,
3641
+ placeholder: "\u8BF7\u9009\u62E9",
3642
+ onSelect: handleSelect
3643
+ }, null, 8, ["options", "open"])
3644
+ ]),
3645
+ _: 1
3646
+ }),
3647
+ vue.createVNode(vue.unref(antDesignVue.Button), {
3648
+ ref_key: "btnCom",
3649
+ ref: btnCom,
3650
+ class: "bm-table-column__btn",
3651
+ block: "",
3652
+ onClick: add
3653
+ }, {
3654
+ icon: vue.withCtx(() => [
3655
+ vue.createVNode(vue.unref(iconsVue.PlusOutlined))
3656
+ ]),
3657
+ default: vue.withCtx(() => [
3658
+ _hoisted_3$1
3659
+ ]),
3660
+ _: 1
3661
+ }, 512)
3662
+ ])
3663
+ ]);
3664
+ };
3665
+ }
3666
+ });
3667
+ var TableColumn = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__file", "table-column.vue"]]);
3668
+
3669
+ const _hoisted_1$1 = /* @__PURE__ */ vue.createTextVNode("change");
3670
+ const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
3671
+ __name: "text-color",
3672
+ props: ["rule"],
3673
+ setup(__props) {
3674
+ const props = __props;
3675
+ function handleClick() {
3676
+ const rule = props.rule;
3677
+ rule.style.color = rule.style.color === Colors.Black ? Colors.Blue : Colors.Black;
3678
+ }
3679
+ return (_ctx, _cache) => {
3680
+ const _component_ColorPanel = vue.resolveComponent("ColorPanel");
3681
+ return vue.openBlock(), vue.createBlock(_component_ColorPanel, {
3682
+ style: vue.normalizeStyle({
3683
+ position: "absolute",
3684
+ top: "-29px",
3685
+ right: 0,
3686
+ width: "1em",
3687
+ height: "1em",
3688
+ fontSize: "20px",
3689
+ color: __props.rule.style.color,
3690
+ cursor: "pointer"
3691
+ }),
3692
+ onClick: vue.withModifiers(handleClick, ["prevent", "stop"])
3693
+ }, {
3694
+ default: vue.withCtx(() => [
3695
+ _hoisted_1$1
3696
+ ]),
3697
+ _: 1
3698
+ }, 8, ["style", "onClick"]);
3699
+ };
3700
+ }
3701
+ });
3702
+ var TextColor = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__file", "text-color.vue"]]);
3703
+
3704
+ const _hoisted_1 = { class: "bm-menu-title" };
3705
+ const _hoisted_2 = ["onClick"];
3706
+ const _hoisted_3 = { class: "bfd-main__warp" };
3707
+ const _hoisted_4 = { class: "bm-widget-form-item" };
3708
+ const _hoisted_5 = {
3709
+ key: 0,
3710
+ class: "bfd-sider-right__title"
3711
+ };
3712
+ const _hoisted_6 = /* @__PURE__ */ vue.createTextVNode(" \u5355\u4E2A\u6587\u4EF6\u5927\u5C0F\u9700\u572820M\u4EE5\u5185 ");
3713
+ const _hoisted_7 = { class: "bfd-sider-right__form" };
3714
+ const _hoisted_8 = {
3715
+ key: 0,
3716
+ class: "bfd-sider-right__form__flow-releated"
3717
+ };
16
3718
  const __default__ = {
17
3719
  name: "BmFormDesigner"
18
3720
  };
19
3721
  const _sfc_main = /* @__PURE__ */ vue.defineComponent({
20
3722
  ...__default__,
21
- setup(__props) {
22
- const rule = [
3723
+ props: formDesignerProps,
3724
+ setup(__props, { expose }) {
3725
+ const props = __props;
3726
+ FC__default["default"].component("TableHeadCount", TableHeadCount);
3727
+ FC__default["default"].component("TableColumn", TableColumn);
3728
+ FC__default["default"].component("TextColor", TextColor);
3729
+ FC__default["default"].component("CheckboxSwitch", CheckboxSwitch);
3730
+ FC__default["default"].register({
3731
+ name: "formRule",
3732
+ init(effect, rule, api) {
3733
+ const config = api.config;
3734
+ const parentType = config.parentType;
3735
+ if (!rule.config.fieldRatio) {
3736
+ resetFieldRatio(rule, parentType);
3737
+ }
3738
+ if (rule?.props?.type === "textarea" && parentType === WidgetType.TableWidget) {
3739
+ rule.props.autoSize = true;
3740
+ }
3741
+ if (rule.config.config.name === "product" && parentType === WidgetType.TableWidget) {
3742
+ rule.type = "input";
3743
+ delete rule.component;
3744
+ rule.title.title = "\u5546\u54C1\u7F16\u53F7";
3745
+ rule.props = {};
3746
+ rule.props.placeholder = "\u8BF7\u8F93\u5165";
3747
+ }
3748
+ }
3749
+ });
3750
+ const showDragTip = vue.ref(true);
3751
+ const tabData = createTab();
3752
+ const activeKey = vue.ref("controlLibrary");
3753
+ const widgetFormRules = vue.reactive([]);
3754
+ const activeRule = vue.ref({});
3755
+ const cacheProps = vue.reactive({});
3756
+ const fApi = vue.ref();
3757
+ const activeParentRule = vue.ref();
3758
+ const menuList = vue.computed(
3759
+ () => tabData.find((tab) => tab.key === activeKey.value).menuList
3760
+ );
3761
+ const activeProps = vue.computed(() => cacheProps[activeRule.value.field]);
3762
+ const activeRuleInList = vue.computed(
3763
+ () => activeParentRule.value?.config?.childRules || widgetFormRules
3764
+ );
3765
+ function hideShowDragTip() {
3766
+ showDragTip.value = false;
3767
+ }
3768
+ function handleTabChange(key) {
3769
+ activeKey.value = key;
3770
+ }
3771
+ function cloneMenuItem(original) {
3772
+ return makeRule(original);
3773
+ }
3774
+ function checkDragMove(evt) {
3775
+ const draggedData = evt.dragged._underlying_vm_ || {};
3776
+ const toComponentData = evt.to.__draggable_component__.componentData || {};
3777
+ const widgetNameDragged = draggedData?.config?.config?.name;
3778
+ if (toComponentData.type === WidgetType.RowWidget && !widgetNamesRowAccept.includes(widgetNameDragged) || toComponentData.type === WidgetType.TableWidget && !Object.keys(widgetsTableAccept).includes(widgetNameDragged)) {
3779
+ widgetFormRules.forEach((rule) => {
3780
+ rule.config.putDisabled = rule.field === toComponentData.field;
3781
+ });
3782
+ return false;
3783
+ } else {
3784
+ widgetFormRules.forEach((rule) => {
3785
+ rule.config.putDisabled = false;
3786
+ });
3787
+ }
3788
+ }
3789
+ function moveMenuItem(evt) {
3790
+ return checkDragMove(evt);
3791
+ }
3792
+ function moveFormItem(evt) {
3793
+ return checkDragMove(evt);
3794
+ }
3795
+ function handleMenuItemDragStart(evt) {
3796
+ const item = evt.item.children[0];
3797
+ const cloneItem = evt.clone.children[0];
3798
+ item.style.opacity = 0.3;
3799
+ cloneItem.style.opacity = 0.3;
3800
+ item.style.color = "#2F4EED";
3801
+ cloneItem.style.color = "#2F4EED";
3802
+ }
3803
+ function resetPutDisabled() {
3804
+ widgetFormRules.forEach((rule) => {
3805
+ rule.config.putDisabled = false;
3806
+ });
3807
+ }
3808
+ function handleMenuItemDragEnd(evt) {
3809
+ evt.item.children[0].style.opacity = "";
3810
+ evt.item.children[0].style.color = "";
3811
+ resetPutDisabled();
3812
+ }
3813
+ function handleMenuItemClick(config) {
3814
+ const rule = makeRule(config);
3815
+ const activeParentRuleName = activeParentRule.value?.config?.config?.name;
3816
+ if (!widgetNamesRowAccept.includes(config.name) && activeParentRuleName === "row" || !Object.keys(widgetsTableAccept).includes(config.name) && activeParentRuleName === "table") {
3817
+ disabledTip(activeParentRule.value.config.config.name);
3818
+ } else {
3819
+ const index = activeRuleInList.value.findIndex(
3820
+ (item) => item.field === activeRule.value.field
3821
+ );
3822
+ activeRuleInList.value.splice(index + 1, 0, rule);
3823
+ setActiveRule(rule, activeParentRule.value);
3824
+ hideShowDragTip();
3825
+ }
3826
+ }
3827
+ function makeRule(config) {
3828
+ const rule = config.rule();
3829
+ rule.config.config = config;
3830
+ return rule;
3831
+ }
3832
+ function disabledTip(name) {
3833
+ antDesignVue.message.warning({
3834
+ content: name === "table" ? "\u8BE5\u63A7\u4EF6\u6682\u4E0D\u652F\u6301\u62D6\u5165\u8868\u683C\u4E2D" : "\u8BE5\u63A7\u4EF6\u6682\u4E0D\u652F\u6301\u5206\u680F",
3835
+ class: "bm-form-designer__message-warning"
3836
+ });
3837
+ }
3838
+ function putDisabledTip() {
3839
+ const targetRule = widgetFormRules.find((rule) => rule.config.putDisabled);
3840
+ if (targetRule) {
3841
+ disabledTip(targetRule.config.config.name);
3842
+ }
3843
+ }
3844
+ function dragAdd(rule, parentRule = void 0) {
3845
+ resetFieldRatio(rule, parentRule?.type);
3846
+ if (cacheProps[rule.field])
3847
+ delete cacheProps[rule.field];
3848
+ setActiveRule(rule, parentRule);
3849
+ putDisabledTip();
3850
+ }
3851
+ function handleFormItemAdd({ newIndex }) {
3852
+ const rule = widgetFormRules[newIndex];
3853
+ dragAdd(rule);
3854
+ hideShowDragTip();
3855
+ }
3856
+ function handleFormItemUpdate({ newIndex }) {
3857
+ const rule = widgetFormRules[newIndex];
3858
+ if (rule)
3859
+ setActiveRule(widgetFormRules[newIndex]);
3860
+ }
3861
+ function handleFormItemDragEnd() {
3862
+ putDisabledTip();
3863
+ resetPutDisabled();
3864
+ }
3865
+ function handleFormItemClick(rule) {
3866
+ setActiveRule(rule);
3867
+ }
3868
+ function makeChildRules(ruleList2) {
3869
+ return ruleList2.map((rule) => makeRule(rule.config.config));
3870
+ }
3871
+ function handleFormItemCopy(rule, parentRule) {
3872
+ const newRule = makeRule(rule.config.config);
3873
+ const list = parentRule?.config?.childRules || widgetFormRules;
3874
+ const index = list.findIndex((ruleItem) => ruleItem.field === rule.field);
3875
+ if (rule.config.childRules?.length) {
3876
+ newRule.config.childRules.push(...makeChildRules(rule.config.childRules));
3877
+ }
3878
+ list.splice(index + 1, 0, newRule);
3879
+ copyPropValue(rule, newRule);
3880
+ setActiveRule(newRule, parentRule);
3881
+ }
3882
+ function handleFormItemDelete(targetRule, parentRule) {
3883
+ if (targetRule.config.linkProductCount > 0) {
3884
+ antDesignVue.message.error("\u8BE5\u63A7\u4EF6\u5DF2\u88AB\u8BBE\u4E3A\u6570\u636E\u8FC7\u6EE4\u6761\u4EF6\uFF0C\u4E0D\u53EF\u5220\u9664\u3002");
3885
+ return;
3886
+ }
3887
+ const parentList = parentRule?.config?.childRules || widgetFormRules;
3888
+ const index = parentList.findIndex((rule) => rule.field === targetRule.field);
3889
+ parentList.splice(index, 1);
3890
+ delete cacheProps[targetRule.field];
3891
+ if (targetRule.field === activeRule.value.field) {
3892
+ const newIndex = Math.min(parentList.length - 1, index);
3893
+ if (newIndex >= 0) {
3894
+ setActiveRule(parentList[newIndex]);
3895
+ } else if (parentRule) {
3896
+ setActiveRule(parentRule);
3897
+ } else {
3898
+ activeRule.value = {};
3899
+ }
3900
+ } else if (targetRule?.config?.childRules?.some(
3901
+ (rule) => rule.field === activeRule.value.field
3902
+ )) {
3903
+ const newIndex = Math.min(parentList.length - 1, index);
3904
+ if (newIndex >= 0) {
3905
+ setActiveRule(parentList[newIndex]);
3906
+ } else {
3907
+ activeRule.value = {};
3908
+ activeParentRule.value = widgetFormRules;
3909
+ }
3910
+ }
3911
+ }
3912
+ function makePropRule(rule, parentRule) {
3913
+ return rule.config.config.props(rule, parentRule, widgetFormRules);
3914
+ }
3915
+ function setActiveRule(rule, parentRule = void 0) {
3916
+ activeRule.value = rule;
3917
+ activeParentRule.value = parentRule;
3918
+ widgetFormRules.forEach((item) => {
3919
+ if (item.type === WidgetType.RowWidget || item.type === WidgetType.TableWidget) {
3920
+ vue.nextTick(() => {
3921
+ item.props.activeRule = rule;
3922
+ });
3923
+ }
3924
+ });
3925
+ if (!cacheProps[rule.field]) {
3926
+ cacheProps[rule.field] = makePropRule(rule, parentRule);
3927
+ }
3928
+ }
3929
+ function propChange(field, value) {
3930
+ setRulePropValue(field, value, activeRule.value);
3931
+ }
3932
+ function setRulePropValue(field, value, rule) {
3933
+ field.split(".").reduce((pre, cur, index, arr) => {
3934
+ if (index === arr.length - 1) {
3935
+ pre[cur] = value;
3936
+ } else {
3937
+ if (!pre[cur]) {
3938
+ pre[cur] = {};
3939
+ }
3940
+ }
3941
+ return pre[cur];
3942
+ }, rule);
3943
+ }
3944
+ function copyPropValue(oldRule, newRule) {
3945
+ newRule.config.propsFields.forEach((field) => {
3946
+ if (field !== "config.childRules")
3947
+ setRulePropValue(field, lodashEs.cloneDeep(getValue(field, oldRule)), newRule);
3948
+ });
3949
+ if (newRule.config.childRules?.length) {
3950
+ newRule.config.childRules.forEach((rule, index) => {
3951
+ copyPropValue(oldRule.config.childRules[index], rule);
3952
+ });
3953
+ }
3954
+ }
3955
+ function handleWidgetAdd(rule, parentRule) {
3956
+ dragAdd(rule, parentRule);
3957
+ }
3958
+ function handlePropsSetActive(rule) {
3959
+ setActiveRule(rule, activeRule.value);
3960
+ }
3961
+ function handleAddChildRule(config) {
3962
+ const rule = makeRule(config);
3963
+ activeRule.value.config.childRules.push(rule);
3964
+ }
3965
+ function getValue(field, oldRule) {
3966
+ return field.split(".").reduce((pre, cur) => {
3967
+ return pre[cur];
3968
+ }, oldRule);
3969
+ }
3970
+ function resetFieldRatio(rule, parentRuleType) {
3971
+ if (!parentRuleType) {
3972
+ rule.config.fieldRatio = "100%";
3973
+ } else if (parentRuleType === WidgetType.RowWidget) {
3974
+ const ruleName = rule.config.config.name;
3975
+ rule.config.fieldRatio = ruleName === "table" || ruleName === "product" ? 24 : 12;
3976
+ } else if (parentRuleType === WidgetType.TableWidget) {
3977
+ rule.config.fieldRatio = "140px";
3978
+ }
3979
+ }
3980
+ function getFormRule() {
3981
+ return widgetFormRules.map((rule) => {
3982
+ const ruleParsed = parseRule(rule);
3983
+ const childRules = rule?.config?.childRules;
3984
+ if (childRules?.length) {
3985
+ const childRulesParsed = ruleParsed.config.childRules = [];
3986
+ childRules.forEach((ruleItem) => {
3987
+ childRulesParsed.push(parseRule(ruleItem));
3988
+ });
3989
+ }
3990
+ return ruleParsed;
3991
+ });
3992
+ }
3993
+ function parseRule(rule) {
3994
+ return rule.config.config.parse(rule);
3995
+ }
3996
+ function edit(formRules) {
3997
+ formRules.forEach((item) => {
3998
+ const rule = makeRule(ruleList[item.name]);
3999
+ delete item.name;
4000
+ if (item?.config?.childRules?.length) {
4001
+ rule.config.childRules = item.config.childRules.map((childItem) => {
4002
+ const childRule = makeRule(ruleList[childItem.name]);
4003
+ delete childItem.name;
4004
+ return childRule;
4005
+ });
4006
+ }
4007
+ lodashEs.merge(rule, item);
4008
+ widgetFormRules.push(rule);
4009
+ });
4010
+ }
4011
+ function getRule(name) {
4012
+ return makeRule(ruleList[name]);
4013
+ }
4014
+ vue.watch(
4015
+ () => props.presetRules,
4016
+ (presetRules) => {
4017
+ widgetFormRules.push(...presetRules);
4018
+ },
23
4019
  {
24
- type: "input",
25
- title: "\u5546\u54C1\u540D\u79F0",
26
- field: "goods_name"
4020
+ immediate: true
27
4021
  }
28
- ];
4022
+ );
4023
+ vue.watch(
4024
+ () => props.formRules,
4025
+ (formRules) => {
4026
+ edit(formRules);
4027
+ },
4028
+ {
4029
+ immediate: true
4030
+ }
4031
+ );
4032
+ vue.onBeforeUnmount(() => {
4033
+ resetIndex();
4034
+ });
4035
+ expose({
4036
+ getFormRule,
4037
+ getRule
4038
+ });
29
4039
  return (_ctx, _cache) => {
30
- const _component_form_create = vue.resolveComponent("form-create");
31
- return vue.openBlock(), vue.createBlock(_component_form_create, { rule });
4040
+ const _component_ACol = vue.resolveComponent("ACol");
4041
+ const _component_ARow = vue.resolveComponent("ARow");
4042
+ const _component_FormCreate = vue.resolveComponent("FormCreate");
4043
+ return vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.Layout), { class: "bm-form-designer" }, {
4044
+ default: vue.withCtx(() => [
4045
+ vue.createVNode(vue.unref(antDesignVue.LayoutSider), {
4046
+ class: "bfd-sider-left",
4047
+ width: "260"
4048
+ }, {
4049
+ default: vue.withCtx(() => [
4050
+ vue.createVNode(_component_ARow, { class: "bm-tabs" }, {
4051
+ default: vue.withCtx(() => [
4052
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(tabData), (item) => {
4053
+ return vue.openBlock(), vue.createBlock(_component_ACol, {
4054
+ key: item.key,
4055
+ class: vue.normalizeClass(["bm-tabs-item", activeKey.value === item.key ? "active" : ""]),
4056
+ onClick: ($event) => handleTabChange(item.key)
4057
+ }, {
4058
+ default: vue.withCtx(() => [
4059
+ vue.createTextVNode(vue.toDisplayString(item.tab), 1)
4060
+ ]),
4061
+ _: 2
4062
+ }, 1032, ["class", "onClick"]);
4063
+ }), 128))
4064
+ ]),
4065
+ _: 1
4066
+ }),
4067
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(menuList), (item, index) => {
4068
+ return vue.openBlock(), vue.createElementBlock("div", { key: index }, [
4069
+ vue.createElementVNode("div", _hoisted_1, vue.toDisplayString(item.title), 1),
4070
+ vue.createVNode(vue.unref(Draggable__default["default"]), {
4071
+ class: "bm-menu-wrap",
4072
+ list: item.list,
4073
+ group: { name: "widget", pull: "clone", put: false },
4074
+ "item-key": "name",
4075
+ sort: false,
4076
+ clone: cloneMenuItem,
4077
+ move: moveMenuItem,
4078
+ "force-fallback": true,
4079
+ "scroll-sensitivity": 100,
4080
+ delay: 50,
4081
+ onStart: handleMenuItemDragStart,
4082
+ onEnd: handleMenuItemDragEnd
4083
+ }, {
4084
+ item: vue.withCtx(({ element }) => [
4085
+ vue.createElementVNode("div", {
4086
+ style: vue.normalizeStyle({ flexBasis: item.name === "dataForm" ? "100%" : "50%" }),
4087
+ class: "bm-menu-item-wrap"
4088
+ }, [
4089
+ vue.createElementVNode("div", {
4090
+ class: "bm-menu-item",
4091
+ onClick: ($event) => handleMenuItemClick(element)
4092
+ }, [
4093
+ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(element.icon), { class: "bm-menu-icon" })),
4094
+ vue.createTextVNode(" " + vue.toDisplayString(element.label), 1)
4095
+ ], 8, _hoisted_2),
4096
+ vue.createVNode(DragPlaceholder)
4097
+ ], 4)
4098
+ ]),
4099
+ _: 2
4100
+ }, 1032, ["list"])
4101
+ ]);
4102
+ }), 128))
4103
+ ]),
4104
+ _: 1
4105
+ }),
4106
+ vue.createVNode(vue.unref(antDesignVue.LayoutContent), { class: "bfd-main" }, {
4107
+ default: vue.withCtx(() => [
4108
+ vue.createElementVNode("div", _hoisted_3, [
4109
+ vue.createVNode(vue.unref(Draggable__default["default"]), {
4110
+ list: widgetFormRules,
4111
+ class: "bm-widget-form",
4112
+ group: {
4113
+ name: "formWidget",
4114
+ pull: true,
4115
+ put: ["widget", "formWidget", "rowWidget"]
4116
+ },
4117
+ "item-key": "field",
4118
+ "ghost-class": "form-item-drag-ghost",
4119
+ move: moveFormItem,
4120
+ "force-fallback": true,
4121
+ delay: 50,
4122
+ onAdd: handleFormItemAdd,
4123
+ onUpdate: handleFormItemUpdate,
4124
+ onEnd: handleFormItemDragEnd
4125
+ }, {
4126
+ item: vue.withCtx(({ element }) => [
4127
+ vue.createElementVNode("div", _hoisted_4, [
4128
+ vue.createVNode(DragTool, {
4129
+ rule: element,
4130
+ "active-rule": activeRule.value,
4131
+ style: vue.normalizeStyle({
4132
+ width: element.config.fieldRatio
4133
+ }),
4134
+ onCopy: handleFormItemCopy,
4135
+ onDelete: handleFormItemDelete,
4136
+ onClick: ($event) => handleFormItemClick(element),
4137
+ onSetActiveRule: setActiveRule,
4138
+ onWidgetAdd: handleWidgetAdd
4139
+ }, null, 8, ["rule", "active-rule", "style", "onClick"]),
4140
+ vue.createVNode(DragPlaceholder)
4141
+ ])
4142
+ ]),
4143
+ _: 1
4144
+ }, 8, ["list"]),
4145
+ showDragTip.value && !_ctx.formRules.length ? (vue.openBlock(), vue.createBlock(NoDataTip, {
4146
+ key: 0,
4147
+ class: "bm-no-data-tip"
4148
+ })) : vue.createCommentVNode("v-if", true)
4149
+ ])
4150
+ ]),
4151
+ _: 1
4152
+ }),
4153
+ vue.createVNode(vue.unref(antDesignVue.LayoutSider), {
4154
+ class: "bfd-sider-right",
4155
+ width: "288"
4156
+ }, {
4157
+ default: vue.withCtx(() => [
4158
+ activeRule.value.field ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5, [
4159
+ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(activeRule.value.config?.config.icon))),
4160
+ vue.createTextVNode(" " + vue.toDisplayString(activeRule.value.config?.config.label) + " ", 1),
4161
+ activeRule.value.type === vue.unref(WidgetType).UploadFile ? (vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.Tooltip), { key: 0 }, {
4162
+ title: vue.withCtx(() => [
4163
+ _hoisted_6
4164
+ ]),
4165
+ default: vue.withCtx(() => [
4166
+ vue.createVNode(vue.unref(iconsVue.QuestionCircleOutlined), { style: { "color": "#babac1", "font-size": "14px", "margin-left": "5px" } })
4167
+ ]),
4168
+ _: 1
4169
+ })) : vue.createCommentVNode("v-if", true)
4170
+ ])) : vue.createCommentVNode("v-if", true),
4171
+ vue.createElementVNode("div", _hoisted_7, [
4172
+ _ctx.flowCondition[activeRule.value.field] ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_8, [
4173
+ vue.createVNode(vue.unref(iconsVue.ExclamationCircleFilled), { style: { "color": "#2f4eed" } }),
4174
+ vue.createTextVNode(" \u8BE5\u7EC4\u4EF6\u5728\u201C" + vue.toDisplayString(_ctx.flowCondition[activeRule.value.field]) + "\u201D\u5DF2\u88AB\u8BBE\u4E3A\u5BA1\u6279\u6761\u4EF6\uFF0C\u9664\u201C\u5FC5\u586B\u3001\u9009\u9879\u201D\u8BBE\u7F6E\u4E0D\u53EF\u4FEE\u6539\uFF0C\u5176\u4ED6\u4FE1\u606F\u53EF\u4FEE\u6539 ", 1)
4175
+ ])) : vue.createCommentVNode("v-if", true),
4176
+ vue.createVNode(_component_FormCreate, {
4177
+ api: fApi.value,
4178
+ "onUpdate:api": _cache[0] || (_cache[0] = ($event) => fApi.value = $event),
4179
+ option: {
4180
+ form: {
4181
+ layout: "vertical"
4182
+ },
4183
+ submitBtn: {
4184
+ show: false
4185
+ },
4186
+ info: {
4187
+ type: "tooltip",
4188
+ align: "left",
4189
+ arrowPointAtCenter: true,
4190
+ overlayStyle: {
4191
+ width: "184px"
4192
+ }
4193
+ }
4194
+ },
4195
+ rule: vue.unref(activeProps),
4196
+ onChange: propChange,
4197
+ onSetActive: handlePropsSetActive,
4198
+ onAddChildRule: handleAddChildRule
4199
+ }, null, 8, ["api", "rule"])
4200
+ ])
4201
+ ]),
4202
+ _: 1
4203
+ })
4204
+ ]),
4205
+ _: 1
4206
+ });
32
4207
  };
33
4208
  }
34
4209
  });