@titaui/pc 1.11.3 → 1.11.4-10
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/avatar/text-avatar/index.css +7 -0
- package/lib/components/avatar/text-avatar/index.js +32 -7
- package/lib/components/button/icon-btn/index.js +17 -8
- package/lib/components/button/rect-btn/index.js +7 -7
- package/lib/components/change-okr-modal/Item.js +15 -15
- package/lib/components/communication/index.js +30 -29
- package/lib/components/drawer/index.js +7 -6
- package/lib/components/drop-selector/index.js +25 -10
- package/lib/components/dynamic/constant.js +43 -36
- package/lib/components/dynamic/dynamic-item/dynamic-ai-dialy/dynamic-footer.js +243 -0
- package/lib/components/dynamic/dynamic-item/dynamic-ai-dialy/index.js +6 -2
- package/lib/components/dynamic/dynamic-item/dynamic-interview/img/wifi.svg +24 -0
- package/lib/components/dynamic/dynamic-item/dynamic-interview/index.css +51 -0
- package/lib/components/dynamic/dynamic-item/dynamic-interview/index.js +50 -0
- package/lib/components/dynamic/dynamic-item/dynamic-interview/interview-content.js +65 -0
- package/lib/components/dynamic/dynamic-item/dynamic-interview-share/img/wifi.svg +24 -0
- package/lib/components/dynamic/dynamic-item/dynamic-interview-share/index.css +61 -0
- package/lib/components/dynamic/dynamic-item/dynamic-interview-share/index.js +61 -0
- package/lib/components/dynamic/dynamic-item/dynamic-interview-share/interview-content.js +69 -0
- package/lib/components/dynamic/dynamic-item/dynamic-kr/index.js +6 -6
- package/lib/components/dynamic/dynamic-item/dynamic-milestone/index.js +7 -7
- package/lib/components/dynamic/dynamic-item/dynamic-progress/index.js +11 -11
- package/lib/components/dynamic/dynamic-item/dynamic-reply/index.js +14 -14
- package/lib/components/dynamic/dynamic-item/dynamic-task/index.js +10 -10
- package/lib/components/dynamic/dynamic-item/index.js +70 -41
- package/lib/components/dynamic/dynamic-list/index.js +5 -13
- package/lib/components/e-priority/index.js +18 -12
- package/lib/components/eReport/eReportShare/index.js +11 -11
- package/lib/components/file-list/components/single-file/index.js +11 -11
- package/lib/components/form/form-fields/date/index.css +24 -0
- package/lib/components/form/form-fields/date/index.js +102 -0
- package/lib/components/form/form-fields/input/index.js +10 -10
- package/lib/components/form/form-fields/user/index.css +23 -3
- package/lib/components/form/form-fields/user/index.js +18 -8
- package/lib/components/form/form-fields/user/user-input.js +15 -6
- package/lib/components/form/index.js +10 -3
- package/lib/components/icon-button-list/index.css +2 -57
- package/lib/components/icon-button-list/index.js +10 -7
- package/lib/components/img-viewer/index.css +10 -3
- package/lib/components/img-viewer/index.js +57 -18
- package/lib/components/mblog/index.js +31 -30
- package/lib/components/menus/components/menu-tree/images/interview-menu/my-interview.svg +16 -0
- package/lib/components/menus/components/menu-tree/images/interview-menu/template.svg +16 -0
- package/lib/components/menus/components/menu-tree/images/interview-menu/todo.svg +16 -0
- package/lib/components/menus/components/menu-tree/index.css +4 -2
- package/lib/components/menus/components/menu-tree/tree-node/index.css +85 -1
- package/lib/components/menus/export-modules/interview-menus/constant.js +30 -0
- package/lib/components/menus/export-modules/interview-menus/handle-highlight.js +63 -0
- package/lib/components/menus/export-modules/interview-menus/index.css +7 -0
- package/lib/components/menus/export-modules/interview-menus/index.js +128 -0
- package/lib/components/menus/index.js +11 -5
- package/lib/components/nav-top/components/menu/index.js +14 -14
- package/lib/components/nav-top/components/user-message/components/inform/inform-item.js +25 -19
- package/lib/components/nav-top/components/user-message/components/remind/remind-item.js +48 -10
- package/lib/components/nav-top/components/user-message/constant.js +1 -0
- package/lib/components/nav-top/components/user-message/hrMessage.js +22 -19
- package/lib/components/nav-top/components/user-message/index.js +23 -20
- package/lib/components/nav-top/request.apis.js +3 -1
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/e-priority-dropdown.js +7 -7
- package/lib/components/okr-detail/detail-header/actions.js +62 -66
- package/lib/components/okr-detail/detail-header/index.css +2 -2
- package/lib/components/okr-detail/detail-header/index.js +205 -194
- package/lib/components/okr-detail/index.js +21 -19
- package/lib/components/okr-flow/child-node/index.css +67 -21
- package/lib/components/okr-flow/child-node/work-node.js +61 -24
- package/lib/components/okr-flow/empty/index.css +8 -1
- package/lib/components/okr-flow/export-modal/index.js +42 -18
- package/lib/components/okr-flow/export-modules/okr-search-panel/index.css +3 -1
- package/lib/components/okr-flow/export-modules/okr-search-panel/index.js +30 -24
- package/lib/components/okr-flow/images/loading-light.gif +0 -0
- package/lib/components/okr-flow/okr-map/index.js +43 -22
- package/lib/components/okr-flow/request-apis.js +15 -8
- package/lib/components/okr-flow/root-node/index.css +2 -2
- package/lib/components/okr-flow/root-node/index.js +26 -25
- package/lib/components/okr-flow/utils/index.js +45 -29
- package/lib/components/okr-flow/utils/tree-handler.js +29 -18
- package/lib/components/okrcase-library/index.css +6 -4
- package/lib/components/okrcase-library/okrcases-components/submitOkr-dialog.js +36 -30
- package/lib/components/pagination/index.css +3 -3
- package/lib/components/pagination/select.css +58 -23
- package/lib/components/period-selector/index.css +9 -3
- package/lib/components/period-selector/index.js +14 -11
- package/lib/components/picker/components/panels/date-panel/date-body.js +118 -0
- package/lib/components/picker/components/panels/date-panel/date-head.js +87 -0
- package/lib/components/picker/components/panels/date-panel/index.css +14 -0
- package/lib/components/picker/components/panels/date-panel/index.js +49 -0
- package/lib/components/picker/components/panels/month-panel/index.css +27 -0
- package/lib/components/picker/components/panels/month-panel/index.js +63 -0
- package/lib/components/picker/components/panels/month-panel/month-body.js +89 -0
- package/lib/components/picker/components/panels/month-panel/month-head.js +47 -0
- package/lib/components/picker/components/panels/panel-body/index.js +53 -0
- package/lib/components/picker/components/panels/panel-head/index.js +48 -0
- package/lib/components/picker/components/panels/year-panel/index.css +23 -0
- package/lib/components/picker/components/panels/year-panel/index.js +65 -0
- package/lib/components/picker/components/panels/year-panel/year-body.js +92 -0
- package/lib/components/picker/components/panels/year-panel/year-head.js +35 -0
- package/lib/components/picker/components/picker-trigger/index.css +57 -0
- package/lib/components/picker/components/picker-trigger/index.js +94 -0
- package/lib/components/picker/context.js +15 -0
- package/lib/components/picker/index.css +121 -0
- package/lib/components/picker/index.js +13 -0
- package/lib/components/picker/picker-panels.js +182 -0
- package/lib/components/picker/picker.js +132 -0
- package/lib/components/picker/type.js +5 -0
- package/lib/components/picker/utils.js +28 -0
- package/lib/components/popup/index.js +4 -4
- package/lib/components/radio/index.css +9 -9
- package/lib/components/scroll-container/index.js +423 -0
- package/lib/components/scroll-container/style.css +35 -0
- package/lib/components/scrollbar/scroll-mask/index.js +1 -1
- package/lib/components/superset-charts/components/chart/index.js +1 -1
- package/lib/components/superset-charts/utils/axios.js +5 -13
- package/lib/components/survey-model/contact.js +93 -0
- package/lib/components/survey-model/index.css +141 -0
- package/lib/components/survey-model/index.js +265 -0
- package/lib/components/survey-model/instance.js +86 -0
- package/lib/components/survey-model/request-api.js +80 -0
- package/lib/components/task-tree/helper.js +61 -0
- package/lib/components/task-tree/images/P1.svg +15 -0
- package/lib/components/task-tree/images/P2.svg +15 -0
- package/lib/components/task-tree/images/P3.svg +15 -0
- package/lib/components/task-tree/images/P4.svg +15 -0
- package/lib/components/task-tree/images/P5.svg +15 -0
- package/lib/components/task-tree/images/arrow.svg +9 -0
- package/lib/components/task-tree/images/empty-131.png +0 -0
- package/lib/components/task-tree/images/followed.svg +33 -0
- package/lib/components/task-tree/images/nice.svg +108 -0
- package/lib/components/task-tree/images/struc12.png +0 -0
- package/lib/components/task-tree/images/struc2.png +0 -0
- package/lib/components/task-tree/images/xialat-s.svg +13 -0
- package/lib/components/task-tree/index.js +22 -0
- package/lib/components/task-tree/mock.js +944 -0
- package/lib/components/task-tree/precls.js +8 -0
- package/lib/components/task-tree/request-apis.js +88 -0
- package/lib/components/task-tree/task-item-node/constant.js +45 -0
- package/lib/components/task-tree/task-item-node/e-empty.js +29 -0
- package/lib/components/task-tree/task-item-node/e-project.js +212 -0
- package/lib/components/task-tree/task-item-node/e-status-dropdown.js +94 -0
- package/lib/components/task-tree/task-item-node/e-task.js +426 -0
- package/lib/components/task-tree/task-item-node/get-process-color.js +62 -0
- package/lib/components/task-tree/task-item-node/index.css +289 -0
- package/lib/components/task-tree/task-item-node/task-node-render.js +43 -0
- package/lib/components/task-tree/task-tree.css +16 -0
- package/lib/components/task-tree/task-tree.js +49 -0
- package/lib/components/time-picker/index.css +123 -0
- package/lib/components/time-picker/index.js +13 -0
- package/lib/components/time-picker/time-picker-selector.js +138 -0
- package/lib/components/time-picker/time-picker.js +324 -0
- package/lib/components/time-picker/timer-picker-input.js +94 -0
- package/lib/components/time-picker/utils.js +52 -0
- package/lib/components/user-selector/select-tree/tree-nodes/tree-person-node/index.css +1 -0
- package/lib/components/wechat-btn/index.css +14 -0
- package/lib/components/wechat-btn/index.js +338 -0
- package/lib/components-v1/radio/radio.js +3 -3
- package/lib/components-v1/radio/style/index.css +8 -8
- package/lib/index.js +101 -77
- package/lib/pages/aha2021/index.js +5 -1
- package/lib/pages/okr-map/export-modules/okr-map/header/index.css +7 -2
- package/lib/pages/okr-map/export-modules/okr-map/header/index.js +73 -34
- package/lib/pages/okr-map/export-modules/okr-map/okr-map.js +65 -42
- package/lib/pages/okr-map/export-modules/share-okr-page/header/index.css +26 -14
- package/lib/pages/okr-map/export-modules/share-okr-page/header/index.js +58 -13
- package/lib/pages/okr-map/export-modules/share-okr-page/share-okr-map.js +28 -20
- package/lib/pages/okr-map/number-select/index.css +12 -9
- package/lib/pages/okr-map/number-select/index.js +3 -3
- package/lib/utils/auth.js +65 -8
- package/lib/utils/bs-global.js +18 -6
- package/lib/utils/hooks.js +72 -0
- package/lib/utils/open-data.js +63 -43
- package/package.json +6 -2
- package/.eslintignore +0 -3
- package/.eslintrc.js +0 -223
- package/.husky/pre-commit +0 -4
- package/.prettierignore +0 -31
- package/.prettierrc.js +0 -90
- package/.vscode/settings.json +0 -5
package/lib/utils/auth.js
CHANGED
|
@@ -5,7 +5,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.hasSuperior = exports.OAuth = exports.KRAuth = exports.EAuth = exports.DynamicManagerAuth = exports.ChildAuth = exports.BaseAuth = void 0;
|
|
8
|
+
exports.hasSuperior = exports.OAuth = exports.MyRole = exports.KRAuth = exports.EAuth = exports.DynamicManagerAuth = exports.ChildAuth = exports.BaseAuth = void 0;
|
|
9
9
|
|
|
10
10
|
var _bsGlobal = require("./bs-global");
|
|
11
11
|
|
|
@@ -33,7 +33,7 @@ var BaseAuth = /*#__PURE__*/function () {
|
|
|
33
33
|
function BaseAuth() {
|
|
34
34
|
_classCallCheck(this, BaseAuth);
|
|
35
35
|
|
|
36
|
-
this.loginUserInfor = (0, _bsGlobal.getBSGlobal)(
|
|
36
|
+
this.loginUserInfor = (0, _bsGlobal.getBSGlobal)('loginUserInfo');
|
|
37
37
|
} // 老板
|
|
38
38
|
|
|
39
39
|
|
|
@@ -123,7 +123,7 @@ var KRAuth = /*#__PURE__*/function (_BaseAuth2) {
|
|
|
123
123
|
_this2 = _super2.call(this, props);
|
|
124
124
|
var user = props.user,
|
|
125
125
|
createUserId = props.createUserId;
|
|
126
|
-
_this2.loginUserInfor = (0, _bsGlobal.getBSGlobal)(
|
|
126
|
+
_this2.loginUserInfor = (0, _bsGlobal.getBSGlobal)('loginUserInfo');
|
|
127
127
|
_this2.userId = _this2.loginUserInfor.Id;
|
|
128
128
|
_this2.user = user;
|
|
129
129
|
_this2.createUserId = createUserId;
|
|
@@ -211,7 +211,7 @@ var EAuth = /*#__PURE__*/function (_BaseAuth3) {
|
|
|
211
211
|
exports.EAuth = EAuth;
|
|
212
212
|
|
|
213
213
|
var hasSuperior = function hasSuperior() {
|
|
214
|
-
return !!(0, _bsGlobal.getBSGlobal)(
|
|
214
|
+
return !!(0, _bsGlobal.getBSGlobal)('loginUserInfo').ManagerId;
|
|
215
215
|
}; // 动态和项目文件管理权限
|
|
216
216
|
|
|
217
217
|
|
|
@@ -228,8 +228,8 @@ var DynamicManagerAuth = /*#__PURE__*/function (_BaseAuth4) {
|
|
|
228
228
|
_classCallCheck(this, DynamicManagerAuth);
|
|
229
229
|
|
|
230
230
|
_this4 = _super4.call(this, props);
|
|
231
|
-
_this4.isDynamicManager = (0, _bsGlobal.getBSGlobal)(
|
|
232
|
-
_this4.isLeader = (0, _bsGlobal.getBSGlobal)(
|
|
231
|
+
_this4.isDynamicManager = (0, _bsGlobal.getBSGlobal)('loginUserInfo').IsFeedAndFileManager;
|
|
232
|
+
_this4.isLeader = (0, _bsGlobal.getBSGlobal)('loginUserInfo').IsLeader;
|
|
233
233
|
return _this4;
|
|
234
234
|
}
|
|
235
235
|
|
|
@@ -289,6 +289,63 @@ var ChildAuth = /*#__PURE__*/function (_BaseAuth5) {
|
|
|
289
289
|
}]);
|
|
290
290
|
|
|
291
291
|
return ChildAuth;
|
|
292
|
-
}(BaseAuth);
|
|
292
|
+
}(BaseAuth); // 上面的权限我没动,但我这个应该是全的
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
exports.ChildAuth = ChildAuth;
|
|
296
|
+
|
|
297
|
+
var MyRole = /*#__PURE__*/function () {
|
|
298
|
+
function MyRole() {
|
|
299
|
+
_classCallCheck(this, MyRole);
|
|
300
|
+
|
|
301
|
+
this.loginUserInfo = (0, _bsGlobal.getBSGlobal)('loginUserInfo');
|
|
302
|
+
this.role_label = {
|
|
303
|
+
1: 'assistant',
|
|
304
|
+
// 助理或者说动态管理员
|
|
305
|
+
2: 'supreManager',
|
|
306
|
+
// 超管
|
|
307
|
+
3: 'manage',
|
|
308
|
+
// 普通管理员,比如okr管理员,项目管理员,这时候就要去判断别的字段
|
|
309
|
+
4: 'adminManager' // 后台管理员
|
|
310
|
+
|
|
311
|
+
};
|
|
312
|
+
this.isLeader = this.loginUserInfo.IsLeader;
|
|
313
|
+
this.isBoss = this.loginUserInfo.IsBoss;
|
|
314
|
+
this.isSuperManager = this.loginUserInfo.Role === 2; // 超管
|
|
315
|
+
|
|
316
|
+
this.isAssistant = this.loginUserInfo.Role === 1; // 助理或者说动态管理员
|
|
317
|
+
|
|
318
|
+
this.isOkrManager = this.loginUserInfo.IsOkrManager; // 目标管理员
|
|
319
|
+
|
|
320
|
+
this.isWorkManager = this.loginUserInfo.IsWorkManager; // 项目管理员
|
|
321
|
+
|
|
322
|
+
this.isAdminManager = this.loginUserInfo.Role === 4; // 后台管理员
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
_createClass(MyRole, [{
|
|
326
|
+
key: "getRole",
|
|
327
|
+
value: function getRole() {
|
|
328
|
+
if (this.isBoss) {
|
|
329
|
+
return '老板';
|
|
330
|
+
} else if (this.isSuperManager) {
|
|
331
|
+
return '超管';
|
|
332
|
+
} else if (this.isAssistant) {
|
|
333
|
+
return '助理';
|
|
334
|
+
} else if (this.isOkrManager) {
|
|
335
|
+
return '目标管理员';
|
|
336
|
+
} else if (this.isWorkManager) {
|
|
337
|
+
return '项目管理员';
|
|
338
|
+
} else if (this.isAdminManager) {
|
|
339
|
+
return '后台管理员';
|
|
340
|
+
} else if (this.isLeader) {
|
|
341
|
+
return '部门领导';
|
|
342
|
+
} else {
|
|
343
|
+
return '员工';
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
}]);
|
|
347
|
+
|
|
348
|
+
return MyRole;
|
|
349
|
+
}();
|
|
293
350
|
|
|
294
|
-
exports.
|
|
351
|
+
exports.MyRole = MyRole;
|
package/lib/utils/bs-global.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.hasWebHead = exports.getVersion = exports.getUserInfo = exports.getUploadMaxSize = exports.getTenantInfo = exports.getSource = exports.getOkrAdvancedSetting = exports.getBSGlobal = exports.getAppHead = exports.formatNum = exports["default"] = void 0;
|
|
6
|
+
exports.hasWebHead = exports.getVersion = exports.getUserInfo = exports.getUploadMaxSize = exports.getTenantInfo = exports.getSource = exports.getOkrAdvancedSetting = exports.getBSGlobal = exports.getAppHead = exports.formatNum = exports["default"] = exports.VERSION_MAP = void 0;
|
|
7
7
|
exports.isWx = isWx;
|
|
8
8
|
|
|
9
9
|
var getUserInfo = function getUserInfo() {
|
|
@@ -38,14 +38,14 @@ var getVersion = function getVersion() {
|
|
|
38
38
|
exports.getVersion = getVersion;
|
|
39
39
|
|
|
40
40
|
var getSource = function getSource() {
|
|
41
|
-
var info = getBSGlobal(
|
|
41
|
+
var info = getBSGlobal('tenantInfo');
|
|
42
42
|
return info.Source;
|
|
43
43
|
};
|
|
44
44
|
|
|
45
45
|
exports.getSource = getSource;
|
|
46
46
|
|
|
47
47
|
var getUploadMaxSize = function getUploadMaxSize() {
|
|
48
|
-
var info = getBSGlobal(
|
|
48
|
+
var info = getBSGlobal('tenantInfo');
|
|
49
49
|
if (info.Id === 352728) return 150;
|
|
50
50
|
var isDingDing = info.Source === 861;
|
|
51
51
|
var isDingZhi = window.dingZhiSize && window.dingZhiSize.indexOf(info.Id) !== -1;
|
|
@@ -65,8 +65,8 @@ function isWx() {
|
|
|
65
65
|
|
|
66
66
|
|
|
67
67
|
var getAppHead = function getAppHead(appId) {
|
|
68
|
-
var appHead = getBSGlobal(
|
|
69
|
-
var apps = getBSGlobal(
|
|
68
|
+
var appHead = getBSGlobal('WebHead');
|
|
69
|
+
var apps = getBSGlobal('apps');
|
|
70
70
|
if (!appHead && apps) return undefined;
|
|
71
71
|
var app = appHead && appHead.AppHead || apps && apps || [];
|
|
72
72
|
var appItem = app.find(function (item) {
|
|
@@ -105,9 +105,21 @@ var hasWebHead = function hasWebHead(webHeadName) {
|
|
|
105
105
|
return webHead.findIndex(function (a) {
|
|
106
106
|
return a.AppId === webHeadMap[webHeadName];
|
|
107
107
|
}) !== -1;
|
|
108
|
-
};
|
|
108
|
+
}; // 版本判断
|
|
109
|
+
|
|
109
110
|
|
|
110
111
|
exports.hasWebHead = hasWebHead;
|
|
112
|
+
var VERSION_MAP = {
|
|
113
|
+
1: '试用版',
|
|
114
|
+
2: '标准版',
|
|
115
|
+
3: '个人版',
|
|
116
|
+
6: '旗舰版',
|
|
117
|
+
8: '考核版',
|
|
118
|
+
9: '专业版',
|
|
119
|
+
10: 'OKR版',
|
|
120
|
+
100: 'OKR模板购买'
|
|
121
|
+
};
|
|
122
|
+
exports.VERSION_MAP = VERSION_MAP;
|
|
111
123
|
var _default = {
|
|
112
124
|
hasWebHead: hasWebHead
|
|
113
125
|
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = useQuery;
|
|
7
|
+
exports.parseUrl = parseUrl;
|
|
8
|
+
|
|
9
|
+
var _react = require("react");
|
|
10
|
+
|
|
11
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
12
|
+
|
|
13
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
14
|
+
|
|
15
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
16
|
+
|
|
17
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
18
|
+
|
|
19
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
20
|
+
|
|
21
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
22
|
+
|
|
23
|
+
function parseUrl(fragmentStr) {
|
|
24
|
+
var queryObject = {};
|
|
25
|
+
if (!fragmentStr) return queryObject;
|
|
26
|
+
var markIndex = fragmentStr.indexOf("?"); // contain query string in fragments
|
|
27
|
+
|
|
28
|
+
if (markIndex > -1) {
|
|
29
|
+
// build query object
|
|
30
|
+
var queryString = fragmentStr.slice(markIndex + 1);
|
|
31
|
+
var queryArray = queryString.split("&");
|
|
32
|
+
|
|
33
|
+
for (var i = 0; i < queryArray.length; i += 1) {
|
|
34
|
+
var queryPair = queryArray[i].split("=");
|
|
35
|
+
queryObject[queryPair[0]] = decodeURIComponent(queryPair[1]);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return queryObject;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function useQuery(name) {
|
|
43
|
+
var initValue = name ? parseUrl(decodeURIComponent(window.location.hash))[name] : parseUrl(decodeURIComponent(window.location.hash));
|
|
44
|
+
|
|
45
|
+
var _useState = (0, _react.useState)(initValue),
|
|
46
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
47
|
+
state = _useState2[0],
|
|
48
|
+
setState = _useState2[1];
|
|
49
|
+
|
|
50
|
+
var stateRef = (0, _react.useRef)();
|
|
51
|
+
stateRef.current = {
|
|
52
|
+
state: state,
|
|
53
|
+
setState: setState
|
|
54
|
+
};
|
|
55
|
+
var hashChangeHandler = (0, _react.useCallback)(function () {
|
|
56
|
+
var _stateRef$current = stateRef.current,
|
|
57
|
+
state = _stateRef$current.state,
|
|
58
|
+
setState = _stateRef$current.setState;
|
|
59
|
+
var value = name ? parseUrl(decodeURIComponent(window.location.hash))[name] : parseUrl(decodeURIComponent(window.location.hash));
|
|
60
|
+
|
|
61
|
+
if (value !== state) {
|
|
62
|
+
setState(value);
|
|
63
|
+
}
|
|
64
|
+
}, []);
|
|
65
|
+
(0, _react.useEffect)(function () {
|
|
66
|
+
window.addEventListener("hashchange", hashChangeHandler);
|
|
67
|
+
return function () {
|
|
68
|
+
window.removeEventListener("hashchange", hashChangeHandler);
|
|
69
|
+
};
|
|
70
|
+
}, []);
|
|
71
|
+
return state;
|
|
72
|
+
}
|
package/lib/utils/open-data.js
CHANGED
|
@@ -22,12 +22,12 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
22
22
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
23
23
|
|
|
24
24
|
var WX_SOURCE = 860;
|
|
25
|
-
var WX_UA_STR =
|
|
25
|
+
var WX_UA_STR = 'micromessenger';
|
|
26
26
|
var FEISHU_SOURCE = 862;
|
|
27
27
|
var DINGTALK_SOURCE = 861;
|
|
28
28
|
|
|
29
29
|
var getSource = function getSource() {
|
|
30
|
-
return (0, _bsGlobal.getBSGlobal)(
|
|
30
|
+
return (0, _bsGlobal.getBSGlobal)('tenantInfo').Source;
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
exports.getSource = getSource;
|
|
@@ -51,10 +51,10 @@ var getUA = function getUA() {
|
|
|
51
51
|
var getOpenId = function getOpenId(id, type) {
|
|
52
52
|
var openIds;
|
|
53
53
|
|
|
54
|
-
if (type ==
|
|
55
|
-
openIds = (0, _bsGlobal.getBSGlobal)(
|
|
56
|
-
} else if (type ==
|
|
57
|
-
openIds = (0, _bsGlobal.getBSGlobal)(
|
|
54
|
+
if (type == 'userName') {
|
|
55
|
+
openIds = (0, _bsGlobal.getBSGlobal)('openIds');
|
|
56
|
+
} else if (type == 'departmentName') {
|
|
57
|
+
openIds = (0, _bsGlobal.getBSGlobal)('openDepartmentIds');
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
return openIds && openIds[id];
|
|
@@ -79,11 +79,11 @@ function openData(p) {
|
|
|
79
79
|
});
|
|
80
80
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
81
81
|
style: {
|
|
82
|
-
display:
|
|
83
|
-
position:
|
|
84
|
-
overflow:
|
|
85
|
-
textOverflow:
|
|
86
|
-
verticalAlign:
|
|
82
|
+
display: 'inline-block',
|
|
83
|
+
position: 'relative',
|
|
84
|
+
overflow: 'hidden',
|
|
85
|
+
textOverflow: 'ellipsis',
|
|
86
|
+
verticalAlign: 'middle'
|
|
87
87
|
}
|
|
88
88
|
}, /*#__PURE__*/_react["default"].createElement("ww-open-data", {
|
|
89
89
|
ref: ref,
|
|
@@ -91,7 +91,7 @@ function openData(p) {
|
|
|
91
91
|
openid: openId
|
|
92
92
|
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
93
93
|
style: {
|
|
94
|
-
position:
|
|
94
|
+
position: 'absolute',
|
|
95
95
|
top: 0,
|
|
96
96
|
left: 0,
|
|
97
97
|
right: 0,
|
|
@@ -111,7 +111,7 @@ var getOpenData = openData();
|
|
|
111
111
|
|
|
112
112
|
var OpenUserName = function OpenUserName(p) {
|
|
113
113
|
return getOpenData(_objectSpread(_objectSpread({}, p), {}, {
|
|
114
|
-
type:
|
|
114
|
+
type: 'userName'
|
|
115
115
|
}));
|
|
116
116
|
};
|
|
117
117
|
|
|
@@ -119,7 +119,7 @@ exports.OpenUserName = OpenUserName;
|
|
|
119
119
|
|
|
120
120
|
var OpenDepartmentName = function OpenDepartmentName(p) {
|
|
121
121
|
return getOpenData(_objectSpread(_objectSpread({}, p), {}, {
|
|
122
|
-
type:
|
|
122
|
+
type: 'departmentName'
|
|
123
123
|
}));
|
|
124
124
|
};
|
|
125
125
|
|
|
@@ -130,22 +130,22 @@ var openDataMap = {
|
|
|
130
130
|
}; // name:'wx'|'dd'|'feishu',type:'source'|'env'|'all' = 'all'
|
|
131
131
|
|
|
132
132
|
var isPlatform = function isPlatform(name) {
|
|
133
|
-
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] :
|
|
133
|
+
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'all';
|
|
134
134
|
|
|
135
135
|
switch (name) {
|
|
136
|
-
case
|
|
136
|
+
case 'wx':
|
|
137
137
|
{
|
|
138
|
-
if (type ==
|
|
139
|
-
if (type ==
|
|
138
|
+
if (type == 'source') return getSource() == WX_SOURCE;
|
|
139
|
+
if (type == 'env') return getUA().includes(WX_UA_STR);
|
|
140
140
|
return getSource() == WX_SOURCE || getUA().includes(WX_UA_STR);
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
-
case
|
|
143
|
+
case 'dd':
|
|
144
144
|
{
|
|
145
145
|
return getSource() == DINGTALK_SOURCE;
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
-
case
|
|
148
|
+
case 'feishu':
|
|
149
149
|
{
|
|
150
150
|
return getSource() == FEISHU_SOURCE;
|
|
151
151
|
}
|
|
@@ -164,7 +164,7 @@ var parseTag = function parseTag(str) {
|
|
|
164
164
|
// return <span dangerouslySetInnerHTML={{ '__html': str }} />;
|
|
165
165
|
|
|
166
166
|
while (matchStr != null) {
|
|
167
|
-
var OpenDataCompoent = matchStr[1] ==
|
|
167
|
+
var OpenDataCompoent = matchStr[1] == 'userId' ? OpenUserName : OpenDepartmentName;
|
|
168
168
|
|
|
169
169
|
if (!OpenDataCompoent) {
|
|
170
170
|
openDatas.push( /*#__PURE__*/_react["default"].createElement("span", {
|
|
@@ -178,7 +178,7 @@ var parseTag = function parseTag(str) {
|
|
|
178
178
|
} else {
|
|
179
179
|
openDatas.push( /*#__PURE__*/_react["default"].createElement("span", {
|
|
180
180
|
style: {
|
|
181
|
-
color:
|
|
181
|
+
color: '#1890ff',
|
|
182
182
|
margin: '0 4px'
|
|
183
183
|
},
|
|
184
184
|
onClick: function onClick(e) {
|
|
@@ -214,7 +214,7 @@ var parseString = function parseString(str) {
|
|
|
214
214
|
// @ts-ignore
|
|
215
215
|
var source = window.BSGlobal.tenantInfo.Source;
|
|
216
216
|
var ua = navigator.userAgent.toLowerCase();
|
|
217
|
-
if (source != 860 && ua.indexOf(
|
|
217
|
+
if (source != 860 && ua.indexOf('micromessenger') == -1) return /*#__PURE__*/_react["default"].createElement("span", {
|
|
218
218
|
dangerouslySetInnerHTML: {
|
|
219
219
|
__html: str
|
|
220
220
|
}
|
|
@@ -263,10 +263,13 @@ var parseHtmlAndTextTag = function parseHtmlAndTextTag(str) {
|
|
|
263
263
|
var openDatareg = /\[(\w+?)\:(\w+?)\]/g;
|
|
264
264
|
var openDataStrReg = /\[\w+?\:\w+?\]/;
|
|
265
265
|
var openDataMatchStr = openDatareg.exec(str);
|
|
266
|
+
var hasMatchStr = false;
|
|
267
|
+
var renderData = [];
|
|
266
268
|
|
|
267
|
-
while (matchStr != null
|
|
269
|
+
while (matchStr != null) {
|
|
268
270
|
if (matchStr) {
|
|
269
|
-
|
|
271
|
+
hasMatchStr = true;
|
|
272
|
+
var OpenDataCompoent = matchStr[1] == 'userId' ? OpenUserName : OpenDepartmentName;
|
|
270
273
|
|
|
271
274
|
if (!OpenDataCompoent) {
|
|
272
275
|
openDatas.push( /*#__PURE__*/_react["default"].createElement("span", {
|
|
@@ -280,7 +283,7 @@ var parseHtmlAndTextTag = function parseHtmlAndTextTag(str) {
|
|
|
280
283
|
} else {
|
|
281
284
|
openDatas.push( /*#__PURE__*/_react["default"].createElement("span", {
|
|
282
285
|
style: {
|
|
283
|
-
color:
|
|
286
|
+
color: '#1890ff',
|
|
284
287
|
margin: '0 4px'
|
|
285
288
|
},
|
|
286
289
|
onClick: function onClick(e) {
|
|
@@ -293,7 +296,24 @@ var parseHtmlAndTextTag = function parseHtmlAndTextTag(str) {
|
|
|
293
296
|
}
|
|
294
297
|
|
|
295
298
|
matchStr = reg.exec(str);
|
|
296
|
-
}
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
if (hasMatchStr) {
|
|
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) {
|
|
297
317
|
var _OpenDataCompoent = openDataMap[openDataMatchStr[2]];
|
|
298
318
|
|
|
299
319
|
if (!_OpenDataCompoent) {
|
|
@@ -304,32 +324,32 @@ var parseHtmlAndTextTag = function parseHtmlAndTextTag(str) {
|
|
|
304
324
|
})));
|
|
305
325
|
}
|
|
306
326
|
|
|
307
|
-
openDataMatchStr =
|
|
327
|
+
openDataMatchStr = openDatareg.exec(str);
|
|
308
328
|
}
|
|
309
329
|
}
|
|
310
330
|
|
|
311
|
-
var
|
|
312
|
-
var tempStrs = [];
|
|
313
|
-
commonStrs && commonStrs.forEach(function (item) {
|
|
314
|
-
tempStrs.push(item.split(openDataStrReg).filter(function (item) {
|
|
315
|
-
return item !== '';
|
|
316
|
-
}));
|
|
317
|
-
});
|
|
318
|
-
var renderData = [];
|
|
331
|
+
var newCommonStrs = str.split(openDataStrReg);
|
|
319
332
|
|
|
320
|
-
for (var
|
|
333
|
+
for (var _i = 0; _i < newCommonStrs.length; _i++) {
|
|
321
334
|
renderData.push( /*#__PURE__*/_react["default"].createElement("span", {
|
|
322
|
-
style: {
|
|
323
|
-
verticalAlign: 'middle'
|
|
324
|
-
},
|
|
325
335
|
dangerouslySetInnerHTML: {
|
|
326
|
-
__html:
|
|
336
|
+
__html: newCommonStrs[_i]
|
|
327
337
|
}
|
|
328
338
|
}));
|
|
329
|
-
renderData.push(openDatas[
|
|
339
|
+
renderData.push(openDatas[_i]);
|
|
330
340
|
}
|
|
331
341
|
|
|
332
|
-
return renderData
|
|
342
|
+
return renderData.filter(function (item) {
|
|
343
|
+
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
|
+
});
|
|
333
353
|
};
|
|
334
354
|
|
|
335
355
|
exports.parseHtmlAndTextTag = parseHtmlAndTextTag;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@titaui/pc",
|
|
3
|
-
"version": "1.11.
|
|
3
|
+
"version": "1.11.4-10",
|
|
4
4
|
"nameCN": "",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -90,6 +90,7 @@
|
|
|
90
90
|
"color": "4.2.1",
|
|
91
91
|
"cos-js-sdk-v5": "1.3.3",
|
|
92
92
|
"dayjs": "1.10.4",
|
|
93
|
+
"easy-bem": "^1.1.1",
|
|
93
94
|
"html2canvas": "1.3.2",
|
|
94
95
|
"less": "4.1.2",
|
|
95
96
|
"less-loader": "6.0.0",
|
|
@@ -154,5 +155,8 @@
|
|
|
154
155
|
"pretty-quick --staged",
|
|
155
156
|
"eslint --fix"
|
|
156
157
|
]
|
|
157
|
-
}
|
|
158
|
+
},
|
|
159
|
+
"files": [
|
|
160
|
+
"lib/"
|
|
161
|
+
]
|
|
158
162
|
}
|
package/.eslintignore
DELETED