@wibetter/json-editor 5.0.8 → 5.0.9

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/lib/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /*!
2
- * @wibetter/json-editor v5.0.7
2
+ * @wibetter/json-editor v5.0.8
3
3
  * author: wibetter
4
4
  * build tool: AKFun
5
- * build time: Tue Dec 24 2024 14:45:50 GMT+0800 (中国标准时间)
5
+ * build time: Thu Dec 26 2024 13:18:12 GMT+0800 (中国标准时间)
6
6
  * build tool info: https://github.com/wibetter/akfun
7
7
  */
8
8
  (function webpackUniversalModuleDefinition(root, factory) {
@@ -309,37 +309,46 @@
309
309
  // 是否显示code模式,默认不显示code模式
310
310
  viewStyle: _this.catchViewStyle(props.viewStyle), // 默认为fold(可折叠面板),可选:tabs:(tabs切换面板)
311
311
  };
312
+ var _ref = _this.props.schemaStore || {},
313
+ initJSONSchemaData = _ref.initJSONSchemaData,
314
+ setPageScreen = _ref.setPageScreen;
315
+ var _ref2 = _this.props.jsonStore || {},
316
+ initJSONData = _ref2.initJSONData,
317
+ initOnChange = _ref2.initOnChange,
318
+ setDynamicDataList = _ref2.setDynamicDataList,
319
+ setOptions = _ref2.setOptions;
320
+
312
321
  // 根据props.schemaData对jsonSchema进行初始化
313
322
  if (props.schemaData) {
314
- _this.props.initJSONSchemaData(props.schemaData);
323
+ initJSONSchemaData(props.schemaData);
315
324
  // 根据props.jsonData对jsonData进行初始化
316
- _this.props.initJSONData(props.jsonData);
325
+ initJSONData(props.jsonData);
317
326
  } else if (props.jsonData) {
318
327
  // schemaData为空,jsonData不为空时,尝试通过jsonData转jsonSchema
319
328
  var jsonSchema = (0,
320
329
  _wibetter_json_utils__WEBPACK_IMPORTED_MODULE_8__.json2schema)(
321
330
  props.jsonData,
322
331
  ); // 通过json转换schema
323
- _this.props.initJSONSchemaData(jsonSchema);
332
+ initJSONSchemaData(jsonSchema);
324
333
  // 根据props.jsonData对jsonData进行初始化
325
- _this.props.initJSONData(props.jsonData);
334
+ initJSONData(props.jsonData);
326
335
  }
327
336
  // 读取宽屏和小屏的配置
328
337
  if (props.wideScreen) {
329
- _this.props.setPageScreen(props.wideScreen);
338
+ setPageScreen(props.wideScreen);
330
339
  }
331
340
  // 记录onChange事件
332
341
  if (props.onChange) {
333
- _this.props.initOnChange(props.onChange);
342
+ initOnChange(props.onChange);
334
343
  }
335
344
 
336
345
  // 获取dynamicDataList(动态数据源)
337
346
  if (props.dynamicDataList) {
338
- _this.props.setDynamicDataList(props.dynamicDataList);
347
+ setDynamicDataList(props.dynamicDataList);
339
348
  }
340
349
  // 配置类数据
341
350
  if (props.options) {
342
- _this.props.setOptions(props.options);
351
+ setOptions(props.options);
343
352
  }
344
353
  return _this;
345
354
  }
@@ -350,6 +359,14 @@
350
359
  var _proto = JSONDataEditor.prototype;
351
360
  _proto.componentWillReceiveProps =
352
361
  function componentWillReceiveProps(nextProps) {
362
+ var _ref3 = this.props.schemaStore || {},
363
+ JSONSchemaChange = _ref3.JSONSchemaChange,
364
+ setPageScreen = _ref3.setPageScreen;
365
+ var _ref4 = this.props.jsonStore || {},
366
+ initJSONData = _ref4.initJSONData,
367
+ initOnChange = _ref4.initOnChange,
368
+ setDynamicDataList = _ref4.setDynamicDataList,
369
+ setOptions = _ref4.setOptions;
353
370
  /** 1. 先初始化schemaData,如果jsonData和schemaData的格式不一致,则以schemaData为准 */
354
371
  if (
355
372
  !(0, $utils_index__WEBPACK_IMPORTED_MODULE_7__.isEqual)(
@@ -357,7 +374,7 @@
357
374
  this.props.schemaData,
358
375
  )
359
376
  ) {
360
- this.props.JSONSchemaChange(nextProps.schemaData);
377
+ JSONSchemaChange(nextProps.schemaData);
361
378
  }
362
379
  /** 2. 初始化jsonData */
363
380
  if (
@@ -366,7 +383,7 @@
366
383
  this.props.jsonData,
367
384
  )
368
385
  ) {
369
- this.props.initJSONData(nextProps.jsonData);
386
+ initJSONData(nextProps.jsonData);
370
387
  }
371
388
  // 读取code模式配置
372
389
  if (
@@ -396,7 +413,7 @@
396
413
  this.props.wideScreen,
397
414
  )
398
415
  ) {
399
- this.props.setPageScreen(nextProps.wideScreen);
416
+ setPageScreen(nextProps.wideScreen);
400
417
  }
401
418
  // 记录onChange事件
402
419
  if (
@@ -405,7 +422,7 @@
405
422
  this.props.onChange,
406
423
  )
407
424
  ) {
408
- this.props.initOnChange(nextProps.onChange);
425
+ initOnChange(nextProps.onChange);
409
426
  }
410
427
 
411
428
  // 获取dynamicDataList(动态数据源)
@@ -415,7 +432,7 @@
415
432
  this.props.dynamicDataList,
416
433
  )
417
434
  ) {
418
- this.props.setDynamicDataList(nextProps.dynamicDataList);
435
+ setDynamicDataList(nextProps.dynamicDataList);
419
436
  }
420
437
  if (
421
438
  !(0, $utils_index__WEBPACK_IMPORTED_MODULE_7__.isEqual)(
@@ -423,18 +440,19 @@
423
440
  this.props.options,
424
441
  )
425
442
  ) {
426
- this.props.setOptions(nextProps.options);
443
+ setOptions(nextProps.options);
427
444
  }
428
445
  };
429
446
  _proto.render = function render() {
430
447
  var _this2 = this;
431
448
  var _this$props = this.props,
432
- jsonSchema = _this$props.jsonSchema,
433
- lastUpdateTime = _this$props.lastUpdateTime,
434
- jsonLastUpdateTime = _this$props.jsonLastUpdateTime,
435
- getJSONDataByKeyRoute = _this$props.getJSONDataByKeyRoute,
436
- keyRoute2indexRoute = _this$props.keyRoute2indexRoute,
437
- updateFormValueData = _this$props.updateFormValueData;
449
+ schemaStore = _this$props.schemaStore,
450
+ jsonStore = _this$props.jsonStore;
451
+ var _ref5 = schemaStore || {},
452
+ jsonSchema = _ref5.jsonSchema,
453
+ lastUpdateTime = _ref5.lastUpdateTime;
454
+ var _ref6 = jsonStore || {},
455
+ jsonLastUpdateTime = _ref6.lastUpdateTime;
438
456
  var _this$state = this.state,
439
457
  jsonView = _this$state.jsonView,
440
458
  viewStyle = _this$state.viewStyle;
@@ -522,10 +540,8 @@
522
540
  nodeKey: nodeKey,
523
541
  targetJsonSchema: currentSchemaData,
524
542
  isStructuredSchema: isStructured,
525
- getJSONDataByKeyRoute:
526
- getJSONDataByKeyRoute,
527
- keyRoute2indexRoute: keyRoute2indexRoute,
528
- updateFormValueData: updateFormValueData,
543
+ schemaStore: schemaStore,
544
+ jsonStore: jsonStore,
529
545
  }),
530
546
  );
531
547
  }
@@ -586,10 +602,8 @@
586
602
  nodeKey: nodeKey,
587
603
  targetJsonSchema: currentSchemaData,
588
604
  isStructuredSchema: isStructured,
589
- getJSONDataByKeyRoute:
590
- getJSONDataByKeyRoute,
591
- keyRoute2indexRoute: keyRoute2indexRoute,
592
- updateFormValueData: updateFormValueData,
605
+ schemaStore: schemaStore,
606
+ jsonStore: jsonStore,
593
607
  }),
594
608
  );
595
609
  }
@@ -611,9 +625,8 @@
611
625
  keyRoute: '',
612
626
  nodeKey: '',
613
627
  targetJsonSchema: jsonSchema,
614
- getJSONDataByKeyRoute: getJSONDataByKeyRoute,
615
- keyRoute2indexRoute: keyRoute2indexRoute,
616
- updateFormValueData: updateFormValueData,
628
+ schemaStore: schemaStore,
629
+ jsonStore: jsonStore,
617
630
  }),
618
631
  ),
619
632
  ),
@@ -648,20 +661,8 @@
648
661
  /* harmony default export */ __webpack_exports__['default'] = (0,
649
662
  mobx_react__WEBPACK_IMPORTED_MODULE_2__.inject)(function (stores) {
650
663
  return {
651
- jsonSchema: stores.JSONSchemaStore.jsonSchema,
652
- lastUpdateTime: stores.JSONSchemaStore.lastUpdateTime,
653
- jsonLastUpdateTime: stores.JSONEditorStore.lastUpdateTime,
654
- initJSONSchemaData: stores.JSONSchemaStore.initJSONSchemaData,
655
- JSONSchemaChange: stores.JSONSchemaStore.JSONSchemaChange,
656
- initJSONData: stores.JSONEditorStore.initJSONData,
657
- initOnChange: stores.JSONEditorStore.initOnChange,
658
- getJSONDataByKeyRoute:
659
- stores.JSONEditorStore.getJSONDataByKeyRoute,
660
- keyRoute2indexRoute: stores.JSONSchemaStore.keyRoute2indexRoute,
661
- setDynamicDataList: stores.JSONEditorStore.setDynamicDataList,
662
- setOptions: stores.JSONEditorStore.setOptions,
663
- setPageScreen: stores.JSONSchemaStore.setPageScreen,
664
- updateFormValueData: stores.JSONEditorStore.updateFormValueData,
664
+ schemaStore: stores.JSONSchemaStore,
665
+ jsonStore: stores.JSONEditorStore,
665
666
  };
666
667
  })(
667
668
  (0, mobx_react__WEBPACK_IMPORTED_MODULE_2__.observer)(
@@ -697,155 +698,169 @@
697
698
  /*#__PURE__*/ __webpack_require__.n(
698
699
  react__WEBPACK_IMPORTED_MODULE_1__,
699
700
  );
700
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ =
701
- __webpack_require__(/*! ../utils */ './src/utils/index.js');
702
- /* harmony import */ var $renderers_ArraySchema_index__WEBPACK_IMPORTED_MODULE_3__ =
701
+ /* harmony import */ var _wibetter_json_utils__WEBPACK_IMPORTED_MODULE_2__ =
702
+ __webpack_require__(
703
+ /*! @wibetter/json-utils */ '@wibetter/json-utils',
704
+ );
705
+ /* harmony import */ var _wibetter_json_utils__WEBPACK_IMPORTED_MODULE_2___default =
706
+ /*#__PURE__*/ __webpack_require__.n(
707
+ _wibetter_json_utils__WEBPACK_IMPORTED_MODULE_2__,
708
+ );
709
+ /* harmony import */ var $utils_index__WEBPACK_IMPORTED_MODULE_3__ =
710
+ __webpack_require__(/*! $utils/index */ './src/utils/index.js');
711
+ /* harmony import */ var $renderers_ArraySchema_index__WEBPACK_IMPORTED_MODULE_4__ =
703
712
  __webpack_require__(
704
713
  /*! $renderers/ArraySchema/index */ './src/renderers/ArraySchema/index.js',
705
714
  );
706
- /* harmony import */ var $renderers_ObjectSchema_index__WEBPACK_IMPORTED_MODULE_4__ =
715
+ /* harmony import */ var $renderers_ObjectSchema_index__WEBPACK_IMPORTED_MODULE_5__ =
707
716
  __webpack_require__(
708
717
  /*! $renderers/ObjectSchema/index */ './src/renderers/ObjectSchema/index.js',
709
718
  );
710
- /* harmony import */ var $renderers_DataSourceSchema_index__WEBPACK_IMPORTED_MODULE_5__ =
719
+ /* harmony import */ var $renderers_DataSourceSchema_index__WEBPACK_IMPORTED_MODULE_6__ =
711
720
  __webpack_require__(
712
721
  /*! $renderers/DataSourceSchema/index */ './src/renderers/DataSourceSchema/index.js',
713
722
  );
714
- /* harmony import */ var $renderers_DynamicDataSchema_index__WEBPACK_IMPORTED_MODULE_6__ =
723
+ /* harmony import */ var $renderers_DynamicDataSchema_index__WEBPACK_IMPORTED_MODULE_7__ =
715
724
  __webpack_require__(
716
725
  /*! $renderers/DynamicDataSchema/index */ './src/renderers/DynamicDataSchema/index.js',
717
726
  );
718
- /* harmony import */ var $renderers_EventSchema_index__WEBPACK_IMPORTED_MODULE_7__ =
727
+ /* harmony import */ var $renderers_EventSchema_index__WEBPACK_IMPORTED_MODULE_8__ =
719
728
  __webpack_require__(
720
729
  /*! $renderers/EventSchema/index */ './src/renderers/EventSchema/index.js',
721
730
  );
722
- /* harmony import */ var $renderers_QuantitySchema_index__WEBPACK_IMPORTED_MODULE_8__ =
731
+ /* harmony import */ var $renderers_QuantitySchema_index__WEBPACK_IMPORTED_MODULE_9__ =
723
732
  __webpack_require__(
724
733
  /*! $renderers/QuantitySchema/index */ './src/renderers/QuantitySchema/index.js',
725
734
  );
726
- /* harmony import */ var $renderers_BoxStyleSchema_index__WEBPACK_IMPORTED_MODULE_9__ =
735
+ /* harmony import */ var $renderers_BoxStyleSchema_index__WEBPACK_IMPORTED_MODULE_10__ =
727
736
  __webpack_require__(
728
737
  /*! $renderers/BoxStyleSchema/index */ './src/renderers/BoxStyleSchema/index.js',
729
738
  );
730
- /* harmony import */ var $renderers_RadioSchema_index__WEBPACK_IMPORTED_MODULE_10__ =
739
+ /* harmony import */ var $renderers_RadioSchema_index__WEBPACK_IMPORTED_MODULE_11__ =
731
740
  __webpack_require__(
732
741
  /*! $renderers/RadioSchema/index */ './src/renderers/RadioSchema/index.js',
733
742
  );
734
- /* harmony import */ var $renderers_CheckboxSchema_index__WEBPACK_IMPORTED_MODULE_11__ =
743
+ /* harmony import */ var $renderers_CheckboxSchema_index__WEBPACK_IMPORTED_MODULE_12__ =
735
744
  __webpack_require__(
736
745
  /*! $renderers/CheckboxSchema/index */ './src/renderers/CheckboxSchema/index.js',
737
746
  );
738
- /* harmony import */ var $renderers_InputFormSchema_index__WEBPACK_IMPORTED_MODULE_12__ =
747
+ /* harmony import */ var $renderers_InputFormSchema_index__WEBPACK_IMPORTED_MODULE_13__ =
739
748
  __webpack_require__(
740
749
  /*! $renderers/InputFormSchema/index */ './src/renderers/InputFormSchema/index.js',
741
750
  );
742
- /* harmony import */ var $renderers_TextAreaFormSchema_index__WEBPACK_IMPORTED_MODULE_13__ =
751
+ /* harmony import */ var $renderers_TextAreaFormSchema_index__WEBPACK_IMPORTED_MODULE_14__ =
743
752
  __webpack_require__(
744
753
  /*! $renderers/TextAreaFormSchema/index */ './src/renderers/TextAreaFormSchema/index.js',
745
754
  );
746
- /* harmony import */ var $renderers_TextEditorSchema_index__WEBPACK_IMPORTED_MODULE_14__ =
755
+ /* harmony import */ var $renderers_TextEditorSchema_index__WEBPACK_IMPORTED_MODULE_15__ =
747
756
  __webpack_require__(
748
757
  /*! $renderers/TextEditorSchema/index */ './src/renderers/TextEditorSchema/index.js',
749
758
  );
750
- /* harmony import */ var $renderers_NumberFormSchema_index__WEBPACK_IMPORTED_MODULE_15__ =
759
+ /* harmony import */ var $renderers_NumberFormSchema_index__WEBPACK_IMPORTED_MODULE_16__ =
751
760
  __webpack_require__(
752
761
  /*! $renderers/NumberFormSchema/index */ './src/renderers/NumberFormSchema/index.js',
753
762
  );
754
- /* harmony import */ var $renderers_BooleanFormSchema_index__WEBPACK_IMPORTED_MODULE_16__ =
763
+ /* harmony import */ var $renderers_BooleanFormSchema_index__WEBPACK_IMPORTED_MODULE_17__ =
755
764
  __webpack_require__(
756
765
  /*! $renderers/BooleanFormSchema/index */ './src/renderers/BooleanFormSchema/index.js',
757
766
  );
758
- /* harmony import */ var $renderers_DateTimeFormSchema_index__WEBPACK_IMPORTED_MODULE_17__ =
767
+ /* harmony import */ var $renderers_DateTimeFormSchema_index__WEBPACK_IMPORTED_MODULE_18__ =
759
768
  __webpack_require__(
760
769
  /*! $renderers/DateTimeFormSchema/index */ './src/renderers/DateTimeFormSchema/index.js',
761
770
  );
762
- /* harmony import */ var $renderers_TimeFormSchema_index__WEBPACK_IMPORTED_MODULE_18__ =
771
+ /* harmony import */ var $renderers_TimeFormSchema_index__WEBPACK_IMPORTED_MODULE_19__ =
763
772
  __webpack_require__(
764
773
  /*! $renderers/TimeFormSchema/index */ './src/renderers/TimeFormSchema/index.js',
765
774
  );
766
- /* harmony import */ var $renderers_URLFormSchema_index__WEBPACK_IMPORTED_MODULE_19__ =
775
+ /* harmony import */ var $renderers_URLFormSchema_index__WEBPACK_IMPORTED_MODULE_20__ =
767
776
  __webpack_require__(
768
777
  /*! $renderers/URLFormSchema/index */ './src/renderers/URLFormSchema/index.js',
769
778
  );
770
- /* harmony import */ var $renderers_ColorFormSchemaV3_index__WEBPACK_IMPORTED_MODULE_20__ =
779
+ /* harmony import */ var $renderers_ColorFormSchemaV3_index__WEBPACK_IMPORTED_MODULE_21__ =
771
780
  __webpack_require__(
772
781
  /*! $renderers/ColorFormSchemaV3/index */ './src/renderers/ColorFormSchemaV3/index.js',
773
782
  );
774
- /* harmony import */ var $renderers_JsonFormSchema_index__WEBPACK_IMPORTED_MODULE_21__ =
783
+ /* harmony import */ var $renderers_JsonFormSchema_index__WEBPACK_IMPORTED_MODULE_22__ =
775
784
  __webpack_require__(
776
785
  /*! $renderers/JsonFormSchema/index */ './src/renderers/JsonFormSchema/index.js',
777
786
  );
778
- /* harmony import */ var $renderers_CodeAreaFormSchema_index__WEBPACK_IMPORTED_MODULE_22__ =
787
+ /* harmony import */ var $renderers_CodeAreaFormSchema_index__WEBPACK_IMPORTED_MODULE_23__ =
779
788
  __webpack_require__(
780
789
  /*! $renderers/CodeAreaFormSchema/index */ './src/renderers/CodeAreaFormSchema/index.js',
781
790
  );
782
- /* harmony import */ var $renderers_HtmlAreaFormSchema_index__WEBPACK_IMPORTED_MODULE_23__ =
791
+ /* harmony import */ var $renderers_HtmlAreaFormSchema_index__WEBPACK_IMPORTED_MODULE_24__ =
783
792
  __webpack_require__(
784
793
  /*! $renderers/HtmlAreaFormSchema/index */ './src/renderers/HtmlAreaFormSchema/index.js',
785
794
  );
786
- /* harmony import */ var $renderers_SelectSchema_index__WEBPACK_IMPORTED_MODULE_24__ =
795
+ /* harmony import */ var $renderers_SelectSchema_index__WEBPACK_IMPORTED_MODULE_25__ =
787
796
  __webpack_require__(
788
797
  /*! $renderers/SelectSchema/index */ './src/renderers/SelectSchema/index.js',
789
798
  );
790
- /* harmony import */ var $renderers_InputImageSchema_index__WEBPACK_IMPORTED_MODULE_25__ =
799
+ /* harmony import */ var $renderers_InputImageSchema_index__WEBPACK_IMPORTED_MODULE_26__ =
791
800
  __webpack_require__(
792
801
  /*! $renderers/InputImageSchema/index */ './src/renderers/InputImageSchema/index.js',
793
802
  );
794
- /* harmony import */ var $renderers_DynamicConfigSchema_index__WEBPACK_IMPORTED_MODULE_26__ =
803
+ /* harmony import */ var $renderers_DynamicConfigSchema_index__WEBPACK_IMPORTED_MODULE_27__ =
795
804
  __webpack_require__(
796
805
  /*! $renderers/DynamicConfigSchema/index */ './src/renderers/DynamicConfigSchema/index.js',
797
806
  );
798
- /* harmony import */ var $renderers_SohuDataSourceSchema_index__WEBPACK_IMPORTED_MODULE_27__ =
807
+ /* harmony import */ var $renderers_SohuDataSourceSchema_index__WEBPACK_IMPORTED_MODULE_28__ =
799
808
  __webpack_require__(
800
809
  /*! $renderers/SohuDataSourceSchema/index */ './src/renderers/SohuDataSourceSchema/index.js',
801
810
  );
802
- /* harmony import */ var $renderers_SohuEventSchema_index__WEBPACK_IMPORTED_MODULE_28__ =
811
+ /* harmony import */ var $renderers_SohuEventSchema_index__WEBPACK_IMPORTED_MODULE_29__ =
803
812
  __webpack_require__(
804
813
  /*! $renderers/SohuEventSchema/index */ './src/renderers/SohuEventSchema/index.js',
805
814
  );
806
815
 
816
+ // import {omit} from 'lodash';
817
+
807
818
  /** 根据当前类型选择对应的组件进行渲染 */
808
819
  var MappingRender = function MappingRender(props) {
820
+ var _ref = props.schemaStore || {},
821
+ getSchemaByKeyRoute = _ref.getSchemaByKeyRoute;
822
+ var _ref2 = props.jsonStore || {},
823
+ getJSONDataByKeyRoute = _ref2.getJSONDataByKeyRoute;
809
824
  var nodeKey = props.nodeKey,
810
825
  jsonKey = props.jsonKey,
811
826
  keyRoute = props.keyRoute,
812
- targetJsonSchema = props.targetJsonSchema,
813
- getJSONDataByKeyRoute = props.getJSONDataByKeyRoute,
814
- keyRoute2indexRoute = props.keyRoute2indexRoute,
815
- updateFormValueData = props.updateFormValueData;
827
+ targetJsonSchema = props.targetJsonSchema;
816
828
  var curType = targetJsonSchema.type;
817
-
818
- // 获取当前字段的条件规则
819
- var hiddenRule = {};
820
- if (targetJsonSchema.hiddenRule) {
821
- hiddenRule = targetJsonSchema.hiddenRule;
822
- }
823
- var curConditionValue = '';
824
829
  var curNodeKey = nodeKey;
825
830
 
826
- // 隐藏条件成立则直接返回
831
+ // 支持显隐属性表达式
832
+ var parentKeyRoute = (0,
833
+ _wibetter_json_utils__WEBPACK_IMPORTED_MODULE_2__.getParentKeyRoute)(
834
+ keyRoute,
835
+ );
836
+ var parentData = getJSONDataByKeyRoute(parentKeyRoute) || {}; // 获取当前父级数据域
827
837
  if (
828
- hiddenRule.conditionProp &&
829
- (0, _utils__WEBPACK_IMPORTED_MODULE_2__.hasProperties)(
830
- hiddenRule.conditionValue,
831
- )
838
+ ((0, _wibetter_json_utils__WEBPACK_IMPORTED_MODULE_2__.isBoolean)(
839
+ targetJsonSchema.onShow,
840
+ ) &&
841
+ !targetJsonSchema.onShow) ||
842
+ ((0, _wibetter_json_utils__WEBPACK_IMPORTED_MODULE_2__.isString)(
843
+ targetJsonSchema.onShow,
844
+ ) &&
845
+ !(0,
846
+ _wibetter_json_utils__WEBPACK_IMPORTED_MODULE_2__.expressionOn)(
847
+ targetJsonSchema.onShow,
848
+ parentData,
849
+ ))
832
850
  ) {
833
- var curConditionProp = hiddenRule.conditionProp;
834
- var needConditionValue = hiddenRule.conditionValue; // 条件字段成立的条件值
835
- var curConditionKeyRoute = curConditionProp.keyRoute; // 条件字段的key值
836
-
837
- // 获取条件字段的数值
838
- curConditionValue = getJSONDataByKeyRoute(curConditionKeyRoute);
839
- if (needConditionValue === curConditionValue) {
840
- if (targetJsonSchema.clearValueOnHidden) {
841
- // 删除掉隐藏的表单项数值
842
- updateFormValueData(keyRoute, undefined);
843
- }
844
- return;
845
- }
851
+ return;
846
852
  }
847
- // 将条件字段的数值作为key的一部分
848
- curNodeKey = nodeKey + '-' + curConditionValue;
853
+
854
+ // 收集当前所有条件子字段
855
+ /*
856
+ const curData = getJSONDataByKeyRoute(keyRoute) || {};
857
+ const curConditionValue = schema2conditionValue(targetJsonSchema, curData);
858
+ // 将条件字段的数值作为key的一部分
859
+ if (curConditionValue) {
860
+ curNodeKey = `${nodeKey}-${curConditionValue}`;
861
+ }
862
+ */
863
+
849
864
  var newProps =
850
865
  _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()(
851
866
  {},
@@ -857,356 +872,194 @@
857
872
  switch (curType) {
858
873
  case 'object':
859
874
  return /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
860
- $renderers_ObjectSchema_index__WEBPACK_IMPORTED_MODULE_4__[
875
+ $renderers_ObjectSchema_index__WEBPACK_IMPORTED_MODULE_5__[
861
876
  'default'
862
877
  ],
863
- _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()(
864
- {},
865
- newProps,
866
- {
867
- key: curNodeKey,
868
- },
869
- ),
878
+ newProps,
870
879
  );
871
880
  case 'dynamic-config':
872
881
  return /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
873
- $renderers_DynamicConfigSchema_index__WEBPACK_IMPORTED_MODULE_26__[
882
+ $renderers_DynamicConfigSchema_index__WEBPACK_IMPORTED_MODULE_27__[
874
883
  'default'
875
884
  ],
876
- _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()(
877
- {},
878
- newProps,
879
- {
880
- key: curNodeKey,
881
- },
882
- ),
885
+ newProps,
883
886
  );
884
887
  case 'sohu-source':
885
888
  return /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
886
- $renderers_SohuDataSourceSchema_index__WEBPACK_IMPORTED_MODULE_27__[
889
+ $renderers_SohuDataSourceSchema_index__WEBPACK_IMPORTED_MODULE_28__[
887
890
  'default'
888
891
  ],
889
- _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()(
890
- {},
891
- newProps,
892
- {
893
- key: curNodeKey,
894
- },
895
- ),
892
+ newProps,
896
893
  );
897
894
  case 'sohu-event':
898
895
  return /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
899
- $renderers_SohuEventSchema_index__WEBPACK_IMPORTED_MODULE_28__[
896
+ $renderers_SohuEventSchema_index__WEBPACK_IMPORTED_MODULE_29__[
900
897
  'default'
901
898
  ],
902
- _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()(
903
- {},
904
- newProps,
905
- {
906
- key: curNodeKey,
907
- },
908
- ),
899
+ newProps,
909
900
  );
910
901
  case 'array':
911
902
  return /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
912
- $renderers_ArraySchema_index__WEBPACK_IMPORTED_MODULE_3__[
903
+ $renderers_ArraySchema_index__WEBPACK_IMPORTED_MODULE_4__[
913
904
  'default'
914
905
  ],
915
- _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()(
916
- {},
917
- newProps,
918
- {
919
- key: curNodeKey,
920
- },
921
- ),
906
+ newProps,
922
907
  );
923
908
  case 'dynamic-data':
924
909
  return /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
925
- $renderers_DynamicDataSchema_index__WEBPACK_IMPORTED_MODULE_6__[
910
+ $renderers_DynamicDataSchema_index__WEBPACK_IMPORTED_MODULE_7__[
926
911
  'default'
927
912
  ],
928
- _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()(
929
- {},
930
- newProps,
931
- {
932
- key: curNodeKey,
933
- },
934
- ),
913
+ newProps,
935
914
  );
936
915
  case 'datasource':
937
916
  return /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
938
- $renderers_DataSourceSchema_index__WEBPACK_IMPORTED_MODULE_5__[
917
+ $renderers_DataSourceSchema_index__WEBPACK_IMPORTED_MODULE_6__[
939
918
  'default'
940
919
  ],
941
- _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()(
942
- {},
943
- newProps,
944
- {
945
- key: curNodeKey,
946
- },
947
- ),
920
+ newProps,
948
921
  );
949
922
  case 'event':
950
923
  return /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
951
- $renderers_EventSchema_index__WEBPACK_IMPORTED_MODULE_7__[
924
+ $renderers_EventSchema_index__WEBPACK_IMPORTED_MODULE_8__[
952
925
  'default'
953
926
  ],
954
- _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()(
955
- {},
956
- newProps,
957
- {
958
- key: curNodeKey,
959
- },
960
- ),
927
+ newProps,
961
928
  );
962
929
  case 'quantity':
963
930
  return /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
964
- $renderers_QuantitySchema_index__WEBPACK_IMPORTED_MODULE_8__[
931
+ $renderers_QuantitySchema_index__WEBPACK_IMPORTED_MODULE_9__[
965
932
  'default'
966
933
  ],
967
- _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()(
968
- {},
969
- newProps,
970
- {
971
- key: curNodeKey,
972
- },
973
- ),
934
+ newProps,
974
935
  );
975
936
  case 'box-style':
976
937
  return /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
977
- $renderers_BoxStyleSchema_index__WEBPACK_IMPORTED_MODULE_9__[
938
+ $renderers_BoxStyleSchema_index__WEBPACK_IMPORTED_MODULE_10__[
978
939
  'default'
979
940
  ],
980
- _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()(
981
- {},
982
- newProps,
983
- {
984
- key: curNodeKey,
985
- },
986
- ),
941
+ newProps,
987
942
  );
988
943
  case 'radio':
989
944
  return /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
990
- $renderers_RadioSchema_index__WEBPACK_IMPORTED_MODULE_10__[
945
+ $renderers_RadioSchema_index__WEBPACK_IMPORTED_MODULE_11__[
991
946
  'default'
992
947
  ],
993
- _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()(
994
- {},
995
- newProps,
996
- {
997
- key: curNodeKey,
998
- },
999
- ),
948
+ newProps,
1000
949
  );
1001
950
  case 'select':
1002
951
  return /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
1003
- $renderers_SelectSchema_index__WEBPACK_IMPORTED_MODULE_24__[
952
+ $renderers_SelectSchema_index__WEBPACK_IMPORTED_MODULE_25__[
1004
953
  'default'
1005
954
  ],
1006
- _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()(
1007
- {},
1008
- newProps,
1009
- {
1010
- key: curNodeKey,
1011
- },
1012
- ),
955
+ newProps,
1013
956
  );
1014
957
  case 'checkboxes':
1015
958
  // 多选
1016
959
  return /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
1017
- $renderers_CheckboxSchema_index__WEBPACK_IMPORTED_MODULE_11__[
960
+ $renderers_CheckboxSchema_index__WEBPACK_IMPORTED_MODULE_12__[
1018
961
  'default'
1019
962
  ],
1020
- _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()(
1021
- {},
1022
- newProps,
1023
- {
1024
- key: curNodeKey,
1025
- },
1026
- ),
963
+ newProps,
1027
964
  );
1028
965
  case 'input':
1029
966
  return /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
1030
- $renderers_InputFormSchema_index__WEBPACK_IMPORTED_MODULE_12__[
967
+ $renderers_InputFormSchema_index__WEBPACK_IMPORTED_MODULE_13__[
1031
968
  'default'
1032
969
  ],
1033
- _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()(
1034
- {},
1035
- newProps,
1036
- {
1037
- key: curNodeKey,
1038
- },
1039
- ),
970
+ newProps,
1040
971
  );
1041
972
  case 'textarea':
1042
973
  return /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
1043
- $renderers_TextAreaFormSchema_index__WEBPACK_IMPORTED_MODULE_13__[
974
+ $renderers_TextAreaFormSchema_index__WEBPACK_IMPORTED_MODULE_14__[
1044
975
  'default'
1045
976
  ],
1046
- _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()(
1047
- {},
1048
- newProps,
1049
- {
1050
- key: curNodeKey,
1051
- },
1052
- ),
977
+ newProps,
1053
978
  );
1054
979
  case 'text-editor':
1055
980
  return /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
1056
- $renderers_TextEditorSchema_index__WEBPACK_IMPORTED_MODULE_14__[
981
+ $renderers_TextEditorSchema_index__WEBPACK_IMPORTED_MODULE_15__[
1057
982
  'default'
1058
983
  ],
1059
- _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()(
1060
- {},
1061
- newProps,
1062
- {
1063
- key: curNodeKey,
1064
- },
1065
- ),
984
+ newProps,
1066
985
  );
1067
986
  case 'number':
1068
987
  return /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
1069
- $renderers_NumberFormSchema_index__WEBPACK_IMPORTED_MODULE_15__[
988
+ $renderers_NumberFormSchema_index__WEBPACK_IMPORTED_MODULE_16__[
1070
989
  'default'
1071
990
  ],
1072
- _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()(
1073
- {},
1074
- newProps,
1075
- {
1076
- key: curNodeKey,
1077
- },
1078
- ),
991
+ newProps,
1079
992
  );
1080
993
  case 'boolean':
1081
994
  return /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
1082
- $renderers_BooleanFormSchema_index__WEBPACK_IMPORTED_MODULE_16__[
995
+ $renderers_BooleanFormSchema_index__WEBPACK_IMPORTED_MODULE_17__[
1083
996
  'default'
1084
997
  ],
1085
- _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()(
1086
- {},
1087
- newProps,
1088
- {
1089
- key: curNodeKey,
1090
- },
1091
- ),
998
+ newProps,
1092
999
  );
1093
1000
  case 'date':
1094
1001
  case 'date-time':
1095
1002
  return /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
1096
- $renderers_DateTimeFormSchema_index__WEBPACK_IMPORTED_MODULE_17__[
1003
+ $renderers_DateTimeFormSchema_index__WEBPACK_IMPORTED_MODULE_18__[
1097
1004
  'default'
1098
1005
  ],
1099
- _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()(
1100
- {},
1101
- newProps,
1102
- {
1103
- key: curNodeKey,
1104
- },
1105
- ),
1006
+ newProps,
1106
1007
  );
1107
1008
  case 'time':
1108
1009
  return /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
1109
- $renderers_TimeFormSchema_index__WEBPACK_IMPORTED_MODULE_18__[
1010
+ $renderers_TimeFormSchema_index__WEBPACK_IMPORTED_MODULE_19__[
1110
1011
  'default'
1111
1012
  ],
1112
- _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()(
1113
- {},
1114
- newProps,
1115
- {
1116
- key: curNodeKey,
1117
- },
1118
- ),
1013
+ newProps,
1119
1014
  );
1120
1015
  case 'url':
1121
1016
  return /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
1122
- $renderers_URLFormSchema_index__WEBPACK_IMPORTED_MODULE_19__[
1017
+ $renderers_URLFormSchema_index__WEBPACK_IMPORTED_MODULE_20__[
1123
1018
  'default'
1124
1019
  ],
1125
- _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()(
1126
- {},
1127
- newProps,
1128
- {
1129
- key: curNodeKey,
1130
- },
1131
- ),
1020
+ newProps,
1132
1021
  );
1133
1022
  case 'color':
1134
1023
  return /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
1135
- $renderers_ColorFormSchemaV3_index__WEBPACK_IMPORTED_MODULE_20__[
1024
+ $renderers_ColorFormSchemaV3_index__WEBPACK_IMPORTED_MODULE_21__[
1136
1025
  'default'
1137
1026
  ],
1138
- _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()(
1139
- {},
1140
- newProps,
1141
- {
1142
- key: curNodeKey,
1143
- },
1144
- ),
1027
+ newProps,
1145
1028
  );
1146
1029
  case 'input-image':
1147
1030
  return /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
1148
- $renderers_InputImageSchema_index__WEBPACK_IMPORTED_MODULE_25__[
1031
+ $renderers_InputImageSchema_index__WEBPACK_IMPORTED_MODULE_26__[
1149
1032
  'default'
1150
1033
  ],
1151
- _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()(
1152
- {},
1153
- newProps,
1154
- {
1155
- key: curNodeKey,
1156
- },
1157
- ),
1034
+ newProps,
1158
1035
  );
1159
1036
  case 'json':
1160
1037
  return /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
1161
- $renderers_JsonFormSchema_index__WEBPACK_IMPORTED_MODULE_21__[
1038
+ $renderers_JsonFormSchema_index__WEBPACK_IMPORTED_MODULE_22__[
1162
1039
  'default'
1163
1040
  ],
1164
- _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()(
1165
- {},
1166
- newProps,
1167
- {
1168
- key: curNodeKey,
1169
- },
1170
- ),
1041
+ newProps,
1171
1042
  );
1172
1043
  case 'codearea':
1173
1044
  return /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
1174
- $renderers_CodeAreaFormSchema_index__WEBPACK_IMPORTED_MODULE_22__[
1045
+ $renderers_CodeAreaFormSchema_index__WEBPACK_IMPORTED_MODULE_23__[
1175
1046
  'default'
1176
1047
  ],
1177
- _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()(
1178
- {},
1179
- newProps,
1180
- {
1181
- key: curNodeKey,
1182
- },
1183
- ),
1048
+ newProps,
1184
1049
  );
1185
1050
  case 'htmlarea':
1186
1051
  return /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
1187
- $renderers_HtmlAreaFormSchema_index__WEBPACK_IMPORTED_MODULE_23__[
1052
+ $renderers_HtmlAreaFormSchema_index__WEBPACK_IMPORTED_MODULE_24__[
1188
1053
  'default'
1189
1054
  ],
1190
- _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()(
1191
- {},
1192
- newProps,
1193
- {
1194
- key: curNodeKey,
1195
- },
1196
- ),
1055
+ newProps,
1197
1056
  );
1198
1057
  default:
1199
1058
  return /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
1200
- $renderers_InputFormSchema_index__WEBPACK_IMPORTED_MODULE_12__[
1059
+ $renderers_InputFormSchema_index__WEBPACK_IMPORTED_MODULE_13__[
1201
1060
  'default'
1202
1061
  ],
1203
- _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()(
1204
- {},
1205
- newProps,
1206
- {
1207
- key: curNodeKey,
1208
- },
1209
- ),
1062
+ newProps,
1210
1063
  );
1211
1064
  }
1212
1065
  };
@@ -1242,11 +1095,11 @@
1242
1095
  * getJSONDataByKeyRoute、getInitJsonDataByKeyRoute
1243
1096
  * */
1244
1097
  function catchJsonDataByWebCache(curKeyRoute) {
1245
- var _this$props = this.props,
1246
- targetJsonSchema = _this$props.targetJsonSchema,
1247
- getJSONDataByKeyRoute = _this$props.getJSONDataByKeyRoute,
1248
- getInitJsonDataByKeyRoute = _this$props.getInitJsonDataByKeyRoute,
1249
- updateFormValueData = _this$props.updateFormValueData;
1098
+ var targetJsonSchema = this.props.targetJsonSchema;
1099
+ var _ref = this.props.jsonStore || {},
1100
+ getJSONDataByKeyRoute = _ref.getJSONDataByKeyRoute,
1101
+ getInitJsonDataByKeyRoute = _ref.getInitJsonDataByKeyRoute,
1102
+ updateFormValueData = _ref.updateFormValueData;
1250
1103
  var curType = targetJsonSchema.type;
1251
1104
  var keyRoute = curKeyRoute || this.props.keyRoute;
1252
1105
  var backUpKeyRoute = (0,
@@ -1377,6 +1230,8 @@
1377
1230
  _this = _React$PureComponent.call(this, props) || this;
1378
1231
  /** 添加数组项 */
1379
1232
  _this.addArrayItem = function (keyRoute, curArr, curArrIndex) {
1233
+ var _ref = _this.props.jsonStore || {},
1234
+ addArrayItem = _ref.addArrayItem;
1380
1235
  var maximumChild =
1381
1236
  _this.props.targetJsonSchema['maximum-child'];
1382
1237
  if (curArr && maximumChild && curArr.length >= maximumChild) {
@@ -1386,11 +1241,13 @@
1386
1241
  '\u4E2A\u5B50\u9879',
1387
1242
  );
1388
1243
  } else {
1389
- _this.props.addArrayItem(keyRoute, curArrIndex);
1244
+ addArrayItem(keyRoute, curArrIndex);
1390
1245
  }
1391
1246
  };
1392
1247
  /** 删除数组项 */
1393
1248
  _this.deleteArrItem = function (keyRoute, arrIndex, curArr) {
1249
+ var _ref2 = _this.props.jsonStore || {},
1250
+ deleteArrayIndex = _ref2.deleteArrayIndex;
1394
1251
  var minimumChild =
1395
1252
  _this.props.targetJsonSchema['minimum-child'];
1396
1253
  if (curArr && minimumChild && curArr.length <= minimumChild) {
@@ -1400,7 +1257,7 @@
1400
1257
  '\u4E2A\u5B50\u9879',
1401
1258
  );
1402
1259
  } else {
1403
- _this.props.deleteArrayIndex(keyRoute, arrIndex);
1260
+ deleteArrayIndex(keyRoute, arrIndex);
1404
1261
  }
1405
1262
  };
1406
1263
  /**
@@ -1513,15 +1370,20 @@
1513
1370
  var _targetJsonSchema$sho,
1514
1371
  _this2 = this;
1515
1372
  var _this$props = this.props,
1516
- keyRoute = _this$props.keyRoute,
1517
- jsonKey = _this$props.jsonKey,
1518
- nodeKey = _this$props.nodeKey,
1519
- pageScreen = _this$props.pageScreen,
1520
- indexRoute = _this$props.indexRoute,
1521
- targetJsonSchema = _this$props.targetJsonSchema,
1522
- getJSONDataByKeyRoute = _this$props.getJSONDataByKeyRoute,
1523
- keyRoute2indexRoute = _this$props.keyRoute2indexRoute,
1524
- updateFormValueData = _this$props.updateFormValueData;
1373
+ schemaStore = _this$props.schemaStore,
1374
+ jsonStore = _this$props.jsonStore;
1375
+ var _ref3 = schemaStore || {},
1376
+ pageScreen = _ref3.pageScreen;
1377
+ var _ref4 = jsonStore || {},
1378
+ getJSONDataByKeyRoute = _ref4.getJSONDataByKeyRoute,
1379
+ sortArrayItem = _ref4.sortArrayItem,
1380
+ triggerChange = _ref4.triggerChange;
1381
+ var _this$props2 = this.props,
1382
+ keyRoute = _this$props2.keyRoute,
1383
+ jsonKey = _this$props2.jsonKey,
1384
+ nodeKey = _this$props2.nodeKey,
1385
+ indexRoute = _this$props2.indexRoute,
1386
+ targetJsonSchema = _this$props2.targetJsonSchema;
1525
1387
  var _this$state = this.state,
1526
1388
  jsonView = _this$state.jsonView,
1527
1389
  isClosed = _this$state.isClosed,
@@ -1545,7 +1407,7 @@
1545
1407
  pageScreen === 'wideScreen'
1546
1408
  ? 'wide-screen-element-warp'
1547
1409
  : 'mobile-screen-element-warp',
1548
- key: nodeKey,
1410
+ key: nodeKey + '-' + triggerChange,
1549
1411
  id: nodeKey,
1550
1412
  },
1551
1413
  /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1__.createElement(
@@ -1846,11 +1708,7 @@
1846
1708
  {
1847
1709
  className: 'array-operate-btn',
1848
1710
  onClick: function onClick(event) {
1849
- _this2.props.sortArrayItem(
1850
- keyRoute,
1851
- arrIndex,
1852
- 'up',
1853
- );
1711
+ sortArrayItem(keyRoute, arrIndex, 'up');
1854
1712
  event.preventDefault();
1855
1713
  event.stopPropagation();
1856
1714
  },
@@ -1868,7 +1726,7 @@
1868
1726
  {
1869
1727
  className: 'array-operate-btn',
1870
1728
  onClick: function onClick(event) {
1871
- _this2.props.sortArrayItem(
1729
+ sortArrayItem(
1872
1730
  keyRoute,
1873
1731
  arrIndex,
1874
1732
  'down',
@@ -1905,9 +1763,8 @@
1905
1763
  targetJsonSchema: arrayItemsDataObj,
1906
1764
  isArrayItem: true,
1907
1765
  arrIndex: arrIndex,
1908
- getJSONDataByKeyRoute: getJSONDataByKeyRoute,
1909
- keyRoute2indexRoute: keyRoute2indexRoute,
1910
- updateFormValueData: updateFormValueData,
1766
+ schemaStore: schemaStore,
1767
+ jsonStore: jsonStore,
1911
1768
  },
1912
1769
  ),
1913
1770
  ),
@@ -1940,17 +1797,8 @@
1940
1797
  /* harmony default export */ __webpack_exports__['default'] = (0,
1941
1798
  mobx_react__WEBPACK_IMPORTED_MODULE_2__.inject)(function (stores) {
1942
1799
  return {
1943
- triggerChange: stores.JSONEditorStore.triggerChange,
1944
- pageScreen: stores.JSONSchemaStore.pageScreen,
1945
- indexRoute2keyRoute: stores.JSONSchemaStore.indexRoute2keyRoute,
1946
- getJSONDataByKeyRoute:
1947
- stores.JSONEditorStore.getJSONDataByKeyRoute,
1948
- getInitJsonDataByKeyRoute:
1949
- stores.JSONEditorStore.getInitJsonDataByKeyRoute,
1950
- updateFormValueData: stores.JSONEditorStore.updateFormValueData,
1951
- deleteArrayIndex: stores.JSONEditorStore.deleteArrayIndex,
1952
- addArrayItem: stores.JSONEditorStore.addArrayItem,
1953
- sortArrayItem: stores.JSONEditorStore.sortArrayItem,
1800
+ schemaStore: stores.JSONSchemaStore,
1801
+ jsonStore: stores.JSONEditorStore,
1954
1802
  };
1955
1803
  })(
1956
1804
  (0, mobx_react__WEBPACK_IMPORTED_MODULE_2__.observer)(ArraySchema),
@@ -2026,7 +1874,9 @@
2026
1874
  _this.handleValueChange = function (checked) {
2027
1875
  var _this$props = _this.props,
2028
1876
  keyRoute = _this$props.keyRoute,
2029
- updateFormValueData = _this$props.updateFormValueData;
1877
+ jsonStore = _this$props.jsonStore;
1878
+ var _ref = jsonStore || {},
1879
+ updateFormValueData = _ref.updateFormValueData;
2030
1880
  updateFormValueData(keyRoute, checked); // 更新数值
2031
1881
  };
2032
1882
  _this.handleValueChange = _this.handleValueChange.bind(_this);
@@ -2055,12 +1905,17 @@
2055
1905
  };
2056
1906
  _proto.render = function render() {
2057
1907
  var _this$props2 = this.props,
2058
- keyRoute = _this$props2.keyRoute,
2059
- jsonKey = _this$props2.jsonKey,
2060
- nodeKey = _this$props2.nodeKey,
2061
- targetJsonSchema = _this$props2.targetJsonSchema,
2062
- pageScreen = _this$props2.pageScreen,
2063
- getJSONDataByKeyRoute = _this$props2.getJSONDataByKeyRoute;
1908
+ schemaStore = _this$props2.schemaStore,
1909
+ jsonStore = _this$props2.jsonStore;
1910
+ var _ref2 = schemaStore || {},
1911
+ pageScreen = _ref2.pageScreen;
1912
+ var _ref3 = jsonStore || {},
1913
+ getJSONDataByKeyRoute = _ref3.getJSONDataByKeyRoute;
1914
+ var _this$props3 = this.props,
1915
+ keyRoute = _this$props3.keyRoute,
1916
+ jsonKey = _this$props3.jsonKey,
1917
+ nodeKey = _this$props3.nodeKey,
1918
+ targetJsonSchema = _this$props3.targetJsonSchema;
2064
1919
  // 从jsonData中获取对应的数值
2065
1920
  var curJsonData = getJSONDataByKeyRoute(keyRoute);
2066
1921
  var isNeedTwoCol = (0,
@@ -2164,12 +2019,8 @@
2164
2019
  /* harmony default export */ __webpack_exports__['default'] = (0,
2165
2020
  mobx_react__WEBPACK_IMPORTED_MODULE_2__.inject)(function (stores) {
2166
2021
  return {
2167
- pageScreen: stores.JSONSchemaStore.pageScreen,
2168
- getJSONDataByKeyRoute:
2169
- stores.JSONEditorStore.getJSONDataByKeyRoute,
2170
- updateFormValueData: stores.JSONEditorStore.updateFormValueData,
2171
- getInitJsonDataByKeyRoute:
2172
- stores.JSONEditorStore.getInitJsonDataByKeyRoute,
2022
+ schemaStore: stores.JSONSchemaStore,
2023
+ jsonStore: stores.JSONEditorStore,
2173
2024
  };
2174
2025
  })(
2175
2026
  (0, mobx_react__WEBPACK_IMPORTED_MODULE_2__.observer)(
@@ -2254,10 +2105,12 @@
2254
2105
  };
2255
2106
  /** 初始化boxStyle的数值 */
2256
2107
  _this.initBoxStyle = function () {
2108
+ var jsonStore = _this.props.jsonStore;
2109
+ var _ref = jsonStore || {},
2110
+ getJSONDataByKeyRoute = _ref.getJSONDataByKeyRoute;
2257
2111
  var _this$props = _this.props,
2258
2112
  keyRoute = _this$props.keyRoute,
2259
- targetJsonSchema = _this$props.targetJsonSchema,
2260
- getJSONDataByKeyRoute = _this$props.getJSONDataByKeyRoute;
2113
+ targetJsonSchema = _this$props.targetJsonSchema;
2261
2114
  // 从jsonData中获取对应的数值
2262
2115
  var curJsonData = getJSONDataByKeyRoute(keyRoute);
2263
2116
  /** 获取quantity中的数值对象(默认第一个就是数值对象) */
@@ -2377,7 +2230,9 @@
2377
2230
  _this.updateBoxStyleState = function () {
2378
2231
  var _this$props2 = _this.props,
2379
2232
  keyRoute = _this$props2.keyRoute,
2380
- updateFormValueData = _this$props2.updateFormValueData;
2233
+ jsonStore = _this$props2.jsonStore;
2234
+ var _ref2 = jsonStore || {},
2235
+ updateFormValueData = _ref2.updateFormValueData;
2381
2236
  var renderAction = _this.state.renderAction;
2382
2237
  /** 获取布局容器的盒子模型数值 */
2383
2238
  var boxStyleUnit =
@@ -2421,8 +2276,12 @@
2421
2276
  var _this$props3 = this.props,
2422
2277
  nodeKey = _this$props3.nodeKey,
2423
2278
  jsonKey = _this$props3.jsonKey,
2424
- targetJsonSchema = _this$props3.targetJsonSchema,
2425
- pageScreen = _this$props3.pageScreen;
2279
+ targetJsonSchema = _this$props3.targetJsonSchema;
2280
+ var _this$props4 = this.props,
2281
+ schemaStore = _this$props4.schemaStore,
2282
+ jsonStore = _this$props4.jsonStore;
2283
+ var _ref3 = schemaStore || {},
2284
+ pageScreen = _ref3.pageScreen;
2426
2285
  var _this$state = this.state,
2427
2286
  renderAction = _this$state.renderAction,
2428
2287
  layoutStyleLock = _this$state.layoutStyleLock;
@@ -2655,12 +2514,8 @@
2655
2514
  /* harmony default export */ __webpack_exports__['default'] = (0,
2656
2515
  mobx_react__WEBPACK_IMPORTED_MODULE_2__.inject)(function (stores) {
2657
2516
  return {
2658
- pageScreen: stores.JSONSchemaStore.pageScreen,
2659
- getJSONDataByKeyRoute:
2660
- stores.JSONEditorStore.getJSONDataByKeyRoute,
2661
- updateFormValueData: stores.JSONEditorStore.updateFormValueData,
2662
- getInitJsonDataByKeyRoute:
2663
- stores.JSONEditorStore.getInitJsonDataByKeyRoute,
2517
+ schemaStore: stores.JSONSchemaStore,
2518
+ jsonStore: stores.JSONEditorStore,
2664
2519
  };
2665
2520
  })(
2666
2521
  (0, mobx_react__WEBPACK_IMPORTED_MODULE_2__.observer)(
@@ -2740,7 +2595,9 @@
2740
2595
  _this.handleValueChange = function (checkedValue) {
2741
2596
  var _this$props = _this.props,
2742
2597
  keyRoute = _this$props.keyRoute,
2743
- updateFormValueData = _this$props.updateFormValueData;
2598
+ jsonStore = _this$props.jsonStore;
2599
+ var _ref = jsonStore || {},
2600
+ updateFormValueData = _ref.updateFormValueData;
2744
2601
  updateFormValueData(keyRoute, checkedValue); // 更新数值
2745
2602
  };
2746
2603
  _this.handleValueChange = _this.handleValueChange.bind(_this);
@@ -2769,12 +2626,17 @@
2769
2626
  };
2770
2627
  _proto.render = function render() {
2771
2628
  var _this$props2 = this.props,
2772
- nodeKey = _this$props2.nodeKey,
2773
- jsonKey = _this$props2.jsonKey,
2774
- keyRoute = _this$props2.keyRoute,
2775
- targetJsonSchema = _this$props2.targetJsonSchema,
2776
- pageScreen = _this$props2.pageScreen,
2777
- getJSONDataByKeyRoute = _this$props2.getJSONDataByKeyRoute;
2629
+ schemaStore = _this$props2.schemaStore,
2630
+ jsonStore = _this$props2.jsonStore;
2631
+ var _ref2 = schemaStore || {},
2632
+ pageScreen = _ref2.pageScreen;
2633
+ var _ref3 = jsonStore || {},
2634
+ getJSONDataByKeyRoute = _ref3.getJSONDataByKeyRoute;
2635
+ var _this$props3 = this.props,
2636
+ nodeKey = _this$props3.nodeKey,
2637
+ jsonKey = _this$props3.jsonKey,
2638
+ keyRoute = _this$props3.keyRoute,
2639
+ targetJsonSchema = _this$props3.targetJsonSchema;
2778
2640
  // 从jsonData中获取对应的数值
2779
2641
  var curJsonData = getJSONDataByKeyRoute(keyRoute);
2780
2642
  var options = targetJsonSchema.options;
@@ -2901,12 +2763,8 @@
2901
2763
  /* harmony default export */ __webpack_exports__['default'] = (0,
2902
2764
  mobx_react__WEBPACK_IMPORTED_MODULE_2__.inject)(function (stores) {
2903
2765
  return {
2904
- pageScreen: stores.JSONSchemaStore.pageScreen,
2905
- getJSONDataByKeyRoute:
2906
- stores.JSONEditorStore.getJSONDataByKeyRoute,
2907
- updateFormValueData: stores.JSONEditorStore.updateFormValueData,
2908
- getInitJsonDataByKeyRoute:
2909
- stores.JSONEditorStore.getInitJsonDataByKeyRoute,
2766
+ schemaStore: stores.JSONSchemaStore,
2767
+ jsonStore: stores.JSONEditorStore,
2910
2768
  };
2911
2769
  })(
2912
2770
  (0, mobx_react__WEBPACK_IMPORTED_MODULE_2__.observer)(
@@ -3012,7 +2870,9 @@
3012
2870
  _this.handleValueChange = function (newJsonData) {
3013
2871
  var _this$props = _this.props,
3014
2872
  keyRoute = _this$props.keyRoute,
3015
- updateFormValueData = _this$props.updateFormValueData;
2873
+ jsonStore = _this$props.jsonStore;
2874
+ var _ref = jsonStore || {},
2875
+ updateFormValueData = _ref.updateFormValueData;
3016
2876
  updateFormValueData(keyRoute, newJsonData); // 更新数值
3017
2877
  };
3018
2878
  _this.state = {
@@ -3048,14 +2908,19 @@
3048
2908
  _proto.render = function render() {
3049
2909
  var _this2 = this;
3050
2910
  var _this$props2 = this.props,
3051
- isReadOnly = _this$props2.isReadOnly,
3052
- jsonKey = _this$props2.jsonKey,
3053
- isIgnoreWarn = _this$props2.isIgnoreWarn,
3054
- nodeKey = _this$props2.nodeKey,
3055
- keyRoute = _this$props2.keyRoute,
3056
- targetJsonSchema = _this$props2.targetJsonSchema,
3057
- pageScreen = _this$props2.pageScreen,
3058
- getJSONDataByKeyRoute = _this$props2.getJSONDataByKeyRoute;
2911
+ schemaStore = _this$props2.schemaStore,
2912
+ jsonStore = _this$props2.jsonStore;
2913
+ var _ref2 = schemaStore || {},
2914
+ pageScreen = _ref2.pageScreen;
2915
+ var _ref3 = jsonStore || {},
2916
+ getJSONDataByKeyRoute = _ref3.getJSONDataByKeyRoute;
2917
+ var _this$props3 = this.props,
2918
+ isReadOnly = _this$props3.isReadOnly,
2919
+ jsonKey = _this$props3.jsonKey,
2920
+ isIgnoreWarn = _this$props3.isIgnoreWarn,
2921
+ nodeKey = _this$props3.nodeKey,
2922
+ keyRoute = _this$props3.keyRoute,
2923
+ targetJsonSchema = _this$props3.targetJsonSchema;
3059
2924
  var _this$state = this.state,
3060
2925
  isShowWarn = _this$state.isShowWarn,
3061
2926
  warnText = _this$state.warnText;
@@ -3242,12 +3107,8 @@
3242
3107
  /* harmony default export */ __webpack_exports__['default'] = (0,
3243
3108
  mobx_react__WEBPACK_IMPORTED_MODULE_2__.inject)(function (stores) {
3244
3109
  return {
3245
- pageScreen: stores.JSONSchemaStore.pageScreen,
3246
- getJSONDataByKeyRoute:
3247
- stores.JSONEditorStore.getJSONDataByKeyRoute,
3248
- updateFormValueData: stores.JSONEditorStore.updateFormValueData,
3249
- getInitJsonDataByKeyRoute:
3250
- stores.JSONEditorStore.getInitJsonDataByKeyRoute,
3110
+ schemaStore: stores.JSONSchemaStore,
3111
+ jsonStore: stores.JSONEditorStore,
3251
3112
  };
3252
3113
  })(
3253
3114
  (0, mobx_react__WEBPACK_IMPORTED_MODULE_2__.observer)(
@@ -3343,6 +3204,11 @@
3343
3204
  _this = _React$PureComponent.call(this, props) || this;
3344
3205
  /** 数值变动事件处理器 */
3345
3206
  _this.handleValueChange = function (color) {
3207
+ var _this$props = _this.props,
3208
+ keyRoute = _this$props.keyRoute,
3209
+ jsonStore = _this$props.jsonStore;
3210
+ var _ref = jsonStore || {},
3211
+ updateFormValueData = _ref.updateFormValueData;
3346
3212
  var rgb = color.rgb; // hex,
3347
3213
  var rgbaVal =
3348
3214
  'rgba(' +
@@ -3354,9 +3220,6 @@
3354
3220
  ',' +
3355
3221
  rgb.a +
3356
3222
  ')';
3357
- var _this$props = _this.props,
3358
- keyRoute = _this$props.keyRoute,
3359
- updateFormValueData = _this$props.updateFormValueData;
3360
3223
  // updateFormValueData(keyRoute, hex); // 更新数值(#ffffff数据格式)
3361
3224
  updateFormValueData(keyRoute, rgbaVal); // 更新数值: rgba(255,255,255,100)
3362
3225
  // 主动触发更新的状态数据
@@ -3368,7 +3231,9 @@
3368
3231
  _this.deleteColor = function () {
3369
3232
  var _this$props2 = _this.props,
3370
3233
  keyRoute = _this$props2.keyRoute,
3371
- updateFormValueData = _this$props2.updateFormValueData;
3234
+ jsonStore = _this$props2.jsonStore;
3235
+ var _ref2 = jsonStore || {},
3236
+ updateFormValueData = _ref2.updateFormValueData;
3372
3237
  updateFormValueData(keyRoute, 'initial'); // 更新数值
3373
3238
  antd__WEBPACK_IMPORTED_MODULE_4__.message.success(
3374
3239
  '已移除当前设置的颜色值',
@@ -3411,12 +3276,17 @@
3411
3276
  _proto.render = function render() {
3412
3277
  var _this2 = this;
3413
3278
  var _this$props3 = this.props,
3414
- keyRoute = _this$props3.keyRoute,
3415
- jsonKey = _this$props3.jsonKey,
3416
- nodeKey = _this$props3.nodeKey,
3417
- targetJsonSchema = _this$props3.targetJsonSchema,
3418
- pageScreen = _this$props3.pageScreen,
3419
- getJSONDataByKeyRoute = _this$props3.getJSONDataByKeyRoute;
3279
+ schemaStore = _this$props3.schemaStore,
3280
+ jsonStore = _this$props3.jsonStore;
3281
+ var _ref3 = schemaStore || {},
3282
+ pageScreen = _ref3.pageScreen;
3283
+ var _ref4 = jsonStore || {},
3284
+ getJSONDataByKeyRoute = _ref4.getJSONDataByKeyRoute;
3285
+ var _this$props4 = this.props,
3286
+ keyRoute = _this$props4.keyRoute,
3287
+ jsonKey = _this$props4.jsonKey,
3288
+ nodeKey = _this$props4.nodeKey,
3289
+ targetJsonSchema = _this$props4.targetJsonSchema;
3420
3290
  var _this$state = this.state,
3421
3291
  renderState = _this$state.renderState,
3422
3292
  displayColorPicker = _this$state.displayColorPicker;
@@ -3571,12 +3441,8 @@
3571
3441
  /* harmony default export */ __webpack_exports__['default'] = (0,
3572
3442
  mobx_react__WEBPACK_IMPORTED_MODULE_2__.inject)(function (stores) {
3573
3443
  return {
3574
- pageScreen: stores.JSONSchemaStore.pageScreen,
3575
- getJSONDataByKeyRoute:
3576
- stores.JSONEditorStore.getJSONDataByKeyRoute,
3577
- updateFormValueData: stores.JSONEditorStore.updateFormValueData,
3578
- getInitJsonDataByKeyRoute:
3579
- stores.JSONEditorStore.getInitJsonDataByKeyRoute,
3444
+ schemaStore: stores.JSONSchemaStore,
3445
+ jsonStore: stores.JSONEditorStore,
3580
3446
  };
3581
3447
  })(
3582
3448
  (0, mobx_react__WEBPACK_IMPORTED_MODULE_2__.observer)(
@@ -3724,12 +3590,16 @@
3724
3590
  var _targetJsonSchema$sho,
3725
3591
  _this2 = this;
3726
3592
  var _this$props = this.props,
3727
- keyRoute = _this$props.keyRoute,
3728
- jsonKey = _this$props.jsonKey,
3729
- nodeKey = _this$props.nodeKey,
3730
- indexRoute = _this$props.indexRoute,
3731
- targetJsonSchema = _this$props.targetJsonSchema,
3732
- pageScreen = _this$props.pageScreen;
3593
+ schemaStore = _this$props.schemaStore,
3594
+ jsonStore = _this$props.jsonStore;
3595
+ var _ref = schemaStore || {},
3596
+ pageScreen = _ref.pageScreen;
3597
+ var _this$props2 = this.props,
3598
+ keyRoute = _this$props2.keyRoute,
3599
+ jsonKey = _this$props2.jsonKey,
3600
+ nodeKey = _this$props2.nodeKey,
3601
+ indexRoute = _this$props2.indexRoute,
3602
+ targetJsonSchema = _this$props2.targetJsonSchema;
3733
3603
  var _this$state = this.state,
3734
3604
  jsonView = _this$state.jsonView,
3735
3605
  isClosed = _this$state.isClosed,
@@ -4026,13 +3896,8 @@
4026
3896
  /* harmony default export */ __webpack_exports__['default'] = (0,
4027
3897
  mobx_react__WEBPACK_IMPORTED_MODULE_2__.inject)(function (stores) {
4028
3898
  return {
4029
- triggerChange: stores.JSONEditorStore.triggerChange,
4030
- pageScreen: stores.JSONSchemaStore.pageScreen,
4031
- getJSONDataByKeyRoute:
4032
- stores.JSONEditorStore.getJSONDataByKeyRoute,
4033
- updateFormValueData: stores.JSONEditorStore.updateFormValueData,
4034
- getInitJsonDataByKeyRoute:
4035
- stores.JSONEditorStore.getInitJsonDataByKeyRoute,
3899
+ schemaStore: stores.JSONSchemaStore,
3900
+ jsonStore: stores.JSONEditorStore,
4036
3901
  };
4037
3902
  })(
4038
3903
  (0, mobx_react__WEBPACK_IMPORTED_MODULE_2__.observer)(
@@ -4121,7 +3986,9 @@
4121
3986
  _this.handleValueChange = function (event, dateString) {
4122
3987
  var _this$props = _this.props,
4123
3988
  keyRoute = _this$props.keyRoute,
4124
- updateFormValueData = _this$props.updateFormValueData;
3989
+ jsonStore = _this$props.jsonStore;
3990
+ var _ref = jsonStore || {},
3991
+ updateFormValueData = _ref.updateFormValueData;
4125
3992
  updateFormValueData(keyRoute, dateString); // 更新数值
4126
3993
  };
4127
3994
  _this.handleValueChange = _this.handleValueChange.bind(_this);
@@ -4150,12 +4017,17 @@
4150
4017
  };
4151
4018
  _proto.render = function render() {
4152
4019
  var _this$props2 = this.props,
4153
- keyRoute = _this$props2.keyRoute,
4154
- jsonKey = _this$props2.jsonKey,
4155
- nodeKey = _this$props2.nodeKey,
4156
- targetJsonSchema = _this$props2.targetJsonSchema,
4157
- pageScreen = _this$props2.pageScreen,
4158
- getJSONDataByKeyRoute = _this$props2.getJSONDataByKeyRoute;
4020
+ schemaStore = _this$props2.schemaStore,
4021
+ jsonStore = _this$props2.jsonStore;
4022
+ var _ref2 = schemaStore || {},
4023
+ pageScreen = _ref2.pageScreen;
4024
+ var _ref3 = jsonStore || {},
4025
+ getJSONDataByKeyRoute = _ref3.getJSONDataByKeyRoute;
4026
+ var _this$props3 = this.props,
4027
+ keyRoute = _this$props3.keyRoute,
4028
+ jsonKey = _this$props3.jsonKey,
4029
+ nodeKey = _this$props3.nodeKey,
4030
+ targetJsonSchema = _this$props3.targetJsonSchema;
4159
4031
  var curType = targetJsonSchema.type;
4160
4032
  var readOnly = targetJsonSchema.readOnly || false; // 是否只读(默认可编辑)
4161
4033
  var isRequired = targetJsonSchema.isRequired || false; // 是否必填(默认非必填)
@@ -4277,12 +4149,8 @@
4277
4149
  /* harmony default export */ __webpack_exports__['default'] = (0,
4278
4150
  mobx_react__WEBPACK_IMPORTED_MODULE_2__.inject)(function (stores) {
4279
4151
  return {
4280
- pageScreen: stores.JSONSchemaStore.pageScreen,
4281
- getJSONDataByKeyRoute:
4282
- stores.JSONEditorStore.getJSONDataByKeyRoute,
4283
- updateFormValueData: stores.JSONEditorStore.updateFormValueData,
4284
- getInitJsonDataByKeyRoute:
4285
- stores.JSONEditorStore.getInitJsonDataByKeyRoute,
4152
+ schemaStore: stores.JSONSchemaStore,
4153
+ jsonStore: stores.JSONEditorStore,
4286
4154
  };
4287
4155
  })(
4288
4156
  (0, mobx_react__WEBPACK_IMPORTED_MODULE_2__.observer)(
@@ -4368,7 +4236,11 @@
4368
4236
  );
4369
4237
  /* harmony import */ var $mixins_index__WEBPACK_IMPORTED_MODULE_11__ =
4370
4238
  __webpack_require__(/*! $mixins/index */ './src/mixins/index.js');
4371
- /* harmony import */ var $assets_img_code_svg__WEBPACK_IMPORTED_MODULE_12__ =
4239
+ /* harmony import */ var $utils_webCache__WEBPACK_IMPORTED_MODULE_12__ =
4240
+ __webpack_require__(
4241
+ /*! $utils/webCache */ './src/utils/webCache.js',
4242
+ );
4243
+ /* harmony import */ var $assets_img_code_svg__WEBPACK_IMPORTED_MODULE_13__ =
4372
4244
  __webpack_require__(
4373
4245
  /*! $assets/img/code.svg */ './src/assets/img/code.svg',
4374
4246
  );
@@ -4382,6 +4254,7 @@
4382
4254
  // 是否显示code模式
4383
4255
  isClosed: false, // 是否为关闭状态,默认是开启状态
4384
4256
  };
4257
+ _this.collapseChange = _this.collapseChange.bind(_this);
4385
4258
  return _this;
4386
4259
  }
4387
4260
  _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_0___default()(
@@ -4405,25 +4278,45 @@
4405
4278
  );
4406
4279
  }
4407
4280
  };
4281
+ _proto.collapseChange = function collapseChange(event) {
4282
+ var keyRoute = this.props.keyRoute;
4283
+ var isClosed = this.state.isClosed;
4284
+ this.setState({
4285
+ isClosed: !isClosed,
4286
+ });
4287
+ event.preventDefault();
4288
+ event.stopPropagation();
4289
+
4290
+ // 缓存当前折叠状态
4291
+ (0,
4292
+ $utils_webCache__WEBPACK_IMPORTED_MODULE_12__.saveJSONEditorCache)(
4293
+ keyRoute,
4294
+ !isClosed,
4295
+ );
4296
+ };
4408
4297
  _proto.render = function render() {
4409
4298
  var _targetJsonSchema$sho,
4410
4299
  _this2 = this;
4411
4300
  var _this$props = this.props,
4412
- indexRoute = _this$props.indexRoute,
4413
- jsonKey = _this$props.jsonKey,
4414
- nodeKey = _this$props.nodeKey,
4415
- keyRoute = _this$props.keyRoute,
4416
- pageScreen = _this$props.pageScreen,
4417
- targetJsonSchema = _this$props.targetJsonSchema,
4418
- isArrayItem = _this$props.isArrayItem,
4419
- isStructuredSchema = _this$props.isStructuredSchema,
4420
- getJSONDataByKeyRoute = _this$props.getJSONDataByKeyRoute,
4421
- keyRoute2indexRoute = _this$props.keyRoute2indexRoute,
4422
- updateFormValueData = _this$props.updateFormValueData;
4301
+ schemaStore = _this$props.schemaStore,
4302
+ jsonStore = _this$props.jsonStore;
4303
+ var _ref = schemaStore || {},
4304
+ pageScreen = _ref.pageScreen;
4305
+ var _ref2 = jsonStore || {},
4306
+ _options = _ref2.options,
4307
+ getJSONDataByKeyRoute = _ref2.getJSONDataByKeyRoute;
4308
+ var _this$props2 = this.props,
4309
+ indexRoute = _this$props2.indexRoute,
4310
+ jsonKey = _this$props2.jsonKey,
4311
+ nodeKey = _this$props2.nodeKey,
4312
+ keyRoute = _this$props2.keyRoute,
4313
+ targetJsonSchema = _this$props2.targetJsonSchema,
4314
+ isArrayItem = _this$props2.isArrayItem,
4315
+ isStructuredSchema = _this$props2.isStructuredSchema;
4423
4316
  var _this$state = this.state,
4424
4317
  jsonView = _this$state.jsonView,
4425
- isClosed = _this$state.isClosed;
4426
- var options = this.props.options || {};
4318
+ _isClosed = _this$state.isClosed;
4319
+ var options = _options || {};
4427
4320
  // 判断是否结构化Schema,如果是则不显示Title,避免重复的title
4428
4321
  var isStructured = isStructuredSchema;
4429
4322
  // 是否显示源码切换按钮
@@ -4439,6 +4332,16 @@
4439
4332
  // 内容Meta数据
4440
4333
  var metaContentKeyList = options.metaContentKeyList || [];
4441
4334
  var globalMetaConfig = options.globalMetaConfig || [];
4335
+
4336
+ // 获取前端缓存中的折叠数据
4337
+ var isClosed = _isClosed;
4338
+ var collapseCacheData = (0,
4339
+ $utils_webCache__WEBPACK_IMPORTED_MODULE_12__.getJSONEditorCache)(
4340
+ keyRoute,
4341
+ );
4342
+ if (collapseCacheData !== undefined) {
4343
+ isClosed = collapseCacheData;
4344
+ }
4442
4345
  return /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
4443
4346
  'div',
4444
4347
  {
@@ -4502,13 +4405,7 @@
4502
4405
  'div',
4503
4406
  {
4504
4407
  className: 'element-title',
4505
- onClick: function onClick(event) {
4506
- _this2.setState({
4507
- isClosed: !isClosed,
4508
- });
4509
- event.preventDefault();
4510
- event.stopPropagation();
4511
- },
4408
+ onClick: this.collapseChange,
4512
4409
  },
4513
4410
  /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
4514
4411
  'span',
@@ -4549,7 +4446,7 @@
4549
4446
  title: jsonView ? '关闭源码模式' : '开启源码模式',
4550
4447
  },
4551
4448
  /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
4552
- $assets_img_code_svg__WEBPACK_IMPORTED_MODULE_12__[
4449
+ $assets_img_code_svg__WEBPACK_IMPORTED_MODULE_13__[
4553
4450
  'default'
4554
4451
  ],
4555
4452
  {
@@ -4596,28 +4493,16 @@
4596
4493
  /** 5. 获取当前元素的id,用于做唯一标识 */
4597
4494
  var childNodeKey =
4598
4495
  nodeKey + '-' + curType + '-' + currentJsonKey;
4599
- var visibleOn = [
4600
- 'description',
4601
- 'valueType',
4602
- 'range',
4603
- 'value',
4604
- ].includes(currentJsonKey)
4605
- ? false
4606
- : true; // 是否显示当前元素
4607
4496
 
4608
4497
  // 补充动态配置类型相关显隐逻辑【定制逻辑】
4609
4498
  if (
4610
- (currentJsonKey === 'description' ||
4611
- currentJsonKey === 'valueType') &&
4499
+ currentJsonKey === 'valueType' &&
4612
4500
  (curJsonData.type === 'ContentStaticConfig' ||
4613
4501
  curJsonData.type === 'ResourceCenter')
4614
4502
  ) {
4615
- // 资源中心配置、mp后台配置 时显示 description(属性名称)、valueType(配置方式)配置项
4616
- visibleOn = true;
4617
4503
  var valueSchema =
4618
4504
  targetJsonSchema.properties['value'];
4619
4505
  if (
4620
- currentJsonKey === 'valueType' &&
4621
4506
  !['select', 'radio', 'checkboxes'].includes(
4622
4507
  valueSchema.type,
4623
4508
  )
@@ -4628,15 +4513,13 @@
4628
4513
  currentSchemaData.description =
4629
4514
  '当前数值没有可选项,不支持设置。';
4630
4515
  }
4631
- } else if (currentJsonKey === 'range') {
4516
+ }
4517
+ if (currentJsonKey === 'range') {
4632
4518
  if (
4633
4519
  curJsonData.valueType === 'select' &&
4634
4520
  (curJsonData.type === 'ContentStaticConfig' ||
4635
4521
  curJsonData.type === 'ResourceCenter')
4636
4522
  ) {
4637
- visibleOn = true;
4638
- }
4639
- if (visibleOn) {
4640
4523
  var _valueSchema =
4641
4524
  targetJsonSchema.properties['value'];
4642
4525
  if (
@@ -4653,14 +4536,6 @@
4653
4536
  );
4654
4537
  }
4655
4538
  }
4656
- } else if (
4657
- currentJsonKey === 'value' &&
4658
- (curJsonData.type === 'DevDefaults' ||
4659
- curJsonData.type === 'RuntimeConst' ||
4660
- curJsonData.type === 'Content')
4661
- ) {
4662
- // 全局配置数据、内容Meta数据 显示 数据值 配置项
4663
- visibleOn = true;
4664
4539
  }
4665
4540
  if (
4666
4541
  currentJsonKey === 'value' &&
@@ -4683,22 +4558,19 @@
4683
4558
  globalMetaConfig,
4684
4559
  );
4685
4560
  }
4686
- if (visibleOn) {
4687
- return (0,
4688
- $components_MappingRender__WEBPACK_IMPORTED_MODULE_9__[
4689
- 'default'
4690
- ])({
4691
- parentType: curType,
4692
- jsonKey: currentJsonKey,
4693
- indexRoute: currentIndexRoute,
4694
- keyRoute: currentKeyRoute,
4695
- nodeKey: childNodeKey,
4696
- targetJsonSchema: currentSchemaData,
4697
- getJSONDataByKeyRoute: getJSONDataByKeyRoute,
4698
- keyRoute2indexRoute: keyRoute2indexRoute,
4699
- updateFormValueData: updateFormValueData,
4700
- });
4701
- }
4561
+ return (0,
4562
+ $components_MappingRender__WEBPACK_IMPORTED_MODULE_9__[
4563
+ 'default'
4564
+ ])({
4565
+ parentType: curType,
4566
+ jsonKey: currentJsonKey,
4567
+ indexRoute: currentIndexRoute,
4568
+ keyRoute: currentKeyRoute,
4569
+ nodeKey: childNodeKey,
4570
+ targetJsonSchema: currentSchemaData,
4571
+ schemaStore: schemaStore,
4572
+ jsonStore: jsonStore,
4573
+ });
4702
4574
  }),
4703
4575
  jsonView &&
4704
4576
  /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
@@ -4732,13 +4604,8 @@
4732
4604
  /* harmony default export */ __webpack_exports__['default'] = (0,
4733
4605
  mobx_react__WEBPACK_IMPORTED_MODULE_2__.inject)(function (stores) {
4734
4606
  return {
4735
- pageScreen: stores.JSONSchemaStore.pageScreen,
4736
- options: stores.JSONEditorStore.options,
4737
- getJSONDataByKeyRoute:
4738
- stores.JSONEditorStore.getJSONDataByKeyRoute,
4739
- updateFormValueData: stores.JSONEditorStore.updateFormValueData,
4740
- getInitJsonDataByKeyRoute:
4741
- stores.JSONEditorStore.getInitJsonDataByKeyRoute,
4607
+ schemaStore: stores.JSONSchemaStore,
4608
+ jsonStore: stores.JSONEditorStore,
4742
4609
  };
4743
4610
  })(
4744
4611
  (0, mobx_react__WEBPACK_IMPORTED_MODULE_2__.observer)(ObjectSchema),
@@ -4855,7 +4722,8 @@
4855
4722
  _this = _React$PureComponent.call(this, props) || this;
4856
4723
  /** 数值变动事件处理器 */
4857
4724
  _this.handleValueChange = function (curKeyRoute, value) {
4858
- var updateFormValueData = _this.props.updateFormValueData;
4725
+ var _ref = _this.props.jsonStore || {},
4726
+ updateFormValueData = _ref.updateFormValueData;
4859
4727
  updateFormValueData(curKeyRoute, value); // 更新数值
4860
4728
  };
4861
4729
  // 显示和隐藏数据过滤器
@@ -4869,7 +4737,9 @@
4869
4737
  _this.tabChange = function (value) {
4870
4738
  var _this$props = _this.props,
4871
4739
  keyRoute = _this$props.keyRoute,
4872
- triggerChangeAction = _this$props.triggerChangeAction;
4740
+ jsonStore = _this$props.jsonStore;
4741
+ var _ref2 = jsonStore || {},
4742
+ triggerChangeAction = _ref2.triggerChangeAction;
4873
4743
  _this.handleValueChange(keyRoute + '-type', value);
4874
4744
  setTimeout(function () {
4875
4745
  triggerChangeAction();
@@ -4878,8 +4748,10 @@
4878
4748
  _this.dynamicDataChange = function (dynamicDataName) {
4879
4749
  var _this$props2 = _this.props,
4880
4750
  keyRoute = _this$props2.keyRoute,
4881
- dynamicDataObj = _this$props2.dynamicDataObj,
4882
- triggerChangeAction = _this$props2.triggerChangeAction;
4751
+ jsonStore = _this$props2.jsonStore;
4752
+ var _ref3 = jsonStore || {},
4753
+ triggerChangeAction = _ref3.triggerChangeAction,
4754
+ dynamicDataObj = _ref3.dynamicDataObj;
4883
4755
  var curDynamicData = (0,
4884
4756
  $utils_index__WEBPACK_IMPORTED_MODULE_14__.objClone)(
4885
4757
  (0, mobx__WEBPACK_IMPORTED_MODULE_16__.toJS)(
@@ -4911,8 +4783,10 @@
4911
4783
  _this.dataRouteChange = function (newDataRoute) {
4912
4784
  var _this$props3 = _this.props,
4913
4785
  keyRoute = _this$props3.keyRoute,
4914
- triggerChangeAction = _this$props3.triggerChangeAction,
4915
- updateFormValueData = _this$props3.updateFormValueData;
4786
+ jsonStore = _this$props3.jsonStore;
4787
+ var _ref4 = jsonStore || {},
4788
+ triggerChangeAction = _ref4.triggerChangeAction,
4789
+ updateFormValueData = _ref4.updateFormValueData;
4916
4790
  if (newDataRoute) {
4917
4791
  updateFormValueData(
4918
4792
  keyRoute + '-config-dataRoute',
@@ -4944,8 +4818,10 @@
4944
4818
  _this.paramsConfigChange = function (paramsKey, newParamsConfig) {
4945
4819
  var _this$props4 = _this.props,
4946
4820
  keyRoute = _this$props4.keyRoute,
4947
- triggerChangeAction = _this$props4.triggerChangeAction,
4948
- getJSONDataByKeyRoute = _this$props4.getJSONDataByKeyRoute;
4821
+ jsonStore = _this$props4.jsonStore;
4822
+ var _ref5 = jsonStore || {},
4823
+ triggerChangeAction = _ref5.triggerChangeAction,
4824
+ getJSONDataByKeyRoute = _ref5.getJSONDataByKeyRoute;
4949
4825
  var curParamsConfigData =
4950
4826
  getJSONDataByKeyRoute(
4951
4827
  keyRoute + '-config-body-' + paramsKey,
@@ -4989,16 +4865,21 @@
4989
4865
  _proto.render = function render() {
4990
4866
  var _this2 = this;
4991
4867
  var _this$props5 = this.props,
4992
- keyRoute = _this$props5.keyRoute,
4993
- jsonKey = _this$props5.jsonKey,
4994
- nodeKey = _this$props5.nodeKey,
4995
- indexRoute = _this$props5.indexRoute,
4996
- targetJsonSchema = _this$props5.targetJsonSchema,
4997
- dynamicDataList = _this$props5.dynamicDataList,
4998
- dynamicDataObj = _this$props5.dynamicDataObj,
4999
- dynamicDataApiScopeList = _this$props5.dynamicDataApiScopeList,
5000
- getJSONDataByKeyRoute = _this$props5.getJSONDataByKeyRoute,
5001
- pageScreen = _this$props5.pageScreen;
4868
+ schemaStore = _this$props5.schemaStore,
4869
+ jsonStore = _this$props5.jsonStore;
4870
+ var _ref6 = schemaStore || {},
4871
+ pageScreen = _ref6.pageScreen;
4872
+ var _ref7 = jsonStore || {},
4873
+ getJSONDataByKeyRoute = _ref7.getJSONDataByKeyRoute;
4874
+ var _this$props6 = this.props,
4875
+ keyRoute = _this$props6.keyRoute,
4876
+ jsonKey = _this$props6.jsonKey,
4877
+ nodeKey = _this$props6.nodeKey,
4878
+ indexRoute = _this$props6.indexRoute,
4879
+ targetJsonSchema = _this$props6.targetJsonSchema,
4880
+ dynamicDataList = _this$props6.dynamicDataList,
4881
+ dynamicDataObj = _this$props6.dynamicDataObj,
4882
+ dynamicDataApiScopeList = _this$props6.dynamicDataApiScopeList;
5002
4883
  var isShowFilter = this.state.isShowFilter;
5003
4884
  var curType = targetJsonSchema.type;
5004
4885
  // 从jsonData中获取对应的数值
@@ -5454,18 +5335,8 @@
5454
5335
  /* harmony default export */ __webpack_exports__['default'] = (0,
5455
5336
  mobx_react__WEBPACK_IMPORTED_MODULE_2__.inject)(function (stores) {
5456
5337
  return {
5457
- triggerChange: stores.JSONEditorStore.triggerChange,
5458
- triggerChangeAction: stores.JSONEditorStore.triggerChangeAction,
5459
- pageScreen: stores.JSONSchemaStore.pageScreen,
5460
- dynamicDataList: stores.JSONEditorStore.dynamicDataList,
5461
- dynamicDataObj: stores.JSONEditorStore.dynamicDataObj,
5462
- dynamicDataApiScopeList:
5463
- stores.JSONEditorStore.dynamicDataApiScopeList,
5464
- getJSONDataByKeyRoute:
5465
- stores.JSONEditorStore.getJSONDataByKeyRoute,
5466
- updateFormValueData: stores.JSONEditorStore.updateFormValueData,
5467
- getInitJsonDataByKeyRoute:
5468
- stores.JSONEditorStore.getInitJsonDataByKeyRoute,
5338
+ schemaStore: stores.JSONSchemaStore,
5339
+ jsonStore: stores.JSONEditorStore,
5469
5340
  };
5470
5341
  })(
5471
5342
  (0, mobx_react__WEBPACK_IMPORTED_MODULE_2__.observer)(
@@ -5592,12 +5463,16 @@
5592
5463
  var _targetJsonSchema$sho,
5593
5464
  _this2 = this;
5594
5465
  var _this$props = this.props,
5595
- keyRoute = _this$props.keyRoute,
5596
- jsonKey = _this$props.jsonKey,
5597
- nodeKey = _this$props.nodeKey,
5598
- indexRoute = _this$props.indexRoute,
5599
- targetJsonSchema = _this$props.targetJsonSchema,
5600
- pageScreen = _this$props.pageScreen;
5466
+ schemaStore = _this$props.schemaStore,
5467
+ jsonStore = _this$props.jsonStore;
5468
+ var _ref = schemaStore || {},
5469
+ pageScreen = _ref.pageScreen;
5470
+ var _this$props2 = this.props,
5471
+ keyRoute = _this$props2.keyRoute,
5472
+ jsonKey = _this$props2.jsonKey,
5473
+ nodeKey = _this$props2.nodeKey,
5474
+ indexRoute = _this$props2.indexRoute,
5475
+ targetJsonSchema = _this$props2.targetJsonSchema;
5601
5476
  var curType = targetJsonSchema.type;
5602
5477
  var _this$state = this.state,
5603
5478
  jsonView = _this$state.jsonView,
@@ -5860,13 +5735,8 @@
5860
5735
  /* harmony default export */ __webpack_exports__['default'] = (0,
5861
5736
  mobx_react__WEBPACK_IMPORTED_MODULE_2__.inject)(function (stores) {
5862
5737
  return {
5863
- triggerChange: stores.JSONEditorStore.triggerChange,
5864
- pageScreen: stores.JSONSchemaStore.pageScreen,
5865
- getJSONDataByKeyRoute:
5866
- stores.JSONEditorStore.getJSONDataByKeyRoute,
5867
- updateFormValueData: stores.JSONEditorStore.updateFormValueData,
5868
- getInitJsonDataByKeyRoute:
5869
- stores.JSONEditorStore.getInitJsonDataByKeyRoute,
5738
+ schemaStore: stores.JSONSchemaStore,
5739
+ jsonStore: stores.JSONEditorStore,
5870
5740
  };
5871
5741
  })(
5872
5742
  (0, mobx_react__WEBPACK_IMPORTED_MODULE_2__.observer)(EventSchema),
@@ -5970,7 +5840,9 @@
5970
5840
  _this.handleValueChange = function (newJsonData) {
5971
5841
  var _this$props = _this.props,
5972
5842
  keyRoute = _this$props.keyRoute,
5973
- updateFormValueData = _this$props.updateFormValueData;
5843
+ jsonStore = _this$props.jsonStore;
5844
+ var _ref = jsonStore || {},
5845
+ updateFormValueData = _ref.updateFormValueData;
5974
5846
  updateFormValueData(keyRoute, newJsonData); // 更新数值
5975
5847
  };
5976
5848
  _this.state = {
@@ -6006,12 +5878,17 @@
6006
5878
  _proto.render = function render() {
6007
5879
  var _this2 = this;
6008
5880
  var _this$props2 = this.props,
6009
- nodeKey = _this$props2.nodeKey,
6010
- jsonKey = _this$props2.jsonKey,
6011
- keyRoute = _this$props2.keyRoute,
6012
- targetJsonSchema = _this$props2.targetJsonSchema,
6013
- pageScreen = _this$props2.pageScreen,
6014
- getJSONDataByKeyRoute = _this$props2.getJSONDataByKeyRoute;
5881
+ schemaStore = _this$props2.schemaStore,
5882
+ jsonStore = _this$props2.jsonStore;
5883
+ var _ref2 = schemaStore || {},
5884
+ pageScreen = _ref2.pageScreen;
5885
+ var _ref3 = jsonStore || {},
5886
+ getJSONDataByKeyRoute = _ref3.getJSONDataByKeyRoute;
5887
+ var _this$props3 = this.props,
5888
+ nodeKey = _this$props3.nodeKey,
5889
+ jsonKey = _this$props3.jsonKey,
5890
+ keyRoute = _this$props3.keyRoute,
5891
+ targetJsonSchema = _this$props3.targetJsonSchema;
6015
5892
  var _this$state = this.state,
6016
5893
  isShowWarn = _this$state.isShowWarn,
6017
5894
  warnText = _this$state.warnText;
@@ -6195,12 +6072,8 @@
6195
6072
  /* harmony default export */ __webpack_exports__['default'] = (0,
6196
6073
  mobx_react__WEBPACK_IMPORTED_MODULE_2__.inject)(function (stores) {
6197
6074
  return {
6198
- pageScreen: stores.JSONSchemaStore.pageScreen,
6199
- getJSONDataByKeyRoute:
6200
- stores.JSONEditorStore.getJSONDataByKeyRoute,
6201
- updateFormValueData: stores.JSONEditorStore.updateFormValueData,
6202
- getInitJsonDataByKeyRoute:
6203
- stores.JSONEditorStore.getInitJsonDataByKeyRoute,
6075
+ schemaStore: stores.JSONSchemaStore,
6076
+ jsonStore: stores.JSONEditorStore,
6204
6077
  };
6205
6078
  })(
6206
6079
  (0, mobx_react__WEBPACK_IMPORTED_MODULE_2__.observer)(
@@ -6280,14 +6153,16 @@
6280
6153
  // static contextType = ThemeContext;
6281
6154
  /** 数值变动事件处理器 */
6282
6155
  _this.handleValueChange = function (event) {
6156
+ var _this$props = _this.props,
6157
+ keyRoute = _this$props.keyRoute,
6158
+ jsonStore = _this$props.jsonStore;
6159
+ var _ref = jsonStore || {},
6160
+ updateFormValueData = _ref.updateFormValueData;
6283
6161
  var value = event.target.value;
6284
6162
  if (_this.props.onChange) {
6285
6163
  // 如果有监听数据变动函数则优先触发
6286
6164
  _this.props.onChange(value);
6287
6165
  } else {
6288
- var _this$props = _this.props,
6289
- keyRoute = _this$props.keyRoute,
6290
- updateFormValueData = _this$props.updateFormValueData;
6291
6166
  updateFormValueData(keyRoute, value); // 更新数值
6292
6167
  }
6293
6168
  };
@@ -6317,12 +6192,17 @@
6317
6192
  };
6318
6193
  _proto.render = function render() {
6319
6194
  var _this$props2 = this.props,
6320
- nodeKey = _this$props2.nodeKey,
6321
- jsonKey = _this$props2.jsonKey,
6322
- keyRoute = _this$props2.keyRoute,
6323
- targetJsonSchema = _this$props2.targetJsonSchema,
6324
- pageScreen = _this$props2.pageScreen,
6325
- getJSONDataByKeyRoute = _this$props2.getJSONDataByKeyRoute;
6195
+ schemaStore = _this$props2.schemaStore,
6196
+ jsonStore = _this$props2.jsonStore;
6197
+ var _ref2 = schemaStore || {},
6198
+ pageScreen = _ref2.pageScreen;
6199
+ var _ref3 = jsonStore || {},
6200
+ getJSONDataByKeyRoute = _ref3.getJSONDataByKeyRoute;
6201
+ var _this$props3 = this.props,
6202
+ nodeKey = _this$props3.nodeKey,
6203
+ jsonKey = _this$props3.jsonKey,
6204
+ keyRoute = _this$props3.keyRoute,
6205
+ targetJsonSchema = _this$props3.targetJsonSchema;
6326
6206
  // 从jsonData中获取对应的数值
6327
6207
  var curJsonData = keyRoute && getJSONDataByKeyRoute(keyRoute);
6328
6208
  var readOnly = targetJsonSchema.readOnly || false; // 是否只读(默认可编辑)
@@ -6448,12 +6328,8 @@
6448
6328
  /* harmony default export */ __webpack_exports__['default'] = (0,
6449
6329
  mobx_react__WEBPACK_IMPORTED_MODULE_2__.inject)(function (stores) {
6450
6330
  return {
6451
- pageScreen: stores.JSONSchemaStore.pageScreen,
6452
- getJSONDataByKeyRoute:
6453
- stores.JSONEditorStore.getJSONDataByKeyRoute,
6454
- getInitJsonDataByKeyRoute:
6455
- stores.JSONEditorStore.getInitJsonDataByKeyRoute,
6456
- updateFormValueData: stores.JSONEditorStore.updateFormValueData,
6331
+ schemaStore: stores.JSONSchemaStore,
6332
+ jsonStore: stores.JSONEditorStore,
6457
6333
  };
6458
6334
  })(
6459
6335
  (0, mobx_react__WEBPACK_IMPORTED_MODULE_2__.observer)(
@@ -6533,7 +6409,9 @@
6533
6409
  _this.handleImageChange = function (fileInfo) {
6534
6410
  var _this$props = _this.props,
6535
6411
  keyRoute = _this$props.keyRoute,
6536
- updateFormValueData = _this$props.updateFormValueData;
6412
+ jsonStore = _this$props.jsonStore;
6413
+ var _ref = jsonStore || {},
6414
+ updateFormValueData = _ref.updateFormValueData;
6537
6415
  if (fileInfo.file.status === 'uploading') {
6538
6416
  _this.setState({
6539
6417
  loading: true,
@@ -6555,11 +6433,20 @@
6555
6433
  loading: false,
6556
6434
  });
6557
6435
  };
6436
+ _this.handleDeleteChange = function () {
6437
+ var _this$props2 = _this.props,
6438
+ keyRoute = _this$props2.keyRoute,
6439
+ jsonStore = _this$props2.jsonStore;
6440
+ var _ref2 = jsonStore || {},
6441
+ updateFormValueData = _ref2.updateFormValueData;
6442
+ updateFormValueData(keyRoute, '');
6443
+ };
6558
6444
  _this.state = {
6559
6445
  loading: false,
6560
6446
  };
6561
6447
  // 这边绑定是必要的,这样 `this` 才能在回调函数中使用
6562
6448
  _this.handleImageChange = _this.handleImageChange.bind(_this);
6449
+ _this.handleDeleteChange = _this.handleDeleteChange.bind(_this);
6563
6450
  return _this;
6564
6451
  }
6565
6452
 
@@ -6588,13 +6475,18 @@
6588
6475
  };
6589
6476
  _proto.render = function render() {
6590
6477
  var _targetJsonSchema$lis;
6591
- var _this$props2 = this.props,
6592
- nodeKey = _this$props2.nodeKey,
6593
- jsonKey = _this$props2.jsonKey,
6594
- keyRoute = _this$props2.keyRoute,
6595
- targetJsonSchema = _this$props2.targetJsonSchema,
6596
- pageScreen = _this$props2.pageScreen,
6597
- getJSONDataByKeyRoute = _this$props2.getJSONDataByKeyRoute;
6478
+ var _this$props3 = this.props,
6479
+ schemaStore = _this$props3.schemaStore,
6480
+ jsonStore = _this$props3.jsonStore;
6481
+ var _ref3 = schemaStore || {},
6482
+ pageScreen = _ref3.pageScreen;
6483
+ var _ref4 = jsonStore || {},
6484
+ getJSONDataByKeyRoute = _ref4.getJSONDataByKeyRoute;
6485
+ var _this$props4 = this.props,
6486
+ nodeKey = _this$props4.nodeKey,
6487
+ jsonKey = _this$props4.jsonKey,
6488
+ keyRoute = _this$props4.keyRoute,
6489
+ targetJsonSchema = _this$props4.targetJsonSchema;
6598
6490
  var options = this.props.options || {};
6599
6491
  var loading = this.state.loading;
6600
6492
  // 从jsonData中获取对应的数值
@@ -6621,6 +6513,7 @@
6621
6513
  targetJsonSchema.authorization || 'authorization-content',
6622
6514
  },
6623
6515
  onChange: this.handleImageChange,
6516
+ onRemove: this.handleDeleteChange,
6624
6517
  };
6625
6518
  return /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1__.createElement(
6626
6519
  'div',
@@ -6759,13 +6652,8 @@
6759
6652
  /* harmony default export */ __webpack_exports__['default'] = (0,
6760
6653
  mobx_react__WEBPACK_IMPORTED_MODULE_2__.inject)(function (stores) {
6761
6654
  return {
6762
- pageScreen: stores.JSONSchemaStore.pageScreen,
6763
- options: stores.JSONEditorStore.options,
6764
- getJSONDataByKeyRoute:
6765
- stores.JSONEditorStore.getJSONDataByKeyRoute,
6766
- getInitJsonDataByKeyRoute:
6767
- stores.JSONEditorStore.getInitJsonDataByKeyRoute,
6768
- updateFormValueData: stores.JSONEditorStore.updateFormValueData,
6655
+ schemaStore: stores.JSONSchemaStore,
6656
+ jsonStore: stores.JSONEditorStore,
6769
6657
  };
6770
6658
  })(
6771
6659
  (0, mobx_react__WEBPACK_IMPORTED_MODULE_2__.observer)(
@@ -6873,7 +6761,9 @@
6873
6761
  _this.handleValueChange = function (newJsonData) {
6874
6762
  var _this$props = _this.props,
6875
6763
  keyRoute = _this$props.keyRoute,
6876
- updateFormValueData = _this$props.updateFormValueData;
6764
+ jsonStore = _this$props.jsonStore;
6765
+ var _ref = jsonStore || {},
6766
+ updateFormValueData = _ref.updateFormValueData;
6877
6767
  if (newJsonData) {
6878
6768
  updateFormValueData(keyRoute, newJsonData); // 更新数值
6879
6769
  }
@@ -6913,12 +6803,17 @@
6913
6803
  _proto.render = function render() {
6914
6804
  var _this2 = this;
6915
6805
  var _this$props2 = this.props,
6916
- nodeKey = _this$props2.nodeKey,
6917
- jsonKey = _this$props2.jsonKey,
6918
- keyRoute = _this$props2.keyRoute,
6919
- targetJsonSchema = _this$props2.targetJsonSchema,
6920
- pageScreen = _this$props2.pageScreen,
6921
- getJSONDataByKeyRoute = _this$props2.getJSONDataByKeyRoute;
6806
+ schemaStore = _this$props2.schemaStore,
6807
+ jsonStore = _this$props2.jsonStore;
6808
+ var _ref2 = schemaStore || {},
6809
+ pageScreen = _ref2.pageScreen;
6810
+ var _ref3 = jsonStore || {},
6811
+ getJSONDataByKeyRoute = _ref3.getJSONDataByKeyRoute;
6812
+ var _this$props3 = this.props,
6813
+ nodeKey = _this$props3.nodeKey,
6814
+ jsonKey = _this$props3.jsonKey,
6815
+ keyRoute = _this$props3.keyRoute,
6816
+ targetJsonSchema = _this$props3.targetJsonSchema;
6922
6817
  var _this$state = this.state,
6923
6818
  isShowWarn = _this$state.isShowWarn,
6924
6819
  warnText = _this$state.warnText,
@@ -7101,13 +6996,8 @@
7101
6996
  /* harmony default export */ __webpack_exports__['default'] = (0,
7102
6997
  mobx_react__WEBPACK_IMPORTED_MODULE_2__.inject)(function (stores) {
7103
6998
  return {
7104
- pageScreen: stores.JSONSchemaStore.pageScreen,
7105
- getJSONDataByKeyRoute:
7106
- stores.JSONEditorStore.getJSONDataByKeyRoute,
7107
- getInitJsonDataByKeyRoute:
7108
- stores.JSONEditorStore.getInitJsonDataByKeyRoute,
7109
- indexRoute2keyRoute: stores.JSONSchemaStore.indexRoute2keyRoute,
7110
- updateFormValueData: stores.JSONEditorStore.updateFormValueData,
6999
+ schemaStore: stores.JSONSchemaStore,
7000
+ jsonStore: stores.JSONEditorStore,
7111
7001
  };
7112
7002
  })(
7113
7003
  (0, mobx_react__WEBPACK_IMPORTED_MODULE_2__.observer)(
@@ -7199,7 +7089,9 @@
7199
7089
  _this.handleValueChange = function (newJsonData) {
7200
7090
  var _this$props = _this.props,
7201
7091
  keyRoute = _this$props.keyRoute,
7202
- updateFormValueData = _this$props.updateFormValueData;
7092
+ jsonStore = _this$props.jsonStore;
7093
+ var _ref = jsonStore || {},
7094
+ updateFormValueData = _ref.updateFormValueData;
7203
7095
  if (newJsonData) {
7204
7096
  updateFormValueData(keyRoute, newJsonData); // 更新数值
7205
7097
  }
@@ -7213,11 +7105,12 @@
7213
7105
  );
7214
7106
  var _proto = JsonView.prototype;
7215
7107
  _proto.render = function render() {
7108
+ var _ref2 = this.props.jsonStore || {},
7109
+ getJSONDataByKeyRoute = _ref2.getJSONDataByKeyRoute;
7216
7110
  var _this$props2 = this.props,
7217
7111
  nodeKey = _this$props2.nodeKey,
7218
7112
  keyRoute = _this$props2.keyRoute,
7219
- targetJsonSchema = _this$props2.targetJsonSchema,
7220
- getJSONDataByKeyRoute = _this$props2.getJSONDataByKeyRoute;
7113
+ targetJsonSchema = _this$props2.targetJsonSchema;
7221
7114
  // 从jsonData中获取对应的数值
7222
7115
  var curJsonData = getJSONDataByKeyRoute(keyRoute);
7223
7116
 
@@ -7293,11 +7186,8 @@
7293
7186
  /* harmony default export */ __webpack_exports__['default'] = (0,
7294
7187
  mobx_react__WEBPACK_IMPORTED_MODULE_2__.inject)(function (stores) {
7295
7188
  return {
7296
- pageScreen: stores.JSONSchemaStore.pageScreen,
7297
- getJSONDataByKeyRoute:
7298
- stores.JSONEditorStore.getJSONDataByKeyRoute,
7299
- getInitJsonDataByKeyRoute:
7300
- stores.JSONEditorStore.getInitJsonDataByKeyRoute,
7189
+ schemaStore: stores.JSONSchemaStore,
7190
+ jsonStore: stores.JSONEditorStore,
7301
7191
  };
7302
7192
  })((0, mobx_react__WEBPACK_IMPORTED_MODULE_2__.observer)(JsonView));
7303
7193
 
@@ -7378,8 +7268,10 @@
7378
7268
  _this.handleValueChange = function (newVal) {
7379
7269
  var _this$props = _this.props,
7380
7270
  keyRoute = _this$props.keyRoute,
7381
- targetJsonSchema = _this$props.targetJsonSchema,
7382
- updateFormValueData = _this$props.updateFormValueData;
7271
+ jsonStore = _this$props.jsonStore;
7272
+ var _ref = jsonStore || {},
7273
+ updateFormValueData = _ref.updateFormValueData;
7274
+ var targetJsonSchema = _this.props.targetJsonSchema;
7383
7275
  if (newVal < targetJsonSchema.minimum) {
7384
7276
  antd__WEBPACK_IMPORTED_MODULE_4__.message.warning(
7385
7277
  '\u5C0F\u4E8E\u8BBE\u5B9A\u7684\u6700\u5C0F\u6570\u503C' +
@@ -7444,12 +7336,17 @@
7444
7336
  _proto.render = function render() {
7445
7337
  var _this2 = this;
7446
7338
  var _this$props2 = this.props,
7447
- keyRoute = _this$props2.keyRoute,
7448
- jsonKey = _this$props2.jsonKey,
7449
- nodeKey = _this$props2.nodeKey,
7450
- targetJsonSchema = _this$props2.targetJsonSchema,
7451
- pageScreen = _this$props2.pageScreen,
7452
- getJSONDataByKeyRoute = _this$props2.getJSONDataByKeyRoute;
7339
+ schemaStore = _this$props2.schemaStore,
7340
+ jsonStore = _this$props2.jsonStore;
7341
+ var _ref2 = schemaStore || {},
7342
+ pageScreen = _ref2.pageScreen;
7343
+ var _ref3 = jsonStore || {},
7344
+ getJSONDataByKeyRoute = _ref3.getJSONDataByKeyRoute;
7345
+ var _this$props3 = this.props,
7346
+ keyRoute = _this$props3.keyRoute,
7347
+ jsonKey = _this$props3.jsonKey,
7348
+ nodeKey = _this$props3.nodeKey,
7349
+ targetJsonSchema = _this$props3.targetJsonSchema;
7453
7350
  var renderTime = this.state.renderTime;
7454
7351
  // 从jsonData中获取对应的数值
7455
7352
  var curJsonData = getJSONDataByKeyRoute(keyRoute);
@@ -7614,12 +7511,8 @@
7614
7511
  /* harmony default export */ __webpack_exports__['default'] = (0,
7615
7512
  mobx_react__WEBPACK_IMPORTED_MODULE_2__.inject)(function (stores) {
7616
7513
  return {
7617
- pageScreen: stores.JSONSchemaStore.pageScreen,
7618
- getJSONDataByKeyRoute:
7619
- stores.JSONEditorStore.getJSONDataByKeyRoute,
7620
- updateFormValueData: stores.JSONEditorStore.updateFormValueData,
7621
- getInitJsonDataByKeyRoute:
7622
- stores.JSONEditorStore.getInitJsonDataByKeyRoute,
7514
+ schemaStore: stores.JSONSchemaStore,
7515
+ jsonStore: stores.JSONEditorStore,
7623
7516
  };
7624
7517
  })(
7625
7518
  (0, mobx_react__WEBPACK_IMPORTED_MODULE_2__.observer)(
@@ -7697,17 +7590,21 @@
7697
7590
  );
7698
7591
  /* harmony import */ var $mixins_index__WEBPACK_IMPORTED_MODULE_9__ =
7699
7592
  __webpack_require__(/*! $mixins/index */ './src/mixins/index.js');
7700
- /* harmony import */ var $assets_img_code_svg__WEBPACK_IMPORTED_MODULE_10__ =
7593
+ /* harmony import */ var $utils_webCache__WEBPACK_IMPORTED_MODULE_10__ =
7594
+ __webpack_require__(
7595
+ /*! $utils/webCache */ './src/utils/webCache.js',
7596
+ );
7597
+ /* harmony import */ var $assets_img_code_svg__WEBPACK_IMPORTED_MODULE_11__ =
7701
7598
  __webpack_require__(
7702
7599
  /*! $assets/img/code.svg */ './src/assets/img/code.svg',
7703
7600
  );
7704
- /* harmony import */ var _index_scss__WEBPACK_IMPORTED_MODULE_11__ =
7601
+ /* harmony import */ var _index_scss__WEBPACK_IMPORTED_MODULE_12__ =
7705
7602
  __webpack_require__(
7706
7603
  /*! ./index.scss */ './src/renderers/ObjectSchema/index.scss',
7707
7604
  );
7708
- /* harmony import */ var _index_scss__WEBPACK_IMPORTED_MODULE_11___default =
7605
+ /* harmony import */ var _index_scss__WEBPACK_IMPORTED_MODULE_12___default =
7709
7606
  /*#__PURE__*/ __webpack_require__.n(
7710
- _index_scss__WEBPACK_IMPORTED_MODULE_11__,
7607
+ _index_scss__WEBPACK_IMPORTED_MODULE_12__,
7711
7608
  );
7712
7609
 
7713
7610
  var ObjectSchema = /*#__PURE__*/ (function (_React$PureComponent) {
@@ -7719,6 +7616,7 @@
7719
7616
  // 是否显示code模式
7720
7617
  isClosed: false, // 是否为关闭状态,默认是开启状态
7721
7618
  };
7619
+ _this.collapseChange = _this.collapseChange.bind(_this);
7722
7620
  return _this;
7723
7621
  }
7724
7622
  _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_0___default()(
@@ -7742,25 +7640,42 @@
7742
7640
  );
7743
7641
  }
7744
7642
  };
7643
+ _proto.collapseChange = function collapseChange(event) {
7644
+ var keyRoute = this.props.keyRoute;
7645
+ var isClosed = this.state.isClosed;
7646
+ this.setState({
7647
+ isClosed: !isClosed,
7648
+ });
7649
+ event.preventDefault();
7650
+ event.stopPropagation();
7651
+
7652
+ // 缓存当前折叠状态
7653
+ (0,
7654
+ $utils_webCache__WEBPACK_IMPORTED_MODULE_10__.saveJSONEditorCache)(
7655
+ keyRoute,
7656
+ !isClosed,
7657
+ );
7658
+ };
7745
7659
  _proto.render = function render() {
7746
7660
  var _targetJsonSchema$sho,
7747
7661
  _this2 = this;
7748
7662
  var _this$props = this.props,
7749
- indexRoute = _this$props.indexRoute,
7750
- jsonKey = _this$props.jsonKey,
7751
- nodeKey = _this$props.nodeKey,
7752
- keyRoute = _this$props.keyRoute,
7753
- pageScreen = _this$props.pageScreen,
7754
- targetJsonSchema = _this$props.targetJsonSchema,
7755
- isArrayItem = _this$props.isArrayItem,
7756
- arrIndex = _this$props.arrIndex,
7757
- isStructuredSchema = _this$props.isStructuredSchema,
7758
- getJSONDataByKeyRoute = _this$props.getJSONDataByKeyRoute,
7759
- keyRoute2indexRoute = _this$props.keyRoute2indexRoute,
7760
- updateFormValueData = _this$props.updateFormValueData;
7663
+ schemaStore = _this$props.schemaStore,
7664
+ jsonStore = _this$props.jsonStore;
7665
+ var _ref = schemaStore || {},
7666
+ pageScreen = _ref.pageScreen;
7667
+ var _this$props2 = this.props,
7668
+ indexRoute = _this$props2.indexRoute,
7669
+ jsonKey = _this$props2.jsonKey,
7670
+ nodeKey = _this$props2.nodeKey,
7671
+ keyRoute = _this$props2.keyRoute,
7672
+ targetJsonSchema = _this$props2.targetJsonSchema,
7673
+ isArrayItem = _this$props2.isArrayItem,
7674
+ arrIndex = _this$props2.arrIndex,
7675
+ isStructuredSchema = _this$props2.isStructuredSchema;
7761
7676
  var _this$state = this.state,
7762
7677
  jsonView = _this$state.jsonView,
7763
- isClosed = _this$state.isClosed;
7678
+ _isClosed = _this$state.isClosed;
7764
7679
  // 判断是否结构化Schema,如果是则不显示Title,避免重复的title
7765
7680
  var isStructured = isStructuredSchema;
7766
7681
  // 是否显示源码切换按钮
@@ -7769,6 +7684,16 @@
7769
7684
  null
7770
7685
  ? _targetJsonSchema$sho
7771
7686
  : true;
7687
+
7688
+ // 获取前端缓存中的折叠数据
7689
+ var isClosed = _isClosed;
7690
+ var collapseCacheData = (0,
7691
+ $utils_webCache__WEBPACK_IMPORTED_MODULE_10__.getJSONEditorCache)(
7692
+ keyRoute,
7693
+ );
7694
+ if (collapseCacheData !== undefined) {
7695
+ isClosed = collapseCacheData;
7696
+ }
7772
7697
  return /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
7773
7698
  'div',
7774
7699
  {
@@ -7831,13 +7756,7 @@
7831
7756
  'div',
7832
7757
  {
7833
7758
  className: 'element-title',
7834
- onClick: function onClick(event) {
7835
- _this2.setState({
7836
- isClosed: !isClosed,
7837
- });
7838
- event.preventDefault();
7839
- event.stopPropagation();
7840
- },
7759
+ onClick: this.collapseChange,
7841
7760
  },
7842
7761
  /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
7843
7762
  'span',
@@ -7878,7 +7797,7 @@
7878
7797
  title: jsonView ? '关闭源码模式' : '开启源码模式',
7879
7798
  },
7880
7799
  /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
7881
- $assets_img_code_svg__WEBPACK_IMPORTED_MODULE_10__[
7800
+ $assets_img_code_svg__WEBPACK_IMPORTED_MODULE_11__[
7882
7801
  'default'
7883
7802
  ],
7884
7803
  {
@@ -7933,9 +7852,8 @@
7933
7852
  keyRoute: currentKeyRoute,
7934
7853
  nodeKey: childNodeKey,
7935
7854
  targetJsonSchema: currentSchemaData,
7936
- getJSONDataByKeyRoute: getJSONDataByKeyRoute,
7937
- keyRoute2indexRoute: keyRoute2indexRoute,
7938
- updateFormValueData: updateFormValueData,
7855
+ schemaStore: schemaStore,
7856
+ jsonStore: jsonStore,
7939
7857
  });
7940
7858
  }),
7941
7859
  jsonView &&
@@ -7970,12 +7888,8 @@
7970
7888
  /* harmony default export */ __webpack_exports__['default'] = (0,
7971
7889
  mobx_react__WEBPACK_IMPORTED_MODULE_2__.inject)(function (stores) {
7972
7890
  return {
7973
- pageScreen: stores.JSONSchemaStore.pageScreen,
7974
- getJSONDataByKeyRoute:
7975
- stores.JSONEditorStore.getJSONDataByKeyRoute,
7976
- updateFormValueData: stores.JSONEditorStore.updateFormValueData,
7977
- getInitJsonDataByKeyRoute:
7978
- stores.JSONEditorStore.getInitJsonDataByKeyRoute,
7891
+ schemaStore: stores.JSONSchemaStore,
7892
+ jsonStore: stores.JSONEditorStore,
7979
7893
  };
7980
7894
  })(
7981
7895
  (0, mobx_react__WEBPACK_IMPORTED_MODULE_2__.observer)(ObjectSchema),
@@ -8047,10 +7961,12 @@
8047
7961
  // 这边绑定是必要的,这样 `this` 才能在回调函数中使用
8048
7962
  /** 数值变动事件处理器 */
8049
7963
  _this.handleValueChange = function (event) {
8050
- var value = event.target.value;
8051
7964
  var _this$props = _this.props,
8052
7965
  keyRoute = _this$props.keyRoute,
8053
- updateFormValueData = _this$props.updateFormValueData;
7966
+ jsonStore = _this$props.jsonStore;
7967
+ var _ref = jsonStore || {},
7968
+ updateFormValueData = _ref.updateFormValueData;
7969
+ var value = event.target.value;
8054
7970
  var curKeyRoute = keyRoute ? keyRoute + '-unit' : 'unit';
8055
7971
  updateFormValueData(curKeyRoute, Number(value)); // 更新单位数值
8056
7972
  };
@@ -8080,12 +7996,17 @@
8080
7996
  };
8081
7997
  _proto.render = function render() {
8082
7998
  var _this$props2 = this.props,
8083
- keyRoute = _this$props2.keyRoute,
8084
- jsonKey = _this$props2.jsonKey,
8085
- nodeKey = _this$props2.nodeKey,
8086
- targetJsonSchema = _this$props2.targetJsonSchema,
8087
- pageScreen = _this$props2.pageScreen,
8088
- getJSONDataByKeyRoute = _this$props2.getJSONDataByKeyRoute;
7999
+ schemaStore = _this$props2.schemaStore,
8000
+ jsonStore = _this$props2.jsonStore;
8001
+ var _ref2 = schemaStore || {},
8002
+ pageScreen = _ref2.pageScreen;
8003
+ var _ref3 = jsonStore || {},
8004
+ getJSONDataByKeyRoute = _ref3.getJSONDataByKeyRoute;
8005
+ var _this$props3 = this.props,
8006
+ keyRoute = _this$props3.keyRoute,
8007
+ jsonKey = _this$props3.jsonKey,
8008
+ nodeKey = _this$props3.nodeKey,
8009
+ targetJsonSchema = _this$props3.targetJsonSchema;
8089
8010
  // 从jsonData中获取对应的数值
8090
8011
  var curJsonData = getJSONDataByKeyRoute(keyRoute);
8091
8012
  var readOnly = targetJsonSchema.readOnly || false; // 是否只读(默认可编辑)
@@ -8210,12 +8131,8 @@
8210
8131
  /* harmony default export */ __webpack_exports__['default'] = (0,
8211
8132
  mobx_react__WEBPACK_IMPORTED_MODULE_2__.inject)(function (stores) {
8212
8133
  return {
8213
- pageScreen: stores.JSONSchemaStore.pageScreen,
8214
- getJSONDataByKeyRoute:
8215
- stores.JSONEditorStore.getJSONDataByKeyRoute,
8216
- updateFormValueData: stores.JSONEditorStore.updateFormValueData,
8217
- getInitJsonDataByKeyRoute:
8218
- stores.JSONEditorStore.getInitJsonDataByKeyRoute,
8134
+ schemaStore: stores.JSONSchemaStore,
8135
+ jsonStore: stores.JSONEditorStore,
8219
8136
  };
8220
8137
  })(
8221
8138
  (0, mobx_react__WEBPACK_IMPORTED_MODULE_2__.observer)(
@@ -8293,10 +8210,12 @@
8293
8210
  // 这边绑定是必要的,这样 `this` 才能在回调函数中使用
8294
8211
  /** 数值变动事件处理器 */
8295
8212
  _this.handleValueChange = function (event) {
8296
- var value = event.target.value;
8297
8213
  var _this$props = _this.props,
8298
8214
  keyRoute = _this$props.keyRoute,
8299
- updateFormValueData = _this$props.updateFormValueData;
8215
+ jsonStore = _this$props.jsonStore;
8216
+ var _ref = jsonStore || {},
8217
+ updateFormValueData = _ref.updateFormValueData;
8218
+ var value = event.target.value;
8300
8219
  updateFormValueData(keyRoute, value); // 更新数值
8301
8220
  };
8302
8221
  _this.handleValueChange = _this.handleValueChange.bind(_this);
@@ -8325,12 +8244,17 @@
8325
8244
  };
8326
8245
  _proto.render = function render() {
8327
8246
  var _this$props2 = this.props,
8328
- nodeKey = _this$props2.nodeKey,
8329
- jsonKey = _this$props2.jsonKey,
8330
- keyRoute = _this$props2.keyRoute,
8331
- targetJsonSchema = _this$props2.targetJsonSchema,
8332
- pageScreen = _this$props2.pageScreen,
8333
- getJSONDataByKeyRoute = _this$props2.getJSONDataByKeyRoute;
8247
+ schemaStore = _this$props2.schemaStore,
8248
+ jsonStore = _this$props2.jsonStore;
8249
+ var _ref2 = schemaStore || {},
8250
+ pageScreen = _ref2.pageScreen;
8251
+ var _ref3 = jsonStore || {},
8252
+ getJSONDataByKeyRoute = _ref3.getJSONDataByKeyRoute;
8253
+ var _this$props3 = this.props,
8254
+ nodeKey = _this$props3.nodeKey,
8255
+ jsonKey = _this$props3.jsonKey,
8256
+ keyRoute = _this$props3.keyRoute,
8257
+ targetJsonSchema = _this$props3.targetJsonSchema;
8334
8258
  // 从jsonData中获取对应的数值
8335
8259
  var curJsonData = getJSONDataByKeyRoute(keyRoute);
8336
8260
  var options = targetJsonSchema.options;
@@ -8456,12 +8380,8 @@
8456
8380
  /* harmony default export */ __webpack_exports__['default'] = (0,
8457
8381
  mobx_react__WEBPACK_IMPORTED_MODULE_2__.inject)(function (stores) {
8458
8382
  return {
8459
- pageScreen: stores.JSONSchemaStore.pageScreen,
8460
- getJSONDataByKeyRoute:
8461
- stores.JSONEditorStore.getJSONDataByKeyRoute,
8462
- updateFormValueData: stores.JSONEditorStore.updateFormValueData,
8463
- getInitJsonDataByKeyRoute:
8464
- stores.JSONEditorStore.getInitJsonDataByKeyRoute,
8383
+ schemaStore: stores.JSONSchemaStore,
8384
+ jsonStore: stores.JSONEditorStore,
8465
8385
  };
8466
8386
  })(
8467
8387
  (0, mobx_react__WEBPACK_IMPORTED_MODULE_2__.observer)(RadioSchema),
@@ -8625,14 +8545,19 @@
8625
8545
  _proto.render = function render() {
8626
8546
  var _this2 = this;
8627
8547
  var _this$props = this.props,
8628
- pageScreen = _this$props.pageScreen,
8629
- curConfigData = _this$props.curConfigData,
8630
- nodeKey = _this$props.nodeKey,
8631
- keyRoute = _this$props.keyRoute,
8632
- dynamicDataList = _this$props.dynamicDataList,
8633
- dynamicDataObj = _this$props.dynamicDataObj,
8634
- dynamicDataApiScopeList = _this$props.dynamicDataApiScopeList,
8635
- getJSONDataByKeyRoute = _this$props.getJSONDataByKeyRoute;
8548
+ schemaStore = _this$props.schemaStore,
8549
+ jsonStore = _this$props.jsonStore;
8550
+ var _ref = schemaStore || {},
8551
+ pageScreen = _ref.pageScreen;
8552
+ var _ref2 = jsonStore || {},
8553
+ getJSONDataByKeyRoute = _ref2.getJSONDataByKeyRoute,
8554
+ dynamicDataApiScopeList = _ref2.dynamicDataApiScopeList,
8555
+ dynamicDataList = _ref2.dynamicDataList,
8556
+ dynamicDataObj = _ref2.dynamicDataObj;
8557
+ var _this$props2 = this.props,
8558
+ curConfigData = _this$props2.curConfigData,
8559
+ nodeKey = _this$props2.nodeKey,
8560
+ keyRoute = _this$props2.keyRoute;
8636
8561
  // 从jsonData中获取对应的数值
8637
8562
  var curJsonData = getJSONDataByKeyRoute(keyRoute) || {};
8638
8563
  var dataName = curConfigData.dataName; // 数据源名称
@@ -8892,13 +8817,8 @@
8892
8817
  /* harmony default export */ __webpack_exports__['default'] = (0,
8893
8818
  mobx_react__WEBPACK_IMPORTED_MODULE_2__.inject)(function (stores) {
8894
8819
  return {
8895
- pageScreen: stores.JSONSchemaStore.pageScreen,
8896
- dynamicDataList: stores.JSONEditorStore.dynamicDataList,
8897
- dynamicDataObj: stores.JSONEditorStore.dynamicDataObj,
8898
- dynamicDataApiScopeList:
8899
- stores.JSONEditorStore.dynamicDataApiScopeList,
8900
- getJSONDataByKeyRoute:
8901
- stores.JSONEditorStore.getJSONDataByKeyRoute,
8820
+ schemaStore: stores.JSONSchemaStore,
8821
+ jsonStore: stores.JSONEditorStore,
8902
8822
  };
8903
8823
  })(
8904
8824
  (0, mobx_react__WEBPACK_IMPORTED_MODULE_2__.observer)(
@@ -8993,7 +8913,9 @@
8993
8913
  _this.handleValueChange = function (value) {
8994
8914
  var _this$props = _this.props,
8995
8915
  keyRoute = _this$props.keyRoute,
8996
- updateFormValueData = _this$props.updateFormValueData;
8916
+ jsonStore = _this$props.jsonStore;
8917
+ var _ref = jsonStore || {},
8918
+ updateFormValueData = _ref.updateFormValueData;
8997
8919
  updateFormValueData(keyRoute, value); // 更新数值
8998
8920
  };
8999
8921
  _this.handleValueChange = _this.handleValueChange.bind(_this);
@@ -9022,12 +8944,17 @@
9022
8944
  };
9023
8945
  _proto.render = function render() {
9024
8946
  var _this$props2 = this.props,
9025
- nodeKey = _this$props2.nodeKey,
9026
- jsonKey = _this$props2.jsonKey,
9027
- keyRoute = _this$props2.keyRoute,
9028
- targetJsonSchema = _this$props2.targetJsonSchema,
9029
- pageScreen = _this$props2.pageScreen,
9030
- getJSONDataByKeyRoute = _this$props2.getJSONDataByKeyRoute;
8947
+ schemaStore = _this$props2.schemaStore,
8948
+ jsonStore = _this$props2.jsonStore;
8949
+ var _ref2 = schemaStore || {},
8950
+ pageScreen = _ref2.pageScreen;
8951
+ var _ref3 = jsonStore || {},
8952
+ getJSONDataByKeyRoute = _ref3.getJSONDataByKeyRoute;
8953
+ var _this$props3 = this.props,
8954
+ nodeKey = _this$props3.nodeKey,
8955
+ jsonKey = _this$props3.jsonKey,
8956
+ keyRoute = _this$props3.keyRoute,
8957
+ targetJsonSchema = _this$props3.targetJsonSchema;
9031
8958
  // 从jsonData中获取对应的数值
9032
8959
  var curJsonData = getJSONDataByKeyRoute(keyRoute);
9033
8960
  var options = targetJsonSchema.options;
@@ -9165,12 +9092,8 @@
9165
9092
  /* harmony default export */ __webpack_exports__['default'] = (0,
9166
9093
  mobx_react__WEBPACK_IMPORTED_MODULE_2__.inject)(function (stores) {
9167
9094
  return {
9168
- pageScreen: stores.JSONSchemaStore.pageScreen,
9169
- getJSONDataByKeyRoute:
9170
- stores.JSONEditorStore.getJSONDataByKeyRoute,
9171
- updateFormValueData: stores.JSONEditorStore.updateFormValueData,
9172
- getInitJsonDataByKeyRoute:
9173
- stores.JSONEditorStore.getInitJsonDataByKeyRoute,
9095
+ schemaStore: stores.JSONSchemaStore,
9096
+ jsonStore: stores.JSONEditorStore,
9174
9097
  };
9175
9098
  })(
9176
9099
  (0, mobx_react__WEBPACK_IMPORTED_MODULE_2__.observer)(SelectSchema),
@@ -9242,6 +9165,10 @@
9242
9165
  );
9243
9166
  /* harmony import */ var $mixins_index__WEBPACK_IMPORTED_MODULE_8__ =
9244
9167
  __webpack_require__(/*! $mixins/index */ './src/mixins/index.js');
9168
+ /* harmony import */ var $utils_webCache__WEBPACK_IMPORTED_MODULE_9__ =
9169
+ __webpack_require__(
9170
+ /*! $utils/webCache */ './src/utils/webCache.js',
9171
+ );
9245
9172
 
9246
9173
  var Panel = antd__WEBPACK_IMPORTED_MODULE_5__.Collapse.Panel;
9247
9174
 
@@ -9256,6 +9183,7 @@
9256
9183
  // 是否显示code模式
9257
9184
  isClosed: false, // 是否为关闭状态,默认是开启状态
9258
9185
  };
9186
+ _this.collapseChange = _this.collapseChange.bind(_this);
9259
9187
  return _this;
9260
9188
  }
9261
9189
  _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_0___default()(
@@ -9279,17 +9207,42 @@
9279
9207
  );
9280
9208
  }
9281
9209
  };
9210
+ _proto.collapseChange = function collapseChange(collapseData) {
9211
+ var keyRoute = this.props.keyRoute;
9212
+ // 缓存当前折叠状态
9213
+ (0,
9214
+ $utils_webCache__WEBPACK_IMPORTED_MODULE_9__.saveJSONEditorCache)(
9215
+ keyRoute,
9216
+ collapseData,
9217
+ );
9218
+ };
9282
9219
  _proto.render = function render() {
9283
9220
  var _this$props = this.props,
9284
- indexRoute = _this$props.indexRoute,
9285
- jsonKey = _this$props.jsonKey,
9286
- nodeKey = _this$props.nodeKey,
9287
- keyRoute = _this$props.keyRoute,
9288
- pageScreen = _this$props.pageScreen,
9289
- targetJsonSchema = _this$props.targetJsonSchema,
9290
- getJSONDataByKeyRoute = _this$props.getJSONDataByKeyRoute,
9291
- keyRoute2indexRoute = _this$props.keyRoute2indexRoute,
9292
- updateFormValueData = _this$props.updateFormValueData;
9221
+ schemaStore = _this$props.schemaStore,
9222
+ jsonStore = _this$props.jsonStore;
9223
+ var _ref = schemaStore || {},
9224
+ pageScreen = _ref.pageScreen;
9225
+ // const { getJSONDataByKeyRoute } = jsonStore || {};
9226
+ var _this$props2 = this.props,
9227
+ indexRoute = _this$props2.indexRoute,
9228
+ jsonKey = _this$props2.jsonKey,
9229
+ nodeKey = _this$props2.nodeKey,
9230
+ keyRoute = _this$props2.keyRoute,
9231
+ targetJsonSchema = _this$props2.targetJsonSchema;
9232
+ // 获取前端缓存中的折叠数据
9233
+ var collapseData = ['mainConfig'];
9234
+ var collapseCacheData = (0,
9235
+ $utils_webCache__WEBPACK_IMPORTED_MODULE_9__.getJSONEditorCache)(
9236
+ keyRoute,
9237
+ );
9238
+ if (
9239
+ collapseCacheData &&
9240
+ (0, _wibetter_json_utils__WEBPACK_IMPORTED_MODULE_6__.isArray)(
9241
+ collapseCacheData,
9242
+ )
9243
+ ) {
9244
+ collapseData = collapseCacheData;
9245
+ }
9293
9246
  return /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
9294
9247
  'div',
9295
9248
  {
@@ -9298,7 +9251,7 @@
9298
9251
  (pageScreen === 'wideScreen'
9299
9252
  ? 'wide-screen-element-warp'
9300
9253
  : 'mobile-screen-element-warp'),
9301
- key: nodeKey,
9254
+ // key={nodeKey}
9302
9255
  id: nodeKey,
9303
9256
  },
9304
9257
  /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
@@ -9348,93 +9301,13 @@
9348
9301
  /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
9349
9302
  antd__WEBPACK_IMPORTED_MODULE_5__.Collapse,
9350
9303
  {
9351
- defaultActiveKey: ['mainConfig'],
9304
+ defaultActiveKey: collapseData,
9352
9305
  expandIconPosition: 'right',
9353
9306
  bordered: false,
9354
9307
  accordion: true,
9308
+ onChange: this.collapseChange,
9355
9309
  },
9356
- targetJsonSchema.properties['mainConfig'] &&
9357
- /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
9358
- Panel,
9359
- {
9360
- header:
9361
- targetJsonSchema.properties['mainConfig'].title,
9362
- key: 'mainConfig',
9363
- },
9364
- targetJsonSchema.properties[
9365
- 'mainConfig'
9366
- ].propertyOrder.map(function (key, index) {
9367
- /** 1. 获取当前元素的路径值 */
9368
- var currentIndexRoute = indexRoute
9369
- ? indexRoute + '-0-' + index
9370
- : '0-' + index;
9371
- var currentKeyRoute = keyRoute
9372
- ? keyRoute + '-mainConfig-' + key
9373
- : 'mainConfig-' + key; // key路径值,后续用于从jsonData中提取当前元素的数值
9374
- var mainConfigJsonData =
9375
- getJSONDataByKeyRoute(
9376
- keyRoute
9377
- ? keyRoute + '-mainConfig'
9378
- : 'mainConfig',
9379
- ) || {};
9380
- /** 2. 获取当前元素的key值 */
9381
- var currentJsonKey = key;
9382
- /** 3. 获取当前元素的json结构对象 */
9383
- var currentSchemaData = (0,
9384
- mobx__WEBPACK_IMPORTED_MODULE_3__.toJS)(
9385
- targetJsonSchema.properties['mainConfig']
9386
- .properties[currentJsonKey],
9387
- );
9388
- /** 4. 判断是否是容器类型元素,如果是则禁止选中 */
9389
- var curType = currentSchemaData.type;
9390
- /** 5. 获取当前元素的id,用于做唯一标识 */
9391
- var childNodeKey =
9392
- nodeKey + '-' + curType + '-' + currentJsonKey;
9393
- var visibleOn = [
9394
- 'description',
9395
- 'CONTENTID',
9396
- 'CONTENTTYPE',
9397
- ].includes(currentJsonKey)
9398
- ? false
9399
- : true; // 是否显示当前元素
9400
-
9401
- // 补充动态配置类型相关显隐逻辑【定制逻辑】
9402
- if (
9403
- currentJsonKey === 'description' &&
9404
- mainConfigJsonData.type === 'ContentStaticConfig'
9405
- ) {
9406
- // mp后台配置 时显示 description(属性名称)
9407
- visibleOn = true;
9408
- } else if (
9409
- (currentJsonKey === 'CONTENTID' ||
9410
- currentJsonKey === 'CONTENTTYPE') &&
9411
- mainConfigJsonData.type === 'RuntimeDataSelfDefine'
9412
- ) {
9413
- visibleOn = true;
9414
- }
9415
- if (visibleOn) {
9416
- return (0,
9417
- $components_MappingRender__WEBPACK_IMPORTED_MODULE_7__[
9418
- 'default'
9419
- ])({
9420
- parentType: curType,
9421
- jsonKey: currentJsonKey,
9422
- indexRoute: currentIndexRoute,
9423
- keyRoute: currentKeyRoute,
9424
- nodeKey: childNodeKey,
9425
- targetJsonSchema: currentSchemaData,
9426
- isArrayItem: true,
9427
- getJSONDataByKeyRoute: getJSONDataByKeyRoute,
9428
- keyRoute2indexRoute: keyRoute2indexRoute,
9429
- updateFormValueData: updateFormValueData,
9430
- });
9431
- }
9432
- }),
9433
- ),
9434
9310
  targetJsonSchema.propertyOrder.map(function (key, index) {
9435
- if (key === 'mainConfig') {
9436
- return;
9437
- }
9438
9311
  /** 1. 获取当前元素的路径值 */
9439
9312
  var currentIndexRoute = indexRoute
9440
9313
  ? indexRoute + '-' + index
@@ -9475,9 +9348,8 @@
9475
9348
  nodeKey: childNodeKey,
9476
9349
  targetJsonSchema: currentSchemaData,
9477
9350
  isArrayItem: true,
9478
- getJSONDataByKeyRoute: getJSONDataByKeyRoute,
9479
- keyRoute2indexRoute: keyRoute2indexRoute,
9480
- updateFormValueData: updateFormValueData,
9351
+ schemaStore: schemaStore,
9352
+ jsonStore: jsonStore,
9481
9353
  }),
9482
9354
  );
9483
9355
  }
@@ -9505,12 +9377,8 @@
9505
9377
  /* harmony default export */ __webpack_exports__['default'] = (0,
9506
9378
  mobx_react__WEBPACK_IMPORTED_MODULE_2__.inject)(function (stores) {
9507
9379
  return {
9508
- pageScreen: stores.JSONSchemaStore.pageScreen,
9509
- getJSONDataByKeyRoute:
9510
- stores.JSONEditorStore.getJSONDataByKeyRoute,
9511
- updateFormValueData: stores.JSONEditorStore.updateFormValueData,
9512
- getInitJsonDataByKeyRoute:
9513
- stores.JSONEditorStore.getInitJsonDataByKeyRoute,
9380
+ schemaStore: stores.JSONSchemaStore,
9381
+ jsonStore: stores.JSONEditorStore,
9514
9382
  };
9515
9383
  })(
9516
9384
  (0, mobx_react__WEBPACK_IMPORTED_MODULE_2__.observer)(
@@ -9580,13 +9448,17 @@
9580
9448
  );
9581
9449
  /* harmony import */ var $mixins_index__WEBPACK_IMPORTED_MODULE_7__ =
9582
9450
  __webpack_require__(/*! $mixins/index */ './src/mixins/index.js');
9583
- /* harmony import */ var _index_scss__WEBPACK_IMPORTED_MODULE_8__ =
9451
+ /* harmony import */ var $utils_webCache__WEBPACK_IMPORTED_MODULE_8__ =
9452
+ __webpack_require__(
9453
+ /*! $utils/webCache */ './src/utils/webCache.js',
9454
+ );
9455
+ /* harmony import */ var _index_scss__WEBPACK_IMPORTED_MODULE_9__ =
9584
9456
  __webpack_require__(
9585
9457
  /*! ./index.scss */ './src/renderers/SohuEventSchema/index.scss',
9586
9458
  );
9587
- /* harmony import */ var _index_scss__WEBPACK_IMPORTED_MODULE_8___default =
9459
+ /* harmony import */ var _index_scss__WEBPACK_IMPORTED_MODULE_9___default =
9588
9460
  /*#__PURE__*/ __webpack_require__.n(
9589
- _index_scss__WEBPACK_IMPORTED_MODULE_8__,
9461
+ _index_scss__WEBPACK_IMPORTED_MODULE_9__,
9590
9462
  );
9591
9463
 
9592
9464
  var Option = antd__WEBPACK_IMPORTED_MODULE_5__.Select.Option;
@@ -9597,11 +9469,14 @@
9597
9469
  var _this;
9598
9470
  _this = _React$PureComponent.call(this, props) || this;
9599
9471
  _this.handleEventTitleChange = function (eventCode, inputEvent) {
9600
- var newTitle = inputEvent.target.value;
9601
9472
  var _this$props = _this.props,
9602
9473
  keyRoute = _this$props.keyRoute,
9603
- updateFormValueData = _this$props.updateFormValueData,
9604
- getJSONDataByKeyRoute = _this$props.getJSONDataByKeyRoute;
9474
+ jsonStore = _this$props.jsonStore;
9475
+ var _ref = jsonStore || {},
9476
+ updateFormValueData = _ref.updateFormValueData,
9477
+ getJSONDataByKeyRoute = _ref.getJSONDataByKeyRoute,
9478
+ _options = _ref.options;
9479
+ var newTitle = inputEvent.target.value;
9605
9480
  var curJsonData = getJSONDataByKeyRoute(keyRoute) || {};
9606
9481
  var globalEventMap = Object.assign(
9607
9482
  {},
@@ -9619,9 +9494,12 @@
9619
9494
  ) {
9620
9495
  var _this$props2 = _this.props,
9621
9496
  keyRoute = _this$props2.keyRoute,
9622
- updateFormValueData = _this$props2.updateFormValueData,
9623
- getJSONDataByKeyRoute = _this$props2.getJSONDataByKeyRoute;
9624
- var options = _this.props.options || {};
9497
+ jsonStore = _this$props2.jsonStore;
9498
+ var _ref2 = jsonStore || {},
9499
+ updateFormValueData = _ref2.updateFormValueData,
9500
+ getJSONDataByKeyRoute = _ref2.getJSONDataByKeyRoute,
9501
+ _options = _ref2.options;
9502
+ var options = _options || {};
9625
9503
  var curKeyRout = keyRoute + '-event';
9626
9504
  var curJsonData = getJSONDataByKeyRoute(keyRoute) || {};
9627
9505
  var curEvent = [];
@@ -9654,6 +9532,7 @@
9654
9532
  // 是否显示code模式
9655
9533
  isClosed: false, // 是否为关闭状态,默认是开启状态
9656
9534
  };
9535
+ _this.collapseChange = _this.collapseChange.bind(_this);
9657
9536
  return _this;
9658
9537
  }
9659
9538
  _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_0___default()(
@@ -9677,19 +9556,32 @@
9677
9556
  );
9678
9557
  }
9679
9558
  };
9559
+ _proto.collapseChange = function collapseChange(collapseData) {
9560
+ var keyRoute = this.props.keyRoute;
9561
+ // 缓存当前折叠状态
9562
+ (0,
9563
+ $utils_webCache__WEBPACK_IMPORTED_MODULE_8__.saveJSONEditorCache)(
9564
+ keyRoute,
9565
+ collapseData,
9566
+ );
9567
+ };
9680
9568
  _proto.render = function render() {
9681
9569
  var _this2 = this;
9682
9570
  var _this$props3 = this.props,
9683
- indexRoute = _this$props3.indexRoute,
9684
- jsonKey = _this$props3.jsonKey,
9685
- nodeKey = _this$props3.nodeKey,
9686
- keyRoute = _this$props3.keyRoute,
9687
- pageScreen = _this$props3.pageScreen,
9688
- targetJsonSchema = _this$props3.targetJsonSchema,
9689
- getJSONDataByKeyRoute = _this$props3.getJSONDataByKeyRoute,
9690
- keyRoute2indexRoute = _this$props3.keyRoute2indexRoute,
9691
- updateFormValueData = _this$props3.updateFormValueData;
9692
- var options = this.props.options || {};
9571
+ schemaStore = _this$props3.schemaStore,
9572
+ jsonStore = _this$props3.jsonStore;
9573
+ var _ref3 = schemaStore || {},
9574
+ pageScreen = _ref3.pageScreen;
9575
+ var _ref4 = jsonStore || {},
9576
+ getJSONDataByKeyRoute = _ref4.getJSONDataByKeyRoute,
9577
+ _options = _ref4.options;
9578
+ var _this$props4 = this.props,
9579
+ indexRoute = _this$props4.indexRoute,
9580
+ jsonKey = _this$props4.jsonKey,
9581
+ nodeKey = _this$props4.nodeKey,
9582
+ keyRoute = _this$props4.keyRoute,
9583
+ targetJsonSchema = _this$props4.targetJsonSchema;
9584
+ var options = options || {};
9693
9585
  var curJsonData = getJSONDataByKeyRoute(keyRoute);
9694
9586
  var globalEventMap = curJsonData.globalEventMap || {}; // 全局事件列表
9695
9587
  var curEventList = curJsonData.event || []; // 当前组件事件列表
@@ -9703,6 +9595,21 @@
9703
9595
  widgetType !== 'page' &&
9704
9596
  eventEmitConfig.length === 0 &&
9705
9597
  eventListenConfig.length === 0;
9598
+
9599
+ // 获取前端缓存中的折叠数据
9600
+ var collapseData = [];
9601
+ var collapseCacheData = (0,
9602
+ $utils_webCache__WEBPACK_IMPORTED_MODULE_8__.getJSONEditorCache)(
9603
+ keyRoute,
9604
+ );
9605
+ if (
9606
+ collapseCacheData &&
9607
+ (0, _wibetter_json_utils__WEBPACK_IMPORTED_MODULE_6__.isArray)(
9608
+ collapseCacheData,
9609
+ )
9610
+ ) {
9611
+ collapseData = collapseCacheData;
9612
+ }
9706
9613
  return /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
9707
9614
  'div',
9708
9615
  {
@@ -9717,9 +9624,10 @@
9717
9624
  /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
9718
9625
  antd__WEBPACK_IMPORTED_MODULE_5__.Collapse,
9719
9626
  {
9720
- defaultActiveKey: ['mainConfig'],
9627
+ defaultActiveKey: collapseData,
9721
9628
  expandIconPosition: 'right',
9722
9629
  bordered: false,
9630
+ onChange: this.collapseChange,
9723
9631
  // accordion
9724
9632
  },
9725
9633
  eventListenConfig &&
@@ -9969,13 +9877,8 @@
9969
9877
  /* harmony default export */ __webpack_exports__['default'] = (0,
9970
9878
  mobx_react__WEBPACK_IMPORTED_MODULE_2__.inject)(function (stores) {
9971
9879
  return {
9972
- pageScreen: stores.JSONSchemaStore.pageScreen,
9973
- options: stores.JSONEditorStore.options,
9974
- getJSONDataByKeyRoute:
9975
- stores.JSONEditorStore.getJSONDataByKeyRoute,
9976
- updateFormValueData: stores.JSONEditorStore.updateFormValueData,
9977
- getInitJsonDataByKeyRoute:
9978
- stores.JSONEditorStore.getInitJsonDataByKeyRoute,
9880
+ schemaStore: stores.JSONSchemaStore,
9881
+ jsonStore: stores.JSONEditorStore,
9979
9882
  };
9980
9883
  })(
9981
9884
  (0, mobx_react__WEBPACK_IMPORTED_MODULE_2__.observer)(
@@ -10057,10 +9960,12 @@
10057
9960
  // 这边绑定是必要的,这样 `this` 才能在回调函数中使用
10058
9961
  /** 数值变动事件处理器 */
10059
9962
  _this.handleValueChange = function (event) {
10060
- var value = event.target.value;
10061
9963
  var _this$props = _this.props,
10062
9964
  keyRoute = _this$props.keyRoute,
10063
- updateFormValueData = _this$props.updateFormValueData;
9965
+ jsonStore = _this$props.jsonStore;
9966
+ var _ref = jsonStore || {},
9967
+ updateFormValueData = _ref.updateFormValueData;
9968
+ var value = event.target.value;
10064
9969
  updateFormValueData(keyRoute, value); // 更新数值
10065
9970
  };
10066
9971
  _this.handleValueChange = _this.handleValueChange.bind(_this);
@@ -10089,12 +9994,17 @@
10089
9994
  };
10090
9995
  _proto.render = function render() {
10091
9996
  var _this$props2 = this.props,
10092
- keyRoute = _this$props2.keyRoute,
10093
- jsonKey = _this$props2.jsonKey,
10094
- nodeKey = _this$props2.nodeKey,
10095
- targetJsonSchema = _this$props2.targetJsonSchema,
10096
- pageScreen = _this$props2.pageScreen,
10097
- getJSONDataByKeyRoute = _this$props2.getJSONDataByKeyRoute;
9997
+ schemaStore = _this$props2.schemaStore,
9998
+ jsonStore = _this$props2.jsonStore;
9999
+ var _ref2 = schemaStore || {},
10000
+ pageScreen = _ref2.pageScreen;
10001
+ var _ref3 = jsonStore || {},
10002
+ getJSONDataByKeyRoute = _ref3.getJSONDataByKeyRoute;
10003
+ var _this$props3 = this.props,
10004
+ keyRoute = _this$props3.keyRoute,
10005
+ jsonKey = _this$props3.jsonKey,
10006
+ nodeKey = _this$props3.nodeKey,
10007
+ targetJsonSchema = _this$props3.targetJsonSchema;
10098
10008
  // 从jsonData中获取对应的数值
10099
10009
  var curJsonData = getJSONDataByKeyRoute(keyRoute);
10100
10010
  var readOnly = targetJsonSchema.readOnly || false; // 是否只读(默认可编辑)
@@ -10222,12 +10132,8 @@
10222
10132
  /* harmony default export */ __webpack_exports__['default'] = (0,
10223
10133
  mobx_react__WEBPACK_IMPORTED_MODULE_2__.inject)(function (stores) {
10224
10134
  return {
10225
- pageScreen: stores.JSONSchemaStore.pageScreen,
10226
- getJSONDataByKeyRoute:
10227
- stores.JSONEditorStore.getJSONDataByKeyRoute,
10228
- updateFormValueData: stores.JSONEditorStore.updateFormValueData,
10229
- getInitJsonDataByKeyRoute:
10230
- stores.JSONEditorStore.getInitJsonDataByKeyRoute,
10135
+ schemaStore: stores.JSONSchemaStore,
10136
+ jsonStore: stores.JSONEditorStore,
10231
10137
  };
10232
10138
  })(
10233
10139
  (0, mobx_react__WEBPACK_IMPORTED_MODULE_2__.observer)(
@@ -10396,7 +10302,9 @@
10396
10302
  _this.handleEditorChange = function (editorState) {
10397
10303
  var _this$props = _this.props,
10398
10304
  keyRoute = _this$props.keyRoute,
10399
- updateFormValueData = _this$props.updateFormValueData;
10305
+ jsonStore = _this$props.jsonStore;
10306
+ var _ref = jsonStore || {},
10307
+ updateFormValueData = _ref.updateFormValueData;
10400
10308
  updateFormValueData(keyRoute, editorState.toHTML()); // 更新数值
10401
10309
  };
10402
10310
  _this.state = {
@@ -10458,14 +10366,13 @@
10458
10366
  );
10459
10367
  var _proto = TextEditorSchema.prototype;
10460
10368
  _proto.componentWillMount = function componentWillMount() {
10369
+ var _ref2 = this.props.schemaStore || {},
10370
+ pageScreen = _ref2.pageScreen;
10461
10371
  // 从web缓存中获取数值
10462
10372
  $mixins_index__WEBPACK_IMPORTED_MODULE_6__.catchJsonDataByWebCache.call(
10463
10373
  this,
10464
10374
  );
10465
- if (
10466
- this.props.pageScreen &&
10467
- this.props.pageScreen === 'wideScreen'
10468
- ) {
10375
+ if (pageScreen && pageScreen === 'wideScreen') {
10469
10376
  // 大屏幕时默认展开富文本编辑器
10470
10377
  this.setState({
10471
10378
  isClosed: false,
@@ -10480,10 +10387,13 @@
10480
10387
  this,
10481
10388
  nextProps.keyRoute,
10482
10389
  );
10483
- } else if (nextProps.pageScreen !== this.props.pageScreen) {
10390
+ } else if (
10391
+ nextProps.schemaStore.pageScreen !==
10392
+ this.props.schemaStore.pageScreen
10393
+ ) {
10484
10394
  if (
10485
- nextProps.pageScreen &&
10486
- nextProps.pageScreen === 'wideScreen'
10395
+ nextProps.schemaStore.pageScreen &&
10396
+ nextProps.schemaStore.pageScreen === 'wideScreen'
10487
10397
  ) {
10488
10398
  // 大屏幕时默认展开富文本编辑器
10489
10399
  this.setState({
@@ -10495,12 +10405,17 @@
10495
10405
  _proto.render = function render() {
10496
10406
  var _this2 = this;
10497
10407
  var _this$props2 = this.props,
10498
- keyRoute = _this$props2.keyRoute,
10499
- jsonKey = _this$props2.jsonKey,
10500
- nodeKey = _this$props2.nodeKey,
10501
- targetJsonSchema = _this$props2.targetJsonSchema,
10502
- pageScreen = _this$props2.pageScreen,
10503
- getJSONDataByKeyRoute = _this$props2.getJSONDataByKeyRoute;
10408
+ schemaStore = _this$props2.schemaStore,
10409
+ jsonStore = _this$props2.jsonStore;
10410
+ var _ref3 = schemaStore || {},
10411
+ pageScreen = _ref3.pageScreen;
10412
+ var _ref4 = jsonStore || {},
10413
+ getJSONDataByKeyRoute = _ref4.getJSONDataByKeyRoute;
10414
+ var _this$props3 = this.props,
10415
+ keyRoute = _this$props3.keyRoute,
10416
+ jsonKey = _this$props3.jsonKey,
10417
+ nodeKey = _this$props3.nodeKey,
10418
+ targetJsonSchema = _this$props3.targetJsonSchema;
10504
10419
  var isClosed = this.state.isClosed;
10505
10420
  var curJsonData = getJSONDataByKeyRoute(keyRoute); // 从jsonData中获取对应的html内容
10506
10421
  var editorState =
@@ -10652,12 +10567,8 @@
10652
10567
  /* harmony default export */ __webpack_exports__['default'] = (0,
10653
10568
  mobx_react__WEBPACK_IMPORTED_MODULE_2__.inject)(function (stores) {
10654
10569
  return {
10655
- pageScreen: stores.JSONSchemaStore.pageScreen,
10656
- getJSONDataByKeyRoute:
10657
- stores.JSONEditorStore.getJSONDataByKeyRoute,
10658
- updateFormValueData: stores.JSONEditorStore.updateFormValueData,
10659
- getInitJsonDataByKeyRoute:
10660
- stores.JSONEditorStore.getInitJsonDataByKeyRoute,
10570
+ schemaStore: stores.JSONSchemaStore,
10571
+ jsonStore: stores.JSONEditorStore,
10661
10572
  };
10662
10573
  })(
10663
10574
  (0, mobx_react__WEBPACK_IMPORTED_MODULE_2__.observer)(
@@ -10739,7 +10650,9 @@
10739
10650
  _this.handleValueChange = function (event, dateString) {
10740
10651
  var _this$props = _this.props,
10741
10652
  keyRoute = _this$props.keyRoute,
10742
- updateFormValueData = _this$props.updateFormValueData;
10653
+ jsonStore = _this$props.jsonStore;
10654
+ var _ref = jsonStore || {},
10655
+ updateFormValueData = _ref.updateFormValueData;
10743
10656
  updateFormValueData(keyRoute, dateString); // 更新数值
10744
10657
  };
10745
10658
  _this.handleValueChange = _this.handleValueChange.bind(_this);
@@ -10768,12 +10681,17 @@
10768
10681
  };
10769
10682
  _proto.render = function render() {
10770
10683
  var _this$props2 = this.props,
10771
- nodeKey = _this$props2.nodeKey,
10772
- jsonKey = _this$props2.jsonKey,
10773
- keyRoute = _this$props2.keyRoute,
10774
- targetJsonSchema = _this$props2.targetJsonSchema,
10775
- pageScreen = _this$props2.pageScreen,
10776
- getJSONDataByKeyRoute = _this$props2.getJSONDataByKeyRoute;
10684
+ schemaStore = _this$props2.schemaStore,
10685
+ jsonStore = _this$props2.jsonStore;
10686
+ var _ref2 = schemaStore || {},
10687
+ pageScreen = _ref2.pageScreen;
10688
+ var _ref3 = jsonStore || {},
10689
+ getJSONDataByKeyRoute = _ref3.getJSONDataByKeyRoute;
10690
+ var _this$props3 = this.props,
10691
+ nodeKey = _this$props3.nodeKey,
10692
+ jsonKey = _this$props3.jsonKey,
10693
+ keyRoute = _this$props3.keyRoute,
10694
+ targetJsonSchema = _this$props3.targetJsonSchema;
10777
10695
  // 从jsonData中获取对应的数值
10778
10696
  var curJsonData = getJSONDataByKeyRoute(keyRoute);
10779
10697
  var defaultTime = curJsonData || targetJsonSchema.default;
@@ -10891,12 +10809,8 @@
10891
10809
  /* harmony default export */ __webpack_exports__['default'] = (0,
10892
10810
  mobx_react__WEBPACK_IMPORTED_MODULE_2__.inject)(function (stores) {
10893
10811
  return {
10894
- pageScreen: stores.JSONSchemaStore.pageScreen,
10895
- getJSONDataByKeyRoute:
10896
- stores.JSONEditorStore.getJSONDataByKeyRoute,
10897
- updateFormValueData: stores.JSONEditorStore.updateFormValueData,
10898
- getInitJsonDataByKeyRoute:
10899
- stores.JSONEditorStore.getInitJsonDataByKeyRoute,
10812
+ schemaStore: stores.JSONSchemaStore,
10813
+ jsonStore: stores.JSONEditorStore,
10900
10814
  };
10901
10815
  })(
10902
10816
  (0, mobx_react__WEBPACK_IMPORTED_MODULE_2__.observer)(
@@ -10972,11 +10886,17 @@
10972
10886
  var _proto = TreeSelectFromSchema.prototype;
10973
10887
  _proto.render = function render() {
10974
10888
  var _this$props = this.props,
10975
- pageScreen = _this$props.pageScreen,
10976
- mockData = _this$props.mockData,
10977
- dataRoute = _this$props.dataRoute,
10978
- nodeKey = _this$props.nodeKey,
10979
- onChange = _this$props.onChange;
10889
+ schemaStore = _this$props.schemaStore,
10890
+ jsonStore = _this$props.jsonStore;
10891
+ var _ref = schemaStore || {},
10892
+ pageScreen = _ref.pageScreen;
10893
+ var _ref2 = jsonStore || {},
10894
+ getJSONDataByKeyRoute = _ref2.getJSONDataByKeyRoute;
10895
+ var _this$props2 = this.props,
10896
+ mockData = _this$props2.mockData,
10897
+ dataRoute = _this$props2.dataRoute,
10898
+ nodeKey = _this$props2.nodeKey,
10899
+ onChange = _this$props2.onChange;
10980
10900
  var treeData = [];
10981
10901
  if (mockData && JSON.stringify(mockData) !== '{}') {
10982
10902
  var mockObj = mockData;
@@ -11046,7 +10966,6 @@
11046
10966
  return TreeSelectFromSchema;
11047
10967
  })(react__WEBPACK_IMPORTED_MODULE_1__.PureComponent);
11048
10968
  TreeSelectFromSchema.propTypes = {
11049
- pageScreen: prop_types__WEBPACK_IMPORTED_MODULE_3___default().any,
11050
10969
  mockData: prop_types__WEBPACK_IMPORTED_MODULE_3___default().any,
11051
10970
  // 接口mock数据
11052
10971
  dataRoute: prop_types__WEBPACK_IMPORTED_MODULE_3___default().any,
@@ -11058,7 +10977,7 @@
11058
10977
  /* harmony default export */ __webpack_exports__['default'] = (0,
11059
10978
  mobx_react__WEBPACK_IMPORTED_MODULE_2__.inject)(function (stores) {
11060
10979
  return {
11061
- pageScreen: stores.JSONSchemaStore.pageScreen,
10980
+ schemaStore: stores.JSONSchemaStore,
11062
10981
  };
11063
10982
  })(
11064
10983
  (0, mobx_react__WEBPACK_IMPORTED_MODULE_2__.observer)(
@@ -11136,10 +11055,12 @@
11136
11055
  // 这边绑定是必要的,这样 `this` 才能在回调函数中使用
11137
11056
  /** 数值变动事件处理器 */
11138
11057
  _this.handleValueChange = function (event) {
11139
- var value = event.target.value;
11140
11058
  var _this$props = _this.props,
11141
11059
  keyRoute = _this$props.keyRoute,
11142
- updateFormValueData = _this$props.updateFormValueData;
11060
+ jsonStore = _this$props.jsonStore;
11061
+ var _ref = jsonStore || {},
11062
+ updateFormValueData = _ref.updateFormValueData;
11063
+ var value = event.target.value;
11143
11064
  updateFormValueData(keyRoute, value); // 更新数值
11144
11065
  };
11145
11066
  _this.handleValueChange = _this.handleValueChange.bind(_this);
@@ -11168,12 +11089,17 @@
11168
11089
  };
11169
11090
  _proto.render = function render() {
11170
11091
  var _this$props2 = this.props,
11171
- keyRoute = _this$props2.keyRoute,
11172
- jsonKey = _this$props2.jsonKey,
11173
- nodeKey = _this$props2.nodeKey,
11174
- targetJsonSchema = _this$props2.targetJsonSchema,
11175
- pageScreen = _this$props2.pageScreen,
11176
- getJSONDataByKeyRoute = _this$props2.getJSONDataByKeyRoute;
11092
+ schemaStore = _this$props2.schemaStore,
11093
+ jsonStore = _this$props2.jsonStore;
11094
+ var _ref2 = schemaStore || {},
11095
+ pageScreen = _ref2.pageScreen;
11096
+ var _ref3 = jsonStore || {},
11097
+ getJSONDataByKeyRoute = _ref3.getJSONDataByKeyRoute;
11098
+ var _this$props3 = this.props,
11099
+ keyRoute = _this$props3.keyRoute,
11100
+ jsonKey = _this$props3.jsonKey,
11101
+ nodeKey = _this$props3.nodeKey,
11102
+ targetJsonSchema = _this$props3.targetJsonSchema;
11177
11103
  // 从jsonData中获取对应的数值
11178
11104
  var curJsonData = getJSONDataByKeyRoute(keyRoute);
11179
11105
  var readOnly = targetJsonSchema.readOnly || false; // 是否只读(默认可编辑)
@@ -11300,12 +11226,8 @@
11300
11226
  /* harmony default export */ __webpack_exports__['default'] = (0,
11301
11227
  mobx_react__WEBPACK_IMPORTED_MODULE_2__.inject)(function (stores) {
11302
11228
  return {
11303
- pageScreen: stores.JSONSchemaStore.pageScreen,
11304
- getJSONDataByKeyRoute:
11305
- stores.JSONEditorStore.getJSONDataByKeyRoute,
11306
- updateFormValueData: stores.JSONEditorStore.updateFormValueData,
11307
- getInitJsonDataByKeyRoute:
11308
- stores.JSONEditorStore.getInitJsonDataByKeyRoute,
11229
+ schemaStore: stores.JSONSchemaStore,
11230
+ jsonStore: stores.JSONEditorStore,
11309
11231
  };
11310
11232
  })(
11311
11233
  (0, mobx_react__WEBPACK_IMPORTED_MODULE_2__.observer)(
@@ -11666,7 +11588,6 @@
11666
11588
  newVal,
11667
11589
  ignoreChange,
11668
11590
  ) {
11669
- var _this = this;
11670
11591
  if (keyRoute !== '') {
11671
11592
  // 1. 获取父级key路径和最近的有一个key
11672
11593
  var parentKeyRoute_CurKey = (0,
@@ -11687,14 +11608,7 @@
11687
11608
  // 当keyRoute为空时直接修改当前schemaData
11688
11609
  this.jsonData = newVal;
11689
11610
  }
11690
- if (
11691
- this.state.rootJSONStore.JSONSchemaStore &&
11692
- this.state.rootJSONStore.JSONSchemaStore.jsonSchema
11693
- ) {
11694
- // 获取当前schema的条件字段
11695
- var curJsonSchema =
11696
- this.state.rootJSONStore.JSONSchemaStore.jsonSchema;
11697
- var conditionProps = curJsonSchema.conditionProps;
11611
+ if (this.state.rootJSONStore.JSONSchemaStore) {
11698
11612
  // 备注:数组类型通过keyRoute获取schema对象会有异常
11699
11613
  var curElemSchema =
11700
11614
  this.state.rootJSONStore.JSONSchemaStore.getSchemaByKeyRoute(
@@ -11703,15 +11617,7 @@
11703
11617
  if (curElemSchema && curElemSchema.isConditionProp) {
11704
11618
  // 判断条件字段的快捷通道:如果是条件字段则更新LastInitTime
11705
11619
  this.updateLastTime();
11706
- } else if (conditionProps) {
11707
- // 判断当前字段是否为条件字段
11708
- Object.keys(conditionProps).map(function (propKey) {
11709
- var conditionItem = conditionProps[propKey];
11710
- if (conditionItem.keyRoute === keyRoute) {
11711
- // 更新LastInitTime
11712
- _this.updateLastTime();
11713
- }
11714
- });
11620
+ // this.triggerChangeAction(); // 用于主动触发组件更新
11715
11621
  }
11716
11622
  }
11717
11623
  if (!ignoreChange) {
@@ -12695,15 +12601,35 @@
12695
12601
  },
12696
12602
  /* harmony export */
12697
12603
  });
12604
+ /* harmony import */ var _wibetter_json_utils__WEBPACK_IMPORTED_MODULE_0__ =
12605
+ __webpack_require__(
12606
+ /*! @wibetter/json-utils */ '@wibetter/json-utils',
12607
+ );
12608
+ /* harmony import */ var _wibetter_json_utils__WEBPACK_IMPORTED_MODULE_0___default =
12609
+ /*#__PURE__*/ __webpack_require__.n(
12610
+ _wibetter_json_utils__WEBPACK_IMPORTED_MODULE_0__,
12611
+ );
12612
+ /* harmony import */ var _webCache_js__WEBPACK_IMPORTED_MODULE_1__ =
12613
+ __webpack_require__(/*! ./webCache.js */ './src/utils/webCache.js');
12614
+
12698
12615
  /** js对象数据深拷贝,避免数据联动 */
12699
12616
  function objClone(targetObj) {
12700
- var newObj = JSON.stringify(targetObj);
12701
- return JSON.parse(newObj);
12617
+ // const newObj = JSON.stringify(targetObj);
12618
+ // return JSON.parse(newObj);
12619
+ return (0,
12620
+ _wibetter_json_utils__WEBPACK_IMPORTED_MODULE_0__.objClone)(
12621
+ targetObj,
12622
+ );
12702
12623
  }
12703
12624
 
12704
12625
  /** 对比两个json数据是否相等 */
12705
12626
  function isEqual(targetObj, nextTargetObj) {
12706
- return JSON.stringify(targetObj) === JSON.stringify(nextTargetObj);
12627
+ // return JSON.stringify(targetObj) === JSON.stringify(nextTargetObj);
12628
+ return (0,
12629
+ _wibetter_json_utils__WEBPACK_IMPORTED_MODULE_0__.isEqual)(
12630
+ targetObj,
12631
+ nextTargetObj,
12632
+ );
12707
12633
  }
12708
12634
 
12709
12635
  /** 判断当前属性是否存在
@@ -12837,29 +12763,35 @@
12837
12763
 
12838
12764
  /**
12839
12765
  * 将数据缓存到sessionStorage中
12840
- * */
12841
- function saveWebCacheData(cacheKey, targetSourceIndex) {
12842
- if (window.sessionStorage) {
12843
- window.sessionStorage.setItem(cacheKey, targetSourceIndex);
12844
- }
12766
+ */
12767
+ function saveWebCacheData(valueKey, value) {
12768
+ (0, _webCache_js__WEBPACK_IMPORTED_MODULE_1__.saveJSONEditorCache)(
12769
+ valueKey,
12770
+ value,
12771
+ 'json-editor-formData',
12772
+ );
12845
12773
  }
12846
12774
 
12847
12775
  /**
12848
12776
  * 从sessionStorage中读取此前缓存的数据
12849
- * */
12850
- function getWebCacheData(cacheKey) {
12851
- if (window.sessionStorage) {
12852
- return window.sessionStorage.getItem(cacheKey);
12853
- }
12777
+ */
12778
+ function getWebCacheData(valueKey) {
12779
+ return (0,
12780
+ _webCache_js__WEBPACK_IMPORTED_MODULE_1__.getJSONEditorCache)(
12781
+ valueKey,
12782
+ 'json-editor-formData',
12783
+ );
12854
12784
  }
12855
12785
 
12856
12786
  /**
12857
12787
  * 从sessionStorage中删除此前缓存的数据
12858
- * */
12859
- function deleteWebCacheData(cacheKey) {
12860
- if (window.sessionStorage) {
12861
- return window.sessionStorage.removeItem(cacheKey);
12862
- }
12788
+ */
12789
+ function deleteWebCacheData(valueKey) {
12790
+ (0,
12791
+ _webCache_js__WEBPACK_IMPORTED_MODULE_1__.deleteJSONEditorCache)(
12792
+ valueKey,
12793
+ 'json-editor-formData',
12794
+ );
12863
12795
  }
12864
12796
 
12865
12797
  /***/
@@ -13050,6 +12982,95 @@
13050
12982
  /***/
13051
12983
  },
13052
12984
 
12985
+ /***/ './src/utils/webCache.js':
12986
+ /*!*******************************!*\
12987
+ !*** ./src/utils/webCache.js ***!
12988
+ \*******************************/
12989
+ /***/ function (
12990
+ __unused_webpack_module,
12991
+ __webpack_exports__,
12992
+ __webpack_require__,
12993
+ ) {
12994
+ 'use strict';
12995
+ __webpack_require__.r(__webpack_exports__);
12996
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12997
+ /* harmony export */ deleteJSONEditorCache: function () {
12998
+ return /* binding */ deleteJSONEditorCache;
12999
+ },
13000
+ /* harmony export */ getJSONEditorCache: function () {
13001
+ return /* binding */ getJSONEditorCache;
13002
+ },
13003
+ /* harmony export */ saveJSONEditorCache: function () {
13004
+ return /* binding */ saveJSONEditorCache;
13005
+ },
13006
+ /* harmony export */
13007
+ });
13008
+ /**
13009
+ * 将数据缓存到sessionStorage中
13010
+ * */
13011
+ function saveJSONEditorCache(key, value, cacheMark) {
13012
+ if (cacheMark === void 0) {
13013
+ cacheMark = 'json-editor-cache';
13014
+ }
13015
+ if (window.sessionStorage) {
13016
+ var cacheData = {};
13017
+ var cacheDataStr = window.sessionStorage.getItem(cacheMark);
13018
+ if (cacheDataStr) {
13019
+ cacheData = JSON.parse(cacheDataStr);
13020
+ }
13021
+ if (key) {
13022
+ cacheData[key] = value;
13023
+ }
13024
+ window.sessionStorage.setItem(
13025
+ cacheMark,
13026
+ JSON.stringify(cacheData),
13027
+ );
13028
+ }
13029
+ }
13030
+
13031
+ /**
13032
+ * 从sessionStorage中读取此前缓存的数据
13033
+ * */
13034
+ function getJSONEditorCache(valueKey, cacheMark) {
13035
+ if (cacheMark === void 0) {
13036
+ cacheMark = 'json-editor-cache';
13037
+ }
13038
+ var curKeyValue;
13039
+ if (window.sessionStorage) {
13040
+ var cacheData = {};
13041
+ var cacheDataStr = window.sessionStorage.getItem(cacheMark);
13042
+ if (cacheDataStr) {
13043
+ cacheData = JSON.parse(cacheDataStr);
13044
+ }
13045
+ if (valueKey) {
13046
+ curKeyValue = cacheData[valueKey];
13047
+ }
13048
+ }
13049
+ return curKeyValue;
13050
+ }
13051
+
13052
+ /**
13053
+ * 从sessionStorage中删除此前缓存的数据
13054
+ * */
13055
+ function deleteJSONEditorCache(valueKey, cacheMark) {
13056
+ if (cacheMark === void 0) {
13057
+ cacheMark = 'json-editor-cache';
13058
+ }
13059
+ if (window.sessionStorage) {
13060
+ var cacheData = {};
13061
+ var cacheDataStr = window.sessionStorage.getItem(cacheMark);
13062
+ if (cacheDataStr) {
13063
+ cacheData = JSON.parse(cacheDataStr);
13064
+ }
13065
+ if (valueKey) {
13066
+ cacheData[valueKey] = undefined;
13067
+ }
13068
+ }
13069
+ }
13070
+
13071
+ /***/
13072
+ },
13073
+
13053
13074
  /***/ '../../node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-11.use[1]!../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[4]!../../node_modules/sass-resources-loader/lib/loader.js??clonedRuleSet-11.use[5]!./src/components/JSONDataEditor/index.scss':
13054
13075
  /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
13055
13076
  !*** ../../node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-11.use[1]!../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[4]!../../node_modules/sass-resources-loader/lib/loader.js??clonedRuleSet-11.use[5]!./src/components/JSONDataEditor/index.scss ***!