fix: Improve bisector again

This commit is contained in:
JLoeve 2023-02-20 23:17:16 +08:00
parent 6ad8b3e27b
commit 33faf3d421
2 changed files with 19 additions and 6 deletions

View File

@ -1,13 +1,17 @@
<template>
<div class="bisector-dialog-content-container">
<div class="bisector-dialog-content-text">
组件二等分进行中预计剩余{{ rouge }}轮次请确认当前情况
组件二等分进行中预计剩余
<b style="color: var(--theme-color)">{{ rouge }} </b>轮次请确认当前情况
</div>
<div class="bisector-dialog-button-group">
<VButton @click="onGood">正常</VButton>
<VButton @click="onBad">不正常</VButton>
<VButton type="primary" @click="onAbort">终止</VButton>
</div>
<div class="bisector-dialog-content-text weak">
*可以点击×号关闭对话框刷新页面后会再次询问
</div>
</div>
</template>
@ -40,10 +44,19 @@ export default Vue.extend({
<style lang="scss" scoped>
.bisector-dialog-content-container {
padding: 12px;
padding: 0 16px;
.bisector-dialog-content-text {
&.weak {
opacity: 0.6;
}
}
.bisector-dialog-content-text,
.bisector-dialog-button-group {
margin-bottom: 8px;
}
.bisector-dialog-button-group {
display: grid;
gap: 8px;

View File

@ -33,7 +33,7 @@ export function* bisectLeft<O>(
high,
mid,
slice: data.slice(low, mid),
rouge: ~~Math.log2(high - low),
rouge: Math.trunc(Math.log2(high - low)),
}
if (seeingBad) {
@ -48,7 +48,7 @@ export function* bisectLeft<O>(
high,
mid,
slice: data.slice(low, mid),
rouge: ~~Math.log2(high - low),
rouge: Math.trunc(Math.log2(high - low)),
target: data[low],
}
}
@ -69,7 +69,7 @@ export function* bisectRight<O>(
high,
mid,
slice: data.slice(mid, high),
rouge: ~~Math.log2(high - low),
rouge: Math.trunc(Math.log2(high - low)),
}
if (seeingBad) {
@ -84,7 +84,7 @@ export function* bisectRight<O>(
high,
mid,
slice: data.slice(low, mid),
rouge: ~~Math.log2(high - low),
rouge: Math.trunc(Math.log2(high - low)),
target: data[low],
}
}