fmui-base 2.3.13 → 2.3.15
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/README.md +2 -0
- package/lib/form/form.js +89 -53
- package/lib/form/subForm.js +26 -23
- package/lib/process_info/processInfo.js +84 -35
- package/package.json +1 -1
package/README.md
CHANGED
package/lib/form/form.js
CHANGED
|
@@ -690,8 +690,8 @@ var PageHome = function (_React$Component) {
|
|
|
690
690
|
itemParam.decimalPlace = form.decimalPlace; //小数位数
|
|
691
691
|
itemParam.dataAttr = form['dataAttr'];
|
|
692
692
|
itemParam.maxlength = form['length'];
|
|
693
|
-
/*if(itemParam.dataAttr){
|
|
694
|
-
alert("265====="+itemParam.dataAttr.textLineFeed);
|
|
693
|
+
/*if(itemParam.dataAttr){
|
|
694
|
+
alert("265====="+itemParam.dataAttr.textLineFeed);
|
|
695
695
|
}*/
|
|
696
696
|
//宏值签名图片
|
|
697
697
|
// if(itemParam.dataAttr && itemParam.dataAttr.dataSrc=='2' && !readOnly && !itemParam.bizCodeRuleId){
|
|
@@ -945,11 +945,11 @@ var PageHome = function (_React$Component) {
|
|
|
945
945
|
if (value == item.value) {
|
|
946
946
|
value = { value: value, text: item.name };
|
|
947
947
|
}
|
|
948
|
-
/*}else{
|
|
949
|
-
var defaultValue=form.defaultValue;
|
|
950
|
-
if(defaultValue == item.value){
|
|
951
|
-
value = {value:value,text:item.name};
|
|
952
|
-
}
|
|
948
|
+
/*}else{
|
|
949
|
+
var defaultValue=form.defaultValue;
|
|
950
|
+
if(defaultValue == item.value){
|
|
951
|
+
value = {value:value,text:item.name};
|
|
952
|
+
}
|
|
953
953
|
}*/
|
|
954
954
|
selectOptions.push(option);
|
|
955
955
|
}
|
|
@@ -993,8 +993,21 @@ var PageHome = function (_React$Component) {
|
|
|
993
993
|
|
|
994
994
|
if (form.dataAttr && typeof form.dataAttr != "undefined") {
|
|
995
995
|
var dateDisplayFormat = form.dataAttr.dateDisplayFormat;
|
|
996
|
-
|
|
996
|
+
// 优先按 dateDisplayFormat 识别展示类型;勿用 form.dateFormat==YMDHM 抢先匹配,
|
|
997
|
+
// 否则时分(HourMin)进不了分支,HH:mm 会被下方当作无效值清空
|
|
998
|
+
if (dateDisplayFormat == "HourMin") {
|
|
997
999
|
dateFormat = "YMDHM";
|
|
1000
|
+
if (value && typeof value === 'string') {
|
|
1001
|
+
var hm = value.trim();
|
|
1002
|
+
// HH:mm / H:mm / HH:mm:ss
|
|
1003
|
+
if (/^\d{1,2}:\d{2}(:\d{2})?$/.test(hm)) {
|
|
1004
|
+
var hmParts = hm.split(':');
|
|
1005
|
+
var hh = hmParts[0].length === 1 ? '0' + hmParts[0] : hmParts[0];
|
|
1006
|
+
var mm = hmParts[1];
|
|
1007
|
+
value = formattedDate + " " + hh + ":" + mm + ":00";
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
dateFormatShow = "HourMin";
|
|
998
1011
|
} else if (dateDisplayFormat == "YearMon") {
|
|
999
1012
|
dateFormat = "YM";
|
|
1000
1013
|
} else if (dateDisplayFormat == "MonthDay") {
|
|
@@ -1003,12 +1016,6 @@ var PageHome = function (_React$Component) {
|
|
|
1003
1016
|
dateFormat = "Y";
|
|
1004
1017
|
} else if (dateDisplayFormat == "ODate") {
|
|
1005
1018
|
dateFormat = "YMD";
|
|
1006
|
-
} else if (dateDisplayFormat == "HourMin") {
|
|
1007
|
-
dateFormat = "YMDHM";
|
|
1008
|
-
if (value && value.length == 5) {
|
|
1009
|
-
value = formattedDate + " " + value + ":00";
|
|
1010
|
-
}
|
|
1011
|
-
dateFormatShow = "HourMin";
|
|
1012
1019
|
} else if (dateDisplayFormat == "zhDate") {
|
|
1013
1020
|
dateFormat = "YMD";
|
|
1014
1021
|
dateFormatShow = "zhDate";
|
|
@@ -1021,6 +1028,8 @@ var PageHome = function (_React$Component) {
|
|
|
1021
1028
|
} else if (dateDisplayFormat == "DateTimeInterval") {
|
|
1022
1029
|
dateFormat = "DateInterval";
|
|
1023
1030
|
dateFormatShow = "dayWithTime";
|
|
1031
|
+
} else if (dateDisplayFormat == "STime" || dateFormat == "YMDHM") {
|
|
1032
|
+
dateFormat = "YMDHM";
|
|
1024
1033
|
} else {
|
|
1025
1034
|
dateFormat = "YMDHM";
|
|
1026
1035
|
}
|
|
@@ -1112,6 +1121,11 @@ var PageHome = function (_React$Component) {
|
|
|
1112
1121
|
value = new Date(value).getTime();
|
|
1113
1122
|
} else if (value && typeof value === 'string' && value.length == 7 && dateFormat == "YM") {
|
|
1114
1123
|
value = new Date(value).getTime();
|
|
1124
|
+
} else if (dateFormatShow == 'HourMin' && value && typeof value === 'string' && /^\d{1,2}:\d{2}(:\d{2})?$/.test(value.trim())) {
|
|
1125
|
+
// 时分兜底:仍为 HH:mm 时拼当前日期再转时间戳,避免被清空
|
|
1126
|
+
var hmFallback = value.trim().split(':');
|
|
1127
|
+
var hhFallback = hmFallback[0].length === 1 ? '0' + hmFallback[0] : hmFallback[0];
|
|
1128
|
+
value = new Date((formattedDate + " " + hhFallback + ":" + hmFallback[1] + ":00").replace(/-/g, "/")).getTime();
|
|
1115
1129
|
} else {
|
|
1116
1130
|
for (var i = 0; i < mainTblData.length; i++) {
|
|
1117
1131
|
if (itemParam.key == mainTblData[i].key) {
|
|
@@ -2069,26 +2083,32 @@ var PageHome = function (_React$Component) {
|
|
|
2069
2083
|
}
|
|
2070
2084
|
} else if (itemParam.itemType == 'checkbox') {
|
|
2071
2085
|
var selectOptions = itemParam.selectOptions;
|
|
2072
|
-
var valueHas = false; //判断传过来的值是否有匹配
|
|
2073
2086
|
var value = itemNew[i].value;
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2087
|
+
// 子表删除后刷新时 value 可能为 undefined/null,直接 split 会报错
|
|
2088
|
+
var valueArray = value == null || value === '' ? [] : String(value).split(",");
|
|
2089
|
+
if (itemParam.isinput == '1') {
|
|
2090
|
+
// 多选可输入走 SelectInput,无 checkbox_ ref
|
|
2091
|
+
itemParam[key] = value == null ? '' : value;
|
|
2092
|
+
} else {
|
|
2093
|
+
selectOptions.map(function (item1) {
|
|
2094
|
+
var isHas = false;
|
|
2095
|
+
valueArray.map(function (item2) {
|
|
2096
|
+
if (item1.value == item2) {
|
|
2097
|
+
item1.checked = true;
|
|
2098
|
+
selectText += item1.text + ',';
|
|
2099
|
+
isHas = true;
|
|
2100
|
+
}
|
|
2101
|
+
});
|
|
2102
|
+
if (!isHas) {
|
|
2103
|
+
item1.checked = false;
|
|
2082
2104
|
}
|
|
2083
2105
|
});
|
|
2084
|
-
if (
|
|
2085
|
-
|
|
2106
|
+
if (selectText != '') {
|
|
2107
|
+
selectText = selectText.substring(0, selectText.length - 1);
|
|
2086
2108
|
}
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
selectText = selectText.substring(0, selectText.length - 1);
|
|
2109
|
+
itemParam[key] = value == null ? '' : value;
|
|
2110
|
+
checkboxValueHas = true;
|
|
2090
2111
|
}
|
|
2091
|
-
checkboxValueHas = true;
|
|
2092
2112
|
} else if (itemParam.itemType == 'datetime') {
|
|
2093
2113
|
itemParam[key] = itemNew[i].value;
|
|
2094
2114
|
if (this.props.data) {
|
|
@@ -2114,9 +2134,12 @@ var PageHome = function (_React$Component) {
|
|
|
2114
2134
|
itemParam: Object.assign({}, itemParam)
|
|
2115
2135
|
}, function () {
|
|
2116
2136
|
if (checkboxValueHas) {
|
|
2117
|
-
this.refs["checkbox_" + itemParam.tableName + "_" + itemParam.key]
|
|
2118
|
-
|
|
2119
|
-
|
|
2137
|
+
var checkboxRef = this.refs["checkbox_" + itemParam.tableName + "_" + itemParam.key];
|
|
2138
|
+
if (checkboxRef && typeof checkboxRef.setState === 'function') {
|
|
2139
|
+
checkboxRef.setState({
|
|
2140
|
+
selectedText: selectText
|
|
2141
|
+
});
|
|
2142
|
+
}
|
|
2120
2143
|
}
|
|
2121
2144
|
// if(dataType=='sub'){
|
|
2122
2145
|
// this.props.reloadItemParam(itemNew,this.state.itemParam);
|
|
@@ -2360,21 +2383,21 @@ var PageHome = function (_React$Component) {
|
|
|
2360
2383
|
var length = item.maxlength;
|
|
2361
2384
|
var patrn = /^-?\d+(\.\d+)?$/;
|
|
2362
2385
|
if (newValue !== '' && newValue != '-') {
|
|
2363
|
-
/* var validAttr=item['validAttr'];
|
|
2364
|
-
if(validAttr!=null && validAttr.length>0){
|
|
2365
|
-
for(var va=0;va<validAttr.length;va++){
|
|
2366
|
-
var regular=validAttr[va]['regular'];
|
|
2367
|
-
var tips=validAttr[va]['tips'];
|
|
2368
|
-
var reg=new RegExp(regular.slice(1,-1),"g");
|
|
2369
|
-
if(!reg.test(newValue)){
|
|
2370
|
-
Toast.show({
|
|
2371
|
-
type: 'error',
|
|
2372
|
-
content:item.title+':'+tips
|
|
2373
|
-
});
|
|
2374
|
-
return false;
|
|
2375
|
-
}
|
|
2376
|
-
|
|
2377
|
-
}
|
|
2386
|
+
/* var validAttr=item['validAttr'];
|
|
2387
|
+
if(validAttr!=null && validAttr.length>0){
|
|
2388
|
+
for(var va=0;va<validAttr.length;va++){
|
|
2389
|
+
var regular=validAttr[va]['regular'];
|
|
2390
|
+
var tips=validAttr[va]['tips'];
|
|
2391
|
+
var reg=new RegExp(regular.slice(1,-1),"g");
|
|
2392
|
+
if(!reg.test(newValue)){
|
|
2393
|
+
Toast.show({
|
|
2394
|
+
type: 'error',
|
|
2395
|
+
content:item.title+':'+tips
|
|
2396
|
+
});
|
|
2397
|
+
return false;
|
|
2398
|
+
}
|
|
2399
|
+
|
|
2400
|
+
}
|
|
2378
2401
|
}*/
|
|
2379
2402
|
if (this.checkEmoji(newValue)) {
|
|
2380
2403
|
_Toast2.default.show({
|
|
@@ -2847,8 +2870,21 @@ var PageHome = function (_React$Component) {
|
|
|
2847
2870
|
if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && value != null && value.value != null) {
|
|
2848
2871
|
raw = value.value;
|
|
2849
2872
|
}
|
|
2873
|
+
// 时分:只读回显已是 HH:mm,new Date('HH:mm') 无效会导致提交值被清空
|
|
2874
|
+
if (dateFormatShow === 'HourMin' && typeof raw === 'string') {
|
|
2875
|
+
var hmStr = raw.trim();
|
|
2876
|
+
if (/^\d{1,2}:\d{2}(:\d{2})?$/.test(hmStr)) {
|
|
2877
|
+
var p = hmStr.split(':');
|
|
2878
|
+
var h = p[0].length === 1 ? '0' + p[0] : p[0];
|
|
2879
|
+
return h + ':' + p[1];
|
|
2880
|
+
}
|
|
2881
|
+
}
|
|
2850
2882
|
if (typeof raw === 'string') {
|
|
2851
2883
|
if (raw.length >= 10 && raw.indexOf('-') >= 0) {
|
|
2884
|
+
// 时分字段提交仍只需 HH:mm
|
|
2885
|
+
if (dateFormatShow === 'HourMin') {
|
|
2886
|
+
return this.dateFormat(new Date(raw.replace(/-/g, '/')).getTime(), dateFormat, dateFormatShow) || '';
|
|
2887
|
+
}
|
|
2852
2888
|
return raw.substring(0, 19);
|
|
2853
2889
|
}
|
|
2854
2890
|
if (/^\d+$/.test(raw)) {
|
|
@@ -3386,12 +3422,12 @@ var PageHome = function (_React$Component) {
|
|
|
3386
3422
|
});
|
|
3387
3423
|
return false;
|
|
3388
3424
|
}
|
|
3389
|
-
/* if(newValue=''){
|
|
3390
|
-
Toast.show({
|
|
3391
|
-
type: 'error',
|
|
3392
|
-
content: '意见不能为空!',
|
|
3393
|
-
});
|
|
3394
|
-
return false;
|
|
3425
|
+
/* if(newValue=''){
|
|
3426
|
+
Toast.show({
|
|
3427
|
+
type: 'error',
|
|
3428
|
+
content: '意见不能为空!',
|
|
3429
|
+
});
|
|
3430
|
+
return false;
|
|
3395
3431
|
}*/
|
|
3396
3432
|
if (newValue.length > 2000) {
|
|
3397
3433
|
newValue = newValue.substring(0, 2000);
|
package/lib/form/subForm.js
CHANGED
|
@@ -335,28 +335,28 @@ var PageHome = function (_React$Component) {
|
|
|
335
335
|
var data = this.props.data;
|
|
336
336
|
var subTblList = data.subTbl; //子表
|
|
337
337
|
var relatedTbl = data.relatedTbl; //关联表
|
|
338
|
-
/* var calculateExpList = data.calculateExpList;//计算公式列表
|
|
339
|
-
var calculateExpList1 = value.calculateExpList;//计算公式列表
|
|
340
|
-
if(calculateExpList1){
|
|
341
|
-
for(var key in calculateExpList1){
|
|
342
|
-
var calculateExpValue;
|
|
343
|
-
if(calculateExpList){
|
|
344
|
-
calculateExpValue = calculateExpList[key];
|
|
345
|
-
if(!calculateExpValue){
|
|
346
|
-
calculateExpValue = [];
|
|
347
|
-
}
|
|
348
|
-
}else{
|
|
349
|
-
calculateExpList = {};
|
|
350
|
-
calculateExpValue = [];
|
|
351
|
-
}
|
|
352
|
-
for(var j=0;j<calculateExpList1[key].length;j++){
|
|
353
|
-
calculateExpValue.push(calculateExpList1[key][j]);
|
|
354
|
-
}
|
|
355
|
-
calculateExpList[key] = calculateExpValue;
|
|
356
|
-
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
data.calculateExpList = calculateExpList;
|
|
338
|
+
/* var calculateExpList = data.calculateExpList;//计算公式列表
|
|
339
|
+
var calculateExpList1 = value.calculateExpList;//计算公式列表
|
|
340
|
+
if(calculateExpList1){
|
|
341
|
+
for(var key in calculateExpList1){
|
|
342
|
+
var calculateExpValue;
|
|
343
|
+
if(calculateExpList){
|
|
344
|
+
calculateExpValue = calculateExpList[key];
|
|
345
|
+
if(!calculateExpValue){
|
|
346
|
+
calculateExpValue = [];
|
|
347
|
+
}
|
|
348
|
+
}else{
|
|
349
|
+
calculateExpList = {};
|
|
350
|
+
calculateExpValue = [];
|
|
351
|
+
}
|
|
352
|
+
for(var j=0;j<calculateExpList1[key].length;j++){
|
|
353
|
+
calculateExpValue.push(calculateExpList1[key][j]);
|
|
354
|
+
}
|
|
355
|
+
calculateExpList[key] = calculateExpValue;
|
|
356
|
+
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
data.calculateExpList = calculateExpList;
|
|
360
360
|
}*/
|
|
361
361
|
|
|
362
362
|
this.dealwithSubData(subTblList, subTblNo, value, relatedTbl);
|
|
@@ -875,8 +875,11 @@ var PageHome = function (_React$Component) {
|
|
|
875
875
|
for (var n = 0; n < tblData.length; n++) {
|
|
876
876
|
var key = tblData[n].key;
|
|
877
877
|
var value = tblData[n].value;
|
|
878
|
+
if (value == null) {
|
|
879
|
+
value = '';
|
|
880
|
+
}
|
|
878
881
|
if (this.refs[tblName + '_' + key + '_' + m]) {
|
|
879
|
-
this.refs[tblName + '_' + key + '_' + m].reloadItemParam([{ 'key': 'value', 'value': value }]);
|
|
882
|
+
this.refs[tblName + '_' + key + '_' + m].reloadItemParam([{ 'key': 'value', 'value': value }], { silent: true });
|
|
880
883
|
}
|
|
881
884
|
}
|
|
882
885
|
}
|
|
@@ -517,7 +517,7 @@ var PageHome = function (_React$Component) {
|
|
|
517
517
|
selectProcessCode: '', //选中的子流程
|
|
518
518
|
subProcessType: '', //子流程类型 0串行 1并行
|
|
519
519
|
urgencyList: [], //紧急程度列表
|
|
520
|
-
urgency: '' }, _defineProperty(_param, 'urgent', ''), _defineProperty(_param, 'backInitiatorEndFlow', '0'), _defineProperty(_param, 'oauthWindowURL', ''), _defineProperty(_param, 'signDataId', ''), _defineProperty(_param, 'isCaUser', '0'), _defineProperty(_param, 'caFirm', ''), _defineProperty(_param, 'caESignatureName', ''), _defineProperty(_param, 'caFormSign', ''), _defineProperty(_param, 'addlotsReturn', ''), _defineProperty(_param, 'inscriptionShow', ''), _defineProperty(_param, 'showOrgSwitcher', false), _defineProperty(_param, 'approveOrgOptions', []), _defineProperty(_param, 'approveOrgSelectValue', {}), _defineProperty(_param, 'approveCurOrgId', ''), _defineProperty(_param, 'startUserOrgId', ''), _defineProperty(_param, 'taskAssignOrgId', ''), _defineProperty(_param, 'approveOrgApiUnavailable', false), _param);
|
|
520
|
+
urgency: '' }, _defineProperty(_param, 'urgent', ''), _defineProperty(_param, 'backInitiatorEndFlow', '0'), _defineProperty(_param, 'oauthWindowURL', ''), _defineProperty(_param, 'signDataId', ''), _defineProperty(_param, 'isCaUser', '0'), _defineProperty(_param, 'caFirm', ''), _defineProperty(_param, 'caESignatureName', ''), _defineProperty(_param, 'caFormSign', ''), _defineProperty(_param, 'addlotsReturn', ''), _defineProperty(_param, 'inscriptionShow', ''), _defineProperty(_param, 'showOrgSwitcher', false), _defineProperty(_param, 'approveOrgOptions', []), _defineProperty(_param, 'approveOrgSelectValue', {}), _defineProperty(_param, 'approveFormParttimeOrgEnabled', true), _defineProperty(_param, 'approveCurOrgId', ''), _defineProperty(_param, 'startUserOrgId', ''), _defineProperty(_param, 'taskAssignOrgId', ''), _defineProperty(_param, 'approveOrgApiUnavailable', false), _param);
|
|
521
521
|
FlowCommon = require('pages/flow_common/' + module).default ? require('pages/flow_common/' + module).default : require('pages/flow_common/' + module);
|
|
522
522
|
|
|
523
523
|
//处理特有参数
|
|
@@ -7638,10 +7638,18 @@ var PageHome = function (_React$Component) {
|
|
|
7638
7638
|
value: org.id
|
|
7639
7639
|
};
|
|
7640
7640
|
}
|
|
7641
|
+
|
|
7642
|
+
/** 流程设置「表单切换兼职组织」是否启用,默认启用(仅明确为 0 时禁用) */
|
|
7643
|
+
|
|
7644
|
+
}, {
|
|
7645
|
+
key: 'isApproveFormParttimeOrgEnabled',
|
|
7646
|
+
value: function isApproveFormParttimeOrgEnabled() {
|
|
7647
|
+
return this.state.approveFormParttimeOrgEnabled !== false;
|
|
7648
|
+
}
|
|
7641
7649
|
}, {
|
|
7642
7650
|
key: 'renderApproveOrgSwitcher',
|
|
7643
7651
|
value: function renderApproveOrgSwitcher(orgList, selectedOrgId) {
|
|
7644
|
-
if (!orgList || orgList.length <= 1) {
|
|
7652
|
+
if (!this.isApproveFormParttimeOrgEnabled() || !orgList || orgList.length <= 1) {
|
|
7645
7653
|
this.setState({
|
|
7646
7654
|
showOrgSwitcher: false,
|
|
7647
7655
|
approveOrgOptions: [],
|
|
@@ -7686,44 +7694,85 @@ var PageHome = function (_React$Component) {
|
|
|
7686
7694
|
if (!window.approveOrgAutoSwitchedMap) {
|
|
7687
7695
|
window.approveOrgAutoSwitchedMap = {};
|
|
7688
7696
|
}
|
|
7689
|
-
|
|
7690
|
-
|
|
7691
|
-
|
|
7692
|
-
}
|
|
7693
|
-
|
|
7694
|
-
|
|
7695
|
-
|
|
7696
|
-
|
|
7697
|
-
|
|
7698
|
-
|
|
7699
|
-
|
|
7700
|
-
|
|
7701
|
-
|
|
7702
|
-
|
|
7703
|
-
|
|
7704
|
-
|
|
7705
|
-
|
|
7706
|
-
|
|
7707
|
-
|
|
7708
|
-
|
|
7709
|
-
|
|
7710
|
-
|
|
7711
|
-
|
|
7712
|
-
|
|
7713
|
-
|
|
7714
|
-
|
|
7715
|
-
|
|
7716
|
-
|
|
7697
|
+
// 先读取流程设置「表单切换兼职组织」(默认启用)
|
|
7698
|
+
var loadOrgSwitcher = function loadOrgSwitcher(parttimeOrgEnabled) {
|
|
7699
|
+
t.setState({ approveFormParttimeOrgEnabled: parttimeOrgEnabled !== false });
|
|
7700
|
+
_db2.default.FlowModuleAPI.getUserSetInfo({}).then(function (userInfo) {
|
|
7701
|
+
if (currentSeq != window.approveOrgSwitcherSeq || t.state.approveOrgApiUnavailable) {
|
|
7702
|
+
return;
|
|
7703
|
+
}
|
|
7704
|
+
if (!userInfo) {
|
|
7705
|
+
t.hideApproveOrgSwitcherSilently();
|
|
7706
|
+
return;
|
|
7707
|
+
}
|
|
7708
|
+
if (userInfo.content && !userInfo.orgList) {
|
|
7709
|
+
userInfo = userInfo.content;
|
|
7710
|
+
}
|
|
7711
|
+
var orgList = userInfo.orgList || [];
|
|
7712
|
+
var showSwitcher = parttimeOrgEnabled !== false && orgList && orgList.length > 1;
|
|
7713
|
+
if (!orgList || orgList.length == 0 || !showSwitcher) {
|
|
7714
|
+
// 开关禁用但有兼职时,仍可静默切到目标组织,仅隐藏切换区
|
|
7715
|
+
if (orgList && orgList.length > 1 && parttimeOrgEnabled === false) {
|
|
7716
|
+
var curOrgIdHide = userInfo.curOrgId || '';
|
|
7717
|
+
var hideTargetOrgId = t.resolveApproveOrgTargetId(orgList, curOrgIdHide, t.state.taskAssignOrgId, t.state.startUserOrgId);
|
|
7718
|
+
if (hideTargetOrgId && hideTargetOrgId != curOrgIdHide && !window.approveOrgAutoSwitchedMap[autoSwitchKey]) {
|
|
7719
|
+
t.switchApproveOrg(hideTargetOrgId, function () {
|
|
7720
|
+
if (currentSeq != window.approveOrgSwitcherSeq) {
|
|
7721
|
+
return;
|
|
7722
|
+
}
|
|
7723
|
+
window.approveOrgAutoSwitchedMap[autoSwitchKey] = true;
|
|
7724
|
+
t.setState({ showOrgSwitcher: false });
|
|
7725
|
+
}, function () {
|
|
7726
|
+
if (currentSeq != window.approveOrgSwitcherSeq) {
|
|
7727
|
+
return;
|
|
7728
|
+
}
|
|
7729
|
+
t.setState({ showOrgSwitcher: false });
|
|
7730
|
+
}, { silent: true });
|
|
7731
|
+
return;
|
|
7732
|
+
}
|
|
7717
7733
|
}
|
|
7734
|
+
t.setState({ showOrgSwitcher: false });
|
|
7735
|
+
return;
|
|
7736
|
+
}
|
|
7737
|
+
var curOrgId = userInfo.curOrgId || '';
|
|
7738
|
+
var targetOrgId = t.resolveApproveOrgTargetId(orgList, curOrgId, t.state.taskAssignOrgId, t.state.startUserOrgId);
|
|
7739
|
+
if (targetOrgId && targetOrgId != curOrgId && !window.approveOrgAutoSwitchedMap[autoSwitchKey]) {
|
|
7740
|
+
t.switchApproveOrg(targetOrgId, function () {
|
|
7741
|
+
if (currentSeq != window.approveOrgSwitcherSeq) {
|
|
7742
|
+
return;
|
|
7743
|
+
}
|
|
7744
|
+
window.approveOrgAutoSwitchedMap[autoSwitchKey] = true;
|
|
7745
|
+
t.renderApproveOrgSwitcher(orgList, targetOrgId);
|
|
7746
|
+
}, function () {
|
|
7747
|
+
if (currentSeq != window.approveOrgSwitcherSeq) {
|
|
7748
|
+
return;
|
|
7749
|
+
}
|
|
7750
|
+
t.hideApproveOrgSwitcherSilently();
|
|
7751
|
+
}, { silent: true });
|
|
7752
|
+
return;
|
|
7753
|
+
}
|
|
7754
|
+
t.renderApproveOrgSwitcher(orgList, targetOrgId || curOrgId);
|
|
7755
|
+
}).catch(function (err) {
|
|
7756
|
+
if (currentSeq == window.approveOrgSwitcherSeq) {
|
|
7718
7757
|
t.hideApproveOrgSwitcherSilently();
|
|
7719
|
-
}
|
|
7758
|
+
}
|
|
7759
|
+
});
|
|
7760
|
+
};
|
|
7761
|
+
_db2.default.FlowModuleAPI.getSysSettingByMark({ mark: 'approveFormParttimeOrg' }).then(function (content) {
|
|
7762
|
+
if (currentSeq != window.approveOrgSwitcherSeq) {
|
|
7720
7763
|
return;
|
|
7721
7764
|
}
|
|
7722
|
-
|
|
7723
|
-
|
|
7724
|
-
|
|
7725
|
-
|
|
7765
|
+
var val = content;
|
|
7766
|
+
if (content && (typeof content === 'undefined' ? 'undefined' : _typeof(content)) === 'object' && content.content != null) {
|
|
7767
|
+
val = content.content;
|
|
7768
|
+
}
|
|
7769
|
+
// 默认启用:仅明确为 '0' 时禁用
|
|
7770
|
+
loadOrgSwitcher(val != '0');
|
|
7771
|
+
}).catch(function () {
|
|
7772
|
+
if (currentSeq != window.approveOrgSwitcherSeq) {
|
|
7773
|
+
return;
|
|
7726
7774
|
}
|
|
7775
|
+
loadOrgSwitcher(true);
|
|
7727
7776
|
});
|
|
7728
7777
|
}
|
|
7729
7778
|
}, {
|