@titaui/pc 1.9.65 → 1.9.69
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/form/form-fields/input/index.js +13 -3
- package/lib/components/hr-header/index.css +3 -2
- package/lib/components/hr-header/index.js +1 -1
- package/lib/components/okr-detail/base-info/base-info.css +3 -3
- package/lib/components/okr-detail/base-info/other-infos/visibility/index.js +78 -48
- package/lib/components/part-notice/index.css +40 -0
- package/lib/components/part-notice/index.js +90 -0
- package/lib/components-v1/userSelector/components/MultiMode/index.js +19 -16
- package/lib/index.js +8 -2
- package/lib/pages/aha2021/index.js +1 -1
- package/lib/utils/open-data.js +4 -5
- package/package.json +3 -2
- package/src/components/hr-header/index.scss +1 -1
- package/src/components/hr-header/index.tsx +2 -2
- package/src/components/part-notice/index.scss +37 -0
- package/src/components/part-notice/index.tsx +50 -0
- package/src/index.js +1 -1
|
@@ -15,12 +15,16 @@ var _errorTip = _interopRequireDefault(require("../../../tooltip/error-tip"));
|
|
|
15
15
|
|
|
16
16
|
require("./index.css");
|
|
17
17
|
|
|
18
|
+
var _excluded = ["label", "verifies", "placeholder", "onChange", "require", "type", "tips", "name", "disabled", "getContainer", "layout", "onCheckSuccess", "className", "tail"];
|
|
19
|
+
|
|
18
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
21
|
|
|
20
22
|
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); }
|
|
21
23
|
|
|
22
24
|
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; }
|
|
23
25
|
|
|
26
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
27
|
+
|
|
24
28
|
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
29
|
|
|
26
30
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
@@ -35,6 +39,10 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
35
39
|
|
|
36
40
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
37
41
|
|
|
42
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
43
|
+
|
|
44
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
45
|
+
|
|
38
46
|
var preCls = "form-field-input";
|
|
39
47
|
|
|
40
48
|
function OverlayInner(_ref) {
|
|
@@ -72,7 +80,9 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
72
80
|
onCheckSuccess = props.onCheckSuccess,
|
|
73
81
|
_props$className = props.className,
|
|
74
82
|
className = _props$className === void 0 ? "" : _props$className,
|
|
75
|
-
tail = props.tail
|
|
83
|
+
tail = props.tail,
|
|
84
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
85
|
+
|
|
76
86
|
var inputRef = (0, _react.useRef)();
|
|
77
87
|
|
|
78
88
|
var _useState = (0, _react.useState)(false),
|
|
@@ -206,7 +216,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
206
216
|
activeTips: tips
|
|
207
217
|
}),
|
|
208
218
|
getTooltipContainer: getContainer
|
|
209
|
-
}, /*#__PURE__*/_react["default"].createElement("input", {
|
|
219
|
+
}, /*#__PURE__*/_react["default"].createElement("input", _extends({
|
|
210
220
|
ref: inputRef,
|
|
211
221
|
type: type,
|
|
212
222
|
disabled: disabled,
|
|
@@ -217,7 +227,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
217
227
|
onBlur: onBlurHandler,
|
|
218
228
|
onChange: onChangeHandler,
|
|
219
229
|
autoComplete: "off"
|
|
220
|
-
})), typeof tail === "string" ? /*#__PURE__*/_react["default"].createElement("span", {
|
|
230
|
+
}, restProps))), typeof tail === "string" ? /*#__PURE__*/_react["default"].createElement("span", {
|
|
221
231
|
className: (0, _classnames["default"])("".concat(preCls, "__tail"))
|
|
222
232
|
}, tail) : tail));
|
|
223
233
|
});
|
|
@@ -30,14 +30,15 @@
|
|
|
30
30
|
justify-content: center;
|
|
31
31
|
margin: 0 5px;
|
|
32
32
|
position: relative;
|
|
33
|
+
color: #ffffff;
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
.tencent-hr-header__item > a {
|
|
36
|
-
color: #
|
|
37
|
+
color: #ffffff !important;
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
.tencent-hr-header__item--active::after {
|
|
40
|
-
content:
|
|
41
|
+
content: '';
|
|
41
42
|
position: absolute;
|
|
42
43
|
top: 50%;
|
|
43
44
|
left: 50%;
|
|
@@ -73,7 +73,7 @@ function HrHeader() {
|
|
|
73
73
|
className: preCls
|
|
74
74
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
75
75
|
className: "".concat(preCls, "__title")
|
|
76
|
-
},
|
|
76
|
+
}, (0, _helpers.getTenantInfo)().Name), /*#__PURE__*/_react["default"].createElement("div", {
|
|
77
77
|
className: "".concat(preCls, "__menu-list")
|
|
78
78
|
}, menus.slice(0, 5).map(function (menu) {
|
|
79
79
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
.base-info__divider {
|
|
2
2
|
height: 8px;
|
|
3
|
-
background: #
|
|
3
|
+
background: #f0f2f5;
|
|
4
4
|
margin: 0 32px;
|
|
5
5
|
}
|
|
6
6
|
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
.base-info__participant-followers-wrapper .base-info__person-block {
|
|
13
13
|
font-size: 14px;
|
|
14
14
|
font-weight: 600;
|
|
15
|
-
color: #
|
|
15
|
+
color: #141c28;
|
|
16
16
|
line-height: 22px;
|
|
17
17
|
font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-serif, PingFang SC, Microsoft YaHei;
|
|
18
18
|
padding-left: 10px;
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
.base-info__participant-followers-wrapper .base-info__person-block .base-info__person-block-title {
|
|
26
26
|
font-size: 14px;
|
|
27
27
|
font-weight: 600;
|
|
28
|
-
color: #
|
|
28
|
+
color: #141c28;
|
|
29
29
|
line-height: 22px;
|
|
30
30
|
margin-bottom: 8px;
|
|
31
31
|
display: block;
|
|
@@ -39,24 +39,29 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
39
39
|
|
|
40
40
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
41
41
|
|
|
42
|
-
var
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
42
|
+
var getVisibilityList = function getVisibilityList() {
|
|
43
|
+
return [{
|
|
44
|
+
value: 1,
|
|
45
|
+
label: (0, _getLocale.getLocale)("OKR_MyO_Pop_Public")
|
|
46
|
+
}, {
|
|
47
|
+
value: 2,
|
|
48
|
+
label: (0, _getLocale.getLocale)("OKR_MyO_From_Associatedmem")
|
|
49
|
+
}, {
|
|
50
|
+
value: 3,
|
|
51
|
+
label: (0, _getLocale.getLocale)("OKR_MyO_Pop_Directrep")
|
|
52
|
+
}, {
|
|
53
|
+
value: 4,
|
|
54
|
+
label: (0, _getLocale.getLocale)("OKR_MyO_Pop_Specified")
|
|
55
|
+
}];
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
var getVisibilityMapText = function getVisibilityMapText() {
|
|
59
|
+
return {
|
|
60
|
+
1: (0, _getLocale.getLocale)("OKR_MyO_Pop_Public"),
|
|
61
|
+
2: (0, _getLocale.getLocale)("OKR_MyO_From_Associatedmem"),
|
|
62
|
+
3: (0, _getLocale.getLocale)("OKR_MyO_Pop_Directrep"),
|
|
63
|
+
4: (0, _getLocale.getLocale)("OKR_MyO_Pop_Specified")
|
|
64
|
+
};
|
|
60
65
|
};
|
|
61
66
|
|
|
62
67
|
var Visibility = function Visibility(_ref) {
|
|
@@ -80,55 +85,77 @@ var Visibility = function Visibility(_ref) {
|
|
|
80
85
|
users = selectNodes.users;
|
|
81
86
|
|
|
82
87
|
if (departments.length === 0 && groups.length === 0 && users.length === 0) {
|
|
83
|
-
setVisibilityState(oldSelect.current);
|
|
88
|
+
setVisibilityState(oldSelect.current);
|
|
89
|
+
|
|
90
|
+
if (selectorRef.current) {
|
|
91
|
+
// @ts-ignore
|
|
92
|
+
selectorRef.current.close();
|
|
93
|
+
}
|
|
84
94
|
|
|
85
|
-
selectorRef.current && selectorRef.current.close();
|
|
86
95
|
return;
|
|
87
96
|
}
|
|
88
97
|
|
|
89
|
-
|
|
98
|
+
if (onChangeVisiableLimit) {
|
|
99
|
+
onChangeVisiableLimit(4, selectNodes);
|
|
100
|
+
}
|
|
90
101
|
|
|
91
|
-
|
|
102
|
+
if (selectorRef.current) {
|
|
103
|
+
// @ts-ignore
|
|
104
|
+
selectorRef.current.close();
|
|
105
|
+
}
|
|
92
106
|
}, [onChangeVisiableLimit]);
|
|
93
107
|
var handleChangeVisibility = (0, _react.useCallback)(function (data) {
|
|
94
108
|
setVisibilityState(data.value);
|
|
95
109
|
|
|
96
110
|
if (data.value === 4) {
|
|
97
|
-
|
|
98
|
-
|
|
111
|
+
if (selectorRef.current) {
|
|
112
|
+
// @ts-ignore
|
|
113
|
+
selectorRef.current.open();
|
|
114
|
+
}
|
|
99
115
|
} else {
|
|
100
116
|
oldSelect.current = data.value;
|
|
101
|
-
|
|
117
|
+
|
|
118
|
+
if (onChangeVisiableLimit) {
|
|
119
|
+
onChangeVisiableLimit(data.value);
|
|
120
|
+
}
|
|
102
121
|
}
|
|
103
122
|
}, [onChangeVisiableLimit]);
|
|
104
123
|
var renderText = (0, _react.useMemo)(function () {
|
|
105
124
|
var result = [];
|
|
106
125
|
|
|
107
126
|
if (visiableLimit) {
|
|
108
|
-
visiableLimit.users && visiableLimit.users.length > 0
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
127
|
+
if (visiableLimit.users && visiableLimit.users.length > 0) {
|
|
128
|
+
visiableLimit.users.forEach(function (item, index) {
|
|
129
|
+
if (index !== 0) {
|
|
130
|
+
result.push("、");
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
result.push( /*#__PURE__*/_react["default"].createElement(_openData.OpenUserName, {
|
|
134
|
+
name: item.name,
|
|
135
|
+
id: item.userId
|
|
136
|
+
}));
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
if (visiableLimit.departments && visiableLimit.departments.length > 0) {
|
|
141
|
+
visiableLimit.departments.forEach(function (item, index) {
|
|
142
|
+
result.push(index === 0 && result.length === 0 ? "" : "、");
|
|
143
|
+
result.push( /*#__PURE__*/_react["default"].createElement(_openData.OpenDepartmentName, {
|
|
144
|
+
name: item.name,
|
|
145
|
+
id: item.id
|
|
146
|
+
}));
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
if (visiableLimit.groups && visiableLimit.groups.length > 0) {
|
|
151
|
+
visiableLimit.groups.forEach(function (item, index) {
|
|
152
|
+
result.push(index === 0 && result.length === 0 ? "" : "、");
|
|
153
|
+
result.push(item.name);
|
|
154
|
+
});
|
|
155
|
+
}
|
|
129
156
|
}
|
|
130
157
|
|
|
131
|
-
return result.length > 0 ? result :
|
|
158
|
+
return result.length > 0 ? result : getVisibilityMapText()[visibilityState];
|
|
132
159
|
}, [visiableLimit, visibilityState]);
|
|
133
160
|
(0, _react.useEffect)(function () {
|
|
134
161
|
setVisibilityState(visibility);
|
|
@@ -158,7 +185,7 @@ var Visibility = function Visibility(_ref) {
|
|
|
158
185
|
textClass: "base-info-other-infos__visibility-select-text",
|
|
159
186
|
forceRenderText: visibility === 4,
|
|
160
187
|
initText: renderText,
|
|
161
|
-
items:
|
|
188
|
+
items: getVisibilityList(),
|
|
162
189
|
initValue: visibilityState,
|
|
163
190
|
onChangeSelect: handleChangeVisibility
|
|
164
191
|
}), canEdit ? /*#__PURE__*/_react["default"].createElement(_index["default"], {
|
|
@@ -172,5 +199,8 @@ var Visibility = function Visibility(_ref) {
|
|
|
172
199
|
}) : null);
|
|
173
200
|
};
|
|
174
201
|
|
|
202
|
+
Visibility.defaultProps = {
|
|
203
|
+
canEdit: false
|
|
204
|
+
};
|
|
175
205
|
var _default = Visibility;
|
|
176
206
|
exports["default"] = _default;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
.part-notice {
|
|
2
|
+
margin-left: 16px;
|
|
3
|
+
height: 36px;
|
|
4
|
+
background: #fcedd4;
|
|
5
|
+
display: flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
font-size: 12px;
|
|
8
|
+
font-weight: 400;
|
|
9
|
+
color: #3f4755;
|
|
10
|
+
line-height: 18px;
|
|
11
|
+
position: relative;
|
|
12
|
+
padding: 0 12px;
|
|
13
|
+
margin-bottom: 10px;
|
|
14
|
+
margin-top: 16px;
|
|
15
|
+
border-radius: 12px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.part-notice > .tu-icon-tishi {
|
|
19
|
+
color: #f0a326;
|
|
20
|
+
margin-right: 8px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.part-notice__link {
|
|
24
|
+
color: #f6bd16;
|
|
25
|
+
cursor: pointer;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.part-notice__close {
|
|
29
|
+
color: #f6bd16;
|
|
30
|
+
cursor: pointer;
|
|
31
|
+
font-size: 16px;
|
|
32
|
+
position: absolute;
|
|
33
|
+
right: 12px;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.part-notice__image {
|
|
37
|
+
width: 16px;
|
|
38
|
+
height: 16px;
|
|
39
|
+
margin-right: 8px;
|
|
40
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
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 _localStorage = require("../../utils/local-storage");
|
|
13
|
+
|
|
14
|
+
require("./index.css");
|
|
15
|
+
|
|
16
|
+
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); }
|
|
17
|
+
|
|
18
|
+
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; }
|
|
19
|
+
|
|
20
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
21
|
+
|
|
22
|
+
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."); }
|
|
23
|
+
|
|
24
|
+
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); }
|
|
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
|
+
|
|
28
|
+
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; }
|
|
29
|
+
|
|
30
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
31
|
+
|
|
32
|
+
var preCls = "part-notice";
|
|
33
|
+
var storage = new _localStorage.LocalStorage();
|
|
34
|
+
|
|
35
|
+
var PartNotice = function PartNotice(_ref) {
|
|
36
|
+
var storageName = _ref.storageName,
|
|
37
|
+
text = _ref.text,
|
|
38
|
+
link = _ref.link;
|
|
39
|
+
|
|
40
|
+
var _useState = (0, _react.useState)(function () {
|
|
41
|
+
var stopTaking = storage.getItem(storageName);
|
|
42
|
+
|
|
43
|
+
if (stopTaking !== null && stopTaking !== void 0 && stopTaking.date) {
|
|
44
|
+
var oldDate = new Date(stopTaking === null || stopTaking === void 0 ? void 0 : stopTaking.date).getDate();
|
|
45
|
+
var newDate = new Date().getDate();
|
|
46
|
+
|
|
47
|
+
if (newDate > oldDate) {
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return true;
|
|
55
|
+
}),
|
|
56
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
57
|
+
visible = _useState2[0],
|
|
58
|
+
setVisible = _useState2[1];
|
|
59
|
+
|
|
60
|
+
var handleClose = (0, _react.useCallback)(function () {
|
|
61
|
+
setVisible(false);
|
|
62
|
+
storage.setItem(storageName, {
|
|
63
|
+
bol: false,
|
|
64
|
+
date: new Date()
|
|
65
|
+
});
|
|
66
|
+
}, []);
|
|
67
|
+
|
|
68
|
+
var handleOpenLink = function handleOpenLink() {
|
|
69
|
+
window.open(link, "_target");
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
if (!visible) return /*#__PURE__*/_react["default"].createElement("span", null);
|
|
73
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
74
|
+
className: "".concat(preCls)
|
|
75
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
76
|
+
className: "tu-icon-tishi"
|
|
77
|
+
}), text, /*#__PURE__*/_react["default"].createElement("span", {
|
|
78
|
+
className: "".concat(preCls, "__link"),
|
|
79
|
+
onClick: handleOpenLink
|
|
80
|
+
}, "\u4E86\u89E3\u8BE6\u60C5"), /*#__PURE__*/_react["default"].createElement("span", {
|
|
81
|
+
className: "tu-icon-close ".concat(preCls, "__close"),
|
|
82
|
+
onClick: handleClose
|
|
83
|
+
}));
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
PartNotice.defaultProps = {
|
|
87
|
+
storageName: "partNotice"
|
|
88
|
+
};
|
|
89
|
+
var _default = PartNotice;
|
|
90
|
+
exports["default"] = _default;
|
|
@@ -69,10 +69,18 @@ var MutiMode = /*#__PURE__*/function (_PureComponent) {
|
|
|
69
69
|
args[_key] = arguments[_key];
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
return _possibleConstructorReturn(_this, (_temp = _this = _super.call.apply(_super, [this].concat(args)), _this.
|
|
72
|
+
return _possibleConstructorReturn(_this, (_temp = _this = _super.call.apply(_super, [this].concat(args)), _this.handleDepartment = function (d) {
|
|
73
73
|
var _this$props = _this.props,
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
selectedDept = _this$props.selectedDept,
|
|
75
|
+
onSelectDept = _this$props.onSelectDept;
|
|
76
|
+
if (selectedDept.findIndex(function (sd) {
|
|
77
|
+
return sd.Id === d.Id;
|
|
78
|
+
}) !== -1) return;
|
|
79
|
+
onSelectDept(d);
|
|
80
|
+
}, _this.handleSelectUser = function (users) {
|
|
81
|
+
var _this$props2 = _this.props,
|
|
82
|
+
selectedUser = _this$props2.selectedUser,
|
|
83
|
+
onSelectUser = _this$props2.onSelectUser;
|
|
76
84
|
var m = {};
|
|
77
85
|
selectedUser.forEach(function (user) {
|
|
78
86
|
return m[user.Id] = true;
|
|
@@ -82,22 +90,16 @@ var MutiMode = /*#__PURE__*/function (_PureComponent) {
|
|
|
82
90
|
});
|
|
83
91
|
if (!filterdUsers.length) return;
|
|
84
92
|
onSelectUser(filterdUsers);
|
|
85
|
-
}, _this.handleDepartment = function (d) {
|
|
86
|
-
var _this$props2 = _this.props,
|
|
87
|
-
selectedDept = _this$props2.selectedDept,
|
|
88
|
-
onSelectDept = _this$props2.onSelectDept;
|
|
89
|
-
if (selectedDept.findIndex(function (sd) {
|
|
90
|
-
return sd.Id == d.Id;
|
|
91
|
-
}) != -1) return;
|
|
92
|
-
onSelectDept(d);
|
|
93
93
|
}, _temp));
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
_createClass(MutiMode, [{
|
|
97
97
|
key: "componentDidUpdate",
|
|
98
98
|
value: function componentDidUpdate(prevProps) {
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
var searchTxt = this.props.searchTxt;
|
|
100
|
+
|
|
101
|
+
if (prevProps.searchTxt !== searchTxt) {
|
|
102
|
+
if (searchTxt) {
|
|
101
103
|
this.tab.changeTab("common");
|
|
102
104
|
}
|
|
103
105
|
}
|
|
@@ -114,14 +116,15 @@ var MutiMode = /*#__PURE__*/function (_PureComponent) {
|
|
|
114
116
|
onDeleteDept = _this$props3.onDeleteDept,
|
|
115
117
|
onClear = _this$props3.onClear,
|
|
116
118
|
deptSelectable = _this$props3.deptSelectable,
|
|
117
|
-
rootSelectable = _this$props3.rootSelectable
|
|
119
|
+
rootSelectable = _this$props3.rootSelectable,
|
|
120
|
+
searchTxt = _this$props3.searchTxt;
|
|
118
121
|
var deptIsSelected = selectedDept.length > 0;
|
|
119
122
|
var userIsSelected = selectedUser.length > 0;
|
|
120
123
|
var tabOptions = [{
|
|
121
124
|
title: (0, _getLocale.getLocale)("OKR_MyO_Butt_Commonlyused"),
|
|
122
125
|
name: "common",
|
|
123
126
|
component: /*#__PURE__*/_react["default"].createElement(_CommonList["default"], {
|
|
124
|
-
searchTxt:
|
|
127
|
+
searchTxt: searchTxt,
|
|
125
128
|
onSelect: function onSelect(u) {
|
|
126
129
|
return _this2.handleSelectUser(u);
|
|
127
130
|
}
|
|
@@ -155,7 +158,7 @@ var MutiMode = /*#__PURE__*/function (_PureComponent) {
|
|
|
155
158
|
ref: function ref(r) {
|
|
156
159
|
return _this2.tab = r;
|
|
157
160
|
}
|
|
158
|
-
})), /*#__PURE__*/_react["default"].createElement(_style.MutiModeRight, null, /*#__PURE__*/_react["default"].createElement(_style.SelectedHeader, null, /*#__PURE__*/_react["default"].createElement("span", null, (0, _getLocale.getLocale)("Mod_Selecperson"), selectedUser.length + (0, _getLocale.getLocale)("Mod_Number"), deptIsSelected && "
|
|
161
|
+
})), /*#__PURE__*/_react["default"].createElement(_style.MutiModeRight, null, /*#__PURE__*/_react["default"].createElement(_style.SelectedHeader, null, /*#__PURE__*/_react["default"].createElement("span", null, (0, _getLocale.getLocale)("Mod_Selecperson"), selectedUser.length + (0, _getLocale.getLocale)("Mod_Number"), deptIsSelected && ",".concat((0, _getLocale.getLocale)("Mod_departments").replace("XX", "".concat(selectedDept.length)))), /*#__PURE__*/_react["default"].createElement(_style.ClearBtn, {
|
|
159
162
|
active: deptIsSelected || userIsSelected,
|
|
160
163
|
onMouseDown: function onMouseDown() {
|
|
161
164
|
return onClear();
|
package/lib/index.js
CHANGED
|
@@ -303,6 +303,12 @@ Object.defineProperty(exports, "Pagination", {
|
|
|
303
303
|
return _pagination["default"];
|
|
304
304
|
}
|
|
305
305
|
});
|
|
306
|
+
Object.defineProperty(exports, "PartNotice", {
|
|
307
|
+
enumerable: true,
|
|
308
|
+
get: function get() {
|
|
309
|
+
return _partNotice["default"];
|
|
310
|
+
}
|
|
311
|
+
});
|
|
306
312
|
Object.defineProperty(exports, "PasswordInput", {
|
|
307
313
|
enumerable: true,
|
|
308
314
|
get: function get() {
|
|
@@ -528,8 +534,6 @@ Object.defineProperty(exports, "upload", {
|
|
|
528
534
|
|
|
529
535
|
require("./index.css");
|
|
530
536
|
|
|
531
|
-
var _stopTakingModal = _interopRequireDefault(require("./components/stop-taking-modal"));
|
|
532
|
-
|
|
533
537
|
var _dialog = _interopRequireDefault(require("./components/dialog"));
|
|
534
538
|
|
|
535
539
|
var _switch = _interopRequireDefault(require("./components/switch"));
|
|
@@ -644,6 +648,8 @@ var _okrcaseLibraryCard = _interopRequireDefault(require("./components/okrcase-l
|
|
|
644
648
|
|
|
645
649
|
var _operationRecords = _interopRequireDefault(require("./components/operation-records"));
|
|
646
650
|
|
|
651
|
+
var _partNotice = _interopRequireDefault(require("./components/part-notice"));
|
|
652
|
+
|
|
647
653
|
var _pagination = _interopRequireDefault(require("./components/pagination"));
|
|
648
654
|
|
|
649
655
|
var _passwordInput = _interopRequireDefault(require("./components/password-input"));
|
|
@@ -83,7 +83,7 @@ function PageLayout(props) {
|
|
|
83
83
|
var children = props.children;
|
|
84
84
|
|
|
85
85
|
var _useState = (0, _react.useState)(function () {
|
|
86
|
-
if ((0, _helpers.getTenantInfo)().Source
|
|
86
|
+
if ((0, _helpers.getTenantInfo)().Source === 964) return false;
|
|
87
87
|
var stopTaking = storage.getItem("topGlobalCard");
|
|
88
88
|
|
|
89
89
|
if (stopTaking !== null && stopTaking !== void 0 && stopTaking.date) {
|
package/lib/utils/open-data.js
CHANGED
|
@@ -70,11 +70,10 @@ function openData(p) {
|
|
|
70
70
|
if (!openId) return p.name || p.id || null;
|
|
71
71
|
var ref = (0, _react.useRef)(null);
|
|
72
72
|
(0, _react.useEffect)(function () {
|
|
73
|
-
var wWOpenData = window.WWOpenData; // 如果当前页面中没有 WWOpenData 则去 top 上尝试获取
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
73
|
+
var wWOpenData = window.top.WWOpenData; // // 如果当前页面中没有 WWOpenData 则去 top 上尝试获取
|
|
74
|
+
// if (!wWOpenData && window.top.WWOpenData) {
|
|
75
|
+
// wWOpenData = window.top.WWOpenData;
|
|
76
|
+
// }
|
|
78
77
|
|
|
79
78
|
wWOpenData && wWOpenData.bind(ref.current);
|
|
80
79
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@titaui/pc",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.69",
|
|
4
4
|
"nameCN": "",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -61,6 +61,7 @@
|
|
|
61
61
|
"gulp-replace": "^1.0.0",
|
|
62
62
|
"gulp-sass": "^4.1.0",
|
|
63
63
|
"gulp-sourcemaps": "^2.6.5",
|
|
64
|
+
"gulp-util": "^3.0.8",
|
|
64
65
|
"husky": "^7.0.4",
|
|
65
66
|
"lint-staged": "^12.2.0",
|
|
66
67
|
"pretty-quick": "^3.1.3",
|
|
@@ -132,7 +133,7 @@
|
|
|
132
133
|
"lint-staged": {
|
|
133
134
|
"src/**/*.{js,ts,tsx,jsx,css,scss}": [
|
|
134
135
|
"pretty-quick --staged",
|
|
135
|
-
"eslint --
|
|
136
|
+
"eslint --fix"
|
|
136
137
|
]
|
|
137
138
|
}
|
|
138
139
|
}
|
|
@@ -2,7 +2,7 @@ import React, { ReactElement, useState, useEffect } from "react";
|
|
|
2
2
|
import classNames from "classnames";
|
|
3
3
|
import axios from "axios";
|
|
4
4
|
import Popup from "../popup";
|
|
5
|
-
import { getLoginUserInfo } from "../../utils/helpers";
|
|
5
|
+
import { getLoginUserInfo, getTenantInfo } from "../../utils/helpers";
|
|
6
6
|
import ArrowImg from "./img/arrow.png";
|
|
7
7
|
import "./index.scss";
|
|
8
8
|
|
|
@@ -22,7 +22,7 @@ function HrHeader(): ReactElement {
|
|
|
22
22
|
}, []);
|
|
23
23
|
return (
|
|
24
24
|
<div className={preCls}>
|
|
25
|
-
<span className={`${preCls}__title`}
|
|
25
|
+
<span className={`${preCls}__title`}>{getTenantInfo().Name}</span>
|
|
26
26
|
<div className={`${preCls}__menu-list`}>
|
|
27
27
|
{menus.slice(0, 5).map((menu) => (
|
|
28
28
|
<div
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
.part-notice {
|
|
2
|
+
margin-left: 16px;
|
|
3
|
+
height: 36px;
|
|
4
|
+
background: #fcedd4;
|
|
5
|
+
display: flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
font-size: 12px;
|
|
8
|
+
font-weight: 400;
|
|
9
|
+
color: #3f4755;
|
|
10
|
+
line-height: 18px;
|
|
11
|
+
position: relative;
|
|
12
|
+
padding: 0 12px;
|
|
13
|
+
margin-bottom: 10px;
|
|
14
|
+
margin-top: 16px;
|
|
15
|
+
border-radius: 12px;
|
|
16
|
+
|
|
17
|
+
> .tu-icon-tishi {
|
|
18
|
+
color: #f0a326;
|
|
19
|
+
margin-right: 8px;
|
|
20
|
+
}
|
|
21
|
+
&__link {
|
|
22
|
+
color: #f6bd16;
|
|
23
|
+
cursor: pointer;
|
|
24
|
+
}
|
|
25
|
+
&__close {
|
|
26
|
+
color: #f6bd16;
|
|
27
|
+
cursor: pointer;
|
|
28
|
+
font-size: 16px;
|
|
29
|
+
position: absolute;
|
|
30
|
+
right: 12px;
|
|
31
|
+
}
|
|
32
|
+
&__image {
|
|
33
|
+
width: 16px;
|
|
34
|
+
height: 16px;
|
|
35
|
+
margin-right: 8px;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import React, { FC, useState, useCallback } from "react";
|
|
2
|
+
import { LocalStorage } from "../../utils/local-storage";
|
|
3
|
+
import "./index.scss";
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
text: any;
|
|
7
|
+
link: string;
|
|
8
|
+
storageName?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const preCls = "part-notice";
|
|
12
|
+
const storage = new LocalStorage();
|
|
13
|
+
|
|
14
|
+
const PartNotice: FC<Props> = ({ storageName, text, link }) => {
|
|
15
|
+
const [visible, setVisible] = useState(() => {
|
|
16
|
+
const stopTaking: any = storage.getItem(storageName);
|
|
17
|
+
if (stopTaking?.date) {
|
|
18
|
+
const oldDate = new Date(stopTaking?.date).getDate();
|
|
19
|
+
const newDate = new Date().getDate();
|
|
20
|
+
if (newDate > oldDate) {
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
return true;
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
const handleClose = useCallback(() => {
|
|
29
|
+
setVisible(false);
|
|
30
|
+
storage.setItem(storageName, { bol: false, date: new Date() });
|
|
31
|
+
}, []);
|
|
32
|
+
|
|
33
|
+
const handleOpenLink = () => {
|
|
34
|
+
window.open(link, "_target");
|
|
35
|
+
};
|
|
36
|
+
if (!visible) return <span />;
|
|
37
|
+
return (
|
|
38
|
+
<div className={`${preCls}`}>
|
|
39
|
+
<span className="tu-icon-tishi" />
|
|
40
|
+
{text}
|
|
41
|
+
<span className={`${preCls}__link`} onClick={handleOpenLink}>了解详情</span>
|
|
42
|
+
<span className={`tu-icon-close ${preCls}__close`} onClick={handleClose} />
|
|
43
|
+
</div>
|
|
44
|
+
);
|
|
45
|
+
};
|
|
46
|
+
PartNotice.defaultProps = {
|
|
47
|
+
storageName: "partNotice",
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export default PartNotice;
|
package/src/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import "./index.scss";
|
|
2
|
-
import { default as StopTakingModal } from "./components/stop-taking-modal";
|
|
3
2
|
|
|
4
3
|
export { default as Dialog } from "./components/dialog";
|
|
5
4
|
export { default as Switch } from "./components/switch";
|
|
@@ -58,6 +57,7 @@ export { default as OkrShare } from "./components/okr-share";
|
|
|
58
57
|
export { default as OkrcaseLibrary } from "./components/okrcase-library";
|
|
59
58
|
export { default as OkrcaseLibraryCard } from "./components/okrcase-library-card";
|
|
60
59
|
export { default as OperationRecords } from "./components/operation-records";
|
|
60
|
+
export { default as PartNotice } from "./components/part-notice";
|
|
61
61
|
export { default as Pagination } from "./components/pagination";
|
|
62
62
|
export { default as PasswordInput } from "./components/password-input";
|
|
63
63
|
export { default as PhotoCard } from "./components/photo-card";
|