角色面板显示评分规则名、有益/有效词条数

This commit is contained in:
UCPr 2025-04-01 23:22:56 +08:00
parent b256890166
commit cf553ecaab
4 changed files with 190 additions and 115 deletions

View file

@ -262,7 +262,9 @@ export class ZZZAvatarInfo {
this.isNew = isNew; this.isNew = isNew;
/** @type {number} 等级级别(取十位数字)*/ /** @type {number} 等级级别(取十位数字)*/
this.level_rank = Math.floor(this.level / 10); this.level_rank = Math.floor(this.level / 10);
this.scoreWeight = formatScoreWeight(scoreFnc[this.id] && scoreFnc[this.id](this)?.[1]) || scoreWeight[this.id]; const weight = scoreFnc[this.id] && scoreFnc[this.id](this);
this.weightRule = weight?.[0] || '默认';
this.scoreWeight = formatScoreWeight(weight?.[1]) || scoreWeight[this.id];
for (const equip of this.equip) { for (const equip of this.equip) {
equip.get_score(this.scoreWeight); equip.get_score(this.scoreWeight);
} }

View file

@ -492,19 +492,23 @@
.card .equip-stats { .card .equip-stats {
display: flex; display: flex;
padding: 0 1.8em; padding: 0 1.8em;
height: 6em; height: 7.5em;
} }
.card .equip-stats .equip-score { .card .equip-stats .box1 {
width: 30%;
border: #707070 solid; border: #707070 solid;
border-width: 0.2em 0 0.2em 0.2em; border-width: 0.2em 0 0.2em 0.2em;
border-radius: 0.6em 0 0 0.6em; border-radius: 0.6em 0 0 0.6em;
}
.card .equip-stats .box1 .equip-score {
height: 80%;
border: #707070 solid;
border-width: 0 0 0.1em 0;
display: flex; display: flex;
justify-content: center; justify-content: center;
font-size: 1em;
align-items: center; align-items: center;
width: 30%;
} }
.card .equip-stats .equip-score .comment-box { .card .equip-stats .box1 .equip-score .comment-box {
font-size: 1.2em; font-size: 1.2em;
width: 2em; width: 2em;
display: flex; display: flex;
@ -518,30 +522,43 @@
position: relative; position: relative;
z-index: 1; z-index: 1;
} }
.card .equip-stats .equip-score .value { .card .equip-stats .box1 .equip-score .value {
border: 0.1em solid rgb(155, 155, 155); border: 0.1em solid rgb(155, 155, 155);
border-left: none; border-left: none;
padding: 0.1em 1em 0.1em 1em; padding: 0.1em 1em 0.1em 1em;
margin-left: -0.6em; margin-left: -0.6em;
border-radius: 0 1em 1em 0; border-radius: 0 1em 1em 0;
} }
.card .equip-stats .equip-score .value .subt { .card .equip-stats .box1 .equip-score .value .subt {
font-size: 0.8em; font-size: 0.8em;
} }
.card .equip-stats .property-stats { .card .equip-stats .box1 .weight-rule {
height: 20%;
font-size: 0.8em;
color: #aaa;
display: flex;
justify-content: center;
align-items: center;
overflow: hidden;
}
.card .equip-stats .box2 {
width: 70%; width: 70%;
height: 100%; border: #707070 solid;
border-width: 0.2em;
border-radius: 0 0.6em 0.6em 0;
}
.card .equip-stats .box2 .property-stats {
height: 80%;
border: #707070 solid;
border-width: 0 0 0.125em 0;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
flex-wrap: wrap; flex-wrap: wrap;
font-size: 0.8em; font-size: 0.8em;
align-items: center; align-items: center;
border: #707070 solid;
border-width: 0.2em;
border-radius: 0 0.6em 0.6em 0;
overflow: hidden; overflow: hidden;
} }
.card .equip-stats .property-stats .stat-item { .card .equip-stats .box2 .property-stats .stat-item {
width: 33.33%; width: 33.33%;
height: 33.33%; height: 33.33%;
padding: 0 0.2em; padding: 0 0.2em;
@ -552,27 +569,28 @@
color: #eee; color: #eee;
border: #707070 0.1em solid; border: #707070 0.1em solid;
} }
.card .equip-stats .property-stats .stat-item:nth-child(7) { .card .equip-stats .box2 .property-stats .stat-item:nth-child(7) {
border-radius: 0 0.4em 0 0; border-radius: 0 0.4em 0 0;
} }
.card .equip-stats .property-stats .stat-item:nth-child(9) { .card .equip-stats .box2 .property-stats .stat-item:nth-child(3n) {
border-radius: 0 0 0.4em 0; border: #707070 solid;
border-width: 0.1em 0.1em 0 0.1em;
} }
.card .equip-stats .property-stats .stat-item.great { .card .equip-stats .box2 .property-stats .stat-item.great {
color: rgb(249, 189, 64); color: rgb(249, 189, 64);
} }
.card .equip-stats .property-stats .stat-item.good { .card .equip-stats .box2 .property-stats .stat-item.good {
color: rgb(238, 207, 139); color: rgb(238, 207, 139);
} }
.card .equip-stats .property-stats .stat-item.useless { .card .equip-stats .box2 .property-stats .stat-item.useless {
color: #999999; color: #999999;
} }
.card .equip-stats .property-stats .stat-item span.title { .card .equip-stats .box2 .property-stats .stat-item span.title {
padding-left: 0.1em; padding-left: 0.1em;
text-align: left; text-align: left;
width: 48%; width: 48%;
} }
.card .equip-stats .property-stats .stat-item span.title span.count { .card .equip-stats .box2 .property-stats .stat-item span.title span.count {
display: inline-block; display: inline-block;
text-align: center; text-align: center;
background-color: black; background-color: black;
@ -581,12 +599,23 @@
border: #696969 0.15em solid; border: #696969 0.15em solid;
border-radius: 0.4em; border-radius: 0.4em;
} }
.card .equip-stats .property-stats .stat-item span.value { .card .equip-stats .box2 .property-stats .stat-item span.value {
padding-right: 0.2em; padding-right: 0.2em;
width: 52%; width: 52%;
overflow: hidden; overflow: hidden;
text-align: right; text-align: right;
} }
.card .equip-stats .box2 .useful-stats {
height: 20%;
font-size: 0.8em;
color: #aaa;
display: flex;
justify-content: center;
align-items: center;
overflow: hidden;
border: #707070 solid;
border-width: 0 0.1em 0 0.1em;
}
.card .equip-list { .card .equip-list {
width: 100%; width: 100%;
display: grid; display: grid;

View file

@ -141,26 +141,37 @@
</div> </div>
{{if charData.equip_score !== false}} {{if charData.equip_score !== false}}
<div class="equip-stats"> <div class="equip-stats">
<div class="equip-score {{charData.equip_comment}}"> <div class="box1">
<div class="comment-box"> <div class="equip-score {{charData.equip_comment}}">
<div class="comment">{{charData.equip_comment}}</div> <div class="comment-box">
</div> <div class="comment">{{charData.equip_comment}}</div>
<div class="value"> </div>
<span>{{charData.equip_score.toFixed(2)}}</span> <div class="value">
<span class="subt"></span> <span>{{charData.equip_score.toFixed(2)}}</span>
<span class="subt"></span>
</div>
</div> </div>
<div class="weight-rule">规则:{{charData.weightRule || '默认'}}</div>
</div> </div>
<div class="property-stats"> <div class="box2">
{{set stats = charData.propertyStats.slice(0, 9)}} <div class="property-stats">
{{each stats item}} {{set stats = charData.propertyStats.slice(0, 9)}}
<div class="stat-item {{item.weight == 1 ? 'great' : (item.weight >= 0.75 ? 'good' : (item.weight > 0 ? 'useful' : 'useless'))}}"> {{each stats item}}
<span class="title"><span class="count">{{item.count}}</span> {{item.name}}</span> <div class="stat-item {{item.weight == 1 ? 'great' : (item.weight >= 0.75 ? 'good' : (item.weight > 0 ? 'useful' : 'useless'))}}">
<span class="value">+{{item.value}}</span> <span class="title"><span class="count">{{item.count}}</span> {{item.name}}</span>
<span class="value">+{{item.value}}</span>
</div>
{{/each}}
<% for (let i = 0; i < 9-stats.length; i++) { %>
<div class="stat-item"></div>
<% } %>
</div>
<div class="useful-stats">有益词条数:{{
stats.reduce((acc, stat) => stat.weight ? acc + stat.count : acc, 0)
}} 有效词条数:{{
(stats.reduce((acc, stat) => acc + stat.count * stat.weight, 0)).toFixed(2)
}}
</div> </div>
{{/each}}
<% for (let i = 0; i < 9-stats.length; i++) { %>
<div class="stat-item"></div>
<% } %>
</div> </div>
</div> </div>
{{/if}} {{/if}}

View file

@ -481,109 +481,142 @@
.equip-stats { .equip-stats {
display: flex; display: flex;
padding: 0 1.8em; padding: 0 1.8em;
height: 6em; height: 7.5em;
.equip-score { .box1 {
width: 30%;
border: #707070 solid; border: #707070 solid;
border-width: 0.2em 0 0.2em 0.2em; border-width: 0.2em 0 0.2em 0.2em;
border-radius: 0.6em 0 0 0.6em; border-radius: 0.6em 0 0 0.6em;
display: flex;
justify-content: center; .equip-score {
font-size: 1em; height: 80%;
align-items: center; border: #707070 solid;
width: 30%; border-width: 0 0 0.1em 0;
.comment-box {
font-size: 1.2em;
width: 2em;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
aspect-ratio: 1; .comment-box {
border-radius: 50%; font-size: 1.2em;
background-color: rgba(32, 32, 32, 0.4); width: 2em;
box-shadow: 0 0 1em rgba(0, 0, 0, 0.4); display: flex;
border: 0.2em solid rgb(216, 216, 216); justify-content: center;
position: relative; align-items: center;
z-index: 1; aspect-ratio: 1;
} border-radius: 50%;
.value { background-color: rgba(32, 32, 32, 0.4);
border: 0.1em solid rgba(155, 155, 155); box-shadow: 0 0 1em rgba(0, 0, 0, 0.4);
border-left: none; border: 0.2em solid rgb(216, 216, 216);
padding: 0.1em 1em 0.1em 1em; position: relative;
margin-left: -0.6em; z-index: 1;
border-radius: 0 1em 1em 0;
.subt {
font-size: 0.8em;
} }
.value {
border: 0.1em solid rgba(155, 155, 155);
border-left: none;
padding: 0.1em 1em 0.1em 1em;
margin-left: -0.6em;
border-radius: 0 1em 1em 0;
.subt {
font-size: 0.8em;
}
}
}
.weight-rule {
height: 20%;
font-size: 0.8em;
color: #aaa;
display: flex;
justify-content: center;
align-items: center;
overflow: hidden;
} }
} }
.property-stats { .box2 {
width: 70%; width: 70%;
height: 100%;
display: flex;
flex-direction: column;
flex-wrap: wrap;
font-size: 0.8em;
align-items: center;
border: #707070 solid; border: #707070 solid;
border-width: 0.2em; border-width: 0.2em;
border-radius: 0 0.6em 0.6em 0; border-radius: 0 0.6em 0.6em 0;
overflow: hidden;
.stat-item { .property-stats {
width: 33.33%; height: 80%;
height: 33.33%; border: #707070 solid;
padding: 0 0.2em; border-width: 0 0 0.125em 0;
position: relative;
display: flex; display: flex;
flex-direction: column;
flex-wrap: wrap;
font-size: 0.8em;
align-items: center; align-items: center;
white-space: nowrap; overflow: hidden;
color: #eee;
border: #707070 0.1em solid;
&:nth-child(7) { .stat-item {
border-radius: 0 0.4em 0 0; width: 33.33%;
} height: 33.33%;
padding: 0 0.2em;
position: relative;
display: flex;
align-items: center;
white-space: nowrap;
color: #eee;
border: #707070 0.1em solid;
&:nth-child(9) { &:nth-child(7) {
border-radius: 0 0 0.4em 0; border-radius: 0 0.4em 0 0;
} }
&:nth-child(3n){
border: #707070 solid;
border-width: 0.1em 0.1em 0 0.1em;
}
&.great { &.great {
color: rgb(249, 189, 64); color: rgb(249, 189, 64);
} }
&.good { &.good {
color: rgb(238, 207, 139); color: rgb(238, 207, 139);
} }
&.useless { &.useless {
color: #999999; color: #999999;
} }
span.title { span.title {
padding-left: 0.1em; padding-left: 0.1em;
text-align: left; text-align: left;
width: 48%; width: 48%;
span.count { span.count {
display: inline-block; display: inline-block;
text-align: center; text-align: center;
background-color: black; background-color: black;
width: 1.6em; width: 1.6em;
height: 1.6em; height: 1.6em;
border: #696969 0.15em solid; border: #696969 0.15em solid;
border-radius: 0.4em; border-radius: 0.4em;
}
}
span.value {
padding-right: 0.2em;
width: 52%;
overflow: hidden;
text-align: right;
} }
} }
}
span.value { .useful-stats {
padding-right: 0.2em; height: 20%;
width: 52%; font-size: 0.8em;
overflow: hidden; color: #aaa;
text-align: right; display: flex;
} justify-content: center;
align-items: center;
overflow: hidden;
border: #707070 solid;
border-width: 0 0.1em 0 0.1em;
} }
} }
} }