@titaui/pc 1.9.87 → 1.9.88

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.
Files changed (121) hide show
  1. package/lib/components/change-okr-modal/Filter.js +1 -1
  2. package/lib/components/change-okr-modal/Item.js +91 -121
  3. package/lib/components/change-okr-modal/filterTab.js +1 -1
  4. package/lib/components/change-okr-modal/index.js +1 -1
  5. package/lib/components/communication/CommunicationAttachments.js +1 -1
  6. package/lib/components/communication/ConvertUserName.js +1 -1
  7. package/lib/components/communication/index.js +1 -1
  8. package/lib/components/create-okr-modal/objectType.js +1 -1
  9. package/lib/components/date-picker/BodyItem.js +1 -1
  10. package/lib/components/date-picker/CalendarBody.js +1 -1
  11. package/lib/components/date-picker/CalendarHeader.js +1 -1
  12. package/lib/components/date-picker/index.js +1 -1
  13. package/lib/components/date-range-picker/index.js +1 -1
  14. package/lib/components/delete-confirm-pop/ConfirmPop.js +1 -1
  15. package/lib/components/eReport/eReportListEmpty.js +1 -1
  16. package/lib/components/eReport/eReportLists/reportList.js +1 -1
  17. package/lib/components/eReport/eReportShare/index.js +1 -1
  18. package/lib/components/eReport/eReportShare/toast/index.js +1 -1
  19. package/lib/components/edit-kr-wight/EditKrWightModal.js +1 -1
  20. package/lib/components/edit-kr-wight/FormItemV2.js +1 -1
  21. package/lib/components/emotions-selector/selector-content.js +1 -1
  22. package/lib/components/emotions-selector/selector-pop.js +1 -1
  23. package/lib/components/ereport-list/index.js +1 -1
  24. package/lib/components/error-boundary/index.js +1 -1
  25. package/lib/components/mblog/components/ConfirmPop.js +1 -1
  26. package/lib/components/mblog/components/MblogAction.js +1 -1
  27. package/lib/components/mblog/components/MblogContent.js +1 -1
  28. package/lib/components/mblog/index.js +1 -1
  29. package/lib/components/menus/export-modules/demo-menus/index.js +117 -0
  30. package/lib/components/menus/export-modules/demo-menus/menu-highlight.js +74 -0
  31. package/lib/components/menus/export-modules/demo-menus/menus.js +154 -0
  32. package/lib/components/menus/index.js +6 -0
  33. package/lib/components/nav-top/constant.js +26 -2
  34. package/lib/components/nav-top/utils.js +10 -1
  35. package/lib/components/okr-detail/auth.js +1 -1
  36. package/lib/components/okr-detail/components/base-okr-type/confirm/buttonv2.js +1 -1
  37. package/lib/components/okr-detail/components/base-okr-type/confirm/confirm.js +1 -1
  38. package/lib/components/okr-detail/components/base-okr-type/object-type.js +1 -1
  39. package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/kr-score-editor/edit-pop.js +1 -1
  40. package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/kr-score-editor/kr-push-score.js +1 -1
  41. package/lib/components/okr-flow/export-modal/index.js +1 -1
  42. package/lib/components/okr-period-selector/select-cycle.js +0 -7
  43. package/lib/components/okr-review/ReviewPop/components/ReviewBody/index.js +1 -1
  44. package/lib/components/okr-review/ReviewPop/components/Toast/index.js +1 -1
  45. package/lib/components/okr-review/ReviewPop/index.js +1 -1
  46. package/lib/components/okr-review/components/ReviewItem/index.js +1 -1
  47. package/lib/components/okr-review/components/confirm-pop/ConfirmPop.js +1 -1
  48. package/lib/components/okr-review/index.js +1 -1
  49. package/lib/components/operation-records/OperationRecordItem.js +1 -1
  50. package/lib/components/operation-records/index.js +1 -1
  51. package/lib/components/point-demo/input/index.js +1 -1
  52. package/lib/components/praise-record/PraiseRecordItem.js +1 -1
  53. package/lib/components/praise-record/index.js +1 -1
  54. package/lib/components/range-picker-pop/index.js +1 -1
  55. package/lib/components/range-selector-pop/RangeList.js +1 -1
  56. package/lib/components/range-selector-pop/RangeSelectorPop.js +1 -1
  57. package/lib/components/select/Option.js +1 -1
  58. package/lib/components/select/index.js +1 -1
  59. package/lib/components/tita-chart/errorBoundary/index.js +1 -1
  60. package/lib/components/upload/components/uploadedPreview.js +1 -1
  61. package/lib/components/upload/index.js +1 -1
  62. package/lib/components/viewer/ImageListRender.js +1 -1
  63. package/lib/components/viewer/index.js +1 -1
  64. package/lib/components-v1/animate/AnimateChild.js +1 -1
  65. package/lib/components-v1/animate/animate.js +1 -1
  66. package/lib/components-v1/avatar/index.js +1 -1
  67. package/lib/components-v1/buttonv2/ButtonOutlined.js +1 -1
  68. package/lib/components-v1/buttonv2/ButtonRounded.js +1 -1
  69. package/lib/components-v1/buttonv2/DefaultButton.js +1 -1
  70. package/lib/components-v1/confirm/index.js +1 -1
  71. package/lib/components-v1/dropDownSelector/StatelessDropdown.js +1 -1
  72. package/lib/components-v1/dropDownSelector/dropDownSelector.js +1 -1
  73. package/lib/components-v1/input/Input.js +1 -1
  74. package/lib/components-v1/input/InputNumber.js +1 -1
  75. package/lib/components-v1/placement/placement.js +1 -1
  76. package/lib/components-v1/placement/placementInner.js +1 -1
  77. package/lib/components-v1/pop/Pop.js +1 -1
  78. package/lib/components-v1/pop/PopInner.js +1 -1
  79. package/lib/components-v1/portals/Portals.js +1 -1
  80. package/lib/components-v1/progress/CircleProgress.js +1 -1
  81. package/lib/components-v1/progress/LineProgress.js +1 -1
  82. package/lib/components-v1/progress/index.js +1 -1
  83. package/lib/components-v1/radio/radio.js +1 -1
  84. package/lib/components-v1/radio/radioGroup.js +1 -1
  85. package/lib/components-v1/search/index.js +1 -1
  86. package/lib/components-v1/select/Option.js +1 -1
  87. package/lib/components-v1/select/index.js +1 -1
  88. package/lib/components-v1/tabs/index.js +1 -1
  89. package/lib/components-v1/textarea/index.js +1 -1
  90. package/lib/components-v1/transition/index.js +1 -1
  91. package/lib/components-v1/userSelector/UserSelectorPop.js +1 -1
  92. package/lib/components-v1/userSelector/components/MultiMode/CommonList.js +1 -1
  93. package/lib/components-v1/userSelector/components/MultiMode/DepartmentList.js +1 -1
  94. package/lib/components-v1/userSelector/components/MultiMode/DepartmentTree.js +1 -1
  95. package/lib/components-v1/userSelector/components/MultiMode/SubsList.js +1 -1
  96. package/lib/components-v1/userSelector/components/MultiMode/index.js +1 -1
  97. package/lib/components-v1/userSelector/components/SearchBar.js +1 -1
  98. package/lib/components-v1/userSelector/components/SingleMode.js +1 -1
  99. package/lib/components-v1/userSelector/components/UserItem.js +1 -1
  100. package/lib/components-v1/userSelector/index.js +1 -1
  101. package/lib/index.js +14 -6
  102. package/lib/pages/appointment-demo/input/index.js +1 -1
  103. package/lib/pages/demo-free/index.css +0 -0
  104. package/lib/pages/demo-free/index.js +31 -0
  105. package/lib/pages/group-management/components/input-form/index.js +1 -1
  106. package/lib/pages/new-okr-list/init-cycle-setting.js +2 -4
  107. package/lib/pages/new-okr-list/request-api.js +57 -32
  108. package/lib/utils/auth.js +1 -1
  109. package/package.json +2 -1
  110. package/src/components/menus/export-modules/demo-menus/index.tsx +80 -0
  111. package/src/components/menus/export-modules/demo-menus/menu-highlight.ts +53 -0
  112. package/src/components/menus/export-modules/demo-menus/menus.tsx +136 -0
  113. package/src/components/menus/index.tsx +9 -5
  114. package/src/components/nav-top/constant.ts +24 -0
  115. package/src/components/nav-top/index.tsx +10 -9
  116. package/src/components/nav-top/request.apis.ts +5 -5
  117. package/src/components/nav-top/utils.ts +15 -2
  118. package/src/index.d.ts +1 -0
  119. package/src/index.js +2 -1
  120. package/src/pages/demo-free/index.tsx +15 -0
  121. package/yarn-error.log +0 -103
@@ -4,19 +4,22 @@ import OkrMenus from "./export-modules/okr-menus";
4
4
  import AppraisalMenus from "./export-modules/appraisal-menus";
5
5
  import ManageMenus from "./export-modules/manage-menus";
6
6
  import "./index.scss";
7
+ import DemoMenus from "./export-modules/demo-menus";
7
8
 
8
9
  const preCls = "titaui-menus";
9
10
 
10
- export default function (props) {
11
+ const Menus = (props: any) => {
11
12
  const { type, ...restProps } = props;
12
13
 
13
14
  const renderMenuByType = () => {
14
- if (type == "okr") {
15
+ if (type === "okr") {
15
16
  return <OkrMenus {...restProps} />;
16
- } if (type == "appraisal") {
17
+ } if (type === "appraisal") {
17
18
  return <AppraisalMenus {...restProps} />;
18
- } if (type == "manage") {
19
+ } if (type === "manage") {
19
20
  return <ManageMenus {...restProps} />;
21
+ } if (type === "demofree") {
22
+ return <DemoMenus {...restProps} />;
20
23
  }
21
24
  return undefined;
22
25
  };
@@ -26,4 +29,5 @@ export default function (props) {
26
29
  {renderMenuByType()}
27
30
  </div>
28
31
  );
29
- }
32
+ };
33
+ export default Menus;
@@ -18,3 +18,27 @@ export const getVersionTextMap = () => ({
18
18
  [Versions.Professional]: getLocale("Sw_OKREdit"),
19
19
  [Versions.Flagship]: getLocale("Sw_Flagship"),
20
20
  });
21
+
22
+ export const DEMO_FREE_MENU_CONFIG = {
23
+ DataSource: null,
24
+ appCode: null,
25
+ appId: 119,
26
+ children: [],
27
+ code: "",
28
+ color: "#F28D49",
29
+ defaultExpand: false,
30
+ domain: "",
31
+ groupId: 0,
32
+ href: "#demofree/list?selected=assigned",
33
+ iconName: "",
34
+ id: 99998,
35
+ labelName: null,
36
+ menuPoint: null,
37
+ orderId: 2000,
38
+ originUrl: null,
39
+ signUrl: "",
40
+ status: 0,
41
+ tenantId: 0,
42
+ title: "demofree",
43
+ type: "hash",
44
+ };
@@ -25,12 +25,10 @@ const NavTop: FC = () => {
25
25
  const versionInfo = getBSGlobal("tenantAuthentication");
26
26
  const [activeMenuId, setActiveMenuId] = useState(-1);
27
27
  const ua = navigator.userAgent.toLowerCase();
28
- const showWxInvite = getTenantInfo().mainCorpId && ua.indexOf("micromessenger") != -1;
28
+ const showWxInvite = getTenantInfo().mainCorpId && ua.indexOf("micromessenger") !== -1;
29
29
  const openWxInvite = useCallback(() => {
30
- // @ts-ignore
31
- WeixinJSBridge
32
- // @ts-ignore
33
- && WeixinJSBridge.invoke(
30
+ if (window.WeixinJSBridge !== undefined) {
31
+ window.WeixinJSBridge.invoke(
34
32
  "selectPrivilegedContact",
35
33
  {
36
34
  fromDepartmentId: -1, // 必填,表示打开的通讯录从指定的部门开始展示,-1表示自己所在部门开始, 0表示从最上层开始
@@ -40,7 +38,7 @@ const NavTop: FC = () => {
40
38
  // "selectedTickets"["ticket1","ticket2"] // 非必填,已选ticket列表。single模式忽略该参数
41
39
  },
42
40
  (res) => {
43
- if (res.err_msg == "selectPrivilegedContact:ok") {
41
+ if (res.err_msg === "selectPrivilegedContact:ok") {
44
42
  // var selectedUserList = res.result.userList; // 已选的成员列表
45
43
  // for (var i = 0; i < selectedUserList.length; i++) {
46
44
  // var openUserId = selectedUserList[i].openUserId; //成员openUserId
@@ -52,7 +50,7 @@ const NavTop: FC = () => {
52
50
  .then(() => {
53
51
  Toast.Success("邀请成功");
54
52
  })
55
- .catch((e) => {
53
+ .catch(() => {
56
54
  Toast.Error("邀请失败");
57
55
  });
58
56
  } else {
@@ -60,10 +58,11 @@ const NavTop: FC = () => {
60
58
  }
61
59
  },
62
60
  );
61
+ }
63
62
  }, []);
64
63
 
65
64
  const handleHashChange = () => {
66
- const hash = location.hash.split("?")[0] || "";
65
+ const hash = window.location.hash.split("?")[0] || "";
67
66
  if (hash) {
68
67
  const activeMenu = menu.find((item) => hash.includes(item.href.split("#")?.[1]?.split("?")[0]));
69
68
  if (hash.includes("homepage")) {
@@ -94,6 +93,7 @@ const NavTop: FC = () => {
94
93
  href={hasOKRApp ? "#homepage" : ""}
95
94
  >
96
95
  <img
96
+ alt="logo"
97
97
  src={Logo}
98
98
  className={classNames(`${preCls}__left-logo`, {
99
99
  [`${preCls}__left-logo--hover`]: hasOKRApp,
@@ -102,11 +102,12 @@ const NavTop: FC = () => {
102
102
  {hasOKRApp && (
103
103
  <span
104
104
  className={classNames(`${preCls}__left-home`, {
105
- [`${preCls}__left-home--active`]: activeMenuId == 99999,
105
+ [`${preCls}__left-home--active`]: activeMenuId === 99999,
106
106
  [`${preCls}__left-home--hover`]: hasOKRApp,
107
107
  })}
108
108
  >
109
109
  <img
110
+ alt="home-img"
110
111
  src={Home}
111
112
  className={classNames(`${preCls}__left-home-img`)}
112
113
  />
@@ -2,13 +2,13 @@ import axios from "axios";
2
2
  import { rget, rdelete } from "../../utils/request";
3
3
 
4
4
  // @ts-ignore
5
- const tenantId = (BSGlobal && BSGlobal.tenantInfo.Id) || 0;
5
+ const tenantId = (window.BSGlobal && window.BSGlobal.tenantInfo.Id) || 0;
6
6
  // @ts-ignore
7
- const userId = (BSGlobal && BSGlobal.loginUserInfo.Id) || 0;
7
+ const userId = (window.BSGlobal && window.BSGlobal.loginUserInfo.Id) || 0;
8
8
 
9
9
  const requestDomain = () => {
10
10
  if (!window.location.hostname.match(/dev/)) return "";
11
- return `${location.protocol}//www.tita.gift`;
11
+ return `${window.location.protocol}//www.tita.gift`;
12
12
  };
13
13
 
14
14
  export const getTodos = (pageNum) => rget("v1")(
@@ -43,8 +43,8 @@ export const getMessages = () => {
43
43
  )
44
44
  .then((resp: any) => {
45
45
  if (resp.code === 401) {
46
- location.href = "/Account/Logout";
47
- return;
46
+ window.location.href = "/Account/Logout";
47
+ return undefined;
48
48
  }
49
49
  return resp.data;
50
50
  })
@@ -4,7 +4,7 @@ import defaultLogo from "./images/logo-white.png";
4
4
 
5
5
  export const getMenus = () => {
6
6
  // @ts-ignore
7
- const navs: INavType[] = BSGlobal.newNavigation;
7
+ const navs: INavType[] = window.BSGlobal.newNavigation;
8
8
  navs.sort((pre, next) => pre.orderId - next.orderId);
9
9
  return navs;
10
10
  };
@@ -12,5 +12,18 @@ export const getMenus = () => {
12
12
  export const getLogo = () => {
13
13
  // 232637ab8a674427a1d6489329035d86_n 是老logo的路径,没法判断是否用户自定义过,所以只能这么硬核
14
14
  const tenantInfo = getTenantInfo();
15
- return tenantInfo.isNewIndex && /232637ab8a674427a1d6489329035d86_n/g.test(tenantInfo.Logo) || !tenantInfo.Logo ? defaultLogo : tenantInfo.Logo;
15
+ return ((tenantInfo.isNewIndex && /232637ab8a674427a1d6489329035d86_n/g.test(tenantInfo.Logo)) || !tenantInfo.Logo) ? defaultLogo : tenantInfo.Logo;
16
+ };
17
+
18
+ export const transMetasToTableData = (dataSource = []) => {
19
+ const listData: any = [];
20
+ dataSource.forEach((dataItem: any) => {
21
+ const data = {};
22
+ dataItem.forEach((field) => {
23
+ const { name, value } = field;
24
+ data[name] = value;
25
+ });
26
+ listData.push(data);
27
+ });
28
+ return listData;
16
29
  };
package/src/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  interface Window {
2
2
  BSGlobal: any;
3
+ WeixinJSBridge?: any;
3
4
  Talent: any;
4
5
  trackAction?: (actionName?: string) => {};
5
6
  getLocale: Function;
package/src/index.js CHANGED
@@ -20,6 +20,7 @@ export { default as ChangeOkrModal } from "./components/change-okr-modal";
20
20
  export { default as CreateOkrModal } from "./components/create-okr-modal";
21
21
  export { default as RangePickerPop } from "./components/range-picker-pop";
22
22
  export { default as DatePicker } from "./components/date-picker";
23
+ export { default as DemoFree } from "./pages/demo-free";
23
24
  export { default as OkrMapPage } from "./pages/okr-map";
24
25
  export { default as OkrFlow } from "./components/okr-flow";
25
26
  export { default as DropSelector } from "./components/drop-selector";
@@ -87,4 +88,4 @@ export { default as requestApi } from "./utils/request";
87
88
  export { default as PointDemo } from "./components/point-demo";
88
89
  export { default as Scrollbar } from "./components/scrollbar";
89
90
  export { default as WeeklyReport } from "./components/weekly-report";
90
- export { default as UploadPhotoModal } from "./components/upload-photo-modal";
91
+ export { default as tasUploadPhotoModal } from "./components/upload-photo-modal";
@@ -0,0 +1,15 @@
1
+ import React, { FC } from "react";
2
+ import ErrorBoundary from "../../components/error-boundary";
3
+ import ERROR_LEVEL from "../../utils/error-level";
4
+
5
+ const prefix = "dynamic-page";
6
+
7
+ const DemoFree: FC = () => (
8
+ <ErrorBoundary errorLevel={ERROR_LEVEL.P0}>
9
+ <div className={prefix}>
10
+ <div />
11
+ </div>
12
+ </ErrorBoundary>
13
+ );
14
+
15
+ export default DemoFree;
package/yarn-error.log DELETED
@@ -1,103 +0,0 @@
1
- Arguments:
2
- /usr/local/bin/node /usr/local/bin/yarn
3
-
4
- PATH:
5
- /opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/opt/homebrew/bin:/opt/homebrew/sbin
6
-
7
- Yarn version:
8
- 1.22.10
9
-
10
- Node version:
11
- 12.22.1
12
-
13
- Platform:
14
- darwin x64
15
-
16
- Trace:
17
- SyntaxError: /Users/yang/tita/titaui-pc/package.json: Unexpected token < in JSON at position 26
18
- at JSON.parse (<anonymous>)
19
- at /usr/local/lib/node_modules/yarn/lib/cli.js:1625:59
20
- at Generator.next (<anonymous>)
21
- at step (/usr/local/lib/node_modules/yarn/lib/cli.js:310:30)
22
- at /usr/local/lib/node_modules/yarn/lib/cli.js:321:13
23
-
24
- npm manifest:
25
- {
26
- "name": "@titaui/pc",
27
- <<<<<<< HEAD
28
- "version": "1.2.22",
29
- =======
30
- "version": "1.2.13",
31
- >>>>>>> master
32
- "nameCN": "",
33
- "description": "",
34
- "main": "src/index.js",
35
- "scripts": {
36
- "storybook": "start-storybook -p 6006 --no-dll",
37
- "start": "dev_server=on webpack-dev-server --disableHostCheck=true --progress --colors --config webpack-stories.config.js",
38
- "build-storybook": "build-storybook --docs --no-dll",
39
- "build:es": "babel src -d es --ignore **/__tests__",
40
- "build:lib": "cross-env OUTPUT_MODULE=commonjs babel src -d lib --ignore **/__tests__",
41
- "build:umd": "webpack --config ./.scripts/webpack.umd.js",
42
- "build": "npm run build:lib && npm run build:es && npm run build:umd"
43
- },
44
- "author": "",
45
- "license": "ISC",
46
- "devDependencies": {
47
- "del": "^6.0.0",
48
- "gulp": "^3.x",
49
- "gulp-autoprefixer": "^7.0.1",
50
- "gulp-babel": "^8.0.0",
51
- "gulp-concat": "^2.6.1",
52
- "gulp-cssbeautify": "^3.0.0",
53
- "gulp-cssnano": "^2.1.3",
54
- "gulp-filesize": "0.0.6",
55
- "gulp-postcss": "^9.0.0",
56
- "gulp-rename": "^2.0.0",
57
- "gulp-replace": "^1.0.0",
58
- "gulp-sass": "^4.1.0",
59
- "gulp-sourcemaps": "^2.6.5",
60
- "sass-resources-loader": "^2.2.1"
61
- },
62
- "dependencies": {
63
- "@titaui/dagre": "^0.8.8-pre",
64
- "@titaui/rc-tree2": "^4.1.15",
65
- "@titaui/rc-trigger": "^5.2.5",
66
- "@titaui/react-flow-renderer": "9.5.4",
67
- "@titaui/toast": "^1.0.0",
68
- "axios": "^0.21.1",
69
- "classnames": "^2.2.6",
70
- "clone-deep": "^4.0.1",
71
- "d3-cloud": "^1.2.5",
72
- "dayjs": "^1.10.4",
73
- "html2canvas": "^1.0.0-rc.7",
74
- "moment": "^2.29.1",
75
- "qs": "^6.10.1",
76
- "rc-checkbox": "^2.3.2",
77
- "rc-dialog": "8.5.2",
78
- "rc-drawer": "^4.3.1",
79
- "rc-input-number": "^5.0.0",
80
- "rc-pagination": "^3.1.6",
81
- "rc-queue-anim": "1.4.1",
82
- "rc-select": "^12.1.7",
83
- "rc-switch": "^3.2.2",
84
- "rc-table": "^7.13.2",
85
- "rc-tabs": "^11.7.3",
86
- "rc-tooltip": "^5.1.1",
87
- "rc-tree": "^4.1.5",
88
- "rc-trigger": "^5.2.3",
89
- "rc-upload": "^4.2.0-alpha.0",
90
- "rc-util": "^5.13.1",
91
- "react-collapse": "^5.1.0",
92
- "react-perfect-scrollbar": "^1.5.2",
93
- "url-parse": "^1.5.1",
94
- "uuid": "^3.1.0",
95
- "wordcloud": "^1.2.2"
96
- }
97
- }
98
-
99
- yarn manifest:
100
- No manifest
101
-
102
- Lockfile:
103
- No lockfile