Commit de0ea244 authored by chenshouchao's avatar chenshouchao

Merge branch 'feat-20220801' of http://120.77.149.83/root/bkunyun into feat-20220801

parents 0808d488 55ec68d9
......@@ -2,7 +2,7 @@
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-05-31 10:18:13
* @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-08-30 18:42:45
* @LastEditTime: 2022-08-31 20:25:56
* @FilePath: /bkunyun/src/views/Project/ProjectSetting/index.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
......@@ -27,6 +27,8 @@ interface ITabList {
}
interface IProps {
value?: string;
onChange?: (val: string)=> void;
tabList: ITabList[];
defaultValue?: string;
tabPanelSx?: any;
......@@ -71,11 +73,14 @@ const theme = createTheme({
const Tabs = (props: IProps) => {
const {
tabList,
value,
defaultValue,
onChange,
allowNullValue = false,
tabPanelSx = { padding: "24px 0 0 0" },
} = props;
const [value, setValue] = useState(
const [tabValue, setTabValue] = useState(
defaultValue
? defaultValue
: allowNullValue
......@@ -85,8 +90,9 @@ const Tabs = (props: IProps) => {
const [hoverValue, setHoverValue] = useState('')
const onChange = (val: string) => {
setValue(val);
const onTabChange = (val: string) => {
setTabValue(val)
onChange && onChange(val);
};
const getImgSrc = useCallback((item: ITabList)=>{
......@@ -128,11 +134,11 @@ const Tabs = (props: IProps) => {
return (
<ThemeProvider theme={theme}>
<TabContext value={value}>
<TabContext value={value || tabValue}>
<Box sx={{ borderBottom: 1, borderColor: "#EDEFF2" }}>
<TabList
onChange={(e: any, val: string) => {
onChange(val);
onTabChange(val);
}}
>
{tabList
......
......@@ -647,7 +647,8 @@ const ParameterSetting = (props: IParameterSettingProps) => {
</div>
<Tabs
tabList={paramsTabList}
defaultValue={activeParamsTab}
value={activeParamsTab}
// defaultValue={activeParamsTab}
allowNullValue={true}
tabPanelSx={{ padding: "7px 0" }}
/>
......
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