refactor: 工具栏按钮简化为 截图阅卷/评分标准/其它(下拉)/设置
This commit is contained in:
@@ -1,35 +1,29 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="floating-toolbar" :class="{ 'is-hidden': !appStore.isToolbarVisible }">
|
<div class="floating-toolbar" :class="{ 'is-hidden': !appStore.isToolbarVisible }">
|
||||||
<div class="toolbar-buttons">
|
<div class="toolbar-buttons">
|
||||||
<el-button class="toolbar-btn" @click="startScreenshot">
|
<el-button class="toolbar-btn" @click="startScreenshot" :loading="appStore.isGrading">
|
||||||
<span class="btn-icon">📷</span>
|
<span class="btn-icon">📷</span>
|
||||||
<span class="btn-label">截图</span>
|
<span class="btn-label">{{ appStore.isGrading ? '阅卷中...' : '截图阅卷' }}</span>
|
||||||
</el-button>
|
|
||||||
|
|
||||||
<el-button class="toolbar-btn" @click="selectImage">
|
|
||||||
<span class="btn-icon">📁</span>
|
|
||||||
<span class="btn-label">图片</span>
|
|
||||||
</el-button>
|
|
||||||
|
|
||||||
<el-button class="toolbar-btn" @click="startGrading" :loading="appStore.isGrading">
|
|
||||||
<span class="btn-icon">⚡</span>
|
|
||||||
<span class="btn-label">{{ appStore.isGrading ? '阅卷中...' : '阅卷' }}</span>
|
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|
||||||
<el-button class="toolbar-btn" @click="openRubric">
|
<el-button class="toolbar-btn" @click="openRubric">
|
||||||
<span class="btn-icon">📋</span>
|
<span class="btn-icon">📋</span>
|
||||||
<span class="btn-label">标准</span>
|
<span class="btn-label">评分标准</span>
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|
||||||
<el-button class="toolbar-btn" @click="openTemplates">
|
<el-dropdown trigger="click" @command="handleMenu">
|
||||||
<span class="btn-icon">📚</span>
|
<el-button class="toolbar-btn">
|
||||||
<span class="btn-label">模板</span>
|
<span class="btn-icon">📎</span>
|
||||||
</el-button>
|
<span class="btn-label">其它</span>
|
||||||
|
</el-button>
|
||||||
<el-button class="toolbar-btn" @click="openHistory">
|
<template #dropdown>
|
||||||
<span class="btn-icon">📜</span>
|
<el-dropdown-menu>
|
||||||
<span class="btn-label">历史</span>
|
<el-dropdown-item command="image">📁 图片阅卷</el-dropdown-item>
|
||||||
</el-button>
|
<el-dropdown-item command="templates">📚 模板</el-dropdown-item>
|
||||||
|
<el-dropdown-item command="history">📜 历史</el-dropdown-item>
|
||||||
|
</el-dropdown-menu>
|
||||||
|
</template>
|
||||||
|
</el-dropdown>
|
||||||
|
|
||||||
<el-button class="toolbar-btn" @click="openSettings">
|
<el-button class="toolbar-btn" @click="openSettings">
|
||||||
<span class="btn-icon">⚙</span>
|
<span class="btn-icon">⚙</span>
|
||||||
@@ -76,10 +70,16 @@ async function selectImage() {
|
|||||||
const data = await window.electronAPI.dialog.openImage()
|
const data = await window.electronAPI.dialog.openImage()
|
||||||
if (data) {
|
if (data) {
|
||||||
gradingStore.setImage(data.base64)
|
gradingStore.setImage(data.base64)
|
||||||
ElMessage.success('已选择图片')
|
startGrading()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function handleMenu(cmd: string) {
|
||||||
|
if (cmd === 'image') await selectImage()
|
||||||
|
else if (cmd === 'templates') window.electronAPI?.dialog.open('templates')
|
||||||
|
else if (cmd === 'history') window.electronAPI?.dialog.open('history')
|
||||||
|
}
|
||||||
|
|
||||||
async function gradeQuestion(questionIdx: number) {
|
async function gradeQuestion(questionIdx: number) {
|
||||||
const questions = gradingStore.questions
|
const questions = gradingStore.questions
|
||||||
if (!questions.length) {
|
if (!questions.length) {
|
||||||
|
|||||||
Reference in New Issue
Block a user