From 3d30ecaa5e9a211bf9be4b1324022494a85c0eac Mon Sep 17 00:00:00 2001 From: haml-707 <845831435@qq.com> Date: Mon, 9 Jan 2023 17:02:34 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E9=87=8C=E7=A8=8B=E7=A2=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix:默认选项 fix:nginx 切换测试环境 feat:上线正式环境 fix:api 位置修改 fix:api 外链打开 --- src/api/api-quick-issue.ts | 4 +- src/components/AppHeader.vue | 25 ++++++-- src/components/ONav.vue | 6 +- src/i18n/quick-issue/quick-issue-en.ts | 1 + src/i18n/quick-issue/quick-issue-zh.ts | 2 +- src/routers/index.ts | 20 +------ src/shared/@types/type-quick-issue.ts | 1 + src/views/TheQuickIssue.vue | 80 +++++++++++++++++++++++++- 8 files changed, 110 insertions(+), 29 deletions(-) diff --git a/src/api/api-quick-issue.ts b/src/api/api-quick-issue.ts index b5599f0..e4fc47d 100644 --- a/src/api/api-quick-issue.ts +++ b/src/api/api-quick-issue.ts @@ -13,11 +13,13 @@ export function getRepoIssue(params: IssueQueryData) { if ( typeof params.label === 'object' && typeof params.issue_state === 'object' && - typeof params.exclusion === 'object' + typeof params.exclusion === 'object' && + typeof params.milestone === 'object' ) { params.exclusion = params.exclusion.join(','); params.label = params.label.join(','); params.issue_state = params.issue_state.join(','); + params.milestone = params.milestone.join(','); } return request .get(url, { params }) diff --git a/src/components/AppHeader.vue b/src/components/AppHeader.vue index 4bb7e76..7a64eb7 100644 --- a/src/components/AppHeader.vue +++ b/src/components/AppHeader.vue @@ -12,7 +12,6 @@ import communityLogoWhite from '@/assets/openeuler-logo.png'; import QuickIssueLogo from '@/assets/quickissue-logo.png'; import IconDown from '~icons/app/icon-chevron-down.svg'; import IconLogin from '~icons/app/icon-login.svg'; -import { router } from '@/routers'; const { t, locale } = useI18n({ useScope: 'global' }); @@ -51,8 +50,9 @@ const handleCommand = (command: any): void => { const newHref = pathname.split('/'); newHref[1] = command.value; useLangStore().setLangStore(command.value); - router.push(newHref.join('/')); + window.location.href = newHref.join('/'); }; + watch( () => { return locale.value as string; @@ -61,6 +61,7 @@ watch( useLangStore().setLangStore(val); } ); + const jumpToUserZone = () => { const language = lang.value === 'zh' ? 'zh' : 'en'; const origin = import.meta.env.VITE_LOGIN_ORIGIN; @@ -81,6 +82,7 @@ const jumpToUserZone = () => {
+
@@ -90,7 +92,9 @@ const jumpToUserZone = () => { class="opt-img" />
-

{{ guardAuthClient.username }}

+

+ {{ guardAuthClient.username }} +

+ + API +
@@ -123,6 +134,7 @@ const jumpToUserZone = () => {
+ {{ t('quickIssue.SUBMIT_ISSUE') }} @@ -154,7 +166,7 @@ const jumpToUserZone = () => { .language { display: flex; justify-content: flex-end; - margin-right: 48px; + margin-right: 40px; width: 100px; text-align: right; .el-dropdown { @@ -170,6 +182,11 @@ const jumpToUserZone = () => { } } } + .api-docs { + margin-right: 40px; + font-size: var(--o-font-size-h8); + color: #fff; + } } &.isabout { background: #000; diff --git a/src/components/ONav.vue b/src/components/ONav.vue index 2b361c6..6d0a276 100644 --- a/src/components/ONav.vue +++ b/src/components/ONav.vue @@ -23,8 +23,8 @@ const props = defineProps({ const { navItems } = toRefs(props); const activeItem = ref(route.path); -const navClick = (path: string) => { - router.push(path); +const navClick = (path: string, windowOpen: boolean) => { + windowOpen ? window.open(path) : router.push(path); }; watch( () => { @@ -43,7 +43,7 @@ watch( :key="item.id" :class="[activeItem === item.link ? 'active' : '']" class="nav-item" - @click="navClick(item.link)" + @click="navClick(item.link, item.windowOpen)" > {{ item.label }} diff --git a/src/i18n/quick-issue/quick-issue-en.ts b/src/i18n/quick-issue/quick-issue-en.ts index a89068e..8c8154d 100644 --- a/src/i18n/quick-issue/quick-issue-en.ts +++ b/src/i18n/quick-issue/quick-issue-en.ts @@ -20,6 +20,7 @@ export default { TYPE: 'Type', PRIORITY: 'Priority', SUBMITTER: 'Creator', + MILESTONE: 'Milestone', ASSIGNER: 'Assignees', LABEL: 'Labels', SELECT_LABEL: 'Include Labels', diff --git a/src/i18n/quick-issue/quick-issue-zh.ts b/src/i18n/quick-issue/quick-issue-zh.ts index 3951124..a10bba7 100644 --- a/src/i18n/quick-issue/quick-issue-zh.ts +++ b/src/i18n/quick-issue/quick-issue-zh.ts @@ -25,7 +25,7 @@ export default { SELECT_LABEL: '选择标签', BRANCH: '分支', RELATION_BRANCH: '关联分支', - MILEPOST: '里程碑', + MILESTONE: '里程碑', CREATED_AT: '提交时间', UPDATE_AT: '更新时间', CANCEL: '取消选项', diff --git a/src/routers/index.ts b/src/routers/index.ts index 14641e6..5c306a3 100644 --- a/src/routers/index.ts +++ b/src/routers/index.ts @@ -3,36 +3,22 @@ import { useLangStore } from '@/stores'; export const routes: RouteRecordRaw[] = [ { path: '/', redirect: '/zh/issues' }, - // zh { path: '/zh/issues', name: 'issues', + alias: '/en/issues', component: () => import('@/views/TheQuickIssue.vue'), }, { path: '/zh/pulls', name: 'pulls', + alias: '/en/pulls', component: () => import('@/views/pull-request/PullRequest.vue'), }, { path: '/zh/new-issues', name: 'new-issues', - component: () => import('@/views/submit-issue/SubmitIssue.vue'), - }, - // en - { - path: '/en/issues', - name: 'issues_en', - component: () => import('@/views/TheQuickIssue.vue'), - }, - { - path: '/en/pulls', - name: 'pulls_en', - component: () => import('@/views/pull-request/PullRequest.vue'), - }, - { - path: '/en/new-issues', - name: 'new-issues_en', + alias: '/en/new-issues', component: () => import('@/views/submit-issue/SubmitIssue.vue'), }, ]; diff --git a/src/shared/@types/type-quick-issue.ts b/src/shared/@types/type-quick-issue.ts index 4ccb663..2eb93e9 100644 --- a/src/shared/@types/type-quick-issue.ts +++ b/src/shared/@types/type-quick-issue.ts @@ -13,6 +13,7 @@ export interface IssueQueryData { branch: string; repo: string; issue_state: Array | string; + milestone: Array | string; } export interface OptionList { diff --git a/src/views/TheQuickIssue.vue b/src/views/TheQuickIssue.vue index 923f0a4..a1ab69e 100644 --- a/src/views/TheQuickIssue.vue +++ b/src/views/TheQuickIssue.vue @@ -54,6 +54,7 @@ const keyArr = [ 'reposList', 'typesList', 'exLabelsList', + 'milestonesList', ]; const filterList = ref(new Map()); @@ -126,6 +127,14 @@ const titleList = ref( }), }, ], + [ + 'milestone', + { + value: computed(() => { + return t('quickIssue.MILESTONE'); + }), + }, + ], [ 'label', { @@ -186,6 +195,7 @@ const queryData = reactive({ branch: '', repo: '', issue_state: [], + milestone: [], exclusion: [], }); @@ -193,7 +203,6 @@ const optionQuery = reactive({ page: 1, per_page: 40, keyword: '', - mode: 'local', }); const handleTitleClick = (title: string) => { @@ -354,6 +363,7 @@ onMounted(() => { getOption('branches'); getOption('types'); getOption('repos'); + getOption('milestones'); }); watch( () => checkedTitle, @@ -577,6 +587,70 @@ watch( + + + +