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
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
55 deletions
+34
-55
MyPopconfirm.tsx
src/components/mui/MyPopconfirm.tsx
+2
-2
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) => {
bgcolor
:
"#fff"
,
minWidth
:
"200px"
,
borderRadius
:
"4px"
,
fontSize
:
"14px"
,
fontSize
:
"14px"
,
padding
:
"20px 16px"
,
boxShadow
:
"0px 3px 10px 0px rgba(0, 24, 57, 0.14)"
,
}
}
...
...
@@ -97,7 +97,7 @@ const MyPopconfirm = (props: IMyPopconfirmProps) => {
style=
{
{
marginRight
:
"12px"
}
}
/>
)
}
<
MyButton
text=
{
okText
}
onClick=
{
handleOk
}
/>
<
MyButton
text=
{
okText
}
onClick=
{
handleOk
}
/>
</
Box
>
</
Popper
>
);
...
...
src/views/Project/ProjectSetting/BaseInfo/index.tsx
View file @
d701429c
...
...
@@ -21,7 +21,6 @@ import { toJS } from "mobx";
import
{
observer
}
from
"mobx-react-lite"
;
import
InformationDisplay
from
"@/components/CommonComponents/InformationDisplay"
;
import
classnames
from
"classnames"
;
import
{
TextField
}
from
"@mui/material"
;
import
LoadingButton
from
"@mui/lab/LoadingButton"
;
import
InputAdornment
from
"@mui/material/InputAdornment"
;
import
{
useMessage
}
from
"@/components/MySnackbar"
;
...
...
@@ -29,11 +28,8 @@ import Loading from "@/views/Loading";
import
MyDialog
from
"@/components/mui/MyDialog"
;
import
{
getProjectList
}
from
"../../project"
;
import
{
checkIsNumberLetterChinese
}
from
"@/utils/util"
;
import
{
setFileServerEndPointLocalStorage
,
getFiletokenAccordingToId
,
}
from
"@/views/Project/project"
;
import
MyButton
from
"@/components/mui/MyButton"
;
import
MySelect
,
{
optionsTransform
}
from
"@/components/mui/MySelect"
;
import
MyInput
from
"@/components/mui/MyInput"
;
type
zoneIdOption
=
{
...
...
@@ -205,7 +201,11 @@ const BaseInfo = observer(() => {
showMessage
&&
message
.
error
(
help
);
return
false
;
}
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之间的数值,结果最高保留两位小数。"
;
setBudgetCheck
({
error
:
true
,
...
...
@@ -229,7 +229,7 @@ const BaseInfo = observer(() => {
showMessage
&&
message
.
error
(
help
);
return
false
;
}
}
}
;
const
budgetChange
=
(
e
:
any
)
=>
{
setProjectInfo
({
...
...
@@ -237,13 +237,16 @@ const BaseInfo = observer(() => {
projectBudget
:
e
.
target
.
value
,
});
checkBudget
(
e
.
target
.
value
);
}
}
;
const
budgetBlur
=
(
e
:
any
)
=>
{
if
(
e
.
target
.
value
.
indexOf
(
" "
)
==
-
1
&&
e
.
target
.
value
)
{
if
(
e
.
target
.
value
.
indexOf
(
" "
)
==
=
-
1
&&
e
.
target
.
value
)
{
setProjectInfo
({
...
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(() => {
// 修改项目
const
handleClickUpdate
=
()
=>
{
if
(
checkName
(
projectInfo
.
name
,
true
)
&&
checkBudget
(
projectInfo
.
projectBudget
,
true
))
{
if
(
checkName
(
projectInfo
.
name
,
true
)
&&
checkBudget
(
projectInfo
.
projectBudget
,
true
)
)
{
updateProjectRun
({
...
projectInfo
,
product
:
"cadd"
});
}
else
{
return
;
...
...
@@ -276,20 +282,9 @@ const BaseInfo = observer(() => {
const
projectList
=
await
getProjectList
();
currentProjectStore
.
setProjectList
(
projectList
);
// 项目删完了
// if (projectList.length === 0) {
currentProjectStore
.
changeProject
({});
localStorage
.
setItem
(
"fileServerEndPoint"
,
""
);
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(() => {
placeholder=
"项目描述限制300字以内"
maxLength=
{
300
}
></
textarea
>
{
/* <MyInput
value={projectInfo.desc}
multiline
rows={4}
placeholder="项目描述限制100字以内"
onChange={descChange}
/> */
}
</
div
>
<
div
className=
{
style
.
projectInfoListLi
}
>
<
div
className=
{
style
.
projectInfoListLiLabel
}
>
计算区
</
div
>
<
s
elect
<
MyS
elect
value=
{
projectInfo
.
zoneId
}
disabled
className=
{
classnames
({
[
style
.
projectInfoListLiValue
]:
true
,
[
style
.
projectInfoSelect
]:
true
,
[
style
.
disable
]:
true
,
})
}
>
{
zoneIdOptions
.
map
((
option
)
=>
(
<
option
key=
{
option
.
id
}
value=
{
option
.
id
}
>
{
option
.
name
}
</
option
>
))
}
</
select
>
options=
{
optionsTransform
(
zoneIdOptions
,
"name"
,
"id"
)
}
sx=
{
{
width
:
"560px"
}
}
></
MySelect
>
</
div
>
<
div
className=
{
style
.
projectInfoListLi
}
>
<
div
className=
{
style
.
projectInfoListLiLabel
}
>
创建人
</
div
>
...
...
@@ -410,8 +389,8 @@ const BaseInfo = observer(() => {
padding
:
"6.5px 2px"
,
},
"& .MuiTypography-root"
:
{
fontSize
:
'14px'
}
fontSize
:
"14px"
,
}
,
}
}
/>
</
div
>
...
...
@@ -425,32 +404,32 @@ const BaseInfo = observer(() => {
</
div
>
<
div
className=
{
style
.
projectInfoListLi
}
>
<
LoadingButton
variant=
"
outl
ined"
variant=
"
conta
ined"
className=
{
style
.
updateButton
}
onClick=
{
handleClickUpdate
}
loading=
{
updateLoading
}
sx=
{
{
height
:
"32px"
height
:
"32px"
,
}
}
>
保存修改
</
LoadingButton
>
</
div
>
<
div
className=
{
style
.
projectInfoListLi
}
>
<
div
className=
{
style
.
projectInfoListLiLabel
}
>
删除项目
</
div
>
<
div
className=
{
style
.
projectInfoListLiLabel
}
style=
{
{
paddingTop
:
"12px"
}
}
>
删除项目
</
div
>
<
div
className=
{
style
.
projectInfoListLiText
}
>
删除项目将删除其存储的数据和所有相关资源,并且已删除的项目无法恢复!请谨慎操作!
</
div
>
<
MyButton
text=
"删除项目"
variant=
"
conta
ined"
variant=
"
outl
ined"
onClick=
{
()
=>
setDialogOpen
(
true
)
}
color=
"error"
// style={{
// backgroundColor: "#fff",
// color: "#FF4E4E",
// border: "1px solid #FF4E4E",
// }}
/>
</
div
>
<
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