搜索结果列表页面开发

This commit is contained in:
付民康
2025-03-12 18:41:20 +08:00
commit 7cebe8fc00
739 changed files with 88149 additions and 0 deletions

26
src/constant/discuss.ts Normal file
View File

@@ -0,0 +1,26 @@
import type { RadioOption } from '@/api/discussion/types';
const config = {};
export default config;
export const debounceTime = 300;
export enum VISIBILITY {
PUBLIC = 'public',
PRIVATE = 'private',
INTERNAL = 'internal'
}
export const defaultGroup: RadioOption<string> = {
value: 'default',
label: '不设置分组'
};
// 讨论四种基础类型
export enum DISCUSS_FORMAT {
OPEN=1, // 开放讨论形式
QANDA=2, // 问答形式
ANNOUNCE=3, // 公告 - 管理员才能创建和维护
VOTE=4 // 投票
}

17
src/constant/enum.ts Normal file
View File

@@ -0,0 +1,17 @@
export enum VISIBILITY {
INTERNAL = 'internal',
PRIVATE = 'private',
PUBLIC = 'public'
}
export enum SORTBY {
ASC = 'asc',
DESC = 'desc'
}
export enum TIMESORT {
CREATED_ASC = 'created_asc',
CREATED_DESC = 'created_desc',
UPDATED_ASC = 'updated_asc',
UPDATED_DESC = 'updated_desc',
}

40
src/constant/index.ts Normal file
View File

@@ -0,0 +1,40 @@
/* 全局枚举配置 */
export enum VISIBILITY {
PUBLIC = 'public',
PRIVATE = 'private',
INTERNAL = 'internal'
}
export enum SORT {
DESC = 'desc',
ASC = 'asc'
};
export enum COMMENT {
ISSUE = 1,
MR = 2,
COMMIT = 3,
DISCUSS = 4,
}
export const repoTypeOption = [
{ name: '私有', value: 'private' },
// { name: '内部', value: 'internal' },
{ name: '公开', value: 'public' }
];
export const localStorageKeys = {
merge_showformat_setting: 'merge_showformat_setting'
};
export const sortBy = [
{ label: '最近', value: 'desc' },
{ label: '较早', value: 'asc' }
];
export const timeSort = [
{ label: '较早创建', value: 'created_asc' },
{ label: '最近创建', value: 'created_desc' },
{ label: '较早更新', value: 'updated_asc' },
{ label: '最近更新', value: 'updated_desc' }
];

79
src/constant/issue.ts Normal file
View File

@@ -0,0 +1,79 @@
export enum ISSUE_STATE {
OPENED = 'opened',
CLOSED = 'closed',
}
export enum ISSUE_SCOPE {
ALL = 'all',
CREATED_BY_ME = 'created_by_me',
ASSIGNED_TO_ME = 'assigned_to_me',
}
export enum ISSUEORDERBY {
CREATED_AT = 'created_at',
UPDATED_AT = 'updated_at',
}
export const issueOrderBy = [
{ label: '创建', value: 'created_at' },
{ label: '更新', value: 'updated_at' }
];
export const issueStateOption = {
opened: {
state: 'opened',
label: '已开启',
icon: 'gt-issue',
color: 'var(--color-danger)',
bgColor: '#FDF4F6'
},
closed: {
state: 'closed',
label: '已关闭',
icon: 'gt-closed-issue',
color: 'var(--color-success)',
bgColor: 'rgb(230, 247, 241)'
}
};
export enum ISSUE_EVENT {
TITLE = 'title',
DESCRIPTION = 'description',
ASSIGNEE = 'assignee',
LOCKED = 'locked',
CLOSED = 'closed',
UNLOCKED = 'unlocked',
OPENED = 'opened',
MILESTONE = 'milestone',
LABEL = 'label',
}
export const issueEventOption = {
title: {
icon: 'gt-plane-edit'
},
description: {
icon: 'gt-plane-edit'
},
assignee: {
icon: 'gt-plane-users'
},
locked: {
icon: 'gt-plane-lock'
},
closed: {
icon: 'gt-plane-issue'
},
unlocked: {
icon: 'gt-plane-ok'
},
opened: {
icon: 'gt-plane-openlock'
},
milestone: {
icon: 'gt-plane-topics'
},
label: {
icon: 'gt-plane-tag'
}
};

549
src/constant/menu.ts Normal file
View File

@@ -0,0 +1,549 @@
export default {
repo: [
{
id: 'repoDashboard',
icon: 'gt-plane-home',
activeIcon: 'gt-plane-home-red',
label: '首页'
},
{
id: 'repo',
icon: 'gt-plane-code',
activeIcon: 'gt-plane-code-red',
label: '代码'
},
{
id: 'repoIssues',
icon: 'gt-plane-issues',
activeIcon: 'gt-plane-issues-red',
label: 'Issues'
},
{
id: 'repoMerge',
icon: 'gt-plane-pullRequest',
activeIcon: 'gt-plane-pullRequest-red',
label: 'Pull Requests'
},
{
id: 'repoDiscussion',
icon: 'gt-plane-discussions',
activeIcon: 'gt-plane-discussions-red',
label: '讨论'
},
{
id: 'repoWiki',
icon: 'gt-plane-wiki',
activeIcon: 'gt-plane-wiki-red',
label: 'Wiki'
},
{
id: 'repoMember',
icon: 'gt-plane-users',
activeIcon: 'gt-plane-users-red',
label: '项目成员',
permission: 'visitor'
},
{
id: 'repoAnalysis',
icon: 'gt-plane-insight',
activeIcon: 'gt-plane-insight-red',
label: '分析'
},
{
id: 'repoSetting',
icon: 'gt-plane-setting',
activeIcon: 'gt-plane-setting-red',
label: '项目设置',
permission: 'admin'
},
],
repoData: [
{
id: 'repoAnalysis',
label: '仓库统计',
icon: 'gt-merge'
},
{
id: 'repoGraph',
label: '仓库分支图',
icon: 'gt-branch-c'
}
],
org: [
{
id: 'homepage',
label: '主页',
icon: 'gt-home'
},
{
id: 'orgRepos',
label: '项目',
icon: 'gt-folder'
},
{
id: '/organization/:namespace/article',
label: '技术文章',
icon: 'gt-file2',
devpress: true
},
// {
// id: 'orgIssue',
// label: 'Issue',
// permission: 'visitor',
// icon: 'gt-issue'
// },
// {
// id: 'orgMerge',
// label: '合并请求',
// permission: 'visitor',
// icon: 'gt-closed-merge'
// },
{
id: 'orgDiscussion',
label: '热门讨论',
icon: 'gt-comment'
},
{
id: '/organization/:namespace/activity',
label: '最新活动',
icon: 'gt-calendar',
devpress: true
},
{
id: 'orgMember',
label: '组织成员',
// number: 12,
permission: 'visitor',
icon: 'gt-member'
},
{
id: 'orgSetting',
label: '组织设置',
permission: 'admin',
icon: 'gt-setting'
}
],
user: [
{
id: 'homepage',
label: '主页',
icon: 'gt-home'
},
{
id: 'userRepos',
label: '项目',
icon: 'gt-folder'
},
{
id: 'userStars',
label: 'Stars',
icon: 'gt-star'
}
],
orgSetting: [
{
id: 'orgSetting',
label: '基础设置',
icon: ''
},
{
id: 'orgSettingMember',
label: '成员管理',
menuType: '用户管理'
},
{
id: 'orgSettingDefault',
label: '默认设置',
menuType: '项目设置'
},
// {
// id: '/organization/setting/push-msg',
// label: '触达消息',
// menuType: '用户管理',
// devpress: true
// },
{
id: '/organization/setting/people',
label: '粉丝管理',
menuType: '用户管理',
devpress: true
},
{
id: 'orgWebhook',
label: 'WebHook',
menuType: '项目设置',
},
{
id: 'orgSettingCla',
label: '贡献者协议 CLA',
menuType: '项目设置'
},
{
id: '/organization/setting/content',
label: '文章管理',
menuType: '内容管理',
devpress: true
},
{
id: '/organization/setting/column',
label: '专栏管理',
menuType: '内容管理',
devpress: true
},
{
id: '/organization/setting/included',
label: '收录管理',
menuType: '内容管理',
devpress: true
},
{
id: '/organization/setting/comment-manage',
label: '评论管理',
menuType: '内容管理',
devpress: true
},
{
id: '/organization/setting/live',
label: '活动设置',
menuType: '活动管理',
devpress: true
},
{
id: '/organization/setting/retained-capital',
label: '活动表单',
menuType: '活动管理',
devpress: true
},
{
id: '/organization/setting/rotation-right',
label: '详情页Banner',
menuType: '运营位管理',
devpress: true
},
{
id: '/organization/setting/rotation',
label: '首页Banner',
menuType: '运营位管理',
devpress: true
},
{
id: '/organization/setting/navigation',
label: '自定义导航',
menuType: '运营位管理',
devpress: true
},
// {
// id: '/organization/setting/data-user',
// label: '用户分析',
// menuType: '数据统计',
// devpress: true
// },
{
id: '/organization/setting/data-source',
label: '渠道分析',
menuType: '数据统计',
devpress: true
},
{
id: '/organization/setting/data-content',
label: '内容分析',
menuType: '数据统计',
devpress: true
},
{
id: 'orgSettingStock',
label: '用量及存储',
menuType: '数据统计',
icon: ''
}
// {
// id: 'orgSettingRepo',
// label: '项目默认设置'
// },
// {
// id: 'orgSettingLabels',
// label: 'Labels'
// },
// {
// id: 'orgSettingMilestone',
// label: '里程碑'
// },
// {
// id: 'orgSettingCla',
// label: '贡献者协议CLA'
// },
// {
// id: 'orgWebhook',
// label: 'WebHook'
// },
// {
// id: 'orgSettingDiscussion',
// label: '讨论',
// icon: 'gt-comment-c'
// },
// {
// id: 'orgSettingDoubleAuth',
// label: '两步认证'
// }
// {
// id: 'communityManagement',
// label: '社区管理',
// icon: 'gt-community-c',
// isNew: true,
// children: [
// {
// id: 'orgSettingCommunityStatus',
// label: '社区设置'
// },
// {
// id: 'orgSettingCommunitySetup',
// label: '内容管理'
// }
// ]
// }
],
repoSetting: [
{
id: 'repoSetting',
label: '基础设置',
icon: 'gt-plane-setting',
activeIcon: 'gt-plane-setting-red'
},
{
id: 'repoSettingMember',
label: '项目成员',
icon: 'gt-plane-users',
activeIcon: 'gt-plane-users-red',
menuType: '权限'
},
// {
// id: 'repoSettingEmail',
// label: '邮件通知设置'
// },
{
id: 'repoSettingRepo',
label: '仓库设置',
icon: 'gt-plane-warehouse',
activeIcon: 'gt-plane-warehouse-red',
menuType: '仓库管理'
},
{
id: 'repoSettingCommit',
label: '提交设置',
icon: 'gt-plane-rule',
activeIcon: 'gt-plane-rule-red',
menuType: '仓库管理'
},
{
id: 'repoSettingMirror',
label: '仓库镜像',
icon: 'gt-plane-mirroring',
activeIcon: 'gt-plane-mirroring-red',
menuType: '仓库管理'
},
{
id: 'repoSettingBranch',
label: '保护分支',
icon: 'gt-plane-branches',
activeIcon: 'gt-plane-branches-red',
menuType: '分支管理'
},
{
id: 'repoSettingTags',
label: '保护 Tag',
icon: 'gt-plane-tag',
activeIcon: 'gt-plane-tag-red',
menuType: '分支管理'
},
{
id: 'repoSettingMerge',
label: 'Pull Requests设置',
icon: 'gt-plane-pullRequest',
activeIcon: 'gt-plane-pullRequest-red',
menuType: '分支管理'
},
{
id: 'repoSettingExamine',
label: 'PR 审查设置',
icon: 'gt-plane-codeanalysis',
activeIcon: 'gt-plane-codeanalysis-red',
menuType: '分支管理'
},
{
id: 'repoWebhook',
label: 'WebHook',
icon: 'gt-plane-webhook',
activeIcon: 'gt-plane-webhook-red',
menuType: '服务集成'
},
// {
// id: 'repoSecret',
// label: '部署密钥'
// },
{
id: 'repoSettingLogs',
label: '审计日志',
icon: 'gt-plane-file',
activeIcon: 'gt-plane-file-red',
menuType: '安全管理'
}
],
userSetting: [
{
id: 'setting',
label: '用户资料',
icon: 'gt-plane-user',
activeIcon: 'gt-plane-user-red'
},
{
id: 'settingCla',
label: '已签署CLA',
icon: 'gt-plane-CLA',
activeIcon: 'gt-plane-CLA-red'
},
{
id: 'settingAccount',
label: '账号设置',
icon: 'gt-plane-setting',
activeIcon: 'gt-plane-setting-red'
},
{
id: 'settingPreference',
label: '偏好设置',
icon: 'gt-plane-advancedSearch',
activeIcon: 'gt-plane-advancedSearch-red'
},
// {
// id: 'settingNotice',
// label: '通知设置'
// },
{
id: 'settingOrganization',
label: '组织管理',
icon: 'gt-plane-organization',
activeIcon: 'gt-plane-organization-red',
menuType: '权限'
},
// {
// id: 'settingReply',
// label: '快捷回复'
// },
{
id: 'settingEmail',
label: '电子邮件',
icon: 'gt-plane-email',
activeIcon: 'gt-plane-email-red',
menuType: '权限'
},
// {
// id: 'settingPassword',
// label: '密码设置',
// icon: 'gt-lock-c',
// menuType: '权限'
// },
{
icon: 'gt-plane-GPG',
activeIcon: 'gt-plane-GPG-red',
label: '公钥管理',
id: 'submenuSecretKey',
menuType: '权限',
children: [
{
id: 'settingSSH',
label: 'SSH公钥'
},
{
id: 'settingGPG',
label: 'GPG公钥'
}
]
},
{
id: 'settingSession',
label: '活动会话',
icon: 'gt-plane-airwaves',
activeIcon: 'gt-plane-airwaves-red',
menuType: '权限'
},
{
id: 'settingRepo',
label: '项目管理',
icon: 'gt-plane-projects',
activeIcon: 'gt-plane-projects-red',
menuType: '项目'
},
// {
// id: 'settingLog',
// label: '审计日志'
// },
{
icon: 'gt-plane-pipeline',
activeIcon: 'gt-plane-pipeline-red',
label: '流水线',
id: 'settingPipeline',
menuType: '流水线'
},
{
id: 'settingClassic',
label: '访问令牌(经典)',
icon: 'gt-plane-accessPassword',
activeIcon: 'gt-plane-accessPassword-red',
menuType: '开发者'
}
],
dashBoardSetting: [
{
id: 'submenuIssue',
label: 'Issue',
icon: 'gt-issue-c',
activeIcon: '',
children: [
{
id: 'issues',
label: '我创建的'
},
{
id: 'issuesAssigned',
label: '我负责的'
}
]
},
{
id: 'submenuDiscussion',
label: '讨论',
icon: 'gt-comment-c',
activeIcon: '',
children: [
{
id: 'discussionCreated',
label: '我创建的'
},
{
id: 'discussionJoined',
label: '我参与的'
}
]
},
{
id: 'submenuMerge',
label: '合并请求',
icon: 'gt-me-merge-c',
activeIcon: '',
children: [
{
id: 'merge',
label: '我创建的'
},
{
id: 'mergeAssigned',
label: '我负责的'
},
{
id: 'mergeReviewed',
label: '我评审的'
}
]
}
]
};

108
src/constant/mr.ts Normal file
View File

@@ -0,0 +1,108 @@
export enum MR_STATE {
ALL = 'all',
OPENED = 'opened',
MERGED = 'merged',
CLOSED = 'closed',
LOCKED = 'locked',
}
export enum MR_SCOPE {
ALL = 'all',
CREATED_BY_ME = 'created_by_me',
ASSIGNED_TO_ME = 'assigned_to_me',
NEED_MY_REVIEW = 'need_my_review',
}
export enum SORTBY {
DESC = 'desc',
ASC = 'asc',
}
export const sortBy = [
{ label: '最近', value: 'desc' },
{ label: '较早', value: 'asc' }
];
export enum MRORDERBY {
CREATED_AT = 'created_at',
UPDATED_AT = 'updated_at',
MERGED_AT = 'merged_at'
}
export const mrOrderBy = [
{ label: '创建', value: 'created_at' },
{ label: '更新', value: 'updated_at' }
// { label: '合并', value: 'merged_at' }
];
export const mrStateOption = {
opened: {
icon: 'gt-merge-request',
label: '已开启',
color: 'var(--color-Y500,#F5AB0B)',
bgColor: 'rgba(245,171,11,0.1)'
},
closed: {
icon: 'gt-skip-merge',
label: '已关闭',
color: 'var(--color-G600,#9A9B9C)',
bgColor: 'rgba(154,155,156,0.1)'
},
merged: {
icon: 'gt-closed-merge',
label: '已合并',
color: 'var(--color-GN500,#0EB07B)',
bgColor: 'rgb(230, 247, 241)'
}
};
export enum MR_EVENT {
TITLE = 'title',
DESCRIPTION = 'description',
ASSIGNEE = 'assignee',
LOCKED = 'locked',
CLOSED = 'closed',
UNLOCKED = 'unlocked',
OPENED = 'opened',
MILESTONE = 'milestone',
MERGED = 'merged',
MR_CHANGE = 'mr_change',
DISCUSSION = 'discussion',
LABEL = 'label',
}
export const mrEventOption = {
title: {
icon: 'gt-plane-edit'
},
description: {
icon: 'gt-plane-edit'
},
assignee: {
icon: 'gt-plane-users'
},
locked: {
icon: 'gt-plane-lock'
},
closed: {
icon: 'gt-plane-skip1'
},
unlocked: {
icon: 'gt-plane-openlock1'
},
opened: {
icon: 'gt-plane-issues'
},
milestone: {
icon: 'gt-plane-topics'
},
merged: {
icon: 'plane-merge'
},
mr_change: {
icon: 'gt-plane-users'
},
label: {
icon: 'gt-plane-tag'
}
};