@titaui/pc 1.9.87 → 1.9.91
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/change-okr-modal/Filter.js +1 -1
- package/lib/components/change-okr-modal/Item.js +1 -1
- package/lib/components/change-okr-modal/filterTab.js +1 -1
- package/lib/components/change-okr-modal/index.js +1 -1
- package/lib/components/communication/CommunicationAttachments.js +1 -1
- package/lib/components/communication/ConvertUserName.js +1 -1
- package/lib/components/communication/index.js +1 -1
- package/lib/components/create-okr-modal/objectType.js +1 -1
- package/lib/components/date-picker/BodyItem.js +1 -1
- package/lib/components/date-picker/CalendarBody.js +1 -1
- package/lib/components/date-picker/CalendarHeader.js +1 -1
- package/lib/components/date-picker/index.js +1 -1
- package/lib/components/date-range-picker/index.js +1 -1
- package/lib/components/delete-confirm-pop/ConfirmPop.js +1 -1
- package/lib/components/eReport/eReportListEmpty.js +1 -1
- package/lib/components/eReport/eReportLists/reportList.js +1 -1
- package/lib/components/eReport/eReportShare/index.js +1 -1
- package/lib/components/eReport/eReportShare/toast/index.js +1 -1
- package/lib/components/edit-kr-wight/EditKrWightModal.js +1 -1
- package/lib/components/edit-kr-wight/FormItemV2.js +1 -1
- package/lib/components/emotions-selector/selector-content.js +1 -1
- package/lib/components/emotions-selector/selector-pop.js +1 -1
- package/lib/components/ereport-list/index.js +1 -1
- package/lib/components/error-boundary/index.js +1 -1
- package/lib/components/mblog/components/ConfirmPop.js +1 -1
- package/lib/components/mblog/components/MblogAction.js +1 -1
- package/lib/components/mblog/components/MblogContent.js +1 -1
- package/lib/components/mblog/index.js +1 -1
- package/lib/components/menus/export-modules/demo-menus/index.js +125 -0
- package/lib/components/menus/export-modules/demo-menus/menu-highlight.js +74 -0
- package/lib/components/menus/export-modules/demo-menus/menus.js +147 -0
- package/lib/components/menus/index.js +15 -6
- package/lib/components/nav-top/constant.js +26 -2
- package/lib/components/nav-top/index.js +32 -30
- package/lib/components/nav-top/request.apis.js +5 -5
- package/lib/components/nav-top/utils.js +20 -3
- package/lib/components/okr-detail/auth.js +1 -1
- package/lib/components/okr-detail/components/base-okr-type/confirm/buttonv2.js +1 -1
- package/lib/components/okr-detail/components/base-okr-type/confirm/confirm.js +1 -1
- package/lib/components/okr-detail/components/base-okr-type/object-type.js +1 -1
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/kr-score-editor/edit-pop.js +1 -1
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/kr-score-editor/kr-push-score.js +1 -1
- package/lib/components/okr-review/ReviewPop/components/ReviewBody/index.js +1 -1
- package/lib/components/okr-review/ReviewPop/components/Toast/index.js +1 -1
- package/lib/components/okr-review/ReviewPop/index.js +1 -1
- package/lib/components/okr-review/components/ReviewItem/index.js +1 -1
- package/lib/components/okr-review/components/confirm-pop/ConfirmPop.js +1 -1
- package/lib/components/okr-review/index.js +1 -1
- package/lib/components/operation-records/OperationRecordItem.js +1 -1
- package/lib/components/operation-records/index.js +1 -1
- package/lib/components/point-demo/input/index.js +1 -1
- package/lib/components/praise-record/PraiseRecordItem.js +1 -1
- package/lib/components/praise-record/index.js +1 -1
- package/lib/components/range-picker-pop/index.js +1 -1
- package/lib/components/range-selector-pop/RangeList.js +1 -1
- package/lib/components/range-selector-pop/RangeSelectorPop.js +1 -1
- package/lib/components/select/Option.js +1 -1
- package/lib/components/select/index.js +1 -1
- package/lib/components/tita-chart/errorBoundary/index.js +1 -1
- package/lib/components/upload/components/uploadedPreview.js +1 -1
- package/lib/components/upload/index.js +1 -1
- package/lib/components/viewer/ImageListRender.js +1 -1
- package/lib/components/viewer/index.js +1 -1
- package/lib/components-v1/animate/AnimateChild.js +1 -1
- package/lib/components-v1/animate/animate.js +1 -1
- package/lib/components-v1/avatar/index.js +1 -1
- package/lib/components-v1/buttonv2/ButtonOutlined.js +1 -1
- package/lib/components-v1/buttonv2/ButtonRounded.js +1 -1
- package/lib/components-v1/buttonv2/DefaultButton.js +1 -1
- package/lib/components-v1/confirm/index.js +1 -1
- package/lib/components-v1/dropDownSelector/StatelessDropdown.js +1 -1
- package/lib/components-v1/dropDownSelector/dropDownSelector.js +1 -1
- package/lib/components-v1/input/Input.js +1 -1
- package/lib/components-v1/input/InputNumber.js +1 -1
- package/lib/components-v1/placement/placement.js +1 -1
- package/lib/components-v1/placement/placementInner.js +1 -1
- package/lib/components-v1/pop/Pop.js +1 -1
- package/lib/components-v1/pop/PopInner.js +1 -1
- package/lib/components-v1/portals/Portals.js +1 -1
- package/lib/components-v1/progress/CircleProgress.js +1 -1
- package/lib/components-v1/progress/LineProgress.js +1 -1
- package/lib/components-v1/progress/index.js +1 -1
- package/lib/components-v1/radio/radio.js +1 -1
- package/lib/components-v1/radio/radioGroup.js +1 -1
- package/lib/components-v1/search/index.js +1 -1
- package/lib/components-v1/select/Option.js +1 -1
- package/lib/components-v1/select/index.js +1 -1
- package/lib/components-v1/tabs/index.js +1 -1
- package/lib/components-v1/textarea/index.js +1 -1
- package/lib/components-v1/transition/index.js +1 -1
- package/lib/components-v1/userSelector/UserSelectorPop.js +1 -1
- package/lib/components-v1/userSelector/components/MultiMode/CommonList.js +1 -1
- package/lib/components-v1/userSelector/components/MultiMode/DepartmentList.js +1 -1
- package/lib/components-v1/userSelector/components/MultiMode/DepartmentTree.js +1 -1
- package/lib/components-v1/userSelector/components/MultiMode/SubsList.js +1 -1
- package/lib/components-v1/userSelector/components/MultiMode/index.js +1 -1
- package/lib/components-v1/userSelector/components/SearchBar.js +1 -1
- package/lib/components-v1/userSelector/components/SingleMode.js +1 -1
- package/lib/components-v1/userSelector/components/UserItem.js +1 -1
- package/lib/components-v1/userSelector/index.js +1 -1
- package/lib/index.js +14 -6
- package/lib/pages/appointment-demo/input/index.js +1 -1
- package/lib/pages/demo-free/index.js +27 -0
- package/lib/pages/group-management/components/input-form/index.js +1 -1
- package/lib/utils/auth.js +1 -1
- package/package.json +1 -1
- package/src/components/menus/export-modules/demo-menus/index.tsx +85 -0
- package/src/components/menus/export-modules/demo-menus/menu-highlight.ts +53 -0
- package/src/components/menus/export-modules/demo-menus/menus.tsx +136 -0
- package/src/components/menus/index.tsx +9 -5
- package/src/components/nav-top/constant.ts +24 -0
- package/src/components/nav-top/index.tsx +10 -9
- package/src/components/nav-top/request.apis.ts +5 -5
- package/src/components/nav-top/utils.ts +15 -2
- package/src/index.d.ts +1 -0
- package/src/index.js +2 -1
- package/src/pages/demo-free/index.tsx +15 -0
- package/yarn-error.log +0 -103
package/lib/index.js
CHANGED
|
@@ -63,6 +63,12 @@ Object.defineProperty(exports, "DatePicker", {
|
|
|
63
63
|
return _datePicker["default"];
|
|
64
64
|
}
|
|
65
65
|
});
|
|
66
|
+
Object.defineProperty(exports, "DemoFree", {
|
|
67
|
+
enumerable: true,
|
|
68
|
+
get: function get() {
|
|
69
|
+
return _demoFree["default"];
|
|
70
|
+
}
|
|
71
|
+
});
|
|
66
72
|
Object.defineProperty(exports, "Dialog", {
|
|
67
73
|
enumerable: true,
|
|
68
74
|
get: function get() {
|
|
@@ -465,12 +471,6 @@ Object.defineProperty(exports, "UpdateModal", {
|
|
|
465
471
|
return _updateModal["default"];
|
|
466
472
|
}
|
|
467
473
|
});
|
|
468
|
-
Object.defineProperty(exports, "UploadPhotoModal", {
|
|
469
|
-
enumerable: true,
|
|
470
|
-
get: function get() {
|
|
471
|
-
return _uploadPhotoModal["default"];
|
|
472
|
-
}
|
|
473
|
-
});
|
|
474
474
|
Object.defineProperty(exports, "Upvote", {
|
|
475
475
|
enumerable: true,
|
|
476
476
|
get: function get() {
|
|
@@ -525,6 +525,12 @@ Object.defineProperty(exports, "requestApi", {
|
|
|
525
525
|
return _request["default"];
|
|
526
526
|
}
|
|
527
527
|
});
|
|
528
|
+
Object.defineProperty(exports, "tasUploadPhotoModal", {
|
|
529
|
+
enumerable: true,
|
|
530
|
+
get: function get() {
|
|
531
|
+
return _uploadPhotoModal["default"];
|
|
532
|
+
}
|
|
533
|
+
});
|
|
528
534
|
Object.defineProperty(exports, "upload", {
|
|
529
535
|
enumerable: true,
|
|
530
536
|
get: function get() {
|
|
@@ -574,6 +580,8 @@ var _rangePickerPop = _interopRequireDefault(require("./components/range-picker-
|
|
|
574
580
|
|
|
575
581
|
var _datePicker = _interopRequireDefault(require("./components/date-picker"));
|
|
576
582
|
|
|
583
|
+
var _demoFree = _interopRequireDefault(require("./pages/demo-free"));
|
|
584
|
+
|
|
577
585
|
var _okrMap = _interopRequireDefault(require("./pages/okr-map"));
|
|
578
586
|
|
|
579
587
|
var _okrFlow = _interopRequireDefault(require("./components/okr-flow"));
|
|
@@ -23,7 +23,7 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
|
|
|
23
23
|
|
|
24
24
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
25
25
|
|
|
26
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); }
|
|
26
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
27
27
|
|
|
28
28
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
29
29
|
|
|
@@ -0,0 +1,27 @@
|
|
|
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 _errorBoundary = _interopRequireDefault(require("../../components/error-boundary"));
|
|
11
|
+
|
|
12
|
+
var _errorLevel = _interopRequireDefault(require("../../utils/error-level"));
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
|
+
|
|
16
|
+
var prefix = "dynamic-page";
|
|
17
|
+
|
|
18
|
+
var DemoFree = function DemoFree() {
|
|
19
|
+
return /*#__PURE__*/_react["default"].createElement(_errorBoundary["default"], {
|
|
20
|
+
errorLevel: _errorLevel["default"].P0
|
|
21
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
22
|
+
className: prefix
|
|
23
|
+
}, /*#__PURE__*/_react["default"].createElement("div", null)));
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
var _default = DemoFree;
|
|
27
|
+
exports["default"] = _default;
|
|
@@ -23,7 +23,7 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
|
|
|
23
23
|
|
|
24
24
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
25
25
|
|
|
26
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); }
|
|
26
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
27
27
|
|
|
28
28
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
29
29
|
|
package/lib/utils/auth.js
CHANGED
|
@@ -9,7 +9,7 @@ exports.hasSuperior = exports.OAuth = exports.KRAuth = exports.EAuth = exports.D
|
|
|
9
9
|
|
|
10
10
|
var _bsGlobal = require("./bs-global");
|
|
11
11
|
|
|
12
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); }
|
|
12
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
13
13
|
|
|
14
14
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
15
15
|
|
package/package.json
CHANGED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import React, { useState, useRef, useEffect } from "react";
|
|
2
|
+
import classNames from "classnames";
|
|
3
|
+
import { withRouter } from "react-router";
|
|
4
|
+
// import { ResizeObserver } from '@juggle/resize-observer';
|
|
5
|
+
// import ResizeObserver from "resize-observer-polyfill";
|
|
6
|
+
import FlipCard, { flipRefIns } from "../../components/flip-menu-card";
|
|
7
|
+
import MenuTree from "../../components/menu-tree";
|
|
8
|
+
import Scrollbar from "../../../scrollbar";
|
|
9
|
+
import DemoMenuData, { DemoMenusInt, defaultRefObject } from "./menus";
|
|
10
|
+
import MenuHighlight from "./menu-highlight";
|
|
11
|
+
import preCls from "../../precls";
|
|
12
|
+
import { isEn } from "../../../../utils/getLocale";
|
|
13
|
+
|
|
14
|
+
interface DemoMenusProps {
|
|
15
|
+
onSelect: (node: any) => void;
|
|
16
|
+
history: any;
|
|
17
|
+
isManager: number
|
|
18
|
+
}
|
|
19
|
+
const DemoMenus: React.FC<DemoMenusProps> = (props) => {
|
|
20
|
+
const { onSelect = () => { }, history, isManager } = props;
|
|
21
|
+
const menuRef = useRef<any>();
|
|
22
|
+
const okrMenusData = useRef<DemoMenusInt>(defaultRefObject);
|
|
23
|
+
const [selectedMenuKeys, setSelectedMenuKeys] = useState<string[]>([]);
|
|
24
|
+
const [expandedKeys, setExpandedKeys] = useState(["demofree"]);
|
|
25
|
+
const [menus, setMenus] = useState(() => {
|
|
26
|
+
okrMenusData.current = new DemoMenuData();
|
|
27
|
+
return okrMenusData.current.getMenus()
|
|
28
|
+
});
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
okrMenusData.current = new DemoMenuData(isManager === 1);
|
|
31
|
+
setMenus(okrMenusData.current.getMenus())
|
|
32
|
+
setExpandedKeys(["demofree"]);
|
|
33
|
+
}, [isManager])
|
|
34
|
+
const flipRef = useRef<flipRefIns>({
|
|
35
|
+
next: () => { },
|
|
36
|
+
goback: () => { },
|
|
37
|
+
});
|
|
38
|
+
const collapseMenu = (isHide) => {
|
|
39
|
+
if (isHide) {
|
|
40
|
+
menuRef.current.style.width = "0px";
|
|
41
|
+
} else {
|
|
42
|
+
menuRef.current.style.width = "";
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
const onExpandHandler = (expandKeys) => {
|
|
46
|
+
setExpandedKeys(expandKeys);
|
|
47
|
+
};
|
|
48
|
+
// 判断路由高亮菜单
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
const menuHighlight = new MenuHighlight(history);
|
|
51
|
+
menuHighlight.highlight((menu) => setSelectedMenuKeys([menu]));
|
|
52
|
+
}, [
|
|
53
|
+
history.location.pathname,
|
|
54
|
+
history.location.search,
|
|
55
|
+
]);
|
|
56
|
+
|
|
57
|
+
const onSelectHandler = (selectedKyes, { node }) => {
|
|
58
|
+
onSelect(node);
|
|
59
|
+
// 处理菜单选中
|
|
60
|
+
if (!selectedKyes.length) return;
|
|
61
|
+
setSelectedMenuKeys(selectedKyes);
|
|
62
|
+
};
|
|
63
|
+
return (
|
|
64
|
+
<div
|
|
65
|
+
ref={menuRef}
|
|
66
|
+
className={classNames(preCls, `${preCls}-appraisal-menus`)}
|
|
67
|
+
>
|
|
68
|
+
<FlipCard collapseMenu={collapseMenu} ref={flipRef} defaultWidth={isEn ? 210 : 180}>
|
|
69
|
+
<div className={classNames(`${preCls}-appraisal-menus-tree`)}>
|
|
70
|
+
<Scrollbar>
|
|
71
|
+
<MenuTree
|
|
72
|
+
data={menus}
|
|
73
|
+
selectedKeys={selectedMenuKeys}
|
|
74
|
+
defaultExpandedKeys={expandedKeys}
|
|
75
|
+
onExpand={onExpandHandler}
|
|
76
|
+
onSelect={onSelectHandler}
|
|
77
|
+
/>
|
|
78
|
+
</Scrollbar>
|
|
79
|
+
</div>
|
|
80
|
+
<div />
|
|
81
|
+
</FlipCard>
|
|
82
|
+
</div>
|
|
83
|
+
);
|
|
84
|
+
};
|
|
85
|
+
export default withRouter(DemoMenus);
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PAGE_UNASSIGNED_DEMOFREE,
|
|
3
|
+
PAGE_ASSIGNED_DEMOFREE,
|
|
4
|
+
PAGE_RESERVED_DEMOFREE,
|
|
5
|
+
PAGE_DONE_DEMOFREE,
|
|
6
|
+
PAGE_IGNORED_DEMOFREE,
|
|
7
|
+
} from "./menus";
|
|
8
|
+
|
|
9
|
+
export default class {
|
|
10
|
+
private history: any = null;
|
|
11
|
+
|
|
12
|
+
constructor(history: any) {
|
|
13
|
+
this.history = history;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
highlight(cb) {
|
|
17
|
+
if (this.isUnAssigned()) cb(PAGE_UNASSIGNED_DEMOFREE);
|
|
18
|
+
else if (this.isAssigned()) cb(PAGE_ASSIGNED_DEMOFREE);
|
|
19
|
+
else if (this.isReserved()) cb(PAGE_RESERVED_DEMOFREE);
|
|
20
|
+
else if (this.isDone()) cb(PAGE_DONE_DEMOFREE);
|
|
21
|
+
else if (this.isIgnore()) cb(PAGE_IGNORED_DEMOFREE);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
isUnAssigned() {
|
|
25
|
+
const { pathname, search } = this.history.location;
|
|
26
|
+
return pathname.match(/demofree/)
|
|
27
|
+
&& (!search || search.match(/selected[\s]*?=[\s]*?unassigned/));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
isAssigned() {
|
|
31
|
+
const { pathname, search } = this.history.location;
|
|
32
|
+
return pathname.match(/demofree/)
|
|
33
|
+
&& search.match(/selected[\s]*?=[\s]*?assigned/);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
isReserved() {
|
|
37
|
+
const { pathname, search } = this.history.location;
|
|
38
|
+
return pathname.match(/demofree/)
|
|
39
|
+
&& search.match(/selected[\s]*?=[\s]*?reserved/);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
isDone() {
|
|
43
|
+
const { pathname, search } = this.history.location;
|
|
44
|
+
return pathname.match(/demofree/)
|
|
45
|
+
&& search.match(/selected[\s]*?=[\s]*?done/);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
isIgnore() {
|
|
49
|
+
const { pathname, search } = this.history.location;
|
|
50
|
+
return pathname.match(/demofree/)
|
|
51
|
+
&& search.match(/selected[\s]*?=[\s]*?ignore/);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { PARENT_MENU_NODE, SUB_MENU_ITEM_NOE } from "../../components/menu-tree/tree-node/index";
|
|
2
|
+
|
|
3
|
+
interface TreeNode {
|
|
4
|
+
key: string;
|
|
5
|
+
title: string;
|
|
6
|
+
nodeType: string;
|
|
7
|
+
isLeaf: boolean;
|
|
8
|
+
data: any;
|
|
9
|
+
children?: TreeNode[];
|
|
10
|
+
}
|
|
11
|
+
export const defaultRefObject = {
|
|
12
|
+
menus: [],
|
|
13
|
+
getMenus: () => { },
|
|
14
|
+
};
|
|
15
|
+
export interface DemoMenusInt {
|
|
16
|
+
menus: any[];
|
|
17
|
+
getMenus: Function;
|
|
18
|
+
}
|
|
19
|
+
export const PAGE_UNASSIGNED_DEMOFREE = "unassigned";
|
|
20
|
+
export const PAGE_ASSIGNED_DEMOFREE = "assigned";
|
|
21
|
+
export const PAGE_RESERVED_DEMOFREE = "reserved";
|
|
22
|
+
export const PAGE_DONE_DEMOFREE = "done";
|
|
23
|
+
export const PAGE_IGNORED_DEMOFREE = "ignore";
|
|
24
|
+
export default class DemoMenuData {
|
|
25
|
+
public menus;
|
|
26
|
+
|
|
27
|
+
public isManager;
|
|
28
|
+
|
|
29
|
+
constructor(isManager = false) {
|
|
30
|
+
this.isManager = isManager;
|
|
31
|
+
this.menus = [
|
|
32
|
+
{
|
|
33
|
+
icon: "kaohe",
|
|
34
|
+
label: "任务状态",
|
|
35
|
+
key: "demofree",
|
|
36
|
+
href: this.isManager ? "#/demofree/list?selected=unassigned" : "#/demofree/list?selected=assigned",
|
|
37
|
+
isShow: true,
|
|
38
|
+
children: [{
|
|
39
|
+
icon: "",
|
|
40
|
+
label: "未分配",
|
|
41
|
+
key: "unassigned",
|
|
42
|
+
href: "#/demofree/list?selected=unassigned",
|
|
43
|
+
isShow: this.isManager,
|
|
44
|
+
}, {
|
|
45
|
+
icon: "",
|
|
46
|
+
label: "已分配",
|
|
47
|
+
key: "assigned",
|
|
48
|
+
href: "#/demofree/list?selected=assigned",
|
|
49
|
+
isShow: true,
|
|
50
|
+
}, {
|
|
51
|
+
icon: "",
|
|
52
|
+
label: "已预约",
|
|
53
|
+
key: "reserved",
|
|
54
|
+
href: "#/demofree/list?selected=reserved",
|
|
55
|
+
isShow: true,
|
|
56
|
+
}, {
|
|
57
|
+
icon: "",
|
|
58
|
+
label: "已完成",
|
|
59
|
+
key: "done",
|
|
60
|
+
href: "#/demofree/list?selected=done",
|
|
61
|
+
isShow: true,
|
|
62
|
+
}, {
|
|
63
|
+
icon: "",
|
|
64
|
+
label: "已忽略",
|
|
65
|
+
key: "ignore",
|
|
66
|
+
href: "#/demofree/list?selected=ignore",
|
|
67
|
+
isShow: this.isManager,
|
|
68
|
+
}],
|
|
69
|
+
},
|
|
70
|
+
// {
|
|
71
|
+
// icon: "KH-help",
|
|
72
|
+
// label: "客户续费情况",
|
|
73
|
+
// key: "custom",
|
|
74
|
+
// href: "#/custom",
|
|
75
|
+
// isShow: true,
|
|
76
|
+
// type: MENU_ITEM_NOE,
|
|
77
|
+
// children:[{
|
|
78
|
+
// icon: "",
|
|
79
|
+
// label: "未处理",
|
|
80
|
+
// key: "ignore",
|
|
81
|
+
// href: "#/demofree/custom?selected=未处理",
|
|
82
|
+
// isShow: true,
|
|
83
|
+
// },{
|
|
84
|
+
// icon: "",
|
|
85
|
+
// label: "待定",
|
|
86
|
+
// key: "ignore",
|
|
87
|
+
// href: "#/demofree/custom?selected=待定",
|
|
88
|
+
// isShow: true,
|
|
89
|
+
// },{
|
|
90
|
+
// icon: "",
|
|
91
|
+
// label: "已续费",
|
|
92
|
+
// key: "ignore",
|
|
93
|
+
// href: "#/demofree/custom?selected=已续费",
|
|
94
|
+
// isShow: true,
|
|
95
|
+
// },{
|
|
96
|
+
// icon: "",
|
|
97
|
+
// label: "未续费",
|
|
98
|
+
// key: "ignore",
|
|
99
|
+
// href: "#/demofree/custom?selected=未续费",
|
|
100
|
+
// isShow: true,
|
|
101
|
+
// }]
|
|
102
|
+
// },
|
|
103
|
+
];
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
getMenus() {
|
|
107
|
+
const menus = this.formateToTreeNodeData(this.menus);
|
|
108
|
+
return menus;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
formateToTreeNodeData(menus) {
|
|
112
|
+
const treeNodes: TreeNode[] = [];
|
|
113
|
+
|
|
114
|
+
for (let i = 0; i < menus.length; i += 1) {
|
|
115
|
+
const menu = menus[i];
|
|
116
|
+
const hasChildren = !!((menu.children && menu.children.length));
|
|
117
|
+
const isLeaf = menu.isLeaf !== undefined ? menu.isLeaf : !hasChildren;
|
|
118
|
+
|
|
119
|
+
let nodeType = menu.type;
|
|
120
|
+
if (!nodeType) nodeType = !isLeaf ? PARENT_MENU_NODE : SUB_MENU_ITEM_NOE;
|
|
121
|
+
|
|
122
|
+
if (menu.isShow) {
|
|
123
|
+
treeNodes.push({
|
|
124
|
+
key: `${menu.key}`,
|
|
125
|
+
title: menu.label,
|
|
126
|
+
data: menu,
|
|
127
|
+
isLeaf,
|
|
128
|
+
children: this.formateToTreeNodeData(menu.children || []),
|
|
129
|
+
nodeType,
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
return treeNodes;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
@@ -4,19 +4,22 @@ import OkrMenus from "./export-modules/okr-menus";
|
|
|
4
4
|
import AppraisalMenus from "./export-modules/appraisal-menus";
|
|
5
5
|
import ManageMenus from "./export-modules/manage-menus";
|
|
6
6
|
import "./index.scss";
|
|
7
|
+
import DemoMenus from "./export-modules/demo-menus";
|
|
7
8
|
|
|
8
9
|
const preCls = "titaui-menus";
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
const Menus = (props: any) => {
|
|
11
12
|
const { type, ...restProps } = props;
|
|
12
13
|
|
|
13
14
|
const renderMenuByType = () => {
|
|
14
|
-
if (type
|
|
15
|
+
if (type === "okr") {
|
|
15
16
|
return <OkrMenus {...restProps} />;
|
|
16
|
-
} if (type
|
|
17
|
+
} if (type === "appraisal") {
|
|
17
18
|
return <AppraisalMenus {...restProps} />;
|
|
18
|
-
} if (type
|
|
19
|
+
} if (type === "manage") {
|
|
19
20
|
return <ManageMenus {...restProps} />;
|
|
21
|
+
} if (type === "demofree") {
|
|
22
|
+
return <DemoMenus {...restProps} />;
|
|
20
23
|
}
|
|
21
24
|
return undefined;
|
|
22
25
|
};
|
|
@@ -26,4 +29,5 @@ export default function (props) {
|
|
|
26
29
|
{renderMenuByType()}
|
|
27
30
|
</div>
|
|
28
31
|
);
|
|
29
|
-
}
|
|
32
|
+
};
|
|
33
|
+
export default Menus;
|
|
@@ -18,3 +18,27 @@ export const getVersionTextMap = () => ({
|
|
|
18
18
|
[Versions.Professional]: getLocale("Sw_OKREdit"),
|
|
19
19
|
[Versions.Flagship]: getLocale("Sw_Flagship"),
|
|
20
20
|
});
|
|
21
|
+
|
|
22
|
+
export const DEMO_FREE_MENU_CONFIG = {
|
|
23
|
+
DataSource: null,
|
|
24
|
+
appCode: null,
|
|
25
|
+
appId: 119,
|
|
26
|
+
children: [],
|
|
27
|
+
code: "",
|
|
28
|
+
color: "#F28D49",
|
|
29
|
+
defaultExpand: false,
|
|
30
|
+
domain: "",
|
|
31
|
+
groupId: 0,
|
|
32
|
+
href: "#demofree/list?selected=assigned",
|
|
33
|
+
iconName: "",
|
|
34
|
+
id: 99998,
|
|
35
|
+
labelName: null,
|
|
36
|
+
menuPoint: null,
|
|
37
|
+
orderId: 2000,
|
|
38
|
+
originUrl: null,
|
|
39
|
+
signUrl: "",
|
|
40
|
+
status: 0,
|
|
41
|
+
tenantId: 0,
|
|
42
|
+
title: "demofree",
|
|
43
|
+
type: "hash",
|
|
44
|
+
};
|
|
@@ -25,12 +25,10 @@ const NavTop: FC = () => {
|
|
|
25
25
|
const versionInfo = getBSGlobal("tenantAuthentication");
|
|
26
26
|
const [activeMenuId, setActiveMenuId] = useState(-1);
|
|
27
27
|
const ua = navigator.userAgent.toLowerCase();
|
|
28
|
-
const showWxInvite = getTenantInfo().mainCorpId && ua.indexOf("micromessenger")
|
|
28
|
+
const showWxInvite = getTenantInfo().mainCorpId && ua.indexOf("micromessenger") !== -1;
|
|
29
29
|
const openWxInvite = useCallback(() => {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
// @ts-ignore
|
|
33
|
-
&& WeixinJSBridge.invoke(
|
|
30
|
+
if (window.WeixinJSBridge !== undefined) {
|
|
31
|
+
window.WeixinJSBridge.invoke(
|
|
34
32
|
"selectPrivilegedContact",
|
|
35
33
|
{
|
|
36
34
|
fromDepartmentId: -1, // 必填,表示打开的通讯录从指定的部门开始展示,-1表示自己所在部门开始, 0表示从最上层开始
|
|
@@ -40,7 +38,7 @@ const NavTop: FC = () => {
|
|
|
40
38
|
// "selectedTickets"["ticket1","ticket2"] // 非必填,已选ticket列表。single模式忽略该参数
|
|
41
39
|
},
|
|
42
40
|
(res) => {
|
|
43
|
-
if (res.err_msg
|
|
41
|
+
if (res.err_msg === "selectPrivilegedContact:ok") {
|
|
44
42
|
// var selectedUserList = res.result.userList; // 已选的成员列表
|
|
45
43
|
// for (var i = 0; i < selectedUserList.length; i++) {
|
|
46
44
|
// var openUserId = selectedUserList[i].openUserId; //成员openUserId
|
|
@@ -52,7 +50,7 @@ const NavTop: FC = () => {
|
|
|
52
50
|
.then(() => {
|
|
53
51
|
Toast.Success("邀请成功");
|
|
54
52
|
})
|
|
55
|
-
.catch((
|
|
53
|
+
.catch(() => {
|
|
56
54
|
Toast.Error("邀请失败");
|
|
57
55
|
});
|
|
58
56
|
} else {
|
|
@@ -60,10 +58,11 @@ const NavTop: FC = () => {
|
|
|
60
58
|
}
|
|
61
59
|
},
|
|
62
60
|
);
|
|
61
|
+
}
|
|
63
62
|
}, []);
|
|
64
63
|
|
|
65
64
|
const handleHashChange = () => {
|
|
66
|
-
const hash = location.hash.split("?")[0] || "";
|
|
65
|
+
const hash = window.location.hash.split("?")[0] || "";
|
|
67
66
|
if (hash) {
|
|
68
67
|
const activeMenu = menu.find((item) => hash.includes(item.href.split("#")?.[1]?.split("?")[0]));
|
|
69
68
|
if (hash.includes("homepage")) {
|
|
@@ -94,6 +93,7 @@ const NavTop: FC = () => {
|
|
|
94
93
|
href={hasOKRApp ? "#homepage" : ""}
|
|
95
94
|
>
|
|
96
95
|
<img
|
|
96
|
+
alt="logo"
|
|
97
97
|
src={Logo}
|
|
98
98
|
className={classNames(`${preCls}__left-logo`, {
|
|
99
99
|
[`${preCls}__left-logo--hover`]: hasOKRApp,
|
|
@@ -102,11 +102,12 @@ const NavTop: FC = () => {
|
|
|
102
102
|
{hasOKRApp && (
|
|
103
103
|
<span
|
|
104
104
|
className={classNames(`${preCls}__left-home`, {
|
|
105
|
-
[`${preCls}__left-home--active`]: activeMenuId
|
|
105
|
+
[`${preCls}__left-home--active`]: activeMenuId === 99999,
|
|
106
106
|
[`${preCls}__left-home--hover`]: hasOKRApp,
|
|
107
107
|
})}
|
|
108
108
|
>
|
|
109
109
|
<img
|
|
110
|
+
alt="home-img"
|
|
110
111
|
src={Home}
|
|
111
112
|
className={classNames(`${preCls}__left-home-img`)}
|
|
112
113
|
/>
|
|
@@ -2,13 +2,13 @@ import axios from "axios";
|
|
|
2
2
|
import { rget, rdelete } from "../../utils/request";
|
|
3
3
|
|
|
4
4
|
// @ts-ignore
|
|
5
|
-
const tenantId = (BSGlobal && BSGlobal.tenantInfo.Id) || 0;
|
|
5
|
+
const tenantId = (window.BSGlobal && window.BSGlobal.tenantInfo.Id) || 0;
|
|
6
6
|
// @ts-ignore
|
|
7
|
-
const userId = (BSGlobal && BSGlobal.loginUserInfo.Id) || 0;
|
|
7
|
+
const userId = (window.BSGlobal && window.BSGlobal.loginUserInfo.Id) || 0;
|
|
8
8
|
|
|
9
9
|
const requestDomain = () => {
|
|
10
10
|
if (!window.location.hostname.match(/dev/)) return "";
|
|
11
|
-
return `${location.protocol}//www.tita.gift`;
|
|
11
|
+
return `${window.location.protocol}//www.tita.gift`;
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
export const getTodos = (pageNum) => rget("v1")(
|
|
@@ -43,8 +43,8 @@ export const getMessages = () => {
|
|
|
43
43
|
)
|
|
44
44
|
.then((resp: any) => {
|
|
45
45
|
if (resp.code === 401) {
|
|
46
|
-
location.href = "/Account/Logout";
|
|
47
|
-
return;
|
|
46
|
+
window.location.href = "/Account/Logout";
|
|
47
|
+
return undefined;
|
|
48
48
|
}
|
|
49
49
|
return resp.data;
|
|
50
50
|
})
|
|
@@ -4,7 +4,7 @@ import defaultLogo from "./images/logo-white.png";
|
|
|
4
4
|
|
|
5
5
|
export const getMenus = () => {
|
|
6
6
|
// @ts-ignore
|
|
7
|
-
const navs: INavType[] = BSGlobal.newNavigation;
|
|
7
|
+
const navs: INavType[] = window.BSGlobal.newNavigation;
|
|
8
8
|
navs.sort((pre, next) => pre.orderId - next.orderId);
|
|
9
9
|
return navs;
|
|
10
10
|
};
|
|
@@ -12,5 +12,18 @@ export const getMenus = () => {
|
|
|
12
12
|
export const getLogo = () => {
|
|
13
13
|
// 232637ab8a674427a1d6489329035d86_n 是老logo的路径,没法判断是否用户自定义过,所以只能这么硬核
|
|
14
14
|
const tenantInfo = getTenantInfo();
|
|
15
|
-
return tenantInfo.isNewIndex && /232637ab8a674427a1d6489329035d86_n/g.test(tenantInfo.Logo) || !tenantInfo.Logo ? defaultLogo : tenantInfo.Logo;
|
|
15
|
+
return ((tenantInfo.isNewIndex && /232637ab8a674427a1d6489329035d86_n/g.test(tenantInfo.Logo)) || !tenantInfo.Logo) ? defaultLogo : tenantInfo.Logo;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const transMetasToTableData = (dataSource = []) => {
|
|
19
|
+
const listData: any = [];
|
|
20
|
+
dataSource.forEach((dataItem: any) => {
|
|
21
|
+
const data = {};
|
|
22
|
+
dataItem.forEach((field) => {
|
|
23
|
+
const { name, value } = field;
|
|
24
|
+
data[name] = value;
|
|
25
|
+
});
|
|
26
|
+
listData.push(data);
|
|
27
|
+
});
|
|
28
|
+
return listData;
|
|
16
29
|
};
|
package/src/index.d.ts
CHANGED
package/src/index.js
CHANGED
|
@@ -20,6 +20,7 @@ export { default as ChangeOkrModal } from "./components/change-okr-modal";
|
|
|
20
20
|
export { default as CreateOkrModal } from "./components/create-okr-modal";
|
|
21
21
|
export { default as RangePickerPop } from "./components/range-picker-pop";
|
|
22
22
|
export { default as DatePicker } from "./components/date-picker";
|
|
23
|
+
export { default as DemoFree } from "./pages/demo-free";
|
|
23
24
|
export { default as OkrMapPage } from "./pages/okr-map";
|
|
24
25
|
export { default as OkrFlow } from "./components/okr-flow";
|
|
25
26
|
export { default as DropSelector } from "./components/drop-selector";
|
|
@@ -87,4 +88,4 @@ export { default as requestApi } from "./utils/request";
|
|
|
87
88
|
export { default as PointDemo } from "./components/point-demo";
|
|
88
89
|
export { default as Scrollbar } from "./components/scrollbar";
|
|
89
90
|
export { default as WeeklyReport } from "./components/weekly-report";
|
|
90
|
-
export { default as
|
|
91
|
+
export { default as tasUploadPhotoModal } from "./components/upload-photo-modal";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React, { FC } from "react";
|
|
2
|
+
import ErrorBoundary from "../../components/error-boundary";
|
|
3
|
+
import ERROR_LEVEL from "../../utils/error-level";
|
|
4
|
+
|
|
5
|
+
const prefix = "dynamic-page";
|
|
6
|
+
|
|
7
|
+
const DemoFree: FC = () => (
|
|
8
|
+
<ErrorBoundary errorLevel={ERROR_LEVEL.P0}>
|
|
9
|
+
<div className={prefix}>
|
|
10
|
+
<div />
|
|
11
|
+
</div>
|
|
12
|
+
</ErrorBoundary>
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
export default DemoFree;
|