@titaui/pc 1.9.30 → 1.9.34
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/lib/components/dialog/index.css +23 -0
- package/lib/components/dialog/index.js +25 -5
- package/lib/components/dialog/loading.png +0 -0
- package/lib/components/dynamic/export-module/index.js +5 -1
- package/lib/components/dynamic/index.js +1 -0
- package/lib/components/hr-header/index.js +1 -1
- package/lib/components/menus/components/flip-menu-card/index.js +78 -14
- package/lib/components/menus/export-modules/okr-menus/depart-menus/index.js +14 -10
- package/lib/components/table/index.css +1 -0
- package/lib/components/user-selector/export-modules/duties-selector/index.js +5 -3
- package/lib/components/user-selector/select-tree/choose-tree/index.js +10 -2
- package/lib/pages/aha2021/index.js +1 -1
- package/lib/pages/home/components/data-list/index.css +0 -2
- package/lib/pages/new-okr-list/index.js +1 -1
- package/package.json +1 -1
- package/src/components/dialog/index.js +19 -5
- package/src/components/dialog/index.scss +46 -2
- package/src/components/dialog/loading.png +0 -0
- package/src/components/dynamic/export-module/index.tsx +2 -0
- package/src/components/dynamic/index.tsx +2 -0
- package/src/components/hr-header/index.tsx +1 -1
- package/src/components/menus/components/flip-menu-card/index.tsx +83 -25
- package/src/components/menus/export-modules/okr-menus/depart-menus/index.tsx +9 -6
- package/src/components/table/index.scss +1 -0
- package/src/components/user-selector/export-modules/duties-selector/index.tsx +4 -2
- package/src/components/user-selector/select-tree/choose-tree/index.tsx +3 -1
- package/src/pages/aha2021/index.tsx +1 -1
- package/src/pages/home/components/data-list/index.scss +0 -2
- package/src/pages/new-okr-list/index.tsx +1 -1
- package/lib/components/table/checkbox/index.css +0 -95
- package/lib/components/table/checkbox/index.js +0 -24
- package/src/components/table/checkbox/index.js +0 -11
- package/src/components/table/checkbox/index.scss +0 -93
|
@@ -84,6 +84,8 @@
|
|
|
84
84
|
font-weight: 400;
|
|
85
85
|
line-height: 20px;
|
|
86
86
|
text-align: center;
|
|
87
|
+
display: flex;
|
|
88
|
+
align-items: center;
|
|
87
89
|
box-sizing: border-box;
|
|
88
90
|
}
|
|
89
91
|
|
|
@@ -93,6 +95,7 @@
|
|
|
93
95
|
border: 1px solid #2879ff;
|
|
94
96
|
color: #ffffff;
|
|
95
97
|
transition: 0.2s all;
|
|
98
|
+
user-select: none;
|
|
96
99
|
}
|
|
97
100
|
|
|
98
101
|
.titaui-dialog__btn-ok:hover {
|
|
@@ -102,9 +105,19 @@
|
|
|
102
105
|
}
|
|
103
106
|
|
|
104
107
|
.titaui-dialog__btn-ok-not-allowed {
|
|
108
|
+
background-color: #5C8EFF;
|
|
105
109
|
cursor: not-allowed;
|
|
106
110
|
}
|
|
107
111
|
|
|
112
|
+
.titaui-dialog__btn-ok-loading-icon {
|
|
113
|
+
width: 14px;
|
|
114
|
+
margin-right: 6px;
|
|
115
|
+
animation-name: spin;
|
|
116
|
+
animation-timing-function: linear;
|
|
117
|
+
animation-iteration-count: infinite;
|
|
118
|
+
animation-duration: 1s;
|
|
119
|
+
}
|
|
120
|
+
|
|
108
121
|
.titaui-dialog__btn-cancel {
|
|
109
122
|
border: 1px solid #DFE3EA;
|
|
110
123
|
color: #6f7886;
|
|
@@ -131,3 +144,13 @@
|
|
|
131
144
|
.titaui-dialog.titaui-dialog-no-footer .rc-dialog-footer {
|
|
132
145
|
display: none;
|
|
133
146
|
}
|
|
147
|
+
|
|
148
|
+
@keyframes spin {
|
|
149
|
+
from {
|
|
150
|
+
transform: rotate(0deg);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
to {
|
|
154
|
+
transform: rotate(360deg);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
@@ -1,26 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
6
8
|
exports["default"] = void 0;
|
|
7
9
|
|
|
8
|
-
var _react =
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
11
|
|
|
10
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
13
|
|
|
12
14
|
var _rcDialog = _interopRequireDefault(require("rc-dialog"));
|
|
13
15
|
|
|
16
|
+
var _loading = _interopRequireDefault(require("./loading.png"));
|
|
17
|
+
|
|
14
18
|
var _getLocale = require("../../utils/getLocale");
|
|
15
19
|
|
|
16
20
|
require("rc-dialog/assets/index.css");
|
|
17
21
|
|
|
18
22
|
require("./index.css");
|
|
19
23
|
|
|
20
|
-
var _excluded = ["onOk", "onCancel", "okText", "cancelText", "footer", "noFooter", "noHeadLine", "noCloseIcon", "noFooterLine", "visible", "extraClass", "extendFooterBtn", "disabled"];
|
|
24
|
+
var _excluded = ["onOk", "onCancel", "okText", "cancelText", "footer", "noFooter", "noHeadLine", "noCloseIcon", "noFooterLine", "visible", "extraClass", "extendFooterBtn", "disabled", "confirmLoading"];
|
|
21
25
|
|
|
22
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
23
27
|
|
|
28
|
+
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); }
|
|
29
|
+
|
|
30
|
+
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; }
|
|
31
|
+
|
|
24
32
|
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); }
|
|
25
33
|
|
|
26
34
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
@@ -69,8 +77,15 @@ var _default = function _default(props) {
|
|
|
69
77
|
extendFooterBtn = props.extendFooterBtn,
|
|
70
78
|
_props$disabled = props.disabled,
|
|
71
79
|
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
80
|
+
_props$confirmLoading = props.confirmLoading,
|
|
81
|
+
confirmLoading = _props$confirmLoading === void 0 ? false : _props$confirmLoading,
|
|
72
82
|
restProps = _objectWithoutProperties(props, _excluded);
|
|
73
83
|
|
|
84
|
+
var handleOK = function handleOK() {
|
|
85
|
+
if (confirmLoading) return;
|
|
86
|
+
onOk && onOk();
|
|
87
|
+
};
|
|
88
|
+
|
|
74
89
|
var baseFooter = [extendFooterBtn, /*#__PURE__*/_react["default"].createElement("span", {
|
|
75
90
|
key: "cancel",
|
|
76
91
|
className: (0, _classnames["default"])("".concat(preCls, "__btn"), "".concat(preCls, "__btn-cancel")),
|
|
@@ -79,9 +94,14 @@ var _default = function _default(props) {
|
|
|
79
94
|
className: (0, _classnames["default"])("".concat(preCls, "__btn-cancel-text"))
|
|
80
95
|
}, cancelText)), /*#__PURE__*/_react["default"].createElement("span", {
|
|
81
96
|
key: "ok",
|
|
82
|
-
className: (0, _classnames["default"])("".concat(preCls, "__btn"), "".concat(preCls, "__btn-ok"), _defineProperty({}, "".concat(preCls, "__btn-ok-not-allowed"), disabled)),
|
|
83
|
-
onClick:
|
|
84
|
-
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
97
|
+
className: (0, _classnames["default"])("".concat(preCls, "__btn"), "".concat(preCls, "__btn-ok"), _defineProperty({}, "".concat(preCls, "__btn-ok-not-allowed"), disabled || confirmLoading)),
|
|
98
|
+
onClick: handleOK
|
|
99
|
+
}, confirmLoading ? /*#__PURE__*/_react["default"].createElement("span", {
|
|
100
|
+
className: (0, _classnames["default"])("".concat(preCls, "__btn-ok-loading"))
|
|
101
|
+
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
102
|
+
className: (0, _classnames["default"])("".concat(preCls, "__btn-ok-loading-icon")),
|
|
103
|
+
src: _loading["default"]
|
|
104
|
+
}), (0, _getLocale.getLocale)('Mod_loading')) : /*#__PURE__*/_react["default"].createElement("span", {
|
|
85
105
|
className: (0, _classnames["default"])("".concat(preCls, "__btn-ok-text"))
|
|
86
106
|
}, okText))];
|
|
87
107
|
return /*#__PURE__*/_react["default"].createElement(_rcDialog["default"], _extends({
|
|
Binary file
|
|
@@ -3,12 +3,14 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports["default"] = exports.DynamicTopping = exports.DynamicQuickOperation = exports.DynamicLiking = exports.DynamicLikeRanking = exports.DynamicItem = void 0;
|
|
6
|
+
exports["default"] = exports.DynamicTopping = exports.DynamicQuickOperation = exports.DynamicList = exports.DynamicLiking = exports.DynamicLikeRanking = exports.DynamicItem = void 0;
|
|
7
7
|
|
|
8
8
|
var _quickOperation = _interopRequireDefault(require("../quick-operation"));
|
|
9
9
|
|
|
10
10
|
var _dynamic = _interopRequireDefault(require("../dynamic"));
|
|
11
11
|
|
|
12
|
+
var _dynamicList = _interopRequireDefault(require("../dynamic-list"));
|
|
13
|
+
|
|
12
14
|
var _dynamicItem = _interopRequireDefault(require("../dynamic-item"));
|
|
13
15
|
|
|
14
16
|
var _dynamicTopping = _interopRequireDefault(require("../dynamic-topping"));
|
|
@@ -21,6 +23,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
|
|
|
21
23
|
|
|
22
24
|
var _default = _dynamic["default"];
|
|
23
25
|
exports["default"] = _default;
|
|
26
|
+
var DynamicList = _dynamicList["default"];
|
|
27
|
+
exports.DynamicList = DynamicList;
|
|
24
28
|
var DynamicQuickOperation = _quickOperation["default"];
|
|
25
29
|
exports.DynamicQuickOperation = DynamicQuickOperation;
|
|
26
30
|
var DynamicItem = _dynamicItem["default"];
|
|
@@ -13,6 +13,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
13
13
|
|
|
14
14
|
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; }
|
|
15
15
|
|
|
16
|
+
_exportModule["default"].List = _exportModule.DynamicList;
|
|
16
17
|
_exportModule["default"].Item = _exportModule.DynamicItem;
|
|
17
18
|
_exportModule["default"].LikeRanking = _exportModule.DynamicLikeRanking;
|
|
18
19
|
_exportModule["default"].Liking = _exportModule.DynamicLiking;
|
|
@@ -76,11 +76,16 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
76
76
|
isHideTopRightIcon = _useState8[0],
|
|
77
77
|
setIsHideTopRightIcon = _useState8[1];
|
|
78
78
|
|
|
79
|
-
var _useState9 = (0, _react.useState)(
|
|
79
|
+
var _useState9 = (0, _react.useState)(true),
|
|
80
80
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
81
81
|
showMore = _useState10[0],
|
|
82
82
|
setShowMore = _useState10[1];
|
|
83
83
|
|
|
84
|
+
var _useState11 = (0, _react.useState)(true),
|
|
85
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
86
|
+
showFrontMore = _useState12[0],
|
|
87
|
+
setShowFrontMore = _useState12[1];
|
|
88
|
+
|
|
84
89
|
var hideFloatRef = (0, _react.useRef)();
|
|
85
90
|
var flipCardRef = (0, _react.useRef)();
|
|
86
91
|
var flipFrontRef = (0, _react.useRef)();
|
|
@@ -189,7 +194,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
189
194
|
};
|
|
190
195
|
|
|
191
196
|
(0, _react.useEffect)(function () {
|
|
192
|
-
var targetNode = document.
|
|
197
|
+
var targetNode = document.querySelector(".".concat(_precls["default"], "__inner-back-content"));
|
|
193
198
|
var config = {
|
|
194
199
|
attributes: true,
|
|
195
200
|
childList: true,
|
|
@@ -197,16 +202,22 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
197
202
|
};
|
|
198
203
|
|
|
199
204
|
var callback = function callback(_mutationsList, _observer) {
|
|
200
|
-
var scrollArea = document.
|
|
205
|
+
var scrollArea = _simplebar["default"].instances.get(document.querySelector(".".concat(_precls["default"], "__inner-back [data-simplebar]")));
|
|
206
|
+
|
|
207
|
+
var el = scrollArea === null || scrollArea === void 0 ? void 0 : scrollArea.getScrollElement();
|
|
201
208
|
|
|
202
|
-
if (
|
|
203
|
-
|
|
209
|
+
if (el && el.scrollHeight > el.offsetHeight) {
|
|
210
|
+
if (el.scrollHeight - el.offsetHeight == el.scrollTop) {
|
|
211
|
+
setShowFrontMore(false);
|
|
212
|
+
} else {
|
|
213
|
+
setShowFrontMore(true);
|
|
214
|
+
}
|
|
204
215
|
} else {
|
|
205
216
|
setShowMore(false);
|
|
206
217
|
}
|
|
207
218
|
|
|
208
|
-
|
|
209
|
-
if (
|
|
219
|
+
el === null || el === void 0 ? void 0 : el.addEventListener("scroll", function () {
|
|
220
|
+
if (el.scrollHeight - el.offsetHeight == el.scrollTop) {
|
|
210
221
|
setShowMore(false);
|
|
211
222
|
} else {
|
|
212
223
|
setShowMore(true);
|
|
@@ -219,13 +230,63 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
219
230
|
return function () {
|
|
220
231
|
observer.disconnect();
|
|
221
232
|
};
|
|
222
|
-
}, []);
|
|
233
|
+
}, [isBack]);
|
|
234
|
+
(0, _react.useEffect)(function () {
|
|
235
|
+
if (isBack) return;
|
|
236
|
+
var targetNode = document.querySelector(".".concat(_precls["default"], "__inner-front-content"));
|
|
237
|
+
var config = {
|
|
238
|
+
attributes: true,
|
|
239
|
+
childList: true,
|
|
240
|
+
subtree: true
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
var callback = function callback(_mutationsList, _observer) {
|
|
244
|
+
var scrollArea = _simplebar["default"].instances.get(document.querySelector(".".concat(_precls["default"], "__inner-front [data-simplebar]")));
|
|
245
|
+
|
|
246
|
+
var el = scrollArea === null || scrollArea === void 0 ? void 0 : scrollArea.getScrollElement();
|
|
247
|
+
|
|
248
|
+
if (el && el.scrollHeight > el.offsetHeight) {
|
|
249
|
+
if (el.scrollHeight - el.offsetHeight == el.scrollTop) {
|
|
250
|
+
setShowFrontMore(false);
|
|
251
|
+
} else {
|
|
252
|
+
setShowFrontMore(true);
|
|
253
|
+
}
|
|
254
|
+
} else {
|
|
255
|
+
setShowFrontMore(false);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
el === null || el === void 0 ? void 0 : el.addEventListener("scroll", function () {
|
|
259
|
+
if (el.scrollHeight - el.offsetHeight == el.scrollTop) {
|
|
260
|
+
setShowFrontMore(false);
|
|
261
|
+
} else {
|
|
262
|
+
setShowFrontMore(true);
|
|
263
|
+
}
|
|
264
|
+
});
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
var observer = new MutationObserver(callback);
|
|
268
|
+
targetNode && observer.observe(targetNode, config);
|
|
269
|
+
return function () {
|
|
270
|
+
observer.disconnect();
|
|
271
|
+
};
|
|
272
|
+
}, [isBack]);
|
|
223
273
|
|
|
224
274
|
var onClickShowMore = function onClickShowMore() {
|
|
225
|
-
var
|
|
275
|
+
var _instance;
|
|
276
|
+
|
|
277
|
+
var instance = null;
|
|
278
|
+
|
|
279
|
+
if (isBack) {
|
|
280
|
+
instance = _simplebar["default"].instances.get(document.querySelector(".".concat(_precls["default"], "__inner-back [data-simplebar]")));
|
|
281
|
+
} else {
|
|
282
|
+
instance = _simplebar["default"].instances.get(document.querySelector(".".concat(_precls["default"], "__inner-front [data-simplebar]")));
|
|
283
|
+
}
|
|
226
284
|
|
|
227
|
-
var el = instance.getScrollElement();
|
|
228
|
-
|
|
285
|
+
var el = (_instance = instance) === null || _instance === void 0 ? void 0 : _instance.getScrollElement();
|
|
286
|
+
|
|
287
|
+
if (el) {
|
|
288
|
+
el.scrollTop = el.scrollTop + 150;
|
|
289
|
+
}
|
|
229
290
|
};
|
|
230
291
|
|
|
231
292
|
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -248,7 +309,10 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
248
309
|
style: {
|
|
249
310
|
padding: "28px 12px 28px 12px"
|
|
250
311
|
}
|
|
251
|
-
}, children[0]))
|
|
312
|
+
}, children[0])), showFrontMore && /*#__PURE__*/_react["default"].createElement("div", {
|
|
313
|
+
className: "".concat(_precls["default"], "__has-more"),
|
|
314
|
+
onClick: onClickShowMore
|
|
315
|
+
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
252
316
|
ref: flipBackRef,
|
|
253
317
|
className: (0, _classnames["default"])("".concat(_precls["default"], "__inner-back"))
|
|
254
318
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -259,10 +323,10 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
259
323
|
}
|
|
260
324
|
}, /*#__PURE__*/_react["default"].createElement(_flipBackHeader["default"], {
|
|
261
325
|
onClick: goBackHandler
|
|
262
|
-
}), children[1]))
|
|
326
|
+
}), children[1])), showMore && /*#__PURE__*/_react["default"].createElement("div", {
|
|
263
327
|
className: "".concat(_precls["default"], "__has-more"),
|
|
264
328
|
onClick: onClickShowMore
|
|
265
|
-
}))), !isHideTopRightIcon && /*#__PURE__*/_react["default"].createElement(_menuCloseBtn["default"], {
|
|
329
|
+
})))), !isHideTopRightIcon && /*#__PURE__*/_react["default"].createElement(_menuCloseBtn["default"], {
|
|
266
330
|
className: (0, _classnames["default"])("".concat(_precls["default"], "__top-right-hide-icon")),
|
|
267
331
|
isAutoShow: true,
|
|
268
332
|
onClick: onMenuHideHandler
|
|
@@ -25,6 +25,8 @@ var _utils = require("../../../utils");
|
|
|
25
25
|
|
|
26
26
|
var _precls = _interopRequireDefault(require("../../../precls"));
|
|
27
27
|
|
|
28
|
+
var _scrollbar = _interopRequireDefault(require("../../../../scrollbar"));
|
|
29
|
+
|
|
28
30
|
require("../../../index.css");
|
|
29
31
|
|
|
30
32
|
require("./index.css");
|
|
@@ -118,7 +120,7 @@ var _default = function _default() {
|
|
|
118
120
|
}, []); // 因为要实现虚拟列表的功能,所有要动态的计算出一个菜单的高度
|
|
119
121
|
|
|
120
122
|
(0, _react.useEffect)(function () {
|
|
121
|
-
setHeight(document.body.offsetHeight -
|
|
123
|
+
setHeight(document.body.offsetHeight - 210);
|
|
122
124
|
}, []);
|
|
123
125
|
(0, _react.useEffect)(function () {
|
|
124
126
|
location.href = "#/okr/manage?departmentName=\u516C\u53F8\u5168\u90E8&departmentId=0";
|
|
@@ -168,7 +170,7 @@ var _default = function _default() {
|
|
|
168
170
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
169
171
|
var entry = _step.value;
|
|
170
172
|
var cr = entry.contentRect;
|
|
171
|
-
setHeight(cr.height -
|
|
173
|
+
setHeight(cr.height - 210);
|
|
172
174
|
}
|
|
173
175
|
} catch (err) {
|
|
174
176
|
_iterator.e(err);
|
|
@@ -182,22 +184,24 @@ var _default = function _default() {
|
|
|
182
184
|
};
|
|
183
185
|
}, []);
|
|
184
186
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
185
|
-
className: (0, _classnames["default"])("".concat(_precls["default"], "__depart-menus"))
|
|
186
|
-
|
|
187
|
-
'height': "".concat(height, "px")
|
|
188
|
-
}
|
|
187
|
+
className: (0, _classnames["default"])("".concat(_precls["default"], "__depart-menus")) // style={{ 'height': `${height}px` }}
|
|
188
|
+
|
|
189
189
|
}, loading ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
190
190
|
className: (0, _classnames["default"])("".concat(_precls["default"], "__depart-menus--loading"))
|
|
191
|
-
}, /*#__PURE__*/_react["default"].createElement("span", null)) : /*#__PURE__*/_react["default"].createElement(
|
|
191
|
+
}, /*#__PURE__*/_react["default"].createElement("span", null)) : /*#__PURE__*/_react["default"].createElement(_scrollbar["default"], {
|
|
192
|
+
style: {
|
|
193
|
+
'maxHeight': height
|
|
194
|
+
}
|
|
195
|
+
}, /*#__PURE__*/_react["default"].createElement(_menuTree["default"], {
|
|
192
196
|
data: treeData,
|
|
193
|
-
itemHeight: itemHeight
|
|
194
|
-
|
|
197
|
+
itemHeight: itemHeight // height={height}
|
|
198
|
+
,
|
|
195
199
|
virtual: true,
|
|
196
200
|
onSelect: onSelectHandler,
|
|
197
201
|
defaultExpandedKeys: ["0"],
|
|
198
202
|
selectedKeys: selectedMenuKeys,
|
|
199
203
|
loadData: onLoadTreeNodeDataHandler
|
|
200
|
-
}));
|
|
204
|
+
})));
|
|
201
205
|
};
|
|
202
206
|
|
|
203
207
|
exports["default"] = _default;
|
|
@@ -162,7 +162,8 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
162
162
|
asyncData: false,
|
|
163
163
|
onSelect: onSelectHandler,
|
|
164
164
|
virtual: true,
|
|
165
|
-
height: height
|
|
165
|
+
height: height,
|
|
166
|
+
switcherIcon: ""
|
|
166
167
|
}))) : /*#__PURE__*/_react["default"].createElement(_context.TreeNodeContext.Provider, {
|
|
167
168
|
value: {}
|
|
168
169
|
}, /*#__PURE__*/_react["default"].createElement(_chooseTree["default"], {
|
|
@@ -171,8 +172,9 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
171
172
|
multiple: false,
|
|
172
173
|
getTreeData: onGetTreeData,
|
|
173
174
|
itemHeight: itemHeight,
|
|
174
|
-
height: height
|
|
175
|
-
virtual: true
|
|
175
|
+
height: height,
|
|
176
|
+
virtual: true,
|
|
177
|
+
switcherIcon: ""
|
|
176
178
|
}))));
|
|
177
179
|
|
|
178
180
|
return /*#__PURE__*/_react["default"].createElement(_context.CommonContext.Provider, {
|
|
@@ -29,6 +29,8 @@ var _loading = _interopRequireDefault(require("../../loading"));
|
|
|
29
29
|
|
|
30
30
|
require("./index.css");
|
|
31
31
|
|
|
32
|
+
var _excluded = ["onSelect", "selected", "multiple", "getTreeData", "loadNodes", "expandedKeys", "asyncData", "itemHeight", "height", "virtual", "isGetRoot", "renderEmpty"];
|
|
33
|
+
|
|
32
34
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
33
35
|
|
|
34
36
|
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); }
|
|
@@ -49,6 +51,10 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
49
51
|
|
|
50
52
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
51
53
|
|
|
54
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
55
|
+
|
|
56
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
57
|
+
|
|
52
58
|
var _default = function _default(props) {
|
|
53
59
|
var onSelect = props.onSelect,
|
|
54
60
|
_props$selected = props.selected,
|
|
@@ -65,7 +71,9 @@ var _default = function _default(props) {
|
|
|
65
71
|
_props$renderEmpty = props.renderEmpty,
|
|
66
72
|
renderEmpty = _props$renderEmpty === void 0 ? function () {
|
|
67
73
|
return /*#__PURE__*/_react["default"].createElement(_empty["default"], null);
|
|
68
|
-
} : _props$renderEmpty
|
|
74
|
+
} : _props$renderEmpty,
|
|
75
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
76
|
+
|
|
69
77
|
var loadedNode = (0, _react.useRef)([]);
|
|
70
78
|
|
|
71
79
|
var _useState = (0, _react.useState)(true),
|
|
@@ -180,7 +188,7 @@ var _default = function _default(props) {
|
|
|
180
188
|
|
|
181
189
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
182
190
|
className: "perspm-tree"
|
|
183
|
-
}, /*#__PURE__*/_react["default"].createElement(_tree["default"], _extends({
|
|
191
|
+
}, /*#__PURE__*/_react["default"].createElement(_tree["default"], _extends({}, restProps, {
|
|
184
192
|
multiple: multiple,
|
|
185
193
|
selectNodeHighlight: false,
|
|
186
194
|
defaultExpandedKeys: getDefaultExpandedKeys(),
|
|
@@ -62,7 +62,7 @@ var ContentTemplate = function ContentTemplate(props) {
|
|
|
62
62
|
|
|
63
63
|
var PageLayout = function PageLayout(props) {
|
|
64
64
|
var children = props.children;
|
|
65
|
-
var isTrial = window.BSGlobal.tenantAuthentication.Version
|
|
65
|
+
var isTrial = window.BSGlobal.tenantAuthentication.Version == 1 && (0, _platform.isOfficialSite)();
|
|
66
66
|
|
|
67
67
|
var onClickKefu = function onClickKefu() {
|
|
68
68
|
var kefuUrl = isTrial ? "https://wpa1.qq.com/vZYKN3kT?_type=wpa&qidian=true" : "https://wpa1.qq.com/o6X4XD1n?_type=wpa&qidian=true";
|
|
@@ -178,7 +178,7 @@ var NewOkrList = function NewOkrList(props) {
|
|
|
178
178
|
|
|
179
179
|
(0, _react.useEffect)(function () {
|
|
180
180
|
setPageNum(1);
|
|
181
|
-
}, [relation, toUserId, departmentId]);
|
|
181
|
+
}, [relation, toUserId, departmentId, query]);
|
|
182
182
|
(0, _react.useEffect)(function () {
|
|
183
183
|
getOkrs();
|
|
184
184
|
}, [pageNum, pageSize, query, relation, toUserId, departmentId]); // 记录访问者数据
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import Dialog from 'rc-dialog';
|
|
4
|
+
import loading from './loading.png';
|
|
4
5
|
import { getLocale } from '../../utils/getLocale'
|
|
5
6
|
|
|
6
7
|
import 'rc-dialog/assets/index.css';
|
|
@@ -20,25 +21,38 @@ export default props => {
|
|
|
20
21
|
noCloseIcon,
|
|
21
22
|
noFooterLine,
|
|
22
23
|
visible,
|
|
23
|
-
extraClass=[],
|
|
24
|
+
extraClass = [],
|
|
24
25
|
extendFooterBtn,
|
|
25
26
|
disabled = false,
|
|
27
|
+
confirmLoading = false,
|
|
26
28
|
...restProps
|
|
27
29
|
} = props;
|
|
28
30
|
|
|
31
|
+
const handleOK = () => {
|
|
32
|
+
if (confirmLoading) return
|
|
33
|
+
onOk && onOk()
|
|
34
|
+
}
|
|
35
|
+
|
|
29
36
|
const baseFooter = [
|
|
30
37
|
extendFooterBtn,
|
|
31
38
|
<span key="cancel" className={classNames(`${preCls}__btn`, `${preCls}__btn-cancel`)} onClick={onCancel}>
|
|
32
39
|
<span className={classNames(`${preCls}__btn-cancel-text`)}>{cancelText}</span>
|
|
33
40
|
</span>,
|
|
34
|
-
<span key="ok" className={classNames(`${preCls}__btn`, `${preCls}__btn-ok`, {[`${preCls}__btn-ok-not-allowed`]:disabled})} onClick={
|
|
35
|
-
|
|
41
|
+
<span key="ok" className={classNames(`${preCls}__btn`, `${preCls}__btn-ok`, { [`${preCls}__btn-ok-not-allowed`]: disabled || confirmLoading })} onClick={handleOK}>
|
|
42
|
+
{confirmLoading ?
|
|
43
|
+
<span className={classNames(`${preCls}__btn-ok-loading`)}>
|
|
44
|
+
<img className={classNames(`${preCls}__btn-ok-loading-icon`)} src={loading} />
|
|
45
|
+
{getLocale('Mod_loading')}
|
|
46
|
+
</span>
|
|
47
|
+
:
|
|
48
|
+
<span className={classNames(`${preCls}__btn-ok-text`)}>{okText}</span>
|
|
49
|
+
}
|
|
36
50
|
</span>
|
|
37
51
|
];
|
|
38
52
|
|
|
39
53
|
return <Dialog
|
|
40
54
|
visible={visible}
|
|
41
|
-
className={classNames(preCls,[...extraClass], {
|
|
55
|
+
className={classNames(preCls, [...extraClass], {
|
|
42
56
|
[`${preCls}-no-head-line`]: noHeadLine,
|
|
43
57
|
[`${preCls}-no-footer-line`]: noFooterLine,
|
|
44
58
|
[`${preCls}-no-close`]: noCloseIcon,
|
|
@@ -1,13 +1,23 @@
|
|
|
1
|
-
$font-family: -apple-system,
|
|
1
|
+
$font-family: -apple-system,
|
|
2
|
+
Arial,
|
|
3
|
+
Verdana,
|
|
4
|
+
Helvetica Neue,
|
|
5
|
+
Helvetica,
|
|
6
|
+
sans-serif,
|
|
7
|
+
PingFang SC,
|
|
8
|
+
Microsoft YaHei;
|
|
9
|
+
|
|
2
10
|
.rc-dialog-close {
|
|
3
11
|
z-index: 100;
|
|
4
12
|
}
|
|
13
|
+
|
|
5
14
|
.rc-dialog-wrap {
|
|
6
15
|
display: flex;
|
|
7
16
|
justify-content: center;
|
|
8
17
|
align-items: center;
|
|
9
18
|
z-index: 1299 !important;
|
|
10
19
|
}
|
|
20
|
+
|
|
11
21
|
.rc-dialog-mask {
|
|
12
22
|
z-index: 1299 !important;
|
|
13
23
|
background: rgba(20, 28, 40, 0.7) !important;
|
|
@@ -16,6 +26,7 @@ $font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-ser
|
|
|
16
26
|
.titaui-dialog {
|
|
17
27
|
border-radius: 24px;
|
|
18
28
|
overflow: hidden;
|
|
29
|
+
|
|
19
30
|
&.rc-dialog {
|
|
20
31
|
display: inline-block;
|
|
21
32
|
margin: 0;
|
|
@@ -49,10 +60,12 @@ $font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-ser
|
|
|
49
60
|
.rc-dialog-header {
|
|
50
61
|
padding: 18px 32px;
|
|
51
62
|
}
|
|
63
|
+
|
|
52
64
|
.rc-dialog-body {
|
|
53
65
|
// padding: 0 32px 0 32px;
|
|
54
66
|
padding: 0;
|
|
55
67
|
}
|
|
68
|
+
|
|
56
69
|
.rc-dialog-footer {
|
|
57
70
|
padding: 20px 32px;
|
|
58
71
|
display: flex;
|
|
@@ -72,12 +85,15 @@ $font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-ser
|
|
|
72
85
|
justify-content: center;
|
|
73
86
|
cursor: pointer;
|
|
74
87
|
box-sizing: border-box;
|
|
75
|
-
|
|
88
|
+
|
|
89
|
+
&>span {
|
|
76
90
|
font-size: 14px;
|
|
77
91
|
font-family: $font-family;
|
|
78
92
|
font-weight: 400;
|
|
79
93
|
line-height: 20px;
|
|
80
94
|
text-align: center;
|
|
95
|
+
display: flex;
|
|
96
|
+
align-items: center;
|
|
81
97
|
box-sizing: border-box;
|
|
82
98
|
}
|
|
83
99
|
}
|
|
@@ -88,20 +104,36 @@ $font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-ser
|
|
|
88
104
|
border: 1px solid #2879ff;
|
|
89
105
|
color: #ffffff;
|
|
90
106
|
transition: 0.2s all;
|
|
107
|
+
user-select: none;
|
|
108
|
+
|
|
91
109
|
&:hover {
|
|
92
110
|
border: 1px solid #5c8eff;
|
|
93
111
|
background: #5c8eff;
|
|
94
112
|
color: #ffffff;
|
|
95
113
|
}
|
|
114
|
+
|
|
96
115
|
&-not-allowed {
|
|
116
|
+
background-color: #5C8EFF;
|
|
97
117
|
cursor: not-allowed;
|
|
98
118
|
}
|
|
119
|
+
|
|
120
|
+
&-loading {
|
|
121
|
+
&-icon {
|
|
122
|
+
width: 14px;
|
|
123
|
+
margin-right: 6px;
|
|
124
|
+
animation-name: spin;
|
|
125
|
+
animation-timing-function: linear;
|
|
126
|
+
animation-iteration-count: infinite;
|
|
127
|
+
animation-duration: 1s;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
99
130
|
}
|
|
100
131
|
|
|
101
132
|
&__btn-cancel {
|
|
102
133
|
border: 1px solid #DFE3EA;
|
|
103
134
|
color: #6f7886;
|
|
104
135
|
transition: 0.2s all;
|
|
136
|
+
|
|
105
137
|
&:hover {
|
|
106
138
|
border: 1px solid #2879ff;
|
|
107
139
|
color: #2879ff;
|
|
@@ -114,11 +146,13 @@ $font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-ser
|
|
|
114
146
|
border-bottom: none;
|
|
115
147
|
}
|
|
116
148
|
}
|
|
149
|
+
|
|
117
150
|
.titaui-dialog.titaui-dialog-no-footer-line {
|
|
118
151
|
.rc-dialog-footer {
|
|
119
152
|
border-top: none;
|
|
120
153
|
}
|
|
121
154
|
}
|
|
155
|
+
|
|
122
156
|
.titaui-dialog.titaui-dialog-no-close {
|
|
123
157
|
.rc-dialog-close {
|
|
124
158
|
display: none;
|
|
@@ -130,3 +164,13 @@ $font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-ser
|
|
|
130
164
|
display: none;
|
|
131
165
|
}
|
|
132
166
|
}
|
|
167
|
+
|
|
168
|
+
@keyframes spin {
|
|
169
|
+
from {
|
|
170
|
+
transform: rotate(0deg);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
to {
|
|
174
|
+
transform: rotate(360deg);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
Binary file
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import _DynamicQuickOperation from "../quick-operation";
|
|
2
2
|
import _Dynamic from '../dynamic';
|
|
3
|
+
import _DynamicList from '../dynamic-list';
|
|
3
4
|
import _DynamicItem from '../dynamic-item';
|
|
4
5
|
import _DynamicTopping from '../dynamic-topping';
|
|
5
6
|
import _DynamicLiking from '../dynamic-liking';
|
|
6
7
|
import _DynamicLikeRanking from '../dynamic-like-ranking';
|
|
7
8
|
|
|
8
9
|
export default _Dynamic;
|
|
10
|
+
export const DynamicList = _DynamicList;
|
|
9
11
|
export const DynamicQuickOperation = _DynamicQuickOperation;
|
|
10
12
|
export const DynamicItem = _DynamicItem;
|
|
11
13
|
export const DynamicTopping = _DynamicTopping;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import Dynamic, {
|
|
2
2
|
DynamicQuickOperation,
|
|
3
|
+
DynamicList,
|
|
3
4
|
DynamicItem,
|
|
4
5
|
DynamicTopping,
|
|
5
6
|
DynamicLiking,
|
|
6
7
|
DynamicLikeRanking,
|
|
7
8
|
} from './export-module';
|
|
8
9
|
|
|
10
|
+
Dynamic.List = DynamicList;
|
|
9
11
|
Dynamic.Item = DynamicItem;
|
|
10
12
|
Dynamic.LikeRanking = DynamicLikeRanking;
|
|
11
13
|
Dynamic.Liking = DynamicLiking;
|
|
@@ -3,7 +3,7 @@ import { useEffect } from 'react';
|
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import axios from 'axios';
|
|
5
5
|
import Popup from '../popup';
|
|
6
|
-
import { getLoginUserInfo } from '
|
|
6
|
+
import { getLoginUserInfo } from '../../utils/helpers';
|
|
7
7
|
import './index.scss';
|
|
8
8
|
|
|
9
9
|
interface Props {}
|
|
@@ -5,7 +5,7 @@ import React, {
|
|
|
5
5
|
useImperativeHandle,
|
|
6
6
|
useEffect,
|
|
7
7
|
} from "react";
|
|
8
|
-
import SimpleBar from
|
|
8
|
+
import SimpleBar from "../../../scrollbar/simplebar/simplebar";
|
|
9
9
|
import ReactDOM from "react-dom";
|
|
10
10
|
import classNames from "classnames";
|
|
11
11
|
import MenuCard from "../menu-card";
|
|
@@ -36,7 +36,8 @@ export default forwardRef((props: Props, ref) => {
|
|
|
36
36
|
const [isFloatHide, setIsFloatHide] = useState(false);
|
|
37
37
|
const [isHideTopRightIcon, setIsHideTopRightIcon] = useState(false);
|
|
38
38
|
|
|
39
|
-
const [showMore, setShowMore] = useState(
|
|
39
|
+
const [showMore, setShowMore] = useState(true);
|
|
40
|
+
const [showFrontMore, setShowFrontMore] = useState(true);
|
|
40
41
|
|
|
41
42
|
const hideFloatRef = useRef<any>();
|
|
42
43
|
const flipCardRef = useRef<any>();
|
|
@@ -144,28 +145,29 @@ export default forwardRef((props: Props, ref) => {
|
|
|
144
145
|
};
|
|
145
146
|
|
|
146
147
|
useEffect(() => {
|
|
147
|
-
|
|
148
|
-
"simplebar-content-wrapper"
|
|
149
|
-
)[0];
|
|
150
|
-
|
|
148
|
+
let targetNode = document.querySelector(`.${preCls}__inner-back-content`);
|
|
151
149
|
const config = { attributes: true, childList: true, subtree: true };
|
|
152
|
-
|
|
153
150
|
const callback = function (_mutationsList, _observer) {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
)
|
|
157
|
-
|
|
158
|
-
|
|
151
|
+
let scrollArea = SimpleBar.instances.get(
|
|
152
|
+
document.querySelector(`.${preCls}__inner-back [data-simplebar]`)
|
|
153
|
+
);
|
|
154
|
+
const el = scrollArea?.getScrollElement();
|
|
155
|
+
if (el && el.scrollHeight > el.offsetHeight) {
|
|
156
|
+
if (el.scrollHeight - el.offsetHeight == el.scrollTop) {
|
|
157
|
+
setShowFrontMore(false);
|
|
158
|
+
} else {
|
|
159
|
+
setShowFrontMore(true);
|
|
160
|
+
}
|
|
159
161
|
} else {
|
|
160
162
|
setShowMore(false);
|
|
161
163
|
}
|
|
162
|
-
|
|
163
|
-
if(
|
|
164
|
-
setShowMore(false)
|
|
164
|
+
el?.addEventListener("scroll", () => {
|
|
165
|
+
if (el.scrollHeight - el.offsetHeight == el.scrollTop) {
|
|
166
|
+
setShowMore(false);
|
|
165
167
|
} else {
|
|
166
168
|
setShowMore(true);
|
|
167
169
|
}
|
|
168
|
-
})
|
|
170
|
+
});
|
|
169
171
|
};
|
|
170
172
|
const observer = new MutationObserver(callback);
|
|
171
173
|
|
|
@@ -174,13 +176,61 @@ export default forwardRef((props: Props, ref) => {
|
|
|
174
176
|
return () => {
|
|
175
177
|
observer.disconnect();
|
|
176
178
|
};
|
|
177
|
-
}, []);
|
|
179
|
+
}, [isBack]);
|
|
180
|
+
|
|
181
|
+
useEffect(() => {
|
|
182
|
+
if (isBack) return;
|
|
183
|
+
let targetNode = document.querySelector(`.${preCls}__inner-front-content`);
|
|
184
|
+
|
|
185
|
+
const config = { attributes: true, childList: true, subtree: true };
|
|
186
|
+
|
|
187
|
+
const callback = function (_mutationsList, _observer) {
|
|
188
|
+
let scrollArea = SimpleBar.instances.get(
|
|
189
|
+
document.querySelector(`.${preCls}__inner-front [data-simplebar]`)
|
|
190
|
+
);
|
|
191
|
+
const el = scrollArea?.getScrollElement();
|
|
192
|
+
if (el && el.scrollHeight > el.offsetHeight) {
|
|
193
|
+
if (el.scrollHeight - el.offsetHeight == el.scrollTop) {
|
|
194
|
+
setShowFrontMore(false);
|
|
195
|
+
} else {
|
|
196
|
+
setShowFrontMore(true);
|
|
197
|
+
}
|
|
198
|
+
} else {
|
|
199
|
+
setShowFrontMore(false);
|
|
200
|
+
}
|
|
201
|
+
el?.addEventListener("scroll", () => {
|
|
202
|
+
if (el.scrollHeight - el.offsetHeight == el.scrollTop) {
|
|
203
|
+
setShowFrontMore(false);
|
|
204
|
+
} else {
|
|
205
|
+
setShowFrontMore(true);
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
};
|
|
209
|
+
const observer = new MutationObserver(callback);
|
|
210
|
+
|
|
211
|
+
targetNode && observer.observe(targetNode, config);
|
|
212
|
+
|
|
213
|
+
return () => {
|
|
214
|
+
observer.disconnect();
|
|
215
|
+
};
|
|
216
|
+
}, [isBack]);
|
|
178
217
|
|
|
179
218
|
const onClickShowMore = () => {
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
219
|
+
let instance = null;
|
|
220
|
+
if (isBack) {
|
|
221
|
+
instance = SimpleBar.instances.get(
|
|
222
|
+
document.querySelector(`.${preCls}__inner-back [data-simplebar]`)
|
|
223
|
+
);
|
|
224
|
+
} else {
|
|
225
|
+
instance = SimpleBar.instances.get(
|
|
226
|
+
document.querySelector(`.${preCls}__inner-front [data-simplebar]`)
|
|
227
|
+
);
|
|
228
|
+
}
|
|
229
|
+
const el = instance?.getScrollElement();
|
|
230
|
+
if (el) {
|
|
231
|
+
el.scrollTop = el.scrollTop + 150;
|
|
232
|
+
}
|
|
233
|
+
};
|
|
184
234
|
|
|
185
235
|
return (
|
|
186
236
|
<React.Fragment>
|
|
@@ -216,6 +266,12 @@ export default forwardRef((props: Props, ref) => {
|
|
|
216
266
|
{children[0]}
|
|
217
267
|
</MenuCard>
|
|
218
268
|
</div>
|
|
269
|
+
{showFrontMore && (
|
|
270
|
+
<div
|
|
271
|
+
className={`${preCls}__has-more`}
|
|
272
|
+
onClick={onClickShowMore}
|
|
273
|
+
/>
|
|
274
|
+
)}
|
|
219
275
|
</div>
|
|
220
276
|
|
|
221
277
|
{/* 第二屏的内容 */}
|
|
@@ -234,11 +290,13 @@ export default forwardRef((props: Props, ref) => {
|
|
|
234
290
|
{children[1]}
|
|
235
291
|
</MenuCard>
|
|
236
292
|
</div>
|
|
293
|
+
{showMore && (
|
|
294
|
+
<div
|
|
295
|
+
className={`${preCls}__has-more`}
|
|
296
|
+
onClick={onClickShowMore}
|
|
297
|
+
></div>
|
|
298
|
+
)}
|
|
237
299
|
</div>
|
|
238
|
-
{showMore && (
|
|
239
|
-
<div className={`${preCls}__has-more`} onClick={onClickShowMore}>
|
|
240
|
-
</div>
|
|
241
|
-
)}
|
|
242
300
|
</div>
|
|
243
301
|
</DragResize>
|
|
244
302
|
|
|
@@ -9,6 +9,7 @@ import { DEPART_NODE, USER_NODE } from '../../../components/menu-tree/tree-node/
|
|
|
9
9
|
import { toTree } from "../../../utils";
|
|
10
10
|
import { ITreeNode } from "../../../types";
|
|
11
11
|
import preCls from '../../../precls';
|
|
12
|
+
import Scrollbar from '../../../../scrollbar';
|
|
12
13
|
|
|
13
14
|
import "../../../index.scss";
|
|
14
15
|
import "./index.scss";
|
|
@@ -52,7 +53,7 @@ export default () => {
|
|
|
52
53
|
|
|
53
54
|
// 因为要实现虚拟列表的功能,所有要动态的计算出一个菜单的高度
|
|
54
55
|
useEffect(() => {
|
|
55
|
-
setHeight(document.body.offsetHeight -
|
|
56
|
+
setHeight(document.body.offsetHeight - 210);
|
|
56
57
|
}, [])
|
|
57
58
|
|
|
58
59
|
useEffect(() => {
|
|
@@ -92,7 +93,7 @@ export default () => {
|
|
|
92
93
|
const obs = new ResizeObserver(entries => {
|
|
93
94
|
for (let entry of entries) {
|
|
94
95
|
const cr = entry.contentRect;
|
|
95
|
-
setHeight(cr.height -
|
|
96
|
+
setHeight(cr.height - 210);
|
|
96
97
|
}
|
|
97
98
|
})
|
|
98
99
|
obs.observe(document.body);
|
|
@@ -103,22 +104,24 @@ export default () => {
|
|
|
103
104
|
|
|
104
105
|
return <div
|
|
105
106
|
className={classNames(`${preCls}__depart-menus`)}
|
|
106
|
-
style={{ 'height': `${height}px` }}
|
|
107
|
+
// style={{ 'height': `${height}px` }}
|
|
107
108
|
>
|
|
108
109
|
{loading ?
|
|
109
110
|
<div className={classNames(`${preCls}__depart-menus--loading`)}>
|
|
110
111
|
<span />
|
|
111
112
|
</div> :
|
|
112
|
-
<
|
|
113
|
+
<Scrollbar style={{ 'maxHeight': height }}>
|
|
114
|
+
<MenuTree
|
|
113
115
|
data={treeData}
|
|
114
116
|
itemHeight={itemHeight}
|
|
115
|
-
height={height}
|
|
117
|
+
// height={height}
|
|
116
118
|
virtual={true}
|
|
117
119
|
onSelect={onSelectHandler}
|
|
118
120
|
defaultExpandedKeys={["0"]}
|
|
119
121
|
selectedKeys={selectedMenuKeys}
|
|
120
122
|
loadData={onLoadTreeNodeDataHandler}
|
|
121
|
-
|
|
123
|
+
/>
|
|
124
|
+
</Scrollbar>
|
|
122
125
|
}
|
|
123
126
|
</div>
|
|
124
127
|
}
|
|
@@ -118,7 +118,8 @@ export default forwardRef((props: Props, ref) => {
|
|
|
118
118
|
asyncData={false}
|
|
119
119
|
onSelect={onSelectHandler}
|
|
120
120
|
virtual={true}
|
|
121
|
-
height={height
|
|
121
|
+
height={height}
|
|
122
|
+
switcherIcon=""
|
|
122
123
|
/>
|
|
123
124
|
</TreeNodeContext.Provider>
|
|
124
125
|
</div>
|
|
@@ -131,8 +132,9 @@ export default forwardRef((props: Props, ref) => {
|
|
|
131
132
|
multiple={false}
|
|
132
133
|
getTreeData={onGetTreeData}
|
|
133
134
|
itemHeight={itemHeight}
|
|
134
|
-
height={height
|
|
135
|
+
height={height}
|
|
135
136
|
virtual={true}
|
|
137
|
+
switcherIcon=""
|
|
136
138
|
/>
|
|
137
139
|
</TreeNodeContext.Provider>
|
|
138
140
|
)}
|
|
@@ -24,7 +24,8 @@ export default props => {
|
|
|
24
24
|
height,
|
|
25
25
|
virtual,
|
|
26
26
|
isGetRoot,
|
|
27
|
-
renderEmpty = () => <Empty
|
|
27
|
+
renderEmpty = () => <Empty />,
|
|
28
|
+
...restProps
|
|
28
29
|
} = props;
|
|
29
30
|
|
|
30
31
|
const loadedNode = useRef([]);
|
|
@@ -118,6 +119,7 @@ export default props => {
|
|
|
118
119
|
return (
|
|
119
120
|
<div className="perspm-tree">
|
|
120
121
|
<Tree
|
|
122
|
+
{...restProps}
|
|
121
123
|
multiple={multiple}
|
|
122
124
|
selectNodeHighlight={false}
|
|
123
125
|
defaultExpandedKeys={getDefaultExpandedKeys()}
|
|
@@ -41,7 +41,7 @@ const PageLayout = (props) => {
|
|
|
41
41
|
const { children } = props;
|
|
42
42
|
|
|
43
43
|
const isTrial =
|
|
44
|
-
window.BSGlobal.tenantAuthentication.Version
|
|
44
|
+
window.BSGlobal.tenantAuthentication.Version == 1 && isOfficialSite();
|
|
45
45
|
|
|
46
46
|
const onClickKefu = () => {
|
|
47
47
|
const kefuUrl = isTrial
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
.tita-checkbox {
|
|
2
|
-
font-size: 14px;
|
|
3
|
-
line-height: 1.5;
|
|
4
|
-
color: rgba(0, 0, 0, 0.65);
|
|
5
|
-
box-sizing: border-box;
|
|
6
|
-
margin: 0;
|
|
7
|
-
padding: 0;
|
|
8
|
-
list-style: none;
|
|
9
|
-
white-space: nowrap;
|
|
10
|
-
cursor: pointer;
|
|
11
|
-
outline: 0;
|
|
12
|
-
display: inline-block;
|
|
13
|
-
line-height: 1;
|
|
14
|
-
position: relative;
|
|
15
|
-
vertical-align: middle;
|
|
16
|
-
left: 1px;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.tita-checkbox .rc-checkbox-checked .rc-checkbox-inner {
|
|
20
|
-
background: #2879ff;
|
|
21
|
-
border: none;
|
|
22
|
-
border-radius: 2px;
|
|
23
|
-
width: 16px;
|
|
24
|
-
height: 16px;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.tita-checkbox .rc-checkbox-checked .rc-checkbox-inner::after {
|
|
28
|
-
transform: rotate(0deg) scale(0.6);
|
|
29
|
-
border: 0 solid transparent;
|
|
30
|
-
transition: none;
|
|
31
|
-
color: #fff;
|
|
32
|
-
content: "\E9f9" !important;
|
|
33
|
-
left: 1px;
|
|
34
|
-
top: 1px;
|
|
35
|
-
font-weight: 700;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.tita-checkbox .rc-checkbox-checked::after {
|
|
39
|
-
position: absolute;
|
|
40
|
-
top: 0;
|
|
41
|
-
left: 0;
|
|
42
|
-
width: 100%;
|
|
43
|
-
height: 100%;
|
|
44
|
-
border-radius: 2px;
|
|
45
|
-
border: 1px solid #1687d9;
|
|
46
|
-
content: "";
|
|
47
|
-
animation: antCheckboxEffect 0.36s ease-in-out;
|
|
48
|
-
animation-fill-mode: both;
|
|
49
|
-
visibility: hidden;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.tita-checkbox .rc-checkbox-input {
|
|
53
|
-
position: absolute;
|
|
54
|
-
left: 0;
|
|
55
|
-
z-index: 1;
|
|
56
|
-
cursor: pointer;
|
|
57
|
-
opacity: 0;
|
|
58
|
-
top: -5px;
|
|
59
|
-
bottom: 0;
|
|
60
|
-
right: 0;
|
|
61
|
-
width: 100%;
|
|
62
|
-
height: 100%;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
.tita-checkbox .rc-checkbox-inner {
|
|
66
|
-
position: relative;
|
|
67
|
-
top: 0;
|
|
68
|
-
left: 0;
|
|
69
|
-
display: block;
|
|
70
|
-
width: 14px;
|
|
71
|
-
height: 14px;
|
|
72
|
-
border: 1px solid #e9ecf0;
|
|
73
|
-
border-radius: 2px;
|
|
74
|
-
background-color: #fff;
|
|
75
|
-
transition: none;
|
|
76
|
-
font-family: tu-icon !important;
|
|
77
|
-
font-style: normal;
|
|
78
|
-
font-weight: 400;
|
|
79
|
-
font-variant: normal;
|
|
80
|
-
text-transform: none;
|
|
81
|
-
line-height: 1;
|
|
82
|
-
-webkit-font-smoothing: antialiased;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.tita-checkbox .rc-checkbox-inner::after {
|
|
86
|
-
transform: rotate(0deg) scale(1);
|
|
87
|
-
position: absolute;
|
|
88
|
-
display: table;
|
|
89
|
-
border: 0 solid #1587d9;
|
|
90
|
-
border-top: 0;
|
|
91
|
-
border-left: 0;
|
|
92
|
-
content: " ";
|
|
93
|
-
left: 0;
|
|
94
|
-
transition: none;
|
|
95
|
-
}
|
|
@@ -1,24 +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 _rcCheckbox = _interopRequireDefault(require("rc-checkbox"));
|
|
11
|
-
|
|
12
|
-
require("./index.css");
|
|
13
|
-
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
|
-
|
|
16
|
-
var _default = function _default(props) {
|
|
17
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
18
|
-
className: "tita-checkbox"
|
|
19
|
-
}, /*#__PURE__*/_react["default"].createElement(_rcCheckbox["default"], props), /*#__PURE__*/_react["default"].createElement("div", {
|
|
20
|
-
className: "tita-checkbox-sign"
|
|
21
|
-
}));
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
exports["default"] = _default;
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
.tita-checkbox {
|
|
2
|
-
font-size: 14px;
|
|
3
|
-
line-height: 1.5;
|
|
4
|
-
color: rgba(0, 0, 0, 0.65);
|
|
5
|
-
box-sizing: border-box;
|
|
6
|
-
margin: 0;
|
|
7
|
-
padding: 0;
|
|
8
|
-
list-style: none;
|
|
9
|
-
white-space: nowrap;
|
|
10
|
-
cursor: pointer;
|
|
11
|
-
outline: 0;
|
|
12
|
-
display: inline-block;
|
|
13
|
-
line-height: 1;
|
|
14
|
-
position: relative;
|
|
15
|
-
vertical-align: middle;
|
|
16
|
-
left: 1px;
|
|
17
|
-
|
|
18
|
-
.rc-checkbox-checked {
|
|
19
|
-
.rc-checkbox-inner {
|
|
20
|
-
background: #2879ff;
|
|
21
|
-
border: none;
|
|
22
|
-
border-radius: 2px;
|
|
23
|
-
width: 16px;
|
|
24
|
-
height: 16px;
|
|
25
|
-
&::after {
|
|
26
|
-
transform: rotate(0deg) scale(0.6);
|
|
27
|
-
border: 0 solid transparent;
|
|
28
|
-
transition: none;
|
|
29
|
-
color: #fff;
|
|
30
|
-
content: "\E9f9" !important;
|
|
31
|
-
left: 1px;
|
|
32
|
-
top: 1px;
|
|
33
|
-
font-weight: 700;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
&::after {
|
|
38
|
-
position: absolute;
|
|
39
|
-
top: 0;
|
|
40
|
-
left: 0;
|
|
41
|
-
width: 100%;
|
|
42
|
-
height: 100%;
|
|
43
|
-
border-radius: 2px;
|
|
44
|
-
border: 1px solid #1687d9;
|
|
45
|
-
content: "";
|
|
46
|
-
animation: antCheckboxEffect 0.36s ease-in-out;
|
|
47
|
-
animation-fill-mode: both;
|
|
48
|
-
visibility: hidden;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
.rc-checkbox-input {
|
|
52
|
-
position: absolute;
|
|
53
|
-
left: 0;
|
|
54
|
-
z-index: 1;
|
|
55
|
-
cursor: pointer;
|
|
56
|
-
opacity: 0;
|
|
57
|
-
top: -5px;
|
|
58
|
-
bottom: 0;
|
|
59
|
-
right: 0;
|
|
60
|
-
width: 100%;
|
|
61
|
-
height: 100%;
|
|
62
|
-
}
|
|
63
|
-
.rc-checkbox-inner {
|
|
64
|
-
position: relative;
|
|
65
|
-
top: 0;
|
|
66
|
-
left: 0;
|
|
67
|
-
display: block;
|
|
68
|
-
width: 14px;
|
|
69
|
-
height: 14px;
|
|
70
|
-
border: 1px solid #e9ecf0;
|
|
71
|
-
border-radius: 2px;
|
|
72
|
-
background-color: #fff;
|
|
73
|
-
transition: none;
|
|
74
|
-
font-family: tu-icon !important;
|
|
75
|
-
font-style: normal;
|
|
76
|
-
font-weight: 400;
|
|
77
|
-
font-variant: normal;
|
|
78
|
-
text-transform: none;
|
|
79
|
-
line-height: 1;
|
|
80
|
-
-webkit-font-smoothing: antialiased;
|
|
81
|
-
&::after {
|
|
82
|
-
transform: rotate(0deg) scale(1);
|
|
83
|
-
position: absolute;
|
|
84
|
-
display: table;
|
|
85
|
-
border: 0 solid #1587d9;
|
|
86
|
-
border-top: 0;
|
|
87
|
-
border-left: 0;
|
|
88
|
-
content: " ";
|
|
89
|
-
left: 0;
|
|
90
|
-
transition: none;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|