fix: TRAFFIC 规则两个条件共用同一个阈值天数

This commit is contained in:
mediabot-pt
2026-07-10 15:57:52 +08:00
parent dee204c99b
commit 6c40505b73

View File

@@ -94,7 +94,7 @@
<el-icon class="drag-handle"><Rank /></el-icon> <el-icon class="drag-handle"><Rank /></el-icon>
<span class="type-tag">{{ typeLabel(rule.type) }}</span> <span class="type-tag">{{ typeLabel(rule.type) }}</span>
<span v-if="rule.type==='TASK'" class="rule-fixed-text">考核周期 {{ rule.threshold }}天</span> <span v-if="rule.type==='TASK'" class="rule-fixed-text">考核周期 {{ rule.threshold }}天</span>
<span v-else-if="rule.type==='TRAFFIC'" class="rule-fixed-text">无流量 &gt; {{ rule.threshold }}天<span v-if="rule.loginDays>0">,且未登录 &gt; {{ rule.loginDays }}天</span></span> <span v-else-if="rule.type==='TRAFFIC'" class="rule-fixed-text">无流量且未登录 &gt; {{ rule.threshold }}天</span>
<span v-else-if="rule.type==='DRATIO'" class="rule-fixed-text">下载量分级控制({{ (rule.levels||[]).length }} 级)</span> <span v-else-if="rule.type==='DRATIO'" class="rule-fixed-text">下载量分级控制({{ (rule.levels||[]).length }} 级)</span>
<span v-else-if="rule.type==='EXEMPT'" class="rule-fixed-text">永久保留 ≥ {{ rankDisplay(rule.permRank) }} / 封存豁免 ≥ {{ rankDisplay(rule.sealExemptRank) }}</span> <span v-else-if="rule.type==='EXEMPT'" class="rule-fixed-text">永久保留 ≥ {{ rankDisplay(rule.permRank) }} / 封存豁免 ≥ {{ rankDisplay(rule.sealExemptRank) }}</span>
<span v-else class="rule-fixed-text">{{ metricLabel(rule.metric) }} {{ condLabel(rule.condition) }} {{ rule.threshold }}{{ rule.unit || '' }}</span> <span v-else class="rule-fixed-text">{{ metricLabel(rule.metric) }} {{ condLabel(rule.condition) }} {{ rule.threshold }}{{ rule.unit || '' }}</span>
@@ -159,17 +159,12 @@
</div> </div>
</template> </template>
<!-- TRAFFIC 连续无流量 --> <!-- TRAFFIC 连续无流量+未登录 -->
<template v-else-if="rule.type==='TRAFFIC'"> <template v-else-if="rule.type==='TRAFFIC'">
<div class="field-row"> <div class="field-row">
<span class="field-label">无流量天数</span> <span class="field-label">阈值</span>
<el-input v-model.number="rule.threshold" size="small" type="number" placeholder="天数" @input="sync" style="width:100px" /> <el-input v-model.number="rule.threshold" size="small" type="number" placeholder="天数" @input="sync" style="width:100px" />
<span class="field-hint">天内无上传/下载流量 → 有风险</span> <span class="field-hint">天内无上传/下载流量且未登录 → 有风险</span>
</div>
<div class="field-row">
<span class="field-label">且未登录天数</span>
<el-input v-model.number="rule.loginDays" size="small" type="number" placeholder="0=不限制" @input="sync" style="width:100px" />
<span class="field-hint">天内无登录活动时触发(0 表示不限制登录条件)</span>
</div> </div>
</template> </template>
@@ -282,7 +277,7 @@ const presets = [
{ name:'零活跃不登录封号', type:'KILL', metric:'days_since_last_login', threshold:7, unit:'天', condition:'GT', applicable:'new_account_30d', description:'零活跃新用户连续7天不登录即封号' }, { name:'零活跃不登录封号', type:'KILL', metric:'days_since_last_login', threshold:7, unit:'天', condition:'GT', applicable:'new_account_30d', description:'零活跃新用户连续7天不登录即封号' },
{ name:'零活跃注册天数封号', type:'KILL', metric:'days_since_registration', threshold:30, unit:'天', condition:'GT', applicable:'new_account_30d', description:'零活跃新用户注册满30天即封号' }, { name:'零活跃注册天数封号', type:'KILL', metric:'days_since_registration', threshold:30, unit:'天', condition:'GT', applicable:'new_account_30d', description:'零活跃新用户注册满30天即封号' },
// 流量监控 // 流量监控
{ name:'连续无流量封号', type:'TRAFFIC', metric:'days_since_last_traffic', threshold:90, unit:'天', loginDays:90, condition:'GT', description:'连续90天无流量且90天未登录即封号' }, { name:'连续无流量封号', type:'TRAFFIC', metric:'days_since_last_traffic', threshold:90, unit:'天', condition:'GT', description:'连续90天无流量且未登录即封号' },
// H&R // H&R
{ name:'H&R 封号', type:'HD', metric:'hnr_count', threshold:5, unit:'次', condition:'GTE', description:'H&R违规次数达到5次即封号' }, { name:'H&R 封号', type:'HD', metric:'hnr_count', threshold:5, unit:'次', condition:'GTE', description:'H&R违规次数达到5次即封号' },
// 新人考核 // 新人考核
@@ -353,8 +348,7 @@ const ruleText = (r) => {
const cond = condLabel(r.condition) const cond = condLabel(r.condition)
const val = `${metric}${cond}${r.threshold}${r.unit||''}` const val = `${metric}${cond}${r.threshold}${r.unit||''}`
if (r.type === 'TRAFFIC') { if (r.type === 'TRAFFIC') {
const extra = r.loginDays > 0 ? `(且${r.loginDays}天未登录)` : '' return `无流量且未登录:${val} → <span style="color:#f56c6c;font-weight:500">封号/删除账号</span>${appText}`
return `无流量:${val}${extra} → <span style="color:#f56c6c;font-weight:500">封号/删除账号</span>${appText}`
} }
const levels = (r.levels||[]).map(l => `下载量≥${l.threshold}GB时分享率<${l.ratio}`).join(',') const levels = (r.levels||[]).map(l => `下载量≥${l.threshold}GB时分享率<${l.ratio}`).join(',')
return `分享率:${levels} → <span style="color:#e6a23c;font-weight:500">封号(缓刑7天)</span>${appText}` return `分享率:${levels} → <span style="color:#e6a23c;font-weight:500">封号(缓刑7天)</span>${appText}`