可信代码库-软件列表软件详情可信度评分展示修改
This commit is contained in:
@@ -15,15 +15,12 @@
|
||||
<span class="split"></span>
|
||||
<!-- <span class="span1">生命周期状态:</span><span class="span2">{{ softwareData.lifecycle }}</span>-->
|
||||
<!-- <span class="split"></span>-->
|
||||
<span class="span1">可信度评分:</span><span class="span2"
|
||||
style="
|
||||
font-weight: bold;
|
||||
color: #409EFF;
|
||||
font-size: 16px;
|
||||
text-decoration: underline;
|
||||
cursor: pointer;
|
||||
"
|
||||
>{{ ReleaseInfo.basicInfo.trustScore || '--' }}</span>
|
||||
<span class="span1">可信度评分:</span>
|
||||
|
||||
<d-popover :content="ReleaseInfo.basicInfo.trustScore || '--'" trigger="hover" style="background-color: #7693f5; color: #fff">
|
||||
<d-tag color="#ef4444">{{ '非常重要' || '--' }}</d-tag>
|
||||
</d-popover>
|
||||
|
||||
<span class="split"></span>
|
||||
<span class="span1">重要性评分:</span><span class="span2"
|
||||
style="
|
||||
@@ -36,7 +33,7 @@
|
||||
>{{ ReleaseInfo.networkSecurity.softwareRating || ReleaseInfo.basicInfo.securityScore || '--' }}</span>
|
||||
<span class="split"></span>
|
||||
<span class="span1">集成风险:</span>
|
||||
<d-tag color="#F6933B">{{ ReleaseInfo.referenceInfo.integrationRisk || jcfxList[ReleaseInfo.basicInfo.integrationRiskLevel] || '--' }}</d-tag>
|
||||
<d-tag :color="jcfxList[ReleaseInfo.referenceInfo.integrationRisk].color">{{ ReleaseInfo.referenceInfo.integrationRisk || jcfxList[ReleaseInfo.basicInfo.integrationRiskLevel].text || '--' }}</d-tag>
|
||||
<!-- <d-tag color="#F6933B">{{ ReleaseInfo.referenceInfo.integrationRisk || '--' }}</d-tag>-->
|
||||
</div>
|
||||
</div>
|
||||
@@ -82,7 +79,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, watch, onMounted } from 'vue';
|
||||
import { ref, reactive, watch, onMounted,computed } from 'vue';
|
||||
import { useRouter, useRoute } from 'vue-router';
|
||||
import { getOrgInfo } from '@/views/Org/hooks/orgInfo';
|
||||
import VulnerabilitiesList from './VulnerabilitiesList.vue';
|
||||
@@ -117,10 +114,45 @@ const ReleaseInfo = ref({
|
||||
referenceInfo: {},
|
||||
});
|
||||
const versionId = route.params.versionId; // 获取路由参数 versionId
|
||||
const jcfxList = ['','低','中','高'];
|
||||
|
||||
const jcfxList = {
|
||||
'0': { text: '', color: '#ef4444' }, // 红色
|
||||
'1': { text: '低', color: '#F6933B' }, // 橙色
|
||||
'2': { text: '中', color: '#eab308' }, // 黄色
|
||||
'3': { text: '高', color: '#10b981' }, // 绿色
|
||||
'低': { text: '低', color: '#F6933B' }, // 橙色
|
||||
'中': { text: '中', color: '#eab308' }, // 黄色
|
||||
'高': { text: '高', color: '#10b981' } // 绿色
|
||||
}
|
||||
|
||||
// 定义评分范围和对应的显示配置
|
||||
const scoreRanges = [
|
||||
{ min: 0, max: 59, color: '#F6933B', text: '低', description: '0-59分,可信度较低' },
|
||||
{ min: 60, max: 84, color: '#eab308', text: '中', description: '60-84分,可信度中等' },
|
||||
{ min: 85, max: 100, color: '#10b981', text: '高', description: '85-100分,可信度高' }
|
||||
];
|
||||
|
||||
// // 根据评分获取标签颜色
|
||||
// const getTrustScoreColor = computed(() => {
|
||||
// const score = ReleaseInfo.value.basicInfo.trustScore;
|
||||
// if (!score) return '#909399'; // 未评分时的默认颜色
|
||||
//
|
||||
// const range = scoreRanges.find(range => score >= range.min && score <= range.max);
|
||||
// return range ? range.color : '#909399';
|
||||
// });
|
||||
//
|
||||
// // 根据评分获取标签文本
|
||||
// const getTrustScoreText = computed(() => {
|
||||
// const score = ReleaseInfo.value.basicInfo.trustScore;
|
||||
// if (!score) return '--';
|
||||
//
|
||||
// const range = scoreRanges.find(range => score >= range.min && score <= range.max);
|
||||
// return range ? range.text : '--';
|
||||
// });
|
||||
|
||||
const getReleaseInfo = async(versionId) => {
|
||||
const { data, error } = await releaseInfo({ softwareId: versionId });
|
||||
debugger
|
||||
if (!error && data) {
|
||||
ReleaseInfo.value = data.data;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user