Commit d9f215a3 authored by chenshouchao's avatar chenshouchao

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

parents c602505a 94e1a524
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com * @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-05-31 10:18:13 * @Date: 2022-05-31 10:18:13
* @LastEditors: 吴永生 15770852798@163.com * @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-08-30 18:26:23 * @LastEditTime: 2022-08-30 18:42:45
* @FilePath: /bkunyun/src/views/Project/ProjectSetting/index.tsx * @FilePath: /bkunyun/src/views/Project/ProjectSetting/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
*/ */
......
...@@ -511,7 +511,7 @@ const ConfigForm = (props: ConfigFormProps) => { ...@@ -511,7 +511,7 @@ const ConfigForm = (props: ConfigFormProps) => {
return null; return null;
} }
return ( return (
<div className={styles.flowConfigBox} key={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 && (
......
...@@ -177,13 +177,13 @@ const AddProject = (props: IAddProjectProps) => { ...@@ -177,13 +177,13 @@ const AddProject = (props: IAddProjectProps) => {
title="新建项目" title="新建项目"
loading={loading} loading={loading}
> >
<div className={style.formBox} onClick={handleFromBox}> <div className={style.formBox} onClick={handleFromBox}>
<MyInput <MyInput
required required
error={nameCheck.error} error={nameCheck.error}
id="name" // id="name"
label="项目名称" label="项目名称"
variant="outlined"
value={name} value={name}
onChange={handleNameChange} onChange={handleNameChange}
helperText={nameCheck.help} helperText={nameCheck.help}
......
/*
* @Author: 吴永生 15770852798@163.com
* @Date: 2022-08-26 19:13:55
* @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-08-30 19:26:16
* @FilePath: /bkunyun/src/views/Project/components/CurrentProject/index.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import logo from "@/assets/project/projectIcon.svg"; import logo from "@/assets/project/projectIcon.svg";
import style from "./index.module.css"; import style from "./index.module.css";
import ArrowForwardIosIcon from "@mui/icons-material/ArrowForwardIos"; import ArrowForwardIosIcon from "@mui/icons-material/ArrowForwardIos";
import { Popper, Fade } from "@mui/material"; import { Popper, Fade } from "@mui/material";
import { useStores } from "@/store/index"; import { useStores } from "@/store/index";
import ProjectListPopper from "../ProjectListPopper"; import ProjectListPopper from "../ProjectListPopper";
import React, { useEffect, useState } from "react"; import React, { useState } from "react";
import { observer } from "mobx-react-lite"; import { observer } from "mobx-react-lite";
import AddProject from "../AddProject"; import AddProject from "../AddProject";
import { import {
...@@ -17,17 +25,6 @@ const CurrentProject = observer(() => { ...@@ -17,17 +25,6 @@ const CurrentProject = observer(() => {
const [projectListOpen, setProjectListOpen] = useState(false); const [projectListOpen, setProjectListOpen] = useState(false);
const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null); const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);
useEffect(() => {
document.addEventListener("click", (e) => {
setProjectListOpen(false);
});
return () => {
document.removeEventListener("click", (e) => {
setProjectListOpen(false);
});
};
}, []);
const handleShowProjectList = (event: React.MouseEvent<HTMLElement>) => { const handleShowProjectList = (event: React.MouseEvent<HTMLElement>) => {
event.nativeEvent.stopImmediatePropagation(); event.nativeEvent.stopImmediatePropagation();
setAnchorEl(event.currentTarget); setAnchorEl(event.currentTarget);
......
...@@ -406,14 +406,12 @@ const Flow = (props: IProps) => { ...@@ -406,14 +406,12 @@ const Flow = (props: IProps) => {
const onNodeClick = (e: any, node: Node) => { const onNodeClick = (e: any, node: Node) => {
tasks?.forEach((item) => { tasks?.forEach((item) => {
if (item.id === node.id) { if (item.id === node.id) {
if (item.type === "BATCH") { if (item.type !== "BATCH") {
setNodeIdFun(node.id);
} else {
setInSideFlowNodeId(node.id); setInSideFlowNodeId(node.id);
setInSideBatchNodeId(""); setInSideBatchNodeId("");
setSelectedBatchNodeId && setSelectedBatchNodeId(""); setSelectedBatchNodeId && setSelectedBatchNodeId("");
} }
setNodeIdFun(node.id);
} }
}); });
if (onFlowNodeClick) { if (onFlowNodeClick) {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 吴永生 15770852798@163.com * @Author: 吴永生 15770852798@163.com
* @Date: 2022-08-02 11:43:28 * @Date: 2022-08-02 11:43:28
* @LastEditors: 吴永生 15770852798@163.com * @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-08-11 18:50:31 * @LastEditTime: 2022-08-30 19:32:05
* @FilePath: /bkunyun/src/views/Project/components/ProjectListPopper/index.tsx * @FilePath: /bkunyun/src/views/Project/components/ProjectListPopper/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
*/ */
...@@ -14,7 +14,8 @@ import AddIcon from "@mui/icons-material/Add"; ...@@ -14,7 +14,8 @@ import AddIcon from "@mui/icons-material/Add";
import classNames from "classnames"; import classNames from "classnames";
import { useStores } from "@/store/index"; import { useStores } from "@/store/index";
import moment from "moment"; import moment from "moment";
import React, { useMemo, useState } from "react"; import React, { useMemo, useState } from "react";
import { useClickAway } from 'ahooks';
import { toJS } from "mobx"; import { toJS } from "mobx";
import { observer } from "mobx-react-lite"; import { observer } from "mobx-react-lite";
...@@ -38,12 +39,18 @@ const ProjectListPopper = observer((props: any) => { ...@@ -38,12 +39,18 @@ const ProjectListPopper = observer((props: any) => {
const handleProjectBox = (e: React.SyntheticEvent) => { const handleProjectBox = (e: React.SyntheticEvent) => {
setProjectListOpen(false); setProjectListOpen(false);
e.nativeEvent.stopImmediatePropagation();
}; };
useClickAway(
() => {
setProjectListOpen(false);
},
() => document.getElementById('use-click-projectList-mainBox'),
);
return ( return (
<div className={style.projectBox} onClick={handleProjectBox}> <div className={style.projectBox} onClick={handleProjectBox}>
<div className={style.mainBox}> <div className={style.mainBox} id="use-click-projectList-mainBox" onClick={(e: any)=>e.stopPropagation()}>
<div className={style.searchBox}> <div className={style.searchBox}>
<IconButton <IconButton
type="submit" type="submit"
......
import _ from "lodash"; import _ from "lodash";
import { useCallback, useEffect, useMemo, useState } from "react"; import { useCallback, useMemo, useRef, useState } from "react";
import classNames from "classnames"; import classNames from "classnames";
import { import {
...@@ -20,6 +20,7 @@ import MySwitch from "@/components/mui/MySwitch"; ...@@ -20,6 +20,7 @@ import MySwitch from "@/components/mui/MySwitch";
import Tabs from "@/components/mui/Tabs"; import Tabs from "@/components/mui/Tabs";
import { getCustomTemplateParameterCheckResult } from "../../util"; import { getCustomTemplateParameterCheckResult } from "../../util";
import MyTooltip from "@/components/mui/MyTooltip"; import MyTooltip from "@/components/mui/MyTooltip";
import { useSize } from "ahooks";
import styles from "./index.module.css"; import styles from "./index.module.css";
...@@ -30,18 +31,13 @@ type IParameterSettingProps = { ...@@ -30,18 +31,13 @@ type IParameterSettingProps = {
}; };
const ParameterSetting = (props: IParameterSettingProps) => { const ParameterSetting = (props: IParameterSettingProps) => {
const { templateConfigInfo, setTemplateConfigInfo, taskId } = props; // 算子大数组 const { templateConfigInfo, setTemplateConfigInfo, taskId } = props; // 算子大数组
const [descHeight, setDescHeight] = useState(0); // 算子描述的高度 用来完成描述展开收起功能
const [isShowAllDese, setIsShowAllDese] = useState(false); // 是否展示全部描述 const [isShowAllDese, setIsShowAllDese] = useState(false); // 是否展示全部描述
const [fileSelectOpen, setFileSelectOpen] = useState(false); // 选择输出路径的弹窗显示控制 const [fileSelectOpen, setFileSelectOpen] = useState(false); // 选择输出路径的弹窗显示控制
const [fileSelectType, setFileSelectType] = useState<FileSelectType>("path"); const [fileSelectType, setFileSelectType] = useState<FileSelectType>("path");
const [parameterName, setParameterName] = useState(""); // 当前算子中的parameters中正在编辑饿parameter(参数) const [parameterName, setParameterName] = useState(""); // 当前算子中的parameters中正在编辑饿parameter(参数)
const resizeRef = useRef<HTMLDivElement>(null);
const div = document.getElementById("descHeight"); // 算子描述的元素(不限高)用来完成描述展开收起功能
useEffect(() => { const size = useSize(resizeRef) ;
if (div) {
setDescHeight(div.offsetHeight);
}
}, [div]);
// 文件夹路线选择器弹窗 // 文件夹路线选择器弹窗
const handleFileSelectOnClose = () => { const handleFileSelectOnClose = () => {
...@@ -525,13 +521,14 @@ const ParameterSetting = (props: IParameterSettingProps) => { ...@@ -525,13 +521,14 @@ const ParameterSetting = (props: IParameterSettingProps) => {
{taskInfo.description || "-"} {taskInfo.description || "-"}
</div> </div>
<div <div
ref={resizeRef}
className={classNames({ className={classNames({
[styles.taskDescriptionAll]: isShowAllDese, [styles.taskDescriptionAll]: isShowAllDese,
[styles.taskDescription]: !isShowAllDese, [styles.taskDescription]: !isShowAllDese,
})} })}
> >
{taskInfo.description || "-"} {taskInfo.description || "-"}
{descHeight > 60 && ( {size && size?.height >= 60 && (
<span <span
className={styles.descButton} className={styles.descButton}
onClick={() => setIsShowAllDese(!isShowAllDese)} onClick={() => setIsShowAllDese(!isShowAllDese)}
......
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