centaline-data-driven-v3 0.0.71 → 0.0.73

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