Commit 41da8b2d authored by chenshouchao's avatar chenshouchao

feat: 新增按钮样式的单选组组件

parent 92ced994
.RadiosBox {
display: flex;
justify-content: space-between;
align-items: center;
border: 1px solid #e6e8eb;
border-radius: 4px;
background-color: #e6e8eb;
cursor: pointer;
height: 32px;
box-sizing: border-box;
padding: 2px;
}
.radio {
height: 28px;
box-sizing: border-box;
font-size: 14px;
color: #565c66;
border-radius: 4px;
line-height: 20px;
padding: 3px 18px;
background-color: #e6e8eb;
display: flex;
align-items: center;
}
.radioActive {
color: #1370ff;
background-color: #fff;
border: 1px solid #e6e8eb;
}
// 按钮样式的单选组
import classnames from "classnames";
import style from "./index.module.css";
type radioOption = {
value: string;
label: string;
};
type IRadioGroupOfButtonStyleProps = {
radioOptions: Array<radioOption>;
value: string;
handleRadio: any;
};
const RadioGroupOfButtonStyle = (props: IRadioGroupOfButtonStyleProps) => {
const { radioOptions, value, handleRadio } = props;
return (
<div className={style.RadiosBox}>
{radioOptions.map((options) => {
return (
<div
key={options.value}
className={classnames({
[style.radio]: true,
[style.radioActive]: value === options.value,
})}
onClick={() => handleRadio(options.value)}
>
{options.label}
</div>
);
})}
</div>
);
};
export default RadioGroupOfButtonStyle;
...@@ -30,7 +30,6 @@ import MyPopconfirm from "@/components/mui/MyPopconfirm"; ...@@ -30,7 +30,6 @@ import MyPopconfirm from "@/components/mui/MyPopconfirm";
import styles from "./index.module.css"; import styles from "./index.module.css";
const ProjectSubmitWork = () => { const ProjectSubmitWork = () => {
const Message = useMessage(); const Message = useMessage();
const { currentProjectStore } = useStores(); const { currentProjectStore } = useStores();
...@@ -67,7 +66,14 @@ const ProjectSubmitWork = () => { ...@@ -67,7 +66,14 @@ const ProjectSubmitWork = () => {
task.parameters.forEach((parameter) => { task.parameters.forEach((parameter) => {
let value: any = undefined; let value: any = undefined;
if (parameter.defaultValue) { if (parameter.defaultValue) {
value = parameter.defaultValue; if (
parameter.domType.toLowerCase() === "multipleselect" ||
parameter.domType.toLowerCase() === "checkbox"
) {
value = parameter.defaultValue.split(",");
} else {
value = parameter.defaultValue;
}
} else if ( } else if (
parameter.domType.toLowerCase() === "multipleselect" || parameter.domType.toLowerCase() === "multipleselect" ||
parameter.domType.toLowerCase() === "checkbox" parameter.domType.toLowerCase() === "checkbox"
...@@ -192,71 +198,78 @@ const ProjectSubmitWork = () => { ...@@ -192,71 +198,78 @@ const ProjectSubmitWork = () => {
return ( return (
<div className={styles.swBox}> <div className={styles.swBox}>
{ fullScreenShow ? null : <div className={styles.swHeader}> {fullScreenShow ? null : (
<div className={styles.swHeaderLeft}> <div className={styles.swHeader}>
<MyPopconfirm <div className={styles.swHeaderLeft}>
title="返回后,当前页面已填写内容将不保存,确认返回吗?" <MyPopconfirm
onConfirm={handleGoBack} title="返回后,当前页面已填写内容将不保存,确认返回吗?"
> onConfirm={handleGoBack}
<IconButton
color="primary"
// onClick={() => handleGoBack()}
aria-label="upload picture"
component="span"
size="small"
> >
<ArrowBackIosNewIcon <IconButton
sx={{ color="primary"
color: "rgba(194, 198, 204, 1)", // onClick={() => handleGoBack()}
width: "12px", aria-label="upload picture"
height: "12px", component="span"
}} size="small"
/> >
</IconButton> <ArrowBackIosNewIcon
</MyPopconfirm> sx={{
color: "rgba(194, 198, 204, 1)",
width: "12px",
height: "12px",
}}
/>
</IconButton>
</MyPopconfirm>
<div className={styles.swTemplateTitle}> <div className={styles.swTemplateTitle}>
{templateConfigInfo?.title} {templateConfigInfo?.title}
</div>
<div className={styles.swTemplateVersionBox}>
<span className={styles.swHeaderLable}>版本:</span>
<span className={styles.swHeaderValue}>
{templateConfigInfo?.languageVersion}
</span>
</div>
<div className={styles.swTemplateUpdateTimeBox}>
<span className={styles.swHeaderLable}>更新时间:</span>
<span className={styles.swHeaderValue}>
{templateConfigInfo?.updateTime
? moment(templateConfigInfo?.updateTime).format(
"YYYY-MM-DD HH:mm:ss"
)
: "-"}
</span>
</div>
<div className={styles.swHeaderGoback}></div>
</div> </div>
<div className={styles.swTemplateVersionBox}> <div className={styles.swHeaderRight}>
<span className={styles.swHeaderLable}>版本:</span> <MyPopconfirm
<span className={styles.swHeaderValue}> title="提交前请先确认参数填写无误,确认提交吗?"
{templateConfigInfo?.languageVersion} onConfirm={handleSubmitForm}
</span> >
</div> <ButtonComponent
<div className={styles.swTemplateUpdateTimeBox}> text="提交任务"
<span className={styles.swHeaderLable}>更新时间:</span> // click={handleSubmitForm}
<span className={styles.swHeaderValue}> ></ButtonComponent>
{templateConfigInfo?.updateTime </MyPopconfirm>
? moment(templateConfigInfo?.updateTime).format(
"YYYY-MM-DD HH:mm:ss"
)
: "-"}
</span>
</div> </div>
<div className={styles.swHeaderGoback}></div>
</div> </div>
<div className={styles.swHeaderRight}> )}
<MyPopconfirm
title="提交前请先确认参数填写无误,确认提交吗?"
onConfirm={handleSubmitForm}
>
<ButtonComponent
text="提交任务"
// click={handleSubmitForm}
></ButtonComponent>
</MyPopconfirm>
</div>
</div>}
<div className={styles.swContent}> <div className={styles.swContent}>
{fullScreenShow ? null : <div className={styles.swFormBox}> {fullScreenShow ? null : (
<ConfigForm <div className={styles.swFormBox}>
onRef={configFormRef} <ConfigForm
templateConfigInfo={templateConfigInfo} onRef={configFormRef}
setParameter={setParameter} templateConfigInfo={templateConfigInfo}
/> setParameter={setParameter}
</div>} />
<div className={styles.swFlowBox} style={fullScreenShow ? { height: "100vh" } : undefined}> </div>
)}
<div
className={styles.swFlowBox}
style={fullScreenShow ? { height: "100vh" } : undefined}
>
<WorkFlow templateConfigInfo={templateConfigInfo} /> <WorkFlow templateConfigInfo={templateConfigInfo} />
</div> </div>
</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