feat: 完善课表档案、课件归档、提醒与客户端更新并发布 1.4.1
- 重写课表档案工作区并合并时间表、课表与完整档案导入导出 - 修复课前/上下课提醒遮罩与通知收回冲突 - 增加课件文件夹分类、教师归档路径和客户端本机归档 - 打通客户端下载/安装/完成状态上报并在管理端展示更新过程 - 修复侧栏折叠裁切、课时多选与上传控件样式 - 统一版本到 1.4.1
This commit is contained in:
1 parent
2612a912ef
commit
6347d1e5aa
59 files changed
+2251
-584
No files matched your search
@@ -0,0 +1,70 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue';
|
||||
import type { ClientDeviceDto } from '@classhelper/shared';
|
||||
const props = defineProps<{ device: ClientDeviceDto }>();
|
||||
const progress = computed(() => props.device.updateProgress);
|
||||
const labels = {
|
||||
idle: '等待客户端接收',
|
||||
downloading: '当前客户端正在下载更新包',
|
||||
verifying: '正在校验更新包',
|
||||
ready: '更新包已就绪',
|
||||
waiting: '已下载,等待安装时机',
|
||||
installing: '当前客户端正在更新,将会短暂离线',
|
||||
completed: '客户端已完成更新',
|
||||
failed: '客户端更新失败',
|
||||
};
|
||||
const waiting = computed(() =>
|
||||
props.device.updateMode === 'immediate'
|
||||
? '立即安装'
|
||||
: props.device.updateMode === 'after-school'
|
||||
? `放学后安装${props.device.updateNotBefore ? ' · ' + new Date(props.device.updateNotBefore).toLocaleString() : ''}`
|
||||
: '课间且主窗口隐藏满五分钟后安装',
|
||||
);
|
||||
const mb = (bytes: number) => `${(bytes / 1048576).toFixed(1)} MB`;
|
||||
</script>
|
||||
<template>
|
||||
<div class="update-status">
|
||||
<template v-if="progress">
|
||||
<strong>
|
||||
{{ labels[progress.stage] }}
|
||||
<template v-if="progress.stage === 'completed'">,版本 {{ progress.version }}</template>
|
||||
</strong>
|
||||
<el-progress
|
||||
v-if="['downloading', 'verifying', 'waiting'].includes(progress.stage)"
|
||||
:percentage="progress.percent || 0"
|
||||
:indeterminate="progress.percent === null"
|
||||
/>
|
||||
<small v-if="progress.totalBytes">
|
||||
{{ mb(progress.downloadedBytes) }} / {{ mb(progress.totalBytes) }}
|
||||
</small>
|
||||
<small v-if="progress.stage === 'waiting'">{{ waiting }}</small>
|
||||
<el-text v-if="progress.error" type="danger">{{ progress.error }}</el-text>
|
||||
<small v-if="progress.updatedAt">上次报告:{{ new Date(progress.updatedAt).toLocaleString() }}</small>
|
||||
<el-text v-if="progress.stage === 'installing' && !device.online" type="warning">
|
||||
正在等待新版上线确认
|
||||
</el-text>
|
||||
</template>
|
||||
<template v-else-if="device.updateTargetVersion">
|
||||
<strong>已下发 {{ device.updateTargetVersion }},等待客户端接收</strong>
|
||||
<small>{{ waiting }}</small>
|
||||
</template>
|
||||
<span v-else>暂无更新任务</span>
|
||||
<el-text
|
||||
v-if="device.updateTargetVersion && !device.autoUpdate && progress?.stage !== 'completed'"
|
||||
type="warning"
|
||||
>
|
||||
客户端已关闭自动更新,请在客户端开启后重试
|
||||
</el-text>
|
||||
</div>
|
||||
</template>
|
||||
<style scoped>
|
||||
.update-status {
|
||||
display: grid;
|
||||
gap: 6px;
|
||||
padding-block: 6px;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
small {
|
||||
color: var(--el-text-color-secondary);
|
||||
}
|
||||
</style>
|
||||
@@ -103,7 +103,23 @@ watch(
|
||||
width: 0;
|
||||
}
|
||||
.management-menu.menu-rail :deep(.el-sub-menu__title) {
|
||||
padding: 0 14px !important;
|
||||
padding: 0 !important;
|
||||
margin: 4px 0 !important;
|
||||
width: 48px;
|
||||
height: 44px;
|
||||
justify-content: center;
|
||||
}
|
||||
.management-menu.menu-rail .management-group-title {
|
||||
justify-content: center;
|
||||
gap: 0;
|
||||
min-width: 20px;
|
||||
}
|
||||
.management-menu.menu-rail .management-group-title span {
|
||||
flex: 0 0 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
.management-menu.menu-rail :deep(.el-sub-menu__icon-arrow) {
|
||||
visibility: hidden;
|
||||
}
|
||||
.management-menu.menu-rail {
|
||||
overflow-x: hidden;
|
||||
|
||||
Reference in new issue
Block a user