Commit 1b79d21b authored by wuyongsheng's avatar wuyongsheng

Revert "Merge branch 'feat-20220801' into 'master'"

This reverts merge request !78
parent 52c8279d
/* /*
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com * @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-05-31 10:17:48 * @Date: 2022-05-31 10:17:48
* @LastEditors: 吴永生 15770852798@163.com * @LastEditors: 吴永生#A02208 yongsheng.wu@wholion.com
* @LastEditTime: 2022-08-30 16:22:15 * @LastEditTime: 2022-07-18 15:44:35
* @FilePath: /bkunyun/src/api/api_prefix.ts * @FilePath: /bkunyun/src/api/api_prefix.ts
* @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
*/ */
...@@ -36,7 +36,7 @@ switch (process.env.REACT_APP_ENV) { ...@@ -36,7 +36,7 @@ switch (process.env.REACT_APP_ENV) {
BACKEND_API_URI_PREFIX = "https://www.cloudam.cn"; BACKEND_API_URI_PREFIX = "https://www.cloudam.cn";
} }
else { else {
BACKEND_API_URI_PREFIX = "http://47.75.104.171"; BACKEND_API_URI_PREFIX = "http://47.57.4.97";
} }
break; break;
} }
......
<?xml version="1.0" encoding="UTF-8"?>
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>刷新备份</title>
<g id="上线UI" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="刷新备份">
<rect id="矩形" x="0" y="0" width="16" height="16"></rect>
<path d="M14.1034483,5.0750097 L12.3103448,6.87501758 C11.862069,4.9250128 10.0689767,3.42499873 7.97701897,3.42499873 C5.51150172,3.42499873 3.49426034,5.45000759 3.49426034,7.92501842 C3.49426034,10.3999842 5.51150172,12.4249931 7.97701897,12.4249931 C10.3678534,12.4249931 12.3850948,10.5500599 12.4597328,8.15001941 L13.8045603,6.8000135 C13.8793103,7.17501139 13.9540603,7.55002053 13.9540603,8.0000225 C13.9540603,11.2999882 11.2644052,14 7.97701897,14 C4.68965517,14 2,11.2999882 2,8.0000225 C2,4.70001181 4.68965517,2 7.97701897,2 C9.91954397,2 11.712681,2.97499677 12.7586207,4.40000675 L12.9080086,4.17500577 L15,4.17500577 L14.1034483,5.0750097 Z" id="路径" fill="#8A9099"></path>
</g>
</g>
</svg>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>1.Base基础/Icon图标/任务列表备份</title> <title>1.Base基础/Icon图标/任务列表</title>
<defs>
<filter color-interpolation-filters="auto" id="filter-1">
<feColorMatrix in="SourceGraphic" type="matrix" values="0 0 0 0 0.760000 0 0 0 0 0.776000 0 0 0 0 0.800000 0 0 0 1.000000 0"></feColorMatrix>
</filter>
</defs>
<g id="上线UI" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> <g id="上线UI" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="1.Base基础/Icon图标/任务列表备份"> <g id="工作台(管理员)空" transform="translate(-370.000000, -245.000000)">
<g id="编组-5" transform="translate(370.000000, 242.000000)">
<g id="1.Base基础/Icon图标/任务列表" transform="translate(0.000000, 3.000000)">
<rect id="矩形" x="0" y="0" width="16" height="16"></rect> <rect id="矩形" x="0" y="0" width="16" height="16"></rect>
<g id="编组-4" transform="translate(0.500000, 0.000000)" stroke="#C2C6CC" stroke-width="1.5"> <g filter="url(#filter-1)" id="编组-4">
<path d="M7.38809691,0.889939751 L14.1102244,4.08516037 L14.2499569,11.9840447 L7.60081331,15.1318104 L0.897545722,12.2122049 L0.75,4.30940599 L7.38809691,0.889939751 Z" id="路径-15"></path> <g transform="translate(0.500000, 0.000000)">
<polyline id="路径-20" points="1.29720478 4.56847209 7.47016174 7.45 13.6431187 4.56847209"></polyline> <path d="M7.38809691,0.889939751 C7.45764437,0.855744844 7.53911808,0.85573765 7.60867158,0.889920274 L7.60867158,0.889920274 L14.1102244,4.08516037 C14.1529938,4.10617975 14.187927,4.13844408 14.2121677,4.17736742 C14.2364085,4.21629077 14.2499569,4.26187312 14.2499569,4.30952854 L14.2499569,4.30952854 L14.2499569,11.9840447 C14.2499569,12.0332683 14.2355127,12.0802004 14.2098426,12.119868 C14.1841726,12.1595356 14.1472766,12.1919385 14.1023731,12.2121037 L14.1023731,12.2121037 L7.60081331,15.1318104 C7.53565621,15.161071 7.46109499,15.1610648 7.39594277,15.1317934 L7.39594277,15.1317934 L0.897545722,12.2122049 C0.852652465,12.1920353 0.815766035,12.1596329 0.790102919,12.1199688 C0.764439802,12.0803047 0.75,12.033379 0.75,11.984163 L0.75,11.984163 L0.75,4.30940599 C0.75,4.26175853 0.763543923,4.21618307 0.78777749,4.17726362 L0.78777749,4.17726362 Z" id="路径-15" stroke="#979797" stroke-width="1.5"></path>
<line x1="7.47016174" y1="7.39513959" x2="7.47016174" y2="14.8580198" id="路径-21"></line> <polyline id="路径-20" stroke="#979797" stroke-width="1.5" points="1.29720478 4.56847209 7.47016174 7.45 13.6431187 4.56847209"></polyline>
<line x1="7.47016174" y1="7.39513959" x2="7.47016174" y2="14.8580198" id="路径-21" stroke="#979797" stroke-width="1.5"></line>
</g>
</g>
</g>
</g> </g>
</g> </g>
</g> </g>
......
<?xml version="1.0" encoding="UTF-8"?>
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>1.Base基础/Icon图标/任务列表备份 3</title>
<g id="上线UI" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="1.Base基础/Icon图标/任务列表备份">
<rect id="矩形" x="0" y="0" width="16" height="16"></rect>
<g id="编组-4" transform="translate(0.500000, 0.000000)" stroke="#1E2633" stroke-width="1.5">
<path d="M7.38809691,0.889939751 L14.1102244,4.08516037 L14.2499569,11.9840447 L7.60081331,15.1318104 L0.897545722,12.2122049 L0.75,4.30940599 L7.38809691,0.889939751 Z" id="路径-15"></path>
<polyline id="路径-20" points="1.29720478 4.56847209 7.47016174 7.45 13.6431187 4.56847209"></polyline>
<line x1="7.47016174" y1="7.39513959" x2="7.47016174" y2="14.8580198" id="路径-21"></line>
</g>
</g>
</g>
</svg>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>1.Base基础/Icon图标/任务列表备份 2</title> <title>1.Base基础/Icon图标/任务列表</title>
<defs>
<filter color-interpolation-filters="auto" id="filter-1">
<feColorMatrix in="SourceGraphic" type="matrix" values="0 0 0 0 0.076000 0 0 0 0 0.440000 0 0 0 0 1.000000 0 0 0 1.000000 0"></feColorMatrix>
</filter>
</defs>
<g id="上线UI" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> <g id="上线UI" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="1.Base基础/Icon图标/任务列表备份-2"> <g id="任务列表" transform="translate(-370.000000, -245.000000)">
<g id="编组-5" transform="translate(370.000000, 242.000000)">
<g id="1.Base基础/Icon图标/任务列表" transform="translate(0.000000, 3.000000)">
<rect id="矩形" x="0" y="0" width="16" height="16"></rect> <rect id="矩形" x="0" y="0" width="16" height="16"></rect>
<g id="编组-4" transform="translate(0.500000, 0.000000)" stroke="#1370FF" stroke-width="1.5"> <g filter="url(#filter-1)" id="编组-4">
<path d="M7.38809691,0.889939751 L14.1102244,4.08516037 L14.2499569,11.9840447 L7.60081331,15.1318104 L0.897545722,12.2122049 L0.75,4.30940599 L7.38809691,0.889939751 Z" id="路径-15"></path> <g transform="translate(0.500000, 0.000000)">
<polyline id="路径-20" points="1.29720478 4.56847209 7.47016174 7.45 13.6431187 4.56847209"></polyline> <path d="M7.38809691,0.889939751 C7.45764437,0.855744844 7.53911808,0.85573765 7.60867158,0.889920274 L7.60867158,0.889920274 L14.1102244,4.08516037 C14.1529938,4.10617975 14.187927,4.13844408 14.2121677,4.17736742 C14.2364085,4.21629077 14.2499569,4.26187312 14.2499569,4.30952854 L14.2499569,4.30952854 L14.2499569,11.9840447 C14.2499569,12.0332683 14.2355127,12.0802004 14.2098426,12.119868 C14.1841726,12.1595356 14.1472766,12.1919385 14.1023731,12.2121037 L14.1023731,12.2121037 L7.60081331,15.1318104 C7.53565621,15.161071 7.46109499,15.1610648 7.39594277,15.1317934 L7.39594277,15.1317934 L0.897545722,12.2122049 C0.852652465,12.1920353 0.815766035,12.1596329 0.790102919,12.1199688 C0.764439802,12.0803047 0.75,12.033379 0.75,11.984163 L0.75,11.984163 L0.75,4.30940599 C0.75,4.26175853 0.763543923,4.21618307 0.78777749,4.17726362 L0.78777749,4.17726362 Z" id="路径-15" stroke="#979797" stroke-width="1.5"></path>
<line x1="7.47016174" y1="7.39513959" x2="7.47016174" y2="14.8580198" id="路径-21"></line> <polyline id="路径-20" stroke="#979797" stroke-width="1.5" points="1.29720478 4.56847209 7.47016174 7.45 13.6431187 4.56847209"></polyline>
<line x1="7.47016174" y1="7.39513959" x2="7.47016174" y2="14.8580198" id="路径-21" stroke="#979797" stroke-width="1.5"></line>
</g>
</g>
</g>
</g> </g>
</g> </g>
</g> </g>
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <svg width="14px" height="14px" viewBox="0 0 14 14" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>1.Base基础/Icon图标/工作流模版备份 3</title> <title>1.Base基础/Icon图标/工作流模版</title>
<defs>
<filter color-interpolation-filters="auto" id="filter-1">
<feColorMatrix in="SourceGraphic" type="matrix" values="0 0 0 0 0.760000 0 0 0 0 0.776000 0 0 0 0 0.800000 0 0 0 1.000000 0"></feColorMatrix>
</filter>
</defs>
<g id="上线UI" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> <g id="上线UI" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="编组-5"> <g id="任务列表" transform="translate(-245.000000, -246.000000)">
<g id="编组-4" transform="translate(244.000000, 242.000000)">
<g id="编组-5" transform="translate(0.000000, 3.000000)" filter="url(#filter-1)">
<g>
<rect id="矩形" x="0" y="0" width="16" height="16"></rect> <rect id="矩形" x="0" y="0" width="16" height="16"></rect>
<g id="编组-4" transform="translate(1.000000, 1.000000)" stroke="#C2C6CC" stroke-width="1.5"> <g id="编组-4" transform="translate(1.000000, 1.000000)" stroke="#979797" stroke-width="1.5">
<rect id="矩形" x="0.75" y="0.75" width="4.75" height="4.75" rx="1"></rect> <rect id="矩形" x="0.75" y="0.75" width="4.75" height="4.75" rx="1"></rect>
<rect id="矩形备份-2" x="0.75" y="8.5" width="4.75" height="4.75" rx="1"></rect> <rect id="矩形备份-2" x="0.75" y="8.5" width="4.75" height="4.75" rx="1"></rect>
<rect id="矩形备份" x="8.5" y="0.75" width="4.75" height="4.75" rx="1"></rect> <rect id="矩形备份" x="8.5" y="0.75" width="4.75" height="4.75" rx="1"></rect>
...@@ -12,4 +20,7 @@ ...@@ -12,4 +20,7 @@
</g> </g>
</g> </g>
</g> </g>
</g>
</g>
</g>
</svg> </svg>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>1.Base基础/Icon图标/工作流模版备份 2</title>
<g id="上线UI" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="编组-5">
<rect id="矩形" x="0" y="0" width="16" height="16"></rect>
<g id="编组-4" transform="translate(1.000000, 1.000000)" stroke="#1E2633" stroke-width="1.5">
<rect id="矩形" x="0.75" y="0.75" width="4.75" height="4.75" rx="1"></rect>
<rect id="矩形备份-2" x="0.75" y="8.5" width="4.75" height="4.75" rx="1"></rect>
<rect id="矩形备份" x="8.5" y="0.75" width="4.75" height="4.75" rx="1"></rect>
<rect id="矩形备份-3" x="8.5" y="8.5" width="4.75" height="4.75" rx="1"></rect>
</g>
</g>
</g>
</svg>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <svg width="14px" height="14px" viewBox="0 0 14 14" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>1.Base基础/Icon图标/工作流模版备份</title> <title>1.Base基础/Icon图标/工作流模版</title>
<defs>
<filter color-interpolation-filters="auto" id="filter-1">
<feColorMatrix in="SourceGraphic" type="matrix" values="0 0 0 0 0.076000 0 0 0 0 0.440000 0 0 0 0 1.000000 0 0 0 1.000000 0"></feColorMatrix>
</filter>
</defs>
<g id="上线UI" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> <g id="上线UI" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="编组-5"> <g id="工作台(管理员)空" transform="translate(-245.000000, -246.000000)">
<g id="编组-4" transform="translate(244.000000, 242.000000)">
<g id="编组-5" transform="translate(0.000000, 3.000000)" filter="url(#filter-1)">
<g>
<rect id="矩形" x="0" y="0" width="16" height="16"></rect> <rect id="矩形" x="0" y="0" width="16" height="16"></rect>
<g id="编组-4" transform="translate(1.000000, 1.000000)" stroke="#1370FF" stroke-width="1.5"> <g id="编组-4" transform="translate(1.000000, 1.000000)" stroke="#979797" stroke-width="1.5">
<rect id="矩形" x="0.75" y="0.75" width="4.75" height="4.75" rx="1"></rect> <rect id="矩形" x="0.75" y="0.75" width="4.75" height="4.75" rx="1"></rect>
<rect id="矩形备份-2" x="0.75" y="8.5" width="4.75" height="4.75" rx="1"></rect> <rect id="矩形备份-2" x="0.75" y="8.5" width="4.75" height="4.75" rx="1"></rect>
<rect id="矩形备份" x="8.5" y="0.75" width="4.75" height="4.75" rx="1"></rect> <rect id="矩形备份" x="8.5" y="0.75" width="4.75" height="4.75" rx="1"></rect>
...@@ -12,4 +20,7 @@ ...@@ -12,4 +20,7 @@
</g> </g>
</g> </g>
</g> </g>
</g>
</g>
</g>
</svg> </svg>
\ No newline at end of file
.FSBox { .FSBox {
width: 900px; width: 900px;
max-height: 550px; height: 650px;
position: relative; position: relative;
} }
......
...@@ -447,7 +447,6 @@ const FileSelect = observer((props: FileSelectProps) => { ...@@ -447,7 +447,6 @@ const FileSelect = observer((props: FileSelectProps) => {
)} )}
</div> </div>
<Table <Table
tableContainerStyle={{height: 470}}
footer={false} footer={false}
rowHover={true} rowHover={true}
nopadding={true} nopadding={true}
......
...@@ -33,11 +33,3 @@ ...@@ -33,11 +33,3 @@
background-color: #fff; background-color: #fff;
box-shadow: 2px 4px 12px 0px rgba(0, 27, 63, 0.06); box-shadow: 2px 4px 12px 0px rgba(0, 27, 63, 0.06);
} }
.border {
width: 1px;
height: 16px;
background-color: rgba(209, 214, 222, 1);
}
.borderHidden {
visibility: hidden;
}
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
*/ */
// 按钮样式的单选组 // 按钮样式的单选组
import classnames from "classnames"; import classnames from "classnames";
import { useMemo } from "react";
import style from "./index.module.css"; import style from "./index.module.css";
type radioOption = { type radioOption = {
...@@ -28,21 +27,10 @@ const RadioGroupOfButtonStyle = (props: IRadioGroupOfButtonStyleProps) => { ...@@ -28,21 +27,10 @@ const RadioGroupOfButtonStyle = (props: IRadioGroupOfButtonStyleProps) => {
const { radioOptions, value, handleRadio, RadiosBoxStyle, radioStyle } = const { radioOptions, value, handleRadio, RadiosBoxStyle, radioStyle } =
props; props;
const activeIndex: any = useMemo(() => {
let res = 0;
radioOptions.forEach((item, index) => {
if (item.value === value) {
res = index;
}
});
return res;
}, [value, radioOptions]);
return ( return (
<div className={style.RadiosBox} style={RadiosBoxStyle}> <div className={style.RadiosBox} style={RadiosBoxStyle}>
{radioOptions.map((options, index) => { {radioOptions.map((options) => {
return ( return (
<>
<div <div
key={options.value} key={options.value}
className={classnames({ className={classnames({
...@@ -54,17 +42,6 @@ const RadioGroupOfButtonStyle = (props: IRadioGroupOfButtonStyleProps) => { ...@@ -54,17 +42,6 @@ const RadioGroupOfButtonStyle = (props: IRadioGroupOfButtonStyleProps) => {
> >
{options.label} {options.label}
</div> </div>
<div
className={classnames({
[style.border]: true,
[style.borderHidden]: !(
index !== radioOptions.length - 1 &&
index !== activeIndex &&
index !== activeIndex - 1
),
})}
></div>
</>
); );
})} })}
</div> </div>
......
...@@ -66,7 +66,6 @@ const MySnackbarProvider = ({ ...@@ -66,7 +66,6 @@ const MySnackbarProvider = ({
}: MySnackbarProviderProp) => { }: MySnackbarProviderProp) => {
const { const {
open, open,
setOpen,
messageInfo, messageInfo,
handleExited, handleExited,
success, success,
...@@ -75,46 +74,31 @@ const MySnackbarProvider = ({ ...@@ -75,46 +74,31 @@ const MySnackbarProvider = ({
info, info,
close, close,
} = useMySnackbar(); } = useMySnackbar();
// .MuiAlert-filledInfo
const getColorStyle = useMemo(() => {
if (messageInfo.severity === "success") {
return "#02AB83";
}
if (messageInfo.severity === "info") {
return "#1370FF";
}
if (messageInfo.severity === "warning") {
return "#FFB919";
}
if (messageInfo.severity === "error") {
return "#FF4E4E";
}
}, [messageInfo.severity]);
const theme = createTheme({ const theme = createTheme({
components: { components: {
MuiAlert: { MuiAlert: {
styleOverrides: { styleOverrides: {
root: { root: {
minWidth: "360px", color: getColorStyle,
maxWidth: "542px",
minHeight: "38px",
boxShadow: "none",
"& .MuiAlert-action": {
paddingLeft: "60px",
},
"&.MuiAlert-standardError": {
color: "#FF4E4E",
background: "rgba(255, 237, 237, 1)",
"& .MuiAlert-icon": { "& .MuiAlert-icon": {
color: "#FF4E4E", color: getColorStyle,
},
},
"&.MuiAlert-standardInfo": {
color: "rgba(19, 112, 255, 1)",
background: "rgba(235, 243, 255, 1)",
"& .MuiAlert-icon": {
color: "rgba(19, 112, 255, 1)",
},
},
"&.MuiAlert-standardSuccess": {
color: "rgba(2, 171, 131, 1)",
background: "rgba(217, 255, 238, 1)",
"& .MuiAlert-icon": {
color: "rgba(2, 171, 131, 1)",
},
},
"&.MuiAlert-standardWarning": {
color: "rgba(255, 185, 25, 1)",
background: "rgba(255, 246, 226, 1)",
"& .MuiAlert-icon": {
color: "rgba(255, 185, 25, 1)",
},
}, },
}, },
}, },
...@@ -153,10 +137,7 @@ const MySnackbarProvider = ({ ...@@ -153,10 +137,7 @@ const MySnackbarProvider = ({
severity={messageInfo?.severity} severity={messageInfo?.severity}
variant={variant} variant={variant}
elevation={elevation} elevation={elevation}
sx={{ ...alertSx }} sx={{ boxShadow: "unset", ...alertSx }}
onClose={() => {
setOpen(false);
}}
> >
{messageInfo?.content} {messageInfo?.content}
</Alert> </Alert>
......
...@@ -69,7 +69,6 @@ const useMySnackbar = () => { ...@@ -69,7 +69,6 @@ const useMySnackbar = () => {
return { return {
open, open,
setOpen,
messageInfo, messageInfo,
handleExited, handleExited,
success, success,
......
...@@ -47,14 +47,12 @@ const theme = createTheme({ ...@@ -47,14 +47,12 @@ const theme = createTheme({
styleOverrides: { styleOverrides: {
root: { root: {
minWidth: "48px", minWidth: "48px",
boxShadow: "none !important",
"&.MuiButton-textError": { "&.MuiButton-textError": {
color: "rgba(255, 78, 78, 1)", color: "rgba(255, 78, 78, 1)",
}, },
"&.MuiButton-outlinedError": { "&.MuiButton-outlinedError": {
color: "rgba(255, 78, 78, 1)", color: "rgba(255, 78, 78, 1)",
border: "1px solid rgba(255, 78, 78, 1)", border: "1px solid rgba(255, 78, 78, 1)",
"&:hover": { backgroundColor: 'transparent' },
}, },
"& .MuiLoadingButton-loadingIndicator": { "& .MuiLoadingButton-loadingIndicator": {
color: "#fff", color: "#fff",
...@@ -69,6 +67,7 @@ const theme = createTheme({ ...@@ -69,6 +67,7 @@ const theme = createTheme({
outlined: { outlined: {
backgroundColor: "#FFFFFF", backgroundColor: "#FFFFFF",
border: "1px solid #1370FF", border: "1px solid #1370FF",
boxShadow: "none !important",
color: "#1370FF", color: "#1370FF",
"&:hover": { backgroundColor: "#ECF4FF " }, "&:hover": { backgroundColor: "#ECF4FF " },
"&.MuiButton-textError": { "&.MuiButton-textError": {
...@@ -77,6 +76,7 @@ const theme = createTheme({ ...@@ -77,6 +76,7 @@ const theme = createTheme({
}, },
text: { text: {
backgroundColor: "transparent", backgroundColor: "transparent",
boxShadow: "none !important",
color: "#1370FF", color: "#1370FF",
"&:hover": { backgroundColor: "#ECF4FF " }, "&:hover": { backgroundColor: "#ECF4FF " },
}, },
...@@ -95,6 +95,7 @@ const theme = createTheme({ ...@@ -95,6 +95,7 @@ const theme = createTheme({
}, },
outlinedSecondary: { outlinedSecondary: {
border: "1px solid rgba(221, 225, 230, 1)", border: "1px solid rgba(221, 225, 230, 1)",
boxShadow: "none !important",
color: "rgba(30, 38, 51, 1)", color: "rgba(30, 38, 51, 1)",
"&:hover": { "&:hover": {
backgroundColor: "rgba(240, 242, 245, 1) ", backgroundColor: "rgba(240, 242, 245, 1) ",
...@@ -103,6 +104,7 @@ const theme = createTheme({ ...@@ -103,6 +104,7 @@ const theme = createTheme({
}, },
textSecondary: { textSecondary: {
backgroundColor: "transparent", backgroundColor: "transparent",
boxShadow: "none !important",
color: "#FF4E4E", color: "#FF4E4E",
"&:hover": { backgroundColor: "#FFEDED " }, "&:hover": { backgroundColor: "#FFEDED " },
}, },
......
...@@ -103,7 +103,7 @@ const MyDialog: React.FunctionComponent<IDialogProps> = (props) => { ...@@ -103,7 +103,7 @@ const MyDialog: React.FunctionComponent<IDialogProps> = (props) => {
disabled={disabledConfirm} disabled={disabledConfirm}
isLoadingButton={true} isLoadingButton={true}
loading={loading} loading={loading}
style={{ marginLeft: '12px', ...okSx }} style={{ ...okSx }}
/> />
) : null} ) : null}
</DialogActions> </DialogActions>
......
...@@ -35,13 +35,9 @@ const MyInput = (props: MyInputProps) => { ...@@ -35,13 +35,9 @@ const MyInput = (props: MyInputProps) => {
root: { root: {
height: "36px", height: "36px",
fontSize: "14px", fontSize: "14px",
border: "rgba(221, 225, 230, 1)",
"&.MuiInputBase-sizeSmall": { "&.MuiInputBase-sizeSmall": {
height: "32px", height: "32px",
}, },
"& .Mui-disabled": {
background: "rgba(247, 248, 250, 1)",
},
}, },
multiline: { multiline: {
height: "auto", height: "auto",
...@@ -72,7 +68,7 @@ const MyInput = (props: MyInputProps) => { ...@@ -72,7 +68,7 @@ const MyInput = (props: MyInputProps) => {
borderWidth: "1px", borderWidth: "1px",
}, },
"& .MuiOutlinedInput-notchedOutline": { "& .MuiOutlinedInput-notchedOutline": {
borderColor: "#DDE1E6", borderColor: '#DDE1E6',
}, },
":hover": { ":hover": {
"& .MuiOutlinedInput-notchedOutline": error "& .MuiOutlinedInput-notchedOutline": error
......
...@@ -30,7 +30,6 @@ interface IMyPopconfirmProps { ...@@ -30,7 +30,6 @@ interface IMyPopconfirmProps {
showCancel?: boolean; showCancel?: boolean;
onCancel?: any; onCancel?: any;
onConfirm?: any; onConfirm?: any;
loading?: boolean;
} }
const MyPopconfirm = (props: IMyPopconfirmProps) => { const MyPopconfirm = (props: IMyPopconfirmProps) => {
...@@ -43,7 +42,6 @@ const MyPopconfirm = (props: IMyPopconfirmProps) => { ...@@ -43,7 +42,6 @@ const MyPopconfirm = (props: IMyPopconfirmProps) => {
showCancel = true, showCancel = true,
onCancel, onCancel,
onConfirm, onConfirm,
loading = false,
} = props; } = props;
const open = useMemo(() => { const open = useMemo(() => {
...@@ -99,12 +97,7 @@ const MyPopconfirm = (props: IMyPopconfirmProps) => { ...@@ -99,12 +97,7 @@ const MyPopconfirm = (props: IMyPopconfirmProps) => {
style={{ marginRight: "12px" }} style={{ marginRight: "12px" }}
/> />
)} )}
<MyButton <MyButton text={okText} onClick={handleOk} />
text={okText}
onClick={handleOk}
loading={loading}
isLoadingButton={true}
/>
</Box> </Box>
</Popper> </Popper>
); );
......
...@@ -71,14 +71,6 @@ export default function MySelect(props: IProps) { ...@@ -71,14 +71,6 @@ export default function MySelect(props: IProps) {
styleOverrides: { styleOverrides: {
root: { root: {
height: "36px", height: "36px",
"& .Mui-disabled": {
background: "rgba(247, 248, 250, 1)",
},
"& .MuiSelect-icon": {
"&.Mui-disabled": {
display: "none",
},
},
}, },
}, },
}, },
......
...@@ -138,8 +138,7 @@ export default function EnhancedTable(props: ITableProps) { ...@@ -138,8 +138,7 @@ export default function EnhancedTable(props: ITableProps) {
(rows.length === 0 && !load) && <TableRow> (rows.length === 0 && !load) && <TableRow>
<TableCell <TableCell
sx={{ sx={{
borderBottom: '1px solid #F0F2F5', borderBottom: '1px solid #F0F2F5'
textAlign: 'center'
}} }}
colSpan={headCells?.filter((k: any) => k.id === "checkbox")?.length === 0 ? headCells?.length : headCells?.length + 1} colSpan={headCells?.filter((k: any) => k.id === "checkbox")?.length === 0 ? headCells?.length : headCells?.length + 1}
className={classes.TypographyStyle} className={classes.TypographyStyle}
......
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
import { Tooltip, TooltipProps } from "@mui/material"; import { Tooltip, TooltipProps } from "@mui/material";
import { ThemeProvider, createTheme } from "@mui/material/styles"; import { ThemeProvider, createTheme } from "@mui/material/styles";
interface IMyTooltipProps extends Omit<TooltipProps, "title"> { interface IMyTooltipProps extends TooltipProps {
title?: string | boolean; title: string;
} }
const theme = createTheme({ const theme = createTheme({
...@@ -33,7 +33,7 @@ const theme = createTheme({ ...@@ -33,7 +33,7 @@ const theme = createTheme({
}); });
const MyTooltip = (props: IMyTooltipProps) => { const MyTooltip = (props: IMyTooltipProps) => {
const { title = false, children, placement = "top", ...other } = props; const { title, children, placement = "top", ...other } = props;
return ( return (
<ThemeProvider theme={theme}> <ThemeProvider theme={theme}>
<Tooltip <Tooltip
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com * @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-05-31 10:18:13 * @Date: 2022-05-31 10:18:13
* @LastEditors: 吴永生 15770852798@163.com * @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-08-31 20:25:56 * @LastEditTime: 2022-08-10 11:06:12
* @FilePath: /bkunyun/src/views/Project/ProjectSetting/index.tsx * @FilePath: /bkunyun/src/views/Project/ProjectSetting/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
*/ */
import { memo, useCallback } from "react"; import { memo } from "react";
import { isEqual } from "lodash"; import { isEqual } from "lodash";
import { useState } from "react"; import { useState } from "react";
import { Box } from "@mui/system"; import { Box } from "@mui/system";
...@@ -21,14 +21,11 @@ interface ITabList { ...@@ -21,14 +21,11 @@ interface ITabList {
component: JSX.Element | React.ReactNode; component: JSX.Element | React.ReactNode;
icon?: string; icon?: string;
iconed?: string; iconed?: string;
iconHover?: string;
hide?: boolean; hide?: boolean;
disabled?: boolean; disabled?: boolean;
} }
interface IProps { interface IProps {
value?: string;
onChange?: (val: string)=> void;
tabList: ITabList[]; tabList: ITabList[];
defaultValue?: string; defaultValue?: string;
tabPanelSx?: any; tabPanelSx?: any;
...@@ -73,14 +70,11 @@ const theme = createTheme({ ...@@ -73,14 +70,11 @@ const theme = createTheme({
const Tabs = (props: IProps) => { const Tabs = (props: IProps) => {
const { const {
tabList, tabList,
value,
defaultValue, defaultValue,
onChange,
allowNullValue = false, allowNullValue = false,
tabPanelSx = { padding: "24px 0 0 0" }, tabPanelSx = { padding: "24px 0 0 0" },
} = props; } = props;
const [value, setValue] = useState(
const [tabValue, setTabValue] = useState(
defaultValue defaultValue
? defaultValue ? defaultValue
: allowNullValue : allowNullValue
...@@ -88,31 +82,17 @@ const Tabs = (props: IProps) => { ...@@ -88,31 +82,17 @@ const Tabs = (props: IProps) => {
: tabList.filter((e) => !e.hide)[0].value : tabList.filter((e) => !e.hide)[0].value
); );
const [hoverValue, setHoverValue] = useState('') const onChange = (val: string) => {
setValue(val);
const onTabChange = (val: string) => {
setTabValue(val)
onChange && onChange(val);
}; };
const getImgSrc = useCallback((item: ITabList)=>{
let result = item.icon
if(value === item.value){
result = item.iconed
}
if(hoverValue === item.value){
result = item.iconHover
}
return result
},[hoverValue, value])
const labelRender = (item: ITabList, key: number) => { const labelRender = (item: ITabList, key: number) => {
return ( return (
<div style={{ display: "flex", alignItems: "center" }} onMouseOver={()=>setHoverValue(item.value)} onMouseOut={()=>setHoverValue('')}> <Box style={{ display: "flex", alignItems: "center" }}>
{item.icon ? ( {item.icon ? (
<img <img
style={{ width: "16px", marginRight: "8px" }} style={{ width: "16px", marginRight: "8px" }}
src={getImgSrc(item)} src={value === item.value ? item.iconed : item.icon}
alt="" alt=""
/> />
) : ( ) : (
...@@ -128,17 +108,17 @@ const Tabs = (props: IProps) => { ...@@ -128,17 +108,17 @@ const Tabs = (props: IProps) => {
> >
{item.label} {item.label}
</Typography> </Typography>
</div> </Box>
); );
}; };
return ( return (
<ThemeProvider theme={theme}> <ThemeProvider theme={theme}>
<TabContext value={value || tabValue}> <TabContext value={value}>
<Box sx={{ borderBottom: 1, borderColor: "#EDEFF2" }}> <Box sx={{ borderBottom: 1, borderColor: "#EDEFF2" }}>
<TabList <TabList
onChange={(e: any, val: string) => { onChange={(e: any, val: string) => {
onTabChange(val); onChange(val);
}} }}
> >
{tabList {tabList
......
...@@ -41,7 +41,9 @@ root.render( ...@@ -41,7 +41,9 @@ root.render(
<React.StrictMode> <React.StrictMode>
<ThemeProvider theme={theme}> <ThemeProvider theme={theme}>
<Provider {...stores}> <Provider {...stores}>
<MySnackbarProvider> <MySnackbarProvider
alertSx={{ boxShadow: "0px 2px 4px 0px rgb(0 0 0 / 8%)" }}
>
<MyRouter></MyRouter> <MyRouter></MyRouter>
</MySnackbarProvider> </MySnackbarProvider>
</Provider> </Provider>
......
/*
* @Author: 吴永生 15770852798@163.com
* @Date: 2022-07-11 11:49:55
* @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-08-23 16:46:45
* @FilePath: /bkunyun/src/store/modules/currentProject.ts
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import { makeAutoObservable } from "mobx"; import { makeAutoObservable } from "mobx";
type projectInfo = { type projectInfo = {
id?: string; id?: string;
...@@ -20,22 +12,14 @@ type productInfo = { ...@@ -20,22 +12,14 @@ type productInfo = {
name?: string; name?: string;
}; };
/** 用户信息 */ const sessionStorageCurrentProjectInfo = JSON.parse(
let userInfo: any; sessionStorage.getItem("currentProjectInfo") || "{}"
try {
userInfo = JSON.parse(localStorage.getItem("userInfo") || "{}");
} catch {
console.error("获取用户信息 出错");
}
const localStorageCurrentProjectInfo = JSON.parse(
localStorage.getItem(`currentProjectInfo_${userInfo.name}`) || "{}"
); );
const localStorageCurrentProductInfo = JSON.parse( const sessionStorageCurrentProductInfo = JSON.parse(
localStorage.getItem(`currentProductInfo_${userInfo.name}`) || "{}" sessionStorage.getItem("currentProductInfo") || "{}"
); );
const localStorageProjectList = JSON.parse( const sessionStorageProjectList = JSON.parse(
localStorage.getItem(`projectList_${userInfo.name}`) || "[]" sessionStorage.getItem("projectList") || "[]"
); );
class currentProject { class currentProject {
...@@ -44,22 +28,22 @@ class currentProject { ...@@ -44,22 +28,22 @@ class currentProject {
} }
// 选中的项目 // 选中的项目
currentProjectInfo: projectInfo = localStorageCurrentProjectInfo; currentProjectInfo: projectInfo = sessionStorageCurrentProjectInfo;
// 选中的产品下的项目列表 // 选中的产品下的项目列表
projectList: Array<projectInfo> = localStorageProjectList; projectList: Array<projectInfo> = sessionStorageProjectList;
// 选中的产品 // 选中的产品
currentProductInfo: productInfo = localStorageCurrentProductInfo; currentProductInfo: productInfo = sessionStorageCurrentProductInfo;
setProjectList = (list: Array<projectInfo>) => { setProjectList = (list: Array<projectInfo>) => {
this.projectList = list; this.projectList = list;
localStorage.setItem(`projectList_${userInfo.name}`, JSON.stringify(list)); sessionStorage.setItem("projectList", JSON.stringify(list));
}; };
changeProject = (project: projectInfo) => { changeProject = (project: projectInfo) => {
this.currentProjectInfo = project; this.currentProjectInfo = project;
localStorage.setItem(`currentProjectInfo_${userInfo.name}`, JSON.stringify(project)); sessionStorage.setItem("currentProjectInfo", JSON.stringify(project));
}; };
changeProductInfo = (productInfo: productInfo) => { changeProductInfo = (productInfo: productInfo) => {
this.currentProductInfo = productInfo; this.currentProductInfo = productInfo;
localStorage.setItem(`currentProductInfo_${userInfo.name}`, JSON.stringify(productInfo)); sessionStorage.setItem("currentProductInfo", JSON.stringify(productInfo));
}; };
} }
......
/* /*
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com * @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-06-07 18:37:53 * @Date: 2022-06-07 18:37:53
* @LastEditors: 吴永生 15770852798@163.com * @LastEditors: 吴永生#A02208 yongsheng.wu@wholion.com
* @LastEditTime: 2022-08-23 11:19:11 * @LastEditTime: 2022-06-15 17:49:27
* @FilePath: /bkunyun/src/utils/util.ts * @FilePath: /bkunyun/src/utils/util.ts
* @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
*/ */
...@@ -67,7 +67,7 @@ export const getTokenInfo = () => { ...@@ -67,7 +67,7 @@ export const getTokenInfo = () => {
return val; return val;
}; };
const IsNumberLetterChineseReg = new RegExp("^[A-Za-z0-9\u4e00-\u9fa5]{1,50}$"); const IsNumberLetterChineseReg = new RegExp("^[A-Za-z0-9\u4e00-\u9fa5]+$");
export const checkIsNumberLetterChinese = (string: string) => { export const checkIsNumberLetterChinese = (string: string) => {
return IsNumberLetterChineseReg.test(string); return IsNumberLetterChineseReg.test(string);
......
...@@ -14,11 +14,10 @@ import { ITask } from "@/views/Project/ProjectSubmitWork/interface"; ...@@ -14,11 +14,10 @@ import { ITask } from "@/views/Project/ProjectSubmitWork/interface";
type IProps = { type IProps = {
operatorList: ITask[]; operatorList: ITask[];
setOperatorList: any; setOperatorList: any;
setInputActive: any;
}; };
const OperatorList = (props: IProps) => { const OperatorList = (props: IProps) => {
const { operatorList, setOperatorList, setInputActive } = props; // 流程图中流算子列表 const { operatorList, setOperatorList } = props; // 流程图中流算子列表
const { currentProjectStore } = useStores(); const { currentProjectStore } = useStores();
const [list, setList] = useState<ITask[]>([]); // 算子列表 const [list, setList] = useState<ITask[]>([]); // 算子列表
const productId = toJS(currentProjectStore.currentProductInfo.id); // 产品ID const productId = toJS(currentProjectStore.currentProductInfo.id); // 产品ID
...@@ -206,12 +205,6 @@ const OperatorList = (props: IProps) => { ...@@ -206,12 +205,6 @@ const OperatorList = (props: IProps) => {
value={keyword} value={keyword}
onChange={keywordChange} onChange={keywordChange}
onKeyUp={handleKeywordKeyUp} onKeyUp={handleKeywordKeyUp}
onFocus={() => {
setInputActive(true);
}}
onBlur={() => {
setInputActive(false);
}}
sx={{ fontSize: "14px" }} sx={{ fontSize: "14px" }}
/> />
</div> </div>
......
...@@ -193,8 +193,8 @@ const SaveOperator = (props: IProps) => { ...@@ -193,8 +193,8 @@ const SaveOperator = (props: IProps) => {
<MyInput <MyInput
value={description} value={description}
id="desc" id="desc"
label="算子描述" label="模板描述"
placeholder="算子描述" placeholder="模板描述"
onChange={handleDescriptionChange} onChange={handleDescriptionChange}
multiline multiline
rows={4} rows={4}
......
...@@ -21,7 +21,6 @@ const CustomOperator = observer((props: IProps) => { ...@@ -21,7 +21,6 @@ const CustomOperator = observer((props: IProps) => {
const Message = useMessage(); const Message = useMessage();
const [operatorList, setOperatorList] = useState<ITask[]>(initOperatorList); const [operatorList, setOperatorList] = useState<ITask[]>(initOperatorList);
const [saveFormDialog, setSaveFormDialog] = useState(false); const [saveFormDialog, setSaveFormDialog] = useState(false);
const [inputActive, setInputActive] = useState(false);
// const [showCustomOperator, setShowCustomOperator] = useState(false); // const [showCustomOperator, setShowCustomOperator] = useState(false);
/** 设置选中唯一标识符 */ /** 设置选中唯一标识符 */
...@@ -101,8 +100,7 @@ const CustomOperator = observer((props: IProps) => { ...@@ -101,8 +100,7 @@ const CustomOperator = observer((props: IProps) => {
return ( return (
(outItem.domType || "").toLowerCase() === "dataset" || (outItem.domType || "").toLowerCase() === "dataset" ||
(outItem.domType || "").toLowerCase() === "file" || (outItem.domType || "").toLowerCase() === "file" ||
(outItem.domType || "").toLowerCase() === "path" || (outItem.domType || "").toLowerCase() === "path"
(outItem.domType || "").toLowerCase() === "input"
); );
}) })
) { ) {
...@@ -177,7 +175,6 @@ const CustomOperator = observer((props: IProps) => { ...@@ -177,7 +175,6 @@ const CustomOperator = observer((props: IProps) => {
<OperatorList <OperatorList
operatorList={operatorList} operatorList={operatorList}
setOperatorList={setOperatorList} setOperatorList={setOperatorList}
setInputActive={setInputActive}
/> />
<BatchOperatorFlow <BatchOperatorFlow
tasks={operatorList} tasks={operatorList}
...@@ -185,7 +182,7 @@ const CustomOperator = observer((props: IProps) => { ...@@ -185,7 +182,7 @@ const CustomOperator = observer((props: IProps) => {
type="edit" type="edit"
onFlowNodeClick={handleNodeClick} onFlowNodeClick={handleNodeClick}
flowNodeDraggable={true} flowNodeDraggable={true}
ListenState={!saveFormDialog && !inputActive} ListenState={!saveFormDialog}
showVersion={true} showVersion={true}
showControls={false} showControls={false}
/> />
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
color: #565c66; color: #565c66;
font-size: 14px; font-size: 14px;
line-height: 22px; line-height: 22px;
border-left: 3px solid #f7f8fa; border-left: 3px solid #fff;
} }
.listItem:hover { .listItem:hover {
background-color: #eef1f5; background-color: #eef1f5;
...@@ -37,5 +37,5 @@ ...@@ -37,5 +37,5 @@
.active { .active {
border-left: 3px solid #1370ff; border-left: 3px solid #1370ff;
color: #1370ff; color: #1370ff;
background-color: #e6eaf0; background-color: #ebedf0;
} }
...@@ -54,7 +54,7 @@ const AddFolder = (props: IAddFolderProps) => { ...@@ -54,7 +54,7 @@ const AddFolder = (props: IAddFolderProps) => {
refresh(); refresh();
}); });
} else { } else {
Message.error(fileNameCheck.help || "请输入文件夹名称"); Message.info(fileNameCheck.help || "请输入文件夹名称");
} }
}; };
......
...@@ -19,7 +19,6 @@ import classNames from "classnames"; ...@@ -19,7 +19,6 @@ import classNames from "classnames";
import Save from "./save"; import Save from "./save";
import NoData from "@/components/BusinessComponents/NoData"; import NoData from "@/components/BusinessComponents/NoData";
import Download from "./download"; import Download from "./download";
import MyTooltip from "@/components/mui/MyTooltip";
import style from "./index.module.css"; import style from "./index.module.css";
type ISeeDatasetProps = { type ISeeDatasetProps = {
...@@ -49,7 +48,6 @@ const SeeDataset = observer((props: ISeeDatasetProps) => { ...@@ -49,7 +48,6 @@ const SeeDataset = observer((props: ISeeDatasetProps) => {
const [saveOpen, setSaveOpen] = useState(false); // 另存为弹窗显示控制 const [saveOpen, setSaveOpen] = useState(false); // 另存为弹窗显示控制
const [downloadOpen, setDownloadOpen] = useState(false); // 下载弹窗显示控制 const [downloadOpen, setDownloadOpen] = useState(false); // 下载弹窗显示控制
const [showAnimation, setShowAnimation] = useState(true); // 弹窗动画变化中 const [showAnimation, setShowAnimation] = useState(true); // 弹窗动画变化中
const [firstGetList, setFirstGetList] = useState(true); // 第一次请求列表
// 解决图像渲染造成弹窗卡顿的问题 // 解决图像渲染造成弹窗卡顿的问题
useEffect(() => { useEffect(() => {
...@@ -105,7 +103,7 @@ const SeeDataset = observer((props: ISeeDatasetProps) => { ...@@ -105,7 +103,7 @@ const SeeDataset = observer((props: ISeeDatasetProps) => {
name: name, name: name,
page: paramsPage, page: paramsPage,
size, size,
index: searchDataType ? `${searchDataType}` : "", index: searchDataType ? `meta.${searchDataType}` : "",
sort: sort === "null" ? "" : sort, sort: sort === "null" ? "" : sort,
query: keyword, query: keyword,
}) })
...@@ -113,32 +111,14 @@ const SeeDataset = observer((props: ISeeDatasetProps) => { ...@@ -113,32 +111,14 @@ const SeeDataset = observer((props: ISeeDatasetProps) => {
setList(res.data.list); setList(res.data.list);
setCount(res.data.totalPage - 1); setCount(res.data.totalPage - 1);
if (res.data.list && res.data.list.length > 0) { if (res.data.list && res.data.list.length > 0) {
if (res.data.list[0]) { if (res.data.list[0].meta) {
let arr: any = []; const meta = res.data.list[0].meta;
Object.keys(res.data.list[0]).forEach((item) => { const arr = Object.keys(meta).map((item) => {
if ( return { label: item, value: item };
![
"meta",
"id",
// "canonical_smiles",
// "mol",
// "mol2",
// "pdb",
// "sdf",
// "sdf2d",
// "sdf3d",
// "smiles",
].includes(item)
) {
arr.push({ label: item, value: item });
}
}); });
if (firstGetList) {
setdataTypes(arr); setdataTypes(arr);
setSearchDataType(arr[0].value); setSearchDataType(arr[0].value);
} }
setFirstGetList(false);
}
} }
}) })
?.catch((error) => { ?.catch((error) => {
...@@ -315,7 +295,7 @@ const SeeDataset = observer((props: ISeeDatasetProps) => { ...@@ -315,7 +295,7 @@ const SeeDataset = observer((props: ISeeDatasetProps) => {
</div> </div>
{showData.length !== 0 && ( {showData.length !== 0 && (
<div className={style.datasetLiDataList}> <div className={style.datasetLiDataList}>
{Object.keys(item) {Object.keys(item.meta)
.filter((key) => showData.indexOf(key) !== -1) .filter((key) => showData.indexOf(key) !== -1)
.map((key, index) => { .map((key, index) => {
return ( return (
...@@ -328,13 +308,11 @@ const SeeDataset = observer((props: ISeeDatasetProps) => { ...@@ -328,13 +308,11 @@ const SeeDataset = observer((props: ISeeDatasetProps) => {
> >
{key} {key}
</span> </span>
<MyTooltip title={item[key]}>
<span <span
className={style.datasetLiDataLiValue} className={style.datasetLiDataLiValue}
> >
{item[key]} {item.meta[key]}
</span> </span>
</MyTooltip>
</div> </div>
); );
})} })}
......
...@@ -239,6 +239,10 @@ const UpLoaderFile = observer((props: IMoveFileProps) => { ...@@ -239,6 +239,10 @@ const UpLoaderFile = observer((props: IMoveFileProps) => {
// lineHeight: "20px", // lineHeight: "20px",
// color: "#8A9099", // color: "#8A9099",
// }} // }}
tableBodySx={{
backgroundColor:
fileList.length >= 10 ? "rgba(255, 0, 0, 0.6)" : "",
}}
tableContainerStyle={{ tableContainerStyle={{
maxHeight: "300px", maxHeight: "300px",
}} }}
......
...@@ -40,11 +40,6 @@ ...@@ -40,11 +40,6 @@
align-items: center; align-items: center;
} }
.refreshIcon {
width: 16px;
height: 16px;
}
.folderIconBox { .folderIconBox {
display: flex; display: flex;
justify-content: flex-start; justify-content: flex-start;
......
...@@ -2,9 +2,9 @@ import React, { useState, useCallback, useEffect, useMemo } from "react"; ...@@ -2,9 +2,9 @@ import React, { useState, useCallback, useEffect, useMemo } from "react";
import style from "./index.module.css"; import style from "./index.module.css";
import classnames from "classnames"; import classnames from "classnames";
import { IconButton } from "@mui/material"; import { IconButton } from "@mui/material";
import RefreshIcon from "@mui/icons-material/Refresh";
import MyTable from "@/components/mui/MyTable"; import MyTable from "@/components/mui/MyTable";
import dataSetIcon from "@/assets/project/dataSetIcon.svg"; import dataSetIcon from "@/assets/project/dataSetIcon.svg";
import refresh from "@/assets/project/refresh.svg";
import fileIcon from "@/assets/project/fileIcon.svg"; import fileIcon from "@/assets/project/fileIcon.svg";
import folderIcon from "@/assets/project/folderIcon.svg"; import folderIcon from "@/assets/project/folderIcon.svg";
import noFile from "@/assets/project/noFile.svg"; import noFile from "@/assets/project/noFile.svg";
...@@ -68,7 +68,6 @@ const ProjectData = observer(() => { ...@@ -68,7 +68,6 @@ const ProjectData = observer(() => {
useEffect(() => { useEffect(() => {
const locationInfo: any = location?.state; const locationInfo: any = location?.state;
setActiveTab(locationInfo?.dataType || "file");
setPath(locationInfo?.pathName || "/"); setPath(locationInfo?.pathName || "/");
}, [location]); }, [location]);
...@@ -557,17 +556,12 @@ const ProjectData = observer(() => { ...@@ -557,17 +556,12 @@ const ProjectData = observer(() => {
size="small" size="small"
onClick={handleRefresh} onClick={handleRefresh}
disabled={!isPass("PROJECT_DATA_REFRESH", "USER")} disabled={!isPass("PROJECT_DATA_REFRESH", "USER")}
sx={{ sx={{ marginLeft: "17px", width: '32px', height: '32px', ":hover": {
marginLeft: "12px", backgroundColor: "#F0F2F5 ",
width: "32px", borderRadius: 2
height: "32px", } }}
":hover": {
backgroundColor: "rgba(240, 242, 245, 1)",
borderRadius: "4px",
},
}}
> >
<img className={style.refreshIcon} src={refresh} alt="" /> <RefreshIcon sx={{ fontSize: "18px" }} />
</IconButton> </IconButton>
</div> </div>
</div> </div>
......
...@@ -74,13 +74,6 @@ ...@@ -74,13 +74,6 @@
color: rgba(19, 112, 255, 1); color: rgba(19, 112, 255, 1);
font-size: 14px; font-size: 14px;
} }
.outputItemName{
max-width: 172px;
white-space: nowrap;
display: block;
overflow: hidden;
text-overflow: ellipsis;
}
.outputLiLeftImg { .outputLiLeftImg {
margin-right: 12px; margin-right: 12px;
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com * @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-06-21 20:03:56 * @Date: 2022-06-21 20:03:56
* @LastEditors: 吴永生 15770852798@163.com * @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-08-23 19:27:18 * @LastEditTime: 2022-08-15 17:18:49
* @FilePath: /bkunyun/src/views/Project/ProjectSubmitWork/index.tsx * @FilePath: /bkunyun/src/views/Project/ProjectSubmitWork/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
*/ */
...@@ -47,7 +47,6 @@ import { getConnectionArr, getDatasetName, getDatasetPath, getSameBatch } from " ...@@ -47,7 +47,6 @@ import { getConnectionArr, getDatasetName, getDatasetPath, getSameBatch } from "
import styles from "./index.module.css"; import styles from "./index.module.css";
const stateMap = { const stateMap = {
SUBMITTED:"正在启动",
RUNNING: "正在运行", RUNNING: "正在运行",
ABORTED: "运行终止", ABORTED: "运行终止",
FAILED: "运行失败", FAILED: "运行失败",
...@@ -350,6 +349,17 @@ const ProjectSubmitWork = observer(() => { ...@@ -350,6 +349,17 @@ const ProjectSubmitWork = observer(() => {
setShowOptions(!showOptions); setShowOptions(!showOptions);
}; };
const handleDownLoad = (path: string) => {
if (path.indexOf("/ProjectData") !== -1) {
path = path.slice(12);
}
CloudEController.JobFileDownload(
path,
fileToken as string,
projectId as string
);
};
/** 终止任务 */ /** 终止任务 */
const onStopJob = useCallback(() => { const onStopJob = useCallback(() => {
cancelWorkJob({ cancelWorkJob({
...@@ -365,7 +375,7 @@ const ProjectSubmitWork = observer(() => { ...@@ -365,7 +375,7 @@ const ProjectSubmitWork = observer(() => {
}, [deleteWorkJob, workFlowJobInfo?.id]); }, [deleteWorkJob, workFlowJobInfo?.id]);
const returnPermission = useMemo(() => { const returnPermission = useMemo(() => {
if (['SUBMITTED', 'RUNNING'].includes(state || '')) { if (state === "RUNNING") {
return isPass("PROJECT_WORKBENCH_JOBS_STOP", "USER"); return isPass("PROJECT_WORKBENCH_JOBS_STOP", "USER");
} else { } else {
return isPass("PROJECT_WORKBENCH_JOBS_DELETE", "MANAGER"); return isPass("PROJECT_WORKBENCH_JOBS_DELETE", "MANAGER");
...@@ -436,13 +446,13 @@ const ProjectSubmitWork = observer(() => { ...@@ -436,13 +446,13 @@ const ProjectSubmitWork = observer(() => {
}} }}
> */} > */}
<MyButton <MyButton
text={['SUBMITTED', 'RUNNING'].includes(state || '') ? "终止" : "删除"} text={state === "RUNNING" ? "终止" : "删除"}
variant="outlined" variant="outlined"
color="secondary" color="secondary"
onClick={(e: any) => onClick={(e: any) =>
handleShowPopper( handleShowPopper(
e, e,
['SUBMITTED', 'RUNNING'].includes(state || '') state === "RUNNING"
? "正在运行的任务终止后将无法重新运行,确认继续吗?" ? "正在运行的任务终止后将无法重新运行,确认继续吗?"
: "任务被删除后将无法恢复,确认继续吗?" : "任务被删除后将无法恢复,确认继续吗?"
) )
...@@ -480,7 +490,7 @@ const ProjectSubmitWork = observer(() => { ...@@ -480,7 +490,7 @@ const ProjectSubmitWork = observer(() => {
} }
alt="" alt=""
/> />
<span className={styles.outputItemName}>{item.name}</span> {item.name}
</div> </div>
{/* </MyPopconfirm> */} {/* </MyPopconfirm> */}
<span className={styles.outputLiRight}> <span className={styles.outputLiRight}>
...@@ -541,7 +551,7 @@ const ProjectSubmitWork = observer(() => { ...@@ -541,7 +551,7 @@ const ProjectSubmitWork = observer(() => {
alt="" alt=""
/> />
)} )}
{['SUBMITTED', 'RUNNING'].includes(state || '') && ( {state === "RUNNING" && (
<img <img
className={styles.taskInfoValueIcon} className={styles.taskInfoValueIcon}
src={jobRun} src={jobRun}
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 吴永生 15770852798@163.com * @Author: 吴永生 15770852798@163.com
* @Date: 2022-08-15 15:03:10 * @Date: 2022-08-15 15:03:10
* @LastEditors: 吴永生 15770852798@163.com * @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-08-23 19:39:21 * @LastEditTime: 2022-08-15 15:43:16
* @FilePath: /bkunyun/src/views/Project/ProjectJobDetail/utils.ts * @FilePath: /bkunyun/src/views/Project/ProjectJobDetail/utils.ts
* @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
*/ */
...@@ -26,12 +26,13 @@ export const getDatasetPath = (path: string) => { ...@@ -26,12 +26,13 @@ export const getDatasetPath = (path: string) => {
// 根据outputs的路径获取数据集的名称 // 根据outputs的路径获取数据集的名称
export const getDatasetName = (path: string) => { export const getDatasetName = (path: string) => {
let name=''; let name = "";
const arr = path.split('/.dataset/'); let nameIndex = path.indexOf("/.dataset/") + 10;
if(arr.length === 2) { const lastIndex = path.lastIndexOf("/");
name = arr[1] if (nameIndex !== -1 && lastIndex !== -1) {
name = path.slice(nameIndex, lastIndex);
} }
return name return name;
}; };
/** 根据批节点 判断是否在同一个批 */ /** 根据批节点 判断是否在同一个批 */
......
...@@ -47,18 +47,21 @@ const TaskCard = (props: TaskCardProps) => { ...@@ -47,18 +47,21 @@ const TaskCard = (props: TaskCardProps) => {
} }
}, [outputs]) }, [outputs])
// 结果文件跳转 // 结果文件跳转
const goToProjectData = (info: any) => { const goToProjectData = (path: string) => {
let { path = '' , type = '' } = info
const lastIndex = path.lastIndexOf("/"); const lastIndex = path.lastIndexOf("/");
// /projectData
// dataType
if (lastIndex !== -1) { if (lastIndex !== -1) {
path = path.slice(0, lastIndex); path = path.slice(0, lastIndex);
} }
path = path.slice(12); path = path.slice(12);
if (path) {
navigate(`/product/cadd/projectData`, { navigate(`/product/cadd/projectData`, {
state: { pathName: path || '/', dataType: type }, state: { pathName: path },
}); });
} else {
navigate(`/product/cadd/projectData`, {
state: { pathName: "/" },
});
}
} }
// 跳转详情页 // 跳转详情页
const gotoDetail = (id: string) => { const gotoDetail = (id: string) => {
...@@ -84,8 +87,6 @@ const TaskCard = (props: TaskCardProps) => { ...@@ -84,8 +87,6 @@ const TaskCard = (props: TaskCardProps) => {
// 渲染状态 // 渲染状态
const renderStatusText = (data: string) => { const renderStatusText = (data: string) => {
switch (data) { switch (data) {
case "SUBMITTED":
return "正在启动";
case "RUNNING": case "RUNNING":
return '正在运行' return '正在运行'
case "ABORTED": case "ABORTED":
...@@ -174,15 +175,15 @@ const TaskCard = (props: TaskCardProps) => { ...@@ -174,15 +175,15 @@ const TaskCard = (props: TaskCardProps) => {
{randerOutputs.length === 0 ? <div className={style.noResult}>暂无结果文件</div> : {randerOutputs.length === 0 ? <div className={style.noResult}>暂无结果文件</div> :
<div className={style.resultBox}> <div className={style.resultBox}>
{randerOutputs.map((item, index) => { {randerOutputs.map((item, index) => {
return <div key={index} className={style.result} onClick={() => goToProjectData(item)}> return <div key={index} className={style.result} onClick={() => goToProjectData(item.path)}>
<img <img
className={style.outputLeftImg} className={style.outputLeftImg}
src={ src={
item?.type === "file" ? fileIcon : dataSetIcon item.type === "file" ? fileIcon : dataSetIcon
} }
alt="" alt=""
/> />
{item?.name}</div> {item.name}</div>
})} })}
</div> </div>
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
justify-content: space-between; justify-content: space-between;
margin: 24px 24px 0 24px; margin: 24px 24px 0 24px;
padding-bottom: 20px; padding-bottom: 20px;
border-bottom: 1px solid #EDEFF2; border-bottom: 1px solid #F0F2F5;
} }
.basicInformationRight { .basicInformationRight {
......
...@@ -37,8 +37,11 @@ ...@@ -37,8 +37,11 @@
border: 2px solid #136efa; border: 2px solid #136efa;
} }
.projectInfoTextarea { .projectInfoTextarea {
position: relative; line-height: 22px;
width: 560px; height: 82px;
padding: 7px 12px;
resize: none;
font-size: 14px;
} }
.projectInfoSelect { .projectInfoSelect {
width: 560px; width: 560px;
......
...@@ -184,12 +184,10 @@ const BaseInfo = observer(() => { ...@@ -184,12 +184,10 @@ const BaseInfo = observer(() => {
}; };
const descChange = (e: any) => { const descChange = (e: any) => {
if (e.target.value.length <= 100) {
setProjectInfo({ setProjectInfo({
...projectInfo, ...projectInfo,
desc: e.target.value, desc: e.target.value,
}); });
}
}; };
const checkBudget = (budget: string, showMessage = false) => { const checkBudget = (budget: string, showMessage = false) => {
...@@ -339,30 +337,16 @@ const BaseInfo = observer(() => { ...@@ -339,30 +337,16 @@ const BaseInfo = observer(() => {
</div> </div>
<div className={style.projectInfoListLi}> <div className={style.projectInfoListLi}>
<div className={style.projectInfoListLiLabel}>项目描述</div> <div className={style.projectInfoListLiLabel}>项目描述</div>
<div <textarea
value={projectInfo.desc}
className={classnames({ className={classnames({
[style.projectInfoListLiValue]: true,
[style.projectInfoTextarea]: true, [style.projectInfoTextarea]: true,
})} })}
>
<MyInput
value={projectInfo.desc}
id="desc"
placeholder="项目描述限制100字以内"
onChange={descChange} onChange={descChange}
multiline placeholder="项目描述限制300字以内"
rows={4} maxLength={300}
/> ></textarea>
<span
style={{
position: "absolute",
bottom: "7px",
right: "12px",
color: projectInfo.desc.length >= 100 ? "#d32f2f" : "#C2C6CC",
}}
>
{projectInfo.desc.length}/100
</span>
</div>
</div> </div>
<div className={style.projectInfoListLi}> <div className={style.projectInfoListLi}>
<div className={style.projectInfoListLiLabel}>计算区</div> <div className={style.projectInfoListLiLabel}>计算区</div>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com * @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-05-31 10:18:13 * @Date: 2022-05-31 10:18:13
* @LastEditors: 吴永生 15770852798@163.com * @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-08-31 18:27:26 * @LastEditTime: 2022-08-03 14:29:19
* @FilePath: /bkunyun/src/views/Project/ProjectSetting/index.tsx * @FilePath: /bkunyun/src/views/Project/ProjectSetting/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
*/ */
...@@ -79,7 +79,15 @@ const AddMember = observer((props: IProps) => { ...@@ -79,7 +79,15 @@ const AddMember = observer((props: IProps) => {
useEffect(() => { useEffect(() => {
if (addMemberDialog) { if (addMemberDialog) {
http.get<IResponse<any>>("/cpp/project/listroles").then((res) => { http.get<IResponse<any>>("/cpp/project/listroles").then((res) => {
setSelectOptions(res.data); const arr = [];
const { data } = res;
for (const key in data) {
arr.push({
label: String(data[key]),
value: key,
});
}
setSelectOptions(arr);
}); });
} }
}, [addMemberDialog, http]); }, [addMemberDialog, http]);
...@@ -162,7 +170,6 @@ const AddMember = observer((props: IProps) => { ...@@ -162,7 +170,6 @@ const AddMember = observer((props: IProps) => {
/> />
<div style={{ overflowY: "scroll", maxHeight: 400 }}> <div style={{ overflowY: "scroll", maxHeight: 400 }}>
<MyTable <MyTable
tableContainerStyle={{height: 346}}
checkboxData={(val: string[]) => setCheckData(val)} checkboxData={(val: string[]) => setCheckData(val)}
param="username" param="username"
disabledParam={"enabled"} disabledParam={"enabled"}
......
...@@ -23,11 +23,11 @@ type ConfigFormProps = { ...@@ -23,11 +23,11 @@ type ConfigFormProps = {
templateConfigInfo?: ITemplateConfig; templateConfigInfo?: ITemplateConfig;
setParameter: any; setParameter: any;
onRef?: React.Ref<any>; onRef?: React.Ref<any>;
setExternalSelectedNodeId: (val: string) => void; setSelectedBatchNodeId: (val: string) => void;
}; };
const ConfigForm = (props: ConfigFormProps) => { const ConfigForm = (props: ConfigFormProps) => {
const { templateConfigInfo, setParameter, setExternalSelectedNodeId } = props; const { templateConfigInfo, setParameter, setSelectedBatchNodeId } = props;
const [name, setName] = useState<string>(""); // 任务名称 const [name, setName] = useState<string>(""); // 任务名称
const [fileSelectType, setFileSelectType] = useState<FileSelectType>("path"); const [fileSelectType, setFileSelectType] = useState<FileSelectType>("path");
...@@ -192,6 +192,7 @@ const ConfigForm = (props: ConfigFormProps) => { ...@@ -192,6 +192,7 @@ const ConfigForm = (props: ConfigFormProps) => {
const randerParameters = ( const randerParameters = (
parameters: Array<IParameter>, parameters: Array<IParameter>,
taskId: string, taskId: string,
batchId?: string
) => { ) => {
return parameters return parameters
.filter((parameter) => parameter.hidden === false) .filter((parameter) => parameter.hidden === false)
...@@ -207,20 +208,17 @@ const ConfigForm = (props: ConfigFormProps) => { ...@@ -207,20 +208,17 @@ const ConfigForm = (props: ConfigFormProps) => {
[styles.required]: parameter.required, [styles.required]: parameter.required,
})} })}
> >
{parameter.title} {parameter.name}
<span className={styles.parameterDataType}> <span className={styles.parameterDataType}>
{parameter.classTypeName} {parameter.classTypeName}
</span> </span>
</div> </div>
<MyTooltip <MyTooltip title={parameter.description} placement="right">
title={parameter.description || parameter.name}
placement="right"
>
<div className={styles.parameterContent}> <div className={styles.parameterContent}>
{(parameter.domType || "").toLowerCase() === "file" && ( {(parameter.domType || "").toLowerCase() === "file" && (
<MyInput <MyInput
onClick={() => { onClick={() => {
setExternalSelectedNodeId(taskId || ""); setSelectedBatchNodeId(batchId || "");
setFileSelectType("file"); setFileSelectType("file");
handleOpenFileSelect(taskId, parameter.name); handleOpenFileSelect(taskId, parameter.name);
}} }}
...@@ -243,7 +241,7 @@ const ConfigForm = (props: ConfigFormProps) => { ...@@ -243,7 +241,7 @@ const ConfigForm = (props: ConfigFormProps) => {
{(parameter.domType || "").toLowerCase() === "path" && ( {(parameter.domType || "").toLowerCase() === "path" && (
<MyInput <MyInput
onClick={() => { onClick={() => {
setExternalSelectedNodeId(taskId || ""); setSelectedBatchNodeId(batchId || "");
setFileSelectType("path"); setFileSelectType("path");
handleOpenFileSelect(taskId, parameter.name); handleOpenFileSelect(taskId, parameter.name);
}} }}
...@@ -266,7 +264,7 @@ const ConfigForm = (props: ConfigFormProps) => { ...@@ -266,7 +264,7 @@ const ConfigForm = (props: ConfigFormProps) => {
{(parameter.domType || "").toLowerCase() === "dataset" && ( {(parameter.domType || "").toLowerCase() === "dataset" && (
<MyInput <MyInput
onClick={() => { onClick={() => {
setExternalSelectedNodeId(taskId); setSelectedBatchNodeId(taskId);
setFileSelectType("dataset"); setFileSelectType("dataset");
handleOpenFileSelect(taskId, parameter.name); handleOpenFileSelect(taskId, parameter.name);
}} }}
...@@ -289,9 +287,10 @@ const ConfigForm = (props: ConfigFormProps) => { ...@@ -289,9 +287,10 @@ const ConfigForm = (props: ConfigFormProps) => {
{(parameter.domType || "").toLowerCase() === "input" && ( {(parameter.domType || "").toLowerCase() === "input" && (
<MyInput <MyInput
onFocus={() => { onFocus={() => {
setExternalSelectedNodeId(taskId || ""); setSelectedBatchNodeId(batchId || "");
console.log(batchId, "111");
}} }}
onBlur={() => setExternalSelectedNodeId("")} onBlur={() => setSelectedBatchNodeId("")}
value={parameter.value || ""} value={parameter.value || ""}
onChange={(e: any) => onChange={(e: any) =>
handleParameterChange(e, taskId, parameter.name || "") handleParameterChange(e, taskId, parameter.name || "")
...@@ -304,8 +303,8 @@ const ConfigForm = (props: ConfigFormProps) => { ...@@ -304,8 +303,8 @@ const ConfigForm = (props: ConfigFormProps) => {
)} )}
{(parameter.domType || "").toLowerCase() === "select" && ( {(parameter.domType || "").toLowerCase() === "select" && (
<MySelect <MySelect
onFocus={() => setExternalSelectedNodeId(taskId || "")} onFocus={() => setSelectedBatchNodeId(batchId || "")}
onBlur={() => setExternalSelectedNodeId("")} onBlur={() => setSelectedBatchNodeId("")}
value={parameter.value} value={parameter.value}
onChange={(e: any) => onChange={(e: any) =>
handleParameterChange( handleParameterChange(
...@@ -327,8 +326,8 @@ const ConfigForm = (props: ConfigFormProps) => { ...@@ -327,8 +326,8 @@ const ConfigForm = (props: ConfigFormProps) => {
{(parameter.domType || "").toLowerCase() === {(parameter.domType || "").toLowerCase() ===
"multipleselect" && ( "multipleselect" && (
<MySelect <MySelect
onFocus={() => setExternalSelectedNodeId(taskId || "")} onFocus={() => setSelectedBatchNodeId(batchId || "")}
onBlur={() => setExternalSelectedNodeId("")} onBlur={() => setSelectedBatchNodeId("")}
value={parameter.value} value={parameter.value}
onChange={(e: any) => onChange={(e: any) =>
handleParameterChange( handleParameterChange(
...@@ -354,8 +353,8 @@ const ConfigForm = (props: ConfigFormProps) => { ...@@ -354,8 +353,8 @@ const ConfigForm = (props: ConfigFormProps) => {
onChange={(e: any) => onChange={(e: any) =>
handleParameterChange(e, taskId, parameter.name || "") handleParameterChange(e, taskId, parameter.name || "")
} }
onFocus={() => setExternalSelectedNodeId(taskId || "")} onFocus={() => setSelectedBatchNodeId(batchId || "")}
onBlur={() => setExternalSelectedNodeId("")} onBlur={() => setSelectedBatchNodeId("")}
options={parameter?.choices || []} options={parameter?.choices || []}
error={parameter.error || false} error={parameter.error || false}
helperText={parameter.helperText} helperText={parameter.helperText}
...@@ -376,8 +375,8 @@ const ConfigForm = (props: ConfigFormProps) => { ...@@ -376,8 +375,8 @@ const ConfigForm = (props: ConfigFormProps) => {
) )
} }
options={parameter?.choices || []} options={parameter?.choices || []}
onFocus={() => setExternalSelectedNodeId(taskId || "")} onFocus={() => setSelectedBatchNodeId(batchId || "")}
onBlur={() => setExternalSelectedNodeId("")} onBlur={() => setSelectedBatchNodeId("")}
error={parameter.error || false} error={parameter.error || false}
helperText={parameter.helperText} helperText={parameter.helperText}
/> />
...@@ -446,7 +445,7 @@ const ConfigForm = (props: ConfigFormProps) => { ...@@ -446,7 +445,7 @@ const ConfigForm = (props: ConfigFormProps) => {
<MyInput <MyInput
value={outputPath || ""} value={outputPath || ""}
onClick={() => { onClick={() => {
setExternalSelectedNodeId(""); setSelectedBatchNodeId("");
setFileSelectType("path"); setFileSelectType("path");
handleOpenFileSelect(); handleOpenFileSelect();
}} }}
...@@ -495,10 +494,7 @@ const ConfigForm = (props: ConfigFormProps) => { ...@@ -495,10 +494,7 @@ const ConfigForm = (props: ConfigFormProps) => {
/> />
</div> </div>
<div className={styles.taskConfigBox}> <div className={styles.taskConfigBox}>
{randerParameters( {randerParameters(task.parameters, task.id, task.id)}
task.parameters.filter((parameter) => !parameter?.thrown),
task.id,
)}
{task.flows.map((flow) => { {task.flows.map((flow) => {
if ( if (
flow.parameters.filter( flow.parameters.filter(
...@@ -508,7 +504,7 @@ const ConfigForm = (props: ConfigFormProps) => { ...@@ -508,7 +504,7 @@ const ConfigForm = (props: ConfigFormProps) => {
return null; return null;
} }
return ( return (
<div className={styles.flowConfigBox} key={flow.id} id={`point${flow.id}`}> <div className={styles.flowConfigBox} key={flow.id}>
<div className={styles.flowTitle}> <div className={styles.flowTitle}>
{flow.title} {flow.title}
{flow.description && ( {flow.description && (
...@@ -524,6 +520,7 @@ const ConfigForm = (props: ConfigFormProps) => { ...@@ -524,6 +520,7 @@ const ConfigForm = (props: ConfigFormProps) => {
{randerParameters( {randerParameters(
flow.parameters, flow.parameters,
flow.id, flow.id,
flow.parentNode ? flow.parentNode : flow.id
)} )}
</div> </div>
); );
......
...@@ -12,11 +12,11 @@ import { ITemplateConfig } from "../interface"; ...@@ -12,11 +12,11 @@ import { ITemplateConfig } from "../interface";
interface IProps { interface IProps {
templateConfigInfo?: ITemplateConfig; templateConfigInfo?: ITemplateConfig;
setExternalSelectedNodeId?: (val: string) => void; setSelectedBatchNodeId?: (val: string) => void;
externalSelectedNodeId?: string; selectedBatchNodeId?: string;
} }
const WorkFlow = (props: IProps) => { const WorkFlow = (props: IProps) => {
const { templateConfigInfo, setExternalSelectedNodeId, externalSelectedNodeId } = const { templateConfigInfo, setSelectedBatchNodeId, selectedBatchNodeId } =
props; props;
/** 页面刷新提醒 */ /** 页面刷新提醒 */
...@@ -36,8 +36,8 @@ const WorkFlow = (props: IProps) => { ...@@ -36,8 +36,8 @@ const WorkFlow = (props: IProps) => {
return ( return (
<Flow <Flow
tasks={templateConfigInfo?.tasks} tasks={templateConfigInfo?.tasks}
setExternalSelectedNodeId={setExternalSelectedNodeId} setSelectedBatchNodeId={setSelectedBatchNodeId}
externalSelectedNodeId={externalSelectedNodeId} selectedBatchNodeId={selectedBatchNodeId}
/> />
); );
}; };
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com * @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-06-21 20:03:56 * @Date: 2022-06-21 20:03:56
* @LastEditors: 吴永生 15770852798@163.com * @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-08-17 10:58:02 * @LastEditTime: 2022-08-08 16:41:20
* @FilePath: /bkunyun/src/views/Project/ProjectSubmitWork/index.tsx * @FilePath: /bkunyun/src/views/Project/ProjectSubmitWork/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
*/ */
...@@ -42,8 +42,7 @@ const ProjectSubmitWork = observer(() => { ...@@ -42,8 +42,7 @@ const ProjectSubmitWork = observer(() => {
let configFormRef: any = React.createRef(); let configFormRef: any = React.createRef();
/** 是否全屏 */ /** 是否全屏 */
const [fullScreenShow, setFullScreenShow] = useState<boolean>(false); const [fullScreenShow, setFullScreenShow] = useState<boolean>(false);
const [externalSelectedNodeId, setExternalSelectedNodeId] = const [selectedBatchNodeId, setSelectedBatchNodeId] = useState<string>("");
useState<string>("");
// 前往工作台 // 前往工作台
const goToWorkbench = (toWorkbenchList = false) => { const goToWorkbench = (toWorkbenchList = false) => {
...@@ -75,8 +74,6 @@ const ProjectSubmitWork = observer(() => { ...@@ -75,8 +74,6 @@ const ProjectSubmitWork = observer(() => {
(parameter.domType || "").toLowerCase() === "checkbox" (parameter.domType || "").toLowerCase() === "checkbox"
) { ) {
value = parameter.defaultValue.split(","); value = parameter.defaultValue.split(",");
} else if ((parameter.domType || "").toLowerCase() === "input") {
value = String(parameter.defaultValue);
} else { } else {
value = parameter.defaultValue; value = parameter.defaultValue;
} }
...@@ -85,13 +82,6 @@ const ProjectSubmitWork = observer(() => { ...@@ -85,13 +82,6 @@ const ProjectSubmitWork = observer(() => {
(parameter.domType || "").toLowerCase() === "checkbox" (parameter.domType || "").toLowerCase() === "checkbox"
) { ) {
value = []; value = [];
} else if ((parameter.domType || "").toLowerCase() === "input") {
value =
String(parameter.defaultValue) === "null"
? ""
: String(parameter.defaultValue);
} else if ((parameter.domType || "").toLowerCase() === "radio") {
value = false;
} else { } else {
value = ""; value = "";
} }
...@@ -116,7 +106,7 @@ const ProjectSubmitWork = observer(() => { ...@@ -116,7 +106,7 @@ const ProjectSubmitWork = observer(() => {
}, },
}); });
const { run: submitWorkFlowRun, loading } = useMyRequest(submitWorkFlow, { const { run: submitWorkFlowRun } = useMyRequest(submitWorkFlow, {
onSuccess: (res) => { onSuccess: (res) => {
Message.success("提交成功"); Message.success("提交成功");
goToWorkbench(true); goToWorkbench(true);
...@@ -167,9 +157,6 @@ const ProjectSubmitWork = observer(() => { ...@@ -167,9 +157,6 @@ const ProjectSubmitWork = observer(() => {
tack.parameters tack.parameters
.filter((parameter) => parameter.hidden === false) .filter((parameter) => parameter.hidden === false)
.forEach((parameter) => { .forEach((parameter) => {
if (tack.type === "BATCH" && parameter?.thrown) {
return;
}
const checkResult = getCheckResult(parameter, parameter.value); const checkResult = getCheckResult(parameter, parameter.value);
parameter.error = checkResult.error; parameter.error = checkResult.error;
parameter.helperText = checkResult.helperText; parameter.helperText = checkResult.helperText;
...@@ -199,16 +186,12 @@ const ProjectSubmitWork = observer(() => { ...@@ -199,16 +186,12 @@ const ProjectSubmitWork = observer(() => {
value = `/${value}`; value = `/${value}`;
} }
if (tack.type === "BATCH") { if (tack.type === "BATCH") {
if (!parameter?.thrown) {
promotedParameters[`${tack.id}_${parameter.name}`] = { promotedParameters[`${tack.id}_${parameter.name}`] = {
[parameter.classTypeName]: value, [parameter.classTypeName]: value,
}; };
}
} else { } else {
promotedParameters[ promotedParameters[
`${tack.parentNode}${ `${tack.parentNode}_${tack.prefix}_${parameter.name}`
parameter.thrown ? "" : "_" + tack.prefix
}_${parameter.name}`
] = { ] = {
[parameter.classTypeName]: value, [parameter.classTypeName]: value,
}; };
...@@ -223,7 +206,7 @@ const ProjectSubmitWork = observer(() => { ...@@ -223,7 +206,7 @@ const ProjectSubmitWork = observer(() => {
promotedParameters, promotedParameters,
}); });
} else { } else {
Message.error("请完善算子信息后提交任务"); Message.error("请完善左侧表单再提交");
} }
}; };
...@@ -314,7 +297,7 @@ const ProjectSubmitWork = observer(() => { ...@@ -314,7 +297,7 @@ const ProjectSubmitWork = observer(() => {
onRef={configFormRef} onRef={configFormRef}
templateConfigInfo={templateConfigInfo} templateConfigInfo={templateConfigInfo}
setParameter={setParameter} setParameter={setParameter}
setExternalSelectedNodeId={setExternalSelectedNodeId} setSelectedBatchNodeId={setSelectedBatchNodeId}
/> />
</div> </div>
)} )}
...@@ -324,8 +307,8 @@ const ProjectSubmitWork = observer(() => { ...@@ -324,8 +307,8 @@ const ProjectSubmitWork = observer(() => {
> >
<WorkFlow <WorkFlow
templateConfigInfo={templateConfigInfo} templateConfigInfo={templateConfigInfo}
setExternalSelectedNodeId={setExternalSelectedNodeId} setSelectedBatchNodeId={setSelectedBatchNodeId}
externalSelectedNodeId={externalSelectedNodeId} selectedBatchNodeId={selectedBatchNodeId}
/> />
</div> </div>
</div> </div>
...@@ -340,7 +323,6 @@ const ProjectSubmitWork = observer(() => { ...@@ -340,7 +323,6 @@ const ProjectSubmitWork = observer(() => {
anchorEl={anchorEl} anchorEl={anchorEl}
onCancel={handleCancel} onCancel={handleCancel}
onConfirm={handleConfirm} onConfirm={handleConfirm}
loading={loading}
/> />
</div> </div>
); );
......
...@@ -11,7 +11,6 @@ export interface IParameter { ...@@ -11,7 +11,6 @@ export interface IParameter {
hidden: boolean; // 使用模板时是否展示 true 不展示 用户不需要填写 hidden: boolean; // 使用模板时是否展示 true 不展示 用户不需要填写
id?: string; id?: string;
name: string; // 参数名称 name: string; // 参数名称
title: string; // 参数名称
required: boolean; // 是否必填 required: boolean; // 是否必填
defaultValue: any; // 默认值 defaultValue: any; // 默认值
domType: IDomType; // 前端组件类型 domType: IDomType; // 前端组件类型
...@@ -31,7 +30,6 @@ export interface IParameter { ...@@ -31,7 +30,6 @@ export interface IParameter {
error?: boolean; // 表单校验是否通过 error?: boolean; // 表单校验是否通过
helperText?: string; // 表单校验提示文案 helperText?: string; // 表单校验提示文案
parameterGroup?: string; // parameterGroup?: string; //
thrown: boolean; // 保存批算子时 是否是 批算子输入输出相关的parameters
} }
export type IExecutionStatus = "Pending" | "Running" | "Done" | "Failed"; export type IExecutionStatus = "Pending" | "Running" | "Done" | "Failed";
......
/* /*
* @Author: rocosen * @Author: rocosen
* @Date: 2022-06-12 10:05:13 * @Date: 2022-06-12 10:05:13
* @LastEditors: 吴永生 15770852798@163.com * @LastEditors: 吴永生#A02208 yongsheng.wu@wholion.com
* @LastEditTime: 2022-08-30 18:21:04 * @LastEditTime: 2022-07-20 15:04:19
* @FilePath: /bkunyun/src/views/Project/ProjectSetting/index.tsx * @FilePath: /bkunyun/src/views/Project/ProjectSetting/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
*/ */
...@@ -11,16 +11,17 @@ import { Box } from "@mui/system"; ...@@ -11,16 +11,17 @@ import { Box } from "@mui/system";
import { observer } from "mobx-react-lite"; import { observer } from "mobx-react-lite";
import { useLocation } from "react-router-dom"; import { useLocation } from "react-router-dom";
import projectImg from "@/assets/project/projectIconSmall.svg";
import WorkbenchTemplate from "./workbenchTemplate"; import WorkbenchTemplate from "./workbenchTemplate";
import WorkbenchList from "./workbenchList"; import WorkbenchList from "./workbenchList";
import Tabs from "@/components/mui/Tabs"; import Tabs from "@/components/mui/Tabs";
import usePass from "@/hooks/usePass"; import usePass from "@/hooks/usePass";
import Template from "@/assets/project/workbenchTemplate.svg"; import Template from "@/assets/project/workbenchTemplate.svg";
import TemplateSelect from "@/assets/project/workbenchTemplate_select.svg"; import Template_select from "@/assets/project/workbenchTemplate_select.svg";
import TemplateHover from "@/assets/project/workbenchTemplate_hover.svg";
import List from "@/assets/project/workbenchList.svg"; import List from "@/assets/project/workbenchList.svg";
import ListHover from "@/assets/project/workbenchList_hover.svg"; import List_select from "@/assets/project/workbenchList_select.svg";
import ListSelect from "@/assets/project/workbenchList_select.svg"; import ButtonDemo from "@/views/mui_demo/button";
import InputDemo from "@/views/mui_demo/input";
const ProjectWorkbench = observer(() => { const ProjectWorkbench = observer(() => {
const isPass = usePass(); const isPass = usePass();
...@@ -34,8 +35,7 @@ const ProjectWorkbench = observer(() => { ...@@ -34,8 +35,7 @@ const ProjectWorkbench = observer(() => {
component: <WorkbenchTemplate />, component: <WorkbenchTemplate />,
hide: !isPass("PROJECT_WORKBENCH_FLOES"), hide: !isPass("PROJECT_WORKBENCH_FLOES"),
icon: Template, icon: Template,
iconed: TemplateSelect, iconed: Template_select,
iconHover: TemplateHover
}, },
{ {
label: "任务列表", label: "任务列表",
...@@ -43,8 +43,21 @@ const ProjectWorkbench = observer(() => { ...@@ -43,8 +43,21 @@ const ProjectWorkbench = observer(() => {
component: <WorkbenchList />, component: <WorkbenchList />,
hide: !isPass("PROJECT_WORKBENCH_JOBS"), hide: !isPass("PROJECT_WORKBENCH_JOBS"),
icon: List, icon: List,
iconed: ListSelect, iconed: List_select,
iconHover: ListHover, },
{
label: "按钮组件",
value: "MUI_BUTTON",
component: <ButtonDemo />,
icon: List,
iconed: List_select,
},
{
label: "输入框组件",
value: "MUI_INPUT",
component: <InputDemo />,
icon: List,
iconed: List_select,
}, },
]; ];
}, [isPass]); }, [isPass]);
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com * @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-05-31 10:18:13 * @Date: 2022-05-31 10:18:13
* @LastEditors: 吴永生 15770852798@163.com * @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-08-22 15:33:02 * @LastEditTime: 2022-07-28 19:02:19
* @FilePath: /bkunyun/src/views/Project/ProjectSetting/index.tsx * @FilePath: /bkunyun/src/views/Project/ProjectSetting/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
*/ */
...@@ -48,10 +48,6 @@ const currencies = [ ...@@ -48,10 +48,6 @@ const currencies = [
value: "ALL", value: "ALL",
label: "全部", label: "全部",
}, },
{
value: "SUBMITTED",
label: "正在启动",
},
{ {
value: "RUNNING", value: "RUNNING",
label: "正在运行", label: "正在运行",
...@@ -83,17 +79,17 @@ const ProjectMembers = observer(() => { ...@@ -83,17 +79,17 @@ const ProjectMembers = observer(() => {
const [size, setSize] = useState(10); const [size, setSize] = useState(10);
const [rowsPerPage, setRowsPerPage] = useState(10); const [rowsPerPage, setRowsPerPage] = useState(10);
const [count, setCount] = useState(0); const [count, setCount] = useState(0);
const [loading, setLoading] = useState(false)
/** 简单弹窗 */ /** 简单弹窗 */
const [jobData, setJobData] = useState(""); const [jobData, setJobData] = useState("");
const [openDialog, setOpenDialog] = useState(false); const [openDialog, setOpenDialog] = useState(false);
const [dialogType, setDialogType] = useState("del"); const [dialogType, setDialogType] = useState("del");
// 获取作业列表 // 获取作业列表
const { run: getWorkflowJobInfo, loading } = useMyRequest( const { run: getWorkflowJobInfo } = useMyRequest(getWorkflowJobList, {
getWorkflowJobList,
{
onSuccess: (result: any) => { onSuccess: (result: any) => {
setJobList(result.data.content); setJobList(result.data.content);
setCount(result.data.totalElements); setCount(result.data.totalElements);
setLoading(false);
timer && clearTimeout(timer as number); timer && clearTimeout(timer as number);
timer = null; timer = null;
timer = setTimeout(() => { timer = setTimeout(() => {
...@@ -106,8 +102,7 @@ const ProjectMembers = observer(() => { ...@@ -106,8 +102,7 @@ const ProjectMembers = observer(() => {
}); });
}, 60000); }, 60000);
}, },
} });
);
useEffect(() => { useEffect(() => {
return () => { return () => {
...@@ -286,7 +281,7 @@ const ProjectMembers = observer(() => { ...@@ -286,7 +281,7 @@ const ProjectMembers = observer(() => {
const rowClick = useCallback( const rowClick = useCallback(
(id: string) => { (id: string) => {
navigate(`/product/cadd/projectJobDetail`, { navigate(`/product/cadd/projectJobDetail`, {
state: { taskId: id, from: "workbenchList" }, state: { taskId: id, from: 'workbenchList' },
}); });
}, },
[navigate] [navigate]
...@@ -364,6 +359,7 @@ const ProjectMembers = observer(() => { ...@@ -364,6 +359,7 @@ const ProjectMembers = observer(() => {
name: jobName, name: jobName,
state: currency === "ALL" ? "" : currency, state: currency === "ALL" ? "" : currency,
}); });
setLoading(true)
}} }}
> >
<img alt="" src={onload} /> <img alt="" src={onload} />
...@@ -372,7 +368,7 @@ const ProjectMembers = observer(() => { ...@@ -372,7 +368,7 @@ const ProjectMembers = observer(() => {
<Box className={styles.body} style={{ position: "relative" }}> <Box className={styles.body} style={{ position: "relative" }}>
<MyCircularProgress loading={loading} /> <MyCircularProgress loading={loading} />
{jobList.length === 0 && !loading && ( {jobList.length === 0 && (
<Box <Box
sx={{ sx={{
display: "flex", display: "flex",
...@@ -414,9 +410,7 @@ const ProjectMembers = observer(() => { ...@@ -414,9 +410,7 @@ const ProjectMembers = observer(() => {
</Box> </Box>
<Box className={styles.tabBoxMiddle}> <Box className={styles.tabBoxMiddle}>
<img alt="" src={jobCost} /> <img alt="" src={jobCost} />
<div className={styles.tabBoxTime}> <div className={styles.tabBoxTime}>{item.jobCost.toFixed(2)}</div>
{item.jobCost ? item.jobCost.toFixed(2) : "--"}
</div>
</Box> </Box>
<Box className={styles.tabBoxJobStatus}> <Box className={styles.tabBoxJobStatus}>
<img alt="" src={renderStatusIcon(item.state)} /> <img alt="" src={renderStatusIcon(item.state)} />
...@@ -433,27 +427,18 @@ const ProjectMembers = observer(() => { ...@@ -433,27 +427,18 @@ const ProjectMembers = observer(() => {
/> />
</Box> </Box>
<div <div
style={{ style={{ color: renderTextColor(item.state), margin: '0px' }}
color: renderTextColor(item.state),
margin: "0px",
}}
className={styles.tabBoxStatusText} className={styles.tabBoxStatusText}
> >
{item.completeNum + "/" + item.totalNum} {item.completeNum + "/" + item.totalNum}
</div> </div>
</Box> </Box>
{(item.state === "RUNNING" || item.state === "SUBMITTED") && {item.state === "RUNNING" &&
isPass("PROJECT_WORKBENCH_JOBS_STOP", "USER") && ( isPass("PROJECT_WORKBENCH_JOBS_STOP", "USER") && (
<Box className={styles.tabBoxJobOperate}> <Box className={styles.tabBoxJobOperate}>
{currentProjectStore.currentProjectInfo.projectRole === {
"USER" && currentProjectStore.currentProjectInfo.projectRole === "USER" && (item.creator !== JSON.parse(localStorage.getItem("userInfo") || "{}")?.name) ? "" : <img
item.creator !==
JSON.parse(localStorage.getItem("userInfo") || "{}")
?.name ? (
""
) : (
<img
alt="" alt=""
src={jobStop} src={jobStop}
style={{ cursor: "pointer" }} style={{ cursor: "pointer" }}
...@@ -465,11 +450,10 @@ const ProjectMembers = observer(() => { ...@@ -465,11 +450,10 @@ const ProjectMembers = observer(() => {
setDialogType("stop"); setDialogType("stop");
}} }}
/> />
)} }
</Box> </Box>
)} )}
{item.state !== "RUNNING" && {item.state !== "RUNNING" &&
item.state !== "SUBMITTED" &&
isPass("PROJECT_WORKBENCH_JOBS_DELETE", "MANAGER") && ( isPass("PROJECT_WORKBENCH_JOBS_DELETE", "MANAGER") && (
<Box className={styles.tabBoxJobOperate}> <Box className={styles.tabBoxJobOperate}>
<img <img
......
...@@ -144,7 +144,7 @@ const AddTemplate = (props: IAddTemplateProps) => { ...@@ -144,7 +144,7 @@ const AddTemplate = (props: IAddTemplateProps) => {
}; };
// 获取模板列表 // 获取模板列表
const getAddTemplateListFun = useCallback((newTitle?: string) => { const getAddTemplateListFun = useCallback(() => {
const userName = JSON.parse(localStorage.getItem("userInfo") || "{}")?.name; const userName = JSON.parse(localStorage.getItem("userInfo") || "{}")?.name;
setSelectTemplateData([]); setSelectTemplateData([]);
setAddTemplateList([]); setAddTemplateList([]);
...@@ -153,14 +153,14 @@ const AddTemplate = (props: IAddTemplateProps) => { ...@@ -153,14 +153,14 @@ const AddTemplate = (props: IAddTemplateProps) => {
projectId: projectId as string, projectId: projectId as string,
productId: productId as string, productId: productId as string,
creator: "root", creator: "root",
keyword: newTitle, keyword: title,
}); });
} else { } else {
getAddTemplateList({ getAddTemplateList({
projectId: projectId as string, projectId: projectId as string,
productId: productId as string, productId: productId as string,
creator: userName, creator: userName,
keyword: newTitle, keyword: title,
}); });
} }
}, [ }, [
...@@ -169,7 +169,7 @@ const AddTemplate = (props: IAddTemplateProps) => { ...@@ -169,7 +169,7 @@ const AddTemplate = (props: IAddTemplateProps) => {
productId, productId,
projectId, projectId,
templateType, templateType,
// title, title,
]); ]);
//模板启用切换 //模板启用切换
...@@ -193,13 +193,6 @@ const AddTemplate = (props: IAddTemplateProps) => { ...@@ -193,13 +193,6 @@ const AddTemplate = (props: IAddTemplateProps) => {
getAddTemplateListFun(); getAddTemplateListFun();
}, [getAddTemplateListFun]); }, [getAddTemplateListFun]);
// 按回车搜索
const handleKeyWordChangeKeyUp = (e: any) => {
if (e.keyCode === 13) {
getAddTemplateListFun(e.target.value);
}
};
const hiddenBoxArr = useMemo(() => { const hiddenBoxArr = useMemo(() => {
const length = const length =
templateType === "public" templateType === "public"
...@@ -222,7 +215,7 @@ const AddTemplate = (props: IAddTemplateProps) => { ...@@ -222,7 +215,7 @@ const AddTemplate = (props: IAddTemplateProps) => {
<Typography <Typography
sx={{ fontSize: "18px", fontWeight: "600", color: "#1E2633" }} sx={{ fontSize: "18px", fontWeight: "600", color: "#1E2633" }}
> >
管理工作流模板 添加工作流模版
</Typography> </Typography>
<Box <Box
sx={{ sx={{
...@@ -238,7 +231,6 @@ const AddTemplate = (props: IAddTemplateProps) => { ...@@ -238,7 +231,6 @@ const AddTemplate = (props: IAddTemplateProps) => {
onChange={(e: any) => { onChange={(e: any) => {
setTitle(e.target.value); setTitle(e.target.value);
}} }}
onKeyUp={handleKeyWordChangeKeyUp}
placeholder="输入关键词搜索" placeholder="输入关键词搜索"
size="small" size="small"
sx={{ width: 340, height: 32 }} sx={{ width: 340, height: 32 }}
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com * @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-05-31 10:18:13 * @Date: 2022-05-31 10:18:13
* @LastEditors: 吴永生 15770852798@163.com * @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-08-18 10:01:36 * @LastEditTime: 2022-08-09 16:32:42
* @FilePath: /bkunyun/src/views/Project/ProjectSetting/index.tsx * @FilePath: /bkunyun/src/views/Project/ProjectSetting/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
*/ */
...@@ -114,7 +114,7 @@ const ProjectMembers = observer(() => { ...@@ -114,7 +114,7 @@ const ProjectMembers = observer(() => {
<SearchInput onKeyUp={handleKeyWordChangeKeyUp} sx={{ width: 340 }} /> <SearchInput onKeyUp={handleKeyWordChangeKeyUp} sx={{ width: 340 }} />
{isPass("PROJECT_WORKBENCH_FLOES_ADD", "MANAGER") && ( {isPass("PROJECT_WORKBENCH_FLOES_ADD", "MANAGER") && (
<MyButton <MyButton
text={"管理工作流模板"} text={"添加工作流模版"}
img={<Add />} img={<Add />}
onClick={addTemplateBlock} onClick={addTemplateBlock}
size={"medium"} size={"medium"}
......
...@@ -177,13 +177,13 @@ const AddProject = (props: IAddProjectProps) => { ...@@ -177,13 +177,13 @@ const AddProject = (props: IAddProjectProps) => {
title="新建项目" title="新建项目"
loading={loading} loading={loading}
> >
<div className={style.formBox} onClick={handleFromBox}> <div className={style.formBox} onClick={handleFromBox}>
<MyInput <MyInput
required required
error={nameCheck.error} error={nameCheck.error}
// id="name" id="name"
label="项目名称" label="项目名称"
variant="outlined"
value={name} value={name}
onChange={handleNameChange} onChange={handleNameChange}
helperText={nameCheck.help} helperText={nameCheck.help}
......
/*
* @Author: 吴永生 15770852798@163.com
* @Date: 2022-08-26 19:13:55
* @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-08-30 19:26:16
* @FilePath: /bkunyun/src/views/Project/components/CurrentProject/index.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import logo from "@/assets/project/projectIcon.svg"; import logo from "@/assets/project/projectIcon.svg";
import style from "./index.module.css"; import style from "./index.module.css";
import ArrowForwardIosIcon from "@mui/icons-material/ArrowForwardIos"; import ArrowForwardIosIcon from "@mui/icons-material/ArrowForwardIos";
import { Popper, Fade } from "@mui/material"; import { Popper, Fade } from "@mui/material";
import { useStores } from "@/store/index"; import { useStores } from "@/store/index";
import ProjectListPopper from "../ProjectListPopper"; import ProjectListPopper from "../ProjectListPopper";
import React, { useState } from "react"; import React, { useEffect, useState } from "react";
import { observer } from "mobx-react-lite"; import { observer } from "mobx-react-lite";
import AddProject from "../AddProject"; import AddProject from "../AddProject";
import { import {
...@@ -25,6 +17,17 @@ const CurrentProject = observer(() => { ...@@ -25,6 +17,17 @@ const CurrentProject = observer(() => {
const [projectListOpen, setProjectListOpen] = useState(false); const [projectListOpen, setProjectListOpen] = useState(false);
const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null); const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);
useEffect(() => {
document.addEventListener("click", (e) => {
setProjectListOpen(false);
});
return () => {
document.removeEventListener("click", (e) => {
setProjectListOpen(false);
});
};
}, []);
const handleShowProjectList = (event: React.MouseEvent<HTMLElement>) => { const handleShowProjectList = (event: React.MouseEvent<HTMLElement>) => {
event.nativeEvent.stopImmediatePropagation(); event.nativeEvent.stopImmediatePropagation();
setAnchorEl(event.currentTarget); setAnchorEl(event.currentTarget);
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
/* padding: 12px 20px; */ /* padding: 12px 20px; */
border: 1px solid #e6e8eb; border: 1px solid #e6e8eb;
border-left: 4px solid #e6e8eb; border-left: 4px solid #e6e8eb;
/* display: flex; */ display: flex;
align-items: center; align-items: center;
} }
...@@ -37,12 +37,7 @@ ...@@ -37,12 +37,7 @@
} }
.batchRotate { .batchRotate {
margin-bottom: 20px; transform: translateX(-50%) rotate(-90deg);
line-height: 22px;
font-size: 14px;
font-weight: 900;
/* text-align: center; */
/* transform: translateX(-50%) rotate(-90deg); */
} }
.handleBox::before{ .handleBox::before{
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com * @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-07-12 11:20:29 * @Date: 2022-07-12 11:20:29
* @LastEditors: 吴永生 15770852798@163.com * @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-08-31 17:09:26 * @LastEditTime: 2022-08-09 11:24:38
* @FilePath: /bkunyun/src/views/Project/components/Flow/components/BatchNode.tsx * @FilePath: /bkunyun/src/views/Project/components/Flow/components/BatchNode.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
*/ */
...@@ -68,12 +68,11 @@ const BatchNode = (props: IBatchNode) => { ...@@ -68,12 +68,11 @@ const BatchNode = (props: IBatchNode) => {
className={styles.handleBox} className={styles.handleBox}
id={item.name} id={item.name}
style={{ style={{
backgroundColor: "rgba(19, 112, 255, 1)", background: "#fff ",
border: item.error border: item.error
? "1px solid #FF4E4E" ? "1px solid #FF4E4E"
: "1px solid #fff", : "1px solid #D1D6DE",
left: index * 24 + 20, left: index * 24 + 20,
top: '-47px',
}} }}
type="target" type="target"
position={Position.Top} position={Position.Top}
...@@ -100,8 +99,8 @@ const BatchNode = (props: IBatchNode) => { ...@@ -100,8 +99,8 @@ const BatchNode = (props: IBatchNode) => {
className={styles.handleBox} className={styles.handleBox}
id={item.name} id={item.name}
style={{ style={{
backgroundColor: "rgba(19, 112, 255, 1)", background: "#fff ",
border: "1px solid #FFF", border: "1px solid #D1D6DE",
left: index * 24 + 20, left: index * 24 + 20,
}} }}
type="source" type="source"
......
...@@ -50,6 +50,7 @@ const BatchOperatorFlow = (props: IProps) => { ...@@ -50,6 +50,7 @@ const BatchOperatorFlow = (props: IProps) => {
showVersion = false, showVersion = false,
...other ...other
} = props; } = props;
console.log(tasks);
/** 自定义的节点类型 */ /** 自定义的节点类型 */
const nodeTypes = useMemo(() => { const nodeTypes = useMemo(() => {
return { batchNode: BatchNode, flowNode: FlowNode }; return { batchNode: BatchNode, flowNode: FlowNode };
...@@ -146,17 +147,16 @@ const BatchOperatorFlow = (props: IProps) => { ...@@ -146,17 +147,16 @@ const BatchOperatorFlow = (props: IProps) => {
flowNodeStyle: { flowNodeStyle: {
backgroundColor: "#fff", backgroundColor: "#fff",
borderRadius: "4px", borderRadius: "4px",
boxShadow: "0px 3px 10px 0px rgba(0,24,57,0.14)",
}, },
inStyle: { inStyle: {
backgroundColor: "rgba(19, 112, 255, 1)", backgroundColor: "rgba(19, 112, 255, 1)",
border: "1px solid #FFF", border: "none",
left: 12, left: 12,
top: "-2px", top: "-2px",
}, },
outStyle: { outStyle: {
backgroundColor: "rgba(19, 112, 255, 1)", backgroundColor: "rgba(19, 112, 255, 1)",
border: "1px solid #FFF", border: "none",
left: 12, left: 12,
bottom: "-2px", bottom: "-2px",
}, },
...@@ -367,16 +367,6 @@ const BatchOperatorFlow = (props: IProps) => { ...@@ -367,16 +367,6 @@ const BatchOperatorFlow = (props: IProps) => {
setInSideFlowNodeId(""); setInSideFlowNodeId("");
}, []); }, []);
// const onNodesChange = (val: any)=>{
// // 自定义change事件 不允许react flow组件本身删除事件
// return
// }
// const onEdgesChange = (val: any) =>{
// // 自定义change事件 不允许react flow组件本身删除事件
// return;
// }
const reactFlowParams = const reactFlowParams =
flowType === "edit" flowType === "edit"
? { ? {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com * @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-07-12 11:29:46 * @Date: 2022-07-12 11:29:46
* @LastEditors: 吴永生 15770852798@163.com * @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-08-31 17:09:31 * @LastEditTime: 2022-08-09 19:06:43
* @FilePath: /bkunyun/src/views/Project/components/Flow/components/FlowNode/index.tsx * @FilePath: /bkunyun/src/views/Project/components/Flow/components/FlowNode/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
*/ */
...@@ -52,7 +52,6 @@ const FlowNode = (props: any) => { ...@@ -52,7 +52,6 @@ const FlowNode = (props: any) => {
(parameters?.length && (parameters?.length &&
parameters?.filter((item: any) => { parameters?.filter((item: any) => {
return item.parameterGroup === "in"; return item.parameterGroup === "in";
// return item.parameterGroup === "in" && !item?.thrown;
})) || })) ||
[] []
); );
...@@ -64,7 +63,6 @@ const FlowNode = (props: any) => { ...@@ -64,7 +63,6 @@ const FlowNode = (props: any) => {
(parameters?.length && (parameters?.length &&
parameters?.filter((item: any) => { parameters?.filter((item: any) => {
return item.parameterGroup === "out"; return item.parameterGroup === "out";
// return item.parameterGroup === "out" && !item?.thrown;
})) || })) ||
[] []
); );
...@@ -98,8 +96,8 @@ const FlowNode = (props: any) => { ...@@ -98,8 +96,8 @@ const FlowNode = (props: any) => {
); );
}) })
: null} : null}
<div style={{display: 'flex', alignItems: 'center'}}> <div>
<span style={{fontSize: '12px', lineHeight: '24px'}}>{title || ""} {showVersion && version}</span> {title || ""} {showVersion && version}
{flowType !== "edit" && isCheck ? ( {flowType !== "edit" && isCheck ? (
<span className={styles.successDot}></span> <span className={styles.successDot}></span>
) : null} ) : null}
......
...@@ -11,7 +11,7 @@ import ReactFlow, { ...@@ -11,7 +11,7 @@ import ReactFlow, {
import { useCallback, useEffect, useMemo, useState } from "react"; import { useCallback, useEffect, useMemo, useState } from "react";
import { uuid } from "@/utils/util"; import { uuid } from "@/utils/util";
import { IParameter, ITask } from "../../ProjectSubmitWork/interface"; import { IEdge, IParameter, ITask } from "../../ProjectSubmitWork/interface";
import { ILine } from "./interface"; import { ILine } from "./interface";
import BatchNode from "./components/BatchNode"; import BatchNode from "./components/BatchNode";
import FlowNode from "./components/FlowNode"; import FlowNode from "./components/FlowNode";
...@@ -33,9 +33,9 @@ interface IProps extends ReactFlowProps { ...@@ -33,9 +33,9 @@ interface IProps extends ReactFlowProps {
/** 点击batch事件 */ /** 点击batch事件 */
onBatchClick?: (val: string) => void; onBatchClick?: (val: string) => void;
/** 设置选中的batch节点id */ /** 设置选中的batch节点id */
setExternalSelectedNodeId?: (val: string) => void; setSelectedBatchNodeId?: (val: string) => void;
/** 选中的batch节点id */ /** 选中的batch节点id */
externalSelectedNodeId?: string; selectedBatchNodeId?: string;
/** 类型, edit为编辑类型 */ /** 类型, edit为编辑类型 */
type?: "edit" | "default"; type?: "edit" | "default";
/** 设置组件数据 组件为编辑状态使用 */ /** 设置组件数据 组件为编辑状态使用 */
...@@ -52,8 +52,8 @@ const Flow = (props: IProps) => { ...@@ -52,8 +52,8 @@ const Flow = (props: IProps) => {
const { const {
tasks, tasks,
onBatchClick, onBatchClick,
setExternalSelectedNodeId, setSelectedBatchNodeId,
externalSelectedNodeId, selectedBatchNodeId,
type: flowType = "default", type: flowType = "default",
setTasks, setTasks,
onFlowNodeClick, onFlowNodeClick,
...@@ -61,7 +61,7 @@ const Flow = (props: IProps) => { ...@@ -61,7 +61,7 @@ const Flow = (props: IProps) => {
showControls = true, showControls = true,
...other ...other
} = props; } = props;
console.log(tasks);
/** 自定义的节点类型 */ /** 自定义的节点类型 */
const nodeTypes = useMemo(() => { const nodeTypes = useMemo(() => {
return { batchNode: BatchNode, flowNode: FlowNode }; return { batchNode: BatchNode, flowNode: FlowNode };
...@@ -77,7 +77,7 @@ const Flow = (props: IProps) => { ...@@ -77,7 +77,7 @@ const Flow = (props: IProps) => {
/** 原始数据删除线 */ /** 原始数据删除线 */
const tasksDeleteLine = useCallback( const tasksDeleteLine = useCallback(
(connection: Connection | Edge | any) => { (connection: Connection | Edge | any) => {
let result = const result =
(tasks?.length && (tasks?.length &&
tasks.map((item) => { tasks.map((item) => {
/** 删除batch起始的edges中的一项 === 等于删除了一根连线 */ /** 删除batch起始的edges中的一项 === 等于删除了一根连线 */
...@@ -123,45 +123,6 @@ const Flow = (props: IProps) => { ...@@ -123,45 +123,6 @@ const Flow = (props: IProps) => {
} }
})) || })) ||
[]; [];
// 更新批节点下对应流节点的hidden和错误提示
result = result.map((task) => {
if (task.parentNode === connection.target) {
let isCheck = true;
const parametersChange = task.parameters.map((parameter) => {
if (parameter.name === connection.targetHandle) {
const { error, helperText } =
getCustomTemplateParameterCheckResult({
...parameter,
linked: false,
hidden: false,
});
return {
...parameter,
hidden: false,
linked: false,
error,
helperText,
};
} else {
return parameter;
}
});
parametersChange.forEach((parameter) => {
if (
getCustomTemplateParameterCheckResult(parameter).error === true
) {
isCheck = false;
}
});
return {
...task,
isCheck,
parameters: parametersChange,
};
} else {
return task;
}
});
return result; return result;
}, },
[tasks] [tasks]
...@@ -221,7 +182,7 @@ const Flow = (props: IProps) => { ...@@ -221,7 +182,7 @@ const Flow = (props: IProps) => {
// const nodesInputAndOutputStatus = useCallback( // const nodesInputAndOutputStatus = useCallback(
// (id: string) => { // (id: string) => {
// /** 所有的连线 */ // /** 所有的连线 */
// const lineArr: ] = []; // const lineArr: IEdge[] = [];
// tasks?.length && // tasks?.length &&
// tasks.forEach((item) => { // tasks.forEach((item) => {
// item.edges?.length && lineArr.push(...item.edges); // item.edges?.length && lineArr.push(...item.edges);
...@@ -270,14 +231,14 @@ const Flow = (props: IProps) => { ...@@ -270,14 +231,14 @@ const Flow = (props: IProps) => {
return a - b; return a - b;
}); });
let width = 176, let width = 176,
height = 66; height = 22;
if (positionXArr?.length) { if (positionXArr?.length) {
const val = positionXArr[positionXArr.length - 1] + 144; const val = positionXArr[positionXArr.length - 1] + 150;
width = val > 176 ? val : width; width = val > 176 ? val : width;
} }
if (positionYArr?.length) { if (positionYArr?.length) {
const val = positionYArr[positionYArr.length - 1] + 74; const val = positionYArr[positionYArr.length - 1] + 6;
height = val > 66 ? val : height; height = val > 22 ? val : height;
} }
return { return {
width, width,
...@@ -305,23 +266,20 @@ const Flow = (props: IProps) => { ...@@ -305,23 +266,20 @@ const Flow = (props: IProps) => {
/** 是否有流节点 */ /** 是否有流节点 */
isFlowNode: isFlowNode(item.id), isFlowNode: isFlowNode(item.id),
/** 选中状态 */ /** 选中状态 */
selectedStatus: externalSelectedNodeId selectedStatus: selectedBatchNodeId
? externalSelectedNodeId.includes(item.id) ? selectedBatchNodeId === item.id
: inSideBatchNodeId === item.id, : inSideBatchNodeId === item.id,
/** tasks 数据 */ /** tasks 数据 */
tasks: tasks, tasks: tasks,
} }
: { selectedStatus: externalSelectedNodeId : { selectedStatus: inSideFlowNodeId === item.id }),
? externalSelectedNodeId.includes(item.id)
: inSideFlowNodeId === item.id,}),
/** 输入输出圆点状态 */ /** 输入输出圆点状态 */
// dotStatus: nodesInputAndOutputStatus(item.id), // dotStatus: nodesInputAndOutputStatus(item.id),
/** 样式 */ /** 样式 */
style: { style: {
...getBatchStyle(item), ...getBatchStyle(item),
marginTop: '-44px', padding: isFlowNode(item.id) ? "20px" : "12px 20px",
padding: "12px 20px",
}, },
}, },
/** 坐标 */ /** 坐标 */
...@@ -345,7 +303,7 @@ const Flow = (props: IProps) => { ...@@ -345,7 +303,7 @@ const Flow = (props: IProps) => {
tasks, tasks,
flowType, flowType,
isFlowNode, isFlowNode,
externalSelectedNodeId, selectedBatchNodeId,
inSideBatchNodeId, inSideBatchNodeId,
inSideFlowNodeId, inSideFlowNodeId,
// nodesInputAndOutputStatus, // nodesInputAndOutputStatus,
...@@ -367,8 +325,8 @@ const Flow = (props: IProps) => { ...@@ -367,8 +325,8 @@ const Flow = (props: IProps) => {
}, []); }, []);
}); });
return val.map((item: ILine) => { return val.map((item: ILine) => {
const newSelectId = externalSelectedNodeId const newSelectId = selectedBatchNodeId
? externalSelectedNodeId ? selectedBatchNodeId
: inSideBatchNodeId; : inSideBatchNodeId;
return { return {
...item, ...item,
...@@ -389,18 +347,19 @@ const Flow = (props: IProps) => { ...@@ -389,18 +347,19 @@ const Flow = (props: IProps) => {
label: item.label ? `(${item.label})` : "", label: item.label ? `(${item.label})` : "",
}; };
}); });
}, [inSideBatchNodeId, externalSelectedNodeId, selectedEdge?.id, tasks]); }, [inSideBatchNodeId, selectedBatchNodeId, selectedEdge?.id, tasks]);
/** 设置nodeId方法 */ /** 设置nodeId方法 */
const setNodeIdFun = useCallback( const setNodeIdFun = useCallback(
(id: string) => { (id: string) => {
setExternalSelectedNodeId setSelectedBatchNodeId
? setExternalSelectedNodeId(id) ? setSelectedBatchNodeId(id)
: setInSideBatchNodeId(id); : setInSideBatchNodeId(id);
onBatchClick && onBatchClick(id); onBatchClick && onBatchClick(id);
setInSideFlowNodeId(""); setInSideFlowNodeId("");
document.getElementById(`point${id}`)?.scrollIntoView(true);
}, },
[onBatchClick, setExternalSelectedNodeId] [onBatchClick, setSelectedBatchNodeId]
); );
/** flowNode点击事件 */ /** flowNode点击事件 */
...@@ -412,9 +371,9 @@ const Flow = (props: IProps) => { ...@@ -412,9 +371,9 @@ const Flow = (props: IProps) => {
} else { } else {
setInSideFlowNodeId(node.id); setInSideFlowNodeId(node.id);
setInSideBatchNodeId(""); setInSideBatchNodeId("");
setExternalSelectedNodeId && setExternalSelectedNodeId("");
setSelectedBatchNodeId && setSelectedBatchNodeId("");
} }
document.getElementById(`point${node.id}`)?.scrollIntoView(true);
} }
}); });
if (onFlowNodeClick) { if (onFlowNodeClick) {
...@@ -425,8 +384,8 @@ const Flow = (props: IProps) => { ...@@ -425,8 +384,8 @@ const Flow = (props: IProps) => {
}; };
const handlePaneClick = () => { const handlePaneClick = () => {
setExternalSelectedNodeId setSelectedBatchNodeId
? setExternalSelectedNodeId("") ? setSelectedBatchNodeId("")
: setInSideBatchNodeId(""); : setInSideBatchNodeId("");
setInSideFlowNodeId(""); setInSideFlowNodeId("");
onBatchClick && onBatchClick(""); onBatchClick && onBatchClick("");
...@@ -513,7 +472,7 @@ const Flow = (props: IProps) => { ...@@ -513,7 +472,7 @@ const Flow = (props: IProps) => {
/** 连接校验并修改值 */ /** 连接校验并修改值 */
const connectCheck = useCallback( const connectCheck = useCallback(
(connection: Connection) => { (connection: Connection) => {
let newVal = const newVal =
(tasks?.length && (tasks?.length &&
tasks?.map((item) => { tasks?.map((item) => {
if (item.id === connection.source) { if (item.id === connection.source) {
...@@ -540,76 +499,17 @@ const Flow = (props: IProps) => { ...@@ -540,76 +499,17 @@ const Flow = (props: IProps) => {
} }
})) || })) ||
[]; [];
// 更新批节点下对应流节点的hidden和错误提示
newVal = newVal.map((task) => {
if (task.parentNode === connection.target) {
let isCheck = true; // 红点校验
let parametersChange = task.parameters.map((parameter) => {
if (parameter.name === connection.targetHandle) {
const { error, helperText } =
getCustomTemplateParameterCheckResult({
...parameter,
linked: true,
hidden: true,
});
return {
...parameter,
hidden: true,
linked: true,
error,
helperText,
};
} else {
return parameter;
}
});
parametersChange.forEach((parameter) => {
if (
getCustomTemplateParameterCheckResult(parameter).error === true
) {
isCheck = false;
}
});
return {
...task,
isCheck,
parameters: parametersChange,
};
} else {
return task;
}
});
return newVal; return newVal;
}, },
[connectModifyParameters, tasks] [connectModifyParameters, tasks]
); );
// 获取算子类型 批算还是流算子
const getTaskType = useCallback(
(taskId: string) => {
let type = "";
tasks?.forEach((task) => {
if (task.id === taskId) {
type = task.type;
}
});
return type;
},
[tasks]
);
/** 已经连接线啦 */ /** 已经连接线啦 */
const onConnect = useCallback( const onConnect = useCallback(
(connection: Connection) => { (connection: Connection) => {
const { inputClassType, outClassType } = getClassType(connection); const { inputClassType, outClassType } = getClassType(connection);
let result: ITask[] = []; let result: ITask[] = [];
if ( if (inputClassType === outClassType) {
getTaskType(connection.source as string) === "FLOW" ||
getTaskType(connection.target as string) === "FLOW"
) {
return;
} else if (inputClassType === outClassType) {
result = connectCheck(connection) as ITask[]; result = connectCheck(connection) as ITask[];
} else { } else {
Message.error("端口数据类型不一致,无法连接!"); Message.error("端口数据类型不一致,无法连接!");
...@@ -617,14 +517,7 @@ const Flow = (props: IProps) => { ...@@ -617,14 +517,7 @@ const Flow = (props: IProps) => {
} }
setTasks && setTasks(result); setTasks && setTasks(result);
}, },
[ [Message, connectCheck, getClassType, setTasks, tasksDeleteLine]
Message,
connectCheck,
getClassType,
setTasks,
tasksDeleteLine,
getTaskType,
]
); );
/** 点击连线 */ /** 点击连线 */
...@@ -634,21 +527,11 @@ const Flow = (props: IProps) => { ...@@ -634,21 +527,11 @@ const Flow = (props: IProps) => {
/** 点击连线清除选中的node ID */ /** 点击连线清除选中的node ID */
setInSideFlowNodeId(""); setInSideFlowNodeId("");
setInSideBatchNodeId(""); setInSideBatchNodeId("");
setExternalSelectedNodeId && setExternalSelectedNodeId(""); setSelectedBatchNodeId && setSelectedBatchNodeId("");
}, },
[setExternalSelectedNodeId] [setSelectedBatchNodeId]
); );
// const onNodesChange = (val: any)=>{
// // 自定义change事件 不允许react flow组件本身删除事件
// // return
// }
// const onEdgesChange = (val: any) =>{
// // 自定义change事件 不允许react flow组件本身删除事件
// // return;
// }
const reactFlowParams = const reactFlowParams =
flowType === "edit" flowType === "edit"
? { ? {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 吴永生 15770852798@163.com * @Author: 吴永生 15770852798@163.com
* @Date: 2022-08-02 11:43:28 * @Date: 2022-08-02 11:43:28
* @LastEditors: 吴永生 15770852798@163.com * @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-08-30 19:32:05 * @LastEditTime: 2022-08-11 18:50:31
* @FilePath: /bkunyun/src/views/Project/components/ProjectListPopper/index.tsx * @FilePath: /bkunyun/src/views/Project/components/ProjectListPopper/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
*/ */
...@@ -15,7 +15,6 @@ import classNames from "classnames"; ...@@ -15,7 +15,6 @@ import classNames from "classnames";
import { useStores } from "@/store/index"; import { useStores } from "@/store/index";
import moment from "moment"; import moment from "moment";
import React, { useMemo, useState } from "react"; import React, { useMemo, useState } from "react";
import { useClickAway } from 'ahooks';
import { toJS } from "mobx"; import { toJS } from "mobx";
import { observer } from "mobx-react-lite"; import { observer } from "mobx-react-lite";
...@@ -39,18 +38,12 @@ const ProjectListPopper = observer((props: any) => { ...@@ -39,18 +38,12 @@ const ProjectListPopper = observer((props: any) => {
const handleProjectBox = (e: React.SyntheticEvent) => { const handleProjectBox = (e: React.SyntheticEvent) => {
setProjectListOpen(false); setProjectListOpen(false);
e.nativeEvent.stopImmediatePropagation();
}; };
useClickAway(
() => {
setProjectListOpen(false);
},
() => document.getElementById('use-click-projectList-mainBox'),
);
return ( return (
<div className={style.projectBox} onClick={handleProjectBox}> <div className={style.projectBox} onClick={handleProjectBox}>
<div className={style.mainBox} id="use-click-projectList-mainBox" onClick={(e: any)=>e.stopPropagation()}> <div className={style.mainBox}>
<div className={style.searchBox}> <div className={style.searchBox}>
<IconButton <IconButton
type="submit" type="submit"
......
...@@ -130,8 +130,6 @@ const OperatorItem = (props: IOperatorItemProps) => { ...@@ -130,8 +130,6 @@ const OperatorItem = (props: IOperatorItemProps) => {
draggable={true} draggable={true}
onDragStart={onDragStart} onDragStart={onDragStart}
onDragEnd={onDragEnd} onDragEnd={onDragEnd}
onDragOver={(e)=>e.preventDefault()}
// dragOver( e ){ e.preventDefault };
> >
<h2 className={styles.operatorItemTitle}>{title}</h2> <h2 className={styles.operatorItemTitle}>{title}</h2>
<div className={styles.operatorItemText}>{description}</div> <div className={styles.operatorItemText}>{description}</div>
......
...@@ -129,12 +129,6 @@ ...@@ -129,12 +129,6 @@
line-height: 20px; line-height: 20px;
color: rgba(255, 78, 78, 1); color: rgba(255, 78, 78, 1);
} }
.noParameters{
font-size: 12px;
text-align: center;
color: #C2C6CC;
line-height: 84px;
}
.noData { .noData {
height: calc(100vh - 140px); height: calc(100vh - 140px);
......
import _ from "lodash"; import _ from "lodash";
import { useCallback, useMemo, useRef, useState } from "react"; import { useCallback, useEffect, useMemo, useState } from "react";
import classNames from "classnames"; import classNames from "classnames";
import { import {
...@@ -20,7 +20,6 @@ import MySwitch from "@/components/mui/MySwitch"; ...@@ -20,7 +20,6 @@ import MySwitch from "@/components/mui/MySwitch";
import Tabs from "@/components/mui/Tabs"; import Tabs from "@/components/mui/Tabs";
import { getCustomTemplateParameterCheckResult } from "../../util"; import { getCustomTemplateParameterCheckResult } from "../../util";
import MyTooltip from "@/components/mui/MyTooltip"; import MyTooltip from "@/components/mui/MyTooltip";
import { useSize } from "ahooks";
import styles from "./index.module.css"; import styles from "./index.module.css";
...@@ -31,13 +30,18 @@ type IParameterSettingProps = { ...@@ -31,13 +30,18 @@ type IParameterSettingProps = {
}; };
const ParameterSetting = (props: IParameterSettingProps) => { const ParameterSetting = (props: IParameterSettingProps) => {
const { templateConfigInfo, setTemplateConfigInfo, taskId } = props; // 算子大数组 const { templateConfigInfo, setTemplateConfigInfo, taskId } = props; // 算子大数组
const [descHeight, setDescHeight] = useState(0); // 算子描述的高度 用来完成描述展开收起功能
const [isShowAllDese, setIsShowAllDese] = useState(false); // 是否展示全部描述 const [isShowAllDese, setIsShowAllDese] = useState(false); // 是否展示全部描述
const [fileSelectOpen, setFileSelectOpen] = useState(false); // 选择输出路径的弹窗显示控制 const [fileSelectOpen, setFileSelectOpen] = useState(false); // 选择输出路径的弹窗显示控制
const [fileSelectType, setFileSelectType] = useState<FileSelectType>("path"); const [fileSelectType, setFileSelectType] = useState<FileSelectType>("path");
const [parameterName, setParameterName] = useState(""); // 当前算子中的parameters中正在编辑饿parameter(参数) const [parameterName, setParameterName] = useState(""); // 当前算子中的parameters中正在编辑饿parameter(参数)
const resizeRef = useRef<HTMLDivElement>(null);
const size = useSize(resizeRef) ; const div = document.getElementById("descHeight"); // 算子描述的元素(不限高)用来完成描述展开收起功能
useEffect(() => {
if (div) {
setDescHeight(div.offsetHeight);
}
}, [div]);
// 文件夹路线选择器弹窗 // 文件夹路线选择器弹窗
const handleFileSelectOnClose = () => { const handleFileSelectOnClose = () => {
...@@ -63,12 +67,6 @@ const ParameterSetting = (props: IParameterSettingProps) => { ...@@ -63,12 +67,6 @@ const ParameterSetting = (props: IParameterSettingProps) => {
/** 通过parameter.name删除与之相关联的线 */ /** 通过parameter.name删除与之相关联的线 */
const handleHiddenDeleteEdge = useCallback( const handleHiddenDeleteEdge = useCallback(
(val: ITask[], parameterName: string) => { (val: ITask[], parameterName: string) => {
let taskParentNode = "";
val.forEach((task) => {
if (task.id === taskId) {
taskParentNode = task.parentNode || "";
}
});
return ( return (
val?.length && val?.length &&
val?.map((item) => { val?.map((item) => {
...@@ -94,11 +92,7 @@ const ParameterSetting = (props: IParameterSettingProps) => { ...@@ -94,11 +92,7 @@ const ParameterSetting = (props: IParameterSettingProps) => {
const newEdges = const newEdges =
(item?.edges?.length && (item?.edges?.length &&
item?.edges?.filter((every) => { item?.edges?.filter((every) => {
// 因为存在同名的parameterName 所以增加every.source === taskParentNode判断 return every.targetHandle !== parameterName;
return (
every.targetHandle !== parameterName ||
every.source === taskParentNode
);
})) || })) ||
[]; [];
return { return {
...@@ -188,10 +182,7 @@ const ParameterSetting = (props: IParameterSettingProps) => { ...@@ -188,10 +182,7 @@ const ParameterSetting = (props: IParameterSettingProps) => {
const renderInput = useCallback( const renderInput = useCallback(
(parameter: IParameter) => { (parameter: IParameter) => {
return ( return (
<MyTooltip <MyTooltip title={parameter.description} placement="right">
title={parameter.description || parameter.name}
placement="right"
>
<div> <div>
{(parameter.domType || "").toLowerCase() === "file" && ( {(parameter.domType || "").toLowerCase() === "file" && (
<MyInput <MyInput
...@@ -359,34 +350,22 @@ const ParameterSetting = (props: IParameterSettingProps) => { ...@@ -359,34 +350,22 @@ const ParameterSetting = (props: IParameterSettingProps) => {
const inParameters: Array<IParameter> = useMemo(() => { const inParameters: Array<IParameter> = useMemo(() => {
if (!taskInfo) { if (!taskInfo) {
return []; return [];
} else {
if (taskInfo.type === "BATCH") {
return taskInfo.parameters.filter(
(parameter) => parameter.parameterGroup === "in" && !parameter.thrown
);
} else { } else {
return taskInfo.parameters.filter( return taskInfo.parameters.filter(
(parameter) => parameter.parameterGroup === "in" (parameter) => parameter.parameterGroup === "in"
); );
} }
}
}, [taskInfo]); }, [taskInfo]);
// 输出参数 // 输出参数
const outParameters: Array<IParameter> = useMemo(() => { const outParameters: Array<IParameter> = useMemo(() => {
if (!taskInfo) { if (!taskInfo) {
return []; return [];
} else {
if (taskInfo.type === "BATCH") {
return taskInfo.parameters.filter(
(parameter) => parameter.parameterGroup === "out" && !parameter.thrown
);
} else { } else {
return taskInfo.parameters.filter( return taskInfo.parameters.filter(
(parameter) => parameter.parameterGroup === "out" (parameter) => parameter.parameterGroup === "out"
); );
} }
}
}, [taskInfo]); }, [taskInfo]);
// 基础参数 // 基础参数
...@@ -441,7 +420,7 @@ const ParameterSetting = (props: IParameterSettingProps) => { ...@@ -441,7 +420,7 @@ const ParameterSetting = (props: IParameterSettingProps) => {
[styles.required]: parameter.required, [styles.required]: parameter.required,
})} })}
> >
{parameter.title} {parameter.name}
</div> </div>
<div className={styles.parameterClassTypeName}> <div className={styles.parameterClassTypeName}>
{parameter.classTypeName} {parameter.classTypeName}
...@@ -521,14 +500,13 @@ const ParameterSetting = (props: IParameterSettingProps) => { ...@@ -521,14 +500,13 @@ const ParameterSetting = (props: IParameterSettingProps) => {
{taskInfo.description || "-"} {taskInfo.description || "-"}
</div> </div>
<div <div
ref={resizeRef}
className={classNames({ className={classNames({
[styles.taskDescriptionAll]: isShowAllDese, [styles.taskDescriptionAll]: isShowAllDese,
[styles.taskDescription]: !isShowAllDese, [styles.taskDescription]: !isShowAllDese,
})} })}
> >
{taskInfo.description || "-"} {taskInfo.description || "-"}
{size && size?.height >= 60 && ( {descHeight > 60 && (
<span <span
className={styles.descButton} className={styles.descButton}
onClick={() => setIsShowAllDese(!isShowAllDese)} onClick={() => setIsShowAllDese(!isShowAllDese)}
...@@ -569,7 +547,7 @@ const ParameterSetting = (props: IParameterSettingProps) => { ...@@ -569,7 +547,7 @@ const ParameterSetting = (props: IParameterSettingProps) => {
[styles.required]: parameter.required, [styles.required]: parameter.required,
})} })}
> >
{parameter.title} {parameter.name}
</div> </div>
<div className={styles.inOutParameterdataType}> <div className={styles.inOutParameterdataType}>
{parameter.classTypeName} {parameter.classTypeName}
...@@ -581,7 +559,6 @@ const ParameterSetting = (props: IParameterSettingProps) => { ...@@ -581,7 +559,6 @@ const ParameterSetting = (props: IParameterSettingProps) => {
onChange={(e: any) => onChange={(e: any) =>
handleHiddenChange(e, parameter.name || "") handleHiddenChange(e, parameter.name || "")
} }
disabled={true}
></MySwitch> ></MySwitch>
</div> </div>
</div> </div>
...@@ -615,7 +592,7 @@ const ParameterSetting = (props: IParameterSettingProps) => { ...@@ -615,7 +592,7 @@ const ParameterSetting = (props: IParameterSettingProps) => {
[styles.required]: parameter.required, [styles.required]: parameter.required,
})} })}
> >
{parameter.title} {parameter.name}
</div> </div>
<div className={styles.inOutParameterdataType}> <div className={styles.inOutParameterdataType}>
{parameter.classTypeName} {parameter.classTypeName}
...@@ -647,12 +624,10 @@ const ParameterSetting = (props: IParameterSettingProps) => { ...@@ -647,12 +624,10 @@ const ParameterSetting = (props: IParameterSettingProps) => {
</div> </div>
<Tabs <Tabs
tabList={paramsTabList} tabList={paramsTabList}
value={activeParamsTab} defaultValue={activeParamsTab}
// defaultValue={activeParamsTab}
allowNullValue={true} allowNullValue={true}
tabPanelSx={{ padding: "7px 0" }} tabPanelSx={{ padding: "7px 0" }}
/> />
{basisParameters.length === 0 && seniorParameters.length === 0 && hardwareParameters.length === 0 && (<div className={styles.noParameters}>暂无可设置参数</div>)}
</div> </div>
)} )}
{!taskInfo && ( {!taskInfo && (
......
/* /*
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com * @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-07-15 15:47:16 * @Date: 2022-07-15 15:47:16
* @LastEditors: 吴永生 15770852798@163.com * @LastEditors: 吴永生#A02208 yongsheng.wu@wholion.com
* @LastEditTime: 2022-08-23 11:32:19 * @LastEditTime: 2022-07-15 16:30:59
* @FilePath: /bkunyun/src/views/WorkFlowEdit/components/SaveCustomTemplate/index.tsx * @FilePath: /bkunyun/src/views/WorkFlowEdit/components/SaveCustomTemplate/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
*/ */
...@@ -107,7 +107,7 @@ const SaveCustomTemplate = (props: IProps) => { ...@@ -107,7 +107,7 @@ const SaveCustomTemplate = (props: IProps) => {
helperText: "必须输入模板名称", helperText: "必须输入模板名称",
}); });
return false; return false;
} else if (title.length > 50) { } else if (title.length > 15) {
setTitleHelper({ setTitleHelper({
error: true, error: true,
helperText: "格式不正确,必须在15字符以内,仅限大小写字母、数字、中文", helperText: "格式不正确,必须在15字符以内,仅限大小写字母、数字、中文",
......
...@@ -45,28 +45,14 @@ ...@@ -45,28 +45,14 @@
bottom: 20px; bottom: 20px;
width: 36px; width: 36px;
height: 36px; height: 36px;
border-radius: 18px; border-radius: 50%;
box-shadow: 0px 3px 10px 0px rgba(0, 24, 57, 0.14); box-shadow: 0px 3px 10px 0px rgba(0, 24, 57, 0.14);
font-size: 30px; font-size: 30px;
line-height: 36px; line-height: 36px;
text-align: start; text-align: center;
color: RGBA(66, 141, 255, 1); color: RGBA(66, 141, 255, 1);
cursor: pointer; cursor: pointer;
background-color: #fff; background-color: #fff;
transition: width 1s;
-webkit-transition: width 1s;
overflow: hidden;
display: flex;
justify-content: start;
align-items: center;
}
.addOperator:hover {
width: 105px;
}
.addText {
font-size: 14px;
line-height: 36px;
white-space: nowrap;
} }
.swFlowBox { .swFlowBox {
flex: 1; flex: 1;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* @FilePath: /bkunyun/src/views/Project/ProjectSubmitWork/index.tsx * @FilePath: /bkunyun/src/views/Project/ProjectSubmitWork/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
*/ */
import React, { useCallback, useEffect, useState, useMemo } from "react"; import React, { useCallback, useEffect, useState } from "react";
import ArrowBackIosNewIcon from "@mui/icons-material/ArrowBackIosNew"; import ArrowBackIosNewIcon from "@mui/icons-material/ArrowBackIosNew";
import IconButton from "@mui/material/IconButton"; import IconButton from "@mui/material/IconButton";
import _ from "lodash"; import _ from "lodash";
...@@ -25,7 +25,6 @@ import { getCustomTemplateParameterCheckResult } from "./util"; ...@@ -25,7 +25,6 @@ import { getCustomTemplateParameterCheckResult } from "./util";
import useMyRequest from "@/hooks/useMyRequest"; import useMyRequest from "@/hooks/useMyRequest";
import CustomOperator from "../CustomOperator"; import CustomOperator from "../CustomOperator";
import SaveCustomTemplate from "./components/SaveCustomTemplate"; import SaveCustomTemplate from "./components/SaveCustomTemplate";
import AddIcon from "@mui/icons-material/Add";
import styles from "./index.module.css"; import styles from "./index.module.css";
...@@ -56,7 +55,6 @@ const WorkFlowEdit = observer((props: IProps) => { ...@@ -56,7 +55,6 @@ const WorkFlowEdit = observer((props: IProps) => {
const [oldversion, setOldersion] = useState(""); // 编辑是自定义模板的老版本 const [oldversion, setOldersion] = useState(""); // 编辑是自定义模板的老版本
const [description, setDescription] = useState(""); // 自定义模板描述 const [description, setDescription] = useState(""); // 自定义模板描述
const [creator, setCreator] = useState(""); // 自定义模板创建人 const [creator, setCreator] = useState(""); // 自定义模板创建人
const [operatingArea, setOperatingArea] = useState<"form" | "flow">("form"); // 当前操作区域
const [leftContentType, setLeftContentType] = useState("list"); // 页面左侧展示的是算子列表还是参数设置 const [leftContentType, setLeftContentType] = useState("list"); // 页面左侧展示的是算子列表还是参数设置
const [popperTitle, setPopperTitle] = useState( const [popperTitle, setPopperTitle] = useState(
...@@ -64,14 +62,6 @@ const WorkFlowEdit = observer((props: IProps) => { ...@@ -64,14 +62,6 @@ const WorkFlowEdit = observer((props: IProps) => {
"返回后,当前页面已填写内容将不保存,确认返回吗?" "返回后,当前页面已填写内容将不保存,确认返回吗?"
); );
// 是否要监听删除时间
const listenState = useMemo(() => {
if (operatingArea === "form") {
return false;
}
return !saveFormDialog && !showCustomOperator;
}, [operatingArea, saveFormDialog, showCustomOperator]);
// 编辑时获取模板详情的方法 // 编辑时获取模板详情的方法
const { run: fetchTemplateConfigInfoRun } = useMyRequest( const { run: fetchTemplateConfigInfoRun } = useMyRequest(
fetchTemplateConfigInfo, fetchTemplateConfigInfo,
...@@ -153,25 +143,19 @@ const WorkFlowEdit = observer((props: IProps) => { ...@@ -153,25 +143,19 @@ const WorkFlowEdit = observer((props: IProps) => {
return; return;
} }
let templateConfigInfoClone: ITask[] = _.cloneDeep(templateConfigInfo); let templateConfigInfoClone: ITask[] = _.cloneDeep(templateConfigInfo);
let tasksIsCheck = true; // 整体校验 let check = true;
templateConfigInfoClone.forEach((task) => { templateConfigInfoClone.forEach((task) => {
let taskIsCheck = true; // 单个task校验
task.parameters.forEach((parameter) => { task.parameters.forEach((parameter) => {
if (task.type === "BATCH" && parameter.thrown) {
return;
}
const checkResult = getCustomTemplateParameterCheckResult(parameter); const checkResult = getCustomTemplateParameterCheckResult(parameter);
parameter.error = checkResult.error; parameter.error = checkResult.error;
parameter.helperText = checkResult.helperText; parameter.helperText = checkResult.helperText;
if (checkResult.error) { if (checkResult.error) {
taskIsCheck = false; check = false;
tasksIsCheck = false;
} }
}); });
task.isCheck = taskIsCheck;
}); });
setTemplateConfigInfo(templateConfigInfoClone); setTemplateConfigInfo(templateConfigInfoClone);
if (!tasksIsCheck) { if (!check) {
Message.error("工作流校验未通过,请检查!"); Message.error("工作流校验未通过,请检查!");
} else { } else {
setSaveFormDialog(true); setSaveFormDialog(true);
...@@ -216,12 +200,7 @@ const WorkFlowEdit = observer((props: IProps) => { ...@@ -216,12 +200,7 @@ const WorkFlowEdit = observer((props: IProps) => {
</div> </div>
</div> </div>
<div className={styles.swContent}> <div className={styles.swContent}>
<div <div className={styles.swFormBox}>
className={styles.swFormBox}
onClick={() => {
setOperatingArea("form");
}}
>
<div className={styles.radiosBox}> <div className={styles.radiosBox}>
<RadioGroupOfButtonStyle <RadioGroupOfButtonStyle
radioOptions={radioOptions} radioOptions={radioOptions}
...@@ -255,23 +234,16 @@ const WorkFlowEdit = observer((props: IProps) => { ...@@ -255,23 +234,16 @@ const WorkFlowEdit = observer((props: IProps) => {
className={styles.addOperator} className={styles.addOperator}
onClick={() => setShowCustomOperator(true)} onClick={() => setShowCustomOperator(true)}
> >
<AddIcon sx={{ padding: "6px" }} /> +
<span className={styles.addText}>添加算子</span>
</div> </div>
</div> </div>
<div <div className={styles.swFlowBox} id="workFlowEditRight">
className={styles.swFlowBox}
id="workFlowEditRight"
onClick={() => {
setOperatingArea("flow");
}}
>
<Flow <Flow
tasks={templateConfigInfo} tasks={templateConfigInfo}
setTasks={setTemplateConfigInfo} setTasks={setTemplateConfigInfo}
type="edit" type="edit"
onFlowNodeClick={handleNodeClick} onFlowNodeClick={handleNodeClick}
ListenState={listenState} ListenState={!saveFormDialog && !showCustomOperator}
/> />
</div> </div>
</div> </div>
......
...@@ -50,7 +50,7 @@ export const getCustomTemplateParameterCheckResult = ( ...@@ -50,7 +50,7 @@ export const getCustomTemplateParameterCheckResult = (
} else if (parameter.hidden && !parameter.linked) { } else if (parameter.hidden && !parameter.linked) {
return { return {
error: true, error: true,
helperText: '该输入为必填,需在右侧视图编辑区连接输入文件', helperText: '该输入为必填,需在右侧视图编辑区连接输入文件或重新改回“开启”状态',
deleteLine: false, deleteLine: false,
} }
} }
......
import { memo } from "react";
import DeleteIcon from "@mui/icons-material/Delete";
import Button from "@/components/mui/MyButton";
const ProjectMembers = () => {
return (
<>
<Button size={"large"} text={"确定"} />
&nbsp;&nbsp;
<Button text={"确定"} />
&nbsp;&nbsp;
<Button size={"small"} text={"确定"} />
<br />
<br />
<Button size={"large"} text={"确定"} disabled />
&nbsp;&nbsp;
<Button text={"确定"} disabled />
&nbsp;&nbsp;
<Button size={"small"} text={"确定"} disabled />
<br />
<br />
<Button size={"large"} color={"secondary"} text={"确定"} />
&nbsp;&nbsp;
<Button color={"secondary"} text={"确定"} />
&nbsp;&nbsp;
<Button size={"small"} color={"secondary"} text={"确定"} />
<br /> <br />
<Button
text={"确定"}
size={"large"}
style={{ color: "aqua", background: "burlywood" }}
/>
&nbsp;&nbsp;
<Button
text={"确定"}
style={{ color: "aqua", background: "burlywood" }}
/>
&nbsp;&nbsp;
<Button
text={"确定"}
size={"small"}
style={{ color: "aqua", background: "burlywood" }}
/>
<br /> <br />
outlined
<br />
<Button size={"large"} variant={"outlined"} text={"确定"} />
&nbsp;&nbsp;
<Button variant={"outlined"} text={"确定"} />
&nbsp;&nbsp;
<Button size={"small"} variant={"outlined"} text={"确定"} />
<br /> <br />
<Button size={"large"} variant={"outlined"} disabled text={"确定"} />
&nbsp;&nbsp;
<Button variant={"outlined"} disabled text={"确定"} />
&nbsp;&nbsp;
<Button size={"small"} variant={"outlined"} disabled text={"确定"} />
<br /> <br />
<Button
size={"large"}
variant={"outlined"}
color={"secondary"}
text={"确定"}
/>
&nbsp;&nbsp;
<Button variant={"outlined"} color={"secondary"} text={"确定"} />
&nbsp;&nbsp;
<Button
size={"small"}
variant={"outlined"}
color={"secondary"}
text={"确定"}
/>
<br /> <br />
<Button
text={"确定"}
size={"large"}
variant={"outlined"}
style={{ color: "aqua", background: "burlywood" }}
/>
&nbsp;&nbsp;
<Button
text={"确定"}
variant={"outlined"}
style={{ color: "aqua", background: "burlywood" }}
/>
&nbsp;&nbsp;
<Button
text={"确定"}
size={"small"}
variant={"outlined"}
style={{ color: "aqua", background: "burlywood" }}
/>
<br /> <br />
text
<br />
<Button
size={"large"}
variant={"text"}
text={"确定确定确定确定确定确定"}
/>
&nbsp;&nbsp;
<Button variant={"text"} text={"确定确定确定确定确定确定"} />
&nbsp;&nbsp;
<Button
size={"small"}
variant={"text"}
text={"确定确定确定确定确定确定"}
/>
<br />
<Button
size={"large"}
disabled
variant={"text"}
text={"确定确定确定确定确定确定"}
/>
&nbsp;&nbsp;
<Button variant={"text"} disabled text={"确定确定确定确定确定确定"} />
&nbsp;&nbsp;
<Button
size={"small"}
disabled
variant={"text"}
text={"确定确定确定确定确定确定"}
/>
<br />
<Button
size={"large"}
color={"secondary"}
variant={"text"}
text={"确定确定确定确定确定确定"}
/>
&nbsp;&nbsp;
<Button
variant={"text"}
color={"secondary"}
text={"确定确定确定确定确定确定"}
/>
&nbsp;&nbsp;
<Button
size={"small"}
color={"secondary"}
variant={"text"}
text={"确定确定确定确定确定确定"}
/>
<br /> <br />
img
<br />
<Button text={"确定确定确定确定确定确定"} img={<DeleteIcon />} />
<br /> <br />
select
<br />
<Button
text={"更多"}
select={[
{ name: "1111111" },
{ name: "1111111" },
{ name: "1111111" },
{ name: "1111111", color: "red" },
]}
/>
<Button
text={"更多"}
color={"secondary"}
variant={"text"}
select={[
{ name: "1111111" },
{ name: "1111111" },
{ name: "1111111" },
{ name: "1111111", color: "red" },
]}
/>
</>
);
};
export default memo(ProjectMembers);
import { memo } from "react";
import { InputAdornment } from "@mui/material";
import InputComponent from "@/components/mui/MyInput";
const ProjectMembers = () => {
return (
<>
<InputComponent
fullWidth={false}
label={"test"}
defaultValue={"sssssssss"}
/>
<InputComponent fullWidth={false} defaultValue={"sssssssss"} />
&nbsp;&nbsp;&nbsp;&nbsp;
<InputComponent
fullWidth={false}
label={"test"}
error={true}
helperText={"你还急急急靠靠靠靠靠靠靠靠靠靠靠靠靠靠"}
/>
&nbsp;&nbsp;&nbsp;&nbsp;
<InputComponent
fullWidth={false}
label={"test"}
size={"small"}
disabled
/>
&nbsp;&nbsp;&nbsp;&nbsp;
<InputComponent fullWidth={false} label={"xsmall"} />
&nbsp;&nbsp;&nbsp;&nbsp;
<InputComponent fullWidth={false} placeholder={"测试机哦"} />
&nbsp;&nbsp;&nbsp;&nbsp;
<InputComponent
fullWidth={false}
size={"small"}
placeholder={"nishuoshenm"}
label={"asdasfasf"}
/>
<br /> <br />
<InputComponent fullWidth={true} />
<br />
<br />
{/* <SelectComponent
option={json}
/>
<br /><br />
<SelectComponent
option={json}
size={"large"}
/>
<br /><br />
<SelectComponent
option={json}
size={"small"}
/> */}
<br />
<br />
</>
);
};
export default memo(ProjectMembers);
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