@titaui/pc 1.11.21-beta.13 → 1.11.21-beta.30

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 (92) hide show
  1. package/lib/components/create-okr-modal/index.js +3 -1
  2. package/lib/components/drawer/index.css +0 -11
  3. package/lib/components/drawer/index.js +2 -8
  4. package/lib/components/dynamic/constant.js +1 -1
  5. package/lib/components/dynamic/dynamic-list/index.js +11 -3
  6. package/lib/components/dynamic/index.js +9 -12
  7. package/lib/components/dynamic/request-api.js +7 -68
  8. package/lib/components/eReport/eReportShare/index.js +1 -1
  9. package/lib/components/grid-layout/sub-employee-okr/person-okr.js +8 -2
  10. package/lib/components/nav-top/index.js +2 -2
  11. package/lib/components/okr-detail/base-info/other-infos/date-cycle/index.js +2 -3
  12. package/lib/components/okr-detail/detail-header/delete-confirm/delete-confirm.js +27 -17
  13. package/lib/components/okr-detail/detail-header/index.css +11 -0
  14. package/lib/components/okr-detail/detail-header/index.js +25 -21
  15. package/lib/components/okr-period-selector/index.js +9 -5
  16. package/lib/components/okrcase-library/okrcases-components/submitOkr-dialog.js +7 -2
  17. package/lib/components/operation-records/index.js +1 -1
  18. package/lib/components/publish-dynamic-modal/publish-dynamic-modal.js +16 -10
  19. package/lib/components/superset-charts/utils/axios.js +0 -8
  20. package/lib/components/survey-model/contact.js +1 -1
  21. package/lib/components/toast/index.js +5 -3
  22. package/lib/pages/new-okr-list/header/index.js +1 -1
  23. package/lib/pages/new-okr-list/header/operate-record.js +8 -6
  24. package/package.json +2 -2
  25. package/lib/components/dynamic/advertise/components/next-btn/index.css +0 -27
  26. package/lib/components/dynamic/advertise/components/next-btn/index.js +0 -32
  27. package/lib/components/dynamic/advertise/components/pre-btn/index.css +0 -26
  28. package/lib/components/dynamic/advertise/components/pre-btn/index.js +0 -32
  29. package/lib/components/dynamic/advertise/index.css +0 -21
  30. package/lib/components/dynamic/advertise/index.js +0 -126
  31. package/lib/components/dynamic/advertise/interface.js +0 -5
  32. package/lib/components/dynamic/advertise/util.js +0 -28
  33. package/lib/components/dynamic/components/dynamic-search-input/index.css +0 -81
  34. package/lib/components/dynamic/components/dynamic-search-input/index.js +0 -203
  35. package/lib/components/dynamic/components/first-level-tabs/index.css +0 -101
  36. package/lib/components/dynamic/components/first-level-tabs/index.js +0 -131
  37. package/lib/components/dynamic/dynamic-like-ranking/image/like-ranking.svg +0 -23
  38. package/lib/components/dynamic/dynamic-like-ranking/image/ranking-1.png +0 -0
  39. package/lib/components/dynamic/dynamic-like-ranking/image/ranking-2.png +0 -0
  40. package/lib/components/dynamic/dynamic-like-ranking/image/ranking-3.png +0 -0
  41. package/lib/components/dynamic/dynamic-like-ranking/image/ranking-empty.png +0 -0
  42. package/lib/components/dynamic/dynamic-like-ranking/index.css +0 -146
  43. package/lib/components/dynamic/dynamic-like-ranking/index.js +0 -180
  44. package/lib/components/dynamic/dynamic-like-ranking/item.js +0 -105
  45. package/lib/components/dynamic/dynamic-like-ranking/mock.js +0 -84
  46. package/lib/components/dynamic/dynamic-liking/image/like-dynamic.svg +0 -30
  47. package/lib/components/dynamic/dynamic-liking/index.css +0 -81
  48. package/lib/components/dynamic/dynamic-liking/index.js +0 -79
  49. package/lib/components/dynamic/dynamic-liking/item.js +0 -75
  50. package/lib/components/dynamic/dynamic-liking/mock.js +0 -83
  51. package/lib/components/dynamic/dynamic-topping/image/quotation-mark.svg +0 -16
  52. package/lib/components/dynamic/dynamic-topping/image/top-icon.svg +0 -30
  53. package/lib/components/dynamic/dynamic-topping/index.css +0 -141
  54. package/lib/components/dynamic/dynamic-topping/index.js +0 -82
  55. package/lib/components/dynamic/dynamic-topping/interface.js +0 -5
  56. package/lib/components/dynamic/dynamic-topping/item.js +0 -153
  57. package/lib/components/dynamic/dynamic-topping/request-api.js +0 -36
  58. package/lib/components/dynamic/dynamic.css +0 -173
  59. package/lib/components/dynamic/dynamic.js +0 -428
  60. package/lib/components/dynamic/export-module/index.js +0 -37
  61. package/lib/components/dynamic/img/dynamic-top.svg +0 -14
  62. package/lib/components/dynamic/my-team/img/add-subordinate.png +0 -0
  63. package/lib/components/dynamic/my-team/img/line.png +0 -0
  64. package/lib/components/dynamic/my-team/img/team.png +0 -0
  65. package/lib/components/dynamic/my-team/index.css +0 -184
  66. package/lib/components/dynamic/my-team/index.js +0 -263
  67. package/lib/components/dynamic/my-team/request-api.js +0 -52
  68. package/lib/components/dynamic/my-team/util.js +0 -20
  69. package/lib/components/dynamic/new-ui.css +0 -192
  70. package/lib/components/dynamic/online-broadcast/components/broadcast-item/index.css +0 -58
  71. package/lib/components/dynamic/online-broadcast/components/broadcast-item/index.js +0 -68
  72. package/lib/components/dynamic/online-broadcast/data.js +0 -77
  73. package/lib/components/dynamic/online-broadcast/img/broadcast.svg +0 -14
  74. package/lib/components/dynamic/online-broadcast/img/new.png +0 -0
  75. package/lib/components/dynamic/online-broadcast/img/preview.png +0 -0
  76. package/lib/components/dynamic/online-broadcast/index.css +0 -46
  77. package/lib/components/dynamic/online-broadcast/index.js +0 -61
  78. package/lib/components/dynamic/online-broadcast/interfact.js +0 -5
  79. package/lib/components/dynamic/quick-operation/components/create-announcement/index.css +0 -25
  80. package/lib/components/dynamic/quick-operation/components/create-announcement/index.js +0 -39
  81. package/lib/components/dynamic/quick-operation/components/create-okr/index.css +0 -25
  82. package/lib/components/dynamic/quick-operation/components/create-okr/index.js +0 -39
  83. package/lib/components/dynamic/quick-operation/components/create-share/index.css +0 -25
  84. package/lib/components/dynamic/quick-operation/components/create-share/index.js +0 -39
  85. package/lib/components/dynamic/quick-operation/components/create-task/index.css +0 -25
  86. package/lib/components/dynamic/quick-operation/components/create-task/index.js +0 -44
  87. package/lib/components/dynamic/quick-operation/img/new-announcement.png +0 -0
  88. package/lib/components/dynamic/quick-operation/img/new-okr.png +0 -0
  89. package/lib/components/dynamic/quick-operation/img/new-share.png +0 -0
  90. package/lib/components/dynamic/quick-operation/img/new-task.png +0 -0
  91. package/lib/components/dynamic/quick-operation/index.css +0 -51
  92. package/lib/components/dynamic/quick-operation/index.js +0 -120
@@ -41,12 +41,9 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
41
41
 
42
42
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
43
43
 
44
- function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure undefined"); }
45
-
46
44
  var prefix = "publish-dynamic-modal";
47
-
48
- var PublishDynamicModal = function PublishDynamicModal(_ref) {
49
- _objectDestructuringEmpty(_ref);
45
+ var PublishDynamicModal = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
46
+ var onSubmitSuccess = _ref.onSubmitSuccess;
50
47
 
51
48
  var _useState = (0, _react.useState)(false),
52
49
  _useState2 = _slicedToArray(_useState, 2),
@@ -82,10 +79,10 @@ var PublishDynamicModal = function PublishDynamicModal(_ref) {
82
79
  localStorage.removeItem("mblogLocalStroage_".concat((0, _bsGlobal.getUserInfo)().Id, "_commentsTypeKey_").concat(isShare ? "share" : "announcement"));
83
80
  setVisible(false);
84
81
  setSubmitStatus(1);
85
- setTimeout(function () {
86
- // @ts-ignore 跳到我的发布页签
87
- window.setTabsToPublish && window.setTabsToPublish();
88
- }, 2000);
82
+
83
+ if (onSubmitSuccess) {
84
+ onSubmitSuccess();
85
+ }
89
86
  } else {
90
87
  _toast["default"].Error(resp.Message, {
91
88
  canClose: false
@@ -146,6 +143,13 @@ var PublishDynamicModal = function PublishDynamicModal(_ref) {
146
143
  setVisible(true);
147
144
  };
148
145
 
146
+ (0, _react.useImperativeHandle)(ref, function () {
147
+ return {
148
+ hide: hidePublishDynamicModal,
149
+ showShareModal: showPublishShareDynamicModal,
150
+ showAnnouncementModal: showPublishAnnouncementDynamicModal
151
+ };
152
+ });
149
153
  (0, _react.useEffect)(function () {
150
154
  // @ts-ignore
151
155
  window.hidePublishDynamicModal = hidePublishDynamicModal; // @ts-ignore
@@ -188,7 +192,9 @@ var PublishDynamicModal = function PublishDynamicModal(_ref) {
188
192
  ,
189
193
  onMblogSubmit: onMblogSubmit
190
194
  })));
195
+ });
196
+ PublishDynamicModal.defaultProps = {
197
+ onSubmitSuccess: function onSubmitSuccess() {}
191
198
  };
192
-
193
199
  var _default = PublishDynamicModal;
194
200
  exports["default"] = _default;
@@ -65,14 +65,6 @@ var beforeResponse = function beforeResponse(res) {
65
65
  config.retry = 3;
66
66
  config.retryCount = config.retryCount || 0;
67
67
 
68
- if (window.titaTracker) {
69
- window.titaTracker("action").record({
70
- actionName: JSON.stringify(config),
71
- actionGroup: "调用接口",
72
- productName: "接口"
73
- });
74
- }
75
-
76
68
  if (res.data.code === 401) {
77
69
  // 401错误表示未登录授权或者token失效
78
70
  clearToken();
@@ -77,7 +77,7 @@ var ContactModel = function ContactModel(_ref) {
77
77
  className: "tu-icon-canceled ".concat(preCls, "__head-close "),
78
78
  onClick: handleClose
79
79
  })), /*#__PURE__*/_react["default"].createElement(Input, {
80
- placeholder: '请输入',
80
+ placeholder: '参与调研有礼相送哦~',
81
81
  value: contact,
82
82
  onChange: onContactChange,
83
83
  className: "".concat(preCls, "__input")
@@ -168,6 +168,7 @@ var Toast = /*#__PURE__*/function () {
168
168
  var options,
169
169
  key,
170
170
  ins,
171
+ canClose,
171
172
  _args3 = arguments;
172
173
  return regeneratorRuntime.wrap(function _callee3$(_context3) {
173
174
  while (1) {
@@ -180,14 +181,15 @@ var Toast = /*#__PURE__*/function () {
180
181
 
181
182
  case 4:
182
183
  ins = _context3.sent;
184
+ canClose = options.canClose !== undefined ? options.canClose : false;
183
185
  ins.notice({
184
- content: (0, _SuccessRender.RenderError)(msg, key, options.canClose, ins),
186
+ content: (0, _SuccessRender.RenderError)(msg, key, canClose, ins),
185
187
  style: options.style,
186
- duration: options.duration || options.canClose === false ? 3 : 3000,
188
+ duration: options.duration || canClose === false ? 3 : 3000,
187
189
  key: key
188
190
  });
189
191
 
190
- case 6:
192
+ case 7:
191
193
  case "end":
192
194
  return _context3.stop();
193
195
  }
@@ -205,7 +205,7 @@ function Header(props, ref) {
205
205
  className: "".concat(_precls.precls, "__header-item")
206
206
  }, getTitle())), /*#__PURE__*/_react["default"].createElement("div", {
207
207
  className: "".concat(_precls.precls, "__header-right")
208
- }, departmentId === 0 && /*#__PURE__*/_react["default"].createElement("div", {
208
+ }, Number(departmentId) === 0 && /*#__PURE__*/_react["default"].createElement("div", {
209
209
  className: "".concat(_precls.precls, "__header-item")
210
210
  }, /*#__PURE__*/_react["default"].createElement(_keywordSearch["default"], {
211
211
  onSearch: onSearch
@@ -63,7 +63,9 @@ var OperateRecord = function OperateRecord(props) {
63
63
  yqmNum = _useContext.yqmNum;
64
64
 
65
65
  var openOperateRecordPush = function openOperateRecordPush() {
66
- popupRef.current && popupRef.current.close();
66
+ // @ts-ignore
67
+ popupRef.current && popupRef.current.close(); // @ts-ignore
68
+
67
69
  drawerRef.current && drawerRef.current.showOperateDrawerVisible();
68
70
  };
69
71
 
@@ -110,11 +112,11 @@ var OperateRecord = function OperateRecord(props) {
110
112
  })))), (toUserId !== undefined || relation === 1) && !!userInfo && /*#__PURE__*/_react["default"].createElement(OkrOperateRecordDrawer, {
111
113
  ref: drawerRef,
112
114
  userInfo: {
113
- Id: userInfo.userId,
114
- Name: userInfo.name,
115
- Color: userInfo.avatar.color,
116
- AvatarsUrl: userInfo.avatar.original,
117
- Type: 1
115
+ id: userInfo.userId,
116
+ name: userInfo.name,
117
+ color: userInfo.avatar.color,
118
+ avatarsUrl: userInfo.avatar.original,
119
+ type: 1
118
120
  },
119
121
  okrCycle: "\u300C".concat((0, _common.formatPeriod)({
120
122
  annualNum: annualNum,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@titaui/pc",
3
- "version": "1.11.21-beta.13",
3
+ "version": "1.11.21-beta.30",
4
4
  "nameCN": "",
5
5
  "description": "",
6
6
  "main": "lib/index.js",
@@ -144,7 +144,7 @@
144
144
  "react-transition-group": "4.4.2",
145
145
  "resize-observer-polyfill": "1.5.1",
146
146
  "slick-carousel": "1.8.1",
147
- "tita-ui": "1.2.52",
147
+ "tita-ui": "1.2.56",
148
148
  "url-parse": "1.5.1",
149
149
  "uuid": "3.1.0",
150
150
  "viewerjs": "1.10.1",
@@ -1,27 +0,0 @@
1
- .titaui-dynamic-advertise-next-btn {
2
- width: 24px;
3
- height: 24px;
4
- background: rgba(0, 0, 0, 0.4);
5
- border-radius: 50%;
6
- display: flex;
7
- align-items: center;
8
- justify-content: center;
9
- cursor: pointer;
10
- position: absolute;
11
- top: 50%;
12
- transform: translateY(-50%);
13
- z-index: 1;
14
- right: 16px;
15
- opacity: 1;
16
- transition: all 0.3s linear;
17
- }
18
-
19
- .titaui-dynamic-advertise-next-btn__icon {
20
- font-size: 16px;
21
- transform: rotate(180deg);
22
- color: #ffffff;
23
- }
24
-
25
- .titaui-dynamic-advertise-next-btn--hidden {
26
- opacity: 0;
27
- }
@@ -1,32 +0,0 @@
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 _classnames = _interopRequireDefault(require("classnames"));
11
-
12
- require("./index.css");
13
-
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
-
16
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
17
-
18
- var prefix = "titaui-dynamic-advertise-next-btn";
19
-
20
- var NextBtn = function NextBtn(_ref) {
21
- var onClick = _ref.onClick,
22
- isShow = _ref.isShow;
23
- return /*#__PURE__*/_react["default"].createElement("div", {
24
- className: (0, _classnames["default"])(prefix, _defineProperty({}, "".concat(prefix, "--hidden"), !isShow)),
25
- onClick: onClick
26
- }, /*#__PURE__*/_react["default"].createElement("i", {
27
- className: (0, _classnames["default"])("tu-icon-left", "".concat(prefix, "__icon"))
28
- }));
29
- };
30
-
31
- var _default = NextBtn;
32
- exports["default"] = _default;
@@ -1,26 +0,0 @@
1
- .titaui-dynamic-advertise-pre-btn {
2
- width: 24px;
3
- height: 24px;
4
- background: rgba(0, 0, 0, 0.4);
5
- border-radius: 50%;
6
- display: flex;
7
- align-items: center;
8
- justify-content: center;
9
- cursor: pointer;
10
- position: absolute;
11
- top: 50%;
12
- left: 16px;
13
- transform: translateY(-50%);
14
- z-index: 1;
15
- opacity: 1;
16
- transition: all 0.3s linear;
17
- }
18
-
19
- .titaui-dynamic-advertise-pre-btn__icon {
20
- font-size: 16px;
21
- color: #ffffff;
22
- }
23
-
24
- .titaui-dynamic-advertise-pre-btn--hidden {
25
- opacity: 0;
26
- }
@@ -1,32 +0,0 @@
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 _classnames = _interopRequireDefault(require("classnames"));
11
-
12
- require("./index.css");
13
-
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
-
16
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
17
-
18
- var prefix = "titaui-dynamic-advertise-pre-btn";
19
-
20
- var PreBtn = function PreBtn(_ref) {
21
- var onClick = _ref.onClick,
22
- isShow = _ref.isShow;
23
- return /*#__PURE__*/_react["default"].createElement("div", {
24
- className: (0, _classnames["default"])(prefix, _defineProperty({}, "".concat(prefix, "--hidden"), !isShow)),
25
- onClick: onClick
26
- }, /*#__PURE__*/_react["default"].createElement("i", {
27
- className: (0, _classnames["default"])("tu-icon-left", "".concat(prefix, "__icon"))
28
- }));
29
- };
30
-
31
- var _default = PreBtn;
32
- exports["default"] = _default;
@@ -1,21 +0,0 @@
1
- .tutaui-dynamic-advertise {
2
- width: 278px;
3
- border-radius: 12px;
4
- position: relative;
5
- }
6
-
7
- .tutaui-dynamic-advertise--not-empty {
8
- box-shadow: 0px 2px 12px 0px rgba(127, 145, 180, 0.2);
9
- margin-top: 10px;
10
- height: 136px;
11
- }
12
-
13
- .tutaui-dynamic-advertise *:focus {
14
- outline: none !important;
15
- }
16
-
17
- .tutaui-dynamic-advertise__img {
18
- border-radius: 12px;
19
- width: 278px;
20
- height: 136px;
21
- }
@@ -1,126 +0,0 @@
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"] = void 0;
9
-
10
- var _react = _interopRequireWildcard(require("react"));
11
-
12
- var _reactSlick = _interopRequireDefault(require("react-slick"));
13
-
14
- var _classnames = _interopRequireDefault(require("classnames"));
15
-
16
- var _requestApi = require("../request-api");
17
-
18
- var _toast = _interopRequireDefault(require("../../toast"));
19
-
20
- var _util = require("./util");
21
-
22
- var _nextBtn = _interopRequireDefault(require("./components/next-btn"));
23
-
24
- var _preBtn = _interopRequireDefault(require("./components/pre-btn"));
25
-
26
- require("slick-carousel/slick/slick.css");
27
-
28
- require("slick-carousel/slick/slick-theme.css");
29
-
30
- require("./index.css");
31
-
32
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
33
-
34
- 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); }
35
-
36
- 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; }
37
-
38
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
39
-
40
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
41
-
42
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
43
-
44
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
45
-
46
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
47
-
48
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
49
-
50
- function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
51
-
52
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
53
-
54
- var prefix = "tutaui-dynamic-advertise";
55
- var settings = {
56
- dots: false,
57
- infinite: true,
58
- speed: 1000,
59
- slidesToShow: 1,
60
- slidesToScroll: 1,
61
- // arrows: false,
62
- autoplay: true
63
- };
64
-
65
- var DynamicAdvertise = function DynamicAdvertise() {
66
- var _useState = (0, _react.useState)([]),
67
- _useState2 = _slicedToArray(_useState, 2),
68
- sliderData = _useState2[0],
69
- setSliderData = _useState2[1];
70
-
71
- var _useState3 = (0, _react.useState)(false),
72
- _useState4 = _slicedToArray(_useState3, 2),
73
- isMouseEnter = _useState4[0],
74
- setIsMouseEnter = _useState4[1];
75
-
76
- var handleImgClick = function handleImgClick(link) {
77
- window.open(link, "_blank");
78
- };
79
-
80
- var handleMouseEnter = function handleMouseEnter() {
81
- setIsMouseEnter(true);
82
- };
83
-
84
- var handleMouseLeave = function handleMouseLeave() {
85
- setIsMouseEnter(false);
86
- };
87
-
88
- (0, _react.useEffect)(function () {
89
- (0, _requestApi.getAdvertise)().then(function (resp) {
90
- if (resp.Code === 1 && resp.Data.length > 0) {
91
- setSliderData((0, _util.formatResp)(resp.Data));
92
- }
93
-
94
- if (resp.Code !== 1) {
95
- _toast["default"].Error(resp.Message, {
96
- canClose: false
97
- });
98
- }
99
- });
100
- }, []);
101
- return /*#__PURE__*/_react["default"].createElement("div", {
102
- className: (0, _classnames["default"])(prefix, _defineProperty({}, "".concat(prefix, "--not-empty"), sliderData.length > 0)),
103
- onMouseEnter: handleMouseEnter,
104
- onMouseLeave: handleMouseLeave
105
- }, sliderData.length > 0 && /*#__PURE__*/_react["default"].createElement(_reactSlick["default"], _extends({}, settings, {
106
- nextArrow: /*#__PURE__*/_react["default"].createElement(_nextBtn["default"], {
107
- isShow: isMouseEnter
108
- }),
109
- prevArrow: /*#__PURE__*/_react["default"].createElement(_preBtn["default"], {
110
- isShow: isMouseEnter
111
- })
112
- }), sliderData.map(function (item) {
113
- return /*#__PURE__*/_react["default"].createElement("div", {
114
- onClick: function onClick() {
115
- handleImgClick(item.link);
116
- }
117
- }, /*#__PURE__*/_react["default"].createElement("img", {
118
- className: "".concat(prefix, "__img"),
119
- src: item.img,
120
- alt: item.name
121
- }));
122
- })));
123
- };
124
-
125
- var _default = DynamicAdvertise;
126
- exports["default"] = _default;
@@ -1,5 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
@@ -1,28 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.formatResp = void 0;
7
-
8
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
9
-
10
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
11
-
12
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
13
-
14
- var formatResp = function formatResp(data) {
15
- if (!data || data.length === 0) {
16
- return [];
17
- }
18
-
19
- return data.map(function (item) {
20
- var content = JSON.parse(item.content);
21
- return _objectSpread(_objectSpread({}, item), {}, {
22
- img: content.picUrl,
23
- link: content.link
24
- });
25
- });
26
- };
27
-
28
- exports.formatResp = formatResp;
@@ -1,81 +0,0 @@
1
- .titaui-dynamic-search-input {
2
- display: flex;
3
- align-items: center;
4
- width: 240px;
5
- height: 32px;
6
- background: #ffffff;
7
- border-radius: 16px;
8
- border: 1px solid #e9ecf0;
9
- padding: 5px 12px 5px 14px;
10
- box-sizing: border-box;
11
- }
12
-
13
- .titaui-dynamic-search-input__popup {
14
- width: 96px;
15
- height: 96px;
16
- background: #ffffff;
17
- box-shadow: 0px 4px 12px 0px rgba(127, 145, 180, 0.2);
18
- border: 1px solid #f0f2f5;
19
- padding: 16px 0px 16px 0px;
20
- box-sizing: border-box;
21
- border-radius: 6px;
22
- user-select: none;
23
- }
24
-
25
- .titaui-dynamic-search-input__popup-item {
26
- display: flex;
27
- align-items: center;
28
- justify-content: center;
29
- height: 32px;
30
- font-size: 14px;
31
- color: #3f4755;
32
- line-height: 22px;
33
- cursor: pointer;
34
- }
35
-
36
- .titaui-dynamic-search-input__popup-item--active {
37
- color: #2879ff;
38
- }
39
-
40
- .titaui-dynamic-search-input__popup-item:hover {
41
- color: #2879ff;
42
- background: #f7f8fa;
43
- }
44
-
45
- .titaui-dynamic-search-input__icon {
46
- margin: 0 8px;
47
- }
48
-
49
- .titaui-dynamic-search-input__select-type {
50
- display: flex;
51
- align-items: center;
52
- cursor: pointer;
53
- word-break: keep-all;
54
- white-space: nowrap;
55
- }
56
-
57
- .titaui-dynamic-search-input__input {
58
- border: none;
59
- outline: none;
60
- width: 130px;
61
- margin-right: 4px;
62
- overflow: hidden;
63
- text-overflow: ellipsis;
64
- line-height: 22px;
65
- }
66
-
67
- .titaui-dynamic-search-input__input::placeholder {
68
- font-size: 14px;
69
- color: #bfc7d5;
70
- line-height: 22px;
71
- }
72
-
73
- .titaui-dynamic-search-input__input-clear {
74
- color: #bfc7d5;
75
- font-size: 14px;
76
- }
77
-
78
- .titaui-dynamic-search-input__input-clear:hover {
79
- cursor: pointer;
80
- color: #f05e5e;
81
- }