@titaui/pc 1.11.52-beta.3 → 1.11.52-beta.6
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-modal/Item.js +19 -18
- package/lib/components/change-okr-modal/styledComponents.js +9 -9
- 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 +25 -19
- package/lib/components/create-okr-modal/index.js +75 -35
- package/lib/components/create-okr-modal/kr-items/index.css +12 -1
- package/lib/components/create-okr-modal/kr-items/krDatas.js +6 -5
- package/lib/components/create-okr-modal/kr-items/krItem.js +22 -12
- 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/advertise/components/next-btn/index.css +27 -0
- package/lib/components/dynamic/advertise/components/next-btn/index.js +32 -0
- package/lib/components/dynamic/advertise/components/pre-btn/index.css +26 -0
- package/lib/components/dynamic/advertise/components/pre-btn/index.js +32 -0
- package/lib/components/dynamic/advertise/index.css +21 -0
- package/lib/components/dynamic/advertise/index.js +126 -0
- package/lib/components/dynamic/advertise/interface.js +5 -0
- package/lib/components/dynamic/advertise/util.js +28 -0
- package/lib/components/dynamic/components/dynamic-search-input/index.css +81 -0
- package/lib/components/dynamic/components/dynamic-search-input/index.js +203 -0
- package/lib/components/dynamic/components/first-level-tabs/index.css +101 -0
- package/lib/components/dynamic/components/first-level-tabs/index.js +131 -0
- package/lib/components/dynamic/dynamic-item/components/feed-operate/index.js +8 -8
- package/lib/components/dynamic/dynamic-item/dynamic-create-o/index.js +18 -18
- package/lib/components/dynamic/dynamic-like-ranking/image/like-ranking.svg +23 -0
- 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 +146 -0
- package/lib/components/dynamic/dynamic-like-ranking/index.js +180 -0
- package/lib/components/dynamic/dynamic-like-ranking/item.js +105 -0
- package/lib/components/dynamic/dynamic-like-ranking/mock.js +84 -0
- package/lib/components/dynamic/dynamic-liking/image/like-dynamic.svg +30 -0
- package/lib/components/dynamic/dynamic-liking/index.css +81 -0
- package/lib/components/{contact-kefu → dynamic/dynamic-liking}/index.js +35 -58
- package/lib/components/dynamic/dynamic-liking/item.js +75 -0
- package/lib/components/dynamic/dynamic-liking/mock.js +83 -0
- package/lib/components/dynamic/dynamic-list/index.js +7 -14
- package/lib/components/dynamic/dynamic-topping/image/quotation-mark.svg +16 -0
- package/lib/components/dynamic/dynamic-topping/image/top-icon.svg +30 -0
- package/lib/components/dynamic/dynamic-topping/index.css +141 -0
- package/lib/components/dynamic/dynamic-topping/index.js +82 -0
- package/lib/components/dynamic/dynamic-topping/interface.js +5 -0
- package/lib/components/dynamic/dynamic-topping/item.js +153 -0
- package/lib/components/dynamic/dynamic-topping/request-api.js +36 -0
- package/lib/components/dynamic/dynamic.css +173 -0
- package/lib/components/dynamic/dynamic.js +428 -0
- package/lib/components/dynamic/export-module/index.js +37 -0
- package/lib/components/dynamic/img/dynamic-top.svg +14 -0
- package/lib/components/dynamic/index.js +12 -9
- 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 +184 -0
- package/lib/components/dynamic/my-team/index.js +263 -0
- package/lib/components/dynamic/my-team/request-api.js +52 -0
- package/lib/components/dynamic/my-team/util.js +20 -0
- package/lib/components/dynamic/new-ui.css +192 -0
- package/lib/components/dynamic/online-broadcast/components/broadcast-item/index.css +58 -0
- package/lib/components/dynamic/online-broadcast/components/broadcast-item/index.js +68 -0
- package/lib/components/dynamic/online-broadcast/data.js +95 -0
- package/lib/components/dynamic/online-broadcast/img/broadcast.svg +14 -0
- 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 +46 -0
- package/lib/components/dynamic/online-broadcast/index.js +61 -0
- package/lib/components/dynamic/online-broadcast/interfact.js +5 -0
- package/lib/components/dynamic/quick-operation/components/create-announcement/index.css +25 -0
- package/lib/components/dynamic/quick-operation/components/create-announcement/index.js +39 -0
- package/lib/components/dynamic/quick-operation/components/create-okr/index.css +25 -0
- package/lib/components/dynamic/quick-operation/components/create-okr/index.js +39 -0
- package/lib/components/dynamic/quick-operation/components/create-share/index.css +25 -0
- package/lib/components/dynamic/quick-operation/components/create-share/index.js +39 -0
- package/lib/components/dynamic/quick-operation/components/create-task/index.css +25 -0
- package/lib/components/dynamic/quick-operation/components/create-task/index.js +44 -0
- 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 +51 -0
- package/lib/components/dynamic/quick-operation/index.js +120 -0
- package/lib/components/dynamic/request-api.js +68 -7
- 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/nav-top/components/menu/index.js +4 -3
- package/lib/components/nav-top/index.js +2 -2
- package/lib/components/okr-detail/components/base-okr-type/index.css +0 -4
- package/lib/components/okr-detail/components/base-okr-type/object-type.js +0 -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 +54 -4
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/index.js +106 -56
- 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/detail-header/delete-confirm/index.css +5 -9
- package/lib/components/okr-detail/detail-header/index.js +8 -4
- 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 +71 -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 +3 -1
- 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/publish-dynamic-modal/publish-dynamic-modal.js +10 -16
- package/lib/components/radio/index.css +3 -3
- 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-key-handle/index.js +9 -7
- package/lib/components/select/Option.js +3 -3
- package/lib/components/task-relation-modal/tree/okr-tree/index.css +1 -1
- package/lib/components/task-relation-modal/tree-node/category-node/index.css +11 -0
- package/lib/components/task-relation-modal/tree-node/category-node/index.js +3 -1
- package/lib/components/task-relation-modal/tree-node/kr-node/index.css +16 -0
- package/lib/components/task-relation-modal/tree-node/kr-node/index.js +10 -4
- package/lib/components/task-relation-modal/tree-node/milestone-node/index.css +16 -0
- package/lib/components/task-relation-modal/tree-node/milestone-node/index.js +4 -0
- package/lib/components/task-relation-modal/tree-node/o-node/index.js +8 -8
- package/lib/components/textarea/index.js +35 -38
- package/lib/components/tita-chart/errorBoundary/index.js +3 -3
- package/lib/components/wechat-btn/index.css +4 -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/index.js +0 -8
- package/lib/{components/contact-kefu → pages/aha2021}/img/canceled.svg +0 -0
- package/lib/{components/contact-kefu → pages/aha2021}/img/kefu.svg +0 -0
- package/lib/{components/contact-kefu → pages/aha2021}/img/not-try.png +0 -0
- package/lib/{components/contact-kefu → pages/aha2021}/img/try.png +0 -0
- package/lib/pages/aha2021/index.css +26 -1
- package/lib/pages/aha2021/index.js +82 -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/pages/new-okr-list/header/index.css +1 -1
- package/lib/utils/open-data.js +213 -65
- package/package.json +3 -2
- package/lib/components/contact-kefu/img/notice.png +0 -0
- package/lib/components/contact-kefu/index.css +0 -85
|
@@ -7,6 +7,8 @@ exports["default"] = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
|
+
var _openData = require("../../../../../../utils/open-data");
|
|
11
|
+
|
|
10
12
|
require("./index.css");
|
|
11
13
|
|
|
12
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -25,11 +27,11 @@ function OkrNameColumn(_ref) {
|
|
|
25
27
|
className: "".concat(preCls, "__tagO")
|
|
26
28
|
}, "O"), /*#__PURE__*/_react["default"].createElement("span", {
|
|
27
29
|
className: "".concat(preCls, "__contentO")
|
|
28
|
-
}, children)), type === "KR" && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
30
|
+
}, (0, _openData.parseString)(children))), type === "KR" && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
29
31
|
className: "".concat(preCls, "__tagKR")
|
|
30
32
|
}, "KR"), /*#__PURE__*/_react["default"].createElement("span", {
|
|
31
33
|
className: "".concat(preCls, "__contentKR")
|
|
32
|
-
}, children)));
|
|
34
|
+
}, (0, _openData.parseString)(children))));
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
var _default = OkrNameColumn;
|
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
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@titaui/pc",
|
|
3
|
-
"version": "1.11.52-beta.
|
|
3
|
+
"version": "1.11.52-beta.6",
|
|
4
4
|
"nameCN": "",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"@storybook/addon-knobs": "6.0.10",
|
|
35
35
|
"@storybook/addon-links": "6.0.10",
|
|
36
36
|
"@storybook/react": "6.0.10",
|
|
37
|
+
"@titaui/rich-editor": "^0.1.29",
|
|
37
38
|
"@types/prosemirror-state": "1.2.8",
|
|
38
39
|
"@types/styled-components": "5.1.2",
|
|
39
40
|
"@typescript-eslint/eslint-plugin": "5.10.0",
|
|
@@ -144,7 +145,7 @@
|
|
|
144
145
|
"react-transition-group": "4.4.2",
|
|
145
146
|
"resize-observer-polyfill": "1.5.1",
|
|
146
147
|
"slick-carousel": "1.8.1",
|
|
147
|
-
"tita-ui": "1.2.
|
|
148
|
+
"tita-ui": "1.2.52",
|
|
148
149
|
"url-parse": "1.5.1",
|
|
149
150
|
"uuid": "3.1.0",
|
|
150
151
|
"viewerjs": "1.10.1",
|
|
Binary file
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
.contact-kefu {
|
|
2
|
-
position: relative;
|
|
3
|
-
height: 100vh;
|
|
4
|
-
background: #f0f4fa;
|
|
5
|
-
overflow: hidden;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.contact-kefu__kefu {
|
|
9
|
-
position: absolute;
|
|
10
|
-
bottom: 74px;
|
|
11
|
-
right: 24px;
|
|
12
|
-
z-index: 2;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.contact-kefu__try-kefu {
|
|
16
|
-
position: absolute;
|
|
17
|
-
bottom: 134px;
|
|
18
|
-
right: 24px;
|
|
19
|
-
z-index: 2;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.contact-kefu__kefu {
|
|
23
|
-
width: 42px;
|
|
24
|
-
height: 42px;
|
|
25
|
-
background: url("./img/kefu.svg") no-repeat;
|
|
26
|
-
background-color: #fff;
|
|
27
|
-
background-size: 42px;
|
|
28
|
-
box-shadow: 0px 4px 12px 0px rgba(127, 145, 180, 0.2);
|
|
29
|
-
cursor: pointer;
|
|
30
|
-
border-radius: 50%;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.contact-kefu__hidden {
|
|
34
|
-
background-image: none;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.contact-kefu__cancel {
|
|
38
|
-
height: 100%;
|
|
39
|
-
background: url("./img/canceled.svg") 50% 50% no-repeat;
|
|
40
|
-
animation-duration: 0.3s;
|
|
41
|
-
animation-name: kefuActive;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.contact-kefu__popup {
|
|
45
|
-
width: 332px;
|
|
46
|
-
height: 376px;
|
|
47
|
-
display: flex;
|
|
48
|
-
flex-direction: column;
|
|
49
|
-
justify-content: center;
|
|
50
|
-
align-items: center;
|
|
51
|
-
background: #ffffff;
|
|
52
|
-
box-shadow: 0px 8px 24px 0px rgba(127, 145, 180, 0.16);
|
|
53
|
-
border-radius: 24px;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.contact-kefu__popup-title {
|
|
57
|
-
font-size: 20px;
|
|
58
|
-
font-weight: 600;
|
|
59
|
-
color: #141c28;
|
|
60
|
-
line-height: 30px;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.contact-kefu__popup-content {
|
|
64
|
-
margin-top: 4px;
|
|
65
|
-
font-size: 14px;
|
|
66
|
-
font-weight: normal;
|
|
67
|
-
color: #6f7886;
|
|
68
|
-
line-height: 22px;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.contact-kefu__popup-img {
|
|
72
|
-
width: 200px;
|
|
73
|
-
height: 200px;
|
|
74
|
-
margin-top: 24px;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
@keyframes contentOpacity {
|
|
78
|
-
from {
|
|
79
|
-
opacity: 0;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
to {
|
|
83
|
-
opacity: 1;
|
|
84
|
-
}
|
|
85
|
-
}
|