From 3a62cc37ffe9bf031a8019f0201c5ec18e5b399b Mon Sep 17 00:00:00 2001 From: whyour Date: Mon, 4 Jul 2022 22:24:50 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8E=AF=E5=A2=83=E5=8F=98=E9=87=8F=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=AF=BC=E5=87=BA=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/env/index.tsx | 16 +++++++++++++++- src/utils/index.ts | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) diff --git a/src/pages/env/index.tsx b/src/pages/env/index.tsx index 303b6a4d..84bc0d07 100644 --- a/src/pages/env/index.tsx +++ b/src/pages/env/index.tsx @@ -25,7 +25,7 @@ import EditNameModal from './editNameModal'; import { DndProvider, useDrag, useDrop } from 'react-dnd'; import { HTML5Backend } from 'react-dnd-html5-backend'; import './index.less'; -import { getTableScroll } from '@/utils/index'; +import { exportJson, getTableScroll } from '@/utils/index'; const { Text, Paragraph } = Typography; const { Search } = Input; @@ -462,6 +462,13 @@ const Env = ({ headerStyle, isPhone, theme }: any) => { }); }; + const exportEnvs = () => { + const envs = value + .filter((x) => selectedRowIds.includes(x.id)) + .map((x) => ({ value: x.value, name: x.name, remarks: x.remarks })); + exportJson('env.json', JSON.stringify(envs)); + }; + const modifyName = () => { setIsEditNameModalVisible(true); }; @@ -516,6 +523,13 @@ const Env = ({ headerStyle, isPhone, theme }: any) => { > 批量删除 +