@fonixtree/magic-design 0.0.58 → 0.0.60
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/README.md +320 -0
- package/es/assets/fonts/magic-box-iconfont.css +20 -8
- package/es/assets/fonts/magic-box-iconfont.css.bak +20 -8
- package/es/assets/fonts/magic-box-iconfont.js +1 -1
- package/es/assets/fonts/magic-box-iconfont.js.bak +1 -1
- package/es/assets/fonts/magic-box-iconfont.ttf +0 -0
- package/es/assets/fonts/magic-box-iconfont.woff +0 -0
- package/es/assets/fonts/magic-box-iconfont.woff2 +0 -0
- package/es/common/Button/index.js +2 -1
- package/es/common/Button/index.less +5 -0
- package/es/composite-comp/bol/components/Banner/defaultJSON.js +2 -2
- package/es/composite-comp/bol/config-panels/TextCompConfig/TextConfigGroup/index.js +3 -1
- package/es/composite-comp/common/components/ProductItem/index.less +3 -3
- package/es/composite-comp/dito/components/PcNavigation/defaultJSON.js +13 -9
- package/es/composite-comp/dito/components/PcNavigation/pc/index.js +46 -14
- package/es/composite-comp/dito/components/PcNavigation/pc/index.less +8 -5
- package/es/composite-comp/dito/components/Recommend/mobile/index.less +1 -1
- package/es/composite-comp/dito/components/Recommend/pc/index.less +1 -1
- package/es/composite-comp/dito/components/SearchBar/defaultJSON.js +2 -2
- package/es/composite-comp/dito/components/SearchBar/index.js +5 -1
- package/es/composite-comp/dito/components/SearchBar/mobile/index.js +23 -24
- package/es/composite-comp/dito/components/SearchBar/mobile/index.less +13 -3
- package/es/composite-comp/dito/components/SearchBar/pc/index.js +151 -0
- package/es/composite-comp/dito/components/SearchBar/pc/index.less +57 -0
- package/es/composite-comp/dito/config-panels/PcNavigationConfig/PcNavConfigCategory/index.js +15 -2
- package/es/core/Designer/CompListPanel/index.js +8 -33
- package/es/core/Designer/ConfigPanel/TerminalSelect/index.js +73 -0
- package/es/core/Designer/ConfigPanel/TerminalSelect/index.less +29 -0
- package/es/core/Designer/ConfigPanel/index.js +28 -7
- package/es/core/Designer/ConfigPanel/index.less +4 -0
- package/es/core/Designer/History/index.js +0 -2
- package/es/core/Designer/PageCompList/index.js +9 -1
- package/es/core/Designer/ViewArea/index.js +20 -6
- package/es/core/Designer/index.js +22 -26
- package/es/core/Renderer/index.js +17 -2
- package/es/decorator/compositeDecorator.js +0 -1
- package/es/decorator/updateConfigDecorator.js +2 -2
- package/es/locale/en/en.json +2 -0
- package/es/locale/es/es.json +2 -0
- package/es/locale/id/id.json +2 -0
- package/es/meta-comp/components/Button/index.js +1 -1
- package/es/meta-comp/components/Button/index.less +5 -0
- package/es/mobx/Store.js +4 -0
- package/es/utils/coreUtil.js +8 -1
- package/lib/assets/fonts/magic-box-iconfont.css +20 -8
- package/lib/assets/fonts/magic-box-iconfont.css.bak +20 -8
- package/lib/assets/fonts/magic-box-iconfont.js +1 -1
- package/lib/assets/fonts/magic-box-iconfont.js.bak +1 -1
- package/lib/assets/fonts/magic-box-iconfont.ttf +0 -0
- package/lib/assets/fonts/magic-box-iconfont.woff +0 -0
- package/lib/assets/fonts/magic-box-iconfont.woff2 +0 -0
- package/lib/common/Button/index.js +2 -1
- package/lib/common/Button/index.less +5 -0
- package/lib/composite-comp/bol/components/Banner/defaultJSON.js +2 -2
- package/lib/composite-comp/bol/config-panels/TextCompConfig/TextConfigGroup/index.js +3 -1
- package/lib/composite-comp/common/components/ProductItem/index.less +3 -3
- package/lib/composite-comp/dito/components/PcNavigation/defaultJSON.js +13 -9
- package/lib/composite-comp/dito/components/PcNavigation/pc/index.js +46 -14
- package/lib/composite-comp/dito/components/PcNavigation/pc/index.less +8 -5
- package/lib/composite-comp/dito/components/Recommend/mobile/index.less +1 -1
- package/lib/composite-comp/dito/components/Recommend/pc/index.less +1 -1
- package/lib/composite-comp/dito/components/SearchBar/defaultJSON.js +2 -2
- package/lib/composite-comp/dito/components/SearchBar/index.js +5 -1
- package/lib/composite-comp/dito/components/SearchBar/mobile/index.js +23 -24
- package/lib/composite-comp/dito/components/SearchBar/mobile/index.less +13 -3
- package/lib/composite-comp/dito/components/SearchBar/pc/index.js +151 -0
- package/lib/composite-comp/dito/components/SearchBar/pc/index.less +57 -0
- package/lib/composite-comp/dito/config-panels/PcNavigationConfig/PcNavConfigCategory/index.js +15 -2
- package/lib/core/Designer/CompListPanel/index.js +8 -33
- package/lib/core/Designer/ConfigPanel/TerminalSelect/index.js +73 -0
- package/lib/core/Designer/ConfigPanel/TerminalSelect/index.less +29 -0
- package/lib/core/Designer/ConfigPanel/index.js +28 -7
- package/lib/core/Designer/ConfigPanel/index.less +4 -0
- package/lib/core/Designer/History/index.js +0 -2
- package/lib/core/Designer/PageCompList/index.js +9 -1
- package/lib/core/Designer/ViewArea/index.js +20 -6
- package/lib/core/Designer/index.js +22 -26
- package/lib/core/Renderer/index.js +17 -2
- package/lib/decorator/compositeDecorator.js +0 -1
- package/lib/decorator/updateConfigDecorator.js +2 -2
- package/lib/locale/en/en.json +2 -0
- package/lib/locale/es/es.json +2 -0
- package/lib/locale/id/id.json +2 -0
- package/lib/meta-comp/components/Button/index.js +1 -1
- package/lib/meta-comp/components/Button/index.less +5 -0
- package/lib/mobx/Store.js +4 -0
- package/lib/utils/coreUtil.js +8 -1
- package/package.json +86 -1
|
@@ -25,7 +25,7 @@ var getDefaultJSON = function getDefaultJSON() {
|
|
|
25
25
|
h5Name: 'name2',
|
|
26
26
|
pcName: 'name2',
|
|
27
27
|
h5ImgSrc: _ditoLogo["default"],
|
|
28
|
-
pcImgSrc:
|
|
28
|
+
pcImgSrc: _ditoLogo["default"],
|
|
29
29
|
clickUrl: ''
|
|
30
30
|
},
|
|
31
31
|
hover: {
|
|
@@ -38,7 +38,7 @@ var getDefaultJSON = function getDefaultJSON() {
|
|
|
38
38
|
},
|
|
39
39
|
icon: {
|
|
40
40
|
open: true,
|
|
41
|
-
color: '#
|
|
41
|
+
color: '#D92929'
|
|
42
42
|
},
|
|
43
43
|
customize: {
|
|
44
44
|
layout: 'left',
|
|
@@ -11,6 +11,8 @@ var _defaultJSON = require("./defaultJSON");
|
|
|
11
11
|
|
|
12
12
|
var _index = _interopRequireDefault(require("./mobile/index"));
|
|
13
13
|
|
|
14
|
+
var _index2 = _interopRequireDefault(require("./pc/index"));
|
|
15
|
+
|
|
14
16
|
var _coreUtil = require("../../../../utils/coreUtil");
|
|
15
17
|
|
|
16
18
|
var _compositeDecorator = _interopRequireDefault(require("../../../../decorator/compositeDecorator"));
|
|
@@ -70,7 +72,9 @@ function (_super) {
|
|
|
70
72
|
|
|
71
73
|
SearchBar.prototype.render = function () {
|
|
72
74
|
var nodeData = this.props.nodeData;
|
|
73
|
-
return /*#__PURE__*/_react["default"].createElement("div", null, (0, _coreUtil.isPc)() ?
|
|
75
|
+
return /*#__PURE__*/_react["default"].createElement("div", null, (0, _coreUtil.isPc)() ? /*#__PURE__*/_react["default"].createElement(_index2["default"], {
|
|
76
|
+
data: nodeData
|
|
77
|
+
}) : /*#__PURE__*/_react["default"].createElement(_index["default"], {
|
|
74
78
|
data: nodeData
|
|
75
79
|
}));
|
|
76
80
|
};
|
|
@@ -233,44 +233,43 @@ function (_super) {
|
|
|
233
233
|
|
|
234
234
|
SearchMobile.prototype.render = function () {
|
|
235
235
|
var data = this.props.data;
|
|
236
|
-
var messageNum = this.state.messageNum;
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
};
|
|
251
|
-
}
|
|
236
|
+
var messageNum = this.state.messageNum; // let styleWrap = {};
|
|
237
|
+
// if (data.background.bgType === 'color') {
|
|
238
|
+
// styleWrap = {
|
|
239
|
+
// backgroundColor: data.background.color,
|
|
240
|
+
// opacity: data.background.opacity,
|
|
241
|
+
// };
|
|
242
|
+
// } else {
|
|
243
|
+
// styleWrap = {
|
|
244
|
+
// backgroundImage: `url(${data.background.image})`,
|
|
245
|
+
// backgroundPosition: 'center',
|
|
246
|
+
// backgroundRepeat: 'no-repeat',
|
|
247
|
+
// backgroundSize: '100%',
|
|
248
|
+
// };
|
|
249
|
+
// }
|
|
252
250
|
|
|
253
251
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
254
|
-
className: "m-search-bar"
|
|
255
|
-
style: styleWrap
|
|
252
|
+
className: "m-search-bar"
|
|
256
253
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
257
254
|
className: "right"
|
|
258
|
-
}, /*#__PURE__*/_react["default"].createElement(
|
|
259
|
-
|
|
255
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
256
|
+
className: "search-input-wrap",
|
|
260
257
|
onClick: function onClick() {
|
|
261
258
|
return (0, _coreUtil.clickUrl)('/search-page');
|
|
262
|
-
}
|
|
259
|
+
}
|
|
260
|
+
}, /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
|
|
261
|
+
color: "#8493AF",
|
|
263
262
|
size: 24,
|
|
264
263
|
type: "icon-search2"
|
|
265
|
-
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
264
|
+
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
266
265
|
className: "message-wrap"
|
|
267
266
|
}, /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
|
|
268
|
-
color: "#
|
|
267
|
+
color: "#262626",
|
|
269
268
|
onClick: function onClick() {
|
|
270
269
|
return (0, _coreUtil.clickUrl)('/message-center');
|
|
271
270
|
},
|
|
272
271
|
size: 24,
|
|
273
|
-
type: "icon-
|
|
272
|
+
type: "icon-ChatDots"
|
|
274
273
|
}), !!messageNum && /*#__PURE__*/_react["default"].createElement("span", {
|
|
275
274
|
className: "num"
|
|
276
275
|
}, messageNum))), data.logo.open && /*#__PURE__*/_react["default"].createElement(_components.MetaImage, {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
.m-search-bar {
|
|
2
|
-
height:
|
|
3
|
-
padding:
|
|
2
|
+
height: 48px;
|
|
3
|
+
padding: 8px 16px;
|
|
4
4
|
display: flex;
|
|
5
5
|
flex-direction: row-reverse;
|
|
6
6
|
align-items: center;
|
|
@@ -8,13 +8,23 @@
|
|
|
8
8
|
width: 100%;
|
|
9
9
|
|
|
10
10
|
.right {
|
|
11
|
-
width: 60px;
|
|
12
11
|
display: flex;
|
|
13
12
|
align-items: center;
|
|
14
13
|
justify-content: space-between;
|
|
15
14
|
|
|
15
|
+
.search-input-wrap {
|
|
16
|
+
width: 195px;
|
|
17
|
+
background: #fff;
|
|
18
|
+
border-radius: 4px;
|
|
19
|
+
border: 1px solid #D2D9E5;
|
|
20
|
+
padding: 4px 12px;
|
|
21
|
+
height: 32px;
|
|
22
|
+
text-align: right;
|
|
23
|
+
}
|
|
24
|
+
|
|
16
25
|
.message-wrap {
|
|
17
26
|
position: relative;
|
|
27
|
+
margin-left: 16px;
|
|
18
28
|
|
|
19
29
|
.num {
|
|
20
30
|
position: absolute;
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
require("./index.less");
|
|
11
|
+
|
|
12
|
+
var _antd = require("antd");
|
|
13
|
+
|
|
14
|
+
var _locale = require("../../../../../locale");
|
|
15
|
+
|
|
16
|
+
var _components = require("../../../../../meta-comp/components");
|
|
17
|
+
|
|
18
|
+
var _common = require("../../../../../common");
|
|
19
|
+
|
|
20
|
+
var _coreUtil = require("../../../../../utils/coreUtil");
|
|
21
|
+
|
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
23
|
+
|
|
24
|
+
var __extends = void 0 && (void 0).__extends || function () {
|
|
25
|
+
var _extendStatics = function extendStatics(d, b) {
|
|
26
|
+
_extendStatics = Object.setPrototypeOf || {
|
|
27
|
+
__proto__: []
|
|
28
|
+
} instanceof Array && function (d, b) {
|
|
29
|
+
d.__proto__ = b;
|
|
30
|
+
} || function (d, b) {
|
|
31
|
+
for (var p in b) {
|
|
32
|
+
if (b.hasOwnProperty(p)) d[p] = b[p];
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
return _extendStatics(d, b);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
return function (d, b) {
|
|
40
|
+
_extendStatics(d, b);
|
|
41
|
+
|
|
42
|
+
function __() {
|
|
43
|
+
this.constructor = d;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
47
|
+
};
|
|
48
|
+
}();
|
|
49
|
+
|
|
50
|
+
var SearchPc =
|
|
51
|
+
/** @class */
|
|
52
|
+
function (_super) {
|
|
53
|
+
__extends(SearchPc, _super);
|
|
54
|
+
|
|
55
|
+
function SearchPc() {
|
|
56
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
57
|
+
|
|
58
|
+
_this.state = {
|
|
59
|
+
// messageNum: '',
|
|
60
|
+
inputVal: ''
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
_this.onChangeVal = function (val) {
|
|
64
|
+
// console.log('--onChangeVal', val);
|
|
65
|
+
_this.setState({
|
|
66
|
+
inputVal: val
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
_this.searchProduct = function () {
|
|
71
|
+
console.log('--input', _this.state.inputVal);
|
|
72
|
+
(0, _coreUtil.clickUrl)({
|
|
73
|
+
pathname: "/product/list?q=" + _this.state.inputVal
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
_this.keyUp = function (e) {
|
|
78
|
+
if (e.keyCode === 13) {
|
|
79
|
+
_this.searchProduct();
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
return _this;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
SearchPc.prototype.componentDidMount = function () {};
|
|
87
|
+
|
|
88
|
+
SearchPc.prototype.render = function () {
|
|
89
|
+
var _this = this;
|
|
90
|
+
|
|
91
|
+
var data = this.props.data;
|
|
92
|
+
var inputVal = this.state.inputVal;
|
|
93
|
+
console.log('--pc data', data);
|
|
94
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
95
|
+
className: "pc-search-bar"
|
|
96
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
97
|
+
className: "right"
|
|
98
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
99
|
+
className: "search-input-wrap",
|
|
100
|
+
style: {
|
|
101
|
+
borderColor: data.icon.color
|
|
102
|
+
}
|
|
103
|
+
}, /*#__PURE__*/_react["default"].createElement(_antd.Input, {
|
|
104
|
+
className: "search-input",
|
|
105
|
+
onChange: function onChange(e) {
|
|
106
|
+
return _this.onChangeVal(e.target.value);
|
|
107
|
+
},
|
|
108
|
+
onKeyUp: this.keyUp,
|
|
109
|
+
placeholder: (0, _locale.i18n)('PLEASE_INPUT_KEYWORDS'),
|
|
110
|
+
value: inputVal
|
|
111
|
+
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
112
|
+
className: "search-icon",
|
|
113
|
+
onClick: this.searchProduct,
|
|
114
|
+
style: {
|
|
115
|
+
background: data.icon.color
|
|
116
|
+
}
|
|
117
|
+
}, /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
|
|
118
|
+
color: "#fff",
|
|
119
|
+
size: 24,
|
|
120
|
+
type: "icon-search2"
|
|
121
|
+
}))), /*#__PURE__*/_react["default"].createElement("div", {
|
|
122
|
+
className: "shopping-wrap",
|
|
123
|
+
onClick: function onClick() {
|
|
124
|
+
return (0, _coreUtil.clickUrl)('/cart');
|
|
125
|
+
},
|
|
126
|
+
style: {
|
|
127
|
+
borderColor: data.icon.color,
|
|
128
|
+
color: data.icon.color
|
|
129
|
+
}
|
|
130
|
+
}, /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
|
|
131
|
+
color: data.icon.color,
|
|
132
|
+
size: 16,
|
|
133
|
+
type: "icon-ShoppingCartSimple"
|
|
134
|
+
}), /*#__PURE__*/_react["default"].createElement("span", {
|
|
135
|
+
className: "shopping-txt"
|
|
136
|
+
}, (0, _locale.i18n)('SHOPPING_CART')))), data.logo.open && /*#__PURE__*/_react["default"].createElement(_components.MetaImage, {
|
|
137
|
+
data: data.logo,
|
|
138
|
+
style: {
|
|
139
|
+
height: 64
|
|
140
|
+
}
|
|
141
|
+
}));
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
SearchPc.defaultProps = {
|
|
145
|
+
data: {}
|
|
146
|
+
};
|
|
147
|
+
return SearchPc;
|
|
148
|
+
}(_react["default"].Component);
|
|
149
|
+
|
|
150
|
+
var _default = SearchPc;
|
|
151
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
.pc-search-bar {
|
|
2
|
+
// height: 48px;
|
|
3
|
+
padding: 20px 100px 30px;
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: row-reverse;
|
|
6
|
+
align-items: flex-start;
|
|
7
|
+
justify-content: space-between;
|
|
8
|
+
width: 100%;
|
|
9
|
+
|
|
10
|
+
.right {
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
justify-content: space-between;
|
|
14
|
+
|
|
15
|
+
.search-input-wrap {
|
|
16
|
+
border: 1px solid #2F54EB;
|
|
17
|
+
border-radius: 6px;
|
|
18
|
+
height: 40px;
|
|
19
|
+
display: flex;
|
|
20
|
+
width: 440px;
|
|
21
|
+
.search-input {
|
|
22
|
+
border: none;
|
|
23
|
+
height: 38px;
|
|
24
|
+
box-shadow: none;
|
|
25
|
+
font-family: 'Open Sans';
|
|
26
|
+
font-style: normal;
|
|
27
|
+
font-weight: 400;
|
|
28
|
+
font-size: 14px;
|
|
29
|
+
}
|
|
30
|
+
.search-icon {
|
|
31
|
+
cursor: pointer;
|
|
32
|
+
height: 100%;
|
|
33
|
+
// width: 40px;
|
|
34
|
+
text-align: center;
|
|
35
|
+
padding: 8px;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.shopping-wrap {
|
|
40
|
+
border-radius: 4px;
|
|
41
|
+
margin-left: 16px;
|
|
42
|
+
padding: 8px 16px;
|
|
43
|
+
font-family: 'Open Sans';
|
|
44
|
+
font-style: normal;
|
|
45
|
+
font-weight: 400;
|
|
46
|
+
font-size: 14px;
|
|
47
|
+
line-height: 22px;
|
|
48
|
+
display: flex;
|
|
49
|
+
align-items: center;
|
|
50
|
+
cursor: pointer;
|
|
51
|
+
border: 1px solid #2F54EB;
|
|
52
|
+
.shopping-txt {
|
|
53
|
+
margin-left: 6px;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
package/es/composite-comp/dito/config-panels/PcNavigationConfig/PcNavConfigCategory/index.js
CHANGED
|
@@ -7,10 +7,12 @@ exports["default"] = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _common = require("../../../../../common");
|
|
11
11
|
|
|
12
12
|
var _coreUtil = require("../../../../../utils/coreUtil");
|
|
13
13
|
|
|
14
|
+
var _TextOnlyFontConfig = _interopRequireDefault(require("../TextOnlyFontConfig"));
|
|
15
|
+
|
|
14
16
|
var _Collapse = _interopRequireDefault(require("../../../../../common/Collapse"));
|
|
15
17
|
|
|
16
18
|
var _locale = require("../../../../../locale");
|
|
@@ -69,7 +71,18 @@ function (_super) {
|
|
|
69
71
|
onRefresh: this.reRender,
|
|
70
72
|
source: [{
|
|
71
73
|
key: 'category1',
|
|
72
|
-
name: (
|
|
74
|
+
name: /*#__PURE__*/_react["default"].createElement("div", {
|
|
75
|
+
onClick: function onClick() {
|
|
76
|
+
return (0, _coreUtil.clickUrl)('/#/PageCategoryManagement');
|
|
77
|
+
}
|
|
78
|
+
}, (0, _locale.i18n)('ALL_CATEGORY'), /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
|
|
79
|
+
color: "#2F54EB",
|
|
80
|
+
size: 16,
|
|
81
|
+
style: {
|
|
82
|
+
marginLeft: 10
|
|
83
|
+
},
|
|
84
|
+
type: "icon-edit"
|
|
85
|
+
})),
|
|
73
86
|
value: /*#__PURE__*/_react["default"].createElement(_TextOnlyFontConfig["default"], {
|
|
74
87
|
data: panelProps.allCategory,
|
|
75
88
|
needIcon: true
|
|
@@ -19,6 +19,8 @@ require("./index.less");
|
|
|
19
19
|
|
|
20
20
|
var _locale = require("../../../locale");
|
|
21
21
|
|
|
22
|
+
var _coreUtil = require("../../../utils/coreUtil");
|
|
23
|
+
|
|
22
24
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
25
|
|
|
24
26
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -114,10 +116,12 @@ function (_super) {
|
|
|
114
116
|
}, /*#__PURE__*/_react["default"].createElement("h5", {
|
|
115
117
|
className: "cat-name"
|
|
116
118
|
}, compCat, "(", "" + compSource[compCat].length, ")"), compSource[compCat].map(function (comp) {
|
|
117
|
-
return /*#__PURE__*/_react["default"].createElement(_CompCard["default"], _extends({}, comp, {
|
|
119
|
+
return (0, _coreUtil.isActiveFloor)(comp.terminalType) ? /*#__PURE__*/_react["default"].createElement(_CompCard["default"], _extends({}, comp, {
|
|
118
120
|
key: comp.moduleId,
|
|
119
|
-
onAdd:
|
|
120
|
-
|
|
121
|
+
onAdd: function onAdd() {
|
|
122
|
+
return _this.onAddClick(comp);
|
|
123
|
+
}
|
|
124
|
+
})) : null;
|
|
121
125
|
}));
|
|
122
126
|
})));
|
|
123
127
|
};
|
|
@@ -125,34 +129,5 @@ function (_super) {
|
|
|
125
129
|
return CompListPanel;
|
|
126
130
|
}(_react.Component);
|
|
127
131
|
|
|
128
|
-
var _default = CompListPanel;
|
|
129
|
-
// useEffect(() => {
|
|
130
|
-
// if (visible) {
|
|
131
|
-
// document.getElementsByClassName('component-list')[0].scrollTop = 0;
|
|
132
|
-
// }
|
|
133
|
-
// }, [visible]);
|
|
134
|
-
// return (
|
|
135
|
-
// <div className={classNames('compListPanel', { visible })}>
|
|
136
|
-
// <header className="header">
|
|
137
|
-
// <Button icon="icon-close" onClick={onClose} type="icon" />
|
|
138
|
-
// </header>
|
|
139
|
-
// <h2 className="title">{i18n('ADD_COMPONENT')}</h2>
|
|
140
|
-
// <div className="component-list">
|
|
141
|
-
// {
|
|
142
|
-
// Object.keys(compSource).map(compCat => (
|
|
143
|
-
// <div key={compCat} className="cat-list">
|
|
144
|
-
// <h5 className="cat-name">{compCat}({`${compSource[compCat].length}`})</h5>
|
|
145
|
-
// {
|
|
146
|
-
// compSource[compCat].map(comp => (
|
|
147
|
-
// <CompCard {...comp} key={comp.moduleId} onAdd={onAdd} />
|
|
148
|
-
// ))
|
|
149
|
-
// }
|
|
150
|
-
// </div>
|
|
151
|
-
// ))
|
|
152
|
-
// }
|
|
153
|
-
// </div>
|
|
154
|
-
// </div>
|
|
155
|
-
// );
|
|
156
|
-
// }
|
|
157
|
-
|
|
132
|
+
var _default = CompListPanel;
|
|
158
133
|
exports["default"] = _default;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = TerminalSelect;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _common = require("../../../../common");
|
|
11
|
+
|
|
12
|
+
require("./index.less");
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
|
+
|
|
16
|
+
function TerminalSelect(_a) {
|
|
17
|
+
var value = _a.value,
|
|
18
|
+
onChange = _a.onChange,
|
|
19
|
+
terminalType = _a.terminalType;
|
|
20
|
+
var isActiveMobile = ['MOBILE', 'ALL'].includes(value);
|
|
21
|
+
var isActivePc = ['PC', 'ALL'].includes(value);
|
|
22
|
+
|
|
23
|
+
var onTerminalClick = function onTerminalClick(terminal) {
|
|
24
|
+
// 至少选中一种终端
|
|
25
|
+
if (value === terminal) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (value === 'ALL') {
|
|
30
|
+
if (terminal === 'PC') {
|
|
31
|
+
onChange('MOBILE');
|
|
32
|
+
} else {
|
|
33
|
+
onChange('PC');
|
|
34
|
+
}
|
|
35
|
+
} else {
|
|
36
|
+
onChange('ALL');
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
41
|
+
className: "terminal_wrap"
|
|
42
|
+
}, ['MOBILE', 'ALL'].includes(terminalType) && /*#__PURE__*/_react["default"].createElement("div", {
|
|
43
|
+
className: "terminal_item",
|
|
44
|
+
onClick: function onClick() {
|
|
45
|
+
return onTerminalClick('MOBILE');
|
|
46
|
+
}
|
|
47
|
+
}, /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
|
|
48
|
+
color: isActiveMobile ? '#2F54EB' : '#C4C4C4',
|
|
49
|
+
size: 20,
|
|
50
|
+
type: "icon-mobile"
|
|
51
|
+
}), /*#__PURE__*/_react["default"].createElement("span", {
|
|
52
|
+
className: "select"
|
|
53
|
+
}, /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
|
|
54
|
+
color: isActiveMobile ? '#00AC5A' : '#A3AEC3',
|
|
55
|
+
size: 9,
|
|
56
|
+
type: "icon-select"
|
|
57
|
+
}))), ['PC', 'ALL'].includes(terminalType) && /*#__PURE__*/_react["default"].createElement("div", {
|
|
58
|
+
className: "terminal_item",
|
|
59
|
+
onClick: function onClick() {
|
|
60
|
+
return onTerminalClick('PC');
|
|
61
|
+
}
|
|
62
|
+
}, /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
|
|
63
|
+
color: isActivePc ? '#2F54EB' : '#C4C4C4',
|
|
64
|
+
size: 20,
|
|
65
|
+
type: "icon-pc"
|
|
66
|
+
}), /*#__PURE__*/_react["default"].createElement("span", {
|
|
67
|
+
className: "select"
|
|
68
|
+
}, /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
|
|
69
|
+
color: isActivePc ? '#00AC5A' : '#A3AEC3',
|
|
70
|
+
size: 9,
|
|
71
|
+
type: "icon-select"
|
|
72
|
+
}))));
|
|
73
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
.terminal_wrap {
|
|
2
|
+
display: flex;
|
|
3
|
+
.terminal_item {
|
|
4
|
+
position: relative;
|
|
5
|
+
display: flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
width: 24px;
|
|
9
|
+
height: 24px;
|
|
10
|
+
background-color: #EDF0F4;
|
|
11
|
+
border-radius: 2px;
|
|
12
|
+
cursor: pointer;
|
|
13
|
+
.select {
|
|
14
|
+
position: absolute;
|
|
15
|
+
right: -4px;
|
|
16
|
+
top: -4px;
|
|
17
|
+
line-height: 0;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
.terminal_item + .terminal_item {
|
|
21
|
+
margin-left: 16px;
|
|
22
|
+
}
|
|
23
|
+
.active {
|
|
24
|
+
background-color: #2F54EB;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
.terminal_wrap+ span {
|
|
28
|
+
margin-left: 14px;
|
|
29
|
+
}
|
|
@@ -9,6 +9,8 @@ exports["default"] = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
|
|
12
|
+
var _TerminalSelect = _interopRequireDefault(require("./TerminalSelect"));
|
|
13
|
+
|
|
12
14
|
var _coreUtil = require("../../../utils/coreUtil");
|
|
13
15
|
|
|
14
16
|
var _commonUtil = require("../../../utils/commonUtil");
|
|
@@ -72,10 +74,10 @@ function (_super) {
|
|
|
72
74
|
selectedNode: {}
|
|
73
75
|
};
|
|
74
76
|
|
|
75
|
-
_this.resetState = function (propsData) {
|
|
77
|
+
_this.resetState = function (propsData, clickedFloor) {
|
|
76
78
|
var pageData = propsData.pageData;
|
|
77
79
|
var selectedNode = pageData.find(function (floor) {
|
|
78
|
-
return floor.id ===
|
|
80
|
+
return floor.id === clickedFloor;
|
|
79
81
|
});
|
|
80
82
|
|
|
81
83
|
_this.setState({
|
|
@@ -252,7 +254,7 @@ function (_super) {
|
|
|
252
254
|
groupName = panelProps.groupName.text;
|
|
253
255
|
|
|
254
256
|
case 'TAG':
|
|
255
|
-
groupName =
|
|
257
|
+
groupName = '';
|
|
256
258
|
}
|
|
257
259
|
|
|
258
260
|
return groupName || 'Group Name';
|
|
@@ -268,6 +270,18 @@ function (_super) {
|
|
|
268
270
|
}));
|
|
269
271
|
};
|
|
270
272
|
|
|
273
|
+
_this.onTerminalChange = function (terminal) {
|
|
274
|
+
var selectedNode = _this.state.selectedNode;
|
|
275
|
+
selectedNode.activeTerminal = terminal;
|
|
276
|
+
|
|
277
|
+
_this.setState({
|
|
278
|
+
selectedNode: selectedNode
|
|
279
|
+
}); // 刷新页面组件列表 和 viewArea
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
(0, _coreUtil.renderPreview)();
|
|
283
|
+
};
|
|
284
|
+
|
|
271
285
|
return _this;
|
|
272
286
|
}
|
|
273
287
|
|
|
@@ -275,12 +289,12 @@ function (_super) {
|
|
|
275
289
|
var _this = this;
|
|
276
290
|
|
|
277
291
|
this.distroy = (0, _mobx.autorun)(function () {
|
|
278
|
-
_this.resetState(_this.props);
|
|
292
|
+
_this.resetState(_this.props, _mobx.store.clickedFloor);
|
|
279
293
|
});
|
|
280
294
|
};
|
|
281
295
|
|
|
282
296
|
ConfigPanel.prototype.componentWillReceiveProps = function (nextProps) {
|
|
283
|
-
this.resetState(nextProps);
|
|
297
|
+
this.resetState(nextProps, _mobx.store.clickedFloor);
|
|
284
298
|
};
|
|
285
299
|
|
|
286
300
|
ConfigPanel.prototype.componentWillUnmount = function () {
|
|
@@ -301,10 +315,17 @@ function (_super) {
|
|
|
301
315
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
302
316
|
className: "title",
|
|
303
317
|
title: (_a = _constants.compInfoMap[selectedNode === null || selectedNode === void 0 ? void 0 : selectedNode.type]) === null || _a === void 0 ? void 0 : _a.name
|
|
304
|
-
}, (_b = _constants.compInfoMap[selectedNode === null || selectedNode === void 0 ? void 0 : selectedNode.type]) === null || _b === void 0 ? void 0 : _b.name),
|
|
318
|
+
}, (_b = _constants.compInfoMap[selectedNode === null || selectedNode === void 0 ? void 0 : selectedNode.type]) === null || _b === void 0 ? void 0 : _b.name), /*#__PURE__*/_react["default"].createElement("div", {
|
|
319
|
+
className: "right_wrap"
|
|
320
|
+
}, /*#__PURE__*/_react["default"].createElement(_TerminalSelect["default"], {
|
|
321
|
+
onChange: this.onTerminalChange,
|
|
322
|
+
terminalType: selectedNode === null || selectedNode === void 0 ? void 0 : selectedNode.terminalType,
|
|
323
|
+
value: selectedNode === null || selectedNode === void 0 ? void 0 : selectedNode.activeTerminal
|
|
324
|
+
}), device === _constants.deviceTypeMap.PC && /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
305
325
|
onClick: this.onDoneClick,
|
|
326
|
+
size: "small",
|
|
306
327
|
type: "light"
|
|
307
|
-
}, (0, _locale.i18n)('DONE'))), this.getConfigPanelInstance()), /*#__PURE__*/_react["default"].createElement("div", {
|
|
328
|
+
}, (0, _locale.i18n)('DONE')))), this.getConfigPanelInstance()), /*#__PURE__*/_react["default"].createElement("div", {
|
|
308
329
|
className: "sec_config_wrap"
|
|
309
330
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
310
331
|
className: "config_header"
|