feat: 目录层级变更
This commit is contained in:
@@ -97,10 +97,9 @@
|
||||
<el-table-column label="色情检测" width="140" align="center">
|
||||
<template slot-scope="scope">
|
||||
<div v-if="scope.row.nsfwScore > 0">
|
||||
<el-tag :type="scope.row.nsfwScore >= scope.row.nsfwThreshold ? 'danger' : 'warning'" size="small">
|
||||
{{ (scope.row.nsfwScore * 100).toFixed(1) }}%
|
||||
<el-tag :type="getNsfwLevelType(scope.row.nsfwScore)" size="small">
|
||||
{{ getNsfwLevelName(scope.row.nsfwScore) }} {{ (scope.row.nsfwScore * 100).toFixed(1) }}%
|
||||
</el-tag>
|
||||
<div class="nsfw-threshold">阈值: {{ (scope.row.nsfwThreshold * 100).toFixed(0) }}%</div>
|
||||
<div v-if="scope.row.nsfwDetections" class="nsfw-threshold">{{ formatNsfwDetections(scope.row.nsfwDetections) }}</div>
|
||||
</div>
|
||||
<span v-else class="muted">-</span>
|
||||
@@ -109,18 +108,14 @@
|
||||
<el-table-column label="动漫色情检测" width="140" align="center">
|
||||
<template slot-scope="scope">
|
||||
<div v-if="scope.row.animeNsfwScore > 0">
|
||||
<el-tag :type="scope.row.animeNsfwScore >= scope.row.animeNsfwThreshold ? 'danger' : 'warning'" size="small">
|
||||
{{ (scope.row.animeNsfwScore * 100).toFixed(1) }}%
|
||||
<el-tag :type="getNsfwLevelType(scope.row.animeNsfwScore)" size="small">
|
||||
{{ getNsfwLevelName(scope.row.animeNsfwScore) }} {{ (scope.row.animeNsfwScore * 100).toFixed(1) }}%
|
||||
</el-tag>
|
||||
<div class="nsfw-threshold">阈值: {{ (scope.row.animeNsfwThreshold * 100).toFixed(0) }}%</div>
|
||||
</div>
|
||||
<div v-else-if="scope.row.animeNsfwRatings">
|
||||
<el-tag type="info" size="small">安全</el-tag>
|
||||
<div class="nsfw-threshold">{{ formatAnimeRatings(scope.row.animeNsfwRatings) }}</div>
|
||||
</div>
|
||||
<div v-else-if="scope.row.animeNsfwThreshold > 0">
|
||||
<el-tag type="info" size="small">安全</el-tag>
|
||||
</div>
|
||||
<span v-else class="muted">-</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -312,6 +307,18 @@ export default {
|
||||
this.$message.error('复制失败')
|
||||
})
|
||||
},
|
||||
getNsfwLevelName(score) {
|
||||
if (score < 0.25) return '安全'
|
||||
if (score < 0.5) return '低俗'
|
||||
if (score < 0.75) return '擦边'
|
||||
return '色情'
|
||||
},
|
||||
getNsfwLevelType(score) {
|
||||
if (score < 0.25) return 'success'
|
||||
if (score < 0.5) return 'warning'
|
||||
if (score < 0.75) return ''
|
||||
return 'danger'
|
||||
},
|
||||
formatAnimeRatings(ratingsJson) {
|
||||
if (!ratingsJson) return ''
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user