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
b50885a4
Commit
b50885a4
authored
Oct 26, 2022
by
wuyongsheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 修改bug
parent
c00eabe1
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
26 deletions
+36
-26
index.tsx
src/components/CommonComponents/Code/index.tsx
+2
-7
useCheckOperator.tsx
src/views/CustomOperator/useCheckOperator.tsx
+7
-6
index.tsx
...sources/WorkflowOperator/components/AddOperator/index.tsx
+11
-8
index.tsx
...ces/WorkflowOperator/components/OperatorDetails/index.tsx
+14
-3
index.tsx
...s/ResourceCenter/UserResources/WorkflowOperator/index.tsx
+2
-2
No files found.
src/components/CommonComponents/Code/index.tsx
View file @
b50885a4
...
...
@@ -2,7 +2,7 @@
* @Author: 吴永生 15770852798@163.com
* @Date: 2022-10-20 19:45:32
* @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-10-2
5 21:16:13
* @LastEditTime: 2022-10-2
6 17:27:12
* @FilePath: /bkunyun/src/components/CommonComponents/Code/index.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
...
...
@@ -12,8 +12,6 @@ import { isEqual } from "lodash";
// import { javascript } from "@codemirror/lang-javascript";
interface
ICodeType
extends
ReactCodeMirrorProps
{
value
?:
string
;
onChange
:
any
;
height
?:
string
;
width
?:
string
;
maxWidth
?:
string
;
...
...
@@ -21,16 +19,13 @@ interface ICodeType extends ReactCodeMirrorProps {
}
const
Code
=
(
props
:
ICodeType
)
=>
{
console
.
log
(
"----"
);
const
{
value
,
onChange
,
height
,
theme
=
"dark"
,
width
,
maxWidth
}
=
props
;
const
{
height
,
theme
=
"dark"
,
width
,
maxWidth
}
=
props
;
return
(
<
CodeMirror
{
...
props
}
height=
{
height
||
"100%"
}
width=
{
width
||
"100%"
}
maxWidth=
{
maxWidth
||
"100%"
}
value=
{
value
}
onChange=
{
(
e
)
=>
onChange
(
e
)
}
theme=
{
theme
}
/>
);
...
...
src/views/CustomOperator/useCheckOperator.tsx
View file @
b50885a4
...
...
@@ -8,7 +8,7 @@ import { ITask } from "../Project/ProjectSubmitWork/interface";
* @Author: 吴永生 15770852798@163.com
* @Date: 2022-10-24 18:08:47
* @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-10-2
5 18:16
:34
* @LastEditTime: 2022-10-2
6 17:15
:34
* @FilePath: /bkunyun/src/views/CustomOperator/useCheckOperator.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
...
...
@@ -106,7 +106,7 @@ const useCheckOperator = (
if
(
operatorList
.
length
===
0
)
{
Message
.
error
(
nullText
||
"内容不能为空!"
);
checkStatus
=
false
;
return
;
return
checkStatus
;
}
let
sourceArr
:
string
[]
=
[];
let
targetArr
:
string
[]
=
[];
...
...
@@ -119,25 +119,26 @@ const useCheckOperator = (
if
(
!
checkHasOneLine
([...
sourceArr
],
[...
targetArr
]))
{
checkStatus
=
false
;
Message
.
error
(
"部分算子没有流程线,请检查流程!"
);
return
;
return
checkStatus
;
}
if
(
!
checkIn
([...
targetArr
]))
{
checkStatus
=
false
;
Message
.
error
(
"每个流程第一步需读取文件/数据集,请检查流程!"
);
return
;
return
checkStatus
;
}
if
(
!
checkOut
([...
sourceArr
]))
{
checkStatus
=
false
;
Message
.
error
(
"每个流程最后一步必须将数据写入为文件/数据集,请检查流程!"
);
return
;
return
checkStatus
;
}
checkStatus
=
true
;
successCallBack
();
return
checkStatus
;
};
return
{
handleCheck
,
checkStatus
};
return
{
handleCheck
};
};
export
default
useCheckOperator
;
src/views/ResourceCenter/UserResources/WorkflowOperator/components/AddOperator/index.tsx
View file @
b50885a4
...
...
@@ -2,7 +2,7 @@
* @Author: 吴永生 15770852798@163.com
* @Date: 2022-10-18 16:12:55
* @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-10-26 1
3:57:17
* @LastEditTime: 2022-10-26 1
7:31:53
* @FilePath: /bkunyun/src/views/ResourceCenter/UserResources/WorkflowOperator/components/AddOperator/index.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
...
...
@@ -95,7 +95,7 @@ const AddOperator = observer((props: IAddOperator) => {
/** 详情数据 */
const
[
detailInfo
,
setDetailInfo
]
=
useState
<
any
>
();
const
{
handleCheck
,
checkStatus
}
=
useCheckOperator
(
const
{
handleCheck
}
=
useCheckOperator
(
operatorList
,
()
=>
{},
"流程编排不能为空"
...
...
@@ -178,7 +178,6 @@ const AddOperator = observer((props: IAddOperator) => {
const
paramsConfigBlur
=
useCallback
(()
=>
{
let
result
,
resultError
;
console
.
log
(
batchBuildType
,
"batchBuildType"
);
if
(
batchBuildType
===
"OPERATOR"
)
return
;
if
(
code
===
""
)
{
resultError
=
"请输入参数配置!"
;
...
...
@@ -247,16 +246,16 @@ const AddOperator = observer((props: IAddOperator) => {
const paramsResultError = paramsConfigBlur();
setFormErrors(resultErrors);
let checkStatus = true;
if (taskType === "BATCH" && batchBuildType === "OPERATOR") {
handleCheck();
checkStatus =
handleCheck();
}
if (
Object.getOwnPropertyNames(resultErrors)?.length ||
checkStatus ||
!
checkStatus ||
paramsResultError
)
return;
console.log(code, "111");
let newParameters = [];
try {
newParameters = JSON.parse(code);
...
...
@@ -286,7 +285,6 @@ const AddOperator = observer((props: IAddOperator) => {
runSaveOperator(params, detailsId ? true : false);
}, [
batchBuildType,
checkStatus,
code,
command,
detailInfo,
...
...
@@ -431,6 +429,7 @@ const AddOperator = observer((props: IAddOperator) => {
placeholder="请输入算子描述"
value={formData?.description}
onChange={(e) => {
if (e.target.value?.length > 300) return;
changeFormData({ description: e.target.value });
}}
/>
...
...
@@ -503,6 +502,7 @@ const AddOperator = observer((props: IAddOperator) => {
placeholder="请输入算子描述"
value={formData?.description}
onChange={(e) => {
if (e.target.value?.length > 300) return;
changeFormData({ description: e.target.value });
}}
/>
...
...
@@ -564,7 +564,10 @@ const AddOperator = observer((props: IAddOperator) => {
)}
<div className={style.buttonBox}>
<MyButton text="开始构建" onClick={handleSubmit} />
<MyButton
text={detailsId ? "更新完成" : "开始构建"}
onClick={handleSubmit}
/>
</div>
</div>
</div>
...
...
src/views/ResourceCenter/UserResources/WorkflowOperator/components/OperatorDetails/index.tsx
View file @
b50885a4
...
...
@@ -2,7 +2,7 @@
* @Author: 吴永生 15770852798@163.com
* @Date: 2022-10-17 14:35:11
* @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-10-26
09:27:56
* @LastEditTime: 2022-10-26
17:28:19
* @FilePath: /bkunyun/src/views/ResourceCenter/UserResources/WorkflowOperator/index.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
...
...
@@ -17,6 +17,8 @@ import useMyRequest from "@/hooks/useMyRequest";
import
{
getOperatorDetail
}
from
"@/api/resourceCenter"
;
import
{
useStores
}
from
"@/store"
;
import
goback
from
"@/assets/project/goback.svg"
;
import
Code
from
"@/components/CommonComponents/Code"
;
import
Flow
from
"@/views/Project/components/Flow"
;
import
styles
from
"./index.module.css"
;
...
...
@@ -58,9 +60,10 @@ const OperatorDetails = observer(() => {
description
=
""
,
type
,
}
=
detailInfo
;
console
.
log
(
detailInfo
,
"detailInfo"
);
/** 切换类型 */
const
handleRadio
=
(
val
:
string
)
=>
{
console
.
log
(
val
,
"2"
);
setContentType
(
val
);
};
...
...
@@ -117,7 +120,15 @@ const OperatorDetails = observer(() => {
handleRadio=
{
handleRadio
}
/>
</
div
>
<
div
>
11
</
div
>
<
div
>
{
contentType
===
"flowChart"
?
<
Flow
tasks=
{
[]
}
/>
:
null
}
{
contentType
===
"parameterList"
?
null
:
null
}
{
contentType
===
"runScript"
?
(
<
div
className=
{
styles
.
code
}
>
<
Code
value=
""
editable=
{
false
}
height=
"350px"
/>
</
div
>
)
:
null
}
</
div
>
</
div
>
);
});
...
...
src/views/ResourceCenter/UserResources/WorkflowOperator/index.tsx
View file @
b50885a4
...
...
@@ -2,7 +2,7 @@
* @Author: 吴永生 15770852798@163.com
* @Date: 2022-10-17 14:35:11
* @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-10-26 1
4:05:04
* @LastEditTime: 2022-10-26 1
5:14:32
* @FilePath: /bkunyun/src/views/ResourceCenter/UserResources/WorkflowOperator/index.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
...
...
@@ -145,7 +145,7 @@ const WorkflowOperator = observer(() => {
})
}
</
div
>
)
:
(
<
div
style=
{
{
position
:
"relative"
}
}
>
<
div
style=
{
{
position
:
"relative"
,
minHeight
:
450
}
}
>
<
img
src=
{
noFile
}
alt=
""
...
...
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