From 6553a24c309e17584e5e19d71609a22d8d90ec02 Mon Sep 17 00:00:00 2001 From: wulibaibao <13366578180@163.com> Date: Fri, 10 Nov 2023 11:19:08 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0case=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 3 +-- .gitignore | 2 +- config/proxy.ts | 5 ++--- config/utils.ts | 4 +++- src/pages/Suite/components/RightContent/ExportCase.tsx | 6 ++++++ src/pages/Suite/components/RightContent/index.tsx | 1 + 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.env b/.env index e5abb4c..c88bfa8 100644 --- a/.env +++ b/.env @@ -1,2 +1 @@ -PORT=8080 -FRONT_END_STATIC_CDN_REPLACE_STRING={OPENANOLIS_TEST_LIB_TOOLS_SERVER} \ No newline at end of file +PORT=8080 \ No newline at end of file diff --git a/.gitignore b/.gitignore index b36d216..f9f9a6a 100644 --- a/.gitignore +++ b/.gitignore @@ -45,4 +45,4 @@ build /.umi-production /.umi-test /dist -/.mfsu +/.mfsu \ No newline at end of file diff --git a/config/proxy.ts b/config/proxy.ts index 7a14647..2f2de60 100644 --- a/config/proxy.ts +++ b/config/proxy.ts @@ -6,13 +6,12 @@ * For details, please see * https://pro.ant.design/docs/deploy */ - - +const { PROXY } = process.env export default { dev: { '/api/': { - target: "http://121.196.236.71:8083/", + target: PROXY, changeOrigin: true, https: true, secure: false, diff --git a/config/utils.ts b/config/utils.ts index c51e463..9cac6d9 100644 --- a/config/utils.ts +++ b/config/utils.ts @@ -1,5 +1,7 @@ -const { NODE_ENV, FRONT_END_STATIC_CDN_REPLACE_STRING } = process.env +const { NODE_ENV } = process.env + +const FRONT_END_STATIC_CDN_REPLACE_STRING = '{OPENANOLIS_TEST_LIB_TOOLS_SERVER}' export const isPro = NODE_ENV === "production" export const publicPath = `${isPro ? "/" + FRONT_END_STATIC_CDN_REPLACE_STRING : ""}/` diff --git a/src/pages/Suite/components/RightContent/ExportCase.tsx b/src/pages/Suite/components/RightContent/ExportCase.tsx index df47dfe..4341687 100644 --- a/src/pages/Suite/components/RightContent/ExportCase.tsx +++ b/src/pages/Suite/components/RightContent/ExportCase.tsx @@ -1,6 +1,7 @@ import React from "react" import { Modal, Form, Space, Button, Typography, Upload, message, UploadProps, Tooltip } from "antd" import { UploadOutlined } from "@ant-design/icons" +import { useParams } from "@/.umi/exports"; type IProps = { onOk: () => void; @@ -16,6 +17,8 @@ const accept = '.yaml,.tar' const ReactComponent: React.ForwardRefRenderFunction = (props, ref) => { const { onOk } = props + const { mod_id } = useParams() + const [visible, setVisible] = React.useState(false) const [loading, setLoading] = React.useState(false) const [fileList, setFileList] = React.useState([]) @@ -26,6 +29,9 @@ const ReactComponent: React.ForwardRefRenderFunction = (props, re accept, name: "file", maxCount: 1, + data: { + parent: mod_id + }, multiple: false, fileList, itemRender: (originNode, file, currFileList) => { diff --git a/src/pages/Suite/components/RightContent/index.tsx b/src/pages/Suite/components/RightContent/index.tsx index 011d43f..fa19dac 100644 --- a/src/pages/Suite/components/RightContent/index.tsx +++ b/src/pages/Suite/components/RightContent/index.tsx @@ -208,6 +208,7 @@ const RightContent: React.FC = () => { const paneDom = React.useRef(null) as any const paneHeight = paneDom.current?.pane1?.offsetHeight ?? 0 + return (
-- Gitee