本次提交包含多项功能更新: 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 登录窗口模式,支持全屏置顶
85 lines
4.0 KiB
Vue
85 lines
4.0 KiB
Vue
<template>
|
|
<span v-if="variant === 'dot'" class="run-ind dot" :title="label"><i class="ri-dot"></i></span>
|
|
<span v-else-if="variant === 'tag'" class="run-ind tag"><i class="ri-dot"></i><span class="ri-label">{{ label }}</span></span>
|
|
<div v-else class="run-ind" :class="variant">
|
|
<div class="ri-row">
|
|
<i class="ri-dot"></i>
|
|
<span v-if="showLabel" class="ri-label">{{ label }}</span>
|
|
<span v-if="variant !== 'chip' && name" class="ri-name">{{ name }}</span>
|
|
<span class="ri-pct">{{ progress }}%</span>
|
|
<span v-if="variant === 'chip' && showBar" class="ri-track mini"><i :style="barStyle"></i></span>
|
|
</div>
|
|
<template v-if="variant !== 'chip'">
|
|
<div v-if="showBar" class="ri-track"><i :style="barStyle"></i></div>
|
|
<div v-if="$slots.tail" class="ri-tail"><slot name="tail" /></div>
|
|
</template>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup>
|
|
import { computed } from 'vue'
|
|
|
|
// 「运行中」唯一出处:颜色、脉冲与文案集中在这里,调用方只传进度/名称。
|
|
// inline:首页运行卡、右轨当前运行(可带日志 tail 插槽);
|
|
// chip:插件详情页头部胶囊;tag:小胶囊(右轨「进行中」/日志 LIVE);dot:仅脉冲点(标签页)。
|
|
const props = defineProps({
|
|
variant: { type: String, default: 'inline' }, // inline | chip | tag | dot
|
|
name: { type: String, default: '' },
|
|
progress: { type: Number, default: 0 },
|
|
label: { type: String, default: '运行中' },
|
|
showLabel: { type: Boolean, default: true },
|
|
showBar: { type: Boolean, default: true },
|
|
})
|
|
|
|
const barStyle = computed(() => ({ width: `${Math.max(0, Math.min(100, props.progress))}%` }))
|
|
</script>
|
|
|
|
<style scoped>
|
|
.run-ind { --ri-ink: var(--brand); --ri-track: var(--brand-track); --ri-soft: var(--brand-soft); }
|
|
|
|
.ri-dot {
|
|
width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
|
|
background: var(--ri-ink); animation: riPulse 1.4s infinite;
|
|
}
|
|
@keyframes riPulse {
|
|
0%, 100% { box-shadow: 0 0 0 0 var(--ri-soft); }
|
|
50% { box-shadow: 0 0 0 4px var(--ri-soft); }
|
|
}
|
|
|
|
.ri-row { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
|
|
.ri-label { font: 600 12px/17px var(--f-cn); color: var(--t1); flex-shrink: 0; }
|
|
.ri-name {
|
|
flex: 1; min-width: 0; font-size: 12px; font-weight: 600; color: var(--t1);
|
|
white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
|
|
}
|
|
.ri-pct { font: 600 12px/1 var(--f-num); color: var(--ri-ink); flex-shrink: 0; }
|
|
|
|
.ri-track { height: 5px; border-radius: 3px; background: var(--ri-track); overflow: hidden; }
|
|
.ri-track i { display: block; height: 100%; border-radius: 3px; background: var(--ri-ink); transition: width .5s var(--ease); }
|
|
|
|
.run-ind.inline { display: flex; flex-direction: column; gap: var(--space-2); }
|
|
.ri-tail { display: flex; flex-direction: column; gap: 3px; max-height: 72px; overflow: hidden; }
|
|
|
|
/* 插件详情页胶囊:仅回显进度,执行入口在插件界面内 */
|
|
.run-ind.chip { display: inline-flex; align-items: center; padding: var(--space-1-5) var(--space-3); border-radius: var(--r-pill); background: var(--ri-soft); }
|
|
.run-ind.chip .ri-row { gap: var(--space-1-5); }
|
|
.run-ind.chip .ri-dot { width: 5px; height: 5px; animation: riBlink 1s infinite; }
|
|
.run-ind.chip .ri-label { font-size: 12px; color: var(--brand-ink); }
|
|
.run-ind.chip .ri-pct { font-size: 12px; }
|
|
.run-ind.chip .ri-track.mini { width: 56px; height: 4px; border-radius: 2px; }
|
|
@keyframes riBlink { 50% { opacity: .25; } }
|
|
|
|
/* 小胶囊:右轨「进行中」、日志 LIVE(替代各页面自定义的脉动态样式) */
|
|
.run-ind.tag {
|
|
display: inline-flex; align-items: center; gap: var(--space-1);
|
|
height: 20px; padding: 0 var(--space-2);
|
|
border-radius: var(--r-pill); background: var(--ri-soft);
|
|
}
|
|
.run-ind.tag .ri-dot { width: 5px; height: 5px; }
|
|
.run-ind.tag .ri-label { font: 500 10px/1 var(--f-cn); color: var(--brand-ink); }
|
|
|
|
/* 仅脉冲点:运行台标签页等只需状态提示的位置 */
|
|
.run-ind.dot { display: inline-flex; align-items: center; }
|
|
.run-ind.dot .ri-dot { width: 6px; height: 6px; }
|
|
</style>
|