@titaui/pc 1.12.35 → 1.12.38
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/dynamic/components/comments-dialog/index.js +11 -9
- package/lib/components/dynamic/dynamic-item/components/progress/index.js +1 -1
- package/lib/components/dynamic/dynamic-item/dynamic-new-report/components/evalute/index.js +12 -11
- package/lib/components/dynamic/dynamic-item/dynamic-new-report/index.js +2 -2
- package/lib/components/guide-tip/index.js +2 -2
- package/lib/components/import-modal/tree-node/kr-node/index.js +1 -1
- package/lib/components/import-modal/tree-node/milestone-node/index.js +1 -1
- package/lib/components/import-modal/tree-node/o-node/index.js +1 -1
- package/lib/components/import-modal/tree-node/work-node/index.js +1 -1
- package/lib/components/picker/components/panels/week-panel/utils.js +21 -14
- package/lib/components/toast/index.js +1 -1
- package/lib/utils/open-data.js +41 -42
- package/package.json +1 -1
|
@@ -116,11 +116,13 @@ var EvaluationDialog = function EvaluationDialog(props) {
|
|
|
116
116
|
};
|
|
117
117
|
(0, _api.setSummaryEvaluate)(params).then(function (res) {
|
|
118
118
|
if (res.Code === 1) {
|
|
119
|
+
var _res$Data;
|
|
120
|
+
|
|
119
121
|
closeDialog({
|
|
120
122
|
remark: remark,
|
|
121
123
|
type: Number(evaluateType),
|
|
122
124
|
value: value,
|
|
123
|
-
user: res === null || res === void 0 ? void 0 : res.
|
|
125
|
+
user: res === null || res === void 0 ? void 0 : (_res$Data = res.Data) === null || _res$Data === void 0 ? void 0 : _res$Data.user
|
|
124
126
|
});
|
|
125
127
|
|
|
126
128
|
_toast["default"].Success((0, _getLocale.getLocale)("Mod_Successfuloperat"));
|
|
@@ -136,18 +138,18 @@ var EvaluationDialog = function EvaluationDialog(props) {
|
|
|
136
138
|
toUserId: toUserId
|
|
137
139
|
};
|
|
138
140
|
(0, _api.getSummaryEvaluate)(params).then(function (res) {
|
|
139
|
-
var _res$
|
|
141
|
+
var _res$Data2, _res$Data3, _res$Data5;
|
|
140
142
|
|
|
141
|
-
setRemark(res === null || res === void 0 ? void 0 : (_res$
|
|
143
|
+
setRemark(res === null || res === void 0 ? void 0 : (_res$Data2 = res.Data) === null || _res$Data2 === void 0 ? void 0 : _res$Data2.remark);
|
|
142
144
|
|
|
143
|
-
if ((res === null || res === void 0 ? void 0 : (_res$
|
|
144
|
-
var _res$
|
|
145
|
+
if ((res === null || res === void 0 ? void 0 : (_res$Data3 = res.Data) === null || _res$Data3 === void 0 ? void 0 : _res$Data3.type) === 1) {
|
|
146
|
+
var _res$Data4;
|
|
145
147
|
|
|
146
|
-
setRatingScore(Number(res === null || res === void 0 ? void 0 : (_res$
|
|
147
|
-
} else if ((res === null || res === void 0 ? void 0 : (_res$
|
|
148
|
-
var _res$
|
|
148
|
+
setRatingScore(Number(res === null || res === void 0 ? void 0 : (_res$Data4 = res.Data) === null || _res$Data4 === void 0 ? void 0 : _res$Data4.value) / 2);
|
|
149
|
+
} else if ((res === null || res === void 0 ? void 0 : (_res$Data5 = res.Data) === null || _res$Data5 === void 0 ? void 0 : _res$Data5.type) === 2) {
|
|
150
|
+
var _res$Data6;
|
|
149
151
|
|
|
150
|
-
setEencourageState(res === null || res === void 0 ? void 0 : (_res$
|
|
152
|
+
setEencourageState(res === null || res === void 0 ? void 0 : (_res$Data6 = res.Data) === null || _res$Data6 === void 0 ? void 0 : _res$Data6.value);
|
|
151
153
|
}
|
|
152
154
|
});
|
|
153
155
|
}
|
|
@@ -62,7 +62,7 @@ var Progress = function Progress(_ref) {
|
|
|
62
62
|
}, renderContent, /*#__PURE__*/_react["default"].createElement("div", {
|
|
63
63
|
className: (0, _classnames["default"])("".concat(prefix, "__bg"), (_classNames = {}, _defineProperty(_classNames, "".concat(prefix, "__bg--normal"), status === "normal"), _defineProperty(_classNames, "".concat(prefix, "__bg--risk"), status === "risk"), _defineProperty(_classNames, "".concat(prefix, "__bg--delay"), status === "delay"), _classNames)),
|
|
64
64
|
style: {
|
|
65
|
-
width: "".concat(value, "%")
|
|
65
|
+
width: "".concat(value > 100 ? 100 : value, "%")
|
|
66
66
|
}
|
|
67
67
|
}));
|
|
68
68
|
};
|
|
@@ -137,19 +137,20 @@ var EvaluteCard = function EvaluteCard(props) {
|
|
|
137
137
|
(0, _react.useEffect)(function () {
|
|
138
138
|
if (evaluation) {
|
|
139
139
|
setCurrentEvalute(evaluation);
|
|
140
|
-
|
|
141
|
-
if (type === 1) {
|
|
142
|
-
setEvaluateConfig({
|
|
143
|
-
bgc: "rgba(240, 163, 38, 0.12)"
|
|
144
|
-
});
|
|
145
|
-
} else if (type === 2) {
|
|
146
|
-
var curTypeConfig = RemarkTypeList.find(function (item) {
|
|
147
|
-
return item.id === Number(value);
|
|
148
|
-
}) || {};
|
|
149
|
-
setEvaluateConfig(curTypeConfig);
|
|
150
|
-
}
|
|
151
140
|
}
|
|
152
141
|
}, [evaluation]);
|
|
142
|
+
(0, _react.useEffect)(function () {
|
|
143
|
+
if (type === 1) {
|
|
144
|
+
setEvaluateConfig({
|
|
145
|
+
bgc: "rgba(240, 163, 38, 0.12)"
|
|
146
|
+
});
|
|
147
|
+
} else if (type === 2) {
|
|
148
|
+
var curTypeConfig = RemarkTypeList.find(function (item) {
|
|
149
|
+
return item.id === Number(value);
|
|
150
|
+
}) || {};
|
|
151
|
+
setEvaluateConfig(curTypeConfig);
|
|
152
|
+
}
|
|
153
|
+
}, [currentEvalute]);
|
|
153
154
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
154
155
|
className: (0, _classnames["default"])(preCls, (_classNames = {}, _defineProperty(_classNames, "".concat(preCls, "__score"), type === 1), _defineProperty(_classNames, "".concat(preCls, "__").concat(evaluateConfig.key), type === 2), _classNames)),
|
|
155
156
|
style: {
|
|
@@ -192,11 +192,11 @@ var DynamicReply = function DynamicReply(_ref) {
|
|
|
192
192
|
alt: ""
|
|
193
193
|
}))), dailyContent.map(function (item) {
|
|
194
194
|
if (item.contentType === _constant.dailyContentType.richText) {
|
|
195
|
-
return
|
|
195
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
196
196
|
className: "".concat(prefix, "__work")
|
|
197
197
|
}, item.title === "工作总结" ? (0, _getLocale.getLocale)('Tasks_Tab_MyS_JobSummary') : (0, _getLocale.getLocale)('Rep_Tab_Mys_NextWorkPlans'), /*#__PURE__*/_react["default"].createElement(_richEditor["default"], null, /*#__PURE__*/_react["default"].createElement(_richEditor.EditorComponent, {
|
|
198
198
|
editable: false,
|
|
199
|
-
initialState: JSON.parse(item.richContent || '{}'),
|
|
199
|
+
initialState: !!item.richContent ? JSON.parse(item.richContent || '{}') : undefined,
|
|
200
200
|
placeholder: (0, _getLocale.getLocale)('Rep_NewS_Notfilled')
|
|
201
201
|
})));
|
|
202
202
|
}
|
|
@@ -101,10 +101,10 @@ var GuideTip = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
101
101
|
(0, _react.useImperativeHandle)(ref, function () {
|
|
102
102
|
return {
|
|
103
103
|
showGuideTip: function showGuideTip() {
|
|
104
|
-
return
|
|
104
|
+
return popupRef.current.open();
|
|
105
105
|
},
|
|
106
106
|
hideGuideTip: function hideGuideTip() {
|
|
107
|
-
return
|
|
107
|
+
return popupRef.current.close();
|
|
108
108
|
}
|
|
109
109
|
};
|
|
110
110
|
});
|
|
@@ -89,7 +89,7 @@ function KrNode(props) {
|
|
|
89
89
|
className: "".concat(precls, "__name-text"),
|
|
90
90
|
onClick: openKrDrawer
|
|
91
91
|
}, /*#__PURE__*/_react["default"].createElement(_tooltip["default"].Text, {
|
|
92
|
-
text: (0, _tools.htmlDecodeByHtmlRegExp)(data.mileStoneName),
|
|
92
|
+
text: (0, _openData.parseString)((0, _tools.htmlDecodeByHtmlRegExp)(data.mileStoneName)),
|
|
93
93
|
maxWidth: 374
|
|
94
94
|
}))), /*#__PURE__*/_react["default"].createElement("span", {
|
|
95
95
|
className: "".concat(precls, "__principle")
|
|
@@ -95,7 +95,7 @@ function MileStone(props) {
|
|
|
95
95
|
className: (0, _classnames["default"])("tu-icon-licheng-s", "".concat(precls, "__name-icon"))
|
|
96
96
|
}), /*#__PURE__*/_react["default"].createElement("span", {
|
|
97
97
|
onClick: openKrDrawer
|
|
98
|
-
}, (0, _tools.htmlDecodeByHtmlRegExp)(data.mileStoneName))), /*#__PURE__*/_react["default"].createElement("span", {
|
|
98
|
+
}, (0, _openData.parseString)((0, _tools.htmlDecodeByHtmlRegExp)(data.mileStoneName)))), /*#__PURE__*/_react["default"].createElement("span", {
|
|
99
99
|
className: "".concat(precls, "__status")
|
|
100
100
|
}, statusMap[data.status]), /*#__PURE__*/_react["default"].createElement("span", {
|
|
101
101
|
className: "".concat(precls, "__principle")
|
|
@@ -119,7 +119,7 @@ function ONode(props) {
|
|
|
119
119
|
className: "".concat(precls, "__name-text"),
|
|
120
120
|
onClick: openOkrDrawer
|
|
121
121
|
}, /*#__PURE__*/_react["default"].createElement(_tooltip["default"].Text, {
|
|
122
|
-
text: (0, _tools.htmlDecodeByHtmlRegExp)(data.workName),
|
|
122
|
+
text: (0, _openData.parseString)((0, _tools.htmlDecodeByHtmlRegExp)(data.workName)),
|
|
123
123
|
maxWidth: 390
|
|
124
124
|
}))), /*#__PURE__*/_react["default"].createElement("span", {
|
|
125
125
|
className: "".concat(precls, "__principle")
|
|
@@ -88,7 +88,7 @@ function WorkNode(props) {
|
|
|
88
88
|
className: (0, _classnames["default"])('tu-icon-project-s', "".concat(precls, "__name-icon"))
|
|
89
89
|
}), /*#__PURE__*/_react["default"].createElement("span", {
|
|
90
90
|
onClick: gotoWorkDetail
|
|
91
|
-
}, (0, _tools.htmlDecodeByHtmlRegExp)(data.WorkName))), /*#__PURE__*/_react["default"].createElement("span", {
|
|
91
|
+
}, (0, _openData.parseString)((0, _tools.htmlDecodeByHtmlRegExp)(data.WorkName)))), /*#__PURE__*/_react["default"].createElement("span", {
|
|
92
92
|
className: "".concat(precls, "__status")
|
|
93
93
|
}, statusMap[data.Status]), /*#__PURE__*/_react["default"].createElement("span", {
|
|
94
94
|
className: "".concat(precls, "__principle")
|
|
@@ -125,22 +125,29 @@ var getPointYearMonthWeeksRange = function getPointYearMonthWeeksRange(year, mon
|
|
|
125
125
|
exports.getPointYearMonthWeeksRange = getPointYearMonthWeeksRange;
|
|
126
126
|
|
|
127
127
|
var getWeek = function getWeek(date) {
|
|
128
|
-
var
|
|
129
|
-
|
|
130
|
-
var
|
|
131
|
-
var
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
128
|
+
var isPreMonth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
129
|
+
var currentMonth = new Date(date).getMonth() + 1;
|
|
130
|
+
var currentYear = new Date(date).getFullYear();
|
|
131
|
+
var currentDate = new Date(date).getDate();
|
|
132
|
+
var week;
|
|
133
|
+
var range = getPointYearMonthWeeksRange(currentYear, currentMonth);
|
|
134
|
+
|
|
135
|
+
if (new Date(range[0].startTime).getDate() > currentDate) {
|
|
136
|
+
//计入上个月
|
|
137
|
+
currentMonth -= 1;
|
|
138
|
+
|
|
139
|
+
var _range = getPointYearMonthWeeksRange(currentYear, currentMonth);
|
|
140
|
+
|
|
141
|
+
week = _range.length;
|
|
142
|
+
} else {
|
|
143
|
+
range.forEach(function (item, index) {
|
|
144
|
+
if (new Date(item.startTime).getDate() < currentDate && new Date(item.endTime).getDate() > currentDate || new Date(item.startTime).getDate() === currentDate || new Date(item.endTime).getDate() === currentDate) {
|
|
145
|
+
week = index + 1;
|
|
146
|
+
}
|
|
147
|
+
});
|
|
141
148
|
}
|
|
142
149
|
|
|
143
|
-
return [week,
|
|
150
|
+
return [week, currentMonth, currentYear];
|
|
144
151
|
};
|
|
145
152
|
|
|
146
153
|
exports.getWeek = getWeek;
|
package/lib/utils/open-data.js
CHANGED
|
@@ -71,6 +71,7 @@ var getOpenId = function getOpenId(id, type) {
|
|
|
71
71
|
exports.getOpenId = getOpenId;
|
|
72
72
|
|
|
73
73
|
function openData(p) {
|
|
74
|
+
//@ts-ignore
|
|
74
75
|
if (getSource() == WX_SOURCE || getUA().includes(WX_UA_STR)) {
|
|
75
76
|
return function (p) {
|
|
76
77
|
if (p.id === undefined && p.corpId === undefined) {
|
|
@@ -86,7 +87,7 @@ function openData(p) {
|
|
|
86
87
|
Sentry.captureException(new Error("企业微信openData调用失败"), scope);
|
|
87
88
|
});
|
|
88
89
|
return p.name || null;
|
|
89
|
-
}
|
|
90
|
+
} //@ts-ignore
|
|
90
91
|
|
|
91
92
|
|
|
92
93
|
var openId = p.corpId || getOpenId(p.id, p.type);
|
|
@@ -105,31 +106,35 @@ function openData(p) {
|
|
|
105
106
|
Sentry.captureException(new Error("企业微信openData调用失败"), scope);
|
|
106
107
|
});
|
|
107
108
|
return p.name || p.id || null;
|
|
108
|
-
}
|
|
109
|
+
} //<span style={{color:'red'}}>OPENID_EMPTY</span>;
|
|
110
|
+
|
|
109
111
|
|
|
110
112
|
var ref = (0, _react.useRef)(null);
|
|
111
113
|
(0, _react.useEffect)(function () {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
//@ts-ignore
|
|
115
|
+
window.WWOpenData && window.WWOpenData.bind(ref.current);
|
|
116
|
+
if (!p.id) return;
|
|
117
|
+
var openId = getOpenId(p.id, p.type);
|
|
116
118
|
|
|
117
|
-
|
|
118
|
-
});
|
|
119
|
+
if (!openId) {}
|
|
120
|
+
}, []);
|
|
119
121
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
120
122
|
style: {
|
|
121
|
-
display:
|
|
122
|
-
position:
|
|
123
|
-
overflow:
|
|
124
|
-
textOverflow:
|
|
123
|
+
display: 'inline',
|
|
124
|
+
position: 'relative',
|
|
125
|
+
overflow: 'hidden',
|
|
126
|
+
textOverflow: 'ellipsis'
|
|
125
127
|
}
|
|
126
|
-
},
|
|
128
|
+
},
|
|
129
|
+
/*#__PURE__*/
|
|
130
|
+
//@ts-ignore
|
|
131
|
+
_react["default"].createElement("ww-open-data", {
|
|
127
132
|
ref: ref,
|
|
128
133
|
type: p.type,
|
|
129
134
|
openid: openId
|
|
130
135
|
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
131
136
|
style: {
|
|
132
|
-
position:
|
|
137
|
+
position: 'absolute',
|
|
133
138
|
top: 0,
|
|
134
139
|
left: 0,
|
|
135
140
|
right: 0,
|
|
@@ -138,11 +143,11 @@ function openData(p) {
|
|
|
138
143
|
}
|
|
139
144
|
}));
|
|
140
145
|
};
|
|
146
|
+
} else {
|
|
147
|
+
return function (p) {
|
|
148
|
+
return p.name || p.id || null;
|
|
149
|
+
};
|
|
141
150
|
}
|
|
142
|
-
|
|
143
|
-
return function (p) {
|
|
144
|
-
return p.name || p.id || null;
|
|
145
|
-
};
|
|
146
151
|
}
|
|
147
152
|
|
|
148
153
|
var getOpenData = openData();
|
|
@@ -249,18 +254,14 @@ var parseTag = function parseTag(str) {
|
|
|
249
254
|
exports.parseTag = parseTag;
|
|
250
255
|
|
|
251
256
|
var parseString = function parseString(str) {
|
|
252
|
-
|
|
253
|
-
var source = window.BSGlobal.tenantInfo.Source
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
}
|
|
261
|
-
});
|
|
262
|
-
}
|
|
263
|
-
|
|
257
|
+
//@ts-ignore
|
|
258
|
+
var source = window.BSGlobal.tenantInfo.Source,
|
|
259
|
+
ua = navigator.userAgent.toLowerCase();
|
|
260
|
+
if (source != 860 && ua.indexOf('wxwork') == -1) return /*#__PURE__*/_react["default"].createElement("span", {
|
|
261
|
+
dangerouslySetInnerHTML: {
|
|
262
|
+
__html: str
|
|
263
|
+
}
|
|
264
|
+
});
|
|
264
265
|
var reg = /\[(\w+?)\:(\w+?)\]/g;
|
|
265
266
|
var strReg = /\[\w+?\:\w+?\]/;
|
|
266
267
|
var openDatas = [];
|
|
@@ -275,14 +276,16 @@ var parseString = function parseString(str) {
|
|
|
275
276
|
openDatas.push( /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, v2Paresed));
|
|
276
277
|
} else {
|
|
277
278
|
openDatas.push( /*#__PURE__*/_react["default"].createElement("span", null, /*#__PURE__*/_react["default"].createElement(OpenDataCompoent, {
|
|
278
|
-
id: matchStr[1]
|
|
279
|
+
id: matchStr[1],
|
|
280
|
+
callFunc: "parseString",
|
|
281
|
+
extra: str
|
|
279
282
|
})));
|
|
280
283
|
}
|
|
281
284
|
|
|
282
285
|
matchStr = reg.exec(str);
|
|
283
286
|
}
|
|
284
287
|
|
|
285
|
-
var commonStrs = str
|
|
288
|
+
var commonStrs = str.split(strReg);
|
|
286
289
|
var renderData = [];
|
|
287
290
|
|
|
288
291
|
for (var i = 0; i < commonStrs.length; i++) {
|
|
@@ -308,15 +311,11 @@ var parseStringV2 = function parseStringV2(str) {
|
|
|
308
311
|
// @ts-ignore
|
|
309
312
|
var source = window.BSGlobal.tenantInfo.Source;
|
|
310
313
|
var ua = navigator.userAgent.toLowerCase();
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
}
|
|
317
|
-
});
|
|
318
|
-
}
|
|
319
|
-
|
|
314
|
+
if (source != 860 && ua.indexOf('micromessenger') == -1) return /*#__PURE__*/_react["default"].createElement("span", {
|
|
315
|
+
dangerouslySetInnerHTML: {
|
|
316
|
+
__html: str
|
|
317
|
+
}
|
|
318
|
+
});
|
|
320
319
|
var reg = /\$(userName|departmentName)\=(.+?)\$/g;
|
|
321
320
|
var strReg = /\$(?:userName|departmentName)\=.+?\$/;
|
|
322
321
|
var openDatas = [];
|
|
@@ -336,7 +335,7 @@ var parseStringV2 = function parseStringV2(str) {
|
|
|
336
335
|
matchStr = reg.exec(str);
|
|
337
336
|
}
|
|
338
337
|
|
|
339
|
-
var commonStrs =
|
|
338
|
+
var commonStrs = str.split(strReg);
|
|
340
339
|
var renderData = [];
|
|
341
340
|
|
|
342
341
|
for (var i = 0; i < commonStrs.length; i++) {
|