@titaui/pc 1.9.18 → 1.9.22
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 +24 -27
- package/lib/components/create-okr-modal/fields/index.css +1 -1
- package/lib/components/dialog-confirm/index.css +8 -3
- package/lib/components/dialog-confirm/index.js +17 -15
- package/lib/components/drawer/index.css +1 -1
- package/lib/components/dynamic/dynamic-item/dynamic-align/index.css +2 -4
- package/lib/components/dynamic/dynamic-item/dynamic-announcement/index.css +2 -4
- package/lib/components/dynamic/dynamic-item/dynamic-assessment/index.css +2 -4
- package/lib/components/dynamic/dynamic-item/dynamic-create-o/index.css +2 -4
- package/lib/components/dynamic/dynamic-item/dynamic-kr/index.css +2 -4
- package/lib/components/dynamic/dynamic-item/dynamic-milestone/index.css +1 -3
- package/lib/components/dynamic/dynamic-item/dynamic-okrs-communication/index.css +2 -4
- package/lib/components/dynamic/dynamic-item/dynamic-plan-communication/index.css +2 -4
- package/lib/components/dynamic/dynamic-item/dynamic-progress/index.css +2 -4
- package/lib/components/dynamic/dynamic-item/dynamic-project/index.css +2 -4
- package/lib/components/dynamic/dynamic-item/dynamic-relative/index.css +2 -4
- package/lib/components/dynamic/dynamic-item/dynamic-replay/index.css +2 -4
- package/lib/components/dynamic/dynamic-item/dynamic-report/index.css +2 -4
- package/lib/components/dynamic/dynamic-item/dynamic-reward/index.css +2 -3
- package/lib/components/dynamic/dynamic-item/dynamic-share/index.css +2 -4
- package/lib/components/dynamic/dynamic-item/dynamic-task/index.css +2 -4
- package/lib/components/dynamic/dynamic-topping/index.css +1 -1
- package/lib/components/grid-layout/okr-align/index.js +1 -1
- package/lib/components/grid-layout/okr-progress/index.js +1 -1
- package/lib/components/menus/components/menu-tree/index.css +2 -2
- package/lib/components/menus/export-modules/okr-menus/depart-menus/index.css +1 -1
- package/lib/components/okr-detail/base-info/base-info.js +14 -13
- package/lib/components/okr-detail/base-info/o-desc/index.css +1 -1
- package/lib/components/okr-detail/components/header/index.css +4 -0
- package/lib/components/okr-detail/components/header/index.js +7 -3
- package/lib/components/okr-detail/components/header/o-score.js +163 -0
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-kr-node/index.js +1 -1
- package/lib/components/okr-detail/components/okr-tree/tree-node/index.css +1 -1
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/index.css +1 -1
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/kr-score-editor/edit-pop.js +5 -2
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/kr-score-editor/kr-push-score.js +10 -2
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/kr-score-editor/style.js +6 -6
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-parent-node/index.css +1 -1
- package/lib/components/okr-detail/components/okr-tree/tree-node/o-child-node/index.css +1 -1
- package/lib/components/okr-detail/components/okr-tree/tree-node/o-parent-node/index.css +1 -1
- package/lib/components/okr-detail/detail-footer/index.css +1 -1
- package/lib/components/okr-detail/e-list/search-form/fields/index.css +1 -0
- package/lib/components/okr-detail/okr-list/index.css +2 -2
- package/lib/components/okr-detail/request-apis.js +11 -2
- package/lib/components/okr-progress-modal/helper.js +2 -2
- package/lib/components/okr-progress-modal/index.css +2 -2
- package/lib/components/okrcase-library/index.css +1 -1
- package/lib/components/pagination/select.css +1 -1
- package/lib/components/search-dropdown/index.css +1 -1
- package/lib/components/switch/index.css +1 -1
- package/lib/components/tabs/index.css +1 -1
- package/lib/components/tita-chart/charts/pie.js +3 -1
- package/lib/components/tooltip/tooltip-text/index.js +6 -5
- package/lib/components/user-selector/export-modules/duties-selector/index.js +69 -10
- package/lib/components/user-selector/request-apis.js +11 -2
- package/lib/components/version-change-modal/index.css +1 -1
- package/lib/components/weekly-report/index.css +1 -1
- package/lib/components-v1/confirm/index.js +1 -1
- package/lib/components-v1/dropDownSelector/styles/index.js +1 -1
- package/lib/pages/appointment-demo/index.css +1 -1
- package/lib/pages/group-management/page-view/importGroupStaff/index.css +2 -2
- package/lib/pages/okr-map/export-modules/okr-map/header/index.css +1 -1
- package/lib/pages/okr-map/export-modules/share-okr-page/header/index.css +1 -1
- package/lib/pages/personal-info/components/base-info/index.js +8 -6
- package/lib/pages/personal-info/components/edit-base-info/index.js +26 -22
- package/lib/utils/i18n-front-translate.js +18 -0
- package/package.json +1 -1
- package/src/components/change-okr-modal/Item.tsx +9 -3
- package/src/components/create-okr-modal/fields/index.scss +1 -1
- package/src/components/dialog-confirm/index.js +95 -58
- package/src/components/dialog-confirm/index.scss +16 -12
- package/src/components/drawer/index.scss +1 -1
- package/src/components/dynamic/dynamic-item/dynamic-align/index.scss +2 -4
- package/src/components/dynamic/dynamic-item/dynamic-announcement/index.scss +2 -4
- package/src/components/dynamic/dynamic-item/dynamic-assessment/index.scss +2 -4
- package/src/components/dynamic/dynamic-item/dynamic-create-o/index.scss +2 -4
- package/src/components/dynamic/dynamic-item/dynamic-kr/index.scss +2 -4
- package/src/components/dynamic/dynamic-item/dynamic-milestone/index.scss +1 -3
- package/src/components/dynamic/dynamic-item/dynamic-okrs-communication/index.scss +2 -4
- package/src/components/dynamic/dynamic-item/dynamic-plan-communication/index.scss +2 -4
- package/src/components/dynamic/dynamic-item/dynamic-progress/index.scss +2 -4
- package/src/components/dynamic/dynamic-item/dynamic-project/index.scss +2 -4
- package/src/components/dynamic/dynamic-item/dynamic-relative/index.scss +2 -4
- package/src/components/dynamic/dynamic-item/dynamic-replay/index.scss +2 -4
- package/src/components/dynamic/dynamic-item/dynamic-report/index.scss +2 -4
- package/src/components/dynamic/dynamic-item/dynamic-reward/index.scss +2 -3
- package/src/components/dynamic/dynamic-item/dynamic-share/index.scss +2 -4
- package/src/components/dynamic/dynamic-item/dynamic-task/index.scss +2 -4
- package/src/components/dynamic/dynamic-topping/index.scss +1 -1
- package/src/components/form/form-fields/input/index.tsx +1 -1
- package/src/components/form/form-fields/textarea/index.tsx +2 -1
- package/src/components/grid-layout/okr-align/index.tsx +1 -1
- package/src/components/grid-layout/okr-progress/index.tsx +1 -1
- package/src/components/menus/components/menu-tree/index.scss +2 -2
- package/src/components/menus/export-modules/okr-menus/depart-menus/index.scss +1 -1
- package/src/components/okr-detail/base-info/base-info.tsx +39 -27
- package/src/components/okr-detail/base-info/o-desc/index.scss +1 -1
- package/src/components/okr-detail/components/header/index.js +4 -3
- package/src/components/okr-detail/components/header/index.scss +5 -0
- package/src/components/okr-detail/components/header/o-score.tsx +115 -0
- package/src/components/okr-detail/components/okr-tree/tree-node/e-kr-node/index.js +1 -1
- package/src/components/okr-detail/components/okr-tree/tree-node/index.scss +1 -1
- package/src/components/okr-detail/components/okr-tree/tree-node/kr-node/index.scss +1 -1
- package/src/components/okr-detail/components/okr-tree/tree-node/kr-node/kr-score-editor/edit-pop.tsx +2 -2
- package/src/components/okr-detail/components/okr-tree/tree-node/kr-node/kr-score-editor/kr-push-score.tsx +3 -3
- package/src/components/okr-detail/components/okr-tree/tree-node/kr-node/kr-score-editor/style.js +2 -6
- package/src/components/okr-detail/components/okr-tree/tree-node/kr-parent-node/index.scss +1 -1
- package/src/components/okr-detail/components/okr-tree/tree-node/o-child-node/index.scss +1 -1
- package/src/components/okr-detail/components/okr-tree/tree-node/o-parent-node/index.scss +1 -1
- package/src/components/okr-detail/detail-footer/index.scss +1 -1
- package/src/components/okr-detail/e-list/search-form/fields/index.scss +1 -0
- package/src/components/okr-detail/okr-list/index.scss +1 -1
- package/src/components/okr-detail/request-apis.ts +7 -0
- package/src/components/okr-progress-modal/helper.js +2 -2
- package/src/components/okr-progress-modal/index.scss +2 -2
- package/src/components/okrcase-library/index.scss +1 -1
- package/src/components/pagination/select.scss +1 -1
- package/src/components/search-dropdown/index.scss +1 -1
- package/src/components/switch/index.scss +1 -1
- package/src/components/tabs/index.scss +1 -1
- package/src/components/tita-chart/charts/pie.tsx +2 -1
- package/src/components/tooltip/tooltip-text/index.tsx +8 -6
- package/src/components/user-selector/export-modules/duties-selector/index.tsx +78 -18
- package/src/components/user-selector/request-apis.js +7 -0
- package/src/components/version-change-modal/index.scss +1 -1
- package/src/components/weekly-report/index.scss +1 -1
- package/src/components-v1/confirm/index.tsx +0 -1
- package/src/components-v1/dropDownSelector/styles/index.tsx +1 -1
- package/src/pages/appointment-demo/index.scss +1 -1
- package/src/pages/group-management/page-view/importGroupStaff/index.scss +2 -2
- package/src/pages/okr-map/export-modules/okr-map/header/index.scss +1 -1
- package/src/pages/okr-map/export-modules/share-okr-page/header/index.scss +1 -1
- package/src/pages/personal-info/components/base-info/index.tsx +42 -21
- package/src/pages/personal-info/components/edit-base-info/index.tsx +151 -141
- package/src/utils/i18n-front-translate.ts +8 -0
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import React, { useState, forwardRef, useImperativeHandle } from 'react';
|
|
2
|
-
import classNames from 'classnames';
|
|
1
|
+
import React, { useState, forwardRef, useImperativeHandle, useEffect } from 'react';
|
|
3
2
|
import ChooseTree from '../../select-tree/choose-tree';
|
|
4
3
|
import Popup from '../../../popup';
|
|
5
4
|
import { TreeNodeContext } from '../../context';
|
|
6
5
|
import { CommonContext } from '../../context';
|
|
7
|
-
import
|
|
6
|
+
import Loading from '../../loading';
|
|
7
|
+
import { SinglePersonalLayout } from '../../layout';
|
|
8
|
+
import SelectorInput from '../../../selector-input';
|
|
9
|
+
import { getDuties,searchDuties } from '../../request-apis';
|
|
8
10
|
|
|
9
11
|
import '../../index.scss';
|
|
10
12
|
import './index.scss';
|
|
11
13
|
|
|
12
|
-
const preCls = 'perspm-duties-selector';
|
|
14
|
+
// const preCls = 'perspm-duties-selector';
|
|
13
15
|
|
|
14
16
|
interface Props {
|
|
15
17
|
onSelect?: Function;
|
|
@@ -37,6 +39,39 @@ export default forwardRef((props: Props, ref) => {
|
|
|
37
39
|
} = props;
|
|
38
40
|
|
|
39
41
|
const [visible, setVisible] = useState(false);
|
|
42
|
+
const [searchKey, setSearchKey] = useState('');
|
|
43
|
+
const [loading, setLoading] = useState(false);
|
|
44
|
+
const [dutiesData,setDutiesData] = useState([])
|
|
45
|
+
|
|
46
|
+
// 获取数据的API
|
|
47
|
+
const searchTreeData = () => {
|
|
48
|
+
|
|
49
|
+
return searchDuties({
|
|
50
|
+
searchKey,
|
|
51
|
+
}).then(res => {
|
|
52
|
+
if(!!res.Code){
|
|
53
|
+
let data = res.Data.map(it => {
|
|
54
|
+
return {
|
|
55
|
+
'key': `${it.code}`,
|
|
56
|
+
'id': `${it.id}`,
|
|
57
|
+
'pid': `-1`,
|
|
58
|
+
'nodeType': 'duties',
|
|
59
|
+
'isLeaf': true,
|
|
60
|
+
'data': { ...it }
|
|
61
|
+
};
|
|
62
|
+
})
|
|
63
|
+
setDutiesData(data)
|
|
64
|
+
}
|
|
65
|
+
}).catch(err=>{
|
|
66
|
+
console.log(err)
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
useEffect(() => {
|
|
71
|
+
if (!searchKey) return;
|
|
72
|
+
setLoading(true);
|
|
73
|
+
searchTreeData().then(() => setLoading(false));
|
|
74
|
+
}, [searchKey]);
|
|
40
75
|
|
|
41
76
|
const onGetTreeData = () => {
|
|
42
77
|
return getDuties().then(duties => {
|
|
@@ -63,20 +98,45 @@ export default forwardRef((props: Props, ref) => {
|
|
|
63
98
|
setVisible(false);
|
|
64
99
|
}
|
|
65
100
|
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
101
|
+
const onSearchChangeHandler = val => {
|
|
102
|
+
setSearchKey(val);
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
const popup = <div>
|
|
107
|
+
<SinglePersonalLayout>
|
|
108
|
+
<SelectorInput onChange={onSearchChangeHandler} />
|
|
109
|
+
{!!searchKey ? (
|
|
110
|
+
loading ? (
|
|
111
|
+
<Loading />
|
|
112
|
+
) : (
|
|
113
|
+
<div>
|
|
114
|
+
<TreeNodeContext.Provider value={{}}>
|
|
115
|
+
<ChooseTree
|
|
116
|
+
multiple={false}
|
|
117
|
+
treeData={dutiesData}
|
|
118
|
+
asyncData={false}
|
|
119
|
+
onSelect={onSelectHandler}
|
|
120
|
+
virtual={true}
|
|
121
|
+
height={height-44}
|
|
122
|
+
/>
|
|
123
|
+
</TreeNodeContext.Provider>
|
|
124
|
+
</div>
|
|
125
|
+
)
|
|
126
|
+
) : (
|
|
127
|
+
<TreeNodeContext.Provider value={{}}>
|
|
128
|
+
<ChooseTree
|
|
129
|
+
onSelect={onSelectHandler}
|
|
130
|
+
asyncData={true}
|
|
131
|
+
multiple={false}
|
|
132
|
+
getTreeData={onGetTreeData}
|
|
133
|
+
itemHeight={itemHeight}
|
|
134
|
+
height={height-44}
|
|
135
|
+
virtual={true}
|
|
136
|
+
/>
|
|
137
|
+
</TreeNodeContext.Provider>
|
|
138
|
+
)}
|
|
139
|
+
</SinglePersonalLayout>
|
|
80
140
|
</div>;
|
|
81
141
|
|
|
82
142
|
return <CommonContext.Provider value={{}}>
|
|
@@ -124,4 +124,11 @@ export const getDuties = () => {
|
|
|
124
124
|
.then(res => {
|
|
125
125
|
return res.data;
|
|
126
126
|
})
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export const searchDuties = ({searchKey}) => {
|
|
130
|
+
return axios.get(`${requestDomain()}/api/v1/${tenantId}/${userId}/position/search?status=1&pageNum=1&pageSize=100&filter=${searchKey}`)
|
|
131
|
+
.then(res => {
|
|
132
|
+
return res.data;
|
|
133
|
+
})
|
|
127
134
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
&-download{
|
|
5
5
|
&-template{
|
|
6
6
|
font-size: 14px;
|
|
7
|
-
font-weight:
|
|
7
|
+
font-weight: 600;
|
|
8
8
|
color: #3F4755;
|
|
9
9
|
display: flex;
|
|
10
10
|
justify-content: space-between;
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
border-radius: 3px;
|
|
18
18
|
border: 1px solid #2879FF;
|
|
19
19
|
font-size: 12px;
|
|
20
|
-
font-weight:
|
|
20
|
+
font-weight: 600;
|
|
21
21
|
color: #2879FF;
|
|
22
22
|
line-height: 26px;
|
|
23
23
|
&:hover{
|
|
@@ -1,58 +1,79 @@
|
|
|
1
1
|
import React, { FC, useState, useEffect } from "react";
|
|
2
|
-
import { getUserInfoFun } from
|
|
2
|
+
import { getUserInfoFun } from "../../request-api";
|
|
3
3
|
import { RectBtn } from "../../../../components/button";
|
|
4
|
-
import EditModle from
|
|
5
|
-
import {OpenUserName} from
|
|
4
|
+
import EditModle from "../edit-base-info";
|
|
5
|
+
import { OpenUserName } from "../../../../utils/open-data";
|
|
6
|
+
import { getLocale } from "../../../../utils/getLocale";
|
|
6
7
|
import "./index.scss";
|
|
7
8
|
|
|
8
9
|
const prefix = "titaui-personal-info-base-info";
|
|
9
10
|
|
|
10
11
|
const BaseInfo: FC = () => {
|
|
11
|
-
const [userInfo, setUserInfo] = useState({
|
|
12
|
+
const [userInfo, setUserInfo] = useState({
|
|
13
|
+
name: "",
|
|
14
|
+
email: "",
|
|
15
|
+
mobile: "",
|
|
16
|
+
userId: "",
|
|
17
|
+
});
|
|
12
18
|
const [visible, setVisible] = useState(false);
|
|
13
19
|
|
|
14
20
|
const handleClickEdit = () => {
|
|
15
21
|
setVisible(true);
|
|
16
|
-
}
|
|
22
|
+
};
|
|
17
23
|
|
|
18
24
|
const handleCancelEdit = () => {
|
|
19
25
|
setVisible(false);
|
|
20
|
-
}
|
|
26
|
+
};
|
|
21
27
|
|
|
22
28
|
const handleSuccessEditBaseInfo = (userInfo) => {
|
|
23
|
-
setUserInfo({...userInfo});
|
|
24
|
-
}
|
|
29
|
+
setUserInfo({ ...userInfo });
|
|
30
|
+
};
|
|
25
31
|
|
|
26
32
|
useEffect(() => {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
+
getUserInfoFun().then((resp) => {
|
|
34
|
+
if (resp.Code === 1 && resp.Data) {
|
|
35
|
+
setUserInfo({ ...resp.Data, position: resp.Data.positionCode });
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}, []);
|
|
33
39
|
|
|
34
40
|
return (
|
|
35
41
|
<div className={prefix}>
|
|
36
42
|
<div className={`${prefix}__header`}>
|
|
37
|
-
<span className={`${prefix}__header-title`}>
|
|
43
|
+
<span className={`${prefix}__header-title`}>
|
|
44
|
+
{getLocale("Per_Ass_New_title_text_BasicIn")}
|
|
45
|
+
</span>
|
|
38
46
|
<RectBtn
|
|
39
47
|
type={"primary"}
|
|
40
|
-
text={getLocale(
|
|
48
|
+
text={getLocale("Mod_Editor")}
|
|
41
49
|
onClick={handleClickEdit}
|
|
42
50
|
/>
|
|
43
|
-
<EditModle
|
|
51
|
+
<EditModle
|
|
52
|
+
visible={visible}
|
|
53
|
+
onCancel={handleCancelEdit}
|
|
54
|
+
handleSuccessEditBaseInfo={handleSuccessEditBaseInfo}
|
|
55
|
+
info={userInfo}
|
|
56
|
+
/>
|
|
44
57
|
</div>
|
|
45
58
|
<div className={`${prefix}__form`}>
|
|
46
|
-
<div className={`${prefix}__form-title`}
|
|
47
|
-
|
|
59
|
+
<div className={`${prefix}__form-title`}>
|
|
60
|
+
{getLocale("Mod_UserName")}
|
|
61
|
+
</div>
|
|
62
|
+
<span className={`${prefix}__form-value`}>
|
|
63
|
+
<OpenUserName id={userInfo.userId} name={userInfo.name} />
|
|
64
|
+
</span>
|
|
48
65
|
</div>
|
|
49
66
|
<div className={`${prefix}__form`}>
|
|
50
67
|
<div className={`${prefix}__form-title`}>手机号码</div>
|
|
51
|
-
<span className={`${prefix}__form-value`}>
|
|
68
|
+
<span className={`${prefix}__form-value`}>
|
|
69
|
+
{userInfo.mobile ? userInfo.mobile : getLocale('Data_Notset')}
|
|
70
|
+
</span>
|
|
52
71
|
</div>
|
|
53
72
|
<div className={`${prefix}__form`}>
|
|
54
73
|
<div className={`${prefix}__form-title`}>电子邮箱</div>
|
|
55
|
-
<span className={`${prefix}__form-value`}>
|
|
74
|
+
<span className={`${prefix}__form-value`}>
|
|
75
|
+
{userInfo.email ? userInfo.email : getLocale('Data_Notset')}
|
|
76
|
+
</span>
|
|
56
77
|
</div>
|
|
57
78
|
</div>
|
|
58
79
|
);
|
|
@@ -1,172 +1,182 @@
|
|
|
1
|
-
import React, { useState, useRef, useEffect } from
|
|
2
|
-
import Form from
|
|
3
|
-
import { getUserInfoFun, saveUserInfo } from
|
|
4
|
-
import Toast from
|
|
5
|
-
import Dialog from
|
|
6
|
-
import
|
|
1
|
+
import React, { useState, useRef, useEffect } from "react";
|
|
2
|
+
import Form from "../../../../components/form";
|
|
3
|
+
import { getUserInfoFun, saveUserInfo } from "../../request-api";
|
|
4
|
+
import Toast from "../../../../components/toast";
|
|
5
|
+
import Dialog from "../../../../components/dialog";
|
|
6
|
+
import { getLocale } from "../../../../utils/getLocale";
|
|
7
|
+
import { i18nLimitCharacters } from "../../../../utils/i18n-front-translate"
|
|
8
|
+
import "./index.scss";
|
|
7
9
|
|
|
8
10
|
const { Fields } = Form;
|
|
9
11
|
|
|
10
|
-
const prefix = "titaui-edit-personal-info"
|
|
12
|
+
const prefix = "titaui-edit-personal-info";
|
|
11
13
|
|
|
12
14
|
const EditBaseInfo = (props) => {
|
|
13
|
-
|
|
15
|
+
const { visible, onCancel, handleSuccessEditBaseInfo, info } = props;
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
const modalRef = useRef<any>();
|
|
16
18
|
const formContainerRef = useRef<any>();
|
|
17
|
-
|
|
19
|
+
const formRef = useRef<any>();
|
|
18
20
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
const [isDisable, setIsDisable] = useState(false);
|
|
22
|
+
const [isEdit, setIsEdit] = useState(false);
|
|
23
|
+
const [userInfo, setUserInfo] = useState({ name: "", email: "", mobile: "" });
|
|
22
24
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
if(value.length > 50 || value.length === 0) {
|
|
25
|
+
const handleNameChange = (value) => {
|
|
26
|
+
setUserInfo({
|
|
27
|
+
...userInfo,
|
|
28
|
+
name: value || "",
|
|
29
|
+
});
|
|
30
|
+
if (value.length > 50 || value.length === 0) {
|
|
29
31
|
setIsDisable(true);
|
|
30
32
|
} else {
|
|
31
33
|
setIsDisable(false);
|
|
32
34
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
+
setIsEdit(true);
|
|
36
|
+
};
|
|
35
37
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
if(value.length !== 11
|
|
38
|
+
const handlePhoneChange = (value) => {
|
|
39
|
+
setUserInfo({
|
|
40
|
+
...userInfo,
|
|
41
|
+
mobile: value || "",
|
|
42
|
+
});
|
|
43
|
+
if (value.length !== 11) {
|
|
42
44
|
setIsDisable(true);
|
|
43
|
-
}else {
|
|
45
|
+
} else {
|
|
44
46
|
setIsDisable(false);
|
|
45
47
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
+
setIsEdit(true);
|
|
49
|
+
};
|
|
48
50
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
51
|
+
const handleEmailChange = (value) => {
|
|
52
|
+
setUserInfo({
|
|
53
|
+
...userInfo,
|
|
54
|
+
email: value || "",
|
|
55
|
+
});
|
|
56
|
+
setIsEdit(true);
|
|
57
|
+
};
|
|
56
58
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
+
const handleSaveUserInfo = () => {
|
|
60
|
+
if (!userInfo.mobile || !userInfo.name || userInfo.name.length > 50) {
|
|
59
61
|
setIsDisable(true);
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
return;
|
|
63
|
+
} else {
|
|
64
|
+
saveUserInfo({ data: userInfo }).then((resp) => {
|
|
65
|
+
if (resp.Code === 1) {
|
|
66
|
+
Toast.Success(getLocale('Per_Ma_form_Updatesuc'), { canClose: false });
|
|
65
67
|
handleSuccessEditBaseInfo(userInfo);
|
|
66
68
|
onCancel();
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
69
|
+
} else {
|
|
70
|
+
Toast.Error(resp.Message, { canClose: false });
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
};
|
|
73
75
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
76
|
+
useEffect(() => {
|
|
77
|
+
getUserInfoFun().then((resp) => {
|
|
78
|
+
if (resp.Code === 1 && resp.Data) {
|
|
79
|
+
setUserInfo({ ...resp.Data, position: resp.Data.positionCode });
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
}, []);
|
|
81
83
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
onCancel();
|
|
94
|
-
setUserInfo({
|
|
84
|
+
return (
|
|
85
|
+
<Dialog
|
|
86
|
+
visible={visible}
|
|
87
|
+
ref={modalRef}
|
|
88
|
+
width={480}
|
|
89
|
+
mask
|
|
90
|
+
centered
|
|
91
|
+
title={"基本信息设置"}
|
|
92
|
+
noHeadLine
|
|
93
|
+
maskClosable={false}
|
|
94
|
+
onClose={() => {
|
|
95
|
+
onCancel();
|
|
96
|
+
setUserInfo({
|
|
97
|
+
name: info.name,
|
|
98
|
+
mobile: info.mobile,
|
|
99
|
+
email: info.email,
|
|
100
|
+
});
|
|
95
101
|
}}
|
|
96
|
-
|
|
102
|
+
onCancel={() => {
|
|
97
103
|
onCancel();
|
|
98
|
-
setUserInfo({
|
|
104
|
+
setUserInfo({
|
|
105
|
+
name: info.name,
|
|
106
|
+
mobile: info.mobile,
|
|
107
|
+
email: info.email,
|
|
108
|
+
});
|
|
99
109
|
}}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
110
|
+
okText={getLocale('Mod_Determiness')}
|
|
111
|
+
noFooterLine
|
|
112
|
+
onOk={handleSaveUserInfo}
|
|
113
|
+
disabled={isDisable}
|
|
114
|
+
>
|
|
105
115
|
<div className={`${prefix}__form`} ref={formContainerRef}>
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
116
|
+
<Form ref={formRef} getFormContainer={() => formContainerRef.current}>
|
|
117
|
+
<Fields.Input
|
|
118
|
+
name={"name"}
|
|
119
|
+
label={getLocale('Mod_UserName')}
|
|
120
|
+
placeholder={getLocale('Perf_Indica_Pop_text_Name')}
|
|
121
|
+
type="text"
|
|
122
|
+
require
|
|
123
|
+
layout="row"
|
|
124
|
+
verifies={[
|
|
125
|
+
{
|
|
126
|
+
tip: getLocale('OKR_MyO_Ew_Namecant'),
|
|
127
|
+
test: /^[\s\S]+$/,
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
tip: "姓名只能为中文,英文字母和数字及下划线的组合",
|
|
131
|
+
test: /^((?!(\uff08|\uff09)).)*$/g,
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
tip: i18nLimitCharacters(50),
|
|
135
|
+
test: /^[\s\S]{0,50}$/,
|
|
136
|
+
},
|
|
137
|
+
]}
|
|
138
|
+
value={userInfo.name}
|
|
139
|
+
onChange={handleNameChange}
|
|
140
|
+
/>
|
|
141
|
+
<Fields.Input
|
|
142
|
+
name="phone"
|
|
143
|
+
type="text"
|
|
144
|
+
label={"手机号码"}
|
|
145
|
+
placeholder={getLocale('Pro_page_Ext_Tab_PhoneNumber')}
|
|
146
|
+
require
|
|
147
|
+
layout="row"
|
|
148
|
+
value={userInfo.mobile}
|
|
149
|
+
verifies={[
|
|
150
|
+
{
|
|
151
|
+
tip: "手机号不能为空",
|
|
152
|
+
test: /^[\s\S]+$/,
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
tip: "格式错误,海外手机格式如:(+852)52345678",
|
|
156
|
+
test: /^1[3456789]\d{9}$/,
|
|
157
|
+
},
|
|
158
|
+
]}
|
|
159
|
+
onChange={handlePhoneChange}
|
|
160
|
+
/>
|
|
161
|
+
<Fields.Input
|
|
162
|
+
name="email"
|
|
163
|
+
type="text"
|
|
164
|
+
label={getLocale('OKR_MyO_Ew_Mail')}
|
|
165
|
+
value={userInfo.email}
|
|
166
|
+
layout="row"
|
|
167
|
+
placeholder={getLocale('Pro_page_Ext_Tab_Inpuyouremail')}
|
|
168
|
+
verifies={[
|
|
169
|
+
{
|
|
170
|
+
tip: getLocale('OKR_MyO_Ew_Emailfor'),
|
|
171
|
+
test: /^([a-zA-Z0-9_-]|\.)+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/,
|
|
172
|
+
},
|
|
173
|
+
]}
|
|
174
|
+
onChange={handleEmailChange}
|
|
175
|
+
/>
|
|
176
|
+
</Form>
|
|
177
|
+
</div>
|
|
178
|
+
</Dialog>
|
|
179
|
+
);
|
|
170
180
|
};
|
|
171
181
|
|
|
172
182
|
export default EditBaseInfo;
|