@titaui/pc 1.6.81 → 1.6.82
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/change-okr/Item.js +6 -23
- package/lib/components/change-okr/styledComponents.js +2 -4
- package/lib/components/drawer/manager/drawerWrapper.js +1 -1
- package/lib/components/drawer/manager/index.js +3 -3
- package/lib/components/nav-top/index.js +6 -1
- package/lib/pages/home-page/components/data-list/table/columns/createDate.js +1 -1
- package/lib/pages/home-page/components/data-list/table/index.js +1 -0
- package/lib/utils/date-test-change.js +2 -2
- package/package.json +1 -1
|
@@ -13,8 +13,6 @@ var _styledComponents = require("./styledComponents");
|
|
|
13
13
|
|
|
14
14
|
var _openData = require("../../utils/open-data");
|
|
15
15
|
|
|
16
|
-
var _pc = require("@titaui/pc");
|
|
17
|
-
|
|
18
16
|
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); }
|
|
19
17
|
|
|
20
18
|
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; }
|
|
@@ -134,15 +132,6 @@ var Item = /*#__PURE__*/function (_PureComponent) {
|
|
|
134
132
|
}
|
|
135
133
|
};
|
|
136
134
|
|
|
137
|
-
_this.toOkrDetail = function (e, okrId) {
|
|
138
|
-
e.stopPropagation();
|
|
139
|
-
e.nativeEvent.stopImmediatePropagation();
|
|
140
|
-
var isShowKr = _this.props.isShowKr;
|
|
141
|
-
isShowKr && _pc.drawerManager.open('okrDetail', {
|
|
142
|
-
okrId: okrId
|
|
143
|
-
});
|
|
144
|
-
};
|
|
145
|
-
|
|
146
135
|
_this.formatKeywordsFunc = function (str, key) {
|
|
147
136
|
var reg = new RegExp("(" + key + ")", "g");
|
|
148
137
|
var newstr = str.replace(reg, "<span style=\"color: #2879ff;\">".concat(key, "</span>"));
|
|
@@ -209,11 +198,9 @@ var Item = /*#__PURE__*/function (_PureComponent) {
|
|
|
209
198
|
}), /*#__PURE__*/_react["default"].createElement(_styledComponents.Tag, {
|
|
210
199
|
color: colorMap[data.cycleType] || colorMap[4]
|
|
211
200
|
}, this.getCycleText()), /*#__PURE__*/_react["default"].createElement(_styledComponents.WorkNameWrapper, {
|
|
212
|
-
isShowKr: isShowKr
|
|
213
|
-
onClick: function onClick(e) {
|
|
214
|
-
return _this2.toOkrDetail(e, data.workId);
|
|
215
|
-
}
|
|
201
|
+
isShowKr: isShowKr
|
|
216
202
|
}, /*#__PURE__*/_react["default"].createElement(_styledComponents.OkrName, {
|
|
203
|
+
isKr: false,
|
|
217
204
|
isShowKr: isShowKr,
|
|
218
205
|
dangerouslySetInnerHTML: {
|
|
219
206
|
__html: this.okrData.workName
|
|
@@ -234,11 +221,9 @@ var Item = /*#__PURE__*/function (_PureComponent) {
|
|
|
234
221
|
},
|
|
235
222
|
active: active && item.mileStoneId == (active.workId || active.mileStoneId)
|
|
236
223
|
}), /*#__PURE__*/_react["default"].createElement(_styledComponents.WorkNameWrapper, {
|
|
237
|
-
isShowKr: isShowKr
|
|
238
|
-
onClick: function onClick(e) {
|
|
239
|
-
return _this2.toOkrDetail(e, data.workId);
|
|
240
|
-
}
|
|
224
|
+
isShowKr: isShowKr
|
|
241
225
|
}, /*#__PURE__*/_react["default"].createElement(_styledComponents.OkrName, {
|
|
226
|
+
isKr: true,
|
|
242
227
|
isShowKr: isShowKr,
|
|
243
228
|
dangerouslySetInnerHTML: {
|
|
244
229
|
__html: "KR".concat(index + 1, "\uFF1A").concat(item.mileStoneName)
|
|
@@ -251,11 +236,9 @@ var Item = /*#__PURE__*/function (_PureComponent) {
|
|
|
251
236
|
},
|
|
252
237
|
active: active && item.mileStoneId == (active.workId || active.mileStoneId)
|
|
253
238
|
}), /*#__PURE__*/_react["default"].createElement(_styledComponents.WorkNameWrapper, {
|
|
254
|
-
isShowKr: isShowKr
|
|
255
|
-
onClick: function onClick(e) {
|
|
256
|
-
return _this2.toOkrDetail(e, data.workId);
|
|
257
|
-
}
|
|
239
|
+
isShowKr: isShowKr
|
|
258
240
|
}, /*#__PURE__*/_react["default"].createElement(_styledComponents.OkrName, {
|
|
241
|
+
isKr: true,
|
|
259
242
|
isShowKr: isShowKr,
|
|
260
243
|
dangerouslySetInnerHTML: {
|
|
261
244
|
__html: "KR".concat(index + 1, "\uFF1A").concat(item.mileStoneName)
|
|
@@ -79,10 +79,8 @@ var ItemTop = _styledComponents["default"].div(_templateObject16 || (_templateOb
|
|
|
79
79
|
|
|
80
80
|
exports.ItemTop = ItemTop;
|
|
81
81
|
|
|
82
|
-
var WorkNameWrapper = _styledComponents["default"].div(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["\n flex: 1px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n cursor: ", ";\n
|
|
83
|
-
return p.
|
|
84
|
-
}, function (p) {
|
|
85
|
-
return p.isShowKr ? '#2879ff' : '#33383D';
|
|
82
|
+
var WorkNameWrapper = _styledComponents["default"].div(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["\n flex: 1px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n cursor: ", ";\n"])), function (p) {
|
|
83
|
+
return p.isKr ? 'default' : 'pointer';
|
|
86
84
|
});
|
|
87
85
|
|
|
88
86
|
exports.WorkNameWrapper = WorkNameWrapper;
|
|
@@ -67,7 +67,7 @@ var DrawerManager = /*#__PURE__*/function () {
|
|
|
67
67
|
var extendedDrawerProps = drawerProps;
|
|
68
68
|
|
|
69
69
|
if (_this.history.length > 0) {
|
|
70
|
-
extendedDrawerProps = _objectSpread(_objectSpread({}, _this.history[_this.history.length - 1]), extendedDrawerProps);
|
|
70
|
+
extendedDrawerProps = _objectSpread(_objectSpread({}, _this.history[_this.history.length - 1].extendedDrawerProps), extendedDrawerProps);
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
_this.history.push({
|
|
@@ -97,12 +97,12 @@ var DrawerManager = /*#__PURE__*/function () {
|
|
|
97
97
|
var _this$history = _this.history[_this.history.length - 1],
|
|
98
98
|
Component = _this$history.Component,
|
|
99
99
|
props = _this$history.props,
|
|
100
|
-
|
|
100
|
+
extendedDrawerProps = _this$history.extendedDrawerProps,
|
|
101
101
|
key = _this$history.key;
|
|
102
102
|
|
|
103
103
|
_this.drawer.open( /*#__PURE__*/_react["default"].createElement(Component, _extends({
|
|
104
104
|
key: key
|
|
105
|
-
}, props)),
|
|
105
|
+
}, props)), extendedDrawerProps);
|
|
106
106
|
} else {
|
|
107
107
|
_this.close();
|
|
108
108
|
}
|
|
@@ -115,6 +115,11 @@ var NavTop = function NavTop() {
|
|
|
115
115
|
return hash.includes(item.href.split("#")[1]);
|
|
116
116
|
});
|
|
117
117
|
|
|
118
|
+
if (hash.includes('homepage')) {
|
|
119
|
+
setActiveMenuId(99999);
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
|
|
118
123
|
if (activeMenu) {
|
|
119
124
|
setActiveMenuId(activeMenu.id);
|
|
120
125
|
} else {
|
|
@@ -139,7 +144,7 @@ var NavTop = function NavTop() {
|
|
|
139
144
|
src: Logo,
|
|
140
145
|
className: (0, _classnames["default"])("".concat(preCls, "__left-logo"), _defineProperty({}, "".concat(preCls, "__left-logo--hover"), hasOKRApp))
|
|
141
146
|
}), hasOKRApp && /*#__PURE__*/_react["default"].createElement("span", {
|
|
142
|
-
className: (0, _classnames["default"])("".concat(preCls, "__left-home"), (_classNames2 = {}, _defineProperty(_classNames2, "".concat(preCls, "__left-home--active"), activeMenuId ==
|
|
147
|
+
className: (0, _classnames["default"])("".concat(preCls, "__left-home"), (_classNames2 = {}, _defineProperty(_classNames2, "".concat(preCls, "__left-home--active"), activeMenuId == 99999), _defineProperty(_classNames2, "".concat(preCls, "__left-home--hover"), hasOKRApp), _classNames2))
|
|
143
148
|
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
144
149
|
src: _home["default"],
|
|
145
150
|
className: (0, _classnames["default"])("".concat(preCls, "__left-home-img"))
|
|
@@ -11,7 +11,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
|
|
|
11
11
|
|
|
12
12
|
function CreateDate(_ref) {
|
|
13
13
|
var createDate = _ref.createDate;
|
|
14
|
-
var date = new Date(createDate);
|
|
14
|
+
var date = new Date(createDate.replace(/-/g, '/').split('T').join(' '));
|
|
15
15
|
return /*#__PURE__*/_react["default"].createElement("div", null, createDate ? "".concat(date.getFullYear(), "-").concat(date.getMonth() + 1, "-").concat(date.getDate()) : '-');
|
|
16
16
|
}
|
|
17
17
|
|
|
@@ -7,8 +7,8 @@ exports.testDayChange = exports.testDateDiff = void 0;
|
|
|
7
7
|
|
|
8
8
|
//精确到日期的检测 date为2021/8/26这样的类型,返回距现在几天
|
|
9
9
|
var testDateDiff = function testDateDiff(date) {
|
|
10
|
-
var
|
|
11
|
-
var testTime = Date.parse(
|
|
10
|
+
var handleDate = date.length == 5 ? "".concat(new Date().getFullYear(), "/").concat(date) : date;
|
|
11
|
+
var testTime = Date.parse(handleDate.replace(/-/g, '/').split('T').join(' '));
|
|
12
12
|
var now = Date.now();
|
|
13
13
|
var diffDay = Math.floor((now - testTime) / (1000 * 60 * 60 * 24));
|
|
14
14
|
return diffDay;
|