diff --git a/src/views/epkg/EpkgContent.vue b/src/views/epkg/EpkgContent.vue
index fc99828..ff40415 100644
--- a/src/views/epkg/EpkgContent.vue
+++ b/src/views/epkg/EpkgContent.vue
@@ -1,6 +1,6 @@
diff --git a/src/views/epkg/TheDetail.vue b/src/views/epkg/TheDetail.vue
index 0f5a3cd..55b2f63 100644
--- a/src/views/epkg/TheDetail.vue
+++ b/src/views/epkg/TheDetail.vue
@@ -1,11 +1,10 @@
diff --git a/src/views/home/TheHome.vue b/src/views/home/TheHome.vue
index cedc417..b5a869e 100644
--- a/src/views/home/TheHome.vue
+++ b/src/views/home/TheHome.vue
@@ -6,7 +6,7 @@ import type { AppT } from '@/@types/app';
import HomeHeader from './HomeHeader.vue';
import HomeNews from './HomeNews.vue';
import HomeSkeleton from './HomeSkeleton.vue';
-import { solutionData, resourceData } from '@/data/home/index';
+import { solutionData, homeData } from '@/data/home/index';
import { useLocale } from '@/composables/useLocale';
import { getTagsIcon } from '@/utils/common';
import { useScreen } from '@/composables/useScreen';
@@ -108,7 +108,7 @@ onMounted(() => {
import { ref, watch, computed, onMounted } from 'vue';
-import { OTag, OLink, OIcon } from '@opensig/opendesign';
+import { OTag, OLink, OIcon, isUndefined, isString } from '@opensig/opendesign';
import { getSearchData } from '@/api/api-search';
import { useRoute } from 'vue-router';
import { getSearchAllFiled, getSearchAllColumn } from '@/api/api-domain';
@@ -71,7 +71,7 @@ const querySearch = () => {
if (res.code === 200) {
pkgData.value = res.data.apppkg;
total.value = res.data.total;
- isSearch.value = true;
+ isSearchDocs.value = true;
}
isLoading.value = false;
if (pkgData.value.length === 0) {
@@ -81,14 +81,14 @@ const querySearch = () => {
.catch(() => {
pkgData.value = [];
isLoading.value = false;
- isSearch.value = false;
+ isSearchDocs.value = false;
useViewStore().showNotFound();
});
};
// sql搜索
const isSearchError = ref(false);
-const isSearch = ref(false);
+const isSearchDocs = ref(false);
const queryAllpkg = () => {
const params = {
name: tabName.value,
@@ -173,7 +173,7 @@ const resetTag = () => {
searchArch.value = [];
searchOs.value = [];
searchCategory.value = [];
- isSearch.value = false;
+ isSearchDocs.value = false;
nameOrder.value = '';
};
@@ -226,31 +226,31 @@ watch(
{ deep: true }
);
-watch(
- () => route.query.name as string,
- (v: string) => {
- if (searchKey.value !== v && v !== undefined) {
- searchKey.value = v;
- }
- if (v === '') {
- isSearch.value = false;
- }
+// -------------------- 监听 url query 变化 触发搜索 ---------------------
+const handleQueryData = () => {
+ const query = route.query;
+ const { name, tab, key } = query;
+ if (!isUndefined(name) && name) {
+ searchKey.value = name?.toString();
currentPage.value = 1;
+ } else if (name === '') {
+ isSearchDocs.value = false;
}
-);
-
-watch(
- () => route.query.tab as string,
- (v: string) => {
- tabName.value = v;
+ if (isString(tab) && tab) {
+ tabName.value = tab?.toString();
}
-);
+ if (isString(key) && key) {
+ keywordType.value = key?.toString();
+ }
+};
+handleQueryData();
watch(
- () => route.query.key as string,
- (v: string) => {
- keywordType.value = v;
- }
+ () => route.query,
+ () => {
+ handleQueryData();
+ },
+ { deep: true }
);
diff --git a/src/views/image/TheDetail.vue b/src/views/image/TheDetail.vue
index 9e33233..720b88c 100644
--- a/src/views/image/TheDetail.vue
+++ b/src/views/image/TheDetail.vue
@@ -1,34 +1,23 @@
diff --git a/src/views/package/RpmContent.vue b/src/views/package/RpmContent.vue
index 750ba87..53c15f4 100644
--- a/src/views/package/RpmContent.vue
+++ b/src/views/package/RpmContent.vue
@@ -1,6 +1,6 @@
diff --git a/src/views/package/TheDetail.vue b/src/views/package/TheDetail.vue
index e0b1d55..f3fa8d2 100644
--- a/src/views/package/TheDetail.vue
+++ b/src/views/package/TheDetail.vue
@@ -1,11 +1,10 @@
diff --git a/src/views/upstream/UpstreamContent.vue b/src/views/upstream/UpstreamContent.vue
index e23bf12..1acdc77 100644
--- a/src/views/upstream/UpstreamContent.vue
+++ b/src/views/upstream/UpstreamContent.vue
@@ -220,7 +220,7 @@ watch(
-
+
--
Gitee
From 2a3158a6457fc1f19034a7a640725825a7f84677 Mon Sep 17 00:00:00 2001
From: YCA001 <2915341988@qq.com>
Date: Sat, 25 May 2024 09:49:57 +0800
Subject: [PATCH 6/7] =?UTF-8?q?=E8=AF=A6=E6=83=85=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/@types/detail.ts | 17 +++++++++++------
src/components/DetailAside.vue | 2 +-
src/utils/common.ts | 11 +++++++++++
src/views/apppkg/TheNewDetail.vue | 18 ++++++++++--------
src/views/epkg/TheDetail.vue | 2 +-
src/views/image/TheDetail.vue | 4 ++--
src/views/package/TheDetail.vue | 2 +-
7 files changed, 37 insertions(+), 19 deletions(-)
diff --git a/src/@types/detail.ts b/src/@types/detail.ts
index a42f183..aef029e 100644
--- a/src/@types/detail.ts
+++ b/src/@types/detail.ts
@@ -32,12 +32,15 @@ interface PackageDetailT {
license: string;
}
-
interface RequiresT {
- name: string; flags: string; rel: string; ver: string; epoch: string
+ name: string;
+ flags: string;
+ rel: string;
+ ver: string;
+ epoch: string;
}
interface FilesT {
- fileName: string
+ fileName: string;
}
export interface EpkgDetailT extends PackageDetailT {
@@ -47,15 +50,12 @@ export interface EpkgDetailT extends PackageDetailT {
securityLevel: string | null;
}
-
-
export interface RpmDetailT extends PackageDetailT {
id: string;
rpmSize: string;
rpmUpdateAt: string;
}
-
export interface ImageDetailT extends PackageDetailT {
id: string;
type: string;
@@ -72,3 +72,8 @@ export interface ImageDetailT extends PackageDetailT {
latestOsSupport: boolean;
}
+export interface ParamsKeyT {
+ appPkgId: string | null;
+ epkgPkgId: string | null;
+ rpmPkgId: string | null;
+}
diff --git a/src/components/DetailAside.vue b/src/components/DetailAside.vue
index 728370d..3bf6ac0 100644
--- a/src/components/DetailAside.vue
+++ b/src/components/DetailAside.vue
@@ -185,7 +185,7 @@ const jumpTo = (name: string, id: string) => {
-
+
当前版本 查看
diff --git a/src/utils/common.ts b/src/utils/common.ts
index ce71071..563a509 100644
--- a/src/utils/common.ts
+++ b/src/utils/common.ts
@@ -136,4 +136,15 @@ export const getParamsRules = (data: any) => {
}
});
return newData
+}
+import type { ParamsKeyT } from '@/@types/detail';
+export const getDetailRules = (data: any) => {
+ const newData = {} as any;
+ Object.keys(data).forEach((key) => {
+ const value = data[key as keyof ParamsKeyT];
+ if (value) {
+ newData[key] = value;
+ }
+ });
+ return newData
}
\ No newline at end of file
diff --git a/src/views/apppkg/TheNewDetail.vue b/src/views/apppkg/TheNewDetail.vue
index 8208fb7..65958fa 100644
--- a/src/views/apppkg/TheNewDetail.vue
+++ b/src/views/apppkg/TheNewDetail.vue
@@ -18,7 +18,7 @@ import IconRpm from '~icons/pkg/rpm.svg';
import { columnTags } from '@/data/detail/index';
import { useI18n } from 'vue-i18n';
import { useViewStore } from '@/stores/common';
-
+import { getDetailRules } from '@/utils/common';
const { t } = useI18n();
const route = useRoute();
const { mkit } = useMarkdown();
@@ -64,11 +64,13 @@ const queryEntity = () => {
activeName.value = type as string;
if (pkgId.value) {
- getDetail({
- appPkgId: (appPkgId as string) || '',
- epkgPkgId: (epkgPkgId as string) || '',
- rpmPkgId: (rpmPkgId as string) || '',
- })
+ getDetail(
+ getDetailRules({
+ appPkgId: (appPkgId as string) || '',
+ epkgPkgId: (epkgPkgId as string) || '',
+ rpmPkgId: (rpmPkgId as string) || '',
+ })
+ )
.then((res) => {
const data = res.data;
tabList.value = data.tags;
@@ -220,7 +222,7 @@ const imgList = ref(['概览', 'Tags']);
const imgName = ref('概览');
const tagsValue = ref();
const queryTags = () => {
- getTags(appData.value.name).then((res) => {
+ getTags(encodeURIComponent(appData.value.name as string)).then((res) => {
tagsValue.value = res.data.list;
});
};
@@ -245,7 +247,7 @@ const getTabIcon = (tab: string) => {
//获取支持
const verData = ref();
const queryVer = () => {
- getVer(tabValue.value, appData.value.name).then((res) => {
+ getVer(tabValue.value, encodeURIComponent(appData.value.name as string)).then((res) => {
verData.value = res.data.list;
});
};
diff --git a/src/views/epkg/TheDetail.vue b/src/views/epkg/TheDetail.vue
index 55b2f63..2dafc6c 100644
--- a/src/views/epkg/TheDetail.vue
+++ b/src/views/epkg/TheDetail.vue
@@ -118,7 +118,7 @@ const onExternalDialog = (href: string) => {
//获取支持
const verData = ref();
const queryVer = () => {
- getVer('epkgpkg', appData.value.name).then((res) => {
+ getVer('epkgpkg', encodeURIComponent(appData.value.name as string)).then((res) => {
verData.value = res.data.list;
});
};
diff --git a/src/views/image/TheDetail.vue b/src/views/image/TheDetail.vue
index 720b88c..55a8410 100644
--- a/src/views/image/TheDetail.vue
+++ b/src/views/image/TheDetail.vue
@@ -104,7 +104,7 @@ const getDetailValue = (data: ImageDetailT) => {
const tagsValue = ref();
const queryTags = () => {
- getTags(appData.value.name).then((res) => {
+ getTags(encodeURIComponent(appData.value.name as string)).then((res) => {
tagsValue.value = res.data.list;
});
};
@@ -118,7 +118,7 @@ const onChange = (v: string) => {
//获取支持
const verData = ref();
const queryVer = () => {
- getVer('apppkg', appData.value.name).then((res) => {
+ getVer('apppkg', encodeURIComponent(appData.value.name as string)).then((res) => {
verData.value = res.data.list;
});
};
diff --git a/src/views/package/TheDetail.vue b/src/views/package/TheDetail.vue
index f3fa8d2..a221509 100644
--- a/src/views/package/TheDetail.vue
+++ b/src/views/package/TheDetail.vue
@@ -111,7 +111,7 @@ const onExternalDialog = (href: string) => {
//获取支持
const verData = ref();
const queryVer = () => {
- getVer('rpmpkg', appData.value.name).then((res) => {
+ getVer('rpmpkg', encodeURIComponent(appData.value.name as string)).then((res) => {
verData.value = res.data.list;
});
};
--
Gitee
From 3d2f56a2a4756ac28580332b4c642df5758604ad Mon Sep 17 00:00:00 2001
From: ailoooong
Date: Sat, 25 May 2024 09:56:43 +0800
Subject: [PATCH 7/7] =?UTF-8?q?fix:=20=E8=AF=A6=E6=83=85=E6=9B=B4=E5=A4=9A?=
=?UTF-8?q?=E4=BF=A1=E6=81=AF=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/@types/app.ts | 13 +++++++++++++
src/assets/style/detail/index.scss | 11 ++++++++++-
src/views/apppkg/TheNewDetail.vue | 22 ++++++++++++++++++----
src/views/epkg/TheDetail.vue | 24 ++++++++++++++++--------
src/views/image/TheDetail.vue | 2 +-
src/views/package/TheDetail.vue | 22 +++++++++++++++-------
6 files changed, 73 insertions(+), 21 deletions(-)
diff --git a/src/@types/app.ts b/src/@types/app.ts
index f657852..9cb2379 100644
--- a/src/@types/app.ts
+++ b/src/@types/app.ts
@@ -48,5 +48,18 @@ export interface HomeInfoT {
href: string;
}
+export interface MoreMessgeT {
+ name: string;
+ value: MoreMessgeItemT[];
+}
+export interface MoreMessgeItemT {
+ name: string;
+ flags: string;
+ rel: string;
+ ver: string;
+ epoch: string;
+}
+
+
export type PkgTypeT = 'RPM' | 'IMAGE' | 'EPKG';
\ No newline at end of file
diff --git a/src/assets/style/detail/index.scss b/src/assets/style/detail/index.scss
index fa6381b..1ab8e23 100644
--- a/src/assets/style/detail/index.scss
+++ b/src/assets/style/detail/index.scss
@@ -50,7 +50,7 @@
--table-edge-padding: 24px;
}
// 容器镜像样式
- &.switch {
+ &.tabs-switch {
.o-tab-nav-list {
background: #ededf0;
border-radius: 8px;
@@ -74,6 +74,15 @@
}
}
}
+ &.tabs-one {
+ .o-tab-nav-active {
+ color: var(--o-color-info1);
+ cursor: default;
+ }
+ .o-tab-nav-anchor {
+ display: none;
+ }
+ }
}
.code-box {
diff --git a/src/views/apppkg/TheNewDetail.vue b/src/views/apppkg/TheNewDetail.vue
index 65958fa..3d41b87 100644
--- a/src/views/apppkg/TheNewDetail.vue
+++ b/src/views/apppkg/TheNewDetail.vue
@@ -4,7 +4,7 @@ import { OTab, OTabPane, OTable, OLink, OIcon, OTag } from '@opensig/opendesign'
import { useRoute } from 'vue-router';
import { getDetails, getDetail, getTags, getVer } from '@/api/api-domain';
import { useMarkdown } from '@/composables/useMarkdown';
-import type { AppInfoT, MaintainerT, DetailItemT } from '@/@types/app';
+import type { AppInfoT, MaintainerT, DetailItemT, MoreMessgeT } from '@/@types/app';
import { OPENEULER_CONTACT } from '@/data/config';
import AppFeedback from '@/components/AppFeedback.vue';
@@ -33,7 +33,7 @@ const files = ref([]);
const maintainer = ref({ maintainerId: '', maintainerEmail: '', maintainerGiteeId: '' });
const upStream = ref();
const security = ref();
-const moreMessge = ref([]);
+const moreMessge = ref([]);
const description = ref();
const appData = ref({
name: '',
@@ -165,11 +165,19 @@ const getDetailValue = (data: any) => {
{ name: 'Repo源', value: JSON.parse(data?.repoType).url, type: JSON.parse(data?.repoType).type },
];
files.value = JSON.parse(data?.files);
- moreMessge.value = [
+ const newData = [
{ name: 'Requires', value: JSON.parse(data?.requires || '') },
{ name: 'Provides', value: JSON.parse(data?.provides || '') },
{ name: 'Conflicts', value: JSON.parse(data?.conflicts || '') },
];
+
+ // 过滤空数据
+ newData.forEach((item) => {
+ if (item.value.length > 0) {
+ moreMessge.value.push(item);
+ }
+ });
+
appData.value.size = data.epkgSize || 0;
summary.value = data.summary;
version.value = data?.version;
@@ -296,7 +304,13 @@ const repeatTags = (v: string) => {
> 安装指引
> 更多信息
-
+
diff --git a/src/views/epkg/TheDetail.vue b/src/views/epkg/TheDetail.vue
index 2dafc6c..960515e 100644
--- a/src/views/epkg/TheDetail.vue
+++ b/src/views/epkg/TheDetail.vue
@@ -4,7 +4,7 @@ import { OTab, OTabPane, OTable, OLink } from '@opensig/opendesign';
import { OPENEULER_CONTACT } from '@/data/config';
import { useRoute } from 'vue-router';
import { useMarkdown } from '@/composables/useMarkdown';
-import type { AppInfoT, MaintainerT, DetailItemT } from '@/@types/app';
+import type { AppInfoT, MaintainerT, DetailItemT, MoreMessgeT } from '@/@types/app';
import { useI18n } from 'vue-i18n';
import { getDetails, getVer } from '@/api/api-domain';
import AppFeedback from '@/components/AppFeedback.vue';
@@ -27,7 +27,7 @@ const files = ref([]);
const maintainer = ref({ maintainerId: '', maintainerEmail: '', maintainerGiteeId: '' });
const upStream = ref();
const security = ref();
-const moreMessge = ref([]);
+const moreMessge = ref([]);
const description = ref();
const appData = ref({
name: '',
@@ -81,11 +81,19 @@ const getDetailValue = (data: any) => {
} catch (res) {}
files.value = JSON.parse(data?.files);
summary.value = data.summary;
- moreMessge.value = [
- { name: 'Requires', value: JSON.parse(data?.requires || '') },
- { name: 'Provides', value: JSON.parse(data?.provides || '') },
- { name: 'Conflicts', value: JSON.parse(data?.conflicts || '') },
+
+ const newData = [
+ { name: 'Requires', value: JSON.parse(data?.requires || []) },
+ { name: 'Provides', value: JSON.parse(data?.provides || []) },
+ { name: 'Conflicts', value: JSON.parse(data?.conflicts || []) },
];
+ // 过滤空数据
+ newData.forEach((item) => {
+ if (item.value.length > 0) {
+ moreMessge.value.push(item);
+ }
+ });
+
appData.value.size = data.epkgSize;
tagVer.value = [data.osSupport, data.arch];
maintainer.value = {
@@ -157,9 +165,9 @@ const queryVer = () => {
> 更多信息
-
+
-
+
diff --git a/src/views/image/TheDetail.vue b/src/views/image/TheDetail.vue
index 55a8410..628399a 100644
--- a/src/views/image/TheDetail.vue
+++ b/src/views/image/TheDetail.vue
@@ -134,7 +134,7 @@ const queryVer = () => {
-
+
diff --git a/src/views/package/TheDetail.vue b/src/views/package/TheDetail.vue
index a221509..7c7bd0d 100644
--- a/src/views/package/TheDetail.vue
+++ b/src/views/package/TheDetail.vue
@@ -4,7 +4,7 @@ import { OTab, OTabPane, OTable, OLink } from '@opensig/opendesign';
import { OPENEULER_CONTACT } from '@/data/config';
import { useRoute } from 'vue-router';
import { useMarkdown } from '@/composables/useMarkdown';
-import type { AppInfoT, MaintainerT, DetailItemT } from '@/@types/app';
+import type { AppInfoT, MaintainerT, DetailItemT, MoreMessgeT } from '@/@types/app';
import { getDetails, getVer } from '@/api/api-domain';
import defaultImg from '@/assets/default-logo.png';
import AppFeedback from '@/components/AppFeedback.vue';
@@ -23,7 +23,7 @@ const downloadData = ref('');
const maintainer = ref
({ maintainerId: '', maintainerEmail: '', maintainerGiteeId: '' });
const upStream = ref();
const security = ref();
-const moreMessge = ref([]);
+const moreMessge = ref([]);
const description = ref();
const appData = ref({
name: '',
@@ -61,6 +61,7 @@ const getPkg = (tabValue: string) => {
onMounted(() => {
queryEntity();
});
+
const summary = ref();
const license = ref();
const tagVer = ref();
@@ -74,11 +75,18 @@ const getDetailValue = (data: any) => {
{ name: 'Repo源', value: JSON.parse(data?.repoType).url, type: JSON.parse(data?.repoType).type },
];
summary.value = data.summary;
- moreMessge.value = [
- { name: 'Requires', value: JSON.parse(data?.requires || '') },
- { name: 'Provides', value: JSON.parse(data?.provides || '') },
- { name: 'Conflicts', value: JSON.parse(data?.conflicts || '') },
+ const newData = [
+ { name: 'Requires', value: JSON.parse(data?.requires || []) },
+ { name: 'Provides', value: JSON.parse(data?.provides || []) },
+ { name: 'Conflicts', value: JSON.parse(data?.conflicts || []) },
];
+ // 过滤空数据
+ newData.forEach((item) => {
+ if (item.value.length > 0) {
+ moreMessge.value.push(item);
+ }
+ });
+
appData.value.size = data.rpmSize;
tagVer.value = [data.osSupport, data.arch];
maintainer.value = {
@@ -148,7 +156,7 @@ const queryVer = () => {
> 安装指引
> 更多信息
-
+
--
Gitee