环境变量增加导出功能

This commit is contained in:
whyour
2022-07-04 22:24:50 +08:00
parent 6f4736bddf
commit 87a265191c
2 changed files with 51 additions and 1 deletions
+15 -1
View File
@@ -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) => {
>
</Button>
<Button
type="primary"
onClick={() => exportEnvs()}
style={{ marginLeft: 8, marginRight: 8 }}
>
</Button>
<Button
type="primary"
onClick={() => operateEnvs(0)}