1
0
mirror of https://github.com/ZeroCatDev/Classworks.git synced 2025-07-05 02:59: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()) .filter(([, value]) => value.content?.trim())
.map(([key, value]) => ({ .map(([key, value]) => ({
key, key,
name: value.name, name: this.state.availableSubjects.find((s) => s.key === key)?.name || key,
content: value.content, content: value.content,
order: this.state.subjectOrder.indexOf(key), order: this.state.subjectOrder.indexOf(key),
rowSpan: Math.ceil( rowSpan: Math.ceil(
@ -473,7 +473,6 @@ export default {
? this.optimizeGridLayout(items) ? this.optimizeGridLayout(items)
: items.sort((a, b) => a.order - b.order); : items.sort((a, b) => a.order - b.order);
// 使
this.updateSortedItemsCache(key, result); this.updateSortedItemsCache(key, result);
return result; return result;
@ -706,10 +705,8 @@ export default {
// () // ()
if (content !== originalContent.trim()) { if (content !== originalContent.trim()) {
if (content) { if (content) {
// 使
this.state.boardData.homework[this.currentEditSubject] = { this.state.boardData.homework[this.currentEditSubject] = {
name: this.state.availableSubjects.find(
(s) => s.key === this.currentEditSubject
)?.name,
content, content,
}; };
} else { } else {
@ -782,16 +779,15 @@ export default {
} }
this.currentEditSubject = subject; this.currentEditSubject = subject;
// //
if (!this.state.boardData.homework[subject]) { if (!this.state.boardData.homework[subject]) {
this.state.boardData.homework[subject] = { this.state.boardData.homework[subject] = {
name:
this.state.availableSubjects.find((s) => s.key === subject)?.name ||
subject,
content: "", 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.textarea = this.state.boardData.homework[subject].content;
this.state.dialogVisible = true; this.state.dialogVisible = true;
this.$nextTick(() => { this.$nextTick(() => {