Commit 295c75d6 authored by chenshouchao's avatar chenshouchao

feat: 提交任务样式修改

parent d79b0f12
...@@ -12,6 +12,7 @@ import FormControlLabel from "@mui/material/FormControlLabel"; ...@@ -12,6 +12,7 @@ import FormControlLabel from "@mui/material/FormControlLabel";
import Checkbox from "@mui/material/Checkbox"; import Checkbox from "@mui/material/Checkbox";
import FormControl from "@mui/material/FormControl"; import FormControl from "@mui/material/FormControl";
import FormHelperText from "@mui/material/FormHelperText"; import FormHelperText from "@mui/material/FormHelperText";
import { ThemeProvider, createTheme } from "@mui/material/styles";
import _ from "lodash"; import _ from "lodash";
interface IMyCheckBoxProps extends FormGroupProps { interface IMyCheckBoxProps extends FormGroupProps {
...@@ -44,6 +45,33 @@ export const optionsTransform = ( ...@@ -44,6 +45,33 @@ export const optionsTransform = (
}); });
}; };
const theme = createTheme({
components: {
MuiFormControlLabel: {
styleOverrides: {
label: {
fontSize: "14px",
},
},
},
MuiSvgIcon: {
styleOverrides: {
root: {
fontSize: "19px",
},
},
},
MuiCheckbox: {
styleOverrides: {
colorPrimary: {
color: "rgba(209, 214, 222, 1)",
},
},
},
// MuiCheckbox-colorPrimary
},
});
export default function MyCheckBox(props: IMyCheckBoxProps) { export default function MyCheckBox(props: IMyCheckBoxProps) {
const { const {
value, value,
...@@ -76,27 +104,29 @@ export default function MyCheckBox(props: IMyCheckBoxProps) { ...@@ -76,27 +104,29 @@ export default function MyCheckBox(props: IMyCheckBoxProps) {
}; };
return ( return (
<FormControl fullWidth variant={variant} error={error}> <ThemeProvider theme={theme}>
<FormGroup {...props} row> <FormControl fullWidth variant={variant} error={error}>
{options.map((option) => { <FormGroup {...props} row>
return ( {options.map((option) => {
<FormControlLabel return (
key={option.value} <FormControlLabel
control={ key={option.value}
<Checkbox control={
checked={getCheckedStatus(option.value, value)} <Checkbox
value={option.value} checked={getCheckedStatus(option.value, value)}
/> value={option.value}
} />
label={option.label} }
name={option.value} label={option.label}
onChange={handleMyCheckBoxOnChange} name={option.value}
disabled={option.disabled} onChange={handleMyCheckBoxOnChange}
/> disabled={option.disabled}
); />
})} );
</FormGroup> })}
{helperText && error && <FormHelperText>{helperText}</FormHelperText>} </FormGroup>
</FormControl> {helperText && error && <FormHelperText>{helperText}</FormHelperText>}
</FormControl>
</ThemeProvider>
); );
} }
...@@ -12,6 +12,7 @@ import RadioGroup, { RadioGroupProps } from "@mui/material/RadioGroup"; ...@@ -12,6 +12,7 @@ import RadioGroup, { RadioGroupProps } from "@mui/material/RadioGroup";
import FormControlLabel from "@mui/material/FormControlLabel"; import FormControlLabel from "@mui/material/FormControlLabel";
import FormControl from "@mui/material/FormControl"; import FormControl from "@mui/material/FormControl";
import FormHelperText from "@mui/material/FormHelperText"; import FormHelperText from "@mui/material/FormHelperText";
import { ThemeProvider, createTheme } from "@mui/material/styles";
interface IMyRadioProps extends RadioGroupProps { interface IMyRadioProps extends RadioGroupProps {
value: any; value: any;
...@@ -44,6 +45,25 @@ export const optionsTransform = ( ...@@ -44,6 +45,25 @@ export const optionsTransform = (
}); });
}; };
const theme = createTheme({
components: {
MuiFormControlLabel: {
styleOverrides: {
label: {
fontSize: "14px",
},
},
},
MuiSvgIcon: {
styleOverrides: {
root: {
fontSize: "19px",
},
},
},
},
});
export default function MyRadio(props: IMyRadioProps) { export default function MyRadio(props: IMyRadioProps) {
const { const {
value, value,
...@@ -55,28 +75,30 @@ export default function MyRadio(props: IMyRadioProps) { ...@@ -55,28 +75,30 @@ export default function MyRadio(props: IMyRadioProps) {
} = props; } = props;
return ( return (
<FormControl fullWidth variant={variant} error={error}> <ThemeProvider theme={theme}>
<RadioGroup <FormControl fullWidth variant={variant} error={error}>
{...props} <RadioGroup
row {...props}
aria-labelledby="demo-row-radio-buttons-group-label" row
name="row-radio-buttons-group" aria-labelledby="demo-row-radio-buttons-group-label"
value={value} name="row-radio-buttons-group"
onChange={onChange} value={value}
> onChange={onChange}
{options.map((option) => { >
return ( {options.map((option) => {
<FormControlLabel return (
key={option.value} <FormControlLabel
value={option.value} key={option.value}
control={<Radio sx={{ color: "rgba(209, 214, 222, 1)" }} />} value={option.value}
label={option.label} control={<Radio sx={{ color: "rgba(209, 214, 222, 1)" }} />}
disabled={option.disabled} label={option.label}
/> disabled={option.disabled}
); />
})} );
</RadioGroup> })}
{helperText && error && <FormHelperText>{helperText}</FormHelperText>} </RadioGroup>
</FormControl> {helperText && error && <FormHelperText>{helperText}</FormHelperText>}
</FormControl>
</ThemeProvider>
); );
} }
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
} }
.taskConfigBox { .taskConfigBox {
padding: 16px 24px 4px; padding: 16px 0px 4px;
} }
.flowTitle { .flowTitle {
line-height: 16px; line-height: 16px;
...@@ -118,3 +118,13 @@ ...@@ -118,3 +118,13 @@
color: rgba(138, 144, 153, 1); color: rgba(138, 144, 153, 1);
margin-left: 16px; margin-left: 16px;
} }
.bacthConfigBox {
padding: 0 24px 0;
}
.flowConfigBox {
border-bottom: 1px solid rgba(235, 237, 240, 1);
padding: 20px 24px 12px;
}
.flowConfigBox:nth-last-child(1) {
border-bottom: none;
}
...@@ -189,10 +189,7 @@ const ConfigForm = (props: ConfigFormProps) => { ...@@ -189,10 +189,7 @@ const ConfigForm = (props: ConfigFormProps) => {
setParameter(e.target.value, taskId, parameterName); setParameter(e.target.value, taskId, parameterName);
}; };
const randerParameters = ( const randerParameters = (parameters: Array<IParameter>, taskId: string) => {
parameters: Array<IParameter>,
taskId: string,
) => {
return parameters return parameters
.filter((parameter) => parameter.hidden === false) .filter((parameter) => parameter.hidden === false)
.map((parameter, parameterIndex) => { .map((parameter, parameterIndex) => {
...@@ -495,10 +492,12 @@ const ConfigForm = (props: ConfigFormProps) => { ...@@ -495,10 +492,12 @@ const ConfigForm = (props: ConfigFormProps) => {
/> />
</div> </div>
<div className={styles.taskConfigBox}> <div className={styles.taskConfigBox}>
{randerParameters( <div className={styles.bacthConfigBox}>
task.parameters.filter((parameter) => !parameter?.thrown), {randerParameters(
task.id, task.parameters.filter((parameter) => !parameter?.thrown),
)} task.id
)}
</div>
{task.flows.map((flow) => { {task.flows.map((flow) => {
if ( if (
flow.parameters.filter( flow.parameters.filter(
...@@ -508,7 +507,11 @@ const ConfigForm = (props: ConfigFormProps) => { ...@@ -508,7 +507,11 @@ const ConfigForm = (props: ConfigFormProps) => {
return null; return null;
} }
return ( return (
<div className={styles.flowConfigBox} key={flow.id} id={`point${flow.id}`}> <div
className={styles.flowConfigBox}
key={flow.id}
id={`point${flow.id}`}
>
<div className={styles.flowTitle}> <div className={styles.flowTitle}>
{flow.title} {flow.title}
{flow.description && ( {flow.description && (
...@@ -521,10 +524,7 @@ const ConfigForm = (props: ConfigFormProps) => { ...@@ -521,10 +524,7 @@ const ConfigForm = (props: ConfigFormProps) => {
</MyTooltip> </MyTooltip>
)} )}
</div> </div>
{randerParameters( {randerParameters(flow.parameters, flow.id)}
flow.parameters,
flow.id,
)}
</div> </div>
); );
})} })}
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
top: 0; top: 0;
height: 56px; height: 56px;
background-color: #fff; background-color: #fff;
box-shadow: 0px 3px 10px 0px rgba(0, 24, 57, 0.04); box-shadow: 0px 3px 10px 0px rgba(0, 24, 57, 0.06);
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
......
...@@ -28,6 +28,7 @@ import { useMessage } from "@/components/MySnackbar"; ...@@ -28,6 +28,7 @@ import { useMessage } from "@/components/MySnackbar";
import { useStores } from "@/store"; import { useStores } from "@/store";
import { observer } from "mobx-react-lite"; import { observer } from "mobx-react-lite";
import MyPopconfirm from "@/components/mui/MyPopconfirm"; import MyPopconfirm from "@/components/mui/MyPopconfirm";
import goback from "@/assets/project/goback.svg";
import styles from "./index.module.css"; import styles from "./index.module.css";
...@@ -254,24 +255,14 @@ const ProjectSubmitWork = observer(() => { ...@@ -254,24 +255,14 @@ const ProjectSubmitWork = observer(() => {
{fullScreenShow ? null : ( {fullScreenShow ? null : (
<div className={styles.swHeader}> <div className={styles.swHeader}>
<div className={styles.swHeaderLeft}> <div className={styles.swHeaderLeft}>
<IconButton <img
color="primary" className={styles.goBackIcon}
src={goback}
alt=""
onClick={(e: any) => onClick={(e: any) =>
handleShowPopper(e, "返回将放弃当前页面所有操作,确认返回吗?") handleShowPopper(e, "返回将放弃当前页面所有操作,确认返回吗?")
} }
aria-label="upload picture" />
component="span"
size="small"
>
<ArrowBackIosNewIcon
sx={{
color: "rgba(194, 198, 204, 1)",
width: "14px",
height: "14px",
}}
/>
</IconButton>
<div className={styles.swTemplateTitle}> <div className={styles.swTemplateTitle}>
{templateConfigInfo?.title} {templateConfigInfo?.title}
</div> </div>
...@@ -294,17 +285,12 @@ const ProjectSubmitWork = observer(() => { ...@@ -294,17 +285,12 @@ const ProjectSubmitWork = observer(() => {
<div className={styles.swHeaderGoback}></div> <div className={styles.swHeaderGoback}></div>
</div> </div>
<div className={styles.swHeaderRight}> <div className={styles.swHeaderRight}>
{/* <MyPopconfirm
title="提交前请先确认参数填写无误,确认提交吗?"
onConfirm={handleSubmitForm}
> */}
<MyButton <MyButton
text="提交任务" text="提交任务"
onClick={(e: any) => onClick={(e: any) =>
handleShowPopper(e, "提交前请先确认参数填写无误,确认提交吗?") handleShowPopper(e, "提交前请先确认参数填写无误,确认提交吗?")
} }
></MyButton> ></MyButton>
{/* </MyPopconfirm> */}
</div> </div>
</div> </div>
)} )}
......
...@@ -19,9 +19,7 @@ ...@@ -19,9 +19,7 @@
.templateBox { .templateBox {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
/* max-height: calc(100vh - 276px); */
margin: 0 -8px; margin: 0 -8px;
overflow-y: overlay;
} }
.template { .template {
...@@ -41,7 +39,7 @@ ...@@ -41,7 +39,7 @@
margin-bottom: 16px; margin-bottom: 16px;
position: relative; position: relative;
box-sizing: border-box; box-sizing: border-box;
transition: box-shadow .2s cubic-bezier(0, 0, 1, 1); transition: box-shadow 0.2s cubic-bezier(0, 0, 1, 1);
} }
.templateBlock:hover { .templateBlock:hover {
box-shadow: 6px 8px 22px 0px rgba(0, 24, 57, 0.08); box-shadow: 6px 8px 22px 0px rgba(0, 24, 57, 0.08);
......
...@@ -199,27 +199,6 @@ const WorkFlowEdit = observer((props: IProps) => { ...@@ -199,27 +199,6 @@ const WorkFlowEdit = observer((props: IProps) => {
> >
<img className={styles.goBackIcon} src={goback} alt="" /> <img className={styles.goBackIcon} src={goback} alt="" />
<span className={styles.goBack}>返回</span> <span className={styles.goBack}>返回</span>
{/* <IconButton
color="primary"
aria-label="upload picture"
component="span"
size="small"
onClick={(e: any) =>
handleShowPopper(
e,
"返回后,当前页面已填写内容将不保存,确认返回吗?"
)
}
>
<ArrowBackIosNewIcon
sx={{
color: "rgba(194, 198, 204, 1)",
width: "12px",
height: "12px",
}}
/>
返回
</IconButton> */}
</div> </div>
<div className={styles.swHeaderRight}> <div className={styles.swHeaderRight}>
<MyButton text="保存" onClick={() => handlePreserve()}></MyButton> <MyButton text="保存" onClick={() => handlePreserve()}></MyButton>
......
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