|
|
@@ -1,6 +1,7 @@
|
|
|
<script>
|
|
|
import {ElMessage, ElMessageBox} from "element-plus";
|
|
|
import {Close, UploadFilled} from "@element-plus/icons-vue";
|
|
|
+import debounce from "lodash-es/debounce";
|
|
|
|
|
|
export default {
|
|
|
name: "HomeworkTab",
|
|
|
@@ -241,6 +242,13 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ createWritingHomeworkDebounce: debounce(function () {
|
|
|
+ this.createHomework();
|
|
|
+ }, 1000, { leading: true, trailing: false }),
|
|
|
+
|
|
|
+ createSpeakingHomeworkDebounce: debounce(function () {
|
|
|
+ this.createSpeakingHomework();
|
|
|
+ }, 1000, { leading: true, trailing: false }),
|
|
|
handleClose(){
|
|
|
ElMessageBox.confirm("确认吗?你的修改将不会保存。",{
|
|
|
confirmButtonText:"确认",
|
|
|
@@ -647,7 +655,7 @@ export default {
|
|
|
<template #footer>
|
|
|
<div class="dialog-footer">
|
|
|
<el-button @click="createHomeworkCancel">取消</el-button>
|
|
|
- <el-button type="primary" @click="createHomework">
|
|
|
+ <el-button type="primary" @click="createWritingHomeworkDebounce">
|
|
|
创建
|
|
|
</el-button>
|
|
|
</div>
|
|
|
@@ -852,7 +860,7 @@ export default {
|
|
|
<template #footer>
|
|
|
<div class="dialog-footer">
|
|
|
<el-button @click="createHomeworkCancel">取消</el-button>
|
|
|
- <el-button type="primary" @click="createSpeakingHomework">
|
|
|
+ <el-button type="primary" @click="createSpeakingHomeworkDebounce">
|
|
|
创建
|
|
|
</el-button>
|
|
|
</div>
|
|
|
@@ -890,6 +898,12 @@ export default {
|
|
|
width: 100%;
|
|
|
max-width: 100%;
|
|
|
height: auto;
|
|
|
+
|
|
|
+}
|
|
|
+.homework-form-item textarea {
|
|
|
+ word-break: normal; /* 允许在单词之间换行 */
|
|
|
+ overflow-wrap: break-word; /* 防止长单词溢出,必要时才打断 */
|
|
|
+ hyphens: none; /* 禁止浏览器自动断字(连字符) */
|
|
|
}
|
|
|
.form-input{
|
|
|
width: 100%;
|
|
|
@@ -905,4 +919,10 @@ export default {
|
|
|
.list-leave-to {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
+/* 统一字体 */
|
|
|
+.el-input__inner,
|
|
|
+.el-textarea__inner {
|
|
|
+ font-family: inherit;
|
|
|
+ font-size: 14px;
|
|
|
+}
|
|
|
</style>
|