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
c054d7f8
Commit
c054d7f8
authored
Aug 05, 2022
by
rocosen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:bug
parent
b08567c0
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
50 additions
and
37 deletions
+50
-37
NoProject.tsx
src/components/BusinessComponents/NoProject/NoProject.tsx
+11
-7
MySwitch.tsx
src/components/mui/MySwitch.tsx
+10
-8
index.tsx
src/views/Project/ProjectSetting/BaseInfo/index.tsx
+14
-14
index.module.css
...workbenchTemplate/components/AddTemplate/index.module.css
+6
-7
index.tsx
...kbench/workbenchTemplate/components/AddTemplate/index.tsx
+0
-0
index.tsx
...iews/Project/ProjectWorkbench/workbenchTemplate/index.tsx
+9
-1
No files found.
src/components/BusinessComponents/NoProject/NoProject.tsx
View file @
c054d7f8
...
@@ -12,16 +12,20 @@ import AddIcon from "@mui/icons-material/Add";
...
@@ -12,16 +12,20 @@ import AddIcon from "@mui/icons-material/Add";
import
AddProject
from
"@/views/Project/components/AddProject"
;
import
AddProject
from
"@/views/Project/components/AddProject"
;
import
React
,
{
useState
}
from
"react"
;
import
React
,
{
useState
}
from
"react"
;
import
MyButton
from
"@/components/mui/MyButton"
;
import
MyButton
from
"@/components/mui/MyButton"
;
import
{
toJS
}
from
"mobx"
;
import
{
observer
}
from
"mobx-react-lite"
;
import
{
useStores
}
from
"@/store/index"
;
const
NoProject
=
(
)
=>
{
const
NoProject
=
observer
((
props
:
any
)
=>
{
// 新建弹窗显示控制
// 新建弹窗显示控制
const
[
addOpen
,
setAddOpen
]
=
useState
(
false
);
const
[
addOpen
,
setAddOpen
]
=
useState
(
false
);
const
{
currentProjectStore
}
=
useStores
();
let
projectList
=
toJS
(
currentProjectStore
.
projectList
)
return
(
return
(
<
div
className=
{
style
.
noProject
}
>
<
div
className=
{
style
.
noProject
}
>
<
img
src=
{
noData
}
alt=
""
className=
{
style
.
noDataImg
}
/>
<
img
src=
{
noData
}
alt=
""
className=
{
style
.
noDataImg
}
/>
<
div
className=
{
style
.
text1
}
>
当前产品暂无项目
</
div
>
<
div
className=
{
style
.
text1
}
>
{
projectList
.
length
>
0
?
"当前未选中任何项目"
:
"当前产品暂无项目"
}
</
div
>
<
div
className=
{
style
.
text2
}
>
请先创建项目
</
div
>
<
div
className=
{
style
.
text2
}
>
{
projectList
.
length
>
0
?
"或创建新项目"
:
"请先创建项目"
}
</
div
>
<
MyButton
<
MyButton
text=
'创建项目'
text=
'创建项目'
variant=
"contained"
variant=
"contained"
...
@@ -30,11 +34,11 @@ const NoProject = () => {
...
@@ -30,11 +34,11 @@ const NoProject = () => {
onClick=
{
()
=>
setAddOpen
(
true
)
}
onClick=
{
()
=>
setAddOpen
(
true
)
}
style=
{
{
backgroundColor
:
"#1370ff"
,
color
:
"#fff"
}
}
style=
{
{
backgroundColor
:
"#1370ff"
,
color
:
"#fff"
}
}
/>
/>
<
AddProject
addOpen=
{
addOpen
}
setAddOpen=
{
setAddOpen
}
/>
<
AddProject
addOpen=
{
addOpen
}
setAddOpen=
{
setAddOpen
}
/>
</
div
>
</
div
>
);
);
};
}
)
;
export
default
NoProject
;
export
default
NoProject
;
src/components/mui/MySwitch.tsx
View file @
c054d7f8
...
@@ -11,7 +11,8 @@ import Switch, { SwitchProps } from "@mui/material/Switch";
...
@@ -11,7 +11,8 @@ import Switch, { SwitchProps } from "@mui/material/Switch";
import
{
ThemeProvider
,
createTheme
}
from
"@mui/material/styles"
;
import
{
ThemeProvider
,
createTheme
}
from
"@mui/material/styles"
;
interface
IMySwitchProps
extends
SwitchProps
{
interface
IMySwitchProps
extends
SwitchProps
{
value
:
boolean
;
value
?:
boolean
;
defaultChecked
?:
boolean
;
onChange
?:
any
;
onChange
?:
any
;
disabled
?:
boolean
;
disabled
?:
boolean
;
}
}
...
@@ -52,23 +53,24 @@ const theme = createTheme({
...
@@ -52,23 +53,24 @@ const theme = createTheme({
});
});
const
MySwitch
=
(
props
:
IMySwitchProps
)
=>
{
const
MySwitch
=
(
props
:
IMySwitchProps
)
=>
{
const
{
value
,
onChange
,
disabled
=
false
,
size
,
...
other
}
=
props
;
const
{
value
,
defaultChecked
,
onChange
,
disabled
=
false
,
size
,
...
other
}
=
props
;
return
(
return
(
<
ThemeProvider
theme=
{
theme
}
>
<
ThemeProvider
theme=
{
theme
}
>
<
Switch
<
Switch
checked=
{
value
}
checked=
{
value
}
disabled=
{
disabled
}
disabled=
{
disabled
}
defaultChecked=
{
defaultChecked
}
onChange=
{
onChange
}
onChange=
{
onChange
}
sx=
{
sx=
{
size
===
"medium"
size
===
"medium"
?
{
?
{
width
:
44
,
width
:
44
,
height
:
24
,
height
:
24
,
}
}
:
{
:
{
width
:
40
,
width
:
40
,
height
:
22
,
height
:
22
,
}
}
}
}
{
...
other
}
{
...
other
}
/>
/>
...
...
src/views/Project/ProjectSetting/BaseInfo/index.tsx
View file @
c054d7f8
...
@@ -276,20 +276,20 @@ const BaseInfo = observer(() => {
...
@@ -276,20 +276,20 @@ const BaseInfo = observer(() => {
const
projectList
=
await
getProjectList
();
const
projectList
=
await
getProjectList
();
currentProjectStore
.
setProjectList
(
projectList
);
currentProjectStore
.
setProjectList
(
projectList
);
// 项目删完了
// 项目删完了
if
(
projectList
.
length
===
0
)
{
//
if (projectList.length === 0) {
currentProjectStore
.
changeProject
({});
currentProjectStore
.
changeProject
({});
localStorage
.
setItem
(
"fileServerEndPoint"
,
""
);
localStorage
.
setItem
(
"fileServerEndPoint"
,
""
);
setProjectInfo
({});
setProjectInfo
({});
}
else
{
//
} else {
projectList
[
0
].
filetoken
=
getFiletokenAccordingToId
(
projectList
[
0
].
id
);
//
projectList[0].filetoken = getFiletokenAccordingToId(projectList[0].id);
currentProjectStore
.
changeProject
(
projectList
[
0
]);
//
currentProjectStore.changeProject(projectList[0]);
setFileServerEndPointLocalStorage
(
projectList
[
0
].
zoneId
);
//
setFileServerEndPointLocalStorage(projectList[0].zoneId);
getFiletokenAccordingToId
(
projectList
[
0
].
id
).
then
((
res
)
=>
{
//
getFiletokenAccordingToId(projectList[0].id).then((res) => {
projectList
[
0
].
filetoken
=
res
;
//
projectList[0].filetoken = res;
currentProjectStore
.
changeProject
(
projectList
[
0
]);
//
currentProjectStore.changeProject(projectList[0]);
});
//
});
setProjectInfo
(
projectList
[
0
]);
//
setProjectInfo(projectList[0]);
}
//
}
},
},
});
});
...
...
src/views/Project/ProjectWorkbench/workbenchTemplate/components/AddTemplate/index.module.css
View file @
c054d7f8
...
@@ -28,10 +28,10 @@
...
@@ -28,10 +28,10 @@
}
}
.templateLi
{
.templateLi
{
height
:
1
46
px
;
height
:
1
70
px
;
box-sizing
:
border-box
;
box-sizing
:
border-box
;
padding
:
16px
20px
;
padding
:
16px
20px
;
cursor
:
pointer
;
/* cursor: pointer; */
border
:
1px
solid
rgba
(
235
,
237
,
240
,
1
);
border
:
1px
solid
rgba
(
235
,
237
,
240
,
1
);
border-radius
:
4px
;
border-radius
:
4px
;
min-width
:
20%
;
min-width
:
20%
;
...
@@ -41,7 +41,7 @@
...
@@ -41,7 +41,7 @@
}
}
.templateLiCustom
{
.templateLiCustom
{
height
:
1
94
px
;
height
:
1
70
px
;
}
}
.templateLiHidden
{
.templateLiHidden
{
...
@@ -49,7 +49,7 @@
...
@@ -49,7 +49,7 @@
}
}
.addCustomTemplate
{
.addCustomTemplate
{
height
:
1
94
px
;
height
:
1
70
px
;
box-sizing
:
border-box
;
box-sizing
:
border-box
;
display
:
flex
;
display
:
flex
;
justify-content
:
center
;
justify-content
:
center
;
...
@@ -112,5 +112,5 @@
...
@@ -112,5 +112,5 @@
.templateLiEditBox
{
.templateLiEditBox
{
display
:
flex
;
display
:
flex
;
justify-content
:
flex-end
;
justify-content
:
flex-end
;
margin-top
:
16px
;
/* margin-top: 16px; */
}
}
\ No newline at end of file
src/views/Project/ProjectWorkbench/workbenchTemplate/components/AddTemplate/index.tsx
View file @
c054d7f8
This diff is collapsed.
Click to expand it.
src/views/Project/ProjectWorkbench/workbenchTemplate/index.tsx
View file @
c054d7f8
...
@@ -182,7 +182,15 @@ const ProjectMembers = observer(() => {
...
@@ -182,7 +182,15 @@ const ProjectMembers = observer(() => {
{
showAddTemplate
&&
(
{
showAddTemplate
&&
(
<
AddTemplate
<
AddTemplate
setShowAddTemplate=
{
()
=>
setShowAddTemplate
(
false
)
}
setShowAddTemplate=
{
()
=>
{
setShowAddTemplate
(
false
)
getTemplateInfo
({
projectId
:
projectIdData
as
string
,
title
:
templateName
,
});
}
}
getTemplateInfo=
{
getTemplateInfo
}
getTemplateInfo=
{
getTemplateInfo
}
productId=
{
productId
as
string
}
productId=
{
productId
as
string
}
projectId=
{
projectIdData
as
string
}
projectId=
{
projectIdData
as
string
}
...
...
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