Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
bkunyun
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
bkunyun
Commits
d701429c
Commit
d701429c
authored
Aug 12, 2022
by
chenshouchao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 基础信息样式修改
parent
87a6abe5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
54 deletions
+33
-54
MyPopconfirm.tsx
src/components/mui/MyPopconfirm.tsx
+1
-1
index.tsx
src/views/Project/ProjectSetting/BaseInfo/index.tsx
+32
-53
No files found.
src/components/mui/MyPopconfirm.tsx
View file @
d701429c
...
@@ -69,7 +69,7 @@ const MyPopconfirm = (props: IMyPopconfirmProps) => {
...
@@ -69,7 +69,7 @@ const MyPopconfirm = (props: IMyPopconfirmProps) => {
bgcolor
:
"#fff"
,
bgcolor
:
"#fff"
,
minWidth
:
"200px"
,
minWidth
:
"200px"
,
borderRadius
:
"4px"
,
borderRadius
:
"4px"
,
fontSize
:
"14px"
,
fontSize
:
"14px"
,
padding
:
"20px 16px"
,
padding
:
"20px 16px"
,
boxShadow
:
"0px 3px 10px 0px rgba(0, 24, 57, 0.14)"
,
boxShadow
:
"0px 3px 10px 0px rgba(0, 24, 57, 0.14)"
,
}
}
}
}
...
...
src/views/Project/ProjectSetting/BaseInfo/index.tsx
View file @
d701429c
...
@@ -21,7 +21,6 @@ import { toJS } from "mobx";
...
@@ -21,7 +21,6 @@ import { toJS } from "mobx";
import
{
observer
}
from
"mobx-react-lite"
;
import
{
observer
}
from
"mobx-react-lite"
;
import
InformationDisplay
from
"@/components/CommonComponents/InformationDisplay"
;
import
InformationDisplay
from
"@/components/CommonComponents/InformationDisplay"
;
import
classnames
from
"classnames"
;
import
classnames
from
"classnames"
;
import
{
TextField
}
from
"@mui/material"
;
import
LoadingButton
from
"@mui/lab/LoadingButton"
;
import
LoadingButton
from
"@mui/lab/LoadingButton"
;
import
InputAdornment
from
"@mui/material/InputAdornment"
;
import
InputAdornment
from
"@mui/material/InputAdornment"
;
import
{
useMessage
}
from
"@/components/MySnackbar"
;
import
{
useMessage
}
from
"@/components/MySnackbar"
;
...
@@ -29,11 +28,8 @@ import Loading from "@/views/Loading";
...
@@ -29,11 +28,8 @@ import Loading from "@/views/Loading";
import
MyDialog
from
"@/components/mui/MyDialog"
;
import
MyDialog
from
"@/components/mui/MyDialog"
;
import
{
getProjectList
}
from
"../../project"
;
import
{
getProjectList
}
from
"../../project"
;
import
{
checkIsNumberLetterChinese
}
from
"@/utils/util"
;
import
{
checkIsNumberLetterChinese
}
from
"@/utils/util"
;
import
{
setFileServerEndPointLocalStorage
,
getFiletokenAccordingToId
,
}
from
"@/views/Project/project"
;
import
MyButton
from
"@/components/mui/MyButton"
;
import
MyButton
from
"@/components/mui/MyButton"
;
import
MySelect
,
{
optionsTransform
}
from
"@/components/mui/MySelect"
;
import
MyInput
from
"@/components/mui/MyInput"
;
import
MyInput
from
"@/components/mui/MyInput"
;
type
zoneIdOption
=
{
type
zoneIdOption
=
{
...
@@ -205,7 +201,11 @@ const BaseInfo = observer(() => {
...
@@ -205,7 +201,11 @@ const BaseInfo = observer(() => {
showMessage
&&
message
.
error
(
help
);
showMessage
&&
message
.
error
(
help
);
return
false
;
return
false
;
}
else
if
(
budget
)
{
}
else
if
(
budget
)
{
if
(
isNaN
(
Number
(
budget
))
||
Number
(
budget
)
>
10000000
||
Number
(
budget
)
<
0
)
{
if
(
isNaN
(
Number
(
budget
))
||
Number
(
budget
)
>
10000000
||
Number
(
budget
)
<
0
)
{
help
=
"格式错误,请输入0~10000000之间的数值,结果最高保留两位小数。"
;
help
=
"格式错误,请输入0~10000000之间的数值,结果最高保留两位小数。"
;
setBudgetCheck
({
setBudgetCheck
({
error
:
true
,
error
:
true
,
...
@@ -229,7 +229,7 @@ const BaseInfo = observer(() => {
...
@@ -229,7 +229,7 @@ const BaseInfo = observer(() => {
showMessage
&&
message
.
error
(
help
);
showMessage
&&
message
.
error
(
help
);
return
false
;
return
false
;
}
}
}
}
;
const
budgetChange
=
(
e
:
any
)
=>
{
const
budgetChange
=
(
e
:
any
)
=>
{
setProjectInfo
({
setProjectInfo
({
...
@@ -237,13 +237,16 @@ const BaseInfo = observer(() => {
...
@@ -237,13 +237,16 @@ const BaseInfo = observer(() => {
projectBudget
:
e
.
target
.
value
,
projectBudget
:
e
.
target
.
value
,
});
});
checkBudget
(
e
.
target
.
value
);
checkBudget
(
e
.
target
.
value
);
}
}
;
const
budgetBlur
=
(
e
:
any
)
=>
{
const
budgetBlur
=
(
e
:
any
)
=>
{
if
(
e
.
target
.
value
.
indexOf
(
" "
)
==
-
1
&&
e
.
target
.
value
)
{
if
(
e
.
target
.
value
.
indexOf
(
" "
)
==
=
-
1
&&
e
.
target
.
value
)
{
setProjectInfo
({
setProjectInfo
({
...
projectInfo
,
...
projectInfo
,
projectBudget
:
Number
(
e
.
target
.
value
)
||
Number
(
e
.
target
.
value
)
==
0
?
Number
(
e
.
target
.
value
).
toFixed
(
2
)
:
e
.
target
.
value
,
projectBudget
:
Number
(
e
.
target
.
value
)
||
Number
(
e
.
target
.
value
)
===
0
?
Number
(
e
.
target
.
value
).
toFixed
(
2
)
:
e
.
target
.
value
,
});
});
}
}
};
};
...
@@ -262,7 +265,10 @@ const BaseInfo = observer(() => {
...
@@ -262,7 +265,10 @@ const BaseInfo = observer(() => {
// 修改项目
// 修改项目
const
handleClickUpdate
=
()
=>
{
const
handleClickUpdate
=
()
=>
{
if
(
checkName
(
projectInfo
.
name
,
true
)
&&
checkBudget
(
projectInfo
.
projectBudget
,
true
))
{
if
(
checkName
(
projectInfo
.
name
,
true
)
&&
checkBudget
(
projectInfo
.
projectBudget
,
true
)
)
{
updateProjectRun
({
...
projectInfo
,
product
:
"cadd"
});
updateProjectRun
({
...
projectInfo
,
product
:
"cadd"
});
}
else
{
}
else
{
return
;
return
;
...
@@ -276,20 +282,9 @@ const BaseInfo = observer(() => {
...
@@ -276,20 +282,9 @@ const BaseInfo = observer(() => {
const
projectList
=
await
getProjectList
();
const
projectList
=
await
getProjectList
();
currentProjectStore
.
setProjectList
(
projectList
);
currentProjectStore
.
setProjectList
(
projectList
);
// 项目删完了
// 项目删完了
// if (projectList.length === 0) {
currentProjectStore
.
changeProject
({});
currentProjectStore
.
changeProject
({});
localStorage
.
setItem
(
"fileServerEndPoint"
,
""
);
localStorage
.
setItem
(
"fileServerEndPoint"
,
""
);
setProjectInfo
({});
setProjectInfo
({});
// } else {
// projectList[0].filetoken = getFiletokenAccordingToId(projectList[0].id);
// currentProjectStore.changeProject(projectList[0]);
// setFileServerEndPointLocalStorage(projectList[0].zoneId);
// getFiletokenAccordingToId(projectList[0].id).then((res) => {
// projectList[0].filetoken = res;
// currentProjectStore.changeProject(projectList[0]);
// });
// setProjectInfo(projectList[0]);
// }
},
},
});
});
...
@@ -352,31 +347,15 @@ const BaseInfo = observer(() => {
...
@@ -352,31 +347,15 @@ const BaseInfo = observer(() => {
placeholder=
"项目描述限制300字以内"
placeholder=
"项目描述限制300字以内"
maxLength=
{
300
}
maxLength=
{
300
}
></
textarea
>
></
textarea
>
{
/* <MyInput
value={projectInfo.desc}
multiline
rows={4}
placeholder="项目描述限制100字以内"
onChange={descChange}
/> */
}
</
div
>
</
div
>
<
div
className=
{
style
.
projectInfoListLi
}
>
<
div
className=
{
style
.
projectInfoListLi
}
>
<
div
className=
{
style
.
projectInfoListLiLabel
}
>
计算区
</
div
>
<
div
className=
{
style
.
projectInfoListLiLabel
}
>
计算区
</
div
>
<
s
elect
<
MyS
elect
value=
{
projectInfo
.
zoneId
}
value=
{
projectInfo
.
zoneId
}
disabled
disabled
className=
{
classnames
({
options=
{
optionsTransform
(
zoneIdOptions
,
"name"
,
"id"
)
}
[
style
.
projectInfoListLiValue
]:
true
,
sx=
{
{
width
:
"560px"
}
}
[
style
.
projectInfoSelect
]:
true
,
></
MySelect
>
[
style
.
disable
]:
true
,
})
}
>
{
zoneIdOptions
.
map
((
option
)
=>
(
<
option
key=
{
option
.
id
}
value=
{
option
.
id
}
>
{
option
.
name
}
</
option
>
))
}
</
select
>
</
div
>
</
div
>
<
div
className=
{
style
.
projectInfoListLi
}
>
<
div
className=
{
style
.
projectInfoListLi
}
>
<
div
className=
{
style
.
projectInfoListLiLabel
}
>
创建人
</
div
>
<
div
className=
{
style
.
projectInfoListLiLabel
}
>
创建人
</
div
>
...
@@ -410,8 +389,8 @@ const BaseInfo = observer(() => {
...
@@ -410,8 +389,8 @@ const BaseInfo = observer(() => {
padding
:
"6.5px 2px"
,
padding
:
"6.5px 2px"
,
},
},
"& .MuiTypography-root"
:
{
"& .MuiTypography-root"
:
{
fontSize
:
'14px'
fontSize
:
"14px"
,
}
}
,
}
}
}
}
/>
/>
</
div
>
</
div
>
...
@@ -425,32 +404,32 @@ const BaseInfo = observer(() => {
...
@@ -425,32 +404,32 @@ const BaseInfo = observer(() => {
</
div
>
</
div
>
<
div
className=
{
style
.
projectInfoListLi
}
>
<
div
className=
{
style
.
projectInfoListLi
}
>
<
LoadingButton
<
LoadingButton
variant=
"
outl
ined"
variant=
"
conta
ined"
className=
{
style
.
updateButton
}
className=
{
style
.
updateButton
}
onClick=
{
handleClickUpdate
}
onClick=
{
handleClickUpdate
}
loading=
{
updateLoading
}
loading=
{
updateLoading
}
sx=
{
{
sx=
{
{
height
:
"32px"
height
:
"32px"
,
}
}
}
}
>
>
保存修改
保存修改
</
LoadingButton
>
</
LoadingButton
>
</
div
>
</
div
>
<
div
className=
{
style
.
projectInfoListLi
}
>
<
div
className=
{
style
.
projectInfoListLi
}
>
<
div
className=
{
style
.
projectInfoListLiLabel
}
>
删除项目
</
div
>
<
div
className=
{
style
.
projectInfoListLiLabel
}
style=
{
{
paddingTop
:
"12px"
}
}
>
删除项目
</
div
>
<
div
className=
{
style
.
projectInfoListLiText
}
>
<
div
className=
{
style
.
projectInfoListLiText
}
>
删除项目将删除其存储的数据和所有相关资源,并且已删除的项目无法恢复!请谨慎操作!
删除项目将删除其存储的数据和所有相关资源,并且已删除的项目无法恢复!请谨慎操作!
</
div
>
</
div
>
<
MyButton
<
MyButton
text=
"删除项目"
text=
"删除项目"
variant=
"
conta
ined"
variant=
"
outl
ined"
onClick=
{
()
=>
setDialogOpen
(
true
)
}
onClick=
{
()
=>
setDialogOpen
(
true
)
}
color=
"error"
color=
"error"
// style={{
// backgroundColor: "#fff",
// color: "#FF4E4E",
// border: "1px solid #FF4E4E",
// }}
/>
/>
</
div
>
</
div
>
<
MyDialog
<
MyDialog
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment