@fonixtree/magic-design 1.0.219 → 1.0.221
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/es/common/LinkModal/index.js +3 -23
- package/es/common/PictureModal/index.js +1 -1
- package/es/composite-comp/bol/components/Banner/pc/components/SwiperBannerPc.js +13 -8
- package/es/composite-comp/bol/components/Banner/pc/index.less +6 -6
- package/es/composite-comp/common/components/ProductItem/index.js +22 -27
- package/es/composite-comp/dito/components/GroupedImage/defaultJSON.js +7 -8
- package/es/composite-comp/dito/components/GroupedImage/pc/index.js +243 -26
- package/es/composite-comp/dito/components/GroupedImage/pc/index.less +79 -10
- package/es/composite-comp/dito/components/MenuNavigation/MenuNavMetaImage/index.less +3 -1
- package/es/composite-comp/dito/components/Recommend/pc/index.js +28 -25
- package/es/composite-comp/dito/components/Recommend/pc/index.less +10 -2
- package/es/composite-comp/dito/second-config-panels/GroupedImageSecondConfig/index.js +127 -29
- package/es/composite-comp/dito/second-config-panels/GroupedImageSecondConfig/index.less +21 -0
- package/es/composite-comp/dito/second-config-panels/MenuNavigationSecondConfig/index.js +1 -1
- package/es/constants/index.js +1 -1
- package/es/core/Designer/ConfigPanel/index.js +217 -4
- package/es/core/Designer/ConfigPanel/index.less +39 -0
- package/es/core/Renderer/index.js +0 -1
- package/es/meta-comp/components/Image/index.js +15 -11
- package/es/meta-comp/config-panels/ButtonConfig/index.js +4 -0
- package/es/meta-comp/config-panels/ImageConfig/index.js +25 -8
- package/es/meta-comp/config-panels/TextConfig/index.js +1 -1
- package/es/mobx/Store.js +4 -1
- package/es/utils/coreUtil.js +3 -3
- package/lib/common/LinkModal/index.js +3 -23
- package/lib/common/PictureModal/index.js +1 -1
- package/lib/composite-comp/bol/components/Banner/pc/components/SwiperBannerPc.js +13 -8
- package/lib/composite-comp/bol/components/Banner/pc/index.less +6 -6
- package/lib/composite-comp/common/components/ProductItem/index.js +22 -27
- package/lib/composite-comp/dito/components/GroupedImage/defaultJSON.js +7 -8
- package/lib/composite-comp/dito/components/GroupedImage/pc/index.js +243 -26
- package/lib/composite-comp/dito/components/GroupedImage/pc/index.less +79 -10
- package/lib/composite-comp/dito/components/MenuNavigation/MenuNavMetaImage/index.less +3 -1
- package/lib/composite-comp/dito/components/Recommend/pc/index.js +28 -25
- package/lib/composite-comp/dito/components/Recommend/pc/index.less +10 -2
- package/lib/composite-comp/dito/second-config-panels/GroupedImageSecondConfig/index.js +127 -29
- package/lib/composite-comp/dito/second-config-panels/GroupedImageSecondConfig/index.less +21 -0
- package/lib/composite-comp/dito/second-config-panels/MenuNavigationSecondConfig/index.js +1 -1
- package/lib/constants/index.js +1 -1
- package/lib/core/Designer/ConfigPanel/index.js +217 -4
- package/lib/core/Designer/ConfigPanel/index.less +39 -0
- package/lib/core/Renderer/index.js +0 -1
- package/lib/meta-comp/components/Image/index.js +15 -11
- package/lib/meta-comp/config-panels/ButtonConfig/index.js +4 -0
- package/lib/meta-comp/config-panels/ImageConfig/index.js +25 -8
- package/lib/meta-comp/config-panels/TextConfig/index.js +1 -1
- package/lib/mobx/Store.js +4 -1
- package/lib/utils/coreUtil.js +3 -3
- package/package.json +1 -1
|
@@ -3,12 +3,22 @@
|
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
position: relative;
|
|
5
5
|
|
|
6
|
+
&.less-than-4 {
|
|
7
|
+
.image-list-wrapper {
|
|
8
|
+
padding-left: 0!important;
|
|
9
|
+
.image-list {
|
|
10
|
+
width: fit-content;
|
|
11
|
+
margin: 0 auto;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
6
16
|
.tab-select-wrap {
|
|
7
17
|
display: flex;
|
|
8
18
|
align-items: center;
|
|
9
|
-
|
|
19
|
+
gap: 16px;
|
|
10
20
|
background: #ffffff;
|
|
11
|
-
overflow: auto;
|
|
21
|
+
// overflow: auto;
|
|
12
22
|
position: relative;
|
|
13
23
|
width: fit-content;
|
|
14
24
|
margin: 0 auto 15px;
|
|
@@ -19,14 +29,13 @@
|
|
|
19
29
|
text-align: center;
|
|
20
30
|
padding: 0; // 无缝衔接:去掉左右间距
|
|
21
31
|
width: fit-content;
|
|
22
|
-
height: 100%;
|
|
23
32
|
justify-content: center;
|
|
24
33
|
white-space: nowrap;
|
|
25
34
|
flex-direction: column;
|
|
26
35
|
cursor: pointer;
|
|
27
36
|
|
|
28
37
|
img {
|
|
29
|
-
height: 50px;
|
|
38
|
+
max-height: 50px;
|
|
30
39
|
margin-bottom: 2px;
|
|
31
40
|
}
|
|
32
41
|
}
|
|
@@ -38,15 +47,75 @@
|
|
|
38
47
|
margin-bottom: 16px;
|
|
39
48
|
}
|
|
40
49
|
|
|
41
|
-
.image-list {
|
|
50
|
+
.image-list-wrapper {
|
|
51
|
+
padding-left: 88px;
|
|
52
|
+
position: relative;
|
|
53
|
+
|
|
54
|
+
.image-list {
|
|
55
|
+
display: flex;
|
|
56
|
+
flex-direction: row;
|
|
57
|
+
gap: 16px;
|
|
58
|
+
overflow-x: auto;
|
|
59
|
+
overflow-y: hidden;
|
|
60
|
+
flex: 1;
|
|
61
|
+
scroll-behavior: smooth;
|
|
62
|
+
-webkit-overflow-scrolling: touch;
|
|
63
|
+
|
|
64
|
+
&::-webkit-scrollbar {
|
|
65
|
+
display: none;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
scrollbar-width: none;
|
|
69
|
+
|
|
70
|
+
.image-item {
|
|
71
|
+
flex-shrink: 0;
|
|
72
|
+
width: 300px;
|
|
73
|
+
|
|
74
|
+
&:last-child {
|
|
75
|
+
margin-right: 40px;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.empty-placeholder {
|
|
80
|
+
width: 100%;
|
|
81
|
+
text-align: center;
|
|
82
|
+
color: #999;
|
|
83
|
+
padding: 40px 0;
|
|
84
|
+
font-size: 14px;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.arrow-icon-wrapper {
|
|
91
|
+
display: flex;
|
|
92
|
+
justify-content: end;
|
|
93
|
+
padding: 24px 0;
|
|
94
|
+
padding-right: 75px;
|
|
95
|
+
|
|
96
|
+
.arrow-icon {
|
|
42
97
|
display: flex;
|
|
43
|
-
|
|
98
|
+
align-items: center;
|
|
44
99
|
justify-content: center;
|
|
45
|
-
|
|
100
|
+
width: 40px;
|
|
101
|
+
height: 40px;
|
|
102
|
+
background: #CE1126;
|
|
103
|
+
border-radius: 100px;
|
|
104
|
+
cursor: pointer;
|
|
105
|
+
flex-shrink: 0;
|
|
106
|
+
z-index: 1;
|
|
46
107
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
108
|
+
&.left {
|
|
109
|
+
margin-right: 16px;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
&.right {
|
|
113
|
+
// margin-left: 15px;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
&.disabled {
|
|
117
|
+
cursor: not-allowed;
|
|
118
|
+
opacity: 0.5;
|
|
50
119
|
}
|
|
51
120
|
}
|
|
52
121
|
}
|
|
@@ -4,10 +4,12 @@
|
|
|
4
4
|
height: 100%;
|
|
5
5
|
display: flex;
|
|
6
6
|
justify-content: center;
|
|
7
|
+
max-height: 65px;
|
|
8
|
+
|
|
7
9
|
// overflow: hidden;
|
|
8
10
|
&>img {
|
|
9
11
|
width: 100%;
|
|
10
|
-
height: 100%;
|
|
12
|
+
// height: 100%;
|
|
11
13
|
// object-fit: contain;
|
|
12
14
|
transition: all .2s linear;
|
|
13
15
|
vertical-align: initial;
|
|
@@ -279,7 +279,7 @@ function (_super) {
|
|
|
279
279
|
};
|
|
280
280
|
|
|
281
281
|
_this.initTab = function (index, hideTabs) {
|
|
282
|
-
var selectedTabDom = document.querySelector(".tab-select-wrap .tabTitle:nth-child(" + (index + 1) + ")");
|
|
282
|
+
var selectedTabDom = document.querySelector(".recommend-tab-select-wrap .tabTitle:nth-child(" + (index + 1) + ")");
|
|
283
283
|
var tabLeft = 0;
|
|
284
284
|
var tabWidth = 0;
|
|
285
285
|
|
|
@@ -303,14 +303,14 @@ function (_super) {
|
|
|
303
303
|
|
|
304
304
|
_this.getProductList = function (index) {
|
|
305
305
|
return __awaiter(_this, void 0, void 0, function () {
|
|
306
|
-
var panelProps, groupSource, recommendId, pageId, cache, _a, _b, sourceType, _c, prodIds, _d,
|
|
306
|
+
var panelProps, groupSource, recommendId, pageId, cache, _a, _b, sourceType, _c, prodIds, _d, prodType, _e, intelligentType, _f, intelligentValue, _g, maxProdNum, newData, params, res, res, e_1, _cache;
|
|
307
307
|
|
|
308
|
-
var
|
|
308
|
+
var _h, _j, _k;
|
|
309
309
|
|
|
310
310
|
var _this = this;
|
|
311
311
|
|
|
312
|
-
return __generator(this, function (
|
|
313
|
-
switch (
|
|
312
|
+
return __generator(this, function (_l) {
|
|
313
|
+
switch (_l.label) {
|
|
314
314
|
case 0:
|
|
315
315
|
panelProps = this.props.panelProps;
|
|
316
316
|
groupSource = this.state.groupSource;
|
|
@@ -322,7 +322,7 @@ function (_super) {
|
|
|
322
322
|
|
|
323
323
|
if (cache) {
|
|
324
324
|
if ("products" + index in cache) {
|
|
325
|
-
this.setState((
|
|
325
|
+
this.setState((_h = {}, _h["products" + index] = cache["products" + index], _h), function () {
|
|
326
326
|
_this.resetLayout();
|
|
327
327
|
});
|
|
328
328
|
/** 如果数据未过期 */
|
|
@@ -334,12 +334,12 @@ function (_super) {
|
|
|
334
334
|
}
|
|
335
335
|
}
|
|
336
336
|
|
|
337
|
-
_a = groupSource[index] || {}, _b = _a.sourceType, sourceType = _b === void 0 ? '' : _b, _c = _a.prodIds, prodIds = _c === void 0 ? '' : _c, _d = _a.
|
|
337
|
+
_a = groupSource[index] || {}, _b = _a.sourceType, sourceType = _b === void 0 ? '' : _b, _c = _a.prodIds, prodIds = _c === void 0 ? '' : _c, _d = _a.prodType, prodType = _d === void 0 ? '' : _d, _e = _a.intelligentType, intelligentType = _e === void 0 ? '' : _e, _f = _a.intelligentValue, intelligentValue = _f === void 0 ? [] : _f, _g = _a.maxProdNum, maxProdNum = _g === void 0 ? 10 : _g;
|
|
338
338
|
newData = [];
|
|
339
|
-
|
|
339
|
+
_l.label = 1;
|
|
340
340
|
|
|
341
341
|
case 1:
|
|
342
|
-
|
|
342
|
+
_l.trys.push([1, 9,, 10]);
|
|
343
343
|
|
|
344
344
|
if (!(groupSource.length > 0)) return [3
|
|
345
345
|
/*break*/
|
|
@@ -347,22 +347,25 @@ function (_super) {
|
|
|
347
347
|
if (!(sourceType === 'select')) return [3
|
|
348
348
|
/*break*/
|
|
349
349
|
, 3];
|
|
350
|
+
if (!prodIds) return [2
|
|
351
|
+
/*return*/
|
|
352
|
+
];
|
|
353
|
+
params = {
|
|
354
|
+
state: 'A'
|
|
355
|
+
};
|
|
350
356
|
|
|
351
|
-
if (
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
357
|
+
if (prodType === 'spu') {
|
|
358
|
+
params.offers = prodIds;
|
|
359
|
+
} else {
|
|
360
|
+
params.products = prodIds;
|
|
355
361
|
}
|
|
356
362
|
|
|
357
363
|
return [4
|
|
358
364
|
/*yield*/
|
|
359
|
-
, (0, _commonUtil.commonFetch)('/designer/v1/h5/products',
|
|
360
|
-
products: prodIds,
|
|
361
|
-
state: 'A'
|
|
362
|
-
}, 'GET')];
|
|
365
|
+
, (0, _commonUtil.commonFetch)('/designer/v1/h5/products', params, 'GET')];
|
|
363
366
|
|
|
364
367
|
case 2:
|
|
365
|
-
res =
|
|
368
|
+
res = _l.sent();
|
|
366
369
|
newData = __spreadArrays(res.list);
|
|
367
370
|
return [3
|
|
368
371
|
/*break*/
|
|
@@ -385,7 +388,7 @@ function (_super) {
|
|
|
385
388
|
}, 'POST')];
|
|
386
389
|
|
|
387
390
|
case 4:
|
|
388
|
-
res =
|
|
391
|
+
res = _l.sent();
|
|
389
392
|
newData = __spreadArrays(res.pageInfo.list);
|
|
390
393
|
return [3
|
|
391
394
|
/*break*/
|
|
@@ -393,7 +396,7 @@ function (_super) {
|
|
|
393
396
|
|
|
394
397
|
case 5:
|
|
395
398
|
newData = [];
|
|
396
|
-
|
|
399
|
+
_l.label = 6;
|
|
397
400
|
|
|
398
401
|
case 6:
|
|
399
402
|
return [3
|
|
@@ -402,7 +405,7 @@ function (_super) {
|
|
|
402
405
|
|
|
403
406
|
case 7:
|
|
404
407
|
newData = [];
|
|
405
|
-
|
|
408
|
+
_l.label = 8;
|
|
406
409
|
|
|
407
410
|
case 8:
|
|
408
411
|
return [3
|
|
@@ -410,7 +413,7 @@ function (_super) {
|
|
|
410
413
|
, 10];
|
|
411
414
|
|
|
412
415
|
case 9:
|
|
413
|
-
e_1 =
|
|
416
|
+
e_1 = _l.sent();
|
|
414
417
|
newData = [];
|
|
415
418
|
return [3
|
|
416
419
|
/*break*/
|
|
@@ -419,10 +422,10 @@ function (_super) {
|
|
|
419
422
|
case 10:
|
|
420
423
|
if (!(0, _coreUtil.isDesignMode)()) {
|
|
421
424
|
_cache = (0, _storeUtil.getMagicStore)("recommend_" + pageId + "_" + recommendId);
|
|
422
|
-
(0, _storeUtil.setMagicStore)("recommend_" + pageId + "_" + recommendId, __assign(__assign({}, _cache), (
|
|
425
|
+
(0, _storeUtil.setMagicStore)("recommend_" + pageId + "_" + recommendId, __assign(__assign({}, _cache), (_j = {}, _j["products" + index] = newData, _j.endTime = Date.now() + 3 * 60 * 1000, _j)));
|
|
423
426
|
}
|
|
424
427
|
|
|
425
|
-
this.setState((
|
|
428
|
+
this.setState((_k = {}, _k["products" + index] = newData, _k), function () {
|
|
426
429
|
_this.resetLayout();
|
|
427
430
|
});
|
|
428
431
|
return [2
|
|
@@ -642,7 +645,7 @@ function (_super) {
|
|
|
642
645
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
643
646
|
className: "m-recommend-pc"
|
|
644
647
|
}, !hideTabs && /*#__PURE__*/_react["default"].createElement("div", {
|
|
645
|
-
className: "tab-select-wrap"
|
|
648
|
+
className: "recommend-tab-select-wrap"
|
|
646
649
|
}, groupSource.map(function (tab, index) {
|
|
647
650
|
var _image = index == tabIndex && tab.hover.open && tab.hover.image.open ? tab.hover.image : tab.image;
|
|
648
651
|
|
|
@@ -13,12 +13,12 @@
|
|
|
13
13
|
// display: none;
|
|
14
14
|
// }
|
|
15
15
|
|
|
16
|
-
.tab-select-wrap {
|
|
16
|
+
.recommend-tab-select-wrap {
|
|
17
17
|
display: flex;
|
|
18
18
|
align-items: center;
|
|
19
19
|
height: 50px;
|
|
20
20
|
background: rgb(255 255 255);
|
|
21
|
-
overflow: auto;
|
|
21
|
+
// overflow: auto;
|
|
22
22
|
position: relative;
|
|
23
23
|
width: fit-content;
|
|
24
24
|
margin: 0 auto;
|
|
@@ -62,6 +62,14 @@
|
|
|
62
62
|
.tab-list {
|
|
63
63
|
width: 100%;
|
|
64
64
|
}
|
|
65
|
+
|
|
66
|
+
.m-product-item-wrap {
|
|
67
|
+
border-radius: 8px;
|
|
68
|
+
|
|
69
|
+
.img-wrap {
|
|
70
|
+
border-radius: 8px 8px 0 0;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
65
73
|
}
|
|
66
74
|
|
|
67
75
|
.arrow-icon {
|
|
@@ -7,6 +7,8 @@ exports["default"] = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
|
+
var _mobxReact = require("mobx-react");
|
|
11
|
+
|
|
10
12
|
var _common = require("../../../../common");
|
|
11
13
|
|
|
12
14
|
var _ImageConfig = _interopRequireDefault(require("../../../../meta-comp/config-panels/ImageConfig"));
|
|
@@ -15,12 +17,26 @@ var _TextConfig = _interopRequireDefault(require("../../../../meta-comp/config-p
|
|
|
15
17
|
|
|
16
18
|
var _BaseConfig = _interopRequireDefault(require("../../../../meta-comp/config-panels/BaseConfig"));
|
|
17
19
|
|
|
20
|
+
var _GroupList = _interopRequireDefault(require("../../../../common/GroupList"));
|
|
21
|
+
|
|
22
|
+
var _Button = _interopRequireDefault(require("../../../../common/Button"));
|
|
23
|
+
|
|
18
24
|
var _locale = require("../../../../locale");
|
|
19
25
|
|
|
20
26
|
var _coreUtil = require("../../../../utils/coreUtil");
|
|
21
27
|
|
|
28
|
+
var _defaultImg = _interopRequireDefault(require("../../../../common/GroupList/defaultImg.png"));
|
|
29
|
+
|
|
30
|
+
var _defaultJSON = require("../../components/GroupedImage/defaultJSON");
|
|
31
|
+
|
|
32
|
+
var _mobx = require("../../../../mobx");
|
|
33
|
+
|
|
34
|
+
require("./index.less");
|
|
35
|
+
|
|
22
36
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
23
37
|
|
|
38
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
39
|
+
|
|
24
40
|
var __extends = void 0 && (void 0).__extends || function () {
|
|
25
41
|
var _extendStatics = function extendStatics(d, b) {
|
|
26
42
|
_extendStatics = Object.setPrototypeOf || {
|
|
@@ -63,13 +79,45 @@ var __assign = void 0 && (void 0).__assign || function () {
|
|
|
63
79
|
return __assign.apply(this, arguments);
|
|
64
80
|
};
|
|
65
81
|
|
|
82
|
+
var __decorate = void 0 && (void 0).__decorate || function (decorators, target, key, desc) {
|
|
83
|
+
var c = arguments.length,
|
|
84
|
+
r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
|
|
85
|
+
d;
|
|
86
|
+
if ((typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) {
|
|
87
|
+
if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
88
|
+
}
|
|
89
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
90
|
+
};
|
|
91
|
+
|
|
66
92
|
var GroupedImageSecondConfig =
|
|
67
93
|
/** @class */
|
|
68
94
|
function (_super) {
|
|
69
95
|
__extends(GroupedImageSecondConfig, _super);
|
|
70
96
|
|
|
71
97
|
function GroupedImageSecondConfig() {
|
|
72
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
98
|
+
var _this = _super !== null && _super.apply(this, arguments) || this; // 数据迁移:将旧的image1-4迁移到images数组
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
_this.migrateData = function (panelProps) {
|
|
102
|
+
if (!panelProps.images && (panelProps.image1 || panelProps.image2 || panelProps.image3 || panelProps.image4)) {
|
|
103
|
+
panelProps.images = [];
|
|
104
|
+
[panelProps.image1, panelProps.image2, panelProps.image3, panelProps.image4].forEach(function (img) {
|
|
105
|
+
if (img) {
|
|
106
|
+
panelProps.images.push(img);
|
|
107
|
+
}
|
|
108
|
+
}); // 删除旧字段
|
|
109
|
+
|
|
110
|
+
delete panelProps.image1;
|
|
111
|
+
delete panelProps.image2;
|
|
112
|
+
delete panelProps.image3;
|
|
113
|
+
delete panelProps.image4;
|
|
114
|
+
} // 确保images数组存在
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
if (!panelProps.images) {
|
|
118
|
+
panelProps.images = [];
|
|
119
|
+
}
|
|
120
|
+
};
|
|
73
121
|
|
|
74
122
|
_this.getContentPanel = function () {
|
|
75
123
|
var panelProps = _this.props.panelProps;
|
|
@@ -87,34 +135,6 @@ function (_super) {
|
|
|
87
135
|
data: panelProps.title
|
|
88
136
|
}),
|
|
89
137
|
metaOption: panelProps.title
|
|
90
|
-
}, {
|
|
91
|
-
key: 'defaultSource_3',
|
|
92
|
-
name: (0, _locale.i18n)('IMAGE') + " 1",
|
|
93
|
-
value: /*#__PURE__*/_react["default"].createElement(_ImageConfig["default"], {
|
|
94
|
-
data: panelProps.image1
|
|
95
|
-
}),
|
|
96
|
-
metaOption: panelProps.image1
|
|
97
|
-
}, {
|
|
98
|
-
key: 'defaultSource_4',
|
|
99
|
-
name: (0, _locale.i18n)('IMAGE') + " 2",
|
|
100
|
-
value: /*#__PURE__*/_react["default"].createElement(_ImageConfig["default"], {
|
|
101
|
-
data: panelProps.image2
|
|
102
|
-
}),
|
|
103
|
-
metaOption: panelProps.image2
|
|
104
|
-
}, {
|
|
105
|
-
key: 'defaultSource_5',
|
|
106
|
-
name: (0, _locale.i18n)('IMAGE') + " 3",
|
|
107
|
-
value: /*#__PURE__*/_react["default"].createElement(_ImageConfig["default"], {
|
|
108
|
-
data: panelProps.image3
|
|
109
|
-
}),
|
|
110
|
-
metaOption: panelProps.image3
|
|
111
|
-
}, {
|
|
112
|
-
key: 'defaultSource_6',
|
|
113
|
-
name: (0, _locale.i18n)('IMAGE') + " 4",
|
|
114
|
-
value: /*#__PURE__*/_react["default"].createElement(_ImageConfig["default"], {
|
|
115
|
-
data: panelProps.image4
|
|
116
|
-
}),
|
|
117
|
-
metaOption: panelProps.image4
|
|
118
138
|
}];
|
|
119
139
|
return /*#__PURE__*/_react["default"].createElement(_common.Collapse, {
|
|
120
140
|
headerSize: "middle",
|
|
@@ -127,6 +147,69 @@ function (_super) {
|
|
|
127
147
|
});
|
|
128
148
|
};
|
|
129
149
|
|
|
150
|
+
_this.getImagePanel = function () {
|
|
151
|
+
var panelProps = _this.props.panelProps;
|
|
152
|
+
var clickedImage = _mobx.store.clickedImage; // 如果选中了图片,不显示图片列表,由ConfigPanel统一处理第三级面板
|
|
153
|
+
|
|
154
|
+
if (clickedImage) {
|
|
155
|
+
return null;
|
|
156
|
+
} // 显示图片列表
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
var renderCard = function renderCard(src) {
|
|
160
|
+
var _a, _b;
|
|
161
|
+
|
|
162
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
163
|
+
className: "card_wrap"
|
|
164
|
+
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
165
|
+
alt: "",
|
|
166
|
+
src: ((0, _coreUtil.isPc)() ? (_a = src.content) === null || _a === void 0 ? void 0 : _a.pcImgSrc : (_b = src.content) === null || _b === void 0 ? void 0 : _b.h5ImgSrc) || _defaultImg["default"]
|
|
167
|
+
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
168
|
+
className: "name"
|
|
169
|
+
}, "Image Name"));
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
var onClickItem = function onClickItem(node) {
|
|
173
|
+
_mobx.store.setState({
|
|
174
|
+
clickedImage: node.id
|
|
175
|
+
});
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
var onAddClick = function onAddClick() {
|
|
179
|
+
if (!panelProps.images) {
|
|
180
|
+
panelProps.images = [];
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
var newImage = (0, _defaultJSON.createImageMeta)(panelProps.id);
|
|
184
|
+
panelProps.images.push(newImage);
|
|
185
|
+
|
|
186
|
+
_this.setState({});
|
|
187
|
+
|
|
188
|
+
(0, _coreUtil.renderPreview)();
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
var reRender = function reRender() {
|
|
192
|
+
_this.setState({});
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
196
|
+
className: "node_list"
|
|
197
|
+
}, !panelProps.images || panelProps.images.length === 0 ? /*#__PURE__*/_react["default"].createElement("span", {
|
|
198
|
+
className: "notice"
|
|
199
|
+
}) : /*#__PURE__*/_react["default"].createElement(_GroupList["default"], {
|
|
200
|
+
onClickItem: onClickItem,
|
|
201
|
+
renderCard: renderCard,
|
|
202
|
+
reRender: reRender,
|
|
203
|
+
source: panelProps.images || []
|
|
204
|
+
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
205
|
+
className: "btn_wrap"
|
|
206
|
+
}, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
207
|
+
icon: "icon-add",
|
|
208
|
+
onClick: onAddClick,
|
|
209
|
+
type: "primary"
|
|
210
|
+
}, (0, _locale.i18n)('ADD_IMAGE'))));
|
|
211
|
+
};
|
|
212
|
+
|
|
130
213
|
_this.resetHover = function () {
|
|
131
214
|
var panelProps = _this.props.panelProps;
|
|
132
215
|
|
|
@@ -138,6 +221,16 @@ function (_super) {
|
|
|
138
221
|
return _this;
|
|
139
222
|
}
|
|
140
223
|
|
|
224
|
+
GroupedImageSecondConfig.prototype.componentDidMount = function () {
|
|
225
|
+
var panelProps = this.props.panelProps;
|
|
226
|
+
this.migrateData(panelProps);
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
GroupedImageSecondConfig.prototype.componentWillReceiveProps = function (nextProps) {
|
|
230
|
+
var panelProps = nextProps.panelProps;
|
|
231
|
+
this.migrateData(panelProps);
|
|
232
|
+
};
|
|
233
|
+
|
|
141
234
|
GroupedImageSecondConfig.prototype.render = function () {
|
|
142
235
|
var _this = this;
|
|
143
236
|
|
|
@@ -174,6 +267,10 @@ function (_super) {
|
|
|
174
267
|
value: this.getContentPanel()
|
|
175
268
|
}, {
|
|
176
269
|
key: '2',
|
|
270
|
+
name: (0, _locale.i18n)('IMAGE'),
|
|
271
|
+
value: this.getImagePanel()
|
|
272
|
+
}, {
|
|
273
|
+
key: '3',
|
|
177
274
|
name: (0, _locale.i18n)('HOVER'),
|
|
178
275
|
value: hoverPanel,
|
|
179
276
|
metaOption: panelProps.hover,
|
|
@@ -185,6 +282,7 @@ function (_super) {
|
|
|
185
282
|
GroupedImageSecondConfig.defaultProps = {
|
|
186
283
|
panelProps: {}
|
|
187
284
|
};
|
|
285
|
+
GroupedImageSecondConfig = __decorate([(0, _mobxReact.inject)('store'), _mobxReact.observer], GroupedImageSecondConfig);
|
|
188
286
|
return GroupedImageSecondConfig;
|
|
189
287
|
}(_BaseConfig["default"]);
|
|
190
288
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
.grouped_image_second_conf_wrap {
|
|
2
|
+
.config_header {
|
|
3
|
+
.button_wrap {
|
|
4
|
+
display: flex;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.title {
|
|
8
|
+
margin-top: 20px;
|
|
9
|
+
font-family: 'Open Sans';
|
|
10
|
+
font-style: normal;
|
|
11
|
+
font-weight: 700;
|
|
12
|
+
font-size: 26px;
|
|
13
|
+
line-height: 32px;
|
|
14
|
+
color: #232F46;
|
|
15
|
+
overflow: hidden;
|
|
16
|
+
text-overflow: ellipsis;
|
|
17
|
+
white-space: nowrap;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
@@ -71,7 +71,7 @@ function (_super) {
|
|
|
71
71
|
value: /*#__PURE__*/_react["default"].createElement(_ImageConfig["default"], {
|
|
72
72
|
data: panelProps.image,
|
|
73
73
|
needClickArea: false,
|
|
74
|
-
onlySpecificCode:
|
|
74
|
+
onlySpecificCode: ['CustomizedPage', 'FunctionPage']
|
|
75
75
|
}),
|
|
76
76
|
metaOption: panelProps.image
|
|
77
77
|
}];
|
package/es/constants/index.js
CHANGED