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
313c7924
Commit
313c7924
authored
Oct 20, 2022
by
chenshouchao
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feat-20221012-environment' into 'release'
cn-feat: 优化code组件宽度 See merge request
!148
parents
17581507
41b27713
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
39 additions
and
3 deletions
+39
-3
index.module.css
src/components/CommonComponents/CardTable/index.module.css
+0
-0
index.tsx
src/components/CommonComponents/CardTable/index.tsx
+7
-0
index.tsx
src/components/CommonComponents/Code/index.tsx
+6
-1
index.module.css
.../UserResourcesEnvironment/AddEnvironment/index.module.css
+1
-0
index.tsx
...sources/UserResourcesEnvironment/AddEnvironment/index.tsx
+13
-1
index.module.css
src/views/demo/CardTableDemo/index.module.css
+0
-0
index.tsx
src/views/demo/CardTableDemo/index.tsx
+5
-0
index.tsx
src/views/demo/index.tsx
+7
-1
No files found.
src/components/CommonComponents/CardTable/index.module.css
0 → 100644
View file @
313c7924
src/components/CommonComponents/CardTable/index.tsx
0 → 100644
View file @
313c7924
import
style
from
"./index.module.css"
;
const
CardTable
=
()
=>
{
return
<
div
>
CardTable
</
div
>;
};
export
default
CardTable
;
src/components/CommonComponents/Code/index.tsx
View file @
313c7924
...
...
@@ -4,14 +4,19 @@ type ICodeType = {
value
:
string
;
onChange
:
any
;
height
?:
string
;
width
?:
string
;
maxWidth
?:
string
;
theme
?:
"light"
|
"dark"
;
};
const
Code
=
(
props
:
ICodeType
)
=>
{
const
{
value
,
onChange
,
height
,
theme
=
"dark"
}
=
props
;
const
{
value
,
onChange
,
height
,
theme
=
"dark"
,
width
,
maxWidth
}
=
props
;
return
(
<
CodeMirror
height=
{
height
||
"100%"
}
// maxWidth="200px"
width=
{
width
||
"100%"
}
maxWidth=
{
maxWidth
||
"100%"
}
value=
{
value
}
onChange=
{
(
e
)
=>
onChange
(
e
)
}
theme=
{
theme
}
...
...
src/views/ResourceCenter/UserResources/UserResourcesEnvironment/AddEnvironment/index.module.css
View file @
313c7924
...
...
@@ -36,6 +36,7 @@
}
.form
{
width
:
368px
;
min-width
:
368px
;
box-sizing
:
border-box
;
padding
:
16px
24px
;
border
:
1px
solid
#ebedf0
;
...
...
src/views/ResourceCenter/UserResources/UserResourcesEnvironment/AddEnvironment/index.tsx
View file @
313c7924
...
...
@@ -48,6 +48,7 @@ const AddEnvironment = (props: IAddEnvironmentProps) => {
const
[
envList
,
setEnvList
]
=
useState
<
Array
<
any
>>
([]);
// 基础环境列表 和taskType环境类型有关
const
[
progress
,
setProgress
]
=
useState
(
"0%"
);
// 上传压缩包进度
const
[
code
,
setCode
]
=
useState
(
""
);
// 脚本内容
const
[
codeWidth
,
setCodeWidth
]
=
useState
(
0
);
const
[
upload
,
setUpload
]
=
useState
<
any
>
(()
=>
{});
// 上传压缩包实例 用于暂停(取消上传)upload.abort(true);
const
[
nameHelper
,
setNameHelper
]
=
useState
({
error
:
false
,
...
...
@@ -297,6 +298,16 @@ const AddEnvironment = (props: IAddEnvironmentProps) => {
setFilePaths
([]);
};
const
getCodeWidth
=
()
=>
{
const
addEnvironmentCodeElement
=
document
.
getElementById
(
"addEnvironmentCode"
);
setCodeWidth
(
addEnvironmentCodeElement
?.
offsetWidth
||
0
);
};
useEffect
(()
=>
{
getCodeWidth
();
},
[]);
return
(
<
div
className=
{
style
.
addEnvironment
}
>
<
div
className=
{
style
.
left
}
>
...
...
@@ -453,11 +464,12 @@ const AddEnvironment = (props: IAddEnvironmentProps) => {
<
div
className=
{
style
.
codeTitle
}
>
{
taskType
===
"BATCH"
?
"Shell脚本"
:
"Python脚本"
}
</
div
>
<
div
className=
{
style
.
code
}
>
<
div
className=
{
style
.
code
}
id=
"addEnvironmentCode"
>
<
Code
value=
{
code
}
onChange=
{
(
e
:
string
)
=>
setCode
(
e
)
}
height=
"535px"
width=
{
`${codeWidth}px`
}
/>
</
div
>
</
div
>
...
...
src/views/demo/CardTableDemo/index.module.css
0 → 100644
View file @
313c7924
src/views/demo/CardTableDemo/index.tsx
0 → 100644
View file @
313c7924
const
CardTableDemo
=
()
=>
{
return
<
div
>
CardTableDemo
</
div
>;
};
export
default
CardTableDemo
;
src/views/demo/index.tsx
View file @
313c7924
import
MyTableDemo
from
"./MyTableDemo"
;
import
QueueSelectDemo
from
"./QueueSelectDemo"
;
import
IconfontDemo
from
"./IconfontDemo"
;
import
CardTableDemo
from
"./CardTableDemo"
;
import
RadioGroupOfButtonStyle
from
"@/components/CommonComponents/RadioGroupOfButtonStyle"
;
import
{
useState
}
from
"react"
;
import
styles
from
"./index.module.css"
;
const
Demo
=
()
=>
{
const
radioOptionsArr
=
[
{
value
:
"cardTable"
,
label
:
"cardTable"
,
},
{
value
:
"iconfont"
,
label
:
"iconfont"
,
...
...
@@ -27,7 +32,7 @@ const Demo = () => {
const
handleRadio
=
(
e
:
string
)
=>
{
setSelectDemo
(
e
);
};
const
[
selectDemo
,
setSelectDemo
]
=
useState
(
"
iconfont
"
);
const
[
selectDemo
,
setSelectDemo
]
=
useState
(
"
cardTable
"
);
return
(
<
div
className=
{
styles
.
demoBox
}
>
...
...
@@ -37,6 +42,7 @@ const Demo = () => {
handleRadio=
{
handleRadio
}
/>
<
div
className=
{
styles
.
demoContentBox
}
>
{
selectDemo
===
"cardTable"
&&
<
CardTableDemo
></
CardTableDemo
>
}
{
selectDemo
===
"iconfont"
&&
<
IconfontDemo
></
IconfontDemo
>
}
{
selectDemo
===
"队列选择器"
&&
<
QueueSelectDemo
></
QueueSelectDemo
>
}
{
selectDemo
===
"表格"
&&
<
MyTableDemo
></
MyTableDemo
>
}
...
...
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