@fonixtree/magic-design 2.0.74 → 2.0.75

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 (55) hide show
  1. package/es/assets/fonts/.DS_Store +0 -0
  2. package/es/assets/fonts/magic-box-iconfont.css +8 -4
  3. package/es/assets/fonts/magic-box-iconfont.css.bak +8 -4
  4. package/es/assets/fonts/magic-box-iconfont.js +1 -1
  5. package/es/assets/fonts/magic-box-iconfont.js.bak +1 -1
  6. package/es/assets/fonts/magic-box-iconfont.ttf +0 -0
  7. package/es/assets/fonts/magic-box-iconfont.woff +0 -0
  8. package/es/assets/fonts/magic-box-iconfont.woff2 +0 -0
  9. package/es/common/LinkModal/BundleCampaign/index.js +2 -2
  10. package/es/common/LinkModal/CouponTable/index.js +1 -1
  11. package/es/common/LinkModal/FilteredProductModal/index.js +2 -2
  12. package/es/common/LinkModal/ProductDetailPage/index.js +30 -13
  13. package/es/common/MagicLink/index.js +2 -2
  14. package/es/common/ProductModal/index.js +29 -22
  15. package/es/common/ProductSource/index.js +0 -1
  16. package/es/common/UrlPicker/AnchorModal/index.js +170 -0
  17. package/es/common/UrlPicker/AnchorModal/index.less +21 -0
  18. package/es/common/UrlPicker/index.js +61 -11
  19. package/es/composite-comp/dito/components/Recommend/mobile/index.js +1 -1
  20. package/es/composite-comp/dito/components/Recommend/pc/index.js +1 -1
  21. package/es/constants/index.js +2 -1
  22. package/es/core/Designer/QuickMenuBar/index.js +1 -1
  23. package/es/locale/en/en.json +1 -0
  24. package/es/locale/es/es.json +1 -0
  25. package/es/locale/id/id.json +1 -0
  26. package/es/utils/businessUtil.js +13 -2
  27. package/es/utils/coreUtil.js +11 -0
  28. package/lib/assets/fonts/.DS_Store +0 -0
  29. package/lib/assets/fonts/magic-box-iconfont.css +8 -4
  30. package/lib/assets/fonts/magic-box-iconfont.css.bak +8 -4
  31. package/lib/assets/fonts/magic-box-iconfont.js +1 -1
  32. package/lib/assets/fonts/magic-box-iconfont.js.bak +1 -1
  33. package/lib/assets/fonts/magic-box-iconfont.ttf +0 -0
  34. package/lib/assets/fonts/magic-box-iconfont.woff +0 -0
  35. package/lib/assets/fonts/magic-box-iconfont.woff2 +0 -0
  36. package/lib/common/LinkModal/BundleCampaign/index.js +2 -2
  37. package/lib/common/LinkModal/CouponTable/index.js +1 -1
  38. package/lib/common/LinkModal/FilteredProductModal/index.js +2 -2
  39. package/lib/common/LinkModal/ProductDetailPage/index.js +30 -13
  40. package/lib/common/MagicLink/index.js +2 -2
  41. package/lib/common/ProductModal/index.js +29 -22
  42. package/lib/common/ProductSource/index.js +0 -1
  43. package/lib/common/UrlPicker/AnchorModal/index.js +170 -0
  44. package/lib/common/UrlPicker/AnchorModal/index.less +21 -0
  45. package/lib/common/UrlPicker/index.js +61 -11
  46. package/lib/composite-comp/dito/components/Recommend/mobile/index.js +1 -1
  47. package/lib/composite-comp/dito/components/Recommend/pc/index.js +1 -1
  48. package/lib/constants/index.js +2 -1
  49. package/lib/core/Designer/QuickMenuBar/index.js +1 -1
  50. package/lib/locale/en/en.json +1 -0
  51. package/lib/locale/es/es.json +1 -0
  52. package/lib/locale/id/id.json +1 -0
  53. package/lib/utils/businessUtil.js +13 -2
  54. package/lib/utils/coreUtil.js +11 -0
  55. package/package.json +1 -1
@@ -179,7 +179,7 @@ var BundleCampaign = function BundleCampaign(props) {
179
179
  campaignName = _b[0],
180
180
  setCampaignName = _b[1];
181
181
 
182
- var _c = (0, _react.useState)(window.magicDesign.storeId ? window.magicDesign.storeId : ''),
182
+ var _c = (0, _react.useState)(window.magicDesign.storeId >= 0 ? window.magicDesign.storeId : ''),
183
183
  storeId = _c[0],
184
184
  setStoreId = _c[1];
185
185
 
@@ -241,7 +241,7 @@ var BundleCampaign = function BundleCampaign(props) {
241
241
 
242
242
  var reset = function reset() {
243
243
  setCampaignName('');
244
- setStoreId(window.magicDesign.storeId ? window.magicDesign.storeId : '');
244
+ setStoreId(window.magicDesign.storeId >= 0 ? window.magicDesign.storeId : '');
245
245
  setCmpState('A,B');
246
246
  };
247
247
 
@@ -257,7 +257,7 @@ function CouponTable(props) {
257
257
  state: 'A',
258
258
  couponLocation: 'Promotion',
259
259
  pageTotal: false,
260
- storeId: window.magicDesign.storeId ? window.magicDesign.storeId : ''
260
+ storeId: window.magicDesign.storeId >= 0 ? window.magicDesign.storeId : ''
261
261
  });
262
262
  return [4
263
263
  /*yield*/
@@ -213,7 +213,7 @@ var FilteredProductModal = function FilteredProductModal(props) {
213
213
  labelData = _f[0],
214
214
  setLabelData = _f[1];
215
215
 
216
- var _g = (0, _react.useState)(window.magicDesign.storeId || ''),
216
+ var _g = (0, _react.useState)(window.magicDesign.storeId >= 0 ? window.magicDesign.storeId : ''),
217
217
  storeId = _g[0],
218
218
  setStoreId = _g[1];
219
219
 
@@ -277,7 +277,7 @@ var FilteredProductModal = function FilteredProductModal(props) {
277
277
  settVal([]);
278
278
  settBrandId([]);
279
279
  settLabelId({});
280
- setStoreId(window.magicDesign.storeId || '');
280
+ setStoreId(window.magicDesign.storeId >= 0 ? window.magicDesign.storeId : '');
281
281
  setProductName('');
282
282
  setMinimum('');
283
283
  setMaximum('');
@@ -17,8 +17,6 @@ var _commonUtil = require("../../../utils/commonUtil");
17
17
 
18
18
  var _businessUtil = require("../../../utils/businessUtil");
19
19
 
20
- var _ProductModal = require("../../ProductModal");
21
-
22
20
  require("./index.less");
23
21
 
24
22
  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); }
@@ -187,7 +185,7 @@ var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
187
185
  var Option = _antd.Select.Option;
188
186
 
189
187
  var ProductDetailPage = function ProductDetailPage(props) {
190
- var _onChange = props.onChange;
188
+ var onChange = props.onChange;
191
189
 
192
190
  var _a = (0, _react.useState)([]),
193
191
  productList = _a[0],
@@ -225,13 +223,21 @@ var ProductDetailPage = function ProductDetailPage(props) {
225
223
  proType = _j[0],
226
224
  setProType = _j[1];
227
225
 
228
- var _k = (0, _react.useState)({
226
+ var _k = (0, _react.useState)(false),
227
+ flag = _k[0],
228
+ setFlag = _k[1];
229
+
230
+ var _l = (0, _react.useState)({}),
231
+ selectedPro = _l[0],
232
+ setSelectedPro = _l[1];
233
+
234
+ var _m = (0, _react.useState)({
229
235
  pageSize: 20,
230
236
  current: 1,
231
237
  total: 0
232
238
  }),
233
- paginationParams = _k[0],
234
- setPaginationParams = _k[1];
239
+ paginationParams = _m[0],
240
+ setPaginationParams = _m[1];
235
241
 
236
242
  var columns = [{
237
243
  title: 'Image',
@@ -260,12 +266,14 @@ var ProductDetailPage = function ProductDetailPage(props) {
260
266
  ellipsis: true
261
267
  }];
262
268
  var rowSelection = {
269
+ selectedRowKeys: [(selectedPro === null || selectedPro === void 0 ? void 0 : selectedPro.productId) || ''],
263
270
  onChange: function onChange(selectedRowKeys, selectedRows) {
264
- _onChange({
271
+ var selected = {
265
272
  offerId: selectedRows[0].offerId,
266
273
  productId: selectedRows[0].productId,
267
274
  name: selectedRows[0].productName
268
- });
275
+ };
276
+ setSelectedPro(selected);
269
277
  },
270
278
  type: 'radio'
271
279
  };
@@ -303,11 +311,11 @@ var ProductDetailPage = function ProductDetailPage(props) {
303
311
 
304
312
  case 1:
305
313
  res_1 = _a.sent();
306
- _list = (0, _ProductModal.formatData)((0, _commonUtil.ensure)(function () {
314
+ _list = (0, _commonUtil.ensure)(function () {
307
315
  return res_1.list.map(function (m) {
308
316
  return __assign(__assign({}, m.products[0]), m);
309
317
  });
310
- }, []), proType);
318
+ }, []);
311
319
  total = res_1.total;
312
320
  return [3
313
321
  /*break*/
@@ -317,12 +325,13 @@ var ProductDetailPage = function ProductDetailPage(props) {
317
325
  return [4
318
326
  /*yield*/
319
327
  , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/products", __assign(__assign({}, params), {
328
+ state: 'A',
320
329
  productCode: productCode
321
330
  }), 'GET')];
322
331
 
323
332
  case 3:
324
333
  res = _a.sent();
325
- _list = (0, _ProductModal.formatData)(res.list || []);
334
+ _list = res.list || [];
326
335
  total = res.total;
327
336
  _a.label = 4;
328
337
 
@@ -407,11 +416,19 @@ var ProductDetailPage = function ProductDetailPage(props) {
407
416
  queryStore();
408
417
  }
409
418
  }, []);
419
+ (0, _react.useEffect)(function () {
420
+ onChange(selectedPro);
421
+ }, [selectedPro]);
410
422
  (0, _react.useEffect)(function () {
411
423
  setLoading(true);
424
+ reset();
425
+ setSelectedPro({});
412
426
  paginationParams.current = 1;
413
- queryGoods();
427
+ setFlag(!flag);
414
428
  }, [proType]);
429
+ (0, _react.useEffect)(function () {
430
+ queryGoods();
431
+ }, [flag]);
415
432
  var proTypeOption = [{
416
433
  label: 'SKU',
417
434
  value: 'sku'
@@ -530,7 +547,7 @@ var ProductDetailPage = function ProductDetailPage(props) {
530
547
  },
531
548
  showSizeChanger: false
532
549
  }),
533
- rowKey: "id",
550
+ rowKey: "productId",
534
551
  rowSelection: rowSelection,
535
552
  scroll: {
536
553
  y: 300
@@ -7,9 +7,9 @@ exports.onAClick = exports.getLinkUrl = exports["default"] = void 0;
7
7
 
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
 
10
- var _businessUtil = require("src/components/utils/businessUtil");
10
+ var _coreUtil = require("../../utils/coreUtil");
11
11
 
12
- var _coreUtil = require("src/components/utils/coreUtil");
12
+ var _businessUtil = require("../../utils/businessUtil");
13
13
 
14
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
15
 
@@ -302,17 +302,21 @@ var ProductModal = function ProductModal(props) {
302
302
  proType = _u[0],
303
303
  setProType = _u[1];
304
304
 
305
- var _v = (0, _react.useState)(defaultList),
306
- selectedList = _v[0],
307
- setSelectedList = _v[1];
305
+ var _v = (0, _react.useState)(false),
306
+ flag = _v[0],
307
+ setFlag = _v[1];
308
308
 
309
- var _w = (0, _react.useState)({
309
+ var _w = (0, _react.useState)(defaultList),
310
+ selectedList = _w[0],
311
+ setSelectedList = _w[1];
312
+
313
+ var _x = (0, _react.useState)({
310
314
  pageSize: 20,
311
315
  current: 1,
312
316
  total: 0
313
317
  }),
314
- paginationParams = _w[0],
315
- setPaginationParams = _w[1];
318
+ paginationParams = _x[0],
319
+ setPaginationParams = _x[1];
316
320
 
317
321
  var rowSelection = {
318
322
  selectedRowKeys: selectedList.map(function (v) {
@@ -370,8 +374,7 @@ var ProductModal = function ProductModal(props) {
370
374
  brandIds: selBrandsList.join(','),
371
375
  labelIds: selLabelData.value || '',
372
376
  pageSize: paginationParams.pageSize,
373
- pageIndex: paginationParams.current,
374
- state: 'A'
377
+ pageIndex: paginationParams.current
375
378
  };
376
379
  if (!(proType === 'spu')) return [3
377
380
  /*break*/
@@ -402,6 +405,7 @@ var ProductModal = function ProductModal(props) {
402
405
  return [4
403
406
  /*yield*/
404
407
  , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/products", __assign(__assign({}, params), {
408
+ state: 'A',
405
409
  productCode: productCode
406
410
  }), 'GET')];
407
411
 
@@ -513,6 +517,18 @@ var ProductModal = function ProductModal(props) {
513
517
  });
514
518
  };
515
519
 
520
+ var reset = function reset() {
521
+ setSelBrandsList([]);
522
+ setSelCatgsList([]);
523
+ setSelLabelData([]);
524
+ setProductName('');
525
+ setStoreId('');
526
+ setProductCode('');
527
+ setMinPrice('');
528
+ setMaxPrice('');
529
+ setPromotions(props.type === 'groupBuy' ? promType.GROUP_BUY : null);
530
+ };
531
+
516
532
  (0, _react.useEffect)(function () {
517
533
  queryOfferCatgs();
518
534
  queryBrands();
@@ -530,22 +546,13 @@ var ProductModal = function ProductModal(props) {
530
546
  }
531
547
  }, [visible]);
532
548
  (0, _react.useEffect)(function () {
549
+ reset();
533
550
  paginationParams.current = 1;
534
- queryGoods();
551
+ setFlag(!flag);
535
552
  }, [proType]);
536
-
537
- var reset = function reset() {
538
- setSelBrandsList([]);
539
- setSelCatgsList([]);
540
- setSelLabelData([]);
541
- setProductName('');
542
- setStoreId('');
543
- setProductCode('');
544
- setMinPrice('');
545
- setMaxPrice('');
546
- setPromotions(props.type === 'groupBuy' ? promType.GROUP_BUY : null);
547
- };
548
-
553
+ (0, _react.useEffect)(function () {
554
+ queryGoods();
555
+ }, [flag]);
549
556
  var columns = [{
550
557
  title: (0, _locale.i18n)('IMAGE'),
551
558
  dataIndex: 'productImageUrl',
@@ -238,7 +238,6 @@ function ProductSource(_a) {
238
238
  url = "/designer/v1/" + window.magicDesign.MBaseUrl + "/offers";
239
239
  param = {
240
240
  offers: value,
241
- state: 'A',
242
241
  isDefaultCover: 'Y',
243
242
  onlyQryPublishSku: true,
244
243
  auditState: 'S',
@@ -0,0 +1,170 @@
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
+ var _antd = require("antd");
11
+
12
+ var _locale = require("../../../locale");
13
+
14
+ var _mobx = require("../../../mobx");
15
+
16
+ var _constants = require("../../../constants");
17
+
18
+ require("./index.less");
19
+
20
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
21
+
22
+ var __extends = void 0 && (void 0).__extends || function () {
23
+ var _extendStatics = function extendStatics(d, b) {
24
+ _extendStatics = Object.setPrototypeOf || {
25
+ __proto__: []
26
+ } instanceof Array && function (d, b) {
27
+ d.__proto__ = b;
28
+ } || function (d, b) {
29
+ for (var p in b) {
30
+ if (b.hasOwnProperty(p)) d[p] = b[p];
31
+ }
32
+ };
33
+
34
+ return _extendStatics(d, b);
35
+ };
36
+
37
+ return function (d, b) {
38
+ _extendStatics(d, b);
39
+
40
+ function __() {
41
+ this.constructor = d;
42
+ }
43
+
44
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
45
+ };
46
+ }();
47
+
48
+ var __assign = void 0 && (void 0).__assign || function () {
49
+ __assign = Object.assign || function (t) {
50
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
51
+ s = arguments[i];
52
+
53
+ for (var p in s) {
54
+ if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
55
+ }
56
+ }
57
+
58
+ return t;
59
+ };
60
+
61
+ return __assign.apply(this, arguments);
62
+ };
63
+
64
+ var AnchorModal =
65
+ /** @class */
66
+ function (_super) {
67
+ __extends(AnchorModal, _super);
68
+
69
+ function AnchorModal() {
70
+ var _this = _super !== null && _super.apply(this, arguments) || this;
71
+
72
+ _this.state = {
73
+ selectedValue: ''
74
+ };
75
+
76
+ _this.onAnchorChange = function (e) {
77
+ var selectedAnchor = _mobx.store.MPageData.find(function (m) {
78
+ return m.id === e.target.value;
79
+ });
80
+
81
+ console.log('store.MPageData: ', JSON.parse(JSON.stringify(_mobx.store.MPageData)));
82
+
83
+ _this.setState({
84
+ selectedValue: selectedAnchor.id
85
+ });
86
+ };
87
+
88
+ _this.onOk = function () {
89
+ var initData = _this.props.initData;
90
+ var selectedValue = _this.state.selectedValue;
91
+
92
+ var selectedAnchorIndex = _mobx.store.MPageData.findIndex(function (m) {
93
+ return m.id === selectedValue;
94
+ });
95
+
96
+ var selectedAnchor = _mobx.store.MPageData[selectedAnchorIndex];
97
+
98
+ var value = __assign({}, initData.value);
99
+
100
+ if (selectedAnchor.activeTerminal === 'ALL') {
101
+ value.pcNodeId = selectedAnchor.id;
102
+ value.mobileNodeId = selectedAnchor.id;
103
+ } else if (selectedAnchor.activeTerminal === 'MOBILE') {
104
+ value.mobileNodeId = selectedAnchor.id;
105
+ } else if (selectedAnchor.activeTerminal === 'PC') {
106
+ value.pcNodeId = selectedAnchor.id;
107
+ }
108
+
109
+ var data = {
110
+ type: _constants.urlTypeMap.ANCHOR,
111
+ value: value
112
+ };
113
+
114
+ _this.props.onConfirm(data);
115
+ };
116
+
117
+ return _this;
118
+ }
119
+
120
+ AnchorModal.prototype.render = function () {
121
+ var _a = this.props,
122
+ visible = _a.visible,
123
+ onClose = _a.onClose;
124
+ var selectedValue = this.state.selectedValue;
125
+ return /*#__PURE__*/_react["default"].createElement(_antd.Modal, {
126
+ cancelText: (0, _locale.i18n)('CANCEL'),
127
+ draggable: false,
128
+ footer: null,
129
+ okText: "OK",
130
+ onCancel: onClose,
131
+ title: (0, _locale.i18n)('ANCHOR'),
132
+ visible: visible,
133
+ width: "400px",
134
+ wrapClassName: "magicAnchorModal"
135
+ }, /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_antd.Radio.Group, {
136
+ onChange: this.onAnchorChange,
137
+ value: selectedValue
138
+ }, /*#__PURE__*/_react["default"].createElement(_antd.Space, {
139
+ direction: "vertical"
140
+ }, _mobx.store.MPageData.map(function (page, i) {
141
+ var _a;
142
+
143
+ return /*#__PURE__*/_react["default"].createElement(_antd.Radio, {
144
+ value: page.id
145
+ }, i + 1, "\u3001", (_a = _constants.compInfoMap[page.type]) === null || _a === void 0 ? void 0 : _a.name);
146
+ })))), /*#__PURE__*/_react["default"].createElement("div", {
147
+ className: "footer"
148
+ }, /*#__PURE__*/_react["default"].createElement(_antd.Button, {
149
+ className: "btn-cancel",
150
+ onClick: function onClick() {
151
+ return onClose && onClose();
152
+ }
153
+ }, (0, _locale.i18n)('CANCEL')), /*#__PURE__*/_react["default"].createElement(_antd.Button, {
154
+ className: "btn-confirm",
155
+ onClick: this.onOk,
156
+ type: "primary"
157
+ }, (0, _locale.i18n)('OK'))));
158
+ };
159
+
160
+ AnchorModal.defaultProps = {
161
+ visible: false,
162
+ onClose: function onClose() {},
163
+ onConfirm: function onConfirm() {},
164
+ initData: null
165
+ };
166
+ return AnchorModal;
167
+ }(_react["default"].Component);
168
+
169
+ var _default = AnchorModal;
170
+ exports["default"] = _default;
@@ -0,0 +1,21 @@
1
+ .magicAnchorModal {
2
+
3
+
4
+ .footer {
5
+ display: flex;
6
+ align-items: center;
7
+ justify-content: flex-end;
8
+ padding-top: 20px;
9
+
10
+ .btn-cancel {
11
+ margin-right: 12px;
12
+ }
13
+
14
+ .btn-confirm {
15
+ background: #2F54EB;
16
+ border: none;
17
+ border-radius: 6px;
18
+ // margin-left: 20px;
19
+ }
20
+ }
21
+ }
@@ -7,16 +7,24 @@ exports["default"] = void 0;
7
7
 
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
 
10
- require("./index.less");
11
-
12
10
  var _classnames = _interopRequireDefault(require("classnames"));
13
11
 
12
+ var _AnchorModal = _interopRequireDefault(require("./AnchorModal"));
13
+
14
+ var _coreUtil = require("../../utils/coreUtil");
15
+
14
16
  var _locale = require("../../locale");
15
17
 
16
18
  var _LinkModal = _interopRequireDefault(require("../LinkModal"));
17
19
 
18
20
  var _Iconfont = _interopRequireDefault(require("../Iconfont"));
19
21
 
22
+ var _constants = require("../../constants");
23
+
24
+ var _mobx = require("../../mobx");
25
+
26
+ require("./index.less");
27
+
20
28
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
21
29
 
22
30
  var __extends = void 0 && (void 0).__extends || function () {
@@ -44,6 +52,8 @@ var __extends = void 0 && (void 0).__extends || function () {
44
52
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
45
53
  };
46
54
  }();
55
+ /* eslint-disable max-len */
56
+
47
57
 
48
58
  var UrlPicker =
49
59
  /** @class */
@@ -54,7 +64,8 @@ function (_super) {
54
64
  var _this = _super !== null && _super.apply(this, arguments) || this;
55
65
 
56
66
  _this.state = {
57
- visible: false
67
+ visible: false,
68
+ anchorModalVisible: false
58
69
  };
59
70
  return _this;
60
71
  }
@@ -62,14 +73,29 @@ function (_super) {
62
73
  UrlPicker.prototype.render = function () {
63
74
  var _this = this;
64
75
 
65
- var visible = this.state.visible;
66
- var _a = this.props,
67
- value = _a.value,
68
- _onChange = _a.onChange,
69
- disabled = _a.disabled,
70
- onlySpecificCode = _a.onlySpecificCode; // 弹框选择url不可编辑,需要先清除
76
+ var _a;
77
+
78
+ var _b = this.state,
79
+ visible = _b.visible,
80
+ anchorModalVisible = _b.anchorModalVisible;
81
+ var _c = this.props,
82
+ value = _c.value,
83
+ _onChange = _c.onChange,
84
+ disabled = _c.disabled,
85
+ onlySpecificCode = _c.onlySpecificCode; // 弹框选择url不可编辑,需要先清除
71
86
 
72
87
  var editable = !value || !value.type;
88
+ var inputName = (value === null || value === void 0 ? void 0 : value.name) || '';
89
+
90
+ if ((value === null || value === void 0 ? void 0 : value.type) === _constants.urlTypeMap.ANCHOR) {
91
+ var selectedAnchorIndex = _mobx.store.MPageData.findIndex(function (m) {
92
+ return m.id === ((0, _coreUtil.isPc)() ? value.value.pcNodeId : value.value.mobileNodeId);
93
+ });
94
+
95
+ var selectedAnchor = _mobx.store.MPageData[selectedAnchorIndex];
96
+ inputName = selectedAnchorIndex + 1 + "\u3001" + ((_a = _constants.compInfoMap[selectedAnchor.type]) === null || _a === void 0 ? void 0 : _a.name);
97
+ }
98
+
73
99
  return /*#__PURE__*/_react["default"].createElement("div", {
74
100
  className: "m-url-picker"
75
101
  }, disabled && /*#__PURE__*/_react["default"].createElement("div", {
@@ -88,10 +114,19 @@ function (_super) {
88
114
  },
89
115
  placeholder: (0, _locale.i18n)('PLEASE_ADD_A_LINK'),
90
116
  type: "text",
91
- value: value.name || ''
117
+ value: inputName
92
118
  }), /*#__PURE__*/_react["default"].createElement("div", {
93
119
  className: "icon-btns"
94
- }, window.magicDesign.outputType != 'html' && /*#__PURE__*/_react["default"].createElement(_Iconfont["default"], {
120
+ }, /*#__PURE__*/_react["default"].createElement(_Iconfont["default"], {
121
+ color: "#000",
122
+ onClick: function onClick() {
123
+ return _this.setState({
124
+ anchorModalVisible: true
125
+ });
126
+ },
127
+ size: "20px",
128
+ type: "icon-anchor"
129
+ }), window.magicDesign.outputType != 'html' && /*#__PURE__*/_react["default"].createElement(_Iconfont["default"], {
95
130
  color: "#000",
96
131
  onClick: function onClick() {
97
132
  return _this.setState({
@@ -122,6 +157,21 @@ function (_super) {
122
157
  },
123
158
  onlySpecificCode: onlySpecificCode,
124
159
  visible: visible
160
+ }), anchorModalVisible && /*#__PURE__*/_react["default"].createElement(_AnchorModal["default"], {
161
+ initData: value,
162
+ onClose: function onClose() {
163
+ return _this.setState({
164
+ anchorModalVisible: false
165
+ });
166
+ },
167
+ onConfirm: function onConfirm(value) {
168
+ _onChange(value);
169
+
170
+ _this.setState({
171
+ anchorModalVisible: false
172
+ });
173
+ },
174
+ visible: anchorModalVisible
125
175
  }));
126
176
  };
127
177
 
@@ -389,7 +389,7 @@ function (_super) {
389
389
  intelligentType: intelligentType,
390
390
  intelligentValue: intelligentValue.join(','),
391
391
  aggregation: false,
392
- storeId: window.magicDesign.storeId || ''
392
+ storeId: window.magicDesign.storeId >= 0 ? window.magicDesign.storeId : ''
393
393
  }, 'POST')];
394
394
 
395
395
  case 4:
@@ -381,7 +381,7 @@ function (_super) {
381
381
  intelligentType: intelligentType,
382
382
  intelligentValue: intelligentValue.join(','),
383
383
  aggregation: false,
384
- storeId: window.magicDesign.storeId || ''
384
+ storeId: window.magicDesign.storeId >= 0 ? window.magicDesign.storeId : ''
385
385
  }, 'POST')];
386
386
 
387
387
  case 4:
@@ -68,7 +68,8 @@ var urlTypeMap = {
68
68
  SHARE_URL: 'ShareURL',
69
69
  MINI_APP: 'MiniApp',
70
70
  STORE: 'Store',
71
- AFFILIATE_PRODUCT: 'AffiliateProduct'
71
+ AFFILIATE_PRODUCT: 'AffiliateProduct',
72
+ ANCHOR: 'Anchor'
72
73
  };
73
74
  exports.urlTypeMap = urlTypeMap;
74
75
  var respCodeMap = {
@@ -208,7 +208,7 @@ function (_super) {
208
208
  onClick: this.onBtnClick,
209
209
  tip: "The page is in use. Please copy or create a new page",
210
210
  type: "primary"
211
- }, (0, _locale.i18n)('PUBLISH_NOW'), /*#__PURE__*/_react["default"].createElement(_antd.Dropdown, {
211
+ }, (0, _locale.i18n)('PUBLISH_NOW'), window.magicDesign.templateType === 'Page' && /*#__PURE__*/_react["default"].createElement(_antd.Dropdown, {
212
212
  getPopupContainer: function getPopupContainer() {
213
213
  return document.querySelector('.publish_wrap');
214
214
  },
@@ -1,4 +1,5 @@
1
1
  {
2
+ "ANCHOR": "Anchor",
2
3
  "PUSH": "Push",
3
4
  "SET_AS_TEMPLATE": "Set as Template",
4
5
  "DISPLAY_PAGE": "Display page",
@@ -1,4 +1,5 @@
1
1
  {
2
+ "ANCHOR": "Anchor",
2
3
  "PUSH": "Push",
3
4
  "SET_AS_TEMPLATE": "Set as Template",
4
5
  "DISPLAY_PAGE": "Display page",
@@ -1,4 +1,5 @@
1
1
  {
2
+ "ANCHOR": "Anchor",
2
3
  "PUSH": "Push",
3
4
  "SET_AS_TEMPLATE": "Set as Template",
4
5
  "DISPLAY_PAGE": "Display page",