From 1cb8d95d52bcafc9256ee5b700280a24eaa12877 Mon Sep 17 00:00:00 2001 From: zhangshuai <1016868503@qq.com> Date: Mon, 1 Aug 2022 17:00:15 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat:=E9=A6=96=E9=A1=B5=E8=BF=81=E7=A7=BB?= =?UTF-8?q?=E6=96=B0=E9=97=BB=E5=8D=9A=E5=AE=A2=E6=A8=A1=E5=9D=97=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E5=A4=8Dtable=E6=A0=B7=E5=BC=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/download/TheMirList.vue | 33 +- .../src/views/download/TheMirSelect.vue | 39 +- .../src/views/home/HomeCarousel.vue | 4 +- app/.vitepress/src/views/home/HomeNews.vue | 531 ++++++++++++++++++ app/.vitepress/src/views/home/TheHome.vue | 29 +- .../other/projects/components/DocsList.vue | 8 +- 6 files changed, 600 insertions(+), 44 deletions(-) create mode 100644 app/.vitepress/src/views/home/HomeNews.vue diff --git a/app/.vitepress/src/views/download/TheMirList.vue b/app/.vitepress/src/views/download/TheMirList.vue index a5ed13fea..64032be3a 100644 --- a/app/.vitepress/src/views/download/TheMirList.vue +++ b/app/.vitepress/src/views/download/TheMirList.vue @@ -115,7 +115,7 @@ onMounted(async () => { {{ i18n.download.MIRROR_ALL.CONTENT[1] }}.

- { width="260" > - +
@@ -252,17 +252,18 @@ onMounted(async () => { line-height: 54px; padding: 0 !important; .cell { - padding-left: 0px; + padding-left: 0px !important; + padding-right: var(--o-spacing-h6) !important; } } &-header:first-child { .cell { - padding-left: var(--o-spacing-h2); + padding-left: var(--o-spacing-h2) !important; } } &-header:last-child { .cell { - padding-right: var(--o-spacing-h2); + padding-right: var(--o-spacing-h2) !important; } } @@ -272,6 +273,9 @@ onMounted(async () => { font-weight: 800 !important; height: 72px !important; border: none !important; + a { + color: var(--o-color-text2) !important; + } } } @@ -280,18 +284,20 @@ onMounted(async () => { font-weight: 400; color: var(--o-color-text2); height: 54px; + border-bottom: 1px var(--o-color-division) solid !important; .cell { - padding-left: 0px; + padding-left: 0px !important; + padding-right: var(--o-spacing-h6) !important; } } &-row:first-child { .cell { - padding-left: var(--o-spacing-h2); + padding-left: var(--o-spacing-h2) !important; } } &-row:last-child { .cell { - padding-right: var(--o-spacing-h2); + padding-right: var(--o-spacing-h2) !important; } } } @@ -357,7 +363,7 @@ onMounted(async () => { @media (max-width: 1100px) { padding: 0 var(--o-spacing-h5); } - > p { + p { font-size: var(--o-font-size-h7); font-weight: 400; color: var(--o-color-text2); @@ -368,11 +374,10 @@ onMounted(async () => { line-height: var(--o-line-height-tip); margin: var(--o-spacing-h2) 0 var(--o-spacing-h5) 0; } - - > a { - text-decoration: none; - color: var(--o-color-brand); - } + } + a { + text-decoration: none; + color: var(--o-color-brand); } &-img { diff --git a/app/.vitepress/src/views/download/TheMirSelect.vue b/app/.vitepress/src/views/download/TheMirSelect.vue index 5bada038e..f39b3c35c 100644 --- a/app/.vitepress/src/views/download/TheMirSelect.vue +++ b/app/.vitepress/src/views/download/TheMirSelect.vue @@ -123,7 +123,7 @@ onMounted(async () => { }}{{ area }}{{ i18n.download.MIRROR_SELECT.CONTENT[3] }}

- { prop="distance" min-width="160" /> - +
{ line-height: 54px; padding: 0 !important; .cell { - padding-left: 0px; + padding-left: 0px !important; + padding-right: var(--o-spacing-h6) !important; } } &-header:first-child { .cell { - padding-left: var(--o-spacing-h2); + padding-left: var(--o-spacing-h2) !important; } } &-header:last-child { .cell { - padding-right: var(--o-spacing-h2); - } - } - - &-area { - .mirror-select-row { - font-size: var(--o-font-size-h7) !important; - font-weight: 800 !important; - height: 72px !important; - border: none !important; + padding-right: var(--o-spacing-h2) !important; } } @@ -258,18 +250,20 @@ onMounted(async () => { font-weight: 400; color: var(--o-color-text2); height: 54px; + border-bottom: 1px var(--o-color-division) solid !important; .cell { - padding-left: 0px; + padding-left: 0px !important; + padding-right: var(--o-spacing-h6) !important; } } &-row:first-child { .cell { - padding-left: var(--o-spacing-h2); + padding-left: var(--o-spacing-h2) !important; } } &-row:last-child { .cell { - padding-right: var(--o-spacing-h2); + padding-right: var(--o-spacing-h2) !important; } } } @@ -333,7 +327,7 @@ onMounted(async () => { @media (max-width: 1100px) { padding: 0 var(--o-spacing-h5); } - > p { + p { font-size: var(--o-font-size-h7); font-weight: 400; color: var(--o-color-text2); @@ -344,11 +338,10 @@ onMounted(async () => { line-height: var(--o-line-height-tip); margin: var(--o-spacing-h2) 0 var(--o-spacing-h5) 0; } - - > a { - text-decoration: none; - color: var(--o-color-brand); - } + } + a { + text-decoration: none; + color: var(--o-color-brand); } &-name { diff --git a/app/.vitepress/src/views/home/HomeCarousel.vue b/app/.vitepress/src/views/home/HomeCarousel.vue index 04cd1b6b5..471c11e41 100644 --- a/app/.vitepress/src/views/home/HomeCarousel.vue +++ b/app/.vitepress/src/views/home/HomeCarousel.vue @@ -233,9 +233,9 @@ const go = (path: string) => { padding-top: var(--o-spacing-h2); justify-content: center; align-items: center; - @media screen and (max-width: 1000px) { + @media screen and (max-width: 1080px) { padding: 20px 0; - font-size: 12px; + font-size: var(--o-font-size-tip); } &-item:hover { diff --git a/app/.vitepress/src/views/home/HomeNews.vue b/app/.vitepress/src/views/home/HomeNews.vue new file mode 100644 index 000000000..acd62d190 --- /dev/null +++ b/app/.vitepress/src/views/home/HomeNews.vue @@ -0,0 +1,531 @@ + + + diff --git a/app/.vitepress/src/views/home/TheHome.vue b/app/.vitepress/src/views/home/TheHome.vue index 0d555f4af..73ed6a6ba 100644 --- a/app/.vitepress/src/views/home/TheHome.vue +++ b/app/.vitepress/src/views/home/TheHome.vue @@ -7,6 +7,7 @@ import HomePlayground from './HomePlayground.vue'; import HomeNav from './HomeNav.vue'; import PublishLink from './PublishLink.vue'; import SourceLink from './SourceLink.vue'; +import HomeNews from './HomeNews.vue'; - + diff --git a/app/.vitepress/src/views/other/projects/components/DocsList.vue b/app/.vitepress/src/views/other/projects/components/DocsList.vue index 77df4b281..b1b518bcd 100644 --- a/app/.vitepress/src/views/other/projects/components/DocsList.vue +++ b/app/.vitepress/src/views/other/projects/components/DocsList.vue @@ -37,12 +37,12 @@ const goLink = (path: string) => {
{{ item.DESC }}
- - - - diff --git a/app/.vitepress/src/views/download/TheDownload.vue b/app/.vitepress/src/views/download/TheDownload.vue index ba422b043..6177ba812 100644 --- a/app/.vitepress/src/views/download/TheDownload.vue +++ b/app/.vitepress/src/views/download/TheDownload.vue @@ -169,7 +169,7 @@ onMounted(() => { >
{{ item }}
@@ -267,7 +267,7 @@ onMounted(() => {
diff --git a/app/.vitepress/src/views/download/TheMirList.vue b/app/.vitepress/src/views/download/TheMirList.vue index cf7d0f5a3..8ff6e3e50 100644 --- a/app/.vitepress/src/views/download/TheMirList.vue +++ b/app/.vitepress/src/views/download/TheMirList.vue @@ -7,9 +7,14 @@ import BannerLevel3 from '@/components/BannerLevel3.vue'; import banner from '@/assets/banner-secondary.png'; import { useData } from 'vitepress'; import useWindowResize from '@/components/hooks/useWindowResize'; +import MapContainer from './MapContainer.vue'; const { theme: i18n } = useData(); - +interface MapMsg { + name: string; + latitude: number; + longitude: number; +} interface MirrorMsg { name: string; location?: string; @@ -27,6 +32,8 @@ const screenWidth = useWindowResize(); const tableData: Ref = ref([]); +const mapData: Ref = ref([]); + const inputDom: Ref = ref(null); const initTable = (data: any[]) => { @@ -69,6 +76,26 @@ const initTable = (data: any[]) => { result = [...asData, ...euData]; return result; }; + +const initMap = (data: any[]) => { + const result: MapMsg[] = []; + data.forEach((item) => { + const itemObj: MapMsg = { + name: '', + latitude: 0, + longitude: 0, + }; + + itemObj.name = item.Name; + itemObj.longitude = item.Longitude; + itemObj.latitude = item.Latitude; + + result.push(itemObj); + }); + + return result; +}; + const tableRowClassName = ({ row }: any) => { if (row.area) { return 'mirror-list-area'; @@ -87,7 +114,6 @@ const copyText = (value: string | undefined) => { type: 'success', }); }; - const listData = computed(() => { return tableData.value.filter((item) => typeof item.area === 'undefined'); }); @@ -96,6 +122,7 @@ onMounted(async () => { try { const responeData = await getAllMirror(); tableData.value = initTable(responeData); + mapData.value = initMap(responeData); } catch (e: any) { throw new Error(e); } @@ -174,7 +201,7 @@ onMounted(async () => {
- +
{{ i18n.download.MIRROR_ALL.NAME }} @@ -235,6 +262,10 @@ onMounted(async () => {
+
+ +
+
@@ -243,6 +274,11 @@ onMounted(async () => {