@titaui/pc 1.9.78 → 1.9.83

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 (32) hide show
  1. package/.eslintrc.js +6 -4
  2. package/lib/components/change-okr-modal/Item.js +26 -24
  3. package/lib/components/change-okr-modal/styledComponents.js +5 -5
  4. package/lib/components/mblog/style.js +2 -2
  5. package/lib/components/okr-detail/detail-header/confirm.js +2 -1
  6. package/lib/components/okr-detail/detail-header/index.js +13 -10
  7. package/lib/components/okr-flow/export-modal/index.js +3 -3
  8. package/lib/components/okr-progress-modal/helper.js +59 -45
  9. package/lib/components/okr-progress-modal/index.js +19 -14
  10. package/lib/components/okr-share/index.js +7 -2
  11. package/lib/components/okrcase-library/image/{/346/224/257/344/273/230/350/203/214/346/231/257/346/265/256/345/207/272.png → payBackgroundImg.png} +0 -0
  12. package/lib/components/okrcase-library/image/{submit/345/260/217/351/251/264.svg → submitLogo.svg} +0 -0
  13. package/lib/components/okrcase-library/image//345/271/277/345/221/212/345/233/276/347/211/207.png +0 -0
  14. package/lib/components/okrcase-library/okrcases-components/submitOkr-dialog.js +19 -16
  15. package/lib/pages/personal-info/components/base-info/index.js +5 -3
  16. package/lib/pages/personal-info/components/edit-base-info/index.js +12 -29
  17. package/package.json +2 -1
  18. package/src/components/change-okr-modal/Item.tsx +22 -22
  19. package/src/components/change-okr-modal/styledComponents.ts +11 -5
  20. package/src/components/mblog/style.ts +4 -1
  21. package/src/components/okr-detail/detail-header/confirm.tsx +1 -1
  22. package/src/components/okr-detail/detail-header/index.tsx +19 -13
  23. package/src/components/okr-flow/export-modal/index.tsx +2 -2
  24. package/src/components/okr-progress-modal/helper.js +49 -41
  25. package/src/components/okr-progress-modal/index.tsx +17 -16
  26. package/src/components/okr-share/index.tsx +9 -4
  27. package/src/components/okrcase-library/image/{/346/224/257/344/273/230/350/203/214/346/231/257/346/265/256/345/207/272.png → payBackgroundImg.png} +0 -0
  28. package/src/components/okrcase-library/image/{submit/345/260/217/351/251/264.svg → submitLogo.svg} +0 -0
  29. package/src/components/okrcase-library/image//345/271/277/345/221/212/345/233/276/347/211/207.png +0 -0
  30. package/src/components/okrcase-library/okrcases-components/submitOkr-dialog.tsx +16 -16
  31. package/src/pages/personal-info/components/base-info/index.tsx +8 -3
  32. package/src/pages/personal-info/components/edit-base-info/index.tsx +20 -15
@@ -1,11 +1,11 @@
1
- import React, { useEffect, useState } from "react";
1
+ import React, { useEffect, useState, FC } from "react";
2
2
  import { Input, Modal, Tooltip } from "tita-ui";
3
3
  import classNames from "classnames";
4
4
  import { getKrRecommandProgress, getORecommandProgress } from "./request-apis";
5
5
  import Switch from "../switch";
6
6
  import Textarea from "./textarea";
7
7
  import {
8
- getO_SETTING, getKR_SETTING, transProgress, getKrOptions, getOptions,
8
+ getOSetting, getKrSetting, transProgress, getKrOptions, getOptions,
9
9
  } from "./helper";
10
10
  import {
11
11
  ErrorTip, List, Item, Icon, Options, OptionsWrapper,
@@ -15,12 +15,12 @@ import { getLocale } from "../../utils/getLocale";
15
15
  import { inputWordTrans } from "../../utils/i18n-front-translate";
16
16
  import "./index.scss";
17
17
 
18
- const ProgressModal: React.FC<IProgressModalProps> = (props) => {
18
+ const ProgressModal: FC<IProgressModalProps> = (props:IProgressModalProps) => {
19
19
  const {
20
20
  maxLength, okrInfo, onClose, onOk, title = window.getLocale("OKR_MyO_Prog_Butt_Update"), visible, isKr,
21
21
  } = props;
22
22
 
23
- const configure = isKr ? getKR_SETTING() : getO_SETTING();
23
+ const configure = isKr ? getKrSetting() : getOSetting();
24
24
 
25
25
  const reg = /^[0-9]*[1-9][0-9]*$/;
26
26
  const [errorProgress, setErrorProgress] = useState(false);
@@ -34,10 +34,7 @@ const ProgressModal: React.FC<IProgressModalProps> = (props) => {
34
34
  const [selected, setSelected] = useState<number>(
35
35
  isKr ? okrInfo.riskLevel : okrInfo.manualRiskLevel,
36
36
  );
37
- const [ShowKrProgress] = useState(() =>
38
- // @ts-ignore
39
- window.BSGlobal.OkrAdvancedSetting.KRSetting.ShowKrProgress);
40
-
37
+ const [ShowKrProgress] = useState(window?.BSGlobal?.OkrAdvancedSetting?.KRSetting?.ShowKrProgress);
41
38
  const [autoUpdate, setUpdate] = useState(true); // 设置自动更新
42
39
  const [updateWay, setUpdateWay] = useState(0); // 自动更新方式 0: 关闭, 1: 根据关见成果, 2: 子目标
43
40
  const [settingFolded, setSettingFold] = useState(false);
@@ -46,11 +43,11 @@ const ProgressModal: React.FC<IProgressModalProps> = (props) => {
46
43
  const getRecommendProgress = async () => {
47
44
  const getRecommandHandler = isKr ? getKrRecommandProgress : getORecommandProgress;
48
45
  const data = await getRecommandHandler(isKr ? okrInfo.mileStoneId : okrInfo.workId);
49
- if (data.Code == 1) {
46
+ if (data.Code === 1) {
50
47
  const { UpdateProgressWay, Progress } = data.Data;
51
48
  setRecommandProgressObj(data.Data);
52
- setUpdate(UpdateProgressWay != 0);
53
- setUpdateWay(UpdateProgressWay == 0 ? 1 : UpdateProgressWay);
49
+ setUpdate(UpdateProgressWay !== 0);
50
+ setUpdateWay(UpdateProgressWay === 0 ? 1 : UpdateProgressWay);
54
51
  setProgress(Progress);
55
52
  }
56
53
  };
@@ -66,9 +63,12 @@ const ProgressModal: React.FC<IProgressModalProps> = (props) => {
66
63
  useEffect(() => {
67
64
  if (!autoUpdate) return;
68
65
  const { childOkrProgress, childkrProgress, childEProgress } = recommandProgressObj;
69
- updateWay == 1
70
- && setProgress(isKr ? transProgress(childEProgress) : transProgress(childkrProgress));
71
- updateWay == 2 && setProgress(transProgress(childOkrProgress));
66
+ if (updateWay === 1) {
67
+ setProgress(isKr ? transProgress(childEProgress) : transProgress(childkrProgress));
68
+ }
69
+ if (updateWay === 2) {
70
+ setProgress(transProgress(childOkrProgress));
71
+ }
72
72
  }, [updateWay, autoUpdate, recommandProgressObj]);
73
73
 
74
74
  let descriptionText = (
@@ -131,6 +131,7 @@ const ProgressModal: React.FC<IProgressModalProps> = (props) => {
131
131
  title={title}
132
132
  visible={visible}
133
133
  width={600}
134
+ zIndex={2400}
134
135
  >
135
136
  <List>
136
137
  <Item>
@@ -165,7 +166,7 @@ const ProgressModal: React.FC<IProgressModalProps> = (props) => {
165
166
  <Icon
166
167
  color={option.color}
167
168
  className={
168
- selected == option.id ? "tu-icon-singlebox-avtive" : "tu-icon-singlebox-have"
169
+ selected === option.id ? "tu-icon-singlebox-avtive" : "tu-icon-singlebox-have"
169
170
  }
170
171
  />
171
172
  <p>{option.text}</p>
@@ -195,7 +196,7 @@ const ProgressModal: React.FC<IProgressModalProps> = (props) => {
195
196
  <span
196
197
  className={classNames(
197
198
  "auto-update-setting__radio",
198
- `auto-update-setting__radio${updateWay == option.key ? "--selected" : ""
199
+ `auto-update-setting__radio${updateWay === option.key ? "--selected" : ""
199
200
  }`,
200
201
  )}
201
202
  />
@@ -11,7 +11,7 @@ interface Props {
11
11
  data: any;
12
12
  }
13
13
 
14
- const ShareContent = function ({ closeModal, getModalRef, data }: Props) {
14
+ const ShareContent = ({ closeModal, getModalRef, data }: Props) => {
15
15
  const [shareImg, setShareImg] = useState<string>();
16
16
  const [showPublish, setShowPublish] = useState(false);
17
17
  return (
@@ -43,12 +43,14 @@ const ShareContent = function ({ closeModal, getModalRef, data }: Props) {
43
43
  };
44
44
 
45
45
  interface ShareProps {
46
- shareComponent
47
46
  data: any;
48
47
  visible:boolean;
48
+ zIndex?: number;
49
49
  onClose: () => void
50
50
  }
51
- const OkrShare: React.FC<ShareProps> = ({ data, visible, onClose }) => {
51
+ const OkrShare: React.FC<ShareProps> = ({
52
+ data, visible, onClose, zIndex,
53
+ }) => {
52
54
  const modalRef = useRef<any>();
53
55
 
54
56
  return (
@@ -60,6 +62,7 @@ const OkrShare: React.FC<ShareProps> = ({ data, visible, onClose }) => {
60
62
  // maskClosable
61
63
  onCancel={() => onClose()}
62
64
  ref={modalRef}
65
+ zIndex={zIndex}
63
66
  >
64
67
  {visible ? (
65
68
  <ShareContent
@@ -71,5 +74,7 @@ const OkrShare: React.FC<ShareProps> = ({ data, visible, onClose }) => {
71
74
  </Modal>
72
75
  );
73
76
  };
74
-
77
+ OkrShare.defaultProps = {
78
+ zIndex: 1300,
79
+ };
75
80
  export default OkrShare;
@@ -7,16 +7,18 @@ import Toast from "../../toast";
7
7
  import Dialog from "../../dialog";
8
8
  import Form from "../../form";
9
9
  import { getLocale } from "../../../utils/getLocale";
10
+ import img from "../image/payBackgroundImg.png";
11
+ import submitImg from "../image/submitLogo.svg";
10
12
 
11
13
  const { Fields } = Form;
12
14
 
13
15
  interface Props1 {
14
16
  handleShowSubmitOkrWindow: Function;
15
17
  isShowSubmitOkrWindow: boolean;
16
- allViewAreaRef: any;
18
+ // allViewAreaRef: any;
17
19
  }
18
20
  export function SubmitDialog(props: Props1) {
19
- const { handleShowSubmitOkrWindow, isShowSubmitOkrWindow, allViewAreaRef } = props;
21
+ const { handleShowSubmitOkrWindow, isShowSubmitOkrWindow } = props;
20
22
  const [type, setType] = useState("");
21
23
  const [job, setJob] = useState("");
22
24
  const [scene, setScene] = useState("");
@@ -31,10 +33,8 @@ export function SubmitDialog(props: Props1) {
31
33
  };
32
34
  // 校验
33
35
  const err = formRef.current.verifing({ truonlyFirstErrore: false });
34
- if (err.length) {
35
- console.log(err);
36
- } else {
37
- postSurvey(body).then((res) => {
36
+ if (!err.length) {
37
+ postSurvey(body).then(() => {
38
38
  Toast.Success("发送成功");
39
39
  handleShowSubmitOkrWindow(false);
40
40
  }).catch(() => {
@@ -46,7 +46,7 @@ export function SubmitDialog(props: Props1) {
46
46
  return (
47
47
  <Dialog visible={isShowSubmitOkrWindow} noFooter width="480px" destroyOnClose noCloseIcon getContainer={() => document.body} zIndex={1200}>
48
48
  <div className="okr-cases-library__submitWindow">
49
- <img src={require("../image/submit小驴.svg")} />
49
+ <img src={submitImg} alt="submit小驴" />
50
50
  <div className="tu-icon-canceled" onClick={() => handleShowSubmitOkrWindow(false)} />
51
51
  <Form ref={formRef}>
52
52
  <Fields.Input
@@ -110,7 +110,7 @@ export function PayDialog(props: Props2) {
110
110
  // @ts-ignore
111
111
  const { tenantType } = window.BSGlobal.tenantInfo;
112
112
  // 外部注冊賬號使用的產品ID不同
113
- if (Version == 1 && tenantType == 3) return "D9E059E4-4303-4EE2-9275-AE2FA74BBAA6";
113
+ if (Version === 1 && tenantType === 3) return "D9E059E4-4303-4EE2-9275-AE2FA74BBAA6";
114
114
  return "60AFAD35-5273-4A06-B2F4-9A3193096BE7";
115
115
  });
116
116
  const [orderId, setOrderId] = useState("");
@@ -134,30 +134,30 @@ export function PayDialog(props: Props2) {
134
134
  Total: 1,
135
135
  }],
136
136
  }).then((orderInfo) => {
137
- const { Id: orderId, AliModel } = orderInfo;
137
+ const { Id, AliModel } = orderInfo;
138
138
  const { PayCode, PayName } = AliModel;
139
139
  setPayCode(PayCode);
140
- setOrderId(orderId);
140
+ setOrderId(Id);
141
141
  setPayName(PayName);
142
142
  });
143
143
  });
144
144
  }, []);
145
145
 
146
146
  // 点击立即支付后,2分钟内,每个10s,循环获取订单信息
147
- const loopOrderInfo = (orderId) => {
147
+ const loopOrderInfo = (id) => {
148
148
  if (getOrderInfoTimers.current === 12) {
149
149
  getOrderInfoTimers.current = 1;
150
150
  }
151
151
  setTimeout(() => {
152
152
  // 循环获取订单信息 2 分钟
153
153
  if (getOrderInfoTimers.current < 12) {
154
- getOkrOrderInfo(orderId).then((res) => {
154
+ getOkrOrderInfo(id).then((res) => {
155
155
  getOrderInfoTimers.current += 1;
156
156
  // @ts-ignore
157
157
  const { OrderStatus } = res;
158
158
  // 未支付成功重新获取订单
159
- if (OrderStatus != 2) {
160
- loopOrderInfo(orderId);
159
+ if (OrderStatus !== 2) {
160
+ loopOrderInfo(id);
161
161
  } else {
162
162
  // 订单已支付
163
163
  Modal.success({
@@ -178,7 +178,7 @@ export function PayDialog(props: Props2) {
178
178
  return (
179
179
  <Dialog visible={isShowPayWindow} noFooter width="480px" destroyOnClose noCloseIcon getContainer={() => allViewAreaRef.current}>
180
180
  <div className="okr-cases-library__payWindow">
181
- <img src={require("../image/支付背景浮出.png")} />
181
+ <img src={img} alt="支付背景浮出" />
182
182
  <div className="tu-icon-canceled" onClick={() => handleShowPayWindow(false)} style={{ width: "18px", height: "18px" }} />
183
183
  <p className="okr-cases-library__payWindow__head">
184
184
  {price}
@@ -192,7 +192,7 @@ export function PayDialog(props: Props2) {
192
192
  <div className="okr-cases-library__payWindow__amount">
193
193
  应付金额:
194
194
  <b>
195
- <span style={{ fontSize: "32px" }}>19.8</span>
195
+ <span style={{ fontSize: "32px" }}>29.8</span>
196
196
  元/年
197
197
  </b>
198
198
  </div>
@@ -25,14 +25,19 @@ const BaseInfo: FC = () => {
25
25
  setVisible(false);
26
26
  };
27
27
 
28
- const handleSuccessEditBaseInfo = (userInfo) => {
29
- setUserInfo({ ...userInfo });
28
+ const handleSuccessEditBaseInfo = (data) => {
29
+ setUserInfo({ ...data });
30
30
  };
31
31
 
32
32
  useEffect(() => {
33
33
  getUserInfoFun().then((resp) => {
34
34
  if (resp.Code === 1 && resp.Data) {
35
- setUserInfo({ ...resp.Data, position: resp.Data.positionCode });
35
+ setUserInfo({
36
+ ...resp.Data,
37
+ position: resp.Data.positionCode,
38
+ deparmentId: resp.Data.departmentId,
39
+ deparmentName: resp.Data.departmentName,
40
+ });
36
41
  }
37
42
  });
38
43
  }, []);
@@ -1,17 +1,26 @@
1
- import React, { useState, useRef, useEffect } from "react";
1
+ import React, {
2
+ useState, useRef, useEffect, FC,
3
+ } from "react";
2
4
  import Form from "../../../../components/form";
3
- import { getUserInfoFun, saveUserInfo } from "../../request-api";
5
+ import { saveUserInfo } from "../../request-api";
4
6
  import Toast from "../../../../components/toast";
5
7
  import Dialog from "../../../../components/dialog";
6
8
  import { getLocale } from "../../../../utils/getLocale";
7
9
  import { i18nLimitCharacters } from "../../../../utils/i18n-front-translate";
8
10
  import "./index.scss";
9
11
 
12
+ interface IEditbaseInfoProps {
13
+ visible: boolean;
14
+ onCancel: Function;
15
+ handleSuccessEditBaseInfo: Function;
16
+ info: any
17
+ }
18
+
10
19
  const { Fields } = Form;
11
20
 
12
21
  const prefix = "titaui-edit-personal-info";
13
22
 
14
- function EditBaseInfo(props) {
23
+ const EditBaseInfo: FC<IEditbaseInfoProps> = (props) => {
15
24
  const {
16
25
  visible, onCancel, handleSuccessEditBaseInfo, info,
17
26
  } = props;
@@ -21,8 +30,8 @@ function EditBaseInfo(props) {
21
30
  const formRef = useRef<any>();
22
31
 
23
32
  const [isDisable, setIsDisable] = useState(false);
24
- const [isEdit, setIsEdit] = useState(false);
25
- const [userInfo, setUserInfo] = useState({ name: "", email: "", mobile: "" });
33
+ // const [isEdit, setIsEdit] = useState(false);
34
+ const [userInfo, setUserInfo] = useState(info);
26
35
 
27
36
  const handleNameChange = (value) => {
28
37
  setUserInfo({
@@ -34,7 +43,7 @@ function EditBaseInfo(props) {
34
43
  } else {
35
44
  setIsDisable(false);
36
45
  }
37
- setIsEdit(true);
46
+ // setIsEdit(true);
38
47
  };
39
48
 
40
49
  const handlePhoneChange = (value) => {
@@ -47,7 +56,7 @@ function EditBaseInfo(props) {
47
56
  } else {
48
57
  setIsDisable(false);
49
58
  }
50
- setIsEdit(true);
59
+ // setIsEdit(true);
51
60
  };
52
61
 
53
62
  const handleEmailChange = (value) => {
@@ -55,7 +64,7 @@ function EditBaseInfo(props) {
55
64
  ...userInfo,
56
65
  email: value || "",
57
66
  });
58
- setIsEdit(true);
67
+ // setIsEdit(true);
59
68
  };
60
69
 
61
70
  const handleSaveUserInfo = () => {
@@ -75,12 +84,8 @@ function EditBaseInfo(props) {
75
84
  };
76
85
 
77
86
  useEffect(() => {
78
- getUserInfoFun().then((resp) => {
79
- if (resp.Code === 1 && resp.Data) {
80
- setUserInfo({ ...resp.Data, position: resp.Data.positionCode });
81
- }
82
- });
83
- }, []);
87
+ setUserInfo(info);
88
+ }, [info]);
84
89
 
85
90
  return (
86
91
  <Dialog
@@ -178,6 +183,6 @@ function EditBaseInfo(props) {
178
183
  </div>
179
184
  </Dialog>
180
185
  );
181
- }
186
+ };
182
187
 
183
188
  export default EditBaseInfo;