bm-admin-ui 1.2.29-alpha → 1.2.30-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/attachment/index.d.ts +1 -1
- package/es/components/attachment/src/attachment.vue.d.ts +1 -1
- package/es/components/button/index.d.ts +1 -1
- package/es/components/button/src/button.vue.d.ts +1 -1
- package/es/components/cascader/index.d.ts +1 -1
- package/es/components/cascader/src/cascader.vue.d.ts +1 -1
- package/es/components/edit-form/index.d.ts +2 -2
- package/es/components/edit-form/src/edit-form.vue.d.ts +2 -2
- package/es/components/editor/index.d.ts +3 -3
- package/es/components/editor/src/editor.vue.d.ts +3 -3
- package/es/components/feedback/index.d.ts +12 -12
- package/es/components/feedback/src/bmAlert.vue.d.ts +5 -5
- package/es/components/feedback/src/bmModal.vue.d.ts +7 -7
- package/es/components/flow-designer/index.js +32 -10
- package/es/components/flow-designer/src/bm-nodes/BmConditionNode.vue.d.ts +14 -0
- package/es/components/flow-designer/src/bm-nodes/BmHtmlNode.vue.d.ts +1 -0
- package/es/components/form-create/index.js +743 -197
- package/es/components/form-designer/index.js +116 -21
- package/es/components/over-tooltips/index.d.ts +1 -1
- package/es/components/over-tooltips/src/over-tooltips.vue.d.ts +1 -1
- package/es/components/staffs-selector/index.d.ts +8 -8
- package/es/components/staffs-selector/index.js +2 -2
- package/es/components/staffs-selector/src/staffs-selector.vue.d.ts +8 -8
- package/es/components/upload/index.d.ts +1 -1
- package/es/components/upload/src/upload.vue.d.ts +1 -1
- package/es/utils/index.d.ts +7 -0
- package/es/utils/index.js +62 -0
- package/es/utils/isNull.js +1 -1
- package/lib/components/attachment/index.d.ts +1 -1
- package/lib/components/attachment/src/attachment.vue.d.ts +1 -1
- package/lib/components/button/index.d.ts +1 -1
- package/lib/components/button/src/button.vue.d.ts +1 -1
- package/lib/components/cascader/index.d.ts +1 -1
- package/lib/components/cascader/src/cascader.vue.d.ts +1 -1
- package/lib/components/edit-form/index.d.ts +2 -2
- package/lib/components/edit-form/src/edit-form.vue.d.ts +2 -2
- package/lib/components/editor/index.d.ts +3 -3
- package/lib/components/editor/src/editor.vue.d.ts +3 -3
- package/lib/components/feedback/index.d.ts +12 -12
- package/lib/components/feedback/src/bmAlert.vue.d.ts +5 -5
- package/lib/components/feedback/src/bmModal.vue.d.ts +7 -7
- package/lib/components/flow-designer/index.js +32 -10
- package/lib/components/flow-designer/src/bm-nodes/BmConditionNode.vue.d.ts +14 -0
- package/lib/components/flow-designer/src/bm-nodes/BmHtmlNode.vue.d.ts +1 -0
- package/lib/components/form-create/index.js +746 -197
- package/lib/components/form-designer/index.js +115 -20
- package/lib/components/over-tooltips/index.d.ts +1 -1
- package/lib/components/over-tooltips/src/over-tooltips.vue.d.ts +1 -1
- package/lib/components/staffs-selector/index.d.ts +8 -8
- package/lib/components/staffs-selector/index.js +2 -2
- package/lib/components/staffs-selector/src/staffs-selector.vue.d.ts +8 -8
- package/lib/components/upload/index.d.ts +1 -1
- package/lib/components/upload/src/upload.vue.d.ts +1 -1
- package/lib/utils/index.d.ts +7 -0
- package/lib/utils/index.js +64 -0
- package/lib/utils/isNull.js +1 -1
- package/package.json +1 -1
- package/theme-chalk/attachment.css +1 -1
- package/theme-chalk/index.css +2 -2
- package/types/components/attachment/index.d.ts +1 -1
- package/types/components/attachment/src/attachment.vue.d.ts +1 -1
- package/types/components/button/index.d.ts +1 -1
- package/types/components/button/src/button.vue.d.ts +1 -1
- package/types/components/cascader/index.d.ts +1 -1
- package/types/components/cascader/src/cascader.vue.d.ts +1 -1
- package/types/components/edit-form/index.d.ts +2 -2
- package/types/components/edit-form/src/edit-form.vue.d.ts +2 -2
- package/types/components/editor/index.d.ts +3 -3
- package/types/components/editor/src/editor.vue.d.ts +3 -3
- package/types/components/feedback/index.d.ts +12 -12
- package/types/components/feedback/src/bmAlert.vue.d.ts +5 -5
- package/types/components/feedback/src/bmModal.vue.d.ts +7 -7
- package/types/components/flow-designer/src/bm-nodes/BmConditionNode.vue.d.ts +14 -0
- package/types/components/flow-designer/src/bm-nodes/BmHtmlNode.vue.d.ts +1 -0
- package/types/components/over-tooltips/index.d.ts +1 -1
- package/types/components/over-tooltips/src/over-tooltips.vue.d.ts +1 -1
- package/types/components/staffs-selector/index.d.ts +8 -8
- package/types/components/staffs-selector/src/staffs-selector.vue.d.ts +8 -8
- package/types/components/upload/index.d.ts +1 -1
- package/types/components/upload/src/upload.vue.d.ts +1 -1
- package/types/utils/index.d.ts +7 -0
- package/es/index.js +0 -13
- package/lib/index.js +0 -42
|
@@ -12,7 +12,10 @@ var components = require('bm-admin-ui/lib/components');
|
|
|
12
12
|
var iconsVue = require('@ant-design/icons-vue');
|
|
13
13
|
var lodashEs = require('lodash-es');
|
|
14
14
|
var customParseFormat = require('dayjs/plugin/customParseFormat');
|
|
15
|
+
var utils = require('bm-admin-ui/lib/utils');
|
|
15
16
|
var isNull = require('bm-admin-ui/lib/utils/isNull');
|
|
17
|
+
var FC = require('@form-create/ant-design-vue');
|
|
18
|
+
var BmOverTooltips = require('bm-admin-ui/lib/components/over-tooltips');
|
|
16
19
|
|
|
17
20
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
18
21
|
|
|
@@ -20,6 +23,9 @@ var dayjs__default = /*#__PURE__*/_interopDefaultLegacy(dayjs);
|
|
|
20
23
|
var Picture__default = /*#__PURE__*/_interopDefaultLegacy(Picture);
|
|
21
24
|
var BmStaffsSelector__default = /*#__PURE__*/_interopDefaultLegacy(BmStaffsSelector);
|
|
22
25
|
var customParseFormat__default = /*#__PURE__*/_interopDefaultLegacy(customParseFormat);
|
|
26
|
+
var utils__default = /*#__PURE__*/_interopDefaultLegacy(utils);
|
|
27
|
+
var FC__default = /*#__PURE__*/_interopDefaultLegacy(FC);
|
|
28
|
+
var BmOverTooltips__default = /*#__PURE__*/_interopDefaultLegacy(BmOverTooltips);
|
|
23
29
|
|
|
24
30
|
const fieldRatioMap = {
|
|
25
31
|
'25%': 6,
|
|
@@ -38,6 +44,7 @@ function getContainer() {
|
|
|
38
44
|
var input = {
|
|
39
45
|
name: 'input',
|
|
40
46
|
rule(data) {
|
|
47
|
+
var _a;
|
|
41
48
|
return {
|
|
42
49
|
type: 'input',
|
|
43
50
|
field: data.field,
|
|
@@ -48,7 +55,7 @@ var input = {
|
|
|
48
55
|
},
|
|
49
56
|
value: data.value,
|
|
50
57
|
effect: {
|
|
51
|
-
required: data.effect.required && '请输入',
|
|
58
|
+
required: data.effect.required && (((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请输入'),
|
|
52
59
|
},
|
|
53
60
|
wrap: {
|
|
54
61
|
wrapperCol: {
|
|
@@ -58,6 +65,7 @@ var input = {
|
|
|
58
65
|
};
|
|
59
66
|
},
|
|
60
67
|
rowRule(data) {
|
|
68
|
+
var _a;
|
|
61
69
|
return {
|
|
62
70
|
type: 'input',
|
|
63
71
|
field: data.field,
|
|
@@ -68,7 +76,7 @@ var input = {
|
|
|
68
76
|
},
|
|
69
77
|
value: data.value,
|
|
70
78
|
effect: {
|
|
71
|
-
required: data.effect.required && '请输入',
|
|
79
|
+
required: data.effect.required && (((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请输入'),
|
|
72
80
|
},
|
|
73
81
|
col: {
|
|
74
82
|
span: fieldRatioMap[data.config.fieldRatio],
|
|
@@ -110,6 +118,7 @@ var input = {
|
|
|
110
118
|
var textarea = {
|
|
111
119
|
name: 'textarea',
|
|
112
120
|
rule(data) {
|
|
121
|
+
var _a;
|
|
113
122
|
return {
|
|
114
123
|
type: 'input',
|
|
115
124
|
field: data.field,
|
|
@@ -121,7 +130,7 @@ var textarea = {
|
|
|
121
130
|
},
|
|
122
131
|
value: data.value,
|
|
123
132
|
effect: {
|
|
124
|
-
required: data.effect.required && '请输入',
|
|
133
|
+
required: data.effect.required && (((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请输入'),
|
|
125
134
|
},
|
|
126
135
|
wrap: {
|
|
127
136
|
wrapperCol: {
|
|
@@ -131,6 +140,7 @@ var textarea = {
|
|
|
131
140
|
};
|
|
132
141
|
},
|
|
133
142
|
rowRule(data) {
|
|
143
|
+
var _a;
|
|
134
144
|
return {
|
|
135
145
|
type: 'input',
|
|
136
146
|
field: data.field,
|
|
@@ -142,7 +152,7 @@ var textarea = {
|
|
|
142
152
|
},
|
|
143
153
|
value: data.value,
|
|
144
154
|
effect: {
|
|
145
|
-
required: data.effect.required && '请输入',
|
|
155
|
+
required: data.effect.required && (((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请输入'),
|
|
146
156
|
},
|
|
147
157
|
col: {
|
|
148
158
|
span: fieldRatioMap[data.config.fieldRatio],
|
|
@@ -174,8 +184,9 @@ var textarea = {
|
|
|
174
184
|
},
|
|
175
185
|
};
|
|
176
186
|
|
|
177
|
-
function generateRowRule(data) {
|
|
178
|
-
|
|
187
|
+
function generateRowRule(data, InRow = false) {
|
|
188
|
+
var _a;
|
|
189
|
+
const config = {
|
|
179
190
|
type: 'inputNumber',
|
|
180
191
|
field: data.field,
|
|
181
192
|
title: data.title.title,
|
|
@@ -185,17 +196,25 @@ function generateRowRule(data) {
|
|
|
185
196
|
},
|
|
186
197
|
value: data.value,
|
|
187
198
|
effect: {
|
|
188
|
-
required: data.effect.required && '请输入',
|
|
189
|
-
},
|
|
190
|
-
wrap: {
|
|
191
|
-
wrapperCol: {
|
|
192
|
-
span: fieldRatioMap[data.config.fieldRatio],
|
|
193
|
-
},
|
|
199
|
+
required: data.effect.required && (((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请输入'),
|
|
194
200
|
},
|
|
195
201
|
style: {
|
|
196
202
|
width: '100%',
|
|
197
203
|
},
|
|
198
204
|
};
|
|
205
|
+
if (InRow) {
|
|
206
|
+
config['col'] = {
|
|
207
|
+
span: fieldRatioMap[data.config.fieldRatio],
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
else {
|
|
211
|
+
config['wrap'] = {
|
|
212
|
+
wrapperCol: {
|
|
213
|
+
span: fieldRatioMap[data.config.fieldRatio],
|
|
214
|
+
},
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
return config;
|
|
199
218
|
}
|
|
200
219
|
var numInput = {
|
|
201
220
|
name: 'numInput',
|
|
@@ -203,7 +222,7 @@ var numInput = {
|
|
|
203
222
|
return generateRowRule(data);
|
|
204
223
|
},
|
|
205
224
|
rowRule(data) {
|
|
206
|
-
return generateRowRule(data);
|
|
225
|
+
return generateRowRule(data, true);
|
|
207
226
|
},
|
|
208
227
|
tableRule(data) {
|
|
209
228
|
const field = data.field;
|
|
@@ -297,6 +316,7 @@ function handleRadioRule(rule) {
|
|
|
297
316
|
var radio = {
|
|
298
317
|
name: 'radio',
|
|
299
318
|
rule(data) {
|
|
319
|
+
var _a;
|
|
300
320
|
const rule = {
|
|
301
321
|
type: data.type,
|
|
302
322
|
field: data.field,
|
|
@@ -307,7 +327,7 @@ var radio = {
|
|
|
307
327
|
},
|
|
308
328
|
options: data.options,
|
|
309
329
|
effect: {
|
|
310
|
-
required: data.effect.required && '请选择',
|
|
330
|
+
required: data.effect.required && (((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请选择'),
|
|
311
331
|
},
|
|
312
332
|
wrap: {
|
|
313
333
|
wrapperCol: {
|
|
@@ -320,6 +340,7 @@ var radio = {
|
|
|
320
340
|
return rule;
|
|
321
341
|
},
|
|
322
342
|
rowRule(data) {
|
|
343
|
+
var _a;
|
|
323
344
|
const rule = {
|
|
324
345
|
type: data.type,
|
|
325
346
|
field: data.field,
|
|
@@ -330,7 +351,7 @@ var radio = {
|
|
|
330
351
|
},
|
|
331
352
|
options: data.options,
|
|
332
353
|
effect: {
|
|
333
|
-
required: data.effect.required && '请选择',
|
|
354
|
+
required: data.effect.required && (((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请选择'),
|
|
334
355
|
},
|
|
335
356
|
col: {
|
|
336
357
|
span: fieldRatioMap[data.config.fieldRatio],
|
|
@@ -369,15 +390,16 @@ var radio = {
|
|
|
369
390
|
var checkbox = {
|
|
370
391
|
name: 'checkbox',
|
|
371
392
|
rule(data) {
|
|
393
|
+
var _a;
|
|
372
394
|
const extraProps = data.type === 'select' ? { mode: 'multiple' } : {};
|
|
373
395
|
return {
|
|
374
396
|
type: data.type,
|
|
375
397
|
field: data.field,
|
|
376
398
|
title: data.title.title,
|
|
377
|
-
props: Object.assign({ placeholder: data.props.placeholder, allowClear: true }, extraProps),
|
|
399
|
+
props: Object.assign({ placeholder: data.props.placeholder, allowClear: true, maxTagCount: data.props.maxTagCount, maxTagPlaceholder: data.props.maxTagPlaceholder }, extraProps),
|
|
378
400
|
options: data.options,
|
|
379
401
|
effect: {
|
|
380
|
-
required: data.effect.required && '请选择',
|
|
402
|
+
required: data.effect.required && (((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请选择'),
|
|
381
403
|
},
|
|
382
404
|
wrap: {
|
|
383
405
|
wrapperCol: {
|
|
@@ -388,15 +410,16 @@ var checkbox = {
|
|
|
388
410
|
};
|
|
389
411
|
},
|
|
390
412
|
rowRule(data) {
|
|
413
|
+
var _a;
|
|
391
414
|
const extraProps = data.type === 'select' ? { mode: 'multiple' } : {};
|
|
392
415
|
return {
|
|
393
416
|
type: data.type,
|
|
394
417
|
field: data.field,
|
|
395
418
|
title: data.title.title,
|
|
396
|
-
props: Object.assign({ placeholder: data.props.placeholder, allowClear: true }, extraProps),
|
|
419
|
+
props: Object.assign({ placeholder: data.props.placeholder, allowClear: true, maxTagCount: data.props.maxTagCount, maxTagPlaceholder: data.props.maxTagPlaceholder }, extraProps),
|
|
397
420
|
options: data.options,
|
|
398
421
|
effect: {
|
|
399
|
-
required: data.effect.required && '请选择',
|
|
422
|
+
required: data.effect.required && (((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请选择'),
|
|
400
423
|
},
|
|
401
424
|
col: {
|
|
402
425
|
span: fieldRatioMap[data.config.fieldRatio],
|
|
@@ -419,6 +442,8 @@ var checkbox = {
|
|
|
419
442
|
options: data.options,
|
|
420
443
|
mode: 'multiple',
|
|
421
444
|
allowClear: true,
|
|
445
|
+
maxTagCount: data.props.maxTagCount,
|
|
446
|
+
maxTagPlaceholder: data.props.maxTagPlaceholder,
|
|
422
447
|
getPopupContainer: getContainer,
|
|
423
448
|
disabled: data.disabled,
|
|
424
449
|
'onUpdate:value': (value) => {
|
|
@@ -434,6 +459,7 @@ var checkbox = {
|
|
|
434
459
|
var date = {
|
|
435
460
|
name: 'date',
|
|
436
461
|
rule(data) {
|
|
462
|
+
var _a;
|
|
437
463
|
const format = data.props.format;
|
|
438
464
|
const value = data.config.defaultValue || data.value
|
|
439
465
|
? data.value
|
|
@@ -449,7 +475,7 @@ var date = {
|
|
|
449
475
|
props: Object.assign({ format, valueFormat: format, placeholder: data.props.placeholder }, extraProps),
|
|
450
476
|
value,
|
|
451
477
|
effect: {
|
|
452
|
-
required: data.effect.required && '请选择',
|
|
478
|
+
required: data.effect.required && (((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请选择'),
|
|
453
479
|
},
|
|
454
480
|
wrap: {
|
|
455
481
|
wrapperCol: {
|
|
@@ -462,6 +488,7 @@ var date = {
|
|
|
462
488
|
};
|
|
463
489
|
},
|
|
464
490
|
rowRule(data) {
|
|
491
|
+
var _a;
|
|
465
492
|
const format = data.props.format;
|
|
466
493
|
const value = data.config.defaultValue || data.value
|
|
467
494
|
? data.value
|
|
@@ -477,7 +504,7 @@ var date = {
|
|
|
477
504
|
props: Object.assign({ format, valueFormat: format, placeholder: data.props.placeholder }, extraProps),
|
|
478
505
|
value,
|
|
479
506
|
effect: {
|
|
480
|
-
required: data.effect.required && '请选择',
|
|
507
|
+
required: data.effect.required && (((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请选择'),
|
|
481
508
|
},
|
|
482
509
|
col: {
|
|
483
510
|
span: fieldRatioMap[data.config.fieldRatio],
|
|
@@ -523,6 +550,7 @@ var date = {
|
|
|
523
550
|
var dateRange = {
|
|
524
551
|
name: 'dateRange',
|
|
525
552
|
rule(data) {
|
|
553
|
+
var _a;
|
|
526
554
|
const format = data.props.format;
|
|
527
555
|
const extraProps = {
|
|
528
556
|
picker: format === 'YYYY-MM' ? 'month' : '',
|
|
@@ -534,7 +562,7 @@ var dateRange = {
|
|
|
534
562
|
title: data.title.title,
|
|
535
563
|
props: Object.assign({ range: true, separator: '~', format, valueFormat: format, placeholder: data.props.placeholder, getCalendarContainer: getContainer, getPopupContainer: getContainer }, extraProps),
|
|
536
564
|
effect: {
|
|
537
|
-
required: data.effect.required && '请选择',
|
|
565
|
+
required: data.effect.required && (((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请选择'),
|
|
538
566
|
},
|
|
539
567
|
wrap: {
|
|
540
568
|
wrapperCol: {
|
|
@@ -548,6 +576,7 @@ var dateRange = {
|
|
|
548
576
|
};
|
|
549
577
|
},
|
|
550
578
|
rowRule(data) {
|
|
579
|
+
var _a;
|
|
551
580
|
const format = data.props.format;
|
|
552
581
|
const extraProps = {
|
|
553
582
|
picker: format === 'YYYY-MM' ? 'month' : '',
|
|
@@ -559,7 +588,7 @@ var dateRange = {
|
|
|
559
588
|
title: data.title.title,
|
|
560
589
|
props: Object.assign({ range: true, separator: '~', format, valueFormat: format, placeholder: data.props.placeholder }, extraProps),
|
|
561
590
|
effect: {
|
|
562
|
-
required: data.effect.required && '请选择',
|
|
591
|
+
required: data.effect.required && (((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请选择'),
|
|
563
592
|
},
|
|
564
593
|
col: {
|
|
565
594
|
span: fieldRatioMap[data.config.fieldRatio],
|
|
@@ -650,6 +679,7 @@ function __awaiter(thisArg, _arguments, P, generator) {
|
|
|
650
679
|
var picture = {
|
|
651
680
|
name: 'picture',
|
|
652
681
|
rule(data, extraConfig) {
|
|
682
|
+
var _a;
|
|
653
683
|
const maxCount = data.props.extraProps.maxCount;
|
|
654
684
|
return {
|
|
655
685
|
type: 'Picture',
|
|
@@ -682,7 +712,7 @@ var picture = {
|
|
|
682
712
|
required: data.effect.required,
|
|
683
713
|
type: 'array',
|
|
684
714
|
min: 1,
|
|
685
|
-
message: '请上传图片',
|
|
715
|
+
message: ((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请上传图片',
|
|
686
716
|
},
|
|
687
717
|
],
|
|
688
718
|
inject: true,
|
|
@@ -701,6 +731,7 @@ var picture = {
|
|
|
701
731
|
};
|
|
702
732
|
},
|
|
703
733
|
rowRule(data, extraConfig) {
|
|
734
|
+
var _a;
|
|
704
735
|
const maxCount = data.props.extraProps.maxCount;
|
|
705
736
|
return {
|
|
706
737
|
type: 'Picture',
|
|
@@ -730,7 +761,7 @@ var picture = {
|
|
|
730
761
|
required: data.effect.required,
|
|
731
762
|
type: 'array',
|
|
732
763
|
min: 1,
|
|
733
|
-
message: '请上传图片',
|
|
764
|
+
message: ((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请上传图片',
|
|
734
765
|
},
|
|
735
766
|
],
|
|
736
767
|
inject: true,
|
|
@@ -756,6 +787,7 @@ var picture = {
|
|
|
756
787
|
var file = {
|
|
757
788
|
name: 'file',
|
|
758
789
|
rule(data, extraConfig) {
|
|
790
|
+
var _a;
|
|
759
791
|
return {
|
|
760
792
|
type: 'Picture',
|
|
761
793
|
component: Picture__default["default"],
|
|
@@ -776,9 +808,14 @@ var file = {
|
|
|
776
808
|
validate: [
|
|
777
809
|
{
|
|
778
810
|
required: data.effect.required,
|
|
811
|
+
type: 'array',
|
|
812
|
+
min: 1,
|
|
813
|
+
message: ((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请上传附件',
|
|
814
|
+
},
|
|
815
|
+
{
|
|
779
816
|
type: 'array',
|
|
780
817
|
len: 1,
|
|
781
|
-
message: '
|
|
818
|
+
message: '附件数量不能超过1个',
|
|
782
819
|
},
|
|
783
820
|
],
|
|
784
821
|
inject: true,
|
|
@@ -797,6 +834,7 @@ var file = {
|
|
|
797
834
|
};
|
|
798
835
|
},
|
|
799
836
|
rowRule(data, extraConfig) {
|
|
837
|
+
var _a;
|
|
800
838
|
return {
|
|
801
839
|
type: 'Picture',
|
|
802
840
|
component: Picture__default["default"],
|
|
@@ -817,9 +855,14 @@ var file = {
|
|
|
817
855
|
validate: [
|
|
818
856
|
{
|
|
819
857
|
required: data.effect.required,
|
|
858
|
+
type: 'array',
|
|
859
|
+
min: 1,
|
|
860
|
+
message: ((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请上传附件',
|
|
861
|
+
},
|
|
862
|
+
{
|
|
820
863
|
type: 'array',
|
|
821
864
|
len: 1,
|
|
822
|
-
message: '
|
|
865
|
+
message: '附件数量不能超过1个',
|
|
823
866
|
},
|
|
824
867
|
],
|
|
825
868
|
inject: true,
|
|
@@ -913,7 +956,7 @@ var StaffSelector = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__file", "staff-
|
|
|
913
956
|
var people = {
|
|
914
957
|
name: 'people',
|
|
915
958
|
rule(data, extraConfig) {
|
|
916
|
-
var _a;
|
|
959
|
+
var _a, _b;
|
|
917
960
|
return {
|
|
918
961
|
type: 'StaffSelector',
|
|
919
962
|
component: StaffSelector,
|
|
@@ -932,7 +975,7 @@ var people = {
|
|
|
932
975
|
fieldNames: (_a = extraConfig.people) === null || _a === void 0 ? void 0 : _a.fieldNames,
|
|
933
976
|
},
|
|
934
977
|
effect: {
|
|
935
|
-
required: data.effect.required && '请选择',
|
|
978
|
+
required: data.effect.required && (((_b = data.effect) === null || _b === void 0 ? void 0 : _b.requiredTip) || '请选择'),
|
|
936
979
|
},
|
|
937
980
|
wrap: {
|
|
938
981
|
wrapperCol: {
|
|
@@ -941,21 +984,24 @@ var people = {
|
|
|
941
984
|
},
|
|
942
985
|
inject: true,
|
|
943
986
|
on: {
|
|
944
|
-
change(
|
|
945
|
-
const rule =
|
|
987
|
+
change({ api, self }, list) {
|
|
988
|
+
const rule = self;
|
|
946
989
|
rule.props.defaultSelected = list;
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
990
|
+
vue.nextTick(() => {
|
|
991
|
+
rule.props.defaultSelected = list;
|
|
992
|
+
api.form[rule.field] = list;
|
|
993
|
+
api.validateField(rule.field, () => {
|
|
994
|
+
if (list.length) {
|
|
995
|
+
api.clearValidateState(rule.field);
|
|
996
|
+
}
|
|
997
|
+
});
|
|
952
998
|
});
|
|
953
999
|
},
|
|
954
1000
|
},
|
|
955
1001
|
};
|
|
956
1002
|
},
|
|
957
1003
|
rowRule(data, extraConfig) {
|
|
958
|
-
var _a;
|
|
1004
|
+
var _a, _b;
|
|
959
1005
|
return {
|
|
960
1006
|
type: 'StaffSelector',
|
|
961
1007
|
component: StaffSelector,
|
|
@@ -974,21 +1020,24 @@ var people = {
|
|
|
974
1020
|
fieldNames: (_a = extraConfig.people) === null || _a === void 0 ? void 0 : _a.fieldNames,
|
|
975
1021
|
},
|
|
976
1022
|
effect: {
|
|
977
|
-
required: data.effect.required && '请选择',
|
|
1023
|
+
required: data.effect.required && (((_b = data.effect) === null || _b === void 0 ? void 0 : _b.requiredTip) || '请选择'),
|
|
978
1024
|
},
|
|
979
1025
|
col: {
|
|
980
1026
|
span: fieldRatioMap[data.config.fieldRatio],
|
|
981
1027
|
},
|
|
982
1028
|
inject: true,
|
|
983
1029
|
on: {
|
|
984
|
-
change(
|
|
985
|
-
const rule =
|
|
1030
|
+
change({ api, self }, list) {
|
|
1031
|
+
const rule = self;
|
|
986
1032
|
rule.props.defaultSelected = list;
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
1033
|
+
vue.nextTick(() => {
|
|
1034
|
+
rule.props.defaultSelected = list;
|
|
1035
|
+
api.form[rule.field] = list;
|
|
1036
|
+
api.validateField(rule.field, () => {
|
|
1037
|
+
if (list.length) {
|
|
1038
|
+
api.clearValidateState(rule.field);
|
|
1039
|
+
}
|
|
1040
|
+
});
|
|
992
1041
|
});
|
|
993
1042
|
},
|
|
994
1043
|
},
|
|
@@ -1118,8 +1167,8 @@ const _hoisted_5$4 = {
|
|
|
1118
1167
|
key: 1,
|
|
1119
1168
|
class: "bm-fc-select-material-temp__content__circle"
|
|
1120
1169
|
};
|
|
1121
|
-
const _hoisted_6$
|
|
1122
|
-
const _hoisted_7$
|
|
1170
|
+
const _hoisted_6$4 = ["title"];
|
|
1171
|
+
const _hoisted_7$4 = { class: "bm-fc-select-material-temp__content__item-time" };
|
|
1123
1172
|
const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
|
|
1124
1173
|
__name: "select-material-temp",
|
|
1125
1174
|
props: [
|
|
@@ -1334,9 +1383,9 @@ const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
|
|
|
1334
1383
|
vue.createElementVNode("span", {
|
|
1335
1384
|
class: "bm-fc-select-material-temp__content__name",
|
|
1336
1385
|
title: item.templateName
|
|
1337
|
-
}, vue.toDisplayString(item.templateName), 9, _hoisted_6$
|
|
1386
|
+
}, vue.toDisplayString(item.templateName), 9, _hoisted_6$4)
|
|
1338
1387
|
], 8, _hoisted_4$4),
|
|
1339
|
-
vue.createElementVNode("div", _hoisted_7$
|
|
1388
|
+
vue.createElementVNode("div", _hoisted_7$4, vue.toDisplayString(vue.unref(dayjs__default["default"])(item.lastUpdateTime).format("YYYY/MM/DD")), 1)
|
|
1340
1389
|
])
|
|
1341
1390
|
]),
|
|
1342
1391
|
_: 2
|
|
@@ -18573,8 +18622,14 @@ var lodash = {exports: {}};
|
|
|
18573
18622
|
|
|
18574
18623
|
const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
|
|
18575
18624
|
__name: "product-input-in-table",
|
|
18576
|
-
props: [
|
|
18577
|
-
|
|
18625
|
+
props: [
|
|
18626
|
+
"value",
|
|
18627
|
+
"disabled",
|
|
18628
|
+
"shopValue",
|
|
18629
|
+
"doNotClearAfterFilterChange",
|
|
18630
|
+
"fetchMode"
|
|
18631
|
+
],
|
|
18632
|
+
emits: ["change", "blur", "pressEnter"],
|
|
18578
18633
|
setup(__props, { emit: emits }) {
|
|
18579
18634
|
const props = __props;
|
|
18580
18635
|
const debounceFn = lodash.exports.debounce(emitChange, 500);
|
|
@@ -18582,6 +18637,12 @@ const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
|
|
|
18582
18637
|
function emitChange(val) {
|
|
18583
18638
|
emits("change", val);
|
|
18584
18639
|
}
|
|
18640
|
+
function handleBlur(val) {
|
|
18641
|
+
emits("blur", val);
|
|
18642
|
+
}
|
|
18643
|
+
function handlePressEnter(val) {
|
|
18644
|
+
emits("pressEnter", val);
|
|
18645
|
+
}
|
|
18585
18646
|
vue.watch(
|
|
18586
18647
|
() => props.value,
|
|
18587
18648
|
(val) => {
|
|
@@ -18594,17 +18655,29 @@ const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
|
|
|
18594
18655
|
vue.watch(
|
|
18595
18656
|
() => props.shopValue,
|
|
18596
18657
|
() => {
|
|
18597
|
-
|
|
18658
|
+
if (!props.doNotClearAfterFilterChange) {
|
|
18659
|
+
emitChange("");
|
|
18660
|
+
}
|
|
18598
18661
|
}
|
|
18599
18662
|
);
|
|
18600
18663
|
return (_ctx, _cache) => {
|
|
18601
|
-
return vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.Input), {
|
|
18664
|
+
return props.fetchMode === "blur" ? (vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.Input), {
|
|
18665
|
+
key: 0,
|
|
18602
18666
|
value: inputValue.value,
|
|
18603
18667
|
"onUpdate:value": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event),
|
|
18604
18668
|
placeholder: "\u8BF7\u8F93\u5165",
|
|
18605
18669
|
disabled: __props.disabled,
|
|
18606
|
-
onChange: _cache[1] || (_cache[1] = ($event) =>
|
|
18607
|
-
|
|
18670
|
+
onChange: _cache[1] || (_cache[1] = ($event) => emitChange($event.target.value)),
|
|
18671
|
+
onBlur: _cache[2] || (_cache[2] = ($event) => handleBlur($event.target?.value)),
|
|
18672
|
+
onPressEnter: _cache[3] || (_cache[3] = ($event) => handlePressEnter($event.target?.value))
|
|
18673
|
+
}, null, 8, ["value", "disabled"])) : (vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.Input), {
|
|
18674
|
+
key: 1,
|
|
18675
|
+
value: inputValue.value,
|
|
18676
|
+
"onUpdate:value": _cache[4] || (_cache[4] = ($event) => inputValue.value = $event),
|
|
18677
|
+
placeholder: "\u8BF7\u8F93\u5165",
|
|
18678
|
+
disabled: __props.disabled,
|
|
18679
|
+
onChange: _cache[5] || (_cache[5] = ($event) => vue.unref(debounceFn)($event.target.value))
|
|
18680
|
+
}, null, 8, ["value", "disabled"]));
|
|
18608
18681
|
};
|
|
18609
18682
|
}
|
|
18610
18683
|
});
|
|
@@ -18613,14 +18686,20 @@ var ProductInput = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__file", "product
|
|
|
18613
18686
|
const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
|
|
18614
18687
|
__name: "customer-input-in-table",
|
|
18615
18688
|
props: ["value", "disabled", "shopValue"],
|
|
18616
|
-
emits: ["change"],
|
|
18689
|
+
emits: ["change", "blur", "pressEnter"],
|
|
18617
18690
|
setup(__props, { emit: emits }) {
|
|
18618
18691
|
const props = __props;
|
|
18619
|
-
|
|
18692
|
+
lodash.exports.debounce(emitChange, 500);
|
|
18620
18693
|
const inputValue = vue.ref();
|
|
18621
18694
|
function emitChange(val) {
|
|
18622
18695
|
emits("change", val);
|
|
18623
18696
|
}
|
|
18697
|
+
function handleBlur(val) {
|
|
18698
|
+
emits("blur", val);
|
|
18699
|
+
}
|
|
18700
|
+
function handlePressEnter(val) {
|
|
18701
|
+
emits("pressEnter", val);
|
|
18702
|
+
}
|
|
18624
18703
|
vue.watch(
|
|
18625
18704
|
() => props.value,
|
|
18626
18705
|
(val) => {
|
|
@@ -18642,7 +18721,9 @@ const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
|
|
|
18642
18721
|
"onUpdate:value": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event),
|
|
18643
18722
|
placeholder: "\u8BF7\u8F93\u5165",
|
|
18644
18723
|
disabled: __props.disabled,
|
|
18645
|
-
onChange: _cache[1] || (_cache[1] = ($event) =>
|
|
18724
|
+
onChange: _cache[1] || (_cache[1] = ($event) => emitChange($event.target.value)),
|
|
18725
|
+
onBlur: _cache[2] || (_cache[2] = ($event) => handleBlur($event.target?.value)),
|
|
18726
|
+
onPressEnter: _cache[3] || (_cache[3] = ($event) => handlePressEnter($event.target?.value))
|
|
18646
18727
|
}, null, 8, ["value", "disabled"]);
|
|
18647
18728
|
};
|
|
18648
18729
|
}
|
|
@@ -18731,9 +18812,17 @@ var ShopInput = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__file", "shop-input
|
|
|
18731
18812
|
const _hoisted_1$5 = { class: "bm-dc-table-widget" };
|
|
18732
18813
|
const _hoisted_2$4 = { class: "bm-dc-table-widget__title" };
|
|
18733
18814
|
const _hoisted_3$3 = { class: "bm-dc-table-widget__title-samll" };
|
|
18734
|
-
const _hoisted_4$3 = {
|
|
18735
|
-
|
|
18736
|
-
|
|
18815
|
+
const _hoisted_4$3 = {
|
|
18816
|
+
key: 0,
|
|
18817
|
+
class: "bm-dc-table-widget__top-bar"
|
|
18818
|
+
};
|
|
18819
|
+
const _hoisted_5$3 = ["accept"];
|
|
18820
|
+
const _hoisted_6$3 = {
|
|
18821
|
+
key: 1,
|
|
18822
|
+
class: "bm-dc-table-widget__top-bar"
|
|
18823
|
+
};
|
|
18824
|
+
const _hoisted_7$3 = { class: "bm-dc-table-widget__table" };
|
|
18825
|
+
const _sfc_main$7 = vue.defineComponent({
|
|
18737
18826
|
__name: "table-widget",
|
|
18738
18827
|
props: [
|
|
18739
18828
|
"rule",
|
|
@@ -18754,15 +18843,20 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
|
18754
18843
|
\u5EFA\u8BAE\u96F6\u552E\u4EF7: "retailPrice",
|
|
18755
18844
|
\u5546\u54C1\u7BB1\u89C4: "carton",
|
|
18756
18845
|
\u5546\u54C1\u5355\u4F4D: "unit",
|
|
18846
|
+
\u4E00\u7EA7\u5206\u7C7B: "categoryFirst",
|
|
18847
|
+
\u4E8C\u7EA7\u5206\u7C7B: "categorySecond",
|
|
18848
|
+
\u4E09\u7EA7\u5206\u7C7B: "categoryThrid",
|
|
18849
|
+
\u5546\u54C1\u7C7B\u578B: "productType",
|
|
18850
|
+
\u5546\u54C1\u6807\u7B7E: "productTag",
|
|
18757
18851
|
\u5E97\u94FA\u6240\u5C5E\u5E73\u53F0: "platformName",
|
|
18758
18852
|
\u6E20\u9053: "channelName",
|
|
18759
18853
|
\u6E20\u9053\u7C7B\u522B: "channelTypeName",
|
|
18760
|
-
\u5BA2\u6237\u7B80\u79F0: "",
|
|
18761
|
-
\u5BA2\u6237\u7C7B\u578B: "",
|
|
18762
|
-
\u5BA2\u6237\u7B49\u7EA7: "",
|
|
18763
|
-
\u6240\u5C5E\u5E97\u94FA: "",
|
|
18764
|
-
\u5E97\u94FA\u7F16\u53F7: "",
|
|
18765
|
-
SAP\u5BA2\u6237\u7F16\u53F7: ""
|
|
18854
|
+
\u5BA2\u6237\u7B80\u79F0: "clientShortName",
|
|
18855
|
+
\u5BA2\u6237\u7C7B\u578B: "b2bType",
|
|
18856
|
+
\u5BA2\u6237\u7B49\u7EA7: "b2bLevel",
|
|
18857
|
+
\u6240\u5C5E\u5E97\u94FA: "shopName",
|
|
18858
|
+
\u5E97\u94FA\u7F16\u53F7: "shopCode",
|
|
18859
|
+
SAP\u5BA2\u6237\u7F16\u53F7: "sapCode"
|
|
18766
18860
|
};
|
|
18767
18861
|
let indexMap = {
|
|
18768
18862
|
product: 0,
|
|
@@ -18778,6 +18872,7 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
|
18778
18872
|
const columns = vue.reactive([]);
|
|
18779
18873
|
const data = vue.reactive([]);
|
|
18780
18874
|
const config = vue.computed(() => ({
|
|
18875
|
+
...props.rule?.config?.tableConfig,
|
|
18781
18876
|
columns: [...columns],
|
|
18782
18877
|
data: [...data],
|
|
18783
18878
|
columnConfig: {
|
|
@@ -18790,8 +18885,36 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
|
18790
18885
|
}
|
|
18791
18886
|
}
|
|
18792
18887
|
}));
|
|
18888
|
+
const xGrid = vue.computed(() => bmFloatTableRef.value.xGrid || {});
|
|
18889
|
+
const inputRef = vue.ref();
|
|
18890
|
+
const childRulesMap = vue.computed(
|
|
18891
|
+
() => props.rule?.config?.childRules.reduce((result, item) => {
|
|
18892
|
+
result[item.field] = item;
|
|
18893
|
+
return result;
|
|
18894
|
+
}, {}) || {}
|
|
18895
|
+
);
|
|
18896
|
+
const productInputSlots = vue.reactive([]);
|
|
18897
|
+
const shopInputSlots = vue.reactive([]);
|
|
18898
|
+
const customerInputSlots = vue.reactive([]);
|
|
18899
|
+
const formData = vue.computed(
|
|
18900
|
+
() => props.formData || props.formCreateInject.api.bind()
|
|
18901
|
+
);
|
|
18902
|
+
const tableConfig = vue.computed(() => props.rule?.config?.tableConfig || {});
|
|
18903
|
+
const validColumns = vue.computed(() => columns.filter((c) => isValidColumn(c)));
|
|
18904
|
+
const isProductCenter = vue.computed(
|
|
18905
|
+
() => tableConfig.value.system === "productCenter"
|
|
18906
|
+
);
|
|
18907
|
+
const isProductCenterSuit = vue.computed(
|
|
18908
|
+
() => isProductCenter.value && [
|
|
18909
|
+
"F2CTemplate",
|
|
18910
|
+
"B2CTemplate",
|
|
18911
|
+
"DistributeTemp",
|
|
18912
|
+
"FreshTemplate",
|
|
18913
|
+
"activityApply"
|
|
18914
|
+
].includes(tableConfig.value.template)
|
|
18915
|
+
);
|
|
18793
18916
|
const countText = vue.computed(() => {
|
|
18794
|
-
|
|
18917
|
+
let cache = {};
|
|
18795
18918
|
props.rule.config.childRules?.forEach((rule) => {
|
|
18796
18919
|
if (rule.name === "numInput" && rule.config.count) {
|
|
18797
18920
|
cache[rule.field] = { title: rule.title.title, count: 0 };
|
|
@@ -18803,30 +18926,31 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
|
18803
18926
|
cache[key].count += row[key];
|
|
18804
18927
|
});
|
|
18805
18928
|
});
|
|
18806
|
-
if (
|
|
18929
|
+
if (props.rule.config.showTotal) {
|
|
18930
|
+
cache = {
|
|
18931
|
+
_total: { title: "\u884C\u6570", count: data?.length || 0 },
|
|
18932
|
+
...cache
|
|
18933
|
+
};
|
|
18934
|
+
}
|
|
18935
|
+
if (Object.keys(cache).length) {
|
|
18936
|
+
if (isProductCenter.value) {
|
|
18937
|
+
return `\uFF08${Object.values(cache).reduce((pre, cur, index) => {
|
|
18938
|
+
if (index !== 0)
|
|
18939
|
+
pre += "\u3001";
|
|
18940
|
+
pre += `${cur.title}\u603B\u8BA1\uFF1A${cur.count}`;
|
|
18941
|
+
return pre;
|
|
18942
|
+
}, "")}\uFF09`;
|
|
18943
|
+
}
|
|
18807
18944
|
return `\uFF08\u5B57\u6BB5\u540D\u603B\u8BA1\uFF1A${Object.values(cache).reduce((pre, cur, index) => {
|
|
18808
18945
|
if (index !== 0)
|
|
18809
18946
|
pre += "\u3001";
|
|
18810
18947
|
pre += `${cur.title}\uFF1A${cur.count}`;
|
|
18811
18948
|
return pre;
|
|
18812
18949
|
}, "")}\uFF09`;
|
|
18813
|
-
else
|
|
18950
|
+
} else {
|
|
18814
18951
|
return "";
|
|
18952
|
+
}
|
|
18815
18953
|
});
|
|
18816
|
-
const xGrid = vue.computed(() => bmFloatTableRef.value.xGrid || {});
|
|
18817
|
-
const inputRef = vue.ref();
|
|
18818
|
-
const childRulesMap = vue.computed(
|
|
18819
|
-
() => props.rule?.config?.childRules.reduce((result, item) => {
|
|
18820
|
-
result[item.field] = item;
|
|
18821
|
-
return result;
|
|
18822
|
-
}, {}) || {}
|
|
18823
|
-
);
|
|
18824
|
-
const productInputSlots = vue.reactive([]);
|
|
18825
|
-
const shopInputSlots = vue.reactive([]);
|
|
18826
|
-
const customerInputSlots = vue.reactive([]);
|
|
18827
|
-
const formData = vue.computed(
|
|
18828
|
-
() => props.formData || props.formCreateInject.api.bind()
|
|
18829
|
-
);
|
|
18830
18954
|
function isShow(key) {
|
|
18831
18955
|
return props.rule.config.tableAdvancedFeatures.includes(key);
|
|
18832
18956
|
}
|
|
@@ -18844,6 +18968,14 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
|
18844
18968
|
width: "54px"
|
|
18845
18969
|
});
|
|
18846
18970
|
}
|
|
18971
|
+
if (isProductCenterSuit.value) {
|
|
18972
|
+
columns.push({
|
|
18973
|
+
type: "seq",
|
|
18974
|
+
title: "\u5E8F\u53F7",
|
|
18975
|
+
width: "62px",
|
|
18976
|
+
align: "center"
|
|
18977
|
+
});
|
|
18978
|
+
}
|
|
18847
18979
|
childRules?.length && columns.push(
|
|
18848
18980
|
...childRules.reduce((pre, cur) => {
|
|
18849
18981
|
if (cur.hidden) {
|
|
@@ -18853,7 +18985,40 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
|
18853
18985
|
if (Object.keys(indexMap).includes(name)) {
|
|
18854
18986
|
pre.push(...getExtraColumns(cur));
|
|
18855
18987
|
} else {
|
|
18856
|
-
|
|
18988
|
+
let childField = cur.field;
|
|
18989
|
+
let title = cur.title?.title;
|
|
18990
|
+
if (isProductCenter.value && cur.field === "picUrl") {
|
|
18991
|
+
pre.push({
|
|
18992
|
+
field: childField,
|
|
18993
|
+
title,
|
|
18994
|
+
minWidth: "138px",
|
|
18995
|
+
slots: {
|
|
18996
|
+
default({ row }) {
|
|
18997
|
+
if (row?.[childField]) {
|
|
18998
|
+
return vue.h("img", {
|
|
18999
|
+
src: props.extraConfig.common.previewImg(row[childField]),
|
|
19000
|
+
style: {
|
|
19001
|
+
width: "86px",
|
|
19002
|
+
height: "86px",
|
|
19003
|
+
padding: "8px"
|
|
19004
|
+
}
|
|
19005
|
+
});
|
|
19006
|
+
}
|
|
19007
|
+
return vue.h(
|
|
19008
|
+
"div",
|
|
19009
|
+
{
|
|
19010
|
+
style: {
|
|
19011
|
+
color: "#9393A3"
|
|
19012
|
+
}
|
|
19013
|
+
},
|
|
19014
|
+
["\u7CFB\u7EDF\u81EA\u52A8\u83B7\u53D6"]
|
|
19015
|
+
);
|
|
19016
|
+
}
|
|
19017
|
+
}
|
|
19018
|
+
});
|
|
19019
|
+
} else {
|
|
19020
|
+
pre.push(ruleList[name].tableRule(cur, props.extraConfig));
|
|
19021
|
+
}
|
|
18857
19022
|
}
|
|
18858
19023
|
return pre;
|
|
18859
19024
|
}, [])
|
|
@@ -18899,10 +19064,25 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
|
18899
19064
|
const field = rule.field;
|
|
18900
19065
|
const associatedFields = rule.config.associatedFields;
|
|
18901
19066
|
configObj.slots.push(rule);
|
|
19067
|
+
function getBaseTitle() {
|
|
19068
|
+
let baseTitle = mainName;
|
|
19069
|
+
if (rule.name === "product") {
|
|
19070
|
+
baseTitle = `\u5546\u54C1\u7F16\u7801-${mainName}`;
|
|
19071
|
+
if (isProductCenterSuit.value && rule.field === "productCode") {
|
|
19072
|
+
baseTitle = "\u5546\u54C1\u7F16\u53F7";
|
|
19073
|
+
}
|
|
19074
|
+
} else if (rule.name === "customer") {
|
|
19075
|
+
baseTitle = `\u5BA2\u6237\u7F16\u53F7-${mainName}`;
|
|
19076
|
+
if (isProductCenterSuit.value && rule.field === "clientCode") {
|
|
19077
|
+
baseTitle = "\u5BA2\u6237\u7F16\u53F7";
|
|
19078
|
+
}
|
|
19079
|
+
}
|
|
19080
|
+
return baseTitle;
|
|
19081
|
+
}
|
|
18902
19082
|
const columns2 = [
|
|
18903
19083
|
{
|
|
18904
19084
|
field,
|
|
18905
|
-
title:
|
|
19085
|
+
title: getBaseTitle(),
|
|
18906
19086
|
headerClassName: rule.effect.required ? "is-required" : "",
|
|
18907
19087
|
minWidth: "138px",
|
|
18908
19088
|
slots: {
|
|
@@ -18910,7 +19090,7 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
|
18910
19090
|
}
|
|
18911
19091
|
}
|
|
18912
19092
|
];
|
|
18913
|
-
if (associatedFields
|
|
19093
|
+
if (associatedFields?.length) {
|
|
18914
19094
|
associatedFields.forEach((item) => {
|
|
18915
19095
|
const childField = productPicName(item.value, field);
|
|
18916
19096
|
columns2.push({
|
|
@@ -18936,7 +19116,7 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
|
18936
19116
|
color: "#9393A3"
|
|
18937
19117
|
}
|
|
18938
19118
|
},
|
|
18939
|
-
[row[childField] || "\u7CFB\u7EDF\u81EA\u52A8\
|
|
19119
|
+
[row[childField] || "\u7CFB\u7EDF\u81EA\u52A8\u83B7\u53D6"]
|
|
18940
19120
|
);
|
|
18941
19121
|
}
|
|
18942
19122
|
}
|
|
@@ -18946,22 +19126,50 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
|
18946
19126
|
return columns2;
|
|
18947
19127
|
}
|
|
18948
19128
|
function handleAdd(rowData) {
|
|
18949
|
-
|
|
19129
|
+
let defaultRowData = getRowData();
|
|
19130
|
+
if (Array.isArray(rowData)) {
|
|
19131
|
+
rowData.forEach((item) => {
|
|
19132
|
+
Object.keys(defaultRowData).forEach((field) => {
|
|
19133
|
+
if (item[field] === void 0) {
|
|
19134
|
+
item[field] = defaultRowData[field];
|
|
19135
|
+
}
|
|
19136
|
+
});
|
|
19137
|
+
});
|
|
19138
|
+
}
|
|
19139
|
+
Array.isArray(rowData) ? data.push(...rowData) : data.push(defaultRowData);
|
|
18950
19140
|
}
|
|
18951
19141
|
function handleCopy(row) {
|
|
18952
19142
|
const newData = lodashEs.cloneDeep(row);
|
|
18953
19143
|
delete newData._X_ROW_KEY;
|
|
18954
19144
|
data.push(newData);
|
|
18955
19145
|
}
|
|
18956
|
-
function handleDelete(index) {
|
|
18957
|
-
|
|
19146
|
+
async function handleDelete(index, needConfirm = true) {
|
|
19147
|
+
if (isProductCenter.value && needConfirm) {
|
|
19148
|
+
if (await utils__default["default"].confirmModal("\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u9879\uFF1F")) {
|
|
19149
|
+
data.splice(index, 1);
|
|
19150
|
+
}
|
|
19151
|
+
} else {
|
|
19152
|
+
data.splice(index, 1);
|
|
19153
|
+
}
|
|
18958
19154
|
}
|
|
18959
|
-
function handleBatchDelete() {
|
|
19155
|
+
async function handleBatchDelete() {
|
|
18960
19156
|
const selected = xGrid.value.getCheckboxRecords();
|
|
18961
|
-
selected
|
|
18962
|
-
|
|
18963
|
-
|
|
18964
|
-
|
|
19157
|
+
if (!selected?.length) {
|
|
19158
|
+
return;
|
|
19159
|
+
}
|
|
19160
|
+
if (isProductCenter.value) {
|
|
19161
|
+
if (await utils__default["default"].confirmModal(`\u786E\u5B9A\u8981\u5220\u9664\u6240\u9009\u7684${selected?.length}\u6761\u6570\u636E\u4E48\uFF1F`)) {
|
|
19162
|
+
selected.forEach((item) => {
|
|
19163
|
+
const index = data.indexOf(item);
|
|
19164
|
+
handleDelete(index, false);
|
|
19165
|
+
});
|
|
19166
|
+
}
|
|
19167
|
+
} else {
|
|
19168
|
+
selected.forEach((item) => {
|
|
19169
|
+
const index = data.indexOf(item);
|
|
19170
|
+
handleDelete(index, false);
|
|
19171
|
+
});
|
|
19172
|
+
}
|
|
18965
19173
|
}
|
|
18966
19174
|
function handleDownload() {
|
|
18967
19175
|
xGrid.value.exportData({
|
|
@@ -18972,9 +19180,18 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
|
18972
19180
|
}
|
|
18973
19181
|
});
|
|
18974
19182
|
}
|
|
18975
|
-
function handleImport() {
|
|
19183
|
+
async function handleImport() {
|
|
18976
19184
|
if (importDisabled()) {
|
|
18977
19185
|
antDesignVue.message.error("\u8BF7\u5148\u9009\u62E9\u5E97\u94FA\uFF01");
|
|
19186
|
+
} else if (isProductCenterSuit.value) {
|
|
19187
|
+
if (data.length > 0) {
|
|
19188
|
+
if (await utils__default["default"].confirmModal("\u518D\u6B21\u6279\u5BFC\u4F1A\u8986\u76D6\u5DF2\u6709\u6570\u636E")) {
|
|
19189
|
+
data.splice(0, data.length);
|
|
19190
|
+
inputRef.value.click();
|
|
19191
|
+
}
|
|
19192
|
+
} else {
|
|
19193
|
+
inputRef.value.click();
|
|
19194
|
+
}
|
|
18978
19195
|
} else {
|
|
18979
19196
|
inputRef.value.click();
|
|
18980
19197
|
}
|
|
@@ -18993,6 +19210,7 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
|
18993
19210
|
async function queryProductInfo(rule, row) {
|
|
18994
19211
|
const field = rule.field;
|
|
18995
19212
|
const associatedFields = rule?.config?.associatedFields;
|
|
19213
|
+
const otherAssociatedFields = rule?.config?.otherAssociatedFields;
|
|
18996
19214
|
let result = void 0;
|
|
18997
19215
|
try {
|
|
18998
19216
|
if (row[field]) {
|
|
@@ -19005,10 +19223,37 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
|
19005
19223
|
}
|
|
19006
19224
|
}
|
|
19007
19225
|
processAssociatedFields(field, associatedFields, row, result);
|
|
19226
|
+
processOtherAssociatedFields(field, otherAssociatedFields, row, result);
|
|
19227
|
+
return result;
|
|
19228
|
+
} catch (e) {
|
|
19229
|
+
row[field] = "";
|
|
19230
|
+
processAssociatedFields(field, associatedFields, row, result);
|
|
19231
|
+
processOtherAssociatedFields(field, otherAssociatedFields, row, result);
|
|
19232
|
+
return Promise.resolve(result);
|
|
19233
|
+
}
|
|
19234
|
+
}
|
|
19235
|
+
async function queryCustomerInfo(rule, row) {
|
|
19236
|
+
const field = rule.field;
|
|
19237
|
+
const associatedFields = rule?.config?.associatedFields;
|
|
19238
|
+
const otherAssociatedFields = rule?.config?.otherAssociatedFields;
|
|
19239
|
+
let result = void 0;
|
|
19240
|
+
try {
|
|
19241
|
+
if (row[field]) {
|
|
19242
|
+
result = await props.extraConfig.customer?.fetch({
|
|
19243
|
+
clientCode: row[field],
|
|
19244
|
+
filterByShopcode: rule?.config?.dataFiltering
|
|
19245
|
+
});
|
|
19246
|
+
if (!result) {
|
|
19247
|
+
row[field] = "";
|
|
19248
|
+
}
|
|
19249
|
+
}
|
|
19250
|
+
processAssociatedFields(field, associatedFields, row, result);
|
|
19251
|
+
processOtherAssociatedFields(field, otherAssociatedFields, row, result);
|
|
19008
19252
|
return result;
|
|
19009
19253
|
} catch (e) {
|
|
19010
19254
|
row[field] = "";
|
|
19011
19255
|
processAssociatedFields(field, associatedFields, row, result);
|
|
19256
|
+
processOtherAssociatedFields(field, otherAssociatedFields, row, result);
|
|
19012
19257
|
return Promise.resolve(result);
|
|
19013
19258
|
}
|
|
19014
19259
|
}
|
|
@@ -19018,17 +19263,24 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
|
19018
19263
|
row[productPicName(item.value, field)] = result ? result[accosiationParseKeyMap[item.value]] : void 0;
|
|
19019
19264
|
});
|
|
19020
19265
|
}
|
|
19266
|
+
function processOtherAssociatedFields(field, fields, row, result) {
|
|
19267
|
+
if (isProductCenterSuit.value) {
|
|
19268
|
+
fields?.forEach?.((item) => {
|
|
19269
|
+
row[item] = result ? result[item] : void 0;
|
|
19270
|
+
});
|
|
19271
|
+
}
|
|
19272
|
+
}
|
|
19021
19273
|
function handleChange(e) {
|
|
19022
19274
|
const file = e.target.files[0];
|
|
19023
19275
|
const reader = new FileReader();
|
|
19024
19276
|
reader.onload = (fr) => {
|
|
19025
19277
|
const rows = parseCsv(fr?.target?.result);
|
|
19026
|
-
const
|
|
19278
|
+
const validColumns2 = columns.filter((c) => isValidColumn(c));
|
|
19027
19279
|
const result = [];
|
|
19028
19280
|
rows.forEach((row) => {
|
|
19029
19281
|
const rowData = {};
|
|
19030
19282
|
row.forEach((item, index) => {
|
|
19031
|
-
rowData[
|
|
19283
|
+
rowData[validColumns2[index].field] = item;
|
|
19032
19284
|
});
|
|
19033
19285
|
result.push(rowData);
|
|
19034
19286
|
});
|
|
@@ -19045,7 +19297,7 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
|
19045
19297
|
file && reader.readAsText(file, "GB2312");
|
|
19046
19298
|
}
|
|
19047
19299
|
function isValidColumn(c) {
|
|
19048
|
-
return c.type !== "checkbox" && c.field !== oper;
|
|
19300
|
+
return c.type !== "checkbox" && c.type !== "seq" && c.field !== oper;
|
|
19049
19301
|
}
|
|
19050
19302
|
function parseCsv(result) {
|
|
19051
19303
|
let data2 = [];
|
|
@@ -19065,9 +19317,9 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
|
19065
19317
|
}
|
|
19066
19318
|
async function validate(rowData) {
|
|
19067
19319
|
let error = "";
|
|
19068
|
-
const
|
|
19320
|
+
const validColumns2 = columns.filter((c) => isValidColumn(c));
|
|
19069
19321
|
for (const row of rowData) {
|
|
19070
|
-
for (const { field } of
|
|
19322
|
+
for (const { field } of validColumns2) {
|
|
19071
19323
|
const rule = childRulesMap.value[`${field}`];
|
|
19072
19324
|
const title = rule?.title?.title;
|
|
19073
19325
|
if (!rule)
|
|
@@ -19204,6 +19456,18 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
|
19204
19456
|
break;
|
|
19205
19457
|
}
|
|
19206
19458
|
}
|
|
19459
|
+
if (rule.name === "customer") {
|
|
19460
|
+
try {
|
|
19461
|
+
const productInfo = await queryCustomerInfo(rule, row);
|
|
19462
|
+
if (!productInfo) {
|
|
19463
|
+
error = `${title}\u67E5\u8BE2\u7684\u5BA2\u6237\u4E0D\u5B58\u5728`;
|
|
19464
|
+
break;
|
|
19465
|
+
}
|
|
19466
|
+
} catch (e) {
|
|
19467
|
+
error = `${title}\u67E5\u8BE2\u7684\u5BA2\u6237\u4E0D\u5B58\u5728`;
|
|
19468
|
+
break;
|
|
19469
|
+
}
|
|
19470
|
+
}
|
|
19207
19471
|
if (rule.name === "shop") {
|
|
19208
19472
|
try {
|
|
19209
19473
|
const shopInfo = await props.extraConfig[rule.name].getShopInfo({
|
|
@@ -19245,10 +19509,30 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
|
19245
19509
|
return false;
|
|
19246
19510
|
return !formData.value[shopField];
|
|
19247
19511
|
}
|
|
19248
|
-
function
|
|
19512
|
+
function handleProductChange(value, rule, row) {
|
|
19513
|
+
row[rule.field] = value;
|
|
19514
|
+
if (isProductCenterSuit.value && rule.field === "productCode") {
|
|
19515
|
+
Object.keys(row).forEach((key) => {
|
|
19516
|
+
if (!["productCode", "_X_ROW_KEY"].includes(key)) {
|
|
19517
|
+
row[key] = void 0;
|
|
19518
|
+
}
|
|
19519
|
+
});
|
|
19520
|
+
}
|
|
19521
|
+
if (rule.config.fetchMode !== "blur") {
|
|
19522
|
+
queryProductInfo(rule, row);
|
|
19523
|
+
}
|
|
19524
|
+
}
|
|
19525
|
+
function handleProductPressEnter(value, rule, row) {
|
|
19249
19526
|
row[rule.field] = value;
|
|
19250
19527
|
queryProductInfo(rule, row);
|
|
19251
19528
|
}
|
|
19529
|
+
function handleCustomerChange(value, rule, row) {
|
|
19530
|
+
row[rule.field] = value;
|
|
19531
|
+
}
|
|
19532
|
+
function handleCustomerPressEnter(value, rule, row) {
|
|
19533
|
+
row[rule.field] = value;
|
|
19534
|
+
queryCustomerInfo(rule, row);
|
|
19535
|
+
}
|
|
19252
19536
|
function handleShopOption(value, rule, row) {
|
|
19253
19537
|
row[rule?.field] = value;
|
|
19254
19538
|
processAssociatedFields(
|
|
@@ -19259,7 +19543,7 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
|
19259
19543
|
);
|
|
19260
19544
|
}
|
|
19261
19545
|
function importDisabled() {
|
|
19262
|
-
return productInputSlots.filter((item) => item.config?.dataFiltering).some((item) => !formData.value[item.config.dataFiltering]);
|
|
19546
|
+
return productInputSlots.filter((item) => item.config?.dataFiltering).some((item) => !formData.value[item.config.dataFiltering]) || props.rule?.config?.dataFiltering && !formData.value[props.rule?.config?.dataFiltering];
|
|
19263
19547
|
}
|
|
19264
19548
|
vue.watch(
|
|
19265
19549
|
() => props.rule,
|
|
@@ -19279,77 +19563,276 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
|
19279
19563
|
deep: true
|
|
19280
19564
|
}
|
|
19281
19565
|
);
|
|
19566
|
+
const buttonLoadingForProductCenter = vue.ref({
|
|
19567
|
+
export: false,
|
|
19568
|
+
download: false,
|
|
19569
|
+
import: false
|
|
19570
|
+
});
|
|
19571
|
+
async function exportForProductCenter() {
|
|
19572
|
+
if (!tableConfig.value.template || tableConfig.value.template === "table") {
|
|
19573
|
+
return handleExport();
|
|
19574
|
+
}
|
|
19575
|
+
try {
|
|
19576
|
+
buttonLoadingForProductCenter.value.export = true;
|
|
19577
|
+
const selected = xGrid.value?.getCheckboxRecords?.();
|
|
19578
|
+
await props.extraConfig.table?.exportFetch?.({
|
|
19579
|
+
tableConfig: tableConfig.value,
|
|
19580
|
+
columns: validColumns.value,
|
|
19581
|
+
data: selected
|
|
19582
|
+
});
|
|
19583
|
+
} catch (error) {
|
|
19584
|
+
console.log("\u{1F680} ~ error:", error);
|
|
19585
|
+
} finally {
|
|
19586
|
+
buttonLoadingForProductCenter.value.export = false;
|
|
19587
|
+
}
|
|
19588
|
+
}
|
|
19589
|
+
async function downloadTemplateForProductCenter() {
|
|
19590
|
+
if (!tableConfig.value.template || tableConfig.value.template === "table") {
|
|
19591
|
+
return handleDownload();
|
|
19592
|
+
}
|
|
19593
|
+
try {
|
|
19594
|
+
buttonLoadingForProductCenter.value.download = true;
|
|
19595
|
+
await props.extraConfig.table?.downloadTemplateFetch?.({
|
|
19596
|
+
tableConfig: tableConfig.value,
|
|
19597
|
+
tableRules: props.rule.config.childRules,
|
|
19598
|
+
columns: validColumns.value
|
|
19599
|
+
});
|
|
19600
|
+
} catch (error) {
|
|
19601
|
+
console.log("\u{1F680} ~ error:", error);
|
|
19602
|
+
} finally {
|
|
19603
|
+
buttonLoadingForProductCenter.value.download = false;
|
|
19604
|
+
}
|
|
19605
|
+
}
|
|
19606
|
+
async function importHandleForProductCenter(e) {
|
|
19607
|
+
if (!tableConfig.value.template || tableConfig.value.template === "table") {
|
|
19608
|
+
return handleChange(e);
|
|
19609
|
+
}
|
|
19610
|
+
try {
|
|
19611
|
+
buttonLoadingForProductCenter.value.import = true;
|
|
19612
|
+
let tableRules = lodashEs.cloneDeep(props.rule.config?.childRules || []);
|
|
19613
|
+
tableRules.forEach((rule) => {
|
|
19614
|
+
const field = rule.field;
|
|
19615
|
+
let associatedFields = rule.config.associatedFields || [];
|
|
19616
|
+
associatedFields.forEach((associatedRule) => {
|
|
19617
|
+
associatedRule.field = productPicName(associatedRule.value, field);
|
|
19618
|
+
associatedRule.is = accosiationParseKeyMap[associatedRule.value];
|
|
19619
|
+
});
|
|
19620
|
+
});
|
|
19621
|
+
let res = await props.extraConfig.table?.importFetch?.({
|
|
19622
|
+
tableConfig: tableConfig.value,
|
|
19623
|
+
tableRules,
|
|
19624
|
+
columns: validColumns.value,
|
|
19625
|
+
filterByShopcode: props.rule?.config?.dataFiltering,
|
|
19626
|
+
dataFile: e.target.files?.[0]
|
|
19627
|
+
}) || {};
|
|
19628
|
+
if (res.promptMessage && !await utils__default["default"].confirmModal(res.promptMessage)) {
|
|
19629
|
+
return;
|
|
19630
|
+
}
|
|
19631
|
+
if (res.templateDataList?.length) {
|
|
19632
|
+
data.push(...res.templateDataList);
|
|
19633
|
+
}
|
|
19634
|
+
const numFormatter = (value) => utils__default["default"].toFixNumHasDefault(value, 0, false, "0");
|
|
19635
|
+
if (!res.successNum) {
|
|
19636
|
+
let confirmRet = await utils__default["default"].confirmModal(
|
|
19637
|
+
`\u5BFC\u5165\u5931\u8D25\uFF0C\u5171${numFormatter(res.errorNum)}\u6761`,
|
|
19638
|
+
"\u63D0\u793A",
|
|
19639
|
+
"error",
|
|
19640
|
+
{
|
|
19641
|
+
okText: "\u4E0B\u8F7D\u9519\u8BEF\u6570\u636E"
|
|
19642
|
+
},
|
|
19643
|
+
"error"
|
|
19644
|
+
);
|
|
19645
|
+
if (confirmRet) {
|
|
19646
|
+
props.extraConfig.table?.downloadErrorFetch?.({
|
|
19647
|
+
tableConfig: tableConfig.value,
|
|
19648
|
+
columns: validColumns.value,
|
|
19649
|
+
data: res
|
|
19650
|
+
});
|
|
19651
|
+
}
|
|
19652
|
+
} else if (res.successNum === res.importNum) {
|
|
19653
|
+
let confirmRet = await utils__default["default"].confirmModal(
|
|
19654
|
+
`\u5BFC\u5165\u6210\u529F\uFF0C\u5171${numFormatter(res.successNum)}\u6761`,
|
|
19655
|
+
"\u63D0\u793A",
|
|
19656
|
+
"success",
|
|
19657
|
+
{
|
|
19658
|
+
okText: "\u77E5\u9053\u4E86"
|
|
19659
|
+
},
|
|
19660
|
+
"success"
|
|
19661
|
+
);
|
|
19662
|
+
} else {
|
|
19663
|
+
let confirmRet = await utils__default["default"].confirmModal(
|
|
19664
|
+
`\u5BFC\u5165\u6210\u529F${numFormatter(res.successNum)}\u6761\uFF0C\u5931\u8D25${numFormatter(
|
|
19665
|
+
res.errorNum
|
|
19666
|
+
)}\u6761`,
|
|
19667
|
+
"\u63D0\u793A",
|
|
19668
|
+
"warning",
|
|
19669
|
+
{
|
|
19670
|
+
okText: "\u4E0B\u8F7D\u9519\u8BEF\u6570\u636E"
|
|
19671
|
+
},
|
|
19672
|
+
"warning"
|
|
19673
|
+
);
|
|
19674
|
+
if (confirmRet) {
|
|
19675
|
+
props.extraConfig.table?.downloadErrorFetch?.({
|
|
19676
|
+
tableConfig: tableConfig.value,
|
|
19677
|
+
columns: validColumns.value,
|
|
19678
|
+
data: res
|
|
19679
|
+
});
|
|
19680
|
+
}
|
|
19681
|
+
}
|
|
19682
|
+
} catch (error) {
|
|
19683
|
+
console.log("\u{1F680} ~ error:", error);
|
|
19684
|
+
} finally {
|
|
19685
|
+
buttonLoadingForProductCenter.value.import = false;
|
|
19686
|
+
e.target.value = "";
|
|
19687
|
+
}
|
|
19688
|
+
}
|
|
19689
|
+
function getProductClearSetting(field) {
|
|
19690
|
+
let setting = props.rule.config.childRules?.find((rule) => {
|
|
19691
|
+
return rule.field === field;
|
|
19692
|
+
});
|
|
19693
|
+
return !!setting?.config?.doNotClearAfterFilterChange;
|
|
19694
|
+
}
|
|
19282
19695
|
return (_ctx, _cache) => {
|
|
19283
19696
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$5, [
|
|
19284
19697
|
vue.createElementVNode("div", _hoisted_2$4, [
|
|
19285
19698
|
vue.createTextVNode(vue.toDisplayString(__props.rule.title.title) + " ", 1),
|
|
19286
19699
|
vue.createElementVNode("span", _hoisted_3$3, vue.toDisplayString(vue.unref(countText)), 1),
|
|
19287
|
-
vue.
|
|
19288
|
-
|
|
19289
|
-
|
|
19290
|
-
|
|
19291
|
-
|
|
19292
|
-
}, {
|
|
19293
|
-
default: vue.withCtx(() => [
|
|
19294
|
-
vue.createTextVNode("\u5BFC\u51FA")
|
|
19295
|
-
]),
|
|
19296
|
-
_: 1
|
|
19297
|
-
}, 8, ["disabled"])) : vue.createCommentVNode("v-if", true),
|
|
19298
|
-
vue.createTextVNode("\xA0 "),
|
|
19299
|
-
vue.unref(importFeature) && !__props.hidden ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
19300
|
-
vue.createElementVNode("input", {
|
|
19700
|
+
vue.createCommentVNode(" \u5546\u54C1\u4E2D\u5FC3\u5B9A\u5236 \u6309\u94AE "),
|
|
19701
|
+
vue.unref(isProductCenter) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$3, [
|
|
19702
|
+
!__props.hidden ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
19703
|
+
vue.unref(tableConfig).buttons?.includes("import") ? (vue.openBlock(), vue.createElementBlock("input", {
|
|
19704
|
+
key: 0,
|
|
19301
19705
|
ref_key: "inputRef",
|
|
19302
19706
|
ref: inputRef,
|
|
19303
19707
|
style: { "display": "none" },
|
|
19304
19708
|
name: "file",
|
|
19305
19709
|
type: "file",
|
|
19306
|
-
accept: "text/csv",
|
|
19307
|
-
onChange:
|
|
19308
|
-
}, null,
|
|
19309
|
-
vue.
|
|
19710
|
+
accept: vue.unref(tableConfig).template === "table" ? "text/csv" : "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel, .xlsx, .xls, .XLSX, .XLS",
|
|
19711
|
+
onChange: importHandleForProductCenter
|
|
19712
|
+
}, null, 40, _hoisted_5$3)) : vue.createCommentVNode("v-if", true),
|
|
19713
|
+
vue.unref(tableConfig).buttons?.includes("export") ? (vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.Button), {
|
|
19714
|
+
key: 1,
|
|
19310
19715
|
disabled: __props.disabled,
|
|
19311
|
-
|
|
19716
|
+
loading: buttonLoadingForProductCenter.value.export,
|
|
19717
|
+
onClick: exportForProductCenter
|
|
19312
19718
|
}, {
|
|
19313
19719
|
default: vue.withCtx(() => [
|
|
19314
|
-
vue.createTextVNode("\
|
|
19720
|
+
vue.createTextVNode("\u5BFC\u51FA")
|
|
19315
19721
|
]),
|
|
19316
19722
|
_: 1
|
|
19317
|
-
}, 8, ["disabled"]),
|
|
19318
|
-
vue.
|
|
19723
|
+
}, 8, ["disabled", "loading"])) : vue.createCommentVNode("v-if", true),
|
|
19724
|
+
vue.unref(tableConfig).buttons?.includes("downloadTemplate") ? (vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.Button), {
|
|
19725
|
+
key: 2,
|
|
19726
|
+
disabled: __props.disabled,
|
|
19727
|
+
loading: buttonLoadingForProductCenter.value.download,
|
|
19728
|
+
onClick: downloadTemplateForProductCenter
|
|
19729
|
+
}, {
|
|
19730
|
+
default: vue.withCtx(() => [
|
|
19731
|
+
vue.createTextVNode("\u4E0B\u8F7D\u5BFC\u5165\u6A21\u677F")
|
|
19732
|
+
]),
|
|
19733
|
+
_: 1
|
|
19734
|
+
}, 8, ["disabled", "loading"])) : vue.createCommentVNode("v-if", true),
|
|
19735
|
+
vue.unref(tableConfig).buttons?.includes("import") ? (vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.Button), {
|
|
19736
|
+
key: 3,
|
|
19319
19737
|
disabled: __props.disabled,
|
|
19738
|
+
loading: buttonLoadingForProductCenter.value.import,
|
|
19320
19739
|
onClick: handleImport
|
|
19321
19740
|
}, {
|
|
19322
19741
|
default: vue.withCtx(() => [
|
|
19323
19742
|
vue.createTextVNode("\u6279\u91CF\u5BFC\u5165")
|
|
19324
19743
|
]),
|
|
19325
19744
|
_: 1
|
|
19745
|
+
}, 8, ["disabled", "loading"])) : vue.createCommentVNode("v-if", true),
|
|
19746
|
+
vue.unref(tableConfig).buttons?.includes("delete") ? (vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.Button), {
|
|
19747
|
+
key: 4,
|
|
19748
|
+
disabled: __props.disabled,
|
|
19749
|
+
onClick: handleBatchDelete
|
|
19750
|
+
}, {
|
|
19751
|
+
default: vue.withCtx(() => [
|
|
19752
|
+
vue.createTextVNode("\u6279\u91CF\u5220\u9664")
|
|
19753
|
+
]),
|
|
19754
|
+
_: 1
|
|
19755
|
+
}, 8, ["disabled"])) : vue.createCommentVNode("v-if", true),
|
|
19756
|
+
vue.unref(tableConfig).buttons?.includes("add") ? (vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.Button), {
|
|
19757
|
+
key: 5,
|
|
19758
|
+
type: "primary",
|
|
19759
|
+
disabled: __props.disabled,
|
|
19760
|
+
onClick: handleAdd
|
|
19761
|
+
}, {
|
|
19762
|
+
default: vue.withCtx(() => [
|
|
19763
|
+
vue.createVNode(vue.unref(iconsVue.PlusOutlined)),
|
|
19764
|
+
vue.createTextVNode(" \u65B0\u589E")
|
|
19765
|
+
]),
|
|
19766
|
+
_: 1
|
|
19767
|
+
}, 8, ["disabled"])) : vue.createCommentVNode("v-if", true)
|
|
19768
|
+
], 64)) : vue.createCommentVNode("v-if", true)
|
|
19769
|
+
])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_6$3, [
|
|
19770
|
+
!__props.hidden ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
19771
|
+
vue.unref(exportFeature) ? (vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.Button), {
|
|
19772
|
+
key: 0,
|
|
19773
|
+
disabled: __props.disabled,
|
|
19774
|
+
onClick: handleExport
|
|
19775
|
+
}, {
|
|
19776
|
+
default: vue.withCtx(() => [
|
|
19777
|
+
vue.createTextVNode("\u5BFC\u51FA")
|
|
19778
|
+
]),
|
|
19779
|
+
_: 1
|
|
19780
|
+
}, 8, ["disabled"])) : vue.createCommentVNode("v-if", true),
|
|
19781
|
+
vue.createTextVNode("\xA0 "),
|
|
19782
|
+
vue.unref(importFeature) ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
19783
|
+
vue.createElementVNode("input", {
|
|
19784
|
+
ref_key: "inputRef",
|
|
19785
|
+
ref: inputRef,
|
|
19786
|
+
style: { "display": "none" },
|
|
19787
|
+
name: "file",
|
|
19788
|
+
type: "file",
|
|
19789
|
+
accept: "text/csv",
|
|
19790
|
+
onChange: handleChange
|
|
19791
|
+
}, null, 544),
|
|
19792
|
+
vue.createVNode(vue.unref(antDesignVue.Button), {
|
|
19793
|
+
disabled: __props.disabled,
|
|
19794
|
+
onClick: handleDownload
|
|
19795
|
+
}, {
|
|
19796
|
+
default: vue.withCtx(() => [
|
|
19797
|
+
vue.createTextVNode("\u4E0B\u8F7D\u6A21\u677F")
|
|
19798
|
+
]),
|
|
19799
|
+
_: 1
|
|
19800
|
+
}, 8, ["disabled"]),
|
|
19801
|
+
vue.createVNode(vue.unref(antDesignVue.Button), {
|
|
19802
|
+
disabled: __props.disabled,
|
|
19803
|
+
onClick: handleImport
|
|
19804
|
+
}, {
|
|
19805
|
+
default: vue.withCtx(() => [
|
|
19806
|
+
vue.createTextVNode("\u6279\u91CF\u5BFC\u5165")
|
|
19807
|
+
]),
|
|
19808
|
+
_: 1
|
|
19809
|
+
}, 8, ["disabled"])
|
|
19810
|
+
], 64)) : vue.createCommentVNode("v-if", true),
|
|
19811
|
+
vue.unref(deleteFeature) ? (vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.Button), {
|
|
19812
|
+
key: 2,
|
|
19813
|
+
disabled: __props.disabled,
|
|
19814
|
+
onClick: handleBatchDelete
|
|
19815
|
+
}, {
|
|
19816
|
+
default: vue.withCtx(() => [
|
|
19817
|
+
vue.createTextVNode("\u6279\u91CF\u5220\u9664")
|
|
19818
|
+
]),
|
|
19819
|
+
_: 1
|
|
19820
|
+
}, 8, ["disabled"])) : vue.createCommentVNode("v-if", true),
|
|
19821
|
+
vue.createVNode(vue.unref(antDesignVue.Button), {
|
|
19822
|
+
type: "primary",
|
|
19823
|
+
disabled: __props.disabled,
|
|
19824
|
+
onClick: handleAdd
|
|
19825
|
+
}, {
|
|
19826
|
+
default: vue.withCtx(() => [
|
|
19827
|
+
vue.createVNode(vue.unref(iconsVue.PlusOutlined)),
|
|
19828
|
+
vue.createTextVNode(" \u65B0\u589E ")
|
|
19829
|
+
]),
|
|
19830
|
+
_: 1
|
|
19326
19831
|
}, 8, ["disabled"])
|
|
19327
|
-
], 64)) : vue.createCommentVNode("v-if", true)
|
|
19328
|
-
|
|
19329
|
-
key: 2,
|
|
19330
|
-
disabled: __props.disabled,
|
|
19331
|
-
onClick: handleBatchDelete
|
|
19332
|
-
}, {
|
|
19333
|
-
default: vue.withCtx(() => [
|
|
19334
|
-
vue.createTextVNode("\u6279\u91CF\u5220\u9664")
|
|
19335
|
-
]),
|
|
19336
|
-
_: 1
|
|
19337
|
-
}, 8, ["disabled"])) : vue.createCommentVNode("v-if", true),
|
|
19338
|
-
!__props.hidden ? (vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.Button), {
|
|
19339
|
-
key: 3,
|
|
19340
|
-
type: "primary",
|
|
19341
|
-
disabled: __props.disabled,
|
|
19342
|
-
onClick: handleAdd
|
|
19343
|
-
}, {
|
|
19344
|
-
default: vue.withCtx(() => [
|
|
19345
|
-
vue.createVNode(vue.unref(iconsVue.PlusOutlined)),
|
|
19346
|
-
vue.createTextVNode(" \u65B0\u589E ")
|
|
19347
|
-
]),
|
|
19348
|
-
_: 1
|
|
19349
|
-
}, 8, ["disabled"])) : vue.createCommentVNode("v-if", true)
|
|
19350
|
-
])
|
|
19832
|
+
], 64)) : vue.createCommentVNode("v-if", true)
|
|
19833
|
+
]))
|
|
19351
19834
|
]),
|
|
19352
|
-
vue.createElementVNode("div",
|
|
19835
|
+
vue.createElementVNode("div", _hoisted_7$3, [
|
|
19353
19836
|
vue.createVNode(vue.unref(antDesignVue.FormItemRest), null, {
|
|
19354
19837
|
default: vue.withCtx(() => [
|
|
19355
19838
|
vue.createVNode(vue.unref(components.BmFloatTable), {
|
|
@@ -19394,8 +19877,12 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
|
19394
19877
|
value: row[item.field],
|
|
19395
19878
|
disabled: item.disabled || pruductInputDisabled(item.config?.dataFiltering),
|
|
19396
19879
|
"shop-value": vue.unref(formData)[item.config.dataFiltering],
|
|
19397
|
-
|
|
19398
|
-
|
|
19880
|
+
"do-not-clear-after-filter-change": getProductClearSetting(item.field),
|
|
19881
|
+
"fetch-mode": item.config.fetchMode,
|
|
19882
|
+
onChange: ($event) => handleProductChange($event, item, row),
|
|
19883
|
+
onBlur: ($event) => handleProductPressEnter($event, item, row),
|
|
19884
|
+
onPressEnter: ($event) => handleProductPressEnter($event, item, row)
|
|
19885
|
+
}, null, 8, ["value", "disabled", "shop-value", "do-not-clear-after-filter-change", "fetch-mode", "onChange", "onBlur", "onPressEnter"])
|
|
19399
19886
|
])
|
|
19400
19887
|
};
|
|
19401
19888
|
}),
|
|
@@ -19421,8 +19908,10 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
|
19421
19908
|
value: row[item.field],
|
|
19422
19909
|
disabled: item.disabled || pruductInputDisabled(item.config?.dataFiltering),
|
|
19423
19910
|
"shop-value": vue.unref(formData)[item.config.dataFiltering],
|
|
19424
|
-
onChange: ($event) =>
|
|
19425
|
-
|
|
19911
|
+
onChange: ($event) => handleCustomerChange($event, item, row),
|
|
19912
|
+
onBlur: ($event) => handleCustomerPressEnter($event, item, row),
|
|
19913
|
+
onPressEnter: ($event) => handleCustomerPressEnter($event, item, row)
|
|
19914
|
+
}, null, 8, ["value", "disabled", "shop-value", "onChange", "onBlur", "onPressEnter"])
|
|
19426
19915
|
])
|
|
19427
19916
|
};
|
|
19428
19917
|
})
|
|
@@ -19826,7 +20315,7 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
|
|
|
19826
20315
|
flex: 1
|
|
19827
20316
|
}, {
|
|
19828
20317
|
default: vue.withCtx(() => [
|
|
19829
|
-
vue.createTextVNode(vue.toDisplayString(pane.tempSelected.materialCategoryNameShow || "\u7CFB\u7EDF\u81EA\u52A8\
|
|
20318
|
+
vue.createTextVNode(vue.toDisplayString(pane.tempSelected.materialCategoryNameShow || "\u7CFB\u7EDF\u81EA\u52A8\u83B7\u53D6"), 1)
|
|
19830
20319
|
]),
|
|
19831
20320
|
_: 2
|
|
19832
20321
|
}, 1024)
|
|
@@ -20009,6 +20498,7 @@ var MaterialTemp = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__file", "materia
|
|
|
20009
20498
|
var materialTemp = {
|
|
20010
20499
|
name: 'materialTemp',
|
|
20011
20500
|
rule(data, extraConfig) {
|
|
20501
|
+
var _a;
|
|
20012
20502
|
return {
|
|
20013
20503
|
native: true,
|
|
20014
20504
|
type: 'div',
|
|
@@ -20037,14 +20527,19 @@ var materialTemp = {
|
|
|
20037
20527
|
validate: [
|
|
20038
20528
|
{
|
|
20039
20529
|
validator(rule, value) {
|
|
20530
|
+
var _a, _b, _c;
|
|
20040
20531
|
if (isNull.isNull(value)) {
|
|
20041
20532
|
return Promise.reject();
|
|
20042
20533
|
}
|
|
20043
20534
|
const panes = value.panes;
|
|
20535
|
+
const requiredPicture = (_b = (_a = data === null || data === void 0 ? void 0 : data.config) === null || _a === void 0 ? void 0 : _a.uploadPictureRule) === null || _b === void 0 ? void 0 : _b.required;
|
|
20044
20536
|
for (const pane of panes) {
|
|
20045
20537
|
if (!pane.tempIdSelected) {
|
|
20046
20538
|
return Promise.reject();
|
|
20047
20539
|
}
|
|
20540
|
+
if (requiredPicture && !((_c = pane.uploadList) === null || _c === void 0 ? void 0 : _c.length)) {
|
|
20541
|
+
return Promise.reject();
|
|
20542
|
+
}
|
|
20048
20543
|
if (pane.tableRequiredFields) {
|
|
20049
20544
|
for (const field of pane.tableRequiredFields) {
|
|
20050
20545
|
if (pane.tableData.some((row) => isNull.isNull(row[field]))) {
|
|
@@ -20055,7 +20550,7 @@ var materialTemp = {
|
|
|
20055
20550
|
}
|
|
20056
20551
|
return Promise.resolve();
|
|
20057
20552
|
},
|
|
20058
|
-
message: '请检查必填项',
|
|
20553
|
+
message: ((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请检查必填项',
|
|
20059
20554
|
},
|
|
20060
20555
|
],
|
|
20061
20556
|
},
|
|
@@ -20072,11 +20567,13 @@ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
|
20072
20567
|
props: [
|
|
20073
20568
|
"associatedFields",
|
|
20074
20569
|
"dataFiltering",
|
|
20570
|
+
"doNotClearAfterFilterChange",
|
|
20075
20571
|
"required",
|
|
20076
20572
|
"extraConfig",
|
|
20077
20573
|
"defalutValue",
|
|
20078
20574
|
"disabled",
|
|
20079
|
-
"formCreateInject"
|
|
20575
|
+
"formCreateInject",
|
|
20576
|
+
"fetchMode"
|
|
20080
20577
|
],
|
|
20081
20578
|
emits: ["change"],
|
|
20082
20579
|
setup(__props, { emit: emits }) {
|
|
@@ -20088,7 +20585,12 @@ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
|
20088
20585
|
\u5546\u54C1\u56FE\u7247: "picUrl",
|
|
20089
20586
|
\u5EFA\u8BAE\u96F6\u552E\u4EF7: "retailPrice",
|
|
20090
20587
|
\u5546\u54C1\u7BB1\u89C4: "carton",
|
|
20091
|
-
\u5546\u54C1\u5355\u4F4D: "unit"
|
|
20588
|
+
\u5546\u54C1\u5355\u4F4D: "unit",
|
|
20589
|
+
\u4E00\u7EA7\u5206\u7C7B: "categoryFirst",
|
|
20590
|
+
\u4E8C\u7EA7\u5206\u7C7B: "categorySecond",
|
|
20591
|
+
\u4E09\u7EA7\u5206\u7C7B: "categoryThrid",
|
|
20592
|
+
\u5546\u54C1\u7C7B\u578B: "productType",
|
|
20593
|
+
\u5546\u54C1\u6807\u7B7E: "productTag"
|
|
20092
20594
|
};
|
|
20093
20595
|
const unitMap = ["\u652F", "\u74F6", "\u5957", "\u7EC4", "\u7BB1", "\u4E2A", "\u5F20"];
|
|
20094
20596
|
const formData = vue.computed(() => props.formCreateInject.api.bind());
|
|
@@ -20145,7 +20647,7 @@ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
|
20145
20647
|
vue.watch(
|
|
20146
20648
|
() => formData.value[props.dataFiltering],
|
|
20147
20649
|
() => {
|
|
20148
|
-
if (inputValue.value) {
|
|
20650
|
+
if (inputValue.value && !props.doNotClearAfterFilterChange) {
|
|
20149
20651
|
reset();
|
|
20150
20652
|
}
|
|
20151
20653
|
}
|
|
@@ -20170,14 +20672,23 @@ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
|
20170
20672
|
}),
|
|
20171
20673
|
vue.createVNode(vue.unref(antDesignVue.Col), { flex: 1 }, {
|
|
20172
20674
|
default: vue.withCtx(() => [
|
|
20173
|
-
vue.
|
|
20675
|
+
props.fetchMode === "blur" ? (vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.Input), {
|
|
20676
|
+
key: 0,
|
|
20174
20677
|
value: inputValue.value,
|
|
20175
20678
|
"onUpdate:value": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event),
|
|
20176
20679
|
placeholder: "\u8BF7\u8F93\u5165",
|
|
20177
20680
|
disabled: __props.disabled || inputDisbale(__props.dataFiltering),
|
|
20681
|
+
onPressEnter: vue.unref(debounceFn),
|
|
20682
|
+
onBlur: handleBlur
|
|
20683
|
+
}, null, 8, ["value", "disabled", "onPressEnter"])) : (vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.Input), {
|
|
20684
|
+
key: 1,
|
|
20685
|
+
value: inputValue.value,
|
|
20686
|
+
"onUpdate:value": _cache[1] || (_cache[1] = ($event) => inputValue.value = $event),
|
|
20687
|
+
placeholder: "\u8BF7\u8F93\u5165",
|
|
20688
|
+
disabled: __props.disabled || inputDisbale(__props.dataFiltering),
|
|
20178
20689
|
onPressEnter: handleBlur,
|
|
20179
20690
|
onChange: handleChange
|
|
20180
|
-
}, null, 8, ["value", "disabled"])
|
|
20691
|
+
}, null, 8, ["value", "disabled"]))
|
|
20181
20692
|
]),
|
|
20182
20693
|
_: 1
|
|
20183
20694
|
})
|
|
@@ -20212,12 +20723,12 @@ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
|
20212
20723
|
class: "bm-fc-form-item__img",
|
|
20213
20724
|
src: __props.extraConfig.common.previewImg(getValue(field.value))
|
|
20214
20725
|
}, null, 8, _hoisted_2$2)) : field.value === "\u5546\u54C1\u5355\u4F4D" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
20215
|
-
vue.createTextVNode(vue.toDisplayString(unitMap[getValue(field.value)]), 1)
|
|
20726
|
+
vue.createTextVNode(vue.toDisplayString(unitMap[getValue(field.value)] || getValue(field.value)), 1)
|
|
20216
20727
|
], 64)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
|
|
20217
20728
|
vue.createTextVNode(vue.toDisplayString(getValue(field.value)), 1)
|
|
20218
20729
|
], 64))
|
|
20219
20730
|
], 64)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
20220
|
-
vue.createTextVNode("\u7CFB\u7EDF\u81EA\u52A8\
|
|
20731
|
+
vue.createTextVNode("\u7CFB\u7EDF\u81EA\u52A8\u83B7\u53D6")
|
|
20221
20732
|
], 64))
|
|
20222
20733
|
]),
|
|
20223
20734
|
_: 2
|
|
@@ -20240,19 +20751,23 @@ var ProductInfo = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__file", "product-
|
|
|
20240
20751
|
var product = {
|
|
20241
20752
|
name: 'product',
|
|
20242
20753
|
rule(data, extraConfig) {
|
|
20754
|
+
var _a;
|
|
20243
20755
|
return {
|
|
20244
20756
|
type: 'ProductInfo',
|
|
20245
20757
|
component: ProductInfo,
|
|
20246
20758
|
field: data.field,
|
|
20247
20759
|
effect: {
|
|
20248
|
-
required: data.effect.required &&
|
|
20760
|
+
required: data.effect.required &&
|
|
20761
|
+
(((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请输入商品编号'),
|
|
20249
20762
|
},
|
|
20250
20763
|
props: {
|
|
20251
20764
|
required: data.effect.required,
|
|
20252
20765
|
associatedFields: data.config.associatedFields,
|
|
20253
20766
|
dataFiltering: data.config.dataFiltering,
|
|
20767
|
+
doNotClearAfterFilterChange: data.config.doNotClearAfterFilterChange,
|
|
20254
20768
|
extraConfig: extraConfig,
|
|
20255
20769
|
defalutValue: data.value,
|
|
20770
|
+
fetchMode: data.config.fetchMode,
|
|
20256
20771
|
},
|
|
20257
20772
|
inject: true,
|
|
20258
20773
|
on: {
|
|
@@ -20269,19 +20784,23 @@ var product = {
|
|
|
20269
20784
|
};
|
|
20270
20785
|
},
|
|
20271
20786
|
rowRule(data, extraConfig) {
|
|
20787
|
+
var _a;
|
|
20272
20788
|
return {
|
|
20273
20789
|
type: 'ProductInfo',
|
|
20274
20790
|
component: ProductInfo,
|
|
20275
20791
|
field: data.field,
|
|
20276
20792
|
effect: {
|
|
20277
|
-
required: data.effect.required &&
|
|
20793
|
+
required: data.effect.required &&
|
|
20794
|
+
(((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请输入商品编号'),
|
|
20278
20795
|
},
|
|
20279
20796
|
props: {
|
|
20280
20797
|
required: data.effect.required,
|
|
20281
20798
|
associatedFields: data.config.associatedFields,
|
|
20282
20799
|
dataFiltering: data.config.dataFiltering,
|
|
20800
|
+
doNotClearAfterFilterChange: data.config.doNotClearAfterFilterChange,
|
|
20283
20801
|
defalutValue: data.value,
|
|
20284
20802
|
extraConfig: extraConfig,
|
|
20803
|
+
fetchMode: data.config.fetchMode,
|
|
20285
20804
|
},
|
|
20286
20805
|
inject: true,
|
|
20287
20806
|
on: {
|
|
@@ -20345,11 +20864,20 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
20345
20864
|
}
|
|
20346
20865
|
return false;
|
|
20347
20866
|
});
|
|
20867
|
+
function isProductCenterSuit(rule) {
|
|
20868
|
+
return [
|
|
20869
|
+
"F2CTemplate",
|
|
20870
|
+
"B2CTemplate",
|
|
20871
|
+
"DistributeTemp",
|
|
20872
|
+
"FreshTemplate",
|
|
20873
|
+
"activityApply"
|
|
20874
|
+
].includes(rule.name);
|
|
20875
|
+
}
|
|
20348
20876
|
function isAssociatedFn(rule) {
|
|
20349
|
-
if (rule?.config?.dataFiltering === field.value) {
|
|
20877
|
+
if (rule?.config?.dataFiltering === field.value && !isProductCenterSuit(rule)) {
|
|
20350
20878
|
return true;
|
|
20351
20879
|
}
|
|
20352
|
-
if (rule?.config?.childRules?.length) {
|
|
20880
|
+
if (rule?.config?.childRules?.length && !isProductCenterSuit(rule)) {
|
|
20353
20881
|
for (const cRule of rule.config.childRules) {
|
|
20354
20882
|
if (isAssociatedFn(cRule))
|
|
20355
20883
|
return true;
|
|
@@ -20465,7 +20993,7 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
20465
20993
|
getValue(field2.value) ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
20466
20994
|
vue.createTextVNode(vue.toDisplayString(getValue(field2.value)), 1)
|
|
20467
20995
|
], 64)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
20468
|
-
vue.createTextVNode("\u7CFB\u7EDF\u81EA\u52A8\
|
|
20996
|
+
vue.createTextVNode("\u7CFB\u7EDF\u81EA\u52A8\u83B7\u53D6")
|
|
20469
20997
|
], 64))
|
|
20470
20998
|
]),
|
|
20471
20999
|
_: 2
|
|
@@ -20488,17 +21016,17 @@ var ShopWidget = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__file", "shop-widg
|
|
|
20488
21016
|
var shop = {
|
|
20489
21017
|
name: 'shop',
|
|
20490
21018
|
rule(data, extraConfig) {
|
|
20491
|
-
var _a;
|
|
21019
|
+
var _a, _b;
|
|
20492
21020
|
const shopExtraConfig = extraConfig.shop;
|
|
20493
21021
|
return {
|
|
20494
21022
|
type: 'ShopWidget',
|
|
20495
21023
|
component: ShopWidget,
|
|
20496
21024
|
field: data.field,
|
|
20497
21025
|
effect: {
|
|
20498
|
-
required: data.effect.required && '请选择店铺',
|
|
21026
|
+
required: data.effect.required && (((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请选择店铺'),
|
|
20499
21027
|
},
|
|
20500
21028
|
props: {
|
|
20501
|
-
dataFiltering: (
|
|
21029
|
+
dataFiltering: (_b = data.config) === null || _b === void 0 ? void 0 : _b.dataFiltering,
|
|
20502
21030
|
associatedFields: data.config.associatedFields,
|
|
20503
21031
|
extraConfig: shopExtraConfig,
|
|
20504
21032
|
required: data.effect.required,
|
|
@@ -20520,19 +21048,20 @@ var shop = {
|
|
|
20520
21048
|
};
|
|
20521
21049
|
},
|
|
20522
21050
|
rowRule(data, extraConfig) {
|
|
20523
|
-
var _a;
|
|
21051
|
+
var _a, _b;
|
|
20524
21052
|
const shopExtraConfig = extraConfig.shop;
|
|
20525
21053
|
return {
|
|
20526
21054
|
type: 'ShopWidget',
|
|
20527
21055
|
component: ShopWidget,
|
|
20528
|
-
title: data.title.title,
|
|
20529
21056
|
field: data.field,
|
|
20530
21057
|
effect: {
|
|
20531
|
-
required: data.effect.required && '请选择店铺',
|
|
21058
|
+
required: data.effect.required && (((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请选择店铺'),
|
|
20532
21059
|
},
|
|
20533
21060
|
props: {
|
|
20534
|
-
dataFiltering: (
|
|
21061
|
+
dataFiltering: (_b = data.config) === null || _b === void 0 ? void 0 : _b.dataFiltering,
|
|
20535
21062
|
extraConfig: shopExtraConfig,
|
|
21063
|
+
associatedFields: data.config.associatedFields,
|
|
21064
|
+
title: `${data.title.title}`,
|
|
20536
21065
|
},
|
|
20537
21066
|
inject: true,
|
|
20538
21067
|
on: {
|
|
@@ -20547,7 +21076,7 @@ var shop = {
|
|
|
20547
21076
|
},
|
|
20548
21077
|
},
|
|
20549
21078
|
col: {
|
|
20550
|
-
span:
|
|
21079
|
+
span: 24,
|
|
20551
21080
|
},
|
|
20552
21081
|
value: data.value,
|
|
20553
21082
|
};
|
|
@@ -20650,6 +21179,7 @@ var materialType$1 = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__file", "mater
|
|
|
20650
21179
|
var materialType = {
|
|
20651
21180
|
name: 'materialType',
|
|
20652
21181
|
rule(data, extraConfig) {
|
|
21182
|
+
var _a;
|
|
20653
21183
|
return {
|
|
20654
21184
|
type: 'materialType',
|
|
20655
21185
|
component: materialType$1,
|
|
@@ -20660,7 +21190,7 @@ var materialType = {
|
|
|
20660
21190
|
required: data.effect.required,
|
|
20661
21191
|
type: 'array',
|
|
20662
21192
|
min: 1,
|
|
20663
|
-
message: '请选择素材类型',
|
|
21193
|
+
message: ((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请选择素材类型',
|
|
20664
21194
|
},
|
|
20665
21195
|
],
|
|
20666
21196
|
props: {
|
|
@@ -20688,6 +21218,7 @@ var materialType = {
|
|
|
20688
21218
|
};
|
|
20689
21219
|
},
|
|
20690
21220
|
rowRule(data, extraConfig) {
|
|
21221
|
+
var _a;
|
|
20691
21222
|
return {
|
|
20692
21223
|
type: 'materialType',
|
|
20693
21224
|
component: materialType$1,
|
|
@@ -20698,7 +21229,7 @@ var materialType = {
|
|
|
20698
21229
|
required: data.effect.required,
|
|
20699
21230
|
type: 'array',
|
|
20700
21231
|
min: 1,
|
|
20701
|
-
message: '请选择素材类型',
|
|
21232
|
+
message: ((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请选择素材类型',
|
|
20702
21233
|
},
|
|
20703
21234
|
],
|
|
20704
21235
|
props: {
|
|
@@ -20787,7 +21318,7 @@ var row = {
|
|
|
20787
21318
|
var department = {
|
|
20788
21319
|
name: 'department',
|
|
20789
21320
|
rule(data, extraConfig) {
|
|
20790
|
-
var _a;
|
|
21321
|
+
var _a, _b;
|
|
20791
21322
|
return {
|
|
20792
21323
|
type: 'StaffSelector',
|
|
20793
21324
|
component: StaffSelector,
|
|
@@ -20809,7 +21340,7 @@ var department = {
|
|
|
20809
21340
|
fieldNames: (_a = extraConfig.department) === null || _a === void 0 ? void 0 : _a.fieldNames,
|
|
20810
21341
|
},
|
|
20811
21342
|
effect: {
|
|
20812
|
-
required: data.effect.required && '请选择',
|
|
21343
|
+
required: data.effect.required && (((_b = data.effect) === null || _b === void 0 ? void 0 : _b.requiredTip) || '请选择'),
|
|
20813
21344
|
},
|
|
20814
21345
|
wrap: {
|
|
20815
21346
|
wrapperCol: {
|
|
@@ -20821,18 +21352,21 @@ var department = {
|
|
|
20821
21352
|
change(inject, list) {
|
|
20822
21353
|
const rule = inject.self;
|
|
20823
21354
|
rule.props.defaultSelected = list;
|
|
20824
|
-
|
|
20825
|
-
|
|
20826
|
-
|
|
20827
|
-
|
|
20828
|
-
|
|
21355
|
+
vue.nextTick(() => {
|
|
21356
|
+
rule.props.defaultSelected = list;
|
|
21357
|
+
inject.api.form[rule.field] = list;
|
|
21358
|
+
inject.api.validateField(rule.field, () => {
|
|
21359
|
+
if (list.length) {
|
|
21360
|
+
inject.api.clearValidateState(rule.field);
|
|
21361
|
+
}
|
|
21362
|
+
});
|
|
20829
21363
|
});
|
|
20830
21364
|
},
|
|
20831
21365
|
},
|
|
20832
21366
|
};
|
|
20833
21367
|
},
|
|
20834
21368
|
rowRule(data, extraConfig) {
|
|
20835
|
-
var _a;
|
|
21369
|
+
var _a, _b;
|
|
20836
21370
|
return {
|
|
20837
21371
|
type: 'StaffSelector',
|
|
20838
21372
|
component: StaffSelector,
|
|
@@ -20854,7 +21388,7 @@ var department = {
|
|
|
20854
21388
|
fieldNames: (_a = extraConfig.department) === null || _a === void 0 ? void 0 : _a.fieldNames,
|
|
20855
21389
|
},
|
|
20856
21390
|
effect: {
|
|
20857
|
-
required: data.effect.required && '请选择',
|
|
21391
|
+
required: data.effect.required && (((_b = data.effect) === null || _b === void 0 ? void 0 : _b.requiredTip) || '请选择'),
|
|
20858
21392
|
},
|
|
20859
21393
|
col: {
|
|
20860
21394
|
span: fieldRatioMap[data.config.fieldRatio],
|
|
@@ -20864,11 +21398,14 @@ var department = {
|
|
|
20864
21398
|
change(inject, list) {
|
|
20865
21399
|
const rule = inject.self;
|
|
20866
21400
|
rule.props.defaultSelected = list;
|
|
20867
|
-
|
|
20868
|
-
|
|
20869
|
-
|
|
20870
|
-
|
|
20871
|
-
|
|
21401
|
+
vue.nextTick(() => {
|
|
21402
|
+
rule.props.defaultSelected = list;
|
|
21403
|
+
inject.api.form[rule.field] = list;
|
|
21404
|
+
inject.api.validateField(rule.field, () => {
|
|
21405
|
+
if (list.length) {
|
|
21406
|
+
inject.api.clearValidateState(rule.field);
|
|
21407
|
+
}
|
|
21408
|
+
});
|
|
20872
21409
|
});
|
|
20873
21410
|
},
|
|
20874
21411
|
},
|
|
@@ -20926,6 +21463,7 @@ function validator(rule, value) {
|
|
|
20926
21463
|
var table = {
|
|
20927
21464
|
name: 'table',
|
|
20928
21465
|
rule(data, extraConfig) {
|
|
21466
|
+
var _a;
|
|
20929
21467
|
return {
|
|
20930
21468
|
type: 'TableWidget',
|
|
20931
21469
|
component: TableWidget,
|
|
@@ -20947,12 +21485,14 @@ var table = {
|
|
|
20947
21485
|
validator(rule, value) {
|
|
20948
21486
|
return validator(data, value);
|
|
20949
21487
|
},
|
|
20950
|
-
message: '请检查必填项',
|
|
21488
|
+
message: ((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请检查必填项',
|
|
20951
21489
|
},
|
|
20952
21490
|
],
|
|
21491
|
+
wrap: data.wrap,
|
|
20953
21492
|
};
|
|
20954
21493
|
},
|
|
20955
21494
|
rowRule(data, extraConfig) {
|
|
21495
|
+
var _a;
|
|
20956
21496
|
return {
|
|
20957
21497
|
type: 'TableWidget',
|
|
20958
21498
|
component: TableWidget,
|
|
@@ -20974,12 +21514,13 @@ var table = {
|
|
|
20974
21514
|
validator(rule, value) {
|
|
20975
21515
|
return validator(data, value);
|
|
20976
21516
|
},
|
|
20977
|
-
message: '请检查必填项',
|
|
21517
|
+
message: ((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请检查必填项',
|
|
20978
21518
|
},
|
|
20979
21519
|
],
|
|
20980
21520
|
col: {
|
|
20981
21521
|
span: 24,
|
|
20982
21522
|
},
|
|
21523
|
+
wrap: data.wrap,
|
|
20983
21524
|
};
|
|
20984
21525
|
},
|
|
20985
21526
|
};
|
|
@@ -21149,9 +21690,10 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
21149
21690
|
"formPermissions",
|
|
21150
21691
|
"resolveRulesConfig"
|
|
21151
21692
|
],
|
|
21152
|
-
emits: ["update:value"],
|
|
21693
|
+
emits: ["update:value", "change"],
|
|
21153
21694
|
setup(__props, { expose, emit: emits }) {
|
|
21154
21695
|
const props = __props;
|
|
21696
|
+
FC__default["default"].component("BmLabelTooltip", BmOverTooltips__default["default"]);
|
|
21155
21697
|
const formRuleList = vue.computed(() => {
|
|
21156
21698
|
if (typeof props.resolveRulesConfig === "function") {
|
|
21157
21699
|
const rules = props.resolveRulesConfig(ruleList);
|
|
@@ -21171,6 +21713,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
21171
21713
|
span: 24
|
|
21172
21714
|
}
|
|
21173
21715
|
},
|
|
21716
|
+
form: {
|
|
21717
|
+
title: ""
|
|
21718
|
+
},
|
|
21174
21719
|
submitBtn: false,
|
|
21175
21720
|
global: {
|
|
21176
21721
|
ShopWidget: {
|
|
@@ -21309,6 +21854,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
21309
21854
|
immediate: true
|
|
21310
21855
|
}
|
|
21311
21856
|
);
|
|
21857
|
+
function onChange(...reset) {
|
|
21858
|
+
emits("change", ...reset);
|
|
21859
|
+
}
|
|
21312
21860
|
expose({ fApi });
|
|
21313
21861
|
return (_ctx, _cache) => {
|
|
21314
21862
|
const _component_formCreate = vue.resolveComponent("formCreate", true);
|
|
@@ -21323,7 +21871,8 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
21323
21871
|
"model-value": __props.value,
|
|
21324
21872
|
option: vue.unref(option),
|
|
21325
21873
|
rule: rule.value,
|
|
21326
|
-
"onUpdate:modelValue": handleValue
|
|
21874
|
+
"onUpdate:modelValue": handleValue,
|
|
21875
|
+
onChange
|
|
21327
21876
|
}, null, 8, ["api", "model-value", "option", "rule"])
|
|
21328
21877
|
], 64);
|
|
21329
21878
|
};
|