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
21db42bf
Commit
21db42bf
authored
Oct 14, 2022
by
chenshouchao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 应用中心路由搭建
parent
d455f0ea
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
125 additions
and
8 deletions
+125
-8
util.ts
src/utils/util.ts
+1
-1
index.module.css
...r/UserResources/UserResourcesEnvironment/index.module.css
+8
-0
index.tsx
...ceCenter/UserResources/UserResourcesEnvironment/index.tsx
+36
-1
index.module.css
src/views/ResourceCenter/UserResources/index.module.css
+45
-0
index.tsx
src/views/ResourceCenter/UserResources/index.tsx
+35
-6
No files found.
src/utils/util.ts
View file @
21db42bf
...
...
@@ -90,7 +90,7 @@ export const storageUnitFromB = (b: number) => {
}
else
if
(
b
<
1024
*
1024
*
1024
*
1024
)
{
return
`
${(
b
/
(
1024
*
1024
*
1024
)).
toFixed
(
2
)}
G`
;
}
else
{
return
`
${(
b
/
(
1024
*
1024
*
1024
*
1024
)).
toFixed
(
2
)}
t
`
;
return
`
${(
b
/
(
1024
*
1024
*
1024
*
1024
)).
toFixed
(
2
)}
T
`
;
}
};
...
...
src/views/ResourceCenter/UserResources/UserResourcesEnvironment/index.module.css
0 → 100644
View file @
21db42bf
.environment
{
}
.top
{
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
margin-bottom
:
20px
;
}
src/views/ResourceCenter/UserResources/UserResourcesEnvironment/index.tsx
View file @
21db42bf
// 应用环境
import
style
from
"./index.module.css"
;
import
SearchInput
from
"@/components/BusinessComponents/SearchInput"
;
import
MySelect
from
"@/components/mui/MySelect"
;
import
MyButton
from
"@/components/mui/MyButton"
;
const
UserResourcesEnvironment
=
()
=>
{
return
<
div
>
UserResourcesEnvironment
</
div
>;
return
(
<
div
className=
{
style
.
environment
}
>
<
div
className=
{
style
.
top
}
>
<
div
className=
{
style
.
topLeft
}
>
<
SearchInput
sx=
{
{
width
:
340
,
marginRight
:
"16px"
}
}
></
SearchInput
>
<
MySelect
options=
{
[
{
label
:
"环境类型"
,
value
:
"a"
,
},
]
}
sx=
{
{
width
:
"150px"
,
height
:
"32px"
}
}
></
MySelect
>
</
div
>
<
div
className=
{
style
.
topRight
}
>
<
MyButton
text=
"构建应用环境"
img=
{
<
span
style=
{
{
fontSize
:
"14px"
,
marginRight
:
"8px"
}
}
className=
"iconfont icon-dianzan"
></
span
>
}
></
MyButton
>
</
div
>
</
div
>
UserResourcesEnvironment
</
div
>
);
};
export
default
UserResourcesEnvironment
;
src/views/ResourceCenter/UserResources/index.module.css
View file @
21db42bf
.userResources
{
height
:
calc
(
100vh
-
57px
);
width
:
100%
;
}
.top
{
display
:
flex
;
justify-content
:
flex-start
;
align-items
:
center
;
border-bottom
:
1px
solid
rgba
(
235
,
237
,
240
,
1
);
}
.title
{
padding
:
14px
24px
;
color
:
rgba
(
30
,
38
,
51
,
1
);
font-size
:
18px
;
line-height
:
26px
;
font-weight
:
550
;
}
.line
{
width
:
1px
;
height
:
20px
;
background-color
:
rgba
(
221
,
225
,
230
,
1
);
}
.tabs
{
display
:
flex
;
justify-content
:
flex-start
;
align-items
:
center
;
}
.tab
{
margin-left
:
24px
;
font-size
:
16px
;
line-height
:
24px
;
color
:
rgba
(
138
,
144
,
153
,
1
);
border-bottom
:
2px
solid
transparent
;
padding
:
14px
0
;
cursor
:
pointer
;
}
.activeTab
{
color
:
rgba
(
19
,
112
,
255
,
1
);
border-bottom
:
2px
solid
rgba
(
19
,
112
,
255
,
1
);
}
.content
{
padding
:
20px
24px
;
height
:
calc
(
100%
-
55px
);
box-sizing
:
border-box
;
}
src/views/ResourceCenter/UserResources/index.tsx
View file @
21db42bf
import
style
from
"./index.module.css"
;
import
usePass
from
"@/hooks/usePass"
;
import
UserResourcesEnvironment
from
"./UserResourcesEnvironment"
;
// src\views\ResourceCenter\UserResources\UserResourcesEnvironment
import
{
useMemo
,
useState
}
from
"react"
;
import
classNames
from
"classnames"
;
const
tabs
=
[
{
...
...
@@ -21,14 +23,41 @@ const tabs = [
];
const
UserResources
=
()
=>
{
const
renderTabs
=
()
=>
{};
const
isPass
=
usePass
();
const
[
activeTab
,
setActiveTab
]
=
useState
(
"environment"
);
const
renderTabs
=
useMemo
(()
=>
{
return
tabs
.
filter
((
tab
)
=>
isPass
(
tab
.
id
));
},
[
isPass
]);
console
.
log
(
renderTabs
);
// () => {};
return
(
<
div
>
<
div
className=
{
style
.
userResources
}
>
<
div
className=
{
style
.
top
}
>
<
div
>
个人资源
</
div
>
<
div
className=
{
style
.
tabs
}
></
div
>
<
div
className=
{
style
.
title
}
>
个人资源
</
div
>
<
div
className=
{
style
.
line
}
></
div
>
<
div
className=
{
style
.
tabs
}
>
{
renderTabs
.
map
((
tab
)
=>
{
return
(
<
div
className=
{
classNames
({
[
style
.
tab
]:
true
,
[
style
.
activeTab
]:
activeTab
===
tab
.
value
,
})
}
onClick=
{
()
=>
setActiveTab
(
tab
.
value
)
}
key=
{
tab
.
value
}
>
{
tab
.
label
}
</
div
>
);
})
}
</
div
>
</
div
>
<
div
className=
{
style
.
content
}
>
{
activeTab
===
"environment"
&&
(
<
UserResourcesEnvironment
></
UserResourcesEnvironment
>
)
}
</
div
>
<
div
className=
{
style
.
content
}
>
UserResources
</
div
>
</
div
>
);
};
...
...
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