@fonixtree/magic-design 0.0.62 → 0.0.64

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.
Files changed (39) hide show
  1. package/es/common/Collapse/index.js +8 -13
  2. package/es/composite-comp/bol/components/ImageText/mobile/index.js +1 -2
  3. package/es/composite-comp/bol/components/ImageText/mobile/index.less +8 -8
  4. package/es/composite-comp/bol/components/ImageText/pc/index.js +45 -17
  5. package/es/composite-comp/bol/config-panels/ImageTextConfig/index.js +2 -1
  6. package/es/composite-comp/bol/second-config-panels/CarouselSecondConfig/index.js +8 -13
  7. package/es/composite-comp/common/config-panels/CustomizeConfig/index.js +15 -0
  8. package/es/composite-comp/dito/components/FlashDeal/defaultJSON.js +41 -0
  9. package/es/composite-comp/dito/components/Recommend/defaultJSON.js +0 -6
  10. package/es/composite-comp/dito/components/SearchBar/mobile/index.js +1 -1
  11. package/es/composite-comp/dito/config-panels/FlashDealConfig/FlashDealConfigContent/index.js +16 -6
  12. package/es/composite-comp/dito/config-panels/FlashDealConfig/FlashDealConfigContent/index.less +20 -0
  13. package/es/composite-comp/dito/config-panels/FlashDealConfig/index.js +9 -1
  14. package/es/composite-comp/dito/config-panels/RecommendConfig/index.js +1 -8
  15. package/es/core/Designer/ConfigPanel/index.js +7 -5
  16. package/es/core/Designer/QuickMenuBar/index.js +9 -3
  17. package/es/decorator/metaDecorator.js +3 -5
  18. package/es/meta-comp/components/Button/index.js +23 -1
  19. package/es/mobx/Store.js +1 -4
  20. package/lib/common/Collapse/index.js +8 -13
  21. package/lib/composite-comp/bol/components/ImageText/mobile/index.js +1 -2
  22. package/lib/composite-comp/bol/components/ImageText/mobile/index.less +8 -8
  23. package/lib/composite-comp/bol/components/ImageText/pc/index.js +45 -17
  24. package/lib/composite-comp/bol/config-panels/ImageTextConfig/index.js +2 -1
  25. package/lib/composite-comp/bol/second-config-panels/CarouselSecondConfig/index.js +8 -13
  26. package/lib/composite-comp/common/config-panels/CustomizeConfig/index.js +15 -0
  27. package/lib/composite-comp/dito/components/FlashDeal/defaultJSON.js +41 -0
  28. package/lib/composite-comp/dito/components/Recommend/defaultJSON.js +0 -6
  29. package/lib/composite-comp/dito/components/SearchBar/mobile/index.js +1 -1
  30. package/lib/composite-comp/dito/config-panels/FlashDealConfig/FlashDealConfigContent/index.js +16 -6
  31. package/lib/composite-comp/dito/config-panels/FlashDealConfig/FlashDealConfigContent/index.less +20 -0
  32. package/lib/composite-comp/dito/config-panels/FlashDealConfig/index.js +9 -1
  33. package/lib/composite-comp/dito/config-panels/RecommendConfig/index.js +1 -8
  34. package/lib/core/Designer/ConfigPanel/index.js +7 -5
  35. package/lib/core/Designer/QuickMenuBar/index.js +9 -3
  36. package/lib/decorator/metaDecorator.js +3 -5
  37. package/lib/meta-comp/components/Button/index.js +23 -1
  38. package/lib/mobx/Store.js +1 -4
  39. package/package.json +1 -1
@@ -94,19 +94,7 @@ function (_super) {
94
94
  return;
95
95
  }
96
96
 
97
- var activeItem = source.find(function (src) {
98
- return src.active;
99
- });
100
-
101
- if (activeItem) {
102
- actives.push(activeItem.key);
103
-
104
- _this.setState({
105
- activeKey: actives
106
- });
107
-
108
- return;
109
- } else if (type === 'switch') {
97
+ if (type === 'switch') {
110
98
  var first = source.find(function (src) {
111
99
  var _a;
112
100
 
@@ -120,6 +108,13 @@ function (_super) {
120
108
 
121
109
  actives.push(((_b = first.metaOption) === null || _b === void 0 ? void 0 : _b.id) || first.key);
122
110
  }
111
+ } else if (type === 'triangle' && _mobx.store.clickedMeta && !_mobx.store.clickedGroup) {
112
+ var activeItem = source.find(function (src) {
113
+ var _a, _b;
114
+
115
+ return JSON.stringify(((_b = (_a = src.value) === null || _a === void 0 ? void 0 : _a.props) === null || _b === void 0 ? void 0 : _b.panelProps) || '').includes(_mobx.store.clickedMeta);
116
+ });
117
+ actives.push(activeItem === null || activeItem === void 0 ? void 0 : activeItem.key);
123
118
  } else {
124
119
  var first = source.find(function (src) {
125
120
  var _a;
@@ -102,8 +102,7 @@ function (_super) {
102
102
  ImageTextMobile.prototype.render = function () {
103
103
  var _this = this;
104
104
 
105
- var data = this.props.data; // const { ready } = this.state;
106
- // console.log('----imagetext mobile', data);
105
+ var data = this.props.data; // console.log('----imagetext mobile', data);
107
106
 
108
107
  var wrapStyle = {};
109
108
  wrapStyle.textAlign = data.customize.align; // if (data.background.bgType === 'color') {
@@ -59,8 +59,8 @@
59
59
  }
60
60
  .card-btn-wrap {
61
61
  display: flex;
62
- .card-first-btn {
63
- margin-right: 12px;
62
+ .card-second-btn {
63
+ margin-left: 12px;
64
64
  }
65
65
  }
66
66
  }
@@ -94,8 +94,8 @@
94
94
  }
95
95
  .card-btn-wrap {
96
96
  display: flex;
97
- .card-first-btn {
98
- margin-right: 12px;
97
+ .card-second-btn {
98
+ margin-left: 12px;
99
99
  }
100
100
  }
101
101
  }
@@ -135,8 +135,8 @@
135
135
  flex-direction: column;
136
136
  }
137
137
 
138
- .card-second-btn {
139
- margin-top: 8px;
138
+ .card-first-btn, .card-second-btn {
139
+ margin-bottom: 8px;
140
140
  }
141
141
  }
142
142
  .card-margin-bottom {
@@ -170,8 +170,8 @@
170
170
  }
171
171
  .card-btn-wrap {
172
172
  display: flex;
173
- .card-first-btn {
174
- margin-right: 12px;
173
+ .card-second-btn {
174
+ margin-left: 12px;
175
175
  }
176
176
  }
177
177
  }
@@ -11,6 +11,8 @@ require("./index.less");
11
11
 
12
12
  var _classnames = _interopRequireDefault(require("classnames"));
13
13
 
14
+ var _lodash = require("lodash");
15
+
14
16
  var _AlignSelector = require("../../../../../common/AlignSelector");
15
17
 
16
18
  var _components = require("../../../../../meta-comp/components");
@@ -63,7 +65,7 @@ var __assign = void 0 && (void 0).__assign || function () {
63
65
 
64
66
  var maxWidthAndHeight = {
65
67
  normal: 410,
66
- outside: 100,
68
+ outside: 86,
67
69
  center: 410
68
70
  };
69
71
 
@@ -76,17 +78,26 @@ function (_super) {
76
78
  var _this = _super !== null && _super.apply(this, arguments) || this;
77
79
 
78
80
  _this.state = {
79
- hoverIndex: -1
80
- }; // componentDidMount() {
81
- // this.distroy = autorun(() => {
82
- // this.setState({
83
- // clickedGroup: store.clickedGroup,
84
- // });
85
- // });
86
- // }
87
- // componentWillUnmount() {
88
- // this.distroy();
89
- // }
81
+ hoverIndex: -1,
82
+ currentMaxWidth: 410
83
+ };
84
+
85
+ _this.listenCardWidth = function () {
86
+ var _a;
87
+
88
+ var data = _this.props.data;
89
+
90
+ try {
91
+ var cardWidth = ((_a = document.querySelector('.group-wrap .one-card')) === null || _a === void 0 ? void 0 : _a.offsetWidth) - 40;
92
+ var maxLayoutWidth = maxWidthAndHeight[data.customize.layout.pcLayout];
93
+
94
+ _this.setState({
95
+ currentMaxWidth: Math.min(cardWidth, maxLayoutWidth)
96
+ });
97
+ } catch (error) {
98
+ console.log(error);
99
+ }
100
+ };
90
101
 
91
102
  _this.calcWidth = function (num) {
92
103
  return (100 - (num - 1) * 2) / num + "%";
@@ -114,14 +125,31 @@ function (_super) {
114
125
  return _this;
115
126
  }
116
127
 
128
+ ImageTextPc.prototype.componentDidMount = function () {
129
+ var data = this.props.data;
130
+ this.layout = data.customize.layout.pcLayout;
131
+ this.listenCardWidth();
132
+ window.addEventListener('resize', (0, _lodash.debounce)(this.listenCardWidth));
133
+ };
134
+
135
+ ImageTextPc.prototype.componentWillUnmount = function () {
136
+ window.removeEventListener('resize', this.listenCardWidth);
137
+ };
138
+
139
+ ImageTextPc.prototype.componentWillReceiveProps = function (nextProps) {
140
+ if (nextProps.data.customize.layout.pcLayout !== this.layout) {
141
+ this.layout = nextProps.data.customize.layout.pcLayout;
142
+ this.listenCardWidth();
143
+ }
144
+ };
145
+
117
146
  ImageTextPc.prototype.render = function () {
118
147
  var _this = this;
119
148
 
120
149
  var data = this.props.data;
121
- var hoverIndex = this.state.hoverIndex; // console.log('====================================');
122
- // console.log(data);
123
- // console.log('====================================');
124
-
150
+ var _a = this.state,
151
+ hoverIndex = _a.hoverIndex,
152
+ currentMaxWidth = _a.currentMaxWidth;
125
153
  var wrapStyle = {};
126
154
  wrapStyle.alignItems = _AlignSelector.alignItemMap[data.customize.align];
127
155
  return /*#__PURE__*/_react["default"].createElement("div", {
@@ -156,7 +184,7 @@ function (_super) {
156
184
  data: hoverIndex == i ? source.hover.image : source.image,
157
185
  limitWidthHeight: true,
158
186
  maxHeight: maxWidthAndHeight[data.customize.layout.pcLayout],
159
- maxWidth: maxWidthAndHeight[data.customize.layout.pcLayout],
187
+ maxWidth: currentMaxWidth,
160
188
  scale: 0.5
161
189
  })), (source.title.open && data.customize.layout.pcLayout !== 'center' && hoverIndex != i || hoverIndex == i && source.hover.title.open && data.customize.layout.pcLayout !== 'center') && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
162
190
  className: "card-title",
@@ -164,7 +164,7 @@ function (_super) {
164
164
  }),
165
165
  metaOption: data.groupSource
166
166
  }, {
167
- key: '2',
167
+ key: 'imageText3',
168
168
  name: (0, _locale.i18n)('SPACING'),
169
169
  value: /*#__PURE__*/_react["default"].createElement(_SpacingConfig["default"], {
170
170
  data: data.spacing
@@ -173,6 +173,7 @@ function (_super) {
173
173
  key: 'imageText4',
174
174
  name: (0, _locale.i18n)('CUSTOMIZE'),
175
175
  value: /*#__PURE__*/_react["default"].createElement(_CustomizeConfig["default"], {
176
+ component: "imageText",
176
177
  data: data.customize,
177
178
  layoutSource: (0, _coreUtil.isPc)() ? _layout.imageTextLayoutPc : _layout.imageTextLayoutMobile,
178
179
  selectedLayoutFun: function selectedLayoutFun(v) {
@@ -85,40 +85,35 @@ function (_super) {
85
85
  value: /*#__PURE__*/_react["default"].createElement(_TextConfig["default"], {
86
86
  data: panelProps.title
87
87
  }),
88
- metaOption: panelProps.title,
89
- toggleType: 'switch'
88
+ metaOption: panelProps.title
90
89
  }, {
91
90
  key: '3',
92
91
  name: (0, _locale.i18n)('TEXT'),
93
92
  value: /*#__PURE__*/_react["default"].createElement(_TextConfig["default"], {
94
93
  data: panelProps.text
95
94
  }),
96
- metaOption: panelProps.text,
97
- toggleType: 'switch'
95
+ metaOption: panelProps.text
98
96
  }, {
99
97
  key: '4',
100
98
  name: (0, _locale.i18n)('IMAGE_TAG'),
101
99
  value: /*#__PURE__*/_react["default"].createElement(_ImageConfig["default"], {
102
100
  data: panelProps.imageTag
103
101
  }),
104
- metaOption: panelProps.imageTag,
105
- toggleType: 'switch'
102
+ metaOption: panelProps.imageTag
106
103
  }, {
107
104
  key: '5',
108
105
  name: (0, _locale.i18n)('BUTTON_TAG'),
109
106
  value: /*#__PURE__*/_react["default"].createElement(_ButtonConfig["default"], {
110
107
  data: panelProps.buttonTag
111
108
  }),
112
- metaOption: panelProps.buttonTag,
113
- toggleType: 'switch'
109
+ metaOption: panelProps.buttonTag
114
110
  }, {
115
111
  key: '6',
116
112
  name: (0, _locale.i18n)('SECONDARY_BUTTON_TAG'),
117
113
  value: /*#__PURE__*/_react["default"].createElement(_ButtonConfig["default"], {
118
114
  data: panelProps.secondButtonTag
119
115
  }),
120
- metaOption: panelProps.secondButtonTag,
121
- toggleType: 'switch'
116
+ metaOption: panelProps.secondButtonTag
122
117
  }];
123
118
 
124
119
  var _textSource = _mobx.store.CarouselStore[panelProps.compId] === 'layout2' ? textSource : [];
@@ -136,7 +131,8 @@ function (_super) {
136
131
  }),
137
132
  metaOption: panelProps.image,
138
133
  toggleType: 'switch'
139
- }], _textSource)
134
+ }], _textSource),
135
+ type: "switch"
140
136
  });
141
137
  };
142
138
 
@@ -149,8 +145,7 @@ function (_super) {
149
145
  key: '1',
150
146
  name: (0, _locale.i18n)('CONTENT'),
151
147
  value: getConfig()
152
- }],
153
- type: "triangle"
148
+ }]
154
149
  }));
155
150
  };
156
151
 
@@ -121,6 +121,21 @@ function (_super) {
121
121
  _this.props.store.setState({
122
122
  CarouselStore: __assign(__assign({}, _mobx.store.CarouselStore), (_a = {}, _a[id] = v, _a))
123
123
  });
124
+ } // 图文组件,移动端,只有第3个组件可选列数
125
+
126
+
127
+ if (component === 'imageText') {
128
+ if (!(0, _coreUtil.isPc)()) {
129
+ if (v === 'normal3') {
130
+ _this.setState({
131
+ showRowNum: true
132
+ });
133
+ } else {
134
+ _this.setState({
135
+ showRowNum: false
136
+ });
137
+ }
138
+ }
124
139
  } // 移动端导航特殊处理
125
140
  // 更改需求,两个布局都需 可选行数
126
141
  // if (component == 'mobileNavigation') {
@@ -8,11 +8,13 @@ exports.getDefaultJSON = void 0;
8
8
  var _uuid = require("uuid");
9
9
 
10
10
  var getDefaultJSON = function getDefaultJSON() {
11
+ var contentId = (0, _uuid.v4)();
11
12
  return {
12
13
  id: (0, _uuid.v4)(),
13
14
  type: 'FLASH_DEAL',
14
15
  title: {
15
16
  icon: {
17
+ id: (0, _uuid.v4)(),
16
18
  open: true,
17
19
  url: '/get/resource/platform/conf/20220722/picture/组633391550411058986147840.png'
18
20
  },
@@ -23,6 +25,7 @@ var getDefaultJSON = function getDefaultJSON() {
23
25
  specialContent: [],
24
26
  text: 'Flash Deal',
25
27
  content: {
28
+ sizeType: 'Customize font styles',
26
29
  fontFamily: 'Open Sans',
27
30
  fontWeight: 600,
28
31
  fontSize: 14,
@@ -48,6 +51,7 @@ var getDefaultJSON = function getDefaultJSON() {
48
51
  backgroundColor: ''
49
52
  },
50
53
  buttonText: {
54
+ sizeType: 'Customize font styles',
51
55
  fontFamily: 'Open Sans',
52
56
  fontWeight: 600,
53
57
  fontSize: 12,
@@ -60,6 +64,20 @@ var getDefaultJSON = function getDefaultJSON() {
60
64
  borderColor: '',
61
65
  borderRadius: 6
62
66
  },
67
+ spacing: {
68
+ pc: {
69
+ paddingTop: 2,
70
+ paddingBottom: 2,
71
+ paddingLeft: 5,
72
+ paddingRight: 5
73
+ },
74
+ mobile: {
75
+ paddingTop: 2,
76
+ paddingBottom: 2,
77
+ paddingLeft: 5,
78
+ paddingRight: 5
79
+ }
80
+ },
63
81
  buttonIcon: {
64
82
  iconUrl: '/get/resource/platform/conf/20220719/picture/icon-arrow-right-s1549371733179686912.png',
65
83
  layout: 'right'
@@ -68,9 +86,11 @@ var getDefaultJSON = function getDefaultJSON() {
68
86
  }
69
87
  },
70
88
  content: {
89
+ id: contentId,
71
90
  sortType: '1',
72
91
  label: {
73
92
  id: (0, _uuid.v4)(),
93
+ contentId: contentId,
74
94
  open: true,
75
95
  type: 'BUTTON',
76
96
  text: 'Button',
@@ -79,6 +99,7 @@ var getDefaultJSON = function getDefaultJSON() {
79
99
  backgroundColor: '#CC1D20'
80
100
  },
81
101
  buttonText: {
102
+ sizeType: 'Customize font styles',
82
103
  fontFamily: 'Open Sans',
83
104
  fontWeight: 600,
84
105
  fontSize: 8,
@@ -91,6 +112,20 @@ var getDefaultJSON = function getDefaultJSON() {
91
112
  borderColor: '',
92
113
  borderRadius: 7
93
114
  },
115
+ spacing: {
116
+ pc: {
117
+ paddingTop: 2,
118
+ paddingBottom: 2,
119
+ paddingLeft: 3,
120
+ paddingRight: 3
121
+ },
122
+ mobile: {
123
+ paddingTop: 2,
124
+ paddingBottom: 2,
125
+ paddingLeft: 3,
126
+ paddingRight: 3
127
+ }
128
+ },
94
129
  buttonIcon: {
95
130
  iconUrl: '',
96
131
  layout: 'right'
@@ -99,11 +134,13 @@ var getDefaultJSON = function getDefaultJSON() {
99
134
  },
100
135
  productName: {
101
136
  id: (0, _uuid.v4)(),
137
+ contentId: contentId,
102
138
  open: true,
103
139
  type: 'Text',
104
140
  specialContent: [],
105
141
  text: 'Flash Deal',
106
142
  content: {
143
+ sizeType: 'Customize font styles',
107
144
  fontFamily: 'Open Sans',
108
145
  fontWeight: 500,
109
146
  fontSize: 14,
@@ -121,11 +158,13 @@ var getDefaultJSON = function getDefaultJSON() {
121
158
  },
122
159
  activityPrice: {
123
160
  id: (0, _uuid.v4)(),
161
+ contentId: contentId,
124
162
  open: true,
125
163
  type: 'Text',
126
164
  specialContent: [],
127
165
  text: 'Flash Deal',
128
166
  content: {
167
+ sizeType: 'Customize font styles',
129
168
  fontFamily: 'Open Sans',
130
169
  fontWeight: 600,
131
170
  fontSize: 14,
@@ -143,11 +182,13 @@ var getDefaultJSON = function getDefaultJSON() {
143
182
  },
144
183
  salesPrice: {
145
184
  id: (0, _uuid.v4)(),
185
+ contentId: contentId,
146
186
  open: true,
147
187
  type: 'Text',
148
188
  specialContent: [],
149
189
  text: 'Flash Deal',
150
190
  content: {
191
+ sizeType: 'Customize font styles',
151
192
  fontFamily: 'Open Sans',
152
193
  fontWeight: 500,
153
194
  fontSize: 10,
@@ -152,16 +152,13 @@ exports.recommendGroupSourceJSON = recommendGroupSourceJSON;
152
152
 
153
153
  var getDefaultJSON = function getDefaultJSON() {
154
154
  var groupId = (0, _uuid.v4)();
155
- var contentId = (0, _uuid.v4)();
156
155
  return {
157
156
  id: groupId,
158
157
  type: 'RECOMMEND',
159
158
  groupSource: [recommendGroupSourceJSON(groupId, '', 'Tab1'), recommendGroupSourceJSON(groupId, '', 'Tab2')],
160
159
  content: {
161
- id: contentId,
162
160
  label: {
163
161
  id: (0, _uuid.v4)(),
164
- contentId: contentId,
165
162
  open: true,
166
163
  type: 'BUTTON',
167
164
  text: 'Button',
@@ -204,7 +201,6 @@ var getDefaultJSON = function getDefaultJSON() {
204
201
  },
205
202
  productName: {
206
203
  id: (0, _uuid.v4)(),
207
- contentId: contentId,
208
204
  open: true,
209
205
  type: 'Text',
210
206
  specialContent: [],
@@ -228,7 +224,6 @@ var getDefaultJSON = function getDefaultJSON() {
228
224
  },
229
225
  activityPrice: {
230
226
  id: (0, _uuid.v4)(),
231
- contentId: contentId,
232
227
  open: true,
233
228
  type: 'Text',
234
229
  specialContent: [],
@@ -252,7 +247,6 @@ var getDefaultJSON = function getDefaultJSON() {
252
247
  },
253
248
  salesPrice: {
254
249
  id: (0, _uuid.v4)(),
255
- contentId: contentId,
256
250
  open: true,
257
251
  type: 'Text',
258
252
  specialContent: [],
@@ -264,7 +264,7 @@ function (_super) {
264
264
  })), /*#__PURE__*/_react["default"].createElement("div", {
265
265
  className: "message-wrap"
266
266
  }, /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
267
- color: "#262626",
267
+ color: "#fff",
268
268
  onClick: function onClick() {
269
269
  return (0, _coreUtil.clickUrl)('/message-center');
270
270
  },
@@ -19,6 +19,8 @@ var _common = require("../../../../../common");
19
19
 
20
20
  var _locale = require("../../../../../locale");
21
21
 
22
+ require("./index.less");
23
+
22
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
23
25
 
24
26
  var __extends = void 0 && (void 0).__extends || function () {
@@ -116,14 +118,22 @@ function (_super) {
116
118
  data: panelProps.salesPrice
117
119
  }),
118
120
  metaOption: panelProps.salesPrice
119
- }, {
120
- key: '5',
121
- name: (0, _locale.i18n)('SALES_PROGRESS'),
122
- value: null,
123
- metaOption: panelProps.salesProgressVisible
124
121
  }],
125
122
  type: "switch"
126
- }));
123
+ }), /*#__PURE__*/_react["default"].createElement("div", {
124
+ className: "sales_progress_wrap"
125
+ }, /*#__PURE__*/_react["default"].createElement("span", {
126
+ className: "label"
127
+ }, (0, _locale.i18n)('SALES_PROGRESS')), /*#__PURE__*/_react["default"].createElement(_antd.Switch, {
128
+ checked: panelProps.salesProgressVisible.open,
129
+ onChange: function onChange(v) {
130
+ panelProps.salesProgressVisible = {
131
+ open: v
132
+ };
133
+
134
+ _this.reRender();
135
+ }
136
+ })));
127
137
  };
128
138
 
129
139
  AComponent.defaultProps = {
@@ -0,0 +1,20 @@
1
+ .flash_sale_content {
2
+
3
+ .sales_progress_wrap {
4
+ border-top: 1px solid #EDF0F4;
5
+ padding-top: 20px;
6
+ padding-bottom: 10px;
7
+ display: flex;
8
+ justify-content: space-between;
9
+
10
+ .label {
11
+ font-size: 16px !important;
12
+ line-height: 24px !important;
13
+ height: 24px !important;
14
+ font-weight: 600 !important;
15
+ color: #232F46;
16
+ font-family: 'Open Sans';
17
+ font-style: normal;
18
+ }
19
+ }
20
+ }
@@ -21,12 +21,19 @@ var _CustomizeConfig = _interopRequireDefault(require("../../../common/config-pa
21
21
 
22
22
  var _Collapse = _interopRequireDefault(require("../../../../common/Collapse"));
23
23
 
24
+ var _mobx = require("../../../../mobx");
25
+
24
26
  var _locale = require("../../../../locale");
25
27
 
26
28
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
27
29
 
28
30
  function FlashDealConfig(props) {
29
31
  var data = props.data;
32
+
33
+ var getIsContentActive = function getIsContentActive(content) {
34
+ return JSON.stringify(content).includes(_mobx.store.clickedMetaParent);
35
+ };
36
+
30
37
  return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_Collapse["default"], {
31
38
  divider: "bold",
32
39
  headerSize: "large",
@@ -41,7 +48,8 @@ function FlashDealConfig(props) {
41
48
  name: (0, _locale.i18n)('CONTENT'),
42
49
  value: /*#__PURE__*/_react["default"].createElement(_FlashDealConfigContent["default"], {
43
50
  panelProps: data.content
44
- })
51
+ }),
52
+ active: getIsContentActive(data.content)
45
53
  }, {
46
54
  key: '3',
47
55
  name: (0, _locale.i18n)('SPACING'),
@@ -25,8 +25,6 @@ var _Collapse = _interopRequireDefault(require("../../../../common/Collapse"));
25
25
 
26
26
  var _locale = require("../../../../locale");
27
27
 
28
- var _mobx = require("../../../../mobx");
29
-
30
28
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
31
29
 
32
30
  var __extends = void 0 && (void 0).__extends || function () {
@@ -81,10 +79,6 @@ function (_super) {
81
79
  _this.selfRender();
82
80
  };
83
81
 
84
- _this.getIsContentActive = function (content) {
85
- return JSON.stringify(content).includes(_mobx.store.clickedMetaParent);
86
- };
87
-
88
82
  return _this;
89
83
  }
90
84
 
@@ -106,8 +100,7 @@ function (_super) {
106
100
  name: (0, _locale.i18n)('CONTENT'),
107
101
  value: /*#__PURE__*/_react["default"].createElement(_RecommendConfigContent["default"], {
108
102
  panelProps: data.content
109
- }),
110
- active: this.getIsContentActive(data.content)
103
+ })
111
104
  }, {
112
105
  key: '3',
113
106
  name: (0, _locale.i18n)('SPACING'),
@@ -83,19 +83,19 @@ function (_super) {
83
83
  _this.setState({
84
84
  clickedGroup: _mobx.store.clickedGroup,
85
85
  selectedNode: selectedNode
86
- }); // 展开以及面板
86
+ }); // 展开一级面板
87
87
 
88
88
 
89
89
  if (selectedNode) {
90
90
  _this.openConfig();
91
91
  } else {
92
92
  _this.closeConfig();
93
- } // 展开首期二级面板
93
+ } // 展开二级面板
94
94
 
95
95
 
96
- if (!_mobx.store.clickedGroup) {
96
+ if (!_mobx.store.clickedGroup && _this.preClickedGroup) {
97
97
  _this.closeSecConfig();
98
- } else if (_mobx.store.clickedGroup !== _this.preClickedGroup) {
98
+ } else if (Boolean(_mobx.store.clickedGroup) != Boolean(_this.preClickedGroup)) {
99
99
  _this.openSecConfig();
100
100
  }
101
101
 
@@ -294,7 +294,9 @@ function (_super) {
294
294
  };
295
295
 
296
296
  ConfigPanel.prototype.componentWillReceiveProps = function (nextProps) {
297
- this.resetState(nextProps, _mobx.store.clickedFloor);
297
+ if (JSON.stringify(this.props) !== JSON.stringify(nextProps)) {
298
+ this.resetState(nextProps, _mobx.store.clickedFloor);
299
+ }
298
300
  };
299
301
 
300
302
  ConfigPanel.prototype.componentWillUnmount = function () {
@@ -11,6 +11,8 @@ var _classnames = _interopRequireDefault(require("classnames"));
11
11
 
12
12
  var _react = _interopRequireWildcard(require("react"));
13
13
 
14
+ var _mobx = require("../../../mobx");
15
+
14
16
  var _Button = _interopRequireDefault(require("../../../common/Button"));
15
17
 
16
18
  var _Iconfont = _interopRequireDefault(require("../../../common/Iconfont"));
@@ -80,9 +82,13 @@ function (_super) {
80
82
  var _this = _super !== null && _super.apply(this, arguments) || this;
81
83
 
82
84
  _this.onBtnClick = function (event) {
83
- var code = event.currentTarget.dataset.code; // if (code === quickMenuCode.SAVE || code === quickMenuCode.PUBLISH) {
84
- // store.setState({ clickedFloor: '' });
85
- // }
85
+ var code = event.currentTarget.dataset.code; // 保存和发布时需要清空组件和元组件的选中状态,否则截图中会看到选中状态
86
+
87
+ if (code === _constants.quickMenuCode.SAVE || code === _constants.quickMenuCode.PUBLISH) {
88
+ _mobx.store.setState({
89
+ clickedFloor: ''
90
+ });
91
+ }
86
92
 
87
93
  if (_this.props.device === _constants.deviceTypeMap.PC) {}
88
94