You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
232 lines
5.6 KiB
232 lines
5.6 KiB
|
8 months ago
|
<template>
|
||
|
|
<div class="flex-col gap-16 wh-full">
|
||
|
|
<EdfsWrap
|
||
|
|
title="当前连接站点"
|
||
|
|
v-if="connectSite?.title"
|
||
|
|
shape="circle"
|
||
|
|
shapeColor="#4B9E5F"
|
||
|
|
class="h-auto"
|
||
|
|
>
|
||
|
|
<div class="station-list-flow">
|
||
|
|
<div class="station-item">
|
||
|
|
<div class="title bg-[#4B9E5F]">
|
||
|
|
<div>{{ connectSite.title }}</div>
|
||
|
|
</div>
|
||
|
|
<div class="body">
|
||
|
|
<div class="info">
|
||
|
|
<div class="info-item">
|
||
|
|
<div class="info-item-label">在线设备</div>
|
||
|
|
<div class="info-item-value">
|
||
|
|
<div class="i-octicon:cloud-16 color-[#4B9E5F] text-16px"></div>
|
||
|
|
{{ onlineCount }}
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<div class="info-item">
|
||
|
|
<div class="info-item-label">离线设备</div>
|
||
|
|
<div class="info-item-value">
|
||
|
|
<div class="i-octicon:cloud-offline-16 color-[#F44336] text-16px"></div>
|
||
|
|
{{ offlineCount }}
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<div class="footer row-end-0">
|
||
|
|
<div class="m-l-auto p-b-8">
|
||
|
|
<el-button
|
||
|
|
type="primary"
|
||
|
|
style="height: 28px; padding: 0 12px"
|
||
|
|
color="#4B9E5F"
|
||
|
|
@click="onTransferData"
|
||
|
|
>迁移数据</el-button
|
||
|
|
>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</EdfsWrap>
|
||
|
|
<EdfsWrap
|
||
|
|
title="迁移历史"
|
||
|
|
shape="circle"
|
||
|
|
shapeColor="#F1BF63"
|
||
|
|
class="flex-1"
|
||
|
|
useScrollBar
|
||
|
|
>
|
||
|
|
<div class="station-list-flow">
|
||
|
|
<div class="station-item" v-for="item in siteList" :key="item.id">
|
||
|
|
<div class="title bg-[#F1BF63]">
|
||
|
|
{{ item.name }}
|
||
|
|
</div>
|
||
|
|
<div class="body">
|
||
|
|
<div class="info">
|
||
|
|
<div class="info-item">
|
||
|
|
<div class="info-item-label">导出路径</div>
|
||
|
|
<div class="info-item-value">{{ item.export_root_path }}</div>
|
||
|
|
</div>
|
||
|
|
<!-- <div class="info-item">
|
||
|
|
<div class="info-item-label">数据大小</div>
|
||
|
|
<div class="info-item-value">2.5GB</div>
|
||
|
|
</div> -->
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<div class="footer">
|
||
|
|
<div class="item">
|
||
|
|
<div class="label">迁移时间:</div>
|
||
|
|
<div class="value">
|
||
|
|
{{ dayjs(item.export_time).format('YYYY-MM-DD HH:mm:ss') }}
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<div class="info-details" @click="onSiteDetails(item)">详情</div>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</EdfsWrap>
|
||
|
|
</div>
|
||
|
|
</template>
|
||
|
|
|
||
|
|
<script setup lang="ts">
|
||
|
|
import dayjs from 'dayjs'
|
||
|
|
import { useTransferDataStore } from '@/stores/transferData'
|
||
|
|
import { storeToRefs } from 'pinia'
|
||
|
|
import { getSiteList, type ISiteList } from '@/api/module/transfer'
|
||
|
|
|
||
|
|
const router = useRouter()
|
||
|
|
const transferDataStore = useTransferDataStore()
|
||
|
|
|
||
|
|
const { isConnected, connectSite, onlineCount, offlineCount } =
|
||
|
|
storeToRefs(transferDataStore)
|
||
|
|
|
||
|
|
const { initConnectSite } = transferDataStore
|
||
|
|
|
||
|
|
watch(isConnected, val => {
|
||
|
|
val ? initConnectSite() : (connectSite.value = null)
|
||
|
|
})
|
||
|
|
|
||
|
|
function onTransferData() {
|
||
|
|
router.push({
|
||
|
|
path: '/data-transfer',
|
||
|
|
query: {
|
||
|
|
type: 'export',
|
||
|
|
},
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
function onSiteDetails(site: ISiteList) {
|
||
|
|
router.push({
|
||
|
|
path: '/data-transfer',
|
||
|
|
query: {
|
||
|
|
type: 'details',
|
||
|
|
site: JSON.stringify(site),
|
||
|
|
},
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
const siteList = ref<ISiteList[]>([])
|
||
|
|
async function loadSiteList() {
|
||
|
|
const res = await getSiteList()
|
||
|
|
if (res.code === 200 || res.code === 0) {
|
||
|
|
siteList.value = res.data
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
onMounted(() => {
|
||
|
|
initConnectSite()
|
||
|
|
loadSiteList()
|
||
|
|
})
|
||
|
|
</script>
|
||
|
|
<style lang="scss" scoped>
|
||
|
|
.station-list-flow {
|
||
|
|
width: 100%;
|
||
|
|
height: 100%;
|
||
|
|
display: flex;
|
||
|
|
flex-wrap: wrap;
|
||
|
|
column-gap: 20px;
|
||
|
|
row-gap: 24px;
|
||
|
|
|
||
|
|
.station-item {
|
||
|
|
width: 280px;
|
||
|
|
height: 180px;
|
||
|
|
border: 1px solid var(--station-card-border-color);
|
||
|
|
border-radius: 6px;
|
||
|
|
overflow: hidden;
|
||
|
|
display: flex;
|
||
|
|
flex-direction: column;
|
||
|
|
box-sizing: border-box;
|
||
|
|
}
|
||
|
|
.title {
|
||
|
|
display: flex;
|
||
|
|
align-items: center;
|
||
|
|
height: 44px;
|
||
|
|
width: 100%;
|
||
|
|
box-sizing: border-box;
|
||
|
|
font-size: 16px;
|
||
|
|
color: #fff;
|
||
|
|
font-weight: 500;
|
||
|
|
justify-content: space-between;
|
||
|
|
padding: 0 12px;
|
||
|
|
user-select: none;
|
||
|
|
.title-edit-btns {
|
||
|
|
display: flex;
|
||
|
|
margin-left: 12px;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
.body {
|
||
|
|
background-color: var(--station-card-bg);
|
||
|
|
display: flex;
|
||
|
|
flex-direction: column;
|
||
|
|
justify-content: center;
|
||
|
|
flex: 1;
|
||
|
|
.info {
|
||
|
|
display: flex;
|
||
|
|
justify-content: space-around;
|
||
|
|
|
||
|
|
.info-item {
|
||
|
|
display: flex;
|
||
|
|
flex-direction: column;
|
||
|
|
align-items: center;
|
||
|
|
.info-item-label {
|
||
|
|
font-size: 14px;
|
||
|
|
color: var(--label-color);
|
||
|
|
}
|
||
|
|
.info-item-value {
|
||
|
|
font-size: 20px;
|
||
|
|
font-weight: 500;
|
||
|
|
margin-top: 4px;
|
||
|
|
text-align: center;
|
||
|
|
display: flex;
|
||
|
|
align-items: center;
|
||
|
|
justify-content: center;
|
||
|
|
column-gap: 4px;
|
||
|
|
color: var(--station-info-val-text);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
.footer {
|
||
|
|
display: flex;
|
||
|
|
justify-content: space-around;
|
||
|
|
align-items: center;
|
||
|
|
padding: 0 12px;
|
||
|
|
height: 36px;
|
||
|
|
|
||
|
|
.item {
|
||
|
|
display: flex;
|
||
|
|
font-size: 14px;
|
||
|
|
color: #999;
|
||
|
|
font-weight: 400;
|
||
|
|
.value {
|
||
|
|
color: #999;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
.info-details {
|
||
|
|
font-size: 14px;
|
||
|
|
color: #f1bf63;
|
||
|
|
cursor: pointer;
|
||
|
|
text-decoration: underline;
|
||
|
|
&:hover {
|
||
|
|
color: #8ace6a;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
</style>
|