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
|
@@ -8,7 +8,10 @@ import { BmTagsDisplay, BmFloatTable } from 'bm-admin-ui/es/components';
|
|
|
8
8
|
import { EyeOutlined, SearchOutlined, CheckCircleFilled, PlusOutlined } from '@ant-design/icons-vue';
|
|
9
9
|
import { cloneDeep, floor, debounce } from 'lodash-es';
|
|
10
10
|
import customParseFormat from 'dayjs/plugin/customParseFormat';
|
|
11
|
+
import utils from 'bm-admin-ui/es/utils';
|
|
11
12
|
import { isNull } from 'bm-admin-ui/es/utils/isNull';
|
|
13
|
+
import FC from '@form-create/ant-design-vue';
|
|
14
|
+
import BmOverTooltips from 'bm-admin-ui/es/components/over-tooltips';
|
|
12
15
|
|
|
13
16
|
const fieldRatioMap = {
|
|
14
17
|
'25%': 6,
|
|
@@ -27,6 +30,7 @@ function getContainer() {
|
|
|
27
30
|
var input = {
|
|
28
31
|
name: 'input',
|
|
29
32
|
rule(data) {
|
|
33
|
+
var _a;
|
|
30
34
|
return {
|
|
31
35
|
type: 'input',
|
|
32
36
|
field: data.field,
|
|
@@ -37,7 +41,7 @@ var input = {
|
|
|
37
41
|
},
|
|
38
42
|
value: data.value,
|
|
39
43
|
effect: {
|
|
40
|
-
required: data.effect.required && '请输入',
|
|
44
|
+
required: data.effect.required && (((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请输入'),
|
|
41
45
|
},
|
|
42
46
|
wrap: {
|
|
43
47
|
wrapperCol: {
|
|
@@ -47,6 +51,7 @@ var input = {
|
|
|
47
51
|
};
|
|
48
52
|
},
|
|
49
53
|
rowRule(data) {
|
|
54
|
+
var _a;
|
|
50
55
|
return {
|
|
51
56
|
type: 'input',
|
|
52
57
|
field: data.field,
|
|
@@ -57,7 +62,7 @@ var input = {
|
|
|
57
62
|
},
|
|
58
63
|
value: data.value,
|
|
59
64
|
effect: {
|
|
60
|
-
required: data.effect.required && '请输入',
|
|
65
|
+
required: data.effect.required && (((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请输入'),
|
|
61
66
|
},
|
|
62
67
|
col: {
|
|
63
68
|
span: fieldRatioMap[data.config.fieldRatio],
|
|
@@ -99,6 +104,7 @@ var input = {
|
|
|
99
104
|
var textarea = {
|
|
100
105
|
name: 'textarea',
|
|
101
106
|
rule(data) {
|
|
107
|
+
var _a;
|
|
102
108
|
return {
|
|
103
109
|
type: 'input',
|
|
104
110
|
field: data.field,
|
|
@@ -110,7 +116,7 @@ var textarea = {
|
|
|
110
116
|
},
|
|
111
117
|
value: data.value,
|
|
112
118
|
effect: {
|
|
113
|
-
required: data.effect.required && '请输入',
|
|
119
|
+
required: data.effect.required && (((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请输入'),
|
|
114
120
|
},
|
|
115
121
|
wrap: {
|
|
116
122
|
wrapperCol: {
|
|
@@ -120,6 +126,7 @@ var textarea = {
|
|
|
120
126
|
};
|
|
121
127
|
},
|
|
122
128
|
rowRule(data) {
|
|
129
|
+
var _a;
|
|
123
130
|
return {
|
|
124
131
|
type: 'input',
|
|
125
132
|
field: data.field,
|
|
@@ -131,7 +138,7 @@ var textarea = {
|
|
|
131
138
|
},
|
|
132
139
|
value: data.value,
|
|
133
140
|
effect: {
|
|
134
|
-
required: data.effect.required && '请输入',
|
|
141
|
+
required: data.effect.required && (((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请输入'),
|
|
135
142
|
},
|
|
136
143
|
col: {
|
|
137
144
|
span: fieldRatioMap[data.config.fieldRatio],
|
|
@@ -163,8 +170,9 @@ var textarea = {
|
|
|
163
170
|
},
|
|
164
171
|
};
|
|
165
172
|
|
|
166
|
-
function generateRowRule(data) {
|
|
167
|
-
|
|
173
|
+
function generateRowRule(data, InRow = false) {
|
|
174
|
+
var _a;
|
|
175
|
+
const config = {
|
|
168
176
|
type: 'inputNumber',
|
|
169
177
|
field: data.field,
|
|
170
178
|
title: data.title.title,
|
|
@@ -174,17 +182,25 @@ function generateRowRule(data) {
|
|
|
174
182
|
},
|
|
175
183
|
value: data.value,
|
|
176
184
|
effect: {
|
|
177
|
-
required: data.effect.required && '请输入',
|
|
178
|
-
},
|
|
179
|
-
wrap: {
|
|
180
|
-
wrapperCol: {
|
|
181
|
-
span: fieldRatioMap[data.config.fieldRatio],
|
|
182
|
-
},
|
|
185
|
+
required: data.effect.required && (((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请输入'),
|
|
183
186
|
},
|
|
184
187
|
style: {
|
|
185
188
|
width: '100%',
|
|
186
189
|
},
|
|
187
190
|
};
|
|
191
|
+
if (InRow) {
|
|
192
|
+
config['col'] = {
|
|
193
|
+
span: fieldRatioMap[data.config.fieldRatio],
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
else {
|
|
197
|
+
config['wrap'] = {
|
|
198
|
+
wrapperCol: {
|
|
199
|
+
span: fieldRatioMap[data.config.fieldRatio],
|
|
200
|
+
},
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
return config;
|
|
188
204
|
}
|
|
189
205
|
var numInput = {
|
|
190
206
|
name: 'numInput',
|
|
@@ -192,7 +208,7 @@ var numInput = {
|
|
|
192
208
|
return generateRowRule(data);
|
|
193
209
|
},
|
|
194
210
|
rowRule(data) {
|
|
195
|
-
return generateRowRule(data);
|
|
211
|
+
return generateRowRule(data, true);
|
|
196
212
|
},
|
|
197
213
|
tableRule(data) {
|
|
198
214
|
const field = data.field;
|
|
@@ -286,6 +302,7 @@ function handleRadioRule(rule) {
|
|
|
286
302
|
var radio = {
|
|
287
303
|
name: 'radio',
|
|
288
304
|
rule(data) {
|
|
305
|
+
var _a;
|
|
289
306
|
const rule = {
|
|
290
307
|
type: data.type,
|
|
291
308
|
field: data.field,
|
|
@@ -296,7 +313,7 @@ var radio = {
|
|
|
296
313
|
},
|
|
297
314
|
options: data.options,
|
|
298
315
|
effect: {
|
|
299
|
-
required: data.effect.required && '请选择',
|
|
316
|
+
required: data.effect.required && (((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请选择'),
|
|
300
317
|
},
|
|
301
318
|
wrap: {
|
|
302
319
|
wrapperCol: {
|
|
@@ -309,6 +326,7 @@ var radio = {
|
|
|
309
326
|
return rule;
|
|
310
327
|
},
|
|
311
328
|
rowRule(data) {
|
|
329
|
+
var _a;
|
|
312
330
|
const rule = {
|
|
313
331
|
type: data.type,
|
|
314
332
|
field: data.field,
|
|
@@ -319,7 +337,7 @@ var radio = {
|
|
|
319
337
|
},
|
|
320
338
|
options: data.options,
|
|
321
339
|
effect: {
|
|
322
|
-
required: data.effect.required && '请选择',
|
|
340
|
+
required: data.effect.required && (((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请选择'),
|
|
323
341
|
},
|
|
324
342
|
col: {
|
|
325
343
|
span: fieldRatioMap[data.config.fieldRatio],
|
|
@@ -358,15 +376,16 @@ var radio = {
|
|
|
358
376
|
var checkbox = {
|
|
359
377
|
name: 'checkbox',
|
|
360
378
|
rule(data) {
|
|
379
|
+
var _a;
|
|
361
380
|
const extraProps = data.type === 'select' ? { mode: 'multiple' } : {};
|
|
362
381
|
return {
|
|
363
382
|
type: data.type,
|
|
364
383
|
field: data.field,
|
|
365
384
|
title: data.title.title,
|
|
366
|
-
props: Object.assign({ placeholder: data.props.placeholder, allowClear: true }, extraProps),
|
|
385
|
+
props: Object.assign({ placeholder: data.props.placeholder, allowClear: true, maxTagCount: data.props.maxTagCount, maxTagPlaceholder: data.props.maxTagPlaceholder }, extraProps),
|
|
367
386
|
options: data.options,
|
|
368
387
|
effect: {
|
|
369
|
-
required: data.effect.required && '请选择',
|
|
388
|
+
required: data.effect.required && (((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请选择'),
|
|
370
389
|
},
|
|
371
390
|
wrap: {
|
|
372
391
|
wrapperCol: {
|
|
@@ -377,15 +396,16 @@ var checkbox = {
|
|
|
377
396
|
};
|
|
378
397
|
},
|
|
379
398
|
rowRule(data) {
|
|
399
|
+
var _a;
|
|
380
400
|
const extraProps = data.type === 'select' ? { mode: 'multiple' } : {};
|
|
381
401
|
return {
|
|
382
402
|
type: data.type,
|
|
383
403
|
field: data.field,
|
|
384
404
|
title: data.title.title,
|
|
385
|
-
props: Object.assign({ placeholder: data.props.placeholder, allowClear: true }, extraProps),
|
|
405
|
+
props: Object.assign({ placeholder: data.props.placeholder, allowClear: true, maxTagCount: data.props.maxTagCount, maxTagPlaceholder: data.props.maxTagPlaceholder }, extraProps),
|
|
386
406
|
options: data.options,
|
|
387
407
|
effect: {
|
|
388
|
-
required: data.effect.required && '请选择',
|
|
408
|
+
required: data.effect.required && (((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请选择'),
|
|
389
409
|
},
|
|
390
410
|
col: {
|
|
391
411
|
span: fieldRatioMap[data.config.fieldRatio],
|
|
@@ -408,6 +428,8 @@ var checkbox = {
|
|
|
408
428
|
options: data.options,
|
|
409
429
|
mode: 'multiple',
|
|
410
430
|
allowClear: true,
|
|
431
|
+
maxTagCount: data.props.maxTagCount,
|
|
432
|
+
maxTagPlaceholder: data.props.maxTagPlaceholder,
|
|
411
433
|
getPopupContainer: getContainer,
|
|
412
434
|
disabled: data.disabled,
|
|
413
435
|
'onUpdate:value': (value) => {
|
|
@@ -423,6 +445,7 @@ var checkbox = {
|
|
|
423
445
|
var date = {
|
|
424
446
|
name: 'date',
|
|
425
447
|
rule(data) {
|
|
448
|
+
var _a;
|
|
426
449
|
const format = data.props.format;
|
|
427
450
|
const value = data.config.defaultValue || data.value
|
|
428
451
|
? data.value
|
|
@@ -438,7 +461,7 @@ var date = {
|
|
|
438
461
|
props: Object.assign({ format, valueFormat: format, placeholder: data.props.placeholder }, extraProps),
|
|
439
462
|
value,
|
|
440
463
|
effect: {
|
|
441
|
-
required: data.effect.required && '请选择',
|
|
464
|
+
required: data.effect.required && (((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请选择'),
|
|
442
465
|
},
|
|
443
466
|
wrap: {
|
|
444
467
|
wrapperCol: {
|
|
@@ -451,6 +474,7 @@ var date = {
|
|
|
451
474
|
};
|
|
452
475
|
},
|
|
453
476
|
rowRule(data) {
|
|
477
|
+
var _a;
|
|
454
478
|
const format = data.props.format;
|
|
455
479
|
const value = data.config.defaultValue || data.value
|
|
456
480
|
? data.value
|
|
@@ -466,7 +490,7 @@ var date = {
|
|
|
466
490
|
props: Object.assign({ format, valueFormat: format, placeholder: data.props.placeholder }, extraProps),
|
|
467
491
|
value,
|
|
468
492
|
effect: {
|
|
469
|
-
required: data.effect.required && '请选择',
|
|
493
|
+
required: data.effect.required && (((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请选择'),
|
|
470
494
|
},
|
|
471
495
|
col: {
|
|
472
496
|
span: fieldRatioMap[data.config.fieldRatio],
|
|
@@ -512,6 +536,7 @@ var date = {
|
|
|
512
536
|
var dateRange = {
|
|
513
537
|
name: 'dateRange',
|
|
514
538
|
rule(data) {
|
|
539
|
+
var _a;
|
|
515
540
|
const format = data.props.format;
|
|
516
541
|
const extraProps = {
|
|
517
542
|
picker: format === 'YYYY-MM' ? 'month' : '',
|
|
@@ -523,7 +548,7 @@ var dateRange = {
|
|
|
523
548
|
title: data.title.title,
|
|
524
549
|
props: Object.assign({ range: true, separator: '~', format, valueFormat: format, placeholder: data.props.placeholder, getCalendarContainer: getContainer, getPopupContainer: getContainer }, extraProps),
|
|
525
550
|
effect: {
|
|
526
|
-
required: data.effect.required && '请选择',
|
|
551
|
+
required: data.effect.required && (((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请选择'),
|
|
527
552
|
},
|
|
528
553
|
wrap: {
|
|
529
554
|
wrapperCol: {
|
|
@@ -537,6 +562,7 @@ var dateRange = {
|
|
|
537
562
|
};
|
|
538
563
|
},
|
|
539
564
|
rowRule(data) {
|
|
565
|
+
var _a;
|
|
540
566
|
const format = data.props.format;
|
|
541
567
|
const extraProps = {
|
|
542
568
|
picker: format === 'YYYY-MM' ? 'month' : '',
|
|
@@ -548,7 +574,7 @@ var dateRange = {
|
|
|
548
574
|
title: data.title.title,
|
|
549
575
|
props: Object.assign({ range: true, separator: '~', format, valueFormat: format, placeholder: data.props.placeholder }, extraProps),
|
|
550
576
|
effect: {
|
|
551
|
-
required: data.effect.required && '请选择',
|
|
577
|
+
required: data.effect.required && (((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请选择'),
|
|
552
578
|
},
|
|
553
579
|
col: {
|
|
554
580
|
span: fieldRatioMap[data.config.fieldRatio],
|
|
@@ -639,6 +665,7 @@ function __awaiter(thisArg, _arguments, P, generator) {
|
|
|
639
665
|
var picture = {
|
|
640
666
|
name: 'picture',
|
|
641
667
|
rule(data, extraConfig) {
|
|
668
|
+
var _a;
|
|
642
669
|
const maxCount = data.props.extraProps.maxCount;
|
|
643
670
|
return {
|
|
644
671
|
type: 'Picture',
|
|
@@ -671,7 +698,7 @@ var picture = {
|
|
|
671
698
|
required: data.effect.required,
|
|
672
699
|
type: 'array',
|
|
673
700
|
min: 1,
|
|
674
|
-
message: '请上传图片',
|
|
701
|
+
message: ((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请上传图片',
|
|
675
702
|
},
|
|
676
703
|
],
|
|
677
704
|
inject: true,
|
|
@@ -690,6 +717,7 @@ var picture = {
|
|
|
690
717
|
};
|
|
691
718
|
},
|
|
692
719
|
rowRule(data, extraConfig) {
|
|
720
|
+
var _a;
|
|
693
721
|
const maxCount = data.props.extraProps.maxCount;
|
|
694
722
|
return {
|
|
695
723
|
type: 'Picture',
|
|
@@ -719,7 +747,7 @@ var picture = {
|
|
|
719
747
|
required: data.effect.required,
|
|
720
748
|
type: 'array',
|
|
721
749
|
min: 1,
|
|
722
|
-
message: '请上传图片',
|
|
750
|
+
message: ((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请上传图片',
|
|
723
751
|
},
|
|
724
752
|
],
|
|
725
753
|
inject: true,
|
|
@@ -745,6 +773,7 @@ var picture = {
|
|
|
745
773
|
var file = {
|
|
746
774
|
name: 'file',
|
|
747
775
|
rule(data, extraConfig) {
|
|
776
|
+
var _a;
|
|
748
777
|
return {
|
|
749
778
|
type: 'Picture',
|
|
750
779
|
component: Picture,
|
|
@@ -765,9 +794,14 @@ var file = {
|
|
|
765
794
|
validate: [
|
|
766
795
|
{
|
|
767
796
|
required: data.effect.required,
|
|
797
|
+
type: 'array',
|
|
798
|
+
min: 1,
|
|
799
|
+
message: ((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请上传附件',
|
|
800
|
+
},
|
|
801
|
+
{
|
|
768
802
|
type: 'array',
|
|
769
803
|
len: 1,
|
|
770
|
-
message: '
|
|
804
|
+
message: '附件数量不能超过1个',
|
|
771
805
|
},
|
|
772
806
|
],
|
|
773
807
|
inject: true,
|
|
@@ -786,6 +820,7 @@ var file = {
|
|
|
786
820
|
};
|
|
787
821
|
},
|
|
788
822
|
rowRule(data, extraConfig) {
|
|
823
|
+
var _a;
|
|
789
824
|
return {
|
|
790
825
|
type: 'Picture',
|
|
791
826
|
component: Picture,
|
|
@@ -806,9 +841,14 @@ var file = {
|
|
|
806
841
|
validate: [
|
|
807
842
|
{
|
|
808
843
|
required: data.effect.required,
|
|
844
|
+
type: 'array',
|
|
845
|
+
min: 1,
|
|
846
|
+
message: ((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请上传附件',
|
|
847
|
+
},
|
|
848
|
+
{
|
|
809
849
|
type: 'array',
|
|
810
850
|
len: 1,
|
|
811
|
-
message: '
|
|
851
|
+
message: '附件数量不能超过1个',
|
|
812
852
|
},
|
|
813
853
|
],
|
|
814
854
|
inject: true,
|
|
@@ -902,7 +942,7 @@ var StaffSelector = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__file", "staff-
|
|
|
902
942
|
var people = {
|
|
903
943
|
name: 'people',
|
|
904
944
|
rule(data, extraConfig) {
|
|
905
|
-
var _a;
|
|
945
|
+
var _a, _b;
|
|
906
946
|
return {
|
|
907
947
|
type: 'StaffSelector',
|
|
908
948
|
component: StaffSelector,
|
|
@@ -921,7 +961,7 @@ var people = {
|
|
|
921
961
|
fieldNames: (_a = extraConfig.people) === null || _a === void 0 ? void 0 : _a.fieldNames,
|
|
922
962
|
},
|
|
923
963
|
effect: {
|
|
924
|
-
required: data.effect.required && '请选择',
|
|
964
|
+
required: data.effect.required && (((_b = data.effect) === null || _b === void 0 ? void 0 : _b.requiredTip) || '请选择'),
|
|
925
965
|
},
|
|
926
966
|
wrap: {
|
|
927
967
|
wrapperCol: {
|
|
@@ -930,21 +970,24 @@ var people = {
|
|
|
930
970
|
},
|
|
931
971
|
inject: true,
|
|
932
972
|
on: {
|
|
933
|
-
change(
|
|
934
|
-
const rule =
|
|
973
|
+
change({ api, self }, list) {
|
|
974
|
+
const rule = self;
|
|
935
975
|
rule.props.defaultSelected = list;
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
976
|
+
nextTick(() => {
|
|
977
|
+
rule.props.defaultSelected = list;
|
|
978
|
+
api.form[rule.field] = list;
|
|
979
|
+
api.validateField(rule.field, () => {
|
|
980
|
+
if (list.length) {
|
|
981
|
+
api.clearValidateState(rule.field);
|
|
982
|
+
}
|
|
983
|
+
});
|
|
941
984
|
});
|
|
942
985
|
},
|
|
943
986
|
},
|
|
944
987
|
};
|
|
945
988
|
},
|
|
946
989
|
rowRule(data, extraConfig) {
|
|
947
|
-
var _a;
|
|
990
|
+
var _a, _b;
|
|
948
991
|
return {
|
|
949
992
|
type: 'StaffSelector',
|
|
950
993
|
component: StaffSelector,
|
|
@@ -963,21 +1006,24 @@ var people = {
|
|
|
963
1006
|
fieldNames: (_a = extraConfig.people) === null || _a === void 0 ? void 0 : _a.fieldNames,
|
|
964
1007
|
},
|
|
965
1008
|
effect: {
|
|
966
|
-
required: data.effect.required && '请选择',
|
|
1009
|
+
required: data.effect.required && (((_b = data.effect) === null || _b === void 0 ? void 0 : _b.requiredTip) || '请选择'),
|
|
967
1010
|
},
|
|
968
1011
|
col: {
|
|
969
1012
|
span: fieldRatioMap[data.config.fieldRatio],
|
|
970
1013
|
},
|
|
971
1014
|
inject: true,
|
|
972
1015
|
on: {
|
|
973
|
-
change(
|
|
974
|
-
const rule =
|
|
1016
|
+
change({ api, self }, list) {
|
|
1017
|
+
const rule = self;
|
|
975
1018
|
rule.props.defaultSelected = list;
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
1019
|
+
nextTick(() => {
|
|
1020
|
+
rule.props.defaultSelected = list;
|
|
1021
|
+
api.form[rule.field] = list;
|
|
1022
|
+
api.validateField(rule.field, () => {
|
|
1023
|
+
if (list.length) {
|
|
1024
|
+
api.clearValidateState(rule.field);
|
|
1025
|
+
}
|
|
1026
|
+
});
|
|
981
1027
|
});
|
|
982
1028
|
},
|
|
983
1029
|
},
|
|
@@ -1107,8 +1153,8 @@ const _hoisted_5$4 = {
|
|
|
1107
1153
|
key: 1,
|
|
1108
1154
|
class: "bm-fc-select-material-temp__content__circle"
|
|
1109
1155
|
};
|
|
1110
|
-
const _hoisted_6$
|
|
1111
|
-
const _hoisted_7$
|
|
1156
|
+
const _hoisted_6$4 = ["title"];
|
|
1157
|
+
const _hoisted_7$4 = { class: "bm-fc-select-material-temp__content__item-time" };
|
|
1112
1158
|
const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
1113
1159
|
__name: "select-material-temp",
|
|
1114
1160
|
props: [
|
|
@@ -1323,9 +1369,9 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
1323
1369
|
createElementVNode("span", {
|
|
1324
1370
|
class: "bm-fc-select-material-temp__content__name",
|
|
1325
1371
|
title: item.templateName
|
|
1326
|
-
}, toDisplayString(item.templateName), 9, _hoisted_6$
|
|
1372
|
+
}, toDisplayString(item.templateName), 9, _hoisted_6$4)
|
|
1327
1373
|
], 8, _hoisted_4$4),
|
|
1328
|
-
createElementVNode("div", _hoisted_7$
|
|
1374
|
+
createElementVNode("div", _hoisted_7$4, toDisplayString(unref(dayjs)(item.lastUpdateTime).format("YYYY/MM/DD")), 1)
|
|
1329
1375
|
])
|
|
1330
1376
|
]),
|
|
1331
1377
|
_: 2
|
|
@@ -18562,8 +18608,14 @@ var lodash = {exports: {}};
|
|
|
18562
18608
|
|
|
18563
18609
|
const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
18564
18610
|
__name: "product-input-in-table",
|
|
18565
|
-
props: [
|
|
18566
|
-
|
|
18611
|
+
props: [
|
|
18612
|
+
"value",
|
|
18613
|
+
"disabled",
|
|
18614
|
+
"shopValue",
|
|
18615
|
+
"doNotClearAfterFilterChange",
|
|
18616
|
+
"fetchMode"
|
|
18617
|
+
],
|
|
18618
|
+
emits: ["change", "blur", "pressEnter"],
|
|
18567
18619
|
setup(__props, { emit: emits }) {
|
|
18568
18620
|
const props = __props;
|
|
18569
18621
|
const debounceFn = lodash.exports.debounce(emitChange, 500);
|
|
@@ -18571,6 +18623,12 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
18571
18623
|
function emitChange(val) {
|
|
18572
18624
|
emits("change", val);
|
|
18573
18625
|
}
|
|
18626
|
+
function handleBlur(val) {
|
|
18627
|
+
emits("blur", val);
|
|
18628
|
+
}
|
|
18629
|
+
function handlePressEnter(val) {
|
|
18630
|
+
emits("pressEnter", val);
|
|
18631
|
+
}
|
|
18574
18632
|
watch(
|
|
18575
18633
|
() => props.value,
|
|
18576
18634
|
(val) => {
|
|
@@ -18583,17 +18641,29 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
18583
18641
|
watch(
|
|
18584
18642
|
() => props.shopValue,
|
|
18585
18643
|
() => {
|
|
18586
|
-
|
|
18644
|
+
if (!props.doNotClearAfterFilterChange) {
|
|
18645
|
+
emitChange("");
|
|
18646
|
+
}
|
|
18587
18647
|
}
|
|
18588
18648
|
);
|
|
18589
18649
|
return (_ctx, _cache) => {
|
|
18590
|
-
return openBlock(), createBlock(unref(Input), {
|
|
18650
|
+
return props.fetchMode === "blur" ? (openBlock(), createBlock(unref(Input), {
|
|
18651
|
+
key: 0,
|
|
18591
18652
|
value: inputValue.value,
|
|
18592
18653
|
"onUpdate:value": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event),
|
|
18593
18654
|
placeholder: "\u8BF7\u8F93\u5165",
|
|
18594
18655
|
disabled: __props.disabled,
|
|
18595
|
-
onChange: _cache[1] || (_cache[1] = ($event) =>
|
|
18596
|
-
|
|
18656
|
+
onChange: _cache[1] || (_cache[1] = ($event) => emitChange($event.target.value)),
|
|
18657
|
+
onBlur: _cache[2] || (_cache[2] = ($event) => handleBlur($event.target?.value)),
|
|
18658
|
+
onPressEnter: _cache[3] || (_cache[3] = ($event) => handlePressEnter($event.target?.value))
|
|
18659
|
+
}, null, 8, ["value", "disabled"])) : (openBlock(), createBlock(unref(Input), {
|
|
18660
|
+
key: 1,
|
|
18661
|
+
value: inputValue.value,
|
|
18662
|
+
"onUpdate:value": _cache[4] || (_cache[4] = ($event) => inputValue.value = $event),
|
|
18663
|
+
placeholder: "\u8BF7\u8F93\u5165",
|
|
18664
|
+
disabled: __props.disabled,
|
|
18665
|
+
onChange: _cache[5] || (_cache[5] = ($event) => unref(debounceFn)($event.target.value))
|
|
18666
|
+
}, null, 8, ["value", "disabled"]));
|
|
18597
18667
|
};
|
|
18598
18668
|
}
|
|
18599
18669
|
});
|
|
@@ -18602,14 +18672,20 @@ var ProductInput = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__file", "product
|
|
|
18602
18672
|
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
18603
18673
|
__name: "customer-input-in-table",
|
|
18604
18674
|
props: ["value", "disabled", "shopValue"],
|
|
18605
|
-
emits: ["change"],
|
|
18675
|
+
emits: ["change", "blur", "pressEnter"],
|
|
18606
18676
|
setup(__props, { emit: emits }) {
|
|
18607
18677
|
const props = __props;
|
|
18608
|
-
|
|
18678
|
+
lodash.exports.debounce(emitChange, 500);
|
|
18609
18679
|
const inputValue = ref();
|
|
18610
18680
|
function emitChange(val) {
|
|
18611
18681
|
emits("change", val);
|
|
18612
18682
|
}
|
|
18683
|
+
function handleBlur(val) {
|
|
18684
|
+
emits("blur", val);
|
|
18685
|
+
}
|
|
18686
|
+
function handlePressEnter(val) {
|
|
18687
|
+
emits("pressEnter", val);
|
|
18688
|
+
}
|
|
18613
18689
|
watch(
|
|
18614
18690
|
() => props.value,
|
|
18615
18691
|
(val) => {
|
|
@@ -18631,7 +18707,9 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
18631
18707
|
"onUpdate:value": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event),
|
|
18632
18708
|
placeholder: "\u8BF7\u8F93\u5165",
|
|
18633
18709
|
disabled: __props.disabled,
|
|
18634
|
-
onChange: _cache[1] || (_cache[1] = ($event) =>
|
|
18710
|
+
onChange: _cache[1] || (_cache[1] = ($event) => emitChange($event.target.value)),
|
|
18711
|
+
onBlur: _cache[2] || (_cache[2] = ($event) => handleBlur($event.target?.value)),
|
|
18712
|
+
onPressEnter: _cache[3] || (_cache[3] = ($event) => handlePressEnter($event.target?.value))
|
|
18635
18713
|
}, null, 8, ["value", "disabled"]);
|
|
18636
18714
|
};
|
|
18637
18715
|
}
|
|
@@ -18720,9 +18798,17 @@ var ShopInput = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__file", "shop-input
|
|
|
18720
18798
|
const _hoisted_1$5 = { class: "bm-dc-table-widget" };
|
|
18721
18799
|
const _hoisted_2$4 = { class: "bm-dc-table-widget__title" };
|
|
18722
18800
|
const _hoisted_3$3 = { class: "bm-dc-table-widget__title-samll" };
|
|
18723
|
-
const _hoisted_4$3 = {
|
|
18724
|
-
|
|
18725
|
-
|
|
18801
|
+
const _hoisted_4$3 = {
|
|
18802
|
+
key: 0,
|
|
18803
|
+
class: "bm-dc-table-widget__top-bar"
|
|
18804
|
+
};
|
|
18805
|
+
const _hoisted_5$3 = ["accept"];
|
|
18806
|
+
const _hoisted_6$3 = {
|
|
18807
|
+
key: 1,
|
|
18808
|
+
class: "bm-dc-table-widget__top-bar"
|
|
18809
|
+
};
|
|
18810
|
+
const _hoisted_7$3 = { class: "bm-dc-table-widget__table" };
|
|
18811
|
+
const _sfc_main$7 = defineComponent({
|
|
18726
18812
|
__name: "table-widget",
|
|
18727
18813
|
props: [
|
|
18728
18814
|
"rule",
|
|
@@ -18743,15 +18829,20 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
18743
18829
|
\u5EFA\u8BAE\u96F6\u552E\u4EF7: "retailPrice",
|
|
18744
18830
|
\u5546\u54C1\u7BB1\u89C4: "carton",
|
|
18745
18831
|
\u5546\u54C1\u5355\u4F4D: "unit",
|
|
18832
|
+
\u4E00\u7EA7\u5206\u7C7B: "categoryFirst",
|
|
18833
|
+
\u4E8C\u7EA7\u5206\u7C7B: "categorySecond",
|
|
18834
|
+
\u4E09\u7EA7\u5206\u7C7B: "categoryThrid",
|
|
18835
|
+
\u5546\u54C1\u7C7B\u578B: "productType",
|
|
18836
|
+
\u5546\u54C1\u6807\u7B7E: "productTag",
|
|
18746
18837
|
\u5E97\u94FA\u6240\u5C5E\u5E73\u53F0: "platformName",
|
|
18747
18838
|
\u6E20\u9053: "channelName",
|
|
18748
18839
|
\u6E20\u9053\u7C7B\u522B: "channelTypeName",
|
|
18749
|
-
\u5BA2\u6237\u7B80\u79F0: "",
|
|
18750
|
-
\u5BA2\u6237\u7C7B\u578B: "",
|
|
18751
|
-
\u5BA2\u6237\u7B49\u7EA7: "",
|
|
18752
|
-
\u6240\u5C5E\u5E97\u94FA: "",
|
|
18753
|
-
\u5E97\u94FA\u7F16\u53F7: "",
|
|
18754
|
-
SAP\u5BA2\u6237\u7F16\u53F7: ""
|
|
18840
|
+
\u5BA2\u6237\u7B80\u79F0: "clientShortName",
|
|
18841
|
+
\u5BA2\u6237\u7C7B\u578B: "b2bType",
|
|
18842
|
+
\u5BA2\u6237\u7B49\u7EA7: "b2bLevel",
|
|
18843
|
+
\u6240\u5C5E\u5E97\u94FA: "shopName",
|
|
18844
|
+
\u5E97\u94FA\u7F16\u53F7: "shopCode",
|
|
18845
|
+
SAP\u5BA2\u6237\u7F16\u53F7: "sapCode"
|
|
18755
18846
|
};
|
|
18756
18847
|
let indexMap = {
|
|
18757
18848
|
product: 0,
|
|
@@ -18767,6 +18858,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
18767
18858
|
const columns = reactive([]);
|
|
18768
18859
|
const data = reactive([]);
|
|
18769
18860
|
const config = computed(() => ({
|
|
18861
|
+
...props.rule?.config?.tableConfig,
|
|
18770
18862
|
columns: [...columns],
|
|
18771
18863
|
data: [...data],
|
|
18772
18864
|
columnConfig: {
|
|
@@ -18779,8 +18871,36 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
18779
18871
|
}
|
|
18780
18872
|
}
|
|
18781
18873
|
}));
|
|
18874
|
+
const xGrid = computed(() => bmFloatTableRef.value.xGrid || {});
|
|
18875
|
+
const inputRef = ref();
|
|
18876
|
+
const childRulesMap = computed(
|
|
18877
|
+
() => props.rule?.config?.childRules.reduce((result, item) => {
|
|
18878
|
+
result[item.field] = item;
|
|
18879
|
+
return result;
|
|
18880
|
+
}, {}) || {}
|
|
18881
|
+
);
|
|
18882
|
+
const productInputSlots = reactive([]);
|
|
18883
|
+
const shopInputSlots = reactive([]);
|
|
18884
|
+
const customerInputSlots = reactive([]);
|
|
18885
|
+
const formData = computed(
|
|
18886
|
+
() => props.formData || props.formCreateInject.api.bind()
|
|
18887
|
+
);
|
|
18888
|
+
const tableConfig = computed(() => props.rule?.config?.tableConfig || {});
|
|
18889
|
+
const validColumns = computed(() => columns.filter((c) => isValidColumn(c)));
|
|
18890
|
+
const isProductCenter = computed(
|
|
18891
|
+
() => tableConfig.value.system === "productCenter"
|
|
18892
|
+
);
|
|
18893
|
+
const isProductCenterSuit = computed(
|
|
18894
|
+
() => isProductCenter.value && [
|
|
18895
|
+
"F2CTemplate",
|
|
18896
|
+
"B2CTemplate",
|
|
18897
|
+
"DistributeTemp",
|
|
18898
|
+
"FreshTemplate",
|
|
18899
|
+
"activityApply"
|
|
18900
|
+
].includes(tableConfig.value.template)
|
|
18901
|
+
);
|
|
18782
18902
|
const countText = computed(() => {
|
|
18783
|
-
|
|
18903
|
+
let cache = {};
|
|
18784
18904
|
props.rule.config.childRules?.forEach((rule) => {
|
|
18785
18905
|
if (rule.name === "numInput" && rule.config.count) {
|
|
18786
18906
|
cache[rule.field] = { title: rule.title.title, count: 0 };
|
|
@@ -18792,30 +18912,31 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
18792
18912
|
cache[key].count += row[key];
|
|
18793
18913
|
});
|
|
18794
18914
|
});
|
|
18795
|
-
if (
|
|
18915
|
+
if (props.rule.config.showTotal) {
|
|
18916
|
+
cache = {
|
|
18917
|
+
_total: { title: "\u884C\u6570", count: data?.length || 0 },
|
|
18918
|
+
...cache
|
|
18919
|
+
};
|
|
18920
|
+
}
|
|
18921
|
+
if (Object.keys(cache).length) {
|
|
18922
|
+
if (isProductCenter.value) {
|
|
18923
|
+
return `\uFF08${Object.values(cache).reduce((pre, cur, index) => {
|
|
18924
|
+
if (index !== 0)
|
|
18925
|
+
pre += "\u3001";
|
|
18926
|
+
pre += `${cur.title}\u603B\u8BA1\uFF1A${cur.count}`;
|
|
18927
|
+
return pre;
|
|
18928
|
+
}, "")}\uFF09`;
|
|
18929
|
+
}
|
|
18796
18930
|
return `\uFF08\u5B57\u6BB5\u540D\u603B\u8BA1\uFF1A${Object.values(cache).reduce((pre, cur, index) => {
|
|
18797
18931
|
if (index !== 0)
|
|
18798
18932
|
pre += "\u3001";
|
|
18799
18933
|
pre += `${cur.title}\uFF1A${cur.count}`;
|
|
18800
18934
|
return pre;
|
|
18801
18935
|
}, "")}\uFF09`;
|
|
18802
|
-
else
|
|
18936
|
+
} else {
|
|
18803
18937
|
return "";
|
|
18938
|
+
}
|
|
18804
18939
|
});
|
|
18805
|
-
const xGrid = computed(() => bmFloatTableRef.value.xGrid || {});
|
|
18806
|
-
const inputRef = ref();
|
|
18807
|
-
const childRulesMap = computed(
|
|
18808
|
-
() => props.rule?.config?.childRules.reduce((result, item) => {
|
|
18809
|
-
result[item.field] = item;
|
|
18810
|
-
return result;
|
|
18811
|
-
}, {}) || {}
|
|
18812
|
-
);
|
|
18813
|
-
const productInputSlots = reactive([]);
|
|
18814
|
-
const shopInputSlots = reactive([]);
|
|
18815
|
-
const customerInputSlots = reactive([]);
|
|
18816
|
-
const formData = computed(
|
|
18817
|
-
() => props.formData || props.formCreateInject.api.bind()
|
|
18818
|
-
);
|
|
18819
18940
|
function isShow(key) {
|
|
18820
18941
|
return props.rule.config.tableAdvancedFeatures.includes(key);
|
|
18821
18942
|
}
|
|
@@ -18833,6 +18954,14 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
18833
18954
|
width: "54px"
|
|
18834
18955
|
});
|
|
18835
18956
|
}
|
|
18957
|
+
if (isProductCenterSuit.value) {
|
|
18958
|
+
columns.push({
|
|
18959
|
+
type: "seq",
|
|
18960
|
+
title: "\u5E8F\u53F7",
|
|
18961
|
+
width: "62px",
|
|
18962
|
+
align: "center"
|
|
18963
|
+
});
|
|
18964
|
+
}
|
|
18836
18965
|
childRules?.length && columns.push(
|
|
18837
18966
|
...childRules.reduce((pre, cur) => {
|
|
18838
18967
|
if (cur.hidden) {
|
|
@@ -18842,7 +18971,40 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
18842
18971
|
if (Object.keys(indexMap).includes(name)) {
|
|
18843
18972
|
pre.push(...getExtraColumns(cur));
|
|
18844
18973
|
} else {
|
|
18845
|
-
|
|
18974
|
+
let childField = cur.field;
|
|
18975
|
+
let title = cur.title?.title;
|
|
18976
|
+
if (isProductCenter.value && cur.field === "picUrl") {
|
|
18977
|
+
pre.push({
|
|
18978
|
+
field: childField,
|
|
18979
|
+
title,
|
|
18980
|
+
minWidth: "138px",
|
|
18981
|
+
slots: {
|
|
18982
|
+
default({ row }) {
|
|
18983
|
+
if (row?.[childField]) {
|
|
18984
|
+
return h("img", {
|
|
18985
|
+
src: props.extraConfig.common.previewImg(row[childField]),
|
|
18986
|
+
style: {
|
|
18987
|
+
width: "86px",
|
|
18988
|
+
height: "86px",
|
|
18989
|
+
padding: "8px"
|
|
18990
|
+
}
|
|
18991
|
+
});
|
|
18992
|
+
}
|
|
18993
|
+
return h(
|
|
18994
|
+
"div",
|
|
18995
|
+
{
|
|
18996
|
+
style: {
|
|
18997
|
+
color: "#9393A3"
|
|
18998
|
+
}
|
|
18999
|
+
},
|
|
19000
|
+
["\u7CFB\u7EDF\u81EA\u52A8\u83B7\u53D6"]
|
|
19001
|
+
);
|
|
19002
|
+
}
|
|
19003
|
+
}
|
|
19004
|
+
});
|
|
19005
|
+
} else {
|
|
19006
|
+
pre.push(ruleList[name].tableRule(cur, props.extraConfig));
|
|
19007
|
+
}
|
|
18846
19008
|
}
|
|
18847
19009
|
return pre;
|
|
18848
19010
|
}, [])
|
|
@@ -18888,10 +19050,25 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
18888
19050
|
const field = rule.field;
|
|
18889
19051
|
const associatedFields = rule.config.associatedFields;
|
|
18890
19052
|
configObj.slots.push(rule);
|
|
19053
|
+
function getBaseTitle() {
|
|
19054
|
+
let baseTitle = mainName;
|
|
19055
|
+
if (rule.name === "product") {
|
|
19056
|
+
baseTitle = `\u5546\u54C1\u7F16\u7801-${mainName}`;
|
|
19057
|
+
if (isProductCenterSuit.value && rule.field === "productCode") {
|
|
19058
|
+
baseTitle = "\u5546\u54C1\u7F16\u53F7";
|
|
19059
|
+
}
|
|
19060
|
+
} else if (rule.name === "customer") {
|
|
19061
|
+
baseTitle = `\u5BA2\u6237\u7F16\u53F7-${mainName}`;
|
|
19062
|
+
if (isProductCenterSuit.value && rule.field === "clientCode") {
|
|
19063
|
+
baseTitle = "\u5BA2\u6237\u7F16\u53F7";
|
|
19064
|
+
}
|
|
19065
|
+
}
|
|
19066
|
+
return baseTitle;
|
|
19067
|
+
}
|
|
18891
19068
|
const columns2 = [
|
|
18892
19069
|
{
|
|
18893
19070
|
field,
|
|
18894
|
-
title:
|
|
19071
|
+
title: getBaseTitle(),
|
|
18895
19072
|
headerClassName: rule.effect.required ? "is-required" : "",
|
|
18896
19073
|
minWidth: "138px",
|
|
18897
19074
|
slots: {
|
|
@@ -18899,7 +19076,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
18899
19076
|
}
|
|
18900
19077
|
}
|
|
18901
19078
|
];
|
|
18902
|
-
if (associatedFields
|
|
19079
|
+
if (associatedFields?.length) {
|
|
18903
19080
|
associatedFields.forEach((item) => {
|
|
18904
19081
|
const childField = productPicName(item.value, field);
|
|
18905
19082
|
columns2.push({
|
|
@@ -18925,7 +19102,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
18925
19102
|
color: "#9393A3"
|
|
18926
19103
|
}
|
|
18927
19104
|
},
|
|
18928
|
-
[row[childField] || "\u7CFB\u7EDF\u81EA\u52A8\
|
|
19105
|
+
[row[childField] || "\u7CFB\u7EDF\u81EA\u52A8\u83B7\u53D6"]
|
|
18929
19106
|
);
|
|
18930
19107
|
}
|
|
18931
19108
|
}
|
|
@@ -18935,22 +19112,50 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
18935
19112
|
return columns2;
|
|
18936
19113
|
}
|
|
18937
19114
|
function handleAdd(rowData) {
|
|
18938
|
-
|
|
19115
|
+
let defaultRowData = getRowData();
|
|
19116
|
+
if (Array.isArray(rowData)) {
|
|
19117
|
+
rowData.forEach((item) => {
|
|
19118
|
+
Object.keys(defaultRowData).forEach((field) => {
|
|
19119
|
+
if (item[field] === void 0) {
|
|
19120
|
+
item[field] = defaultRowData[field];
|
|
19121
|
+
}
|
|
19122
|
+
});
|
|
19123
|
+
});
|
|
19124
|
+
}
|
|
19125
|
+
Array.isArray(rowData) ? data.push(...rowData) : data.push(defaultRowData);
|
|
18939
19126
|
}
|
|
18940
19127
|
function handleCopy(row) {
|
|
18941
19128
|
const newData = cloneDeep(row);
|
|
18942
19129
|
delete newData._X_ROW_KEY;
|
|
18943
19130
|
data.push(newData);
|
|
18944
19131
|
}
|
|
18945
|
-
function handleDelete(index) {
|
|
18946
|
-
|
|
19132
|
+
async function handleDelete(index, needConfirm = true) {
|
|
19133
|
+
if (isProductCenter.value && needConfirm) {
|
|
19134
|
+
if (await utils.confirmModal("\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u9879\uFF1F")) {
|
|
19135
|
+
data.splice(index, 1);
|
|
19136
|
+
}
|
|
19137
|
+
} else {
|
|
19138
|
+
data.splice(index, 1);
|
|
19139
|
+
}
|
|
18947
19140
|
}
|
|
18948
|
-
function handleBatchDelete() {
|
|
19141
|
+
async function handleBatchDelete() {
|
|
18949
19142
|
const selected = xGrid.value.getCheckboxRecords();
|
|
18950
|
-
selected
|
|
18951
|
-
|
|
18952
|
-
|
|
18953
|
-
|
|
19143
|
+
if (!selected?.length) {
|
|
19144
|
+
return;
|
|
19145
|
+
}
|
|
19146
|
+
if (isProductCenter.value) {
|
|
19147
|
+
if (await utils.confirmModal(`\u786E\u5B9A\u8981\u5220\u9664\u6240\u9009\u7684${selected?.length}\u6761\u6570\u636E\u4E48\uFF1F`)) {
|
|
19148
|
+
selected.forEach((item) => {
|
|
19149
|
+
const index = data.indexOf(item);
|
|
19150
|
+
handleDelete(index, false);
|
|
19151
|
+
});
|
|
19152
|
+
}
|
|
19153
|
+
} else {
|
|
19154
|
+
selected.forEach((item) => {
|
|
19155
|
+
const index = data.indexOf(item);
|
|
19156
|
+
handleDelete(index, false);
|
|
19157
|
+
});
|
|
19158
|
+
}
|
|
18954
19159
|
}
|
|
18955
19160
|
function handleDownload() {
|
|
18956
19161
|
xGrid.value.exportData({
|
|
@@ -18961,9 +19166,18 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
18961
19166
|
}
|
|
18962
19167
|
});
|
|
18963
19168
|
}
|
|
18964
|
-
function handleImport() {
|
|
19169
|
+
async function handleImport() {
|
|
18965
19170
|
if (importDisabled()) {
|
|
18966
19171
|
message.error("\u8BF7\u5148\u9009\u62E9\u5E97\u94FA\uFF01");
|
|
19172
|
+
} else if (isProductCenterSuit.value) {
|
|
19173
|
+
if (data.length > 0) {
|
|
19174
|
+
if (await utils.confirmModal("\u518D\u6B21\u6279\u5BFC\u4F1A\u8986\u76D6\u5DF2\u6709\u6570\u636E")) {
|
|
19175
|
+
data.splice(0, data.length);
|
|
19176
|
+
inputRef.value.click();
|
|
19177
|
+
}
|
|
19178
|
+
} else {
|
|
19179
|
+
inputRef.value.click();
|
|
19180
|
+
}
|
|
18967
19181
|
} else {
|
|
18968
19182
|
inputRef.value.click();
|
|
18969
19183
|
}
|
|
@@ -18982,6 +19196,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
18982
19196
|
async function queryProductInfo(rule, row) {
|
|
18983
19197
|
const field = rule.field;
|
|
18984
19198
|
const associatedFields = rule?.config?.associatedFields;
|
|
19199
|
+
const otherAssociatedFields = rule?.config?.otherAssociatedFields;
|
|
18985
19200
|
let result = void 0;
|
|
18986
19201
|
try {
|
|
18987
19202
|
if (row[field]) {
|
|
@@ -18994,10 +19209,37 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
18994
19209
|
}
|
|
18995
19210
|
}
|
|
18996
19211
|
processAssociatedFields(field, associatedFields, row, result);
|
|
19212
|
+
processOtherAssociatedFields(field, otherAssociatedFields, row, result);
|
|
19213
|
+
return result;
|
|
19214
|
+
} catch (e) {
|
|
19215
|
+
row[field] = "";
|
|
19216
|
+
processAssociatedFields(field, associatedFields, row, result);
|
|
19217
|
+
processOtherAssociatedFields(field, otherAssociatedFields, row, result);
|
|
19218
|
+
return Promise.resolve(result);
|
|
19219
|
+
}
|
|
19220
|
+
}
|
|
19221
|
+
async function queryCustomerInfo(rule, row) {
|
|
19222
|
+
const field = rule.field;
|
|
19223
|
+
const associatedFields = rule?.config?.associatedFields;
|
|
19224
|
+
const otherAssociatedFields = rule?.config?.otherAssociatedFields;
|
|
19225
|
+
let result = void 0;
|
|
19226
|
+
try {
|
|
19227
|
+
if (row[field]) {
|
|
19228
|
+
result = await props.extraConfig.customer?.fetch({
|
|
19229
|
+
clientCode: row[field],
|
|
19230
|
+
filterByShopcode: rule?.config?.dataFiltering
|
|
19231
|
+
});
|
|
19232
|
+
if (!result) {
|
|
19233
|
+
row[field] = "";
|
|
19234
|
+
}
|
|
19235
|
+
}
|
|
19236
|
+
processAssociatedFields(field, associatedFields, row, result);
|
|
19237
|
+
processOtherAssociatedFields(field, otherAssociatedFields, row, result);
|
|
18997
19238
|
return result;
|
|
18998
19239
|
} catch (e) {
|
|
18999
19240
|
row[field] = "";
|
|
19000
19241
|
processAssociatedFields(field, associatedFields, row, result);
|
|
19242
|
+
processOtherAssociatedFields(field, otherAssociatedFields, row, result);
|
|
19001
19243
|
return Promise.resolve(result);
|
|
19002
19244
|
}
|
|
19003
19245
|
}
|
|
@@ -19007,17 +19249,24 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
19007
19249
|
row[productPicName(item.value, field)] = result ? result[accosiationParseKeyMap[item.value]] : void 0;
|
|
19008
19250
|
});
|
|
19009
19251
|
}
|
|
19252
|
+
function processOtherAssociatedFields(field, fields, row, result) {
|
|
19253
|
+
if (isProductCenterSuit.value) {
|
|
19254
|
+
fields?.forEach?.((item) => {
|
|
19255
|
+
row[item] = result ? result[item] : void 0;
|
|
19256
|
+
});
|
|
19257
|
+
}
|
|
19258
|
+
}
|
|
19010
19259
|
function handleChange(e) {
|
|
19011
19260
|
const file = e.target.files[0];
|
|
19012
19261
|
const reader = new FileReader();
|
|
19013
19262
|
reader.onload = (fr) => {
|
|
19014
19263
|
const rows = parseCsv(fr?.target?.result);
|
|
19015
|
-
const
|
|
19264
|
+
const validColumns2 = columns.filter((c) => isValidColumn(c));
|
|
19016
19265
|
const result = [];
|
|
19017
19266
|
rows.forEach((row) => {
|
|
19018
19267
|
const rowData = {};
|
|
19019
19268
|
row.forEach((item, index) => {
|
|
19020
|
-
rowData[
|
|
19269
|
+
rowData[validColumns2[index].field] = item;
|
|
19021
19270
|
});
|
|
19022
19271
|
result.push(rowData);
|
|
19023
19272
|
});
|
|
@@ -19034,7 +19283,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
19034
19283
|
file && reader.readAsText(file, "GB2312");
|
|
19035
19284
|
}
|
|
19036
19285
|
function isValidColumn(c) {
|
|
19037
|
-
return c.type !== "checkbox" && c.field !== oper;
|
|
19286
|
+
return c.type !== "checkbox" && c.type !== "seq" && c.field !== oper;
|
|
19038
19287
|
}
|
|
19039
19288
|
function parseCsv(result) {
|
|
19040
19289
|
let data2 = [];
|
|
@@ -19054,9 +19303,9 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
19054
19303
|
}
|
|
19055
19304
|
async function validate(rowData) {
|
|
19056
19305
|
let error = "";
|
|
19057
|
-
const
|
|
19306
|
+
const validColumns2 = columns.filter((c) => isValidColumn(c));
|
|
19058
19307
|
for (const row of rowData) {
|
|
19059
|
-
for (const { field } of
|
|
19308
|
+
for (const { field } of validColumns2) {
|
|
19060
19309
|
const rule = childRulesMap.value[`${field}`];
|
|
19061
19310
|
const title = rule?.title?.title;
|
|
19062
19311
|
if (!rule)
|
|
@@ -19193,6 +19442,18 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
19193
19442
|
break;
|
|
19194
19443
|
}
|
|
19195
19444
|
}
|
|
19445
|
+
if (rule.name === "customer") {
|
|
19446
|
+
try {
|
|
19447
|
+
const productInfo = await queryCustomerInfo(rule, row);
|
|
19448
|
+
if (!productInfo) {
|
|
19449
|
+
error = `${title}\u67E5\u8BE2\u7684\u5BA2\u6237\u4E0D\u5B58\u5728`;
|
|
19450
|
+
break;
|
|
19451
|
+
}
|
|
19452
|
+
} catch (e) {
|
|
19453
|
+
error = `${title}\u67E5\u8BE2\u7684\u5BA2\u6237\u4E0D\u5B58\u5728`;
|
|
19454
|
+
break;
|
|
19455
|
+
}
|
|
19456
|
+
}
|
|
19196
19457
|
if (rule.name === "shop") {
|
|
19197
19458
|
try {
|
|
19198
19459
|
const shopInfo = await props.extraConfig[rule.name].getShopInfo({
|
|
@@ -19234,10 +19495,30 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
19234
19495
|
return false;
|
|
19235
19496
|
return !formData.value[shopField];
|
|
19236
19497
|
}
|
|
19237
|
-
function
|
|
19498
|
+
function handleProductChange(value, rule, row) {
|
|
19499
|
+
row[rule.field] = value;
|
|
19500
|
+
if (isProductCenterSuit.value && rule.field === "productCode") {
|
|
19501
|
+
Object.keys(row).forEach((key) => {
|
|
19502
|
+
if (!["productCode", "_X_ROW_KEY"].includes(key)) {
|
|
19503
|
+
row[key] = void 0;
|
|
19504
|
+
}
|
|
19505
|
+
});
|
|
19506
|
+
}
|
|
19507
|
+
if (rule.config.fetchMode !== "blur") {
|
|
19508
|
+
queryProductInfo(rule, row);
|
|
19509
|
+
}
|
|
19510
|
+
}
|
|
19511
|
+
function handleProductPressEnter(value, rule, row) {
|
|
19238
19512
|
row[rule.field] = value;
|
|
19239
19513
|
queryProductInfo(rule, row);
|
|
19240
19514
|
}
|
|
19515
|
+
function handleCustomerChange(value, rule, row) {
|
|
19516
|
+
row[rule.field] = value;
|
|
19517
|
+
}
|
|
19518
|
+
function handleCustomerPressEnter(value, rule, row) {
|
|
19519
|
+
row[rule.field] = value;
|
|
19520
|
+
queryCustomerInfo(rule, row);
|
|
19521
|
+
}
|
|
19241
19522
|
function handleShopOption(value, rule, row) {
|
|
19242
19523
|
row[rule?.field] = value;
|
|
19243
19524
|
processAssociatedFields(
|
|
@@ -19248,7 +19529,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
19248
19529
|
);
|
|
19249
19530
|
}
|
|
19250
19531
|
function importDisabled() {
|
|
19251
|
-
return productInputSlots.filter((item) => item.config?.dataFiltering).some((item) => !formData.value[item.config.dataFiltering]);
|
|
19532
|
+
return productInputSlots.filter((item) => item.config?.dataFiltering).some((item) => !formData.value[item.config.dataFiltering]) || props.rule?.config?.dataFiltering && !formData.value[props.rule?.config?.dataFiltering];
|
|
19252
19533
|
}
|
|
19253
19534
|
watch(
|
|
19254
19535
|
() => props.rule,
|
|
@@ -19268,77 +19549,276 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
19268
19549
|
deep: true
|
|
19269
19550
|
}
|
|
19270
19551
|
);
|
|
19552
|
+
const buttonLoadingForProductCenter = ref({
|
|
19553
|
+
export: false,
|
|
19554
|
+
download: false,
|
|
19555
|
+
import: false
|
|
19556
|
+
});
|
|
19557
|
+
async function exportForProductCenter() {
|
|
19558
|
+
if (!tableConfig.value.template || tableConfig.value.template === "table") {
|
|
19559
|
+
return handleExport();
|
|
19560
|
+
}
|
|
19561
|
+
try {
|
|
19562
|
+
buttonLoadingForProductCenter.value.export = true;
|
|
19563
|
+
const selected = xGrid.value?.getCheckboxRecords?.();
|
|
19564
|
+
await props.extraConfig.table?.exportFetch?.({
|
|
19565
|
+
tableConfig: tableConfig.value,
|
|
19566
|
+
columns: validColumns.value,
|
|
19567
|
+
data: selected
|
|
19568
|
+
});
|
|
19569
|
+
} catch (error) {
|
|
19570
|
+
console.log("\u{1F680} ~ error:", error);
|
|
19571
|
+
} finally {
|
|
19572
|
+
buttonLoadingForProductCenter.value.export = false;
|
|
19573
|
+
}
|
|
19574
|
+
}
|
|
19575
|
+
async function downloadTemplateForProductCenter() {
|
|
19576
|
+
if (!tableConfig.value.template || tableConfig.value.template === "table") {
|
|
19577
|
+
return handleDownload();
|
|
19578
|
+
}
|
|
19579
|
+
try {
|
|
19580
|
+
buttonLoadingForProductCenter.value.download = true;
|
|
19581
|
+
await props.extraConfig.table?.downloadTemplateFetch?.({
|
|
19582
|
+
tableConfig: tableConfig.value,
|
|
19583
|
+
tableRules: props.rule.config.childRules,
|
|
19584
|
+
columns: validColumns.value
|
|
19585
|
+
});
|
|
19586
|
+
} catch (error) {
|
|
19587
|
+
console.log("\u{1F680} ~ error:", error);
|
|
19588
|
+
} finally {
|
|
19589
|
+
buttonLoadingForProductCenter.value.download = false;
|
|
19590
|
+
}
|
|
19591
|
+
}
|
|
19592
|
+
async function importHandleForProductCenter(e) {
|
|
19593
|
+
if (!tableConfig.value.template || tableConfig.value.template === "table") {
|
|
19594
|
+
return handleChange(e);
|
|
19595
|
+
}
|
|
19596
|
+
try {
|
|
19597
|
+
buttonLoadingForProductCenter.value.import = true;
|
|
19598
|
+
let tableRules = cloneDeep(props.rule.config?.childRules || []);
|
|
19599
|
+
tableRules.forEach((rule) => {
|
|
19600
|
+
const field = rule.field;
|
|
19601
|
+
let associatedFields = rule.config.associatedFields || [];
|
|
19602
|
+
associatedFields.forEach((associatedRule) => {
|
|
19603
|
+
associatedRule.field = productPicName(associatedRule.value, field);
|
|
19604
|
+
associatedRule.is = accosiationParseKeyMap[associatedRule.value];
|
|
19605
|
+
});
|
|
19606
|
+
});
|
|
19607
|
+
let res = await props.extraConfig.table?.importFetch?.({
|
|
19608
|
+
tableConfig: tableConfig.value,
|
|
19609
|
+
tableRules,
|
|
19610
|
+
columns: validColumns.value,
|
|
19611
|
+
filterByShopcode: props.rule?.config?.dataFiltering,
|
|
19612
|
+
dataFile: e.target.files?.[0]
|
|
19613
|
+
}) || {};
|
|
19614
|
+
if (res.promptMessage && !await utils.confirmModal(res.promptMessage)) {
|
|
19615
|
+
return;
|
|
19616
|
+
}
|
|
19617
|
+
if (res.templateDataList?.length) {
|
|
19618
|
+
data.push(...res.templateDataList);
|
|
19619
|
+
}
|
|
19620
|
+
const numFormatter = (value) => utils.toFixNumHasDefault(value, 0, false, "0");
|
|
19621
|
+
if (!res.successNum) {
|
|
19622
|
+
let confirmRet = await utils.confirmModal(
|
|
19623
|
+
`\u5BFC\u5165\u5931\u8D25\uFF0C\u5171${numFormatter(res.errorNum)}\u6761`,
|
|
19624
|
+
"\u63D0\u793A",
|
|
19625
|
+
"error",
|
|
19626
|
+
{
|
|
19627
|
+
okText: "\u4E0B\u8F7D\u9519\u8BEF\u6570\u636E"
|
|
19628
|
+
},
|
|
19629
|
+
"error"
|
|
19630
|
+
);
|
|
19631
|
+
if (confirmRet) {
|
|
19632
|
+
props.extraConfig.table?.downloadErrorFetch?.({
|
|
19633
|
+
tableConfig: tableConfig.value,
|
|
19634
|
+
columns: validColumns.value,
|
|
19635
|
+
data: res
|
|
19636
|
+
});
|
|
19637
|
+
}
|
|
19638
|
+
} else if (res.successNum === res.importNum) {
|
|
19639
|
+
let confirmRet = await utils.confirmModal(
|
|
19640
|
+
`\u5BFC\u5165\u6210\u529F\uFF0C\u5171${numFormatter(res.successNum)}\u6761`,
|
|
19641
|
+
"\u63D0\u793A",
|
|
19642
|
+
"success",
|
|
19643
|
+
{
|
|
19644
|
+
okText: "\u77E5\u9053\u4E86"
|
|
19645
|
+
},
|
|
19646
|
+
"success"
|
|
19647
|
+
);
|
|
19648
|
+
} else {
|
|
19649
|
+
let confirmRet = await utils.confirmModal(
|
|
19650
|
+
`\u5BFC\u5165\u6210\u529F${numFormatter(res.successNum)}\u6761\uFF0C\u5931\u8D25${numFormatter(
|
|
19651
|
+
res.errorNum
|
|
19652
|
+
)}\u6761`,
|
|
19653
|
+
"\u63D0\u793A",
|
|
19654
|
+
"warning",
|
|
19655
|
+
{
|
|
19656
|
+
okText: "\u4E0B\u8F7D\u9519\u8BEF\u6570\u636E"
|
|
19657
|
+
},
|
|
19658
|
+
"warning"
|
|
19659
|
+
);
|
|
19660
|
+
if (confirmRet) {
|
|
19661
|
+
props.extraConfig.table?.downloadErrorFetch?.({
|
|
19662
|
+
tableConfig: tableConfig.value,
|
|
19663
|
+
columns: validColumns.value,
|
|
19664
|
+
data: res
|
|
19665
|
+
});
|
|
19666
|
+
}
|
|
19667
|
+
}
|
|
19668
|
+
} catch (error) {
|
|
19669
|
+
console.log("\u{1F680} ~ error:", error);
|
|
19670
|
+
} finally {
|
|
19671
|
+
buttonLoadingForProductCenter.value.import = false;
|
|
19672
|
+
e.target.value = "";
|
|
19673
|
+
}
|
|
19674
|
+
}
|
|
19675
|
+
function getProductClearSetting(field) {
|
|
19676
|
+
let setting = props.rule.config.childRules?.find((rule) => {
|
|
19677
|
+
return rule.field === field;
|
|
19678
|
+
});
|
|
19679
|
+
return !!setting?.config?.doNotClearAfterFilterChange;
|
|
19680
|
+
}
|
|
19271
19681
|
return (_ctx, _cache) => {
|
|
19272
19682
|
return openBlock(), createElementBlock("div", _hoisted_1$5, [
|
|
19273
19683
|
createElementVNode("div", _hoisted_2$4, [
|
|
19274
19684
|
createTextVNode(toDisplayString(__props.rule.title.title) + " ", 1),
|
|
19275
19685
|
createElementVNode("span", _hoisted_3$3, toDisplayString(unref(countText)), 1),
|
|
19276
|
-
|
|
19277
|
-
|
|
19278
|
-
|
|
19279
|
-
|
|
19280
|
-
|
|
19281
|
-
}, {
|
|
19282
|
-
default: withCtx(() => [
|
|
19283
|
-
createTextVNode("\u5BFC\u51FA")
|
|
19284
|
-
]),
|
|
19285
|
-
_: 1
|
|
19286
|
-
}, 8, ["disabled"])) : createCommentVNode("v-if", true),
|
|
19287
|
-
createTextVNode("\xA0 "),
|
|
19288
|
-
unref(importFeature) && !__props.hidden ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
19289
|
-
createElementVNode("input", {
|
|
19686
|
+
createCommentVNode(" \u5546\u54C1\u4E2D\u5FC3\u5B9A\u5236 \u6309\u94AE "),
|
|
19687
|
+
unref(isProductCenter) ? (openBlock(), createElementBlock("div", _hoisted_4$3, [
|
|
19688
|
+
!__props.hidden ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
19689
|
+
unref(tableConfig).buttons?.includes("import") ? (openBlock(), createElementBlock("input", {
|
|
19690
|
+
key: 0,
|
|
19290
19691
|
ref_key: "inputRef",
|
|
19291
19692
|
ref: inputRef,
|
|
19292
19693
|
style: { "display": "none" },
|
|
19293
19694
|
name: "file",
|
|
19294
19695
|
type: "file",
|
|
19295
|
-
accept: "text/csv",
|
|
19296
|
-
onChange:
|
|
19297
|
-
}, null,
|
|
19298
|
-
|
|
19696
|
+
accept: unref(tableConfig).template === "table" ? "text/csv" : "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel, .xlsx, .xls, .XLSX, .XLS",
|
|
19697
|
+
onChange: importHandleForProductCenter
|
|
19698
|
+
}, null, 40, _hoisted_5$3)) : createCommentVNode("v-if", true),
|
|
19699
|
+
unref(tableConfig).buttons?.includes("export") ? (openBlock(), createBlock(unref(Button), {
|
|
19700
|
+
key: 1,
|
|
19299
19701
|
disabled: __props.disabled,
|
|
19300
|
-
|
|
19702
|
+
loading: buttonLoadingForProductCenter.value.export,
|
|
19703
|
+
onClick: exportForProductCenter
|
|
19301
19704
|
}, {
|
|
19302
19705
|
default: withCtx(() => [
|
|
19303
|
-
createTextVNode("\
|
|
19706
|
+
createTextVNode("\u5BFC\u51FA")
|
|
19304
19707
|
]),
|
|
19305
19708
|
_: 1
|
|
19306
|
-
}, 8, ["disabled"]),
|
|
19307
|
-
|
|
19709
|
+
}, 8, ["disabled", "loading"])) : createCommentVNode("v-if", true),
|
|
19710
|
+
unref(tableConfig).buttons?.includes("downloadTemplate") ? (openBlock(), createBlock(unref(Button), {
|
|
19711
|
+
key: 2,
|
|
19712
|
+
disabled: __props.disabled,
|
|
19713
|
+
loading: buttonLoadingForProductCenter.value.download,
|
|
19714
|
+
onClick: downloadTemplateForProductCenter
|
|
19715
|
+
}, {
|
|
19716
|
+
default: withCtx(() => [
|
|
19717
|
+
createTextVNode("\u4E0B\u8F7D\u5BFC\u5165\u6A21\u677F")
|
|
19718
|
+
]),
|
|
19719
|
+
_: 1
|
|
19720
|
+
}, 8, ["disabled", "loading"])) : createCommentVNode("v-if", true),
|
|
19721
|
+
unref(tableConfig).buttons?.includes("import") ? (openBlock(), createBlock(unref(Button), {
|
|
19722
|
+
key: 3,
|
|
19308
19723
|
disabled: __props.disabled,
|
|
19724
|
+
loading: buttonLoadingForProductCenter.value.import,
|
|
19309
19725
|
onClick: handleImport
|
|
19310
19726
|
}, {
|
|
19311
19727
|
default: withCtx(() => [
|
|
19312
19728
|
createTextVNode("\u6279\u91CF\u5BFC\u5165")
|
|
19313
19729
|
]),
|
|
19314
19730
|
_: 1
|
|
19731
|
+
}, 8, ["disabled", "loading"])) : createCommentVNode("v-if", true),
|
|
19732
|
+
unref(tableConfig).buttons?.includes("delete") ? (openBlock(), createBlock(unref(Button), {
|
|
19733
|
+
key: 4,
|
|
19734
|
+
disabled: __props.disabled,
|
|
19735
|
+
onClick: handleBatchDelete
|
|
19736
|
+
}, {
|
|
19737
|
+
default: withCtx(() => [
|
|
19738
|
+
createTextVNode("\u6279\u91CF\u5220\u9664")
|
|
19739
|
+
]),
|
|
19740
|
+
_: 1
|
|
19741
|
+
}, 8, ["disabled"])) : createCommentVNode("v-if", true),
|
|
19742
|
+
unref(tableConfig).buttons?.includes("add") ? (openBlock(), createBlock(unref(Button), {
|
|
19743
|
+
key: 5,
|
|
19744
|
+
type: "primary",
|
|
19745
|
+
disabled: __props.disabled,
|
|
19746
|
+
onClick: handleAdd
|
|
19747
|
+
}, {
|
|
19748
|
+
default: withCtx(() => [
|
|
19749
|
+
createVNode(unref(PlusOutlined)),
|
|
19750
|
+
createTextVNode(" \u65B0\u589E")
|
|
19751
|
+
]),
|
|
19752
|
+
_: 1
|
|
19753
|
+
}, 8, ["disabled"])) : createCommentVNode("v-if", true)
|
|
19754
|
+
], 64)) : createCommentVNode("v-if", true)
|
|
19755
|
+
])) : (openBlock(), createElementBlock("div", _hoisted_6$3, [
|
|
19756
|
+
!__props.hidden ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
19757
|
+
unref(exportFeature) ? (openBlock(), createBlock(unref(Button), {
|
|
19758
|
+
key: 0,
|
|
19759
|
+
disabled: __props.disabled,
|
|
19760
|
+
onClick: handleExport
|
|
19761
|
+
}, {
|
|
19762
|
+
default: withCtx(() => [
|
|
19763
|
+
createTextVNode("\u5BFC\u51FA")
|
|
19764
|
+
]),
|
|
19765
|
+
_: 1
|
|
19766
|
+
}, 8, ["disabled"])) : createCommentVNode("v-if", true),
|
|
19767
|
+
createTextVNode("\xA0 "),
|
|
19768
|
+
unref(importFeature) ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
19769
|
+
createElementVNode("input", {
|
|
19770
|
+
ref_key: "inputRef",
|
|
19771
|
+
ref: inputRef,
|
|
19772
|
+
style: { "display": "none" },
|
|
19773
|
+
name: "file",
|
|
19774
|
+
type: "file",
|
|
19775
|
+
accept: "text/csv",
|
|
19776
|
+
onChange: handleChange
|
|
19777
|
+
}, null, 544),
|
|
19778
|
+
createVNode(unref(Button), {
|
|
19779
|
+
disabled: __props.disabled,
|
|
19780
|
+
onClick: handleDownload
|
|
19781
|
+
}, {
|
|
19782
|
+
default: withCtx(() => [
|
|
19783
|
+
createTextVNode("\u4E0B\u8F7D\u6A21\u677F")
|
|
19784
|
+
]),
|
|
19785
|
+
_: 1
|
|
19786
|
+
}, 8, ["disabled"]),
|
|
19787
|
+
createVNode(unref(Button), {
|
|
19788
|
+
disabled: __props.disabled,
|
|
19789
|
+
onClick: handleImport
|
|
19790
|
+
}, {
|
|
19791
|
+
default: withCtx(() => [
|
|
19792
|
+
createTextVNode("\u6279\u91CF\u5BFC\u5165")
|
|
19793
|
+
]),
|
|
19794
|
+
_: 1
|
|
19795
|
+
}, 8, ["disabled"])
|
|
19796
|
+
], 64)) : createCommentVNode("v-if", true),
|
|
19797
|
+
unref(deleteFeature) ? (openBlock(), createBlock(unref(Button), {
|
|
19798
|
+
key: 2,
|
|
19799
|
+
disabled: __props.disabled,
|
|
19800
|
+
onClick: handleBatchDelete
|
|
19801
|
+
}, {
|
|
19802
|
+
default: withCtx(() => [
|
|
19803
|
+
createTextVNode("\u6279\u91CF\u5220\u9664")
|
|
19804
|
+
]),
|
|
19805
|
+
_: 1
|
|
19806
|
+
}, 8, ["disabled"])) : createCommentVNode("v-if", true),
|
|
19807
|
+
createVNode(unref(Button), {
|
|
19808
|
+
type: "primary",
|
|
19809
|
+
disabled: __props.disabled,
|
|
19810
|
+
onClick: handleAdd
|
|
19811
|
+
}, {
|
|
19812
|
+
default: withCtx(() => [
|
|
19813
|
+
createVNode(unref(PlusOutlined)),
|
|
19814
|
+
createTextVNode(" \u65B0\u589E ")
|
|
19815
|
+
]),
|
|
19816
|
+
_: 1
|
|
19315
19817
|
}, 8, ["disabled"])
|
|
19316
|
-
], 64)) : createCommentVNode("v-if", true)
|
|
19317
|
-
|
|
19318
|
-
key: 2,
|
|
19319
|
-
disabled: __props.disabled,
|
|
19320
|
-
onClick: handleBatchDelete
|
|
19321
|
-
}, {
|
|
19322
|
-
default: withCtx(() => [
|
|
19323
|
-
createTextVNode("\u6279\u91CF\u5220\u9664")
|
|
19324
|
-
]),
|
|
19325
|
-
_: 1
|
|
19326
|
-
}, 8, ["disabled"])) : createCommentVNode("v-if", true),
|
|
19327
|
-
!__props.hidden ? (openBlock(), createBlock(unref(Button), {
|
|
19328
|
-
key: 3,
|
|
19329
|
-
type: "primary",
|
|
19330
|
-
disabled: __props.disabled,
|
|
19331
|
-
onClick: handleAdd
|
|
19332
|
-
}, {
|
|
19333
|
-
default: withCtx(() => [
|
|
19334
|
-
createVNode(unref(PlusOutlined)),
|
|
19335
|
-
createTextVNode(" \u65B0\u589E ")
|
|
19336
|
-
]),
|
|
19337
|
-
_: 1
|
|
19338
|
-
}, 8, ["disabled"])) : createCommentVNode("v-if", true)
|
|
19339
|
-
])
|
|
19818
|
+
], 64)) : createCommentVNode("v-if", true)
|
|
19819
|
+
]))
|
|
19340
19820
|
]),
|
|
19341
|
-
createElementVNode("div",
|
|
19821
|
+
createElementVNode("div", _hoisted_7$3, [
|
|
19342
19822
|
createVNode(unref(FormItemRest), null, {
|
|
19343
19823
|
default: withCtx(() => [
|
|
19344
19824
|
createVNode(unref(BmFloatTable), {
|
|
@@ -19383,8 +19863,12 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
19383
19863
|
value: row[item.field],
|
|
19384
19864
|
disabled: item.disabled || pruductInputDisabled(item.config?.dataFiltering),
|
|
19385
19865
|
"shop-value": unref(formData)[item.config.dataFiltering],
|
|
19386
|
-
|
|
19387
|
-
|
|
19866
|
+
"do-not-clear-after-filter-change": getProductClearSetting(item.field),
|
|
19867
|
+
"fetch-mode": item.config.fetchMode,
|
|
19868
|
+
onChange: ($event) => handleProductChange($event, item, row),
|
|
19869
|
+
onBlur: ($event) => handleProductPressEnter($event, item, row),
|
|
19870
|
+
onPressEnter: ($event) => handleProductPressEnter($event, item, row)
|
|
19871
|
+
}, null, 8, ["value", "disabled", "shop-value", "do-not-clear-after-filter-change", "fetch-mode", "onChange", "onBlur", "onPressEnter"])
|
|
19388
19872
|
])
|
|
19389
19873
|
};
|
|
19390
19874
|
}),
|
|
@@ -19410,8 +19894,10 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
19410
19894
|
value: row[item.field],
|
|
19411
19895
|
disabled: item.disabled || pruductInputDisabled(item.config?.dataFiltering),
|
|
19412
19896
|
"shop-value": unref(formData)[item.config.dataFiltering],
|
|
19413
|
-
onChange: ($event) =>
|
|
19414
|
-
|
|
19897
|
+
onChange: ($event) => handleCustomerChange($event, item, row),
|
|
19898
|
+
onBlur: ($event) => handleCustomerPressEnter($event, item, row),
|
|
19899
|
+
onPressEnter: ($event) => handleCustomerPressEnter($event, item, row)
|
|
19900
|
+
}, null, 8, ["value", "disabled", "shop-value", "onChange", "onBlur", "onPressEnter"])
|
|
19415
19901
|
])
|
|
19416
19902
|
};
|
|
19417
19903
|
})
|
|
@@ -19815,7 +20301,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
19815
20301
|
flex: 1
|
|
19816
20302
|
}, {
|
|
19817
20303
|
default: withCtx(() => [
|
|
19818
|
-
createTextVNode(toDisplayString(pane.tempSelected.materialCategoryNameShow || "\u7CFB\u7EDF\u81EA\u52A8\
|
|
20304
|
+
createTextVNode(toDisplayString(pane.tempSelected.materialCategoryNameShow || "\u7CFB\u7EDF\u81EA\u52A8\u83B7\u53D6"), 1)
|
|
19819
20305
|
]),
|
|
19820
20306
|
_: 2
|
|
19821
20307
|
}, 1024)
|
|
@@ -19998,6 +20484,7 @@ var MaterialTemp = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__file", "materia
|
|
|
19998
20484
|
var materialTemp = {
|
|
19999
20485
|
name: 'materialTemp',
|
|
20000
20486
|
rule(data, extraConfig) {
|
|
20487
|
+
var _a;
|
|
20001
20488
|
return {
|
|
20002
20489
|
native: true,
|
|
20003
20490
|
type: 'div',
|
|
@@ -20026,14 +20513,19 @@ var materialTemp = {
|
|
|
20026
20513
|
validate: [
|
|
20027
20514
|
{
|
|
20028
20515
|
validator(rule, value) {
|
|
20516
|
+
var _a, _b, _c;
|
|
20029
20517
|
if (isNull(value)) {
|
|
20030
20518
|
return Promise.reject();
|
|
20031
20519
|
}
|
|
20032
20520
|
const panes = value.panes;
|
|
20521
|
+
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;
|
|
20033
20522
|
for (const pane of panes) {
|
|
20034
20523
|
if (!pane.tempIdSelected) {
|
|
20035
20524
|
return Promise.reject();
|
|
20036
20525
|
}
|
|
20526
|
+
if (requiredPicture && !((_c = pane.uploadList) === null || _c === void 0 ? void 0 : _c.length)) {
|
|
20527
|
+
return Promise.reject();
|
|
20528
|
+
}
|
|
20037
20529
|
if (pane.tableRequiredFields) {
|
|
20038
20530
|
for (const field of pane.tableRequiredFields) {
|
|
20039
20531
|
if (pane.tableData.some((row) => isNull(row[field]))) {
|
|
@@ -20044,7 +20536,7 @@ var materialTemp = {
|
|
|
20044
20536
|
}
|
|
20045
20537
|
return Promise.resolve();
|
|
20046
20538
|
},
|
|
20047
|
-
message: '请检查必填项',
|
|
20539
|
+
message: ((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请检查必填项',
|
|
20048
20540
|
},
|
|
20049
20541
|
],
|
|
20050
20542
|
},
|
|
@@ -20061,11 +20553,13 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
20061
20553
|
props: [
|
|
20062
20554
|
"associatedFields",
|
|
20063
20555
|
"dataFiltering",
|
|
20556
|
+
"doNotClearAfterFilterChange",
|
|
20064
20557
|
"required",
|
|
20065
20558
|
"extraConfig",
|
|
20066
20559
|
"defalutValue",
|
|
20067
20560
|
"disabled",
|
|
20068
|
-
"formCreateInject"
|
|
20561
|
+
"formCreateInject",
|
|
20562
|
+
"fetchMode"
|
|
20069
20563
|
],
|
|
20070
20564
|
emits: ["change"],
|
|
20071
20565
|
setup(__props, { emit: emits }) {
|
|
@@ -20077,7 +20571,12 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
20077
20571
|
\u5546\u54C1\u56FE\u7247: "picUrl",
|
|
20078
20572
|
\u5EFA\u8BAE\u96F6\u552E\u4EF7: "retailPrice",
|
|
20079
20573
|
\u5546\u54C1\u7BB1\u89C4: "carton",
|
|
20080
|
-
\u5546\u54C1\u5355\u4F4D: "unit"
|
|
20574
|
+
\u5546\u54C1\u5355\u4F4D: "unit",
|
|
20575
|
+
\u4E00\u7EA7\u5206\u7C7B: "categoryFirst",
|
|
20576
|
+
\u4E8C\u7EA7\u5206\u7C7B: "categorySecond",
|
|
20577
|
+
\u4E09\u7EA7\u5206\u7C7B: "categoryThrid",
|
|
20578
|
+
\u5546\u54C1\u7C7B\u578B: "productType",
|
|
20579
|
+
\u5546\u54C1\u6807\u7B7E: "productTag"
|
|
20081
20580
|
};
|
|
20082
20581
|
const unitMap = ["\u652F", "\u74F6", "\u5957", "\u7EC4", "\u7BB1", "\u4E2A", "\u5F20"];
|
|
20083
20582
|
const formData = computed(() => props.formCreateInject.api.bind());
|
|
@@ -20134,7 +20633,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
20134
20633
|
watch(
|
|
20135
20634
|
() => formData.value[props.dataFiltering],
|
|
20136
20635
|
() => {
|
|
20137
|
-
if (inputValue.value) {
|
|
20636
|
+
if (inputValue.value && !props.doNotClearAfterFilterChange) {
|
|
20138
20637
|
reset();
|
|
20139
20638
|
}
|
|
20140
20639
|
}
|
|
@@ -20159,14 +20658,23 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
20159
20658
|
}),
|
|
20160
20659
|
createVNode(unref(Col), { flex: 1 }, {
|
|
20161
20660
|
default: withCtx(() => [
|
|
20162
|
-
|
|
20661
|
+
props.fetchMode === "blur" ? (openBlock(), createBlock(unref(Input), {
|
|
20662
|
+
key: 0,
|
|
20163
20663
|
value: inputValue.value,
|
|
20164
20664
|
"onUpdate:value": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event),
|
|
20165
20665
|
placeholder: "\u8BF7\u8F93\u5165",
|
|
20166
20666
|
disabled: __props.disabled || inputDisbale(__props.dataFiltering),
|
|
20667
|
+
onPressEnter: unref(debounceFn),
|
|
20668
|
+
onBlur: handleBlur
|
|
20669
|
+
}, null, 8, ["value", "disabled", "onPressEnter"])) : (openBlock(), createBlock(unref(Input), {
|
|
20670
|
+
key: 1,
|
|
20671
|
+
value: inputValue.value,
|
|
20672
|
+
"onUpdate:value": _cache[1] || (_cache[1] = ($event) => inputValue.value = $event),
|
|
20673
|
+
placeholder: "\u8BF7\u8F93\u5165",
|
|
20674
|
+
disabled: __props.disabled || inputDisbale(__props.dataFiltering),
|
|
20167
20675
|
onPressEnter: handleBlur,
|
|
20168
20676
|
onChange: handleChange
|
|
20169
|
-
}, null, 8, ["value", "disabled"])
|
|
20677
|
+
}, null, 8, ["value", "disabled"]))
|
|
20170
20678
|
]),
|
|
20171
20679
|
_: 1
|
|
20172
20680
|
})
|
|
@@ -20201,12 +20709,12 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
20201
20709
|
class: "bm-fc-form-item__img",
|
|
20202
20710
|
src: __props.extraConfig.common.previewImg(getValue(field.value))
|
|
20203
20711
|
}, null, 8, _hoisted_2$2)) : field.value === "\u5546\u54C1\u5355\u4F4D" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
20204
|
-
createTextVNode(toDisplayString(unitMap[getValue(field.value)]), 1)
|
|
20712
|
+
createTextVNode(toDisplayString(unitMap[getValue(field.value)] || getValue(field.value)), 1)
|
|
20205
20713
|
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
20206
20714
|
createTextVNode(toDisplayString(getValue(field.value)), 1)
|
|
20207
20715
|
], 64))
|
|
20208
20716
|
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
20209
|
-
createTextVNode("\u7CFB\u7EDF\u81EA\u52A8\
|
|
20717
|
+
createTextVNode("\u7CFB\u7EDF\u81EA\u52A8\u83B7\u53D6")
|
|
20210
20718
|
], 64))
|
|
20211
20719
|
]),
|
|
20212
20720
|
_: 2
|
|
@@ -20229,19 +20737,23 @@ var ProductInfo = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__file", "product-
|
|
|
20229
20737
|
var product = {
|
|
20230
20738
|
name: 'product',
|
|
20231
20739
|
rule(data, extraConfig) {
|
|
20740
|
+
var _a;
|
|
20232
20741
|
return {
|
|
20233
20742
|
type: 'ProductInfo',
|
|
20234
20743
|
component: ProductInfo,
|
|
20235
20744
|
field: data.field,
|
|
20236
20745
|
effect: {
|
|
20237
|
-
required: data.effect.required &&
|
|
20746
|
+
required: data.effect.required &&
|
|
20747
|
+
(((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请输入商品编号'),
|
|
20238
20748
|
},
|
|
20239
20749
|
props: {
|
|
20240
20750
|
required: data.effect.required,
|
|
20241
20751
|
associatedFields: data.config.associatedFields,
|
|
20242
20752
|
dataFiltering: data.config.dataFiltering,
|
|
20753
|
+
doNotClearAfterFilterChange: data.config.doNotClearAfterFilterChange,
|
|
20243
20754
|
extraConfig: extraConfig,
|
|
20244
20755
|
defalutValue: data.value,
|
|
20756
|
+
fetchMode: data.config.fetchMode,
|
|
20245
20757
|
},
|
|
20246
20758
|
inject: true,
|
|
20247
20759
|
on: {
|
|
@@ -20258,19 +20770,23 @@ var product = {
|
|
|
20258
20770
|
};
|
|
20259
20771
|
},
|
|
20260
20772
|
rowRule(data, extraConfig) {
|
|
20773
|
+
var _a;
|
|
20261
20774
|
return {
|
|
20262
20775
|
type: 'ProductInfo',
|
|
20263
20776
|
component: ProductInfo,
|
|
20264
20777
|
field: data.field,
|
|
20265
20778
|
effect: {
|
|
20266
|
-
required: data.effect.required &&
|
|
20779
|
+
required: data.effect.required &&
|
|
20780
|
+
(((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请输入商品编号'),
|
|
20267
20781
|
},
|
|
20268
20782
|
props: {
|
|
20269
20783
|
required: data.effect.required,
|
|
20270
20784
|
associatedFields: data.config.associatedFields,
|
|
20271
20785
|
dataFiltering: data.config.dataFiltering,
|
|
20786
|
+
doNotClearAfterFilterChange: data.config.doNotClearAfterFilterChange,
|
|
20272
20787
|
defalutValue: data.value,
|
|
20273
20788
|
extraConfig: extraConfig,
|
|
20789
|
+
fetchMode: data.config.fetchMode,
|
|
20274
20790
|
},
|
|
20275
20791
|
inject: true,
|
|
20276
20792
|
on: {
|
|
@@ -20334,11 +20850,20 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
20334
20850
|
}
|
|
20335
20851
|
return false;
|
|
20336
20852
|
});
|
|
20853
|
+
function isProductCenterSuit(rule) {
|
|
20854
|
+
return [
|
|
20855
|
+
"F2CTemplate",
|
|
20856
|
+
"B2CTemplate",
|
|
20857
|
+
"DistributeTemp",
|
|
20858
|
+
"FreshTemplate",
|
|
20859
|
+
"activityApply"
|
|
20860
|
+
].includes(rule.name);
|
|
20861
|
+
}
|
|
20337
20862
|
function isAssociatedFn(rule) {
|
|
20338
|
-
if (rule?.config?.dataFiltering === field.value) {
|
|
20863
|
+
if (rule?.config?.dataFiltering === field.value && !isProductCenterSuit(rule)) {
|
|
20339
20864
|
return true;
|
|
20340
20865
|
}
|
|
20341
|
-
if (rule?.config?.childRules?.length) {
|
|
20866
|
+
if (rule?.config?.childRules?.length && !isProductCenterSuit(rule)) {
|
|
20342
20867
|
for (const cRule of rule.config.childRules) {
|
|
20343
20868
|
if (isAssociatedFn(cRule))
|
|
20344
20869
|
return true;
|
|
@@ -20454,7 +20979,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
20454
20979
|
getValue(field2.value) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
20455
20980
|
createTextVNode(toDisplayString(getValue(field2.value)), 1)
|
|
20456
20981
|
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
20457
|
-
createTextVNode("\u7CFB\u7EDF\u81EA\u52A8\
|
|
20982
|
+
createTextVNode("\u7CFB\u7EDF\u81EA\u52A8\u83B7\u53D6")
|
|
20458
20983
|
], 64))
|
|
20459
20984
|
]),
|
|
20460
20985
|
_: 2
|
|
@@ -20477,17 +21002,17 @@ var ShopWidget = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__file", "shop-widg
|
|
|
20477
21002
|
var shop = {
|
|
20478
21003
|
name: 'shop',
|
|
20479
21004
|
rule(data, extraConfig) {
|
|
20480
|
-
var _a;
|
|
21005
|
+
var _a, _b;
|
|
20481
21006
|
const shopExtraConfig = extraConfig.shop;
|
|
20482
21007
|
return {
|
|
20483
21008
|
type: 'ShopWidget',
|
|
20484
21009
|
component: ShopWidget,
|
|
20485
21010
|
field: data.field,
|
|
20486
21011
|
effect: {
|
|
20487
|
-
required: data.effect.required && '请选择店铺',
|
|
21012
|
+
required: data.effect.required && (((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请选择店铺'),
|
|
20488
21013
|
},
|
|
20489
21014
|
props: {
|
|
20490
|
-
dataFiltering: (
|
|
21015
|
+
dataFiltering: (_b = data.config) === null || _b === void 0 ? void 0 : _b.dataFiltering,
|
|
20491
21016
|
associatedFields: data.config.associatedFields,
|
|
20492
21017
|
extraConfig: shopExtraConfig,
|
|
20493
21018
|
required: data.effect.required,
|
|
@@ -20509,19 +21034,20 @@ var shop = {
|
|
|
20509
21034
|
};
|
|
20510
21035
|
},
|
|
20511
21036
|
rowRule(data, extraConfig) {
|
|
20512
|
-
var _a;
|
|
21037
|
+
var _a, _b;
|
|
20513
21038
|
const shopExtraConfig = extraConfig.shop;
|
|
20514
21039
|
return {
|
|
20515
21040
|
type: 'ShopWidget',
|
|
20516
21041
|
component: ShopWidget,
|
|
20517
|
-
title: data.title.title,
|
|
20518
21042
|
field: data.field,
|
|
20519
21043
|
effect: {
|
|
20520
|
-
required: data.effect.required && '请选择店铺',
|
|
21044
|
+
required: data.effect.required && (((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请选择店铺'),
|
|
20521
21045
|
},
|
|
20522
21046
|
props: {
|
|
20523
|
-
dataFiltering: (
|
|
21047
|
+
dataFiltering: (_b = data.config) === null || _b === void 0 ? void 0 : _b.dataFiltering,
|
|
20524
21048
|
extraConfig: shopExtraConfig,
|
|
21049
|
+
associatedFields: data.config.associatedFields,
|
|
21050
|
+
title: `${data.title.title}`,
|
|
20525
21051
|
},
|
|
20526
21052
|
inject: true,
|
|
20527
21053
|
on: {
|
|
@@ -20536,7 +21062,7 @@ var shop = {
|
|
|
20536
21062
|
},
|
|
20537
21063
|
},
|
|
20538
21064
|
col: {
|
|
20539
|
-
span:
|
|
21065
|
+
span: 24,
|
|
20540
21066
|
},
|
|
20541
21067
|
value: data.value,
|
|
20542
21068
|
};
|
|
@@ -20639,6 +21165,7 @@ var materialType$1 = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__file", "mater
|
|
|
20639
21165
|
var materialType = {
|
|
20640
21166
|
name: 'materialType',
|
|
20641
21167
|
rule(data, extraConfig) {
|
|
21168
|
+
var _a;
|
|
20642
21169
|
return {
|
|
20643
21170
|
type: 'materialType',
|
|
20644
21171
|
component: materialType$1,
|
|
@@ -20649,7 +21176,7 @@ var materialType = {
|
|
|
20649
21176
|
required: data.effect.required,
|
|
20650
21177
|
type: 'array',
|
|
20651
21178
|
min: 1,
|
|
20652
|
-
message: '请选择素材类型',
|
|
21179
|
+
message: ((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请选择素材类型',
|
|
20653
21180
|
},
|
|
20654
21181
|
],
|
|
20655
21182
|
props: {
|
|
@@ -20677,6 +21204,7 @@ var materialType = {
|
|
|
20677
21204
|
};
|
|
20678
21205
|
},
|
|
20679
21206
|
rowRule(data, extraConfig) {
|
|
21207
|
+
var _a;
|
|
20680
21208
|
return {
|
|
20681
21209
|
type: 'materialType',
|
|
20682
21210
|
component: materialType$1,
|
|
@@ -20687,7 +21215,7 @@ var materialType = {
|
|
|
20687
21215
|
required: data.effect.required,
|
|
20688
21216
|
type: 'array',
|
|
20689
21217
|
min: 1,
|
|
20690
|
-
message: '请选择素材类型',
|
|
21218
|
+
message: ((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请选择素材类型',
|
|
20691
21219
|
},
|
|
20692
21220
|
],
|
|
20693
21221
|
props: {
|
|
@@ -20776,7 +21304,7 @@ var row = {
|
|
|
20776
21304
|
var department = {
|
|
20777
21305
|
name: 'department',
|
|
20778
21306
|
rule(data, extraConfig) {
|
|
20779
|
-
var _a;
|
|
21307
|
+
var _a, _b;
|
|
20780
21308
|
return {
|
|
20781
21309
|
type: 'StaffSelector',
|
|
20782
21310
|
component: StaffSelector,
|
|
@@ -20798,7 +21326,7 @@ var department = {
|
|
|
20798
21326
|
fieldNames: (_a = extraConfig.department) === null || _a === void 0 ? void 0 : _a.fieldNames,
|
|
20799
21327
|
},
|
|
20800
21328
|
effect: {
|
|
20801
|
-
required: data.effect.required && '请选择',
|
|
21329
|
+
required: data.effect.required && (((_b = data.effect) === null || _b === void 0 ? void 0 : _b.requiredTip) || '请选择'),
|
|
20802
21330
|
},
|
|
20803
21331
|
wrap: {
|
|
20804
21332
|
wrapperCol: {
|
|
@@ -20810,18 +21338,21 @@ var department = {
|
|
|
20810
21338
|
change(inject, list) {
|
|
20811
21339
|
const rule = inject.self;
|
|
20812
21340
|
rule.props.defaultSelected = list;
|
|
20813
|
-
|
|
20814
|
-
|
|
20815
|
-
|
|
20816
|
-
|
|
20817
|
-
|
|
21341
|
+
nextTick(() => {
|
|
21342
|
+
rule.props.defaultSelected = list;
|
|
21343
|
+
inject.api.form[rule.field] = list;
|
|
21344
|
+
inject.api.validateField(rule.field, () => {
|
|
21345
|
+
if (list.length) {
|
|
21346
|
+
inject.api.clearValidateState(rule.field);
|
|
21347
|
+
}
|
|
21348
|
+
});
|
|
20818
21349
|
});
|
|
20819
21350
|
},
|
|
20820
21351
|
},
|
|
20821
21352
|
};
|
|
20822
21353
|
},
|
|
20823
21354
|
rowRule(data, extraConfig) {
|
|
20824
|
-
var _a;
|
|
21355
|
+
var _a, _b;
|
|
20825
21356
|
return {
|
|
20826
21357
|
type: 'StaffSelector',
|
|
20827
21358
|
component: StaffSelector,
|
|
@@ -20843,7 +21374,7 @@ var department = {
|
|
|
20843
21374
|
fieldNames: (_a = extraConfig.department) === null || _a === void 0 ? void 0 : _a.fieldNames,
|
|
20844
21375
|
},
|
|
20845
21376
|
effect: {
|
|
20846
|
-
required: data.effect.required && '请选择',
|
|
21377
|
+
required: data.effect.required && (((_b = data.effect) === null || _b === void 0 ? void 0 : _b.requiredTip) || '请选择'),
|
|
20847
21378
|
},
|
|
20848
21379
|
col: {
|
|
20849
21380
|
span: fieldRatioMap[data.config.fieldRatio],
|
|
@@ -20853,11 +21384,14 @@ var department = {
|
|
|
20853
21384
|
change(inject, list) {
|
|
20854
21385
|
const rule = inject.self;
|
|
20855
21386
|
rule.props.defaultSelected = list;
|
|
20856
|
-
|
|
20857
|
-
|
|
20858
|
-
|
|
20859
|
-
|
|
20860
|
-
|
|
21387
|
+
nextTick(() => {
|
|
21388
|
+
rule.props.defaultSelected = list;
|
|
21389
|
+
inject.api.form[rule.field] = list;
|
|
21390
|
+
inject.api.validateField(rule.field, () => {
|
|
21391
|
+
if (list.length) {
|
|
21392
|
+
inject.api.clearValidateState(rule.field);
|
|
21393
|
+
}
|
|
21394
|
+
});
|
|
20861
21395
|
});
|
|
20862
21396
|
},
|
|
20863
21397
|
},
|
|
@@ -20915,6 +21449,7 @@ function validator(rule, value) {
|
|
|
20915
21449
|
var table = {
|
|
20916
21450
|
name: 'table',
|
|
20917
21451
|
rule(data, extraConfig) {
|
|
21452
|
+
var _a;
|
|
20918
21453
|
return {
|
|
20919
21454
|
type: 'TableWidget',
|
|
20920
21455
|
component: TableWidget,
|
|
@@ -20936,12 +21471,14 @@ var table = {
|
|
|
20936
21471
|
validator(rule, value) {
|
|
20937
21472
|
return validator(data, value);
|
|
20938
21473
|
},
|
|
20939
|
-
message: '请检查必填项',
|
|
21474
|
+
message: ((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请检查必填项',
|
|
20940
21475
|
},
|
|
20941
21476
|
],
|
|
21477
|
+
wrap: data.wrap,
|
|
20942
21478
|
};
|
|
20943
21479
|
},
|
|
20944
21480
|
rowRule(data, extraConfig) {
|
|
21481
|
+
var _a;
|
|
20945
21482
|
return {
|
|
20946
21483
|
type: 'TableWidget',
|
|
20947
21484
|
component: TableWidget,
|
|
@@ -20963,12 +21500,13 @@ var table = {
|
|
|
20963
21500
|
validator(rule, value) {
|
|
20964
21501
|
return validator(data, value);
|
|
20965
21502
|
},
|
|
20966
|
-
message: '请检查必填项',
|
|
21503
|
+
message: ((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请检查必填项',
|
|
20967
21504
|
},
|
|
20968
21505
|
],
|
|
20969
21506
|
col: {
|
|
20970
21507
|
span: 24,
|
|
20971
21508
|
},
|
|
21509
|
+
wrap: data.wrap,
|
|
20972
21510
|
};
|
|
20973
21511
|
},
|
|
20974
21512
|
};
|
|
@@ -21138,9 +21676,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
21138
21676
|
"formPermissions",
|
|
21139
21677
|
"resolveRulesConfig"
|
|
21140
21678
|
],
|
|
21141
|
-
emits: ["update:value"],
|
|
21679
|
+
emits: ["update:value", "change"],
|
|
21142
21680
|
setup(__props, { expose, emit: emits }) {
|
|
21143
21681
|
const props = __props;
|
|
21682
|
+
FC.component("BmLabelTooltip", BmOverTooltips);
|
|
21144
21683
|
const formRuleList = computed(() => {
|
|
21145
21684
|
if (typeof props.resolveRulesConfig === "function") {
|
|
21146
21685
|
const rules = props.resolveRulesConfig(ruleList);
|
|
@@ -21160,6 +21699,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
21160
21699
|
span: 24
|
|
21161
21700
|
}
|
|
21162
21701
|
},
|
|
21702
|
+
form: {
|
|
21703
|
+
title: ""
|
|
21704
|
+
},
|
|
21163
21705
|
submitBtn: false,
|
|
21164
21706
|
global: {
|
|
21165
21707
|
ShopWidget: {
|
|
@@ -21298,6 +21840,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
21298
21840
|
immediate: true
|
|
21299
21841
|
}
|
|
21300
21842
|
);
|
|
21843
|
+
function onChange(...reset) {
|
|
21844
|
+
emits("change", ...reset);
|
|
21845
|
+
}
|
|
21301
21846
|
expose({ fApi });
|
|
21302
21847
|
return (_ctx, _cache) => {
|
|
21303
21848
|
const _component_formCreate = resolveComponent("formCreate", true);
|
|
@@ -21312,7 +21857,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
21312
21857
|
"model-value": __props.value,
|
|
21313
21858
|
option: unref(option),
|
|
21314
21859
|
rule: rule.value,
|
|
21315
|
-
"onUpdate:modelValue": handleValue
|
|
21860
|
+
"onUpdate:modelValue": handleValue,
|
|
21861
|
+
onChange
|
|
21316
21862
|
}, null, 8, ["api", "model-value", "option", "rule"])
|
|
21317
21863
|
], 64);
|
|
21318
21864
|
};
|