@titaui/pc 1.11.5-beta.4 → 1.11.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/.husky/pre-commit +2 -2
  2. package/lib/components/button/rect-btn/index.css +11 -25
  3. package/lib/components/button/rect-btn/index.js +4 -8
  4. package/lib/components/create-okr-modal/request-api.js +1 -1
  5. package/lib/components/drawer/index.js +8 -25
  6. package/lib/components/nav-top/index.js +2 -6
  7. package/lib/components/okr-detail/detail-header/actions.js +40 -44
  8. package/lib/components/okr-detail/detail-header/index.css +2 -2
  9. package/lib/components/okr-detail/detail-header/index.js +205 -194
  10. package/lib/components/okr-detail/index.js +2 -0
  11. package/lib/components/okr-flow/child-node/index.css +10 -46
  12. package/lib/components/okr-flow/child-node/work-node.js +3 -19
  13. package/lib/components/okr-flow/export-modal/index.js +2 -26
  14. package/lib/components/okr-flow/export-modules/okr-search-panel/index.js +9 -14
  15. package/lib/components/okr-flow/okr-map/index.js +14 -32
  16. package/lib/components/okr-flow/request-apis.js +4 -11
  17. package/lib/components/okr-flow/utils/index.js +28 -68
  18. package/lib/components/okr-flow/utils/tree-handler.js +1 -9
  19. package/lib/components/survey-model/contact.js +93 -0
  20. package/lib/components/survey-model/index.css +141 -0
  21. package/lib/components/survey-model/index.js +264 -0
  22. package/lib/components/survey-model/instance.js +86 -0
  23. package/lib/components/survey-model/request-api.js +80 -0
  24. package/lib/components/wechat-btn/index.css +14 -0
  25. package/lib/components/wechat-btn/index.js +333 -0
  26. package/lib/index.js +91 -115
  27. package/lib/pages/new-okr-list/header/index.css +0 -45
  28. package/lib/pages/new-okr-list/header/index.js +16 -28
  29. package/lib/pages/new-okr-list/index.js +1 -3
  30. package/lib/pages/okr-map/export-modules/okr-map/header/index.css +1 -1
  31. package/lib/pages/okr-map/export-modules/okr-map/header/index.js +4 -29
  32. package/lib/pages/okr-map/export-modules/okr-map/okr-map.js +17 -27
  33. package/lib/pages/okr-map/number-select/index.css +1 -0
  34. package/lib/utils/auth.js +60 -3
  35. package/lib/utils/bs-global.js +14 -2
  36. package/lib/utils/format-time.js +1 -8
  37. package/lib/utils/open-data.js +1 -5
  38. package/package.json +1 -1
  39. package/lib/components/textarea/index.css +0 -120
  40. package/lib/components/textarea/index.js +0 -257
  41. package/lib/pages/new-okr-list/header/common.js +0 -52
  42. package/lib/pages/new-okr-list/header/operate-record.js +0 -88
package/.husky/pre-commit CHANGED
@@ -1,4 +1,4 @@
1
1
  #!/bin/sh
2
2
  . "$(dirname "$0")/_/husky.sh"
3
-
4
- npm run lint-staged
3
+ #
4
+ npm run lint-staged
@@ -13,7 +13,7 @@
13
13
  align-items: center;
14
14
  justify-content: center;
15
15
  min-width: 64px;
16
- font-size: 14px;
16
+ font-size: 13px;
17
17
  padding: 0 12px;
18
18
  }
19
19
 
@@ -60,35 +60,21 @@
60
60
  background: #5c8eff;
61
61
  }
62
62
 
63
- .titaui-rect-btn--secondary {
64
- font-size: 14px;
65
- font-weight: normal;
66
- color: #2879ff;
67
- line-height: 28px;
68
- background: rgba(40, 121, 255, 0.2);
69
- margin-right: 16px;
70
- }
71
-
72
- .titaui-rect-btn--secondary:hover {
73
- color: #fff;
74
- background-color: #2879ff;
75
- }
76
-
77
63
  .titaui-rect-btn--cancel {
78
- color: #6f7886;
79
- border: 1px solid #dfe3ea;
80
- background: #ffffff;
64
+ color: #6F7886;
65
+ border: 1px solid #DFE3EA;
66
+ background: #FFFFFF;
81
67
  }
82
68
 
83
69
  .titaui-rect-btn--cancel:hover {
84
- color: #2879ff;
85
- border: 1px solid #2879ff;
70
+ color: #2879FF;
71
+ border: 1px solid #2879FF;
86
72
  }
87
73
 
88
74
  .titaui-rect-btn--delete {
89
- background: #ffffff;
90
- color: #f05e5e;
91
- border: 1px solid #f05e5e;
75
+ background: #FFFFFF;
76
+ color: #F05E5E;
77
+ border: 1px solid #F05E5E;
92
78
  }
93
79
 
94
80
  .titaui-rect-btn--delete:hover {
@@ -107,10 +93,10 @@
107
93
  }
108
94
 
109
95
  .titaui-rect-btn--primary.titaui-rect-btn--disabled {
110
- background: #93bcff;
96
+ background: #93BCFF;
111
97
  opacity: 1;
112
98
  }
113
99
 
114
100
  .titaui-rect-btn--primary.titaui-rect-btn--disabled:hover {
115
- background: #93bcff;
101
+ background: #93BCFF;
116
102
  }
@@ -34,8 +34,7 @@ function RectBtn(props) {
34
34
  className = _props$className === void 0 ? "" : _props$className,
35
35
  _props$disabled = props.disabled,
36
36
  disabled = _props$disabled === void 0 ? false : _props$disabled,
37
- style = props.style,
38
- children = props.children;
37
+ style = props.style;
39
38
 
40
39
  var renderIcon = function renderIcon() {
41
40
  if (typeof icon === "string") {
@@ -51,19 +50,16 @@ function RectBtn(props) {
51
50
  }, icon);
52
51
  };
53
52
 
54
- var onClickHandler = function onClickHandler(e) {
53
+ var onClickHandler = function onClickHandler() {
55
54
  if (disabled) return;
56
-
57
- if (onClick) {
58
- onClick(e);
59
- }
55
+ onClick && onClick();
60
56
  };
61
57
 
62
58
  return /*#__PURE__*/_react["default"].createElement("span", {
63
59
  className: (0, _classnames["default"])(precls, "".concat(precls, "--").concat(type), "".concat(precls, "--").concat(size), _defineProperty({}, "".concat(precls, "--disabled"), disabled), className),
64
60
  style: style,
65
61
  onClick: onClickHandler
66
- }, icon && renderIcon(), children || text);
62
+ }, icon && renderIcon(), props.children || text);
67
63
  }
68
64
 
69
65
  var _default = RectBtn;
@@ -46,7 +46,7 @@ var createWidthKr = /*#__PURE__*/function () {
46
46
  while (1) {
47
47
  switch (_context.prev = _context.next) {
48
48
  case 0:
49
- url = "".concat(requestDomain(), "/api/v1/").concat(tenantId, "/").concat(userId, "/okr/createWithKr");
49
+ url = "".concat(requestDomain(), "/api/v2/").concat(tenantId, "/").concat(userId, "/work/createWithKr");
50
50
  _context.next = 3;
51
51
  return _axios["default"].post(url, _objectSpread({
52
52
  workType: 6
@@ -25,9 +25,7 @@ require("./index.css");
25
25
 
26
26
  var _context = _interopRequireDefault(require("../drawer-manager/context"));
27
27
 
28
- var _dom = require("./utils/dom");
29
-
30
- var _excluded = ["visible", "placement", "children", "mask", "width", "className", "contentWrapperStyle", "onClose", "style", "afterVisibleChange", "destroyOnClose", "bodyStyle", "zIndex", "autoClosable"];
28
+ var _excluded = ["visible", "placement", "children", "mask", "width", "className", "contentWrapperStyle", "onClose", "style", "afterVisibleChange", "destroyOnClose", "bodyStyle", "zIndex"];
31
29
 
32
30
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
33
31
 
@@ -56,7 +54,7 @@ var Drawer = function Drawer(props) {
56
54
 
57
55
  var visible = props.visible,
58
56
  _props$placement = props.placement,
59
- placement = _props$placement === void 0 ? 'right' : _props$placement,
57
+ placement = _props$placement === void 0 ? "right" : _props$placement,
60
58
  children = props.children,
61
59
  _props$mask = props.mask,
62
60
  mask = _props$mask === void 0 ? false : _props$mask,
@@ -72,8 +70,6 @@ var Drawer = function Drawer(props) {
72
70
  bodyStyle = props.bodyStyle,
73
71
  _props$zIndex = props.zIndex,
74
72
  zIndex = _props$zIndex === void 0 ? 1200 : _props$zIndex,
75
- _props$autoClosable = props.autoClosable,
76
- autoClosable = _props$autoClosable === void 0 ? false : _props$autoClosable,
77
73
  rest = _objectWithoutProperties(props, _excluded);
78
74
 
79
75
  var handleAfterVisibleChange = (0, _react.useCallback)(function (opened) {
@@ -93,20 +89,6 @@ var Drawer = function Drawer(props) {
93
89
  return children;
94
90
  }
95
91
 
96
- var autoClose = function autoClose(e) {
97
- if ((0, _dom.hasAncestorElement)(e.target, 'document-mouse-event-ignore,rc-tooltip,titaui-popup,rc-dialog-root,common-modal,in-modal,task-hot-add')) return;
98
- onClose();
99
- };
100
-
101
- (0, _react.useEffect)(function () {
102
- if (autoClosable) {
103
- document.addEventListener('mousedown', autoClose);
104
- }
105
-
106
- return function () {
107
- document.removeEventListener('mousedown', autoClose);
108
- };
109
- }, []);
110
92
  return /*#__PURE__*/_react["default"].createElement(DrawerContext.Provider, {
111
93
  value: {
112
94
  close: function close() {
@@ -114,7 +96,7 @@ var Drawer = function Drawer(props) {
114
96
  }
115
97
  }
116
98
  }, /*#__PURE__*/_react["default"].createElement(_rcDrawer["default"], _extends({
117
- className: (0, _classnames["default"])('titaui-drawer', 'document-mouse-event-ignore', className),
99
+ className: (0, _classnames["default"])("titaui-drawer", "document-mouse-event-ignore", className),
118
100
  style: _objectSpread(_objectSpread({}, style), {}, {
119
101
  zIndex: zIndex
120
102
  })
@@ -140,7 +122,8 @@ function DrawerHeader(_ref) {
140
122
  actionMaxCount = _ref$actionMaxCount === void 0 ? 4 : _ref$actionMaxCount,
141
123
  content = _ref.content,
142
124
  style = _ref.style,
143
- onClose = _ref.onClose;
125
+ onClose = _ref.onClose,
126
+ actionComponent = _ref.actionComponent;
144
127
  var drawer = (0, _react.useContext)(DrawerContext);
145
128
  var manager = (0, _react.useContext)(_context["default"]);
146
129
  var showClose = closable && (!!onClose || !!drawer);
@@ -163,16 +146,16 @@ function DrawerHeader(_ref) {
163
146
  onClick: manager && manager.goBack
164
147
  }, /*#__PURE__*/_react["default"].createElement("i", {
165
148
  className: "tu-icon-fanhui"
166
- }), (0, _getLocale.getLocale)('Mod_Back')), showBackBtn && hasContent && /*#__PURE__*/_react["default"].createElement("div", {
149
+ }), (0, _getLocale.getLocale)("Mod_Back")), showBackBtn && hasContent && /*#__PURE__*/_react["default"].createElement("div", {
167
150
  className: "titaui-drawer-header-divider"
168
151
  }), hasContent && content, /*#__PURE__*/_react["default"].createElement("div", {
169
152
  style: {
170
153
  flex: 1
171
154
  }
172
- }), displayActions.map(function (action) {
155
+ }), /*#__PURE__*/_react["default"].createElement("div", null, actionComponent), displayActions.map(function (action) {
173
156
  return /*#__PURE__*/_react["default"].createElement(_headerAction["default"], action);
174
157
  }), !!collapsedActions.length && /*#__PURE__*/_react["default"].createElement(_headerAction["default"], {
175
- title: (0, _getLocale.getLocale)('Mod_MoreOperate'),
158
+ title: (0, _getLocale.getLocale)("Mod_MoreOperate"),
176
159
  icon: "tu-icon-10",
177
160
  children: collapsedActions
178
161
  }), showClose && /*#__PURE__*/_react["default"].createElement("div", {
@@ -15,8 +15,6 @@ var _bsGlobal = require("../../utils/bs-global");
15
15
 
16
16
  var _userOwnMenu = _interopRequireDefault(require("./components/user-own-menu"));
17
17
 
18
- var _useGlobalValue = _interopRequireDefault(require("./useGlobalValue"));
19
-
20
18
  var _menu = _interopRequireDefault(require("./components/menu"));
21
19
 
22
20
  var _userMessage = _interopRequireDefault(require("./components/user-message"));
@@ -172,7 +170,5 @@ var NavTop = function NavTop() {
172
170
  }, /*#__PURE__*/_react["default"].createElement(_userOwnMenu["default"], null)));
173
171
  };
174
172
 
175
- var _default = NavTop; // @ts-ignore
176
-
177
- exports["default"] = _default;
178
- NavTop.useGlobalValue = _useGlobalValue["default"];
173
+ var _default = NavTop;
174
+ exports["default"] = _default;
@@ -5,8 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.getOkrHeadActions = getOkrHeadActions;
7
7
 
8
- var _dayjs = _interopRequireDefault(require("dayjs"));
9
-
10
8
  var _bsGlobal = require("../../../utils/bs-global");
11
9
 
12
10
  var _auth = require("../../../utils/auth");
@@ -15,36 +13,12 @@ var _enums = require("./enums");
15
13
 
16
14
  var _getLocale = require("../../../utils/getLocale");
17
15
 
18
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
19
-
20
16
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
21
17
 
22
18
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
23
19
 
24
20
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
25
21
 
26
- function getOkrHeadActions(data) {
27
- var actions = [];
28
- var auth = new _auth.OAuth({
29
- principalUser: data.principalUser,
30
- createUserId: data.detailInfo.createUserId
31
- });
32
-
33
- var dataWithAuth = _objectSpread(_objectSpread({}, data), {}, {
34
- auth: auth
35
- });
36
-
37
- addShareButton(dataWithAuth, actions);
38
- addVisibilityButton(dataWithAuth, actions);
39
- addFollowButton(dataWithAuth, actions);
40
- addExitButton(dataWithAuth, actions);
41
- addFinishOrReopenButton(dataWithAuth, actions);
42
- addCopyButton(dataWithAuth, actions);
43
- addDeleteButton(dataWithAuth, actions); // addDetailButton(dataWithAuth,actions)
44
-
45
- return actions;
46
- }
47
-
48
22
  var addShareButton = function addShareButton(_ref, actions) {
49
23
  var openShareModal = _ref.openShareModal;
50
24
  actions.push({
@@ -81,10 +55,10 @@ var addVisibilityButton = function addVisibilityButton(_ref2, actions) {
81
55
  }
82
56
  }];
83
57
 
84
- var editable = auth.hasAuth() && detailInfo.status == _enums.OkrStatus.inProgress;
58
+ var editable = auth.hasAuth() && detailInfo.status === _enums.OkrStatus.inProgress;
85
59
 
86
60
  actions.push({
87
- icon: visibility != 1 ? "tu-icon-simi-icon" : "tu-icon-gongkai",
61
+ icon: visibility !== 1 ? "tu-icon-simi-icon" : "tu-icon-gongkai",
88
62
  title: children[visibility - 1].title + (0, _getLocale.getLocale)("OKR_MyO_Text_Visible"),
89
63
  children: editable ? children : null
90
64
  });
@@ -92,7 +66,6 @@ var addVisibilityButton = function addVisibilityButton(_ref2, actions) {
92
66
 
93
67
  var addFollowButton = function addFollowButton(_ref3, actions) {
94
68
  var roleType = _ref3.roleType,
95
- detailInfo = _ref3.detailInfo,
96
69
  onChangeOkrFollow = _ref3.onChangeOkrFollow;
97
70
 
98
71
  // 未开启关注目标功能
@@ -101,12 +74,12 @@ var addFollowButton = function addFollowButton(_ref3, actions) {
101
74
  } // 是负责人或是内部成员不能关注目标
102
75
 
103
76
 
104
- if (roleType == _enums.OkrRole.principal || roleType == _enums.OkrRole.member) {
77
+ if (roleType === _enums.OkrRole.principal || roleType === _enums.OkrRole.member) {
105
78
  return;
106
79
  } // 已关注目标
107
80
 
108
81
 
109
- if (roleType == _enums.OkrRole.follower) {
82
+ if (roleType === _enums.OkrRole.follower) {
110
83
  actions.push({
111
84
  icon: "okr-drawer-header-followed",
112
85
  title: (0, _getLocale.getLocale)("OKR_MyO_Butt_Unfollow"),
@@ -131,7 +104,7 @@ var addExitButton = function addExitButton(_ref4, actions) {
131
104
  var roleType = _ref4.roleType,
132
105
  onQuit = _ref4.onQuit;
133
106
 
134
- if (roleType == _enums.OkrRole.member) {
107
+ if (roleType === _enums.OkrRole.member) {
135
108
  actions.push({
136
109
  icon: "tu-icon-tuichu",
137
110
  title: (0, _getLocale.getLocale)("Pro_Admin_pop_Withdraw"),
@@ -146,7 +119,7 @@ var addFinishOrReopenButton = function addFinishOrReopenButton(_ref5, actions) {
146
119
  onFinishOrReOpen = _ref5.onFinishOrReOpen;
147
120
  if (!auth.hasAuth()) return;
148
121
 
149
- if (detailInfo.status == _enums.OkrStatus.inProgress) {
122
+ if (detailInfo.status === _enums.OkrStatus.inProgress) {
150
123
  actions.push({
151
124
  icon: "tu-icon-liebiao-jieshu",
152
125
  title: (0, _getLocale.getLocale)("OKR_MyO_EndObjective"),
@@ -185,16 +158,39 @@ var addDeleteButton = function addDeleteButton(_ref7, actions) {
185
158
  title: (0, _getLocale.getLocale)("OKR_MyO_Butt_DeleteO"),
186
159
  onClick: onDeleteOkr
187
160
  });
188
- };
161
+ }; // const addDetailButton: ActionDealFunction = ({ detailInfo }, actions) => {
162
+ // const registerDate = window.BSGlobal.tenantAuthentication.StartDate;
163
+ // dayjs(registerDate).year() < 2021
164
+ // && actions.push({
165
+ // icon: "tu-icon-xiangqing1",
166
+ // title: "目标详情",
167
+ // onClick: () => {
168
+ // window.open(
169
+ // `${location.pathname}#okr/manage?work_id=${detailInfo.workId}`,
170
+ // );
171
+ // },
172
+ // });
173
+ // };
189
174
 
190
- var addDetailButton = function addDetailButton(_ref8, actions) {
191
- var detailInfo = _ref8.detailInfo;
192
- var registerDate = window.BSGlobal.tenantAuthentication.StartDate;
193
- (0, _dayjs["default"])(registerDate).year() < 2021 && actions.push({
194
- icon: "tu-icon-xiangqing1",
195
- title: "目标详情",
196
- onClick: function onClick() {
197
- window.open("".concat(location.pathname, "#okr/manage?work_id=").concat(detailInfo.workId));
198
- }
175
+
176
+ function getOkrHeadActions(data) {
177
+ var actions = [];
178
+ var auth = new _auth.OAuth({
179
+ principalUser: data.principalUser,
180
+ createUserId: data.detailInfo.createUserId
199
181
  });
200
- };
182
+
183
+ var dataWithAuth = _objectSpread(_objectSpread({}, data), {}, {
184
+ auth: auth
185
+ });
186
+
187
+ addShareButton(dataWithAuth, actions);
188
+ addVisibilityButton(dataWithAuth, actions);
189
+ addFollowButton(dataWithAuth, actions);
190
+ addExitButton(dataWithAuth, actions);
191
+ addFinishOrReopenButton(dataWithAuth, actions);
192
+ addCopyButton(dataWithAuth, actions);
193
+ addDeleteButton(dataWithAuth, actions); // addDetailButton(dataWithAuth,actions)
194
+
195
+ return actions;
196
+ }
@@ -5,7 +5,7 @@
5
5
  .okr-detail-head-parent {
6
6
  display: flex;
7
7
  align-items: center;
8
- color: #89919F;
8
+ color: #89919f;
9
9
  }
10
10
 
11
11
  .okr-detail-head-parent .tu-icon-liebiao-duiqinubiao {
@@ -23,5 +23,5 @@
23
23
  }
24
24
 
25
25
  .okr-detail-head-parent > span:hover {
26
- color: #2879FF;
26
+ color: #2879ff;
27
27
  }