Commit 55a134bf authored by jiangzijing's avatar jiangzijing

Merge branch 'feat-20220801' into 'staging'

Feat 20220801

See merge request !97
parents 4a4e2d07 a4532ce1
.RadiosBox { .RadiosBox {
position: relative;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
...@@ -20,7 +21,6 @@ ...@@ -20,7 +21,6 @@
border-radius: 2px; border-radius: 2px;
line-height: 20px; line-height: 20px;
padding: 6px 16px; padding: 6px 16px;
/* background-color: #e6e8eb; */
flex: 1; flex: 1;
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -30,8 +30,7 @@ ...@@ -30,8 +30,7 @@
.radioActive { .radioActive {
color: #1370ff; color: #1370ff;
background-color: #fff; position: relative;
box-shadow: 2px 4px 12px 0px rgba(0, 27, 63, 0.06);
} }
.border { .border {
width: 1px; width: 1px;
...@@ -41,3 +40,19 @@ ...@@ -41,3 +40,19 @@
.borderHidden { .borderHidden {
visibility: hidden; visibility: hidden;
} }
.radioActiveBgBox {
width: calc(100% - 2px);
position: absolute;
left: 1px;
top: 1px;
height: 28px;
}
.radioActiveBg {
box-shadow: 2px 4px 12px 0px rgba(0, 27, 63, 0.06);
height: 100%;
background-color: #fff;
transition: transform 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
border-radius: 2px;
width: 50%;
transform: translateX(0px);
}
...@@ -22,11 +22,26 @@ type IRadioGroupOfButtonStyleProps = { ...@@ -22,11 +22,26 @@ type IRadioGroupOfButtonStyleProps = {
handleRadio: any; handleRadio: any;
RadiosBoxStyle?: object; RadiosBoxStyle?: object;
radioStyle?: object; radioStyle?: object;
radioActiveBgBoxStyle?: object;
}; };
const RadioGroupOfButtonStyle = (props: IRadioGroupOfButtonStyleProps) => { const RadioGroupOfButtonStyle = (props: IRadioGroupOfButtonStyleProps) => {
const { radioOptions, value, handleRadio, RadiosBoxStyle, radioStyle } = const {
props; radioOptions,
value,
handleRadio,
RadiosBoxStyle,
radioStyle,
radioActiveBgBoxStyle,
} = props;
const radioWidth = useMemo(() => {
if (radioOptions.length) {
return Number((100 / radioOptions.length).toFixed(2));
} else {
return 100;
}
}, [radioOptions]);
const activeIndex: any = useMemo(() => { const activeIndex: any = useMemo(() => {
let res = 0; let res = 0;
...@@ -40,6 +55,16 @@ const RadioGroupOfButtonStyle = (props: IRadioGroupOfButtonStyleProps) => { ...@@ -40,6 +55,16 @@ const RadioGroupOfButtonStyle = (props: IRadioGroupOfButtonStyleProps) => {
return ( return (
<div className={style.RadiosBox} style={RadiosBoxStyle}> <div className={style.RadiosBox} style={RadiosBoxStyle}>
<div className={style.radioActiveBgBox} style={radioActiveBgBoxStyle}>
<div
className={style.radioActiveBg}
style={{
width: `${radioWidth}%`,
transform: `translateX(${activeIndex * 100}%)`,
}}
></div>
</div>
{radioOptions.map((options, index) => { {radioOptions.map((options, index) => {
return ( return (
<> <>
......
/*
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2021-12-04 15:46:25
* @LastEditors: 吴永生#A02208 yongsheng.wu@wholion.com
* @LastEditTime: 2022-07-21 18:00:58
* @FilePath: /lionet-slb-pc/src/components/SearchView/components/Collapse.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import InputLabel from "@mui/material/InputLabel";
import MenuItem from "@mui/material/MenuItem";
import FormControl from "@mui/material/FormControl";
import FormHelperText from "@mui/material/FormHelperText";
import Select, { SelectChangeEvent, SelectProps } from "@mui/material/Select";
import { createTheme, ThemeProvider } from "@mui/material";
import selectActive from "@/assets/project/selectActive.svg";
export interface IOption {
label: string;
value: string;
disabled?: boolean;
}
export const optionsTransform = (
arr: Array<any>,
labelKey: string = "label",
valueKey: string = "value",
disabledKey: string = "disabled"
): Array<IOption> => {
return arr.map((item: any) => {
return {
label: item[labelKey],
value: item[valueKey],
disabled: item[disabledKey],
};
});
};
interface IProps
extends Omit<SelectProps, "value" | "options" | "onChange" | "title"> {
value?: string;
options: IOption[];
onChange?: (val: string) => void;
/** 类型变种 */
variant?: "standard" | "outlined" | "filled";
/** title */
title?: string;
/** 是否显示title */
isTitle?: boolean;
/** 是否显示提示文案 */
error?: boolean;
/** 提示文案 */
helpertext?: string;
}
export default function MyBorderlessSelect(props: IProps) {
const {
value,
options,
title,
isTitle = false,
variant = "outlined",
multiple = false,
onChange,
fullWidth,
error = false,
helpertext,
...other
} = props;
const theme = createTheme({
components: {
MuiInputBase: {
styleOverrides: {
root: {
height: "36px",
"& .Mui-disabled": {
background: "rgba(247, 248, 250, 1)",
cursor: "not-allowed",
"& .MuiOutlinedInput-notchedOutline": {
borderWidth: '0px'
},
},
},
input: {
fontSize: "14px",
"&.Mui-focused":{
color:"#1370FF",
},
"&.Mui-disabled": {
background: "rgba(247, 248, 250, 1)",
cursor: "not-allowed",
},
img: {
display: "none",
},
},
},
},
MuiList: {
styleOverrides: {
root: {
"& .MuiButtonBase-root": {
"&.Mui-selected": {
backgroundColor: "#fff",
color: "#1370FF",
},
},
},
},
},
MuiMenuItem: {
styleOverrides: {
root: {
paddingRight: "46px",
fontSize: "14px",
lineHeight: "24px",
":hover": {
backgroundColor: "#F0F2F5 ",
color: "#1E2633",
},
},
},
},
MuiOutlinedInput: {
styleOverrides: {
root: {
"&.Mui-focused .MuiOutlinedInput-notchedOutline": {
borderWidth: "0px",
color: '#1370FF'
},
"& .MuiOutlinedInput-notchedOutline": {
borderColor: "#DDE1E6",
borderWidth: "0px",
},
"&.Mui-disabled": {
background: "rgba(247, 248, 250, 1)",
cursor: "not-allowed",
"& .MuiOutlinedInput-notchedOutline": {
borderColor: "#DDE1E6",
},
},
":hover": {
"& .MuiOutlinedInput-notchedOutline": {
borderColor: "#1370ff",
},
"&.Mui-disabled": {
background: "rgba(247, 248, 250, 1)",
cursor: "not-allowed",
"& .MuiOutlinedInput-notchedOutline": {
borderColor: "#DDE1E6",
},
},
},
},
},
},
MuiInputLabel: {
styleOverrides: {
root: {
fontSize: "14px",
// 下拉框未选择时的label定位
top: "-9px",
},
shrink: {
// 下拉框已经选择时的label定位
top: 0,
},
},
},
MuiSelect: {
styleOverrides: {
select: {
padding: "6.5px 14px",
fontSize: "14px",
},
},
},
MuiPaper: {
styleOverrides: {
root: {
boxShadow: "0px 3px 10px 0px rgba(0,24,57,0.14)",
},
},
},
},
});
const handleChange = (e: SelectChangeEvent<unknown>) => {
onChange && onChange(e.target.value as string);
};
return (
<ThemeProvider theme={theme}>
<FormControl fullWidth={fullWidth} variant={variant} error={error}>
{isTitle ? (
<InputLabel id="demo-simple-select-label">
{title || "请选择"}
</InputLabel>
) : null}
<Select
labelId="demo-simple-select-label"
id="demo-simple-select"
label={title || ""}
size="small"
multiple={multiple}
{...other}
value={value || ""}
onChange={handleChange}
>
{options.length
? options?.map((item: IOption, index) => {
return (
<MenuItem
value={item.value}
disabled={item?.disabled}
key={index}
>
{item.label}
{value === item.value && (
<img
style={{
width: "16px",
height: "16px",
position: "absolute",
top: "10px",
right: "12px",
}}
src={selectActive}
alt=""
/>
)}
</MenuItem>
);
})
: null}
</Select>
{helpertext && error && <FormHelperText>{helpertext}</FormHelperText>}
</FormControl>
</ThemeProvider>
);
}
...@@ -63,12 +63,13 @@ const theme = createTheme({ ...@@ -63,12 +63,13 @@ const theme = createTheme({
}, },
MuiCheckbox: { MuiCheckbox: {
styleOverrides: { styleOverrides: {
colorPrimary: { root: {
color: "rgba(209, 214, 222, 1)", "&.Mui-checked .MuiSvgIcon-root": {
color: "rgba(19, 110, 250, 1)",
},
}, },
}, },
}, },
// MuiCheckbox-colorPrimary
}, },
}); });
......
...@@ -71,7 +71,7 @@ const MyPopconfirm = (props: IMyPopconfirmProps) => { ...@@ -71,7 +71,7 @@ const MyPopconfirm = (props: IMyPopconfirmProps) => {
bgcolor: "transparent", bgcolor: "transparent",
minWidth: "200px", minWidth: "200px",
fontSize: "14px", fontSize: "14px",
padding: "20px 16px", padding: "8px 0px",
}} }}
> >
<Box <Box
...@@ -80,7 +80,7 @@ const MyPopconfirm = (props: IMyPopconfirmProps) => { ...@@ -80,7 +80,7 @@ const MyPopconfirm = (props: IMyPopconfirmProps) => {
minWidth: "200px", minWidth: "200px",
borderRadius: "4px", borderRadius: "4px",
fontSize: "14px", fontSize: "14px",
padding: "20px 16px", padding: "16px 20px",
boxShadow: "0px 3px 10px 0px rgba(0, 24, 57, 0.14)", boxShadow: "0px 3px 10px 0px rgba(0, 24, 57, 0.14)",
}} }}
> >
......
...@@ -61,6 +61,15 @@ const theme = createTheme({ ...@@ -61,6 +61,15 @@ const theme = createTheme({
}, },
}, },
}, },
MuiRadio: {
styleOverrides: {
root: {
"&.Mui-checked span": {
color: "rgba(19, 110, 250, 1)",
},
},
},
},
}, },
}); });
......
...@@ -154,6 +154,7 @@ export default function MySelect(props: IProps) { ...@@ -154,6 +154,7 @@ export default function MySelect(props: IProps) {
MuiInputLabel: { MuiInputLabel: {
styleOverrides: { styleOverrides: {
root: { root: {
fontSize: "14px",
// 下拉框未选择时的label定位 // 下拉框未选择时的label定位
top: "-9px", top: "-9px",
}, },
...@@ -180,6 +181,14 @@ export default function MySelect(props: IProps) { ...@@ -180,6 +181,14 @@ export default function MySelect(props: IProps) {
}, },
}, },
}, },
// MuiFormControl: {
// styleOverrides: {
// root: {
// width: fullWidth ? "100%" : "auto",
// },
// },
// },
}, },
}); });
......
/* /*
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com * @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-06-01 16:53:15 * @Date: 2022-06-01 16:53:15
* @LastEditors: 吴永生#A02208 yongsheng.wu@wholion.com * @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-07-25 12:04:49 * @LastEditTime: 2022-09-06 16:30:56
* @FilePath: /bkunyun/src/components/Material.Ui/Table/EnhancedTableHead.jsx * @FilePath: /bkunyun/src/components/Material.Ui/Table/EnhancedTableHead.jsx
* @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
*/ */
...@@ -54,7 +54,7 @@ const EnhancedTableHead = (props: any) => { ...@@ -54,7 +54,7 @@ const EnhancedTableHead = (props: any) => {
classes={{ head: (k && headTableCell) || classes.headTableCell }} classes={{ head: (k && headTableCell) || classes.headTableCell }}
> >
{ {
headCell.sort && <TableSortLabel active={orderBy === headCell.id} direction={order} onClick={createSortHandler(headCell.id)} > headCell.sort && <TableSortLabel style={{fontSize: "16px", fontWeight: '400', color: 'rgba(0, 0, 0, 0.87)', fontFamily: 'Roboto,Helvetica,Tahoma,Arial,"PingFang SC","Hiragino Sans GB","Heiti SC","WenQuanYi Micro Hei",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"'}} active={orderBy === headCell.id} direction={order} onClick={createSortHandler(headCell.id)} >
{headCell.label} {headCell.label}
</TableSortLabel> </TableSortLabel>
} }
......
...@@ -21,7 +21,7 @@ const useMyRequest = <TData, TParams>( ...@@ -21,7 +21,7 @@ const useMyRequest = <TData, TParams>(
defaultParams?: TParams[]; defaultParams?: TParams[];
onBefore?: (params: TParams[]) => void; onBefore?: (params: TParams[]) => void;
onSuccess?: (data: TData, params: TParams[]) => void; onSuccess?: (data: TData, params: TParams[]) => void;
onError?: (e: Error, params: TParams[]) => void; onError?: (e: any, params: TParams[]) => void;
onFinally?: (params: TParams[], data?: TData, e?: Error) => void; onFinally?: (params: TParams[], data?: TData, e?: Error) => void;
loadingDelay?: number; loadingDelay?: number;
pollingInterval?: number; pollingInterval?: number;
...@@ -51,9 +51,16 @@ const useMyRequest = <TData, TParams>( ...@@ -51,9 +51,16 @@ const useMyRequest = <TData, TParams>(
const request = useRequest(api, { const request = useRequest(api, {
...defaultOptions, ...defaultOptions,
onSuccess: () => {}, onSuccess: () => { },
onError: (data) => { onError: (data: any) => {
Message.error(data.message); Message.error(data.message);
if (data.errorCode === '100003') {
setTimeout(() => {
localStorage.removeItem('token_key');
if (window.location.href && !window.location.href.includes("/login-page"))
window.location.href = '/v2/pages/login-page'
}, 4000);
}
}, },
...options, ...options,
}); });
......
import React, { useEffect, useState } from "react"; import React, { useEffect } from "react";
import { Outlet, useLocation, useNavigate } from "react-router-dom"; import { Outlet, useLocation, useNavigate } from "react-router-dom";
import { observer } from "mobx-react-lite"; import { observer } from "mobx-react-lite";
import Avatar from "@mui/material/Avatar"; import Avatar from "@mui/material/Avatar";
...@@ -67,6 +67,15 @@ const ConsoleLayout = observer(() => { ...@@ -67,6 +67,15 @@ const ConsoleLayout = observer(() => {
const location = useLocation(); const location = useLocation();
const { permissionStore, menuStore } = useStores(); const { permissionStore, menuStore } = useStores();
// 不在产品页面下的时候清空当前产品
useEffect(() => {
if (location.pathname.slice(0, 8) !== "/product") {
currentProjectStore.setProjectList([]);
currentProjectStore.changeProject({});
currentProjectStore.changeProductInfo({});
}
}, [location, currentProjectStore]);
useEffect(() => { useEffect(() => {
permissionStore.setSidebarRouters(location.pathname); permissionStore.setSidebarRouters(location.pathname);
}, [location, permissionStore]); }, [location, permissionStore]);
...@@ -76,12 +85,6 @@ const ConsoleLayout = observer(() => { ...@@ -76,12 +85,6 @@ const ConsoleLayout = observer(() => {
<Box className={style.topApp}> <Box className={style.topApp}>
<Box className={style.topLeftBox}> <Box className={style.topLeftBox}>
<img src={logo} alt="" className={style.logo} /> <img src={logo} alt="" className={style.logo} />
{/* <MyButton
text={globalText.console}
variant={"text"}
style={{ color: "#565C66" }}
onClick={() => navigate("/home")}
/> */}
<div className={style.menuBox} onClick={() => navigate("/home")}> <div className={style.menuBox} onClick={() => navigate("/home")}>
<div className={style.menuTitle}>{globalText.console}</div> <div className={style.menuTitle}>{globalText.console}</div>
</div> </div>
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
import { Box, List } from "@mui/material"; import { Box, List } from "@mui/material";
import CurrentProject from "../Project/components/CurrentProject"; import CurrentProject from "../Project/components/CurrentProject";
import React from "react"; import React from "react";
import { Outlet, useNavigate } from "react-router-dom"; import { Outlet, useNavigate, useLocation } from "react-router-dom";
import style from "./index.module.css"; import style from "./index.module.css";
import { observer } from "mobx-react-lite"; import { observer } from "mobx-react-lite";
import { useStores } from "@/store/index"; import { useStores } from "@/store/index";
...@@ -23,9 +23,10 @@ const MenuLayout = observer(() => { ...@@ -23,9 +23,10 @@ const MenuLayout = observer(() => {
const navigate = useNavigate(); const navigate = useNavigate();
const productInfo = toJS(currentProjectStore.currentProductInfo); const productInfo = toJS(currentProjectStore.currentProductInfo);
const location = useLocation();
// 未选择产品时 直接跳转home页面 // 在产品页面下且未选择产品时 直接跳转home页面
if (!productInfo.name) { if (!productInfo.name && location.pathname.slice(0, 8) === "/product") {
navigate("/home"); navigate("/home");
} }
......
...@@ -206,7 +206,7 @@ const SeeDataset = observer((props: ISeeDatasetProps) => { ...@@ -206,7 +206,7 @@ const SeeDataset = observer((props: ISeeDatasetProps) => {
}, },
]} ]}
RadiosBoxStyle={{ width: "132px" }} RadiosBoxStyle={{ width: "132px" }}
></RadioGroupOfButtonStyle> />
)} )}
<MyMultipleMenu <MyMultipleMenu
value={showData} value={showData}
......
...@@ -572,7 +572,7 @@ const ProjectData = observer(() => { ...@@ -572,7 +572,7 @@ const ProjectData = observer(() => {
{ value: "dataset", label: "数据集" }, { value: "dataset", label: "数据集" },
]} ]}
handleRadio={setActiveTab} handleRadio={setActiveTab}
></RadioGroupOfButtonStyle> />
<IconButton <IconButton
aria-label="refreshIcon" aria-label="refreshIcon"
size="small" size="small"
......
...@@ -20,36 +20,71 @@ ...@@ -20,36 +20,71 @@
} }
.logViewTop { .logViewTop {
/* height: 30px; */ position: relative;
width: 100vw; width: 100vw;
background-color: #1d2126; background-color: #1d2126;
/* border-radius: 8px 8px 0 0; */
display: flex; display: flex;
font-size: 12px; font-size: 12px;
color: #8a9099; color: #8a9099;
/* overflow: overlay; */ overflow: hidden;
} }
.logViewTop::-webkit-scrollbar-track { .leftButton {
background-color: #282c34; width: 48px;
height: 32px;
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
border-right: 1px solid #10141A;
background-color: #1d2126;
}
.rightButton {
width: 48px;
height: 32px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
border-left: 1px solid #10141A;
background-color: #1d2126;
}
.middleFixed {
width: calc(100vw - 98px);
position: relative;
overflow: hidden;
}
.middleDynamic{
display: flex;
position: absolute;
left: 0;
} }
.logTitle { .logTitle {
display: flex; display: flex;
width: 0;
max-width: 200px;
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
text-overflow:ellipsis; text-overflow: ellipsis;
flex: 1; flex-shrink: 0;
align-items: center; align-items: center;
height: 30px; height: 32px;
line-height: 20px; line-height: 20px;
padding: 0 24px; padding: 0 20px;
cursor: pointer; cursor: pointer;
border-right: 1px solid #10141A; border-right: 1px solid #10141A;
} }
.logName {
max-width: 90px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.logTitleSelected { .logTitleSelected {
background: #282c34; background: #282c34;
color: #ffffff; color: #ffffff;
...@@ -78,7 +113,7 @@ ...@@ -78,7 +113,7 @@
width: calc(100vw - 64px); width: calc(100vw - 64px);
background-color: #282c34; background-color: #282c34;
position: absolute; position: absolute;
top: 30px; top: 32px;
left: 32px; left: 32px;
z-index: 1005; z-index: 1005;
} }
......
...@@ -8,17 +8,17 @@ import CloudEController from "@/api/fileserver/CloudEController"; ...@@ -8,17 +8,17 @@ import CloudEController from "@/api/fileserver/CloudEController";
import { useStores } from "@/store"; import { useStores } from "@/store";
import { toJS } from "mobx"; import { toJS } from "mobx";
import FullScreenDrawer from "@/components/CommonComponents/FullScreenDrawer"; import FullScreenDrawer from "@/components/CommonComponents/FullScreenDrawer";
import ChevronLeftIcon from '@mui/icons-material/ChevronLeft';
import ChevronRightIcon from '@mui/icons-material/ChevronRight';
type LogViewProps = { type LogViewProps = {
isshow: boolean;
handleClose: () => void;
logs: any[]; logs: any[];
setShowAddTemplate: any; setShowLogView: any;
}; };
const LogView = (props: LogViewProps) => { const LogView = (props: LogViewProps) => {
const { isshow, handleClose, logs, setShowAddTemplate } = props; const { logs, setShowLogView } = props;
const { currentProjectStore } = useStores(); const { currentProjectStore } = useStores();
const fileToken = toJS(currentProjectStore.currentProjectInfo.filetoken); const fileToken = toJS(currentProjectStore.currentProjectInfo.filetoken);
const projectId = toJS(currentProjectStore.currentProjectInfo.id); const projectId = toJS(currentProjectStore.currentProjectInfo.id);
...@@ -65,10 +65,13 @@ const LogView = (props: LogViewProps) => { ...@@ -65,10 +65,13 @@ const LogView = (props: LogViewProps) => {
} }
return ( return (
<FullScreenDrawer handleClose={setShowAddTemplate} zIndex={1002}> <FullScreenDrawer handleClose={setShowLogView} zIndex={1002}>
<div className={style.logViewBox}> <div className={style.logViewBox}>
<div className={style.logViewContentMask}></div> <div className={style.logViewContentMask}></div>
<div className={style.logViewTop}> <div className={style.logViewTop}>
<div className={style.leftButton}><ChevronLeftIcon /></div>
<div className={style.middleFixed}>
<div className={style.middleDynamic}>
{logs.map((item: any, index: number) => { {logs.map((item: any, index: number) => {
return <div return <div
key={index} key={index}
...@@ -78,10 +81,13 @@ const LogView = (props: LogViewProps) => { ...@@ -78,10 +81,13 @@ const LogView = (props: LogViewProps) => {
[style.logTitleSelected]: index === logCurrent, [style.logTitleSelected]: index === logCurrent,
})}> })}>
<InsertDriveFileOutlinedIcon className={style.fileIcon} /> <InsertDriveFileOutlinedIcon className={style.fileIcon} />
<span>{item.logName}</span> <span className={style.logName}>{item.logName}</span>
</div> </div>
})} })}
</div> </div>
</div>
<div className={style.rightButton}><ChevronRightIcon /></div>
</div>
<div className={style.logViewContent}> <div className={style.logViewContent}>
{logText} {logText}
</div> </div>
......
...@@ -28,9 +28,20 @@ ...@@ -28,9 +28,20 @@
.goBackIcon { .goBackIcon {
cursor: pointer; cursor: pointer;
} }
.goBackIconBox {
width: 32px;
height: 32px;
border-radius: 4px;
display: flex;
align-items: center;
justify-content: center;
}
.goBackIconBox:hover {
background-color: rgb(240, 242, 245);
}
.swTemplateTitle { .swTemplateTitle {
margin: 0 19px 0 8px; margin: 0 19px 0 3px;
line-height: 22px; line-height: 20px;
font-size: 14px; font-size: 14px;
color: rgba(30, 38, 51, 1); color: rgba(30, 38, 51, 1);
font-weight: 700; font-weight: 700;
...@@ -112,12 +123,7 @@ ...@@ -112,12 +123,7 @@
line-height: 22px; line-height: 22px;
width: 80px; width: 80px;
margin-right: 44px; margin-right: 44px;
overflow: hidden;
word-wrap: break-word; word-wrap: break-word;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
} }
.taskInfoValue { .taskInfoValue {
color: rgba(30, 38, 51, 1); color: rgba(30, 38, 51, 1);
...@@ -130,6 +136,7 @@ ...@@ -130,6 +136,7 @@
word-break: break-all; word-break: break-all;
flex: 1; flex: 1;
justify-content: flex-end; justify-content: flex-end;
word-wrap: break-word;
} }
.taskInfoValueClick { .taskInfoValueClick {
cursor: pointer; cursor: pointer;
...@@ -202,6 +209,7 @@ ...@@ -202,6 +209,7 @@
right: 24px; right: 24px;
bottom: 24px; bottom: 24px;
padding: 8px; padding: 8px;
box-shadow: 0px 3px 10px 0px rgba(0, 24, 57, 0.06);
} }
.fullScreenBox:hover { .fullScreenBox:hover {
opacity: 0.6; opacity: 0.6;
......
...@@ -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-09-05 17:33:58 * @LastEditTime: 2022-09-06 10:54:40
* @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,6 +47,7 @@ import { ...@@ -47,6 +47,7 @@ import {
getDatasetPath, getDatasetPath,
getSameBatch, getSameBatch,
} from "./utils"; } from "./utils";
import MyTooltip from "@/components/mui/MyTooltip";
import styles from "./index.module.css"; import styles from "./index.module.css";
...@@ -75,11 +76,11 @@ const ProjectSubmitWork = observer(() => { ...@@ -75,11 +76,11 @@ const ProjectSubmitWork = observer(() => {
const productId = toJS(currentProjectStore.currentProductInfo.id); const productId = toJS(currentProjectStore.currentProductInfo.id);
const [workFlowJobInfo, setWorkFlowJobInfo] = useState<ITaskInfo>(); const [workFlowJobInfo, setWorkFlowJobInfo] = useState<ITaskInfo>();
const [patchInfo, setPatchInfo] = useState<any>(); const [patchInfo, setPatchInfo] = useState<any>();
const [overviewInfo, setOverviewInfo] = useState<any>();
const [overviewActive, setOverviewActive] = useState(true); const [overviewActive, setOverviewActive] = useState(true);
/** 选中的node Id */ /** 选中的node Id */
const [activeFlowIndex, setActiveFlowIndex] = useState<string>(""); const [activeFlowIndex, setActiveFlowIndex] = useState<string>("");
/** 选中的flow Title */
const [selectNodeTitle, setSelectNodeTitle] = useState('参数')
// const [showOptions, setShowOptions] = useState<boolean>(false); // const [showOptions, setShowOptions] = useState<boolean>(false);
const [randerOutputs1, setRanderOutputs] = useState<Array<any>>([]); const [randerOutputs1, setRanderOutputs] = useState<Array<any>>([]);
const locationInfo: any = useLocation()?.state; const locationInfo: any = useLocation()?.state;
...@@ -241,7 +242,7 @@ const ProjectSubmitWork = observer(() => { ...@@ -241,7 +242,7 @@ const ProjectSubmitWork = observer(() => {
state: { type: "workbenchList" }, state: { type: "workbenchList" },
}); });
} }
}, [navigate]); }, [navigate, locationInfo.from]);
const getOutouts = (outputs: any) => { const getOutouts = (outputs: any) => {
if (outputs) { if (outputs) {
...@@ -308,7 +309,8 @@ const ProjectSubmitWork = observer(() => { ...@@ -308,7 +309,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]);
} }
...@@ -346,7 +348,7 @@ const ProjectSubmitWork = observer(() => { ...@@ -346,7 +348,7 @@ const ProjectSubmitWork = observer(() => {
if (item.id === id) { if (item.id === id) {
getworkFlowTaskInfoRun({ getworkFlowTaskInfoRun({
jobId: workFlowJobInfo?.id as string, jobId: workFlowJobInfo?.id as string,
taskId: item.parentNode || item.id taskId: item.parentNode || item.id,
}); });
} }
}); });
...@@ -355,32 +357,26 @@ const ProjectSubmitWork = observer(() => { ...@@ -355,32 +357,26 @@ const ProjectSubmitWork = observer(() => {
const selectedParameter = useCallback( const selectedParameter = useCallback(
(list: any) => { (list: any) => {
let result: any = []; let result: any = [];
if(patchInfo?.id === activeFlowIndex ) {
setSelectNodeTitle(list[0].title || '')
result = list[0].parameters
} else {
list?.length && list?.length &&
list?.forEach((item: any) => { list?.forEach((item: any) => {
if (item.id === activeFlowIndex) { if (item.id === activeFlowIndex) {
console.log(1111) setOverviewInfo(item);
setSelectNodeTitle(item?.title || '')
result = item.parameters; result = item.parameters;
} }
}); });
}
return result; return result;
}, },
[activeFlowIndex, patchInfo] [activeFlowIndex]
); );
const randerParameters = useMemo(() => { const randerParameters = useMemo(() => {
if (patchInfo?.children?.length) { if (patchInfo?.id === activeFlowIndex) {
return selectedParameter(patchInfo?.children); setOverviewInfo(patchInfo);
return patchInfo?.parameters;
} else { } else {
return selectedParameter(patchInfo?.parameters); return selectedParameter(patchInfo?.children);
} }
}, [activeFlowIndex, patchInfo, selectedParameter]);
}, [patchInfo, selectedParameter]);
const handleParams = () => { const handleParams = () => {
setOverviewActive(false); setOverviewActive(false);
...@@ -412,12 +408,20 @@ const ProjectSubmitWork = observer(() => { ...@@ -412,12 +408,20 @@ const ProjectSubmitWork = observer(() => {
const [popperTitle, setPopperTitle] = useState( const [popperTitle, setPopperTitle] = useState(
"正在运行的任务终止后将无法重新运行,确认继续吗?" "正在运行的任务终止后将无法重新运行,确认继续吗?"
); );
const [placement, setPlacement] = useState<"bottom" | "bottom-start">(
"bottom"
);
const [anchorEl, setAnchorEl] = useState<any>(null); const [anchorEl, setAnchorEl] = useState<any>(null);
const handleCancel = () => { const handleCancel = () => {
setAnchorEl(null); setAnchorEl(null);
}; };
const handleShowPopper = (e: any, title: string) => { const handleShowPopper = (
e: any,
title: string,
placementParams: "bottom" | "bottom-start"
) => {
setPlacement(placementParams);
setPopperTitle(title); setPopperTitle(title);
setAnchorEl(e.currentTarget); setAnchorEl(e.currentTarget);
}; };
...@@ -441,13 +445,14 @@ const ProjectSubmitWork = observer(() => { ...@@ -441,13 +445,14 @@ const ProjectSubmitWork = observer(() => {
{fullScreenShow ? null : ( {fullScreenShow ? null : (
<div className={styles.swHeader}> <div className={styles.swHeader}>
<div className={styles.swHeaderLeft}> <div className={styles.swHeaderLeft}>
<div className={styles.goBackIconBox}>
<img <img
onClick={onBack} onClick={onBack}
className={styles.goBackIcon} className={styles.goBackIcon}
src={goback} src={goback}
alt="" alt=""
/> />
</div>
<div className={styles.swTemplateTitle}>{name}</div> <div className={styles.swTemplateTitle}>{name}</div>
</div> </div>
{returnPermission && ( {returnPermission && (
...@@ -465,7 +470,8 @@ const ProjectSubmitWork = observer(() => { ...@@ -465,7 +470,8 @@ const ProjectSubmitWork = observer(() => {
e, e,
["SUBMITTED", "RUNNING"].includes(state || "") ["SUBMITTED", "RUNNING"].includes(state || "")
? "正在运行的任务终止后将无法重新运行,确认继续吗?" ? "正在运行的任务终止后将无法重新运行,确认继续吗?"
: "任务被删除后将无法恢复,确认继续吗?" : "任务被删除后将无法恢复,确认继续吗?",
"bottom-start"
) )
} }
></MyButton> ></MyButton>
...@@ -489,7 +495,6 @@ const ProjectSubmitWork = observer(() => { ...@@ -489,7 +495,6 @@ const ProjectSubmitWork = observer(() => {
className={styles.outputLiLeft} className={styles.outputLiLeft}
onClick={(e: any) => { onClick={(e: any) => {
handleDownLoadOutput(item); handleDownLoadOutput(item);
// goToProjectData(getFolderPath(item.path));
}} }}
> >
<img <img
...@@ -503,7 +508,6 @@ const ProjectSubmitWork = observer(() => { ...@@ -503,7 +508,6 @@ const ProjectSubmitWork = observer(() => {
{item.name} {item.name}
</span> </span>
</div> </div>
{/* </MyPopconfirm> */}
<span className={styles.outputLiRight}> <span className={styles.outputLiRight}>
{item.size} {item.size}
</span> </span>
...@@ -542,7 +546,8 @@ const ProjectSubmitWork = observer(() => { ...@@ -542,7 +546,8 @@ const ProjectSubmitWork = observer(() => {
onClick={(e: any) => { onClick={(e: any) => {
handleShowPopper( handleShowPopper(
e, e,
"即将跳转至项目数据内该任务的输出路径,确认继续吗?" "即将跳转至项目数据内该任务的输出路径,确认继续吗?",
"bottom"
); );
setGoToProjectDataPath( setGoToProjectDataPath(
workFlowJobInfo?.outputPath as string workFlowJobInfo?.outputPath as string
...@@ -648,7 +653,9 @@ const ProjectSubmitWork = observer(() => { ...@@ -648,7 +653,9 @@ const ProjectSubmitWork = observer(() => {
)} )}
{activeFlowIndex && ( {activeFlowIndex && (
<div className={styles.suanziInfo}> <div className={styles.suanziInfo}>
<div className={styles.title}>{patchInfo?.title}</div> <MyTooltip>
<div className={styles.title}>{overviewInfo?.title}</div>
</MyTooltip>
<div className={styles.tabs}> <div className={styles.tabs}>
<div <div
className={classNames({ className={classNames({
...@@ -667,7 +674,7 @@ const ProjectSubmitWork = observer(() => { ...@@ -667,7 +674,7 @@ const ProjectSubmitWork = observer(() => {
// onClick={() => setOverviewActive(false)} // onClick={() => setOverviewActive(false)}
onClick={() => handleParams()} onClick={() => handleParams()}
> >
{selectNodeTitle} 参数
</div> </div>
</div> </div>
{overviewActive && ( {overviewActive && (
...@@ -680,40 +687,40 @@ const ProjectSubmitWork = observer(() => { ...@@ -680,40 +687,40 @@ const ProjectSubmitWork = observer(() => {
[styles.taskInfoValueShowAll]: true, [styles.taskInfoValueShowAll]: true,
})} })}
> >
{patchInfo?.description} {overviewInfo?.description}
</div> </div>
</div> </div>
<div className={styles.taskInfoLi}> <div className={styles.taskInfoLi}>
<div className={styles.taskInfoParams}>算子版本</div> <div className={styles.taskInfoParams}>算子版本</div>
<div className={styles.taskInfoValue}> <div className={styles.taskInfoValue}>
{patchInfo?.version || "-"} {overviewInfo?.version || "-"}
</div> </div>
</div> </div>
<div className={styles.taskInfoLi}> <div className={styles.taskInfoLi}>
<div className={styles.taskInfoParams}>算子状态</div> <div className={styles.taskInfoParams}>算子状态</div>
<div className={styles.taskInfoValue}> <div className={styles.taskInfoValue}>
{patchInfo?.status === "Done" && ( {overviewInfo?.status === "Done" && (
<img <img
className={styles.taskInfoValueIcon} className={styles.taskInfoValueIcon}
src={jobSue} src={jobSue}
alt="" alt=""
/> />
)} )}
{patchInfo?.status === "Running" && ( {overviewInfo?.status === "Running" && (
<img <img
className={styles.taskInfoValueIcon} className={styles.taskInfoValueIcon}
src={jobRun} src={jobRun}
alt="" alt=""
/> />
)} )}
{patchInfo?.status === "Failed" && ( {overviewInfo?.status === "Failed" && (
<img <img
className={styles.taskInfoValueIcon} className={styles.taskInfoValueIcon}
src={jobFail} src={jobFail}
alt="" alt=""
/> />
)} )}
{statusMap[patchInfo?.status as IStatus]} {statusMap[overviewInfo?.status as IStatus]}
</div> </div>
</div> </div>
</div> </div>
...@@ -760,6 +767,7 @@ const ProjectSubmitWork = observer(() => { ...@@ -760,6 +767,7 @@ const ProjectSubmitWork = observer(() => {
anchorEl={anchorEl} anchorEl={anchorEl}
onCancel={handleCancel} onCancel={handleCancel}
onConfirm={handleConfirm} onConfirm={handleConfirm}
placement={placement}
/> />
{showSeeDataset && ( {showSeeDataset && (
<SeeDataset <SeeDataset
...@@ -770,7 +778,12 @@ const ProjectSubmitWork = observer(() => { ...@@ -770,7 +778,12 @@ const ProjectSubmitWork = observer(() => {
projectId={projectId as string} projectId={projectId as string}
></SeeDataset> ></SeeDataset>
)} )}
{showLogView && <LogView isshow={showLogView} handleClose={handleClose} logs={logs} setShowAddTemplate={handleClose} />} {showLogView && (
<LogView
logs={logs}
setShowLogView={handleClose}
/>
)}
</div> </div>
); );
}); });
......
...@@ -127,7 +127,9 @@ ...@@ -127,7 +127,9 @@
align-items: center; align-items: center;
color: #1e2633; color: #1e2633;
cursor: pointer; cursor: pointer;
height: 30px; height: 31px;
display: flex;
align-items: center;
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
......
...@@ -29,15 +29,15 @@ const ProjectOverview = observer(() => { ...@@ -29,15 +29,15 @@ const ProjectOverview = observer(() => {
// 选择近7天or近15天or近30天 // 选择近7天or近15天or近30天
const [day, setDay] = useState("7"); const [day, setDay] = useState("7");
// 滚轮是否到顶,判断是否显示阴影 // 滚轮是否到顶,判断是否显示阴影
const [isTop, setIsTop] = useState(true) const [isTop, setIsTop] = useState(true);
// 滚动滚轮时监听是否到顶 // 滚动滚轮时监听是否到顶
const onscroll = (e: any) => { const onscroll = (e: any) => {
if (e.target.scrollTop <= 0) { if (e.target.scrollTop <= 0) {
setIsTop(true) setIsTop(true);
} else { } else {
setIsTop(false) setIsTop(false);
}
} }
};
// 获取概览基本信息 // 获取概览基本信息
const { run: getOverview, loading } = useMyRequest(getOverviewInfo, { const { run: getOverview, loading } = useMyRequest(getOverviewInfo, {
onSuccess: (result: any) => { onSuccess: (result: any) => {
...@@ -207,7 +207,7 @@ const ProjectOverview = observer(() => { ...@@ -207,7 +207,7 @@ const ProjectOverview = observer(() => {
{ value: "30", label: "近30天" }, { value: "30", label: "近30天" },
]} ]}
handleRadio={setDay} handleRadio={setDay}
></RadioGroupOfButtonStyle> />
</div> </div>
<SearchInput <SearchInput
onKeyUp={handleKeyWordChangeKeyUp} onKeyUp={handleKeyWordChangeKeyUp}
......
...@@ -16,7 +16,7 @@ import Dialog from "@/components/mui/MyDialog"; ...@@ -16,7 +16,7 @@ import Dialog from "@/components/mui/MyDialog";
import useMyRequest from "@/hooks/useMyRequest"; import useMyRequest from "@/hooks/useMyRequest";
import { useStores } from "@/store"; import { useStores } from "@/store";
import { useMessage } from "@/components/MySnackbar"; import { useMessage } from "@/components/MySnackbar";
import MySelect, { IOption } from "@/components/mui/MySelect"; import MyBorderlessSelect, { IOption } from "@/components/mui/MyBorderlessSelect";
import MyTable from "@/components/mui/MyTable"; import MyTable from "@/components/mui/MyTable";
import SearchInput from "@/components/BusinessComponents/SearchInput"; import SearchInput from "@/components/BusinessComponents/SearchInput";
import { import {
...@@ -67,8 +67,7 @@ const AddMember = observer((props: IProps) => { ...@@ -67,8 +67,7 @@ const AddMember = observer((props: IProps) => {
(every) => every.value === item (every) => every.value === item
); );
return ( return (
<MySelect <MyBorderlessSelect
input={<OutlinedInput />}
value={defaultValue?.length ? defaultValue[0]?.value : "VIEWER"} value={defaultValue?.length ? defaultValue[0]?.value : "VIEWER"}
onChange={(val) => changePermission(val, index)} onChange={(val) => changePermission(val, index)}
options={selectOptions} options={selectOptions}
......
...@@ -39,7 +39,9 @@ const ProjectSetting = observer(() => { ...@@ -39,7 +39,9 @@ const ProjectSetting = observer(() => {
if (currentProjectStore.currentProjectInfo.name) { if (currentProjectStore.currentProjectInfo.name) {
return ( return (
<div style={{ padding: "28px 24px 24px" }}> <div style={{ padding: "28px 24px 24px" }}>
<div style={{ display: "flex", alignItems: "center" }}> <div
style={{ display: "flex", alignItems: "center", marginBottom: "3px" }}
>
<span <span
style={{ style={{
fontSize: "18px", fontSize: "18px",
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
position: relative; position: relative;
} }
.templateDescBox { .templateDescBox {
margin-bottom: 40px; margin-bottom: 24px;
} }
.templateDescTitle { .templateDescTitle {
font-size: 16px; font-size: 16px;
...@@ -81,11 +81,10 @@ ...@@ -81,11 +81,10 @@
} }
.taskConfigBox { .taskConfigBox {
padding: 16px 0px 4px;
} }
.flowTitle { .flowTitle {
line-height: 16px; line-height: 16px;
margin: 3px 0 27px; margin: 3px 0 25px;
color: rgba(19, 112, 255, 1); color: rgba(19, 112, 255, 1);
font-size: 14px; font-size: 14px;
font-weight: 600; font-weight: 600;
...@@ -119,11 +118,11 @@ ...@@ -119,11 +118,11 @@
margin-left: 16px; margin-left: 16px;
} }
.bacthConfigBox { .bacthConfigBox {
padding: 0 24px 0; padding: 16px 24px 4px;
} }
.flowConfigBox { .flowConfigBox {
border-bottom: 1px solid rgba(235, 237, 240, 1); border-bottom: 1px solid rgba(235, 237, 240, 1);
padding: 20px 24px 12px; padding: 24px 24px 12px;
} }
.flowConfigBox:nth-last-child(1) { .flowConfigBox:nth-last-child(1) {
border-bottom: none; border-bottom: none;
......
...@@ -492,12 +492,16 @@ const ConfigForm = (props: ConfigFormProps) => { ...@@ -492,12 +492,16 @@ const ConfigForm = (props: ConfigFormProps) => {
/> />
</div> </div>
<div className={styles.taskConfigBox}> <div className={styles.taskConfigBox}>
{task.parameters.filter(
(parameter) => !parameter?.thrown && !parameter.hidden
).length !== 0 && (
<div className={styles.bacthConfigBox}> <div className={styles.bacthConfigBox}>
{randerParameters( {randerParameters(
task.parameters.filter((parameter) => !parameter?.thrown), task.parameters.filter((parameter) => !parameter?.thrown),
task.id task.id
)} )}
</div> </div>
)}
{task.flows.map((flow) => { {task.flows.map((flow) => {
if ( if (
flow.parameters.filter( flow.parameters.filter(
......
...@@ -25,9 +25,23 @@ ...@@ -25,9 +25,23 @@
justify-content: flex-start; justify-content: flex-start;
align-items: center; align-items: center;
} }
.goBackIcon {
cursor: pointer;
}
.goBackIconBox {
width: 32px;
height: 32px;
border-radius: 4px;
display: flex;
align-items: center;
justify-content: center;
}
.goBackIconBox:hover {
background-color: rgb(240, 242, 245);
}
.swTemplateTitle { .swTemplateTitle {
margin: 0 19px 0 8px; margin: 0 19px 0 3px;
line-height: 22px; line-height: 20px;
font-size: 14px; font-size: 14px;
color: rgba(30, 38, 51, 1); color: rgba(30, 38, 51, 1);
font-weight: 700; font-weight: 700;
...@@ -51,11 +65,11 @@ ...@@ -51,11 +65,11 @@
} }
.swFormBox { .swFormBox {
background-color: #fff; background-color: #fff;
border-right: 1xp solid rgba(235, 237, 240, 1); border-right: 1px solid rgba(235, 237, 240, 1);
width: 608px; width: 608px;
overflow-y: overlay; overflow-y: overlay;
box-sizing: border-box; box-sizing: border-box;
padding: 36px; padding: 32px 32px 16px;
} }
.swFlowBox { .swFlowBox {
flex: 1; flex: 1;
...@@ -70,6 +84,7 @@ ...@@ -70,6 +84,7 @@
right: 24px; right: 24px;
bottom: 24px; bottom: 24px;
padding: 8px; padding: 8px;
box-shadow: 0px 3px 10px 0px rgba(0, 24, 57, 0.06);
} }
.fullScreenBox:hover { .fullScreenBox:hover {
opacity: 0.6; opacity: 0.6;
......
...@@ -8,8 +8,6 @@ ...@@ -8,8 +8,6 @@
*/ */
import { toJS } from "mobx"; import { toJS } from "mobx";
import React, { useEffect, useState } from "react"; import React, { useEffect, useState } from "react";
import ArrowBackIosNewIcon from "@mui/icons-material/ArrowBackIosNew";
import IconButton from "@mui/material/IconButton";
import _ from "lodash"; import _ from "lodash";
import { useLocation, useNavigate } from "react-router-dom"; import { useLocation, useNavigate } from "react-router-dom";
import moment from "moment"; import moment from "moment";
...@@ -232,12 +230,20 @@ const ProjectSubmitWork = observer(() => { ...@@ -232,12 +230,20 @@ const ProjectSubmitWork = observer(() => {
const [popperTitle, setPopperTitle] = useState( const [popperTitle, setPopperTitle] = useState(
"提交前请先确认参数填写无误,确认提交吗?" "提交前请先确认参数填写无误,确认提交吗?"
); );
const [placement, setPlacement] = useState<
"bottom" | "bottom-start" | "bottom-end"
>("bottom");
const [anchorEl, setAnchorEl] = useState<any>(null); const [anchorEl, setAnchorEl] = useState<any>(null);
const handleCancel = () => { const handleCancel = () => {
setAnchorEl(null); setAnchorEl(null);
}; };
const handleShowPopper = (e: any, title: string) => { const handleShowPopper = (
e: any,
title: string,
placementParams: "bottom" | "bottom-start" | "bottom-end"
) => {
setPlacement(placementParams);
setPopperTitle(title); setPopperTitle(title);
setAnchorEl(anchorEl ? null : e.currentTarget); setAnchorEl(anchorEl ? null : e.currentTarget);
}; };
...@@ -255,14 +261,20 @@ const ProjectSubmitWork = observer(() => { ...@@ -255,14 +261,20 @@ const ProjectSubmitWork = observer(() => {
{fullScreenShow ? null : ( {fullScreenShow ? null : (
<div className={styles.swHeader}> <div className={styles.swHeader}>
<div className={styles.swHeaderLeft}> <div className={styles.swHeaderLeft}>
<div className={styles.goBackIconBox}>
<img <img
className={styles.goBackIcon} className={styles.goBackIcon}
src={goback} src={goback}
alt="" alt=""
onClick={(e: any) => onClick={(e: any) =>
handleShowPopper(e, "返回将放弃当前页面所有操作,确认返回吗?") handleShowPopper(
e,
"返回将放弃当前页面所有操作,确认返回吗?",
"bottom-end"
)
} }
/> />
</div>
<div className={styles.swTemplateTitle}> <div className={styles.swTemplateTitle}>
{templateConfigInfo?.title} {templateConfigInfo?.title}
</div> </div>
...@@ -288,7 +300,11 @@ const ProjectSubmitWork = observer(() => { ...@@ -288,7 +300,11 @@ const ProjectSubmitWork = observer(() => {
<MyButton <MyButton
text="提交任务" text="提交任务"
onClick={(e: any) => onClick={(e: any) =>
handleShowPopper(e, "提交前请先确认参数填写无误,确认提交吗?") handleShowPopper(
e,
"提交前请先确认参数填写无误,确认提交吗?",
"bottom-start"
)
} }
></MyButton> ></MyButton>
</div> </div>
...@@ -328,6 +344,7 @@ const ProjectSubmitWork = observer(() => { ...@@ -328,6 +344,7 @@ const ProjectSubmitWork = observer(() => {
onCancel={handleCancel} onCancel={handleCancel}
onConfirm={handleConfirm} onConfirm={handleConfirm}
loading={loading} loading={loading}
placement={placement}
/> />
</div> </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-09-02 14:45:04 * @LastEditTime: 2022-09-06 10:17:18
* @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
*/ */
...@@ -41,6 +41,7 @@ import MyProgress from "@/components/mui/MyProgress"; ...@@ -41,6 +41,7 @@ import MyProgress from "@/components/mui/MyProgress";
import SearchInput from "@/components/BusinessComponents/SearchInput"; import SearchInput from "@/components/BusinessComponents/SearchInput";
import MyCircularProgress from "@/components/mui/MyCircularProgress"; import MyCircularProgress from "@/components/mui/MyCircularProgress";
import moment from "moment"; import moment from "moment";
import MyTooltip from "@/components/mui/MyTooltip";
import styles from "./index.module.css"; import styles from "./index.module.css";
...@@ -201,6 +202,7 @@ const ProjectMembers = observer(() => { ...@@ -201,6 +202,7 @@ const ProjectMembers = observer(() => {
}; };
useEffect(() => { useEffect(() => {
setLoading(true);
setTimeout(() => { setTimeout(() => {
getWorkflowJobInfo({ getWorkflowJobInfo({
projectId: currentProjectStore.currentProjectInfo.id as string, projectId: currentProjectStore.currentProjectInfo.id as string,
...@@ -296,15 +298,21 @@ const ProjectMembers = observer(() => { ...@@ -296,15 +298,21 @@ const ProjectMembers = observer(() => {
const handleKeyWordChangeKeyUp = (e: any) => { const handleKeyWordChangeKeyUp = (e: any) => {
if (e.keyCode === 13) { if (e.keyCode === 13) {
setJobName(e.target.value); setJobName(e.target.value);
setLoading(true);
} }
}; };
const handleKeyWordChangeBlur = (e: any) => {
setJobName(e.target.value);
};
return ( return (
<Box className={styles.headerBox}> <Box className={styles.headerBox}>
<Box className={styles.tabHeader}> <Box className={styles.tabHeader}>
<Box sx={{ display: "flex" }}> <Box sx={{ display: "flex" }}>
<SearchInput onKeyUp={handleKeyWordChangeKeyUp} sx={{ width: 340 }} /> <SearchInput
onKeyUp={handleKeyWordChangeKeyUp}
onBlur={handleKeyWordChangeBlur}
sx={{ width: 340 }} />
{/* <Box className={styles.tabHeaderSelect}> {/* <Box className={styles.tabHeaderSelect}>
<TextField <TextField
select select
...@@ -374,7 +382,7 @@ const ProjectMembers = observer(() => { ...@@ -374,7 +382,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",
...@@ -400,7 +408,9 @@ const ProjectMembers = observer(() => { ...@@ -400,7 +408,9 @@ const ProjectMembers = observer(() => {
onClick={() => rowClick(item.id)} onClick={() => rowClick(item.id)}
> >
<Box className={styles.tabBoxInfo}> <Box className={styles.tabBoxInfo}>
<MyTooltip title={item.name}>
<div className={styles.tabBoxTitle}>{item.name}</div> <div className={styles.tabBoxTitle}>{item.name}</div>
</MyTooltip>
<Box className={styles.tabBoxDescInfo}> <Box className={styles.tabBoxDescInfo}>
<div <div
className={styles.tabBoxDesc} className={styles.tabBoxDesc}
...@@ -498,11 +508,7 @@ const ProjectMembers = observer(() => { ...@@ -498,11 +508,7 @@ const ProjectMembers = observer(() => {
</MyCircularProgress> </MyCircularProgress>
</Box> </Box>
<div className={styles.pagination}> <div className={styles.pagination}>
<MyPagination <MyPagination page={page} pageChange={handleChangePage} count={count} />
page={page}
pageChange={handleChangePage}
count={count || jobList.length}
/>
</div> </div>
{/* <TablePagination {/* <TablePagination
......
...@@ -53,16 +53,16 @@ const AddTemplate = (props: IAddTemplateProps) => { ...@@ -53,16 +53,16 @@ const AddTemplate = (props: IAddTemplateProps) => {
const [templateType, setTemplateType] = useState("public"); const [templateType, setTemplateType] = useState("public");
// 滚轮是否到顶,判断是否显示阴影 // 滚轮是否到顶,判断是否显示阴影
const [isTop, setIsTop] = useState(true) const [isTop, setIsTop] = useState(true);
// 滚动滚轮时监听是否到顶 // 滚动滚轮时监听是否到顶
const onscroll = (e: any) => { const onscroll = (e: any) => {
if (e.target.scrollTop <= 0) { if (e.target.scrollTop <= 0) {
setIsTop(true) setIsTop(true);
} else { } else {
setIsTop(false) setIsTop(false);
}
} }
};
const handleRadio = (value: string) => { const handleRadio = (value: string) => {
setTemplateType(value); setTemplateType(value);
...@@ -144,8 +144,11 @@ const AddTemplate = (props: IAddTemplateProps) => { ...@@ -144,8 +144,11 @@ const AddTemplate = (props: IAddTemplateProps) => {
}; };
// 获取模板列表 // 获取模板列表
const getAddTemplateListFun = useCallback((newTitle?: string) => { const getAddTemplateListFun = useCallback(
const userName = JSON.parse(localStorage.getItem("userInfo") || "{}")?.name; (newTitle?: string) => {
const userName = JSON.parse(
localStorage.getItem("userInfo") || "{}"
)?.name;
setSelectTemplateData([]); setSelectTemplateData([]);
setAddTemplateList([]); setAddTemplateList([]);
if (templateType === "public") { if (templateType === "public") {
...@@ -163,20 +166,22 @@ const AddTemplate = (props: IAddTemplateProps) => { ...@@ -163,20 +166,22 @@ const AddTemplate = (props: IAddTemplateProps) => {
keyword: newTitle, keyword: newTitle,
}); });
} }
}, [ },
[
setSelectTemplateData, setSelectTemplateData,
getAddTemplateList, getAddTemplateList,
productId, productId,
projectId, projectId,
templateType, templateType,
// title, // title,
]); ]
);
//模板启用切换 //模板启用切换
const templateSwitch = (e: any, id: string) => { const templateSwitch = (e: any, id: string) => {
if (e.target.checked) { if (e.target.checked) {
let arr = [] let arr = [];
arr.push(id) arr.push(id);
addTemplate({ addTemplate({
projectId: projectId as string, projectId: projectId as string,
workflowSpecIds: arr, workflowSpecIds: arr,
...@@ -187,7 +192,7 @@ const AddTemplate = (props: IAddTemplateProps) => { ...@@ -187,7 +192,7 @@ const AddTemplate = (props: IAddTemplateProps) => {
workflowSpecId: id, workflowSpecId: id,
}); });
} }
} };
useEffect(() => { useEffect(() => {
getAddTemplateListFun(); getAddTemplateListFun();
...@@ -255,7 +260,7 @@ const AddTemplate = (props: IAddTemplateProps) => { ...@@ -255,7 +260,7 @@ const AddTemplate = (props: IAddTemplateProps) => {
value={templateType} value={templateType}
radioOptions={radioOptions} radioOptions={radioOptions}
handleRadio={handleRadio} handleRadio={handleRadio}
></RadioGroupOfButtonStyle> />
{/* <MyButton {/* <MyButton
onClick={handleAddTemplate} onClick={handleAddTemplate}
size={"small"} size={"small"}
...@@ -272,7 +277,7 @@ const AddTemplate = (props: IAddTemplateProps) => { ...@@ -272,7 +277,7 @@ const AddTemplate = (props: IAddTemplateProps) => {
</Box> </Box>
</Box> </Box>
</div> </div>
<div className={style.templateBox} onScroll={onscroll} > <div className={style.templateBox} onScroll={onscroll}>
{templateType === "public" && addTemplateList.length === 0 && ( {templateType === "public" && addTemplateList.length === 0 && (
<Box <Box
sx={{ sx={{
...@@ -342,9 +347,7 @@ const AddTemplate = (props: IAddTemplateProps) => { ...@@ -342,9 +347,7 @@ const AddTemplate = (props: IAddTemplateProps) => {
<div className={style.templateLiEditBox}> <div className={style.templateLiEditBox}>
<MySwitch <MySwitch
defaultChecked={item.favorited} defaultChecked={item.favorited}
onChange={(e: any) => onChange={(e: any) => templateSwitch(e, item.id)}
templateSwitch(e, item.id)
}
></MySwitch> ></MySwitch>
</div> </div>
......
...@@ -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-09-07 10:06:13
* @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
*/ */
...@@ -63,7 +63,7 @@ const BatchNode = (props: IBatchNode) => { ...@@ -63,7 +63,7 @@ const BatchNode = (props: IBatchNode) => {
{inParamsArr?.length {inParamsArr?.length
? inParamsArr.map((item, index) => { ? inParamsArr.map((item, index) => {
return ( return (
<MyTooltip title={item.name} key={uuid()}> <MyTooltip title={item.title} key={uuid()}>
<Handle <Handle
className={styles.handleBox} className={styles.handleBox}
id={item.name} id={item.name}
...@@ -95,7 +95,7 @@ const BatchNode = (props: IBatchNode) => { ...@@ -95,7 +95,7 @@ const BatchNode = (props: IBatchNode) => {
{outParamsArr?.length {outParamsArr?.length
? outParamsArr.map((item, index) => { ? outParamsArr.map((item, index) => {
return ( return (
<MyTooltip title={item.name} key={uuid()}> <MyTooltip title={item.title} key={uuid()}>
<Handle <Handle
className={styles.handleBox} className={styles.handleBox}
id={item.name} id={item.name}
......
...@@ -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-09-02 14:23:07 * @LastEditTime: 2022-09-07 10:44:23
* @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
*/ */
...@@ -81,7 +81,7 @@ const FlowNode = (props: any) => { ...@@ -81,7 +81,7 @@ const FlowNode = (props: any) => {
{inParamsArr?.length {inParamsArr?.length
? inParamsArr.map((item: any, index: number) => { ? inParamsArr.map((item: any, index: number) => {
return ( return (
<MyTooltip title={item.name} key={uuid()}> <MyTooltip title={item.title} key={uuid()}>
<Handle <Handle
className={styles.handleBox} className={styles.handleBox}
id={item.name} id={item.name}
...@@ -117,7 +117,7 @@ const FlowNode = (props: any) => { ...@@ -117,7 +117,7 @@ const FlowNode = (props: any) => {
{outParamsArr?.length {outParamsArr?.length
? outParamsArr.map((item: any, index: number) => { ? outParamsArr.map((item: any, index: number) => {
return ( return (
<MyTooltip title={item.name} key={uuid()}> <MyTooltip title={item.title} key={uuid()}>
<Handle <Handle
className={styles.handleBox} className={styles.handleBox}
id={item.name} id={item.name}
......
.reactFlowBox > div:last-child { .reactFlowBox > div:last-child {
display: none; display: none;
} }
/* .reactFlowBox > div:first-child { /* .reactFlowBox > div:first-child {
margin-top: 32px; margin-top: 32px;
} */ } */
...@@ -12,6 +12,8 @@ ...@@ -12,6 +12,8 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
border-left: 1px solid #dde1e6; border-left: 1px solid #dde1e6;
animation: myfirst 0.3s;
-webkit-animation: myfirst 0.3s; /* Safari and Chrome */
} }
.searchBox { .searchBox {
...@@ -119,3 +121,21 @@ ...@@ -119,3 +121,21 @@
line-height: 20px; line-height: 20px;
font-size: 12px; font-size: 12px;
} }
@keyframes myfirst {
from {
width: 0;
}
to {
width: 260px;
}
}
@-webkit-keyframes myfirst /* Safari and Chrome */ {
from {
width: 0;
}
to {
width: 260px;
}
}
...@@ -4,12 +4,18 @@ ...@@ -4,12 +4,18 @@
cursor: grab; cursor: grab;
padding: 16px 16px 0 24px; padding: 16px 16px 0 24px;
background-color: #fff; background-color: #fff;
transition: width 0.2s;
-webkit-transition: width 0.2s; /* Safari */
} }
.operatorItemBox:hover { .operatorItemBox:hover {
box-shadow: 0px 5px 16px 0px rgba(0, 24, 57, 0.1); box-shadow: 0px 5px 16px 0px rgba(0, 24, 57, 0.1);
position: relative; position: relative;
top: -1px; top: -1px;
} }
.operatorItemBox .footerBox {
transition: width 0.2s;
-webkit-transition: width 0.2s; /* Safari */
}
.operatorItemBox:hover .footerBox { .operatorItemBox:hover .footerBox {
border-bottom: 1px solid #fff; border-bottom: 1px solid #fff;
} }
......
...@@ -105,7 +105,7 @@ const OperatorItem = (props: IOperatorItemProps) => { ...@@ -105,7 +105,7 @@ const OperatorItem = (props: IOperatorItemProps) => {
const newBatchFlowArr = getCopyBatchFlowArr( const newBatchFlowArr = getCopyBatchFlowArr(
batchFlowArr, batchFlowArr,
clientX - upperLeftPointX, clientX - upperLeftPointX,
clientY - upperLeftPointY clientY - upperLeftPointY + 44
); );
const newVal = cloneDeep(templateConfigInfo); const newVal = cloneDeep(templateConfigInfo);
newVal.push(...newBatchFlowArr); newVal.push(...newBatchFlowArr);
......
...@@ -300,6 +300,7 @@ const ParameterSetting = (props: IParameterSettingProps) => { ...@@ -300,6 +300,7 @@ const ParameterSetting = (props: IParameterSettingProps) => {
helpertext={parameter.helperText} helpertext={parameter.helperText}
options={parameter?.choices || []} options={parameter?.choices || []}
disabled={parameter.parameterGroup === "out"} disabled={parameter.parameterGroup === "out"}
fullWidth={true}
></MySelect> ></MySelect>
)} )}
{(parameter.domType || "").toLowerCase() === "multipleselect" && ( {(parameter.domType || "").toLowerCase() === "multipleselect" && (
...@@ -320,6 +321,7 @@ const ParameterSetting = (props: IParameterSettingProps) => { ...@@ -320,6 +321,7 @@ const ParameterSetting = (props: IParameterSettingProps) => {
helpertext={parameter.helperText} helpertext={parameter.helperText}
options={parameter?.choices || []} options={parameter?.choices || []}
disabled={parameter.parameterGroup === "out"} disabled={parameter.parameterGroup === "out"}
fullWidth={true}
></MySelect> ></MySelect>
)} )}
{(parameter.domType || "").toLowerCase() === "radio" && ( {(parameter.domType || "").toLowerCase() === "radio" && (
...@@ -510,7 +512,12 @@ const ParameterSetting = (props: IParameterSettingProps) => { ...@@ -510,7 +512,12 @@ const ParameterSetting = (props: IParameterSettingProps) => {
} else { } else {
setActiveParamsTab(""); // 会报错 不过不会有蓝色长条 setActiveParamsTab(""); // 会报错 不过不会有蓝色长条
} }
}, [basisParameters, seniorParameters, hardwareParameters]); }, [
taskId,
basisParameters.length,
seniorParameters.length,
hardwareParameters.length,
]);
return ( return (
<div className={styles.parameterSetting}> <div className={styles.parameterSetting}>
......
...@@ -26,12 +26,20 @@ ...@@ -26,12 +26,20 @@
align-items: center; align-items: center;
} }
.goBackIcon { .goBackIcon {
margin-right: 8px;
cursor: pointer; cursor: pointer;
} }
/* .goBackIcon:hover:{ .goBackIconBox {
color: ; width: 32px;
} */ height: 32px;
border-radius: 4px;
display: flex;
align-items: center;
justify-content: center;
margin-right: 3px;
}
.goBackIconBox:hover {
background-color: rgb(240, 242, 245);
}
.goBack { .goBack {
cursor: pointer; cursor: pointer;
color: #1e2633; color: #1e2633;
......
...@@ -197,7 +197,9 @@ const WorkFlowEdit = observer((props: IProps) => { ...@@ -197,7 +197,9 @@ const WorkFlowEdit = observer((props: IProps) => {
) )
} }
> >
<div className={styles.goBackIconBox}>
<img className={styles.goBackIcon} src={goback} alt="" /> <img className={styles.goBackIcon} src={goback} alt="" />
</div>
<span className={styles.goBack}>返回</span> <span className={styles.goBack}>返回</span>
</div> </div>
<div className={styles.swHeaderRight}> <div className={styles.swHeaderRight}>
...@@ -224,7 +226,10 @@ const WorkFlowEdit = observer((props: IProps) => { ...@@ -224,7 +226,10 @@ const WorkFlowEdit = observer((props: IProps) => {
fontSize: "16px", fontSize: "16px",
height: "30px", height: "30px",
}} }}
></RadioGroupOfButtonStyle> radioActiveBgBoxStyle={{
height: "32px",
}}
/>
</div> </div>
{leftContentType === "list" && ( {leftContentType === "list" && (
<OperatorList <OperatorList
......
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