style: add color to action labels in rule summary text

\u4fdd\u53f7=green(#67c23a), \u5c01\u53f7/\u5220\u9664\u8d26\u53f7=red(#f56c6c), \u5c01\u53f7(\u7f13\u52117\u5929)=orange(#e6a23c)
This commit is contained in:
mediabot-pt
2026-07-06 22:41:55 +08:00
parent 7ec4e16eb6
commit accb38986a

View File

@@ -183,7 +183,7 @@
<div v-if="parsed.length" style="margin-top:16px;padding:10px 12px;background:#fafafa;border-radius:4px;font-size:13px;line-height:1.8;color:#303133">
<div style="font-weight:600;margin-bottom:6px;color:#606266;font-size:12px">规则摘要</div>
<div v-for="(r, i) in sortedRules" :key="i">
<span style="font-weight:500">{{ i + 1 }}.</span> {{ ruleText(r) }}
<span style="font-weight:500">{{ i + 1 }}.</span> <span v-html="ruleText(r)" />
</div>
</div>
</div>
@@ -387,22 +387,20 @@ const sortedRules = computed(() => {
const ruleText = (r) => {
const appText = r.applicable ? `(${applicableOptions.find(x=>x.value===r.applicable)?.label||r.applicable})` : ''
if (r.type === 'EXEMPT') {
return `等级豁免:永久保留 ≥ ${rankDisplay(r.permRank)}、封存豁免 ≥ ${rankDisplay(r.sealExemptRank)} → 保号`
return `等级豁免:永久保留 ≥ ${rankDisplay(r.permRank)}、封存豁免 ≥ ${rankDisplay(r.sealExemptRank)} → <span style="color:#67c23a;font-weight:500">保号</span>`
}
if (r.type === 'TASK') {
const reqs = (r.requirements||[]).filter(x => x.enabled).map(x => `${x.label} ≥ ${x.threshold}${x.unit}`).join('、')
return `新人考核:${r.threshold||30}天内,${reqs} → 封号/删除账号${appText}`
return `新人考核:${r.threshold||30}天内,${reqs} → <span style="color:#f56c6c;font-weight:500">封号/删除账号</span>${appText}`
}
const metric = metricLabel(r.metric)
const cond = condLabel(r.condition)
const val = `${metric}${cond}${r.threshold}${r.unit||''}`
if (r.type === 'DRATIO') {
return `动态分享率:下载量 ≥ ${r.threshold}GB 时分享率 ≥ ${r.minRatio} → 封号(缓刑7天)${appText}`
if (r.type === 'DRATIO' || r.type === 'RATIO') {
const prefix = r.type === 'DRATIO' ? `动态分享率:下载量 ≥ ${r.threshold}GB 时分享率 ≥ ${r.minRatio}` : `分享率:${val}`
return `${prefix} → <span style="color:#e6a23c;font-weight:500">封号(缓刑7天)</span>${appText}`
}
if (r.type === 'RATIO') {
return `分享率:${val} → 封号(缓刑7天)${appText}`
}
return `${typeLabel(r.type)}:${val} → 封号/删除账号${appText}`
return `${typeLabel(r.type)}:${val} → <span style="color:#f56c6c;font-weight:500">封号/删除账号</span>${appText}`
}
const merged = computed(() => (Array.isArray(sites.value)?sites.value:[]).map(s => ({
siteId: s.siteId, names: s.names, siteType: s.siteType,