Commit 5613152f authored by wuyongsheng's avatar wuyongsheng

Merge branch 'feat-20221012-environment' into 'release'

Feat 20221012 environment

See merge request !168
parents a8b40bbf 7e9b1bd1
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 吴永生 15770852798@163.com * @Author: 吴永生 15770852798@163.com
* @Date: 2022-10-19 17:09:23 * @Date: 2022-10-19 17:09:23
* @LastEditors: 吴永生 15770852798@163.com * @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-10-27 11:23:29 * @LastEditTime: 2022-10-31 11:22:34
* @FilePath: /bkunyun/src/api/resourceCenter.ts * @FilePath: /bkunyun/src/api/resourceCenter.ts
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
...@@ -118,9 +118,9 @@ const getWorkflowspecList = (params: {productId?: string, title?: string}) => { ...@@ -118,9 +118,9 @@ const getWorkflowspecList = (params: {productId?: string, title?: string}) => {
// API_WORKFLOWSPEC_LIST // API_WORKFLOWSPEC_LIST
// 新增应用环境 // 新增应用环境
const saveOperator = (params: any, isEdit: boolean) => { const saveOperator = (params: any) => {
return request({ return request({
url: `${Api.API_SAVE_OPERATOR}?isEdit=${isEdit}`, url: `${Api.API_SAVE_OPERATOR}`,
method: "post", method: "post",
data: params, data: params,
}); });
......
...@@ -15,6 +15,7 @@ import { ThemeProvider, createTheme } from "@mui/material/styles"; ...@@ -15,6 +15,7 @@ import { ThemeProvider, createTheme } from "@mui/material/styles";
import { TabContext, TabList, TabPanel } from "@mui/lab"; import { TabContext, TabList, TabPanel } from "@mui/lab";
import { Typography } from "@mui/material"; import { Typography } from "@mui/material";
import classNames from "classnames"; import classNames from "classnames";
import { useNavigate } from "react-router-dom";
import styles from "./index.module.css"; import styles from "./index.module.css";
...@@ -46,6 +47,8 @@ interface IProps { ...@@ -46,6 +47,8 @@ interface IProps {
tabPanelSx?: any; tabPanelSx?: any;
/** 是否允许空值 */ /** 是否允许空值 */
allowNullValue?: boolean; allowNullValue?: boolean;
/** 路由地址 配合navigate和MyTabs组件的defaultValue组合使用、F5刷新也可以保存激活的tab */
navigateUrl?: string;
} }
const theme = createTheme({ const theme = createTheme({
...@@ -101,8 +104,11 @@ const Tabs = (props: IProps) => { ...@@ -101,8 +104,11 @@ const Tabs = (props: IProps) => {
tabPanelSx = { padding: "20px 0 0 0" }, tabPanelSx = { padding: "20px 0 0 0" },
title, title,
titleClass, titleClass,
navigateUrl,
} = props; } = props;
const navigate = useNavigate();
const [tabValue, setTabValue] = useState( const [tabValue, setTabValue] = useState(
defaultValue defaultValue
? defaultValue ? defaultValue
...@@ -116,6 +122,10 @@ const Tabs = (props: IProps) => { ...@@ -116,6 +122,10 @@ const Tabs = (props: IProps) => {
const onTabChange = (val: string) => { const onTabChange = (val: string) => {
setTabValue(val); setTabValue(val);
onChange && onChange(val); onChange && onChange(val);
navigateUrl &&
navigate(navigateUrl, {
state: { defaultTab: val },
});
}; };
const getImgSrc = useCallback( const getImgSrc = useCallback(
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 吴永生 15770852798@163.com * @Author: 吴永生 15770852798@163.com
* @Date: 2022-10-18 16:12:55 * @Date: 2022-10-18 16:12:55
* @LastEditors: 吴永生 15770852798@163.com * @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-10-31 09:38:48 * @LastEditTime: 2022-10-31 11:23:34
* @FilePath: /bkunyun/src/views/ResourceCenter/UserResources/WorkflowOperator/components/AddOperator/index.tsx * @FilePath: /bkunyun/src/views/ResourceCenter/UserResources/WorkflowOperator/components/AddOperator/index.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
...@@ -326,7 +326,7 @@ const AddOperator = observer((props: IAddOperator) => { ...@@ -326,7 +326,7 @@ const AddOperator = observer((props: IAddOperator) => {
body: positionTransform(params?.parameters || []), body: positionTransform(params?.parameters || []),
}); });
} else { } else {
runSaveOperator(params, detailsId ? true : false); runSaveOperator(params);
} }
}, [ }, [
batchBuildType, batchBuildType,
...@@ -499,7 +499,7 @@ const AddOperator = observer((props: IAddOperator) => { ...@@ -499,7 +499,7 @@ const AddOperator = observer((props: IAddOperator) => {
style={{ style={{
position: "absolute", position: "absolute",
fontSize: "14px", fontSize: "14px",
bottom: "7px", top: "96px",
right: "12px", right: "12px",
color: color:
Number(formData?.description?.length) >= 300 Number(formData?.description?.length) >= 300
......
...@@ -79,7 +79,6 @@ const WorkflowOperator = observer(() => { ...@@ -79,7 +79,6 @@ const WorkflowOperator = observer(() => {
<div> <div>
<SearchInput <SearchInput
sx={{ width: 340, marginRight: "16px" }} sx={{ width: 340, marginRight: "16px" }}
placeholder="输入关键词搜索"
value={searchParams.keyword} value={searchParams.keyword}
onKeyUp={handleKeyWordChangeKeyUp} onKeyUp={handleKeyWordChangeKeyUp}
onChange={(e) => { onChange={(e) => {
......
...@@ -40,6 +40,7 @@ const UserResources = () => { ...@@ -40,6 +40,7 @@ const UserResources = () => {
tabList={tabList} tabList={tabList}
defaultValue={location?.state?.defaultTab || "USERRESOURCES_TEMPLATE"} defaultValue={location?.state?.defaultTab || "USERRESOURCES_TEMPLATE"}
tabPanelSx={{ padding: "0" }} tabPanelSx={{ padding: "0" }}
navigateUrl="/utility/resourceCenter/userResources"
/> />
{/* <OperatorDetails /> */} {/* <OperatorDetails /> */}
</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