cloud-web-corejs 1.0.54-dev.509 → 1.0.54-dev.510

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.
@@ -212,7 +212,7 @@ modules = {
212
212
  formulaDialogVisible: false,
213
213
  baseFormulaDialogOption: null,
214
214
  baseFormulaDialogVisible: false,
215
- globalConfig: {}
215
+ globalConfig: {},
216
216
  };
217
217
  },
218
218
  computed: {
@@ -257,41 +257,43 @@ modules = {
257
257
  watch: {
258
258
  //
259
259
  },
260
- async created() {
260
+ created() {
261
261
  this.registerFormToRefList();
262
262
  this.currentFormData = this.formData;
263
- let formConfig = this.formConfig;
264
- await this.initUserInfo();
265
- await this.initSaleOrgData();
266
- await this.initUserRoleData();
267
- await this.initBdService();
268
- // this.handleAllTableColumnWidget();
269
- this.initGlobalConfig();//初始化全局配置
263
+
264
+ this.initGlobalConfig(); //初始化全局配置
270
265
  this.buildFormModel(!this.formJsonObj ? null : this.formJsonObj.widgetList);
271
- // this.hanldeCommonWidget();//处理组件显隐规则
272
- if (formConfig.isLoadEntity) {
273
- await this.loadDefaultEntityData(() => {
274
- this.handleCustomEvent(formConfig.formScriptSuccess);
275
- });
276
- } else {
277
- this.hanldeCommonWidget2(); //处理组件显隐,可编辑
278
- this.handleShowContent();
279
- }
280
- this.handleOnCreated(),
281
- // this.buildFormModel(!this.formJsonObj ? null : this.formJsonObj.widgetList);
282
- this.initFormObject();
266
+
267
+ // this.handleOnCreated(),
268
+ this.initFormObject();
283
269
  },
284
270
  mounted() {
285
271
  this.initLocale();
286
- this.handleOnMounted();
272
+ this.initBaseUserInfo().then(() => {
273
+ let formConfig = this.formConfig;
274
+ if (formConfig.isLoadEntity) {
275
+ this.loadDefaultEntityData(() => {
276
+ this.handleCustomEvent(formConfig.formScriptSuccess);
277
+ });
278
+ } else {
279
+ this.hanldeCommonWidget2(); //处理组件显隐,可编辑
280
+ this.handleShowContent();
281
+ }
282
+ });
287
283
  },
288
284
  methods: {
289
- initGlobalConfig(){
285
+ initBaseUserInfo() {
286
+ return Promise.all([
287
+ this.initUserInfo(),
288
+ this.initSaleOrgData(),
289
+ this.initUserRoleData(),
290
+ this.initBdService(),
291
+ ]);
292
+ },
293
+ initGlobalConfig() {
290
294
  //初始化全局配置
291
- this.globalConfig = this.handleCustomEvent(
292
- this.formConfig.globalConfig
293
- ) || {};
294
-
295
+ this.globalConfig =
296
+ this.handleCustomEvent(this.formConfig.globalConfig) || {};
295
297
  },
296
298
  /**
297
299
  * 数据对象key 驼峰下划线相互转化
@@ -458,10 +460,24 @@ modules = {
458
460
  },
459
461
  handleShowContent(callback) {
460
462
  // this.buildFormModel(!this.formJsonObj ? null : this.formJsonObj.widgetList);
461
- this.showFormContent = true;
462
- this.$nextTick(() => {
463
- this.handleShowHideRule();
464
- callback && callback();
463
+ this.handleBeforeMounted().then(()=>{
464
+ this.showFormContent = true;
465
+ this.$nextTick(() => {
466
+ this.handleOnMounted();
467
+ this.handleShowHideRule();
468
+ callback && callback();
469
+ });
470
+ });
471
+ },
472
+ handleBeforeMounted() {
473
+ return new Promise((resolve) => {
474
+ if(this.formConfig?.onFormBeforeMounted){
475
+ if(this.handleCustomEvent(this.formConfig?.onFormBeforeMounted,['done'],[resolve]) !== false){
476
+ resolve();
477
+ }
478
+ }else{
479
+ resolve();
480
+ }
465
481
  });
466
482
  },
467
483
  hasConfig(widget, configName) {
@@ -527,7 +543,8 @@ modules = {
527
543
  )
528
544
  return;
529
545
  let columnLoopDo = (t, e) => {
530
- if(t.filterable===null || t.filterable===undefined) t.filterable = true;
546
+ if (t.filterable === null || t.filterable === undefined)
547
+ t.filterable = true;
531
548
  if (t.children && t.children.length) {
532
549
  for (let item of t.children) {
533
550
  columnLoopDo(item);
@@ -1128,7 +1145,7 @@ modules = {
1128
1145
  return hasModifyItem;
1129
1146
  },
1130
1147
  loadFormData(options) {
1131
- let config = options.config || {}
1148
+ let config = options.config || {};
1132
1149
  let that = this;
1133
1150
  let formConfig = this.formConfig;
1134
1151
  let entity = formConfig.entity;
@@ -1223,18 +1240,24 @@ modules = {
1223
1240
  }*/
1224
1241
  this.hanldeCommonWidget2(); //处理组件显隐,可编辑
1225
1242
 
1226
- this.showFormContent = true;
1227
- this.$nextTick(() => {
1228
- this.handleShowHideRule();
1229
- /*if (hasWf) {
1230
1243
 
1231
- }*/
1244
+ this.handleShowContent(()=>{
1232
1245
  setTimeout(() => {
1233
1246
  callback && callback();
1234
1247
  callback1 && callback1(wfParam);
1235
1248
  }, 1000);
1236
1249
  wfParam.done();
1237
1250
  });
1251
+
1252
+ /* this.showFormContent = true;
1253
+ this.$nextTick(() => {
1254
+ this.handleShowHideRule();
1255
+ setTimeout(() => {
1256
+ callback && callback();
1257
+ callback1 && callback1(wfParam);
1258
+ }, 1000);
1259
+ wfParam.done();
1260
+ }); */
1238
1261
  },
1239
1262
  };
1240
1263
  if (formConfig.wfStartBindSave) {
@@ -1299,7 +1322,7 @@ modules = {
1299
1322
  };
1300
1323
  }
1301
1324
  return this.loadFormData({
1302
- config:{
1325
+ config: {
1303
1326
  sync: false,
1304
1327
  wfConfig,
1305
1328
  success: (res) => {
@@ -1308,14 +1331,16 @@ modules = {
1308
1331
  if (!wfConfig) {
1309
1332
  this.hanldeCommonWidget2(); //处理组件显隐,可编辑
1310
1333
  this.setFormData(formData);
1311
- this.showFormContent = true;
1334
+
1335
+ this.handleShowContent(callback);
1336
+ /* this.showFormContent = true;
1312
1337
  this.$nextTick(() => {
1313
1338
  this.handleShowHideRule();
1314
1339
  callback && callback();
1315
- });
1340
+ }); */
1316
1341
  }
1317
- }
1318
- }
1342
+ },
1343
+ },
1319
1344
  });
1320
1345
  } else {
1321
1346
  this.hanldeCommonWidget2(); //处理组件显隐,可编辑
@@ -1367,7 +1392,7 @@ modules = {
1367
1392
  this.addFieldChangeEventHandler(),
1368
1393
  this.addFieldValidateEventHandler(),
1369
1394
  this.registerFormToRefList(),
1370
- // this.handleOnCreated(),
1395
+ this.handleOnCreated(),
1371
1396
  this.disabledMode &&
1372
1397
  this.$nextTick(function () {
1373
1398
  e.disableForm();
@@ -2471,10 +2496,10 @@ modules = {
2471
2496
  }
2472
2497
  return realFormData;
2473
2498
  },
2474
- closeDetailPage(){
2499
+ closeDetailPage() {
2475
2500
  //关闭详情页
2476
2501
  let listPageRef = this.getListPageRef();
2477
- if(listPageRef){
2502
+ if (listPageRef) {
2478
2503
  listPageRef.dataId = 0;
2479
2504
  listPageRef.showEdit = false;
2480
2505
  }
@@ -2491,28 +2516,31 @@ modules = {
2491
2516
  let listTabFormRef = parentTarget?.$refs?.list?.$refs?.vFormRef ?? null;
2492
2517
  return listTabFormRef;
2493
2518
  },
2494
- getFirstWidgetRef(){
2519
+ getFirstWidgetRef() {
2495
2520
  //获取表单的第一个组件
2496
2521
  let target = null;
2497
- if(this.formJsonObj.widgetList && this.formJsonObj.widgetList.length > 0){
2522
+ if (
2523
+ this.formJsonObj.widgetList &&
2524
+ this.formJsonObj.widgetList.length > 0
2525
+ ) {
2498
2526
  target = this.getWidgetRef(this.formJsonObj.widgetList[0].options.name);
2499
2527
  }
2500
- return target
2528
+ return target;
2501
2529
  },
2502
- switchToListTab(option){
2530
+ switchToListTab(option) {
2503
2531
  //切换到列表页的tab
2504
2532
  let handleType = option?.handleType;
2505
2533
  let listPageRef = this.getListPageRef();
2506
- if(listPageRef){
2534
+ if (listPageRef) {
2507
2535
  listPageRef.activeName = "second";
2508
2536
  }
2509
- if(handleType){
2537
+ if (handleType) {
2510
2538
  let listTabFormRef = this.getListTabFormRef();
2511
- if(handleType == "reload"){
2539
+ if (handleType == "reload") {
2512
2540
  listTabFormRef.reloadForm();
2513
- }else if(handleType == "searchEvent"){
2541
+ } else if (handleType == "searchEvent") {
2514
2542
  listTabFormRef.getFirstWidgetRef().searchEvent();
2515
- }else if(handleType == "resethEvent"){
2543
+ } else if (handleType == "resethEvent") {
2516
2544
  listTabFormRef.getFirstWidgetRef().resethEvent();
2517
2545
  }
2518
2546
  }
@@ -810,6 +810,7 @@ export function getDefaultFormConfig() {
810
810
  dataSources: [],
811
811
  onBeforeCreated: "",
812
812
  onFormCreated: "",
813
+ onFormBeforeMounted: "",
813
814
  onFormMounted: "",
814
815
  onFormDataChange: "",
815
816
  gridConfig: {
@@ -875,7 +876,7 @@ export function buildDefaultFormJson() {
875
876
  export function cloneFormConfigWithoutEventHandler(e) {
876
877
  var t = deepClone(e);
877
878
  return (
878
- (t.onFormCreated = ""), (t.onFormMounted = ""), (t.onFormDataChange = ""), t
879
+ (t.onFormCreated = ""), (t.onFormBeforeMounted = ""), (t.onFormMounted = ""), (t.onFormDataChange = ""), t
879
880
  );
880
881
  }
881
882