fix: 补 .gitattributes(CRLF for .bat) + README 端口 19540 + 提交 console 锁文件
This commit is contained in:
1 parent
c121111f51
commit
b80c64a115
39 files changed
+4217
-345
No files matched your search
@@ -35,7 +35,6 @@ interface EditableRow {
|
||||
isTie: boolean
|
||||
note: string
|
||||
resultState: ResultState | null
|
||||
serverPoints: number | null
|
||||
original: string
|
||||
}
|
||||
|
||||
@@ -134,11 +133,18 @@ const score = computed(() => {
|
||||
})
|
||||
})
|
||||
|
||||
/**
|
||||
* 已发布行产生的分已经计入当前总分,预览时必须先扣掉,差值才是「本次发布」的影响。
|
||||
*
|
||||
* 不能用 result.points:服务端从不返回该字段(恒为 0),否则已发布分会被重复计算。
|
||||
* 这里改用与预览同一套算法算出的 rowPoints,口径与服务端计分一致。
|
||||
*/
|
||||
const publishedContribution = computed(() => {
|
||||
const map = new Map<number, number>()
|
||||
const rowPoints = score.value?.rowPoints
|
||||
for (const row of visibleRows.value) {
|
||||
if (row.resultState !== 'published') continue
|
||||
const points = row.serverPoints ?? 0
|
||||
const points = rowPoints?.get(row.entryId) ?? 0
|
||||
map.set(row.teamId, (map.get(row.teamId) ?? 0) + (isIndividual.value ? points * weight.value : points))
|
||||
}
|
||||
return map
|
||||
@@ -250,7 +256,6 @@ function toRow(entry: EntryWithResult): EditableRow {
|
||||
isTie: result?.isTie ?? false,
|
||||
note: result?.note ?? '',
|
||||
resultState: result?.state ?? null,
|
||||
serverPoints: result?.points ?? null,
|
||||
original: '',
|
||||
}
|
||||
row.original = snapshotOf(entry)
|
||||
@@ -347,6 +352,11 @@ async function saveDraft(silent = false): Promise<boolean> {
|
||||
|
||||
function requestPublish(): void {
|
||||
if (selectedEventId.value === null) return
|
||||
if (data.isMock) {
|
||||
// 示例数据模式下 publish 只改内存,提示「发布成功」等于谎报落库,直接停用。
|
||||
toast.error('示例数据模式不能发布', '后端未就绪,发布不会写入真实赛事')
|
||||
return
|
||||
}
|
||||
if (!canWrite.value) {
|
||||
toast.error('当前不可发布', auth.readOnly ? '请先登录' : '服务端未连接')
|
||||
return
|
||||
@@ -515,7 +525,7 @@ watch(
|
||||
<button
|
||||
class="mx-btn mx-btn-primary"
|
||||
type="button"
|
||||
:disabled="!canWrite || publishing"
|
||||
:disabled="!canWrite || publishing || data.isMock"
|
||||
@click="requestPublish"
|
||||
>
|
||||
<MxIcon name="push" :size="15" /> 发布
|
||||
@@ -523,6 +533,11 @@ watch(
|
||||
</template>
|
||||
</PageHeader>
|
||||
|
||||
<div v-if="data.isMock" class="mock-note">
|
||||
<MxIcon name="warning" :size="15" />
|
||||
<span>{{ data.mockLabel }},示例数据模式下「发布」已停用,成绩不会写入真实赛事。</span>
|
||||
</div>
|
||||
|
||||
<div class="entry-grid">
|
||||
<aside class="mx-card project-panel">
|
||||
<div class="mx-card-head"><span class="mx-card-title">项目</span></div>
|
||||
@@ -778,6 +793,17 @@ watch(
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.mock-note {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
padding: 10px 14px;
|
||||
margin-bottom: 14px;
|
||||
border-radius: var(--mx-r-sm);
|
||||
font-size: 13px;
|
||||
background: rgba(251, 191, 36, 0.1);
|
||||
color: var(--mx-amber);
|
||||
}
|
||||
.entry-grid {
|
||||
display: grid;
|
||||
grid-template-columns: 264px minmax(0, 1fr);
|
||||
|
||||
Reference in new issue
Block a user