@titaui/pc 1.12.7-beta.13 → 1.12.7-beta.14

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.
@@ -264,16 +264,18 @@ var DynamicItemHeader = function DynamicItemHeader(_ref) {
264
264
  }, (0, _getLocale.getLocale)("Mod_Delete")));
265
265
  }, [showDialogConfirm]);
266
266
  (0, _react.useEffect)(function () {
267
- var mindData = dailyContent.filter(function (item) {
268
- return item.title === "心情";
269
- }); // 暂时用title
270
-
271
- if (typeof mindData[0].content === 'string') {
272
- setMindImg(_constant2.Motion.filter(function (item) {
273
- return item.id === JSON.parse(mindData[0].content).SelectedValues[0];
274
- })[0].img);
267
+ if (dailyContent) {
268
+ var mindData = dailyContent.filter(function (item) {
269
+ return item.title === "心情";
270
+ }); // 暂时用title
271
+
272
+ if (typeof mindData[0].content === 'string') {
273
+ setMindImg(_constant2.Motion.filter(function (item) {
274
+ return item.id === JSON.parse(mindData[0].content).SelectedValues[0];
275
+ })[0].img);
276
+ }
275
277
  }
276
- }, []);
278
+ }, [dailyContent]);
277
279
  return /*#__PURE__*/_react["default"].createElement("div", {
278
280
  className: "".concat(prefix)
279
281
  }, /*#__PURE__*/_react["default"].createElement("span", {
@@ -19,6 +19,8 @@ var _tableRowOProject = _interopRequireDefault(require("../table-row-o-project")
19
19
 
20
20
  var _constant = require("./constant");
21
21
 
22
+ var _utils = require("./utils");
23
+
22
24
  require("./index.css");
23
25
 
24
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -73,6 +75,11 @@ var TaskProgress = function TaskProgress(_ref) {
73
75
  rowsData = _useState2[0],
74
76
  setRowsData = _useState2[1];
75
77
 
78
+ var _useState3 = (0, _react.useState)((0, _utils.getStatusStatistic)([])),
79
+ _useState4 = _slicedToArray(_useState3, 2),
80
+ statusStatistic = _useState4[0],
81
+ setStatusStatistic = _useState4[1];
82
+
76
83
  var renderTitle = (0, _react.useMemo)(function () {
77
84
  if (type === 'day') {
78
85
  return (0, _getLocale.getLocale)('Rep_NewS_Toworkasks');
@@ -140,7 +147,7 @@ var TaskProgress = function TaskProgress(_ref) {
140
147
  (0, _react.useEffect)(function () {
141
148
  if (_typeof(data) !== 'object') {
142
149
  setRowsData(JSON.parse(data));
143
- console.log(JSON.parse(data));
150
+ setStatusStatistic((0, _utils.getStatusStatistic)(JSON.parse(data).Rows));
144
151
  }
145
152
  }, [data]);
146
153
  return /*#__PURE__*/_react["default"].createElement("div", {
@@ -153,15 +160,15 @@ var TaskProgress = function TaskProgress(_ref) {
153
160
  className: "".concat(prefix, "__statistic-item ").concat(prefix, "__statistic-item--finished")
154
161
  }, (0, _getLocale.getLocale)('OKR_MyO_E_From_Completed'), ' ', /*#__PURE__*/_react["default"].createElement("span", {
155
162
  className: "".concat(prefix, "__statistic-item--finished-text")
156
- }, "5")), /*#__PURE__*/_react["default"].createElement("span", {
163
+ }, statusStatistic.doing)), /*#__PURE__*/_react["default"].createElement("span", {
157
164
  className: "".concat(prefix, "__statistic-item ").concat(prefix, "__statistic-item--processing")
158
165
  }, (0, _getLocale.getLocale)('OKR_MyO_Butt_Inprogress'), ' ', /*#__PURE__*/_react["default"].createElement("span", {
159
166
  className: "".concat(prefix, "__statistic-item--processing-text")
160
- }, "5")), /*#__PURE__*/_react["default"].createElement("span", {
167
+ }, statusStatistic.doing)), /*#__PURE__*/_react["default"].createElement("span", {
161
168
  className: "".concat(prefix, "__statistic-item ").concat(prefix, "__statistic-item--overdue")
162
169
  }, (0, _getLocale.getLocale)('OKR_MyO_E_Overdue'), ' ', /*#__PURE__*/_react["default"].createElement("span", {
163
170
  className: "".concat(prefix, "__statistic-item--overdue-text")
164
- }, "5"))), /*#__PURE__*/_react["default"].createElement("div", {
171
+ }, statusStatistic.overDue))), /*#__PURE__*/_react["default"].createElement("div", {
165
172
  className: "".concat(prefix, "__table")
166
173
  }, renderTable));
167
174
  };
@@ -3,8 +3,25 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.formatOkrsData = void 0;
6
+ exports.getStatusStatistic = void 0;
7
7
 
8
- var formatOkrsData = function formatOkrsData(data) {};
8
+ var getStatusStatistic = function getStatusStatistic(data) {
9
+ var result = {
10
+ done: 0,
11
+ doing: 0,
12
+ overDue: 0
13
+ };
14
+ data.forEach(function (item) {
15
+ // 1 进行中 2 已完成 3 已延期
16
+ if (item.status === 1) {
17
+ result.doing = result.doing + 1;
18
+ } else if (item.status === 2) {
19
+ result.done = result.done + 1;
20
+ } else if (item.status === 3) {
21
+ result.overDue = result.overDue + 1;
22
+ }
23
+ });
24
+ return result;
25
+ };
9
26
 
10
- exports.formatOkrsData = formatOkrsData;
27
+ exports.getStatusStatistic = getStatusStatistic;
@@ -23,7 +23,7 @@
23
23
  height: 32px;
24
24
  background: #F0F4FA;
25
25
  border-radius: 16px;
26
- padding: 4px 8px 4px 4px;
26
+ padding: 5px 8px 5px 4px;
27
27
  box-sizing: border-box;
28
28
  font-size: 14px;
29
29
  color: #3F4755;
@@ -31,7 +31,9 @@
31
31
  }
32
32
 
33
33
  .titaui-dynamic-summary__remind-view__user-avatar {
34
- width: 24px;
35
- height: 24px;
36
34
  border-radius: 15px;
37
35
  }
36
+
37
+ .titaui-dynamic-summary__remind-view__user-name {
38
+ margin-left: 6px;
39
+ }
@@ -77,7 +77,9 @@ var RemindUserView = function RemindUserView(props) {
77
77
  name: item.name,
78
78
  src: item.avatar.medium,
79
79
  color: item.avatar.color
80
- }), item.name);
80
+ }), /*#__PURE__*/_react["default"].createElement("span", {
81
+ className: "".concat(preCls, "__user-name")
82
+ }, item.name));
81
83
  })));
82
84
  };
83
85
 
@@ -151,29 +151,31 @@ var DynamicReply = function DynamicReply(_ref) {
151
151
  });
152
152
  }, [data, searchKeyWord]);
153
153
  (0, _react.useEffect)(function () {
154
- var mindData = dailyContent.filter(function (item) {
155
- return item.title === "心情";
156
- }); // 暂时用title
157
-
158
- setOkrtableData(dailyContent.filter(function (item) {
159
- return item.title === "目标";
160
- })[0].content);
161
- setTasktableData(dailyContent.filter(function (item) {
162
- return item.title === "任务";
163
- })[0].content);
164
- setWorkSummaryData(dailyContent.filter(function (item) {
165
- return item.title === "工作总结";
166
- })[0].content);
167
- setNextWorkPlanData(dailyContent.filter(function (item) {
168
- return item.title === "下一步工作计划";
169
- })[0].content);
170
-
171
- if (typeof mindData[0].content === 'string') {
172
- setMindImg(_constant.Motion.filter(function (item) {
173
- return item.id === JSON.parse(mindData[0].content).SelectedValues[0];
174
- })[0].img);
154
+ if (dailyContent) {
155
+ var mindData = dailyContent.filter(function (item) {
156
+ return item.title === "心情";
157
+ }); // 暂时用title
158
+
159
+ setOkrtableData(dailyContent.filter(function (item) {
160
+ return item.title === "目标";
161
+ })[0].content);
162
+ setTasktableData(dailyContent.filter(function (item) {
163
+ return item.title === "任务";
164
+ })[0].content);
165
+ setWorkSummaryData(dailyContent.filter(function (item) {
166
+ return item.title === "工作总结";
167
+ })[0].content);
168
+ setNextWorkPlanData(dailyContent.filter(function (item) {
169
+ return item.title === "下一步工作计划";
170
+ })[0].content);
171
+
172
+ if (typeof mindData[0].content === 'string') {
173
+ setMindImg(_constant.Motion.filter(function (item) {
174
+ return item.id === JSON.parse(mindData[0].content).SelectedValues[0];
175
+ })[0].img);
176
+ }
175
177
  }
176
- }, []);
178
+ }, [dailyContent]);
177
179
  return /*#__PURE__*/_react["default"].createElement("div", {
178
180
  className: prefix
179
181
  }, /*#__PURE__*/_react["default"].createElement(_summaryHeader["default"], _extends({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@titaui/pc",
3
- "version": "1.12.7-beta.13",
3
+ "version": "1.12.7-beta.14",
4
4
  "nameCN": "",
5
5
  "description": "",
6
6
  "main": "lib/index.js",
@@ -43,6 +43,7 @@
43
43
  "babel-plugin-module-resolver": "4.1.0",
44
44
  "babel-plugin-transform-class-properties": "6.24.1",
45
45
  "babel-plugin-transform-function-bind": "6.22.0",
46
+ "copy-to-clipboard": "^3.3.1",
46
47
  "cross-env": "7.0.2",
47
48
  "del": "6.0.0",
48
49
  "eslint": "8.7.0",