@fonixtree/magic-design 0.1.88 → 0.1.89
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/AffiliatePlatform/index.js +325 -0
- package/es/common/LinkModal/index.js +6 -0
- package/es/constants/index.js +3 -1
- package/es/core/Designer/index.js +1 -0
- package/es/utils/businessUtil.js +24 -0
- package/es/utils/coreUtil.js +4 -5
- package/lib/common/LinkModal/AffiliatePlatform/index.js +325 -0
- package/lib/common/LinkModal/index.js +6 -0
- package/lib/constants/index.js +3 -1
- package/lib/core/Designer/index.js +1 -0
- package/lib/utils/businessUtil.js +24 -0
- package/lib/utils/coreUtil.js +4 -5
- package/package.json +1 -1
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
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); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = AffiliatePlatform;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _antd = require("antd4");
|
|
13
|
+
|
|
14
|
+
var _locale = require("../../../locale");
|
|
15
|
+
|
|
16
|
+
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); }
|
|
17
|
+
|
|
18
|
+
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; }
|
|
19
|
+
|
|
20
|
+
var __assign = void 0 && (void 0).__assign || function () {
|
|
21
|
+
__assign = Object.assign || function (t) {
|
|
22
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
23
|
+
s = arguments[i];
|
|
24
|
+
|
|
25
|
+
for (var p in s) {
|
|
26
|
+
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return t;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
return __assign.apply(this, arguments);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
|
|
37
|
+
function adopt(value) {
|
|
38
|
+
return value instanceof P ? value : new P(function (resolve) {
|
|
39
|
+
resolve(value);
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
44
|
+
function fulfilled(value) {
|
|
45
|
+
try {
|
|
46
|
+
step(generator.next(value));
|
|
47
|
+
} catch (e) {
|
|
48
|
+
reject(e);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function rejected(value) {
|
|
53
|
+
try {
|
|
54
|
+
step(generator["throw"](value));
|
|
55
|
+
} catch (e) {
|
|
56
|
+
reject(e);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function step(result) {
|
|
61
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
|
|
69
|
+
var _ = {
|
|
70
|
+
label: 0,
|
|
71
|
+
sent: function sent() {
|
|
72
|
+
if (t[0] & 1) throw t[1];
|
|
73
|
+
return t[1];
|
|
74
|
+
},
|
|
75
|
+
trys: [],
|
|
76
|
+
ops: []
|
|
77
|
+
},
|
|
78
|
+
f,
|
|
79
|
+
y,
|
|
80
|
+
t,
|
|
81
|
+
g;
|
|
82
|
+
return g = {
|
|
83
|
+
next: verb(0),
|
|
84
|
+
"throw": verb(1),
|
|
85
|
+
"return": verb(2)
|
|
86
|
+
}, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
|
|
87
|
+
return this;
|
|
88
|
+
}), g;
|
|
89
|
+
|
|
90
|
+
function verb(n) {
|
|
91
|
+
return function (v) {
|
|
92
|
+
return step([n, v]);
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function step(op) {
|
|
97
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
98
|
+
|
|
99
|
+
while (_) {
|
|
100
|
+
try {
|
|
101
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
102
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
103
|
+
|
|
104
|
+
switch (op[0]) {
|
|
105
|
+
case 0:
|
|
106
|
+
case 1:
|
|
107
|
+
t = op;
|
|
108
|
+
break;
|
|
109
|
+
|
|
110
|
+
case 4:
|
|
111
|
+
_.label++;
|
|
112
|
+
return {
|
|
113
|
+
value: op[1],
|
|
114
|
+
done: false
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
case 5:
|
|
118
|
+
_.label++;
|
|
119
|
+
y = op[1];
|
|
120
|
+
op = [0];
|
|
121
|
+
continue;
|
|
122
|
+
|
|
123
|
+
case 7:
|
|
124
|
+
op = _.ops.pop();
|
|
125
|
+
|
|
126
|
+
_.trys.pop();
|
|
127
|
+
|
|
128
|
+
continue;
|
|
129
|
+
|
|
130
|
+
default:
|
|
131
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
132
|
+
_ = 0;
|
|
133
|
+
continue;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
137
|
+
_.label = op[1];
|
|
138
|
+
break;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
142
|
+
_.label = t[1];
|
|
143
|
+
t = op;
|
|
144
|
+
break;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
if (t && _.label < t[2]) {
|
|
148
|
+
_.label = t[2];
|
|
149
|
+
|
|
150
|
+
_.ops.push(op);
|
|
151
|
+
|
|
152
|
+
break;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
if (t[2]) _.ops.pop();
|
|
156
|
+
|
|
157
|
+
_.trys.pop();
|
|
158
|
+
|
|
159
|
+
continue;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
op = body.call(thisArg, _);
|
|
163
|
+
} catch (e) {
|
|
164
|
+
op = [6, e];
|
|
165
|
+
y = 0;
|
|
166
|
+
} finally {
|
|
167
|
+
f = t = 0;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
if (op[0] & 5) throw op[1];
|
|
172
|
+
return {
|
|
173
|
+
value: op[0] ? op[1] : void 0,
|
|
174
|
+
done: true
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
var paginationParams = {
|
|
180
|
+
pageSize: 20,
|
|
181
|
+
pageIndex: 1
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
function AffiliatePlatform(props) {
|
|
185
|
+
var _this = this;
|
|
186
|
+
|
|
187
|
+
var _onChange = props.onChange,
|
|
188
|
+
_fetch = props._fetch;
|
|
189
|
+
|
|
190
|
+
var _a = (0, _react.useState)([]),
|
|
191
|
+
platformList = _a[0],
|
|
192
|
+
setPlatformList = _a[1];
|
|
193
|
+
|
|
194
|
+
var _b = (0, _react.useState)(false),
|
|
195
|
+
loading = _b[0],
|
|
196
|
+
setLoading = _b[1];
|
|
197
|
+
|
|
198
|
+
var _c = (0, _react.useState)(''),
|
|
199
|
+
platformName = _c[0],
|
|
200
|
+
setPlatformName = _c[1];
|
|
201
|
+
|
|
202
|
+
var queryPlatform = function queryPlatform(params) {
|
|
203
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
204
|
+
var res;
|
|
205
|
+
return __generator(this, function (_a) {
|
|
206
|
+
switch (_a.label) {
|
|
207
|
+
case 0:
|
|
208
|
+
setLoading(true);
|
|
209
|
+
return [4
|
|
210
|
+
/*yield*/
|
|
211
|
+
, _fetch("/designer/v1/" + window.magicDesign.MBaseUrl + "/distribution/platform/page", params, 'GET')];
|
|
212
|
+
|
|
213
|
+
case 1:
|
|
214
|
+
res = _a.sent();
|
|
215
|
+
paginationParams.total = res.total;
|
|
216
|
+
setPlatformList(res.list);
|
|
217
|
+
setLoading(false);
|
|
218
|
+
return [2
|
|
219
|
+
/*return*/
|
|
220
|
+
];
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
});
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
(0, _react.useEffect)(function () {
|
|
227
|
+
queryPlatform(paginationParams);
|
|
228
|
+
}, []);
|
|
229
|
+
var columns = [{
|
|
230
|
+
title: 'Platform Name',
|
|
231
|
+
dataIndex: 'platformName'
|
|
232
|
+
}, {
|
|
233
|
+
title: 'Logo',
|
|
234
|
+
dataIndex: 'logo',
|
|
235
|
+
render: function render(val) {
|
|
236
|
+
return /*#__PURE__*/_react["default"].createElement("img", {
|
|
237
|
+
alt: "",
|
|
238
|
+
src: val,
|
|
239
|
+
style: {
|
|
240
|
+
maxWidth: '50px',
|
|
241
|
+
maxHeight: '50px'
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
}];
|
|
246
|
+
var rowSelection = {
|
|
247
|
+
onChange: function onChange(selectedRowKeys, selectedRow) {
|
|
248
|
+
_onChange({
|
|
249
|
+
value: selectedRow[0].distributionPlatformId,
|
|
250
|
+
name: selectedRow[0].platformName
|
|
251
|
+
});
|
|
252
|
+
},
|
|
253
|
+
type: 'radio'
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
var reset = function reset() {
|
|
257
|
+
setPlatformName('');
|
|
258
|
+
queryPlatform(__assign({
|
|
259
|
+
platformName: ''
|
|
260
|
+
}, paginationParams));
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
264
|
+
style: {
|
|
265
|
+
height: 550
|
|
266
|
+
}
|
|
267
|
+
}, /*#__PURE__*/_react["default"].createElement(_antd.Form, {
|
|
268
|
+
labelCol: {
|
|
269
|
+
span: 6
|
|
270
|
+
},
|
|
271
|
+
layout: "horizontal"
|
|
272
|
+
}, /*#__PURE__*/_react["default"].createElement(_antd.Row, {
|
|
273
|
+
gutter: 24
|
|
274
|
+
}, /*#__PURE__*/_react["default"].createElement(_antd.Col, {
|
|
275
|
+
span: 16
|
|
276
|
+
}, /*#__PURE__*/_react["default"].createElement(_antd.Form.Item, {
|
|
277
|
+
label: "Platform Name"
|
|
278
|
+
}, /*#__PURE__*/_react["default"].createElement(_antd.Input, {
|
|
279
|
+
onChange: function onChange(e) {
|
|
280
|
+
return setPlatformName(e.target.value);
|
|
281
|
+
},
|
|
282
|
+
size: "small",
|
|
283
|
+
value: platformName
|
|
284
|
+
}))), /*#__PURE__*/_react["default"].createElement(_antd.Col, {
|
|
285
|
+
span: 6
|
|
286
|
+
}, /*#__PURE__*/_react["default"].createElement(_antd.Button, {
|
|
287
|
+
onClick: function onClick() {
|
|
288
|
+
setLoading(true);
|
|
289
|
+
paginationParams.pageIndex = 1;
|
|
290
|
+
queryPlatform(__assign({
|
|
291
|
+
platformName: platformName
|
|
292
|
+
}, paginationParams));
|
|
293
|
+
},
|
|
294
|
+
size: "small",
|
|
295
|
+
style: {
|
|
296
|
+
marginRight: 10
|
|
297
|
+
},
|
|
298
|
+
type: "primary"
|
|
299
|
+
}, (0, _locale.i18n)('QUERY')), /*#__PURE__*/_react["default"].createElement(_antd.Button, {
|
|
300
|
+
onClick: function onClick() {
|
|
301
|
+
reset();
|
|
302
|
+
},
|
|
303
|
+
size: "small"
|
|
304
|
+
}, (0, _locale.i18n)('CANCEL'))))), /*#__PURE__*/_react["default"].createElement(_antd.Table, {
|
|
305
|
+
bordered: false,
|
|
306
|
+
columns: columns,
|
|
307
|
+
dataSource: platformList,
|
|
308
|
+
defaultExpandAllRows: true,
|
|
309
|
+
loading: loading,
|
|
310
|
+
pagination: __assign(__assign({}, paginationParams), {
|
|
311
|
+
onChange: function onChange(page) {
|
|
312
|
+
paginationParams.pageIndex = page;
|
|
313
|
+
queryPlatform(__assign(__assign({}, paginationParams), {
|
|
314
|
+
platformName: platformName
|
|
315
|
+
}));
|
|
316
|
+
},
|
|
317
|
+
showSizeChanger: false
|
|
318
|
+
}),
|
|
319
|
+
rowKey: "distributionPlatformId",
|
|
320
|
+
rowSelection: rowSelection,
|
|
321
|
+
scroll: {
|
|
322
|
+
y: 400
|
|
323
|
+
}
|
|
324
|
+
}));
|
|
325
|
+
}
|
|
@@ -39,6 +39,8 @@ var _AffiliateProductTable = _interopRequireDefault(require("./AffiliateProductT
|
|
|
39
39
|
|
|
40
40
|
var _AffiliateStore = _interopRequireDefault(require("./AffiliateStore"));
|
|
41
41
|
|
|
42
|
+
var _AffiliatePlatform = _interopRequireDefault(require("./AffiliatePlatform"));
|
|
43
|
+
|
|
42
44
|
var _locale = require("../../locale");
|
|
43
45
|
|
|
44
46
|
var _commonUtil = require("../../utils/commonUtil");
|
|
@@ -368,6 +370,10 @@ var LinkModal = function LinkModal(props) {
|
|
|
368
370
|
onChange: function onChange(value) {
|
|
369
371
|
return setLinkUrl(value);
|
|
370
372
|
}
|
|
373
|
+
}), item.linkTypeCode === 'AffiliatePlatform' && /*#__PURE__*/_react["default"].createElement(_AffiliatePlatform["default"], {
|
|
374
|
+
onChange: function onChange(value) {
|
|
375
|
+
return setLinkUrl(value);
|
|
376
|
+
}
|
|
371
377
|
}));
|
|
372
378
|
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
373
379
|
className: "footer"
|
package/es/constants/index.js
CHANGED
|
@@ -85,7 +85,9 @@ var urlTypeMap = {
|
|
|
85
85
|
STORE: 'Store',
|
|
86
86
|
AFFILIATE_PRODUCT: 'AffiliateProduct',
|
|
87
87
|
AFFILIATE_STORE: 'AffiliateStore',
|
|
88
|
-
ANCHOR: 'Anchor'
|
|
88
|
+
ANCHOR: 'Anchor',
|
|
89
|
+
MINI_API: 'MiniApi',
|
|
90
|
+
AFFILIATE_PLATFORM: 'AffiliatePlatform'
|
|
89
91
|
};
|
|
90
92
|
exports.urlTypeMap = urlTypeMap;
|
|
91
93
|
var respCodeMap = {
|
|
@@ -604,6 +604,7 @@ function (_super) {
|
|
|
604
604
|
onHtmlBack: _this.onHtmlBack,
|
|
605
605
|
onHtmlSave: _this.onHtmlSave,
|
|
606
606
|
outputType: _this.props.outputType,
|
|
607
|
+
pageState: _this.props.pageState,
|
|
607
608
|
pageType: _this.props.pageType,
|
|
608
609
|
redoDisable: !_this.history.redoAble(),
|
|
609
610
|
undoDisable: !_this.history.undoAble()
|
package/es/utils/businessUtil.js
CHANGED
|
@@ -195,6 +195,30 @@ var newParseUrl = function newParseUrl(urlObj) {
|
|
|
195
195
|
};
|
|
196
196
|
break;
|
|
197
197
|
|
|
198
|
+
case _constants.urlTypeMap.MINI_API:
|
|
199
|
+
// 小程序API,演示使用
|
|
200
|
+
link = "mpaas://miniapp?api=" + value.replace('my.', '');
|
|
201
|
+
params = {
|
|
202
|
+
action: 'jump',
|
|
203
|
+
params: {
|
|
204
|
+
type: 'MINI_API',
|
|
205
|
+
url: value
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
break;
|
|
209
|
+
|
|
210
|
+
case _constants.urlTypeMap.AFFILIATE_PLATFORM:
|
|
211
|
+
// affiliate platform
|
|
212
|
+
link = "/platformDetail/" + value;
|
|
213
|
+
params = {
|
|
214
|
+
action: 'jump',
|
|
215
|
+
params: {
|
|
216
|
+
type: 'AFFILIATE_PLATFORM',
|
|
217
|
+
url: value
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
break;
|
|
221
|
+
|
|
198
222
|
default:
|
|
199
223
|
var map = {
|
|
200
224
|
'/main/cart': 'CART',
|
package/es/utils/coreUtil.js
CHANGED
|
@@ -310,10 +310,9 @@ var clickUrl = function clickUrl(url) {
|
|
|
310
310
|
}
|
|
311
311
|
|
|
312
312
|
console.log('clickUrl...', url); // 只读模式,设计模式,url为空,邮箱模版
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
}
|
|
313
|
+
// if (window.magicDesign.readOnly || window.magicDesign.mode !== 'renderer' || !url || window.magicDesign.outputType == 'html') {
|
|
314
|
+
// return;
|
|
315
|
+
// }
|
|
317
316
|
|
|
318
317
|
var _b = _typeof(url) === 'object' ? (0, _businessUtil.newParseUrl)(url) : (0, _businessUtil.parseUrl)(url),
|
|
319
318
|
link = _b.link,
|
|
@@ -461,7 +460,7 @@ var copyNode = function copyNode(value, parentId) {
|
|
|
461
460
|
exports.copyNode = copyNode;
|
|
462
461
|
|
|
463
462
|
var isAutoAudit = function isAutoAudit() {
|
|
464
|
-
return window.magicDesign.autoAudit
|
|
463
|
+
return window.magicDesign.autoAudit || window.partyType === partyTypeMap.PLATFORM;
|
|
465
464
|
};
|
|
466
465
|
|
|
467
466
|
exports.isAutoAudit = isAutoAudit;
|
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
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); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = AffiliatePlatform;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _antd = require("antd4");
|
|
13
|
+
|
|
14
|
+
var _locale = require("../../../locale");
|
|
15
|
+
|
|
16
|
+
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); }
|
|
17
|
+
|
|
18
|
+
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; }
|
|
19
|
+
|
|
20
|
+
var __assign = void 0 && (void 0).__assign || function () {
|
|
21
|
+
__assign = Object.assign || function (t) {
|
|
22
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
23
|
+
s = arguments[i];
|
|
24
|
+
|
|
25
|
+
for (var p in s) {
|
|
26
|
+
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return t;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
return __assign.apply(this, arguments);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
|
|
37
|
+
function adopt(value) {
|
|
38
|
+
return value instanceof P ? value : new P(function (resolve) {
|
|
39
|
+
resolve(value);
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
44
|
+
function fulfilled(value) {
|
|
45
|
+
try {
|
|
46
|
+
step(generator.next(value));
|
|
47
|
+
} catch (e) {
|
|
48
|
+
reject(e);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function rejected(value) {
|
|
53
|
+
try {
|
|
54
|
+
step(generator["throw"](value));
|
|
55
|
+
} catch (e) {
|
|
56
|
+
reject(e);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function step(result) {
|
|
61
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
|
|
69
|
+
var _ = {
|
|
70
|
+
label: 0,
|
|
71
|
+
sent: function sent() {
|
|
72
|
+
if (t[0] & 1) throw t[1];
|
|
73
|
+
return t[1];
|
|
74
|
+
},
|
|
75
|
+
trys: [],
|
|
76
|
+
ops: []
|
|
77
|
+
},
|
|
78
|
+
f,
|
|
79
|
+
y,
|
|
80
|
+
t,
|
|
81
|
+
g;
|
|
82
|
+
return g = {
|
|
83
|
+
next: verb(0),
|
|
84
|
+
"throw": verb(1),
|
|
85
|
+
"return": verb(2)
|
|
86
|
+
}, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
|
|
87
|
+
return this;
|
|
88
|
+
}), g;
|
|
89
|
+
|
|
90
|
+
function verb(n) {
|
|
91
|
+
return function (v) {
|
|
92
|
+
return step([n, v]);
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function step(op) {
|
|
97
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
98
|
+
|
|
99
|
+
while (_) {
|
|
100
|
+
try {
|
|
101
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
102
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
103
|
+
|
|
104
|
+
switch (op[0]) {
|
|
105
|
+
case 0:
|
|
106
|
+
case 1:
|
|
107
|
+
t = op;
|
|
108
|
+
break;
|
|
109
|
+
|
|
110
|
+
case 4:
|
|
111
|
+
_.label++;
|
|
112
|
+
return {
|
|
113
|
+
value: op[1],
|
|
114
|
+
done: false
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
case 5:
|
|
118
|
+
_.label++;
|
|
119
|
+
y = op[1];
|
|
120
|
+
op = [0];
|
|
121
|
+
continue;
|
|
122
|
+
|
|
123
|
+
case 7:
|
|
124
|
+
op = _.ops.pop();
|
|
125
|
+
|
|
126
|
+
_.trys.pop();
|
|
127
|
+
|
|
128
|
+
continue;
|
|
129
|
+
|
|
130
|
+
default:
|
|
131
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
132
|
+
_ = 0;
|
|
133
|
+
continue;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
137
|
+
_.label = op[1];
|
|
138
|
+
break;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
142
|
+
_.label = t[1];
|
|
143
|
+
t = op;
|
|
144
|
+
break;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
if (t && _.label < t[2]) {
|
|
148
|
+
_.label = t[2];
|
|
149
|
+
|
|
150
|
+
_.ops.push(op);
|
|
151
|
+
|
|
152
|
+
break;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
if (t[2]) _.ops.pop();
|
|
156
|
+
|
|
157
|
+
_.trys.pop();
|
|
158
|
+
|
|
159
|
+
continue;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
op = body.call(thisArg, _);
|
|
163
|
+
} catch (e) {
|
|
164
|
+
op = [6, e];
|
|
165
|
+
y = 0;
|
|
166
|
+
} finally {
|
|
167
|
+
f = t = 0;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
if (op[0] & 5) throw op[1];
|
|
172
|
+
return {
|
|
173
|
+
value: op[0] ? op[1] : void 0,
|
|
174
|
+
done: true
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
var paginationParams = {
|
|
180
|
+
pageSize: 20,
|
|
181
|
+
pageIndex: 1
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
function AffiliatePlatform(props) {
|
|
185
|
+
var _this = this;
|
|
186
|
+
|
|
187
|
+
var _onChange = props.onChange,
|
|
188
|
+
_fetch = props._fetch;
|
|
189
|
+
|
|
190
|
+
var _a = (0, _react.useState)([]),
|
|
191
|
+
platformList = _a[0],
|
|
192
|
+
setPlatformList = _a[1];
|
|
193
|
+
|
|
194
|
+
var _b = (0, _react.useState)(false),
|
|
195
|
+
loading = _b[0],
|
|
196
|
+
setLoading = _b[1];
|
|
197
|
+
|
|
198
|
+
var _c = (0, _react.useState)(''),
|
|
199
|
+
platformName = _c[0],
|
|
200
|
+
setPlatformName = _c[1];
|
|
201
|
+
|
|
202
|
+
var queryPlatform = function queryPlatform(params) {
|
|
203
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
204
|
+
var res;
|
|
205
|
+
return __generator(this, function (_a) {
|
|
206
|
+
switch (_a.label) {
|
|
207
|
+
case 0:
|
|
208
|
+
setLoading(true);
|
|
209
|
+
return [4
|
|
210
|
+
/*yield*/
|
|
211
|
+
, _fetch("/designer/v1/" + window.magicDesign.MBaseUrl + "/distribution/platform/page", params, 'GET')];
|
|
212
|
+
|
|
213
|
+
case 1:
|
|
214
|
+
res = _a.sent();
|
|
215
|
+
paginationParams.total = res.total;
|
|
216
|
+
setPlatformList(res.list);
|
|
217
|
+
setLoading(false);
|
|
218
|
+
return [2
|
|
219
|
+
/*return*/
|
|
220
|
+
];
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
});
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
(0, _react.useEffect)(function () {
|
|
227
|
+
queryPlatform(paginationParams);
|
|
228
|
+
}, []);
|
|
229
|
+
var columns = [{
|
|
230
|
+
title: 'Platform Name',
|
|
231
|
+
dataIndex: 'platformName'
|
|
232
|
+
}, {
|
|
233
|
+
title: 'Logo',
|
|
234
|
+
dataIndex: 'logo',
|
|
235
|
+
render: function render(val) {
|
|
236
|
+
return /*#__PURE__*/_react["default"].createElement("img", {
|
|
237
|
+
alt: "",
|
|
238
|
+
src: val,
|
|
239
|
+
style: {
|
|
240
|
+
maxWidth: '50px',
|
|
241
|
+
maxHeight: '50px'
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
}];
|
|
246
|
+
var rowSelection = {
|
|
247
|
+
onChange: function onChange(selectedRowKeys, selectedRow) {
|
|
248
|
+
_onChange({
|
|
249
|
+
value: selectedRow[0].distributionPlatformId,
|
|
250
|
+
name: selectedRow[0].platformName
|
|
251
|
+
});
|
|
252
|
+
},
|
|
253
|
+
type: 'radio'
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
var reset = function reset() {
|
|
257
|
+
setPlatformName('');
|
|
258
|
+
queryPlatform(__assign({
|
|
259
|
+
platformName: ''
|
|
260
|
+
}, paginationParams));
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
264
|
+
style: {
|
|
265
|
+
height: 550
|
|
266
|
+
}
|
|
267
|
+
}, /*#__PURE__*/_react["default"].createElement(_antd.Form, {
|
|
268
|
+
labelCol: {
|
|
269
|
+
span: 6
|
|
270
|
+
},
|
|
271
|
+
layout: "horizontal"
|
|
272
|
+
}, /*#__PURE__*/_react["default"].createElement(_antd.Row, {
|
|
273
|
+
gutter: 24
|
|
274
|
+
}, /*#__PURE__*/_react["default"].createElement(_antd.Col, {
|
|
275
|
+
span: 16
|
|
276
|
+
}, /*#__PURE__*/_react["default"].createElement(_antd.Form.Item, {
|
|
277
|
+
label: "Platform Name"
|
|
278
|
+
}, /*#__PURE__*/_react["default"].createElement(_antd.Input, {
|
|
279
|
+
onChange: function onChange(e) {
|
|
280
|
+
return setPlatformName(e.target.value);
|
|
281
|
+
},
|
|
282
|
+
size: "small",
|
|
283
|
+
value: platformName
|
|
284
|
+
}))), /*#__PURE__*/_react["default"].createElement(_antd.Col, {
|
|
285
|
+
span: 6
|
|
286
|
+
}, /*#__PURE__*/_react["default"].createElement(_antd.Button, {
|
|
287
|
+
onClick: function onClick() {
|
|
288
|
+
setLoading(true);
|
|
289
|
+
paginationParams.pageIndex = 1;
|
|
290
|
+
queryPlatform(__assign({
|
|
291
|
+
platformName: platformName
|
|
292
|
+
}, paginationParams));
|
|
293
|
+
},
|
|
294
|
+
size: "small",
|
|
295
|
+
style: {
|
|
296
|
+
marginRight: 10
|
|
297
|
+
},
|
|
298
|
+
type: "primary"
|
|
299
|
+
}, (0, _locale.i18n)('QUERY')), /*#__PURE__*/_react["default"].createElement(_antd.Button, {
|
|
300
|
+
onClick: function onClick() {
|
|
301
|
+
reset();
|
|
302
|
+
},
|
|
303
|
+
size: "small"
|
|
304
|
+
}, (0, _locale.i18n)('CANCEL'))))), /*#__PURE__*/_react["default"].createElement(_antd.Table, {
|
|
305
|
+
bordered: false,
|
|
306
|
+
columns: columns,
|
|
307
|
+
dataSource: platformList,
|
|
308
|
+
defaultExpandAllRows: true,
|
|
309
|
+
loading: loading,
|
|
310
|
+
pagination: __assign(__assign({}, paginationParams), {
|
|
311
|
+
onChange: function onChange(page) {
|
|
312
|
+
paginationParams.pageIndex = page;
|
|
313
|
+
queryPlatform(__assign(__assign({}, paginationParams), {
|
|
314
|
+
platformName: platformName
|
|
315
|
+
}));
|
|
316
|
+
},
|
|
317
|
+
showSizeChanger: false
|
|
318
|
+
}),
|
|
319
|
+
rowKey: "distributionPlatformId",
|
|
320
|
+
rowSelection: rowSelection,
|
|
321
|
+
scroll: {
|
|
322
|
+
y: 400
|
|
323
|
+
}
|
|
324
|
+
}));
|
|
325
|
+
}
|
|
@@ -39,6 +39,8 @@ var _AffiliateProductTable = _interopRequireDefault(require("./AffiliateProductT
|
|
|
39
39
|
|
|
40
40
|
var _AffiliateStore = _interopRequireDefault(require("./AffiliateStore"));
|
|
41
41
|
|
|
42
|
+
var _AffiliatePlatform = _interopRequireDefault(require("./AffiliatePlatform"));
|
|
43
|
+
|
|
42
44
|
var _locale = require("../../locale");
|
|
43
45
|
|
|
44
46
|
var _commonUtil = require("../../utils/commonUtil");
|
|
@@ -368,6 +370,10 @@ var LinkModal = function LinkModal(props) {
|
|
|
368
370
|
onChange: function onChange(value) {
|
|
369
371
|
return setLinkUrl(value);
|
|
370
372
|
}
|
|
373
|
+
}), item.linkTypeCode === 'AffiliatePlatform' && /*#__PURE__*/_react["default"].createElement(_AffiliatePlatform["default"], {
|
|
374
|
+
onChange: function onChange(value) {
|
|
375
|
+
return setLinkUrl(value);
|
|
376
|
+
}
|
|
371
377
|
}));
|
|
372
378
|
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
373
379
|
className: "footer"
|
package/lib/constants/index.js
CHANGED
|
@@ -85,7 +85,9 @@ var urlTypeMap = {
|
|
|
85
85
|
STORE: 'Store',
|
|
86
86
|
AFFILIATE_PRODUCT: 'AffiliateProduct',
|
|
87
87
|
AFFILIATE_STORE: 'AffiliateStore',
|
|
88
|
-
ANCHOR: 'Anchor'
|
|
88
|
+
ANCHOR: 'Anchor',
|
|
89
|
+
MINI_API: 'MiniApi',
|
|
90
|
+
AFFILIATE_PLATFORM: 'AffiliatePlatform'
|
|
89
91
|
};
|
|
90
92
|
exports.urlTypeMap = urlTypeMap;
|
|
91
93
|
var respCodeMap = {
|
|
@@ -604,6 +604,7 @@ function (_super) {
|
|
|
604
604
|
onHtmlBack: _this.onHtmlBack,
|
|
605
605
|
onHtmlSave: _this.onHtmlSave,
|
|
606
606
|
outputType: _this.props.outputType,
|
|
607
|
+
pageState: _this.props.pageState,
|
|
607
608
|
pageType: _this.props.pageType,
|
|
608
609
|
redoDisable: !_this.history.redoAble(),
|
|
609
610
|
undoDisable: !_this.history.undoAble()
|
|
@@ -195,6 +195,30 @@ var newParseUrl = function newParseUrl(urlObj) {
|
|
|
195
195
|
};
|
|
196
196
|
break;
|
|
197
197
|
|
|
198
|
+
case _constants.urlTypeMap.MINI_API:
|
|
199
|
+
// 小程序API,演示使用
|
|
200
|
+
link = "mpaas://miniapp?api=" + value.replace('my.', '');
|
|
201
|
+
params = {
|
|
202
|
+
action: 'jump',
|
|
203
|
+
params: {
|
|
204
|
+
type: 'MINI_API',
|
|
205
|
+
url: value
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
break;
|
|
209
|
+
|
|
210
|
+
case _constants.urlTypeMap.AFFILIATE_PLATFORM:
|
|
211
|
+
// affiliate platform
|
|
212
|
+
link = "/platformDetail/" + value;
|
|
213
|
+
params = {
|
|
214
|
+
action: 'jump',
|
|
215
|
+
params: {
|
|
216
|
+
type: 'AFFILIATE_PLATFORM',
|
|
217
|
+
url: value
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
break;
|
|
221
|
+
|
|
198
222
|
default:
|
|
199
223
|
var map = {
|
|
200
224
|
'/main/cart': 'CART',
|
package/lib/utils/coreUtil.js
CHANGED
|
@@ -310,10 +310,9 @@ var clickUrl = function clickUrl(url) {
|
|
|
310
310
|
}
|
|
311
311
|
|
|
312
312
|
console.log('clickUrl...', url); // 只读模式,设计模式,url为空,邮箱模版
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
}
|
|
313
|
+
// if (window.magicDesign.readOnly || window.magicDesign.mode !== 'renderer' || !url || window.magicDesign.outputType == 'html') {
|
|
314
|
+
// return;
|
|
315
|
+
// }
|
|
317
316
|
|
|
318
317
|
var _b = _typeof(url) === 'object' ? (0, _businessUtil.newParseUrl)(url) : (0, _businessUtil.parseUrl)(url),
|
|
319
318
|
link = _b.link,
|
|
@@ -461,7 +460,7 @@ var copyNode = function copyNode(value, parentId) {
|
|
|
461
460
|
exports.copyNode = copyNode;
|
|
462
461
|
|
|
463
462
|
var isAutoAudit = function isAutoAudit() {
|
|
464
|
-
return window.magicDesign.autoAudit
|
|
463
|
+
return window.magicDesign.autoAudit || window.partyType === partyTypeMap.PLATFORM;
|
|
465
464
|
};
|
|
466
465
|
|
|
467
466
|
exports.isAutoAudit = isAutoAudit;
|