cloud-web-corejs 1.0.54-dev.208 → 1.0.54-dev.209
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.
@@ -21,7 +21,8 @@ import {
|
|
21
21
|
runDataSourceRequest,
|
22
22
|
getContainerWidgetByName,
|
23
23
|
cloneFormConfigWithoutEventHandler,
|
24
|
-
loopHandleWidget
|
24
|
+
loopHandleWidget,
|
25
|
+
traverseAllWidgetsNew, columnFormatMap
|
25
26
|
} from '../../../components/xform/utils/util';
|
26
27
|
import {
|
27
28
|
containers,
|
@@ -433,11 +434,74 @@ modules = {
|
|
433
434
|
|
434
435
|
return Object.keys(originalWidget.options).indexOf(configName) > -1;
|
435
436
|
},
|
437
|
+
loopHandleAllWidget(callback) {
|
438
|
+
let columnLoopDo = (t, e) => {
|
439
|
+
if (t.children && t.children.length) {
|
440
|
+
t.children.forEach(item => {
|
441
|
+
columnLoopDo(item)
|
442
|
+
})
|
443
|
+
} else {
|
444
|
+
if (t.widget) {
|
445
|
+
callback && callback(t.widget)
|
446
|
+
}
|
447
|
+
if (t.editWidget) {
|
448
|
+
callback && callback(t.editWidget)
|
449
|
+
}
|
450
|
+
if (t.widgetList && t.widgetList.length) {
|
451
|
+
loopHandleWidget(t.widgetList, (widget) => {
|
452
|
+
callback && callback(widget)
|
453
|
+
});
|
454
|
+
}
|
455
|
+
}
|
456
|
+
}
|
457
|
+
loopHandleWidget(this.formJson.widgetList, (widget, parentWidget) => {
|
458
|
+
if (callback) {
|
459
|
+
callback(widget)
|
460
|
+
if (widget.type == "data-table") {
|
461
|
+
widget.options.tableColumns.forEach(item => {
|
462
|
+
columnLoopDo(item)
|
463
|
+
})
|
464
|
+
}
|
465
|
+
}
|
466
|
+
});
|
467
|
+
},
|
468
|
+
handleTableColumnWidget(widget) {
|
469
|
+
//修复data-table旧数据表格列widget与editWidget为空的问题
|
470
|
+
if (!widget || widget.type != "data-table" || !widget.options.tableColumns) return
|
471
|
+
let columnLoopDo = (t, e) => {
|
472
|
+
if (t.children && t.children.length) {
|
473
|
+
t.children.forEach(item => {
|
474
|
+
columnLoopDo(item)
|
475
|
+
})
|
476
|
+
} else {
|
477
|
+
let type1 = columnFormatMap[t.formatS];
|
478
|
+
if (type1 && t.columnOption && !t.widget) {
|
479
|
+
let fieldWidget = this.copyNewFieldWidget(
|
480
|
+
this.getFieldWidgetByType(type1)
|
481
|
+
);
|
482
|
+
fieldWidget.options = t.columnOption;
|
483
|
+
t.widget = fieldWidget;
|
484
|
+
}
|
485
|
+
let type2 = columnFormatMap[t.editFormatS];
|
486
|
+
if (type2 && t.editColumnOption && !t.editWidget) {
|
487
|
+
let fieldWidget = this.copyNewFieldWidget(
|
488
|
+
this.getFieldWidgetByType(type2)
|
489
|
+
);
|
490
|
+
fieldWidget.options = t.editColumnOption;
|
491
|
+
t.editWidget = fieldWidget;
|
492
|
+
}
|
493
|
+
}
|
494
|
+
}
|
495
|
+
|
496
|
+
widget.options.tableColumns.forEach(item => {
|
497
|
+
columnLoopDo(item)
|
498
|
+
})
|
499
|
+
},
|
436
500
|
hanldeCommonWidget2() {
|
437
501
|
let wfParam = this.wfParam || {};
|
438
502
|
let wfInfo = wfParam?.wfInfo
|
439
503
|
let taskDefinitionKey = wfInfo?.taskDefinitionKey;
|
440
|
-
let toModify = wfInfo?.toModify || false
|
504
|
+
let toModify = wfInfo?.toModify || false;//后台返回流程可以修改单据
|
441
505
|
|
442
506
|
let hasModifyItem = false;
|
443
507
|
let saveButton;
|
@@ -447,34 +511,37 @@ modules = {
|
|
447
511
|
let widgetEditOnWf = this.hanldeWfWidgetNew0();//是否有流程时,当前用户特定流程节点是否可全局可编辑
|
448
512
|
this.widgetEditOnWf = widgetEditOnWf;
|
449
513
|
|
450
|
-
|
514
|
+
traverseAllWidgetsNew(this.formJson.widgetList, (widget) => {
|
515
|
+
//修复data-table旧数据表格列widget与editWidget为空的问题
|
516
|
+
this.handleTableColumnWidget(widget);
|
451
517
|
|
452
|
-
let isModify = false;
|
453
518
|
//处理组件显隐规则
|
454
|
-
|
519
|
+
this.handleWidgetShowRule(widget);
|
455
520
|
|
456
521
|
if (wfParam.hasWf) {
|
522
|
+
//有流程
|
457
523
|
//设置组件的有流程可编辑,有流程隐藏
|
458
524
|
this.hanldeWfWidgetNew1(widget)
|
459
525
|
if (toModify) {
|
526
|
+
//后台返回流程可以修改单据
|
460
527
|
//设置组件的特定流程节点的可编辑,仅显示,隐藏
|
461
528
|
if (taskDefinitionKey) {
|
462
529
|
this.hanldeWfWidgetNew2(widget, (modifyFlag, saveButtonWidget) => {
|
463
530
|
if (!saveButton && saveButtonWidget) {
|
531
|
+
//获取保存按钮
|
464
532
|
saveButton = saveButtonWidget
|
465
533
|
}
|
466
|
-
/*if (modifyFlag) {
|
467
|
-
hasModifyItem = true;
|
468
|
-
}*/
|
469
534
|
})
|
470
535
|
}
|
471
536
|
if (widget.formItemFlag && !widget.options.hidden && !widget.options.disbaled) {
|
537
|
+
//存在存在可以编辑输入框框
|
472
538
|
hasModifyItem = true;
|
473
539
|
}
|
474
540
|
}
|
475
541
|
}
|
476
542
|
});
|
477
|
-
if (hasModifyItem && saveButton) {
|
543
|
+
if (toModify && hasModifyItem && saveButton) {
|
544
|
+
//后台返回流程可以修改单据,存在保存按钮,存在可以编辑输入框框
|
478
545
|
saveButton.options.disabled = false;
|
479
546
|
saveButton.options.hidden = false;
|
480
547
|
}
|
@@ -525,32 +592,32 @@ modules = {
|
|
525
592
|
let enabledByWf = widget?.options?.enabledByWf;
|
526
593
|
let hiddenByWf = widget?.options?.hiddenByWf;
|
527
594
|
let widgetName = widget?.options?.name;
|
528
|
-
if (!hiddenByWf && this.widgetEditOnWf) {
|
529
|
-
|
530
|
-
|
595
|
+
/* if (!hiddenByWf && this.widgetEditOnWf) {
|
596
|
+
enabledByWf = true;
|
597
|
+
}*/
|
531
598
|
let hidden = null;
|
532
599
|
let disabled = null;
|
533
600
|
if (isWfFlag) {
|
534
|
-
if (this.
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
601
|
+
if (!this.widgetEditOnWf) {
|
602
|
+
if (this.hasConfig(widget, 'disabled')) {
|
603
|
+
if (!enabledByWf) {
|
604
|
+
disabled = true;
|
605
|
+
let onClick = widget.options.onClick;
|
606
|
+
if (onClick && onClick.startsWith("this.getFormRef().$baseReload()")) {
|
607
|
+
disabled = false;
|
608
|
+
}
|
609
|
+
} else {
|
540
610
|
disabled = false;
|
541
611
|
}
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
if (disabled !== null) {
|
549
|
-
widget.options.disabled = disabled;
|
612
|
+
if (widgetType == 'reset_button' && enabledByWf === undefined) {
|
613
|
+
disabled = false;
|
614
|
+
}
|
615
|
+
if (disabled !== null) {
|
616
|
+
widget.options.disabled = disabled;
|
617
|
+
}
|
550
618
|
}
|
551
619
|
}
|
552
620
|
|
553
|
-
|
554
621
|
if (hiddenByWf) {
|
555
622
|
hidden = true
|
556
623
|
}
|
@@ -562,7 +629,7 @@ modules = {
|
|
562
629
|
}
|
563
630
|
}
|
564
631
|
|
565
|
-
if (widget?.type == "data-table") {
|
632
|
+
/*if (widget?.type == "data-table") {
|
566
633
|
let loopDo = (t, e) => {
|
567
634
|
if (t.children && t.children.length) {
|
568
635
|
t.children.forEach(item => {
|
@@ -583,7 +650,7 @@ modules = {
|
|
583
650
|
loopDo(item)
|
584
651
|
})
|
585
652
|
|
586
|
-
}
|
653
|
+
}*/
|
587
654
|
},
|
588
655
|
hanldeWfWidgetNew2(widget, callback) {
|
589
656
|
let hasModifyItem = false;
|
@@ -652,29 +719,6 @@ modules = {
|
|
652
719
|
}*/
|
653
720
|
}
|
654
721
|
handleWfConfigData(widget)
|
655
|
-
if (widget.type == "data-table") {
|
656
|
-
let loopDo = (t) => {
|
657
|
-
if (t.children && t.children.length) {
|
658
|
-
t.children.forEach(item => {
|
659
|
-
loopDo(item)
|
660
|
-
})
|
661
|
-
} else {
|
662
|
-
if (t.widget) {
|
663
|
-
handleWfConfigData(t.widget)
|
664
|
-
}
|
665
|
-
if (t.widgetList && t.widgetList.length) {
|
666
|
-
loopHandleWidget(t.widgetList, (item1) => {
|
667
|
-
handleWfConfigData(item1)
|
668
|
-
});
|
669
|
-
}
|
670
|
-
}
|
671
|
-
}
|
672
|
-
|
673
|
-
widget.options.tableColumns.forEach(item => {
|
674
|
-
loopDo(item)
|
675
|
-
})
|
676
|
-
}
|
677
|
-
|
678
722
|
return hasModifyItem;
|
679
723
|
},
|
680
724
|
|
@@ -277,6 +277,41 @@ export function traverseContainerWidgets(
|
|
277
277
|
}); */
|
278
278
|
}
|
279
279
|
|
280
|
+
export function traverseAllWidgetsNew(widgetList, callback) {
|
281
|
+
if (!widgetList) {
|
282
|
+
return;
|
283
|
+
}
|
284
|
+
let columnLoopDo = (t, e) => {
|
285
|
+
if (t.children && t.children.length) {
|
286
|
+
t.children.forEach(item => {
|
287
|
+
columnLoopDo(item)
|
288
|
+
})
|
289
|
+
} else {
|
290
|
+
if (t.widget) {
|
291
|
+
callback && callback(t.widget)
|
292
|
+
}
|
293
|
+
if (t.editWidget) {
|
294
|
+
callback && callback(t.editWidget)
|
295
|
+
}
|
296
|
+
if (t.widgetList && t.widgetList.length) {
|
297
|
+
loopHandleWidget(t.widgetList, (widget) => {
|
298
|
+
callback && callback(widget)
|
299
|
+
});
|
300
|
+
}
|
301
|
+
}
|
302
|
+
}
|
303
|
+
loopHandleWidget(widgetList, (widget,parentWidget) => {
|
304
|
+
if(callback){
|
305
|
+
callback(widget)
|
306
|
+
if(widget.type == "data-table"){
|
307
|
+
widget.options.tableColumns.forEach(item => {
|
308
|
+
columnLoopDo(item)
|
309
|
+
})
|
310
|
+
}
|
311
|
+
}
|
312
|
+
});
|
313
|
+
}
|
314
|
+
|
280
315
|
export function traverseAllWidgets(widgetList, handler) {
|
281
316
|
if (!widgetList) {
|
282
317
|
return;
|