feat: convert rank inputs to dropdown with level numbers
- 10 standard PT ranks: Peasant(0) \u2192 Nexus Master(9) - Dropdown shows \u201c3. Elite User\u201d format with level and name - Card header and template dialog also show level numbers - Default preset: Elite User for perm, Power User for seal
This commit is contained in:
@@ -92,7 +92,7 @@
|
||||
</el-select>
|
||||
<span v-if="rule.type==='TASK'" class="rule-fixed-text">考核周期 {{ rule.threshold }}天</span>
|
||||
<span v-else-if="rule.type==='DRATIO'" class="rule-fixed-text">下载量 ≥ {{ rule.threshold }}GB 时分享率 ≥ {{ rule.minRatio }}</span>
|
||||
<span v-else-if="rule.type==='EXEMPT'" class="rule-fixed-text">永久保留 ≥ {{ rule.permRank || '—' }} / 封存豁免 ≥ {{ 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 class="then-arrow" :style="rule.type==='EXEMPT'?'color:#67c23a':''">→</span>
|
||||
<span :style="rule.type==='EXEMPT'?'color:#67c23a;font-weight:600;font-size:13px':'color:#f56c6c;font-weight:600;font-size:13px'">{{ rule.type==='EXEMPT' ? '保号' : '封号/删除账号' }}</span>
|
||||
@@ -143,12 +143,16 @@
|
||||
<template v-else-if="rule.type==='EXEMPT'">
|
||||
<div class="field-row">
|
||||
<span class="field-label">永久保留等级</span>
|
||||
<el-input v-model="rule.permRank" size="small" placeholder="如:Elite User" @input="sync" style="width:200px" />
|
||||
<el-select v-model="rule.permRank" size="small" @change="sync" style="width:220px">
|
||||
<el-option v-for="r in rankOptions" :key="r.value" :label="`${r.level}. ${r.value}`" :value="r.value" />
|
||||
</el-select>
|
||||
<span class="field-hint">该等级及以上用户永久保留,不受任何清理规则影响</span>
|
||||
</div>
|
||||
<div class="field-row">
|
||||
<span class="field-label">封存豁免等级</span>
|
||||
<el-input v-model="rule.sealExemptRank" size="small" placeholder="如:Power User" @input="sync" style="width:200px" />
|
||||
<el-select v-model="rule.sealExemptRank" size="small" @change="sync" style="width:220px">
|
||||
<el-option v-for="r in rankOptions" :key="r.value" :label="`${r.level}. ${r.value}`" :value="r.value" />
|
||||
</el-select>
|
||||
<span class="field-hint">该等级及以上用户封存后不会被删除</span>
|
||||
</div>
|
||||
</template>
|
||||
@@ -230,6 +234,18 @@ const applicableOptions = [
|
||||
{ value: 'zero_traffic', label: '零流量用户' },
|
||||
{ value: 'new_account_30d', label: '注册 ≤30 天' },
|
||||
]
|
||||
const rankOptions = [
|
||||
{ level: 0, value: 'Peasant', label: 'Peasant' },
|
||||
{ level: 1, value: 'User', label: 'User' },
|
||||
{ level: 2, value: 'Power User', label: 'Power User' },
|
||||
{ level: 3, value: 'Elite User', label: 'Elite User' },
|
||||
{ level: 4, value: 'Crazy User', label: 'Crazy User' },
|
||||
{ level: 5, value: 'Insane User', label: 'Insane User' },
|
||||
{ level: 6, value: 'Veteran User', label: 'Veteran User' },
|
||||
{ level: 7, value: 'Extreme User', label: 'Extreme User' },
|
||||
{ level: 8, value: 'Ultimate User', label: 'Ultimate User' },
|
||||
{ level: 9, value: 'Nexus Master', label: 'Nexus Master' },
|
||||
]
|
||||
const metricOptions = [
|
||||
{ value: 'days_since_last_login', label: '距上次登录天数' },
|
||||
{ value: 'days_since_last_traffic', label: '距上次流量变化天数' },
|
||||
@@ -255,6 +271,12 @@ const typeDefaults = {
|
||||
const metricLabel = (m) => metricOptions.find(x => x.value === m)?.label || m || ''
|
||||
const condLabel = (c) => condOptions.find(x => x.value === c)?.label || c || ''
|
||||
|
||||
const rankDisplay = (v) => {
|
||||
if (!v) return '—'
|
||||
const r = rankOptions.find(x => x.value === v)
|
||||
return r ? `${r.level}. ${r.value}` : v
|
||||
}
|
||||
|
||||
const taskReqDefaults = [
|
||||
{ metric:'upload_gb', label:'上传量', threshold:10, unit:'GB', condition:'GTE' },
|
||||
{ metric:'download_gb', label:'下载量', threshold:10, unit:'GB', condition:'GTE' },
|
||||
@@ -318,7 +340,7 @@ const presetCategories = [
|
||||
const presetDesc = (p) => {
|
||||
if (p.type === 'TASK') return `考核周期 ${p.threshold||30} 天,需满足上传/下载/魔力值/做种积分/做种时间要求`
|
||||
if (p.type === 'DRATIO') return `下载量 ≥ ${p.threshold||100}GB 时分享率 ≥ ${p.minRatio||1.0}`
|
||||
if (p.type === 'EXEMPT') return `永久保留 ≥ ${p.permRank||'—'} / 封存豁免 ≥ ${p.sealExemptRank||'—'}`
|
||||
if (p.type === 'EXEMPT') return `永久保留 ≥ ${rankDisplay(p.permRank)} / 封存豁免 ≥ ${rankDisplay(p.sealExemptRank)}`
|
||||
const condLabel = condOptions.find(c => c.value === p.condition)?.label || p.condition
|
||||
const appLabel = applicableOptions.find(a => a.value === p.applicable)?.label || ''
|
||||
return `${metricOptions.find(m=>m.value===p.metric)?.label||p.metric} ${condLabel} ${p.threshold}${p.unit||''}${appLabel?' ('+appLabel+')':''}`
|
||||
|
||||
Reference in New Issue
Block a user