feat: 添加练度的计算公式

This commit is contained in:
bietiaop 2024-07-31 17:11:30 +08:00
parent 2c745c256e
commit 8a420e8fe1
3 changed files with 51 additions and 2 deletions

View file

@ -19,6 +19,10 @@ export class Panel extends ZZZPlugin {
reg: `${rulePrefix}(.*)面板(.*)$`,
fnc: 'handleRule',
},
{
reg: `${rulePrefix}练度(统计)?$`,
fnc: 'proficiency',
},
],
});
}
@ -104,4 +108,24 @@ export class Panel extends ZZZPlugin {
};
await render(this.e, 'panel/card.html', finalData);
}
async proficiency() {
const uid = await this.getUID();
if (!uid) return false;
const result = getPanelList(uid);
result.sort((a, b) => {
return b.proficiency_score - a.proficiency_score;
});
result.forEach(item => {
logger.debug(item.proficiency_score, item);
});
const finalData = {
count: result?.length || 0,
list: result,
};
// await render(this.e, 'panel/proficiency.html', finalData);
}
}