fix
This commit is contained in:
@@ -233,7 +233,6 @@ export const Submission = {
|
||||
const res = await http.get(`/submission/stats/${taskId}`, { params })
|
||||
return res.data as TaskStatsOut
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
export const Prompt = {
|
||||
|
||||
@@ -16,14 +16,27 @@
|
||||
placeholder="粘贴外部 AI 返回的完整 HTML 代码..."
|
||||
/>
|
||||
<div v-if="splitResult" class="split-result">
|
||||
<n-tag size="small" type="success">HTML · {{ splitResult.html.length }} 字符</n-tag>
|
||||
<n-tag size="small" type="info">CSS · {{ splitResult.css.length }} 字符</n-tag>
|
||||
<n-tag size="small" type="warning">JS · {{ splitResult.js.length }} 字符</n-tag>
|
||||
<n-tag size="small" type="success"
|
||||
>HTML · {{ splitResult.html.length }} 字符</n-tag
|
||||
>
|
||||
<n-tag size="small" type="info"
|
||||
>CSS · {{ splitResult.css.length }} 字符</n-tag
|
||||
>
|
||||
<n-tag size="small" type="warning"
|
||||
>JS · {{ splitResult.js.length }} 字符</n-tag
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<div class="action-bar">
|
||||
<n-button :disabled="!rawCode.trim()" @click="applyPreview">应用预览</n-button>
|
||||
<n-button type="primary" :disabled="!splitResult" :loading="submitting" @click="submit">
|
||||
<n-button :disabled="!rawCode.trim()" @click="applyPreview"
|
||||
>应用预览</n-button
|
||||
>
|
||||
<n-button
|
||||
type="primary"
|
||||
:disabled="!splitResult"
|
||||
:loading="submitting"
|
||||
@click="submit"
|
||||
>
|
||||
提交
|
||||
</n-button>
|
||||
</div>
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
<n-flex align="center" justify="space-between" class="title">
|
||||
<div>
|
||||
<n-text class="titleText">预览</n-text>
|
||||
<n-text v-if="!!submission.id" depth="3">({{ submission.view_count || 0 }})</n-text>
|
||||
<n-text v-if="!!submission.id" depth="3"
|
||||
>({{ submission.view_count || 0 }})</n-text
|
||||
>
|
||||
</div>
|
||||
<n-flex>
|
||||
<n-button quaternary @click="download" :disabled="!showDL">下载</n-button>
|
||||
|
||||
@@ -75,7 +75,14 @@
|
||||
transition: 'all 0.2s',
|
||||
}"
|
||||
>
|
||||
<div style="display: flex; justify-content: space-between; align-items: flex-start; gap: 8px">
|
||||
<div
|
||||
style="
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
gap: 8px;
|
||||
"
|
||||
>
|
||||
<span>{{ round.question }}</span>
|
||||
<span
|
||||
v-if="round.prompt_level"
|
||||
@@ -86,7 +93,8 @@
|
||||
color: levelColors[round.prompt_level],
|
||||
marginTop: '2px',
|
||||
}"
|
||||
>L{{ round.prompt_level }}</span>
|
||||
>L{{ round.prompt_level }}</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -152,7 +160,13 @@ const rounds = computed(() => {
|
||||
break
|
||||
}
|
||||
}
|
||||
result.push({ question: msg.content, prompt_level: msg.prompt_level ?? null, html, css, js })
|
||||
result.push({
|
||||
question: msg.content,
|
||||
prompt_level: msg.prompt_level ?? null,
|
||||
html,
|
||||
css,
|
||||
js,
|
||||
})
|
||||
}
|
||||
return result
|
||||
})
|
||||
|
||||
@@ -12,7 +12,9 @@
|
||||
<n-button
|
||||
v-if="authed"
|
||||
text
|
||||
@click="$router.push({ name: 'submissions', params: { page: 1 } })"
|
||||
@click="
|
||||
$router.push({ name: 'submissions', params: { page: 1 } })
|
||||
"
|
||||
>
|
||||
<Icon :width="16" icon="lucide:list" />
|
||||
</n-button>
|
||||
@@ -24,7 +26,12 @@
|
||||
<n-tab-pane name="desc" tab="挑战描述" display-directive="show">
|
||||
<div
|
||||
class="markdown-body"
|
||||
style="padding: 12px; overflow-y: auto; height: 100%"
|
||||
style="
|
||||
padding: 12px;
|
||||
overflow-y: auto;
|
||||
height: calc(100% - 45px);
|
||||
box-sizing: border-box;
|
||||
"
|
||||
v-html="challengeContent"
|
||||
/>
|
||||
</n-tab-pane>
|
||||
|
||||
@@ -225,10 +225,13 @@ const columns: DataTableColumn<SubmissionOut>[] = [
|
||||
key: "zone",
|
||||
width: 42,
|
||||
render: (row) => {
|
||||
const map: Record<string, { label: string; type: "success" | "default" | "warning" }> = {
|
||||
const map: Record<
|
||||
string,
|
||||
{ label: string; type: "success" | "default" | "warning" }
|
||||
> = {
|
||||
featured: { label: "夯", type: "success" },
|
||||
pending: { label: "N", type: "default" },
|
||||
low: { label: "拉", type: "warning" },
|
||||
pending: { label: "N", type: "default" },
|
||||
low: { label: "拉", type: "warning" },
|
||||
}
|
||||
if (!row.zone || !map[row.zone]) return null
|
||||
const { label, type } = map[row.zone]
|
||||
|
||||
Reference in New Issue
Block a user