From 39fa8b40c5642bd4da2807c3a2fc3b1f81a498ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=98=E6=B0=91=E5=BA=B7?= Date: Thu, 13 Mar 2025 16:09:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=AF=E4=BF=A1=E4=BB=A3=E7=A0=81=E5=BA=93-?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E5=88=97=E8=A1=A8=E9=A1=B5=E9=9D=A2=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/assets/css/jyh.scss | 98 +++++ src/assets/css/main.scss | 4 +- src/main.ts | 137 +++---- src/router/config/home.ts | 15 +- src/router/interceptor.ts | 2 +- src/views/Jyh/Search/Components/OssQuery.vue | 364 +++++++++++++++++++ src/views/Jyh/Search/index.vue | 197 +--------- src/views/Jyh/Search/license.vue | 357 ++++++++++++++++++ yarn.lock | 2 +- 10 files changed, 927 insertions(+), 251 deletions(-) create mode 100644 src/views/Jyh/Search/Components/OssQuery.vue create mode 100644 src/views/Jyh/Search/license.vue diff --git a/package.json b/package.json index e496ab7..ed424da 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "sortablejs": "^1.15.0", "swiper": "^10.3.1", "vue": "^3.3.4", - "vue-devui": "^1.6.7", + "vue-devui": "^1.6.31", "vue-router": "^4.2.2", "yaml": "^2.4.1" }, diff --git a/src/assets/css/jyh.scss b/src/assets/css/jyh.scss index 60f69ee..28fa572 100644 --- a/src/assets/css/jyh.scss +++ b/src/assets/css/jyh.scss @@ -19,6 +19,10 @@ .jyh-form-operation { margin-left: 20px !important; } + .devui-form__label-help { + width: 14px !important; + height: 14px !important; + } } .jyh-table { @@ -46,4 +50,98 @@ padding-top: 10px !important; padding-bottom: 10px !important; } + .header-container { + .filter-icon { + flex: 0; + margin-left: 8px; + } + .devui-table__sort-clickable { + flex: 0; + height: 16px; + } + } +} + +.jyh-tabs { + .devui-tabs__nav { + border-bottom: 0; + } + + .devui-tabs__nav--wrapped>li.active { + border-radius: 4px 4px 0px 0px; + background: #F3F3F3; + + .devui-tabs__nav-content { + a { + color: #191919; + font-family: HarmonyOS Sans SC; + font-weight: medium; + font-size: 14px; + line-height: 22px; + letter-spacing: 0px; + text-align: left; + } + } + } + .devui-tab__content { + //background: #F3F3F3; + margin-top: 0; + } + .devui-tabs__nav-content { + a { + color: #808080; + font-family: HarmonyOS Sans SC; + font-weight: regular; + font-size: 14px; + line-height: 22px; + letter-spacing: 0px; + text-align: left; + } + } +} + +.jyh-checkbox-group { + div { + margin-top: 0; + } + .devui-checkbox label { + color: #191919; + font-family: HarmonyOS Sans SC; + font-weight: regular; + font-size: 14px; + line-height: 22px; + letter-spacing: 0px; + text-align: left; + + } +} + +.devui-dropdown-menu-multiple { + .devui-select__multiple { + .devui-tag { + .devui-tag--default { + display: flex; + border-radius: 4px; + background: #1919190C; + padding: 0 4px; + font-size: 12px; + line-height: 20px; + height: 20px; + } + .remove-button { + margin-left: 8px; + position: relative; + } + } + } + .devui-select__clearable { + .devui-select__multiple--input { + width: 1px; + min-width: 1px; + } + } +} + +.jyh-select-multiple { + } diff --git a/src/assets/css/main.scss b/src/assets/css/main.scss index 413af43..7ff0af9 100644 --- a/src/assets/css/main.scss +++ b/src/assets/css/main.scss @@ -21,7 +21,9 @@ html { overflow-y: scroll; // html本身没有滚动 为了防止自定义滚动条出现时界面抖动,需要预留轨道 } html body { - background-color: $devui-global-bg; + //background-color: $devui-global-bg; + background-color: #F6F6F8; + font-size: var(--text-sm); color: var(--color-font); } diff --git a/src/main.ts b/src/main.ts index 050ff72..260c957 100644 --- a/src/main.ts +++ b/src/main.ts @@ -21,6 +21,7 @@ import dInput from 'vue-devui/input'; import { FormOperation } from 'vue-devui/form'; import { Option } from 'vue-devui/select'; import { BreadcrumbItem } from 'vue-devui/breadcrumb'; +import { CheckboxGroup as DCheckboxGroup, Checkbox as DCheckbox } from 'vue-devui/checkbox'; import { useReport } from '@/utils/hooks/useReport'; import { savePageRef } from '@/utils'; import qs from 'qs'; @@ -40,73 +41,73 @@ declare global { /** * micro-app 微前端 */ -import microApp from '@micro-zoe/micro-app'; -microApp.start({ - 'disable-memory-router': true, // 关闭虚拟路由系统 - 'disable-patch-request': true, // 关闭对子应用请求的拦截 - lifeCycles: { - created() { - // console.log('created'); - }, - beforemount() { - // console.log('beforemount'); - }, - mounted() { - console.log('fst', performance.now().toFixed()); // 首屏时间 - // console.log('mounted'); - }, - unmount() { - console.log('unmount'); - }, - error(e) { - Sentry.captureException(new Error('主站Error:生命周期错误'), { - level: 'error', - extra: { - ...e - } - }); - } - } -}); -microApp.router.setBaseAppRouter(router); - -microApp.router.beforeEach({ - 'micoro-app-homeweb-app': (to, from) => { - const toQuery = qs.parse(to.search, { ignoreQueryPrefix: true }); - const fromQuery = qs.parse(from.search, { ignoreQueryPrefix: true }); - - if ( - toQuery.type !== fromQuery.type || - (from.pathname === '/search' && fromQuery.threadId && !toQuery.threadId && toQuery.type === 'chat') - ) { - // 设置全局ref - savePageRef(to.fullPath); - } else if (to.pathname === '/search' && toQuery.type === 'chat' && toQuery.threadId) { - const BASE_URL = (import.meta as any).env.VITE_HOST; - sessionStorage.setItem('ref', BASE_URL + to.fullPath); - } else { - savePageRef(to.fullPath); - } - } -}); -microApp.router.afterEach({ - 'micoro-app-homeweb-app': (to, from) => { - const names = { - '/': '首页', - '/search': '搜索', - '/g-star': 'g-star', - '/g-star/apply': 'g-star 申请', - '/explore': '搜索开源' - }; - const toQuery = qs.parse(to.search, { ignoreQueryPrefix: true }); - if (to.pathname === '/search' && toQuery.type !== 'repo') { - // 对话有threadid后上报 - if (toQuery.threadId) useReport('pageview', {}, { 'homeweb-page-title': names[to.pathname] }); - } else { - useReport('pageview', {}, { 'homeweb-page-title': names[to.pathname] }); - } - } -}); +// import microApp from '@micro-zoe/micro-app'; +// microApp.start({ +// 'disable-memory-router': true, // 关闭虚拟路由系统 +// 'disable-patch-request': true, // 关闭对子应用请求的拦截 +// lifeCycles: { +// created() { +// // console.log('created'); +// }, +// beforemount() { +// // console.log('beforemount'); +// }, +// mounted() { +// console.log('fst', performance.now().toFixed()); // 首屏时间 +// // console.log('mounted'); +// }, +// unmount() { +// console.log('unmount'); +// }, +// error(e) { +// Sentry.captureException(new Error('主站Error:生命周期错误'), { +// level: 'error', +// extra: { +// ...e +// } +// }); +// } +// } +// }); +// microApp.router.setBaseAppRouter(router); +// +// microApp.router.beforeEach({ +// 'micoro-app-homeweb-app': (to, from) => { +// const toQuery = qs.parse(to.search, { ignoreQueryPrefix: true }); +// const fromQuery = qs.parse(from.search, { ignoreQueryPrefix: true }); +// +// if ( +// toQuery.type !== fromQuery.type || +// (from.pathname === '/search' && fromQuery.threadId && !toQuery.threadId && toQuery.type === 'chat') +// ) { +// // 设置全局ref +// savePageRef(to.fullPath); +// } else if (to.pathname === '/search' && toQuery.type === 'chat' && toQuery.threadId) { +// const BASE_URL = (import.meta as any).env.VITE_HOST; +// sessionStorage.setItem('ref', BASE_URL + to.fullPath); +// } else { +// savePageRef(to.fullPath); +// } +// } +// }); +// microApp.router.afterEach({ +// 'micoro-app-homeweb-app': (to, from) => { +// const names = { +// '/': '首页', +// '/search': '搜索', +// '/g-star': 'g-star', +// '/g-star/apply': 'g-star 申请', +// '/explore': '搜索开源' +// }; +// const toQuery = qs.parse(to.search, { ignoreQueryPrefix: true }); +// if (to.pathname === '/search' && toQuery.type !== 'repo') { +// // 对话有threadid后上报 +// if (toQuery.threadId) useReport('pageview', {}, { 'homeweb-page-title': names[to.pathname] }); +// } else { +// useReport('pageview', {}, { 'homeweb-page-title': names[to.pathname] }); +// } +// } +// }); storageService.setInstanceName('gitcode'); // 缓存策略表 @@ -183,6 +184,8 @@ Sentry.init({ app.use(Icon); app.use(dInput); +app.component('gc-checkbox-group', DCheckboxGroup); +app.component('gc-checkbox', DCheckbox); app.component('gc-option', Option); app.component('gc-skeleton-item', SkeletonItem); app.component('gc-modal-header', ModalHeader); diff --git a/src/router/config/home.ts b/src/router/config/home.ts index d642236..acfeda3 100644 --- a/src/router/config/home.ts +++ b/src/router/config/home.ts @@ -27,9 +27,22 @@ export default [ headerClassName: '' } }, + { + path: 'search/license', + name: 'SearchLicense', + component: () => import('@/views/Jyh/Search/license.vue'), + meta: { + title: '高级搜索-License', + reportTitle: '搜索License', + className: 'w-full min-w-full', + hiddenFooter: true, + hasMobile: true, + asideMenu: 'drawer' // 左侧菜单抽屉模式 + } + }, { path: 'search', - name: 'search', + name: 'Search', component: () => import('@/views/Jyh/Search/index.vue'), meta: { title: '高级搜索', diff --git a/src/router/interceptor.ts b/src/router/interceptor.ts index ffb622e..c7c8fc8 100644 --- a/src/router/interceptor.ts +++ b/src/router/interceptor.ts @@ -228,7 +228,7 @@ export const injectRouter = router => { // 子应用单独处理 if (fromHomeWeb.includes(to.name)) return; // 项目中代码点击tab单独上报(从其他地方跳转除外) - useReport('pageview', {}); + // useReport('pageview', {}); } } }); diff --git a/src/views/Jyh/Search/Components/OssQuery.vue b/src/views/Jyh/Search/Components/OssQuery.vue new file mode 100644 index 0000000..5ed77f5 --- /dev/null +++ b/src/views/Jyh/Search/Components/OssQuery.vue @@ -0,0 +1,364 @@ + + + + + diff --git a/src/views/Jyh/Search/index.vue b/src/views/Jyh/Search/index.vue index f7c5a16..c045ac8 100644 --- a/src/views/Jyh/Search/index.vue +++ b/src/views/Jyh/Search/index.vue @@ -1,162 +1,18 @@ @@ -170,32 +26,10 @@ import { GModal } from '@/components/Setting/index'; import { reqCatch } from '@/utils/catch'; import { getOrgInfo } from '@/views/Org/hooks/orgInfo'; import { Message } from 'vue-devui'; +import OssQuery from './Components/OssQuery.vue'; const { namespace } = getOrgInfo(); -const text = `贡献者协议(CLA)允许外部开发者向组织的代码库提交变更请求时,系统会检查用户是否已签署CLA。如果已签署, "CLA-bot"会在变更请求评论区更新签署信息;如果未签署,"CLA-bot"会引导外部贡献者查看并签署贡献者协议。`; -const tableData = ref([ - {code: '05822156', name:'联通智家通通中视频公司语音.',type:'客户指定预装软件(原预装软件)',risk:'中',useType:'软件',status:'未开始',key:'',created:'2025-03-10 17:25:19',updated:'2025-03-10 17:25:19'}, - {code: '05822156', name:'联通智家通通中视频公司语音.',type:'客户指定预装软件(原预装软件)',risk:'中',useType:'软件',status:'未开始',key:'',created:'2025-03-10 17:25:19',updated:'2025-03-10 17:25:19'}, - {code: '05822156', name:'联通智家通通中视频公司语音.',type:'客户指定预装软件(原预装软件)',risk:'中',useType:'软件',status:'未开始',key:'',created:'2025-03-10 17:25:19',updated:'2025-03-10 17:25:19'}, - {code: '05822156', name:'联通智家通通中视频公司语音.',type:'客户指定预装软件(原预装软件)',risk:'中',useType:'软件',status:'未开始',key:'',created:'2025-03-10 17:25:19',updated:'2025-03-10 17:25:19'}, - {code: '05822156', name:'联通智家通通中视频公司语音.',type:'客户指定预装软件(原预装软件)',risk:'中',useType:'软件',status:'未开始',key:'',created:'2025-03-10 17:25:19',updated:'2025-03-10 17:25:19'}, - {code: '05822156', name:'联通智家通通中视频公司语音.',type:'客户指定预装软件(原预装软件)',risk:'中',useType:'软件',status:'未开始',key:'',created:'2025-03-10 17:25:19',updated:'2025-03-10 17:25:19'}, - {code: '05822156', name:'联通智家通通中视频公司语音.',type:'客户指定预装软件(原预装软件)',risk:'中',useType:'软件',status:'未开始',key:'',created:'2025-03-10 17:25:19',updated:'2025-03-10 17:25:19'}, - {code: '05822156', name:'联通智家通通中视频公司语音.',type:'客户指定预装软件(原预装软件)',risk:'中',useType:'软件',status:'未开始',key:'',created:'2025-03-10 17:25:19',updated:'2025-03-10 17:25:19'}, - {code: '05822156', name:'联通智家通通中视频公司语音.',type:'客户指定预装软件(原预装软件)',risk:'中',useType:'软件',status:'未开始',key:'',created:'2025-03-10 17:25:19',updated:'2025-03-10 17:25:19'}, - {code: '05822156', name:'联通智家通通中视频公司语音.',type:'客户指定预装软件(原预装软件)',risk:'中',useType:'软件',status:'未开始',key:'',created:'2025-03-10 17:25:19',updated:'2025-03-10 17:25:19'}, - ]); -const formData = ref({ title: '', md_content: '',select: '',time1:null }); -const typeOptions = reactive(['Options1', 'Options2', 'Options3']); -const riskOptions = reactive(['低', '中', '高']); -const useTypeOptions = reactive(['软件', '文档', '文档+软件']); -const isUseOptions = reactive(['是', '否']); - -const pager = ref({ - total: 10, - pageIndex: 1, - pageSize: 10 -}); +const selectTab = ref('OssQuery'); // 删除弹窗 const item = ref(''); @@ -354,4 +188,9 @@ const signCla = (row: any) => { } } + +.secret-breadcrumb { + padding: 7px 20px 12px; + background: #ffffff; +} diff --git a/src/views/Jyh/Search/license.vue b/src/views/Jyh/Search/license.vue new file mode 100644 index 0000000..f7c5a16 --- /dev/null +++ b/src/views/Jyh/Search/license.vue @@ -0,0 +1,357 @@ + + + + + diff --git a/yarn.lock b/yarn.lock index a3a0795..bcf56af 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5348,7 +5348,7 @@ vue-demi@*, vue-demi@>=0.14.8, vue-demi@^0.14.10: resolved "https://mirrors.cloud.tencent.com/npm/vue-demi/-/vue-demi-0.14.10.tgz#afc78de3d6f9e11bf78c55e8510ee12814522f04" integrity sha512-nMZBOwuzabUO0nLgIcc6rycZEebF6eeUfaiQx9+WSk8e29IbLvPU9feI6tqW4kTo3hvoYAJkMh8n8D0fuISphg== -vue-devui@^1.6.7: +vue-devui@^1.6.31: version "1.6.31" resolved "https://mirrors.cloud.tencent.com/npm/vue-devui/-/vue-devui-1.6.31.tgz#1431e110986ccadeea6e78d3166892a97eb6de7e" integrity sha512-tKovGWeNJwhdRfItFOKpU9am37b8phOMUIHqMgE9IhIRnNmT+Af8P+0Yf7hilOfbhcdxpyUOmjTXuBWIR194hw==