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
|
@@ -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,22 @@ 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
|
+
let fields = props.rule.config.childRules?.map((item) => item.field) || [];
|
|
19174
|
+
let isNotEmpty = data?.some(
|
|
19175
|
+
(item) => fields.some((field) => ![null, void 0, ""].includes(item[field]))
|
|
19176
|
+
);
|
|
19177
|
+
if (isNotEmpty) {
|
|
19178
|
+
if (await utils.confirmModal("\u518D\u6B21\u6279\u5BFC\u4F1A\u8986\u76D6\u5DF2\u6709\u6570\u636E")) {
|
|
19179
|
+
data.splice(0, data.length);
|
|
19180
|
+
inputRef.value.click();
|
|
19181
|
+
}
|
|
19182
|
+
} else {
|
|
19183
|
+
inputRef.value.click();
|
|
19184
|
+
}
|
|
18967
19185
|
} else {
|
|
18968
19186
|
inputRef.value.click();
|
|
18969
19187
|
}
|
|
@@ -18982,6 +19200,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
18982
19200
|
async function queryProductInfo(rule, row) {
|
|
18983
19201
|
const field = rule.field;
|
|
18984
19202
|
const associatedFields = rule?.config?.associatedFields;
|
|
19203
|
+
const otherAssociatedFields = rule?.config?.otherAssociatedFields;
|
|
18985
19204
|
let result = void 0;
|
|
18986
19205
|
try {
|
|
18987
19206
|
if (row[field]) {
|
|
@@ -18994,10 +19213,37 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
18994
19213
|
}
|
|
18995
19214
|
}
|
|
18996
19215
|
processAssociatedFields(field, associatedFields, row, result);
|
|
19216
|
+
processOtherAssociatedFields(field, otherAssociatedFields, row, result);
|
|
18997
19217
|
return result;
|
|
18998
19218
|
} catch (e) {
|
|
18999
19219
|
row[field] = "";
|
|
19000
19220
|
processAssociatedFields(field, associatedFields, row, result);
|
|
19221
|
+
processOtherAssociatedFields(field, otherAssociatedFields, row, result);
|
|
19222
|
+
return Promise.resolve(result);
|
|
19223
|
+
}
|
|
19224
|
+
}
|
|
19225
|
+
async function queryCustomerInfo(rule, row) {
|
|
19226
|
+
const field = rule.field;
|
|
19227
|
+
const associatedFields = rule?.config?.associatedFields;
|
|
19228
|
+
const otherAssociatedFields = rule?.config?.otherAssociatedFields;
|
|
19229
|
+
let result = void 0;
|
|
19230
|
+
try {
|
|
19231
|
+
if (row[field]) {
|
|
19232
|
+
result = await props.extraConfig.customer?.fetch({
|
|
19233
|
+
clientCode: row[field],
|
|
19234
|
+
filterByShopcode: rule?.config?.dataFiltering
|
|
19235
|
+
});
|
|
19236
|
+
if (!result) {
|
|
19237
|
+
row[field] = "";
|
|
19238
|
+
}
|
|
19239
|
+
}
|
|
19240
|
+
processAssociatedFields(field, associatedFields, row, result);
|
|
19241
|
+
processOtherAssociatedFields(field, otherAssociatedFields, row, result);
|
|
19242
|
+
return result;
|
|
19243
|
+
} catch (e) {
|
|
19244
|
+
row[field] = "";
|
|
19245
|
+
processAssociatedFields(field, associatedFields, row, result);
|
|
19246
|
+
processOtherAssociatedFields(field, otherAssociatedFields, row, result);
|
|
19001
19247
|
return Promise.resolve(result);
|
|
19002
19248
|
}
|
|
19003
19249
|
}
|
|
@@ -19007,17 +19253,24 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
19007
19253
|
row[productPicName(item.value, field)] = result ? result[accosiationParseKeyMap[item.value]] : void 0;
|
|
19008
19254
|
});
|
|
19009
19255
|
}
|
|
19256
|
+
function processOtherAssociatedFields(field, fields, row, result) {
|
|
19257
|
+
if (isProductCenterSuit.value) {
|
|
19258
|
+
fields?.forEach?.((item) => {
|
|
19259
|
+
row[item] = result ? result[item] : void 0;
|
|
19260
|
+
});
|
|
19261
|
+
}
|
|
19262
|
+
}
|
|
19010
19263
|
function handleChange(e) {
|
|
19011
19264
|
const file = e.target.files[0];
|
|
19012
19265
|
const reader = new FileReader();
|
|
19013
19266
|
reader.onload = (fr) => {
|
|
19014
19267
|
const rows = parseCsv(fr?.target?.result);
|
|
19015
|
-
const
|
|
19268
|
+
const validColumns2 = columns.filter((c) => isValidColumn(c));
|
|
19016
19269
|
const result = [];
|
|
19017
19270
|
rows.forEach((row) => {
|
|
19018
19271
|
const rowData = {};
|
|
19019
19272
|
row.forEach((item, index) => {
|
|
19020
|
-
rowData[
|
|
19273
|
+
rowData[validColumns2[index].field] = item;
|
|
19021
19274
|
});
|
|
19022
19275
|
result.push(rowData);
|
|
19023
19276
|
});
|
|
@@ -19034,7 +19287,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
19034
19287
|
file && reader.readAsText(file, "GB2312");
|
|
19035
19288
|
}
|
|
19036
19289
|
function isValidColumn(c) {
|
|
19037
|
-
return c.type !== "checkbox" && c.field !== oper;
|
|
19290
|
+
return c.type !== "checkbox" && c.type !== "seq" && c.field !== oper;
|
|
19038
19291
|
}
|
|
19039
19292
|
function parseCsv(result) {
|
|
19040
19293
|
let data2 = [];
|
|
@@ -19054,9 +19307,9 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
19054
19307
|
}
|
|
19055
19308
|
async function validate(rowData) {
|
|
19056
19309
|
let error = "";
|
|
19057
|
-
const
|
|
19310
|
+
const validColumns2 = columns.filter((c) => isValidColumn(c));
|
|
19058
19311
|
for (const row of rowData) {
|
|
19059
|
-
for (const { field } of
|
|
19312
|
+
for (const { field } of validColumns2) {
|
|
19060
19313
|
const rule = childRulesMap.value[`${field}`];
|
|
19061
19314
|
const title = rule?.title?.title;
|
|
19062
19315
|
if (!rule)
|
|
@@ -19193,6 +19446,18 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
19193
19446
|
break;
|
|
19194
19447
|
}
|
|
19195
19448
|
}
|
|
19449
|
+
if (rule.name === "customer") {
|
|
19450
|
+
try {
|
|
19451
|
+
const productInfo = await queryCustomerInfo(rule, row);
|
|
19452
|
+
if (!productInfo) {
|
|
19453
|
+
error = `${title}\u67E5\u8BE2\u7684\u5BA2\u6237\u4E0D\u5B58\u5728`;
|
|
19454
|
+
break;
|
|
19455
|
+
}
|
|
19456
|
+
} catch (e) {
|
|
19457
|
+
error = `${title}\u67E5\u8BE2\u7684\u5BA2\u6237\u4E0D\u5B58\u5728`;
|
|
19458
|
+
break;
|
|
19459
|
+
}
|
|
19460
|
+
}
|
|
19196
19461
|
if (rule.name === "shop") {
|
|
19197
19462
|
try {
|
|
19198
19463
|
const shopInfo = await props.extraConfig[rule.name].getShopInfo({
|
|
@@ -19234,10 +19499,30 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
19234
19499
|
return false;
|
|
19235
19500
|
return !formData.value[shopField];
|
|
19236
19501
|
}
|
|
19237
|
-
function
|
|
19502
|
+
function handleProductChange(value, rule, row) {
|
|
19503
|
+
row[rule.field] = value;
|
|
19504
|
+
if (isProductCenterSuit.value && rule.field === "productCode") {
|
|
19505
|
+
Object.keys(row).forEach((key) => {
|
|
19506
|
+
if (!["productCode", "_X_ROW_KEY"].includes(key)) {
|
|
19507
|
+
row[key] = void 0;
|
|
19508
|
+
}
|
|
19509
|
+
});
|
|
19510
|
+
}
|
|
19511
|
+
if (rule.config.fetchMode !== "blur") {
|
|
19512
|
+
queryProductInfo(rule, row);
|
|
19513
|
+
}
|
|
19514
|
+
}
|
|
19515
|
+
function handleProductPressEnter(value, rule, row) {
|
|
19238
19516
|
row[rule.field] = value;
|
|
19239
19517
|
queryProductInfo(rule, row);
|
|
19240
19518
|
}
|
|
19519
|
+
function handleCustomerChange(value, rule, row) {
|
|
19520
|
+
row[rule.field] = value;
|
|
19521
|
+
}
|
|
19522
|
+
function handleCustomerPressEnter(value, rule, row) {
|
|
19523
|
+
row[rule.field] = value;
|
|
19524
|
+
queryCustomerInfo(rule, row);
|
|
19525
|
+
}
|
|
19241
19526
|
function handleShopOption(value, rule, row) {
|
|
19242
19527
|
row[rule?.field] = value;
|
|
19243
19528
|
processAssociatedFields(
|
|
@@ -19248,7 +19533,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
19248
19533
|
);
|
|
19249
19534
|
}
|
|
19250
19535
|
function importDisabled() {
|
|
19251
|
-
return productInputSlots.filter((item) => item.config?.dataFiltering).some((item) => !formData.value[item.config.dataFiltering]);
|
|
19536
|
+
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
19537
|
}
|
|
19253
19538
|
watch(
|
|
19254
19539
|
() => props.rule,
|
|
@@ -19268,77 +19553,276 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
19268
19553
|
deep: true
|
|
19269
19554
|
}
|
|
19270
19555
|
);
|
|
19556
|
+
const buttonLoadingForProductCenter = ref({
|
|
19557
|
+
export: false,
|
|
19558
|
+
download: false,
|
|
19559
|
+
import: false
|
|
19560
|
+
});
|
|
19561
|
+
async function exportForProductCenter() {
|
|
19562
|
+
if (!tableConfig.value.template || tableConfig.value.template === "table") {
|
|
19563
|
+
return handleExport();
|
|
19564
|
+
}
|
|
19565
|
+
try {
|
|
19566
|
+
buttonLoadingForProductCenter.value.export = true;
|
|
19567
|
+
const selected = xGrid.value?.getCheckboxRecords?.();
|
|
19568
|
+
await props.extraConfig.table?.exportFetch?.({
|
|
19569
|
+
tableConfig: tableConfig.value,
|
|
19570
|
+
columns: validColumns.value,
|
|
19571
|
+
data: selected
|
|
19572
|
+
});
|
|
19573
|
+
} catch (error) {
|
|
19574
|
+
console.log("\u{1F680} ~ error:", error);
|
|
19575
|
+
} finally {
|
|
19576
|
+
buttonLoadingForProductCenter.value.export = false;
|
|
19577
|
+
}
|
|
19578
|
+
}
|
|
19579
|
+
async function downloadTemplateForProductCenter() {
|
|
19580
|
+
if (!tableConfig.value.template || tableConfig.value.template === "table") {
|
|
19581
|
+
return handleDownload();
|
|
19582
|
+
}
|
|
19583
|
+
try {
|
|
19584
|
+
buttonLoadingForProductCenter.value.download = true;
|
|
19585
|
+
await props.extraConfig.table?.downloadTemplateFetch?.({
|
|
19586
|
+
tableConfig: tableConfig.value,
|
|
19587
|
+
tableRules: props.rule.config.childRules,
|
|
19588
|
+
columns: validColumns.value
|
|
19589
|
+
});
|
|
19590
|
+
} catch (error) {
|
|
19591
|
+
console.log("\u{1F680} ~ error:", error);
|
|
19592
|
+
} finally {
|
|
19593
|
+
buttonLoadingForProductCenter.value.download = false;
|
|
19594
|
+
}
|
|
19595
|
+
}
|
|
19596
|
+
async function importHandleForProductCenter(e) {
|
|
19597
|
+
if (!tableConfig.value.template || tableConfig.value.template === "table") {
|
|
19598
|
+
return handleChange(e);
|
|
19599
|
+
}
|
|
19600
|
+
try {
|
|
19601
|
+
buttonLoadingForProductCenter.value.import = true;
|
|
19602
|
+
let tableRules = cloneDeep(props.rule.config?.childRules || []);
|
|
19603
|
+
tableRules.forEach((rule) => {
|
|
19604
|
+
const field = rule.field;
|
|
19605
|
+
let associatedFields = rule.config.associatedFields || [];
|
|
19606
|
+
associatedFields.forEach((associatedRule) => {
|
|
19607
|
+
associatedRule.field = productPicName(associatedRule.value, field);
|
|
19608
|
+
associatedRule.is = accosiationParseKeyMap[associatedRule.value];
|
|
19609
|
+
});
|
|
19610
|
+
});
|
|
19611
|
+
let res = await props.extraConfig.table?.importFetch?.({
|
|
19612
|
+
tableConfig: tableConfig.value,
|
|
19613
|
+
tableRules,
|
|
19614
|
+
columns: validColumns.value,
|
|
19615
|
+
filterByShopcode: props.rule?.config?.dataFiltering,
|
|
19616
|
+
dataFile: e.target.files?.[0]
|
|
19617
|
+
}) || {};
|
|
19618
|
+
if (res.promptMessage && !await utils.confirmModal(res.promptMessage)) {
|
|
19619
|
+
return;
|
|
19620
|
+
}
|
|
19621
|
+
if (res.templateDataList?.length) {
|
|
19622
|
+
data.push(...res.templateDataList);
|
|
19623
|
+
}
|
|
19624
|
+
const numFormatter = (value) => utils.toFixNumHasDefault(value, 0, false, "0");
|
|
19625
|
+
if (!res.successNum) {
|
|
19626
|
+
let confirmRet = await utils.confirmModal(
|
|
19627
|
+
`\u5BFC\u5165\u5931\u8D25\uFF0C\u5171${numFormatter(res.errorNum)}\u6761`,
|
|
19628
|
+
"\u63D0\u793A",
|
|
19629
|
+
"error",
|
|
19630
|
+
{
|
|
19631
|
+
okText: "\u4E0B\u8F7D\u9519\u8BEF\u6570\u636E"
|
|
19632
|
+
},
|
|
19633
|
+
"error"
|
|
19634
|
+
);
|
|
19635
|
+
if (confirmRet) {
|
|
19636
|
+
props.extraConfig.table?.downloadErrorFetch?.({
|
|
19637
|
+
tableConfig: tableConfig.value,
|
|
19638
|
+
columns: validColumns.value,
|
|
19639
|
+
data: res
|
|
19640
|
+
});
|
|
19641
|
+
}
|
|
19642
|
+
} else if (res.successNum === res.importNum) {
|
|
19643
|
+
let confirmRet = await utils.confirmModal(
|
|
19644
|
+
`\u5BFC\u5165\u6210\u529F\uFF0C\u5171${numFormatter(res.successNum)}\u6761`,
|
|
19645
|
+
"\u63D0\u793A",
|
|
19646
|
+
"success",
|
|
19647
|
+
{
|
|
19648
|
+
okText: "\u77E5\u9053\u4E86"
|
|
19649
|
+
},
|
|
19650
|
+
"success"
|
|
19651
|
+
);
|
|
19652
|
+
} else {
|
|
19653
|
+
let confirmRet = await utils.confirmModal(
|
|
19654
|
+
`\u5BFC\u5165\u6210\u529F${numFormatter(res.successNum)}\u6761\uFF0C\u5931\u8D25${numFormatter(
|
|
19655
|
+
res.errorNum
|
|
19656
|
+
)}\u6761`,
|
|
19657
|
+
"\u63D0\u793A",
|
|
19658
|
+
"warning",
|
|
19659
|
+
{
|
|
19660
|
+
okText: "\u4E0B\u8F7D\u9519\u8BEF\u6570\u636E"
|
|
19661
|
+
},
|
|
19662
|
+
"warning"
|
|
19663
|
+
);
|
|
19664
|
+
if (confirmRet) {
|
|
19665
|
+
props.extraConfig.table?.downloadErrorFetch?.({
|
|
19666
|
+
tableConfig: tableConfig.value,
|
|
19667
|
+
columns: validColumns.value,
|
|
19668
|
+
data: res
|
|
19669
|
+
});
|
|
19670
|
+
}
|
|
19671
|
+
}
|
|
19672
|
+
} catch (error) {
|
|
19673
|
+
console.log("\u{1F680} ~ error:", error);
|
|
19674
|
+
} finally {
|
|
19675
|
+
buttonLoadingForProductCenter.value.import = false;
|
|
19676
|
+
e.target.value = "";
|
|
19677
|
+
}
|
|
19678
|
+
}
|
|
19679
|
+
function getProductClearSetting(field) {
|
|
19680
|
+
let setting = props.rule.config.childRules?.find((rule) => {
|
|
19681
|
+
return rule.field === field;
|
|
19682
|
+
});
|
|
19683
|
+
return !!setting?.config?.doNotClearAfterFilterChange;
|
|
19684
|
+
}
|
|
19271
19685
|
return (_ctx, _cache) => {
|
|
19272
19686
|
return openBlock(), createElementBlock("div", _hoisted_1$5, [
|
|
19273
19687
|
createElementVNode("div", _hoisted_2$4, [
|
|
19274
19688
|
createTextVNode(toDisplayString(__props.rule.title.title) + " ", 1),
|
|
19275
19689
|
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", {
|
|
19690
|
+
createCommentVNode(" \u5546\u54C1\u4E2D\u5FC3\u5B9A\u5236 \u6309\u94AE "),
|
|
19691
|
+
unref(isProductCenter) ? (openBlock(), createElementBlock("div", _hoisted_4$3, [
|
|
19692
|
+
!__props.hidden ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
19693
|
+
unref(tableConfig).buttons?.includes("import") ? (openBlock(), createElementBlock("input", {
|
|
19694
|
+
key: 0,
|
|
19290
19695
|
ref_key: "inputRef",
|
|
19291
19696
|
ref: inputRef,
|
|
19292
19697
|
style: { "display": "none" },
|
|
19293
19698
|
name: "file",
|
|
19294
19699
|
type: "file",
|
|
19295
|
-
accept: "text/csv",
|
|
19296
|
-
onChange:
|
|
19297
|
-
}, null,
|
|
19298
|
-
|
|
19700
|
+
accept: unref(tableConfig).template === "table" ? "text/csv" : "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel, .xlsx, .xls, .XLSX, .XLS",
|
|
19701
|
+
onChange: importHandleForProductCenter
|
|
19702
|
+
}, null, 40, _hoisted_5$3)) : createCommentVNode("v-if", true),
|
|
19703
|
+
unref(tableConfig).buttons?.includes("export") ? (openBlock(), createBlock(unref(Button), {
|
|
19704
|
+
key: 1,
|
|
19299
19705
|
disabled: __props.disabled,
|
|
19300
|
-
|
|
19706
|
+
loading: buttonLoadingForProductCenter.value.export,
|
|
19707
|
+
onClick: exportForProductCenter
|
|
19301
19708
|
}, {
|
|
19302
19709
|
default: withCtx(() => [
|
|
19303
|
-
createTextVNode("\
|
|
19710
|
+
createTextVNode("\u5BFC\u51FA")
|
|
19304
19711
|
]),
|
|
19305
19712
|
_: 1
|
|
19306
|
-
}, 8, ["disabled"]),
|
|
19307
|
-
|
|
19713
|
+
}, 8, ["disabled", "loading"])) : createCommentVNode("v-if", true),
|
|
19714
|
+
unref(tableConfig).buttons?.includes("downloadTemplate") ? (openBlock(), createBlock(unref(Button), {
|
|
19715
|
+
key: 2,
|
|
19716
|
+
disabled: __props.disabled,
|
|
19717
|
+
loading: buttonLoadingForProductCenter.value.download,
|
|
19718
|
+
onClick: downloadTemplateForProductCenter
|
|
19719
|
+
}, {
|
|
19720
|
+
default: withCtx(() => [
|
|
19721
|
+
createTextVNode("\u4E0B\u8F7D\u5BFC\u5165\u6A21\u677F")
|
|
19722
|
+
]),
|
|
19723
|
+
_: 1
|
|
19724
|
+
}, 8, ["disabled", "loading"])) : createCommentVNode("v-if", true),
|
|
19725
|
+
unref(tableConfig).buttons?.includes("import") ? (openBlock(), createBlock(unref(Button), {
|
|
19726
|
+
key: 3,
|
|
19308
19727
|
disabled: __props.disabled,
|
|
19728
|
+
loading: buttonLoadingForProductCenter.value.import,
|
|
19309
19729
|
onClick: handleImport
|
|
19310
19730
|
}, {
|
|
19311
19731
|
default: withCtx(() => [
|
|
19312
19732
|
createTextVNode("\u6279\u91CF\u5BFC\u5165")
|
|
19313
19733
|
]),
|
|
19314
19734
|
_: 1
|
|
19735
|
+
}, 8, ["disabled", "loading"])) : createCommentVNode("v-if", true),
|
|
19736
|
+
unref(tableConfig).buttons?.includes("delete") ? (openBlock(), createBlock(unref(Button), {
|
|
19737
|
+
key: 4,
|
|
19738
|
+
disabled: __props.disabled,
|
|
19739
|
+
onClick: handleBatchDelete
|
|
19740
|
+
}, {
|
|
19741
|
+
default: withCtx(() => [
|
|
19742
|
+
createTextVNode("\u6279\u91CF\u5220\u9664")
|
|
19743
|
+
]),
|
|
19744
|
+
_: 1
|
|
19745
|
+
}, 8, ["disabled"])) : createCommentVNode("v-if", true),
|
|
19746
|
+
unref(tableConfig).buttons?.includes("add") ? (openBlock(), createBlock(unref(Button), {
|
|
19747
|
+
key: 5,
|
|
19748
|
+
type: "primary",
|
|
19749
|
+
disabled: __props.disabled,
|
|
19750
|
+
onClick: handleAdd
|
|
19751
|
+
}, {
|
|
19752
|
+
default: withCtx(() => [
|
|
19753
|
+
createVNode(unref(PlusOutlined)),
|
|
19754
|
+
createTextVNode(" \u65B0\u589E")
|
|
19755
|
+
]),
|
|
19756
|
+
_: 1
|
|
19757
|
+
}, 8, ["disabled"])) : createCommentVNode("v-if", true)
|
|
19758
|
+
], 64)) : createCommentVNode("v-if", true)
|
|
19759
|
+
])) : (openBlock(), createElementBlock("div", _hoisted_6$3, [
|
|
19760
|
+
!__props.hidden ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
19761
|
+
unref(exportFeature) ? (openBlock(), createBlock(unref(Button), {
|
|
19762
|
+
key: 0,
|
|
19763
|
+
disabled: __props.disabled,
|
|
19764
|
+
onClick: handleExport
|
|
19765
|
+
}, {
|
|
19766
|
+
default: withCtx(() => [
|
|
19767
|
+
createTextVNode("\u5BFC\u51FA")
|
|
19768
|
+
]),
|
|
19769
|
+
_: 1
|
|
19770
|
+
}, 8, ["disabled"])) : createCommentVNode("v-if", true),
|
|
19771
|
+
createTextVNode("\xA0 "),
|
|
19772
|
+
unref(importFeature) ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
19773
|
+
createElementVNode("input", {
|
|
19774
|
+
ref_key: "inputRef",
|
|
19775
|
+
ref: inputRef,
|
|
19776
|
+
style: { "display": "none" },
|
|
19777
|
+
name: "file",
|
|
19778
|
+
type: "file",
|
|
19779
|
+
accept: "text/csv",
|
|
19780
|
+
onChange: handleChange
|
|
19781
|
+
}, null, 544),
|
|
19782
|
+
createVNode(unref(Button), {
|
|
19783
|
+
disabled: __props.disabled,
|
|
19784
|
+
onClick: handleDownload
|
|
19785
|
+
}, {
|
|
19786
|
+
default: withCtx(() => [
|
|
19787
|
+
createTextVNode("\u4E0B\u8F7D\u6A21\u677F")
|
|
19788
|
+
]),
|
|
19789
|
+
_: 1
|
|
19790
|
+
}, 8, ["disabled"]),
|
|
19791
|
+
createVNode(unref(Button), {
|
|
19792
|
+
disabled: __props.disabled,
|
|
19793
|
+
onClick: handleImport
|
|
19794
|
+
}, {
|
|
19795
|
+
default: withCtx(() => [
|
|
19796
|
+
createTextVNode("\u6279\u91CF\u5BFC\u5165")
|
|
19797
|
+
]),
|
|
19798
|
+
_: 1
|
|
19799
|
+
}, 8, ["disabled"])
|
|
19800
|
+
], 64)) : createCommentVNode("v-if", true),
|
|
19801
|
+
unref(deleteFeature) ? (openBlock(), createBlock(unref(Button), {
|
|
19802
|
+
key: 2,
|
|
19803
|
+
disabled: __props.disabled,
|
|
19804
|
+
onClick: handleBatchDelete
|
|
19805
|
+
}, {
|
|
19806
|
+
default: withCtx(() => [
|
|
19807
|
+
createTextVNode("\u6279\u91CF\u5220\u9664")
|
|
19808
|
+
]),
|
|
19809
|
+
_: 1
|
|
19810
|
+
}, 8, ["disabled"])) : createCommentVNode("v-if", true),
|
|
19811
|
+
createVNode(unref(Button), {
|
|
19812
|
+
type: "primary",
|
|
19813
|
+
disabled: __props.disabled,
|
|
19814
|
+
onClick: handleAdd
|
|
19815
|
+
}, {
|
|
19816
|
+
default: withCtx(() => [
|
|
19817
|
+
createVNode(unref(PlusOutlined)),
|
|
19818
|
+
createTextVNode(" \u65B0\u589E ")
|
|
19819
|
+
]),
|
|
19820
|
+
_: 1
|
|
19315
19821
|
}, 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
|
-
])
|
|
19822
|
+
], 64)) : createCommentVNode("v-if", true)
|
|
19823
|
+
]))
|
|
19340
19824
|
]),
|
|
19341
|
-
createElementVNode("div",
|
|
19825
|
+
createElementVNode("div", _hoisted_7$3, [
|
|
19342
19826
|
createVNode(unref(FormItemRest), null, {
|
|
19343
19827
|
default: withCtx(() => [
|
|
19344
19828
|
createVNode(unref(BmFloatTable), {
|
|
@@ -19383,8 +19867,12 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
19383
19867
|
value: row[item.field],
|
|
19384
19868
|
disabled: item.disabled || pruductInputDisabled(item.config?.dataFiltering),
|
|
19385
19869
|
"shop-value": unref(formData)[item.config.dataFiltering],
|
|
19386
|
-
|
|
19387
|
-
|
|
19870
|
+
"do-not-clear-after-filter-change": getProductClearSetting(item.field),
|
|
19871
|
+
"fetch-mode": item.config.fetchMode,
|
|
19872
|
+
onChange: ($event) => handleProductChange($event, item, row),
|
|
19873
|
+
onBlur: ($event) => handleProductPressEnter($event, item, row),
|
|
19874
|
+
onPressEnter: ($event) => handleProductPressEnter($event, item, row)
|
|
19875
|
+
}, null, 8, ["value", "disabled", "shop-value", "do-not-clear-after-filter-change", "fetch-mode", "onChange", "onBlur", "onPressEnter"])
|
|
19388
19876
|
])
|
|
19389
19877
|
};
|
|
19390
19878
|
}),
|
|
@@ -19410,8 +19898,10 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
19410
19898
|
value: row[item.field],
|
|
19411
19899
|
disabled: item.disabled || pruductInputDisabled(item.config?.dataFiltering),
|
|
19412
19900
|
"shop-value": unref(formData)[item.config.dataFiltering],
|
|
19413
|
-
onChange: ($event) =>
|
|
19414
|
-
|
|
19901
|
+
onChange: ($event) => handleCustomerChange($event, item, row),
|
|
19902
|
+
onBlur: ($event) => handleCustomerPressEnter($event, item, row),
|
|
19903
|
+
onPressEnter: ($event) => handleCustomerPressEnter($event, item, row)
|
|
19904
|
+
}, null, 8, ["value", "disabled", "shop-value", "onChange", "onBlur", "onPressEnter"])
|
|
19415
19905
|
])
|
|
19416
19906
|
};
|
|
19417
19907
|
})
|
|
@@ -19815,7 +20305,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
19815
20305
|
flex: 1
|
|
19816
20306
|
}, {
|
|
19817
20307
|
default: withCtx(() => [
|
|
19818
|
-
createTextVNode(toDisplayString(pane.tempSelected.materialCategoryNameShow || "\u7CFB\u7EDF\u81EA\u52A8\
|
|
20308
|
+
createTextVNode(toDisplayString(pane.tempSelected.materialCategoryNameShow || "\u7CFB\u7EDF\u81EA\u52A8\u83B7\u53D6"), 1)
|
|
19819
20309
|
]),
|
|
19820
20310
|
_: 2
|
|
19821
20311
|
}, 1024)
|
|
@@ -19998,6 +20488,7 @@ var MaterialTemp = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__file", "materia
|
|
|
19998
20488
|
var materialTemp = {
|
|
19999
20489
|
name: 'materialTemp',
|
|
20000
20490
|
rule(data, extraConfig) {
|
|
20491
|
+
var _a;
|
|
20001
20492
|
return {
|
|
20002
20493
|
native: true,
|
|
20003
20494
|
type: 'div',
|
|
@@ -20026,14 +20517,19 @@ var materialTemp = {
|
|
|
20026
20517
|
validate: [
|
|
20027
20518
|
{
|
|
20028
20519
|
validator(rule, value) {
|
|
20520
|
+
var _a, _b, _c;
|
|
20029
20521
|
if (isNull(value)) {
|
|
20030
20522
|
return Promise.reject();
|
|
20031
20523
|
}
|
|
20032
20524
|
const panes = value.panes;
|
|
20525
|
+
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
20526
|
for (const pane of panes) {
|
|
20034
20527
|
if (!pane.tempIdSelected) {
|
|
20035
20528
|
return Promise.reject();
|
|
20036
20529
|
}
|
|
20530
|
+
if (requiredPicture && !((_c = pane.uploadList) === null || _c === void 0 ? void 0 : _c.length)) {
|
|
20531
|
+
return Promise.reject();
|
|
20532
|
+
}
|
|
20037
20533
|
if (pane.tableRequiredFields) {
|
|
20038
20534
|
for (const field of pane.tableRequiredFields) {
|
|
20039
20535
|
if (pane.tableData.some((row) => isNull(row[field]))) {
|
|
@@ -20044,7 +20540,7 @@ var materialTemp = {
|
|
|
20044
20540
|
}
|
|
20045
20541
|
return Promise.resolve();
|
|
20046
20542
|
},
|
|
20047
|
-
message: '请检查必填项',
|
|
20543
|
+
message: ((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请检查必填项',
|
|
20048
20544
|
},
|
|
20049
20545
|
],
|
|
20050
20546
|
},
|
|
@@ -20061,11 +20557,13 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
20061
20557
|
props: [
|
|
20062
20558
|
"associatedFields",
|
|
20063
20559
|
"dataFiltering",
|
|
20560
|
+
"doNotClearAfterFilterChange",
|
|
20064
20561
|
"required",
|
|
20065
20562
|
"extraConfig",
|
|
20066
20563
|
"defalutValue",
|
|
20067
20564
|
"disabled",
|
|
20068
|
-
"formCreateInject"
|
|
20565
|
+
"formCreateInject",
|
|
20566
|
+
"fetchMode"
|
|
20069
20567
|
],
|
|
20070
20568
|
emits: ["change"],
|
|
20071
20569
|
setup(__props, { emit: emits }) {
|
|
@@ -20077,7 +20575,12 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
20077
20575
|
\u5546\u54C1\u56FE\u7247: "picUrl",
|
|
20078
20576
|
\u5EFA\u8BAE\u96F6\u552E\u4EF7: "retailPrice",
|
|
20079
20577
|
\u5546\u54C1\u7BB1\u89C4: "carton",
|
|
20080
|
-
\u5546\u54C1\u5355\u4F4D: "unit"
|
|
20578
|
+
\u5546\u54C1\u5355\u4F4D: "unit",
|
|
20579
|
+
\u4E00\u7EA7\u5206\u7C7B: "categoryFirst",
|
|
20580
|
+
\u4E8C\u7EA7\u5206\u7C7B: "categorySecond",
|
|
20581
|
+
\u4E09\u7EA7\u5206\u7C7B: "categoryThrid",
|
|
20582
|
+
\u5546\u54C1\u7C7B\u578B: "productType",
|
|
20583
|
+
\u5546\u54C1\u6807\u7B7E: "productTag"
|
|
20081
20584
|
};
|
|
20082
20585
|
const unitMap = ["\u652F", "\u74F6", "\u5957", "\u7EC4", "\u7BB1", "\u4E2A", "\u5F20"];
|
|
20083
20586
|
const formData = computed(() => props.formCreateInject.api.bind());
|
|
@@ -20134,7 +20637,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
20134
20637
|
watch(
|
|
20135
20638
|
() => formData.value[props.dataFiltering],
|
|
20136
20639
|
() => {
|
|
20137
|
-
if (inputValue.value) {
|
|
20640
|
+
if (inputValue.value && !props.doNotClearAfterFilterChange) {
|
|
20138
20641
|
reset();
|
|
20139
20642
|
}
|
|
20140
20643
|
}
|
|
@@ -20159,14 +20662,23 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
20159
20662
|
}),
|
|
20160
20663
|
createVNode(unref(Col), { flex: 1 }, {
|
|
20161
20664
|
default: withCtx(() => [
|
|
20162
|
-
|
|
20665
|
+
props.fetchMode === "blur" ? (openBlock(), createBlock(unref(Input), {
|
|
20666
|
+
key: 0,
|
|
20163
20667
|
value: inputValue.value,
|
|
20164
20668
|
"onUpdate:value": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event),
|
|
20165
20669
|
placeholder: "\u8BF7\u8F93\u5165",
|
|
20166
20670
|
disabled: __props.disabled || inputDisbale(__props.dataFiltering),
|
|
20671
|
+
onPressEnter: unref(debounceFn),
|
|
20672
|
+
onBlur: handleBlur
|
|
20673
|
+
}, null, 8, ["value", "disabled", "onPressEnter"])) : (openBlock(), createBlock(unref(Input), {
|
|
20674
|
+
key: 1,
|
|
20675
|
+
value: inputValue.value,
|
|
20676
|
+
"onUpdate:value": _cache[1] || (_cache[1] = ($event) => inputValue.value = $event),
|
|
20677
|
+
placeholder: "\u8BF7\u8F93\u5165",
|
|
20678
|
+
disabled: __props.disabled || inputDisbale(__props.dataFiltering),
|
|
20167
20679
|
onPressEnter: handleBlur,
|
|
20168
20680
|
onChange: handleChange
|
|
20169
|
-
}, null, 8, ["value", "disabled"])
|
|
20681
|
+
}, null, 8, ["value", "disabled"]))
|
|
20170
20682
|
]),
|
|
20171
20683
|
_: 1
|
|
20172
20684
|
})
|
|
@@ -20201,12 +20713,12 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
20201
20713
|
class: "bm-fc-form-item__img",
|
|
20202
20714
|
src: __props.extraConfig.common.previewImg(getValue(field.value))
|
|
20203
20715
|
}, null, 8, _hoisted_2$2)) : field.value === "\u5546\u54C1\u5355\u4F4D" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
20204
|
-
createTextVNode(toDisplayString(unitMap[getValue(field.value)]), 1)
|
|
20716
|
+
createTextVNode(toDisplayString(unitMap[getValue(field.value)] || getValue(field.value)), 1)
|
|
20205
20717
|
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
20206
20718
|
createTextVNode(toDisplayString(getValue(field.value)), 1)
|
|
20207
20719
|
], 64))
|
|
20208
20720
|
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
20209
|
-
createTextVNode("\u7CFB\u7EDF\u81EA\u52A8\
|
|
20721
|
+
createTextVNode("\u7CFB\u7EDF\u81EA\u52A8\u83B7\u53D6")
|
|
20210
20722
|
], 64))
|
|
20211
20723
|
]),
|
|
20212
20724
|
_: 2
|
|
@@ -20229,19 +20741,23 @@ var ProductInfo = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__file", "product-
|
|
|
20229
20741
|
var product = {
|
|
20230
20742
|
name: 'product',
|
|
20231
20743
|
rule(data, extraConfig) {
|
|
20744
|
+
var _a;
|
|
20232
20745
|
return {
|
|
20233
20746
|
type: 'ProductInfo',
|
|
20234
20747
|
component: ProductInfo,
|
|
20235
20748
|
field: data.field,
|
|
20236
20749
|
effect: {
|
|
20237
|
-
required: data.effect.required &&
|
|
20750
|
+
required: data.effect.required &&
|
|
20751
|
+
(((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请输入商品编号'),
|
|
20238
20752
|
},
|
|
20239
20753
|
props: {
|
|
20240
20754
|
required: data.effect.required,
|
|
20241
20755
|
associatedFields: data.config.associatedFields,
|
|
20242
20756
|
dataFiltering: data.config.dataFiltering,
|
|
20757
|
+
doNotClearAfterFilterChange: data.config.doNotClearAfterFilterChange,
|
|
20243
20758
|
extraConfig: extraConfig,
|
|
20244
20759
|
defalutValue: data.value,
|
|
20760
|
+
fetchMode: data.config.fetchMode,
|
|
20245
20761
|
},
|
|
20246
20762
|
inject: true,
|
|
20247
20763
|
on: {
|
|
@@ -20258,19 +20774,23 @@ var product = {
|
|
|
20258
20774
|
};
|
|
20259
20775
|
},
|
|
20260
20776
|
rowRule(data, extraConfig) {
|
|
20777
|
+
var _a;
|
|
20261
20778
|
return {
|
|
20262
20779
|
type: 'ProductInfo',
|
|
20263
20780
|
component: ProductInfo,
|
|
20264
20781
|
field: data.field,
|
|
20265
20782
|
effect: {
|
|
20266
|
-
required: data.effect.required &&
|
|
20783
|
+
required: data.effect.required &&
|
|
20784
|
+
(((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请输入商品编号'),
|
|
20267
20785
|
},
|
|
20268
20786
|
props: {
|
|
20269
20787
|
required: data.effect.required,
|
|
20270
20788
|
associatedFields: data.config.associatedFields,
|
|
20271
20789
|
dataFiltering: data.config.dataFiltering,
|
|
20790
|
+
doNotClearAfterFilterChange: data.config.doNotClearAfterFilterChange,
|
|
20272
20791
|
defalutValue: data.value,
|
|
20273
20792
|
extraConfig: extraConfig,
|
|
20793
|
+
fetchMode: data.config.fetchMode,
|
|
20274
20794
|
},
|
|
20275
20795
|
inject: true,
|
|
20276
20796
|
on: {
|
|
@@ -20334,11 +20854,20 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
20334
20854
|
}
|
|
20335
20855
|
return false;
|
|
20336
20856
|
});
|
|
20857
|
+
function isProductCenterSuit(rule) {
|
|
20858
|
+
return [
|
|
20859
|
+
"F2CTemplate",
|
|
20860
|
+
"B2CTemplate",
|
|
20861
|
+
"DistributeTemp",
|
|
20862
|
+
"FreshTemplate",
|
|
20863
|
+
"activityApply"
|
|
20864
|
+
].includes(rule.name);
|
|
20865
|
+
}
|
|
20337
20866
|
function isAssociatedFn(rule) {
|
|
20338
|
-
if (rule?.config?.dataFiltering === field.value) {
|
|
20867
|
+
if (rule?.config?.dataFiltering === field.value && !isProductCenterSuit(rule)) {
|
|
20339
20868
|
return true;
|
|
20340
20869
|
}
|
|
20341
|
-
if (rule?.config?.childRules?.length) {
|
|
20870
|
+
if (rule?.config?.childRules?.length && !isProductCenterSuit(rule)) {
|
|
20342
20871
|
for (const cRule of rule.config.childRules) {
|
|
20343
20872
|
if (isAssociatedFn(cRule))
|
|
20344
20873
|
return true;
|
|
@@ -20409,7 +20938,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
20409
20938
|
createVNode(unref(Col), { flex: 1 }, {
|
|
20410
20939
|
default: withCtx(() => [
|
|
20411
20940
|
createVNode(unref(Select), {
|
|
20412
|
-
value: __props.formCreateInject?.rule?.value?.value || __props.value?.value,
|
|
20941
|
+
value: __props.formCreateInject?.rule?.value?.value || __props.value?.value || null,
|
|
20413
20942
|
placeholder: "\u8BF7\u9009\u62E9",
|
|
20414
20943
|
"show-search": "",
|
|
20415
20944
|
"show-arrow": false,
|
|
@@ -20454,7 +20983,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
20454
20983
|
getValue(field2.value) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
20455
20984
|
createTextVNode(toDisplayString(getValue(field2.value)), 1)
|
|
20456
20985
|
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
20457
|
-
createTextVNode("\u7CFB\u7EDF\u81EA\u52A8\
|
|
20986
|
+
createTextVNode("\u7CFB\u7EDF\u81EA\u52A8\u83B7\u53D6")
|
|
20458
20987
|
], 64))
|
|
20459
20988
|
]),
|
|
20460
20989
|
_: 2
|
|
@@ -20477,17 +21006,17 @@ var ShopWidget = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__file", "shop-widg
|
|
|
20477
21006
|
var shop = {
|
|
20478
21007
|
name: 'shop',
|
|
20479
21008
|
rule(data, extraConfig) {
|
|
20480
|
-
var _a;
|
|
21009
|
+
var _a, _b;
|
|
20481
21010
|
const shopExtraConfig = extraConfig.shop;
|
|
20482
21011
|
return {
|
|
20483
21012
|
type: 'ShopWidget',
|
|
20484
21013
|
component: ShopWidget,
|
|
20485
21014
|
field: data.field,
|
|
20486
21015
|
effect: {
|
|
20487
|
-
required: data.effect.required && '请选择店铺',
|
|
21016
|
+
required: data.effect.required && (((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请选择店铺'),
|
|
20488
21017
|
},
|
|
20489
21018
|
props: {
|
|
20490
|
-
dataFiltering: (
|
|
21019
|
+
dataFiltering: (_b = data.config) === null || _b === void 0 ? void 0 : _b.dataFiltering,
|
|
20491
21020
|
associatedFields: data.config.associatedFields,
|
|
20492
21021
|
extraConfig: shopExtraConfig,
|
|
20493
21022
|
required: data.effect.required,
|
|
@@ -20509,19 +21038,20 @@ var shop = {
|
|
|
20509
21038
|
};
|
|
20510
21039
|
},
|
|
20511
21040
|
rowRule(data, extraConfig) {
|
|
20512
|
-
var _a;
|
|
21041
|
+
var _a, _b;
|
|
20513
21042
|
const shopExtraConfig = extraConfig.shop;
|
|
20514
21043
|
return {
|
|
20515
21044
|
type: 'ShopWidget',
|
|
20516
21045
|
component: ShopWidget,
|
|
20517
|
-
title: data.title.title,
|
|
20518
21046
|
field: data.field,
|
|
20519
21047
|
effect: {
|
|
20520
|
-
required: data.effect.required && '请选择店铺',
|
|
21048
|
+
required: data.effect.required && (((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请选择店铺'),
|
|
20521
21049
|
},
|
|
20522
21050
|
props: {
|
|
20523
|
-
dataFiltering: (
|
|
21051
|
+
dataFiltering: (_b = data.config) === null || _b === void 0 ? void 0 : _b.dataFiltering,
|
|
20524
21052
|
extraConfig: shopExtraConfig,
|
|
21053
|
+
associatedFields: data.config.associatedFields,
|
|
21054
|
+
title: `${data.title.title}`,
|
|
20525
21055
|
},
|
|
20526
21056
|
inject: true,
|
|
20527
21057
|
on: {
|
|
@@ -20536,7 +21066,7 @@ var shop = {
|
|
|
20536
21066
|
},
|
|
20537
21067
|
},
|
|
20538
21068
|
col: {
|
|
20539
|
-
span:
|
|
21069
|
+
span: 24,
|
|
20540
21070
|
},
|
|
20541
21071
|
value: data.value,
|
|
20542
21072
|
};
|
|
@@ -20639,6 +21169,7 @@ var materialType$1 = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__file", "mater
|
|
|
20639
21169
|
var materialType = {
|
|
20640
21170
|
name: 'materialType',
|
|
20641
21171
|
rule(data, extraConfig) {
|
|
21172
|
+
var _a;
|
|
20642
21173
|
return {
|
|
20643
21174
|
type: 'materialType',
|
|
20644
21175
|
component: materialType$1,
|
|
@@ -20649,7 +21180,7 @@ var materialType = {
|
|
|
20649
21180
|
required: data.effect.required,
|
|
20650
21181
|
type: 'array',
|
|
20651
21182
|
min: 1,
|
|
20652
|
-
message: '请选择素材类型',
|
|
21183
|
+
message: ((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请选择素材类型',
|
|
20653
21184
|
},
|
|
20654
21185
|
],
|
|
20655
21186
|
props: {
|
|
@@ -20677,6 +21208,7 @@ var materialType = {
|
|
|
20677
21208
|
};
|
|
20678
21209
|
},
|
|
20679
21210
|
rowRule(data, extraConfig) {
|
|
21211
|
+
var _a;
|
|
20680
21212
|
return {
|
|
20681
21213
|
type: 'materialType',
|
|
20682
21214
|
component: materialType$1,
|
|
@@ -20687,7 +21219,7 @@ var materialType = {
|
|
|
20687
21219
|
required: data.effect.required,
|
|
20688
21220
|
type: 'array',
|
|
20689
21221
|
min: 1,
|
|
20690
|
-
message: '请选择素材类型',
|
|
21222
|
+
message: ((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请选择素材类型',
|
|
20691
21223
|
},
|
|
20692
21224
|
],
|
|
20693
21225
|
props: {
|
|
@@ -20776,7 +21308,7 @@ var row = {
|
|
|
20776
21308
|
var department = {
|
|
20777
21309
|
name: 'department',
|
|
20778
21310
|
rule(data, extraConfig) {
|
|
20779
|
-
var _a;
|
|
21311
|
+
var _a, _b;
|
|
20780
21312
|
return {
|
|
20781
21313
|
type: 'StaffSelector',
|
|
20782
21314
|
component: StaffSelector,
|
|
@@ -20798,7 +21330,7 @@ var department = {
|
|
|
20798
21330
|
fieldNames: (_a = extraConfig.department) === null || _a === void 0 ? void 0 : _a.fieldNames,
|
|
20799
21331
|
},
|
|
20800
21332
|
effect: {
|
|
20801
|
-
required: data.effect.required && '请选择',
|
|
21333
|
+
required: data.effect.required && (((_b = data.effect) === null || _b === void 0 ? void 0 : _b.requiredTip) || '请选择'),
|
|
20802
21334
|
},
|
|
20803
21335
|
wrap: {
|
|
20804
21336
|
wrapperCol: {
|
|
@@ -20810,18 +21342,21 @@ var department = {
|
|
|
20810
21342
|
change(inject, list) {
|
|
20811
21343
|
const rule = inject.self;
|
|
20812
21344
|
rule.props.defaultSelected = list;
|
|
20813
|
-
|
|
20814
|
-
|
|
20815
|
-
|
|
20816
|
-
|
|
20817
|
-
|
|
21345
|
+
nextTick(() => {
|
|
21346
|
+
rule.props.defaultSelected = list;
|
|
21347
|
+
inject.api.form[rule.field] = list;
|
|
21348
|
+
inject.api.validateField(rule.field, () => {
|
|
21349
|
+
if (list.length) {
|
|
21350
|
+
inject.api.clearValidateState(rule.field);
|
|
21351
|
+
}
|
|
21352
|
+
});
|
|
20818
21353
|
});
|
|
20819
21354
|
},
|
|
20820
21355
|
},
|
|
20821
21356
|
};
|
|
20822
21357
|
},
|
|
20823
21358
|
rowRule(data, extraConfig) {
|
|
20824
|
-
var _a;
|
|
21359
|
+
var _a, _b;
|
|
20825
21360
|
return {
|
|
20826
21361
|
type: 'StaffSelector',
|
|
20827
21362
|
component: StaffSelector,
|
|
@@ -20843,7 +21378,7 @@ var department = {
|
|
|
20843
21378
|
fieldNames: (_a = extraConfig.department) === null || _a === void 0 ? void 0 : _a.fieldNames,
|
|
20844
21379
|
},
|
|
20845
21380
|
effect: {
|
|
20846
|
-
required: data.effect.required && '请选择',
|
|
21381
|
+
required: data.effect.required && (((_b = data.effect) === null || _b === void 0 ? void 0 : _b.requiredTip) || '请选择'),
|
|
20847
21382
|
},
|
|
20848
21383
|
col: {
|
|
20849
21384
|
span: fieldRatioMap[data.config.fieldRatio],
|
|
@@ -20853,11 +21388,14 @@ var department = {
|
|
|
20853
21388
|
change(inject, list) {
|
|
20854
21389
|
const rule = inject.self;
|
|
20855
21390
|
rule.props.defaultSelected = list;
|
|
20856
|
-
|
|
20857
|
-
|
|
20858
|
-
|
|
20859
|
-
|
|
20860
|
-
|
|
21391
|
+
nextTick(() => {
|
|
21392
|
+
rule.props.defaultSelected = list;
|
|
21393
|
+
inject.api.form[rule.field] = list;
|
|
21394
|
+
inject.api.validateField(rule.field, () => {
|
|
21395
|
+
if (list.length) {
|
|
21396
|
+
inject.api.clearValidateState(rule.field);
|
|
21397
|
+
}
|
|
21398
|
+
});
|
|
20861
21399
|
});
|
|
20862
21400
|
},
|
|
20863
21401
|
},
|
|
@@ -20915,6 +21453,7 @@ function validator(rule, value) {
|
|
|
20915
21453
|
var table = {
|
|
20916
21454
|
name: 'table',
|
|
20917
21455
|
rule(data, extraConfig) {
|
|
21456
|
+
var _a;
|
|
20918
21457
|
return {
|
|
20919
21458
|
type: 'TableWidget',
|
|
20920
21459
|
component: TableWidget,
|
|
@@ -20936,12 +21475,14 @@ var table = {
|
|
|
20936
21475
|
validator(rule, value) {
|
|
20937
21476
|
return validator(data, value);
|
|
20938
21477
|
},
|
|
20939
|
-
message: '请检查必填项',
|
|
21478
|
+
message: ((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请检查必填项',
|
|
20940
21479
|
},
|
|
20941
21480
|
],
|
|
21481
|
+
wrap: data.wrap,
|
|
20942
21482
|
};
|
|
20943
21483
|
},
|
|
20944
21484
|
rowRule(data, extraConfig) {
|
|
21485
|
+
var _a;
|
|
20945
21486
|
return {
|
|
20946
21487
|
type: 'TableWidget',
|
|
20947
21488
|
component: TableWidget,
|
|
@@ -20963,12 +21504,13 @@ var table = {
|
|
|
20963
21504
|
validator(rule, value) {
|
|
20964
21505
|
return validator(data, value);
|
|
20965
21506
|
},
|
|
20966
|
-
message: '请检查必填项',
|
|
21507
|
+
message: ((_a = data.effect) === null || _a === void 0 ? void 0 : _a.requiredTip) || '请检查必填项',
|
|
20967
21508
|
},
|
|
20968
21509
|
],
|
|
20969
21510
|
col: {
|
|
20970
21511
|
span: 24,
|
|
20971
21512
|
},
|
|
21513
|
+
wrap: data.wrap,
|
|
20972
21514
|
};
|
|
20973
21515
|
},
|
|
20974
21516
|
};
|
|
@@ -21138,9 +21680,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
21138
21680
|
"formPermissions",
|
|
21139
21681
|
"resolveRulesConfig"
|
|
21140
21682
|
],
|
|
21141
|
-
emits: ["update:value"],
|
|
21683
|
+
emits: ["update:value", "change"],
|
|
21142
21684
|
setup(__props, { expose, emit: emits }) {
|
|
21143
21685
|
const props = __props;
|
|
21686
|
+
FC.component("BmLabelTooltip", BmOverTooltips);
|
|
21144
21687
|
const formRuleList = computed(() => {
|
|
21145
21688
|
if (typeof props.resolveRulesConfig === "function") {
|
|
21146
21689
|
const rules = props.resolveRulesConfig(ruleList);
|
|
@@ -21160,6 +21703,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
21160
21703
|
span: 24
|
|
21161
21704
|
}
|
|
21162
21705
|
},
|
|
21706
|
+
form: {
|
|
21707
|
+
title: ""
|
|
21708
|
+
},
|
|
21163
21709
|
submitBtn: false,
|
|
21164
21710
|
global: {
|
|
21165
21711
|
ShopWidget: {
|
|
@@ -21298,6 +21844,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
21298
21844
|
immediate: true
|
|
21299
21845
|
}
|
|
21300
21846
|
);
|
|
21847
|
+
function onChange(...reset) {
|
|
21848
|
+
emits("change", ...reset);
|
|
21849
|
+
}
|
|
21301
21850
|
expose({ fApi });
|
|
21302
21851
|
return (_ctx, _cache) => {
|
|
21303
21852
|
const _component_formCreate = resolveComponent("formCreate", true);
|
|
@@ -21312,7 +21861,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
21312
21861
|
"model-value": __props.value,
|
|
21313
21862
|
option: unref(option),
|
|
21314
21863
|
rule: rule.value,
|
|
21315
|
-
"onUpdate:modelValue": handleValue
|
|
21864
|
+
"onUpdate:modelValue": handleValue,
|
|
21865
|
+
onChange
|
|
21316
21866
|
}, null, 8, ["api", "model-value", "option", "rule"])
|
|
21317
21867
|
], 64);
|
|
21318
21868
|
};
|