Commit 24d0d635 authored by chenshouchao's avatar chenshouchao

删除不必要的引用

parent 72f8ff82
......@@ -4,7 +4,7 @@ import axios from "axios";
// import { Actions, Constants } from '../../../../commons/utils/constants'
// import MessageUtil from '../../../../commons/utils/MessageUtil'
// import ApiUtils from '../../../../commons/utils/ApiUtils'
import { APIOPTION, urlToken, ZONEID } from "./raysyncApi";
import { APIOPTION, urlToken } from "./raysyncApi";
// import UserStore from '../../../../console/common/stores/UserStore'
import { ApiUtils } from "./utils";
import Base64 from "crypto-js/enc-base64";
......
......@@ -9,7 +9,6 @@ import Paper from "@mui/material/Paper";
import Checkbox from "@mui/material/Checkbox";
// import Spin from "./Spin";
import EnhancedTableToolbarComponent from "./Table/EnhancedTableToolbar"
import EnhancedTableHeadComponent from "./Table/EnhancedTableHead"
import { getComparator, stableSort, useStyles } from "./Table/function";
import ActionsComponent from "./Table/ActionsComponent"
......@@ -20,11 +19,10 @@ export default function EnhancedTable(props) {
const classes = useStyles;
const [order, setOrder] = React.useState("asc");
const [orderBy, setOrderBy] = React.useState("");
const { headCells, rows, footer = true, elevation1, tableStyle, tablecellstyle, tableContainerStyle, stickyheader, TableHeadClasses, onRowClick, defaultRow, minHeight = '', borderBottom = '', onDoubleClick,
const { headCells, rows, footer = true, elevation1, tableStyle, tablecellstyle, tableContainerStyle, stickyheader, onRowClick, defaultRow, minHeight = '', borderBottom = '', onDoubleClick,
load, size, checkboxData, rowsPerPage = 10, initSelected, page = 0, changePage = function () { }, toolbar, count, param, disabledparam = "id", headTableCellCheckbox, RowHeight = '', CellWidth = '', rowHover, TableNodataPadding = '', TableNodataLineHeight = '', tableBoySx } = props;
const [selected, setSelected] = React.useState(initSelected || []);
const [rowsPerPageOptions, setRowsPerPageOptions] = React.useState(initSelected || [5, 10, 20, 50, { value: -1, label: 'All' }]);
// const [spin, setSpin] = React.useState(false)
const [rowsPerPageOptions] = React.useState(initSelected || [5, 10, 20, 50, { value: -1, label: 'All' }]);
const [onRow, setOnRow] = React.useState('')
// 重置复选框选中选项
......@@ -63,10 +61,6 @@ export default function EnhancedTable(props) {
setSelected([]);
checkboxData([]);
};
// React.useEffect(() => {
// setSpin(load)
// }, [load]);
const handleClick = (event, name) => {
const selectedIndex = selected.indexOf(name);
let newSelected = [];
......@@ -97,7 +91,7 @@ export default function EnhancedTable(props) {
const isSelected = (name) => selected.indexOf(name) !== -1;
const emptyRows = rowsPerPage - Math.min(rowsPerPage, rows.length - page * rowsPerPage);
// const emptyRows = rowsPerPage - Math.min(rowsPerPage, rows.length - page * rowsPerPage);
const renderTableCellValue = useCallback(((item, row, index)=>{
if(
......@@ -209,11 +203,6 @@ export default function EnhancedTable(props) {
</TableRow>
);
})}
{/* {emptyRows > 0 && (
<TableRow style={{ height: (dense ? 33 : 53) * emptyRows }}>
<TableCell colSpan={6} />
</TableRow>
)} */}
</TableBody>
</Table>
</TableContainer>
......
import React, { FC } from "react";
import React from "react";
import { Props } from "ahooks/lib/useControllableValue";
import { makeStyles } from "tss-react/mui";
import { Typography, Menu, MenuItem, IconButton, Button } from "@mui/material";
import ArrowDropDownIcon from '@mui/icons-material/ArrowDropDown';
import { Typography, Menu, MenuItem, Button } from "@mui/material";
import ArrowDropDownIcon from "@mui/icons-material/ArrowDropDown";
type ButtonTagProps = {
text: string;//文本内容
variant?: "text" | 'contained' | 'outlined';//按钮样式
click?: any;//点击事件
select?: any[];//选择按钮的下拉列表
fontSize?: string;//按钮文字大小
dropValue?: boolean;//选择的值
drop?: boolean;//是否开启选择
color?: "inherit" | "primary" | "secondary" | undefined,//按钮颜色风格
btnStyle?: any,//按钮自定义样式类
size?: "large" | "medium" | "small",//按钮尺寸
disabled?: boolean,//是否禁用
style?: any,//按钮自定义样式
img?: JSX.Element;//图标按钮中的图标
selectCallBack?: (item: any, key: number) => void//选择按钮的回调
}
text: string; //文本内容
variant?: "text" | "contained" | "outlined"; //按钮样式
click?: any; //点击事件
select?: any[]; //选择按钮的下拉列表
fontSize?: string; //按钮文字大小
dropValue?: boolean; //选择的值
drop?: boolean; //是否开启选择
color?: "inherit" | "primary" | "secondary" | undefined; //按钮颜色风格
btnStyle?: any; //按钮自定义样式类
size?: "large" | "medium" | "small"; //按钮尺寸
disabled?: boolean; //是否禁用
style?: any; //按钮自定义样式
img?: JSX.Element; //图标按钮中的图标
selectCallBack?: (item: any, key: number) => void; //选择按钮的回调
};
const ButtonComponent = (props: ButtonTagProps) => {
const { size, disabled, variant, color, img, btnStyle = {}, select, selectCallBack } = props;
const {
size,
disabled,
variant,
color,
img,
btnStyle = {},
select,
selectCallBack,
} = props;
const { classes, cx } = useStyles({});
const [anchorEl, setAnchorEl] = React.useState(null);
const handleClick = (event: { currentTarget: React.SetStateAction<null>; }) => setAnchorEl(event.currentTarget);
const defultClick = (event: { stoppropagation: () => any; }) => event && event.stoppropagation && event.stoppropagation()
const handleClick = (event: { currentTarget: React.SetStateAction<null> }) =>
setAnchorEl(event.currentTarget);
const defultClick = (event: { stoppropagation: () => any }) =>
event && event.stoppropagation && event.stoppropagation();
const handleCloseOption = (item: any, key: number) => {
setAnchorEl(null);
selectCallBack && selectCallBack(item, key)
}
selectCallBack && selectCallBack(item, key);
};
const handleClose = () => setAnchorEl(null);
return (
<>
<Button
size={size || "medium"}
variant={variant || 'contained'}
variant={variant || "contained"}
color={color || "primary"}
disableRipple={true}
disableFocusRipple={true}
......@@ -48,29 +57,36 @@ const ButtonComponent = (props: ButtonTagProps) => {
classes={{
root: btnStyle.root || classes.root,
// disabled: btnStyle.disabled || classes.disabled,
containedSecondary: btnStyle.containedSecondary || classes.containedSecondary,
containedSecondary:
btnStyle.containedSecondary || classes.containedSecondary,
outlined: btnStyle.outlined || classes.outlined,
outlinedSecondary: btnStyle.outlinedSecondary || classes.outlinedSecondary,
outlinedSecondary:
btnStyle.outlinedSecondary || classes.outlinedSecondary,
text: btnStyle.text || classes.text,
textPrimary: btnStyle.textPrimary || classes.textPrimary,
textSecondary: btnStyle.textSecondary || classes.textSecondary,
sizeSmall: btnStyle.sizeSmall || classes.sizeSmall,
sizeLarge: btnStyle.sizeLarge || classes.sizeLarge,
}}
style={{ ...props.style }}
onClick={props.select ? handleClick : (props.click || defultClick)}
onClick={props.select ? handleClick : props.click || defultClick}
>
{img || ''}
<Typography style={{ fontSize: props.fontSize || "14px" }}>{props.text}</Typography>
{
(props.select && props.select.length > 0 || props.drop) && <ArrowDropDownIcon classes={{
{img || ""}
<Typography style={{ fontSize: props.fontSize || "14px" }}>
{props.text}
</Typography>
{((props.select && props.select.length > 0) || props.drop) && (
<ArrowDropDownIcon
classes={{
root: cx({
[classes.ArrowDropDownIconRoot]: true,
[classes.ArrowDropDownIconRootOpen]: Boolean(props.dropValue || anchorEl)
})
}} />
}
[classes.ArrowDropDownIconRootOpen]: Boolean(
props.dropValue || anchorEl
),
}),
}}
/>
)}
</Button>
<Menu
id="simple-menu"
......@@ -79,40 +95,67 @@ const ButtonComponent = (props: ButtonTagProps) => {
open={Boolean(anchorEl)}
onClose={handleClose}
>
{
select && select.length > 0 && select.map((item, key) => {
{select &&
select.length > 0 &&
select.map((item, key) => {
return (
<MenuItem
key={key}
classes={{ root: classes.menuItemRoot }}
onClick={() => handleCloseOption(item, key)}>
onClick={() => handleCloseOption(item, key)}
>
{item.name || ""}
</MenuItem>
)
})
}
);
})}
</Menu>
</>
)
}
);
};
const useStyles = makeStyles<{}>()(
(theme, { }) => ({
root: { backgroundColor: "#136EFA", boxShadow: "none !important", color: "#ffffff", "&:hover": { backgroundColor: "#0055D9" } },
containedSecondary: { backgroundColor: "#D62C1F", boxShadow: "none !important", "&:hover": { backgroundColor: "#D82C1F" } },
outlined: { backgroundColor: '#FFFFFF', border: "1px solid #136EFA", boxShadow: "none !important", color: "#136EFA", "&:hover": { backgroundColor: "rgba(19, 110, 250, 0.1)" } },
outlinedSecondary: { border: "1px solid #D62C1F", color: "#D62C1F", "&:hover": { border: "1px solid #D62C1F", backgroundColor: "rgba(214, 44, 31, 0.1)" } },
const useStyles = makeStyles<{}>()((theme) => ({
root: {
backgroundColor: "#136EFA",
boxShadow: "none !important",
color: "#ffffff",
"&:hover": { backgroundColor: "#0055D9" },
},
containedSecondary: {
backgroundColor: "#D62C1F",
boxShadow: "none !important",
"&:hover": { backgroundColor: "#D82C1F" },
},
outlined: {
backgroundColor: "#FFFFFF",
border: "1px solid #136EFA",
boxShadow: "none !important",
color: "#136EFA",
"&:hover": { backgroundColor: "rgba(19, 110, 250, 0.1)" },
},
outlinedSecondary: {
border: "1px solid #D62C1F",
color: "#D62C1F",
"&:hover": {
border: "1px solid #D62C1F",
backgroundColor: "rgba(214, 44, 31, 0.1)",
},
},
label: { "& p": { fontSize: "13px" } },
text: { backgroundColor: 'transparent', boxShadow: "none !important" },
text: { backgroundColor: "transparent", boxShadow: "none !important" },
textPrimary: { color: "#136EFA", "&:hover": { backgroundColor: "#E8F1FF" } },
textSecondary: { color: "#F44335", "&:hover": { backgroundColor: "rgba(244, 67, 53, 0.1)" } },
textSecondary: {
color: "#F44335",
"&:hover": { backgroundColor: "rgba(244, 67, 53, 0.1)" },
},
sizeSmall: { "& p": { fontSize: "12px" } },
sizeLarge: { "& p": { fontSize: "14px" } },
menuItemRoot: {},
ArrowDropDownIconRoot: { color: "#8A9099", transition: "all 0.2s !important", transform: "rotate(0)" },
ArrowDropDownIconRoot: {
color: "#8A9099",
transition: "all 0.2s !important",
transform: "rotate(0)",
},
ArrowDropDownIconRootOpen: { color: "#8A9099", transform: "rotate(180deg)" },
})
);
}));
export default ButtonComponent;
......@@ -18,7 +18,6 @@ type MyTreeViewProps = {
renderLabel?: (node: any) => React.ReactNode;
treeViewSx?: any;
defaultExpanded?: Array<string>;
idKey?: string;
idFunc?: (node: any) => string;
};
......@@ -38,7 +37,6 @@ const MyTreeView = (props: MyTreeViewProps) => {
onNodeSelect,
onNodeToggle,
defaultExpanded,
idKey,
idFunc,
} = props;
......
......@@ -75,7 +75,7 @@ const usePass = () => {
}
return false;
},
[permissionStore.allRoutes]
[permissionStore.allRoutes, currentProjectStore]
);
return isPass;
......
......@@ -7,8 +7,8 @@ import { Provider } from "mobx-react";
import { stores } from "@/store/index";
import { MySnackbarProvider } from "@/components/MySnackbar";
import "@/mocks/index";
import './assets/style/public.css'
import { createTheme, ThemeProvider, styled } from '@mui/material/styles';
import "./assets/style/public.css";
import { createTheme, ThemeProvider } from "@mui/material/styles";
const root = ReactDOM.createRoot(
document.getElementById("root") as HTMLElement
......@@ -16,12 +16,25 @@ const root = ReactDOM.createRoot(
const theme = createTheme({
typography: {
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"'].join(','),
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"',
].join(","),
},
palette: {
primary: { main: '#136EFA' },
secondary: { main: '#F44335' }
}
primary: { main: "#136EFA" },
secondary: { main: "#F44335" },
},
});
root.render(
......
......@@ -36,6 +36,6 @@ export const verifyLettersNumbersCertainChars5 = (str: string) => {
if (getTrueLength(str) > 127) {
return false;
}
let validString = /^[\u4e00-\u9fa5_0-9a-zA-Z\/-_.]+$/;
let validString = /^[\u4e00-\u9fa5_0-9a-zA-Z/-_.]+$/;
return validString.test(str);
};
\ No newline at end of file
import React, { useState, useImperativeHandle, useMemo } from "react";
import React, { useImperativeHandle, useMemo } from "react";
import MyDialog from "@/components/mui/MyDialog";
import { useMessage } from "@/components/MySnackbar";
......
......@@ -34,9 +34,7 @@ const MoveFile = (props: any) => {
const [moveFileSubmitloading, setMoveFileSubmitloading] = useState(false);
const [treeData, setTreeData] = useState<any>([]);
const [renderTreeData, setRenderTreeData] = useState<any>([]);
const [moveFileDialogRef, setMoveFileDialogRef] = useState<any>(
React.createRef()
);
const [moveFileDialogRef] = useState<any>(React.createRef());
// 要移动的文件夹 之后用来隐藏文件夹树中同路径的文件夹
const [moveFolderPathArr, setMoveFolderPathArr] = useState<Array<string>>([]);
......@@ -345,7 +343,6 @@ const MoveFile = (props: any) => {
ProjectData
</div>
<MyTreeView
// treeData={treeData}
treeData={renderTreeData}
renderLabel={renderLabel}
onNodeSelect={onNodeSelect}
......
......@@ -7,7 +7,7 @@
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
// import Dialog from "@/components/Material.Ui/Dialog";
import { memo, useEffect, useMemo, useState } from "react";
import { memo, useEffect, useState } from "react";
import { observer } from "mobx-react-lite";
import { toJS } from "mobx";
......
......@@ -6,7 +6,7 @@
* @FilePath: /bkunyun/src/views/Project/ProjectSetting/index.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import { memo, useState, useMemo } from "react";
import { memo, useMemo } from "react";
import { Box } from "@mui/system";
import { useStores } from "@/store/index";
......
import { memo, useCallback, useEffect, useMemo, useState } from "react";
import styles from "../index.module.css";
import { memo } from "react";
import { Box, Typography } from "@mui/material";
import Button from "@mui/material/Button";
import Dialog from "@/components/mui/Dialog";
const SimpleDialog = (props: any) => {
const { openDialog, closeDialog, onConfirm, text, title } = props;
return (
< >
<>
<Dialog
open={openDialog}
onClose={closeDialog}
......@@ -17,7 +14,9 @@ const SimpleDialog = (props: any) => {
title={title}
>
<Box>
<Typography sx={{ fontSize: '14px', fontWeight: '400' }}>{text}</Typography>
<Typography sx={{ fontSize: "14px", fontWeight: "400" }}>
{text}
</Typography>
</Box>
</Dialog>
</>
......
import { memo, useCallback, useEffect, useMemo, useState } from "react";
import styles from "../index.module.css";
import { memo } from "react";
import { Box, Typography } from "@mui/material";
import Button from "@mui/material/Button";
import Dialog from "@/components/mui/Dialog";
const SimpleDialog = (props: any) => {
const { openDialog, closeDialog, onConfirm, text, title } = props;
return (
< >
<>
<Dialog
open={openDialog}
onClose={closeDialog}
......@@ -17,7 +14,9 @@ const SimpleDialog = (props: any) => {
title={title}
>
<Box>
<Typography sx={{ fontSize: '14px', fontWeight: '400' }}>{text}</Typography>
<Typography sx={{ fontSize: "14px", fontWeight: "400" }}>
{text}
</Typography>
</Box>
</Dialog>
</>
......
......@@ -6,7 +6,7 @@
* @FilePath: /bkunyun/src/views/Project/ProjectWorkbench/workbenchTemplate/components/templateBox.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import { memo, useCallback, useEffect, useMemo, useState } from "react";
import { memo, useCallback } from "react";
import styles from "../index.module.css";
import { Box, Typography } from "@mui/material";
import Button from "@/components/mui/Button";
......
import styles from "./index.module.css";
import {
ITask,
IParameter,
// IParameter,
} from "../../../Project/ProjectSubmitWork/interface";
import noTemplate from "@/assets/project/noTemplate.svg";
import { useEffect, useMemo, useRef, useState } from "react";
import { useEffect, useMemo, useState } from "react";
import classNames from "classnames";
type IParameterSettingProps = {
......@@ -15,16 +15,15 @@ type IParameterSettingProps = {
const ParameterSetting = (props: IParameterSettingProps) => {
const { templateConfigInfo, taskId } = props;
const [descRef, setDescRef] = useState<any>(useRef());
const [descHeight, setDescHeight] = useState(0);
const [isShowAllDese, setIsShowAllDese] = useState(false);
useEffect(() => {
const div = document.getElementById("descHeight");
useEffect(() => {
if (div) {
setDescHeight(div.offsetHeight);
}
}, [descRef]);
}, [div]);
const taskInfo: ITask | null = useMemo(() => {
if (!taskId) {
......@@ -42,100 +41,69 @@ const ParameterSetting = (props: IParameterSettingProps) => {
}, [templateConfigInfo, taskId]);
// 输入参数
const inParameters: Array<IParameter> = useMemo(() => {
if (!taskInfo) {
return [];
} else {
return taskInfo.parameters.filter(
(parameter) => parameter.parameterGroup === "in"
);
}
}, [taskInfo]);
// const inParameters: Array<IParameter> = useMemo(() => {
// if (!taskInfo) {
// return [];
// } else {
// return taskInfo.parameters.filter(
// (parameter) => parameter.parameterGroup === "in"
// );
// }
// }, [taskInfo]);
// 输出参数
const outParameters: Array<IParameter> = useMemo(() => {
if (!taskInfo) {
return [];
} else {
return taskInfo.parameters.filter(
(parameter) => parameter.parameterGroup === "out"
);
}
}, [taskInfo]);
// // 输出参数
// const outParameters: Array<IParameter> = useMemo(() => {
// if (!taskInfo) {
// return [];
// } else {
// return taskInfo.parameters.filter(
// (parameter) => parameter.parameterGroup === "out"
// );
// }
// }, [taskInfo]);
// 基础参数
const basisParameters: Array<IParameter> = useMemo(() => {
if (!taskInfo) {
return [];
} else {
return taskInfo.parameters.filter(
(parameter) => parameter.parameterGroup === "basis"
);
}
}, [taskInfo]);
// // 基础参数
// const basisParameters: Array<IParameter> = useMemo(() => {
// if (!taskInfo) {
// return [];
// } else {
// return taskInfo.parameters.filter(
// (parameter) => parameter.parameterGroup === "basis"
// );
// }
// }, [taskInfo]);
// 高级选项
const seniorParameters: Array<IParameter> = useMemo(() => {
if (!taskInfo) {
return [];
} else {
return taskInfo.parameters.filter(
(parameter) => parameter.parameterGroup === "senior"
);
}
}, [taskInfo]);
// // 高级选项
// const seniorParameters: Array<IParameter> = useMemo(() => {
// if (!taskInfo) {
// return [];
// } else {
// return taskInfo.parameters.filter(
// (parameter) => parameter.parameterGroup === "senior"
// );
// }
// }, [taskInfo]);
// 硬件配置
const hardwareParameters: Array<IParameter> = useMemo(() => {
if (!taskInfo) {
return [];
} else {
return taskInfo.parameters.filter(
(parameter) => parameter.parameterGroup === "hardware"
);
}
}, [taskInfo]);
// // 硬件配置
// const hardwareParameters: Array<IParameter> = useMemo(() => {
// if (!taskInfo) {
// return [];
// } else {
// return taskInfo.parameters.filter(
// (parameter) => parameter.parameterGroup === "hardware"
// );
// }
// }, [taskInfo]);
return (
<div className={styles.parameterSetting}>
{/* <div className={styles.taskInfo}>
<div className={styles.taskTitle}>taskTitle</div>
<div className={styles.taskVersion}>version</div>
<div
className={styles.taskDescriptionHeight}
id="descHeight"
ref={descRef}
>
埃里克梵蒂冈和艰苦拉萨规定了卡号是德国埃里克梵蒂冈和艰苦拉萨规定了卡号是德国埃里克梵蒂冈和艰苦拉萨规定了卡号是德国埃里克梵蒂冈和艰苦拉萨规定了卡号是德国埃里克梵蒂冈和艰苦拉萨规定了卡号是德国埃里克梵蒂冈和艰苦拉萨规定了卡号是德国
</div>
<div
className={classNames({
[styles.taskDescriptionAll]: isShowAllDese,
[styles.taskDescription]: !isShowAllDese,
})}
>
埃里克梵蒂冈和艰苦拉萨规定了卡号是德国埃里克梵蒂冈和艰苦拉萨规定了卡号是德国埃里克梵蒂冈和艰苦拉萨规定了卡号是德国埃里克梵蒂冈和艰苦拉萨规定了卡号是德国埃里克梵蒂冈和艰苦拉萨规定了卡号是德国埃里克梵蒂冈和艰苦拉萨规定了卡号是德国
{descHeight > 60 && (
<span
className={styles.descButton}
onClick={() => setIsShowAllDese(!isShowAllDese)}
>
{isShowAllDese ? "收起" : "展开"}
</span>
)}
</div>
</div> */}
{taskInfo && (
<div className={styles.taskInfo}>
<div className={styles.taskTitle}>{taskInfo.title || "-"}</div>
<div className={styles.taskVersion}>
版本:{taskInfo.version || "-"}
</div>
<div
className={styles.taskDescriptionHeight}
id="descHeight"
ref={descRef}
>
<div className={styles.taskDescriptionHeight} id="descHeight">
{taskInfo.description || "-"}
</div>
<div
......@@ -156,12 +124,12 @@ const ParameterSetting = (props: IParameterSettingProps) => {
</div>
</div>
)}
{/* {!taskInfo && (
{!taskInfo && (
<div className={styles.noData}>
<img src={noTemplate} alt="" className={styles.noDataImg} />
<span className={styles.noDataText}>选中任意算子进行参数设置</span>
</div>
)} */}
)}
</div>
);
};
......
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