mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-17 17:54:32 +08:00
环境变量增加导出功能
This commit is contained in:
Vendored
+15
-1
@@ -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)}
|
||||
|
||||
Reference in New Issue
Block a user