bm-admin-ui 1.2.29-alpha → 1.2.31-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 +748 -198
- package/es/components/form-designer/index.js +118 -22
- 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/search-filter/index.js +4 -2
- 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 +751 -198
- package/lib/components/form-designer/index.js +117 -21
- 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/search-filter/index.js +3 -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/index.css +1 -1
- 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
|
@@ -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,22 @@ 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
|
+
let fields = props.rule.config.childRules?.map((item) => item.field) || [];
|
|
19188
|
+
let isNotEmpty = data?.some(
|
|
19189
|
+
(item) => fields.some((field) => ![null, void 0, ""].includes(item[field]))
|
|
19190
|
+
);
|
|
19191
|
+
if (isNotEmpty) {
|
|
19192
|
+
if (await utils__default["default"].confirmModal("\u518D\u6B21\u6279\u5BFC\u4F1A\u8986\u76D6\u5DF2\u6709\u6570\u636E")) {
|
|
19193
|
+
data.splice(0, data.length);
|
|
19194
|
+
inputRef.value.click();
|
|
19195
|
+
}
|
|
19196
|
+
} else {
|
|
19197
|
+
inputRef.value.click();
|
|
19198
|
+
}
|
|
18978
19199
|
} else {
|
|
18979
19200
|
inputRef.value.click();
|
|
18980
19201
|
}
|
|
@@ -18993,6 +19214,7 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
|
18993
19214
|
async function queryProductInfo(rule, row) {
|
|
18994
19215
|
const field = rule.field;
|
|
18995
19216
|
const associatedFields = rule?.config?.associatedFields;
|
|
19217
|
+
const otherAssociatedFields = rule?.config?.otherAssociatedFields;
|
|
18996
19218
|
let result = void 0;
|
|
18997
19219
|
try {
|
|
18998
19220
|
if (row[field]) {
|
|
@@ -19005,10 +19227,37 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
|
19005
19227
|
}
|
|
19006
19228
|
}
|
|
19007
19229
|
processAssociatedFields(field, associatedFields, row, result);
|
|
19230
|
+
processOtherAssociatedFields(field, otherAssociatedFields, row, result);
|
|
19008
19231
|
return result;
|
|
19009
19232
|
} catch (e) {
|
|
19010
19233
|
row[field] = "";
|
|
19011
19234
|
processAssociatedFields(field, associatedFields, row, result);
|
|
19235
|
+
processOtherAssociatedFields(field, otherAssociatedFields, row, result);
|
|
19236
|
+
return Promise.resolve(result);
|
|
19237
|
+
}
|
|
19238
|
+
}
|
|
19239
|
+
async function queryCustomerInfo(rule, row) {
|
|
19240
|
+
const field = rule.field;
|
|
19241
|
+
const associatedFields = rule?.config?.associatedFields;
|
|
19242
|
+
const otherAssociatedFields = rule?.config?.otherAssociatedFields;
|
|
19243
|
+
let result = void 0;
|
|
19244
|
+
try {
|
|
19245
|
+
if (row[field]) {
|
|
19246
|
+
result = await props.extraConfig.customer?.fetch({
|
|
19247
|
+
clientCode: row[field],
|
|
19248
|
+
filterByShopcode: rule?.config?.dataFiltering
|
|
19249
|
+
});
|
|
19250
|
+
if (!result) {
|
|
19251
|
+
row[field] = "";
|
|
19252
|
+
}
|
|
19253
|
+
}
|
|
19254
|
+
processAssociatedFields(field, associatedFields, row, result);
|
|
19255
|
+
processOtherAssociatedFields(field, otherAssociatedFields, row, result);
|
|
19256
|
+
return result;
|
|
19257
|
+
} catch (e) {
|
|
19258
|
+
row[field] = "";
|
|
19259
|
+
processAssociatedFields(field, associatedFields, row, result);
|
|
19260
|
+
processOtherAssociatedFields(field, otherAssociatedFields, row, result);
|
|
19012
19261
|
return Promise.resolve(result);
|
|
19013
19262
|
}
|
|
19014
19263
|
}
|
|
@@ -19018,17 +19267,24 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
|
19018
19267
|
row[productPicName(item.value, field)] = result ? result[accosiationParseKeyMap[item.value]] : void 0;
|
|
19019
19268
|
});
|
|
19020
19269
|
}
|
|
19270
|
+
function processOtherAssociatedFields(field, fields, row, result) {
|
|
19271
|
+
if (isProductCenterSuit.value) {
|
|
19272
|
+
fields?.forEach?.((item) => {
|
|
19273
|
+
row[item] = result ? result[item] : void 0;
|
|
19274
|
+
});
|
|
19275
|
+
}
|
|
19276
|
+
}
|
|
19021
19277
|
function handleChange(e) {
|
|
19022
19278
|
const file = e.target.files[0];
|
|
19023
19279
|
const reader = new FileReader();
|
|
19024
19280
|
reader.onload = (fr) => {
|
|
19025
19281
|
const rows = parseCsv(fr?.target?.result);
|
|
19026
|
-
const
|
|
19282
|
+
const validColumns2 = columns.filter((c) => isValidColumn(c));
|
|
19027
19283
|
const result = [];
|
|
19028
19284
|
rows.forEach((row) => {
|
|
19029
19285
|
const rowData = {};
|
|
19030
19286
|
row.forEach((item, index) => {
|
|
19031
|
-
rowData[
|
|
19287
|
+
rowData[validColumns2[index].field] = item;
|
|
19032
19288
|
});
|
|
19033
19289
|
result.push(rowData);
|
|
19034
19290
|
});
|
|
@@ -19045,7 +19301,7 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
|
19045
19301
|
file && reader.readAsText(file, "GB2312");
|
|
19046
19302
|
}
|
|
19047
19303
|
function isValidColumn(c) {
|
|
19048
|
-
return c.type !== "checkbox" && c.field !== oper;
|
|
19304
|
+
return c.type !== "checkbox" && c.type !== "seq" && c.field !== oper;
|
|
19049
19305
|
}
|
|
19050
19306
|
function parseCsv(result) {
|
|
19051
19307
|
let data2 = [];
|
|
@@ -19065,9 +19321,9 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
|
19065
19321
|
}
|
|
19066
19322
|
async function validate(rowData) {
|
|
19067
19323
|
let error = "";
|
|
19068
|
-
const
|
|
19324
|
+
const validColumns2 = columns.filter((c) => isValidColumn(c));
|
|
19069
19325
|
for (const row of rowData) {
|
|
19070
|
-
for (const { field } of
|
|
19326
|
+
for (const { field } of validColumns2) {
|
|
19071
19327
|
const rule = childRulesMap.value[`${field}`];
|
|
19072
19328
|
const title = rule?.title?.title;
|
|
19073
19329
|
if (!rule)
|
|
@@ -19204,6 +19460,18 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
|
19204
19460
|
break;
|
|
19205
19461
|
}
|
|
19206
19462
|
}
|
|
19463
|
+
if (rule.name === "customer") {
|
|
19464
|
+
try {
|
|
19465
|
+
const productInfo = await queryCustomerInfo(rule, row);
|
|
19466
|
+
if (!productInfo) {
|
|
19467
|
+
error = `${title}\u67E5\u8BE2\u7684\u5BA2\u6237\u4E0D\u5B58\u5728`;
|
|
19468
|
+
break;
|
|
19469
|
+
}
|
|
19470
|
+
} catch (e) {
|
|
19471
|
+
error = `${title}\u67E5\u8BE2\u7684\u5BA2\u6237\u4E0D\u5B58\u5728`;
|
|
19472
|
+
break;
|
|
19473
|
+
}
|
|
19474
|
+
}
|
|
19207
19475
|
if (rule.name === "shop") {
|
|
19208
19476
|
try {
|
|
19209
19477
|
const shopInfo = await props.extraConfig[rule.name].getShopInfo({
|
|
@@ -19245,10 +19513,30 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
|
19245
19513
|
return false;
|
|
19246
19514
|
return !formData.value[shopField];
|
|
19247
19515
|
}
|
|
19248
|
-
function
|
|
19516
|
+
function handleProductChange(value, rule, row) {
|
|
19517
|
+
row[rule.field] = value;
|
|
19518
|
+
if (isProductCenterSuit.value && rule.field === "productCode") {
|
|
19519
|
+
Object.keys(row).forEach((key) => {
|
|
19520
|
+
if (!["productCode", "_X_ROW_KEY"].includes(key)) {
|
|
19521
|
+
row[key] = void 0;
|
|
19522
|
+
}
|
|
19523
|
+
});
|
|
19524
|
+
}
|
|
19525
|
+
if (rule.config.fetchMode !== "blur") {
|
|
19526
|
+
queryProductInfo(rule, row);
|
|
19527
|
+
}
|
|
19528
|
+
}
|
|
19529
|
+
function handleProductPressEnter(value, rule, row) {
|
|
19249
19530
|
row[rule.field] = value;
|
|
19250
19531
|
queryProductInfo(rule, row);
|
|
19251
19532
|
}
|
|
19533
|
+
function handleCustomerChange(value, rule, row) {
|
|
19534
|
+
row[rule.field] = value;
|
|
19535
|
+
}
|
|
19536
|
+
function handleCustomerPressEnter(value, rule, row) {
|
|
19537
|
+
row[rule.field] = value;
|
|
19538
|
+
queryCustomerInfo(rule, row);
|
|
19539
|
+
}
|
|
19252
19540
|
function handleShopOption(value, rule, row) {
|
|
19253
19541
|
row[rule?.field] = value;
|
|
19254
19542
|
processAssociatedFields(
|
|
@@ -19259,7 +19547,7 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
|
19259
19547
|
);
|
|
19260
19548
|
}
|
|
19261
19549
|
function importDisabled() {
|
|
19262
|
-
return productInputSlots.filter((item) => item.config?.dataFiltering).some((item) => !formData.value[item.config.dataFiltering]);
|
|
19550
|
+
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
19551
|
}
|
|
19264
19552
|
vue.watch(
|
|
19265
19553
|
() => props.rule,
|
|
@@ -19279,77 +19567,276 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
|
19279
19567
|
deep: true
|
|
19280
19568
|
}
|
|
19281
19569
|
);
|
|
19570
|
+
const buttonLoadingForProductCenter = vue.ref({
|
|
19571
|
+
export: false,
|
|
19572
|
+
download: false,
|
|
19573
|
+
import: false
|
|
19574
|
+
});
|
|
19575
|
+
async function exportForProductCenter() {
|
|
19576
|
+
if (!tableConfig.value.template || tableConfig.value.template === "table") {
|
|
19577
|
+
return handleExport();
|
|
19578
|
+
}
|
|
19579
|
+
try {
|
|
19580
|
+
buttonLoadingForProductCenter.value.export = true;
|
|
19581
|
+
const selected = xGrid.value?.getCheckboxRecords?.();
|
|
19582
|
+
await props.extraConfig.table?.exportFetch?.({
|
|
19583
|
+
tableConfig: tableConfig.value,
|
|
19584
|
+
columns: validColumns.value,
|
|
19585
|
+
data: selected
|
|
19586
|
+
});
|
|
19587
|
+
} catch (error) {
|
|
19588
|
+
console.log("\u{1F680} ~ error:", error);
|
|
19589
|
+
} finally {
|
|
19590
|
+
buttonLoadingForProductCenter.value.export = false;
|
|
19591
|
+
}
|
|
19592
|
+
}
|
|
19593
|
+
async function downloadTemplateForProductCenter() {
|
|
19594
|
+
if (!tableConfig.value.template || tableConfig.value.template === "table") {
|
|
19595
|
+
return handleDownload();
|
|
19596
|
+
}
|
|
19597
|
+
try {
|
|
19598
|
+
buttonLoadingForProductCenter.value.download = true;
|
|
19599
|
+
await props.extraConfig.table?.downloadTemplateFetch?.({
|
|
19600
|
+
tableConfig: tableConfig.value,
|
|
19601
|
+
tableRules: props.rule.config.childRules,
|
|
19602
|
+
columns: validColumns.value
|
|
19603
|
+
});
|
|
19604
|
+
} catch (error) {
|
|
19605
|
+
console.log("\u{1F680} ~ error:", error);
|
|
19606
|
+
} finally {
|
|
19607
|
+
buttonLoadingForProductCenter.value.download = false;
|
|
19608
|
+
}
|
|
19609
|
+
}
|
|
19610
|
+
async function importHandleForProductCenter(e) {
|
|
19611
|
+
if (!tableConfig.value.template || tableConfig.value.template === "table") {
|
|
19612
|
+
return handleChange(e);
|
|
19613
|
+
}
|
|
19614
|
+
try {
|
|
19615
|
+
buttonLoadingForProductCenter.value.import = true;
|
|
19616
|
+
let tableRules = lodashEs.cloneDeep(props.rule.config?.childRules || []);
|
|
19617
|
+
tableRules.forEach((rule) => {
|
|
19618
|
+
const field = rule.field;
|
|
19619
|
+
let associatedFields = rule.config.associatedFields || [];
|
|
19620
|
+
associatedFields.forEach((associatedRule) => {
|
|
19621
|
+
associatedRule.field = productPicName(associatedRule.value, field);
|
|
19622
|
+
associatedRule.is = accosiationParseKeyMap[associatedRule.value];
|
|
19623
|
+
});
|
|
19624
|
+
});
|
|
19625
|
+
let res = await props.extraConfig.table?.importFetch?.({
|
|
19626
|
+
tableConfig: tableConfig.value,
|
|
19627
|
+
tableRules,
|
|
19628
|
+
columns: validColumns.value,
|
|
19629
|
+
filterByShopcode: props.rule?.config?.dataFiltering,
|
|
19630
|
+
dataFile: e.target.files?.[0]
|
|
19631
|
+
}) || {};
|
|
19632
|
+
if (res.promptMessage && !await utils__default["default"].confirmModal(res.promptMessage)) {
|
|
19633
|
+
return;
|
|
19634
|
+
}
|
|
19635
|
+
if (res.templateDataList?.length) {
|
|
19636
|
+
data.push(...res.templateDataList);
|
|
19637
|
+
}
|
|
19638
|
+
const numFormatter = (value) => utils__default["default"].toFixNumHasDefault(value, 0, false, "0");
|
|
19639
|
+
if (!res.successNum) {
|
|
19640
|
+
let confirmRet = await utils__default["default"].confirmModal(
|
|
19641
|
+
`\u5BFC\u5165\u5931\u8D25\uFF0C\u5171${numFormatter(res.errorNum)}\u6761`,
|
|
19642
|
+
"\u63D0\u793A",
|
|
19643
|
+
"error",
|
|
19644
|
+
{
|
|
19645
|
+
okText: "\u4E0B\u8F7D\u9519\u8BEF\u6570\u636E"
|
|
19646
|
+
},
|
|
19647
|
+
"error"
|
|
19648
|
+
);
|
|
19649
|
+
if (confirmRet) {
|
|
19650
|
+
props.extraConfig.table?.downloadErrorFetch?.({
|
|
19651
|
+
tableConfig: tableConfig.value,
|
|
19652
|
+
columns: validColumns.value,
|
|
19653
|
+
data: res
|
|
19654
|
+
});
|
|
19655
|
+
}
|
|
19656
|
+
} else if (res.successNum === res.importNum) {
|
|
19657
|
+
let confirmRet = await utils__default["default"].confirmModal(
|
|
19658
|
+
`\u5BFC\u5165\u6210\u529F\uFF0C\u5171${numFormatter(res.successNum)}\u6761`,
|
|
19659
|
+
"\u63D0\u793A",
|
|
19660
|
+
"success",
|
|
19661
|
+
{
|
|
19662
|
+
okText: "\u77E5\u9053\u4E86"
|
|
19663
|
+
},
|
|
19664
|
+
"success"
|
|
19665
|
+
);
|
|
19666
|
+
} else {
|
|
19667
|
+
let confirmRet = await utils__default["default"].confirmModal(
|
|
19668
|
+
`\u5BFC\u5165\u6210\u529F${numFormatter(res.successNum)}\u6761\uFF0C\u5931\u8D25${numFormatter(
|
|
19669
|
+
res.errorNum
|
|
19670
|
+
)}\u6761`,
|
|
19671
|
+
"\u63D0\u793A",
|
|
19672
|
+
"warning",
|
|
19673
|
+
{
|
|
19674
|
+
okText: "\u4E0B\u8F7D\u9519\u8BEF\u6570\u636E"
|
|
19675
|
+
},
|
|
19676
|
+
"warning"
|
|
19677
|
+
);
|
|
19678
|
+
if (confirmRet) {
|
|
19679
|
+
props.extraConfig.table?.downloadErrorFetch?.({
|
|
19680
|
+
tableConfig: tableConfig.value,
|
|
19681
|
+
columns: validColumns.value,
|
|
19682
|
+
data: res
|
|
19683
|
+
});
|
|
19684
|
+
}
|
|
19685
|
+
}
|
|
19686
|
+
} catch (error) {
|
|
19687
|
+
console.log("\u{1F680} ~ error:", error);
|
|
19688
|
+
} finally {
|
|
19689
|
+
buttonLoadingForProductCenter.value.import = false;
|
|
19690
|
+
e.target.value = "";
|
|
19691
|
+
}
|
|
19692
|
+
}
|
|
19693
|
+
function getProductClearSetting(field) {
|
|
19694
|
+
let setting = props.rule.config.childRules?.find((rule) => {
|
|
19695
|
+
return rule.field === field;
|
|
19696
|
+
});
|
|
19697
|
+
return !!setting?.config?.doNotClearAfterFilterChange;
|
|
19698
|
+
}
|
|
19282
19699
|
return (_ctx, _cache) => {
|
|
19283
19700
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$5, [
|
|
19284
19701
|
vue.createElementVNode("div", _hoisted_2$4, [
|
|
19285
19702
|
vue.createTextVNode(vue.toDisplayString(__props.rule.title.title) + " ", 1),
|
|
19286
19703
|
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", {
|
|
19704
|
+
vue.createCommentVNode(" \u5546\u54C1\u4E2D\u5FC3\u5B9A\u5236 \u6309\u94AE "),
|
|
19705
|
+
vue.unref(isProductCenter) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$3, [
|
|
19706
|
+
!__props.hidden ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
19707
|
+
vue.unref(tableConfig).buttons?.includes("import") ? (vue.openBlock(), vue.createElementBlock("input", {
|
|
19708
|
+
key: 0,
|
|
19301
19709
|
ref_key: "inputRef",
|
|
19302
19710
|
ref: inputRef,
|
|
19303
19711
|
style: { "display": "none" },
|
|
19304
19712
|
name: "file",
|
|
19305
19713
|
type: "file",
|
|
19306
|
-
accept: "text/csv",
|
|
19307
|
-
onChange:
|
|
19308
|
-
}, null,
|
|
19309
|
-
vue.
|
|
19714
|
+
accept: vue.unref(tableConfig).template === "table" ? "text/csv" : "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel, .xlsx, .xls, .XLSX, .XLS",
|
|
19715
|
+
onChange: importHandleForProductCenter
|
|
19716
|
+
}, null, 40, _hoisted_5$3)) : vue.createCommentVNode("v-if", true),
|
|
19717
|
+
vue.unref(tableConfig).buttons?.includes("export") ? (vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.Button), {
|
|
19718
|
+
key: 1,
|
|
19310
19719
|
disabled: __props.disabled,
|
|
19311
|
-
|
|
19720
|
+
loading: buttonLoadingForProductCenter.value.export,
|
|
19721
|
+
onClick: exportForProductCenter
|
|
19312
19722
|
}, {
|
|
19313
19723
|
default: vue.withCtx(() => [
|
|
19314
|
-
vue.createTextVNode("\
|
|
19724
|
+
vue.createTextVNode("\u5BFC\u51FA")
|
|
19315
19725
|
]),
|
|
19316
19726
|
_: 1
|
|
19317
|
-
}, 8, ["disabled"]),
|
|
19318
|
-
vue.
|
|
19727
|
+
}, 8, ["disabled", "loading"])) : vue.createCommentVNode("v-if", true),
|
|
19728
|
+
vue.unref(tableConfig).buttons?.includes("downloadTemplate") ? (vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.Button), {
|
|
19729
|
+
key: 2,
|
|
19730
|
+
disabled: __props.disabled,
|
|
19731
|
+
loading: buttonLoadingForProductCenter.value.download,
|
|
19732
|
+
onClick: downloadTemplateForProductCenter
|
|
19733
|
+
}, {
|
|
19734
|
+
default: vue.withCtx(() => [
|
|
19735
|
+
vue.createTextVNode("\u4E0B\u8F7D\u5BFC\u5165\u6A21\u677F")
|
|
19736
|
+
]),
|
|
19737
|
+
_: 1
|
|
19738
|
+
}, 8, ["disabled", "loading"])) : vue.createCommentVNode("v-if", true),
|
|
19739
|
+
vue.unref(tableConfig).buttons?.includes("import") ? (vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.Button), {
|
|
19740
|
+
key: 3,
|
|
19319
19741
|
disabled: __props.disabled,
|
|
19742
|
+
loading: buttonLoadingForProductCenter.value.import,
|
|
19320
19743
|
onClick: handleImport
|
|
19321
19744
|
}, {
|
|
19322
19745
|
default: vue.withCtx(() => [
|
|
19323
19746
|
vue.createTextVNode("\u6279\u91CF\u5BFC\u5165")
|
|
19324
19747
|
]),
|
|
19325
19748
|
_: 1
|
|
19749
|
+
}, 8, ["disabled", "loading"])) : vue.createCommentVNode("v-if", true),
|
|
19750
|
+
vue.unref(tableConfig).buttons?.includes("delete") ? (vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.Button), {
|
|
19751
|
+
key: 4,
|
|
19752
|
+
disabled: __props.disabled,
|
|
19753
|
+
onClick: handleBatchDelete
|
|
19754
|
+
}, {
|
|
19755
|
+
default: vue.withCtx(() => [
|
|
19756
|
+
vue.createTextVNode("\u6279\u91CF\u5220\u9664")
|
|
19757
|
+
]),
|
|
19758
|
+
_: 1
|
|
19759
|
+
}, 8, ["disabled"])) : vue.createCommentVNode("v-if", true),
|
|
19760
|
+
vue.unref(tableConfig).buttons?.includes("add") ? (vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.Button), {
|
|
19761
|
+
key: 5,
|
|
19762
|
+
type: "primary",
|
|
19763
|
+
disabled: __props.disabled,
|
|
19764
|
+
onClick: handleAdd
|
|
19765
|
+
}, {
|
|
19766
|
+
default: vue.withCtx(() => [
|
|
19767
|
+
vue.createVNode(vue.unref(iconsVue.PlusOutlined)),
|
|
19768
|
+
vue.createTextVNode(" \u65B0\u589E")
|
|
19769
|
+
]),
|
|
19770
|
+
_: 1
|
|
19771
|
+
}, 8, ["disabled"])) : vue.createCommentVNode("v-if", true)
|
|
19772
|
+
], 64)) : vue.createCommentVNode("v-if", true)
|
|
19773
|
+
])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_6$3, [
|
|
19774
|
+
!__props.hidden ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
19775
|
+
vue.unref(exportFeature) ? (vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.Button), {
|
|
19776
|
+
key: 0,
|
|
19777
|
+
disabled: __props.disabled,
|
|
19778
|
+
onClick: handleExport
|
|
19779
|
+
}, {
|
|
19780
|
+
default: vue.withCtx(() => [
|
|
19781
|
+
vue.createTextVNode("\u5BFC\u51FA")
|
|
19782
|
+
]),
|
|
19783
|
+
_: 1
|
|
19784
|
+
}, 8, ["disabled"])) : vue.createCommentVNode("v-if", true),
|
|
19785
|
+
vue.createTextVNode("\xA0 "),
|
|
19786
|
+
vue.unref(importFeature) ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
19787
|
+
vue.createElementVNode("input", {
|
|
19788
|
+
ref_key: "inputRef",
|
|
19789
|
+
ref: inputRef,
|
|
19790
|
+
style: { "display": "none" },
|
|
19791
|
+
name: "file",
|
|
19792
|
+
type: "file",
|
|
19793
|
+
accept: "text/csv",
|
|
19794
|
+
onChange: handleChange
|
|
19795
|
+
}, null, 544),
|
|
19796
|
+
vue.createVNode(vue.unref(antDesignVue.Button), {
|
|
19797
|
+
disabled: __props.disabled,
|
|
19798
|
+
onClick: handleDownload
|
|
19799
|
+
}, {
|
|
19800
|
+
default: vue.withCtx(() => [
|
|
19801
|
+
vue.createTextVNode("\u4E0B\u8F7D\u6A21\u677F")
|
|
19802
|
+
]),
|
|
19803
|
+
_: 1
|
|
19804
|
+
}, 8, ["disabled"]),
|
|
19805
|
+
vue.createVNode(vue.unref(antDesignVue.Button), {
|
|
19806
|
+
disabled: __props.disabled,
|
|
19807
|
+
onClick: handleImport
|
|
19808
|
+
}, {
|
|
19809
|
+
default: vue.withCtx(() => [
|
|
19810
|
+
vue.createTextVNode("\u6279\u91CF\u5BFC\u5165")
|
|
19811
|
+
]),
|
|
19812
|
+
_: 1
|
|
19813
|
+
}, 8, ["disabled"])
|
|
19814
|
+
], 64)) : vue.createCommentVNode("v-if", true),
|
|
19815
|
+
vue.unref(deleteFeature) ? (vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.Button), {
|
|
19816
|
+
key: 2,
|
|
19817
|
+
disabled: __props.disabled,
|
|
19818
|
+
onClick: handleBatchDelete
|
|
19819
|
+
}, {
|
|
19820
|
+
default: vue.withCtx(() => [
|
|
19821
|
+
vue.createTextVNode("\u6279\u91CF\u5220\u9664")
|
|
19822
|
+
]),
|
|
19823
|
+
_: 1
|
|
19824
|
+
}, 8, ["disabled"])) : vue.createCommentVNode("v-if", true),
|
|
19825
|
+
vue.createVNode(vue.unref(antDesignVue.Button), {
|
|
19826
|
+
type: "primary",
|
|
19827
|
+
disabled: __props.disabled,
|
|
19828
|
+
onClick: handleAdd
|
|
19829
|
+
}, {
|
|
19830
|
+
default: vue.withCtx(() => [
|
|
19831
|
+
vue.createVNode(vue.unref(iconsVue.PlusOutlined)),
|
|
19832
|
+
vue.createTextVNode(" \u65B0\u589E ")
|
|
19833
|
+
]),
|
|
19834
|
+
_: 1
|
|
19326
19835
|
}, 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
|
-
])
|
|
19836
|
+
], 64)) : vue.createCommentVNode("v-if", true)
|
|
19837
|
+
]))
|
|
19351
19838
|
]),
|
|
19352
|
-
vue.createElementVNode("div",
|
|
19839
|
+
vue.createElementVNode("div", _hoisted_7$3, [
|
|
19353
19840
|
vue.createVNode(vue.unref(antDesignVue.FormItemRest), null, {
|
|
19354
19841
|
default: vue.withCtx(() => [
|
|
19355
19842
|
vue.createVNode(vue.unref(components.BmFloatTable), {
|
|
@@ -19394,8 +19881,12 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
|
19394
19881
|
value: row[item.field],
|
|
19395
19882
|
disabled: item.disabled || pruductInputDisabled(item.config?.dataFiltering),
|
|
19396
19883
|
"shop-value": vue.unref(formData)[item.config.dataFiltering],
|
|
19397
|
-
|
|
19398
|
-
|
|
19884
|
+
"do-not-clear-after-filter-change": getProductClearSetting(item.field),
|
|
19885
|
+
"fetch-mode": item.config.fetchMode,
|
|
19886
|
+
onChange: ($event) => handleProductChange($event, item, row),
|
|
19887
|
+
onBlur: ($event) => handleProductPressEnter($event, item, row),
|
|
19888
|
+
onPressEnter: ($event) => handleProductPressEnter($event, item, row)
|
|
19889
|
+
}, null, 8, ["value", "disabled", "shop-value", "do-not-clear-after-filter-change", "fetch-mode", "onChange", "onBlur", "onPressEnter"])
|
|
19399
19890
|
])
|
|
19400
19891
|
};
|
|
19401
19892
|
}),
|
|
@@ -19421,8 +19912,10 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
|
19421
19912
|
value: row[item.field],
|
|
19422
19913
|
disabled: item.disabled || pruductInputDisabled(item.config?.dataFiltering),
|
|
19423
19914
|
"shop-value": vue.unref(formData)[item.config.dataFiltering],
|
|
19424
|
-
onChange: ($event) =>
|
|
19425
|
-
|
|
19915
|
+
onChange: ($event) => handleCustomerChange($event, item, row),
|
|
19916
|
+
onBlur: ($event) => handleCustomerPressEnter($event, item, row),
|
|
19917
|
+
onPressEnter: ($event) => handleCustomerPressEnter($event, item, row)
|
|
19918
|
+
}, null, 8, ["value", "disabled", "shop-value", "onChange", "onBlur", "onPressEnter"])
|
|
19426
19919
|
])
|
|
19427
19920
|
};
|
|
19428
19921
|
})
|
|
@@ -19826,7 +20319,7 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
|
|
|
19826
20319
|
flex: 1
|
|
19827
20320
|
}, {
|
|
19828
20321
|
default: vue.withCtx(() => [
|
|
19829
|
-
vue.createTextVNode(vue.toDisplayString(pane.tempSelected.materialCategoryNameShow || "\u7CFB\u7EDF\u81EA\u52A8\
|
|
20322
|
+
vue.createTextVNode(vue.toDisplayString(pane.tempSelected.materialCategoryNameShow || "\u7CFB\u7EDF\u81EA\u52A8\u83B7\u53D6"), 1)
|
|
19830
20323
|
]),
|
|
19831
20324
|
_: 2
|
|
19832
20325
|
}, 1024)
|
|
@@ -20009,6 +20502,7 @@ var MaterialTemp = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__file", "materia
|
|
|
20009
20502
|
var materialTemp = {
|
|
20010
20503
|
name: 'materialTemp',
|
|
20011
20504
|
rule(data, extraConfig) {
|
|
20505
|
+
var _a;
|
|
20012
20506
|
return {
|
|
20013
20507
|
native: true,
|
|
20014
20508
|
type: 'div',
|
|
@@ -20037,14 +20531,19 @@ var materialTemp = {
|
|
|
20037
20531
|
validate: [
|
|
20038
20532
|
{
|
|
20039
20533
|
validator(rule, value) {
|
|
20534
|
+
var _a, _b, _c;
|
|
20040
20535
|
if (isNull.isNull(value)) {
|
|
20041
20536
|
return Promise.reject();
|
|
20042
20537
|
}
|
|
20043
20538
|
const panes = value.panes;
|
|
20539
|
+
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
20540
|
for (const pane of panes) {
|
|
20045
20541
|
if (!pane.tempIdSelected) {
|
|
20046
20542
|
return Promise.reject();
|
|
20047
20543
|
}
|
|
20544
|
+
if (requiredPicture && !((_c = pane.uploadList) === null || _c === void 0 ? void 0 : _c.length)) {
|
|
20545
|
+
return Promise.reject();
|
|
20546
|
+
}
|
|
20048
20547
|
if (pane.tableRequiredFields) {
|
|
20049
20548
|
for (const field of pane.tableRequiredFields) {
|
|
20050
20549
|
if (pane.tableData.some((row) => isNull.isNull(row[field]))) {
|
|
@@ -20055,7 +20554,7 @@ var materialTemp = {
|
|
|
20055
20554
|
}
|
|
20056
20555
|
return Promise.resolve();
|
|
20057
20556
|
},
|
|
20058
|
-
message: '请检查必填项',
|
|
20557
|
+
message: ((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请检查必填项',
|
|
20059
20558
|
},
|
|
20060
20559
|
],
|
|
20061
20560
|
},
|
|
@@ -20072,11 +20571,13 @@ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
|
20072
20571
|
props: [
|
|
20073
20572
|
"associatedFields",
|
|
20074
20573
|
"dataFiltering",
|
|
20574
|
+
"doNotClearAfterFilterChange",
|
|
20075
20575
|
"required",
|
|
20076
20576
|
"extraConfig",
|
|
20077
20577
|
"defalutValue",
|
|
20078
20578
|
"disabled",
|
|
20079
|
-
"formCreateInject"
|
|
20579
|
+
"formCreateInject",
|
|
20580
|
+
"fetchMode"
|
|
20080
20581
|
],
|
|
20081
20582
|
emits: ["change"],
|
|
20082
20583
|
setup(__props, { emit: emits }) {
|
|
@@ -20088,7 +20589,12 @@ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
|
20088
20589
|
\u5546\u54C1\u56FE\u7247: "picUrl",
|
|
20089
20590
|
\u5EFA\u8BAE\u96F6\u552E\u4EF7: "retailPrice",
|
|
20090
20591
|
\u5546\u54C1\u7BB1\u89C4: "carton",
|
|
20091
|
-
\u5546\u54C1\u5355\u4F4D: "unit"
|
|
20592
|
+
\u5546\u54C1\u5355\u4F4D: "unit",
|
|
20593
|
+
\u4E00\u7EA7\u5206\u7C7B: "categoryFirst",
|
|
20594
|
+
\u4E8C\u7EA7\u5206\u7C7B: "categorySecond",
|
|
20595
|
+
\u4E09\u7EA7\u5206\u7C7B: "categoryThrid",
|
|
20596
|
+
\u5546\u54C1\u7C7B\u578B: "productType",
|
|
20597
|
+
\u5546\u54C1\u6807\u7B7E: "productTag"
|
|
20092
20598
|
};
|
|
20093
20599
|
const unitMap = ["\u652F", "\u74F6", "\u5957", "\u7EC4", "\u7BB1", "\u4E2A", "\u5F20"];
|
|
20094
20600
|
const formData = vue.computed(() => props.formCreateInject.api.bind());
|
|
@@ -20145,7 +20651,7 @@ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
|
20145
20651
|
vue.watch(
|
|
20146
20652
|
() => formData.value[props.dataFiltering],
|
|
20147
20653
|
() => {
|
|
20148
|
-
if (inputValue.value) {
|
|
20654
|
+
if (inputValue.value && !props.doNotClearAfterFilterChange) {
|
|
20149
20655
|
reset();
|
|
20150
20656
|
}
|
|
20151
20657
|
}
|
|
@@ -20170,14 +20676,23 @@ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
|
20170
20676
|
}),
|
|
20171
20677
|
vue.createVNode(vue.unref(antDesignVue.Col), { flex: 1 }, {
|
|
20172
20678
|
default: vue.withCtx(() => [
|
|
20173
|
-
vue.
|
|
20679
|
+
props.fetchMode === "blur" ? (vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.Input), {
|
|
20680
|
+
key: 0,
|
|
20174
20681
|
value: inputValue.value,
|
|
20175
20682
|
"onUpdate:value": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event),
|
|
20176
20683
|
placeholder: "\u8BF7\u8F93\u5165",
|
|
20177
20684
|
disabled: __props.disabled || inputDisbale(__props.dataFiltering),
|
|
20685
|
+
onPressEnter: vue.unref(debounceFn),
|
|
20686
|
+
onBlur: handleBlur
|
|
20687
|
+
}, null, 8, ["value", "disabled", "onPressEnter"])) : (vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.Input), {
|
|
20688
|
+
key: 1,
|
|
20689
|
+
value: inputValue.value,
|
|
20690
|
+
"onUpdate:value": _cache[1] || (_cache[1] = ($event) => inputValue.value = $event),
|
|
20691
|
+
placeholder: "\u8BF7\u8F93\u5165",
|
|
20692
|
+
disabled: __props.disabled || inputDisbale(__props.dataFiltering),
|
|
20178
20693
|
onPressEnter: handleBlur,
|
|
20179
20694
|
onChange: handleChange
|
|
20180
|
-
}, null, 8, ["value", "disabled"])
|
|
20695
|
+
}, null, 8, ["value", "disabled"]))
|
|
20181
20696
|
]),
|
|
20182
20697
|
_: 1
|
|
20183
20698
|
})
|
|
@@ -20212,12 +20727,12 @@ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
|
20212
20727
|
class: "bm-fc-form-item__img",
|
|
20213
20728
|
src: __props.extraConfig.common.previewImg(getValue(field.value))
|
|
20214
20729
|
}, 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)
|
|
20730
|
+
vue.createTextVNode(vue.toDisplayString(unitMap[getValue(field.value)] || getValue(field.value)), 1)
|
|
20216
20731
|
], 64)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
|
|
20217
20732
|
vue.createTextVNode(vue.toDisplayString(getValue(field.value)), 1)
|
|
20218
20733
|
], 64))
|
|
20219
20734
|
], 64)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
20220
|
-
vue.createTextVNode("\u7CFB\u7EDF\u81EA\u52A8\
|
|
20735
|
+
vue.createTextVNode("\u7CFB\u7EDF\u81EA\u52A8\u83B7\u53D6")
|
|
20221
20736
|
], 64))
|
|
20222
20737
|
]),
|
|
20223
20738
|
_: 2
|
|
@@ -20240,19 +20755,23 @@ var ProductInfo = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__file", "product-
|
|
|
20240
20755
|
var product = {
|
|
20241
20756
|
name: 'product',
|
|
20242
20757
|
rule(data, extraConfig) {
|
|
20758
|
+
var _a;
|
|
20243
20759
|
return {
|
|
20244
20760
|
type: 'ProductInfo',
|
|
20245
20761
|
component: ProductInfo,
|
|
20246
20762
|
field: data.field,
|
|
20247
20763
|
effect: {
|
|
20248
|
-
required: data.effect.required &&
|
|
20764
|
+
required: data.effect.required &&
|
|
20765
|
+
(((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请输入商品编号'),
|
|
20249
20766
|
},
|
|
20250
20767
|
props: {
|
|
20251
20768
|
required: data.effect.required,
|
|
20252
20769
|
associatedFields: data.config.associatedFields,
|
|
20253
20770
|
dataFiltering: data.config.dataFiltering,
|
|
20771
|
+
doNotClearAfterFilterChange: data.config.doNotClearAfterFilterChange,
|
|
20254
20772
|
extraConfig: extraConfig,
|
|
20255
20773
|
defalutValue: data.value,
|
|
20774
|
+
fetchMode: data.config.fetchMode,
|
|
20256
20775
|
},
|
|
20257
20776
|
inject: true,
|
|
20258
20777
|
on: {
|
|
@@ -20269,19 +20788,23 @@ var product = {
|
|
|
20269
20788
|
};
|
|
20270
20789
|
},
|
|
20271
20790
|
rowRule(data, extraConfig) {
|
|
20791
|
+
var _a;
|
|
20272
20792
|
return {
|
|
20273
20793
|
type: 'ProductInfo',
|
|
20274
20794
|
component: ProductInfo,
|
|
20275
20795
|
field: data.field,
|
|
20276
20796
|
effect: {
|
|
20277
|
-
required: data.effect.required &&
|
|
20797
|
+
required: data.effect.required &&
|
|
20798
|
+
(((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请输入商品编号'),
|
|
20278
20799
|
},
|
|
20279
20800
|
props: {
|
|
20280
20801
|
required: data.effect.required,
|
|
20281
20802
|
associatedFields: data.config.associatedFields,
|
|
20282
20803
|
dataFiltering: data.config.dataFiltering,
|
|
20804
|
+
doNotClearAfterFilterChange: data.config.doNotClearAfterFilterChange,
|
|
20283
20805
|
defalutValue: data.value,
|
|
20284
20806
|
extraConfig: extraConfig,
|
|
20807
|
+
fetchMode: data.config.fetchMode,
|
|
20285
20808
|
},
|
|
20286
20809
|
inject: true,
|
|
20287
20810
|
on: {
|
|
@@ -20345,11 +20868,20 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
20345
20868
|
}
|
|
20346
20869
|
return false;
|
|
20347
20870
|
});
|
|
20871
|
+
function isProductCenterSuit(rule) {
|
|
20872
|
+
return [
|
|
20873
|
+
"F2CTemplate",
|
|
20874
|
+
"B2CTemplate",
|
|
20875
|
+
"DistributeTemp",
|
|
20876
|
+
"FreshTemplate",
|
|
20877
|
+
"activityApply"
|
|
20878
|
+
].includes(rule.name);
|
|
20879
|
+
}
|
|
20348
20880
|
function isAssociatedFn(rule) {
|
|
20349
|
-
if (rule?.config?.dataFiltering === field.value) {
|
|
20881
|
+
if (rule?.config?.dataFiltering === field.value && !isProductCenterSuit(rule)) {
|
|
20350
20882
|
return true;
|
|
20351
20883
|
}
|
|
20352
|
-
if (rule?.config?.childRules?.length) {
|
|
20884
|
+
if (rule?.config?.childRules?.length && !isProductCenterSuit(rule)) {
|
|
20353
20885
|
for (const cRule of rule.config.childRules) {
|
|
20354
20886
|
if (isAssociatedFn(cRule))
|
|
20355
20887
|
return true;
|
|
@@ -20420,7 +20952,7 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
20420
20952
|
vue.createVNode(vue.unref(antDesignVue.Col), { flex: 1 }, {
|
|
20421
20953
|
default: vue.withCtx(() => [
|
|
20422
20954
|
vue.createVNode(vue.unref(antDesignVue.Select), {
|
|
20423
|
-
value: __props.formCreateInject?.rule?.value?.value || __props.value?.value,
|
|
20955
|
+
value: __props.formCreateInject?.rule?.value?.value || __props.value?.value || null,
|
|
20424
20956
|
placeholder: "\u8BF7\u9009\u62E9",
|
|
20425
20957
|
"show-search": "",
|
|
20426
20958
|
"show-arrow": false,
|
|
@@ -20465,7 +20997,7 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
20465
20997
|
getValue(field2.value) ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
20466
20998
|
vue.createTextVNode(vue.toDisplayString(getValue(field2.value)), 1)
|
|
20467
20999
|
], 64)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
20468
|
-
vue.createTextVNode("\u7CFB\u7EDF\u81EA\u52A8\
|
|
21000
|
+
vue.createTextVNode("\u7CFB\u7EDF\u81EA\u52A8\u83B7\u53D6")
|
|
20469
21001
|
], 64))
|
|
20470
21002
|
]),
|
|
20471
21003
|
_: 2
|
|
@@ -20488,17 +21020,17 @@ var ShopWidget = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__file", "shop-widg
|
|
|
20488
21020
|
var shop = {
|
|
20489
21021
|
name: 'shop',
|
|
20490
21022
|
rule(data, extraConfig) {
|
|
20491
|
-
var _a;
|
|
21023
|
+
var _a, _b;
|
|
20492
21024
|
const shopExtraConfig = extraConfig.shop;
|
|
20493
21025
|
return {
|
|
20494
21026
|
type: 'ShopWidget',
|
|
20495
21027
|
component: ShopWidget,
|
|
20496
21028
|
field: data.field,
|
|
20497
21029
|
effect: {
|
|
20498
|
-
required: data.effect.required && '请选择店铺',
|
|
21030
|
+
required: data.effect.required && (((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请选择店铺'),
|
|
20499
21031
|
},
|
|
20500
21032
|
props: {
|
|
20501
|
-
dataFiltering: (
|
|
21033
|
+
dataFiltering: (_b = data.config) === null || _b === void 0 ? void 0 : _b.dataFiltering,
|
|
20502
21034
|
associatedFields: data.config.associatedFields,
|
|
20503
21035
|
extraConfig: shopExtraConfig,
|
|
20504
21036
|
required: data.effect.required,
|
|
@@ -20520,19 +21052,20 @@ var shop = {
|
|
|
20520
21052
|
};
|
|
20521
21053
|
},
|
|
20522
21054
|
rowRule(data, extraConfig) {
|
|
20523
|
-
var _a;
|
|
21055
|
+
var _a, _b;
|
|
20524
21056
|
const shopExtraConfig = extraConfig.shop;
|
|
20525
21057
|
return {
|
|
20526
21058
|
type: 'ShopWidget',
|
|
20527
21059
|
component: ShopWidget,
|
|
20528
|
-
title: data.title.title,
|
|
20529
21060
|
field: data.field,
|
|
20530
21061
|
effect: {
|
|
20531
|
-
required: data.effect.required && '请选择店铺',
|
|
21062
|
+
required: data.effect.required && (((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请选择店铺'),
|
|
20532
21063
|
},
|
|
20533
21064
|
props: {
|
|
20534
|
-
dataFiltering: (
|
|
21065
|
+
dataFiltering: (_b = data.config) === null || _b === void 0 ? void 0 : _b.dataFiltering,
|
|
20535
21066
|
extraConfig: shopExtraConfig,
|
|
21067
|
+
associatedFields: data.config.associatedFields,
|
|
21068
|
+
title: `${data.title.title}`,
|
|
20536
21069
|
},
|
|
20537
21070
|
inject: true,
|
|
20538
21071
|
on: {
|
|
@@ -20547,7 +21080,7 @@ var shop = {
|
|
|
20547
21080
|
},
|
|
20548
21081
|
},
|
|
20549
21082
|
col: {
|
|
20550
|
-
span:
|
|
21083
|
+
span: 24,
|
|
20551
21084
|
},
|
|
20552
21085
|
value: data.value,
|
|
20553
21086
|
};
|
|
@@ -20650,6 +21183,7 @@ var materialType$1 = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__file", "mater
|
|
|
20650
21183
|
var materialType = {
|
|
20651
21184
|
name: 'materialType',
|
|
20652
21185
|
rule(data, extraConfig) {
|
|
21186
|
+
var _a;
|
|
20653
21187
|
return {
|
|
20654
21188
|
type: 'materialType',
|
|
20655
21189
|
component: materialType$1,
|
|
@@ -20660,7 +21194,7 @@ var materialType = {
|
|
|
20660
21194
|
required: data.effect.required,
|
|
20661
21195
|
type: 'array',
|
|
20662
21196
|
min: 1,
|
|
20663
|
-
message: '请选择素材类型',
|
|
21197
|
+
message: ((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请选择素材类型',
|
|
20664
21198
|
},
|
|
20665
21199
|
],
|
|
20666
21200
|
props: {
|
|
@@ -20688,6 +21222,7 @@ var materialType = {
|
|
|
20688
21222
|
};
|
|
20689
21223
|
},
|
|
20690
21224
|
rowRule(data, extraConfig) {
|
|
21225
|
+
var _a;
|
|
20691
21226
|
return {
|
|
20692
21227
|
type: 'materialType',
|
|
20693
21228
|
component: materialType$1,
|
|
@@ -20698,7 +21233,7 @@ var materialType = {
|
|
|
20698
21233
|
required: data.effect.required,
|
|
20699
21234
|
type: 'array',
|
|
20700
21235
|
min: 1,
|
|
20701
|
-
message: '请选择素材类型',
|
|
21236
|
+
message: ((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请选择素材类型',
|
|
20702
21237
|
},
|
|
20703
21238
|
],
|
|
20704
21239
|
props: {
|
|
@@ -20787,7 +21322,7 @@ var row = {
|
|
|
20787
21322
|
var department = {
|
|
20788
21323
|
name: 'department',
|
|
20789
21324
|
rule(data, extraConfig) {
|
|
20790
|
-
var _a;
|
|
21325
|
+
var _a, _b;
|
|
20791
21326
|
return {
|
|
20792
21327
|
type: 'StaffSelector',
|
|
20793
21328
|
component: StaffSelector,
|
|
@@ -20809,7 +21344,7 @@ var department = {
|
|
|
20809
21344
|
fieldNames: (_a = extraConfig.department) === null || _a === void 0 ? void 0 : _a.fieldNames,
|
|
20810
21345
|
},
|
|
20811
21346
|
effect: {
|
|
20812
|
-
required: data.effect.required && '请选择',
|
|
21347
|
+
required: data.effect.required && (((_b = data.effect) === null || _b === void 0 ? void 0 : _b.requiredTip) || '请选择'),
|
|
20813
21348
|
},
|
|
20814
21349
|
wrap: {
|
|
20815
21350
|
wrapperCol: {
|
|
@@ -20821,18 +21356,21 @@ var department = {
|
|
|
20821
21356
|
change(inject, list) {
|
|
20822
21357
|
const rule = inject.self;
|
|
20823
21358
|
rule.props.defaultSelected = list;
|
|
20824
|
-
|
|
20825
|
-
|
|
20826
|
-
|
|
20827
|
-
|
|
20828
|
-
|
|
21359
|
+
vue.nextTick(() => {
|
|
21360
|
+
rule.props.defaultSelected = list;
|
|
21361
|
+
inject.api.form[rule.field] = list;
|
|
21362
|
+
inject.api.validateField(rule.field, () => {
|
|
21363
|
+
if (list.length) {
|
|
21364
|
+
inject.api.clearValidateState(rule.field);
|
|
21365
|
+
}
|
|
21366
|
+
});
|
|
20829
21367
|
});
|
|
20830
21368
|
},
|
|
20831
21369
|
},
|
|
20832
21370
|
};
|
|
20833
21371
|
},
|
|
20834
21372
|
rowRule(data, extraConfig) {
|
|
20835
|
-
var _a;
|
|
21373
|
+
var _a, _b;
|
|
20836
21374
|
return {
|
|
20837
21375
|
type: 'StaffSelector',
|
|
20838
21376
|
component: StaffSelector,
|
|
@@ -20854,7 +21392,7 @@ var department = {
|
|
|
20854
21392
|
fieldNames: (_a = extraConfig.department) === null || _a === void 0 ? void 0 : _a.fieldNames,
|
|
20855
21393
|
},
|
|
20856
21394
|
effect: {
|
|
20857
|
-
required: data.effect.required && '请选择',
|
|
21395
|
+
required: data.effect.required && (((_b = data.effect) === null || _b === void 0 ? void 0 : _b.requiredTip) || '请选择'),
|
|
20858
21396
|
},
|
|
20859
21397
|
col: {
|
|
20860
21398
|
span: fieldRatioMap[data.config.fieldRatio],
|
|
@@ -20864,11 +21402,14 @@ var department = {
|
|
|
20864
21402
|
change(inject, list) {
|
|
20865
21403
|
const rule = inject.self;
|
|
20866
21404
|
rule.props.defaultSelected = list;
|
|
20867
|
-
|
|
20868
|
-
|
|
20869
|
-
|
|
20870
|
-
|
|
20871
|
-
|
|
21405
|
+
vue.nextTick(() => {
|
|
21406
|
+
rule.props.defaultSelected = list;
|
|
21407
|
+
inject.api.form[rule.field] = list;
|
|
21408
|
+
inject.api.validateField(rule.field, () => {
|
|
21409
|
+
if (list.length) {
|
|
21410
|
+
inject.api.clearValidateState(rule.field);
|
|
21411
|
+
}
|
|
21412
|
+
});
|
|
20872
21413
|
});
|
|
20873
21414
|
},
|
|
20874
21415
|
},
|
|
@@ -20926,6 +21467,7 @@ function validator(rule, value) {
|
|
|
20926
21467
|
var table = {
|
|
20927
21468
|
name: 'table',
|
|
20928
21469
|
rule(data, extraConfig) {
|
|
21470
|
+
var _a;
|
|
20929
21471
|
return {
|
|
20930
21472
|
type: 'TableWidget',
|
|
20931
21473
|
component: TableWidget,
|
|
@@ -20947,12 +21489,14 @@ var table = {
|
|
|
20947
21489
|
validator(rule, value) {
|
|
20948
21490
|
return validator(data, value);
|
|
20949
21491
|
},
|
|
20950
|
-
message: '请检查必填项',
|
|
21492
|
+
message: ((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请检查必填项',
|
|
20951
21493
|
},
|
|
20952
21494
|
],
|
|
21495
|
+
wrap: data.wrap,
|
|
20953
21496
|
};
|
|
20954
21497
|
},
|
|
20955
21498
|
rowRule(data, extraConfig) {
|
|
21499
|
+
var _a;
|
|
20956
21500
|
return {
|
|
20957
21501
|
type: 'TableWidget',
|
|
20958
21502
|
component: TableWidget,
|
|
@@ -20974,12 +21518,13 @@ var table = {
|
|
|
20974
21518
|
validator(rule, value) {
|
|
20975
21519
|
return validator(data, value);
|
|
20976
21520
|
},
|
|
20977
|
-
message: '请检查必填项',
|
|
21521
|
+
message: ((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请检查必填项',
|
|
20978
21522
|
},
|
|
20979
21523
|
],
|
|
20980
21524
|
col: {
|
|
20981
21525
|
span: 24,
|
|
20982
21526
|
},
|
|
21527
|
+
wrap: data.wrap,
|
|
20983
21528
|
};
|
|
20984
21529
|
},
|
|
20985
21530
|
};
|
|
@@ -21149,9 +21694,10 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
21149
21694
|
"formPermissions",
|
|
21150
21695
|
"resolveRulesConfig"
|
|
21151
21696
|
],
|
|
21152
|
-
emits: ["update:value"],
|
|
21697
|
+
emits: ["update:value", "change"],
|
|
21153
21698
|
setup(__props, { expose, emit: emits }) {
|
|
21154
21699
|
const props = __props;
|
|
21700
|
+
FC__default["default"].component("BmLabelTooltip", BmOverTooltips__default["default"]);
|
|
21155
21701
|
const formRuleList = vue.computed(() => {
|
|
21156
21702
|
if (typeof props.resolveRulesConfig === "function") {
|
|
21157
21703
|
const rules = props.resolveRulesConfig(ruleList);
|
|
@@ -21171,6 +21717,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
21171
21717
|
span: 24
|
|
21172
21718
|
}
|
|
21173
21719
|
},
|
|
21720
|
+
form: {
|
|
21721
|
+
title: ""
|
|
21722
|
+
},
|
|
21174
21723
|
submitBtn: false,
|
|
21175
21724
|
global: {
|
|
21176
21725
|
ShopWidget: {
|
|
@@ -21309,6 +21858,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
21309
21858
|
immediate: true
|
|
21310
21859
|
}
|
|
21311
21860
|
);
|
|
21861
|
+
function onChange(...reset) {
|
|
21862
|
+
emits("change", ...reset);
|
|
21863
|
+
}
|
|
21312
21864
|
expose({ fApi });
|
|
21313
21865
|
return (_ctx, _cache) => {
|
|
21314
21866
|
const _component_formCreate = vue.resolveComponent("formCreate", true);
|
|
@@ -21323,7 +21875,8 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
21323
21875
|
"model-value": __props.value,
|
|
21324
21876
|
option: vue.unref(option),
|
|
21325
21877
|
rule: rule.value,
|
|
21326
|
-
"onUpdate:modelValue": handleValue
|
|
21878
|
+
"onUpdate:modelValue": handleValue,
|
|
21879
|
+
onChange
|
|
21327
21880
|
}, null, 8, ["api", "model-value", "option", "rule"])
|
|
21328
21881
|
], 64);
|
|
21329
21882
|
};
|