@titaui/pc 1.12.22-beta.1 → 1.12.22-beta.13

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.
Files changed (52) hide show
  1. package/lib/components/attachments-preview/index.js +6 -2
  2. package/lib/components/color-date-picker/index.css +1 -2
  3. package/lib/components/dialog-upload/index.js +1 -1
  4. package/lib/components/dynamic/components/comments-dialog/img/curEfforts.png +0 -0
  5. package/lib/components/dynamic/components/comments-dialog/img/curGood.png +0 -0
  6. package/lib/components/dynamic/components/comments-dialog/img/curGreat.png +0 -0
  7. package/lib/components/dynamic/components/comments-dialog/img/efforts.png +0 -0
  8. package/lib/components/dynamic/components/comments-dialog/img/good.png +0 -0
  9. package/lib/components/dynamic/components/comments-dialog/img/great.png +0 -0
  10. package/lib/components/dynamic/components/comments-dialog/index.css +33 -3
  11. package/lib/components/dynamic/components/comments-dialog/index.js +18 -7
  12. package/lib/components/dynamic/dynamic-item/components/header/index.js +2 -1
  13. package/lib/components/dynamic/dynamic-item/components/okr-progress/index.js +3 -14
  14. package/lib/components/dynamic/dynamic-item/components/schedule/index.js +5 -29
  15. package/lib/components/dynamic/dynamic-item/components/summary-header/index.css +0 -1
  16. package/lib/components/dynamic/dynamic-item/components/summary-header/index.js +95 -48
  17. package/lib/components/dynamic/dynamic-item/components/summary-header/request-api.js +17 -0
  18. package/lib/components/dynamic/dynamic-item/components/task-progress/constant.js +15 -2
  19. package/lib/components/dynamic/dynamic-item/components/task-progress/index.css +41 -31
  20. package/lib/components/dynamic/dynamic-item/components/task-progress/index.js +72 -85
  21. package/lib/components/dynamic/dynamic-item/components/task-progress/interface.js +18 -1
  22. package/lib/components/dynamic/dynamic-item/components/task-progress/render-row.js +80 -0
  23. package/lib/components/dynamic/dynamic-item/components/task-progress/request-api.js +16 -0
  24. package/lib/components/dynamic/dynamic-item/components/task-progress/utils.js +92 -8
  25. package/lib/components/dynamic/dynamic-item/dynamic-new-report/components/evalute/index.js +42 -23
  26. package/lib/components/dynamic/dynamic-item/dynamic-new-report/index.css +1 -1
  27. package/lib/components/dynamic/dynamic-item/dynamic-new-report/index.js +42 -65
  28. package/lib/components/dynamic/dynamic-item/index.js +50 -44
  29. package/lib/components/import-modal/import-okr-modal/index.js +2 -1
  30. package/lib/components/import-modal/import-task-modal/search-form.js +4 -1
  31. package/lib/components/import-modal/request-api.js +1 -1
  32. package/lib/components/import-modal/search/task-relation.js +9 -5
  33. package/lib/components/import-modal/tree/okr-tree/index.js +15 -5
  34. package/lib/components/menus/components/search-colleague/index.js +3 -1
  35. package/lib/components/menus/export-modules/summary-menus/depart-menus/index.js +15 -11
  36. package/lib/components/menus/export-modules/summary-menus/menus.js +48 -36
  37. package/lib/components/menus/export-modules/summary-menus/summary-front-menus.js +2 -2
  38. package/lib/components/picker/components/panels/month-panel/index.js +2 -1
  39. package/lib/components/picker/components/panels/week-panel/index.js +6 -2
  40. package/lib/components/picker/components/panels/week-panel/utils.js +24 -2
  41. package/lib/components/picker/components/panels/week-panel/week-body.js +18 -10
  42. package/lib/components/picker/components/panels/week-panel/week-head.js +9 -7
  43. package/lib/components/picker/picker-panels.js +3 -3
  44. package/lib/components/picker/range-picker/components/select-input/index.js +9 -2
  45. package/lib/components/rate/index.css +3 -3
  46. package/lib/components/textarea/index.css +2 -2
  47. package/lib/components/textarea/index.js +1 -1
  48. package/lib/components/upvote/index.js +10 -4
  49. package/lib/components/write-summary-modal/index.css +1 -0
  50. package/lib/components/write-summary-modal/index.js +7 -6
  51. package/lib/utils/helpers.js +58 -3
  52. package/package.json +2 -2
@@ -170,27 +170,37 @@ var OkrTree = function OkrTree(_ref) {
170
170
 
171
171
  var getTreeNodes = /*#__PURE__*/function () {
172
172
  var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
173
- var _yield$okrSearch, works, total;
173
+ var newQuery, date, _yield$okrSearch, works, total;
174
174
 
175
175
  return regeneratorRuntime.wrap(function _callee$(_context) {
176
176
  while (1) {
177
177
  switch (_context.prev = _context.next) {
178
178
  case 0:
179
- _context.next = 2;
179
+ newQuery = query;
180
+
181
+ if ((query === null || query === void 0 ? void 0 : query.cycleType) !== '-1') {
182
+ date = new Date((query === null || query === void 0 ? void 0 : query.endDate) || new Date().valueOf());
183
+ date.setDate(date.getDate() + 1);
184
+ newQuery = _objectSpread(_objectSpread({}, query), {}, {
185
+ endDate: "".concat(date.getFullYear(), "/").concat(date.getMonth() + 1 >= 10 ? date.getMonth() + 1 : '0' + (date.getMonth() + 1), "/").concat(date.getDate() >= 10 ? date.getDate() : '0' + date.getDate())
186
+ });
187
+ }
188
+
189
+ _context.next = 4;
180
190
  return (0, _requestApi.okrSearch)(_objectSpread({
181
191
  pageNum: pageNum,
182
192
  pageSize: pageSize,
183
193
  toUserId: toUserId
184
- }, query));
194
+ }, newQuery));
185
195
 
186
- case 2:
196
+ case 4:
187
197
  _yield$okrSearch = _context.sent;
188
198
  works = _yield$okrSearch.works;
189
199
  total = _yield$okrSearch.total;
190
200
  setWorks(works || []);
191
201
  setTotal(total);
192
202
 
193
- case 7:
203
+ case 9:
194
204
  case "end":
195
205
  return _context.stop();
196
206
  }
@@ -86,6 +86,7 @@ function _default(props) {
86
86
  var _ref2 = _slicedToArray(_ref, 1),
87
87
  user = _ref2[0];
88
88
 
89
+ setSearchVal(user.title);
89
90
  onSelect(user);
90
91
  };
91
92
 
@@ -109,7 +110,8 @@ function _default(props) {
109
110
  placeholder: placeholder,
110
111
  onChange: handleInputChange,
111
112
  onFocus: onInputFocusHandler,
112
- onBlur: onInputBlurHandler
113
+ onBlur: onInputBlurHandler,
114
+ value: searchVal
113
115
  })), /*#__PURE__*/_react["default"].createElement(_userSelector["default"], {
114
116
  ref: selectorRef,
115
117
  multiple: false,
@@ -76,7 +76,7 @@ var _default = function _default() {
76
76
  rawTreeData = _useState4[0],
77
77
  setRawTreeData = _useState4[1];
78
78
 
79
- var _useState5 = (0, _react.useState)(["-1"]),
79
+ var _useState5 = (0, _react.useState)(['-1']),
80
80
  _useState6 = _slicedToArray(_useState5, 2),
81
81
  selectedMenuKeys = _useState6[0],
82
82
  setSelectedMenuKeys = _useState6[1];
@@ -99,12 +99,11 @@ var _default = function _default() {
99
99
  var isBoss = (0, _bsGlobal.getUserInfo)().IsBoss;
100
100
  (0, _react.useEffect)(function () {
101
101
  if (isBoss) {
102
- window.location.href = "#/summary/manage?departmentName=公司全部&departmentId=0";
102
+ window.location.href = '#/summary/manage?departmentName=公司全部&departmentId=0';
103
103
 
104
104
  var allDepartmentText = window.getLocale && window.getLocale(_i18n.locale.menu_alldeparment) || _i18n.locale.menu_alldeparment;
105
105
 
106
106
  (0, _requestApis.getDepsAndUsers)(-1, false).then(function (rawTreeData) {
107
- var transNodes = (0, _helper.translateDepartsToTreeNode)(rawTreeData);
108
107
  var rootNode = {
109
108
  async: true,
110
109
  data: {
@@ -112,14 +111,14 @@ var _default = function _default() {
112
111
  name: allDepartmentText
113
112
  },
114
113
  pid: -1,
115
- id: "0",
116
- key: "0",
114
+ id: '0',
115
+ key: '0',
117
116
  isLeaf: true,
118
117
  nodeType: _index.DEPART_NODE,
119
118
  title: allDepartmentText
120
119
  };
121
- setRawTreeData([rootNode].concat(_toConsumableArray(transNodes)));
122
- setTreeData((0, _utils.toTree)([rootNode].concat(_toConsumableArray(transNodes))));
120
+ setRawTreeData([rootNode].concat(_toConsumableArray(rawTreeData)));
121
+ setTreeData((0, _utils.toTree)([rootNode].concat(_toConsumableArray(rawTreeData))));
123
122
  setLoading(false);
124
123
  });
125
124
  } else {
@@ -130,16 +129,21 @@ var _default = function _default() {
130
129
  async: true,
131
130
  data: {
132
131
  id: -1,
133
- name: "全部管理部门"
132
+ name: '全部管理部门'
134
133
  },
135
134
  pid: 0,
136
135
  id: rawTreeData[0].id,
137
136
  key: -1,
138
137
  nodeType: _index.DEPART_NODE,
139
- title: "全部管理部门"
138
+ title: '全部管理部门'
140
139
  };
141
- setRawTreeData([rootNode].concat(_toConsumableArray(rawTreeData)));
142
- setTreeData((0, _utils.toTree)([rootNode].concat(_toConsumableArray(rawTreeData))));
140
+
141
+ if (rawTreeData.length > 1) {
142
+ rawTreeData.unshift(rootNode);
143
+ }
144
+
145
+ setRawTreeData(_toConsumableArray(rawTreeData));
146
+ setTreeData((0, _utils.toTree)(_toConsumableArray(rawTreeData)));
143
147
  setLoading(false);
144
148
  });
145
149
  }
@@ -11,6 +11,8 @@ var _index = require("../../components/menu-tree/tree-node/index");
11
11
 
12
12
  var _getLocale = require("../../../../utils/getLocale");
13
13
 
14
+ var _bsGlobal = require("../../../../utils/bs-global");
15
+
14
16
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
15
17
 
16
18
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
@@ -22,82 +24,92 @@ var defaultRefObject = {
22
24
  insertSubordinates: function insertSubordinates() {},
23
25
  getMenus: function getMenus() {},
24
26
  setSubordinatesLoading: function setSubordinatesLoading() {},
25
- SUBORDINATES: ''
27
+ SUBORDINATES: ""
26
28
  };
27
29
  exports.defaultRefObject = defaultRefObject;
28
- var PAGE_SUMMARY_ALl = 'summaryall';
30
+ var PAGE_SUMMARY_ALl = "summaryall";
29
31
  exports.PAGE_SUMMARY_ALl = PAGE_SUMMARY_ALl;
30
- var PAGE_SUMMARY_MY = 'summarymy';
32
+ var PAGE_SUMMARY_MY = "summarymy";
31
33
  exports.PAGE_SUMMARY_MY = PAGE_SUMMARY_MY;
32
- var PAGE_SUMMARY_SUBORDINATE = 'subordinates';
34
+ var PAGE_SUMMARY_SUBORDINATE = "subordinates";
33
35
  exports.PAGE_SUMMARY_SUBORDINATE = PAGE_SUMMARY_SUBORDINATE;
34
- var PAGE_SUMMARY_SHARE = 'share';
36
+ var PAGE_SUMMARY_SHARE = "share";
35
37
  exports.PAGE_SUMMARY_SHARE = PAGE_SUMMARY_SHARE;
36
- var PAGE_SUMMARY_DEPART = 'depart';
38
+ var PAGE_SUMMARY_DEPART = "depart";
37
39
  exports.PAGE_SUMMARY_DEPART = PAGE_SUMMARY_DEPART;
38
- var PAGE_SUMMARY_ROLE = 'role';
40
+ var PAGE_SUMMARY_ROLE = "role";
39
41
  exports.PAGE_SUMMARY_ROLE = PAGE_SUMMARY_ROLE;
40
- var PAGE_SUMMARY_CHART = 'chart';
42
+ var PAGE_SUMMARY_CHART = "chart";
41
43
  exports.PAGE_SUMMARY_CHART = PAGE_SUMMARY_CHART;
42
44
 
45
+ var _getUserInfo = (0, _bsGlobal.getUserInfo)(),
46
+ IsLeader = _getUserInfo.IsLeader,
47
+ IsBoss = _getUserInfo.IsBoss,
48
+ IsRoot = _getUserInfo.IsRoot,
49
+ Role = _getUserInfo.Role,
50
+ IsPlanDailyManager = _getUserInfo.IsPlanDailyManager,
51
+ HasSub = _getUserInfo.HasSub;
52
+
53
+ var isShowManage = IsPlanDailyManager || IsBoss || HasSub || IsRoot && Role !== 4 || IsLeader;
54
+
43
55
  var summaryMenus = /*#__PURE__*/function () {
44
56
  function summaryMenus(props) {
45
57
  _classCallCheck(this, summaryMenus);
46
58
 
47
59
  this.COMPANYALL = _index.COMPANY_ALL_NODE;
48
60
  this.SHARE = _index.SHARE_NODE;
49
- this.SUBORDINATES = 'subordinates';
61
+ this.SUBORDINATES = "subordinates";
50
62
  this.menus = [{
51
- icon: 'all-zongjie',
63
+ icon: "all-zongjie",
52
64
  label: _i18n.locale.menu_all_summary,
53
65
  key: PAGE_SUMMARY_ALl,
54
66
  type: _index.MENU_ITEM_NOE,
55
- href: '#/summary/all',
67
+ href: "#/summary/all",
56
68
  isShow: true
57
69
  }, {
58
- icon: 'caidan-my',
70
+ icon: "caidan-my",
59
71
  label: _i18n.locale.menu_my_summary,
60
72
  key: PAGE_SUMMARY_MY,
61
73
  type: _index.MENU_ITEM_NOE,
62
- href: '#/summary/my',
74
+ href: "#/summary/my",
63
75
  isShow: true
64
76
  }, {
65
- icon: 'caidan-xiashu',
77
+ icon: "caidan-xiashu",
66
78
  label: _i18n.locale.menu_my_subordinates,
67
79
  key: this.SUBORDINATES,
68
80
  type: _index.SUBORDINATES_NODE,
69
81
  isLeaf: false,
70
82
  children: [],
71
- href: '#/summary/subordinates',
83
+ href: "#/summary/subordinates",
72
84
  isShow: window.BSGlobal.loginUserInfo.HasSub
73
85
  }, {
74
- icon: 'caidan-enjoy',
86
+ icon: "caidan-enjoy",
75
87
  label: _i18n.locale.menu_my_share,
76
88
  key: PAGE_SUMMARY_SHARE,
77
89
  type: _index.MENU_ITEM_NOE,
78
- href: '#/summary/share',
90
+ href: "#/summary/share",
79
91
  isShow: props.isShowShare
80
92
  }, {
81
- icon: 'bumen',
93
+ icon: "bumen",
82
94
  label: _i18n.locale.menu_department,
83
95
  key: this.COMPANYALL,
84
96
  type: this.COMPANYALL,
85
- href: '',
97
+ href: "",
86
98
  isShow: props.isShowDept
87
99
  }, {
88
- icon: '',
100
+ icon: "",
89
101
  label: _i18n.locale.menu_summary,
90
- key: 'other',
102
+ key: "other",
91
103
  type: _index.GROUP_NAME_NODE,
92
- href: '',
93
- isShow: true
104
+ href: "",
105
+ isShow: isShowManage
94
106
  }, {
95
- icon: 'my-setup',
107
+ icon: "my-setup",
96
108
  label: _i18n.locale.menu_summary_role,
97
109
  key: PAGE_SUMMARY_ROLE,
98
110
  type: _index.MENU_ITEM_NOE,
99
- href: '#/enterprise/manage?reactRouterName=daily',
100
- isShow: true
111
+ href: "#/enterprise/manage?reactRouterName=daily",
112
+ isShow: isShowManage
101
113
  }];
102
114
  }
103
115
 
@@ -108,11 +120,11 @@ var summaryMenus = /*#__PURE__*/function () {
108
120
 
109
121
  if (loading) {
110
122
  this.menus[1].children.push({
111
- icon: '',
112
- label: 'loading',
113
- key: 'loading-subordinates',
123
+ icon: "",
124
+ label: "loading",
125
+ key: "loading-subordinates",
114
126
  type: _index.LOADING_NODE,
115
- href: '',
127
+ href: "",
116
128
  data: {}
117
129
  });
118
130
  }
@@ -122,11 +134,11 @@ var summaryMenus = /*#__PURE__*/function () {
122
134
  value: function insertSubordinates(users) {
123
135
  if (!users || !users.length) {
124
136
  this.menus[2].children = [{
125
- icon: '',
126
- label: 'empty-subordinates',
127
- key: 'empty-subordinates',
137
+ icon: "",
138
+ label: "empty-subordinates",
139
+ key: "empty-subordinates",
128
140
  type: _index.NO_SUBORDINATES_NODE,
129
- href: '',
141
+ href: "",
130
142
  data: {}
131
143
  }];
132
144
  return;
@@ -137,11 +149,11 @@ var summaryMenus = /*#__PURE__*/function () {
137
149
  for (var i = 0; i < users.length; i++) {
138
150
  var user = users[i];
139
151
  treeNodeUsers.push({
140
- icon: '',
152
+ icon: "",
141
153
  label: user.name,
142
154
  key: "".concat(user.userId),
143
155
  type: _index.USER_NODE,
144
- href: '',
156
+ href: "",
145
157
  data: user
146
158
  });
147
159
  }
@@ -63,7 +63,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
63
63
  maxHeight = _useState2[0],
64
64
  setMaxHeight = _useState2[1];
65
65
 
66
- var _useState3 = (0, _react.useState)(['myokr']),
66
+ var _useState3 = (0, _react.useState)(["myokr"]),
67
67
  _useState4 = _slicedToArray(_useState3, 2),
68
68
  expandedKeys = _useState4[0],
69
69
  setExpandedKeys = _useState4[1];
@@ -138,7 +138,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
138
138
  resolve(true); // 获取数据
139
139
 
140
140
  (0, _requestApis.getSubordinates)({
141
- relationIds: '1,2'
141
+ relationIds: "1,2"
142
142
  }, {
143
143
  disabledDottedSubordinatesDig: true
144
144
  }).then(function (users) {
@@ -60,7 +60,8 @@ var MonthPanel = function MonthPanel(props) {
60
60
 
61
61
  var onYearChange = function onYearChange(diff) {
62
62
  if (onViewDateChange) {
63
- onViewDateChange((0, _moment["default"])(newViewDate[0]).add(diff, 'y'));
63
+ onViewDateChange((0, _moment["default"])(newViewDate).add(diff, 'y'));
64
+ setNewViewDate((0, _moment["default"])(newViewDate).add(diff, 'y'));
64
65
  }
65
66
  };
66
67
 
@@ -26,23 +26,27 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
26
26
  var DatePanel = function DatePanel(props) {
27
27
  var viewDate = props.viewDate,
28
28
  onViewDateChange = props.onViewDateChange;
29
+ var startDate = viewDate[0];
29
30
 
30
31
  var onMonthChange = function onMonthChange(diff) {
31
32
  if (onViewDateChange) {
32
- onViewDateChange((0, _moment["default"])(viewDate).add(diff, "M"));
33
+ onViewDateChange((0, _moment["default"])(startDate).add(diff, "M"));
33
34
  }
34
35
  };
35
36
 
36
37
  return /*#__PURE__*/_react["default"].createElement("div", {
37
38
  className: (0, _classnames["default"])("".concat(_utils.PickerPanelClass, "__date"))
38
39
  }, /*#__PURE__*/_react["default"].createElement(_weekHead["default"], _extends({}, props, {
40
+ startDate: viewDate[0],
39
41
  onPrev: function onPrev() {
40
42
  return onMonthChange(-1);
41
43
  },
42
44
  onNext: function onNext() {
43
45
  return onMonthChange(1);
44
46
  }
45
- })), /*#__PURE__*/_react["default"].createElement(_weekBody["default"], props));
47
+ })), /*#__PURE__*/_react["default"].createElement(_weekBody["default"], _extends({}, props, {
48
+ startDate: viewDate[0]
49
+ })));
46
50
  };
47
51
 
48
52
  var _default = DatePanel;
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.endTime = endTime;
7
- exports.getWeeksNum = exports.getWeekNumber = exports.getPointYearMonthWeeksRange = exports.getPointYearMonthWeekStartTimeAndEndTime = exports.getDaysOfMonth = void 0;
7
+ exports.getWeeksNum = exports.getWeekNumber = exports.getWeek = exports.getPointYearMonthWeeksRange = exports.getPointYearMonthWeekStartTimeAndEndTime = exports.getDaysOfMonth = void 0;
8
8
  exports.startTime = startTime;
9
9
 
10
10
  //获取当前日期在这个月是第几周
@@ -119,6 +119,28 @@ var getPointYearMonthWeeksRange = function getPointYearMonthWeeksRange(year, mon
119
119
  }
120
120
 
121
121
  return result;
122
+ }; //获取某个日期处于的年月周
123
+
124
+
125
+ exports.getPointYearMonthWeeksRange = getPointYearMonthWeeksRange;
126
+
127
+ var getWeek = function getWeek(date) {
128
+ var month = date.getMonth() + 1; // 先计算出该日期为第几周
129
+
130
+ var week = Math.ceil(date.getDate() / 7);
131
+ var year = date.getFullYear(); // 判断这个月前7天是周几,如果不是周一,则计入上个月
132
+
133
+ if (date.getDate() < 7) {
134
+ if (date.getDay() !== 1) {
135
+ var preMonthDate = new Date(date.valueOf());
136
+ preMonthDate.setDate(0);
137
+ week = getWeek(new Date("".concat(preMonthDate.getFullYear(), "/").concat(preMonthDate.getMonth() + 1, "/").concat(preMonthDate.getDate())))[0];
138
+ month = preMonthDate.getMonth() + 1;
139
+ year = preMonthDate.getFullYear();
140
+ }
141
+ }
142
+
143
+ return [week, month, year];
122
144
  };
123
145
 
124
- exports.getPointYearMonthWeeksRange = getPointYearMonthWeeksRange;
146
+ exports.getWeek = getWeek;
@@ -26,16 +26,24 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
26
26
  var preCls = 'titaui__picker';
27
27
 
28
28
  var WeekPanelBody = function WeekPanelBody(props) {
29
- var viewDate = props.viewDate,
29
+ var startDate = props.startDate,
30
30
  onSelect = props.onSelect;
31
- var currentYear = new Date().getFullYear();
32
- var currentMonth = new Date().getMonth() + 1;
33
- var currentWeek = (0, _utils.getWeekNumber)(new Date());
34
31
 
35
32
  var getCells = function getCells(date) {
36
- var year = (0, _moment["default"])(date).format('YYYY'); //获取年
37
-
38
- var month = (0, _moment["default"])(date).format('MM'); //获取月
33
+ var currentYear = (0, _utils.getWeek)(new Date(new Date()))[2];
34
+ var currentMonth = (0, _utils.getWeek)(new Date(new Date()))[1];
35
+ var currentWeek = (0, _utils.getWeek)(new Date(new Date()))[0];
36
+ var year = Number((0, _moment["default"])(date).format('YYYY')); //获取年
37
+
38
+ var month = Number((0, _moment["default"])(date).format('MM'));
39
+ var dateYear = Number((0, _moment["default"])(date).format('YYYY'));
40
+ var dateMonth = Number((0, _moment["default"])(date).format('MM'));
41
+
42
+ if (currentMonth !== dateMonth && dateMonth !== 1) {
43
+ dateMonth = dateMonth - 1;
44
+ } else if (currentMonth !== dateMonth && dateMonth === 1) {
45
+ dateMonth = 12;
46
+ }
39
47
 
40
48
  var range = (0, _utils.getPointYearMonthWeeksRange)(year, month);
41
49
 
@@ -43,11 +51,11 @@ var WeekPanelBody = function WeekPanelBody(props) {
43
51
  return range.map(function (item, i) {
44
52
  return /*#__PURE__*/_react["default"].createElement("tr", {
45
53
  key: i,
46
- className: (0, _classnames["default"])("".concat(preCls, "__week"), _defineProperty({}, "".concat(preCls, "__week--select"), currentWeek === i + 1 && parseInt(year) == currentYear && parseInt(month) == currentMonth))
54
+ className: (0, _classnames["default"])("".concat(preCls, "__week"), _defineProperty({}, "".concat(preCls, "__week--select"), currentWeek === i + 1))
47
55
  }, /*#__PURE__*/_react["default"].createElement("div", {
48
56
  onClick: function onClick() {
49
57
  if (onSelect) {
50
- onSelect("".concat(year, "/").concat(item.startTime, "~").concat(year, "/").concat(item.endTime), 'week', year);
58
+ onSelect(["".concat(year, "/").concat(item.startTime), "".concat(year, "/").concat(item.endTime)], 'week', year);
51
59
  }
52
60
  },
53
61
  className: "".concat(preCls, "__week-box")
@@ -64,7 +72,7 @@ var WeekPanelBody = function WeekPanelBody(props) {
64
72
  className: (0, _classnames["default"])(_utils2.PickerBodyClass)
65
73
  }, /*#__PURE__*/_react["default"].createElement("table", {
66
74
  className: (0, _classnames["default"])("".concat(_utils2.PickerClass, "-content"))
67
- }, /*#__PURE__*/_react["default"].createElement("tbody", null, getCells((0, _moment["default"])(viewDate)))));
75
+ }, /*#__PURE__*/_react["default"].createElement("tbody", null, getCells((0, _moment["default"])(startDate)))));
68
76
  };
69
77
 
70
78
  var _default = WeekPanelBody;
@@ -15,17 +15,19 @@ var _getLocale = require("../../../../../utils/getLocale");
15
15
 
16
16
  var _utils = require("../../../utils");
17
17
 
18
+ var _utils2 = require("./utils");
19
+
18
20
  require("./index.css");
19
21
 
20
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
21
23
 
22
24
  function DatePanelHead(props) {
23
- var viewDate = props.viewDate,
25
+ var startDate = props.startDate,
24
26
  onPrev = props.onPrev,
25
27
  onNext = props.onNext,
26
28
  onPanelChange = props.onPanelChange;
27
- var yearText = parseInt((0, _moment["default"])(viewDate).format('YYYY'));
28
- var monthText = parseInt((0, _moment["default"])(viewDate).format('MM'));
29
+ var yearText = (0, _moment["default"])(startDate).year();
30
+ var monthText = (0, _utils2.getWeek)(new Date(startDate))[1];
29
31
  return /*#__PURE__*/_react["default"].createElement("div", {
30
32
  className: (0, _classnames["default"])(_utils.PickerHeadClass)
31
33
  }, !_getLocale.isEn && /*#__PURE__*/_react["default"].createElement("div", {
@@ -33,7 +35,7 @@ function DatePanelHead(props) {
33
35
  }, /*#__PURE__*/_react["default"].createElement("button", {
34
36
  className: (0, _classnames["default"])("".concat(_utils.PickerHeadClass, "-btn__year")),
35
37
  onClick: function onClick() {
36
- return onPanelChange && onPanelChange(viewDate, 'year');
38
+ return onPanelChange && onPanelChange(startDate, 'year');
37
39
  },
38
40
  type: "button"
39
41
  }, yearText), /*#__PURE__*/_react["default"].createElement("span", {
@@ -41,7 +43,7 @@ function DatePanelHead(props) {
41
43
  }, "\xA0\u5E74"), /*#__PURE__*/_react["default"].createElement("button", {
42
44
  className: (0, _classnames["default"])("".concat(_utils.PickerHeadClass, "-btn__month")),
43
45
  onClick: function onClick() {
44
- return onPanelChange && onPanelChange(viewDate, 'month');
46
+ return onPanelChange && onPanelChange(startDate, 'month');
45
47
  },
46
48
  type: "button"
47
49
  }, monthText), /*#__PURE__*/_react["default"].createElement("span", {
@@ -51,7 +53,7 @@ function DatePanelHead(props) {
51
53
  }, /*#__PURE__*/_react["default"].createElement("button", {
52
54
  className: (0, _classnames["default"])("".concat(_utils.PickerHeadClass, "-btn__month")),
53
55
  onClick: function onClick() {
54
- return onPanelChange && onPanelChange(viewDate, 'month');
56
+ return onPanelChange && onPanelChange(startDate, 'month');
55
57
  },
56
58
  style: {
57
59
  marginRight: 4
@@ -60,7 +62,7 @@ function DatePanelHead(props) {
60
62
  }, _utils.MONTHDATAMAPEN[Number(monthText) - 1]), /*#__PURE__*/_react["default"].createElement("button", {
61
63
  className: (0, _classnames["default"])("".concat(_utils.PickerHeadClass, "-btn__year")),
62
64
  onClick: function onClick() {
63
- return onPanelChange && onPanelChange(viewDate, 'year');
65
+ return onPanelChange && onPanelChange(startDate, 'year');
64
66
  },
65
67
  type: "button"
66
68
  }, yearText)), /*#__PURE__*/_react["default"].createElement("div", {
@@ -123,11 +123,11 @@ var PickerPanels = function PickerPanels(props) {
123
123
 
124
124
  var onWeekSelect = function onWeekSelect(date, year) {
125
125
  setViewDate(function () {
126
- return [date];
126
+ return date;
127
127
  });
128
128
 
129
129
  if (onChange) {
130
- onChange([date]);
130
+ onChange(date);
131
131
  }
132
132
 
133
133
  onCloseHandler();
@@ -193,7 +193,7 @@ var PickerPanels = function PickerPanels(props) {
193
193
 
194
194
  case 'week':
195
195
  panel = /*#__PURE__*/_react["default"].createElement(_weekPanel["default"], {
196
- viewDate: date,
196
+ viewDate: viewDate,
197
197
  onSelect: onSelectChange,
198
198
  onViewDateChange: onViewDateChange,
199
199
  onPanelChange: onPanelChange,
@@ -11,6 +11,8 @@ var _react = _interopRequireWildcard(require("react"));
11
11
 
12
12
  var _classnames = _interopRequireDefault(require("classnames"));
13
13
 
14
+ var _tooltip = _interopRequireDefault(require("../../../../../components/tooltip"));
15
+
14
16
  var _utils = require("../../../utils");
15
17
 
16
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -61,10 +63,15 @@ var RangeSelectInput = function RangeSelectInput(props, ref) {
61
63
  onFocus: onFocus,
62
64
  ref: inputRef,
63
65
  value: date
64
- }), /*#__PURE__*/_react["default"].createElement("span", {
66
+ }), /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
67
+ defaultVisible: false,
68
+ placement: "top",
69
+ overlay: /*#__PURE__*/_react["default"].createElement("div", null, "\u6E05\u7A7A\u7B5B\u9009"),
70
+ trigger: ['hover']
71
+ }, /*#__PURE__*/_react["default"].createElement("span", {
65
72
  className: (0, _classnames["default"])('tu-icon-cross', "".concat(_utils.PickerRangesClass, "__select-input__cancel"), _defineProperty({}, "".concat(_utils.PickerRangesClass, "__select-input__cancel--visible"), date)),
66
73
  onClick: onClearHandler
67
- }));
74
+ })));
68
75
  };
69
76
 
70
77
  var _default = /*#__PURE__*/(0, _react.forwardRef)(RangeSelectInput);
@@ -33,7 +33,7 @@
33
33
  margin-right: 8px;
34
34
  position: relative;
35
35
  transition: all 0.3s;
36
- color: #e9e9e9;
36
+ color: #dfe3ea;
37
37
  cursor: pointer;
38
38
  line-height: 1.5;
39
39
  }
@@ -74,12 +74,12 @@
74
74
 
75
75
  .rc-rate-star-half .rc-rate-star-first,
76
76
  .rc-rate-star-full .rc-rate-star-second {
77
- color: #f5a623;
77
+ color: #ffc326;
78
78
  }
79
79
 
80
80
  .rc-rate-star-half:hover .rc-rate-star-first,
81
81
  .rc-rate-star-full:hover .rc-rate-star-second {
82
- color: tint(#f5a623, 30%);
82
+ color: rgba(246, 189, 22, 0.3);
83
83
  }
84
84
 
85
85
  @font-face {
@@ -91,12 +91,12 @@
91
91
 
92
92
  .area-error {
93
93
  border: 1px solid #f05e5e !important;
94
- box-shadow: 0px 0px 6px 0px rgba(240, 94, 94, 0.3);
94
+ box-shadow: inset 0px 0px 6px 0px rgba(240, 94, 94, 0.3);
95
95
  }
96
96
 
97
97
  .area-focus {
98
98
  border: 1px solid #2879ff !important;
99
- box-shadow: 0px 0px 6px 0px rgba(40, 121, 255, 0.3);
99
+ box-shadow: inset 0px 0px 6px 0px rgba(40, 121, 255, 0.3);
100
100
  }
101
101
 
102
102
  .area-normal {
@@ -74,7 +74,7 @@ var Textarea = function Textarea(p) {
74
74
  var selfInputRef = (0, _react.useRef)();
75
75
  var realInputRef = inputRef || selfInputRef;
76
76
  var isControlled = ("value" in p);
77
- var realValue = isControlled ? value : selfValue;
77
+ var realValue = isControlled ? value || '' : selfValue || '';
78
78
 
79
79
  var _useState5 = (0, _react.useState)(false),
80
80
  _useState6 = _slicedToArray(_useState5, 2),
@@ -88,7 +88,8 @@ function UpvoteButton(_ref) {
88
88
  _ref$buttonType = _ref.buttonType,
89
89
  buttonType = _ref$buttonType === void 0 ? "" : _ref$buttonType,
90
90
  _ref$customUpvoteBtnC = _ref.customUpvoteBtnCls,
91
- customUpvoteBtnCls = _ref$customUpvoteBtnC === void 0 ? "" : _ref$customUpvoteBtnC;
91
+ customUpvoteBtnCls = _ref$customUpvoteBtnC === void 0 ? "" : _ref$customUpvoteBtnC,
92
+ getPopupContainer = _ref.getPopupContainer;
92
93
 
93
94
  var _useState = (0, _react.useState)({
94
95
  type: type,
@@ -105,6 +106,7 @@ function UpvoteButton(_ref) {
105
106
  modalVisible = _useState4[0],
106
107
  setModalVisible = _useState4[1];
107
108
 
109
+ var wrapperRef = (0, _react.useRef)(document.createElement('div'));
108
110
  (0, _react.useEffect)(function () {
109
111
  setUpvoteState({
110
112
  type: type,
@@ -126,9 +128,13 @@ function UpvoteButton(_ref) {
126
128
  }, []);
127
129
  return /*#__PURE__*/_react["default"].createElement("div", {
128
130
  className: "feed-upvote pull-screen-click-through pull-screen-ignore",
129
- style: style
130
- }, /*#__PURE__*/_react["default"].createElement(_selector["default"] // visible={selectorVisible}
131
- , {
131
+ style: style,
132
+ ref: wrapperRef
133
+ }, /*#__PURE__*/_react["default"].createElement(_selector["default"], {
134
+ getPopupContainer: function getPopupContainer() {
135
+ return wrapperRef.current || document.body;
136
+ } // visible={selectorVisible}
137
+ ,
132
138
  align: popAlign,
133
139
  onSelect: /*#__PURE__*/function () {
134
140
  var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(type) {