@titaui/pc 1.12.75 → 1.12.77
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/color-date-picker/index.js +49 -9
- package/lib/components/dialog-upload/index.css +12 -0
- package/lib/components/dialog-upload/index.js +9 -4
- package/lib/components/dialog-upload/uploaded-preview.js +8 -2
- package/lib/components/dynamic/dynamic-item/components/okr-progress/index.css +5 -1
- package/lib/components/dynamic/dynamic-item/components/okr-progress/index.js +16 -6
- package/lib/components/dynamic/dynamic-item/components/progress/components/task-progress/index.js +4 -39
- package/lib/components/dynamic/dynamic-item/components/schedule/index.css +4 -0
- package/lib/components/dynamic/dynamic-item/components/schedule/index.js +7 -1
- package/lib/components/dynamic/dynamic-item/components/table-row-okr/index.css +1 -4
- package/lib/components/dynamic/dynamic-item/components/table-row-okr/index.js +6 -5
- package/lib/components/dynamic/dynamic-item/components/task-progress/index.js +10 -4
- package/lib/components/dynamic/dynamic-item/components/task-progress/render-row.js +1 -1
- package/lib/components/dynamic/dynamic-item/dynamic-new-report/index.css +0 -5
- package/lib/components/import-modal/tree/okr-tree/index.css +1 -1
- package/lib/components/import-modal/tree/task-work-tree/index.css +1 -1
- package/lib/components/new-confidence/index.css +1 -2
- package/lib/components/new-confidence/index.js +4 -2
- package/lib/components/percent-line-chart/index.css +5 -0
- package/lib/components/percent-line-chart/index.js +244 -0
- package/lib/components/percent-line-chart/until.js +137 -0
- package/lib/components/percent-line-chart/useChart.js +92 -0
- package/lib/index.js +8 -0
- package/package.json +1 -1
|
@@ -29,14 +29,22 @@ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableTo
|
|
|
29
29
|
|
|
30
30
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
31
31
|
|
|
32
|
-
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); }
|
|
33
|
-
|
|
34
32
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
35
33
|
|
|
36
34
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
37
35
|
|
|
36
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
37
|
+
|
|
38
|
+
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."); }
|
|
39
|
+
|
|
40
|
+
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); }
|
|
41
|
+
|
|
38
42
|
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; }
|
|
39
43
|
|
|
44
|
+
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; }
|
|
45
|
+
|
|
46
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
47
|
+
|
|
40
48
|
var prefix = "tita-ui-color-date-picker";
|
|
41
49
|
|
|
42
50
|
var ColorDatePicker = function ColorDatePicker(_ref) {
|
|
@@ -52,12 +60,32 @@ var ColorDatePicker = function ColorDatePicker(_ref) {
|
|
|
52
60
|
_ref$colGap = _ref.colGap,
|
|
53
61
|
colGap = _ref$colGap === void 0 ? 0 : _ref$colGap;
|
|
54
62
|
|
|
63
|
+
var _useState = (0, _react.useState)(false),
|
|
64
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
65
|
+
isMouseOver = _useState2[0],
|
|
66
|
+
setIsMouseOver = _useState2[1];
|
|
67
|
+
|
|
68
|
+
var _useState3 = (0, _react.useState)({}),
|
|
69
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
70
|
+
mouseOverItem = _useState4[0],
|
|
71
|
+
setMouseOverItem = _useState4[1];
|
|
72
|
+
|
|
55
73
|
var handleItemClick = function handleItemClick(data) {
|
|
56
74
|
if (onItemClick) {
|
|
57
75
|
onItemClick(data);
|
|
58
76
|
}
|
|
59
77
|
};
|
|
60
78
|
|
|
79
|
+
var handleMouseOverDate = function handleMouseOverDate(item) {
|
|
80
|
+
setIsMouseOver(true);
|
|
81
|
+
setMouseOverItem(item);
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
var handleMouseOutDate = function handleMouseOutDate() {
|
|
85
|
+
setIsMouseOver(false);
|
|
86
|
+
setMouseOverItem({});
|
|
87
|
+
};
|
|
88
|
+
|
|
61
89
|
var renderContent = (0, _react.useMemo)(function () {
|
|
62
90
|
var result = [];
|
|
63
91
|
|
|
@@ -76,9 +104,13 @@ var ColorDatePicker = function ColorDatePicker(_ref) {
|
|
|
76
104
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
77
105
|
className: "".concat(prefix, "__content-daily-text"),
|
|
78
106
|
style: {
|
|
79
|
-
background: value === item.value ? item.selectedBgColor : item.bgColor,
|
|
107
|
+
background: mouseOverItem === item && isMouseOver ? item.hoverbgColor : value === item.value ? item.selectedBgColor : item.bgColor,
|
|
80
108
|
color: value === item.value && item.bgColor ? "#ffffff" : item.color
|
|
81
|
-
}
|
|
109
|
+
},
|
|
110
|
+
onMouseOver: function onMouseOver() {
|
|
111
|
+
return handleMouseOverDate(item);
|
|
112
|
+
},
|
|
113
|
+
onMouseOut: handleMouseOutDate
|
|
82
114
|
}, item.text));
|
|
83
115
|
})));
|
|
84
116
|
} else if (type === _interface.EReportType.Weekly) {
|
|
@@ -89,9 +121,13 @@ var ColorDatePicker = function ColorDatePicker(_ref) {
|
|
|
89
121
|
return handleItemClick(item);
|
|
90
122
|
},
|
|
91
123
|
style: {
|
|
92
|
-
background: value === item.value ? item.selectedBgColor : item.bgColor,
|
|
124
|
+
background: mouseOverItem === item && isMouseOver ? item.hoverbgColor : value === item.value ? item.selectedBgColor : item.bgColor,
|
|
93
125
|
color: value === item.value && item.bgColor ? "#ffffff" : item.color
|
|
94
|
-
}
|
|
126
|
+
},
|
|
127
|
+
onMouseOver: function onMouseOver() {
|
|
128
|
+
return handleMouseOverDate(item);
|
|
129
|
+
},
|
|
130
|
+
onMouseOut: handleMouseOutDate
|
|
95
131
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
96
132
|
className: "".concat(prefix, "__content-weekly-text")
|
|
97
133
|
}, item.text, /*#__PURE__*/_react["default"].createElement("span", {
|
|
@@ -106,15 +142,19 @@ var ColorDatePicker = function ColorDatePicker(_ref) {
|
|
|
106
142
|
return handleItemClick(item);
|
|
107
143
|
},
|
|
108
144
|
style: {
|
|
109
|
-
background: value === item.value ? item.selectedBgColor : item.bgColor,
|
|
145
|
+
background: mouseOverItem === item && isMouseOver ? item.hoverbgColor : value === item.value ? item.selectedBgColor : item.bgColor,
|
|
110
146
|
color: value === item.value && item.bgColor ? "#ffffff" : item.color
|
|
111
|
-
}
|
|
147
|
+
},
|
|
148
|
+
onMouseOver: function onMouseOver() {
|
|
149
|
+
return handleMouseOverDate(item);
|
|
150
|
+
},
|
|
151
|
+
onMouseOut: handleMouseOutDate
|
|
112
152
|
}, item.text);
|
|
113
153
|
})));
|
|
114
154
|
}
|
|
115
155
|
|
|
116
156
|
return result;
|
|
117
|
-
}, [column, data, type, value]);
|
|
157
|
+
}, [column, data, type, value, isMouseOver]);
|
|
118
158
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
119
159
|
className: prefix,
|
|
120
160
|
style: {
|
|
@@ -5,6 +5,18 @@
|
|
|
5
5
|
overflow: auto;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
+
.titaui-dialog-upload__empty {
|
|
9
|
+
max-height: 442px;
|
|
10
|
+
min-height: 82px;
|
|
11
|
+
padding: 0 32px;
|
|
12
|
+
display: flex;
|
|
13
|
+
justify-content: center;
|
|
14
|
+
align-items: center;
|
|
15
|
+
line-height: 22px;
|
|
16
|
+
font-size: 14px;
|
|
17
|
+
color: #89919F;
|
|
18
|
+
}
|
|
19
|
+
|
|
8
20
|
.titaui-dialog-upload__preview {
|
|
9
21
|
margin: 10px 0;
|
|
10
22
|
}
|
|
@@ -72,7 +72,8 @@ var uploadUrl = (0, _helpers.getApiUrl)("Upload/PostFiles?format=json×tamp=
|
|
|
72
72
|
var Footer = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
73
73
|
var onUpload = _ref.onUpload,
|
|
74
74
|
onCancel = _ref.onCancel,
|
|
75
|
-
onOk = _ref.onOk
|
|
75
|
+
onOk = _ref.onOk,
|
|
76
|
+
files = _ref.files;
|
|
76
77
|
var uploader = (0, _react.useRef)();
|
|
77
78
|
(0, _react.useImperativeHandle)(ref, function () {
|
|
78
79
|
return {
|
|
@@ -129,7 +130,8 @@ var Footer = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
129
130
|
}, (0, _getLocale.getLocale)('Mod_Cancel')), /*#__PURE__*/_react["default"].createElement(_button["default"].Rect, {
|
|
130
131
|
type: "primary",
|
|
131
132
|
size: "big",
|
|
132
|
-
onClick: onOk
|
|
133
|
+
onClick: onOk,
|
|
134
|
+
disabled: (files === null || files === void 0 ? void 0 : files.length) === 0
|
|
133
135
|
}, (0, _getLocale.getLocale)('Mod_Determiness')));
|
|
134
136
|
});
|
|
135
137
|
|
|
@@ -267,6 +269,7 @@ function UploadDialog(_ref2) {
|
|
|
267
269
|
setFiles([]);
|
|
268
270
|
setVisible(false);
|
|
269
271
|
},
|
|
272
|
+
files: files,
|
|
270
273
|
onOk: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
271
274
|
var isUploading, uploadfiles;
|
|
272
275
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
@@ -316,7 +319,7 @@ function UploadDialog(_ref2) {
|
|
|
316
319
|
setFiles([]);
|
|
317
320
|
setVisible(false);
|
|
318
321
|
}
|
|
319
|
-
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
322
|
+
}, (files === null || files === void 0 ? void 0 : files.length) !== 0 ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
320
323
|
className: preCls + '__content'
|
|
321
324
|
}, files.map(function (f, index) {
|
|
322
325
|
return /*#__PURE__*/_react["default"].createElement(_uploadedPreview["default"], {
|
|
@@ -325,7 +328,9 @@ function UploadDialog(_ref2) {
|
|
|
325
328
|
onSubmit: handleSubmit,
|
|
326
329
|
className: preCls + '__preview'
|
|
327
330
|
});
|
|
328
|
-
}))
|
|
331
|
+
})) : /*#__PURE__*/_react["default"].createElement("div", {
|
|
332
|
+
className: preCls + '__empty'
|
|
333
|
+
}, (0, _getLocale.getLocale)('Rep_Tab_Mys_Noattachment'))));
|
|
329
334
|
}
|
|
330
335
|
|
|
331
336
|
var _default = UploadDialog;
|
|
@@ -47,6 +47,10 @@ var UploadedPreview = function UploadedPreview(_ref) {
|
|
|
47
47
|
src: uploadResultItem.ClientUrl || uploadResultItem.PreviewUrl,
|
|
48
48
|
className: "upload-preview-img"
|
|
49
49
|
}); // 上传成功且为图片时
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
var handleClickTitleToPreView = function handleClickTitleToPreView() {
|
|
53
|
+
onSubmit(index, 'preview');
|
|
50
54
|
}; // 删除、预览icon
|
|
51
55
|
|
|
52
56
|
|
|
@@ -106,7 +110,8 @@ var UploadedPreview = function UploadedPreview(_ref) {
|
|
|
106
110
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
107
111
|
className: "preview__content document-mouse-event-ignore ".concat(className, " ").concat(prefix)
|
|
108
112
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
109
|
-
className: "".concat(prefix, "__img-wrapper")
|
|
113
|
+
className: "".concat(prefix, "__img-wrapper"),
|
|
114
|
+
onClick: handleClickTitleToPreView
|
|
110
115
|
}, renderPreviewThumbnail()), /*#__PURE__*/_react["default"].createElement("div", {
|
|
111
116
|
className: "".concat(prefix, "__message-wrapper")
|
|
112
117
|
}, /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
|
|
@@ -115,7 +120,8 @@ var UploadedPreview = function UploadedPreview(_ref) {
|
|
|
115
120
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
116
121
|
className: "".concat(prefix, "__file-title"),
|
|
117
122
|
"data-tip": uploadResultItem.FileName,
|
|
118
|
-
key: uploadResultItem.Id
|
|
123
|
+
key: uploadResultItem.Id,
|
|
124
|
+
onClick: handleClickTitleToPreView
|
|
119
125
|
}, uploadResultItem.FileName, (uploadResultItem.uploadStatus === 2 || uploadResultItem.uploadStatus === 3) && uploadResultItem.percentComplete !== 100 ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
120
126
|
className: "".concat(prefix, "__upload-progress")
|
|
121
127
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
.titaui-okr-progress__table table tbody tr:hover {
|
|
108
|
-
background:
|
|
108
|
+
background: rgba(240, 244, 250, 0.6);
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
.titaui-okr-progress__table table tbody tr:last-child {
|
|
@@ -136,6 +136,10 @@
|
|
|
136
136
|
text-align: center;
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
+
.titaui-okr-progress__table table tbody tr .padding-td {
|
|
140
|
+
padding: 8px 12px;
|
|
141
|
+
}
|
|
142
|
+
|
|
139
143
|
.titaui-okr-progress__table-title {
|
|
140
144
|
height: 40px;
|
|
141
145
|
background: #f0f4fa;
|
|
@@ -116,7 +116,9 @@ var OkrProgress = function OkrProgress(_ref) {
|
|
|
116
116
|
type: "o",
|
|
117
117
|
status: _constant.OkrRiskMapping[item.RiskLevel],
|
|
118
118
|
value: item.Progress
|
|
119
|
-
})), /*#__PURE__*/_react["default"].createElement("td", null), /*#__PURE__*/_react["default"].createElement("td",
|
|
119
|
+
})), /*#__PURE__*/_react["default"].createElement("td", null), /*#__PURE__*/_react["default"].createElement("td", {
|
|
120
|
+
className: "padding-td"
|
|
121
|
+
}, /*#__PURE__*/_react["default"].createElement(_schedule["default"], {
|
|
120
122
|
value: item.LastContent,
|
|
121
123
|
date: item.LastContentTime,
|
|
122
124
|
id: item.Id
|
|
@@ -136,7 +138,9 @@ var OkrProgress = function OkrProgress(_ref) {
|
|
|
136
138
|
})), /*#__PURE__*/_react["default"].createElement("td", null, /*#__PURE__*/_react["default"].createElement(_newConfidence["default"], {
|
|
137
139
|
value: item.ConfidenceValue,
|
|
138
140
|
editable: false
|
|
139
|
-
})), /*#__PURE__*/_react["default"].createElement("td",
|
|
141
|
+
})), /*#__PURE__*/_react["default"].createElement("td", {
|
|
142
|
+
className: "padding-td"
|
|
143
|
+
}, /*#__PURE__*/_react["default"].createElement(_schedule["default"], {
|
|
140
144
|
value: item.LastContent,
|
|
141
145
|
date: item.LastContentTime,
|
|
142
146
|
id: item.Id
|
|
@@ -161,13 +165,19 @@ var OkrProgress = function OkrProgress(_ref) {
|
|
|
161
165
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
162
166
|
className: prefix
|
|
163
167
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
164
|
-
className: "".concat(prefix, "__title")
|
|
165
|
-
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
166
|
-
className: (0, _classnames["default"])("".concat(prefix, "__title-arrow"), _defineProperty({}, "".concat(prefix, "__title-arrow--show"), !tableVisible)),
|
|
168
|
+
className: "".concat(prefix, "__title"),
|
|
167
169
|
onClick: handleClickToHideTable
|
|
170
|
+
}, /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
|
|
171
|
+
overlay: tableVisible ? (0, _getLocale.getLocale)('Mod_Fold') : (0, _getLocale.getLocale)('Mod_Unfold'),
|
|
172
|
+
placement: "top",
|
|
173
|
+
align: {
|
|
174
|
+
offset: [0, 5]
|
|
175
|
+
}
|
|
176
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
177
|
+
className: (0, _classnames["default"])("".concat(prefix, "__title-arrow"), _defineProperty({}, "".concat(prefix, "__title-arrow--show"), !tableVisible))
|
|
168
178
|
}, /*#__PURE__*/_react["default"].createElement("i", {
|
|
169
179
|
className: (0, _classnames["default"])('tu-icon-caret-down', "".concat(prefix, "__title-arrow-icon"), _defineProperty({}, "".concat(prefix, "__title-arrow-icon--rotate"), !tableVisible))
|
|
170
|
-
})), renderTitle), /*#__PURE__*/_react["default"].createElement("div", {
|
|
180
|
+
}))), renderTitle), /*#__PURE__*/_react["default"].createElement("div", {
|
|
171
181
|
className: (0, _classnames["default"])("".concat(prefix, "__table"), _defineProperty({}, "".concat(prefix, "__table--hide"), !tableVisible))
|
|
172
182
|
}, renderTable));
|
|
173
183
|
};
|
package/lib/components/dynamic/dynamic-item/components/progress/components/task-progress/index.js
CHANGED
|
@@ -1,59 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports["default"] = void 0;
|
|
9
7
|
|
|
10
|
-
var _react =
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
9
|
|
|
12
10
|
require("./index.css");
|
|
13
11
|
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
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; }
|
|
17
|
-
|
|
18
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
19
|
-
|
|
20
|
-
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."); }
|
|
21
|
-
|
|
22
|
-
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); }
|
|
23
|
-
|
|
24
|
-
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; }
|
|
25
|
-
|
|
26
|
-
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; }
|
|
27
|
-
|
|
28
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
29
13
|
|
|
30
14
|
var prefix = "titaui-dynamic-summary-progress-task";
|
|
31
15
|
|
|
32
16
|
var TaskProgress = function TaskProgress(_ref) {
|
|
33
17
|
var _ref$value = _ref.value,
|
|
34
18
|
value = _ref$value === void 0 ? 0 : _ref$value;
|
|
35
|
-
|
|
36
|
-
var _useState = (0, _react.useState)(value + "%"),
|
|
37
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
38
|
-
inputValue = _useState2[0],
|
|
39
|
-
setInputValue = _useState2[1];
|
|
40
|
-
|
|
41
|
-
var handleFocus = function handleFocus() {
|
|
42
|
-
setInputValue(inputValue.substring(0, inputValue.length - 1));
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
var handleBlur = function handleBlur(e) {
|
|
46
|
-
e.persist();
|
|
47
|
-
var inputValue = parseInt(e.target.innerText);
|
|
48
|
-
var resultValue = Number.isNaN(inputValue) || inputValue < 0 ? 0 : inputValue > 100 ? 100 : inputValue;
|
|
49
|
-
setInputValue(resultValue + "%");
|
|
50
|
-
};
|
|
51
|
-
|
|
52
19
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
53
|
-
className: prefix
|
|
54
|
-
|
|
55
|
-
onBlur: handleBlur
|
|
56
|
-
}, inputValue);
|
|
20
|
+
className: prefix
|
|
21
|
+
}, "".concat(value, "%"));
|
|
57
22
|
};
|
|
58
23
|
|
|
59
24
|
var _default = TaskProgress;
|
|
@@ -7,6 +7,8 @@ exports["default"] = exports.Schedule = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
|
+
var _scrollbar = _interopRequireDefault(require("../../../../scrollbar"));
|
|
11
|
+
|
|
10
12
|
require("./index.css");
|
|
11
13
|
|
|
12
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -17,13 +19,17 @@ var Schedule = function Schedule(_ref) {
|
|
|
17
19
|
var value = _ref.value;
|
|
18
20
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
19
21
|
className: prefix
|
|
22
|
+
}, /*#__PURE__*/_react["default"].createElement(_scrollbar["default"], {
|
|
23
|
+
style: {
|
|
24
|
+
maxHeight: 164
|
|
25
|
+
}
|
|
20
26
|
}, value && /*#__PURE__*/_react["default"].createElement("div", {
|
|
21
27
|
className: "".concat(prefix, "__content")
|
|
22
28
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
23
29
|
className: "".concat(prefix, "__content-text")
|
|
24
30
|
}, value)), !value && /*#__PURE__*/_react["default"].createElement("div", {
|
|
25
31
|
className: "".concat(prefix, "__no-progress")
|
|
26
|
-
}, "-"));
|
|
32
|
+
}, "-")));
|
|
27
33
|
};
|
|
28
34
|
|
|
29
35
|
exports.Schedule = Schedule;
|
|
@@ -24,16 +24,13 @@
|
|
|
24
24
|
margin-left: 24px;
|
|
25
25
|
overflow: hidden;
|
|
26
26
|
display: flex;
|
|
27
|
-
word-break: keep-all;
|
|
28
|
-
white-space: nowrap;
|
|
29
|
-
align-items: center;
|
|
30
27
|
}
|
|
31
28
|
|
|
32
29
|
.titaui-dynamic-summary-table-row-okr__kr-order {
|
|
33
30
|
font-size: 12px;
|
|
34
31
|
color: #2879ff;
|
|
35
32
|
line-height: 16px;
|
|
36
|
-
margin-top:
|
|
33
|
+
margin-top: 4px;
|
|
37
34
|
}
|
|
38
35
|
|
|
39
36
|
.titaui-dynamic-summary-table-row-okr__kr-text {
|
|
@@ -9,7 +9,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
|
|
10
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _scrollbar = _interopRequireDefault(require("../../../../scrollbar"));
|
|
13
13
|
|
|
14
14
|
var _drawerManager = _interopRequireDefault(require("../../../../drawer-manager"));
|
|
15
15
|
|
|
@@ -45,6 +45,10 @@ var TableRowOKR = function TableRowOKR(_ref) {
|
|
|
45
45
|
|
|
46
46
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
47
47
|
className: prefix
|
|
48
|
+
}, /*#__PURE__*/_react["default"].createElement(_scrollbar["default"], {
|
|
49
|
+
style: {
|
|
50
|
+
maxHeight: 164
|
|
51
|
+
}
|
|
48
52
|
}, isFirstLevel && /*#__PURE__*/_react["default"].createElement("div", {
|
|
49
53
|
className: "".concat(prefix, "__common"),
|
|
50
54
|
onClick: handleClickTitle
|
|
@@ -57,10 +61,7 @@ var TableRowOKR = function TableRowOKR(_ref) {
|
|
|
57
61
|
className: (0, _classnames["default"])("".concat(prefix, "__kr-order"))
|
|
58
62
|
}, "KR", order), /*#__PURE__*/_react["default"].createElement("span", {
|
|
59
63
|
className: (0, _classnames["default"])("".concat(prefix, "__kr-text"))
|
|
60
|
-
},
|
|
61
|
-
isPercent: true,
|
|
62
|
-
text: (0, _openData.parseString)(text)
|
|
63
|
-
}))));
|
|
64
|
+
}, (0, _openData.parseString)(text)))));
|
|
64
65
|
};
|
|
65
66
|
|
|
66
67
|
var _default = TableRowOKR;
|
|
@@ -161,13 +161,19 @@ var TaskProgress = function TaskProgress(_ref) {
|
|
|
161
161
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
162
162
|
className: prefix
|
|
163
163
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
164
|
-
className: "".concat(prefix, "__title")
|
|
165
|
-
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
166
|
-
className: (0, _classnames["default"])("".concat(prefix, "__title-arrow"), _defineProperty({}, "".concat(prefix, "__title-arrow--show"), !tableVisible)),
|
|
164
|
+
className: "".concat(prefix, "__title"),
|
|
167
165
|
onClick: handleClickToHideTable
|
|
166
|
+
}, /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
|
|
167
|
+
overlay: tableVisible ? (0, _getLocale.getLocale)('Mod_Fold') : (0, _getLocale.getLocale)('Mod_Unfold'),
|
|
168
|
+
placement: "top",
|
|
169
|
+
align: {
|
|
170
|
+
offset: [0, 5]
|
|
171
|
+
}
|
|
172
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
173
|
+
className: (0, _classnames["default"])("".concat(prefix, "__title-arrow"), _defineProperty({}, "".concat(prefix, "__title-arrow--show"), !tableVisible))
|
|
168
174
|
}, /*#__PURE__*/_react["default"].createElement("i", {
|
|
169
175
|
className: (0, _classnames["default"])('tu-icon-caret-down', "".concat(prefix, "__title-arrow-icon"), _defineProperty({}, "".concat(prefix, "__title-arrow-icon--rotate"), !tableVisible))
|
|
170
|
-
})), renderTitle), statusStatistic.done + statusStatistic.doing + statusStatistic.overDue > 0 && /*#__PURE__*/_react["default"].createElement("div", {
|
|
176
|
+
}))), renderTitle), statusStatistic.done + statusStatistic.doing + statusStatistic.overDue > 0 && /*#__PURE__*/_react["default"].createElement("div", {
|
|
171
177
|
className: (0, _classnames["default"])("".concat(prefix, "__statistic"), _defineProperty({}, "".concat(prefix, "__statistic--hide"), !tableVisible))
|
|
172
178
|
}, statusStatistic.done > 0 && /*#__PURE__*/_react["default"].createElement("span", {
|
|
173
179
|
onClick: handleFilterDone,
|
|
@@ -23,7 +23,7 @@ require("./index.css");
|
|
|
23
23
|
|
|
24
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
25
25
|
|
|
26
|
-
var prefix = "titaui-dynamic-
|
|
26
|
+
var prefix = "titaui-dynamic-task-progress";
|
|
27
27
|
|
|
28
28
|
var RenderRow = function RenderRow(_ref) {
|
|
29
29
|
var item = _ref.item;
|
|
@@ -2,11 +2,6 @@
|
|
|
2
2
|
font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-serif, PingFang SC, Microsoft YaHei;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
-
.titaui-dynamic-new-report-item:hover .titaui-dynamic-new-summary-header__edit {
|
|
6
|
-
opacity: 1;
|
|
7
|
-
transition: all 0.2s;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
5
|
.titaui-dynamic-new-report-item .titaui-dynamic-title__content-text {
|
|
11
6
|
cursor: default;
|
|
12
7
|
}
|
|
@@ -11,6 +11,8 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
11
11
|
|
|
12
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
13
|
|
|
14
|
+
var _scrollbar = _interopRequireDefault(require("../scrollbar"));
|
|
15
|
+
|
|
14
16
|
var _popup = _interopRequireDefault(require("../popup"));
|
|
15
17
|
|
|
16
18
|
var _constant = require("./constant");
|
|
@@ -77,7 +79,7 @@ var NewConfidence = function NewConfidence(_ref) {
|
|
|
77
79
|
if (!editable) return null;
|
|
78
80
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
79
81
|
className: "".concat(prefix, "__pop-content")
|
|
80
|
-
}, _constant.ConfidencePointArr.map(function (point) {
|
|
82
|
+
}, /*#__PURE__*/_react["default"].createElement(_scrollbar["default"], null, _constant.ConfidencePointArr.map(function (point) {
|
|
81
83
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
82
84
|
onClick: function onClick() {
|
|
83
85
|
handleChangeConfidence(point);
|
|
@@ -90,7 +92,7 @@ var NewConfidence = function NewConfidence(_ref) {
|
|
|
90
92
|
}), /*#__PURE__*/_react["default"].createElement("span", {
|
|
91
93
|
className: "".concat(prefix, "__pop-content-item-text")
|
|
92
94
|
}, point, /*#__PURE__*/_react["default"].createElement("span", null, (0, _getLocale.getLocale)('Per_Set_Form_Quantifier_Points'))));
|
|
93
|
-
}));
|
|
95
|
+
})));
|
|
94
96
|
}, [editable]);
|
|
95
97
|
return /*#__PURE__*/_react["default"].createElement(_popup["default"], {
|
|
96
98
|
popup: renderPopContent,
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var echarts = _interopRequireWildcard(require("echarts/core"));
|
|
13
|
+
|
|
14
|
+
var _useChart2 = require("./useChart");
|
|
15
|
+
|
|
16
|
+
var _getLocale = require("../../utils/getLocale");
|
|
17
|
+
|
|
18
|
+
var _platform = require("../../utils/platform");
|
|
19
|
+
|
|
20
|
+
require("./index.css");
|
|
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 _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
27
|
+
|
|
28
|
+
var Chart = function Chart(props) {
|
|
29
|
+
var _props$seriesData = props.seriesData,
|
|
30
|
+
series = _props$seriesData.series,
|
|
31
|
+
yAxis = _props$seriesData.yAxis,
|
|
32
|
+
colors = _props$seriesData.colors,
|
|
33
|
+
_props$renderTooltip = props.renderTooltip,
|
|
34
|
+
renderTooltip = _props$renderTooltip === void 0 ? function () {
|
|
35
|
+
return '';
|
|
36
|
+
} : _props$renderTooltip,
|
|
37
|
+
_props$tooltipTrigger = props.tooltipTrigger,
|
|
38
|
+
tooltipTrigger = _props$tooltipTrigger === void 0 ? 'item' : _props$tooltipTrigger;
|
|
39
|
+
var isWeixin = (0, _platform.isPlatform)('wx');
|
|
40
|
+
|
|
41
|
+
var _useChart = (0, _useChart2.useChart)({
|
|
42
|
+
seriesData: props.seriesData,
|
|
43
|
+
applyOptions: function applyOptions(data) {
|
|
44
|
+
if (!(data && data.series) || !(data && data.series)) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
var _series = data.series || [];
|
|
49
|
+
|
|
50
|
+
var _seriesCount = _series.length;
|
|
51
|
+
var totalTimesIndex = _seriesCount - 1;
|
|
52
|
+
var totalTimesData = _series[totalTimesIndex].data;
|
|
53
|
+
var MaxSeriesData = JSON.parse(JSON.stringify(totalTimesData)).sort(function (a, b) {
|
|
54
|
+
return b - a;
|
|
55
|
+
})[0];
|
|
56
|
+
var grid = {
|
|
57
|
+
top: 26,
|
|
58
|
+
// left: 120,
|
|
59
|
+
// right: 10,
|
|
60
|
+
bottom: 14,
|
|
61
|
+
containLabel: false
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
if (isWeixin) {
|
|
65
|
+
grid['left'] = '3%';
|
|
66
|
+
grid.containLabel = true;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
var options = {
|
|
70
|
+
color: colors.map(function (color) {
|
|
71
|
+
return color ? color.colorGradualChange : ['#9FBFFF', '#2879ff'];
|
|
72
|
+
}),
|
|
73
|
+
tooltip: {
|
|
74
|
+
padding: [12, 16],
|
|
75
|
+
trigger: tooltipTrigger,
|
|
76
|
+
axisPointer: {
|
|
77
|
+
type: 'shadow' // 'shadow' as default; can also be 'line' or 'shadow'
|
|
78
|
+
|
|
79
|
+
},
|
|
80
|
+
backgroundColor: '#FFFFFF',
|
|
81
|
+
borderRadius: 8,
|
|
82
|
+
textStyle: {
|
|
83
|
+
fontSize: 14,
|
|
84
|
+
lineHeight: 22,
|
|
85
|
+
color: '#6F7886'
|
|
86
|
+
},
|
|
87
|
+
confine: true,
|
|
88
|
+
extraCssText: 'box-shadow: 0px 4px 12px 0px rgba(127, 145, 180, 0.2);',
|
|
89
|
+
formatter: function formatter(params) {
|
|
90
|
+
return renderTooltip(params);
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
legend: {
|
|
94
|
+
show: false
|
|
95
|
+
},
|
|
96
|
+
grid: grid,
|
|
97
|
+
xAxis: {
|
|
98
|
+
show: false,
|
|
99
|
+
type: 'value'
|
|
100
|
+
},
|
|
101
|
+
yAxis: {
|
|
102
|
+
type: 'category',
|
|
103
|
+
data: isWeixin ? yAxis : yAxis.map(function (d) {
|
|
104
|
+
return {
|
|
105
|
+
value: d,
|
|
106
|
+
textStyle: {
|
|
107
|
+
width: 100,
|
|
108
|
+
// height: 40,
|
|
109
|
+
// lineHeight: 14,
|
|
110
|
+
align: 'right',
|
|
111
|
+
overflow: 'truncate' // lineOverflow: 'truncate',
|
|
112
|
+
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
}),
|
|
116
|
+
inverse: true,
|
|
117
|
+
offset: 0,
|
|
118
|
+
axisLine: {
|
|
119
|
+
show: false
|
|
120
|
+
},
|
|
121
|
+
axisTick: {
|
|
122
|
+
show: false
|
|
123
|
+
},
|
|
124
|
+
axisLabel: {
|
|
125
|
+
show: true // formatter: (value, index) => {
|
|
126
|
+
// return value.length > 10 ? value.substr(0, 10) + '...' : value;
|
|
127
|
+
// },
|
|
128
|
+
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
series: _series.map(function (s, index) {
|
|
132
|
+
var nodeLine = index != totalTimesIndex;
|
|
133
|
+
var data = JSON.parse(JSON.stringify(s.data || []));
|
|
134
|
+
data = data.map(function (d, dIndex) {
|
|
135
|
+
var total = totalTimesData[dIndex];
|
|
136
|
+
if (!total) return 0;
|
|
137
|
+
var value = d / total * MaxSeriesData;
|
|
138
|
+
return value;
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
if (nodeLine) {
|
|
142
|
+
return {
|
|
143
|
+
name: s.name,
|
|
144
|
+
type: 'bar',
|
|
145
|
+
stack: 'total',
|
|
146
|
+
clip: true,
|
|
147
|
+
label: {
|
|
148
|
+
show: true,
|
|
149
|
+
align: 'center',
|
|
150
|
+
fontSize: 14,
|
|
151
|
+
lineHeight: 22,
|
|
152
|
+
color: '#ffffff',
|
|
153
|
+
overflow: 'break',
|
|
154
|
+
formatter: function formatter(params) {
|
|
155
|
+
var dataIndex = params.dataIndex,
|
|
156
|
+
seriesIndex = params.seriesIndex;
|
|
157
|
+
var total = totalTimesData[dataIndex];
|
|
158
|
+
var data = _series[seriesIndex].data[dataIndex];
|
|
159
|
+
if (total == 0 || data == 0) return '';
|
|
160
|
+
var label = Number((data / total * 100).toFixed(2)) + (0, _getLocale.getLocale)('OKR_MyO_Pop_Upd_Percentage');
|
|
161
|
+
return label;
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
barWidth: 40,
|
|
165
|
+
barMaxWidth: 40,
|
|
166
|
+
barMinWidth: 40,
|
|
167
|
+
barMinHeight: 0,
|
|
168
|
+
barGap: '50%',
|
|
169
|
+
emphasis: {
|
|
170
|
+
focus: 'series',
|
|
171
|
+
blurScope: 'coordinateSystem'
|
|
172
|
+
},
|
|
173
|
+
data: data,
|
|
174
|
+
itemStyle: {
|
|
175
|
+
color: function color(option) {
|
|
176
|
+
return new echarts.graphic.LinearGradient(0, 0, 1, 1, [{
|
|
177
|
+
offset: 0,
|
|
178
|
+
color: option.color[0]
|
|
179
|
+
}, {
|
|
180
|
+
offset: 1,
|
|
181
|
+
color: option.color[1]
|
|
182
|
+
}]);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
} else {
|
|
187
|
+
return {
|
|
188
|
+
name: s.name,
|
|
189
|
+
type: 'line',
|
|
190
|
+
// stack: 'total',
|
|
191
|
+
symbolSize: 0,
|
|
192
|
+
lineStyle: {
|
|
193
|
+
opacity: 0
|
|
194
|
+
},
|
|
195
|
+
hoverAnimation: false,
|
|
196
|
+
label: {
|
|
197
|
+
show: true,
|
|
198
|
+
align: 'left',
|
|
199
|
+
position: 'insideLeft',
|
|
200
|
+
offset: [10, 0],
|
|
201
|
+
fontSize: 14,
|
|
202
|
+
lineHeight: 22,
|
|
203
|
+
color: '#3f4755',
|
|
204
|
+
formatter: function formatter(params) {
|
|
205
|
+
var dataIndex = params.dataIndex,
|
|
206
|
+
seriesIndex = params.seriesIndex;
|
|
207
|
+
var data = _series[seriesIndex].data[dataIndex];
|
|
208
|
+
return data;
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
emphasis: {
|
|
212
|
+
focus: 'self'
|
|
213
|
+
},
|
|
214
|
+
itemStyle: {
|
|
215
|
+
color: 'transparent'
|
|
216
|
+
},
|
|
217
|
+
data: data
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
})
|
|
221
|
+
};
|
|
222
|
+
return options;
|
|
223
|
+
}
|
|
224
|
+
}),
|
|
225
|
+
ref = _useChart.ref;
|
|
226
|
+
|
|
227
|
+
var tooltipHeight = (series.length + 1) * 40;
|
|
228
|
+
var yAxisHeight = yAxis.length * 80;
|
|
229
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
230
|
+
className: "chart-container scrollbar-size-sm",
|
|
231
|
+
style: {
|
|
232
|
+
height: Math.max(tooltipHeight, yAxisHeight)
|
|
233
|
+
}
|
|
234
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
235
|
+
ref: ref,
|
|
236
|
+
style: {
|
|
237
|
+
height: yAxisHeight,
|
|
238
|
+
minHeight: 100
|
|
239
|
+
}
|
|
240
|
+
}));
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
var _default = Chart;
|
|
244
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.getOpenId = void 0;
|
|
9
|
+
exports.getWWopenData = getWWopenData;
|
|
10
|
+
exports.parseWxData = void 0;
|
|
11
|
+
|
|
12
|
+
var _bsGlobal = require("../../utils/bs-global");
|
|
13
|
+
|
|
14
|
+
var _platform = require("../../utils/platform");
|
|
15
|
+
|
|
16
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
17
|
+
|
|
18
|
+
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); } }
|
|
19
|
+
|
|
20
|
+
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); }); }; }
|
|
21
|
+
|
|
22
|
+
function getWWopenData() {
|
|
23
|
+
return window.WWOpenData;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* 获取openId
|
|
27
|
+
* @param {number} id 人员id
|
|
28
|
+
* @param {string} type openData类型
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
var getOpenId = function getOpenId(id, type) {
|
|
33
|
+
var openIds;
|
|
34
|
+
|
|
35
|
+
if (type == 'userName') {
|
|
36
|
+
openIds = (0, _bsGlobal.getBSGlobal)('openIds');
|
|
37
|
+
} else if (type == 'departmentName') {
|
|
38
|
+
openIds = (0, _bsGlobal.getBSGlobal)('openDepartmentIds');
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return openIds && openIds[id];
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
exports.getOpenId = getOpenId;
|
|
45
|
+
|
|
46
|
+
var parseWxData = /*#__PURE__*/function () {
|
|
47
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(datas, type) {
|
|
48
|
+
var WWopenData, anaData, invalidId, res, wxIndexs, result;
|
|
49
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
50
|
+
while (1) {
|
|
51
|
+
switch (_context.prev = _context.next) {
|
|
52
|
+
case 0:
|
|
53
|
+
WWopenData = getWWopenData();
|
|
54
|
+
anaData = datas.map(function (d) {
|
|
55
|
+
var idStr = d.split('[!@#')[1];
|
|
56
|
+
idStr = idStr ? idStr.substring(0, idStr.length - 1) : idStr;
|
|
57
|
+
|
|
58
|
+
if ((0, _platform.isPlatform)('wx')) {
|
|
59
|
+
idStr = getOpenId(idStr, type);
|
|
60
|
+
} else {
|
|
61
|
+
idStr = undefined;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return {
|
|
65
|
+
name: d.replace(/\[!@#\S+?\]/, ''),
|
|
66
|
+
id: idStr
|
|
67
|
+
};
|
|
68
|
+
});
|
|
69
|
+
invalidId = anaData.every(function (d) {
|
|
70
|
+
return !d.id;
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
if (!((0, _platform.isPlatform)('wx') && !invalidId)) {
|
|
74
|
+
_context.next = 14;
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
res = [];
|
|
79
|
+
wxIndexs = [];
|
|
80
|
+
anaData.forEach(function (d, index) {
|
|
81
|
+
d.id == undefined ? res[index] = d.name : wxIndexs.push(index);
|
|
82
|
+
});
|
|
83
|
+
_context.next = 9;
|
|
84
|
+
return new Promise(function (resolve, reject) {
|
|
85
|
+
WWopenData && WWopenData.prefetch({
|
|
86
|
+
items: anaData.filter(function (d) {
|
|
87
|
+
return d.id != undefined;
|
|
88
|
+
}).map(function (d) {
|
|
89
|
+
return {
|
|
90
|
+
type: type,
|
|
91
|
+
id: d.id
|
|
92
|
+
};
|
|
93
|
+
})
|
|
94
|
+
}, function (err, data) {
|
|
95
|
+
if (err) {
|
|
96
|
+
return reject(err);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
data.items = (data.items || []).map(function (d, index) {
|
|
100
|
+
return d.data == undefined ? {
|
|
101
|
+
data: anaData[index].name
|
|
102
|
+
} : d;
|
|
103
|
+
});
|
|
104
|
+
resolve(data);
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
case 9:
|
|
109
|
+
result = _context.sent;
|
|
110
|
+
|
|
111
|
+
if (result) {
|
|
112
|
+
result.items.forEach(function (item, index) {
|
|
113
|
+
res[wxIndexs[index]] = item.data;
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
return _context.abrupt("return", res);
|
|
118
|
+
|
|
119
|
+
case 14:
|
|
120
|
+
return _context.abrupt("return", anaData.map(function (d) {
|
|
121
|
+
return d.name;
|
|
122
|
+
}));
|
|
123
|
+
|
|
124
|
+
case 15:
|
|
125
|
+
case "end":
|
|
126
|
+
return _context.stop();
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}, _callee);
|
|
130
|
+
}));
|
|
131
|
+
|
|
132
|
+
return function parseWxData(_x, _x2) {
|
|
133
|
+
return _ref.apply(this, arguments);
|
|
134
|
+
};
|
|
135
|
+
}();
|
|
136
|
+
|
|
137
|
+
exports.parseWxData = parseWxData;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.useChart = useChart;
|
|
9
|
+
|
|
10
|
+
var _react = require("react");
|
|
11
|
+
|
|
12
|
+
var echarts = _interopRequireWildcard(require("echarts/core"));
|
|
13
|
+
|
|
14
|
+
var _components = require("echarts/components");
|
|
15
|
+
|
|
16
|
+
var _charts = require("echarts/charts");
|
|
17
|
+
|
|
18
|
+
var _renderers = require("echarts/renderers");
|
|
19
|
+
|
|
20
|
+
var _until = require("./until");
|
|
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
|
+
echarts.use([_components.TooltipComponent, _components.GridComponent, _components.LegendComponent, _charts.BarChart, _charts.LineChart, _renderers.CanvasRenderer]);
|
|
39
|
+
|
|
40
|
+
function useChart(_ref) {
|
|
41
|
+
var seriesData = _ref.seriesData,
|
|
42
|
+
applyOptions = _ref.applyOptions,
|
|
43
|
+
options = _ref.options;
|
|
44
|
+
var ref = (0, _react.useRef)();
|
|
45
|
+
var charRef = (0, _react.useRef)({});
|
|
46
|
+
|
|
47
|
+
var _useState = (0, _react.useState)(),
|
|
48
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
49
|
+
data = _useState2[0],
|
|
50
|
+
setData = _useState2[1];
|
|
51
|
+
|
|
52
|
+
(0, _react.useEffect)(function () {
|
|
53
|
+
var _seriesData = JSON.parse(JSON.stringify(seriesData));
|
|
54
|
+
|
|
55
|
+
setTimeout(function () {
|
|
56
|
+
if (!charRef.current || !ref.current) return;
|
|
57
|
+
|
|
58
|
+
if (!(_seriesData && _seriesData.series)) {
|
|
59
|
+
charRef.current && charRef.current.chart && charRef.current.chart.dispose();
|
|
60
|
+
charRef.current.chart = undefined;
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (!charRef.current.chart) {
|
|
65
|
+
charRef.current.chart = echarts.init(ref.current);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (_seriesData.yAxis && _seriesData.yAxis.type == 2) {
|
|
69
|
+
(0, _until.parseWxData)(_seriesData.yAxis.data, 'departmentName').then(function (datas) {
|
|
70
|
+
_seriesData.yAxis && (_seriesData.yAxis.data = datas);
|
|
71
|
+
setData(_seriesData);
|
|
72
|
+
setTimeout(function () {
|
|
73
|
+
var options = applyOptions(_seriesData);
|
|
74
|
+
charRef.current && charRef.current.chart && charRef.current.chart.resize();
|
|
75
|
+
charRef.current && charRef.current.chart && charRef.current.chart.setOption(options);
|
|
76
|
+
}, 0);
|
|
77
|
+
});
|
|
78
|
+
} else {
|
|
79
|
+
var _options = applyOptions(_seriesData);
|
|
80
|
+
|
|
81
|
+
charRef.current && charRef.current.chart && charRef.current.chart.resize();
|
|
82
|
+
charRef.current && charRef.current.chart && charRef.current.chart.setOption(_options);
|
|
83
|
+
}
|
|
84
|
+
}, 0);
|
|
85
|
+
setData(_seriesData);
|
|
86
|
+
}, []);
|
|
87
|
+
return {
|
|
88
|
+
ref: ref,
|
|
89
|
+
data: data,
|
|
90
|
+
charRef: charRef
|
|
91
|
+
};
|
|
92
|
+
}
|
package/lib/index.js
CHANGED
|
@@ -387,6 +387,12 @@ Object.defineProperty(exports, "PayPage", {
|
|
|
387
387
|
return _pay["default"];
|
|
388
388
|
}
|
|
389
389
|
});
|
|
390
|
+
Object.defineProperty(exports, "PercentLineChart", {
|
|
391
|
+
enumerable: true,
|
|
392
|
+
get: function get() {
|
|
393
|
+
return _percentLineChart["default"];
|
|
394
|
+
}
|
|
395
|
+
});
|
|
390
396
|
Object.defineProperty(exports, "PeriodSelector", {
|
|
391
397
|
enumerable: true,
|
|
392
398
|
get: function get() {
|
|
@@ -828,6 +834,8 @@ var _pointDemo = _interopRequireDefault(require("./components/point-demo"));
|
|
|
828
834
|
|
|
829
835
|
var _personalInfo = _interopRequireDefault(require("./pages/personal-info"));
|
|
830
836
|
|
|
837
|
+
var _percentLineChart = _interopRequireDefault(require("./components/percent-line-chart"));
|
|
838
|
+
|
|
831
839
|
var _rangePickerPop = _interopRequireDefault(require("./components/range-picker-pop"));
|
|
832
840
|
|
|
833
841
|
var _radio = _interopRequireDefault(require("./components/radio"));
|