@titaui/pc 1.12.22-beta.1 → 1.12.22-beta.2

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.
@@ -78,9 +78,10 @@ function ImportOKRModal(props) {
78
78
  return;
79
79
  }
80
80
 
81
- onOk && onOk(selected);
82
81
  setSelected([]);
82
+ selectedRef.current = [];
83
83
  onCancelHandler();
84
+ onOk && onOk(selected);
84
85
  };
85
86
 
86
87
  var onCancelHandler = function onCancelHandler() {
@@ -11,6 +11,8 @@ var _index = require("../../components/menu-tree/tree-node/index");
11
11
 
12
12
  var _getLocale = require("../../../../utils/getLocale");
13
13
 
14
+ var _bsGlobal = require("../../../../utils/bs-global");
15
+
14
16
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
15
17
 
16
18
  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); } }
@@ -22,82 +24,91 @@ var defaultRefObject = {
22
24
  insertSubordinates: function insertSubordinates() {},
23
25
  getMenus: function getMenus() {},
24
26
  setSubordinatesLoading: function setSubordinatesLoading() {},
25
- SUBORDINATES: ''
27
+ SUBORDINATES: ""
26
28
  };
27
29
  exports.defaultRefObject = defaultRefObject;
28
- var PAGE_SUMMARY_ALl = 'summaryall';
30
+ var PAGE_SUMMARY_ALl = "summaryall";
29
31
  exports.PAGE_SUMMARY_ALl = PAGE_SUMMARY_ALl;
30
- var PAGE_SUMMARY_MY = 'summarymy';
32
+ var PAGE_SUMMARY_MY = "summarymy";
31
33
  exports.PAGE_SUMMARY_MY = PAGE_SUMMARY_MY;
32
- var PAGE_SUMMARY_SUBORDINATE = 'subordinates';
34
+ var PAGE_SUMMARY_SUBORDINATE = "subordinates";
33
35
  exports.PAGE_SUMMARY_SUBORDINATE = PAGE_SUMMARY_SUBORDINATE;
34
- var PAGE_SUMMARY_SHARE = 'share';
36
+ var PAGE_SUMMARY_SHARE = "share";
35
37
  exports.PAGE_SUMMARY_SHARE = PAGE_SUMMARY_SHARE;
36
- var PAGE_SUMMARY_DEPART = 'depart';
38
+ var PAGE_SUMMARY_DEPART = "depart";
37
39
  exports.PAGE_SUMMARY_DEPART = PAGE_SUMMARY_DEPART;
38
- var PAGE_SUMMARY_ROLE = 'role';
40
+ var PAGE_SUMMARY_ROLE = "role";
39
41
  exports.PAGE_SUMMARY_ROLE = PAGE_SUMMARY_ROLE;
40
- var PAGE_SUMMARY_CHART = 'chart';
42
+ var PAGE_SUMMARY_CHART = "chart";
41
43
  exports.PAGE_SUMMARY_CHART = PAGE_SUMMARY_CHART;
42
44
 
45
+ var _getUserInfo = (0, _bsGlobal.getUserInfo)(),
46
+ IsLeader = _getUserInfo.IsLeader,
47
+ IsBoss = _getUserInfo.IsBoss,
48
+ IsRoot = _getUserInfo.IsRoot,
49
+ Role = _getUserInfo.Role,
50
+ IsPlanDailyManager = _getUserInfo.IsPlanDailyManager;
51
+
52
+ var isShowManage = IsPlanDailyManager || IsBoss || IsRoot && Role !== 4 || IsLeader;
53
+
43
54
  var summaryMenus = /*#__PURE__*/function () {
44
55
  function summaryMenus(props) {
45
56
  _classCallCheck(this, summaryMenus);
46
57
 
47
58
  this.COMPANYALL = _index.COMPANY_ALL_NODE;
48
59
  this.SHARE = _index.SHARE_NODE;
49
- this.SUBORDINATES = 'subordinates';
60
+ this.SUBORDINATES = "subordinates";
50
61
  this.menus = [{
51
- icon: 'all-zongjie',
62
+ icon: "all-zongjie",
52
63
  label: _i18n.locale.menu_all_summary,
53
64
  key: PAGE_SUMMARY_ALl,
54
65
  type: _index.MENU_ITEM_NOE,
55
- href: '#/summary/all',
66
+ href: "#/summary/all",
56
67
  isShow: true
57
68
  }, {
58
- icon: 'caidan-my',
69
+ icon: "caidan-my",
59
70
  label: _i18n.locale.menu_my_summary,
60
71
  key: PAGE_SUMMARY_MY,
61
72
  type: _index.MENU_ITEM_NOE,
62
- href: '#/summary/my',
73
+ href: "#/summary/my",
63
74
  isShow: true
64
75
  }, {
65
- icon: 'caidan-xiashu',
76
+ icon: "caidan-xiashu",
66
77
  label: _i18n.locale.menu_my_subordinates,
67
78
  key: this.SUBORDINATES,
68
79
  type: _index.SUBORDINATES_NODE,
69
80
  isLeaf: false,
70
81
  children: [],
71
- href: '#/summary/subordinates',
82
+ href: "#/summary/subordinates",
72
83
  isShow: window.BSGlobal.loginUserInfo.HasSub
73
84
  }, {
74
- icon: 'caidan-enjoy',
85
+ icon: "caidan-enjoy",
75
86
  label: _i18n.locale.menu_my_share,
76
87
  key: PAGE_SUMMARY_SHARE,
77
88
  type: _index.MENU_ITEM_NOE,
78
- href: '#/summary/share',
89
+ href: "#/summary/share",
79
90
  isShow: props.isShowShare
80
91
  }, {
81
- icon: 'bumen',
92
+ icon: "bumen",
82
93
  label: _i18n.locale.menu_department,
83
94
  key: this.COMPANYALL,
84
95
  type: this.COMPANYALL,
85
- href: '',
96
+ href: "",
86
97
  isShow: props.isShowDept
87
98
  }, {
88
- icon: '',
99
+ icon: "",
89
100
  label: _i18n.locale.menu_summary,
90
- key: 'other',
101
+ key: "other",
91
102
  type: _index.GROUP_NAME_NODE,
92
- href: '',
93
- isShow: true
103
+ href: "",
104
+ isShow: isShowManage
94
105
  }, {
95
- icon: 'my-setup',
106
+ icon: "my-setup",
96
107
  label: _i18n.locale.menu_summary_role,
97
108
  key: PAGE_SUMMARY_ROLE,
98
109
  type: _index.MENU_ITEM_NOE,
99
- href: '#/enterprise/manage?reactRouterName=daily',
100
- isShow: true
110
+ href: "#/enterprise/manage?reactRouterName=daily",
111
+ isShow: isShowManage
101
112
  }];
102
113
  }
103
114
 
@@ -108,11 +119,11 @@ var summaryMenus = /*#__PURE__*/function () {
108
119
 
109
120
  if (loading) {
110
121
  this.menus[1].children.push({
111
- icon: '',
112
- label: 'loading',
113
- key: 'loading-subordinates',
122
+ icon: "",
123
+ label: "loading",
124
+ key: "loading-subordinates",
114
125
  type: _index.LOADING_NODE,
115
- href: '',
126
+ href: "",
116
127
  data: {}
117
128
  });
118
129
  }
@@ -122,11 +133,11 @@ var summaryMenus = /*#__PURE__*/function () {
122
133
  value: function insertSubordinates(users) {
123
134
  if (!users || !users.length) {
124
135
  this.menus[2].children = [{
125
- icon: '',
126
- label: 'empty-subordinates',
127
- key: 'empty-subordinates',
136
+ icon: "",
137
+ label: "empty-subordinates",
138
+ key: "empty-subordinates",
128
139
  type: _index.NO_SUBORDINATES_NODE,
129
- href: '',
140
+ href: "",
130
141
  data: {}
131
142
  }];
132
143
  return;
@@ -137,11 +148,11 @@ var summaryMenus = /*#__PURE__*/function () {
137
148
  for (var i = 0; i < users.length; i++) {
138
149
  var user = users[i];
139
150
  treeNodeUsers.push({
140
- icon: '',
151
+ icon: "",
141
152
  label: user.name,
142
153
  key: "".concat(user.userId),
143
154
  type: _index.USER_NODE,
144
- href: '',
155
+ href: "",
145
156
  data: user
146
157
  });
147
158
  }
@@ -63,7 +63,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
63
63
  maxHeight = _useState2[0],
64
64
  setMaxHeight = _useState2[1];
65
65
 
66
- var _useState3 = (0, _react.useState)(['myokr']),
66
+ var _useState3 = (0, _react.useState)(["myokr"]),
67
67
  _useState4 = _slicedToArray(_useState3, 2),
68
68
  expandedKeys = _useState4[0],
69
69
  setExpandedKeys = _useState4[1];
@@ -138,7 +138,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
138
138
  resolve(true); // 获取数据
139
139
 
140
140
  (0, _requestApis.getSubordinates)({
141
- relationIds: '1,2'
141
+ relationIds: "1,2"
142
142
  }, {
143
143
  disabledDottedSubordinatesDig: true
144
144
  }).then(function (users) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@titaui/pc",
3
- "version": "1.12.22-beta.1",
3
+ "version": "1.12.22-beta.2",
4
4
  "nameCN": "",
5
5
  "description": "",
6
6
  "main": "lib/index.js",