From 2a35447a9cfdc984b93ca469784fae2de2bfeb8f Mon Sep 17 00:00:00 2001 From: lzxue <120635640@qq.com> Date: Thu, 30 Nov 2023 23:23:20 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=9B=B4=E6=96=B0=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/app-content/index.tsx | 22 +++-- src/components/app-sider/index.tsx | 10 +- src/data/config.ts | 95 ------------------- src/data/sites/index.ts | 5 + src/data/sites/main/groups/color_map.ts | 21 ++++ src/data/sites/main/groups/coord_convert.ts | 19 ++++ .../sites/main/groups/data_collaboration.ts | 17 ++++ src/data/sites/main/groups/data_edit.ts | 29 ++++++ .../sites/main/groups/data_format_convert.ts | 20 ++++ src/data/sites/main/groups/data_process.ts | 18 ++++ src/data/sites/main/groups/data_source.ts | 20 ++++ src/data/sites/main/groups/geocoding.ts | 9 ++ src/data/sites/main/groups/onlinemap.ts | 61 ++++++++++++ src/data/sites/main/groups/visualization.ts | 29 ++++++ src/data/sites/main/index.ts | 28 ++++++ src/data/types.ts | 29 ++++++ 16 files changed, 324 insertions(+), 108 deletions(-) delete mode 100644 src/data/config.ts create mode 100644 src/data/sites/index.ts create mode 100644 src/data/sites/main/groups/color_map.ts create mode 100644 src/data/sites/main/groups/coord_convert.ts create mode 100644 src/data/sites/main/groups/data_collaboration.ts create mode 100644 src/data/sites/main/groups/data_edit.ts create mode 100644 src/data/sites/main/groups/data_format_convert.ts create mode 100644 src/data/sites/main/groups/data_process.ts create mode 100644 src/data/sites/main/groups/data_source.ts create mode 100644 src/data/sites/main/groups/geocoding.ts create mode 100644 src/data/sites/main/groups/onlinemap.ts create mode 100644 src/data/sites/main/groups/visualization.ts create mode 100644 src/data/sites/main/index.ts create mode 100644 src/data/types.ts diff --git a/src/components/app-content/index.tsx b/src/components/app-content/index.tsx index 7d38ee8..72ce1ac 100644 --- a/src/components/app-content/index.tsx +++ b/src/components/app-content/index.tsx @@ -1,27 +1,31 @@ -import { siteConfig } from "../../data/config"; + +import { SitesConfig } from '../../data/sites' import { Avatar, Row, Card, Col, Tooltip } from "antd"; import "./index.css"; +import { IGroup } from "../../data/types"; export const AppCard = () => { + const siteConfig = SitesConfig['main']; return (
- {Object.keys(siteConfig).map((item) => { + {siteConfig.groups.map((group:IGroup) => { + const { name, children} = group; return ( - {siteConfig[item].children.map((val) => { + {children.map((val) => { return ( { diff --git a/src/components/app-sider/index.tsx b/src/components/app-sider/index.tsx index ff97814..594feab 100644 --- a/src/components/app-sider/index.tsx +++ b/src/components/app-sider/index.tsx @@ -1,9 +1,11 @@ import logo from "../../assets/logo.png"; -import { IGroup, siteConfig } from "../../data/config"; +import { IGroup,} from "../../data/types"; +import { SitesConfig } from '../../data/sites' import "./index.css"; import { Space, Tag } from "antd"; export const AppSider = () => { + const siteConfig = SitesConfig['main']; const tagClick = (item: IGroup) => { const element = document.querySelector(`#${item.name}`); if (element) { @@ -16,14 +18,14 @@ export const AppSider = () => {
- {Object.keys(siteConfig).map((item) => { + {siteConfig.groups.map((group: IGroup) => { return ( tagClick(siteConfig[item])} + onClick={() => tagClick(group)} > - {siteConfig[item].name} + {group.name} ); diff --git a/src/data/config.ts b/src/data/config.ts deleted file mode 100644 index 75f03b9..0000000 --- a/src/data/config.ts +++ /dev/null @@ -1,95 +0,0 @@ -export type toolsType = "tool" | "data" | "tool" | "DataBase" | "Map Server"; -export interface IItem { - icon: string; - name: string; - en_name: string; - description: string; - en_description: string; - site_url?: string; - tags: string[]; - github?: string; - order?: number; - favorite?: boolean; -} -export interface IGroup { - icon?: string; - name: string; - en_name: string; - children: IItem[]; -} -export interface IConfig { - [key: string]: IGroup; -} -export const siteConfig: IConfig = { - tool: { - // icon: "tool", - name: "工具", - en_name: "Tools", - children: [ - { - icon: "https://mdn.alipayobjects.com/huamei_k6sfo0/afts/img/A*RSdESJd70P8AAAAAAAAAAAAADjWqAQ/original", - name: "L7Editor", - en_name: "L7Editor", - description: "多底图地理绘制工具", - en_description: "Multi-base map geographic drawing tool", - site_url: "https://l7editor.antv.antgroup.com/", - order: 2, - tags: ["GIS", "Web", "Data"], - }, - { - icon: "https://mapshaper.org/images/icon.png", - name: "MapShaper", - en_name: "MapShaper", - description: "地理数据预览,编辑工具", - en_description: - "A tool for topologically aware shape simplification. Reads and writes Shapefile, GeoJSON and TopoJSON formats.", - site_url: "http://www.mapshaper.org/", - order: 2, - tags: ["GIS", "Web", "Data"], - }, - { - icon: "https://img.alicdn.com/imgextra/i3/O1CN01NQARus1gyEAmmQ9T0_!!6000000004210-0-tps-670-670.jpg", - name: "DataV.GeoAtlas", - en_name: "DataV.GeoAtlas", - description: - "由阿里云DataV数据可视化团队出品,多年深耕数据可视化领域,数据大屏业务开拓者和领航者。致力用震撼而清晰的视觉语言,让更多人读懂大数据,受惠数据驱动的决策方式。", - en_description: - "A tool for topologically aware shape simplification. Reads and writes Shapefile, GeoJSON and TopoJSON formats.", - site_url: "https://datav.aliyun.com/portal/school/atlas/area_selector", - order: 2, - tags: "阿里云,DataV,数据可视化,GeoAtlas,数字孪生,GIS".split(","), - }, - { - icon: "https://geojson.io/img/favicon.png", - name: "Geojson.io", - en_name: "Geojson.io", - description: "用于创建、查看和共享空间数据的快速、简单的工具。", - en_description: - "A quick, simple tool for creating, viewing, and sharing spatial data.", - site_url: "https://geojson.io", - order: 2, - tags: ["GIS", "Web", "Data"], - }, - { - icon: "", - name: "Maptable", - en_name: "Maptable", - description: "空间数据协同工具", - en_description: "Spatial data collaboration tools", - site_url: "https://maptable.com/zh-cn/", - order: 2, - tags: ["GIS", "Web", "Data"], - }, - { - icon: "https://epsg.io/static/img/espg-logo.png", - name: "epsg.io", - en_name: "epsg.io", - description: "全球坐标系转换工具", - en_description: "Global Coordinate System Conversion Tool", - site_url: "https://epsg.io/", - order: 2, - tags: ["GIS", "Web", "Data"], - }, - ], - }, -}; diff --git a/src/data/sites/index.ts b/src/data/sites/index.ts new file mode 100644 index 0000000..5823d4f --- /dev/null +++ b/src/data/sites/index.ts @@ -0,0 +1,5 @@ +import { ISiteConfig } from '../types' +import { MainConfig } from './main' +export const SitesConfig:{[key:string]:ISiteConfig} = { + main:MainConfig +} \ No newline at end of file diff --git a/src/data/sites/main/groups/color_map.ts b/src/data/sites/main/groups/color_map.ts new file mode 100644 index 0000000..1467ae6 --- /dev/null +++ b/src/data/sites/main/groups/color_map.ts @@ -0,0 +1,21 @@ +import { IGroup } from '../../../types' +export const MapColor: IGroup = { + icon: '', + name: '地图配置', + en_name: 'map color', + order: 2, + children: [ + { + icon: "https://colorbrewer2.org/favicon.ico", + name: "ColorBrewer", + en_name: "ColorBrewer", + description: "地图配色", + en_description: "Map color", + site_url: "https://colorbrewer2.org/", + order: 2, + tags: ["GIS", "Web", "Data"], + }, + + ] + +} diff --git a/src/data/sites/main/groups/coord_convert.ts b/src/data/sites/main/groups/coord_convert.ts new file mode 100644 index 0000000..0913daf --- /dev/null +++ b/src/data/sites/main/groups/coord_convert.ts @@ -0,0 +1,19 @@ +// 坐标转换工具 +import { IGroup } from '../../../types' +export const CoordConvert: IGroup = { + icon: '', + name: '坐标转换', + order: 2, + en_name: 'Coord', + children: [{ + icon: "https://epsg.io/static/img/espg-logo.png", + name: "epsg.io", + en_name: "epsg.io", + description: "全球坐标系转换工具", + en_description: "Global Coordinate System Conversion Tool", + site_url: "https://epsg.io/", + order: 2, + tags: ["GIS", "Web", "Data"], + }] + +} diff --git a/src/data/sites/main/groups/data_collaboration.ts b/src/data/sites/main/groups/data_collaboration.ts new file mode 100644 index 0000000..5dbd8f4 --- /dev/null +++ b/src/data/sites/main/groups/data_collaboration.ts @@ -0,0 +1,17 @@ +import { IGroup } from '../../../types' +export const DataCollaboration: IGroup = { + icon: '', + name: '数据协同', + order: 2, + en_name: 'Data Collaboration', + children: [{ + icon: "", + name: "Maptable", + en_name: "Maptable", + description: "空间数据协同工具", + en_description: "Spatial data collaboration tools", + site_url: "https://maptable.com/zh-cn/", + order: 2, + tags: ["GIS", "Web", "Data"], + }] +} diff --git a/src/data/sites/main/groups/data_edit.ts b/src/data/sites/main/groups/data_edit.ts new file mode 100644 index 0000000..4a9eae6 --- /dev/null +++ b/src/data/sites/main/groups/data_edit.ts @@ -0,0 +1,29 @@ +import { IGroup } from '../../../types' +export const DataEdit: IGroup = { + icon: '', + name: '数据编辑', + en_name: 'data edit', + order: 0, + children: [{ + icon: "https://mdn.alipayobjects.com/huamei_k6sfo0/afts/img/A*RSdESJd70P8AAAAAAAAAAAAADjWqAQ/original", + name: "L7Editor", + en_name: "L7Editor", + description: "多底图地理绘制工具", + en_description: "Multi-base map geographic drawing tool", + site_url: "https://l7editor.antv.antgroup.com/", + order: 2, + tags: ["GIS", "Web", "Data"], + }, + { + icon: "https://geojson.io/img/favicon.png", + name: "Geojson.io", + en_name: "Geojson.io", + description: "用于创建、查看和共享空间数据的快速、简单的工具。", + en_description: + "A quick, simple tool for creating, viewing, and sharing spatial data.", + site_url: "https://geojson.io", + order: 2, + tags: ["GIS", "Web", "Data"], + }, + ] +} diff --git a/src/data/sites/main/groups/data_format_convert.ts b/src/data/sites/main/groups/data_format_convert.ts new file mode 100644 index 0000000..2313a75 --- /dev/null +++ b/src/data/sites/main/groups/data_format_convert.ts @@ -0,0 +1,20 @@ +import { IGroup } from '../../../types' +export const DataFormatConvert: IGroup = { + icon: '', + name: '数据转换', + order: 2, + en_name: 'Data format conversion', + children: [ + // https://gdal3.js.org/ + { + icon: "", + name: "gdal3.js", + en_name: "gdal3.js", + description: "栅格矢量格式转换", + en_description: " Convert raster and vector geospatial data to various formats and coordinate systems entirely in the browser", + site_url: "https://gdal3.js.org/", + order: 2, + tags: ["GIS", "Web", "Data"], + }, + ] +} diff --git a/src/data/sites/main/groups/data_process.ts b/src/data/sites/main/groups/data_process.ts new file mode 100644 index 0000000..18ec5ed --- /dev/null +++ b/src/data/sites/main/groups/data_process.ts @@ -0,0 +1,18 @@ +import { IGroup } from '../../../types' +export const DataProcess: IGroup = { + icon: '', + name: '数据处理', + en_name: 'data process', + order: 2, + children: [{ + icon: "https://mapshaper.org/images/icon.png", + name: "MapShaper", + en_name: "MapShaper", + description: "地理数据预览,编辑工具", + en_description: + "A tool for topologically aware shape simplification. Reads and writes Shapefile, GeoJSON and TopoJSON formats.", + site_url: "http://www.mapshaper.org/", + order: 2, + tags: ["GIS", "Web", "Data"], + }] +} diff --git a/src/data/sites/main/groups/data_source.ts b/src/data/sites/main/groups/data_source.ts new file mode 100644 index 0000000..255afbd --- /dev/null +++ b/src/data/sites/main/groups/data_source.ts @@ -0,0 +1,20 @@ +// 数据可视化 +import { IGroup } from '../../../types' +export const DataSource: IGroup = { + icon: '', + name: '数据源', + en_name: 'data source', + order: 2, + children: [{ + icon: "https://img.alicdn.com/imgextra/i3/O1CN01NQARus1gyEAmmQ9T0_!!6000000004210-0-tps-670-670.jpg", + name: "DataV.GeoAtlas", + en_name: "DataV.GeoAtlas", + description: + "由阿里云DataV数据可视化团队出品,多年深耕数据可视化领域,数据大屏业务开拓者和领航者。致力用震撼而清晰的视觉语言,让更多人读懂大数据,受惠数据驱动的决策方式。", + en_description: + "A tool for topologically aware shape simplification. Reads and writes Shapefile, GeoJSON and TopoJSON formats.", + site_url: "https://datav.aliyun.com/portal/school/atlas/area_selector", + order: 2, + tags: "阿里云,DataV,数据可视化,GeoAtlas,数字孪生,GIS".split(","), + }] +} diff --git a/src/data/sites/main/groups/geocoding.ts b/src/data/sites/main/groups/geocoding.ts new file mode 100644 index 0000000..3e1d178 --- /dev/null +++ b/src/data/sites/main/groups/geocoding.ts @@ -0,0 +1,9 @@ +import { IGroup } from '../../../types' +export const GeoCoding: IGroup = { + icon: '', + name: '地理编码', + en_name: 'geocoding', + order: 2, + children: [] + +} diff --git a/src/data/sites/main/groups/onlinemap.ts b/src/data/sites/main/groups/onlinemap.ts new file mode 100644 index 0000000..07f7d68 --- /dev/null +++ b/src/data/sites/main/groups/onlinemap.ts @@ -0,0 +1,61 @@ +import { IGroup } from '../../../types' +export const OnlineMap: IGroup = { + icon: '', + name: '在线地图', + order: 2, + en_name: 'onlinemap', + children: [ + { + icon: "https://www.baidu.com/favicon.ico", + name: "百度地图", + en_name: "Baidu Map", + description: "百度地图", + en_description: "Baidu Map", + site_url: "https://map.baidu.com/", + order: 2, + tags: ["GIS", "Web", "Data"], + }, + { + icon: "https://www.amap.com/favicon.ico", + name: "高德地图", + en_name: "Amap", + description: "高德地图", + en_description: "Amap", + site_url: "https://www.amap.com/", + order: 2, + tags: ["GIS", "Web", "Data"], + }, + { + icon: "https://map.qq.com/favicon.ico", + name: "腾讯地图", + en_name: "Tencent Map", + description: "腾讯地图", + en_description: "Tencent Map", + site_url: "https://map.qq.com/", + order: 2, + tags: ["GIS", "Web", "Data"], + }, + { + icon: "https://maps.here.com/favicon.png", + name: "Here Map", + en_name: "Here Map", + description: "Here Map", + en_description: "Here Map", + site_url: "https://maps.here.com/", + order: 2, + tags: ["GIS", "Web", "Data"], + }, + { + icon: "https://www.google.com/favicon.ico", + name: "Google Map", + en_name: "Google Map", + description: "Google Map", + en_description: "Google Map", + site_url: "https://www.google.com/maps", + order: 2, + tags: ["GIS", "Web", "Data"], + }, + + + ] +} diff --git a/src/data/sites/main/groups/visualization.ts b/src/data/sites/main/groups/visualization.ts new file mode 100644 index 0000000..54a4cf4 --- /dev/null +++ b/src/data/sites/main/groups/visualization.ts @@ -0,0 +1,29 @@ +// 数据可视化 +import { IGroup } from '../../../types' +export const Visulization: IGroup = { + icon: '', + name: '数据可视化', + en_name: 'Coord', + order: 1, + children: [{ + icon: "https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*WCVLT5Dp5oYAAAAAAAAAAAAADmJ7AQ/original", + name: "L7VP", + en_name: "L7VP", + description: "下一代地理空间智能可视分析工具和应用研发平台,具有丰富的可视化效果提供洞察分析、地图应用搭建工具、开放扩展能力", + en_description: "The next generation of geospatial intelligent visual analysis tools and application development platforms, with rich visualization effectsProvide insight analysis, map application building tools, and open expansion capabilities", + site_url: "https://li.antv.antgroup.com", + order: 2, + tags: ["GIS", "Web", "Data"], + }, + { + icon: "https://kepler.gl/favicon.png", + name: "kepler.gl", + en_name: "kepler.gl", + description: "kepler.gl是一个基于React的开源地理空间分析工具,用于创建大规模、可交互的地理信息可视化应用", + en_description: "kepler.gl is an open source geospatial analysis tool based on React, used to create large-scale, interactive geospatial visualization applications", + site_url: "https://kepler.gl/", + order: 2, + tags: ["GIS", "Web", "Data"], + }, +] +} diff --git a/src/data/sites/main/index.ts b/src/data/sites/main/index.ts new file mode 100644 index 0000000..d707b39 --- /dev/null +++ b/src/data/sites/main/index.ts @@ -0,0 +1,28 @@ +import { ISiteConfig } from "../../types"; +import { MapColor } from "./groups/color_map"; +import { CoordConvert } from "./groups/coord_convert"; +import { DataCollaboration } from "./groups/data_collaboration"; +import { DataEdit } from "./groups/data_edit"; +import { DataFormatConvert } from "./groups/data_format_convert"; +import { DataProcess } from "./groups/data_process"; +import { GeoCoding } from "./groups/geocoding"; +import { OnlineMap } from "./groups/onlinemap"; +import { Visulization } from "./groups/visualization"; + + + +export const MainConfig: ISiteConfig = { + name: "主站", + en_name: "main", + groups: [ + DataEdit, + DataProcess, + DataFormatConvert, + CoordConvert, + Visulization, + MapColor, + DataCollaboration, + OnlineMap, + GeoCoding, + ].sort((a, b) => a.order - b?.order), +}; diff --git a/src/data/types.ts b/src/data/types.ts new file mode 100644 index 0000000..b3ffb4f --- /dev/null +++ b/src/data/types.ts @@ -0,0 +1,29 @@ +export type toolsType = "tool" | "data" | "tool" | "DataBase" | "Map Server"; +export interface IItem { + icon: string; + name: string; + en_name: string; + description: string; + en_description: string; + site_url?: string; + tags: string[]; + github?: string; + order?: number; + favorite?: boolean; +} +export interface IGroup { + icon?: string; + name: string; + en_name: string; + order: number; + children: IItem[]; +} +export interface IConfig { + [key: string]: IGroup; +} + +export interface ISiteConfig { + name:string; + en_name:string; + groups: IGroup[]; +} \ No newline at end of file