优化问题列表组件,调整表格布局,添加检查错误装饰函数,更新样式以居中对齐
This commit is contained in:
parent
1b1196cb21
commit
08dfb27ac9
@ -82,14 +82,34 @@
|
|||||||
</v-dialog>
|
</v-dialog>
|
||||||
</v-toolbar>
|
</v-toolbar>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:item.actions="{ item }">
|
<template v-slot:item="{ item }">
|
||||||
|
<tr>
|
||||||
|
<td>{{ item.id }}</td>
|
||||||
|
<td>{{ item.problem }}</td>
|
||||||
|
<td>{{ item.answer }}</td>
|
||||||
|
<td>{{ decorateCheckingError(item.check_error) }}</td>
|
||||||
|
<td class="text-center">
|
||||||
<v-icon class="me-2" size="small" @click="editItem(item)">
|
<v-icon class="me-2" size="small" @click="editItem(item)">
|
||||||
mdi-pencil
|
mdi-pencil
|
||||||
</v-icon>
|
</v-icon>
|
||||||
<v-icon size="small" @click="deleteItem(item)">
|
<v-icon size="small" @click="deleteItem(item)">
|
||||||
mdi-delete
|
mdi-delete
|
||||||
</v-icon>
|
</v-icon>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
</template>
|
</template>
|
||||||
|
<!-- <template v-slot:item.actions="{ item }">
|
||||||
|
<tr>
|
||||||
|
<td class="text-center">
|
||||||
|
<v-icon class="me-2" size="small" @click="editItem(item)">
|
||||||
|
mdi-pencil
|
||||||
|
</v-icon>
|
||||||
|
<v-icon size="small" @click="deleteItem(item)">
|
||||||
|
mdi-delete
|
||||||
|
</v-icon>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</template> -->
|
||||||
</v-data-table>
|
</v-data-table>
|
||||||
<v-dialog v-model="dialogShow" width="auto">
|
<v-dialog v-model="dialogShow" width="auto">
|
||||||
<v-card max-width="400" prepend-icon="mdi-update" :text="dialogText" :title="dialogTitle">
|
<v-card max-width="400" prepend-icon="mdi-update" :text="dialogText" :title="dialogTitle">
|
||||||
@ -175,6 +195,13 @@ const checkingErrorTitle = ref('');
|
|||||||
const checkingErrorIcon = ref('');
|
const checkingErrorIcon = ref('');
|
||||||
const checkingError = ref('');
|
const checkingError = ref('');
|
||||||
|
|
||||||
|
const decorateCheckingError = (checkError: number) => {
|
||||||
|
if (checkError == 0) {
|
||||||
|
return '精确匹配';
|
||||||
|
}
|
||||||
|
return checkError;
|
||||||
|
}
|
||||||
|
|
||||||
watch(preciseMode, () => {
|
watch(preciseMode, () => {
|
||||||
if (preciseMode.value) {
|
if (preciseMode.value) {
|
||||||
checkingError.value = '精确匹配';
|
checkingError.value = '精确匹配';
|
||||||
@ -403,3 +430,8 @@ const save = async (event: SubmitEvent) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
td {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
</style>
|
Loading…
Reference in New Issue
Block a user