@titaui/pc 1.8.7 → 1.8.8
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 +1 -5
- package/lib/components/change-okr-modal/constant.js +1 -6
- package/lib/components/dialog/index.css +1 -1
- package/lib/components/dynamic/my-team/index.js +1 -1
- package/lib/components/form/form-fields/duties/index.js +2 -1
- package/lib/components/form/form-fields/input-verification-code/index.js +18 -15
- package/lib/components/form/form-fields/password/index.css +18 -0
- package/lib/components/form/form-fields/password/index.js +33 -20
- package/lib/components/form/index.js +4 -1
- package/lib/components/menus/components/drag-resize/index.js +3 -5
- package/lib/components/menus/export-modules/appraisal-menus/index.js +1 -6
- package/lib/components/menus/export-modules/manage-menus/index.js +1 -5
- package/lib/components/menus/export-modules/okr-menus/index.js +2 -5
- package/lib/components/nav-top/components/user-message/components/remind/index.js +3 -1
- package/lib/components/nav-top/components/user-message/components/remind/remind-item.js +2 -2
- package/lib/components/nav-top/components/user-message/msg/index.css +4 -0
- package/lib/components/nav-top/components/version/index.js +3 -3
- package/lib/components/okr-detail/okr-list/empty/index.js +1 -1
- package/lib/components/pagination/pagination.js +2 -5
- package/lib/components/period-selector/common.js +1 -6
- package/lib/components/publish-dynamic-modal/publish-dynamic-modal.js +1 -3
- package/lib/components/status-time/index.js +1 -1
- package/lib/components/upload-photo-modal/constant.js +2 -2
- package/lib/components/upload-photo-modal/index.css +1 -2
- package/lib/components/upload-photo-modal/index.js +54 -77
- package/lib/components/user-selector/request-apis.js +1 -1
- package/lib/pages/like-ranking/index.js +2 -2
- package/lib/pages/personal-info/components/base-info/index.css +31 -3
- package/lib/pages/personal-info/components/base-info/index.js +13 -5
- package/lib/pages/personal-info/components/{edit-info → edit-base-info}/index.css +1 -1
- package/lib/pages/personal-info/components/{edit-info → edit-base-info}/index.js +3 -4
- package/lib/pages/personal-info/components/person-photo/index.css +18 -5
- package/lib/pages/personal-info/components/person-photo/index.js +18 -3
- package/lib/utils/getLocale.js +7 -2
- package/package.json +1 -1
- package/src/components/change-okr-modal/Item.tsx +1 -4
- package/src/components/change-okr-modal/constant.ts +1 -5
- package/src/components/dialog/index.scss +1 -1
- package/src/components/dynamic/my-team/index.tsx +1 -1
- package/src/components/form/form-fields/duties/index.tsx +1 -1
- package/src/components/form/form-fields/input-verification-code/index.tsx +100 -70
- package/src/components/form/form-fields/password/index.scss +20 -4
- package/src/components/form/form-fields/password/index.tsx +73 -51
- package/src/components/form/index.tsx +3 -1
- package/src/components/menus/components/drag-resize/index.tsx +1 -3
- package/src/components/menus/export-modules/appraisal-menus/index.tsx +1 -5
- package/src/components/menus/export-modules/manage-menus/index.tsx +1 -4
- package/src/components/menus/export-modules/okr-menus/index.tsx +1 -4
- package/src/components/nav-top/components/user-message/components/remind/index.tsx +2 -1
- package/src/components/nav-top/components/user-message/components/remind/remind-item.tsx +2 -2
- package/src/components/nav-top/components/user-message/msg/index.scss +3 -0
- package/src/components/nav-top/components/version/index.tsx +1 -3
- package/src/components/okr-detail/okr-list/empty/index.js +1 -1
- package/src/components/pagination/pagination.tsx +1 -4
- package/src/components/period-selector/common.ts +1 -5
- package/src/components/publish-dynamic-modal/publish-dynamic-modal.tsx +2 -4
- package/src/components/status-time/index.tsx +2 -2
- package/src/components/upload-photo-modal/constant.ts +2 -2
- package/src/components/upload-photo-modal/index.scss +1 -2
- package/src/components/upload-photo-modal/index.tsx +42 -57
- package/src/components/user-selector/export-modules/duties-selector/index.tsx +1 -1
- package/src/components/user-selector/request-apis.js +1 -1
- package/src/pages/like-ranking/index.tsx +2 -2
- package/src/pages/personal-info/components/base-info/index.scss +26 -3
- package/src/pages/personal-info/components/base-info/index.tsx +12 -3
- package/src/pages/personal-info/components/{edit-info → edit-base-info}/index.scss +1 -1
- package/src/pages/personal-info/components/{edit-info → edit-base-info}/index.tsx +2 -4
- package/src/pages/personal-info/components/person-photo/index.scss +17 -5
- package/src/pages/personal-info/components/person-photo/index.tsx +12 -4
- package/src/utils/getLocale.ts +6 -0
- package/lib/pages/personal-info/components/edit-info/input/index.css +0 -89
- package/lib/pages/personal-info/components/edit-info/input/index.js +0 -199
- package/src/pages/personal-info/components/edit-info/input/index.scss +0 -82
- package/src/pages/personal-info/components/edit-info/input/index.tsx +0 -145
|
@@ -3,10 +3,8 @@ import Dialog from "../dialog";
|
|
|
3
3
|
import MBlog from "../mblog";
|
|
4
4
|
import { addShare, addNotice } from "./requist-api";
|
|
5
5
|
import Toast from "../toast";
|
|
6
|
-
import { getUserInfo
|
|
7
|
-
import { getLocale } from "../../utils/getLocale";
|
|
8
|
-
const i18nInfo = getBSGlobal('I18NInfo')
|
|
9
|
-
const isEn = i18nInfo && i18nInfo.I18NOpen && i18nInfo.I18NUserLang === "en_US";
|
|
6
|
+
import { getUserInfo } from "../../utils/bs-global";
|
|
7
|
+
import { getLocale, isEn } from "../../utils/getLocale";
|
|
10
8
|
|
|
11
9
|
import "./publish-dynamic-modal.scss";
|
|
12
10
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { FC, useState, useEffect, useCallback } from 'react';
|
|
2
|
-
import { getLocale } from '../../utils/getLocale';
|
|
2
|
+
import { getLocale, isEn } from '../../utils/getLocale';
|
|
3
3
|
import './index.scss';
|
|
4
4
|
|
|
5
5
|
interface IStatusTimeProps {
|
|
@@ -61,7 +61,7 @@ const StatusTime: FC<IStatusTimeProps> = ({ deadLine, isLongTerm, isCancel, isCo
|
|
|
61
61
|
if (isLongTerm) return getLocale('Pro_newpro_LongTerm');
|
|
62
62
|
|
|
63
63
|
if (isRemainLessThan30Days && remainDays > 0 && !isComplete && !isCancel) {
|
|
64
|
-
return `${
|
|
64
|
+
return isEn ? `${remainDays} day(s)` : `剩余${remainDays}天`;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
return `${deadDate.year !== new Date().getFullYear() ? deadDate.year + '/' : ''}${deadDate.month}/${deadDate.day}`;
|
|
@@ -1,44 +1,37 @@
|
|
|
1
1
|
import React, { useState, useRef } from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import Cropper from 'react-cropper';
|
|
4
|
-
import 'cropperjs/dist/cropper.css';
|
|
5
4
|
import Toast from '../../components/toast';
|
|
6
5
|
import ConditionRender from '../condition-render';
|
|
7
6
|
import { saveTenantLogo, saveBrowserIcon, saveUserPhoto } from './request-api';
|
|
8
7
|
import Dialog from '../../components/dialog';
|
|
9
|
-
import { List } from './constant'
|
|
8
|
+
import { List } from './constant';
|
|
9
|
+
import 'cropperjs/dist/cropper.css';
|
|
10
10
|
import './index.scss';
|
|
11
|
-
import uuid from 'uuid';
|
|
12
|
-
import { getBSGlobal, getUserInfo, getTenantInfo } from '../../utils/bs-global';
|
|
13
|
-
const apiServer = getBSGlobal("apiPath")
|
|
14
|
-
const userid = getUserInfo().Id;
|
|
15
|
-
const tenantId = getTenantInfo().Id
|
|
16
|
-
|
|
17
11
|
|
|
18
12
|
const preCls = 'tita-ui-change-person-photo';
|
|
19
|
-
|
|
20
13
|
interface Props {
|
|
21
14
|
visible: boolean;
|
|
22
15
|
type: string; // person enterprise browser
|
|
23
16
|
onCancel: Function;
|
|
17
|
+
handleSuccessUploadPhoto: Function;
|
|
24
18
|
}
|
|
25
19
|
|
|
26
20
|
const ChangePhoto = (props: Props) => {
|
|
27
|
-
const { visible, onCancel, type = '
|
|
21
|
+
const { visible, onCancel, type = 'person', handleSuccessUploadPhoto } = props;
|
|
28
22
|
|
|
29
23
|
const modalRef = useRef<any>();
|
|
24
|
+
const cropperRef = useRef<HTMLImageElement>(null);
|
|
30
25
|
|
|
31
26
|
const [ image, setImage ] = useState('');
|
|
32
27
|
const [ cropper, setCropper ] = useState<any>();
|
|
33
28
|
const [ cropData, setCropData ] = useState('#');
|
|
34
|
-
const [
|
|
35
|
-
const [
|
|
36
|
-
const [fileName, setFileName] = useState('')
|
|
37
|
-
|
|
38
|
-
const cropperRef = useRef<HTMLImageElement>(null);
|
|
29
|
+
const [ isEnter, setIsEnter ] = useState(false);
|
|
30
|
+
const [ fileName, setFileName ] = useState('')
|
|
39
31
|
|
|
32
|
+
const item = List.find(item => item.id === type)
|
|
33
|
+
|
|
40
34
|
const onChange = (e: any) => {
|
|
41
|
-
e.preventDefault();
|
|
42
35
|
let files;
|
|
43
36
|
if (e.dataTransfer) {
|
|
44
37
|
files = e.dataTransfer.files;
|
|
@@ -81,36 +74,37 @@ const ChangePhoto = (props: Props) => {
|
|
|
81
74
|
setCropper(formData);
|
|
82
75
|
};
|
|
83
76
|
|
|
77
|
+
const handleSuccessSave = (resp) => {
|
|
78
|
+
if (resp.Code === 1) {
|
|
79
|
+
Toast.Success('保存成功', {
|
|
80
|
+
style: { position: "fixed", top: " 36px", left: "50%" },
|
|
81
|
+
});
|
|
82
|
+
onCancel();
|
|
83
|
+
setImage('');
|
|
84
|
+
handleSuccessUploadPhoto(cropData);
|
|
85
|
+
} else {
|
|
86
|
+
Toast.Error(resp.Message, {
|
|
87
|
+
style: { position: "fixed", top: " 36px", left: "50%" },
|
|
88
|
+
});
|
|
89
|
+
setImage('');
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
84
93
|
const handleSaveInfo = () => {
|
|
85
94
|
if (!image) {
|
|
86
95
|
return;
|
|
87
96
|
} else {
|
|
88
97
|
if(type === "person") {
|
|
89
98
|
saveUserPhoto(cropper).then((resp) => {
|
|
90
|
-
|
|
91
|
-
Toast.Success('保存成功', { canClose: false });
|
|
92
|
-
onCancel();
|
|
93
|
-
} else {
|
|
94
|
-
Toast.Error(resp.Message, { canClose: false });
|
|
95
|
-
}
|
|
99
|
+
handleSuccessSave(resp);
|
|
96
100
|
});
|
|
97
101
|
} else if(type === "enterprise") {
|
|
98
102
|
saveTenantLogo( cropper ).then((resp) => {
|
|
99
|
-
|
|
100
|
-
Toast.Success('保存成功', { canClose: false });
|
|
101
|
-
onCancel();
|
|
102
|
-
} else {
|
|
103
|
-
Toast.Error(resp.Message, { canClose: false });
|
|
104
|
-
}
|
|
103
|
+
handleSuccessSave(resp);
|
|
105
104
|
});
|
|
106
105
|
} else {
|
|
107
106
|
saveBrowserIcon( cropper ).then((resp) => {
|
|
108
|
-
|
|
109
|
-
Toast.Success('保存成功', { canClose: false });
|
|
110
|
-
onCancel();
|
|
111
|
-
} else {
|
|
112
|
-
Toast.Error(resp.Message, { canClose: false });
|
|
113
|
-
}
|
|
107
|
+
handleSuccessSave(resp);
|
|
114
108
|
});
|
|
115
109
|
}
|
|
116
110
|
}
|
|
@@ -124,6 +118,11 @@ const ChangePhoto = (props: Props) => {
|
|
|
124
118
|
setIsEnter(false);
|
|
125
119
|
}
|
|
126
120
|
|
|
121
|
+
const handleCancel = () => {
|
|
122
|
+
onCancel();
|
|
123
|
+
setImage('');
|
|
124
|
+
}
|
|
125
|
+
|
|
127
126
|
return (
|
|
128
127
|
<Dialog
|
|
129
128
|
visible={visible}
|
|
@@ -134,8 +133,8 @@ const ChangePhoto = (props: Props) => {
|
|
|
134
133
|
title={'上传头像'}
|
|
135
134
|
noHeadLine
|
|
136
135
|
maskClosable={false}
|
|
137
|
-
onClose={
|
|
138
|
-
onCancel={
|
|
136
|
+
onClose={handleCancel}
|
|
137
|
+
onCancel={handleCancel}
|
|
139
138
|
okText="保存"
|
|
140
139
|
noFooterLine
|
|
141
140
|
onOk={handleSaveInfo}
|
|
@@ -153,19 +152,9 @@ const ChangePhoto = (props: Props) => {
|
|
|
153
152
|
accept={item?.accept}
|
|
154
153
|
/>
|
|
155
154
|
<span className={`${preCls}__upload-right-title`}>点击上传</span>
|
|
156
|
-
<
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
</span>
|
|
160
|
-
</ConditionRender>
|
|
161
|
-
<ConditionRender condition={type === 'enterprise'}>
|
|
162
|
-
<span className={`${preCls}__upload-right-tips`}>
|
|
163
|
-
{item?.tips}
|
|
164
|
-
</span>
|
|
165
|
-
</ConditionRender>
|
|
166
|
-
<ConditionRender condition={type === 'browser'}>
|
|
167
|
-
<span className={`${preCls}__upload-right-tips`}>{item?.tips}</span>
|
|
168
|
-
</ConditionRender>
|
|
155
|
+
<span className={`${preCls}__upload-right-tips`}>
|
|
156
|
+
{item?.tips}
|
|
157
|
+
</span>
|
|
169
158
|
</div>
|
|
170
159
|
</div>
|
|
171
160
|
<div className={`${preCls}__upload-left`}>
|
|
@@ -174,11 +163,7 @@ const ChangePhoto = (props: Props) => {
|
|
|
174
163
|
<div className={`${preCls}__upload-left-box2`} />
|
|
175
164
|
<div className={`${preCls}__upload-left-box3`} />
|
|
176
165
|
</ConditionRender>
|
|
177
|
-
<ConditionRender condition={type === 'enterprise'}>
|
|
178
|
-
<div className={`${preCls}__upload-left-box`} />
|
|
179
|
-
<span className={`${preCls}__upload-left-preview`}>{item?.previewTitle}</span>
|
|
180
|
-
</ConditionRender>
|
|
181
|
-
<ConditionRender condition={type === 'browser'}>
|
|
166
|
+
<ConditionRender condition={type === 'enterprise' || type === 'browser'}>
|
|
182
167
|
<div className={`${preCls}__upload-left-box`} />
|
|
183
168
|
<span className={`${preCls}__upload-left-preview`}>{item?.previewTitle}</span>
|
|
184
169
|
</ConditionRender>
|
|
@@ -203,9 +188,9 @@ const ChangePhoto = (props: Props) => {
|
|
|
203
188
|
/>
|
|
204
189
|
<div className={classNames(`${preCls}__preview-box`, {[`${preCls}__preview-box-bgc`]:type === "enterprise"}, {[`${preCls}__preview-box-browser`]:type === "browser"})}>
|
|
205
190
|
<ConditionRender condition={type === "person"}>
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
191
|
+
<img src={cropData} className={`${preCls}__preview-box1`} />
|
|
192
|
+
<img src={cropData} className={`${preCls}__preview-box2`} />
|
|
193
|
+
<img src={cropData} className={`${preCls}__preview-box3`} />
|
|
209
194
|
</ConditionRender>
|
|
210
195
|
<ConditionRender condition={type === "enterprise"}>
|
|
211
196
|
<img src={cropData} className={`${preCls}__preview-enterprise-img`}/>
|
|
@@ -120,7 +120,7 @@ export const searchGroups = ({ searchKey }) => {
|
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
export const getDuties = () => {
|
|
123
|
-
return axios.get(`${requestDomain()}/api/v1/${tenantId}/${userId}/position/get?status=1&pageNum=1&pageSize=
|
|
123
|
+
return axios.get(`${requestDomain()}/api/v1/${tenantId}/${userId}/position/get?status=1&pageNum=1&pageSize=1000`)
|
|
124
124
|
.then(res => {
|
|
125
125
|
return res.data;
|
|
126
126
|
})
|
|
@@ -88,7 +88,7 @@ const LikeRanking: FC = () => {
|
|
|
88
88
|
} else if (item == getLocale('Feed_Tab_Title_Thisweek')) {
|
|
89
89
|
createDate = showWeekFirstDay();
|
|
90
90
|
endDate = showNextWeekFirstDay();
|
|
91
|
-
} else if (item ==
|
|
91
|
+
} else if (item == getLocale('Feed_Tab_Title_Thisyear')) {
|
|
92
92
|
createDate = getFirstDayOfYear();
|
|
93
93
|
endDate = getNextDayOfYear();
|
|
94
94
|
}
|
|
@@ -97,7 +97,7 @@ const LikeRanking: FC = () => {
|
|
|
97
97
|
};
|
|
98
98
|
|
|
99
99
|
const TabBar = () => {
|
|
100
|
-
const typeData = [`${getLocale('Mod_all')}`, `${getLocale('Feed_Tab_Title_Thisweek')}`, `${getLocale('Tasks_Menu_Thismonth')}`,
|
|
100
|
+
const typeData = [`${getLocale('Mod_all')}`, `${getLocale('Feed_Tab_Title_Thisweek')}`, `${getLocale('Tasks_Menu_Thismonth')}`, getLocale('Feed_Tab_Title_Thisyear')];
|
|
101
101
|
return (
|
|
102
102
|
<div className={`${preCls}__tab-bar`}>
|
|
103
103
|
{typeData.map((item, key) => {
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
background: #ffffff;
|
|
3
3
|
box-shadow: 0px 0px 8px 0px rgba(127, 145, 180, 0.1);
|
|
4
4
|
border-radius: 12px;
|
|
5
|
-
padding: 20px 32px;
|
|
5
|
+
padding: 20px 32px 30px 36px;
|
|
6
6
|
font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica,
|
|
7
7
|
sans-serif, PingFang SC, Microsoft YaHei;
|
|
8
8
|
&__header {
|
|
9
9
|
display: flex;
|
|
10
10
|
align-items: center;
|
|
11
11
|
justify-content: space-between;
|
|
12
|
-
margin-bottom:
|
|
12
|
+
margin-bottom: 20px;
|
|
13
13
|
&-title {
|
|
14
14
|
font-size: 16px;
|
|
15
15
|
font-weight: 600;
|
|
@@ -26,10 +26,25 @@
|
|
|
26
26
|
border-radius: 2px;
|
|
27
27
|
display: inline-block;
|
|
28
28
|
position: absolute;
|
|
29
|
-
left: -
|
|
29
|
+
left: -12px;
|
|
30
30
|
top: 3px;
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
+
.titaui-rect-btn--primary {
|
|
34
|
+
font-size: 14px;
|
|
35
|
+
font-weight: normal;
|
|
36
|
+
color: #2879FF;
|
|
37
|
+
line-height: 26px;
|
|
38
|
+
background: rgba(40, 121, 255, 0.2);
|
|
39
|
+
&:hover {
|
|
40
|
+
color: #fff;
|
|
41
|
+
background-color: #2879ff;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
.titaui-rect-btn--normal {
|
|
45
|
+
height: 28px;
|
|
46
|
+
min-width: 64px;
|
|
47
|
+
}
|
|
33
48
|
&-btn {
|
|
34
49
|
width: 64px;
|
|
35
50
|
height: 28px;
|
|
@@ -49,6 +64,12 @@
|
|
|
49
64
|
}
|
|
50
65
|
&__form {
|
|
51
66
|
width: 342px;
|
|
67
|
+
.form-field-input__border--disabled input:disabled {
|
|
68
|
+
color: #6F7886;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
.form-field-input__label {
|
|
72
|
+
margin-bottom: 4px;
|
|
52
73
|
}
|
|
53
74
|
.form-field-input__border {
|
|
54
75
|
padding: 0;
|
|
@@ -59,6 +80,8 @@
|
|
|
59
80
|
font-weight: 600;
|
|
60
81
|
}
|
|
61
82
|
.form-field-input__input {
|
|
83
|
+
font-size: 12px;
|
|
84
|
+
line-height: 18px;
|
|
62
85
|
background-color: #fff;
|
|
63
86
|
}
|
|
64
87
|
.form-field-input__border--disabled input:disabled {
|
|
@@ -2,7 +2,8 @@ import React, { FC, useState, useRef, useEffect } from "react";
|
|
|
2
2
|
import Form from "../../../../components/form";
|
|
3
3
|
import { getUserInfoFun } from "../../request-api";
|
|
4
4
|
import { getLocale } from "../../../../utils/getLocale";
|
|
5
|
-
import EditModle from '../edit-info'
|
|
5
|
+
import EditModle from '../edit-base-info'
|
|
6
|
+
import { RectBtn } from "../../../../components/button";
|
|
6
7
|
import "./index.scss";
|
|
7
8
|
|
|
8
9
|
const {Fields} = Form
|
|
@@ -21,6 +22,10 @@ const BaseInfo: FC = () => {
|
|
|
21
22
|
setVisible(false);
|
|
22
23
|
}
|
|
23
24
|
|
|
25
|
+
const handleSuccessEditBaseInfo = (userInfo) => {
|
|
26
|
+
setUserInfo({...userInfo});
|
|
27
|
+
}
|
|
28
|
+
|
|
24
29
|
useEffect(() => {
|
|
25
30
|
getUserInfoFun().then((resp) => {
|
|
26
31
|
if (resp.Code === 1 && resp.Data) {
|
|
@@ -33,8 +38,12 @@ const BaseInfo: FC = () => {
|
|
|
33
38
|
<div className={prefix}>
|
|
34
39
|
<div className={`${prefix}__header`}>
|
|
35
40
|
<span className={`${prefix}__header-title`}>{getLocale('Per_Ass_New_title_text_BasicIn')}</span>
|
|
36
|
-
<
|
|
37
|
-
|
|
41
|
+
<RectBtn
|
|
42
|
+
type={"primary"}
|
|
43
|
+
text={getLocale('Mod_Editor')}
|
|
44
|
+
onClick={handleClickEdit}
|
|
45
|
+
/>
|
|
46
|
+
<EditModle visible={visible} onCancel={handleCancelEdit} handleSuccessEditBaseInfo={handleSuccessEditBaseInfo}/>
|
|
38
47
|
</div>
|
|
39
48
|
<div className={`${prefix}__form`}>
|
|
40
49
|
<Form ref={formRef}>
|
|
@@ -11,7 +11,7 @@ const { Fields } = Form;
|
|
|
11
11
|
const prefix = "titaui-edit-personal-info"
|
|
12
12
|
|
|
13
13
|
const EditBaseInfo = (props) => {
|
|
14
|
-
const { visible, onCancel } = props;
|
|
14
|
+
const { visible, onCancel, handleSuccessEditBaseInfo } = props;
|
|
15
15
|
|
|
16
16
|
const modalRef = useRef<any>();
|
|
17
17
|
const formContainerRef = useRef<any>();
|
|
@@ -53,10 +53,8 @@ const EditBaseInfo = (props) => {
|
|
|
53
53
|
saveUserInfo({ data: userInfo }).then((resp) => {
|
|
54
54
|
if (resp.Code === 1) {
|
|
55
55
|
Toast.Success('更新成功', { canClose: false });
|
|
56
|
+
handleSuccessEditBaseInfo(userInfo);
|
|
56
57
|
onCancel();
|
|
57
|
-
setTimeout(() => {
|
|
58
|
-
window.location.reload();
|
|
59
|
-
}, 2000)
|
|
60
58
|
} else {
|
|
61
59
|
Toast.Error(resp.Message, { canClose: false });
|
|
62
60
|
}
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
background: #ffffff;
|
|
3
3
|
box-shadow: 0px 0px 8px 0px rgba(127, 145, 180, 0.1);
|
|
4
4
|
border-radius: 12px;
|
|
5
|
-
padding: 20px 32px;
|
|
5
|
+
padding: 20px 32px 30px 36px;
|
|
6
6
|
margin-top: 10px;
|
|
7
7
|
font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-serif, PingFang SC, Microsoft YaHei;
|
|
8
8
|
&__header {
|
|
9
9
|
display: flex;
|
|
10
10
|
align-items: center;
|
|
11
11
|
justify-content: space-between;
|
|
12
|
-
margin-bottom:
|
|
12
|
+
margin-bottom: 20px;
|
|
13
13
|
&-title {
|
|
14
14
|
font-size: 16px;
|
|
15
15
|
font-weight: 600;
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
border-radius: 2px;
|
|
27
27
|
display: inline-block;
|
|
28
28
|
position: absolute;
|
|
29
|
-
left: -
|
|
29
|
+
left: -12px;
|
|
30
30
|
top: 3px;
|
|
31
31
|
}
|
|
32
32
|
}
|
|
@@ -46,11 +46,23 @@
|
|
|
46
46
|
color: #FFFFFF;
|
|
47
47
|
line-height: 18px;
|
|
48
48
|
}
|
|
49
|
-
|
|
50
|
-
margin-left:
|
|
49
|
+
&-tip {
|
|
50
|
+
margin-left: 32px;
|
|
51
51
|
font-size: 12px;
|
|
52
52
|
color: #A4ACB9;
|
|
53
53
|
line-height: 20px;
|
|
54
|
+
position: relative;
|
|
55
|
+
&::before {
|
|
56
|
+
display: block;
|
|
57
|
+
content: '';
|
|
58
|
+
width: 4px;
|
|
59
|
+
height: 4px;
|
|
60
|
+
background: #A4ACB9;
|
|
61
|
+
position: absolute;
|
|
62
|
+
top: 7px;
|
|
63
|
+
left: -12px;
|
|
64
|
+
border-radius: 50%;
|
|
65
|
+
}
|
|
54
66
|
}
|
|
55
67
|
}
|
|
56
68
|
.titaui-pc-avator-container {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react';
|
|
2
|
-
import classNames from 'classnames';
|
|
3
2
|
import { getUserInfo } from '../../../../utils/bs-global';
|
|
4
3
|
import Avatar from '../../../../components/avatar';
|
|
5
4
|
import ChangePhotoModal from '../../../../components/upload-photo-modal';
|
|
@@ -12,6 +11,7 @@ const { Id, Name, UserAvatar } = getUserInfo();
|
|
|
12
11
|
const PersonPhoto = () => {
|
|
13
12
|
|
|
14
13
|
const [visible, setVisible] = useState(false);
|
|
14
|
+
const [avatar, setAvatar] = useState('');
|
|
15
15
|
|
|
16
16
|
const handleChangePhoto = () => {
|
|
17
17
|
setVisible(true);
|
|
@@ -21,6 +21,14 @@ const PersonPhoto = () => {
|
|
|
21
21
|
setVisible(false);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
const handleSuccessUploadPhoto = (image) => {
|
|
25
|
+
setAvatar(image);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
setAvatar(UserAvatar.Large)
|
|
30
|
+
}, [])
|
|
31
|
+
|
|
24
32
|
return (
|
|
25
33
|
<div className={prefix}>
|
|
26
34
|
<div className={`${prefix}__header`}>
|
|
@@ -31,7 +39,7 @@ const PersonPhoto = () => {
|
|
|
31
39
|
userId={Id}
|
|
32
40
|
name={Name}
|
|
33
41
|
color={UserAvatar.Color}
|
|
34
|
-
src={
|
|
42
|
+
src={avatar}
|
|
35
43
|
size={{
|
|
36
44
|
width: 160,
|
|
37
45
|
textNum: 1,
|
|
@@ -39,9 +47,9 @@ const PersonPhoto = () => {
|
|
|
39
47
|
}}
|
|
40
48
|
onClick={handleChangePhoto}
|
|
41
49
|
/>
|
|
42
|
-
<span
|
|
50
|
+
<span className={`${prefix}__main-tip`}>建议图片最小尺寸 150*150px</span>
|
|
43
51
|
</div>
|
|
44
|
-
<ChangePhotoModal visible={visible} onCancel={handleCancel} type="person"/>
|
|
52
|
+
<ChangePhotoModal visible={visible} onCancel={handleCancel} type="person" handleSuccessUploadPhoto={handleSuccessUploadPhoto}/>
|
|
45
53
|
</div>
|
|
46
54
|
);
|
|
47
55
|
};
|
package/src/utils/getLocale.ts
CHANGED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
.edit-base-info-input {
|
|
2
|
-
display: flex;
|
|
3
|
-
box-sizing: border-box;
|
|
4
|
-
padding: 0 32px;
|
|
5
|
-
align-items: center;
|
|
6
|
-
margin-bottom: 16px;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.edit-base-info-input__label {
|
|
10
|
-
width: 56px;
|
|
11
|
-
height: 22px;
|
|
12
|
-
font-size: 14px;
|
|
13
|
-
margin-bottom: 5px;
|
|
14
|
-
margin-right: 20px;
|
|
15
|
-
font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-serif, PingFang SC, Microsoft YaHei;
|
|
16
|
-
font-weight: 400;
|
|
17
|
-
line-height: 22px;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.edit-base-info-input__label-text {
|
|
21
|
-
color: #89919F;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.edit-base-info-input__label-require {
|
|
25
|
-
color: red;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.edit-base-info-input__border {
|
|
29
|
-
flex: 1;
|
|
30
|
-
padding: 6px 12px;
|
|
31
|
-
transition: all 0.2s;
|
|
32
|
-
border: 1px solid #e9ecf0;
|
|
33
|
-
box-sizing: border-box;
|
|
34
|
-
border-radius: 8px;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.edit-base-info-input__border--disabled {
|
|
38
|
-
background-color: #fafafa;
|
|
39
|
-
cursor: not-allowed;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.edit-base-info-input__border--disabled input:disabled {
|
|
43
|
-
background-color: #fafafa;
|
|
44
|
-
cursor: not-allowed;
|
|
45
|
-
color: #3f475594;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.edit-base-info-input__border--error {
|
|
49
|
-
box-shadow: inset 0px 0px 4px 0px rgba(240, 94, 94, 0.3) !important;
|
|
50
|
-
border: 1px solid #f05e5e !important;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.edit-base-info-input__border--active {
|
|
54
|
-
box-shadow: inset 0px 0px 4px 0px rgba(40, 121, 255, 0.3);
|
|
55
|
-
border: 1px solid #2879ff;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.edit-base-info-input__input {
|
|
59
|
-
display: inline-block;
|
|
60
|
-
padding: 0;
|
|
61
|
-
width: calc(100% - 12px);
|
|
62
|
-
font-size: 14px;
|
|
63
|
-
font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-serif, PingFang SC, Microsoft YaHei;
|
|
64
|
-
font-weight: 400;
|
|
65
|
-
color: #3f4755;
|
|
66
|
-
height: 22px;
|
|
67
|
-
line-height: inherit;
|
|
68
|
-
border: none;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.edit-base-info-input__input::-webkit-input-placeholder {
|
|
72
|
-
color: #bfc7d5;
|
|
73
|
-
font-weight: unset;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.edit-base-info-input__input::-moz-placeholder {
|
|
77
|
-
color: #bfc7d5;
|
|
78
|
-
font-weight: unset;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
.edit-base-info-input__input:-moz-placeholder {
|
|
82
|
-
color: #bfc7d5;
|
|
83
|
-
font-weight: unset;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.edit-base-info-input__input:-ms-input-placeholder {
|
|
87
|
-
color: #bfc7d5;
|
|
88
|
-
font-weight: unset;
|
|
89
|
-
}
|