@titaui/pc 1.11.51 → 1.11.52-beta.11
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/button/images/blue.svg +21 -0
- package/lib/components/button/images/red.svg +21 -0
- package/lib/components/button/images/white.svg +19 -0
- package/lib/components/button/rect-btn/index.js +3 -3
- package/lib/components/change-okr-modal/Item.js +19 -18
- package/lib/components/change-okr-modal/styledComponents.js +9 -9
- package/lib/components/checkbox/index.css +4 -0
- package/lib/components/contact-kefu/index.css +11 -1
- package/lib/components/contact-kefu/index.js +10 -4
- package/lib/components/create-okr-modal/createSuccessCmp.js +47 -19
- package/lib/components/create-okr-modal/fields/index.css +14 -3
- package/lib/components/create-okr-modal/fields/o-new-name.js +30 -19
- package/lib/components/create-okr-modal/fields/okr-parent.js +7 -5
- package/lib/components/create-okr-modal/index.js +200 -133
- package/lib/components/create-okr-modal/kr-items/index.css +23 -13
- package/lib/components/create-okr-modal/kr-items/krDatas.js +95 -76
- package/lib/components/create-okr-modal/kr-items/krItem.js +53 -56
- package/lib/components/create-okr-modal/style.js +5 -5
- package/lib/components/date-picker/BodyItem.js +3 -3
- package/lib/components/date-picker/CalendarHeader.js +3 -3
- package/lib/components/delete-confirm-pop/ConfirmPop.js +3 -3
- package/lib/components/dynamic/constant.js +1 -1
- package/lib/components/dynamic/dynamic-item/components/feed-operate/index.js +8 -8
- package/lib/components/dynamic/dynamic-item/dynamic-create-o/index.js +8 -8
- package/lib/components/dynamic/dynamic-list/index.js +14 -7
- package/lib/components/dynamic/index.js +9 -12
- package/lib/components/dynamic/request-api.js +7 -68
- package/lib/components/eReport/eReportLists/reportList.js +3 -3
- package/lib/components/emotions-selector/selector-pop.js +3 -3
- package/lib/components/ereport-list/index.js +3 -3
- package/lib/components/mblog/components/MblogAction.js +3 -3
- package/lib/components/menus/export-modules/appraisal-menus/menus.js +11 -9
- package/lib/components/nav-top/components/menu/index.js +18 -16
- package/lib/components/nav-top/index.js +2 -2
- package/lib/components/okr-detail/components/base-okr-type/confirm/confirm.js +1 -1
- package/lib/components/okr-detail/components/header/edit-name.js +86 -40
- package/lib/components/okr-detail/components/header/index.css +120 -41
- package/lib/components/okr-detail/components/header/index.js +36 -46
- package/lib/components/okr-detail/components/header/o-classify.js +152 -0
- package/lib/components/okr-detail/components/header/o-name.js +7 -5
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-kr-node/index.js +3 -1
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/index.css +58 -4
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/index.js +159 -63
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/kr-score-editor/edit-pop.js +3 -3
- package/lib/components/okr-detail/components/okr-tree/tree-node/o-child-node/index.js +9 -9
- package/lib/components/okr-detail/components/okr-tree/tree-node/o-parent-node/index.js +15 -13
- package/lib/components/okr-detail/detail-header/index.js +8 -4
- package/lib/components/okr-detail/e-list/index.js +2 -2
- package/lib/components/okr-detail/okr-list/create-kr-item/index.css +17 -0
- package/lib/components/okr-detail/okr-list/create-kr-item/index.js +75 -53
- package/lib/components/okr-detail/request-apis.js +73 -69
- package/lib/components/okr-detail/schedule/components/kr-progress/index.js +3 -1
- package/lib/components/okr-detail/schedule/components/o-progress/index.js +34 -32
- package/lib/components/okr-detail/schedule/components/sub-o-progress/index.js +3 -1
- package/lib/components/okr-flow/child-node/kr-node.js +3 -1
- package/lib/components/okr-flow/child-node/work-node.js +3 -1
- package/lib/components/okr-progress/components/kr-progress/index.js +5 -3
- package/lib/components/okr-progress/components/o-progress/index.js +3 -1
- package/lib/components/okr-progress/components/sub-o-progress/index.js +3 -1
- package/lib/components/okr-review/ReviewPop/components/ReviewBody/index.js +3 -3
- package/lib/components/okr-review/components/ReviewItem/index.js +3 -3
- package/lib/components/okr-review/components/confirm-pop/ConfirmPop.js +3 -3
- package/lib/components/okr-share/common-painter/openDataPainter.js +9 -6
- package/lib/components/okr-share/common-painter/utils.js +183 -36
- package/lib/components/okr-share/index.css +5 -4
- package/lib/components/okr-share/pink-card/card.js +3 -3
- package/lib/components/okr-share/pink-card/drawKrs.js +93 -18
- package/lib/components/okr-share/pink-card/index.js +20 -12
- package/lib/components/open-data-painter/index.js +6 -5
- package/lib/components/period-selector/interface.js +7 -0
- package/lib/components/publish-dynamic-modal/publish-dynamic-modal.js +16 -10
- package/lib/components/range-selector-pop/RangeSelectorPop.js +3 -3
- package/lib/components/rich-editor/models/schema.js +6 -6
- package/lib/components/rich-editor/plugins/block/block-quote/index.js +8 -8
- package/lib/components/rich-editor/plugins/block/heading/index.js +8 -8
- package/lib/components/rich-editor/plugins/block/lists/index.js +14 -14
- package/lib/components/rich-editor/plugins/block/paragraph/index.js +5 -5
- package/lib/components/rich-editor/plugins/core/index.js +4 -4
- package/lib/components/rich-editor/plugins/extension/alignment/index.js +5 -5
- package/lib/components/rich-editor/plugins/extension/placeholder/index.js +4 -4
- package/lib/components/rich-editor/plugins/inline/color/index.js +11 -11
- package/lib/components/rich-editor/plugins/inline/delete-line/index.js +8 -8
- package/lib/components/rich-editor/plugins/inline/em/index.js +5 -5
- package/lib/components/rich-editor/plugins/inline/link/index.js +8 -8
- package/lib/components/rich-editor/plugins/inline/strong/index.js +8 -8
- package/lib/components/rich-editor/plugins/inline/under-line/index.js +8 -8
- package/lib/components/rich-editor/react/uiProvider.js +3 -3
- package/lib/components/rich-editor/ui/Popup/index.js +3 -3
- package/lib/components/search-input/index.css +1 -1
- package/lib/components/search-key-handle/index.js +9 -7
- package/lib/components/select/Option.js +3 -3
- package/lib/components/select-layer/index.css +1 -1
- package/lib/components/task-relation-modal/helper.js +139 -2
- package/lib/components/task-relation-modal/image/loading.gif +0 -0
- package/lib/components/task-relation-modal/index.js +9 -0
- package/lib/components/task-relation-modal/okr-relation/relation-task-model/index.css +18 -0
- package/lib/components/task-relation-modal/okr-relation/relation-task-model/index.js +262 -0
- package/lib/components/task-relation-modal/okr-relation/relation-task-model/search-form.js +135 -0
- package/lib/components/task-relation-modal/okr-relation/relation-work-model/index.css +0 -0
- package/lib/components/task-relation-modal/okr-relation/relation-work-model/index.js +129 -0
- package/lib/components/task-relation-modal/okr-relation/request-api.js +106 -0
- package/lib/components/task-relation-modal/okr-relation/tree/task-tree/index.css +120 -0
- package/lib/components/task-relation-modal/okr-relation/tree/task-tree/index.js +185 -0
- package/lib/components/task-relation-modal/request-api.js +28 -2
- package/lib/components/task-relation-modal/search/okr-status-select.js +3 -3
- package/lib/components/task-relation-modal/search/principal.js +36 -19
- package/lib/components/task-relation-modal/search/search-dropdown/index.css +2 -1
- package/lib/components/task-relation-modal/search/search-dropdown/index.js +1 -1
- package/lib/components/{dynamic/dynamic-topping/index.js → task-relation-modal/search/task-relation.js} +45 -44
- package/lib/components/task-relation-modal/search/task-status-select.js +87 -0
- package/lib/components/{dynamic/dynamic-liking/index.js → task-relation-modal/search/work-relation.js} +43 -39
- package/lib/components/task-relation-modal/search/work-status-select.js +74 -0
- package/lib/components/task-relation-modal/tree/category-tree/index.css +3 -3
- package/lib/components/task-relation-modal/tree/okr-tree/index.css +1 -1
- package/lib/components/task-relation-modal/tree/okr-tree/search-form.js +16 -2
- package/lib/components/task-relation-modal/tree/task-list/index.css +0 -0
- package/lib/components/task-relation-modal/tree/task-list/index.js +1 -0
- package/lib/components/task-relation-modal/tree/work-list/index.css +14 -0
- package/lib/components/task-relation-modal/tree/work-list/index.js +176 -0
- package/lib/components/task-relation-modal/tree/work-list/search-form.js +123 -0
- package/lib/components/task-relation-modal/tree/work-tree/index.css +1 -1
- package/lib/components/task-relation-modal/tree-node/category-node/index.css +1 -12
- package/lib/components/task-relation-modal/tree-node/category-node/index.js +1 -3
- package/lib/components/task-relation-modal/tree-node/kr-node/index.css +0 -16
- package/lib/components/task-relation-modal/tree-node/kr-node/index.js +4 -10
- package/lib/components/task-relation-modal/tree-node/milestone-node/index.css +0 -16
- package/lib/components/task-relation-modal/tree-node/milestone-node/index.js +0 -4
- package/lib/components/task-relation-modal/tree-node/o-node/index.js +8 -8
- package/lib/components/task-relation-modal/tree-node/work-node/index.js +3 -1
- package/lib/components/task-relation-modal/work-relation/index.css +0 -0
- package/lib/components/task-relation-modal/work-relation/index.js +256 -0
- package/lib/components/tita-chart/errorBoundary/index.js +3 -3
- package/lib/components/tooltip/index.js +3 -0
- package/lib/components/tooltip/tooltip-rows/index.css +26 -0
- package/lib/components/{dynamic/advertise → tooltip/tooltip-rows}/index.js +65 -85
- package/lib/components/user-selector/category-selector-panel/index.js +6 -1
- package/lib/components/{dynamic/quick-operation/components/create-task/index.js → user-selector/category-selector-panel/subordinate-tree.js} +37 -20
- package/lib/components/user-selector/constant.js +10 -2
- package/lib/components/user-selector/empty/index.css +5 -0
- package/lib/components/user-selector/empty/index.js +9 -3
- package/lib/components/user-selector/export-modules/depart-search-selector/index.js +45 -17
- package/lib/components/user-selector/export-modules/field-tree-selector/index.js +3 -1
- package/lib/components/user-selector/images/no-auth.png +0 -0
- package/lib/components/user-selector/request-apis.js +28 -9
- package/lib/components/user-selector/searched-panel/index.js +21 -7
- package/lib/components/user-selector/select-tree/tree-nodes/tree-person-node/index.js +46 -18
- package/lib/components/wechat-btn/index.css +5 -1
- package/lib/components-v1/animate/AnimateChild.js +3 -3
- package/lib/components-v1/avatar/index.js +3 -3
- package/lib/components-v1/dropDownSelector/StatelessDropdown.js +3 -3
- package/lib/components-v1/progress/CircleProgress.js +3 -3
- package/lib/components-v1/select/Option.js +3 -3
- package/lib/components-v1/userSelector/UserSelectorPop.js +3 -3
- package/lib/components-v1/userSelector/components/MultiMode/index.js +3 -3
- package/lib/components-v1/userSelector/components/SingleMode.js +7 -5
- package/lib/components-v1/userSelector/components/UserItem.js +3 -3
- package/lib/pages/home/components/data-list/table/columns/krName.js +3 -1
- package/lib/pages/home/components/data-list/table/columns/okrName.js +4 -2
- package/lib/utils/open-data.js +213 -65
- package/lib/utils/planDataJson.js +11115 -0
- package/package.json +3 -2
- package/lib/components/dynamic/advertise/components/next-btn/index.css +0 -27
- package/lib/components/dynamic/advertise/components/next-btn/index.js +0 -32
- package/lib/components/dynamic/advertise/components/pre-btn/index.css +0 -26
- package/lib/components/dynamic/advertise/components/pre-btn/index.js +0 -32
- package/lib/components/dynamic/advertise/index.css +0 -21
- package/lib/components/dynamic/advertise/interface.js +0 -5
- package/lib/components/dynamic/advertise/util.js +0 -28
- package/lib/components/dynamic/components/dynamic-search-input/index.css +0 -81
- package/lib/components/dynamic/components/dynamic-search-input/index.js +0 -203
- package/lib/components/dynamic/components/first-level-tabs/index.css +0 -101
- package/lib/components/dynamic/components/first-level-tabs/index.js +0 -131
- package/lib/components/dynamic/dynamic-like-ranking/image/like-ranking.svg +0 -23
- package/lib/components/dynamic/dynamic-like-ranking/image/ranking-1.png +0 -0
- package/lib/components/dynamic/dynamic-like-ranking/image/ranking-2.png +0 -0
- package/lib/components/dynamic/dynamic-like-ranking/image/ranking-3.png +0 -0
- package/lib/components/dynamic/dynamic-like-ranking/image/ranking-empty.png +0 -0
- package/lib/components/dynamic/dynamic-like-ranking/index.css +0 -146
- package/lib/components/dynamic/dynamic-like-ranking/index.js +0 -180
- package/lib/components/dynamic/dynamic-like-ranking/item.js +0 -105
- package/lib/components/dynamic/dynamic-like-ranking/mock.js +0 -84
- package/lib/components/dynamic/dynamic-liking/image/like-dynamic.svg +0 -30
- package/lib/components/dynamic/dynamic-liking/index.css +0 -81
- package/lib/components/dynamic/dynamic-liking/item.js +0 -75
- package/lib/components/dynamic/dynamic-liking/mock.js +0 -83
- package/lib/components/dynamic/dynamic-topping/image/quotation-mark.svg +0 -16
- package/lib/components/dynamic/dynamic-topping/image/top-icon.svg +0 -30
- package/lib/components/dynamic/dynamic-topping/index.css +0 -141
- package/lib/components/dynamic/dynamic-topping/interface.js +0 -5
- package/lib/components/dynamic/dynamic-topping/item.js +0 -153
- package/lib/components/dynamic/dynamic-topping/request-api.js +0 -36
- package/lib/components/dynamic/dynamic.css +0 -173
- package/lib/components/dynamic/dynamic.js +0 -428
- package/lib/components/dynamic/export-module/index.js +0 -37
- package/lib/components/dynamic/img/dynamic-top.svg +0 -14
- package/lib/components/dynamic/my-team/img/add-subordinate.png +0 -0
- package/lib/components/dynamic/my-team/img/line.png +0 -0
- package/lib/components/dynamic/my-team/img/team.png +0 -0
- package/lib/components/dynamic/my-team/index.css +0 -184
- package/lib/components/dynamic/my-team/index.js +0 -263
- package/lib/components/dynamic/my-team/request-api.js +0 -52
- package/lib/components/dynamic/my-team/util.js +0 -20
- package/lib/components/dynamic/new-ui.css +0 -192
- package/lib/components/dynamic/online-broadcast/components/broadcast-item/index.css +0 -58
- package/lib/components/dynamic/online-broadcast/components/broadcast-item/index.js +0 -68
- package/lib/components/dynamic/online-broadcast/data.js +0 -95
- package/lib/components/dynamic/online-broadcast/img/broadcast.svg +0 -14
- package/lib/components/dynamic/online-broadcast/img/new.png +0 -0
- package/lib/components/dynamic/online-broadcast/img/preview.png +0 -0
- package/lib/components/dynamic/online-broadcast/index.css +0 -46
- package/lib/components/dynamic/online-broadcast/index.js +0 -61
- package/lib/components/dynamic/online-broadcast/interfact.js +0 -5
- package/lib/components/dynamic/quick-operation/components/create-announcement/index.css +0 -25
- package/lib/components/dynamic/quick-operation/components/create-announcement/index.js +0 -39
- package/lib/components/dynamic/quick-operation/components/create-okr/index.css +0 -25
- package/lib/components/dynamic/quick-operation/components/create-okr/index.js +0 -39
- package/lib/components/dynamic/quick-operation/components/create-share/index.css +0 -25
- package/lib/components/dynamic/quick-operation/components/create-share/index.js +0 -39
- package/lib/components/dynamic/quick-operation/components/create-task/index.css +0 -25
- package/lib/components/dynamic/quick-operation/img/new-announcement.png +0 -0
- package/lib/components/dynamic/quick-operation/img/new-okr.png +0 -0
- package/lib/components/dynamic/quick-operation/img/new-share.png +0 -0
- package/lib/components/dynamic/quick-operation/img/new-task.png +0 -0
- package/lib/components/dynamic/quick-operation/index.css +0 -51
- package/lib/components/dynamic/quick-operation/index.js +0 -120
package/lib/utils/open-data.js
CHANGED
|
@@ -5,16 +5,22 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.parseTag = exports.parseString = exports.parseHtmlAndTextTag = exports.isWxTrial = exports.isWechat = exports.isPlatform = exports.getSource = exports.getOpenId = exports["default"] = exports.OpenUserName = exports.OpenDepartmentName = void 0;
|
|
8
|
+
exports.parseTag = exports.parseStringV2 = exports.parseString = exports.parseOpenDataStringToImg = exports.parseHtmlAndTextTag = exports.isWxTrial = exports.isWechat = exports.isPlatform = exports.getSource = exports.getOpenId = exports["default"] = exports.OpenUserName = exports.OpenDepartmentName = void 0;
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
|
|
12
12
|
var _bsGlobal = require("./bs-global");
|
|
13
13
|
|
|
14
|
+
var _openDataPainter = require("../components/open-data-painter");
|
|
15
|
+
|
|
14
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); }
|
|
15
17
|
|
|
16
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; }
|
|
17
19
|
|
|
20
|
+
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); } }
|
|
21
|
+
|
|
22
|
+
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); }); }; }
|
|
23
|
+
|
|
18
24
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
19
25
|
|
|
20
26
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -65,8 +71,8 @@ exports.getOpenId = getOpenId;
|
|
|
65
71
|
function openData(p) {
|
|
66
72
|
if (getSource() == WX_SOURCE || getUA().includes(WX_UA_STR)) {
|
|
67
73
|
return function (p) {
|
|
68
|
-
if (p.id === undefined) return p.name || null;
|
|
69
|
-
var openId = getOpenId(p.id, p.type);
|
|
74
|
+
if (p.id === undefined && p.corpId === undefined) return p.name || null;
|
|
75
|
+
var openId = p.corpId || getOpenId(p.id, p.type);
|
|
70
76
|
if (!openId) return p.name || p.id || null;
|
|
71
77
|
var ref = (0, _react.useRef)(null);
|
|
72
78
|
(0, _react.useEffect)(function () {
|
|
@@ -79,11 +85,10 @@ function openData(p) {
|
|
|
79
85
|
});
|
|
80
86
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
81
87
|
style: {
|
|
82
|
-
display: 'inline
|
|
88
|
+
display: 'inline',
|
|
83
89
|
position: 'relative',
|
|
84
90
|
overflow: 'hidden',
|
|
85
|
-
textOverflow: 'ellipsis'
|
|
86
|
-
verticalAlign: 'middle'
|
|
91
|
+
textOverflow: 'ellipsis'
|
|
87
92
|
}
|
|
88
93
|
}, /*#__PURE__*/_react["default"].createElement("ww-open-data", {
|
|
89
94
|
ref: ref,
|
|
@@ -223,12 +228,14 @@ var parseString = function parseString(str) {
|
|
|
223
228
|
var strReg = /\[\w+?\:\w+?\]/;
|
|
224
229
|
var openDatas = [];
|
|
225
230
|
var matchStr = reg.exec(str);
|
|
231
|
+
if (!matchStr) return parseStringV2(str);
|
|
226
232
|
|
|
227
233
|
while (matchStr != null) {
|
|
228
234
|
var OpenDataCompoent = openDataMap[matchStr[2]];
|
|
229
235
|
|
|
230
236
|
if (!OpenDataCompoent) {
|
|
231
|
-
|
|
237
|
+
var v2Paresed = parseStringV2(matchStr[0]);
|
|
238
|
+
openDatas.push( /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, v2Paresed));
|
|
232
239
|
} else {
|
|
233
240
|
openDatas.push( /*#__PURE__*/_react["default"].createElement("span", null, /*#__PURE__*/_react["default"].createElement(OpenDataCompoent, {
|
|
234
241
|
id: matchStr[1]
|
|
@@ -241,6 +248,56 @@ var parseString = function parseString(str) {
|
|
|
241
248
|
var commonStrs = str.split(strReg);
|
|
242
249
|
var renderData = [];
|
|
243
250
|
|
|
251
|
+
for (var i = 0; i < commonStrs.length; i++) {
|
|
252
|
+
var _v2Paresed = parseStringV2(commonStrs[i]);
|
|
253
|
+
|
|
254
|
+
openDatas.push( /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, _v2Paresed)); // renderData.push(
|
|
255
|
+
// <span dangerouslySetInnerHTML={{ __html: commonStrs[i] }} />,
|
|
256
|
+
// )
|
|
257
|
+
|
|
258
|
+
renderData.push(openDatas[i]);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
return renderData;
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
exports.parseString = parseString;
|
|
265
|
+
var openDataMapV2 = {
|
|
266
|
+
userName: OpenUserName,
|
|
267
|
+
departmentName: OpenDepartmentName
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
var parseStringV2 = function parseStringV2(str) {
|
|
271
|
+
// @ts-ignore
|
|
272
|
+
var source = window.BSGlobal.tenantInfo.Source;
|
|
273
|
+
var ua = navigator.userAgent.toLowerCase();
|
|
274
|
+
if (source != 860 && ua.indexOf('micromessenger') == -1) return /*#__PURE__*/_react["default"].createElement("span", {
|
|
275
|
+
dangerouslySetInnerHTML: {
|
|
276
|
+
__html: str
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
var reg = /\$(userName|departmentName)\=(.+?)\$(\s|$)/g;
|
|
280
|
+
var strReg = /\$(?:userName|departmentName)\=.+?\$(?:\s|$)/;
|
|
281
|
+
var openDatas = [];
|
|
282
|
+
var matchStr = reg.exec(str);
|
|
283
|
+
|
|
284
|
+
while (matchStr != null) {
|
|
285
|
+
var OpenDataCompoent = openDataMapV2[matchStr[1]];
|
|
286
|
+
|
|
287
|
+
if (!OpenDataCompoent) {
|
|
288
|
+
openDatas.push(matchStr[0]);
|
|
289
|
+
} else {
|
|
290
|
+
openDatas.push( /*#__PURE__*/_react["default"].createElement("span", null, /*#__PURE__*/_react["default"].createElement(OpenDataCompoent, {
|
|
291
|
+
corpId: matchStr[2]
|
|
292
|
+
})));
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
matchStr = reg.exec(str);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
var commonStrs = str.split(strReg);
|
|
299
|
+
var renderData = [];
|
|
300
|
+
|
|
244
301
|
for (var i = 0; i < commonStrs.length; i++) {
|
|
245
302
|
renderData.push( /*#__PURE__*/_react["default"].createElement("span", {
|
|
246
303
|
dangerouslySetInnerHTML: {
|
|
@@ -253,33 +310,163 @@ var parseString = function parseString(str) {
|
|
|
253
310
|
return renderData;
|
|
254
311
|
};
|
|
255
312
|
|
|
256
|
-
exports.
|
|
313
|
+
exports.parseStringV2 = parseStringV2;
|
|
314
|
+
|
|
315
|
+
var parseOpenDataStringToImg = /*#__PURE__*/function () {
|
|
316
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(str) {
|
|
317
|
+
var font,
|
|
318
|
+
reg,
|
|
319
|
+
strReg,
|
|
320
|
+
openDatas,
|
|
321
|
+
matchStr,
|
|
322
|
+
commonStrs,
|
|
323
|
+
renderData,
|
|
324
|
+
i,
|
|
325
|
+
_args = arguments;
|
|
326
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
327
|
+
while (1) {
|
|
328
|
+
switch (_context.prev = _context.next) {
|
|
329
|
+
case 0:
|
|
330
|
+
font = _args.length > 1 && _args[1] !== undefined ? _args[1] : {
|
|
331
|
+
lineHeight: 20,
|
|
332
|
+
fontSize: 18,
|
|
333
|
+
fontWeight: '500',
|
|
334
|
+
color: '#3f4755'
|
|
335
|
+
};
|
|
336
|
+
font = _objectSpread(_objectSpread({}, {
|
|
337
|
+
lineHeight: 20,
|
|
338
|
+
fontSize: 18,
|
|
339
|
+
fontWeight: '500',
|
|
340
|
+
color: '#3f4755'
|
|
341
|
+
}), font || {});
|
|
342
|
+
reg = /\$(userName|departmentName)\=(.+?)(\s|$)/g;
|
|
343
|
+
strReg = /\$(?:userName|departmentName)\=.+?(?:\s|$)/;
|
|
344
|
+
openDatas = [];
|
|
345
|
+
matchStr = reg.exec(str);
|
|
346
|
+
|
|
347
|
+
case 6:
|
|
348
|
+
if (!(matchStr != null)) {
|
|
349
|
+
_context.next = 15;
|
|
350
|
+
break;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
_context.t0 = openDatas;
|
|
354
|
+
_context.next = 10;
|
|
355
|
+
return getCanvasImg(matchStr[2], matchStr[1], font);
|
|
356
|
+
|
|
357
|
+
case 10:
|
|
358
|
+
_context.t1 = _context.sent;
|
|
359
|
+
|
|
360
|
+
_context.t0.push.call(_context.t0, _context.t1);
|
|
361
|
+
|
|
362
|
+
matchStr = reg.exec(str);
|
|
363
|
+
_context.next = 6;
|
|
364
|
+
break;
|
|
365
|
+
|
|
366
|
+
case 15:
|
|
367
|
+
commonStrs = str.split(strReg);
|
|
368
|
+
renderData = [];
|
|
369
|
+
|
|
370
|
+
for (i = 0; i < commonStrs.length; i++) {
|
|
371
|
+
renderData.push( /*#__PURE__*/_react["default"].createElement("span", {
|
|
372
|
+
dangerouslySetInnerHTML: {
|
|
373
|
+
__html: commonStrs[i]
|
|
374
|
+
}
|
|
375
|
+
}));
|
|
376
|
+
renderData.push(openDatas[i]);
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
return _context.abrupt("return", renderData);
|
|
380
|
+
|
|
381
|
+
case 19:
|
|
382
|
+
case "end":
|
|
383
|
+
return _context.stop();
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
}, _callee);
|
|
387
|
+
}));
|
|
388
|
+
|
|
389
|
+
return function parseOpenDataStringToImg(_x) {
|
|
390
|
+
return _ref.apply(this, arguments);
|
|
391
|
+
};
|
|
392
|
+
}();
|
|
393
|
+
|
|
394
|
+
exports.parseOpenDataStringToImg = parseOpenDataStringToImg;
|
|
395
|
+
|
|
396
|
+
var getCanvasImg = /*#__PURE__*/function () {
|
|
397
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(id, type, _ref2) {
|
|
398
|
+
var lineHeight, fontSize, fontWeight, color, font, canvas, ctx, name, img, _ctx$measureText, width, actualWidth, src;
|
|
399
|
+
|
|
400
|
+
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
401
|
+
while (1) {
|
|
402
|
+
switch (_context2.prev = _context2.next) {
|
|
403
|
+
case 0:
|
|
404
|
+
lineHeight = _ref2.lineHeight, fontSize = _ref2.fontSize, fontWeight = _ref2.fontWeight, color = _ref2.color;
|
|
405
|
+
font = "".concat(fontWeight, " ").concat(fontSize, "px/").concat(lineHeight, "px arial,sans-serif");
|
|
406
|
+
canvas = document.createElement('canvas');
|
|
407
|
+
ctx = canvas.getContext('2d');
|
|
408
|
+
|
|
409
|
+
if (ctx) {
|
|
410
|
+
_context2.next = 6;
|
|
411
|
+
break;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
return _context2.abrupt("return", null);
|
|
415
|
+
|
|
416
|
+
case 6:
|
|
417
|
+
_context2.next = 8;
|
|
418
|
+
return (0, _openDataPainter.getOpenData)({
|
|
419
|
+
openId: id,
|
|
420
|
+
type: type
|
|
421
|
+
});
|
|
422
|
+
|
|
423
|
+
case 8:
|
|
424
|
+
name = _context2.sent;
|
|
425
|
+
img = document.createElement('img');
|
|
426
|
+
ctx.font = font; // const fitStr = fittingString(ctx, name, 92);
|
|
427
|
+
|
|
428
|
+
_ctx$measureText = ctx.measureText(name || ''), width = _ctx$measureText.width;
|
|
429
|
+
actualWidth = Math.min(width, 92);
|
|
430
|
+
(0, _openDataPainter.setSize)(canvas, ctx, actualWidth, lineHeight);
|
|
431
|
+
ctx.textBaseline = 'middle';
|
|
432
|
+
ctx.font = font;
|
|
433
|
+
ctx.fillStyle = color;
|
|
434
|
+
ctx.fillText(name || '', 0, lineHeight / 2);
|
|
435
|
+
src = canvas.toDataURL();
|
|
436
|
+
return _context2.abrupt("return", /*#__PURE__*/_react["default"].createElement("img", {
|
|
437
|
+
src: src,
|
|
438
|
+
width: actualWidth,
|
|
439
|
+
height: lineHeight
|
|
440
|
+
}));
|
|
441
|
+
|
|
442
|
+
case 20:
|
|
443
|
+
case "end":
|
|
444
|
+
return _context2.stop();
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
}, _callee2);
|
|
448
|
+
}));
|
|
449
|
+
|
|
450
|
+
return function getCanvasImg(_x2, _x3, _x4) {
|
|
451
|
+
return _ref3.apply(this, arguments);
|
|
452
|
+
};
|
|
453
|
+
}();
|
|
257
454
|
|
|
258
455
|
var parseHtmlAndTextTag = function parseHtmlAndTextTag(str) {
|
|
259
456
|
var reg = /<\w+[\w\W]*?(userId|departmentId)=["'](\S+?)["'][\w\W]*?>@([\w\W]*?)<\/\w+>/g;
|
|
260
457
|
var strReg = /<\w+[\w\s"'\/=\:\.]*?(?:userId|departmentId)=["']\S+?["'][\w\s"'\/=\:\.]*?>[\w\W]*?<\/\w+?>/;
|
|
261
458
|
var openDatas = [];
|
|
262
459
|
var matchStr = reg.exec(str);
|
|
263
|
-
var openDatareg = /\[(\w+?)\:(\w+?)\]/g;
|
|
264
|
-
var openDataStrReg = /\[\w+?\:\w+?\]/;
|
|
265
|
-
var openDataMatchStr = openDatareg.exec(str);
|
|
266
|
-
var hasMatchStr = false;
|
|
267
460
|
var renderData = [];
|
|
461
|
+
if (matchStr == null) return parseString(str);
|
|
268
462
|
|
|
269
463
|
while (matchStr != null) {
|
|
270
464
|
if (matchStr) {
|
|
271
|
-
hasMatchStr = true;
|
|
272
465
|
var OpenDataCompoent = matchStr[1] == 'userId' ? OpenUserName : OpenDepartmentName;
|
|
273
466
|
|
|
274
467
|
if (!OpenDataCompoent) {
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
__html: matchStr[0]
|
|
278
|
-
},
|
|
279
|
-
onClick: function onClick(e) {
|
|
280
|
-
return e.stopPropagation();
|
|
281
|
-
}
|
|
282
|
-
}));
|
|
468
|
+
var strParsed = parseString(matchStr[0]);
|
|
469
|
+
openDatas.push( /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, strParsed));
|
|
283
470
|
} else {
|
|
284
471
|
openDatas.push( /*#__PURE__*/_react["default"].createElement("span", {
|
|
285
472
|
style: {
|
|
@@ -299,56 +486,17 @@ var parseHtmlAndTextTag = function parseHtmlAndTextTag(str) {
|
|
|
299
486
|
}
|
|
300
487
|
}
|
|
301
488
|
|
|
302
|
-
|
|
303
|
-
var commonStrs = str.split(strReg);
|
|
304
|
-
|
|
305
|
-
for (var i = 0; i < commonStrs.length; i++) {
|
|
306
|
-
renderData.push( /*#__PURE__*/_react["default"].createElement("span", {
|
|
307
|
-
dangerouslySetInnerHTML: {
|
|
308
|
-
__html: commonStrs[i]
|
|
309
|
-
}
|
|
310
|
-
}));
|
|
311
|
-
renderData.push(openDatas[i]);
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
while (openDataMatchStr != null) {
|
|
316
|
-
if (openDataMatchStr) {
|
|
317
|
-
var _OpenDataCompoent = openDataMap[openDataMatchStr[2]];
|
|
318
|
-
|
|
319
|
-
if (!_OpenDataCompoent) {
|
|
320
|
-
openDatas.push(openDataMatchStr[0]);
|
|
321
|
-
} else {
|
|
322
|
-
openDatas.push( /*#__PURE__*/_react["default"].createElement("span", null, /*#__PURE__*/_react["default"].createElement(_OpenDataCompoent, {
|
|
323
|
-
id: openDataMatchStr[1]
|
|
324
|
-
})));
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
openDataMatchStr = openDatareg.exec(str);
|
|
328
|
-
}
|
|
329
|
-
}
|
|
489
|
+
var commonStrs = str.split(strReg);
|
|
330
490
|
|
|
331
|
-
var
|
|
491
|
+
for (var i = 0; i < commonStrs.length; i++) {
|
|
492
|
+
var _strParsed = parseString(commonStrs[i]);
|
|
332
493
|
|
|
333
|
-
|
|
334
|
-
renderData.push(
|
|
335
|
-
dangerouslySetInnerHTML: {
|
|
336
|
-
__html: newCommonStrs[_i]
|
|
337
|
-
}
|
|
338
|
-
}));
|
|
339
|
-
renderData.push(openDatas[_i]);
|
|
494
|
+
renderData.push( /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, _strParsed));
|
|
495
|
+
renderData.push(openDatas[i]);
|
|
340
496
|
}
|
|
341
497
|
|
|
342
498
|
return renderData.filter(function (item) {
|
|
343
499
|
return item !== undefined;
|
|
344
|
-
}).map(function (item) {
|
|
345
|
-
if (typeof item === 'string') {
|
|
346
|
-
return item.replace(',', '');
|
|
347
|
-
} else {
|
|
348
|
-
return item;
|
|
349
|
-
}
|
|
350
|
-
}).filter(function (item) {
|
|
351
|
-
return item !== '';
|
|
352
500
|
});
|
|
353
501
|
};
|
|
354
502
|
|