Commit 3144251a authored by chenshouchao's avatar chenshouchao

UI: 样式优化

parent e44927b1
...@@ -47,6 +47,10 @@ const theme = createTheme({ ...@@ -47,6 +47,10 @@ const theme = createTheme({
"&.MuiButton-textError": { "&.MuiButton-textError": {
color: "rgba(255, 78, 78, 1)", color: "rgba(255, 78, 78, 1)",
}, },
"&.MuiButton-outlinedError": {
color: "rgba(255, 78, 78, 1)",
border: "1px solid rgba(255, 78, 78, 1)",
},
}, },
contained: { contained: {
backgroundColor: "#1370FF", backgroundColor: "#1370FF",
...@@ -60,6 +64,9 @@ const theme = createTheme({ ...@@ -60,6 +64,9 @@ const theme = createTheme({
boxShadow: "none !important", boxShadow: "none !important",
color: "#1370FF", color: "#1370FF",
"&:hover": { backgroundColor: "#ECF4FF " }, "&:hover": { backgroundColor: "#ECF4FF " },
"&.MuiButton-textError": {
color: "rgba(255, 78, 78, 1)",
},
}, },
text: { text: {
backgroundColor: "transparent", backgroundColor: "transparent",
......
...@@ -8,7 +8,7 @@ import { ...@@ -8,7 +8,7 @@ import {
} from "@mui/material"; } from "@mui/material";
import CloseIcon from "@mui/icons-material/Close"; import CloseIcon from "@mui/icons-material/Close";
import MyButton from './MyButton' import MyButton from "./MyButton";
export interface IDialogProps { export interface IDialogProps {
/** 自定义类名 */ /** 自定义类名 */
...@@ -84,7 +84,12 @@ const MyDialog: React.FunctionComponent<IDialogProps> = (props) => { ...@@ -84,7 +84,12 @@ const MyDialog: React.FunctionComponent<IDialogProps> = (props) => {
) : ( ) : (
<DialogActions style={{ padding: "0 24px 24px 24px" }}> <DialogActions style={{ padding: "0 24px 24px 24px" }}>
{showCancel ? ( {showCancel ? (
<MyButton text={cancelText || "取消"} onClick={onClose} variant="outlined" size="small" /> <MyButton
text={cancelText || "取消"}
onClick={onClose}
variant="outlined"
size="small"
/>
) : null} ) : null}
{showConfirm ? ( {showConfirm ? (
<MyButton <MyButton
...@@ -123,6 +128,7 @@ const MyDialog: React.FunctionComponent<IDialogProps> = (props) => { ...@@ -123,6 +128,7 @@ const MyDialog: React.FunctionComponent<IDialogProps> = (props) => {
display: "flex", display: "flex",
justifyContent: "space-between", justifyContent: "space-between",
alignItems: "center", alignItems: "center",
fontWeight: 600,
}} }}
> >
<span>{title}</span> <span>{title}</span>
......
...@@ -20,7 +20,7 @@ interface MyInputProps extends Omit<TextFieldProps, "value"> { ...@@ -20,7 +20,7 @@ interface MyInputProps extends Omit<TextFieldProps, "value"> {
const MyInput = (props: MyInputProps) => { const MyInput = (props: MyInputProps) => {
const { const {
size = "small", size = "medium",
placeholder = "请输入", placeholder = "请输入",
fullWidth = true, fullWidth = true,
error = false, error = false,
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
import InputLabel from "@mui/material/InputLabel"; import InputLabel from "@mui/material/InputLabel";
import MenuItem from "@mui/material/MenuItem"; import MenuItem from "@mui/material/MenuItem";
import FormControl from "@mui/material/FormControl"; import FormControl from "@mui/material/FormControl";
import FormHelperText from "@mui/material/FormHelperText";
import Select, { SelectChangeEvent, SelectProps } from "@mui/material/Select"; import Select, { SelectChangeEvent, SelectProps } from "@mui/material/Select";
import { createTheme, ThemeProvider } from "@mui/material"; import { createTheme, ThemeProvider } from "@mui/material";
...@@ -44,6 +45,10 @@ interface IProps ...@@ -44,6 +45,10 @@ interface IProps
title?: string; title?: string;
/** 是否显示title */ /** 是否显示title */
isTitle?: boolean; isTitle?: boolean;
/** 是否显示提示文案 */
error?: boolean;
/** 提示文案 */
helpertext?: string;
} }
export default function MySelect(props: IProps) { export default function MySelect(props: IProps) {
const { const {
...@@ -55,6 +60,8 @@ export default function MySelect(props: IProps) { ...@@ -55,6 +60,8 @@ export default function MySelect(props: IProps) {
multiple = false, multiple = false,
onChange, onChange,
fullWidth, fullWidth,
error = false,
helpertext,
...other ...other
} = props; } = props;
...@@ -151,6 +158,7 @@ export default function MySelect(props: IProps) { ...@@ -151,6 +158,7 @@ export default function MySelect(props: IProps) {
}) })
: null} : null}
</Select> </Select>
{helpertext && error && <FormHelperText>{helpertext}</FormHelperText>}
</FormControl> </FormControl>
</ThemeProvider> </ThemeProvider>
); );
......
...@@ -7,6 +7,7 @@ import { useMessage } from "@/components/MySnackbar"; ...@@ -7,6 +7,7 @@ import { useMessage } from "@/components/MySnackbar";
import CloudEController from "@/api/fileserver/CloudEController"; import CloudEController from "@/api/fileserver/CloudEController";
import usePass from "@/hooks/usePass"; import usePass from "@/hooks/usePass";
import InputAdornment from "@mui/material/InputAdornment"; import InputAdornment from "@mui/material/InputAdornment";
import MyInput from "@/components/mui/MyInput";
import MyButton from "@/components/mui/MyButton"; import MyButton from "@/components/mui/MyButton";
type IAddFolderProps = { type IAddFolderProps = {
...@@ -93,7 +94,7 @@ const AddFolder = (props: IAddFolderProps) => { ...@@ -93,7 +94,7 @@ const AddFolder = (props: IAddFolderProps) => {
return ( return (
<> <>
<MyButton <MyButton
text='新建文件夹' text="新建文件夹"
variant="outlined" variant="outlined"
size="small" size="small"
onClick={() => setDeleteDialogOpen(true)} onClick={() => setDeleteDialogOpen(true)}
...@@ -108,11 +109,10 @@ const AddFolder = (props: IAddFolderProps) => { ...@@ -108,11 +109,10 @@ const AddFolder = (props: IAddFolderProps) => {
onConfirm={handleAddSubmit} onConfirm={handleAddSubmit}
title="新建文件夹" title="新建文件夹"
> >
<TextField <div style={{ padding: "12px 0" }}>
<MyInput
sx={{ sx={{
width: "388px", width: "388px",
border: "1px solide #E6E8EB",
marginTop: "12px",
}} }}
required required
error={fileNameCheck.error} error={fileNameCheck.error}
...@@ -129,8 +129,9 @@ const AddFolder = (props: IAddFolderProps) => { ...@@ -129,8 +129,9 @@ const AddFolder = (props: IAddFolderProps) => {
</InputAdornment> </InputAdornment>
), ),
}} }}
size="small" size="medium"
/> />
</div>
</MyDialog> </MyDialog>
</> </>
); );
......
...@@ -370,9 +370,9 @@ const ProjectData = observer(() => { ...@@ -370,9 +370,9 @@ const ProjectData = observer(() => {
text="下载" text="下载"
style={{ style={{
position: "relative", position: "relative",
left: "-16px", left: "-10px",
minWidth: "10px", minWidth: "10px",
marginRight: "10px", padding: "0 10px",
visibility: visibility:
item.type !== "dataSet" && item.type !== "directory" item.type !== "dataSet" && item.type !== "directory"
? "visible" ? "visible"
...@@ -388,9 +388,9 @@ const ProjectData = observer(() => { ...@@ -388,9 +388,9 @@ const ProjectData = observer(() => {
text="移动至" text="移动至"
style={{ style={{
position: "relative", position: "relative",
left: "-16px", left: "-10px",
minWidth: "10px", minWidth: "10px",
marginRight: "10px", padding: "0 10px",
}} }}
variant="text" variant="text"
size="medium" size="medium"
...@@ -407,9 +407,9 @@ const ProjectData = observer(() => { ...@@ -407,9 +407,9 @@ const ProjectData = observer(() => {
text="删除" text="删除"
style={{ style={{
position: "relative", position: "relative",
left: "-16px", left: "-10px",
minWidth: "10px", minWidth: "10px",
marginRight: "10px", padding: "0 10px",
}} }}
variant="text" variant="text"
size="medium" size="medium"
...@@ -541,6 +541,7 @@ const ProjectData = observer(() => { ...@@ -541,6 +541,7 @@ const ProjectData = observer(() => {
value={keyWord} value={keyWord}
required required
size="small" size="small"
// size="medium"
placeholder="输入关键词搜索" placeholder="输入关键词搜索"
onChange={handleKeyWordChange} onChange={handleKeyWordChange}
onKeyUp={handleKeyWordChangeKeyUp} onKeyUp={handleKeyWordChangeKeyUp}
...@@ -549,13 +550,11 @@ const ProjectData = observer(() => { ...@@ -549,13 +550,11 @@ const ProjectData = observer(() => {
<SearchIcon <SearchIcon
className={style.searchIcon} className={style.searchIcon}
style={{ style={{
color: "#999", color: "rgba(153, 153, 153, 1)",
cursor: "pointer",
fontSize: "22px", fontSize: "22px",
position: "relative", position: "relative",
left: "4px", left: "4px",
}} }}
onClick={handleRefresh}
/> />
), ),
}} }}
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
line-height: 22px; line-height: 22px;
font-size: 14px; font-size: 14px;
color: rgba(30, 38, 51, 1); color: rgba(30, 38, 51, 1);
font-weight: 600; font-weight: 700;
} }
.swContent { .swContent {
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
font-size: 14px; font-size: 14px;
} }
.outputLiLeftImg { .outputLiLeftImg {
margin-right: 15px; margin-right: 12px;
} }
.outputLiRight { .outputLiRight {
color: rgba(138, 144, 153, 1); color: rgba(138, 144, 153, 1);
......
...@@ -7,12 +7,11 @@ import MyInput from "@/components/mui/MyInput"; ...@@ -7,12 +7,11 @@ import MyInput from "@/components/mui/MyInput";
import FileSelect, { import FileSelect, {
FileSelectType, FileSelectType,
} from "@/components/BusinessComponents/FileSelect"; } from "@/components/BusinessComponents/FileSelect";
import MySelect, { optionsTransform } from "../components/MySelect"; import MySelect from "@/components/mui/MySelect";
import MyCheckBox from "@/components/mui/MyCheckBox"; import MyCheckBox from "@/components/mui/MyCheckBox";
import MyRadio from "@/components/mui/MyRadio"; import MyRadio from "@/components/mui/MyRadio";
import { getCheckResult } from "../util"; import { getCheckResult } from "../util";
import fileSelectIcon from "@/assets/project/fileSelect.svg"; import fileSelectIcon from "@/assets/project/fileSelect.svg";
import questionMark from "@/assets/project/questionMark.svg";
import tipsIcon from "@/assets/project/tipsIcon.svg"; import tipsIcon from "@/assets/project/tipsIcon.svg";
import jobSueIcon from "@/assets/project/jobSue.svg"; import jobSueIcon from "@/assets/project/jobSue.svg";
import { IParameter } from "../interface"; import { IParameter } from "../interface";
...@@ -214,6 +213,7 @@ const ConfigForm = (props: ConfigFormProps) => { ...@@ -214,6 +213,7 @@ const ConfigForm = (props: ConfigFormProps) => {
{parameter.classTypeName} {parameter.classTypeName}
</span> </span>
</div> </div>
<MyTooltip title={parameter.description} placement="right">
<div className={styles.parameterContent}> <div className={styles.parameterContent}>
{parameter.domType.toLowerCase() === "file" && ( {parameter.domType.toLowerCase() === "file" && (
<MyInput <MyInput
...@@ -236,6 +236,7 @@ const ConfigForm = (props: ConfigFormProps) => { ...@@ -236,6 +236,7 @@ const ConfigForm = (props: ConfigFormProps) => {
placeholder="请选择" placeholder="请选择"
error={parameter.error || false} error={parameter.error || false}
helperText={parameter.helperText} helperText={parameter.helperText}
size="medium"
></MyInput> ></MyInput>
)} )}
{parameter.domType.toLowerCase() === "path" && ( {parameter.domType.toLowerCase() === "path" && (
...@@ -259,6 +260,7 @@ const ConfigForm = (props: ConfigFormProps) => { ...@@ -259,6 +260,7 @@ const ConfigForm = (props: ConfigFormProps) => {
placeholder="请选择" placeholder="请选择"
error={parameter.error || false} error={parameter.error || false}
helperText={parameter.helperText} helperText={parameter.helperText}
size="medium"
></MyInput> ></MyInput>
)} )}
{parameter.domType.toLowerCase() === "dataset" && ( {parameter.domType.toLowerCase() === "dataset" && (
...@@ -282,6 +284,7 @@ const ConfigForm = (props: ConfigFormProps) => { ...@@ -282,6 +284,7 @@ const ConfigForm = (props: ConfigFormProps) => {
placeholder="请选择" placeholder="请选择"
error={parameter.error || false} error={parameter.error || false}
helperText={parameter.helperText} helperText={parameter.helperText}
size="medium"
></MyInput> ></MyInput>
)} )}
{parameter.domType.toLowerCase() === "input" && ( {parameter.domType.toLowerCase() === "input" && (
...@@ -298,6 +301,7 @@ const ConfigForm = (props: ConfigFormProps) => { ...@@ -298,6 +301,7 @@ const ConfigForm = (props: ConfigFormProps) => {
placeholder="请输入" placeholder="请输入"
error={parameter.error || false} error={parameter.error || false}
helperText={parameter.helperText} helperText={parameter.helperText}
size="medium"
></MyInput> ></MyInput>
)} )}
{parameter.domType.toLowerCase() === "select" && ( {parameter.domType.toLowerCase() === "select" && (
...@@ -310,7 +314,8 @@ const ConfigForm = (props: ConfigFormProps) => { ...@@ -310,7 +314,8 @@ const ConfigForm = (props: ConfigFormProps) => {
} }
error={parameter.error || false} error={parameter.error || false}
helpertext={parameter.helperText} helpertext={parameter.helperText}
options={optionsTransform(parameter?.choices || [], "label")} options={parameter?.choices || []}
fullWidth
></MySelect> ></MySelect>
)} )}
{parameter.domType.toLowerCase() === "multipleselect" && ( {parameter.domType.toLowerCase() === "multipleselect" && (
...@@ -324,7 +329,8 @@ const ConfigForm = (props: ConfigFormProps) => { ...@@ -324,7 +329,8 @@ const ConfigForm = (props: ConfigFormProps) => {
multiple={true} multiple={true}
error={parameter.error || false} error={parameter.error || false}
helpertext={parameter.helperText} helpertext={parameter.helperText}
options={optionsTransform(parameter.choices, "label")} options={parameter?.choices || []}
fullWidth
></MySelect> ></MySelect>
)} )}
{parameter.domType.toLowerCase() === "radio" && ( {parameter.domType.toLowerCase() === "radio" && (
...@@ -335,7 +341,7 @@ const ConfigForm = (props: ConfigFormProps) => { ...@@ -335,7 +341,7 @@ const ConfigForm = (props: ConfigFormProps) => {
} }
onFocus={() => setSelectedBatchNodeId(batchId || "")} onFocus={() => setSelectedBatchNodeId(batchId || "")}
onBlur={() => setSelectedBatchNodeId("")} onBlur={() => setSelectedBatchNodeId("")}
options={optionsTransform(parameter.choices, "label")} options={parameter?.choices || []}
error={parameter.error || false} error={parameter.error || false}
helperText={parameter.helperText} helperText={parameter.helperText}
></MyRadio> ></MyRadio>
...@@ -354,23 +360,15 @@ const ConfigForm = (props: ConfigFormProps) => { ...@@ -354,23 +360,15 @@ const ConfigForm = (props: ConfigFormProps) => {
parameter.name || "" parameter.name || ""
) )
} }
options={optionsTransform(parameter.choices, "label")} options={parameter?.choices || []}
onFocus={() => setSelectedBatchNodeId(batchId || "")} onFocus={() => setSelectedBatchNodeId(batchId || "")}
onBlur={() => setSelectedBatchNodeId("")} onBlur={() => setSelectedBatchNodeId("")}
error={parameter.error || false} error={parameter.error || false}
helperText={parameter.helperText} helperText={parameter.helperText}
/> />
)} )}
{parameter.description && (
<MyTooltip title={parameter.description} placement="top">
<img
className={styles.parameterDesc}
src={questionMark}
alt=""
/>
</MyTooltip>
)}
</div> </div>
</MyTooltip>
</div> </div>
); );
}); });
......
...@@ -85,7 +85,7 @@ export type IValidator = { ...@@ -85,7 +85,7 @@ export type IValidator = {
export interface IChoice { export interface IChoice {
label: string; label: string;
value: boolean | string | number; value: string;
} }
export interface IEdge { export interface IEdge {
......
...@@ -9,9 +9,10 @@ import { ...@@ -9,9 +9,10 @@ import {
import noTemplate from "@/assets/project/noTemplate.svg"; import noTemplate from "@/assets/project/noTemplate.svg";
import MyInput from "@/components/mui/MyInput"; import MyInput from "@/components/mui/MyInput";
import MyCheckBox from "@/components/mui/MyCheckBox"; import MyCheckBox from "@/components/mui/MyCheckBox";
import MySelect, { // import MySelect, {
optionsTransform, // optionsTransform,
} from "../../../Project/ProjectSubmitWork/components/MySelect"; // } from "../../../Project/ProjectSubmitWork/components/MySelect";
import MySelect from "@/components/mui/MySelect";
import FileSelect, { import FileSelect, {
FileSelectType, FileSelectType,
} from "@/components/BusinessComponents/FileSelect"; } from "@/components/BusinessComponents/FileSelect";
...@@ -397,7 +398,7 @@ const ParameterSetting = (props: IParameterSettingProps) => { ...@@ -397,7 +398,7 @@ const ParameterSetting = (props: IParameterSettingProps) => {
const renderInput = useCallback( const renderInput = useCallback(
(parameter: IParameter) => { (parameter: IParameter) => {
return ( return (
<MyTooltip title={parameter.description} placement="top"> <MyTooltip title={parameter.description} placement="right">
<div> <div>
{parameter.domType.toLowerCase() === "file" && ( {parameter.domType.toLowerCase() === "file" && (
<MyInput <MyInput
...@@ -494,7 +495,7 @@ const ParameterSetting = (props: IParameterSettingProps) => { ...@@ -494,7 +495,7 @@ const ParameterSetting = (props: IParameterSettingProps) => {
} }
error={parameter.error || false} error={parameter.error || false}
helpertext={parameter.helperText} helpertext={parameter.helperText}
options={optionsTransform(parameter?.choices || [], "label")} options={parameter?.choices || []}
disabled={parameter.parameterGroup === "out"} disabled={parameter.parameterGroup === "out"}
></MySelect> ></MySelect>
)} )}
...@@ -507,7 +508,7 @@ const ParameterSetting = (props: IParameterSettingProps) => { ...@@ -507,7 +508,7 @@ const ParameterSetting = (props: IParameterSettingProps) => {
multiple={true} multiple={true}
error={parameter.error || false} error={parameter.error || false}
helpertext={parameter.helperText} helpertext={parameter.helperText}
options={optionsTransform(parameter.choices, "label")} options={parameter?.choices || []}
disabled={parameter.parameterGroup === "out"} disabled={parameter.parameterGroup === "out"}
></MySelect> ></MySelect>
)} )}
...@@ -517,7 +518,7 @@ const ParameterSetting = (props: IParameterSettingProps) => { ...@@ -517,7 +518,7 @@ const ParameterSetting = (props: IParameterSettingProps) => {
onChange={(e: any) => onChange={(e: any) =>
handleParameterChange(e, parameter.name || "") handleParameterChange(e, parameter.name || "")
} }
options={optionsTransform(parameter.choices, "label")} options={parameter?.choices || []}
error={parameter.error || false} error={parameter.error || false}
helperText={parameter.helperText} helperText={parameter.helperText}
></MyRadio> ></MyRadio>
...@@ -535,7 +536,7 @@ const ParameterSetting = (props: IParameterSettingProps) => { ...@@ -535,7 +536,7 @@ const ParameterSetting = (props: IParameterSettingProps) => {
parameter.name || "" parameter.name || ""
) )
} }
options={optionsTransform(parameter.choices, "label")} options={parameter?.choices || []}
error={parameter.error || false} error={parameter.error || false}
helperText={parameter.helperText} helperText={parameter.helperText}
></MyCheckBox> ></MyCheckBox>
......
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