@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,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = _default;
|
|
7
|
+
|
|
8
|
+
var _openData = require("&/components/common/openData");
|
|
9
|
+
|
|
10
|
+
var _helper = require("&/components/helper");
|
|
11
|
+
|
|
12
|
+
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); } }
|
|
13
|
+
|
|
14
|
+
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); }); }; }
|
|
15
|
+
|
|
16
|
+
function _default(_x, _x2, _x3) {
|
|
17
|
+
return _ref.apply(this, arguments);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function _ref() {
|
|
21
|
+
_ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(ctx, openDataParams, lineHeight) {
|
|
22
|
+
var maxWidth,
|
|
23
|
+
name,
|
|
24
|
+
_ctx$measureText,
|
|
25
|
+
width,
|
|
26
|
+
actualWidth,
|
|
27
|
+
_args = arguments;
|
|
28
|
+
|
|
29
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
30
|
+
while (1) {
|
|
31
|
+
switch (_context.prev = _context.next) {
|
|
32
|
+
case 0:
|
|
33
|
+
maxWidth = _args.length > 3 && _args[3] !== undefined ? _args[3] : Infinity;
|
|
34
|
+
name = openDataParams.name;
|
|
35
|
+
|
|
36
|
+
if (!(0, _helper.isWx)()) {
|
|
37
|
+
_context.next = 6;
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
_context.next = 5;
|
|
42
|
+
return getOpenData(openDataParams);
|
|
43
|
+
|
|
44
|
+
case 5:
|
|
45
|
+
name = _context.sent;
|
|
46
|
+
|
|
47
|
+
case 6:
|
|
48
|
+
_ctx$measureText = ctx.measureText(name), width = _ctx$measureText.width;
|
|
49
|
+
actualWidth = Math.min(width, maxWidth);
|
|
50
|
+
return _context.abrupt("return", {
|
|
51
|
+
width: actualWidth,
|
|
52
|
+
height: lineHeight,
|
|
53
|
+
draw: function draw(ctx, x, y) {
|
|
54
|
+
ctx.save();
|
|
55
|
+
ctx.textBaseline = 'middle';
|
|
56
|
+
ctx.beginPath();
|
|
57
|
+
ctx.rect(x, y, actualWidth, lineHeight);
|
|
58
|
+
ctx.clip();
|
|
59
|
+
ctx.fillText(name, x, y + lineHeight / 2);
|
|
60
|
+
ctx.closePath();
|
|
61
|
+
ctx.restore();
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
case 9:
|
|
66
|
+
case "end":
|
|
67
|
+
return _context.stop();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}, _callee);
|
|
71
|
+
}));
|
|
72
|
+
return _ref.apply(this, arguments);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
var getOpenData = function getOpenData(_ref2) {
|
|
76
|
+
var id = _ref2.id,
|
|
77
|
+
name = _ref2.name,
|
|
78
|
+
type = _ref2.type;
|
|
79
|
+
var openId = (0, _openData.getOpenId)(id, type);
|
|
80
|
+
if (!window['WWOpenData'] || !openId) return Promise.resolve(name);
|
|
81
|
+
return new Promise(function (resolve, reject) {
|
|
82
|
+
window['WWOpenData'].prefetch({
|
|
83
|
+
items: [{
|
|
84
|
+
id: openId,
|
|
85
|
+
type: type
|
|
86
|
+
}]
|
|
87
|
+
}, function (err, data) {
|
|
88
|
+
if (err) {
|
|
89
|
+
return reject(err);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
resolve(data.items[0].data);
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = _default;
|
|
7
|
+
|
|
8
|
+
function _default(canvas, ctx, width, height) {
|
|
9
|
+
var devicePixelRatio = window.devicePixelRatio || 1;
|
|
10
|
+
var data = ctx.getImageData(0, 0, canvas.width, canvas.height); //要将 canvas 的宽高设置成容器宽高的 2 倍
|
|
11
|
+
|
|
12
|
+
canvas.width = width * devicePixelRatio;
|
|
13
|
+
canvas.height = height * devicePixelRatio;
|
|
14
|
+
canvas.style.width = width + 'px';
|
|
15
|
+
canvas.style.height = height + 'px'; //然后将画布缩放,将图像放大两倍画到画布上
|
|
16
|
+
|
|
17
|
+
ctx.scale(devicePixelRatio, devicePixelRatio);
|
|
18
|
+
ctx.putImageData(data, 0, 0);
|
|
19
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.breakLinesForCanvas = breakLinesForCanvas;
|
|
7
|
+
exports.drawImage = drawImage;
|
|
8
|
+
exports.drawTextMiddle = drawTextMiddle;
|
|
9
|
+
|
|
10
|
+
function drawImage(ctx, url, x, y, width, height) {
|
|
11
|
+
return new Promise(function (res) {
|
|
12
|
+
var img = new Image();
|
|
13
|
+
img.src = url;
|
|
14
|
+
|
|
15
|
+
img.onload = function () {
|
|
16
|
+
ctx.drawImage(img, x, y, width, height);
|
|
17
|
+
res();
|
|
18
|
+
};
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function drawTextMiddle(ctx, text, x, y, lineHeight, maxWidth, textAlign) {
|
|
23
|
+
ctx.textBaseline = 'middle';
|
|
24
|
+
|
|
25
|
+
if (!maxWidth) {
|
|
26
|
+
ctx.fillText(text, x, y + lineHeight / 2);
|
|
27
|
+
return y + lineHeight;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
var lines = breakLinesForCanvas(ctx, text, maxWidth);
|
|
31
|
+
lines.forEach(function (l) {
|
|
32
|
+
var _ctx$measureText = ctx.measureText(l),
|
|
33
|
+
width = _ctx$measureText.width;
|
|
34
|
+
|
|
35
|
+
var left = x;
|
|
36
|
+
|
|
37
|
+
if (textAlign == 'center' && maxWidth) {
|
|
38
|
+
console.log(maxWidth, width);
|
|
39
|
+
left = (maxWidth - width) / 2 + x;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
ctx.fillText(l, left, y + lineHeight / 2);
|
|
43
|
+
y = y + lineHeight;
|
|
44
|
+
});
|
|
45
|
+
return y;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function findBreakPoint(text, width, context) {
|
|
49
|
+
var min = 0;
|
|
50
|
+
var max = text.length - 1;
|
|
51
|
+
|
|
52
|
+
while (min <= max) {
|
|
53
|
+
var middle = Math.floor((min + max) / 2);
|
|
54
|
+
var middleWidth = context.measureText(text.substr(0, middle)).width;
|
|
55
|
+
var oneCharWiderThanMiddleWidth = context.measureText(text.substr(0, middle + 1)).width;
|
|
56
|
+
|
|
57
|
+
if (middleWidth <= width && oneCharWiderThanMiddleWidth > width) {
|
|
58
|
+
return middle;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (middleWidth < width) {
|
|
62
|
+
min = middle + 1;
|
|
63
|
+
} else {
|
|
64
|
+
max = middle - 1;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return -1;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function breakLinesForCanvas(ctx, text, width) {
|
|
72
|
+
var result = [];
|
|
73
|
+
var breakPoint = 0;
|
|
74
|
+
|
|
75
|
+
while ((breakPoint = findBreakPoint(text, width, ctx)) !== -1) {
|
|
76
|
+
result.push(text.substr(0, breakPoint));
|
|
77
|
+
text = text.substr(breakPoint);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if (text) {
|
|
81
|
+
result.push(text);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return result;
|
|
85
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
.weekly-report-card__dialog .rc-dialog-content {
|
|
2
|
+
background-color: transparent;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.weekly-report-card-wrapper {
|
|
6
|
+
overflow: hidden;
|
|
7
|
+
width: 336px;
|
|
8
|
+
height: 548px;
|
|
9
|
+
border-radius: 24px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.weekly-report-card-wrapper .weekly-report-card-content {
|
|
13
|
+
position: relative;
|
|
14
|
+
top: -66px;
|
|
15
|
+
left: -20px;
|
|
16
|
+
transform: scale(0.9);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.weekly-report-card-content {
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
align-items: center;
|
|
23
|
+
width: 375px;
|
|
24
|
+
height: 710px;
|
|
25
|
+
background: linear-gradient(180deg, #B7D5FF 0%, #186FFF 100%);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.weekly-report-card__title {
|
|
29
|
+
width: 220px;
|
|
30
|
+
height: 40px;
|
|
31
|
+
margin-top: 48px;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.weekly-report-card__date-range {
|
|
35
|
+
font-size: 14px;
|
|
36
|
+
font-weight: 400;
|
|
37
|
+
color: #FFFFFF;
|
|
38
|
+
line-height: 20px;
|
|
39
|
+
margin-top: 11px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.weekly-report-card__body {
|
|
43
|
+
position: relative;
|
|
44
|
+
display: flex;
|
|
45
|
+
flex-direction: column;
|
|
46
|
+
align-items: center;
|
|
47
|
+
width: 335px;
|
|
48
|
+
height: 452px;
|
|
49
|
+
background: transparent;
|
|
50
|
+
padding-top: 55px;
|
|
51
|
+
border-radius: 12px;
|
|
52
|
+
background-image: url("./img/body.png");
|
|
53
|
+
background-size: 100% 100%;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.weekly-report-card__avatar {
|
|
57
|
+
position: absolute;
|
|
58
|
+
left: 129px;
|
|
59
|
+
top: 17px;
|
|
60
|
+
border: 3px solid #fff;
|
|
61
|
+
border-radius: 50%;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.weekly-report-card__avatar > img {
|
|
65
|
+
width: 72px;
|
|
66
|
+
height: 72px;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.weekly-report-card__shadow {
|
|
70
|
+
position: absolute;
|
|
71
|
+
box-shadow: 0px 0px 18px 0px rgba(40, 121, 255, 0.4);
|
|
72
|
+
width: 78px;
|
|
73
|
+
height: 78px;
|
|
74
|
+
border-radius: 50%;
|
|
75
|
+
top: 135px;
|
|
76
|
+
left: 150px;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.weekly-report-card__userName {
|
|
80
|
+
width: 295px;
|
|
81
|
+
height: 24px;
|
|
82
|
+
margin-top: 46px;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.weekly-report-card__text {
|
|
86
|
+
position: relative;
|
|
87
|
+
z-index: 1;
|
|
88
|
+
font-size: 18px;
|
|
89
|
+
font-weight: 500;
|
|
90
|
+
color: #2879FF;
|
|
91
|
+
line-height: 26px;
|
|
92
|
+
margin: 28px 0;
|
|
93
|
+
max-width: 279px;
|
|
94
|
+
text-align: center;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.weekly-report-card__quote {
|
|
98
|
+
position: absolute;
|
|
99
|
+
top: 142px;
|
|
100
|
+
left: 20px;
|
|
101
|
+
width: 22px;
|
|
102
|
+
height: 22px;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.weekly-report-card-board {
|
|
106
|
+
width: 154px;
|
|
107
|
+
height: 77px;
|
|
108
|
+
overflow: hidden;
|
|
109
|
+
position: relative;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.weekly-report-card-board__done {
|
|
113
|
+
position: absolute;
|
|
114
|
+
width: 154px;
|
|
115
|
+
height: 154px;
|
|
116
|
+
border-radius: 50%;
|
|
117
|
+
background: linear-gradient(360deg, #2879FF 0%, #5B8FF9 50%);
|
|
118
|
+
overflow: hidden;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.weekly-report-card-board__undone {
|
|
122
|
+
position: absolute;
|
|
123
|
+
width: 154px;
|
|
124
|
+
height: 77px;
|
|
125
|
+
background-color: #eaf1fe;
|
|
126
|
+
transform-origin: center bottom;
|
|
127
|
+
transform: rotate(90deg);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.weekly-report-card-board__space {
|
|
131
|
+
position: absolute;
|
|
132
|
+
width: 2px;
|
|
133
|
+
height: 77px;
|
|
134
|
+
bottom: 50%;
|
|
135
|
+
right: 50%;
|
|
136
|
+
transform-origin: center bottom;
|
|
137
|
+
background-color: #FFF;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.weekly-report-card-board__center {
|
|
141
|
+
display: flex;
|
|
142
|
+
align-items: flex-start;
|
|
143
|
+
justify-content: center;
|
|
144
|
+
position: absolute;
|
|
145
|
+
bottom: -47px;
|
|
146
|
+
left: 30px;
|
|
147
|
+
width: 94px;
|
|
148
|
+
height: 94px;
|
|
149
|
+
background: #FFF;
|
|
150
|
+
border-radius: 50%;
|
|
151
|
+
font-size: 24px;
|
|
152
|
+
font-weight: 600;
|
|
153
|
+
color: #141C28;
|
|
154
|
+
line-height: 24px;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.weekly-report-card-board__center > div {
|
|
158
|
+
display: flex;
|
|
159
|
+
align-items: flex-end;
|
|
160
|
+
justify-content: center;
|
|
161
|
+
width: 100%;
|
|
162
|
+
height: 47px;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.weekly-report-card-board__num {
|
|
166
|
+
position: absolute;
|
|
167
|
+
bottom: 0;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.weekly-report-card__comparison {
|
|
171
|
+
display: flex;
|
|
172
|
+
align-items: center;
|
|
173
|
+
margin-top: 6px;
|
|
174
|
+
font-size: 12px;
|
|
175
|
+
font-weight: 400;
|
|
176
|
+
color: #6F7886;
|
|
177
|
+
line-height: 18px;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.weekly-report-card__direction {
|
|
181
|
+
width: 13px;
|
|
182
|
+
height: 13px;
|
|
183
|
+
margin: 0 2px;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.weekly-report-card__colleague {
|
|
187
|
+
box-sizing: border-box;
|
|
188
|
+
display: flex;
|
|
189
|
+
align-items: center;
|
|
190
|
+
justify-content: center;
|
|
191
|
+
width: 275px;
|
|
192
|
+
height: 39px;
|
|
193
|
+
padding-top: 7px;
|
|
194
|
+
background-image: url("./img/triangle-pop.png");
|
|
195
|
+
background-size: 100% 100%;
|
|
196
|
+
font-size: 14px;
|
|
197
|
+
font-weight: 400;
|
|
198
|
+
color: #3F4755;
|
|
199
|
+
line-height: 24px;
|
|
200
|
+
margin-top: 6px;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.weekly-report-card__colleague > span {
|
|
204
|
+
color: #2879FF;
|
|
205
|
+
margin: 0 5px;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.weekly-report-card__statistics {
|
|
209
|
+
width: 100%;
|
|
210
|
+
padding: 0 20px;
|
|
211
|
+
box-sizing: border-box;
|
|
212
|
+
display: flex;
|
|
213
|
+
align-items: center;
|
|
214
|
+
justify-content: space-between;
|
|
215
|
+
margin-top: 29px;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.weekly-report-card__statistics__item {
|
|
219
|
+
position: relative;
|
|
220
|
+
display: flex;
|
|
221
|
+
flex-direction: column;
|
|
222
|
+
align-items: center;
|
|
223
|
+
padding: 7px 12px 0;
|
|
224
|
+
background-position: 0 20px;
|
|
225
|
+
background-size: 36px 36px;
|
|
226
|
+
background-repeat: no-repeat;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.weekly-report-card__statistics__finish {
|
|
230
|
+
background-image: url("./img/finish.png");
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.weekly-report-card__statistics__praise {
|
|
234
|
+
background-image: url("./img/praise.png");
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.weekly-report-card__statistics__communication {
|
|
238
|
+
background-image: url("./img/communication.png");
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.weekly-report-card__statistics__num {
|
|
242
|
+
font-size: 22px;
|
|
243
|
+
font-weight: 600;
|
|
244
|
+
color: #141C28;
|
|
245
|
+
line-height: 30px;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.weekly-report-card__statistics__text {
|
|
249
|
+
font-size: 13px;
|
|
250
|
+
font-weight: 400;
|
|
251
|
+
color: #6F7886;
|
|
252
|
+
line-height: 22px;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.weekly-report-card__statistics__tips {
|
|
256
|
+
position: absolute;
|
|
257
|
+
top: 0;
|
|
258
|
+
right: 0;
|
|
259
|
+
padding: 0 4px;
|
|
260
|
+
height: 17px;
|
|
261
|
+
background: linear-gradient(180deg, #F99797 0%, #F05E5E 100%);
|
|
262
|
+
border-radius: 9px 9px 9px 1px;
|
|
263
|
+
font-size: 11px;
|
|
264
|
+
color: #FFFFFF;
|
|
265
|
+
line-height: 17px;
|
|
266
|
+
text-align: center;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.weekly-report-card__laba {
|
|
270
|
+
position: absolute;
|
|
271
|
+
left: 0;
|
|
272
|
+
top: 118px;
|
|
273
|
+
width: 94px;
|
|
274
|
+
height: 65px;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.weekly-report-card__bofang {
|
|
278
|
+
position: absolute;
|
|
279
|
+
right: 0;
|
|
280
|
+
top: 130px;
|
|
281
|
+
width: 62px;
|
|
282
|
+
height: 66px;
|
|
283
|
+
z-index: 1;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
.weekly-report-card__bottom {
|
|
287
|
+
width: 320px;
|
|
288
|
+
height: 60px;
|
|
289
|
+
margin-top: 15px;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
.weekly-report-card__button-container {
|
|
293
|
+
display: flex;
|
|
294
|
+
margin-top: 20px;
|
|
295
|
+
justify-content: center;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
.weekly-report-card__download {
|
|
299
|
+
display: flex;
|
|
300
|
+
align-items: center;
|
|
301
|
+
justify-content: center;
|
|
302
|
+
width: 120px;
|
|
303
|
+
height: 36px;
|
|
304
|
+
margin-right: 12px;
|
|
305
|
+
border-radius: 18px;
|
|
306
|
+
border: 1px solid #FFFFFF;
|
|
307
|
+
background-color: transparent;
|
|
308
|
+
font-size: 14px;
|
|
309
|
+
color: #FFF;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
.weekly-report-card__download:hover {
|
|
313
|
+
background-color: transparent;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
.weekly-report-card__share {
|
|
317
|
+
display: flex;
|
|
318
|
+
align-items: center;
|
|
319
|
+
justify-content: center;
|
|
320
|
+
width: 120px;
|
|
321
|
+
height: 36px;
|
|
322
|
+
border-radius: 18px;
|
|
323
|
+
border: 1px solid #FFFFFF;
|
|
324
|
+
background: linear-gradient(360deg, #2879FF 0%, #5B8FF9 100%);
|
|
325
|
+
font-size: 14px;
|
|
326
|
+
color: #FFF;
|
|
327
|
+
border: none;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
.weekly-report-card__share:hover {
|
|
331
|
+
background: linear-gradient(360deg, #2879FF 0%, #5B8FF9 100%);
|
|
332
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
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 _rectBtn = _interopRequireDefault(require("../button/rect-btn"));
|
|
13
|
+
|
|
14
|
+
var _commonShare = _interopRequireDefault(require("../common-share"));
|
|
15
|
+
|
|
16
|
+
var _card = _interopRequireDefault(require("./card"));
|
|
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
|
+
function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure undefined"); }
|
|
39
|
+
|
|
40
|
+
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); } }
|
|
41
|
+
|
|
42
|
+
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); }); }; }
|
|
43
|
+
|
|
44
|
+
var preCls = "weekly-report-card";
|
|
45
|
+
|
|
46
|
+
function WeeklyReportPreview(_ref) {
|
|
47
|
+
var onShare = _ref.onShare;
|
|
48
|
+
var cardRef = (0, _react.useRef)();
|
|
49
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
50
|
+
style: {
|
|
51
|
+
position: "absolute",
|
|
52
|
+
left: "-999px"
|
|
53
|
+
}
|
|
54
|
+
}, /*#__PURE__*/_react["default"].createElement(_card["default"], {
|
|
55
|
+
ref: cardRef
|
|
56
|
+
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
57
|
+
className: preCls + "-wrapper"
|
|
58
|
+
}, /*#__PURE__*/_react["default"].createElement(_card["default"], null)), /*#__PURE__*/_react["default"].createElement("div", {
|
|
59
|
+
className: preCls + "__button-container"
|
|
60
|
+
}, /*#__PURE__*/_react["default"].createElement(_rectBtn["default"], {
|
|
61
|
+
className: preCls + "__download",
|
|
62
|
+
onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
63
|
+
var img, ele;
|
|
64
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
65
|
+
while (1) {
|
|
66
|
+
switch (_context.prev = _context.next) {
|
|
67
|
+
case 0:
|
|
68
|
+
_context.next = 2;
|
|
69
|
+
return cardRef.current.getImage();
|
|
70
|
+
|
|
71
|
+
case 2:
|
|
72
|
+
img = _context.sent;
|
|
73
|
+
ele = document.createElement("img");
|
|
74
|
+
ele.src = img;
|
|
75
|
+
ele.width = 375;
|
|
76
|
+
ele.style = "position:fixed;z-index:100000;top:0";
|
|
77
|
+
document.body.appendChild(ele);
|
|
78
|
+
|
|
79
|
+
case 8:
|
|
80
|
+
case "end":
|
|
81
|
+
return _context.stop();
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}, _callee);
|
|
85
|
+
}))
|
|
86
|
+
}, "\u4E0B\u8F7D\u56FE\u7247"), /*#__PURE__*/_react["default"].createElement(_rectBtn["default"], {
|
|
87
|
+
className: preCls + "__share",
|
|
88
|
+
onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
|
|
89
|
+
var img;
|
|
90
|
+
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
91
|
+
while (1) {
|
|
92
|
+
switch (_context2.prev = _context2.next) {
|
|
93
|
+
case 0:
|
|
94
|
+
_context2.next = 2;
|
|
95
|
+
return cardRef.current.getImage();
|
|
96
|
+
|
|
97
|
+
case 2:
|
|
98
|
+
img = _context2.sent;
|
|
99
|
+
onShare(img);
|
|
100
|
+
|
|
101
|
+
case 4:
|
|
102
|
+
case "end":
|
|
103
|
+
return _context2.stop();
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}, _callee2);
|
|
107
|
+
}))
|
|
108
|
+
}, "\u5206\u4EAB\u5230\u52A8\u6001")));
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function WeeklyReportModal(_ref4) {
|
|
112
|
+
_objectDestructuringEmpty(_ref4);
|
|
113
|
+
|
|
114
|
+
var _useState = (0, _react.useState)(),
|
|
115
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
116
|
+
visible = _useState2[0],
|
|
117
|
+
setVisible = _useState2[1];
|
|
118
|
+
|
|
119
|
+
return /*#__PURE__*/_react["default"].createElement(_commonShare["default"], {
|
|
120
|
+
uid: 1,
|
|
121
|
+
visible: true,
|
|
122
|
+
onClose: function onClose() {
|
|
123
|
+
return setVisible(false);
|
|
124
|
+
},
|
|
125
|
+
shareComponent: function shareComponent(onShare) {
|
|
126
|
+
return /*#__PURE__*/_react["default"].createElement(WeeklyReportPreview, {
|
|
127
|
+
onShare: onShare
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
var _default = WeeklyReportModal;
|
|
134
|
+
exports["default"] = _default;
|