Skip to content

Commit

Permalink
fix: 评审问题
Browse files Browse the repository at this point in the history
  • Loading branch information
yxh01132861 committed Jan 25, 2024
1 parent 190c88b commit 788b342
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
2 changes: 1 addition & 1 deletion packages/li-editor/src/widgets/Export/ExportData/helper.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { DatasetField } from '@antv/li-sdk';
import type { GeometryTypes } from '@turf/turf';
import { omit } from 'lodash-es';
import type { EditorDataset } from 'packages/li-editor/src/services/editor-dataset-manager';
import papaparse from 'papaparse';
import type { WritingOptions } from 'xlsx';
import { utils as XLSX_utils, write as XLSX_write } from 'xlsx';
import type { EditorDataset } from '../../../services/editor-dataset-manager';

// 数据转文本格式处理
const getTextFormatData = (list: Record<string, any>[]) => {
Expand Down
23 changes: 10 additions & 13 deletions packages/li-editor/src/widgets/Export/ExportData/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type { LocalDatasetSchema } from '@antv/li-sdk';
import { Form, message, Modal, Radio, Select } from 'antd';
import classNames from 'classnames';
import { downloadBlob, downloadText } from 'download.js';
Expand Down Expand Up @@ -28,6 +27,15 @@ const ExportData = ({ visible, onVisbleChange }: ExportDataProps) => {
{ label: 'GeoJSON', value: 'geojson' },
];

const datasets = localOrRemoteDatasets.length
? [
{ label: '全部', value: 'all' },
...localOrRemoteDatasets.map((item) => {
return { label: item.metadata.name, value: item.id };
}),
]
: [];

const downLoadDataSource = () => {
const { dataSourceId, type } = form.getFieldsValue(true);
const targetDataset = localOrRemoteDatasets.find((item) => item.id === dataSourceId);
Expand Down Expand Up @@ -127,18 +135,7 @@ const ExportData = ({ visible, onVisbleChange }: ExportDataProps) => {
style={{ padding: 20 }}
initialValue={localOrRemoteDatasets.length ? 'all' : undefined}
>
<Select
options={
localOrRemoteDatasets.length
? [
{ label: '全部', value: 'all' },
...localOrRemoteDatasets.map((item) => {
return { label: item.metadata.name, value: item.id };
}),
]
: []
}
/>
<Select options={datasets} />
</Form.Item>
<Form.Item
name="type"
Expand Down

0 comments on commit 788b342

Please sign in to comment.