Commit b50885a4 authored by wuyongsheng's avatar wuyongsheng

feat: 修改bug

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