Commit e7ef887f authored by wuyongsheng's avatar wuyongsheng

Merge branch 'feat-20220801' into 'release'

Feat 20220801

See merge request !80
parents 8c1e03bf c3e98d12
/* /*
* @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: 吴永生#A02208 yongsheng.wu@wholion.com * @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-07-18 15:44:35 * @LastEditTime: 2022-08-30 16:22:15
* @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.57.4.97"; BACKEND_API_URI_PREFIX = "http://47.75.104.171";
} }
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="工作台(管理员)空" transform="translate(-370.000000, -245.000000)"> <g id="1.Base基础/Icon图标/任务列表备份">
<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 filter="url(#filter-1)" id="编组-4"> <g id="编组-4" transform="translate(0.500000, 0.000000)" stroke="#C2C6CC" stroke-width="1.5">
<g transform="translate(0.500000, 0.000000)"> <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>
<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> <polyline id="路径-20" points="1.29720478 4.56847209 7.47016174 7.45 13.6431187 4.56847209"></polyline>
<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"></line>
<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图标/任务列表</title> <title>1.Base基础/Icon图标/任务列表备份 2</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="任务列表" transform="translate(-370.000000, -245.000000)"> <g id="1.Base基础/Icon图标/任务列表备份-2">
<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 filter="url(#filter-1)" id="编组-4"> <g id="编组-4" transform="translate(0.500000, 0.000000)" stroke="#1370FF" stroke-width="1.5">
<g transform="translate(0.500000, 0.000000)"> <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>
<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> <polyline id="路径-20" points="1.29720478 4.56847209 7.47016174 7.45 13.6431187 4.56847209"></polyline>
<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"></line>
<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="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"> <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图标/工作流模版备份 3</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="任务列表" transform="translate(-245.000000, -246.000000)"> <g id="编组-5">
<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="#979797" stroke-width="1.5"> <g id="编组-4" transform="translate(1.000000, 1.000000)" stroke="#C2C6CC" 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>
...@@ -20,7 +12,4 @@ ...@@ -20,7 +12,4 @@
</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="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"> <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.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="工作台(管理员)空" transform="translate(-245.000000, -246.000000)"> <g id="编组-5">
<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="#979797" stroke-width="1.5"> <g id="编组-4" transform="translate(1.000000, 1.000000)" stroke="#1370FF" 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>
...@@ -20,7 +12,4 @@ ...@@ -20,7 +12,4 @@
</g> </g>
</g> </g>
</g> </g>
</g>
</g>
</g>
</svg> </svg>
\ No newline at end of file
.FSBox { .FSBox {
width: 900px; width: 900px;
height: 650px; max-height: 550px;
position: relative; position: relative;
} }
......
...@@ -447,6 +447,7 @@ const FileSelect = observer((props: FileSelectProps) => { ...@@ -447,6 +447,7 @@ 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,3 +33,11 @@ ...@@ -33,3 +33,11 @@
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,6 +8,7 @@ ...@@ -8,6 +8,7 @@
*/ */
// 按钮样式的单选组 // 按钮样式的单选组
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 = {
...@@ -27,10 +28,21 @@ const RadioGroupOfButtonStyle = (props: IRadioGroupOfButtonStyleProps) => { ...@@ -27,10 +28,21 @@ 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) => { {radioOptions.map((options, index) => {
return ( return (
<>
<div <div
key={options.value} key={options.value}
className={classnames({ className={classnames({
...@@ -42,6 +54,17 @@ const RadioGroupOfButtonStyle = (props: IRadioGroupOfButtonStyleProps) => { ...@@ -42,6 +54,17 @@ 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,6 +66,7 @@ const MySnackbarProvider = ({ ...@@ -66,6 +66,7 @@ const MySnackbarProvider = ({
}: MySnackbarProviderProp) => { }: MySnackbarProviderProp) => {
const { const {
open, open,
setOpen,
messageInfo, messageInfo,
handleExited, handleExited,
success, success,
...@@ -74,31 +75,46 @@ const MySnackbarProvider = ({ ...@@ -74,31 +75,46 @@ 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: {
color: getColorStyle, minWidth: "360px",
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: getColorStyle, color: "#FF4E4E",
},
},
"&.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)",
},
}, },
}, },
}, },
...@@ -137,7 +153,10 @@ const MySnackbarProvider = ({ ...@@ -137,7 +153,10 @@ const MySnackbarProvider = ({
severity={messageInfo?.severity} severity={messageInfo?.severity}
variant={variant} variant={variant}
elevation={elevation} elevation={elevation}
sx={{ boxShadow: "unset", ...alertSx }} sx={{ ...alertSx }}
onClose={() => {
setOpen(false);
}}
> >
{messageInfo?.content} {messageInfo?.content}
</Alert> </Alert>
......
...@@ -69,6 +69,7 @@ const useMySnackbar = () => { ...@@ -69,6 +69,7 @@ const useMySnackbar = () => {
return { return {
open, open,
setOpen,
messageInfo, messageInfo,
handleExited, handleExited,
success, success,
......
...@@ -35,9 +35,13 @@ const MyInput = (props: MyInputProps) => { ...@@ -35,9 +35,13 @@ 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",
...@@ -68,7 +72,7 @@ const MyInput = (props: MyInputProps) => { ...@@ -68,7 +72,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
......
...@@ -71,6 +71,14 @@ export default function MySelect(props: IProps) { ...@@ -71,6 +71,14 @@ 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,7 +138,8 @@ export default function EnhancedTable(props: ITableProps) { ...@@ -138,7 +138,8 @@ 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}
......
...@@ -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-16 15:53:31 * @LastEditTime: 2022-08-31 20:25:56
* @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 } from "react"; import { memo, useCallback } 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,11 +21,14 @@ interface ITabList { ...@@ -21,11 +21,14 @@ 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;
...@@ -70,11 +73,14 @@ const theme = createTheme({ ...@@ -70,11 +73,14 @@ 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
...@@ -82,17 +88,31 @@ const Tabs = (props: IProps) => { ...@@ -82,17 +88,31 @@ const Tabs = (props: IProps) => {
: tabList.filter((e) => !e.hide)[0].value : tabList.filter((e) => !e.hide)[0].value
); );
const onChange = (val: string) => { const [hoverValue, setHoverValue] = useState('')
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 (
<Box style={{ display: "flex", alignItems: "center" }}> <div style={{ display: "flex", alignItems: "center" }} onMouseOver={()=>setHoverValue(item.value)} onMouseOut={()=>setHoverValue('')}>
{item.icon ? ( {item.icon ? (
<img <img
style={{ width: "16px", marginRight: "8px" }} style={{ width: "16px", marginRight: "8px" }}
src={value === item.value ? item.iconed : item.icon} src={getImgSrc(item)}
alt="" alt=""
/> />
) : ( ) : (
...@@ -108,17 +128,17 @@ const Tabs = (props: IProps) => { ...@@ -108,17 +128,17 @@ const Tabs = (props: IProps) => {
> >
{item.label} {item.label}
</Typography> </Typography>
</Box> </div>
); );
}; };
return ( return (
<ThemeProvider theme={theme}> <ThemeProvider theme={theme}>
<TabContext value={value}> <TabContext value={value || tabValue}>
<Box sx={{ borderBottom: 1, borderColor: "#dde1e6" }}> <Box sx={{ borderBottom: 1, borderColor: "#EDEFF2" }}>
<TabList <TabList
onChange={(e: any, val: string) => { onChange={(e: any, val: string) => {
onChange(val); onTabChange(val);
}} }}
> >
{tabList {tabList
......
...@@ -41,9 +41,7 @@ root.render( ...@@ -41,9 +41,7 @@ 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>
......
...@@ -19,6 +19,7 @@ import classNames from "classnames"; ...@@ -19,6 +19,7 @@ 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 = {
...@@ -117,14 +118,15 @@ const SeeDataset = observer((props: ISeeDatasetProps) => { ...@@ -117,14 +118,15 @@ const SeeDataset = observer((props: ISeeDatasetProps) => {
Object.keys(res.data.list[0]).forEach((item) => { Object.keys(res.data.list[0]).forEach((item) => {
if ( if (
![ ![
"canonical_smiles", "meta",
"id", "id",
"mol", // "canonical_smiles",
"mol2", // "mol",
"pdb", // "mol2",
"sdf", // "pdb",
"sdf2d", // "sdf",
"sdf3d", // "sdf2d",
// "sdf3d",
// "smiles", // "smiles",
].includes(item) ].includes(item)
) { ) {
...@@ -313,7 +315,7 @@ const SeeDataset = observer((props: ISeeDatasetProps) => { ...@@ -313,7 +315,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.meta) {Object.keys(item)
.filter((key) => showData.indexOf(key) !== -1) .filter((key) => showData.indexOf(key) !== -1)
.map((key, index) => { .map((key, index) => {
return ( return (
...@@ -326,11 +328,13 @@ const SeeDataset = observer((props: ISeeDatasetProps) => { ...@@ -326,11 +328,13 @@ const SeeDataset = observer((props: ISeeDatasetProps) => {
> >
{key} {key}
</span> </span>
<MyTooltip title={item[key]}>
<span <span
className={style.datasetLiDataLiValue} className={style.datasetLiDataLiValue}
> >
{item.meta[key]} {item[key]}
</span> </span>
</MyTooltip>
</div> </div>
); );
})} })}
......
...@@ -40,6 +40,11 @@ ...@@ -40,6 +40,11 @@
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,7 @@ const ProjectData = observer(() => { ...@@ -68,7 +68,7 @@ const ProjectData = observer(() => {
useEffect(() => { useEffect(() => {
const locationInfo: any = location?.state; const locationInfo: any = location?.state;
setActiveTab(locationInfo?.dataType || 'file') setActiveTab(locationInfo?.dataType || "file");
setPath(locationInfo?.pathName || "/"); setPath(locationInfo?.pathName || "/");
}, [location]); }, [location]);
...@@ -557,12 +557,17 @@ const ProjectData = observer(() => { ...@@ -557,12 +557,17 @@ const ProjectData = observer(() => {
size="small" size="small"
onClick={handleRefresh} onClick={handleRefresh}
disabled={!isPass("PROJECT_DATA_REFRESH", "USER")} disabled={!isPass("PROJECT_DATA_REFRESH", "USER")}
sx={{ marginLeft: "17px", width: '32px', height: '32px', ":hover": { sx={{
backgroundColor: "#F0F2F5 ", marginLeft: "12px",
borderRadius: 2 width: "32px",
} }} height: "32px",
":hover": {
backgroundColor: "rgba(240, 242, 245, 1)",
borderRadius: "4px",
},
}}
> >
<RefreshIcon sx={{ fontSize: "18px" }} /> <img className={style.refreshIcon} src={refresh} alt="" />
</IconButton> </IconButton>
</div> </div>
</div> </div>
......
...@@ -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-09-01 09:39: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
*/ */
...@@ -39,15 +39,20 @@ import { useMessage } from "@/components/MySnackbar"; ...@@ -39,15 +39,20 @@ import { useMessage } from "@/components/MySnackbar";
import MyPopconfirm from "@/components/mui/MyPopconfirm"; import MyPopconfirm from "@/components/mui/MyPopconfirm";
import SeeDataset from "../ProjectData/SeeDataset"; import SeeDataset from "../ProjectData/SeeDataset";
import { getToken, storageUnitFromB } from "@/utils/util"; import { getToken, storageUnitFromB } from "@/utils/util";
import LogView from "./LogView" import LogView from "./LogView";
import usePass from "@/hooks/usePass"; import usePass from "@/hooks/usePass";
import { IFlowNodeTransmissionNum } from "./interface"; import { IFlowNodeTransmissionNum } from "./interface";
import { getConnectionArr, getDatasetName, getDatasetPath, getSameBatch } from "./utils"; import {
getConnectionArr,
getDatasetName,
getDatasetPath,
getSameBatch,
} from "./utils";
import styles from "./index.module.css"; import styles from "./index.module.css";
const stateMap = { const stateMap = {
SUBMITTED:"正在启动", SUBMITTED: "正在启动",
RUNNING: "正在运行", RUNNING: "正在运行",
ABORTED: "运行终止", ABORTED: "运行终止",
FAILED: "运行失败", FAILED: "运行失败",
...@@ -85,7 +90,7 @@ const ProjectSubmitWork = observer(() => { ...@@ -85,7 +90,7 @@ const ProjectSubmitWork = observer(() => {
// 查看日志弹框显示 // 查看日志弹框显示
const [showLogView, setShowLogView] = useState<boolean>(false); const [showLogView, setShowLogView] = useState<boolean>(false);
// 日志信息 // 日志信息
const [logs, setLogs] = useState<Array<any>>([]) const [logs, setLogs] = useState<Array<any>>([]);
const { name, state } = workFlowJobInfo || {}; const { name, state } = workFlowJobInfo || {};
// 查看数据集(数据集详情)显示控制 // 查看数据集(数据集详情)显示控制
...@@ -97,68 +102,79 @@ const ProjectSubmitWork = observer(() => { ...@@ -97,68 +102,79 @@ const ProjectSubmitWork = observer(() => {
/** 获取模版数据 */ /** 获取模版数据 */
const { run } = useMyRequest(fetchWorkFlowJob, { const { run } = useMyRequest(fetchWorkFlowJob, {
pollingInterval: 1000 * 60, pollingInterval: 1000 * 20,
pollingWhenHidden: false, pollingWhenHidden: false,
onSuccess: (res: IResponse<ITaskInfo>) => { onSuccess: (res: IResponse<ITaskInfo>) => {
getOutouts(res.data.outputs); getOutouts(res.data.outputs);
getLogs(res.data); getLogs(res.data);
setWorkFlowJobInfo(res.data); setWorkFlowJobInfo(res.data);
const newWorkflowId = locationInfo?.taskId?.replaceAll('-', '') const newWorkflowId = locationInfo?.taskId?.replaceAll("-", "");
getFlowNumber({projectId,workflowId: newWorkflowId,filetoken:fileToken, token: getToken()}) getFlowNumber({
projectId,
workflowId: newWorkflowId,
filetoken: fileToken,
token: getToken(),
});
}, },
}); });
// 处理日志数据 // 处理日志数据
const getLogs = (data: any) => { const getLogs = (data: any) => {
let logs = [{ logName: "workflow.log", logPath: data.logPath }] let logs = [{ logName: "workflow.log", logPath: data.logPath }];
data.tasks.forEach((i: any) => { data.tasks.forEach((i: any) => {
if (i.outLog) { if (i.outLog) {
logs.push({ logName: `${i.title}.log`, logPath: i.outLog }) logs.push({ logName: `${i.title}.log`, logPath: i.outLog });
} }
}); });
setLogs(logs) setLogs(logs);
} };
/** 更新流节点传输数据 */ /** 更新流节点传输数据 */
const updateFlowNodeEdgeLabel = useCallback((flowNodeInfo: IFlowNodeTransmissionNum[])=>{ const updateFlowNodeEdgeLabel = useCallback(
const newTasks = workFlowJobInfo && workFlowJobInfo?.tasks?.length && workFlowJobInfo?.tasks.map(item=>{ (flowNodeInfo: IFlowNodeTransmissionNum[]) => {
if(getSameBatch(flowNodeInfo, item)){ const newTasks =
const newEdges = item?.edges?.length && item.edges.map(edgeItem => { workFlowJobInfo &&
const connectionArr = getConnectionArr(flowNodeInfo,edgeItem ) workFlowJobInfo?.tasks?.length &&
if(connectionArr?.length){ workFlowJobInfo?.tasks.map((item) => {
if (getSameBatch(flowNodeInfo, item)) {
const newEdges =
item?.edges?.length &&
item.edges.map((edgeItem) => {
const connectionArr = getConnectionArr(flowNodeInfo, edgeItem);
if (connectionArr?.length) {
return { return {
...edgeItem, ...edgeItem,
label: String(connectionArr[0]?.value) label: String(connectionArr[0]?.value),
} };
}else { } else {
return edgeItem return edgeItem;
} }
}) });
return { return {
...item, ...item,
edges: newEdges || [], edges: newEdges || [],
} };
} else { } else {
return item return item;
} }
}) });
if(workFlowJobInfo) { if (workFlowJobInfo) {
setWorkFlowJobInfo({ setWorkFlowJobInfo({
...workFlowJobInfo, ...workFlowJobInfo,
tasks: newTasks || [] tasks: newTasks || [],
}) });
} }
},
},[workFlowJobInfo]) [workFlowJobInfo]
);
/** 获取流节点数据 */ /** 获取流节点数据 */
const { run: getFlowNumber } = useMyRequest(fetchFlowOutputNumber, { const { run: getFlowNumber } = useMyRequest(fetchFlowOutputNumber, {
pollingInterval: 1000 * 20, pollingInterval: 1000 * 20,
pollingWhenHidden: false, pollingWhenHidden: false,
onSuccess: (res: IResponse<IFlowNodeTransmissionNum[]>) => { onSuccess: (res: IResponse<IFlowNodeTransmissionNum[]>) => {
if(res?.data?.length){ if (res?.data?.length) {
updateFlowNodeEdgeLabel(res.data) updateFlowNodeEdgeLabel(res.data);
} }
}, },
}); });
...@@ -291,7 +307,8 @@ const ProjectSubmitWork = observer(() => { ...@@ -291,7 +307,8 @@ const ProjectSubmitWork = observer(() => {
if (Array.isArray(res.data)) { if (Array.isArray(res.data)) {
res.data.forEach((item1) => { res.data.forEach((item1) => {
if (item1.name === item.path.slice(item.path.lastIndexOf("/") + 1)) { if (item1.name === item.path.slice(item.path.lastIndexOf("/") + 1)) {
randerOutputs[index].size = `${item1.size ? storageUnitFromB(Number(item1.size)) : "-" randerOutputs[index].size = `${
item1.size ? storageUnitFromB(Number(item1.size)) : "-"
}`; }`;
setRanderOutputs([...randerOutputs]); setRanderOutputs([...randerOutputs]);
} }
...@@ -365,7 +382,7 @@ const ProjectSubmitWork = observer(() => { ...@@ -365,7 +382,7 @@ const ProjectSubmitWork = observer(() => {
}, [deleteWorkJob, workFlowJobInfo?.id]); }, [deleteWorkJob, workFlowJobInfo?.id]);
const returnPermission = useMemo(() => { const returnPermission = useMemo(() => {
if (['SUBMITTED', 'RUNNING'].includes(state || '')) { if (["SUBMITTED", "RUNNING"].includes(state || "")) {
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");
...@@ -397,8 +414,8 @@ const ProjectSubmitWork = observer(() => { ...@@ -397,8 +414,8 @@ const ProjectSubmitWork = observer(() => {
}; };
const handleClose = () => { const handleClose = () => {
setShowLogView(false) setShowLogView(false);
} };
return ( return (
<div className={styles.swBox}> <div className={styles.swBox}>
...@@ -436,13 +453,17 @@ const ProjectSubmitWork = observer(() => { ...@@ -436,13 +453,17 @@ const ProjectSubmitWork = observer(() => {
}} }}
> */} > */}
<MyButton <MyButton
text={['SUBMITTED', 'RUNNING'].includes(state || '') ? "终止" : "删除"} text={
["SUBMITTED", "RUNNING"].includes(state || "")
? "终止"
: "删除"
}
variant="outlined" variant="outlined"
color="secondary" color="secondary"
onClick={(e: any) => onClick={(e: any) =>
handleShowPopper( handleShowPopper(
e, e,
['SUBMITTED', 'RUNNING'].includes(state || '') ["SUBMITTED", "RUNNING"].includes(state || "")
? "正在运行的任务终止后将无法重新运行,确认继续吗?" ? "正在运行的任务终止后将无法重新运行,确认继续吗?"
: "任务被删除后将无法恢复,确认继续吗?" : "任务被删除后将无法恢复,确认继续吗?"
) )
...@@ -480,7 +501,9 @@ const ProjectSubmitWork = observer(() => { ...@@ -480,7 +501,9 @@ const ProjectSubmitWork = observer(() => {
} }
alt="" alt=""
/> />
<span className={styles.outputItemName}>{item.name}</span> <span className={styles.outputItemName}>
{item.name}
</span>
</div> </div>
{/* </MyPopconfirm> */} {/* </MyPopconfirm> */}
<span className={styles.outputLiRight}> <span className={styles.outputLiRight}>
...@@ -541,7 +564,7 @@ const ProjectSubmitWork = observer(() => { ...@@ -541,7 +564,7 @@ const ProjectSubmitWork = observer(() => {
alt="" alt=""
/> />
)} )}
{['SUBMITTED', 'RUNNING'].includes(state || '') && ( {["SUBMITTED", "RUNNING"].includes(state || "") && (
<img <img
className={styles.taskInfoValueIcon} className={styles.taskInfoValueIcon}
src={jobRun} src={jobRun}
...@@ -766,11 +789,7 @@ const ProjectSubmitWork = observer(() => { ...@@ -766,11 +789,7 @@ const ProjectSubmitWork = observer(() => {
projectId={projectId as string} projectId={projectId as string}
></SeeDataset> ></SeeDataset>
)} )}
<LogView <LogView isshow={showLogView} handleClose={handleClose} logs={logs} />
isshow={showLogView}
handleClose={handleClose}
logs={logs}
/>
</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 #F0F2F5; border-bottom: 1px solid #EDEFF2;
} }
.basicInformationRight { .basicInformationRight {
......
...@@ -37,11 +37,8 @@ ...@@ -37,11 +37,8 @@
border: 2px solid #136efa; border: 2px solid #136efa;
} }
.projectInfoTextarea { .projectInfoTextarea {
line-height: 22px; position: relative;
height: 82px; width: 560px;
padding: 7px 12px;
resize: none;
font-size: 14px;
} }
.projectInfoSelect { .projectInfoSelect {
width: 560px; width: 560px;
......
...@@ -184,10 +184,12 @@ const BaseInfo = observer(() => { ...@@ -184,10 +184,12 @@ 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) => {
...@@ -337,16 +339,30 @@ const BaseInfo = observer(() => { ...@@ -337,16 +339,30 @@ const BaseInfo = observer(() => {
</div> </div>
<div className={style.projectInfoListLi}> <div className={style.projectInfoListLi}>
<div className={style.projectInfoListLiLabel}>项目描述</div> <div className={style.projectInfoListLiLabel}>项目描述</div>
<textarea <div
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}
placeholder="项目描述限制300字以内" multiline
maxLength={300} rows={4}
></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-03 14:29:19 * @LastEditTime: 2022-08-31 18:27:26
* @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,15 +79,7 @@ const AddMember = observer((props: IProps) => { ...@@ -79,15 +79,7 @@ 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) => {
const arr = []; setSelectOptions(res.data);
const { data } = res;
for (const key in data) {
arr.push({
label: String(data[key]),
value: key,
});
}
setSelectOptions(arr);
}); });
} }
}, [addMemberDialog, http]); }, [addMemberDialog, http]);
...@@ -170,6 +162,7 @@ const AddMember = observer((props: IProps) => { ...@@ -170,6 +162,7 @@ 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>;
setSelectedBatchNodeId: (val: string) => void; setExternalSelectedNodeId: (val: string) => void;
}; };
const ConfigForm = (props: ConfigFormProps) => { const ConfigForm = (props: ConfigFormProps) => {
const { templateConfigInfo, setParameter, setSelectedBatchNodeId } = props; const { templateConfigInfo, setParameter, setExternalSelectedNodeId } = props;
const [name, setName] = useState<string>(""); // 任务名称 const [name, setName] = useState<string>(""); // 任务名称
const [fileSelectType, setFileSelectType] = useState<FileSelectType>("path"); const [fileSelectType, setFileSelectType] = useState<FileSelectType>("path");
...@@ -192,7 +192,6 @@ const ConfigForm = (props: ConfigFormProps) => { ...@@ -192,7 +192,6 @@ 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)
...@@ -221,7 +220,7 @@ const ConfigForm = (props: ConfigFormProps) => { ...@@ -221,7 +220,7 @@ const ConfigForm = (props: ConfigFormProps) => {
{(parameter.domType || "").toLowerCase() === "file" && ( {(parameter.domType || "").toLowerCase() === "file" && (
<MyInput <MyInput
onClick={() => { onClick={() => {
setSelectedBatchNodeId(batchId || ""); setExternalSelectedNodeId(taskId || "");
setFileSelectType("file"); setFileSelectType("file");
handleOpenFileSelect(taskId, parameter.name); handleOpenFileSelect(taskId, parameter.name);
}} }}
...@@ -244,7 +243,7 @@ const ConfigForm = (props: ConfigFormProps) => { ...@@ -244,7 +243,7 @@ const ConfigForm = (props: ConfigFormProps) => {
{(parameter.domType || "").toLowerCase() === "path" && ( {(parameter.domType || "").toLowerCase() === "path" && (
<MyInput <MyInput
onClick={() => { onClick={() => {
setSelectedBatchNodeId(batchId || ""); setExternalSelectedNodeId(taskId || "");
setFileSelectType("path"); setFileSelectType("path");
handleOpenFileSelect(taskId, parameter.name); handleOpenFileSelect(taskId, parameter.name);
}} }}
...@@ -267,7 +266,7 @@ const ConfigForm = (props: ConfigFormProps) => { ...@@ -267,7 +266,7 @@ const ConfigForm = (props: ConfigFormProps) => {
{(parameter.domType || "").toLowerCase() === "dataset" && ( {(parameter.domType || "").toLowerCase() === "dataset" && (
<MyInput <MyInput
onClick={() => { onClick={() => {
setSelectedBatchNodeId(taskId); setExternalSelectedNodeId(taskId);
setFileSelectType("dataset"); setFileSelectType("dataset");
handleOpenFileSelect(taskId, parameter.name); handleOpenFileSelect(taskId, parameter.name);
}} }}
...@@ -290,10 +289,9 @@ const ConfigForm = (props: ConfigFormProps) => { ...@@ -290,10 +289,9 @@ const ConfigForm = (props: ConfigFormProps) => {
{(parameter.domType || "").toLowerCase() === "input" && ( {(parameter.domType || "").toLowerCase() === "input" && (
<MyInput <MyInput
onFocus={() => { onFocus={() => {
setSelectedBatchNodeId(batchId || ""); setExternalSelectedNodeId(taskId || "");
console.log(batchId, "111");
}} }}
onBlur={() => setSelectedBatchNodeId("")} onBlur={() => setExternalSelectedNodeId("")}
value={parameter.value || ""} value={parameter.value || ""}
onChange={(e: any) => onChange={(e: any) =>
handleParameterChange(e, taskId, parameter.name || "") handleParameterChange(e, taskId, parameter.name || "")
...@@ -306,8 +304,8 @@ const ConfigForm = (props: ConfigFormProps) => { ...@@ -306,8 +304,8 @@ const ConfigForm = (props: ConfigFormProps) => {
)} )}
{(parameter.domType || "").toLowerCase() === "select" && ( {(parameter.domType || "").toLowerCase() === "select" && (
<MySelect <MySelect
onFocus={() => setSelectedBatchNodeId(batchId || "")} onFocus={() => setExternalSelectedNodeId(taskId || "")}
onBlur={() => setSelectedBatchNodeId("")} onBlur={() => setExternalSelectedNodeId("")}
value={parameter.value} value={parameter.value}
onChange={(e: any) => onChange={(e: any) =>
handleParameterChange( handleParameterChange(
...@@ -329,8 +327,8 @@ const ConfigForm = (props: ConfigFormProps) => { ...@@ -329,8 +327,8 @@ const ConfigForm = (props: ConfigFormProps) => {
{(parameter.domType || "").toLowerCase() === {(parameter.domType || "").toLowerCase() ===
"multipleselect" && ( "multipleselect" && (
<MySelect <MySelect
onFocus={() => setSelectedBatchNodeId(batchId || "")} onFocus={() => setExternalSelectedNodeId(taskId || "")}
onBlur={() => setSelectedBatchNodeId("")} onBlur={() => setExternalSelectedNodeId("")}
value={parameter.value} value={parameter.value}
onChange={(e: any) => onChange={(e: any) =>
handleParameterChange( handleParameterChange(
...@@ -356,8 +354,8 @@ const ConfigForm = (props: ConfigFormProps) => { ...@@ -356,8 +354,8 @@ const ConfigForm = (props: ConfigFormProps) => {
onChange={(e: any) => onChange={(e: any) =>
handleParameterChange(e, taskId, parameter.name || "") handleParameterChange(e, taskId, parameter.name || "")
} }
onFocus={() => setSelectedBatchNodeId(batchId || "")} onFocus={() => setExternalSelectedNodeId(taskId || "")}
onBlur={() => setSelectedBatchNodeId("")} onBlur={() => setExternalSelectedNodeId("")}
options={parameter?.choices || []} options={parameter?.choices || []}
error={parameter.error || false} error={parameter.error || false}
helperText={parameter.helperText} helperText={parameter.helperText}
...@@ -378,8 +376,8 @@ const ConfigForm = (props: ConfigFormProps) => { ...@@ -378,8 +376,8 @@ const ConfigForm = (props: ConfigFormProps) => {
) )
} }
options={parameter?.choices || []} options={parameter?.choices || []}
onFocus={() => setSelectedBatchNodeId(batchId || "")} onFocus={() => setExternalSelectedNodeId(taskId || "")}
onBlur={() => setSelectedBatchNodeId("")} onBlur={() => setExternalSelectedNodeId("")}
error={parameter.error || false} error={parameter.error || false}
helperText={parameter.helperText} helperText={parameter.helperText}
/> />
...@@ -448,7 +446,7 @@ const ConfigForm = (props: ConfigFormProps) => { ...@@ -448,7 +446,7 @@ const ConfigForm = (props: ConfigFormProps) => {
<MyInput <MyInput
value={outputPath || ""} value={outputPath || ""}
onClick={() => { onClick={() => {
setSelectedBatchNodeId(""); setExternalSelectedNodeId("");
setFileSelectType("path"); setFileSelectType("path");
handleOpenFileSelect(); handleOpenFileSelect();
}} }}
...@@ -500,7 +498,6 @@ const ConfigForm = (props: ConfigFormProps) => { ...@@ -500,7 +498,6 @@ const ConfigForm = (props: ConfigFormProps) => {
{randerParameters( {randerParameters(
task.parameters.filter((parameter) => !parameter?.thrown), task.parameters.filter((parameter) => !parameter?.thrown),
task.id, task.id,
task.id
)} )}
{task.flows.map((flow) => { {task.flows.map((flow) => {
if ( if (
...@@ -511,7 +508,7 @@ const ConfigForm = (props: ConfigFormProps) => { ...@@ -511,7 +508,7 @@ const ConfigForm = (props: ConfigFormProps) => {
return null; return null;
} }
return ( return (
<div className={styles.flowConfigBox} key={flow.id}> <div className={styles.flowConfigBox} key={flow.id} id={`point${flow.id}`}>
<div className={styles.flowTitle}> <div className={styles.flowTitle}>
{flow.title} {flow.title}
{flow.description && ( {flow.description && (
...@@ -527,7 +524,6 @@ const ConfigForm = (props: ConfigFormProps) => { ...@@ -527,7 +524,6 @@ 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;
setSelectedBatchNodeId?: (val: string) => void; setExternalSelectedNodeId?: (val: string) => void;
selectedBatchNodeId?: string; externalSelectedNodeId?: string;
} }
const WorkFlow = (props: IProps) => { const WorkFlow = (props: IProps) => {
const { templateConfigInfo, setSelectedBatchNodeId, selectedBatchNodeId } = const { templateConfigInfo, setExternalSelectedNodeId, externalSelectedNodeId } =
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}
setSelectedBatchNodeId={setSelectedBatchNodeId} setExternalSelectedNodeId={setExternalSelectedNodeId}
selectedBatchNodeId={selectedBatchNodeId} externalSelectedNodeId={externalSelectedNodeId}
/> />
); );
}; };
......
...@@ -42,7 +42,8 @@ const ProjectSubmitWork = observer(() => { ...@@ -42,7 +42,8 @@ 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 [selectedBatchNodeId, setSelectedBatchNodeId] = useState<string>(""); const [externalSelectedNodeId, setExternalSelectedNodeId] =
useState<string>("");
// 前往工作台 // 前往工作台
const goToWorkbench = (toWorkbenchList = false) => { const goToWorkbench = (toWorkbenchList = false) => {
...@@ -313,7 +314,7 @@ const ProjectSubmitWork = observer(() => { ...@@ -313,7 +314,7 @@ const ProjectSubmitWork = observer(() => {
onRef={configFormRef} onRef={configFormRef}
templateConfigInfo={templateConfigInfo} templateConfigInfo={templateConfigInfo}
setParameter={setParameter} setParameter={setParameter}
setSelectedBatchNodeId={setSelectedBatchNodeId} setExternalSelectedNodeId={setExternalSelectedNodeId}
/> />
</div> </div>
)} )}
...@@ -323,8 +324,8 @@ const ProjectSubmitWork = observer(() => { ...@@ -323,8 +324,8 @@ const ProjectSubmitWork = observer(() => {
> >
<WorkFlow <WorkFlow
templateConfigInfo={templateConfigInfo} templateConfigInfo={templateConfigInfo}
setSelectedBatchNodeId={setSelectedBatchNodeId} setExternalSelectedNodeId={setExternalSelectedNodeId}
selectedBatchNodeId={selectedBatchNodeId} externalSelectedNodeId={externalSelectedNodeId}
/> />
</div> </div>
</div> </div>
......
/* /*
* @Author: rocosen * @Author: rocosen
* @Date: 2022-06-12 10:05:13 * @Date: 2022-06-12 10:05:13
* @LastEditors: 吴永生#A02208 yongsheng.wu@wholion.com * @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-07-20 15:04:19 * @LastEditTime: 2022-09-01 09:31:56
* @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,17 +11,16 @@ import { Box } from "@mui/system"; ...@@ -11,17 +11,16 @@ 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 Template_select from "@/assets/project/workbenchTemplate_select.svg"; import TemplateSelect 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 List_select from "@/assets/project/workbenchList_select.svg"; import ListHover from "@/assets/project/workbenchList_hover.svg";
import ButtonDemo from "@/views/mui_demo/button"; import ListSelect from "@/assets/project/workbenchList_select.svg";
import InputDemo from "@/views/mui_demo/input";
const ProjectWorkbench = observer(() => { const ProjectWorkbench = observer(() => {
const isPass = usePass(); const isPass = usePass();
...@@ -35,7 +34,8 @@ const ProjectWorkbench = observer(() => { ...@@ -35,7 +34,8 @@ const ProjectWorkbench = observer(() => {
component: <WorkbenchTemplate />, component: <WorkbenchTemplate />,
hide: !isPass("PROJECT_WORKBENCH_FLOES"), hide: !isPass("PROJECT_WORKBENCH_FLOES"),
icon: Template, icon: Template,
iconed: Template_select, iconed: TemplateSelect,
iconHover: TemplateHover,
}, },
{ {
label: "任务列表", label: "任务列表",
...@@ -43,29 +43,25 @@ const ProjectWorkbench = observer(() => { ...@@ -43,29 +43,25 @@ const ProjectWorkbench = observer(() => {
component: <WorkbenchList />, component: <WorkbenchList />,
hide: !isPass("PROJECT_WORKBENCH_JOBS"), hide: !isPass("PROJECT_WORKBENCH_JOBS"),
icon: List, icon: List,
iconed: List_select, iconed: ListSelect,
}, 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]);
return ( return (
<div style={{ padding:'28px 24px 24px' }}> <div style={{ padding: "28px 24px 24px", height: "100%" }}>
<div style={{ display: "flex", alignItems: "center" }}> <div style={{ display: "flex", alignItems: "center" }}>
<span style={{ fontSize: "18px", lineHeight: "26px", fontWeight: "600", color: "#1E2633" }}>工作台</span> <span
style={{
fontSize: "18px",
lineHeight: "26px",
fontWeight: "600",
color: "#1E2633",
}}
>
工作台
</span>
</div> </div>
<Box sx={{ width: "100%", typography: "body1" }}> <Box sx={{ width: "100%", typography: "body1" }}>
<Tabs <Tabs
......
...@@ -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, { useEffect, useState } from "react"; import React, { 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 {
...@@ -17,17 +25,6 @@ const CurrentProject = observer(() => { ...@@ -17,17 +25,6 @@ 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);
......
...@@ -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-22 16:41:54 * @LastEditTime: 2022-08-31 17:09:26
* @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
*/ */
......
...@@ -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-22 19:16:06 * @LastEditTime: 2022-08-31 17:09:31
* @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
*/ */
......
...@@ -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 */
setSelectedBatchNodeId?: (val: string) => void; setExternalSelectedNodeId?: (val: string) => void;
/** 选中的batch节点id */ /** 选中的batch节点id */
selectedBatchNodeId?: string; externalSelectedNodeId?: 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,
setSelectedBatchNodeId, setExternalSelectedNodeId,
selectedBatchNodeId, externalSelectedNodeId,
type: flowType = "default", type: flowType = "default",
setTasks, setTasks,
onFlowNodeClick, onFlowNodeClick,
...@@ -305,13 +305,15 @@ const Flow = (props: IProps) => { ...@@ -305,13 +305,15 @@ const Flow = (props: IProps) => {
/** 是否有流节点 */ /** 是否有流节点 */
isFlowNode: isFlowNode(item.id), isFlowNode: isFlowNode(item.id),
/** 选中状态 */ /** 选中状态 */
selectedStatus: selectedBatchNodeId selectedStatus: externalSelectedNodeId
? selectedBatchNodeId === item.id ? externalSelectedNodeId.includes(item.id)
: inSideBatchNodeId === item.id, : inSideBatchNodeId === item.id,
/** tasks 数据 */ /** tasks 数据 */
tasks: tasks, tasks: tasks,
} }
: { selectedStatus: inSideFlowNodeId === item.id }), : { selectedStatus: externalSelectedNodeId
? externalSelectedNodeId.includes(item.id)
: inSideFlowNodeId === item.id,}),
/** 输入输出圆点状态 */ /** 输入输出圆点状态 */
// dotStatus: nodesInputAndOutputStatus(item.id), // dotStatus: nodesInputAndOutputStatus(item.id),
...@@ -343,7 +345,7 @@ const Flow = (props: IProps) => { ...@@ -343,7 +345,7 @@ const Flow = (props: IProps) => {
tasks, tasks,
flowType, flowType,
isFlowNode, isFlowNode,
selectedBatchNodeId, externalSelectedNodeId,
inSideBatchNodeId, inSideBatchNodeId,
inSideFlowNodeId, inSideFlowNodeId,
// nodesInputAndOutputStatus, // nodesInputAndOutputStatus,
...@@ -365,8 +367,8 @@ const Flow = (props: IProps) => { ...@@ -365,8 +367,8 @@ const Flow = (props: IProps) => {
}, []); }, []);
}); });
return val.map((item: ILine) => { return val.map((item: ILine) => {
const newSelectId = selectedBatchNodeId const newSelectId = externalSelectedNodeId
? selectedBatchNodeId ? externalSelectedNodeId
: inSideBatchNodeId; : inSideBatchNodeId;
return { return {
...item, ...item,
...@@ -387,19 +389,18 @@ const Flow = (props: IProps) => { ...@@ -387,19 +389,18 @@ const Flow = (props: IProps) => {
label: item.label ? `(${item.label})` : "", label: item.label ? `(${item.label})` : "",
}; };
}); });
}, [inSideBatchNodeId, selectedBatchNodeId, selectedEdge?.id, tasks]); }, [inSideBatchNodeId, externalSelectedNodeId, selectedEdge?.id, tasks]);
/** 设置nodeId方法 */ /** 设置nodeId方法 */
const setNodeIdFun = useCallback( const setNodeIdFun = useCallback(
(id: string) => { (id: string) => {
setSelectedBatchNodeId setExternalSelectedNodeId
? setSelectedBatchNodeId(id) ? setExternalSelectedNodeId(id)
: setInSideBatchNodeId(id); : setInSideBatchNodeId(id);
onBatchClick && onBatchClick(id); onBatchClick && onBatchClick(id);
setInSideFlowNodeId(""); setInSideFlowNodeId("");
document.getElementById(`point${id}`)?.scrollIntoView(true);
}, },
[onBatchClick, setSelectedBatchNodeId] [onBatchClick, setExternalSelectedNodeId]
); );
/** flowNode点击事件 */ /** flowNode点击事件 */
...@@ -411,9 +412,9 @@ const Flow = (props: IProps) => { ...@@ -411,9 +412,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) {
...@@ -424,8 +425,8 @@ const Flow = (props: IProps) => { ...@@ -424,8 +425,8 @@ const Flow = (props: IProps) => {
}; };
const handlePaneClick = () => { const handlePaneClick = () => {
setSelectedBatchNodeId setExternalSelectedNodeId
? setSelectedBatchNodeId("") ? setExternalSelectedNodeId("")
: setInSideBatchNodeId(""); : setInSideBatchNodeId("");
setInSideFlowNodeId(""); setInSideFlowNodeId("");
onBatchClick && onBatchClick(""); onBatchClick && onBatchClick("");
...@@ -633,9 +634,9 @@ const Flow = (props: IProps) => { ...@@ -633,9 +634,9 @@ const Flow = (props: IProps) => {
/** 点击连线清除选中的node ID */ /** 点击连线清除选中的node ID */
setInSideFlowNodeId(""); setInSideFlowNodeId("");
setInSideBatchNodeId(""); setInSideBatchNodeId("");
setSelectedBatchNodeId && setSelectedBatchNodeId(""); setExternalSelectedNodeId && setExternalSelectedNodeId("");
}, },
[setSelectedBatchNodeId] [setExternalSelectedNodeId]
); );
// const onNodesChange = (val: any)=>{ // const onNodesChange = (val: any)=>{
......
...@@ -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-11 18:50:31 * @LastEditTime: 2022-08-30 19:32:05
* @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,6 +15,7 @@ import classNames from "classnames"; ...@@ -15,6 +15,7 @@ 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";
...@@ -38,12 +39,18 @@ const ProjectListPopper = observer((props: any) => { ...@@ -38,12 +39,18 @@ 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}> <div className={style.mainBox} id="use-click-projectList-mainBox" onClick={(e: any)=>e.stopPropagation()}>
<div className={style.searchBox}> <div className={style.searchBox}>
<IconButton <IconButton
type="submit" type="submit"
......
...@@ -130,6 +130,8 @@ const OperatorItem = (props: IOperatorItemProps) => { ...@@ -130,6 +130,8 @@ 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>
...@@ -228,7 +230,9 @@ const OperatorList = observer((props: IOperatorListProps) => { ...@@ -228,7 +230,9 @@ const OperatorList = observer((props: IOperatorListProps) => {
) : ( ) : (
<div className={styles.noData}> <div className={styles.noData}>
<img src={noTemplate} alt="" className={styles.noDataImg} /> <img src={noTemplate} alt="" className={styles.noDataImg} />
<span className={styles.noDataText}>没有找到相关算子</span> <span className={styles.noDataText}>
{keyword ? "没有找到相关算子" : "暂无相关算子"}
</span>
</div> </div>
)} )}
</div> </div>
......
...@@ -129,6 +129,12 @@ ...@@ -129,6 +129,12 @@
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, useEffect, useMemo, useState } from "react"; import { useCallback, useMemo, useRef, useState } from "react";
import classNames from "classnames"; import classNames from "classnames";
import { import {
...@@ -20,6 +20,7 @@ import MySwitch from "@/components/mui/MySwitch"; ...@@ -20,6 +20,7 @@ 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";
...@@ -30,18 +31,13 @@ type IParameterSettingProps = { ...@@ -30,18 +31,13 @@ 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 div = document.getElementById("descHeight"); // 算子描述的元素(不限高)用来完成描述展开收起功能 const size = useSize(resizeRef) ;
useEffect(() => {
if (div) {
setDescHeight(div.offsetHeight);
}
}, [div]);
// 文件夹路线选择器弹窗 // 文件夹路线选择器弹窗
const handleFileSelectOnClose = () => { const handleFileSelectOnClose = () => {
...@@ -525,13 +521,14 @@ const ParameterSetting = (props: IParameterSettingProps) => { ...@@ -525,13 +521,14 @@ 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 || "-"}
{descHeight > 60 && ( {size && size?.height >= 60 && (
<span <span
className={styles.descButton} className={styles.descButton}
onClick={() => setIsShowAllDese(!isShowAllDese)} onClick={() => setIsShowAllDese(!isShowAllDese)}
...@@ -650,10 +647,12 @@ const ParameterSetting = (props: IParameterSettingProps) => { ...@@ -650,10 +647,12 @@ const ParameterSetting = (props: IParameterSettingProps) => {
</div> </div>
<Tabs <Tabs
tabList={paramsTabList} tabList={paramsTabList}
defaultValue={activeParamsTab} value={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 && (
......
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