@titaui/pc 1.9.72 → 1.9.73
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/create-okr-modal/fields/okr-case.js +8 -9
- package/lib/components/dynamic/dynamic-liking/item.js +1 -2
- package/lib/components/okr-detail/components/okr-tree/tree-node/o-child-node/edit-child-okr-weight.js +1 -1
- package/lib/components/photo-card/index.js +3 -6
- package/lib/components/photo-card/request.apis.js +2 -2
- package/lib/pages/new-okr-list/index.js +1 -1
- package/lib/utils/helpers.js +12 -6
- package/package.json +1 -1
- package/src/components/create-okr-modal/fields/okr-case.tsx +7 -7
- package/src/components/dynamic/constant.ts +18 -18
- package/src/components/dynamic/dynamic-liking/item.tsx +1 -2
- package/src/components/okr-detail/components/okr-tree/tree-node/o-child-node/edit-child-okr-weight.tsx +1 -1
- package/src/components/photo-card/index.tsx +5 -6
- package/src/components/photo-card/request.apis.ts +1 -1
- package/src/pages/new-okr-list/index.tsx +1 -1
- package/src/utils/helpers.ts +6 -4
|
@@ -5,7 +5,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports["default"] =
|
|
8
|
+
exports["default"] = OkrCase;
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
|
|
@@ -41,7 +41,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
41
41
|
|
|
42
42
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
43
43
|
|
|
44
|
-
function
|
|
44
|
+
function OkrCase(_ref) {
|
|
45
45
|
var onOkrApply = _ref.onOkrApply,
|
|
46
46
|
okrTemplateEnabled = _ref.okrTemplateEnabled;
|
|
47
47
|
|
|
@@ -59,13 +59,13 @@ function _default(_ref) {
|
|
|
59
59
|
};
|
|
60
60
|
|
|
61
61
|
var OnOkrApplyHandler = function OnOkrApplyHandler(data) {
|
|
62
|
-
onOkrApply
|
|
62
|
+
onOkrApply === null || onOkrApply === void 0 ? void 0 : onOkrApply(data);
|
|
63
63
|
setVisible(false);
|
|
64
64
|
|
|
65
65
|
_toast["default"].Success("成功套用");
|
|
66
66
|
};
|
|
67
67
|
|
|
68
|
-
return /*#__PURE__*/_react["default"].createElement(_style.Line, null, okrTemplateEnabled && !(0, _helpers.isLocal)() ? /*#__PURE__*/_react["default"].createElement(_style.CaseLink, {
|
|
68
|
+
return /*#__PURE__*/_react["default"].createElement(_style.Line, null, okrTemplateEnabled && !(0, _helpers.isLocal)() && !(0, _helpers.isTencentHr)() ? /*#__PURE__*/_react["default"].createElement(_style.CaseLink, {
|
|
69
69
|
onClick: okrCaseClickHandler,
|
|
70
70
|
className: "tu-icon-shoushi"
|
|
71
71
|
}, (0, _getLocale.getLocale)("OKR_MyO_Pop_Butt_AddfromOKR")) : null, okrTemplateEnabled && /*#__PURE__*/_react["default"].createElement(_dialog["default"], {
|
|
@@ -95,8 +95,7 @@ function _default(_ref) {
|
|
|
95
95
|
// offsetPosition={{ 'top': 41 }}
|
|
96
96
|
// fullSize={true}
|
|
97
97
|
// >
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
} // </OldModal>
|
|
98
|
+
// {
|
|
99
|
+
// /* <OKRCases onClose={onCasesCloseHandler} onApplyTpl={OnOkrApplyHandler} /> */
|
|
100
|
+
// }
|
|
101
|
+
// </OldModal>
|
|
@@ -43,7 +43,6 @@ var Item = function Item(_ref) {
|
|
|
43
43
|
// window.open(url, "_blank");
|
|
44
44
|
// };
|
|
45
45
|
|
|
46
|
-
var ObjectTypeText = (0, _constant.ObjectType)();
|
|
47
46
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
48
47
|
className: "".concat(preCls)
|
|
49
48
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -65,7 +64,7 @@ var Item = function Item(_ref) {
|
|
|
65
64
|
text: /*#__PURE__*/_react["default"].createElement("span", null, (0, _getLocale.getLocale)("Feed_Kudos"), /*#__PURE__*/_react["default"].createElement(_openData.OpenUserName, {
|
|
66
65
|
id: toUserId,
|
|
67
66
|
name: toUserName
|
|
68
|
-
}), "".concat(
|
|
67
|
+
}), "".concat((0, _constant.ObjectType)()[pariseObjType] || "feed")),
|
|
69
68
|
maxWidth: 150
|
|
70
69
|
}))), /*#__PURE__*/_react["default"].createElement("div", {
|
|
71
70
|
className: "".concat(preCls, "-center-time")
|
|
@@ -270,7 +270,7 @@ function EditChildOkrWeight(props) {
|
|
|
270
270
|
onChange: onChangeHandler
|
|
271
271
|
})));
|
|
272
272
|
}))), /*#__PURE__*/_react["default"].createElement(_dialogConfirm["default"], {
|
|
273
|
-
zIndex:
|
|
273
|
+
zIndex: 2301,
|
|
274
274
|
visible: showDialogConfirm,
|
|
275
275
|
type: "warning",
|
|
276
276
|
className: "".concat(precls, "__confirm")
|
|
@@ -95,17 +95,14 @@ function PhotoCard(props) {
|
|
|
95
95
|
|
|
96
96
|
(0, _react.useEffect)(function () {
|
|
97
97
|
(0, _request.getOtherUserInfo)(userId).then(function (res) {
|
|
98
|
-
var currentUser;
|
|
99
|
-
|
|
100
98
|
if (res.Code === 1) {
|
|
101
|
-
currentUser = res.Data;
|
|
102
99
|
setUserInfo(res.Data);
|
|
103
100
|
}
|
|
104
101
|
|
|
105
|
-
(0, _request.getAttentionData)().then(function (res) {
|
|
102
|
+
(0, _request.getAttentionData)(userId).then(function (res) {
|
|
106
103
|
if (res.Code === 1) {
|
|
107
|
-
|
|
108
|
-
if (item.userId ===
|
|
104
|
+
res.Data.followerUsers.forEach(function (item) {
|
|
105
|
+
if (item.userId === userownInfo.Id) {
|
|
109
106
|
setIsAttention(true);
|
|
110
107
|
}
|
|
111
108
|
});
|
|
@@ -7,8 +7,8 @@ exports.postAttention = exports.getVisitData = exports.getOtherUserInfo = export
|
|
|
7
7
|
|
|
8
8
|
var _request = require("../../utils/request");
|
|
9
9
|
|
|
10
|
-
var getAttentionData = function getAttentionData() {
|
|
11
|
-
return (0, _request.rget)("v1")("follow/
|
|
10
|
+
var getAttentionData = function getAttentionData(userId) {
|
|
11
|
+
return (0, _request.rget)("v1")("follow/getFollowerList?toUserId=".concat(userId));
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
exports.getAttentionData = getAttentionData;
|
|
@@ -331,7 +331,7 @@ var NewOkrList = function NewOkrList(props) {
|
|
|
331
331
|
replaceOkr: replaceOkr,
|
|
332
332
|
isShowPrincple: isShowPrincple,
|
|
333
333
|
isShowPeriod: isShowPeriod,
|
|
334
|
-
isShowEasyCreate: relation !== 2 && relation !== 3,
|
|
334
|
+
isShowEasyCreate: relation !== "2" && relation !== "3",
|
|
335
335
|
openCreateModal: openCreateModal
|
|
336
336
|
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
337
337
|
className: "".concat(_precls.precls, "__pagination")
|
package/lib/utils/helpers.js
CHANGED
|
@@ -8,7 +8,7 @@ exports.escapeHtml = escapeHtml;
|
|
|
8
8
|
exports.getLoginUserInfo = void 0;
|
|
9
9
|
exports.getTenantInfo = getTenantInfo;
|
|
10
10
|
exports.getUploadMaxSize = getUploadMaxSize;
|
|
11
|
-
exports.isLocal = exports.isDingDing = void 0;
|
|
11
|
+
exports.isTencentHr = exports.isLocal = exports.isDingDing = void 0;
|
|
12
12
|
|
|
13
13
|
var _bsGlobal = require("./bs-global");
|
|
14
14
|
|
|
@@ -25,8 +25,8 @@ function cssSupport(attr, value) {
|
|
|
25
25
|
|
|
26
26
|
function getUploadMaxSize() {
|
|
27
27
|
var info = (0, _bsGlobal.getBSGlobal)("tenantInfo");
|
|
28
|
-
var isDingDing = info.Source
|
|
29
|
-
var isDingZhi = window.dingZhiSize && window.dingZhiSize.indexOf(info.Id)
|
|
28
|
+
var isDingDing = info.Source === 861;
|
|
29
|
+
var isDingZhi = window.dingZhiSize && window.dingZhiSize.indexOf(info.Id) !== -1;
|
|
30
30
|
if (isDingDing) return 20;
|
|
31
31
|
if (isDingZhi) return 100;
|
|
32
32
|
return 50;
|
|
@@ -37,7 +37,7 @@ function getTenantInfo() {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
var isDingDing = function isDingDing() {
|
|
40
|
-
return getTenantInfo().Source
|
|
40
|
+
return getTenantInfo().Source === 861;
|
|
41
41
|
};
|
|
42
42
|
|
|
43
43
|
exports.isDingDing = isDingDing;
|
|
@@ -48,6 +48,12 @@ var isLocal = function isLocal() {
|
|
|
48
48
|
|
|
49
49
|
exports.isLocal = isLocal;
|
|
50
50
|
|
|
51
|
+
var isTencentHr = function isTencentHr() {
|
|
52
|
+
return getTenantInfo().Source === 964;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
exports.isTencentHr = isTencentHr;
|
|
56
|
+
|
|
51
57
|
function escapeHtml(str) {
|
|
52
58
|
var htmlEscapes = {
|
|
53
59
|
"&": "&",
|
|
@@ -56,8 +62,8 @@ function escapeHtml(str) {
|
|
|
56
62
|
""": "\"",
|
|
57
63
|
"'": "'"
|
|
58
64
|
};
|
|
59
|
-
return str.replace(/(&|<|>|"|')/g, function (
|
|
60
|
-
return htmlEscapes[
|
|
65
|
+
return str.replace(/(&|<|>|"|')/g, function (s) {
|
|
66
|
+
return htmlEscapes[s];
|
|
61
67
|
});
|
|
62
68
|
}
|
|
63
69
|
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@ import { CaseLink, Line } from "../style";
|
|
|
3
3
|
import OKRCases from "../../okrcase-library";
|
|
4
4
|
import Dialog from "../../dialog";
|
|
5
5
|
import Toast from "../../toast";
|
|
6
|
-
import { isLocal } from "../../../utils/helpers";
|
|
6
|
+
import { isLocal, isTencentHr } from "../../../utils/helpers";
|
|
7
7
|
import { getLocale } from "../../../utils/getLocale";
|
|
8
8
|
import "./index.scss";
|
|
9
9
|
|
|
@@ -12,7 +12,7 @@ interface Props {
|
|
|
12
12
|
okrTemplateEnabled: boolean;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
export default function ({ onOkrApply, okrTemplateEnabled }: Props) {
|
|
15
|
+
export default function OkrCase({ onOkrApply, okrTemplateEnabled }: Props) {
|
|
16
16
|
const [visible, setVisible] = useState(false);
|
|
17
17
|
|
|
18
18
|
const okrCaseClickHandler = () => {
|
|
@@ -24,14 +24,14 @@ export default function ({ onOkrApply, okrTemplateEnabled }: Props) {
|
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
const OnOkrApplyHandler = (data) => {
|
|
27
|
-
onOkrApply
|
|
27
|
+
onOkrApply?.(data);
|
|
28
28
|
setVisible(false);
|
|
29
29
|
Toast.Success("成功套用");
|
|
30
30
|
};
|
|
31
31
|
|
|
32
32
|
return (
|
|
33
33
|
<Line>
|
|
34
|
-
{okrTemplateEnabled && !isLocal() ? (
|
|
34
|
+
{okrTemplateEnabled && !isLocal() && !isTencentHr() ? (
|
|
35
35
|
<CaseLink onClick={okrCaseClickHandler} className="tu-icon-shoushi">
|
|
36
36
|
{getLocale("OKR_MyO_Pop_Butt_AddfromOKR")}
|
|
37
37
|
</CaseLink>
|
|
@@ -68,7 +68,7 @@ export default function ({ onOkrApply, okrTemplateEnabled }: Props) {
|
|
|
68
68
|
// offsetPosition={{ 'top': 41 }}
|
|
69
69
|
// fullSize={true}
|
|
70
70
|
// >
|
|
71
|
-
{
|
|
72
|
-
|
|
73
|
-
}
|
|
71
|
+
// {
|
|
72
|
+
// /* <OKRCases onClose={onCasesCloseHandler} onApplyTpl={OnOkrApplyHandler} /> */
|
|
73
|
+
// }
|
|
74
74
|
// </OldModal>
|
|
@@ -55,25 +55,25 @@ export const ObjTypeMapText = {
|
|
|
55
55
|
[EObjType.KanBan]: getLocale("Pro_page_V_Tab_Kanban"),
|
|
56
56
|
};
|
|
57
57
|
|
|
58
|
-
export const ObjectType = () => {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
42: getLocale("OKR_MyO_E_Reward"),
|
|
75
|
-
};
|
|
58
|
+
export const ObjectType = () => ({
|
|
59
|
+
1: getLocale("Mod_sannouncement"),
|
|
60
|
+
4: getLocale("Menu_Title_Projects"),
|
|
61
|
+
5: getLocale("Mod_sPerformanceForm"),
|
|
62
|
+
6: getLocale("Mod_sPerformanceGoals"),
|
|
63
|
+
7: getLocale("Mod_stasks"),
|
|
64
|
+
8: getLocale("Mod_sDailySummary"),
|
|
65
|
+
10: getLocale("Feed_sFeed"),
|
|
66
|
+
11: getLocale("Pro_page_Plan"),
|
|
67
|
+
12: getLocale("Feed_OperationTasks"),
|
|
68
|
+
62: getLocale("Mod_sobjective"),
|
|
69
|
+
65: getLocale("Feed_Keyresults"),
|
|
70
|
+
70: getLocale("OKR_MyO_KRP_Review"),
|
|
71
|
+
79: getLocale("Mod_skeyprogress"),
|
|
72
|
+
80: getLocale("Feed_sAnnouncement"),
|
|
73
|
+
42: getLocale("OKR_MyO_E_Reward"),
|
|
76
74
|
}
|
|
75
|
+
);
|
|
76
|
+
|
|
77
77
|
|
|
78
78
|
export const EStatusStatus2ClassType = {
|
|
79
79
|
2: "tu-icon-finished",
|
|
@@ -28,7 +28,6 @@ const Item: FC<any> = ({ userInfo }) => {
|
|
|
28
28
|
// const handleOpenUserPage = () => {
|
|
29
29
|
// window.open(url, "_blank");
|
|
30
30
|
// };
|
|
31
|
-
const ObjectTypeText = ObjectType();
|
|
32
31
|
return (
|
|
33
32
|
<div className={`${preCls}`}>
|
|
34
33
|
<div className={`${preCls}-center`}>
|
|
@@ -48,7 +47,7 @@ const Item: FC<any> = ({ userInfo }) => {
|
|
|
48
47
|
<span>
|
|
49
48
|
{getLocale("Feed_Kudos")}
|
|
50
49
|
<OpenUserName id={toUserId} name={toUserName} />
|
|
51
|
-
{`${
|
|
50
|
+
{`${ObjectType()[pariseObjType] || "feed"}`}
|
|
52
51
|
</span>
|
|
53
52
|
)}
|
|
54
53
|
maxWidth={150}
|
|
@@ -114,7 +114,7 @@ function EditChildOkrWeight(props: IProps) {
|
|
|
114
114
|
))}
|
|
115
115
|
</div>
|
|
116
116
|
</Dialog>
|
|
117
|
-
<DialogConfirm zIndex={
|
|
117
|
+
<DialogConfirm zIndex={2301} visible={showDialogConfirm} type="warning" className={`${precls}__confirm`}>
|
|
118
118
|
{/* @ts-ignore */}
|
|
119
119
|
<span type="title">{getLocale("OKR_MyO_Err_Delefocus")}</span>
|
|
120
120
|
<CancelButton type="button" onClick={closeDialogConfirm}>
|
|
@@ -6,7 +6,7 @@ import Tooltip from "../tooltip";
|
|
|
6
6
|
import ConditionRender from "../condition-render";
|
|
7
7
|
import Avatar from "../../components/avatar";
|
|
8
8
|
import { OpenUserName } from "../../utils/open-data";
|
|
9
|
-
import {
|
|
9
|
+
import { getUserInfo } from "../../utils/bs-global";
|
|
10
10
|
import Card from "./components/card";
|
|
11
11
|
import {
|
|
12
12
|
getAttentionData,
|
|
@@ -32,6 +32,7 @@ interface IProps {
|
|
|
32
32
|
|
|
33
33
|
function PhotoCard(props: IProps) {
|
|
34
34
|
const { userId, isNameVisible = true } = props;
|
|
35
|
+
|
|
35
36
|
const [userInfo, setUserInfo] = useState<any>();
|
|
36
37
|
const [isAttention, setIsAttention] = useState(false);
|
|
37
38
|
|
|
@@ -50,15 +51,13 @@ function PhotoCard(props: IProps) {
|
|
|
50
51
|
|
|
51
52
|
useEffect(() => {
|
|
52
53
|
getOtherUserInfo(userId).then((res) => {
|
|
53
|
-
let currentUser;
|
|
54
54
|
if (res.Code === 1) {
|
|
55
|
-
currentUser = res.Data;
|
|
56
55
|
setUserInfo(res.Data);
|
|
57
56
|
}
|
|
58
|
-
getAttentionData().then((res) => {
|
|
57
|
+
getAttentionData(userId).then((res) => {
|
|
59
58
|
if (res.Code === 1) {
|
|
60
|
-
|
|
61
|
-
if (item.userId ===
|
|
59
|
+
res.Data.followerUsers.forEach((item) => {
|
|
60
|
+
if (item.userId === userownInfo.Id) {
|
|
62
61
|
setIsAttention(true);
|
|
63
62
|
}
|
|
64
63
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { rget, rpost } from "../../utils/request";
|
|
2
2
|
|
|
3
|
-
export const getAttentionData = () => rget("v1")(`follow/
|
|
3
|
+
export const getAttentionData = (userId) => rget("v1")(`follow/getFollowerList?toUserId=${userId}`);
|
|
4
4
|
|
|
5
5
|
export const getVisitData = (userId) => rget("v1")(`okr/okrCyclePageVisitor?toUserId=${userId}`);
|
|
6
6
|
|
|
@@ -234,7 +234,7 @@ const NewOkrList: FC<any> = (props: {
|
|
|
234
234
|
replaceOkr={replaceOkr}
|
|
235
235
|
isShowPrincple={isShowPrincple}
|
|
236
236
|
isShowPeriod={isShowPeriod}
|
|
237
|
-
isShowEasyCreate={relation !== 2 && relation !== 3}
|
|
237
|
+
isShowEasyCreate={relation !== "2" && relation !== "3"}
|
|
238
238
|
openCreateModal={openCreateModal}
|
|
239
239
|
/>
|
|
240
240
|
<div className={`${precls}__pagination`}>
|
package/src/utils/helpers.ts
CHANGED
|
@@ -10,8 +10,8 @@ export function cssSupport(attr, value) {
|
|
|
10
10
|
}
|
|
11
11
|
export function getUploadMaxSize() {
|
|
12
12
|
const info = getBSGlobal("tenantInfo");
|
|
13
|
-
const isDingDing = info.Source
|
|
14
|
-
const isDingZhi = window.dingZhiSize && (window.dingZhiSize).indexOf(info.Id)
|
|
13
|
+
const isDingDing = info.Source === 861;
|
|
14
|
+
const isDingZhi = window.dingZhiSize && (window.dingZhiSize).indexOf(info.Id) !== -1;
|
|
15
15
|
if (isDingDing) return 20;
|
|
16
16
|
if (isDingZhi) return 100;
|
|
17
17
|
return 50;
|
|
@@ -21,9 +21,11 @@ export function getTenantInfo() {
|
|
|
21
21
|
return getBSGlobal("tenantInfo");
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
export const isDingDing = () => getTenantInfo().Source
|
|
24
|
+
export const isDingDing = () => getTenantInfo().Source === 861;
|
|
25
25
|
|
|
26
26
|
export const isLocal = () => !!getTenantInfo().isLocal;
|
|
27
|
+
|
|
28
|
+
export const isTencentHr = () => getTenantInfo().Source === 964;
|
|
27
29
|
export function escapeHtml(str) {
|
|
28
30
|
const htmlEscapes = {
|
|
29
31
|
"&": "&",
|
|
@@ -32,6 +34,6 @@ export function escapeHtml(str) {
|
|
|
32
34
|
""": "\"",
|
|
33
35
|
"'": "'",
|
|
34
36
|
};
|
|
35
|
-
return str.replace(/(&|<|>|"|')/g, (
|
|
37
|
+
return str.replace(/(&|<|>|"|')/g, (s) => htmlEscapes[s]);
|
|
36
38
|
}
|
|
37
39
|
export const getLoginUserInfo = () => getBSGlobal("loginUserInfo");
|