Merge branch 'master' of https://gitcode.com/hk_openRepo/OpenRepo_Portal into junjie_dev

# Conflicts:
#	src/views/Jyh/Home/index.vue
This commit is contained in:
@user8949
2025-03-19 13:26:27 +08:00
24 changed files with 554 additions and 262 deletions

View File

@@ -1,5 +1,5 @@
<template>
<d-row class="mt-3">
<d-row class="mt-3" v-if="inited">
<d-col :span="12">
<d-chart :option="optionConChart" style="width: 100%; height: 400px"></d-chart>
<p class="text-center mt-translate-y">国家/地球分布</p>
@@ -11,80 +11,83 @@
</d-row>
</template>
<script setup>
import { ref, reactive } from 'vue';
<script setup lang="ts">
import { ref, reactive, computed } from 'vue';
import { DChart } from 'vue-devui/echarts';
const optionConChart = reactive({
tooltip: {
show: true,
trigger: 'item'
},
xAxis: {
type: 'category',
data: ['美国', '中国', '德国', '瑞士', '法国', '英国', '印度', '日本', '荷兰', '俄罗斯']
},
yAxis: {
// 给y轴添加单位后缀
axisLabel: {
formatter: '{value}%'
const inited = ref(false);
const props = withDefaults(
defineProps<{
companyGraph: Array<any>;
countryGraph: Array<any>;
}>(),
{
companyGraph: () => [],
countryGraph: () => []
}
);
const options = (x: any, y: any, color = '#2070F3') => {
return {
tooltip: {
show: true,
trigger: 'item'
},
name: '单位',
type: 'value'
},
series: [
{
data: [12, 14.8, 23.6, 18.6, 17.3, 13.1, 16, 11.8, 13.9, 16.4],
type: 'bar',
barWidth: '40%',
// 给label添加单位后缀
label: {
show: true,
position: 'top',
formatter: '{c}%'
xAxis: {
type: 'category',
data: x
},
yAxis: {
// 给y轴添加单位后缀
axisLabel: {
formatter: '{value}%'
},
itemStyle: {
color: '#2070F3',
borderRadius: [5, 5, 0, 0]
name: '单位',
type: 'value'
},
series: [
{
data: y,
type: 'bar',
barWidth: '40%',
// 给label添加单位后缀
label: {
show: true,
position: 'top',
formatter: '{c}%'
},
itemStyle: {
color,
borderRadius: [5, 5, 0, 0]
}
}
}
]
]
};
};
const optionConChart = computed(() => {
return options(
props.countryGraph.map((d) => d.name),
props.countryGraph.map((d) => d.value),
'#2070F3'
);
});
const optionOrgChart = computed(() => {
return options(
props.companyGraph.map((d) => d.name),
props.companyGraph.map((d) => d.value),
'#2CB8C9'
);
});
const optionOrgChart = reactive({
tooltip: {
show: true,
trigger: 'item'
},
xAxis: {
type: 'category',
data: ['公司1', '公司2', '公司3', '公司4', '公司5', '公司6', '公司7', '公司8', '公司9', '公司10']
},
yAxis: {
// 给y轴添加单位后缀
axisLabel: {
formatter: '{value}%'
},
name: '单位',
type: 'value'
},
series: [
{
data: [12, 14.8, 23.6, 18.6, 17.3, 13.1, 16, 11.8, 13.9, 16.4],
type: 'bar',
barWidth: '40%',
// 给label添加单位后缀
label: {
show: true,
position: 'top',
formatter: '{c}%'
},
itemStyle: {
color: '#2CB8C9',
borderRadius: [5, 5, 0, 0]
}
}
]
});
const onInited = () => {
setTimeout(() => {
inited.value = true;
}, 100);
};
// 向外暴露onInited方法
defineExpose({ onInited });
</script>
<style scoped lang="scss">

View File

@@ -57,7 +57,7 @@ const search = () => {
document.querySelector('#golbalSearch').blur();
return;
}
router.push({ name: 'Search', query: { val: searchStr.value || '', type: route?.query?.type || 'License' }});
router.push({ name: 'Search', query: { searchWord: searchStr.value || '', type: route?.query?.type || 'software' }});
};
const handleClear = () => {
router.push({ name: 'home' });

View File

@@ -1,18 +1,18 @@
<template>
<div class="full-w" :style="{ height: `${height}px` }">
<div class="g-header fixed z-20" ref="headerRef" :class="{'home-background': isHome}">
<div class="g-header fixed z-20" ref="headerRef" :class="{ 'home-background': isHome }">
<div class="g-toolbar w-full overflow-hidden" :class="[searchClass, route?.meta?.headerClassName]">
<div class="g-toolbar-left flex-shrink items-center">
<div class="flex-center gap-[16px]" v-if="!isHome">
<!-- <g-icon v-if="!asideSetShow" @click="$emit('clickMenu')" name="gt-hamburger" size="20px" class="cursor-pointer hover:!text-black" color="#1D1F3A"></g-icon>-->
<!-- <g-icon v-if="!asideSetShow" @click="$emit('clickMenu')" name="gt-hamburger" size="20px" class="cursor-pointer hover:!text-black" color="#1D1F3A"></g-icon>-->
<GLink class="g-toolbar-left-logo" :href="baseUrl" />
<GLink class="g-toolbar-left-title" :href="baseUrl">可信代码库</GLink>
<!-- <GLink class="g-toolbar-left-title" :href="baseUrl">可信代码库</GLink>-->
<!-- <Entrance v-if="isLogin" :is-mobile="isMobile" /> -->
</div>
</div>
<div class="flex-1 flex items-center justify-end" v-if="!isHome">
<Search class="g-toolbar-left-search" v-if="!isMobile" :key="$route.fullPath"/>
<Search class="g-toolbar-left-search" v-if="!isMobile" :key="$route.fullPath" />
</div>
<div class="g-toolbar-right gap-[12px] flex-grow-0 flex-shrink-0">
<GLink
@@ -30,21 +30,23 @@
<GIcon name="gt-plane-add" size="16px" color="#9C9DB4" />
<span>新建</span>
</d-button>
<div class="cursor-pointer hidden-m" @click="handleLogin('login')" v-if="inSearch"><span>搜索记录</span></div>
<d-button variant="solid" color="primary" @click="handleLogin('login')"></d-button>
<div class="cursor-pointer hidden-m" @click="handleLogin('login')" v-if="inSearch">
<span>搜索记</span>
</div>
<d-button @click="handleLogin('register')" class="min-w-[64px]">注册</d-button>
<d-button variant="solid" color="primary" @click="handleLogin('login')">Gitcode账号登录</d-button>
</template>
<template v-else>
<!--ai copilot-->
<!-- <a class="g-header-copilot" href="/ai-copilot/">-->
<!-- <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">-->
<!-- <path fill-rule="evenodd" clip-rule="evenodd" d="M2.5 6C2.5 4.89543 3.39543 4 4.5 4H11.5C12.6046 4 13.5 4.89543 13.5 6V12C13.5 13.1046 12.6046 14 11.5 14H4.5C3.39543 14 2.5 13.1046 2.5 12V6ZM4.5 8C4.5 7.44772 4.94772 7 5.5 7C6.05228 7 6.5 7.44772 6.5 8V9C6.5 9.55228 6.05228 10 5.5 10C4.94772 10 4.5 9.55228 4.5 9V8ZM10.5 7C9.94772 7 9.5 7.44772 9.5 8V9C9.5 9.55228 9.94772 10 10.5 10C11.0523 10 11.5 9.55228 11.5 9V8C11.5 7.44772 11.0523 7 10.5 7Z" fill="white"/>-->
<!-- <path opacity="0.6" fill-rule="evenodd" clip-rule="evenodd" d="M8.75 3.29933C9.19835 3.03997 9.5 2.55521 9.5 2C9.5 1.17157 8.82843 0.5 8 0.5C7.17157 0.5 6.5 1.17157 6.5 2C6.5 2.55521 6.80165 3.03997 7.25 3.29933V5.5H8.75V3.29933ZM0 7C0 6.44772 0.447715 6 1 6H1.5V12H1C0.447715 12 0 11.5523 0 11V7ZM15 6H14.5V12H15C15.5523 12 16 11.5523 16 11V7C16 6.44772 15.5523 6 15 6Z" fill="white"/>-->
<!-- </svg>-->
<!-- <span class="ml-xs">AI Copilot</span>-->
<!-- </a>-->
<!-- <Create />-->
<!-- <SearchAiHistory />-->
<!-- <a class="g-header-copilot" href="/ai-copilot/">-->
<!-- <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">-->
<!-- <path fill-rule="evenodd" clip-rule="evenodd" d="M2.5 6C2.5 4.89543 3.39543 4 4.5 4H11.5C12.6046 4 13.5 4.89543 13.5 6V12C13.5 13.1046 12.6046 14 11.5 14H4.5C3.39543 14 2.5 13.1046 2.5 12V6ZM4.5 8C4.5 7.44772 4.94772 7 5.5 7C6.05228 7 6.5 7.44772 6.5 8V9C6.5 9.55228 6.05228 10 5.5 10C4.94772 10 4.5 9.55228 4.5 9V8ZM10.5 7C9.94772 7 9.5 7.44772 9.5 8V9C9.5 9.55228 9.94772 10 10.5 10C11.0523 10 11.5 9.55228 11.5 9V8C11.5 7.44772 11.0523 7 10.5 7Z" fill="white"/>-->
<!-- <path opacity="0.6" fill-rule="evenodd" clip-rule="evenodd" d="M8.75 3.29933C9.19835 3.03997 9.5 2.55521 9.5 2C9.5 1.17157 8.82843 0.5 8 0.5C7.17157 0.5 6.5 1.17157 6.5 2C6.5 2.55521 6.80165 3.03997 7.25 3.29933V5.5H8.75V3.29933ZM0 7C0 6.44772 0.447715 6 1 6H1.5V12H1C0.447715 12 0 11.5523 0 11V7ZM15 6H14.5V12H15C15.5523 12 16 11.5523 16 11V7C16 6.44772 15.5523 6 15 6Z" fill="white"/>-->
<!-- </svg>-->
<!-- <span class="ml-xs">AI Copilot</span>-->
<!-- </a>-->
<!-- <Create />-->
<!-- <SearchAiHistory />-->
<d-popover content="提示!" trigger="hover" style="background-color: #7693f5; color: #fff">
<d-icon style="font-size: 16px" name="icon-helping" />
</d-popover>
@@ -109,9 +111,7 @@ const { isMobile } = usePageResize();
/* store 用户信息 */
/* @test 后面将清除 */
watchEffect(() => {
});
watchEffect(() => {});
microApp.router.beforeEach({
'micoro-app-homeweb-app': (to, from) => {
if (to.pathname === '/search') {
@@ -134,8 +134,8 @@ $add-radius: 48px;
$header-bg: #fff;
.home-background {
background-color: #fff0 !important;
}
background-color: #fff0 !important;
}
.g-header {
// overflow: hidden;
@@ -150,7 +150,7 @@ $header-bg: #fff;
}
.g-header-copilot {
background: rgba(41, 81, 224, 1);
color: #FFF;
color: #fff;
width: 120px;
border-radius: 48px;
height: 32px;
@@ -159,7 +159,7 @@ $header-bg: #fff;
cursor: pointer;
justify-content: center;
&:hover {
background: rgba(41, 81, 224, .8);
background: rgba(41, 81, 224, 0.8);
}
}
.g-toolbar {
@@ -171,7 +171,7 @@ $header-bg: #fff;
flex-basis: 56px;
overflow: hidden;
padding: 0 24px;
border-bottom: 1px solid #F1F1F8;
border-bottom: 1px solid #f1f1f8;
:deep(.devui-button) {
padding: 6px 16px;
border-radius: $add-radius;
@@ -182,9 +182,9 @@ $header-bg: #fff;
gap: 25px;
&-logo {
display: inline-block;
width: 28px;
height: 28px;
background: url(../../assets/imgs/logo/logo.png) no-repeat;
width: 90px;
height: 32px;
background: url(../../assets/imgs/logo2.png) no-repeat;
background-size: contain;
vertical-align: middle;
background-position: 0 center;
@@ -202,14 +202,14 @@ $header-bg: #fff;
display: flex;
align-items: center;
@media screen and (max-width: 576px) {
@apply gap-[16px];
@apply gap-[16px];
}
}
&.border-b-transparent {
border-bottom-color: transparent !important;
}
&.border-b-show {
border-bottom-color: #F1F1F8 !important;
border-bottom-color: #f1f1f8 !important;
}
}
.g-header-gray {
@@ -256,12 +256,12 @@ $header-bg: #fff;
}
}
@media screen and (max-width:576px) {
.hidden-m {
display: none;
}
.g-header-copilot {
display: none!important;;
}
@media screen and (max-width: 576px) {
.hidden-m {
display: none;
}
.g-header-copilot {
display: none !important;
}
}
</style>

View File

@@ -368,7 +368,7 @@ const columns = ref([
{ key: 'communityHash', label: '社区hash值', visible: false, filterable: false, sortable: false },
{ key: 'softwareScore', label: '软件评分', visible: false, filterable: false, sortable: true },
{ key: 'sourceCodeDownload', label: '源码包下载地址', visible: true, filterable: false, sortable: false },
{ key: 'copyright', label: 'CopyRight', visible: false, filterable: false, sortable: false },
{ key: 'copyright', label: 'Copyright', visible: false, filterable: false, sortable: false },
{ key: 'externalVulnerabilitySource', label: '外部漏洞源的软件名称', visible: false, filterable: true, sortable: false },
{ key: 'versionDescription', label: '版本描述', visible: false, filterable: false, sortable: false },
{ key: 'compatibilityRisk', label: '兼容性风险描述', visible: false, filterable: false, sortable: false },