1
0
mirror of https://github.com/ZeroCatDev/Classworks.git synced 2025-07-02 09:19:23 +00:00
This commit is contained in:
SunWuyuan 2025-03-15 21:45:14 +08:00
parent 4adc0474e4
commit 3ac1f86b96
No known key found for this signature in database
GPG Key ID: A6A54CF66F56BB64

View File

@ -459,7 +459,7 @@ export default {
.filter(([, value]) => value.content?.trim())
.map(([key, value]) => ({
key,
name: value.name,
name: this.state.availableSubjects.find((s) => s.key === key)?.name || key,
content: value.content,
order: this.state.subjectOrder.indexOf(key),
rowSpan: Math.ceil(
@ -473,7 +473,6 @@ export default {
? this.optimizeGridLayout(items)
: items.sort((a, b) => a.order - b.order);
// 使
this.updateSortedItemsCache(key, result);
return result;
@ -706,10 +705,8 @@ export default {
// ()
if (content !== originalContent.trim()) {
if (content) {
// 使
this.state.boardData.homework[this.currentEditSubject] = {
name: this.state.availableSubjects.find(
(s) => s.key === this.currentEditSubject
)?.name,
content,
};
} else {
@ -782,16 +779,15 @@ export default {
}
this.currentEditSubject = subject;
//
//
if (!this.state.boardData.homework[subject]) {
this.state.boardData.homework[subject] = {
name:
this.state.availableSubjects.find((s) => s.key === subject)?.name ||
subject,
content: "",
};
}
this.state.dialogTitle = this.state.boardData.homework[subject].name;
this.state.dialogTitle = this.state.availableSubjects.find(
(s) => s.key === subject
)?.name || subject;
this.state.textarea = this.state.boardData.homework[subject].content;
this.state.dialogVisible = true;
this.$nextTick(() => {