Files
37duAutomation/desktop/electron-shell/frontend/src/components/DownloadDialog.vue
T
puddy 843ff244a6 feat: 新增多插件 UI 支持及运行日志集中回传功能
本次提交包含多项功能更新:
1. 为多个插件(xq0002/0003/0004/0008/0010/0011/0020/0031_xq0032/0033/0035/0037/0045_xq0046/0047/0048)新增 UI 界面及配置支持
2. 新增运行日志集中回传功能,客户端自动上传运行日志到中心机集中存储
3. 新增插件分类字段支持,用于场景库分组管理
4. 优化 xq0034/0037/0048 等插件的功能及描述
5. 修复控制面响应兼容问题,支持新旧版本数据格式
6. 新增 xq0033 插件的状态存储模块,用于历史记录管理
7. 优化 CRM 登录窗口模式,支持全屏置顶
2026-10-26 15:42:50 +08:00

52 lines
2.1 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<el-dialog v-model="visible" :title="title" width="420px"
:close-on-click-modal="false" align-center class="upd-dl-dialog">
<template v-if="dl.status === 'downloading'">
<div class="dl-dlg-body">
<el-progress :percentage="dl.pct || 0" :stroke-width="10" />
<span class="dl-dlg-bytes">{{ fmtBytes(dl.received) }}{{ dl.total ? ' / ' + fmtBytes(dl.total) : '' }}</span>
</div>
</template>
<template v-else-if="dl.status === 'extracting'">
<div class="dl-dlg-body">
<el-progress :percentage="100" :stroke-width="10" status="warning" :indeterminate="true" :duration="2" />
<span class="dl-dlg-bytes">下载完成,正在解压安装(约需几十秒)…</span>
</div>
</template>
<template v-else-if="dl.status === 'failed'">
<div class="dl-dlg-body">
<span class="dl-dlg-err">{{ failLabel }}:{{ dl.error || '未知错误' }}</span>
</div>
</template>
<div v-else class="dl-dlg-body"><span>{{ bodyText }}</span></div>
<template #footer><slot name="footer" /></template>
</el-dialog>
</template>
<script setup>
import { computed } from 'vue'
import { fmtBytes } from '../utils/format'
const props = defineProps({
modelValue: { type: Boolean, default: false },
title: { type: String, default: '' },
dl: { type: Object, default: () => ({}) },
// 非下载/解压/失败状态的正文(准备中、已就绪、已安装等由调用方给文案)
bodyText: { type: String, default: '' },
failLabel: { type: String, default: '下载失败' },
})
const emit = defineEmits(['update:modelValue'])
const visible = computed({
get: () => props.modelValue,
set: (v) => emit('update:modelValue', v),
})
</script>
<style scoped>
/* el-dialog 就地渲染(未 append-to-body),scoped 样式仍作用于弹窗内部 */
.dl-dlg-body { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-1) 2px; font-size: 12.5px; color: var(--t2); }
.dl-dlg-bytes { font-family: var(--f-num); font-size: 11px; color: var(--t3); text-align: right; }
.dl-dlg-err { color: var(--danger-ink); font-size: 12px; line-height: 1.6; }
</style>