@titaui/pc 1.7.24 → 1.7.25
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/button/text-btn/index.css +1 -0
- package/lib/components/button/text-btn/index.js +10 -12
- package/lib/components/common-share/index.css +223 -0
- package/lib/components/common-share/index.js +104 -0
- package/lib/components/common-share/publishMblog.js +155 -0
- package/lib/components/common-share/request-apis.js +56 -0
- package/lib/components/common-share/types.js +5 -0
- package/lib/components/follower-visitor/index.css +8 -3
- package/lib/components/menus/components/menu-tree/tree-node/index.css +9 -6
- package/lib/components/select-tags/index.css +6 -0
- package/lib/components/select-tags/index.js +1 -1
- package/lib/components/weekly-report/board.js +43 -0
- package/lib/components/weekly-report/card.js +235 -0
- package/lib/components/weekly-report/common-painter/darwAvatar.js +157 -0
- package/lib/components/weekly-report/common-painter/drawName.js +59 -0
- package/lib/components/weekly-report/common-painter/openDataPainter.js +95 -0
- package/lib/components/weekly-report/common-painter/setSize.js +19 -0
- package/lib/components/weekly-report/common-painter/utils.js +85 -0
- package/lib/components/weekly-report/img/body.png +0 -0
- package/lib/components/weekly-report/img/bofang.png +0 -0
- package/lib/components/weekly-report/img/bottom.png +0 -0
- package/lib/components/weekly-report/img/communication.png +0 -0
- package/lib/components/weekly-report/img/down.png +0 -0
- package/lib/components/weekly-report/img/finish.png +0 -0
- package/lib/components/weekly-report/img/laba.png +0 -0
- package/lib/components/weekly-report/img/praise.png +0 -0
- package/lib/components/weekly-report/img/quote.png +0 -0
- package/lib/components/weekly-report/img/title.png +0 -0
- package/lib/components/weekly-report/img/triangle-pop.png +0 -0
- package/lib/components/weekly-report/img/up.png +0 -0
- package/lib/components/weekly-report/index.css +332 -0
- package/lib/components/weekly-report/index.js +134 -0
- package/lib/components/weekly-report/statistics.js +47 -0
- package/lib/index.js +8 -0
- package/lib/pages/aha2021/index.css +0 -1
- package/lib/pages/new-okr-list/header/filter.js +51 -2
- package/lib/pages/new-okr-list/index.js +44 -5
- package/lib/utils/helpers.js +8 -1
- package/package.json +1 -1
- package/src/components/button/text-btn/index.scss +1 -0
- package/src/components/button/text-btn/index.tsx +13 -13
- package/src/components/button/types.ts +1 -0
- package/src/components/common-share/index.scss +199 -0
- package/src/components/common-share/index.tsx +91 -0
- package/src/components/common-share/publishMblog.tsx +79 -0
- package/src/components/common-share/request-apis.js +37 -0
- package/src/components/common-share/types.ts +4 -0
- package/src/components/follower-visitor/index.scss +9 -4
- package/src/components/menus/components/menu-tree/tree-node/index.scss +2 -1
- package/src/components/okr-share/index.tsx +4 -17
- package/src/components/select-tags/index.scss +7 -0
- package/src/components/select-tags/index.tsx +7 -11
- package/src/components/weekly-report/board.tsx +25 -0
- package/src/components/weekly-report/card.tsx +125 -0
- package/src/components/weekly-report/common-painter/darwAvatar.ts +81 -0
- package/src/components/weekly-report/common-painter/drawName.ts +19 -0
- package/src/components/weekly-report/common-painter/openDataPainter.ts +47 -0
- package/src/components/weekly-report/common-painter/setSize.ts +12 -0
- package/src/components/weekly-report/common-painter/utils.ts +83 -0
- package/src/components/weekly-report/img/body.png +0 -0
- package/src/components/weekly-report/img/bofang.png +0 -0
- package/src/components/weekly-report/img/bottom.png +0 -0
- package/src/components/weekly-report/img/communication.png +0 -0
- package/src/components/weekly-report/img/down.png +0 -0
- package/src/components/weekly-report/img/finish.png +0 -0
- package/src/components/weekly-report/img/laba.png +0 -0
- package/src/components/weekly-report/img/praise.png +0 -0
- package/src/components/weekly-report/img/quote.png +0 -0
- package/src/components/weekly-report/img/title.png +0 -0
- package/src/components/weekly-report/img/triangle-pop.png +0 -0
- package/src/components/weekly-report/img/up.png +0 -0
- package/src/components/weekly-report/index.scss +299 -0
- package/src/components/weekly-report/index.tsx +51 -0
- package/src/components/weekly-report/statistics.tsx +28 -0
- package/src/index.js +2 -1
- package/src/pages/aha2021/index.scss +0 -1
- package/src/pages/new-okr-list/header/filter.tsx +35 -4
- package/src/pages/new-okr-list/index.tsx +33 -5
- package/src/utils/helpers.ts +4 -1
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
+
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
+
|
|
14
|
+
function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure undefined"); }
|
|
15
|
+
|
|
16
|
+
var preCls = 'weekly-report-card__statistics';
|
|
17
|
+
|
|
18
|
+
function Statistics(_ref) {
|
|
19
|
+
_objectDestructuringEmpty(_ref);
|
|
20
|
+
|
|
21
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
22
|
+
className: preCls
|
|
23
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
24
|
+
className: (0, _classnames["default"])(preCls + '__item', preCls + '__finish')
|
|
25
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
26
|
+
className: preCls + '__num'
|
|
27
|
+
}, "12"), /*#__PURE__*/_react["default"].createElement("div", {
|
|
28
|
+
className: preCls + '__text'
|
|
29
|
+
}, "\u5B8C\u6210\u4EFB\u52A1")), /*#__PURE__*/_react["default"].createElement("div", {
|
|
30
|
+
className: (0, _classnames["default"])(preCls + '__item', preCls + '__praise')
|
|
31
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
32
|
+
className: preCls + '__num'
|
|
33
|
+
}, "12"), /*#__PURE__*/_react["default"].createElement("div", {
|
|
34
|
+
className: preCls + '__text'
|
|
35
|
+
}, "\u83B7\u5F97\u70B9\u8D5E"), /*#__PURE__*/_react["default"].createElement("div", {
|
|
36
|
+
className: preCls + '__tips'
|
|
37
|
+
}, "Top1")), /*#__PURE__*/_react["default"].createElement("div", {
|
|
38
|
+
className: (0, _classnames["default"])(preCls + '__item', preCls + '__communication')
|
|
39
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
40
|
+
className: preCls + '__num'
|
|
41
|
+
}, "12"), /*#__PURE__*/_react["default"].createElement("div", {
|
|
42
|
+
className: preCls + '__text'
|
|
43
|
+
}, "\u53C2\u4E0E\u4E92\u52A8")));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
var _default = Statistics;
|
|
47
|
+
exports["default"] = _default;
|
package/lib/index.js
CHANGED
|
@@ -465,6 +465,12 @@ Object.defineProperty(exports, "VersionChangeModal", {
|
|
|
465
465
|
return _versionChangeModal["default"];
|
|
466
466
|
}
|
|
467
467
|
});
|
|
468
|
+
Object.defineProperty(exports, "WeeklyReport", {
|
|
469
|
+
enumerable: true,
|
|
470
|
+
get: function get() {
|
|
471
|
+
return _weeklyReport["default"];
|
|
472
|
+
}
|
|
473
|
+
});
|
|
468
474
|
Object.defineProperty(exports, "WordCloud", {
|
|
469
475
|
enumerable: true,
|
|
470
476
|
get: function get() {
|
|
@@ -670,4 +676,6 @@ var _pointDemo = _interopRequireDefault(require("./components/point-demo"));
|
|
|
670
676
|
|
|
671
677
|
var _scrollbar = _interopRequireDefault(require("./components/scrollbar"));
|
|
672
678
|
|
|
679
|
+
var _weeklyReport = _interopRequireDefault(require("./components/weekly-report"));
|
|
680
|
+
|
|
673
681
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -17,6 +17,8 @@ var _periodSelector = _interopRequireDefault(require("../../../components/period
|
|
|
17
17
|
|
|
18
18
|
var _localStorage = require("../../../utils/local-storage");
|
|
19
19
|
|
|
20
|
+
var _tools = require("../../../utils/tools");
|
|
21
|
+
|
|
20
22
|
var _precls = require("../precls");
|
|
21
23
|
|
|
22
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -68,12 +70,59 @@ var Filter = function Filter(props) {
|
|
|
68
70
|
filterNum = _useState4[0],
|
|
69
71
|
setFilterNum = _useState4[1];
|
|
70
72
|
|
|
71
|
-
var _useState5 = (0, _react.useState)(
|
|
73
|
+
var _useState5 = (0, _react.useState)(function () {
|
|
74
|
+
var routerData = (0, _tools.getQueryString)();
|
|
75
|
+
var annualNum = routerData.annualNum,
|
|
76
|
+
cycleType = routerData.cycleType,
|
|
77
|
+
yqmNum = routerData.yqmNum;
|
|
78
|
+
|
|
79
|
+
if (!!annualNum && !!cycleType && !!yqmNum) {
|
|
80
|
+
return {
|
|
81
|
+
annualNum: annualNum,
|
|
82
|
+
cycleType: cycleType,
|
|
83
|
+
yqmNum: yqmNum
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return useLocalStorage.getItem("okr-filter-cycle") || "";
|
|
88
|
+
}),
|
|
72
89
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
73
90
|
cycle = _useState6[0],
|
|
74
91
|
setCycle = _useState6[1];
|
|
75
92
|
|
|
93
|
+
(0, _react.useEffect)(function () {
|
|
94
|
+
var routerData = (0, _tools.getQueryString)();
|
|
95
|
+
var annualNum = routerData.annualNum,
|
|
96
|
+
cycleType = routerData.cycleType,
|
|
97
|
+
yqmNum = routerData.yqmNum;
|
|
98
|
+
|
|
99
|
+
if (!!annualNum && !!cycleType && !!yqmNum) {
|
|
100
|
+
var _cycle = {
|
|
101
|
+
annualNum: annualNum,
|
|
102
|
+
cycleType: cycleType,
|
|
103
|
+
yqmNum: yqmNum
|
|
104
|
+
};
|
|
105
|
+
setCycle(_cycle);
|
|
106
|
+
onSearch(_cycle);
|
|
107
|
+
}
|
|
108
|
+
}, []);
|
|
109
|
+
|
|
110
|
+
var changeCycleUrl = function changeCycleUrl(s) {
|
|
111
|
+
var routerData = (0, _tools.getQueryString)();
|
|
112
|
+
var annualNum = routerData.annualNum,
|
|
113
|
+
cycleType = routerData.cycleType,
|
|
114
|
+
yqmNum = routerData.yqmNum,
|
|
115
|
+
toUserId = routerData.toUserId;
|
|
116
|
+
|
|
117
|
+
if (!!annualNum && !!cycleType && !!yqmNum) {
|
|
118
|
+
var origin = window.location.href.split('?')[0];
|
|
119
|
+
var url = "".concat(origin, "?cycleType=").concat(s.cycleType, "&yqmNum=").concat(s.yqmNum, "&annualNum=").concat(s.annualNum, "&toUserId=").concat(toUserId);
|
|
120
|
+
history.pushState('', '', url);
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
|
|
76
124
|
var handleChangeCycle = function handleChangeCycle(s) {
|
|
125
|
+
changeCycleUrl(s);
|
|
77
126
|
setCycle(s);
|
|
78
127
|
onSearch && onSearch({
|
|
79
128
|
annualNum: s.annualNum,
|
|
@@ -88,7 +137,7 @@ var Filter = function Filter(props) {
|
|
|
88
137
|
};
|
|
89
138
|
|
|
90
139
|
return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
91
|
-
className: "".concat(_precls.precls, "__header-filter")
|
|
140
|
+
className: "".concat(_precls.precls, "__header-filter okr-list__twinkle")
|
|
92
141
|
}, /*#__PURE__*/_react["default"].createElement(_periodSelector["default"], {
|
|
93
142
|
selected: cycle,
|
|
94
143
|
yearsRange: [2019, 2030],
|
|
@@ -90,11 +90,28 @@ var NewOkrList = function NewOkrList(props) {
|
|
|
90
90
|
targetCategory: "",
|
|
91
91
|
targetSort: ""
|
|
92
92
|
};
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
93
|
+
|
|
94
|
+
var filterCycle = function filterCycle() {
|
|
95
|
+
var routerData = (0, _tools.getQueryString)();
|
|
96
|
+
var annualNum = routerData.annualNum,
|
|
97
|
+
cycleType = routerData.cycleType,
|
|
98
|
+
yqmNum = routerData.yqmNum;
|
|
99
|
+
|
|
100
|
+
if (!!annualNum && !!cycleType && !!yqmNum) {
|
|
101
|
+
return {
|
|
102
|
+
annualNum: annualNum,
|
|
103
|
+
cycleType: cycleType,
|
|
104
|
+
yqmNum: yqmNum
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
return useLocalStorage.getItem("okr-filter-cycle") || {
|
|
109
|
+
annualNum: new Date().getFullYear() + "",
|
|
110
|
+
cycleType: "2",
|
|
111
|
+
yqmNum: "".concat((0, _moment["default"])().quarter())
|
|
112
|
+
};
|
|
97
113
|
};
|
|
114
|
+
|
|
98
115
|
var showWorkExecution = (0, _bsGlobal.getBSGlobal)("OkrAdvancedSetting").KRSetting.ShowWorkExecution;
|
|
99
116
|
|
|
100
117
|
var _useState = (0, _react.useState)(true),
|
|
@@ -249,6 +266,23 @@ var NewOkrList = function NewOkrList(props) {
|
|
|
249
266
|
_toast["default"].Success("成功套用");
|
|
250
267
|
};
|
|
251
268
|
|
|
269
|
+
var triggerAnimation = function triggerAnimation() {
|
|
270
|
+
//@ts-ignore
|
|
271
|
+
document.querySelector('.tita-okr-list-v2').scrollTop = 0;
|
|
272
|
+
var twinkleEles = document.getElementsByClassName('okr-list__twinkle');
|
|
273
|
+
|
|
274
|
+
var _loop = function _loop(i) {
|
|
275
|
+
twinkleEles[i].classList.add('okr-list__twinkle--animation');
|
|
276
|
+
setTimeout(function () {
|
|
277
|
+
twinkleEles[i].classList.remove('okr-list__twinkle--animation');
|
|
278
|
+
}, 3000);
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
for (var i = 0; i < twinkleEles.length; i++) {
|
|
282
|
+
_loop(i);
|
|
283
|
+
}
|
|
284
|
+
};
|
|
285
|
+
|
|
252
286
|
var onCasesCloseHandler = function onCasesCloseHandler() {
|
|
253
287
|
return setCasesVisible(false);
|
|
254
288
|
};
|
|
@@ -305,7 +339,12 @@ var NewOkrList = function NewOkrList(props) {
|
|
|
305
339
|
}
|
|
306
340
|
})), /*#__PURE__*/_react["default"].createElement(_initCycleSetting["default"], {
|
|
307
341
|
SetCycleModal: SetCycleModal
|
|
308
|
-
}), /*#__PURE__*/_react["default"].createElement(
|
|
342
|
+
}), !loading && /*#__PURE__*/_react["default"].createElement("div", {
|
|
343
|
+
className: "okr-list__check-filter-tips"
|
|
344
|
+
}, "\u627E\u4E0D\u5230OKR\uFF1F\u8BD5\u8BD5", /*#__PURE__*/_react["default"].createElement("span", {
|
|
345
|
+
className: "okr-list__check-filter-btn",
|
|
346
|
+
onClick: triggerAnimation
|
|
347
|
+
}, "\u68C0\u67E5"), "\u9876\u90E8\u7B5B\u9009\u6761\u4EF6"), /*#__PURE__*/_react["default"].createElement(_dialog["default"], {
|
|
309
348
|
zIndex: 99999,
|
|
310
349
|
noHeadLine: true,
|
|
311
350
|
visible: casesVisible,
|
package/lib/utils/helpers.js
CHANGED
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.cssSupport = cssSupport;
|
|
7
7
|
exports.escapeHtml = escapeHtml;
|
|
8
|
+
exports.getLoginUserInfo = void 0;
|
|
8
9
|
exports.getTenantInfo = getTenantInfo;
|
|
9
10
|
exports.getUploadMaxSize = getUploadMaxSize;
|
|
10
11
|
exports.isLocal = exports.isDingDing = void 0;
|
|
@@ -58,4 +59,10 @@ function escapeHtml(str) {
|
|
|
58
59
|
return str.replace(/(&|<|>|"|')/g, function (str) {
|
|
59
60
|
return htmlEscapes[str];
|
|
60
61
|
});
|
|
61
|
-
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
var getLoginUserInfo = function getLoginUserInfo() {
|
|
65
|
+
return (0, _bsGlobal.getBSGlobal)('loginUserInfo');
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
exports.getLoginUserInfo = getLoginUserInfo;
|
package/package.json
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import classNames from
|
|
3
|
-
import { TextBtnProps } from
|
|
4
|
-
import
|
|
5
|
-
const precls =
|
|
1
|
+
import React from "react";
|
|
2
|
+
import classNames from "classnames";
|
|
3
|
+
import { TextBtnProps } from "../types";
|
|
4
|
+
import "./index.scss";
|
|
5
|
+
const precls = "titaui-text-btn";
|
|
6
6
|
|
|
7
7
|
const TextBtn = (props: TextBtnProps) => {
|
|
8
8
|
const {
|
|
9
|
-
type =
|
|
10
|
-
icon =
|
|
11
|
-
|
|
12
|
-
text = '确定',
|
|
9
|
+
type = "default",
|
|
10
|
+
icon = "",
|
|
11
|
+
text = "确定",
|
|
13
12
|
onClick = () => {},
|
|
14
|
-
className =
|
|
13
|
+
className = "",
|
|
15
14
|
disabled = false,
|
|
15
|
+
style ={},
|
|
16
16
|
} = props;
|
|
17
17
|
|
|
18
18
|
const renderIcon = () => {
|
|
19
|
-
if (typeof icon ==
|
|
19
|
+
if (typeof icon == "string") {
|
|
20
20
|
return (
|
|
21
21
|
<span className={`${precls}__icon`}>
|
|
22
22
|
<span className={icon} />
|
|
@@ -37,10 +37,10 @@ const TextBtn = (props: TextBtnProps) => {
|
|
|
37
37
|
precls,
|
|
38
38
|
`${precls}--${type}`,
|
|
39
39
|
{ [`${precls}--disabled`]: disabled },
|
|
40
|
-
className
|
|
40
|
+
className
|
|
41
41
|
)}
|
|
42
42
|
onClick={onClickHandler}
|
|
43
|
-
style={
|
|
43
|
+
style={style}
|
|
44
44
|
>
|
|
45
45
|
{icon && renderIcon()}
|
|
46
46
|
{text}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
.okr-share-card {
|
|
2
|
+
position: relative;
|
|
3
|
+
width: 340px;
|
|
4
|
+
height: 434px;
|
|
5
|
+
border-radius: 24px;
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
align-items: center;
|
|
9
|
+
box-sizing: border-box;
|
|
10
|
+
overflow: hidden;
|
|
11
|
+
&-user__name {
|
|
12
|
+
margin-top: 4px;
|
|
13
|
+
font-size: 14px;
|
|
14
|
+
font-weight: bold;
|
|
15
|
+
color: #141c28;
|
|
16
|
+
line-height: 22px;
|
|
17
|
+
display: flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
> span {
|
|
20
|
+
max-width: 170px;
|
|
21
|
+
margin-right: 5px;
|
|
22
|
+
white-space: nowrap;
|
|
23
|
+
overflow: hidden;
|
|
24
|
+
text-overflow: ellipsis;
|
|
25
|
+
word-break: break-all;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
&::after {
|
|
29
|
+
content: "";
|
|
30
|
+
position: absolute;
|
|
31
|
+
height: 70px;
|
|
32
|
+
bottom: 0;
|
|
33
|
+
left: 0px;
|
|
34
|
+
right: 0px;
|
|
35
|
+
border-bottom-left-radius: 24px;
|
|
36
|
+
border-bottom-right-radius: 24px;
|
|
37
|
+
}
|
|
38
|
+
&-user__dept {
|
|
39
|
+
font-size: 12px;
|
|
40
|
+
font-weight: 400;
|
|
41
|
+
color: #3f4755;
|
|
42
|
+
line-height: 18px;
|
|
43
|
+
max-width: 200px;
|
|
44
|
+
white-space: nowrap;
|
|
45
|
+
overflow: hidden;
|
|
46
|
+
text-overflow: ellipsis;
|
|
47
|
+
word-break: break-all;
|
|
48
|
+
}
|
|
49
|
+
.card-okr__content {
|
|
50
|
+
flex: 1;
|
|
51
|
+
display: flex;
|
|
52
|
+
flex-direction: column;
|
|
53
|
+
justify-content: center;
|
|
54
|
+
padding-bottom: 50px;
|
|
55
|
+
}
|
|
56
|
+
.card-okr__name {
|
|
57
|
+
position: relative;
|
|
58
|
+
width: 250px;
|
|
59
|
+
font-size: 18px;
|
|
60
|
+
font-weight: bold;
|
|
61
|
+
color: #141c28;
|
|
62
|
+
line-height: 24px;
|
|
63
|
+
margin-top: 24px;
|
|
64
|
+
margin-bottom: 28px;
|
|
65
|
+
text-align: center;
|
|
66
|
+
&::before,
|
|
67
|
+
&::after {
|
|
68
|
+
content: "";
|
|
69
|
+
display: block;
|
|
70
|
+
position: absolute;
|
|
71
|
+
width: 16px;
|
|
72
|
+
height: 16px;
|
|
73
|
+
background-size: 100% 100%;
|
|
74
|
+
background-repeat: no-repeat;
|
|
75
|
+
}
|
|
76
|
+
&::before {
|
|
77
|
+
top: -16px;
|
|
78
|
+
left: -16px;
|
|
79
|
+
}
|
|
80
|
+
&::after {
|
|
81
|
+
bottom: -16px;
|
|
82
|
+
right: -16px;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
.card-kr__wrapper {
|
|
86
|
+
width: 100%;
|
|
87
|
+
max-height: 240px;
|
|
88
|
+
position: relative;
|
|
89
|
+
overflow: hidden;
|
|
90
|
+
display: flex;
|
|
91
|
+
flex-direction: column;
|
|
92
|
+
align-items: center;
|
|
93
|
+
}
|
|
94
|
+
.card-kr__item {
|
|
95
|
+
font-size: 14px;
|
|
96
|
+
font-weight: 400;
|
|
97
|
+
color: #3f4755;
|
|
98
|
+
line-height: 22px;
|
|
99
|
+
margin-bottom: 6px;
|
|
100
|
+
position: relative;
|
|
101
|
+
width: 250px;
|
|
102
|
+
text-align: left;
|
|
103
|
+
&::before {
|
|
104
|
+
content: "";
|
|
105
|
+
position: absolute;
|
|
106
|
+
width: 6px;
|
|
107
|
+
height: 6px;
|
|
108
|
+
border-radius: 50%;
|
|
109
|
+
top: 8px;
|
|
110
|
+
left: -14px;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
.okr-share-card__selector {
|
|
115
|
+
position: relative;
|
|
116
|
+
.tu-icon-close {
|
|
117
|
+
position: absolute;
|
|
118
|
+
top: -8.25px;
|
|
119
|
+
right: -20px;
|
|
120
|
+
font-size: 16.5px;
|
|
121
|
+
color: #fff;
|
|
122
|
+
}
|
|
123
|
+
.share-card-button__wrapper {
|
|
124
|
+
display: flex;
|
|
125
|
+
align-items: center;
|
|
126
|
+
justify-content: center;
|
|
127
|
+
}
|
|
128
|
+
.share-card-button {
|
|
129
|
+
box-sizing: border-box;
|
|
130
|
+
width: 120px;
|
|
131
|
+
height: 36px;
|
|
132
|
+
border-radius: 18px;
|
|
133
|
+
display: flex;
|
|
134
|
+
align-items: center;
|
|
135
|
+
justify-content: center;
|
|
136
|
+
margin: 20px 6px 0;
|
|
137
|
+
font-size: 14px;
|
|
138
|
+
color: #ffffff;
|
|
139
|
+
transition: all 0.2s ease;
|
|
140
|
+
&.download {
|
|
141
|
+
border: 1px solid #ffffff;
|
|
142
|
+
&:hover {
|
|
143
|
+
background-color: rgba(255, 255, 255, 0.2);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
&.share {
|
|
147
|
+
background: rgba($color: #5c8eff, $alpha: 0);
|
|
148
|
+
position: relative;
|
|
149
|
+
&::after {
|
|
150
|
+
content: "";
|
|
151
|
+
position: absolute;
|
|
152
|
+
z-index: -1;
|
|
153
|
+
background: linear-gradient(180deg, #88bcff 0%, #2879ff 100%);
|
|
154
|
+
border-radius: 18px;
|
|
155
|
+
top: 0;
|
|
156
|
+
right: 0;
|
|
157
|
+
bottom: 0;
|
|
158
|
+
left: 0;
|
|
159
|
+
}
|
|
160
|
+
&:hover {
|
|
161
|
+
background: rgba($color: #5c8eff, $alpha: 1);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
.okr-share-mblog {
|
|
167
|
+
&__container {
|
|
168
|
+
width: 480px;
|
|
169
|
+
height: 420px;
|
|
170
|
+
background-color: #fff;
|
|
171
|
+
border-radius: 6px;
|
|
172
|
+
}
|
|
173
|
+
&__header {
|
|
174
|
+
height: 58px;
|
|
175
|
+
padding: 0 32px;
|
|
176
|
+
display: flex;
|
|
177
|
+
align-items: center;
|
|
178
|
+
font-size: 18px;
|
|
179
|
+
font-weight: bold;
|
|
180
|
+
color: #141c28;
|
|
181
|
+
line-height: 26px;
|
|
182
|
+
border-bottom: 1px solid #e9ecf0;
|
|
183
|
+
justify-content: space-between;
|
|
184
|
+
.tu-icon-close {
|
|
185
|
+
cursor: pointer;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
&__body {
|
|
189
|
+
padding: 16px 32px 20px;
|
|
190
|
+
}
|
|
191
|
+
&__attachment {
|
|
192
|
+
width: 118px;
|
|
193
|
+
height: 160px;
|
|
194
|
+
overflow: hidden;
|
|
195
|
+
> img {
|
|
196
|
+
width: 100%;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import React, { useRef, useState,useEffect } from 'react';
|
|
2
|
+
import { Modal } from 'tita-ui';
|
|
3
|
+
import PublishMblog from './publishMblog';
|
|
4
|
+
import Queue from 'rc-queue-anim';
|
|
5
|
+
import './index.scss';
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
closeModal: Function;
|
|
9
|
+
getModalRef: Function;
|
|
10
|
+
uid: string;
|
|
11
|
+
shareComponent: any;
|
|
12
|
+
shareImage?:string
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const ShareContent = function({ closeModal, getModalRef, uid,shareComponent,shareImage }: Props) {
|
|
16
|
+
const [showPublish, setShowPublish] = useState(false);
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
if(shareImage){
|
|
19
|
+
setTimeout(() => {
|
|
20
|
+
setShowPublish(true)
|
|
21
|
+
}, 200);
|
|
22
|
+
}
|
|
23
|
+
}, [shareImage])
|
|
24
|
+
return (
|
|
25
|
+
<Queue type='bottom'>
|
|
26
|
+
{!shareImage && (
|
|
27
|
+
shareComponent
|
|
28
|
+
)}
|
|
29
|
+
{showPublish && shareImage && (
|
|
30
|
+
<PublishMblog
|
|
31
|
+
base64={shareImage}
|
|
32
|
+
getModalRef={getModalRef}
|
|
33
|
+
closeModal={closeModal}
|
|
34
|
+
key='publish'
|
|
35
|
+
uid={uid}
|
|
36
|
+
/>
|
|
37
|
+
)}
|
|
38
|
+
</Queue>
|
|
39
|
+
);
|
|
40
|
+
};
|
|
41
|
+
export interface ShareData {
|
|
42
|
+
okrName: string;
|
|
43
|
+
okrId: number;
|
|
44
|
+
krs: string[];
|
|
45
|
+
user: {
|
|
46
|
+
name: string;
|
|
47
|
+
userId: number;
|
|
48
|
+
departmentName: string;
|
|
49
|
+
departmentId: number;
|
|
50
|
+
avatar: {
|
|
51
|
+
color: string;
|
|
52
|
+
src?: string;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
interface ShareProps {
|
|
57
|
+
uid: any;
|
|
58
|
+
visible:boolean;
|
|
59
|
+
onClose: () => void
|
|
60
|
+
shareComponent: (share:(img:string) => void) => any
|
|
61
|
+
}
|
|
62
|
+
const OkrShare: React.FC<ShareProps> = ({ uid,visible,onClose,shareComponent }) => {
|
|
63
|
+
const [shareImage,setShareImage] = useState<string>()
|
|
64
|
+
const modalRef = useRef<any>();
|
|
65
|
+
|
|
66
|
+
return (
|
|
67
|
+
<>
|
|
68
|
+
<Modal
|
|
69
|
+
visible={visible}
|
|
70
|
+
className="document-mouse-event-ignore"
|
|
71
|
+
destroyOnClose
|
|
72
|
+
customContent
|
|
73
|
+
// maskClosable
|
|
74
|
+
onCancel={() => onClose()}
|
|
75
|
+
ref={modalRef}
|
|
76
|
+
>
|
|
77
|
+
{visible ? (
|
|
78
|
+
<ShareContent
|
|
79
|
+
closeModal={() => onClose()}
|
|
80
|
+
getModalRef={() => modalRef.current.getRef()}
|
|
81
|
+
uid={uid}
|
|
82
|
+
shareImage={shareImage}
|
|
83
|
+
shareComponent={shareComponent(setShareImage)}
|
|
84
|
+
/>
|
|
85
|
+
) : null}
|
|
86
|
+
</Modal>
|
|
87
|
+
</>
|
|
88
|
+
);
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
export default OkrShare;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import React, { ReactElement, useEffect, useState } from "react";
|
|
2
|
+
import MBlog from "../mblog";
|
|
3
|
+
import MBlogContext from "../mblog/context";
|
|
4
|
+
import { findDOMNode } from "react-dom";
|
|
5
|
+
import { addShare, uploadBase64 } from "./request-apis";
|
|
6
|
+
import Toast from "../toast";
|
|
7
|
+
import { getBSGlobal } from "../../utils/bs-global";
|
|
8
|
+
|
|
9
|
+
const loginUserId = getBSGlobal("loginUserInfo").Id;
|
|
10
|
+
|
|
11
|
+
interface Props {
|
|
12
|
+
base64: string;
|
|
13
|
+
getModalRef: Function;
|
|
14
|
+
closeModal: Function;
|
|
15
|
+
uid: any;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function PublishMblog({
|
|
19
|
+
base64,
|
|
20
|
+
getModalRef,
|
|
21
|
+
closeModal,
|
|
22
|
+
uid,
|
|
23
|
+
}: Props): ReactElement {
|
|
24
|
+
const [file, setFile] = useState({ url: "", pending: true });
|
|
25
|
+
const [status, setStatus] = useState(0);
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
uploadBase64(base64.split(",")[1]).then((res) => {
|
|
28
|
+
setFile({
|
|
29
|
+
url: res.Data.obj,
|
|
30
|
+
pending: false,
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
}, []);
|
|
34
|
+
return (
|
|
35
|
+
<div className="okr-share-mblog__container">
|
|
36
|
+
<div className="okr-share-mblog__header">
|
|
37
|
+
发布动态
|
|
38
|
+
<i className="tu-icon-close" onClick={() => closeModal()} />
|
|
39
|
+
</div>
|
|
40
|
+
<div className="okr-share-mblog__body">
|
|
41
|
+
<MBlogContext.Provider
|
|
42
|
+
value={{ popContainer: findDOMNode(getModalRef()) }}
|
|
43
|
+
>
|
|
44
|
+
<MBlog
|
|
45
|
+
autoResizing={false}
|
|
46
|
+
defaultContent="秀一秀我的 OKR"
|
|
47
|
+
submitStatus={status}
|
|
48
|
+
commentsTypeKey={"share-okr" + loginUserId + uid}
|
|
49
|
+
autoFocus
|
|
50
|
+
onMblogSubmit={async (type, data) => {
|
|
51
|
+
if (file.pending) {
|
|
52
|
+
return Toast.Error("图片正在上传...");
|
|
53
|
+
}
|
|
54
|
+
setStatus(2);
|
|
55
|
+
await addShare({
|
|
56
|
+
...data,
|
|
57
|
+
FileUrls: file.url,
|
|
58
|
+
Visibility: 1,
|
|
59
|
+
isSendSMS: false,
|
|
60
|
+
});
|
|
61
|
+
Toast.Success("分享成功");
|
|
62
|
+
setStatus(1);
|
|
63
|
+
closeModal();
|
|
64
|
+
}}
|
|
65
|
+
isShowAttachment={false}
|
|
66
|
+
isShowSendSms={false}
|
|
67
|
+
isShowBtnCancel={false}
|
|
68
|
+
isShowRange={false}
|
|
69
|
+
/>
|
|
70
|
+
</MBlogContext.Provider>
|
|
71
|
+
<div className="okr-share-mblog__attachment">
|
|
72
|
+
<img src={base64} alt="" />
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export default PublishMblog;
|