Commit f9cb48dc authored by wuyongsheng's avatar wuyongsheng

feat: 版本提示修改

parent 862adc15
...@@ -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-11-01 11:34:04 * @LastEditTime: 2022-11-01 16:03:44
* @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
*/ */
...@@ -52,14 +52,16 @@ import style from "./index.module.css"; ...@@ -52,14 +52,16 @@ import style from "./index.module.css";
interface IAddOperator { interface IAddOperator {
pageType: string; pageType: string;
setPageType: (val: string) => void; setPageType: (val: string) => void;
detailsId: string; detailsId?: string;
detailsMaxVersion?: string;
getList: () => void; getList: () => void;
} }
type IBuildType = "ENVIRONMENT" | "OPERATOR"; type IBuildType = "ENVIRONMENT" | "OPERATOR";
const AddOperator = observer((props: IAddOperator) => { const AddOperator = observer((props: IAddOperator) => {
const { pageType, setPageType, detailsId, getList } = props; const { pageType, setPageType, detailsId, detailsMaxVersion, getList } =
props;
const Message = useMessage(); const Message = useMessage();
/** 创建类型 BATCH - 批算子; FLOW - 流算子*/ /** 创建类型 BATCH - 批算子; FLOW - 流算子*/
...@@ -155,7 +157,7 @@ const AddOperator = observer((props: IAddOperator) => { ...@@ -155,7 +157,7 @@ const AddOperator = observer((props: IAddOperator) => {
command: newCommand, command: newCommand,
} = determineInfo; } = determineInfo;
const newVersion = editDefaultVersion(version); const newVersion = editDefaultVersion(detailsMaxVersion || version);
/** 设置表单数据 */ /** 设置表单数据 */
setFormData({ setFormData({
title, title,
...@@ -276,7 +278,7 @@ const AddOperator = observer((props: IAddOperator) => { ...@@ -276,7 +278,7 @@ const AddOperator = observer((props: IAddOperator) => {
const resultErrors = checkFormData( const resultErrors = checkFormData(
formData, formData,
batchBuildType, batchBuildType,
detailInfo?.version || "0.99.99" detailInfo?.maxVersion || "0.99.99"
); );
const paramsResultError = paramsConfigBlur(); const paramsResultError = paramsConfigBlur();
setFormErrors(resultErrors); setFormErrors(resultErrors);
...@@ -432,6 +434,7 @@ const AddOperator = observer((props: IAddOperator) => { ...@@ -432,6 +434,7 @@ const AddOperator = observer((props: IAddOperator) => {
require require
> >
<MyInput <MyInput
helperText={formErrors?.version ? "" : detailsMaxVersion}
value={formData?.version} value={formData?.version}
onChange={(e) => { onChange={(e) => {
changeFormData({ version: e.target.value }); changeFormData({ version: e.target.value });
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 吴永生 15770852798@163.com * @Author: 吴永生 15770852798@163.com
* @Date: 2022-10-20 17:36:14 * @Date: 2022-10-20 17:36:14
* @LastEditors: 吴永生 15770852798@163.com * @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-11-01 11:05:39 * @LastEditTime: 2022-11-01 15:11:29
* @FilePath: /bkunyun/src/views/ResourceCenter/UserResources/WorkflowOperator/components/AddOperator/utils.ts * @FilePath: /bkunyun/src/views/ResourceCenter/UserResources/WorkflowOperator/components/AddOperator/utils.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
*/ */
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 吴永生 15770852798@163.com * @Author: 吴永生 15770852798@163.com
* @Date: 2022-10-17 14:35:11 * @Date: 2022-10-17 14:35:11
* @LastEditors: 吴永生 15770852798@163.com * @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-10-25 21:32:49 * @LastEditTime: 2022-11-01 14:45:09
* @FilePath: /bkunyun/src/views/ResourceCenter/UserResources/WorkflowOperator/index.tsx * @FilePath: /bkunyun/src/views/ResourceCenter/UserResources/WorkflowOperator/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
*/ */
...@@ -20,14 +20,24 @@ interface IProps { ...@@ -20,14 +20,24 @@ interface IProps {
operatorInfo: IOperatorInfo; operatorInfo: IOperatorInfo;
setPageType: (val: string) => void; setPageType: (val: string) => void;
setDetailsId: (val: string) => void; setDetailsId: (val: string) => void;
setDetailsMaxVersion: (val: string) => void;
} }
const OperatorCard = observer((props: IProps) => { const OperatorCard = observer((props: IProps) => {
const navigate = useNavigate(); const navigate = useNavigate();
const { const {
operatorInfo: { title = "", type, version, productId, createdTime, id }, operatorInfo: {
title = "",
type,
version,
productId,
createdTime,
id,
maxVersion = "",
},
setPageType, setPageType,
setDetailsId, setDetailsId,
setDetailsMaxVersion,
} = props; } = props;
/** 产品store */ /** 产品store */
const { productListStore } = useStores(); const { productListStore } = useStores();
...@@ -43,6 +53,7 @@ const OperatorCard = observer((props: IProps) => { ...@@ -43,6 +53,7 @@ const OperatorCard = observer((props: IProps) => {
if (val === "upgrade") { if (val === "upgrade") {
setPageType("edit"); setPageType("edit");
setDetailsId(id || ""); setDetailsId(id || "");
setDetailsMaxVersion(maxVersion);
} }
}; };
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 吴永生 15770852798@163.com * @Author: 吴永生 15770852798@163.com
* @Date: 2022-10-17 14:35:11 * @Date: 2022-10-17 14:35:11
* @LastEditors: 吴永生 15770852798@163.com * @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-10-27 10:10:08 * @LastEditTime: 2022-11-01 14:49:40
* @FilePath: /bkunyun/src/views/ResourceCenter/UserResources/WorkflowOperator/index.tsx * @FilePath: /bkunyun/src/views/ResourceCenter/UserResources/WorkflowOperator/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
*/ */
...@@ -38,7 +38,10 @@ const WorkflowOperator = observer(() => { ...@@ -38,7 +38,10 @@ const WorkflowOperator = observer(() => {
type: "all", type: "all",
}); });
/** 详情ID */
const [detailsId, setDetailsId] = useState<string>(""); const [detailsId, setDetailsId] = useState<string>("");
/** 详情最大版本 */
const [detailsMaxVersion, setDetailsMaxVersion] = useState<string>("");
const [list, setList] = useState<IOperatorInfo[]>(); const [list, setList] = useState<IOperatorInfo[]>();
...@@ -124,6 +127,7 @@ const WorkflowOperator = observer(() => { ...@@ -124,6 +127,7 @@ const WorkflowOperator = observer(() => {
onClick={() => { onClick={() => {
setPageType("add"); setPageType("add");
setDetailsId(""); setDetailsId("");
setDetailsMaxVersion("");
}} }}
></MyButton> ></MyButton>
</div> </div>
...@@ -135,6 +139,7 @@ const WorkflowOperator = observer(() => { ...@@ -135,6 +139,7 @@ const WorkflowOperator = observer(() => {
renderItem={(item: any) => ( renderItem={(item: any) => (
<OperatorCard <OperatorCard
setDetailsId={setDetailsId} setDetailsId={setDetailsId}
setDetailsMaxVersion={setDetailsMaxVersion}
operatorInfo={item} operatorInfo={item}
setPageType={setPageType} setPageType={setPageType}
/> />
...@@ -153,6 +158,7 @@ const WorkflowOperator = observer(() => { ...@@ -153,6 +158,7 @@ const WorkflowOperator = observer(() => {
<AddOperator <AddOperator
getList={newGetList} getList={newGetList}
detailsId={detailsId} detailsId={detailsId}
detailsMaxVersion={detailsMaxVersion}
setPageType={setPageType} setPageType={setPageType}
pageType={pageType} pageType={pageType}
/> />
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 吴永生 15770852798@163.com * @Author: 吴永生 15770852798@163.com
* @Date: 2022-10-19 20:50:18 * @Date: 2022-10-19 20:50:18
* @LastEditors: 吴永生 15770852798@163.com * @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-10-27 17:14:29 * @LastEditTime: 2022-11-01 14:45:41
* @FilePath: /bkunyun/src/views/ResourceCenter/UserResources/WorkflowOperator/interface.ts * @FilePath: /bkunyun/src/views/ResourceCenter/UserResources/WorkflowOperator/interface.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
*/ */
...@@ -17,6 +17,7 @@ export interface IOperatorInfo{ ...@@ -17,6 +17,7 @@ export interface IOperatorInfo{
version: string; version: string;
productId: string; productId: string;
createdTime: string; createdTime: string;
maxVersion: string
} }
export enum operatorType { export enum operatorType {
......
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