|
|
|
@ -3,18 +3,27 @@
@@ -3,18 +3,27 @@
|
|
|
|
|
<el-button type="primary" @click="onBack" class="w-150px"> |
|
|
|
|
<i class="i-line-md:arrow-left"></i>返回站点数据 |
|
|
|
|
</el-button> |
|
|
|
|
<EdfsWrap title="设备列表" class="flex-1" useScrollBar> |
|
|
|
|
<EdfsWrap |
|
|
|
|
:title="isonLineTransfer ? `在线设备列表` : `历史设备列表`" |
|
|
|
|
class="flex-1" |
|
|
|
|
useScrollBar |
|
|
|
|
:shapeColor="isonLineTransfer ? '#4B9E5F' : '#F1BF63'" |
|
|
|
|
> |
|
|
|
|
<template #title-right> |
|
|
|
|
<template v-if="env.VITE_APP_ENV == 'local'"> |
|
|
|
|
<template v-if="isBatchTransfer || isBatchUpgrade"> |
|
|
|
|
<el-button type="primary" @click="onBatchSave"> 确定{{ batchText }} </el-button> |
|
|
|
|
<el-button type="primary" @click="onBatchSave"> |
|
|
|
|
确定{{ batchText }} |
|
|
|
|
</el-button> |
|
|
|
|
<el-button type="info" @click="onBatchCancel"> 取消 </el-button> |
|
|
|
|
</template> |
|
|
|
|
<template v-else> |
|
|
|
|
<el-button type="primary" @click="onBatchTransfer"> <i class="i-mdi:database-arrow-right-outline mr-1" /> |
|
|
|
|
{{ isonLineTransfer ? '数据迁移' : '数据导出' }} </el-button> |
|
|
|
|
<el-button v-if="isonLineTransfer" type="primary" @click="onBatchUpgrade"> <i |
|
|
|
|
class="i-codicon:chip mr-1" />批量升级 |
|
|
|
|
<el-button type="primary" @click="onBatchTransfer"> |
|
|
|
|
<i class="i-mdi:database-arrow-right-outline mr-1" /> |
|
|
|
|
{{ isonLineTransfer ? '数据迁移' : '数据导出' }} |
|
|
|
|
</el-button> |
|
|
|
|
<el-button v-if="isonLineTransfer" type="primary" @click="onBatchUpgrade"> |
|
|
|
|
<i class="i-codicon:chip mr-1" />批量升级 |
|
|
|
|
</el-button> |
|
|
|
|
</template> |
|
|
|
|
</template> |
|
|
|
@ -24,7 +33,10 @@
@@ -24,7 +33,10 @@
|
|
|
|
|
<div class="device-item" v-for="item in devices"> |
|
|
|
|
<div class="device-item-header"> |
|
|
|
|
<div class="flex items-center"> |
|
|
|
|
<el-checkbox :value="item.sn" v-if="(isBatchTransfer || isBatchUpgrade) && item.status !== '离线'"> |
|
|
|
|
<el-checkbox |
|
|
|
|
:value="item.sn" |
|
|
|
|
v-if="(isBatchTransfer || isBatchUpgrade) && item.status !== '离线'" |
|
|
|
|
> |
|
|
|
|
<div>设备ID: {{ item.sn }}</div> |
|
|
|
|
</el-checkbox> |
|
|
|
|
<div v-else class="h-32 leading-32px"> |
|
|
|
@ -32,23 +44,36 @@
@@ -32,23 +44,36 @@
|
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div class="flex items-center gap-col-2" v-if="!(isBatchTransfer || isBatchUpgrade)"> |
|
|
|
|
<div |
|
|
|
|
class="flex items-center gap-col-2" |
|
|
|
|
v-if="!(isBatchTransfer || isBatchUpgrade)" |
|
|
|
|
> |
|
|
|
|
<template v-if="env.VITE_APP_ENV == 'local'"> |
|
|
|
|
<el-tooltip :content="isonLineTransfer ? '数据迁移' : '数据导出'" |
|
|
|
|
v-if="isonLineTransfer ? item.status === '在线' : true"> |
|
|
|
|
<i class="i-mdi:database-arrow-right-outline :hover:color-[#8ACE6A] color-[#4B9E5F] cursor-pointer text-20px" |
|
|
|
|
@click="onBatchTransferSave([item])"></i> |
|
|
|
|
<el-tooltip |
|
|
|
|
:content="isonLineTransfer ? '数据迁移' : '数据导出'" |
|
|
|
|
v-if="isonLineTransfer ? item.status === '在线' : true" |
|
|
|
|
> |
|
|
|
|
<i |
|
|
|
|
class="i-mdi:database-arrow-right-outline :hover:color-[#8ACE6A] color-[#4B9E5F] cursor-pointer text-20px" |
|
|
|
|
@click="onBatchTransferSave([item])" |
|
|
|
|
></i> |
|
|
|
|
</el-tooltip> |
|
|
|
|
<el-tooltip content="固件升级" v-if="isonLineTransfer && item.status === '在线'"> |
|
|
|
|
<i class="i-codicon:chip :hover:color-[#8ACE6A] color-[#4B9E5F] cursor-pointer text-20px" |
|
|
|
|
@click="onFirmwareUpload([item])"></i> |
|
|
|
|
<el-tooltip |
|
|
|
|
content="固件升级" |
|
|
|
|
v-if="isonLineTransfer && item.status === '在线'" |
|
|
|
|
> |
|
|
|
|
<i |
|
|
|
|
class="i-codicon:chip :hover:color-[#8ACE6A] color-[#4B9E5F] cursor-pointer text-20px" |
|
|
|
|
@click="onFirmwareUpload([item])" |
|
|
|
|
></i> |
|
|
|
|
</el-tooltip> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<el-tooltip content="详情"> |
|
|
|
|
<div |
|
|
|
|
class="i-material-symbols:info-outline :hover:color-[#8ACE6A] color-[#4B9E5F] cursor-pointer text-20px" |
|
|
|
|
@click="onDeviceDetails(item)"></div> |
|
|
|
|
@click="onDeviceDetails(item)" |
|
|
|
|
></div> |
|
|
|
|
</el-tooltip> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
@ -91,10 +116,23 @@
@@ -91,10 +116,23 @@
|
|
|
|
|
</EdfsWrap> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<OnLineTransferDlg ref="onLineTransferDlgRef" @on-save="onLineDeviceTransfer" :is-batch-transfer="isBatchTransfer" /> |
|
|
|
|
<OffTransferDlg ref="offTransferDlgRef" :isBatchTransfer="false" :siteInfo="siteInfo" |
|
|
|
|
@on-save="onOffDeviceTransfer" /> |
|
|
|
|
<DeviceDrawer v-model="isShowDetails" ref="deviceDrawerRef" :siteInfo="siteInfo" :is-transfer="isonLineTransfer" /> |
|
|
|
|
<OnLineTransferDlg |
|
|
|
|
ref="onLineTransferDlgRef" |
|
|
|
|
@on-save="onLineDeviceTransfer" |
|
|
|
|
:is-batch-transfer="isBatchTransfer" |
|
|
|
|
/> |
|
|
|
|
<OffTransferDlg |
|
|
|
|
ref="offTransferDlgRef" |
|
|
|
|
:isBatchTransfer="false" |
|
|
|
|
:siteInfo="siteInfo" |
|
|
|
|
@on-save="onOffDeviceTransfer" |
|
|
|
|
/> |
|
|
|
|
<DeviceDrawer |
|
|
|
|
v-model="isShowDetails" |
|
|
|
|
ref="deviceDrawerRef" |
|
|
|
|
:siteInfo="siteInfo" |
|
|
|
|
:is-transfer="isonLineTransfer" |
|
|
|
|
/> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
|
@ -103,10 +141,7 @@ import OnLineTransferDlg from './components/onLineTransferDlg.vue'
@@ -103,10 +141,7 @@ import OnLineTransferDlg from './components/onLineTransferDlg.vue'
|
|
|
|
|
import OffTransferDlg from './components/offTransferDlg.vue' |
|
|
|
|
import { useTransferDataStore } from '@/stores/transferData' |
|
|
|
|
import { storeToRefs } from 'pinia' |
|
|
|
|
import type { |
|
|
|
|
IOfflineDevice, |
|
|
|
|
IOnlineDevice, |
|
|
|
|
} from './type' |
|
|
|
|
import type { IOfflineDevice, IOnlineDevice } from './type' |
|
|
|
|
import { useMessage } from '@/composables/useMessage' |
|
|
|
|
import { getDeviceList, type ISite } from '@/api/module/transfer' |
|
|
|
|
import DeviceDrawer from './components/deviceDrawer.vue' |
|
|
|
@ -128,14 +163,16 @@ const message = useMessage()
@@ -128,14 +163,16 @@ const message = useMessage()
|
|
|
|
|
const transferDataStore = useTransferDataStore() |
|
|
|
|
const { devicesMap } = storeToRefs(transferDataStore) |
|
|
|
|
|
|
|
|
|
const transferStatus = ref<'progress' | 'success' | 'failed' | 'timeout' | 'stop' | undefined>() |
|
|
|
|
const transferStatus = ref< |
|
|
|
|
'progress' | 'success' | 'failed' | 'timeout' | 'stop' | undefined |
|
|
|
|
>() |
|
|
|
|
|
|
|
|
|
const devices = computed(() => { |
|
|
|
|
return isonLineTransfer.value ? Array.from(devicesMap.value.values()) : offLineDeviceList.value |
|
|
|
|
return isonLineTransfer.value |
|
|
|
|
? Array.from(devicesMap.value.values()) |
|
|
|
|
: offLineDeviceList.value |
|
|
|
|
}) as Ref<any[]> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 在线设备批量迁移 |
|
|
|
|
function onLineDeviceTransfer() { |
|
|
|
|
if (isBatchTransfer.value) { |
|
|
|
@ -182,10 +219,9 @@ function onBatchTransferSave(checkDeviceList: IOnlineDevice[] | IOfflineDevice[]
@@ -182,10 +219,9 @@ function onBatchTransferSave(checkDeviceList: IOnlineDevice[] | IOfflineDevice[]
|
|
|
|
|
const deivcesParms = lineDevices.map(item => ({ |
|
|
|
|
sn: item.sn, |
|
|
|
|
host: item.clientIp, |
|
|
|
|
disk: item.footprint |
|
|
|
|
disk: item.footprint, |
|
|
|
|
})) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const parmas: TaskCreateParams = { |
|
|
|
|
site, |
|
|
|
|
devices: deivcesParms, |
|
|
|
@ -247,9 +283,7 @@ function getOnlineDeviceList(): IOnlineDevice[] {
@@ -247,9 +283,7 @@ function getOnlineDeviceList(): IOnlineDevice[] {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function getOfflineDeviceList(): IOfflineDevice[] { |
|
|
|
|
return offLineDeviceList.value.filter(item => |
|
|
|
|
checkDeviceList.value.includes(item.sn) |
|
|
|
|
) |
|
|
|
|
return offLineDeviceList.value.filter(item => checkDeviceList.value.includes(item.sn)) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function onBatchCancel() { |
|
|
|
@ -327,10 +361,9 @@ async function onFirmwareUpload(devices: IOnlineDevice[]) {
@@ -327,10 +361,9 @@ async function onFirmwareUpload(devices: IOnlineDevice[]) {
|
|
|
|
|
const deivcesParms = devices.map(item => ({ |
|
|
|
|
sn: item.sn, |
|
|
|
|
host: item.clientIp, |
|
|
|
|
disk: item.footprint |
|
|
|
|
disk: item.footprint, |
|
|
|
|
})) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const parmas: TaskCreateParams = { |
|
|
|
|
site, |
|
|
|
|
devices: deivcesParms, |
|
|
|
@ -352,7 +385,6 @@ function onOffDeviceTransfer() {
@@ -352,7 +385,6 @@ function onOffDeviceTransfer() {
|
|
|
|
|
onBatchCancel() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ================ 离线数据导入 end ========= |
|
|
|
|
|
|
|
|
|
// const transferLogScrollbar = ref() |
|
|
|
|