feat: 完善 AI 对话、每日作息与课件目录体验
新增持久化对话、追问卡片和轮次导航;支持每日子时间表、切换保留课程与自动课间;完善课件逐层目录、学期周次同步及两端自适应。同步迁移、文档和回归截图。 验证:后端 262/262、AI 55 项、Web 81/81、桌面 71/71、授权 23 项;构建、类型、Lint 与文档检查通过。
This commit is contained in:
1 parent
cdb64c5499
commit
9351203deb
59 files changed
+1277
-149
No files matched your search
@@ -0,0 +1,97 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue';
|
||||
const props = defineProps<{
|
||||
items: { folderPath?: string; teacher: { id: string; name: string } }[];
|
||||
folders?: { path: string }[];
|
||||
owner?: string;
|
||||
path: string;
|
||||
}>();
|
||||
const emit = defineEmits<{ 'update:path': [value: string]; 'update:owner': [value: string] }>();
|
||||
const teachers = computed(() => [...new Map(props.items.map((i) => [i.teacher.id, i.teacher])).values()]);
|
||||
const children = computed(() => {
|
||||
const paths = [
|
||||
...props.items.filter((i) => !props.owner || i.teacher.id === props.owner).map((i) => i.folderPath || ''),
|
||||
...(props.folders || []).map((f) => f.path),
|
||||
];
|
||||
if (teachers.value.length > 1 && !props.owner) return [];
|
||||
const prefix = props.path ? props.path + '/' : '';
|
||||
return [
|
||||
...new Set(
|
||||
paths
|
||||
.filter((p) => p.startsWith(prefix) && p !== props.path)
|
||||
.map((p) => p.slice(prefix.length).split('/')[0])
|
||||
.filter(Boolean),
|
||||
),
|
||||
].sort();
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
<div class="courseware-folders">
|
||||
<label v-if="teachers.length > 1">
|
||||
教师
|
||||
<select
|
||||
:value="owner"
|
||||
@change="
|
||||
emit('update:owner', ($event.target as HTMLSelectElement).value);
|
||||
emit('update:path', '');
|
||||
"
|
||||
>
|
||||
<option value="">选择教师</option>
|
||||
<option v-for="t in teachers" :key="t.id" :value="t.id">{{ t.name }}</option>
|
||||
</select>
|
||||
</label>
|
||||
<nav aria-label="文件夹路径">
|
||||
<button @click="emit('update:path', '')">根目录</button>
|
||||
<template v-for="(part, index) in path.split('/').filter(Boolean)" :key="index">
|
||||
<span>/</span>
|
||||
<button
|
||||
@click="
|
||||
emit(
|
||||
'update:path',
|
||||
path
|
||||
.split('/')
|
||||
.slice(0, index + 1)
|
||||
.join('/'),
|
||||
)
|
||||
"
|
||||
>
|
||||
{{ part }}
|
||||
</button>
|
||||
</template>
|
||||
</nav>
|
||||
<button v-if="path" @click="emit('update:path', path.split('/').slice(0, -1).join('/'))">返回上级</button>
|
||||
<div class="folder-children">
|
||||
<button
|
||||
v-for="name in children"
|
||||
:key="name"
|
||||
@click="emit('update:path', path ? path + '/' + name : name)"
|
||||
>
|
||||
📁 {{ name }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<style scoped>
|
||||
.courseware-folders {
|
||||
display: grid;
|
||||
gap: 12px;
|
||||
padding: 12px 0;
|
||||
}
|
||||
.courseware-folders nav,
|
||||
.folder-children {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.courseware-folders button,
|
||||
.courseware-folders select {
|
||||
padding: 8px 12px;
|
||||
border: 1px solid var(--el-border-color);
|
||||
border-radius: 6px;
|
||||
background: var(--el-bg-color);
|
||||
color: var(--el-text-color-primary);
|
||||
max-width: 100%;
|
||||
overflow-wrap: anywhere;
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
@@ -14,3 +14,5 @@ declare module 'vue' {
|
||||
ChDatePicker: typeof ChDatePicker;
|
||||
}
|
||||
}
|
||||
|
||||
export { default as CoursewareFolders } from './CoursewareFolders.vue';
|
||||
@@ -264,3 +264,36 @@ html.care-mode .ch-calendar .el-date-picker {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
}
|
||||
|
||||
/* 长内容与窄窗口保持可操作,滚动留在业务容器内。 */
|
||||
html body :is(.page-header, .filters, .toolbar, .filter-bar, .page-actions) {
|
||||
flex-wrap: wrap;
|
||||
row-gap: 12px;
|
||||
min-width: 0;
|
||||
}
|
||||
html body :is(.page-header, .filters, .toolbar, .filter-bar) > * {
|
||||
max-width: 100%;
|
||||
min-width: 0;
|
||||
}
|
||||
html body :is(.el-dialog, .el-message-box) {
|
||||
max-width: calc(100vw - 32px);
|
||||
max-height: calc(100dvh - 32px);
|
||||
overflow: auto;
|
||||
}
|
||||
html body :is(.el-dialog__body, .el-card__body) {
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
html body :is(.el-form-item__content, .el-select, .el-input) {
|
||||
min-width: 0;
|
||||
}
|
||||
@media (max-width: 600px) {
|
||||
html body .page {
|
||||
padding: 16px;
|
||||
}
|
||||
html body :is(.filters, .filter-bar) > * {
|
||||
flex: 1 1 160px;
|
||||
}
|
||||
html body .el-dialog {
|
||||
width: calc(100vw - 32px) !important;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user