@titaui/pc 1.9.85 → 1.9.89

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 (31) hide show
  1. package/.eslintrc.js +1 -1
  2. package/lib/components/change-okr-modal/Item.js +120 -90
  3. package/lib/components/menus/export-modules/demo-menus/index.js +125 -0
  4. package/lib/components/menus/export-modules/demo-menus/menu-highlight.js +74 -0
  5. package/lib/components/menus/export-modules/demo-menus/menus.js +147 -0
  6. package/lib/components/menus/index.js +15 -6
  7. package/lib/components/nav-top/constant.js +26 -2
  8. package/lib/components/nav-top/index.js +32 -30
  9. package/lib/components/nav-top/request.apis.js +5 -5
  10. package/lib/components/nav-top/utils.js +20 -3
  11. package/lib/components/okr-period-selector/select-cycle.js +7 -0
  12. package/lib/index.js +14 -6
  13. package/lib/pages/demo-free/index.js +27 -0
  14. package/lib/pages/new-okr-list/init-cycle-setting.js +4 -2
  15. package/lib/pages/new-okr-list/request-api.js +32 -57
  16. package/package.json +2 -1
  17. package/src/components/change-okr-modal/Item.tsx +84 -45
  18. package/src/components/menus/export-modules/demo-menus/index.tsx +80 -0
  19. package/src/components/menus/export-modules/demo-menus/menu-highlight.ts +53 -0
  20. package/src/components/menus/export-modules/demo-menus/menus.tsx +136 -0
  21. package/src/components/menus/index.tsx +9 -5
  22. package/src/components/nav-top/constant.ts +24 -0
  23. package/src/components/nav-top/index.tsx +10 -9
  24. package/src/components/nav-top/request.apis.ts +5 -5
  25. package/src/components/nav-top/utils.ts +15 -2
  26. package/src/components/okr-period-selector/select-cycle.tsx +5 -0
  27. package/src/index.d.ts +1 -0
  28. package/src/index.js +2 -1
  29. package/src/pages/demo-free/index.tsx +15 -0
  30. package/src/pages/new-okr-list/init-cycle-setting.tsx +10 -7
  31. package/src/pages/new-okr-list/request-api.ts +11 -11
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;
@@ -1,6 +1,6 @@
1
- import React, { useEffect, useState } from "react";
2
- import { getUserInfo } from "../../utils/bs-global";
3
- import { getCycleSetting } from "./request-api";
1
+ import React, { useEffect, useState } from 'react'
2
+ import { getUserInfo } from '../../utils/bs-global'
3
+ import { getCycleSetting } from './request-api'
4
4
 
5
5
  function InitCycleSetting(props) {
6
6
  const { SetCycleModal } = props;
@@ -8,10 +8,13 @@ function InitCycleSetting(props) {
8
8
 
9
9
  useEffect(() => {
10
10
  if (
11
- localStorage.getItem(`cycle_setting_stop_show${getUserInfo().Id}`)
12
- == "true"
13
- ) return;
11
+ localStorage.getItem(`cycle_setting_stop_show${getUserInfo().Id}`) ==
12
+ 'true'
13
+ )
14
+ return
15
+ localStorage.removeItem("OKR_CYCLE_SETTING");
14
16
  getCycleSetting().then((res) => {
17
+ localStorage.setItem("OKR_CYCLE_SETTING", JSON.stringify(res?.Data || {}));
15
18
  const { hasSetting } = res.Data;
16
19
  if (!hasSetting) setVisible(true);
17
20
  });
@@ -21,7 +24,7 @@ function InitCycleSetting(props) {
21
24
  <SetCycleModal
22
25
  visible={visible}
23
26
  onCancel={() => setVisible(false)}
24
- onRefresh={() => location.reload()}
27
+ onRefresh={() => window.location.reload()}
25
28
  />
26
29
  );
27
30
  }
@@ -42,9 +42,6 @@ export const okrCrowd = async (param: ListParam) => {
42
42
  export const getOkrInfoWithListData = async function (okrId) {
43
43
  return rget("v1")(`okr/list/specificOkr?okrId=${okrId}`);
44
44
  };
45
- export const getOkrSetting = async function () {
46
- return rget("v1")("okr/cycleSetting").then((res) => res.Data);
47
- };
48
45
 
49
46
  export const okrList = async (param: ListParam) => {
50
47
  const res = await rpost("v1")(`okr/list?toUserId=${param.toUserId}`, {
@@ -65,12 +62,15 @@ export const visitOkrCyclePag = async function (toUserId) {
65
62
  };
66
63
 
67
64
  export const getCycleSetting = async (): Promise<{
68
- hasSetting: boolean;
69
- isOpenCustom: boolean;
70
- isOpenMonth: boolean;
71
- isOpenQuarter: boolean;
72
- isOpenYear: boolean;
73
- isOpenBimonthly: boolean;
74
- isOpenHalfYear: boolean;
75
- yearStartMonth: number;
65
+ Code: number;
66
+ Data: {
67
+ hasSetting: boolean;
68
+ isOpenCustom: boolean;
69
+ isOpenMonth: boolean;
70
+ isOpenQuarter: boolean;
71
+ isOpenYear: boolean;
72
+ isOpenBimonthly: boolean;
73
+ isOpenHalfYear: boolean;
74
+ yearStartMonth: number;
75
+ }
76
76
  }> => rget("v1")("okr/cycleSetting");