@titaui/pc 1.7.24 → 1.7.28
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 +108 -0
- package/lib/components/common-share/publishMblog.js +157 -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/nav-top/components/user-message/index.js +9 -0
- package/lib/components/nav-top/index.js +2 -3
- 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 +231 -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/close.svg +22 -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 +352 -0
- package/lib/components/weekly-report/index.js +224 -0
- package/lib/components/weekly-report/interface.js +5 -0
- package/lib/components/weekly-report/statistics.js +44 -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 +45 -6
- 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 +95 -0
- package/src/components/common-share/publishMblog.tsx +81 -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/nav-top/components/user-message/index.tsx +6 -1
- package/src/components/nav-top/index.tsx +1 -2
- 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 +157 -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/close.svg +22 -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 +319 -0
- package/src/components/weekly-report/index.tsx +116 -0
- package/src/components/weekly-report/interface.ts +31 -0
- package/src/components/weekly-report/statistics.tsx +29 -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
- package/yarn-error.log +15894 -0
|
@@ -15,26 +15,26 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
|
|
|
15
15
|
|
|
16
16
|
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; }
|
|
17
17
|
|
|
18
|
-
var precls =
|
|
18
|
+
var precls = "titaui-text-btn";
|
|
19
19
|
|
|
20
20
|
var TextBtn = function TextBtn(props) {
|
|
21
21
|
var _props$type = props.type,
|
|
22
|
-
type = _props$type === void 0 ?
|
|
22
|
+
type = _props$type === void 0 ? "default" : _props$type,
|
|
23
23
|
_props$icon = props.icon,
|
|
24
|
-
icon = _props$icon === void 0 ?
|
|
25
|
-
_props$size = props.size,
|
|
26
|
-
size = _props$size === void 0 ? 14 : _props$size,
|
|
24
|
+
icon = _props$icon === void 0 ? "" : _props$icon,
|
|
27
25
|
_props$text = props.text,
|
|
28
|
-
text = _props$text === void 0 ?
|
|
26
|
+
text = _props$text === void 0 ? "确定" : _props$text,
|
|
29
27
|
_props$onClick = props.onClick,
|
|
30
28
|
onClick = _props$onClick === void 0 ? function () {} : _props$onClick,
|
|
31
29
|
_props$className = props.className,
|
|
32
|
-
className = _props$className === void 0 ?
|
|
30
|
+
className = _props$className === void 0 ? "" : _props$className,
|
|
33
31
|
_props$disabled = props.disabled,
|
|
34
|
-
disabled = _props$disabled === void 0 ? false : _props$disabled
|
|
32
|
+
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
33
|
+
_props$style = props.style,
|
|
34
|
+
style = _props$style === void 0 ? {} : _props$style;
|
|
35
35
|
|
|
36
36
|
var renderIcon = function renderIcon() {
|
|
37
|
-
if (typeof icon ==
|
|
37
|
+
if (typeof icon == "string") {
|
|
38
38
|
return /*#__PURE__*/_react["default"].createElement("span", {
|
|
39
39
|
className: "".concat(precls, "__icon")
|
|
40
40
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
@@ -55,9 +55,7 @@ var TextBtn = function TextBtn(props) {
|
|
|
55
55
|
return /*#__PURE__*/_react["default"].createElement("span", {
|
|
56
56
|
className: (0, _classnames["default"])(precls, "".concat(precls, "--").concat(type), _defineProperty({}, "".concat(precls, "--disabled"), disabled), className),
|
|
57
57
|
onClick: onClickHandler,
|
|
58
|
-
style:
|
|
59
|
-
fontSize: "".concat(size, "px")
|
|
60
|
-
}
|
|
58
|
+
style: style
|
|
61
59
|
}, icon && renderIcon(), text);
|
|
62
60
|
};
|
|
63
61
|
|
|
@@ -0,0 +1,223 @@
|
|
|
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
|
+
}
|
|
12
|
+
|
|
13
|
+
.okr-share-card-user__name {
|
|
14
|
+
margin-top: 4px;
|
|
15
|
+
font-size: 14px;
|
|
16
|
+
font-weight: bold;
|
|
17
|
+
color: #141c28;
|
|
18
|
+
line-height: 22px;
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.okr-share-card-user__name > span {
|
|
24
|
+
max-width: 170px;
|
|
25
|
+
margin-right: 5px;
|
|
26
|
+
white-space: nowrap;
|
|
27
|
+
overflow: hidden;
|
|
28
|
+
text-overflow: ellipsis;
|
|
29
|
+
word-break: break-all;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.okr-share-card::after {
|
|
33
|
+
content: "";
|
|
34
|
+
position: absolute;
|
|
35
|
+
height: 70px;
|
|
36
|
+
bottom: 0;
|
|
37
|
+
left: 0px;
|
|
38
|
+
right: 0px;
|
|
39
|
+
border-bottom-left-radius: 24px;
|
|
40
|
+
border-bottom-right-radius: 24px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.okr-share-card-user__dept {
|
|
44
|
+
font-size: 12px;
|
|
45
|
+
font-weight: 400;
|
|
46
|
+
color: #3f4755;
|
|
47
|
+
line-height: 18px;
|
|
48
|
+
max-width: 200px;
|
|
49
|
+
white-space: nowrap;
|
|
50
|
+
overflow: hidden;
|
|
51
|
+
text-overflow: ellipsis;
|
|
52
|
+
word-break: break-all;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.okr-share-card .card-okr__content {
|
|
56
|
+
flex: 1;
|
|
57
|
+
display: flex;
|
|
58
|
+
flex-direction: column;
|
|
59
|
+
justify-content: center;
|
|
60
|
+
padding-bottom: 50px;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.okr-share-card .card-okr__name {
|
|
64
|
+
position: relative;
|
|
65
|
+
width: 250px;
|
|
66
|
+
font-size: 18px;
|
|
67
|
+
font-weight: bold;
|
|
68
|
+
color: #141c28;
|
|
69
|
+
line-height: 24px;
|
|
70
|
+
margin-top: 24px;
|
|
71
|
+
margin-bottom: 28px;
|
|
72
|
+
text-align: center;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.okr-share-card .card-okr__name::before, .okr-share-card .card-okr__name::after {
|
|
76
|
+
content: "";
|
|
77
|
+
display: block;
|
|
78
|
+
position: absolute;
|
|
79
|
+
width: 16px;
|
|
80
|
+
height: 16px;
|
|
81
|
+
background-size: 100% 100%;
|
|
82
|
+
background-repeat: no-repeat;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.okr-share-card .card-okr__name::before {
|
|
86
|
+
top: -16px;
|
|
87
|
+
left: -16px;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.okr-share-card .card-okr__name::after {
|
|
91
|
+
bottom: -16px;
|
|
92
|
+
right: -16px;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.okr-share-card .card-kr__wrapper {
|
|
96
|
+
width: 100%;
|
|
97
|
+
max-height: 240px;
|
|
98
|
+
position: relative;
|
|
99
|
+
overflow: hidden;
|
|
100
|
+
display: flex;
|
|
101
|
+
flex-direction: column;
|
|
102
|
+
align-items: center;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.okr-share-card .card-kr__item {
|
|
106
|
+
font-size: 14px;
|
|
107
|
+
font-weight: 400;
|
|
108
|
+
color: #3f4755;
|
|
109
|
+
line-height: 22px;
|
|
110
|
+
margin-bottom: 6px;
|
|
111
|
+
position: relative;
|
|
112
|
+
width: 250px;
|
|
113
|
+
text-align: left;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.okr-share-card .card-kr__item::before {
|
|
117
|
+
content: "";
|
|
118
|
+
position: absolute;
|
|
119
|
+
width: 6px;
|
|
120
|
+
height: 6px;
|
|
121
|
+
border-radius: 50%;
|
|
122
|
+
top: 8px;
|
|
123
|
+
left: -14px;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.okr-share-card__selector {
|
|
127
|
+
position: relative;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.okr-share-card__selector .tu-icon-close {
|
|
131
|
+
position: absolute;
|
|
132
|
+
top: -8.25px;
|
|
133
|
+
right: -20px;
|
|
134
|
+
font-size: 16.5px;
|
|
135
|
+
color: #fff;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.okr-share-card__selector .share-card-button__wrapper {
|
|
139
|
+
display: flex;
|
|
140
|
+
align-items: center;
|
|
141
|
+
justify-content: center;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.okr-share-card__selector .share-card-button {
|
|
145
|
+
box-sizing: border-box;
|
|
146
|
+
width: 120px;
|
|
147
|
+
height: 36px;
|
|
148
|
+
border-radius: 18px;
|
|
149
|
+
display: flex;
|
|
150
|
+
align-items: center;
|
|
151
|
+
justify-content: center;
|
|
152
|
+
margin: 20px 6px 0;
|
|
153
|
+
font-size: 14px;
|
|
154
|
+
color: #ffffff;
|
|
155
|
+
transition: all 0.2s ease;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.okr-share-card__selector .share-card-button.download {
|
|
159
|
+
border: 1px solid #ffffff;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.okr-share-card__selector .share-card-button.download:hover {
|
|
163
|
+
background-color: rgba(255, 255, 255, 0.2);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.okr-share-card__selector .share-card-button.share {
|
|
167
|
+
background: rgba(92, 142, 255, 0);
|
|
168
|
+
position: relative;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.okr-share-card__selector .share-card-button.share::after {
|
|
172
|
+
content: "";
|
|
173
|
+
position: absolute;
|
|
174
|
+
z-index: -1;
|
|
175
|
+
background: linear-gradient(180deg, #88bcff 0%, #2879ff 100%);
|
|
176
|
+
border-radius: 18px;
|
|
177
|
+
top: 0;
|
|
178
|
+
right: 0;
|
|
179
|
+
bottom: 0;
|
|
180
|
+
left: 0;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.okr-share-card__selector .share-card-button.share:hover {
|
|
184
|
+
background: #5c8eff;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.okr-share-mblog__container {
|
|
188
|
+
width: 480px;
|
|
189
|
+
height: 420px;
|
|
190
|
+
background-color: #fff;
|
|
191
|
+
border-radius: 6px;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.okr-share-mblog__header {
|
|
195
|
+
height: 58px;
|
|
196
|
+
padding: 0 32px;
|
|
197
|
+
display: flex;
|
|
198
|
+
align-items: center;
|
|
199
|
+
font-size: 18px;
|
|
200
|
+
font-weight: bold;
|
|
201
|
+
color: #141c28;
|
|
202
|
+
line-height: 26px;
|
|
203
|
+
border-bottom: 1px solid #e9ecf0;
|
|
204
|
+
justify-content: space-between;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.okr-share-mblog__header .tu-icon-close {
|
|
208
|
+
cursor: pointer;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.okr-share-mblog__body {
|
|
212
|
+
padding: 16px 32px 20px;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.okr-share-mblog__attachment {
|
|
216
|
+
width: 118px;
|
|
217
|
+
height: 160px;
|
|
218
|
+
overflow: hidden;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.okr-share-mblog__attachment > img {
|
|
222
|
+
width: 100%;
|
|
223
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _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 _titaUi = require("tita-ui");
|
|
13
|
+
|
|
14
|
+
var _publishMblog = _interopRequireDefault(require("./publishMblog"));
|
|
15
|
+
|
|
16
|
+
var _rcQueueAnim = _interopRequireDefault(require("rc-queue-anim"));
|
|
17
|
+
|
|
18
|
+
require("./index.css");
|
|
19
|
+
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
21
|
+
|
|
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); }
|
|
23
|
+
|
|
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; }
|
|
25
|
+
|
|
26
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
27
|
+
|
|
28
|
+
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."); }
|
|
29
|
+
|
|
30
|
+
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); }
|
|
31
|
+
|
|
32
|
+
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; }
|
|
33
|
+
|
|
34
|
+
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; }
|
|
35
|
+
|
|
36
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
37
|
+
|
|
38
|
+
var ShareContent = function ShareContent(_ref) {
|
|
39
|
+
var closeModal = _ref.closeModal,
|
|
40
|
+
getModalRef = _ref.getModalRef,
|
|
41
|
+
uid = _ref.uid,
|
|
42
|
+
shareComponent = _ref.shareComponent,
|
|
43
|
+
shareImage = _ref.shareImage,
|
|
44
|
+
defaultContent = _ref.defaultContent;
|
|
45
|
+
|
|
46
|
+
var _useState = (0, _react.useState)(false),
|
|
47
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
48
|
+
showPublish = _useState2[0],
|
|
49
|
+
setShowPublish = _useState2[1];
|
|
50
|
+
|
|
51
|
+
(0, _react.useEffect)(function () {
|
|
52
|
+
if (shareImage) {
|
|
53
|
+
setTimeout(function () {
|
|
54
|
+
setShowPublish(true);
|
|
55
|
+
}, 200);
|
|
56
|
+
}
|
|
57
|
+
}, [shareImage]);
|
|
58
|
+
return /*#__PURE__*/_react["default"].createElement(_rcQueueAnim["default"], {
|
|
59
|
+
type: "bottom"
|
|
60
|
+
}, !shareImage && shareComponent, showPublish && shareImage && /*#__PURE__*/_react["default"].createElement(_publishMblog["default"], {
|
|
61
|
+
base64: shareImage,
|
|
62
|
+
getModalRef: getModalRef,
|
|
63
|
+
closeModal: closeModal,
|
|
64
|
+
key: "publish",
|
|
65
|
+
uid: uid,
|
|
66
|
+
defaultContent: defaultContent
|
|
67
|
+
}));
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
var OkrShare = function OkrShare(_ref2) {
|
|
71
|
+
var uid = _ref2.uid,
|
|
72
|
+
visible = _ref2.visible,
|
|
73
|
+
onClose = _ref2.onClose,
|
|
74
|
+
shareComponent = _ref2.shareComponent,
|
|
75
|
+
defaultContent = _ref2.defaultContent;
|
|
76
|
+
|
|
77
|
+
var _useState3 = (0, _react.useState)(),
|
|
78
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
79
|
+
shareImage = _useState4[0],
|
|
80
|
+
setShareImage = _useState4[1];
|
|
81
|
+
|
|
82
|
+
var modalRef = (0, _react.useRef)();
|
|
83
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_titaUi.Modal, {
|
|
84
|
+
visible: visible,
|
|
85
|
+
className: "document-mouse-event-ignore",
|
|
86
|
+
destroyOnClose: true,
|
|
87
|
+
customContent: true // maskClosable
|
|
88
|
+
,
|
|
89
|
+
onCancel: function onCancel() {
|
|
90
|
+
return onClose();
|
|
91
|
+
},
|
|
92
|
+
ref: modalRef
|
|
93
|
+
}, visible ? /*#__PURE__*/_react["default"].createElement(ShareContent, {
|
|
94
|
+
closeModal: function closeModal() {
|
|
95
|
+
return onClose();
|
|
96
|
+
},
|
|
97
|
+
getModalRef: function getModalRef() {
|
|
98
|
+
return modalRef.current.getRef();
|
|
99
|
+
},
|
|
100
|
+
uid: uid,
|
|
101
|
+
shareImage: shareImage,
|
|
102
|
+
defaultContent: defaultContent,
|
|
103
|
+
shareComponent: shareComponent(setShareImage)
|
|
104
|
+
}) : null));
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
var _default = OkrShare;
|
|
108
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _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 _mblog = _interopRequireDefault(require("../mblog"));
|
|
13
|
+
|
|
14
|
+
var _context2 = _interopRequireDefault(require("../mblog/context"));
|
|
15
|
+
|
|
16
|
+
var _reactDom = require("react-dom");
|
|
17
|
+
|
|
18
|
+
var _requestApis = require("./request-apis");
|
|
19
|
+
|
|
20
|
+
var _toast = _interopRequireDefault(require("../toast"));
|
|
21
|
+
|
|
22
|
+
var _bsGlobal = require("../../utils/bs-global");
|
|
23
|
+
|
|
24
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
25
|
+
|
|
26
|
+
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); }
|
|
27
|
+
|
|
28
|
+
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; }
|
|
29
|
+
|
|
30
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
31
|
+
|
|
32
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
33
|
+
|
|
34
|
+
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; }
|
|
35
|
+
|
|
36
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
37
|
+
|
|
38
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
39
|
+
|
|
40
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
41
|
+
|
|
42
|
+
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."); }
|
|
43
|
+
|
|
44
|
+
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); }
|
|
45
|
+
|
|
46
|
+
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; }
|
|
47
|
+
|
|
48
|
+
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; }
|
|
49
|
+
|
|
50
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
51
|
+
|
|
52
|
+
var loginUserId = (0, _bsGlobal.getBSGlobal)("loginUserInfo").Id;
|
|
53
|
+
|
|
54
|
+
function PublishMblog(_ref) {
|
|
55
|
+
var base64 = _ref.base64,
|
|
56
|
+
getModalRef = _ref.getModalRef,
|
|
57
|
+
closeModal = _ref.closeModal,
|
|
58
|
+
uid = _ref.uid,
|
|
59
|
+
_ref$defaultContent = _ref.defaultContent,
|
|
60
|
+
defaultContent = _ref$defaultContent === void 0 ? "秀一秀我的 OKR" : _ref$defaultContent;
|
|
61
|
+
|
|
62
|
+
var _useState = (0, _react.useState)({
|
|
63
|
+
url: "",
|
|
64
|
+
pending: true
|
|
65
|
+
}),
|
|
66
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
67
|
+
file = _useState2[0],
|
|
68
|
+
setFile = _useState2[1];
|
|
69
|
+
|
|
70
|
+
var _useState3 = (0, _react.useState)(0),
|
|
71
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
72
|
+
status = _useState4[0],
|
|
73
|
+
setStatus = _useState4[1];
|
|
74
|
+
|
|
75
|
+
(0, _react.useEffect)(function () {
|
|
76
|
+
(0, _requestApis.uploadBase64)(base64.split(",")[1]).then(function (res) {
|
|
77
|
+
setFile({
|
|
78
|
+
url: res.Data.obj,
|
|
79
|
+
pending: false
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
}, []);
|
|
83
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
84
|
+
className: "okr-share-mblog__container"
|
|
85
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
86
|
+
className: "okr-share-mblog__header"
|
|
87
|
+
}, "\u53D1\u5E03\u52A8\u6001", /*#__PURE__*/_react["default"].createElement("i", {
|
|
88
|
+
className: "tu-icon-close",
|
|
89
|
+
onClick: function onClick() {
|
|
90
|
+
return closeModal();
|
|
91
|
+
}
|
|
92
|
+
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
93
|
+
className: "okr-share-mblog__body"
|
|
94
|
+
}, /*#__PURE__*/_react["default"].createElement(_context2["default"].Provider, {
|
|
95
|
+
value: {
|
|
96
|
+
popContainer: (0, _reactDom.findDOMNode)(getModalRef())
|
|
97
|
+
}
|
|
98
|
+
}, /*#__PURE__*/_react["default"].createElement(_mblog["default"], {
|
|
99
|
+
autoResizing: false,
|
|
100
|
+
defaultContent: defaultContent,
|
|
101
|
+
submitStatus: status,
|
|
102
|
+
commentsTypeKey: "share-okr" + loginUserId + uid,
|
|
103
|
+
autoFocus: true,
|
|
104
|
+
onMblogSubmit: /*#__PURE__*/function () {
|
|
105
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(type, data) {
|
|
106
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
107
|
+
while (1) {
|
|
108
|
+
switch (_context.prev = _context.next) {
|
|
109
|
+
case 0:
|
|
110
|
+
if (!file.pending) {
|
|
111
|
+
_context.next = 2;
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return _context.abrupt("return", _toast["default"].Error("图片正在上传..."));
|
|
116
|
+
|
|
117
|
+
case 2:
|
|
118
|
+
setStatus(2);
|
|
119
|
+
_context.next = 5;
|
|
120
|
+
return (0, _requestApis.addShare)(_objectSpread(_objectSpread({}, data), {}, {
|
|
121
|
+
FileUrls: file.url,
|
|
122
|
+
Visibility: 1,
|
|
123
|
+
isSendSMS: false
|
|
124
|
+
}));
|
|
125
|
+
|
|
126
|
+
case 5:
|
|
127
|
+
_toast["default"].Success("分享成功");
|
|
128
|
+
|
|
129
|
+
setStatus(1);
|
|
130
|
+
closeModal();
|
|
131
|
+
|
|
132
|
+
case 8:
|
|
133
|
+
case "end":
|
|
134
|
+
return _context.stop();
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}, _callee);
|
|
138
|
+
}));
|
|
139
|
+
|
|
140
|
+
return function (_x, _x2) {
|
|
141
|
+
return _ref2.apply(this, arguments);
|
|
142
|
+
};
|
|
143
|
+
}(),
|
|
144
|
+
isShowAttachment: false,
|
|
145
|
+
isShowSendSms: false,
|
|
146
|
+
isShowBtnCancel: false,
|
|
147
|
+
isShowRange: false
|
|
148
|
+
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
149
|
+
className: "okr-share-mblog__attachment"
|
|
150
|
+
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
151
|
+
src: base64,
|
|
152
|
+
alt: ""
|
|
153
|
+
}))));
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
var _default = PublishMblog;
|
|
157
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.uploadBase64 = exports.getImageBase64ByUrl = exports.getBase64DownloadUrl = exports.addShare = void 0;
|
|
7
|
+
|
|
8
|
+
var _axios = _interopRequireDefault(require("axios"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
+
|
|
12
|
+
var tenantId = BSGlobal && BSGlobal.tenantInfo.Id || 0;
|
|
13
|
+
var userId = BSGlobal && BSGlobal.loginUserInfo.Id || 0;
|
|
14
|
+
|
|
15
|
+
var requestDomain = function requestDomain() {
|
|
16
|
+
if (!window.location.hostname.match(/dev/)) return '';
|
|
17
|
+
return 'http://www.tita.gift';
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
var getImageBase64ByUrl = function getImageBase64ByUrl(toUserId) {
|
|
21
|
+
return _axios["default"].post("".concat(requestDomain(), "/api/v1/").concat(tenantId, "/").concat(userId, "/okr/share/getBase64Str"), {
|
|
22
|
+
toUserId: toUserId
|
|
23
|
+
}).then(function (getBase64Str) {
|
|
24
|
+
return getBase64Str.data;
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
exports.getImageBase64ByUrl = getImageBase64ByUrl;
|
|
29
|
+
|
|
30
|
+
var getBase64DownloadUrl = function getBase64DownloadUrl(base64) {
|
|
31
|
+
return _axios["default"].post("".concat(requestDomain(), "/api/v1/").concat(tenantId, "/").concat(userId, "/okr/share/imageDownLoadDfs"), {
|
|
32
|
+
'SharePicLink': base64
|
|
33
|
+
}).then(function (dfs) {
|
|
34
|
+
return dfs.data;
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
exports.getBase64DownloadUrl = getBase64DownloadUrl;
|
|
39
|
+
|
|
40
|
+
var uploadBase64 = function uploadBase64(base64) {
|
|
41
|
+
return _axios["default"].post("".concat(requestDomain(), "/api/v1/").concat(tenantId, "/").concat(userId, "/okr/share/imagedfs"), {
|
|
42
|
+
'SharePicLink': base64
|
|
43
|
+
}).then(function (dfs) {
|
|
44
|
+
return dfs.data;
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
exports.uploadBase64 = uploadBase64;
|
|
49
|
+
|
|
50
|
+
var addShare = function addShare(data) {
|
|
51
|
+
return _axios["default"].post("".concat(requestDomain(), "/api/v2/").concat(tenantId, "/").concat(userId, "/user/feed/AddShare"), data).then(function (dfs) {
|
|
52
|
+
return dfs.data;
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
exports.addShare = addShare;
|
|
@@ -2,12 +2,17 @@
|
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
justify-content: center;
|
|
5
|
+
position: relative;
|
|
6
|
+
top: -17px;
|
|
7
|
+
width: 634px;
|
|
5
8
|
height: 36px;
|
|
6
|
-
|
|
9
|
+
margin: 0 auto;
|
|
7
10
|
font-size: 14px;
|
|
8
|
-
|
|
11
|
+
background: #FFF4D6;
|
|
12
|
+
box-shadow: 0px 4px 16px 0px rgba(127, 145, 180, 0.2);
|
|
13
|
+
border-radius: 18px;
|
|
9
14
|
font-weight: 400;
|
|
10
|
-
color: #
|
|
15
|
+
color: #704600;
|
|
11
16
|
line-height: 22px;
|
|
12
17
|
position: relative;
|
|
13
18
|
transition: all 0.3s linear;
|