@titaui/pc 1.15.46 → 1.15.47-beta.3
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/avatar/default.js +7 -2
- package/lib/components/book-demo/constant.js +3 -0
- package/lib/components/button/icon-btn/index.css +19 -1
- package/lib/components/button/icon-btn/index.js +4 -2
- package/lib/components/change-okr-modal/index.js +1 -1
- package/lib/components/common-share/publishMblog.js +1 -1
- package/lib/components/create-okr-modal/fields/okr-type-detail.js +1 -1
- package/lib/components/create-okr-modal/fields/okr-visibility-detail.js +1 -1
- package/lib/components/create-okr-modal/index.js +1 -1
- package/lib/components/create-okr-modal/request-api.js +1 -1
- package/lib/components/create-okr-modal/utils/helper.js +1 -1
- package/lib/components/date-picker/BodyItem.js +3 -3
- package/lib/components/date-picker/CalendarHeader.js +3 -3
- package/lib/components/delete-confirm-pop/ConfirmPop.js +3 -3
- package/lib/components/dialog-confirm/index.css +8 -0
- package/lib/components/dialog-confirm/index.js +26 -16
- package/lib/components/dialog-qq-docs/index.js +1 -1
- package/lib/components/dialog-qq-docs/utils.js +1 -1
- package/lib/components/dialog-upload/index.js +1 -1
- package/lib/components/drawer-manager/drawerWrapper.js +1 -1
- package/lib/components/dynamic/dynamic-item/components/progress/components/okr-progress/index.js +1 -1
- package/lib/components/dynamic/dynamic-item/components/summary-header/index.js +7 -7
- package/lib/components/dynamic/dynamic-item/dynamic-create-o/index.js +4 -4
- package/lib/components/dynamic/dynamic-item/dynamic-new-report/components/remind-user-view/index.js +3 -2
- package/lib/components/eReport/eReportLists/reportList.js +3 -3
- package/lib/components/emotions-selector/selector-pop.js +3 -3
- package/lib/components/ereport-list/index.js +3 -3
- package/lib/components/expiration-reminder/index.css +6 -0
- package/lib/components/expiration-reminder/index.js +10 -3
- package/lib/{pages/like-ranking → components}/filter-buttons/department.js +2 -2
- package/lib/{pages/like-ranking → components}/filter-buttons/group.js +2 -2
- package/lib/{pages/like-ranking → components}/filter-buttons/index.css +4 -0
- package/lib/components/filter-buttons/index.js +73 -0
- package/lib/{pages/like-ranking → components}/filter-buttons/modular.js +3 -3
- package/lib/{pages/like-ranking → components}/filter-buttons/name.js +2 -2
- package/lib/{pages/like-ranking → components}/filter-buttons/search-dropdown/index.css +0 -0
- package/lib/{pages/like-ranking → components}/filter-buttons/search-dropdown/index.js +0 -0
- package/lib/{pages/like-ranking → components}/filter-buttons/timer.js +3 -3
- package/lib/components/firework/index.js +1 -1
- package/lib/components/form/form-fields/dropdown/index.css +9 -0
- package/lib/components/form/form-fields/dropdown/index.js +8 -3
- package/lib/components/form/form-fields/input/index.js +4 -1
- package/lib/components/form/form-fields/input-verification-code/index.js +1 -1
- package/lib/components/grid-layout/util/network.js +1 -1
- package/lib/components/import-modal/tree/okr-tree/index.js +1 -1
- package/lib/components/mblog/components/MblogAction.js +3 -3
- package/lib/components/menus/components/menu-tree/tree-node/index.js +21 -2
- package/lib/components/menus/components/menu-tree/tree-node/subordinates.js +1 -5
- package/lib/components/menus/components/menu-tree/tree-node/summary-follower/index.css +47 -0
- package/lib/components/menus/components/menu-tree/tree-node/summary-follower/index.js +77 -0
- package/lib/components/menus/components/menu-tree/tree-node/summary-share.js +7 -6
- package/lib/components/menus/components/menu-tree/tree-node/summary-tongji.js +7 -6
- package/lib/components/menus/components/menu-tree/tree-node/summary-user-concern.js +95 -0
- package/lib/components/menus/context.js +6 -2
- package/lib/components/menus/export-modules/demo-menus/index.js +10 -9
- package/lib/components/menus/export-modules/demo-menus/menu-highlight.js +8 -2
- package/lib/components/menus/export-modules/demo-menus/menus.js +73 -26
- package/lib/components/menus/export-modules/summary-menus/menus.js +122 -0
- package/lib/components/menus/export-modules/summary-menus/summary-front-menus.js +49 -3
- package/lib/components/menus/export-modules/survey-menu/index.css +9 -0
- package/lib/components/menus/export-modules/survey-menu/index.js +120 -0
- package/lib/components/menus/export-modules/survey-menu/menu-highlight.js +52 -0
- package/lib/components/menus/export-modules/survey-menu/menus.js +87 -0
- package/lib/components/menus/export-modules/survey-menu/request-api.js +5 -0
- package/lib/components/menus/export-modules/survey-menu/survey-front-menus.js +155 -0
- package/lib/components/menus/index.js +6 -0
- package/lib/components/menus/request-apis.js +38 -2
- package/lib/components/nav-top/components/app-center/images/survey.svg +20 -0
- package/lib/components/nav-top/components/app-center/index.css +8 -0
- package/lib/components/okr-detail/base-info/other-infos/principal/index.js +1 -1
- package/lib/components/okr-detail/components/ao-nice/index.js +1 -1
- package/lib/components/okr-detail/components/header/edit-name.js +1 -1
- package/lib/components/okr-detail/components/header/o-avatar.js +1 -1
- package/lib/components/okr-detail/components/header/o-classify.js +1 -1
- package/lib/components/okr-detail/components/o-classify.js +1 -1
- package/lib/components/okr-detail/components/o-progress-update/index.js +1 -1
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-kr-node/index.js +1 -1
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/e-task-level2.js +1 -1
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/e-task.js +1 -1
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/index.js +1 -1
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/kr-score-editor/edit-pop.js +3 -3
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-parent-node/index.js +1 -1
- package/lib/components/okr-detail/components/okr-tree/tree-node/o-child-node/edit-child-okr-weight.js +1 -1
- package/lib/components/okr-detail/components/okr-tree/tree-node/o-parent-node/index.js +1 -1
- package/lib/components/okr-detail/detail-footer/index.js +1 -1
- package/lib/components/okr-detail/detail-header/index.js +1 -1
- package/lib/components/okr-detail/index.js +4 -2
- package/lib/components/okr-detail/okr-list/index.js +1 -1
- package/lib/components/okr-detail/request-apis.js +1 -1
- package/lib/components/okr-excel/hooks.js +6 -3
- package/lib/components/okr-excel/index.css +18 -0
- package/lib/components/okr-excel/index.js +79 -76
- package/lib/components/okr-excel/renders.js +24 -3
- package/lib/components/okr-filter-drawer/filter-form.js +2 -2
- package/lib/components/okr-flow/child-node/fields/creator.js +1 -1
- package/lib/components/okr-flow/child-node/work-node.js +1 -1
- package/lib/components/okr-flow/export-modal/index.js +40 -1
- package/lib/components/okr-flow/export-modules/okr-search-panel/index.js +1 -1
- package/lib/components/okr-flow/request-apis.js +1 -1
- package/lib/components/okr-flow/root-node/index.js +1 -1
- package/lib/components/okr-progress/components/o-progress-update/index.js +1 -1
- package/lib/components/okr-progress-modal/index.js +1 -1
- package/lib/components/okr-review/ReviewPop/components/ReviewBody/index.js +1 -1
- package/lib/components/okr-review/components/confirm-pop/ConfirmPop.js +3 -3
- package/lib/components/okr-share/common-painter/darwAvatar.js +1 -1
- package/lib/components/okr-share/common-painter/openDataPainter.js +1 -1
- package/lib/components/okr-share/common-painter/utils.js +1 -1
- package/lib/components/okr-share/pink-card/drawDepartmentName.js +1 -1
- package/lib/components/okr-share/pink-card/drawKrs.js +1 -1
- package/lib/components/okr-share/pink-card/drawQuote.js +1 -1
- package/lib/components/okr-share/pink-card/drawUserName.js +1 -1
- package/lib/components/okr-share/pink-card/index.js +1 -1
- package/lib/components/okr-share/publishMblog.js +1 -1
- package/lib/components/okr-share/shareCardSelector.js +1 -1
- package/lib/components/okr-type-icon/index.js +18 -13
- package/lib/components/okrcase-library/okrcases-components/submitOkr-dialog.js +3 -1
- package/lib/components/okrcase-library/server/network.js +1 -1
- package/lib/components/open-data-painter/index.js +1 -1
- package/lib/components/period-selector/helper/index.js +1 -1
- package/lib/components/picker/picker.js +9 -5
- package/lib/components/picker/range-picker/components/picker-trigger/index.js +3 -1
- package/lib/components/picker/range-picker/index.js +4 -1
- package/lib/components/range-selector-pop/RangeSelectorPop.js +3 -3
- package/lib/components/rich-editor/models/schema.js +6 -6
- package/lib/components/rich-editor/plugins/block/block-quote/index.js +8 -8
- package/lib/components/rich-editor/plugins/block/heading/index.js +8 -8
- package/lib/components/rich-editor/plugins/block/lists/index.js +14 -14
- package/lib/components/rich-editor/plugins/block/paragraph/index.js +5 -5
- package/lib/components/rich-editor/plugins/core/index.js +4 -4
- package/lib/components/rich-editor/plugins/extension/alignment/index.js +5 -5
- package/lib/components/rich-editor/plugins/extension/placeholder/index.js +4 -4
- package/lib/components/rich-editor/plugins/inline/color/commond.js +3 -3
- package/lib/components/rich-editor/plugins/inline/color/index.js +11 -11
- package/lib/components/rich-editor/plugins/inline/delete-line/index.js +8 -8
- package/lib/components/rich-editor/plugins/inline/em/index.js +5 -5
- package/lib/components/rich-editor/plugins/inline/link/index.js +8 -8
- package/lib/components/rich-editor/plugins/inline/strong/index.js +8 -8
- package/lib/components/rich-editor/plugins/inline/under-line/index.js +8 -8
- package/lib/components/rich-editor/react/uiProvider.js +3 -3
- package/lib/components/rich-editor/ui/Popup/index.js +3 -3
- package/lib/components/rich-editor-at/components/index.js +15 -4
- package/lib/components/rich-editor-at/index.js +3 -1
- package/lib/components/select/Option.js +3 -3
- package/lib/components/superset-charts/fetch-assets-and-append/get-assets-with-cache.js +1 -1
- package/lib/components/superset-charts/fetch-assets-and-append/index.js +1 -1
- package/lib/components/survey-model/request-api.js +1 -1
- package/lib/components/tabs/index.css +20 -0
- package/lib/components/tabs/index.js +4 -1
- package/lib/components/tabs/tabBtns.js +69 -0
- package/lib/components/tag/index.css +3 -3
- package/lib/components/task-relation-modal/index.js +1 -1
- package/lib/components/task-relation-modal/tree/category-tree/index.js +1 -1
- package/lib/components/task-relation-modal/tree/okr-tree/index.js +1 -1
- package/lib/components/task-relation-modal/tree/work-tree/index.js +1 -1
- package/lib/components/task-relation-modal/work-relation/index.js +1 -1
- package/lib/components/task-tree/task-item-node/e-project.js +1 -1
- package/lib/components/task-tree/task-item-node/e-task.js +1 -1
- package/lib/components/tita-chart/errorBoundary/index.js +3 -3
- package/lib/components/toast/index.js +1 -1
- package/lib/components/upload/index.js +1 -1
- package/lib/components/upload/index2.js +1 -1
- package/lib/components/upvote/index.js +1 -1
- package/lib/components/user-selector/request-apis.js +6 -3
- package/lib/components/version-change-modal/index.js +1 -1
- package/lib/components/version-change-modal/request-api.js +1 -1
- package/lib/components/weekly-report/card.js +11 -1
- package/lib/components/weekly-report/common-painter/darwAvatar.js +1 -1
- package/lib/components/weekly-report/common-painter/drawName.js +1 -1
- package/lib/components/weekly-report/common-painter/openDataPainter.js +1 -1
- package/lib/components/weekly-report/index.js +1 -1
- package/lib/components-v1/animate/AnimateChild.js +3 -3
- package/lib/components-v1/avatar/index.js +3 -3
- package/lib/components-v1/dropDownSelector/StatelessDropdown.js +3 -3
- package/lib/components-v1/progress/CircleProgress.js +3 -3
- package/lib/components-v1/select/Option.js +3 -3
- package/lib/components-v1/userSelector/UserSelectorPop.js +3 -3
- package/lib/components-v1/userSelector/components/MultiMode/index.js +3 -3
- package/lib/components-v1/userSelector/components/UserItem.js +3 -3
- package/lib/index.js +16 -0
- package/lib/pages/group-management/groupInterface.js +1 -1
- package/lib/pages/like-ranking/index.js +1 -1
- package/lib/pages/new-okr-list/header/index.js +20 -1
- package/lib/pages/new-okr-list/index.js +16 -4
- package/lib/pages/new-okr-list/list/index.js +3 -1
- package/lib/pages/new-okr-list/loading.js +3 -2
- package/lib/pages/new-okr-list/request-api.js +1 -1
- package/lib/pages/okr-map/export-modules/okr-map/okr-map.js +1 -1
- package/lib/pages/okr-map/request-apis.js +1 -1
- package/lib/pages/personal-info/components/edit-base-info/index.js +3 -3
- package/lib/utils/helpers.js +1 -1
- package/lib/utils/open-data.js +4 -1
- package/lib/utils/request-v1.js +1 -1
- package/lib/utils/request.js +1 -1
- package/package.json +2 -2
- package/lib/pages/like-ranking/filter-buttons/index.js +0 -36
|
@@ -49,9 +49,10 @@ var DemoMenus = function DemoMenus(props) {
|
|
|
49
49
|
var _props$onSelect = props.onSelect,
|
|
50
50
|
onSelect = _props$onSelect === void 0 ? function () {} : _props$onSelect,
|
|
51
51
|
history = props.history,
|
|
52
|
-
|
|
52
|
+
roleList = props.roleList,
|
|
53
|
+
showCompeteCustomer = props.showCompeteCustomer;
|
|
53
54
|
var menuRef = (0, _react.useRef)();
|
|
54
|
-
var
|
|
55
|
+
var demoMenusData = (0, _react.useRef)(_menus.defaultRefObject);
|
|
55
56
|
|
|
56
57
|
var _useState = (0, _react.useState)([]),
|
|
57
58
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -64,18 +65,18 @@ var DemoMenus = function DemoMenus(props) {
|
|
|
64
65
|
setExpandedKeys = _useState4[1];
|
|
65
66
|
|
|
66
67
|
var _useState5 = (0, _react.useState)(function () {
|
|
67
|
-
|
|
68
|
-
return
|
|
68
|
+
demoMenusData.current = new _menus["default"](roleList, showCompeteCustomer);
|
|
69
|
+
return demoMenusData.current.getMenus();
|
|
69
70
|
}),
|
|
70
71
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
71
72
|
menus = _useState6[0],
|
|
72
73
|
setMenus = _useState6[1];
|
|
73
74
|
|
|
74
75
|
(0, _react.useEffect)(function () {
|
|
75
|
-
|
|
76
|
-
setMenus(
|
|
76
|
+
demoMenusData.current = new _menus["default"](roleList, showCompeteCustomer);
|
|
77
|
+
setMenus(demoMenusData.current.getMenus());
|
|
77
78
|
setExpandedKeys(["demofree"]);
|
|
78
|
-
}, [
|
|
79
|
+
}, [roleList, showCompeteCustomer]);
|
|
79
80
|
var flipRef = (0, _react.useRef)({
|
|
80
81
|
next: function next() {},
|
|
81
82
|
goback: function goback() {}
|
|
@@ -95,11 +96,11 @@ var DemoMenus = function DemoMenus(props) {
|
|
|
95
96
|
|
|
96
97
|
|
|
97
98
|
(0, _react.useEffect)(function () {
|
|
98
|
-
var menuHighlight = new _menuHighlight["default"](history,
|
|
99
|
+
var menuHighlight = new _menuHighlight["default"](history, roleList.includes(_menus.ERoleType.Manager));
|
|
99
100
|
menuHighlight.highlight(function (menu) {
|
|
100
101
|
return setSelectedMenuKeys([menu]);
|
|
101
102
|
});
|
|
102
|
-
}, [history.location.pathname, history.location.search,
|
|
103
|
+
}, [history.location.pathname, history.location.search, roleList]);
|
|
103
104
|
|
|
104
105
|
var onSelectHandler = function onSelectHandler(selectedKyes, _ref) {
|
|
105
106
|
var node = _ref.node;
|
|
@@ -25,7 +25,7 @@ var _default = /*#__PURE__*/function () {
|
|
|
25
25
|
_createClass(_default, [{
|
|
26
26
|
key: "highlight",
|
|
27
27
|
value: function highlight(cb) {
|
|
28
|
-
if (this.isUnAssigned()) cb(_menus.PAGE_UNASSIGNED_DEMOFREE);else if (this.isAssigned()) cb(_menus.PAGE_ASSIGNED_DEMOFREE);else if (this.isReserved()) cb(_menus.PAGE_RESERVED_DEMOFREE);else if (this.isDone()) cb(_menus.PAGE_DONE_DEMOFREE);else if (this.isIgnore()) cb(_menus.PAGE_IGNORED_DEMOFREE);else if (this.isChart()) cb(_menus.PAGE_CHARTS_DEMOFREE);else if (this.isRechargeList()) cb(_menus.PAGE_RECHARGE_LIST);else if (this.isRechargeStatistics()) cb(_menus.PAGE_RECHARGE_STATISTICS);else if (this.isRechargeStatus()) cb(_menus.PAGE_RECHARGE_STATUS);else if (this.isDueDateOrder()) cb(_menus.PAGE_DUEDATE_ORDER);else if (this.isAllCustomer()) cb(_menus.PAGE_ALL_CUSTOMER);else if (this.isPublicCustomer()) cb(_menus.PAGE_PUBLIC_CUSTOMER);else if (this.isMyCustomer()) cb(_menus.PAGE_MY_CUSTOMER);
|
|
28
|
+
if (this.isUnAssigned()) cb(_menus.PAGE_UNASSIGNED_DEMOFREE);else if (this.isAssigned()) cb(_menus.PAGE_ASSIGNED_DEMOFREE);else if (this.isReserved()) cb(_menus.PAGE_RESERVED_DEMOFREE);else if (this.isDone()) cb(_menus.PAGE_DONE_DEMOFREE);else if (this.isIgnore()) cb(_menus.PAGE_IGNORED_DEMOFREE);else if (this.isChart()) cb(_menus.PAGE_CHARTS_DEMOFREE);else if (this.isRechargeList()) cb(_menus.PAGE_RECHARGE_LIST);else if (this.isRechargeStatistics()) cb(_menus.PAGE_RECHARGE_STATISTICS);else if (this.isRechargeStatus()) cb(_menus.PAGE_RECHARGE_STATUS);else if (this.isDueDateOrder()) cb(_menus.PAGE_DUEDATE_ORDER);else if (this.isAllCustomer()) cb(_menus.PAGE_ALL_CUSTOMER);else if (this.isPublicCustomer()) cb(_menus.PAGE_PUBLIC_CUSTOMER);else if (this.isMyCustomer()) cb(_menus.PAGE_MY_CUSTOMER);else if (this.isLimitCustomer()) cb(_menus.PAGE_LIMIT_CUSTOMER);
|
|
29
29
|
}
|
|
30
30
|
}, {
|
|
31
31
|
key: "isChart",
|
|
@@ -64,7 +64,7 @@ var _default = /*#__PURE__*/function () {
|
|
|
64
64
|
pathname = _this$history$locatio.pathname,
|
|
65
65
|
search = _this$history$locatio.search;
|
|
66
66
|
|
|
67
|
-
if (this.isManager
|
|
67
|
+
if (this.isManager) {
|
|
68
68
|
return pathname.match(/demofree\/list/) && (!search || search.match(/selected[\s]*?=[\s]*?unassigned/));
|
|
69
69
|
}
|
|
70
70
|
|
|
@@ -120,6 +120,12 @@ var _default = /*#__PURE__*/function () {
|
|
|
120
120
|
var pathname = this.history.location.pathname;
|
|
121
121
|
return pathname.match(/demofree\/customer\/all/);
|
|
122
122
|
}
|
|
123
|
+
}, {
|
|
124
|
+
key: "isLimitCustomer",
|
|
125
|
+
value: function isLimitCustomer() {
|
|
126
|
+
var pathname = this.history.location.pathname;
|
|
127
|
+
return pathname.match(/demofree\/customer\/limit/);
|
|
128
|
+
}
|
|
123
129
|
}]);
|
|
124
130
|
|
|
125
131
|
return _default;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.defaultRefObject = exports["default"] = exports.PAGE_UNASSIGNED_DEMOFREE = exports.PAGE_RESERVED_DEMOFREE = exports.PAGE_RECHARGE_STATUS = exports.PAGE_RECHARGE_STATISTICS = exports.PAGE_RECHARGE_LIST = exports.PAGE_PUBLIC_CUSTOMER = exports.PAGE_MY_CUSTOMER = exports.PAGE_IGNORED_DEMOFREE = exports.PAGE_DUEDATE_ORDER = exports.PAGE_DONE_DEMOFREE = exports.PAGE_CHARTS_DEMOFREE = exports.PAGE_CHARTS = exports.PAGE_ASSIGNED_DEMOFREE = exports.PAGE_ALL_CUSTOMER = void 0;
|
|
6
|
+
exports.defaultRefObject = exports["default"] = exports.PAGE_UNASSIGNED_DEMOFREE = exports.PAGE_STAFF_ROLES_MANAGEMENT = exports.PAGE_RESERVED_DEMOFREE = exports.PAGE_RECHARGE_STATUS = exports.PAGE_RECHARGE_STATISTICS = exports.PAGE_RECHARGE_LIST = exports.PAGE_PUBLIC_CUSTOMER = exports.PAGE_MY_CUSTOMER = exports.PAGE_LIMIT_CUSTOMER = exports.PAGE_IGNORED_DEMOFREE = exports.PAGE_DUEDATE_ORDER = exports.PAGE_DONE_DEMOFREE = exports.PAGE_CHARTS_DEMOFREE = exports.PAGE_CHARTS = exports.PAGE_ASSIGNED_DEMOFREE = exports.PAGE_ALL_CUSTOMER = exports.ERoleType = void 0;
|
|
7
7
|
|
|
8
8
|
var _index = require("../../components/menu-tree/tree-node/index");
|
|
9
9
|
|
|
@@ -13,17 +13,20 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
|
|
|
13
13
|
|
|
14
14
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var ERoleType;
|
|
17
|
+
exports.ERoleType = ERoleType;
|
|
17
18
|
|
|
18
|
-
(function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
(function (ERoleType) {
|
|
20
|
+
ERoleType["Sales"] = "sales";
|
|
21
|
+
ERoleType["Manager"] = "manager";
|
|
22
|
+
ERoleType["Supervisor"] = "supervisor";
|
|
23
|
+
ERoleType["SalesOperation"] = "salesOperation";
|
|
24
|
+
ERoleType["CRM"] = "CRM";
|
|
25
|
+
ERoleType["PublicCustomer"] = "publicCustomer";
|
|
26
|
+
ERoleType["DemoReadOnly"] = "demoReadOnly";
|
|
27
|
+
})(ERoleType || (exports.ERoleType = ERoleType = {}));
|
|
26
28
|
|
|
29
|
+
var demoRole = [ERoleType.Sales, ERoleType.Manager, ERoleType.Supervisor, ERoleType.SalesOperation, ERoleType.DemoReadOnly];
|
|
27
30
|
var defaultRefObject = {
|
|
28
31
|
menus: [],
|
|
29
32
|
getMenus: function getMenus() {}
|
|
@@ -45,6 +48,8 @@ var PAGE_ALL_CUSTOMER = "allCustomer";
|
|
|
45
48
|
exports.PAGE_ALL_CUSTOMER = PAGE_ALL_CUSTOMER;
|
|
46
49
|
var PAGE_PUBLIC_CUSTOMER = "publicCustomer";
|
|
47
50
|
exports.PAGE_PUBLIC_CUSTOMER = PAGE_PUBLIC_CUSTOMER;
|
|
51
|
+
var PAGE_LIMIT_CUSTOMER = 'limitCustomer';
|
|
52
|
+
exports.PAGE_LIMIT_CUSTOMER = PAGE_LIMIT_CUSTOMER;
|
|
48
53
|
var PAGE_MY_CUSTOMER = "myCustomer";
|
|
49
54
|
exports.PAGE_MY_CUSTOMER = PAGE_MY_CUSTOMER;
|
|
50
55
|
var PAGE_CHARTS = "charts";
|
|
@@ -57,92 +62,134 @@ var PAGE_RECHARGE_STATISTICS = "rechargeStatistics";
|
|
|
57
62
|
exports.PAGE_RECHARGE_STATISTICS = PAGE_RECHARGE_STATISTICS;
|
|
58
63
|
var PAGE_RECHARGE_STATUS = "rechargeStatus";
|
|
59
64
|
exports.PAGE_RECHARGE_STATUS = PAGE_RECHARGE_STATUS;
|
|
65
|
+
var PAGE_STAFF_ROLES_MANAGEMENT = 'staffManagement';
|
|
66
|
+
exports.PAGE_STAFF_ROLES_MANAGEMENT = PAGE_STAFF_ROLES_MANAGEMENT;
|
|
60
67
|
|
|
61
68
|
var DemoMenuData = /*#__PURE__*/function () {
|
|
62
|
-
function DemoMenuData(
|
|
69
|
+
function DemoMenuData(roleList, showCompeteCustomer) {
|
|
63
70
|
_classCallCheck(this, DemoMenuData);
|
|
64
71
|
|
|
65
|
-
this.
|
|
72
|
+
this.roleList = roleList;
|
|
73
|
+
this.showDemo = this.roleList.some(function (role) {
|
|
74
|
+
return demoRole.includes(role);
|
|
75
|
+
});
|
|
76
|
+
this.isManager = this.roleList.includes(ERoleType.Manager);
|
|
77
|
+
this.showCompeteCustomer = showCompeteCustomer;
|
|
66
78
|
this.menus = [{
|
|
67
79
|
icon: "kaohe",
|
|
68
80
|
label: "任务状态",
|
|
69
81
|
key: "demofree",
|
|
70
82
|
href: this.isManager ? "#/demofree/list?selected=unassigned" : "#/demofree/list?selected=assigned",
|
|
71
|
-
isShow: this.
|
|
83
|
+
isShow: this.showDemo,
|
|
72
84
|
children: [{
|
|
73
85
|
icon: "",
|
|
74
86
|
label: "未分配",
|
|
75
87
|
key: "unassigned",
|
|
76
88
|
href: "#/demofree/list?selected=unassigned",
|
|
77
|
-
isShow: this.isManager
|
|
89
|
+
isShow: this.isManager
|
|
78
90
|
}, {
|
|
79
91
|
icon: "",
|
|
80
92
|
label: "已分配",
|
|
81
93
|
key: "assigned",
|
|
82
94
|
href: "#/demofree/list?selected=assigned",
|
|
83
|
-
isShow: this.
|
|
95
|
+
isShow: this.showDemo
|
|
84
96
|
}, {
|
|
85
97
|
icon: "",
|
|
86
98
|
label: "已预约",
|
|
87
99
|
key: "reserved",
|
|
88
100
|
href: "#/demofree/list?selected=reserved",
|
|
89
|
-
isShow: this.
|
|
101
|
+
isShow: this.showDemo
|
|
90
102
|
}, {
|
|
91
103
|
icon: "",
|
|
92
104
|
label: "已完成",
|
|
93
105
|
key: "done",
|
|
94
106
|
href: "#/demofree/list?selected=done",
|
|
95
|
-
isShow: this.
|
|
107
|
+
isShow: this.showDemo
|
|
96
108
|
}, {
|
|
97
109
|
icon: "",
|
|
98
110
|
label: "已忽略",
|
|
99
111
|
key: "ignore",
|
|
100
112
|
href: "#/demofree/list?selected=ignore",
|
|
101
|
-
isShow: this.isManager
|
|
113
|
+
isShow: this.isManager
|
|
102
114
|
}]
|
|
103
115
|
}, {
|
|
104
116
|
icon: "KH-help",
|
|
105
117
|
label: "公海资源",
|
|
106
118
|
key: "customer",
|
|
107
119
|
href: "#/demofree/customer/public",
|
|
108
|
-
isShow:
|
|
120
|
+
isShow: this.roleList.some(function (role) {
|
|
121
|
+
return [ERoleType.SalesOperation, ERoleType.Manager, ERoleType.PublicCustomer].includes(role);
|
|
122
|
+
}),
|
|
109
123
|
children: [{
|
|
110
124
|
icon: "",
|
|
111
125
|
label: "全部客户",
|
|
112
126
|
key: PAGE_ALL_CUSTOMER,
|
|
113
127
|
href: "#/demofree/customer/all",
|
|
114
|
-
isShow: this.
|
|
128
|
+
isShow: this.roleList.some(function (role) {
|
|
129
|
+
return [ERoleType.SalesOperation, ERoleType.Manager].includes(role);
|
|
130
|
+
})
|
|
115
131
|
}, {
|
|
116
132
|
icon: "",
|
|
117
133
|
label: "公海资源",
|
|
118
134
|
key: PAGE_PUBLIC_CUSTOMER,
|
|
119
135
|
href: "#/demofree/customer/public",
|
|
120
|
-
isShow: this.
|
|
136
|
+
isShow: this.roleList.some(function (role) {
|
|
137
|
+
return [ERoleType.SalesOperation, ERoleType.Manager].includes(role);
|
|
138
|
+
})
|
|
139
|
+
}, {
|
|
140
|
+
icon: "",
|
|
141
|
+
label: "限时资源",
|
|
142
|
+
key: PAGE_LIMIT_CUSTOMER,
|
|
143
|
+
href: "#/demofree/customer/limit",
|
|
144
|
+
isShow: this.roleList.some(function (role) {
|
|
145
|
+
return [ERoleType.SalesOperation, ERoleType.Manager, ERoleType.PublicCustomer].includes(role);
|
|
146
|
+
}) && this.showCompeteCustomer
|
|
121
147
|
}, {
|
|
122
148
|
icon: "",
|
|
123
149
|
label: "我的资源",
|
|
124
150
|
key: PAGE_MY_CUSTOMER,
|
|
125
151
|
href: "#/demofree/customer/my",
|
|
126
|
-
isShow: this.
|
|
152
|
+
isShow: this.roleList.some(function (role) {
|
|
153
|
+
return [ERoleType.SalesOperation, ERoleType.Manager, ERoleType.PublicCustomer].includes(role);
|
|
154
|
+
})
|
|
127
155
|
}]
|
|
128
156
|
}, {
|
|
129
|
-
icon: "
|
|
157
|
+
icon: "PF-shezhi",
|
|
130
158
|
label: "客户续费",
|
|
131
159
|
key: "recharge",
|
|
132
160
|
href: "#/demofree/recharge",
|
|
133
|
-
isShow: this.
|
|
161
|
+
isShow: this.roleList.some(function (role) {
|
|
162
|
+
return [ERoleType.CRM, ERoleType.Manager].includes(role);
|
|
163
|
+
}),
|
|
134
164
|
children: [{
|
|
135
165
|
icon: "",
|
|
136
166
|
label: "客户",
|
|
137
167
|
key: PAGE_RECHARGE_LIST,
|
|
138
168
|
href: "#/demofree/recharge/list",
|
|
139
|
-
isShow: this.
|
|
169
|
+
isShow: this.roleList.some(function (role) {
|
|
170
|
+
return [ERoleType.CRM, ERoleType.Manager].includes(role);
|
|
171
|
+
})
|
|
140
172
|
}, {
|
|
141
173
|
icon: "",
|
|
142
174
|
label: "到期订单",
|
|
143
175
|
key: PAGE_DUEDATE_ORDER,
|
|
144
176
|
href: "#/demofree/recharge/order",
|
|
145
|
-
isShow: this.
|
|
177
|
+
isShow: this.roleList.some(function (role) {
|
|
178
|
+
return [ERoleType.CRM, ERoleType.Manager].includes(role);
|
|
179
|
+
})
|
|
180
|
+
}]
|
|
181
|
+
}, {
|
|
182
|
+
icon: "setting",
|
|
183
|
+
label: "人员管理",
|
|
184
|
+
key: "management",
|
|
185
|
+
href: "#/demofree/management",
|
|
186
|
+
isShow: this.isManager,
|
|
187
|
+
children: [{
|
|
188
|
+
icon: "",
|
|
189
|
+
label: "员工列表",
|
|
190
|
+
key: PAGE_STAFF_ROLES_MANAGEMENT,
|
|
191
|
+
href: "#/demofree/management",
|
|
192
|
+
isShow: this.isManager
|
|
146
193
|
}]
|
|
147
194
|
}];
|
|
148
195
|
}
|
|
@@ -13,6 +13,18 @@ var _getLocale = require("../../../../utils/getLocale");
|
|
|
13
13
|
|
|
14
14
|
var _bsGlobal = require("../../../../utils/bs-global");
|
|
15
15
|
|
|
16
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
17
|
+
|
|
18
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
19
|
+
|
|
20
|
+
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); }
|
|
21
|
+
|
|
22
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
23
|
+
|
|
24
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
25
|
+
|
|
26
|
+
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; }
|
|
27
|
+
|
|
16
28
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
17
29
|
|
|
18
30
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
@@ -61,6 +73,7 @@ var summaryMenus = /*#__PURE__*/function () {
|
|
|
61
73
|
_classCallCheck(this, summaryMenus);
|
|
62
74
|
|
|
63
75
|
this.COMPANYALL = _index.COMPANY_ALL_NODE;
|
|
76
|
+
this.USERCONCERN = _index.SUMMARY_USER_CONCERN_NODE;
|
|
64
77
|
this.SHARE = _index.SHARE_NODE;
|
|
65
78
|
this.TONGJI = _index.TONGJI_NODE;
|
|
66
79
|
this.SUBORDINATES = _index.SUBORDINATES_NODE;
|
|
@@ -105,6 +118,13 @@ var summaryMenus = /*#__PURE__*/function () {
|
|
|
105
118
|
children: [],
|
|
106
119
|
href: "#/summary/share",
|
|
107
120
|
isShow: props.isShowShare
|
|
121
|
+
}, {
|
|
122
|
+
icon: "guanzhu",
|
|
123
|
+
label: _i18n.locale.menu_concerned_user,
|
|
124
|
+
key: this.USERCONCERN,
|
|
125
|
+
type: this.USERCONCERN,
|
|
126
|
+
href: "#/summary/all",
|
|
127
|
+
isShow: true
|
|
108
128
|
}, {
|
|
109
129
|
icon: "bumen",
|
|
110
130
|
label: _i18n.locale.menu_department,
|
|
@@ -278,6 +298,108 @@ var summaryMenus = /*#__PURE__*/function () {
|
|
|
278
298
|
|
|
279
299
|
this.menus[3].children = treeNodeUsers;
|
|
280
300
|
}
|
|
301
|
+
}, {
|
|
302
|
+
key: "setConcernLoading",
|
|
303
|
+
value: function setConcernLoading(loading) {
|
|
304
|
+
this.menus[5].children = [];
|
|
305
|
+
|
|
306
|
+
if (loading) {
|
|
307
|
+
this.menus[5].children.push({
|
|
308
|
+
icon: '',
|
|
309
|
+
label: 'loading',
|
|
310
|
+
key: 'loading-concern',
|
|
311
|
+
type: _index.LOADING_NODE,
|
|
312
|
+
href: '',
|
|
313
|
+
data: {}
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}, {
|
|
318
|
+
key: "checkConcernExist",
|
|
319
|
+
value: function checkConcernExist(user) {
|
|
320
|
+
var concerns = this.menus[5].children;
|
|
321
|
+
|
|
322
|
+
for (var i = 0; i < concerns.length; i++) {
|
|
323
|
+
var it = concerns[i];
|
|
324
|
+
|
|
325
|
+
if (it.key == "concern-".concat(user.userId)) {
|
|
326
|
+
return true;
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
return false;
|
|
331
|
+
}
|
|
332
|
+
}, {
|
|
333
|
+
key: "insertConcern",
|
|
334
|
+
value: function insertConcern(users) {
|
|
335
|
+
var treeNodeUsers = []; // 如果没有关注者,显示空
|
|
336
|
+
|
|
337
|
+
this.setEmptyConcerners(false);
|
|
338
|
+
|
|
339
|
+
if (!users || !users.length) {
|
|
340
|
+
this.setEmptyConcerners(true);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
for (var i = 0; i < users.length; i++) {
|
|
344
|
+
var user = users[i];
|
|
345
|
+
if (this.checkConcernExist(user)) continue;
|
|
346
|
+
treeNodeUsers.push({
|
|
347
|
+
icon: '',
|
|
348
|
+
label: user.name,
|
|
349
|
+
key: "concern-".concat(user.userId),
|
|
350
|
+
type: _index.SUMMARY_FOLLOWER_NODE,
|
|
351
|
+
href: '',
|
|
352
|
+
data: user
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
this.menus[5].children = this.menus[5].children.concat(treeNodeUsers);
|
|
357
|
+
}
|
|
358
|
+
}, {
|
|
359
|
+
key: "addConcerner",
|
|
360
|
+
value: function addConcerner(user) {
|
|
361
|
+
if (this.menus[5].children.length && this.menus[5].children[0].key == 'empty-concerners') {
|
|
362
|
+
this.menus[5].children = [];
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
this.menus[5].children.push({
|
|
366
|
+
icon: '',
|
|
367
|
+
label: user.name,
|
|
368
|
+
key: "concern-".concat(user.userId),
|
|
369
|
+
type: _index.SUMMARY_FOLLOWER_NODE,
|
|
370
|
+
href: '',
|
|
371
|
+
data: user
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
}, {
|
|
375
|
+
key: "setEmptyConcerners",
|
|
376
|
+
value: function setEmptyConcerners(empty) {
|
|
377
|
+
this.menus[5].children = [];
|
|
378
|
+
|
|
379
|
+
if (empty) {
|
|
380
|
+
this.menus[5].children.push({
|
|
381
|
+
icon: '',
|
|
382
|
+
label: 'empty-concerners',
|
|
383
|
+
key: 'empty-concerners',
|
|
384
|
+
type: _index.NO_FOLLOWER_NODE,
|
|
385
|
+
href: '',
|
|
386
|
+
data: {}
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
}, {
|
|
391
|
+
key: "removeConcerner",
|
|
392
|
+
value: function removeConcerner(user) {
|
|
393
|
+
var newChildren = _toConsumableArray(this.menus[5].children).filter(function (it) {
|
|
394
|
+
return it.key != "concern-".concat(user.userId);
|
|
395
|
+
});
|
|
396
|
+
|
|
397
|
+
if (!newChildren.length) {
|
|
398
|
+
this.setEmptyConcerners(true);
|
|
399
|
+
} else {
|
|
400
|
+
this.menus[5].children = newChildren;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
281
403
|
}, {
|
|
282
404
|
key: "getMenus",
|
|
283
405
|
value: function getMenus() {
|
|
@@ -25,6 +25,8 @@ var _requestApis = require("../../request-apis");
|
|
|
25
25
|
|
|
26
26
|
var _requestApi = require("./request-api");
|
|
27
27
|
|
|
28
|
+
var _context = require("../../context");
|
|
29
|
+
|
|
28
30
|
var _auth = require("../../../../utils/auth");
|
|
29
31
|
|
|
30
32
|
require("../../index.css");
|
|
@@ -122,7 +124,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
122
124
|
var nodeType = node.nodeType,
|
|
123
125
|
data = node.data;
|
|
124
126
|
|
|
125
|
-
if (nodeType == _index.USER_NODE || nodeType == _index.FOLLOWER_NODE || nodeType == _index.SAME_LEVEL_USER_NODE) {
|
|
127
|
+
if (nodeType == _index.USER_NODE || nodeType == _index.FOLLOWER_NODE || nodeType == _index.SAME_LEVEL_USER_NODE || nodeType == _index.SUMMARY_FOLLOWER_NODE) {
|
|
126
128
|
location.href = "#/summary/manage?toUserId=".concat(data.userId, "&subordinates=1");
|
|
127
129
|
}
|
|
128
130
|
|
|
@@ -196,6 +198,23 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
196
198
|
resolve(true);
|
|
197
199
|
})["catch"](reject);
|
|
198
200
|
});
|
|
201
|
+
}; // 获取关注的人数据列表
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
var getConcerners = function getConcerners() {
|
|
205
|
+
return new Promise(function (resolve, reject) {
|
|
206
|
+
var mdata = summaryMenusData.current; // 初始化 Loading
|
|
207
|
+
|
|
208
|
+
mdata.setConcernLoading(true);
|
|
209
|
+
setMenus(mdata.getMenus());
|
|
210
|
+
resolve(true); // 获取数据
|
|
211
|
+
|
|
212
|
+
(0, _requestApis.getSummaryFollowerList)().then(function (user) {
|
|
213
|
+
mdata.setConcernLoading(false);
|
|
214
|
+
mdata.insertConcern(user);
|
|
215
|
+
setMenus(mdata.getMenus());
|
|
216
|
+
})["catch"](reject);
|
|
217
|
+
});
|
|
199
218
|
};
|
|
200
219
|
|
|
201
220
|
var onLoadTreeNodeDataHandler = function onLoadTreeNodeDataHandler(treeNode) {
|
|
@@ -218,6 +237,12 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
218
237
|
})["catch"](function () {
|
|
219
238
|
return resolve(true);
|
|
220
239
|
});
|
|
240
|
+
} else if (treeNode.key == summaryMenusData.current.USERCONCERN) {
|
|
241
|
+
getConcerners().then(function () {
|
|
242
|
+
return resolve(true);
|
|
243
|
+
})["catch"](function () {
|
|
244
|
+
return resolve(true);
|
|
245
|
+
});
|
|
221
246
|
} else {
|
|
222
247
|
resolve(true);
|
|
223
248
|
}
|
|
@@ -230,6 +255,22 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
230
255
|
setExpandedKeys(expandKeys);
|
|
231
256
|
};
|
|
232
257
|
|
|
258
|
+
var onAddConcerner = function onAddConcerner(user) {
|
|
259
|
+
var mdata = summaryMenusData.current;
|
|
260
|
+
mdata.addConcerner(user.data);
|
|
261
|
+
setMenus(mdata.getMenus());
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
var onRemoveConcerner = function onRemoveConcerner(user) {
|
|
265
|
+
(0, _requestApis.removeSummaryFollower)(user.userId).then(function (res) {
|
|
266
|
+
if (res.Code == 1) {
|
|
267
|
+
var mdata = summaryMenusData.current;
|
|
268
|
+
mdata.removeConcerner(user);
|
|
269
|
+
setMenus(mdata.getMenus());
|
|
270
|
+
}
|
|
271
|
+
});
|
|
272
|
+
};
|
|
273
|
+
|
|
233
274
|
(0, _react.useImperativeHandle)(ref, function () {
|
|
234
275
|
return {
|
|
235
276
|
setSelectedMenuKeys: setSelectedMenuKeys
|
|
@@ -279,7 +320,12 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
279
320
|
obs.unobserve(document.body);
|
|
280
321
|
};
|
|
281
322
|
}, []);
|
|
282
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
323
|
+
return /*#__PURE__*/_react["default"].createElement(_context.SummaryMenusContext.Provider, {
|
|
324
|
+
value: {
|
|
325
|
+
onAddConcerner: onAddConcerner,
|
|
326
|
+
onRemoveConcerner: onRemoveConcerner
|
|
327
|
+
}
|
|
328
|
+
}, /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_scrollbar["default"], {
|
|
283
329
|
style: {
|
|
284
330
|
maxHeight: maxHeight
|
|
285
331
|
}
|
|
@@ -290,7 +336,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
290
336
|
onSelect: onSelectHandler,
|
|
291
337
|
onExpand: onExpandHandler,
|
|
292
338
|
loadData: onLoadTreeNodeDataHandler
|
|
293
|
-
})));
|
|
339
|
+
}))));
|
|
294
340
|
});
|
|
295
341
|
|
|
296
342
|
exports["default"] = _default;
|
|
@@ -0,0 +1,120 @@
|
|
|
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 _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
+
|
|
14
|
+
var _reactRouter = require("react-router");
|
|
15
|
+
|
|
16
|
+
var _flipMenuCard = _interopRequireDefault(require("../../components/flip-menu-card"));
|
|
17
|
+
|
|
18
|
+
var _surveyFrontMenus = _interopRequireDefault(require("./survey-front-menus"));
|
|
19
|
+
|
|
20
|
+
var _context = require("../../context");
|
|
21
|
+
|
|
22
|
+
var _precls = _interopRequireDefault(require("../../precls"));
|
|
23
|
+
|
|
24
|
+
var _getLocale = require("../../../../utils/getLocale");
|
|
25
|
+
|
|
26
|
+
require("../../index.css");
|
|
27
|
+
|
|
28
|
+
require("./index.css");
|
|
29
|
+
|
|
30
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
31
|
+
|
|
32
|
+
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); }
|
|
33
|
+
|
|
34
|
+
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; }
|
|
35
|
+
|
|
36
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
37
|
+
|
|
38
|
+
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."); }
|
|
39
|
+
|
|
40
|
+
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); }
|
|
41
|
+
|
|
42
|
+
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; }
|
|
43
|
+
|
|
44
|
+
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; }
|
|
45
|
+
|
|
46
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
47
|
+
|
|
48
|
+
function SurveyMenus(props) {
|
|
49
|
+
var _props$onSelect = props.onSelect,
|
|
50
|
+
onSelect = _props$onSelect === void 0 ? function () {} : _props$onSelect,
|
|
51
|
+
history = props.history;
|
|
52
|
+
|
|
53
|
+
var _useState = (0, _react.useState)({}),
|
|
54
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
55
|
+
flipOptions = _useState2[0],
|
|
56
|
+
setFlipOptions = _useState2[1];
|
|
57
|
+
|
|
58
|
+
var _useState3 = (0, _react.useState)(""),
|
|
59
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
60
|
+
flipBackType = _useState4[0],
|
|
61
|
+
setFlipBackType = _useState4[1];
|
|
62
|
+
|
|
63
|
+
var surveyFrontMenu = (0, _react.useRef)();
|
|
64
|
+
var menuRef = (0, _react.useRef)();
|
|
65
|
+
var flipRef = (0, _react.useRef)({
|
|
66
|
+
next: function next() {},
|
|
67
|
+
goback: function goback() {}
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
var flipGoNext = function flipGoNext(opt) {
|
|
71
|
+
setFlipBackType(opt.type);
|
|
72
|
+
setFlipOptions(opt.options);
|
|
73
|
+
flipRef.current.next();
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
var collapseMenu = function collapseMenu(isHide) {
|
|
77
|
+
if (isHide) {
|
|
78
|
+
menuRef.current.style.width = "0px";
|
|
79
|
+
} else {
|
|
80
|
+
menuRef.current.style.width = "";
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
var onFlipChangeHandler = function onFlipChangeHandler(isBack) {
|
|
85
|
+
if (!isBack) {
|
|
86
|
+
// 返回,取消菜单的高亮
|
|
87
|
+
surveyFrontMenu.current.setSelectedMenuKeys([]);
|
|
88
|
+
setTimeout(function () {
|
|
89
|
+
return (// 正面时销毁背面
|
|
90
|
+
setFlipBackType("")
|
|
91
|
+
);
|
|
92
|
+
}, 600);
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
return /*#__PURE__*/_react["default"].createElement(_context.FlipContext.Provider, {
|
|
97
|
+
value: {
|
|
98
|
+
flipGoNext: flipGoNext
|
|
99
|
+
}
|
|
100
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
101
|
+
ref: menuRef,
|
|
102
|
+
className: (0, _classnames["default"])("".concat(_precls["default"], "-survey-menus"))
|
|
103
|
+
}, /*#__PURE__*/_react["default"].createElement(_flipMenuCard["default"], {
|
|
104
|
+
ref: flipRef,
|
|
105
|
+
collapseMenu: collapseMenu,
|
|
106
|
+
defaultWidth: _getLocale.isEn ? 210 : 180,
|
|
107
|
+
onChange: onFlipChangeHandler
|
|
108
|
+
}, /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_surveyFrontMenus["default"], {
|
|
109
|
+
ref: surveyFrontMenu,
|
|
110
|
+
onSelect: onSelect,
|
|
111
|
+
history: history
|
|
112
|
+
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
113
|
+
className: (0, _classnames["default"])("tita-bootstrap__scrollbar")
|
|
114
|
+
}))));
|
|
115
|
+
} // @ts-ignore
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
var _default = (0, _reactRouter.withRouter)(SurveyMenus);
|
|
119
|
+
|
|
120
|
+
exports["default"] = _default;
|