centaline-data-driven-v3 0.0.72 → 0.0.74

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.
@@ -124,7 +124,7 @@ function validExcuteMessage(validtemp, model) {
124
124
  }
125
125
 
126
126
  //路由操作事件
127
- export function RouterClickHandler(field, submitData, action, model, source, callBack) {
127
+ export function RouterClickHandler(field, submitData, action, model, source, callBack,flagMouseenter) {
128
128
  if (source == 'form') {
129
129
  model.scripts.$fd = field.id;
130
130
  model.scripts.$result = [];
@@ -528,7 +528,12 @@ export function RouterClickHandler(field, submitData, action, model, source, cal
528
528
  },
529
529
  ],
530
530
  };
531
- common.openDialog(dialogOption);
531
+ if(flagMouseenter&&callBack){
532
+ callBack(dialogOption.content[0])
533
+ }
534
+ else{
535
+ common.openDialog(dialogOption);
536
+ }
532
537
  }
533
538
  else if (field.isExport || field.flagAsync) {
534
539
  submitData = field.getActionPara(submitData).para;
@@ -775,7 +780,12 @@ export function RouterClickHandler(field, submitData, action, model, source, cal
775
780
  },
776
781
  }]
777
782
  };
778
- common.openDialog(dialogOption);
783
+ if(flagMouseenter&&callBack){
784
+ callBack(dialogOption.content[0])
785
+ }
786
+ else{
787
+ common.openDialog(dialogOption);
788
+ }
779
789
  }
780
790
  else if (field.isOpenList) {
781
791
  var dialogOption = {
@@ -796,7 +806,12 @@ export function RouterClickHandler(field, submitData, action, model, source, cal
796
806
  },
797
807
  }]
798
808
  };
799
- common.openDialog(dialogOption);
809
+ if(flagMouseenter&&callBack){
810
+ callBack(dialogOption.content[0])
811
+ }
812
+ else{
813
+ common.openDialog(dialogOption);
814
+ }
800
815
  }
801
816
  else if (field.isVueComponentInLayer) {
802
817
  var dialogOption = {
@@ -839,14 +854,19 @@ export function RouterClickHandler(field, submitData, action, model, source, cal
839
854
  },
840
855
  }]
841
856
  };
842
- common.openDialog(dialogOption);
857
+ if(flagMouseenter&&callBack){
858
+ callBack(dialogOption.content[0])
859
+ }
860
+ else{
861
+ common.openDialog(dialogOption);
862
+ }
843
863
  }
844
864
  else {
845
865
  if (source == 'table') {
846
- model.$vue.operationLoading = true
866
+ model.$vue.operationLoading = true
847
867
  }
848
868
  else {
849
- submitData = field.getActionPara(submitData).para;
869
+ submitData = field.getActionPara(submitData).para;
850
870
  }
851
871
  field.doAction(submitData, (data) => {
852
872
  if (source == 'table') {
@@ -957,735 +977,6 @@ export function RouterClickHandler(field, submitData, action, model, source, cal
957
977
 
958
978
  }
959
979
 
960
- export function RouterMouseenterHandler(field, submitData, action, model, source, callBack) {
961
- if (source == 'form') {
962
- model.scripts.$fd = field.id;
963
- model.scripts.$result = [];
964
- }
965
- action = action || field.action;
966
- var clickAcion = function (field) {
967
- //若不是客户端方法,则直接访问接口
968
- let verified = true;
969
- if (!field.isClientFuntion) {
970
- if (source == 'form' && field.isSubmit) {
971
- let verified = true;
972
- if (field.flagVerifyData) {
973
- verified = model.$vue.validExcute();
974
- }
975
- if (verified) {
976
-
977
-
978
- if (verified) {
979
- //action有值,提交到后台
980
- if (field.action) {
981
- field.disabled = true;//提交按钮禁用
982
- model.pageDisabled = true;
983
-
984
- if (field.flagAsync) {
985
- field.doAction(model.$vue.getFormObj(), (res) => {
986
- if (res.rtnCode === Enum.ReturnCode.Successful) {
987
- if (res.content && res.content.action) {
988
- var dialogOption = {
989
- title: field.pageTitle || field.controlLabel,
990
- content: [{
991
- component: 'ct-progress',
992
- width: '350px',
993
- height: '165px',
994
- attrs: {
995
- progressAction: res.content.action,
996
- progressKey: res.content.key,
997
- progressType: field.isExport ? 'export' : 'import',
998
- onFinished(data) {
999
- field.disabled = false;
1000
- model.pageDisabled = false;
1001
- common.closeDialog(dialogOption);
1002
- if (field.isExport) {
1003
- if (data.content.indexOf(".zip") > -1) {
1004
- window.location.href = encodeURI(data.content);
1005
- }
1006
- else {
1007
- if (data.content.indexOf("?") > -1) {
1008
- model.$vue.downloadUrl = data.content + "&" + Math.random();
1009
- }
1010
- else {
1011
- model.$vue.downloadUrl = data.content + "?" + Math.random();
1012
- }
1013
- }
1014
- }
1015
- if (data.rtnMsg) {
1016
- common.message(data.rtnMsg, 'success')
1017
- }
1018
- if (data.notification === Enum.ActionType.Router) {
1019
- if (common.dialogList && common.dialogList.List.value.length > 0
1020
- && (data.content.pageStyle === Enum.PageStyle.FormPageInLayer || data.content.pageStyle === Enum.PageStyle.SearchPageInLayer)) {
1021
- }
1022
- else {
1023
- model.$vue.clickHandler(model.getRtnRouter(data.content), null)
1024
- }
1025
- }
1026
- model.$vue.emit('submit', { formData: model, responseData: data });
1027
- },
1028
- onError(data) {
1029
- field.disabled = false;
1030
- model.pageDisabled = false;
1031
- common.closeDialog(dialogOption);
1032
- common.message(data.rtnMsg, 'warning')
1033
- }
1034
- },
1035
- }]
1036
- };
1037
- common.openDialog(dialogOption);
1038
- }
1039
- }
1040
- else if (res.rtnCode === Enum.ReturnCode.ConfirmAlert) {
1041
- common.confirm(res.rtnMsg, '提示', {
1042
- confirmButtonText: '确定',
1043
- cancelButtonText: '取消',
1044
- type: 'warning'
1045
- }).then(() => {
1046
- field.doAction(model.$vue.getFormObj({ flagHaveAlert: '1' }), (res202) => {
1047
- if (res202.rtnCode === Enum.ReturnCode.Successful) {
1048
- if (res202.content && res202.content.action) {
1049
- var dialogOption = {
1050
- title: field.pageTitle || field.controlLabel,
1051
- content: [{
1052
- component: 'ct-progress',
1053
- width: '350px',
1054
- height: '165px',
1055
- attrs: {
1056
- progressAction: res202.content.action,
1057
- progressKey: res202.content.key,
1058
- progressType: field.isExport ? 'export' : 'import',
1059
- onFinished(data) {
1060
- field.disabled = false;
1061
- model.pageDisabled = false;
1062
- common.closeDialog(dialogOption);
1063
- if (field.isExport) {
1064
- if (data.content.indexOf(".zip") > -1) {
1065
- window.location.href = encodeURI(data.content);
1066
- }
1067
- else {
1068
- if (data.content.indexOf("?") > -1) {
1069
- model.$vue.downloadUrl = data.content + "&" + Math.random();
1070
- }
1071
- else {
1072
- model.$vue.downloadUrl = data.content + "?" + Math.random();
1073
- }
1074
- }
1075
- }
1076
- if (data.rtnMsg) {
1077
- common.message(data.rtnMsg, 'success')
1078
- }
1079
- if (data.notification === Enum.ActionType.Router) {
1080
- if (common.dialogList && common.dialogList.List.value.length > 0
1081
- && (data.content.pageStyle === Enum.PageStyle.FormPageInLayer || data.content.pageStyle === Enum.PageStyle.SearchPageInLayer)) {
1082
- }
1083
- else {
1084
- model.$vue.clickHandler(model.getRtnRouter(data.content), null)
1085
- }
1086
- }
1087
- model.$vue.emit('submit', { formData: model, responseData: data });
1088
- },
1089
- onError(data) {
1090
- field.disabled = false;
1091
- model.pageDisabled = false;
1092
- common.closeDialog(dialogOption);
1093
- common.message(data.rtnMsg, 'warning')
1094
- }
1095
- },
1096
- }]
1097
- };
1098
- common.openDialog(dialogOption);
1099
- }
1100
- }
1101
- });
1102
- }).catch(() => {
1103
- field.disabled = false;
1104
- model.pageDisabled = false;
1105
- });
1106
- }
1107
- });
1108
- }
1109
- else {
1110
- field.doAction(model.$vue.getFormObj(), (data) => {
1111
- field.disabled = false;
1112
- model.pageDisabled = false;
1113
- if (data.rtnCode === Enum.ReturnCode.Successful) {
1114
- if (data.notification === Enum.ActionType.Router) {
1115
- if (common.dialogList && common.dialogList.List.length > 0
1116
- && (data.content.pageStyle === Enum.PageStyle.FormPageInLayer || data.content.pageStyle === Enum.PageStyle.SearchPageInLayer)) {
1117
- }
1118
- else {
1119
- model.$vue.clickHandler(model.getRtnRouter(data.content), null)
1120
- }
1121
- }
1122
- if (model.flagAlertCloseWindowAfterSave) {
1123
- common.confirm('操作成功,是否关闭本页面?', '提示', {
1124
- confirmButtonText: '确定',
1125
- cancelButtonText: '取消',
1126
- type: 'warning'
1127
- }).then(() => {
1128
- //如果没有弹框 则关闭tab页
1129
- if (common.dialogList && common.dialogList.List.value.length === 0) {
1130
- if (typeof common.getDataDrivenOpts().handler.closeTab === 'function') {
1131
- common.getDataDrivenOpts().handler.closeTab(data);
1132
- }
1133
- }
1134
- model.$vue.emit('submit', { formData: model, responseData: data });
1135
- }).catch(() => {
1136
- model.$vue.init();
1137
- });
1138
- }
1139
- else {
1140
- if (common.dialogList && common.dialogList.List.value.length === 0 && model.$vue.openType !== 'detail'
1141
- && field.actionType && (field.actionType === Enum.ActionType.New || field.actionType === Enum.ActionType.Update) && data.notification !== Enum.ActionType.Router && data.notification !== Enum.ActionType.CloseTab
1142
- && data.notification !== Enum.ActionType.CloseTabThenNew && data.notification !== Enum.ActionType.CloseTabThenDelete && data.notification !== Enum.ActionType.CloseTabThenUpdate) {
1143
- if (typeof common.getDataDrivenOpts().handler.closeTab === 'function') {
1144
- common.getDataDrivenOpts().handler.closeTab(data);
1145
- }
1146
- }
1147
- model.$vue.emit('submit', { formData: model, responseData: data });
1148
- }
1149
- if (model.$vue.parentModel) {
1150
- model.$vue.parentModel.$vue.closeTabThen(data);
1151
- }
1152
- }
1153
- else if (data.rtnCode === Enum.ReturnCode.ConfirmAlert) {
1154
- common.confirm(data.rtnMsg, '提示', {
1155
- confirmButtonText: '确定',
1156
- cancelButtonText: '取消',
1157
- type: 'warning'
1158
- }).then(() => {
1159
- field.doAction(model.$vue.getFormObj({ flagHaveAlert: '1' }), (res) => {
1160
- if (res.rtnCode === Enum.ReturnCode.Successful) {
1161
- if (res.notification === Enum.ActionType.Router) {
1162
- if (common.dialogList && common.dialogList.List.value.length > 0
1163
- && (res.content.pageStyle === Enum.PageStyle.FormPageInLayer || res.content.pageStyle === Enum.PageStyle.SearchPageInLayer)) {
1164
- }
1165
- else {
1166
- model.$vue.clickHandler(model.getRtnRouter(res.content), null)
1167
- }
1168
- }
1169
- else {
1170
- model.$vue.emit('submit', { formData: model, responseData: res });
1171
- }
1172
- }
1173
- });
1174
- }).catch(() => {
1175
- });
1176
- }
1177
- }, model.scripts);
1178
- }
1179
-
1180
- }
1181
- //无值,触发submit事件
1182
- else {
1183
- model.$vue.emit('submit', { formData: model, responseData: {} });
1184
- }
1185
- }
1186
- }
1187
- }
1188
- else {
1189
- if (!submitData && source == 'form') {
1190
- if (field.flagAttachSearchCondition) {
1191
- if (!model.$vue.validExcute()) {
1192
- return;
1193
- }
1194
- }
1195
- if (typeof field.onChanged !== 'undefined') {
1196
- verified = common.excute.call(model.scripts, field.onChanged);
1197
- }
1198
-
1199
- if (!submitData) {
1200
- submitData = model.$vue.getFileData(field);
1201
- }
1202
980
 
1203
- }
1204
- if (field.isTabInSystem) {
1205
- if (field.isOpenBaiduMap) {
1206
- submitData = field.getActionPara(submitData).para;
1207
- common.getDataDrivenOpts().handler.openTabBaiduMap(submitData, field.pageTitle || field.label);
1208
- }
1209
- }
1210
- else if (field.isTabInBrowse) {
1211
-
1212
- }
1213
- else if (field.isLayerInSystem) {
1214
- if (field.isOpenBaiduMap) {
1215
- var dialogOption = {
1216
- title: field.pageTitle,
1217
- content: [
1218
- {
1219
- component: "ct-mapBaidu",
1220
- width: field.pageWidth + 'px',
1221
- height: field.pageHeight + 'px',
1222
- attrs: {
1223
- field: field,
1224
- apiParam: field.getActionPara(submitData).para,
1225
- onSubmit: () => {
1226
- if (callBack) {
1227
- callBack(field);
1228
- }
1229
- common.closeDialog(dialogOption.dialog);
1230
- },
1231
-
1232
- },
1233
- },
1234
- ],
1235
- };
1236
- common.openDialog(dialogOption);
1237
- }
1238
- }
1239
-
1240
- else if (field.isFormPageInTab) {// 外部框架tab页打开
1241
- submitData = field.getActionPara(submitData).para;
1242
- if (field.pageStyle) {
1243
- submitData.pageStyle = field.pageStyle;
1244
- }
1245
- common.getDataDrivenOpts().handler.openTab(action, submitData, field.pageTitle, model, field.pageWidth);
1246
- }
1247
- else if (field.isSearchPageInTab) {// 外部框架tab页打开
1248
- submitData = field.getActionPara(submitData).para;
1249
- common.getDataDrivenOpts().handler.openTabSearch(field, submitData);
1250
- }
1251
- else if (field.isOpenUrlInBrowse) {// 浏览器打开
1252
- window.open(submitData[field.submitFormField], "_blank");
1253
- }
1254
- else if (field.isBrowserNewTab) {// 浏览器打开
1255
- submitData = field.getActionPara(submitData).para;
1256
- let query = common.objectToQueryStr(submitData);
1257
- window.open(action + query, "_blank");
1258
- }
1259
- else if (field.isUrlInSystemTab) {//外部框架tab页打开URl
1260
- submitData = field.getActionPara(submitData).para;
1261
- let query = common.objectToQueryStr(submitData);
1262
- let urlTab = field.action + query;
1263
- if (field.action.indexOf('?') > -1 && query.indexOf('?') > -1) {
1264
- urlTab = field.action + '&' + query.substr(1, query.length);
1265
- }
1266
- common.getDataDrivenOpts().handler.openTabUrl(urlTab, field.pageTitle || field.label);
1267
- }
1268
- else if (field.isSeeVoice) {//看视频
1269
- common.browseVideo(field, submitData)
1270
- }
1271
- else if (field.isBrowseAttachment) {//浏览附件
1272
- var mediaviewpagetype = (field.isFormPageInTab || field.isSearchPageInTab) ? 2 : 0;
1273
- var MediaAlbum = [
1274
- { albumName: field.pageTitle || "媒体", medias: [] },
1275
- ];
1276
- if (field.action) {
1277
- var callback = function (res) {
1278
- let data = res.content
1279
- if (typeof data == 'object' && data.mediaAlbums) {
1280
- MediaAlbum = data.mediaAlbums;
1281
- }
1282
- else {
1283
- MediaAlbum[0].medias = data;
1284
- }
1285
- common.viewerfile(field.pageTitle, MediaAlbum, 0, 0, mediaviewpagetype);
1286
- }
1287
- field.doAction(submitData, callback);
1288
- }
1289
- else {
1290
- submitData.mediaData.forEach((v) => {
1291
- MediaAlbum[0].medias.push(v);
1292
- });
1293
- common.viewerfile(field.pageTitle, MediaAlbum, 0, 0, mediaviewpagetype);
1294
- }
1295
- }
1296
- else if (field.isUrlInLayer) {//URL页面(弹层iframe)
1297
- var content = {
1298
- component: "ct-iframe",
1299
- width: field.pageWidth,
1300
- height: field.pageHeight,
1301
- attrs: {
1302
- src: submitData[field.submitListField],
1303
- onNew: (id) => {
1304
- field.flagAddRowAfterAction = true;
1305
- field.flagFreshCurrentRow = false;
1306
- var res = { responseData: { content: id } };
1307
- model.$vue.updateCurrentRow(field, res);
1308
- common.closeDialog(dialogOption);
1309
- },
1310
- onUpdate: () => {
1311
- field.flagAddRowAfterAction = false;
1312
- field.flagFreshCurrentRow = true;
1313
- model.$vue.updateCurrentRow(field, null);
1314
- common.closeDialog(dialogOption);
1315
- },
1316
- onDelete: () => {
1317
- var res = {};
1318
- res.notification = 4;
1319
- res.content = model.listData[model.selectIndex][model.primaryKey];
1320
- model.$vue.doAction(res);
1321
- common.closeDialog(dialogOption);
1322
- },
1323
- onRefreshParent: () => {
1324
- model.$vue.getPage(1);
1325
- common.closeDialog(dialogOption);
1326
- },
1327
- onCloseDialog: () => {
1328
- common.closeDialog(dialogOption);
1329
- }
1330
- },
1331
- }
1332
- callBack(content)
1333
- }
1334
- else if (field.isExport || field.flagAsync) {
1335
- submitData = field.getActionPara(submitData).para;
1336
- if (field.flagAsync) {
1337
- field.doAction(submitData, (res) => {
1338
- if (res.rtnCode === Enum.ReturnCode.Successful) {
1339
- if (res.content && res.content.action) {
1340
- var dialogOption = {
1341
- title: field.pageTitle || field.label,
1342
- content: [{
1343
- component: 'ct-progress',
1344
- width: '350px',
1345
- height: '165px',
1346
- attrs: {
1347
- progressAction: res.content.action,
1348
- progressKey: res.content.key,
1349
- progressType: field.isExport ? 'export' : 'import',
1350
- onFinished: (data) => {
1351
- common.closeDialog(dialogOption);
1352
- if (field.isExport) {
1353
- if (data.content.indexOf(".zip") > -1) {
1354
- window.location.href = encodeURI(data.content);
1355
- }
1356
- else {
1357
- if (data.content.indexOf("?") > -1) {
1358
- model.$vue.downloadUrl = data.content + "&" + Math.random();
1359
- }
1360
- else {
1361
- model.$vue.downloadUrl = data.content + "?" + Math.random();
1362
- }
1363
- }
1364
- }
1365
- if (data.rtnMsg) {
1366
- common.message(data.rtnMsg, 'success')
1367
- }
1368
- if (field && field.callBackFunName) {
1369
- model.$vue.changeCallBackHandler(field, field.callBackFunName, data.content);
1370
- }
1371
- else {
1372
- model.$vue.doAction(data);
1373
- }
1374
- if (!field.isExport) {
1375
- model.$vue.getPage(1);
1376
- }
1377
- },
1378
- onError: (data) => {
1379
- common.closeDialog(dialogOption);
1380
- common.message(data.rtnMsg, 'warning')
1381
- }
1382
-
1383
- },
1384
- }]
1385
- };
1386
- common.openDialog(dialogOption);
1387
- }
1388
- }
1389
- else if (res.rtnCode === Enum.ReturnCode.ConfirmAlert) {
1390
- submitData.flagHaveAlert = '1';
1391
- if (submitData.jsonData) submitData.jsonData.flagHaveAlert = '1';
1392
- common.confirm(res.rtnMsg, '提示', {
1393
- confirmButtonText: '确定',
1394
- cancelButtonText: '取消',
1395
- type: 'warning'
1396
- }).then(() => {
1397
- field.doAction(submitData, (res202) => {
1398
- if (res202.rtnCode === Enum.ReturnCode.Successful) {
1399
- if (res202.content && res202.content.action) {
1400
- var dialogOption = {
1401
- title: field.pageTitle || field.controlLabel,
1402
- content: [{
1403
- component: 'ct-progress',
1404
- width: '350px',
1405
- height: '165px',
1406
- attrs: {
1407
- progressAction: res202.content.action,
1408
- progressKey: res202.content.key,
1409
- progressType: field.isExport ? 'export' : 'import',
1410
- onFinished: (data) => {
1411
- common.closeDialog(dialogOption);
1412
- if (field.isExport) {
1413
- if (data.content.indexOf(".zip") > -1) {
1414
- window.location.href = encodeURI(data.content);
1415
- }
1416
- else {
1417
- if (data.content.indexOf("?") > -1) {
1418
- model.$vue.downloadUrl = data.content + "&" + Math.random();
1419
- }
1420
- else {
1421
- model.$vue.downloadUrl = data.content + "?" + Math.random();
1422
- }
1423
- }
1424
- }
1425
- if (data.rtnMsg) {
1426
- common.message(data.rtnMsg, 'success')
1427
- }
1428
- if (field && field.callBackFunName) {
1429
- model.$vue.changeCallBackHandler(field, field.callBackFunName, data.content);
1430
- }
1431
- else {
1432
- model.$vue.doAction(data);
1433
- }
1434
- if (!field.isExport) {
1435
- model.$vue.getPage(1);
1436
- }
1437
- },
1438
- onError: (data) => {
1439
- common.closeDialog(dialogOption);
1440
- common.message(data.rtnMsg, 'warning')
1441
- }
1442
- },
1443
- }]
1444
- };
1445
- common.openDialog(dialogOption);
1446
- }
1447
- }
1448
- });
1449
- }).catch(() => {
1450
- });
1451
- }
1452
- });
1453
- }
1454
- else {
1455
- if (field.action.indexOf("http://") === 0 || field.action.indexOf("https://") === 0) {
1456
- if (field.action.indexOf(".zip") > -1) {
1457
- window.location.href = encodeURI(field.action);
1458
- }
1459
- else {
1460
- if (field.action.indexOf("?") > -1) {
1461
- model.$vue.downloadUrl = field.action + "&" + Math.random();
1462
- }
1463
- else {
1464
- model.$vue.downloadUrl = field.action + "?" + Math.random();
1465
- }
1466
- }
1467
- }
1468
- else {
1469
- field.doBlobAction(submitData, (data, headers) => {
1470
- if (data.type == "application/json") {
1471
- const reader = new FileReader();
1472
- reader.readAsText(data, 'utf-8');
1473
- reader.onload = function () {
1474
- data = JSON.parse(reader.result);
1475
- if (data.content) {
1476
- if (data.content.indexOf("http://") === 0 || data.content.indexOf("https://") === 0) {
1477
- if (data.content.indexOf(".zip") > -1) {
1478
- window.location.href = encodeURI(data.action);
1479
- }
1480
- else {
1481
- if (data.content.indexOf("?") > -1) {
1482
- model.$vue.downloadUrl = data.content + "&" + Math.random();
1483
- }
1484
- else {
1485
- model.$vue.downloadUrl = data.content + "?" + Math.random();
1486
- }
1487
- }
1488
- }
1489
- else {
1490
- }
1491
- }
1492
- };
1493
- }
1494
- else {
1495
- if (!headers['content-disposition']) {
1496
- common.message('返回结果headers必须包含Access-Control-Expose-Headers和Content-Disposition!', 'error')
1497
- return false;
1498
- }
1499
-
1500
- let blob = new Blob([data], { type: "application/octet-stream;" })
1501
- const url = window.URL.createObjectURL(blob);
1502
- const link = document.createElement('a');
1503
- let fileName = decodeURIComponent(escape(headers['content-disposition'].split('filename=')[1]));
1504
- link.href = url;
1505
- link.setAttribute('download', fileName);
1506
- document.body.appendChild(link);
1507
- link.click();
1508
- document.body.removeChild(link);
1509
- }
1510
- });
1511
- }
1512
- }
1513
- }
1514
- else if (field.isOpenForm) {
1515
- var content = {
1516
- component: 'ct-form',
1517
- width: field.pageWidth,
1518
- height: field.pageHeight,
1519
- attrs: {
1520
- api: action,
1521
- apiParam: field.getActionPara(submitData).para,
1522
- onSubmit: (ev) => {
1523
- if (source == 'table') {
1524
- if (ev.responseData.notification == Enum.ActionType.UpdateColumns) {
1525
- //更新列
1526
- model.$vue.refreshTableColumns();
1527
- }
1528
- else if (ev.responseData.notification == Enum.ActionType.Delete
1529
- || ev.responseData.notification == Enum.ActionType.Refersh
1530
- ) {
1531
- model.$vue.doAction(ev);
1532
- model.$vue.loadStats();
1533
- }
1534
- else {
1535
- if (!field.flagFreshCurrentRow && !field.flagAddRowAfterAction) {
1536
- model.$vue.doAction(ev);
1537
- let response = ev;
1538
- if (response.responseData) {
1539
- response = response.responseData;
1540
- }
1541
- if (response.notification === Enum.ActionType.Delete || response.notification === Enum.ActionType.CloseTabThenDelete) {
1542
- model.$vue.loadStats();
1543
- }
1544
- }
1545
- model.$vue.updateCurrentRow(field, ev);
1546
- if (ev.responseData && ev.responseData.notification === Enum.ActionType.Router) {
1547
- setTimeout(() => {
1548
- routerClickHandler(model.getRtnRouter(ev.responseData.content), {}, action, model, source);
1549
- });
1550
- }
1551
- }
1552
- }
1553
- else {
1554
- if (ev.responseData && ev.responseData.notification === Enum.ActionType.Refersh) {
1555
- model.$vue.init();
1556
- }
1557
- else {
1558
- model.$vue.updateFields(ev);
1559
- }
1560
- }
1561
- },
1562
- },
1563
- };
1564
- callBack(content)
1565
- }
1566
- else if (field.isOpenList) {
1567
- var content = {
1568
- component: 'ct-searchlist',
1569
- width: field.pageWidth,
1570
- height: field.pageHeight,
1571
- attrs: {
1572
- searchConditionApi: field.actionForSearchLayout,
1573
- searchDataApi: field.actionForSearch,
1574
- apiParam: submitData,
1575
- },
1576
- };
1577
- callBack(content)
1578
- }
1579
- else {
1580
- submitData = field.getActionPara(submitData).para;
1581
- if (source == 'table') {
1582
- model.$vue.operationLoading = true
1583
- }
1584
- field.doAction(submitData, (data) => {
1585
- if (source == 'table') {
1586
- model.$vue.operationLoading = false
1587
- if (field.isCallTel) {
1588
- // if (self.model.currentCallTellayout) {
1589
- // self.closeCallTel(self.$refs[self.model.currentCallTellayout][0]);
1590
- // }
1591
- // self.model.currentCallTellayout = "layout" + rowindex;
1592
- // self.model.currentCallTelrouter = "router" + forname + forrowindex;
1593
- // self.callTelClick(self.$refs["layout" + rowindex][0], data, forname, forrowindex);
1594
- }
1595
- else {
1596
- if (data.rtnCode === Enum.ReturnCode.Successful) {
1597
- if (!field.flagFreshCurrentRow && !field.flagAddRowAfterAction) {
1598
- model.$vue.doAction(data, model);
1599
- model.$vue.itemKey = Math.random()
1600
- model.$vue.emit("refreshRowHandle");
1601
- }
1602
- model.$vue.updateCurrentRow(field, data);
1603
- }
1604
- else if (data.rtnCode === Enum.ReturnCode.ConfirmAlert) {
1605
- common.confirm(data.rtnMsg, '提示', {
1606
- confirmButtonText: '确定',
1607
- cancelButtonText: '取消',
1608
- type: 'warning'
1609
- }).then(() => {
1610
-
1611
- submitData.flagHaveAlert = '1';
1612
- field.doAction(submitData, (res) => {
1613
- if (res.rtnCode === Enum.ReturnCode.Successful) {
1614
- if (!field.flagFreshCurrentRow && !field.flagAddRowAfterAction) {
1615
- model.$vue.doAction(res, model);
1616
- model.$vue.itemKey = Math.random()
1617
- model.$vue.emit("refreshRowHandle");
1618
- }
1619
- model.$vue.updateCurrentRow(field, res);
1620
- }
1621
- });
1622
- }).catch(() => {
1623
- });
1624
- }
1625
-
1626
- }
1627
- }
1628
- else {
1629
- if (data.rtnCode === Enum.ReturnCode.Successful || data.isSuccess) {
1630
- if (callBack) {
1631
- callBack(data);
1632
- }
1633
- if (field && field.callBackFunName) {
1634
- model.$vue.changeCallBackHandler(field, field.callBackFunName, data.content);
1635
- }
1636
- else if (field.isRefersh) {
1637
- model.$vue.load(model.$vue.Form.loadFromModel(data.content));
1638
- if (model.$vue.itemKey) {
1639
- model.$vue.itemKey = Math.random();
1640
- }
1641
- }
1642
- else {
1643
- model.$vue.Form.doAction(data, model);
1644
- }
1645
- }
1646
- }
1647
- }, model.scripts);
1648
- }
1649
- }
1650
- }
1651
- //执行客户端脚本
1652
- else {
1653
- if (!submitData) {
1654
- submitData = {};
1655
- var tempFormData = model.$vue.getFormObj();
1656
- field.submitFormField.forEach((v) => {
1657
- submitData[v] = common.getDataOfUpperLower(tempFormData, v);
1658
- });
1659
- }
1660
- submitData = field.getActionPara(submitData).para;
1661
- let title = field.pageTitle == undefined ? field.label : field.pageTitle;
1662
- submitData.actionType = field.actionType;
1663
- var fun = common.getDataDrivenOpts().handler[action];
1664
- fun(submitData, title, model);
1665
- }
1666
- }
1667
- if (typeof field.onChanged !== 'undefined') {
1668
- common.excute.call(model.scripts, field.onChanged)
1669
- }
1670
- if (field.isSubmit && field.flagVerifyData) {
1671
- if (source == 'form' && !model.$vue.validExcute()) {
1672
- return;
1673
- }
1674
- }
1675
- if (field.flagAlert) {
1676
- common.confirm(field.content, field.caption, {
1677
- confirmButtonText: field.confirmButtonText,
1678
- cancelButtonText: field.cancelButtonText,
1679
- center: field.contentCenter
1680
- }).then(() => {
1681
- clickAcion(field);
1682
- }).catch(() => {
1683
- });
1684
- }
1685
- else {
1686
- clickAcion(field);
1687
- }
1688
-
1689
- }
1690
981
 
1691
982