|
|
|
@ -1,23 +1,20 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div class="flex-col gap-16 wh-full"> |
|
|
|
<div class="flex-col gap-16 wh-full"> |
|
|
|
<el-button type="primary" @click="onBack" class="w-150px"> |
|
|
|
<el-button class="w-150px" type="primary" @click="onBack"> |
|
|
|
<i class="i-line-md:arrow-left"></i>返回站点数据 |
|
|
|
<i class="i-line-md:arrow-left"></i>返回站点数据 |
|
|
|
</el-button> |
|
|
|
</el-button> |
|
|
|
<EdfsWrap |
|
|
|
<EdfsWrap |
|
|
|
|
|
|
|
:shapeColor="isonLineTransfer ? '#4B9E5F' : '#F1BF63'" |
|
|
|
:title="isonLineTransfer ? `在线设备列表` : `历史设备列表`" |
|
|
|
:title="isonLineTransfer ? `在线设备列表` : `历史设备列表`" |
|
|
|
class="flex-1" |
|
|
|
class="flex-1" |
|
|
|
useScrollBar |
|
|
|
useScrollBar |
|
|
|
:shapeColor="isonLineTransfer ? '#4B9E5F' : '#F1BF63'" |
|
|
|
|
|
|
|
> |
|
|
|
> |
|
|
|
<template #title-right> |
|
|
|
<template #title-right> |
|
|
|
<template v-if="env.VITE_APP_ENV == 'local'"> |
|
|
|
<template v-if="env.VITE_APP_ENV == 'local'"> |
|
|
|
<template v-if="isBatchTransfer || isBatchUpgrade"> |
|
|
|
<template v-if="isBatchTransfer || isBatchUpgrade"> |
|
|
|
<el-button |
|
|
|
<el-button color="#3894FF" @click="onSelectAllCheckbox"> |
|
|
|
color="#3894FF" |
|
|
|
<span class="text-white" |
|
|
|
@click="onSelectAllCheckbox"> |
|
|
|
>{{ isSelectAllCheckbox ? '取消全选' : '全选' }} |
|
|
|
<span class="text-white">{{ |
|
|
|
|
|
|
|
isSelectAllCheckbox ? '取消全选' : '全选' |
|
|
|
|
|
|
|
}} |
|
|
|
|
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</el-button> |
|
|
|
</el-button> |
|
|
|
<el-button type="primary" @click="onBatchSave"> |
|
|
|
<el-button type="primary" @click="onBatchSave"> |
|
|
|
@ -27,41 +24,41 @@ |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<template v-else> |
|
|
|
<template v-else> |
|
|
|
<el-button type="primary" @click="onBatchTransfer"> |
|
|
|
<el-button type="primary" @click="onBatchTransfer"> |
|
|
|
<i class="i-mdi:database-arrow-right-outline mr-1"/> |
|
|
|
<i class="i-mdi:database-arrow-right-outline mr-1" /> |
|
|
|
{{ localTransferBtnText }} |
|
|
|
{{ localTransferBtnText }} |
|
|
|
</el-button> |
|
|
|
</el-button> |
|
|
|
<el-button v-if="isonLineTransfer" type="primary" @click="onBatchUpgrade"> |
|
|
|
<el-button v-if="isonLineTransfer" type="primary" @click="onBatchUpgrade"> |
|
|
|
<i class="i-codicon:chip mr-1"/>批量升级 |
|
|
|
<i class="i-codicon:chip mr-1" />批量升级 |
|
|
|
</el-button> |
|
|
|
</el-button> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<div class="device-list-wrap"> |
|
|
|
<div class="device-list-wrap"> |
|
|
|
<el-checkbox-group v-model="checkDeviceList"> |
|
|
|
<el-checkbox-group v-model="checkDeviceList"> |
|
|
|
<div class="device-item" v-for="item in devices"> |
|
|
|
<div v-for="item in devices" class="device-item"> |
|
|
|
<div class="device-item-header"> |
|
|
|
<div class="device-item-header"> |
|
|
|
<div class="flex items-center"> |
|
|
|
<div class="flex items-center"> |
|
|
|
<el-checkbox |
|
|
|
<el-checkbox |
|
|
|
:value="item.sn" |
|
|
|
|
|
|
|
v-if="(isBatchTransfer || isBatchUpgrade) && item.status !== '离线'" |
|
|
|
v-if="(isBatchTransfer || isBatchUpgrade) && item.status !== '离线'" |
|
|
|
|
|
|
|
:value="item.sn" |
|
|
|
> |
|
|
|
> |
|
|
|
<div>设备ID: {{ item.sn }}</div> |
|
|
|
<div>设备ID: {{ item.sn }}</div> |
|
|
|
</el-checkbox> |
|
|
|
</el-checkbox> |
|
|
|
<div v-else |
|
|
|
<div v-else class="h-32 leading-32px"> |
|
|
|
class="h-32 leading-32px"> |
|
|
|
<div class="overflow-hidden text-ellipsis whitespace-nowrap w-140"> |
|
|
|
<div class="overflow-hidden text-ellipsis whitespace-nowrap w-140">设备ID: |
|
|
|
设备ID: |
|
|
|
<el-tooltip :content="item.sn "> {{ item.sn }}</el-tooltip> |
|
|
|
<el-tooltip :content="item.sn"> {{ item.sn }}</el-tooltip> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div |
|
|
|
<div |
|
|
|
class="flex items-center gap-col-1" |
|
|
|
|
|
|
|
v-if="!(isBatchTransfer || isBatchUpgrade)" |
|
|
|
v-if="!(isBatchTransfer || isBatchUpgrade)" |
|
|
|
|
|
|
|
class="flex items-center gap-col-1" |
|
|
|
> |
|
|
|
> |
|
|
|
<template v-if="env.VITE_APP_ENV == 'local'"> |
|
|
|
<template v-if="env.VITE_APP_ENV == 'local'"> |
|
|
|
<el-tooltip |
|
|
|
<el-tooltip |
|
|
|
:content="isonLineTransfer ? '数据导出' : '数据导入'" |
|
|
|
|
|
|
|
v-if="isonLineTransfer ? item.status === '在线' : true" |
|
|
|
v-if="isonLineTransfer ? item.status === '在线' : true" |
|
|
|
|
|
|
|
:content="isonLineTransfer ? '数据导出' : '数据导入'" |
|
|
|
> |
|
|
|
> |
|
|
|
<i |
|
|
|
<i |
|
|
|
class="i-mdi:database-arrow-right-outline :hover:color-[#8ACE6A] color-[#4B9E5F] cursor-pointer text-20px" |
|
|
|
class="i-mdi:database-arrow-right-outline :hover:color-[#8ACE6A] color-[#4B9E5F] cursor-pointer text-20px" |
|
|
|
@ -69,8 +66,8 @@ |
|
|
|
/> |
|
|
|
/> |
|
|
|
</el-tooltip> |
|
|
|
</el-tooltip> |
|
|
|
<el-tooltip |
|
|
|
<el-tooltip |
|
|
|
content="固件升级" |
|
|
|
|
|
|
|
v-if="isonLineTransfer && item.status === '在线'" |
|
|
|
v-if="isonLineTransfer && item.status === '在线'" |
|
|
|
|
|
|
|
content="固件升级" |
|
|
|
> |
|
|
|
> |
|
|
|
<i |
|
|
|
<i |
|
|
|
class="i-codicon:chip :hover:color-[#8ACE6A] color-[#4B9E5F] cursor-pointer text-20px" |
|
|
|
class="i-codicon:chip :hover:color-[#8ACE6A] color-[#4B9E5F] cursor-pointer text-20px" |
|
|
|
@ -85,26 +82,25 @@ |
|
|
|
@click="onDeviceDetails(item)" |
|
|
|
@click="onDeviceDetails(item)" |
|
|
|
/> |
|
|
|
/> |
|
|
|
</el-tooltip> |
|
|
|
</el-tooltip> |
|
|
|
<el-tooltip content="拓扑详情" v-if="isonLineTransfer"> |
|
|
|
<el-tooltip v-if="isonLineTransfer" content="拓扑详情"> |
|
|
|
<i |
|
|
|
<i |
|
|
|
class="i-hugeicons:node-edit :hover:color-[#8ACE6A] color-[#4B9E5F] cursor-pointer text-20px" |
|
|
|
class="i-hugeicons:node-edit :hover:color-[#8ACE6A] color-[#4B9E5F] cursor-pointer text-20px" |
|
|
|
@click="onTopology(item)" |
|
|
|
@click="onTopology(item)" |
|
|
|
/> |
|
|
|
/> |
|
|
|
</el-tooltip> |
|
|
|
</el-tooltip> |
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div class="device-item-body relative"> |
|
|
|
<div class="device-item-body relative"> |
|
|
|
<template v-if="isonLineTransfer"> |
|
|
|
<template v-if="isonLineTransfer"> |
|
|
|
<template v-for="key in Object.keys(onlineDeviceMap)"> |
|
|
|
<template v-for="key in Object.keys(onlineDeviceMap)"> |
|
|
|
<div class="info-item" v-if="isonLineTransfer && key === 'status'"> |
|
|
|
<div v-if="isonLineTransfer && key === 'status'" class="info-item"> |
|
|
|
<div>{{ onlineDeviceMap.status }}:</div> |
|
|
|
<div>{{ onlineDeviceMap.status }}:</div> |
|
|
|
<el-tag :type="item.status === '在线' ? 'success' : 'danger'"> |
|
|
|
<el-tag :type="item.status === '在线' ? 'success' : 'danger'"> |
|
|
|
{{ item.status }} |
|
|
|
{{ item.status }} |
|
|
|
</el-tag> |
|
|
|
</el-tag> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="info-item" v-else> |
|
|
|
<div v-else class="info-item"> |
|
|
|
<div>{{ onlineDeviceMap[key as keyof typeof onlineDeviceMap] }}:</div> |
|
|
|
<div>{{ onlineDeviceMap[key as keyof typeof onlineDeviceMap] }}:</div> |
|
|
|
<div>{{ item[key] }}</div> |
|
|
|
<div>{{ item[key] }}</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
@ -112,14 +108,16 @@ |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<template v-else> |
|
|
|
<template v-else> |
|
|
|
<template v-for="key in Object.keys(offlineDeviceMap)"> |
|
|
|
<template v-for="key in Object.keys(offlineDeviceMap)"> |
|
|
|
<div class="info-item" |
|
|
|
<div |
|
|
|
v-if="['create_time','end_time','start_time'].includes(key)"> |
|
|
|
v-if="['create_time', 'end_time', 'start_time'].includes(key)" |
|
|
|
|
|
|
|
class="info-item" |
|
|
|
|
|
|
|
> |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
{{ offlineDeviceMap[key as keyof typeof offlineDeviceMap] }}: |
|
|
|
{{ offlineDeviceMap[key as keyof typeof offlineDeviceMap] }}: |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div>{{ dayjs(item[key]).format('YYYY-MM-DD HH:mm:ss') }}</div> |
|
|
|
<div>{{ dayjs(item[key]).format('YYYY-MM-DD HH:mm:ss') }}</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="info-item" v-else> |
|
|
|
<div v-else class="info-item"> |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
{{ offlineDeviceMap[key as keyof typeof offlineDeviceMap] }}: |
|
|
|
{{ offlineDeviceMap[key as keyof typeof offlineDeviceMap] }}: |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
@ -136,8 +134,8 @@ |
|
|
|
|
|
|
|
|
|
|
|
<OnLineTransferDlg |
|
|
|
<OnLineTransferDlg |
|
|
|
ref="onLineTransferDlgRef" |
|
|
|
ref="onLineTransferDlgRef" |
|
|
|
@on-save="onLineDeviceTransfer" |
|
|
|
|
|
|
|
:is-batch-transfer="isBatchTransfer" |
|
|
|
:is-batch-transfer="isBatchTransfer" |
|
|
|
|
|
|
|
@on-save="onLineDeviceTransfer" |
|
|
|
/> |
|
|
|
/> |
|
|
|
<OffTransferDlg |
|
|
|
<OffTransferDlg |
|
|
|
ref="offTransferDlgRef" |
|
|
|
ref="offTransferDlgRef" |
|
|
|
@ -146,14 +144,14 @@ |
|
|
|
@on-save="onOffDeviceTransfer" |
|
|
|
@on-save="onOffDeviceTransfer" |
|
|
|
/> |
|
|
|
/> |
|
|
|
<DeviceDrawer |
|
|
|
<DeviceDrawer |
|
|
|
v-model="isShowDetails" |
|
|
|
|
|
|
|
ref="deviceDrawerRef" |
|
|
|
ref="deviceDrawerRef" |
|
|
|
:siteInfo="siteInfo" |
|
|
|
v-model="isShowDetails" |
|
|
|
:is-transfer="isonLineTransfer" |
|
|
|
:is-transfer="isonLineTransfer" |
|
|
|
|
|
|
|
:siteInfo="siteInfo" |
|
|
|
/> |
|
|
|
/> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
|
<script lang="ts" setup> |
|
|
|
import dayjs from 'dayjs' |
|
|
|
import dayjs from 'dayjs' |
|
|
|
import OnLineTransferDlg from './components/onLineTransferDlg.vue' |
|
|
|
import OnLineTransferDlg from './components/onLineTransferDlg.vue' |
|
|
|
import OffTransferDlg from './components/offTransferDlg.vue' |
|
|
|
import OffTransferDlg from './components/offTransferDlg.vue' |
|
|
|
@ -166,23 +164,24 @@ import DeviceDrawer from './components/deviceDrawer.vue' |
|
|
|
|
|
|
|
|
|
|
|
import { getFirmwarePath } from '@/api/module/firmware' |
|
|
|
import { getFirmwarePath } from '@/api/module/firmware' |
|
|
|
import { createTask, type TaskCreateParams } from '@/api/module/taks' |
|
|
|
import { createTask, type TaskCreateParams } from '@/api/module/taks' |
|
|
|
import EdfsWrap from "@/components/Edfs-wrap.vue"; |
|
|
|
import EdfsWrap from '@/components/Edfs-wrap.vue' |
|
|
|
import { computed } from "vue"; |
|
|
|
import { computed } from 'vue' |
|
|
|
|
|
|
|
|
|
|
|
const env = import.meta.env |
|
|
|
const env = import.meta.env |
|
|
|
const onLineTransferDlgRef = ref<typeof OnLineTransferDlg>() |
|
|
|
const onLineTransferDlgRef = ref<typeof OnLineTransferDlg>() |
|
|
|
const router = useRouter() |
|
|
|
const router = useRouter() |
|
|
|
const route = useRoute() |
|
|
|
const route = useRoute() |
|
|
|
const siteInfo = ref<ISite>( |
|
|
|
const siteInfo = ref<ISite>( |
|
|
|
route.query.site ? JSON.parse(route.query.site as string) : null |
|
|
|
route.query.site ? JSON.parse(route.query.site as string) : null, |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
const type = ref<'export' | 'details'>(route.query.type as 'export' | 'details') |
|
|
|
const type = ref<'export' | 'details'>(route.query.type as 'export' | 'details') |
|
|
|
const isonLineTransfer = computed(() => type.value === 'export') |
|
|
|
const isonLineTransfer = computed(() => type.value === 'export') |
|
|
|
const message = useMessage() |
|
|
|
const message = useMessage() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const localTransferBtnText = computed(() => |
|
|
|
const localTransferBtnText = computed(() => isonLineTransfer.value ? '数据导出' : '数据导入') |
|
|
|
isonLineTransfer.value ? '数据导出' : '数据导入', |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
const transferDataStore = useTransferDataStore() |
|
|
|
const transferDataStore = useTransferDataStore() |
|
|
|
const { devicesMap } = storeToRefs(transferDataStore) |
|
|
|
const { devicesMap } = storeToRefs(transferDataStore) |
|
|
|
@ -217,7 +216,10 @@ const onlineDeviceMap: Record< |
|
|
|
footprint: '数据占用空间', |
|
|
|
footprint: '数据占用空间', |
|
|
|
} |
|
|
|
} |
|
|
|
const offlineDeviceMap: Record< |
|
|
|
const offlineDeviceMap: Record< |
|
|
|
keyof Pick<IOfflineDevice, 'site_id' | 'db' | 'create_time' | 'start_time' | 'end_time'>, |
|
|
|
keyof Pick< |
|
|
|
|
|
|
|
IOfflineDevice, |
|
|
|
|
|
|
|
'site_id' | 'db' | 'create_time' | 'start_time' | 'end_time' |
|
|
|
|
|
|
|
>, |
|
|
|
string |
|
|
|
string |
|
|
|
> = { |
|
|
|
> = { |
|
|
|
site_id: '站点名称', |
|
|
|
site_id: '站点名称', |
|
|
|
@ -281,17 +283,19 @@ function onBatchUpgrade() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const batchText = computed(() => { |
|
|
|
const batchText = computed(() => { |
|
|
|
return isBatchTransfer.value ? isonLineTransfer.value ? '导出' : '导入' : '升级' |
|
|
|
return isBatchTransfer.value ? (isonLineTransfer.value ? '导出' : '导入') : '升级' |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
const isSelectAllCheckbox = computed(() => checkDeviceList.value.length === devices.value.length) |
|
|
|
const isSelectAllCheckbox = computed( |
|
|
|
|
|
|
|
() => checkDeviceList.value.length === devices.value.length, |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
function onSelectAllCheckbox() { |
|
|
|
function onSelectAllCheckbox() { |
|
|
|
if (isSelectAllCheckbox.value) { |
|
|
|
if (isSelectAllCheckbox.value) { |
|
|
|
checkDeviceList.value = [] |
|
|
|
checkDeviceList.value = [] |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
checkDeviceList.value = devices.value.map((item) => item.sn) |
|
|
|
checkDeviceList.value = devices.value.map(item => item.sn) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function onBatchSave() { |
|
|
|
function onBatchSave() { |
|
|
|
@ -390,10 +394,12 @@ function onTopology(item: IDevice) { |
|
|
|
router.push({ |
|
|
|
router.push({ |
|
|
|
path: '/station/topology', |
|
|
|
path: '/station/topology', |
|
|
|
query: { |
|
|
|
query: { |
|
|
|
deviceInfo: JSON.stringify(Object.assign(obj, item, { |
|
|
|
deviceInfo: JSON.stringify( |
|
|
|
|
|
|
|
Object.assign(obj, item, { |
|
|
|
isonLine: isonLineTransfer.value, |
|
|
|
isonLine: isonLineTransfer.value, |
|
|
|
})) |
|
|
|
}), |
|
|
|
} |
|
|
|
), |
|
|
|
|
|
|
|
}, |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@ -457,7 +463,7 @@ function onOffDeviceTransfer() { |
|
|
|
// }, { deep: true }) |
|
|
|
// }, { deep: true }) |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss"> |
|
|
|
<style lang="scss" scoped> |
|
|
|
.transfer-log-wrap { |
|
|
|
.transfer-log-wrap { |
|
|
|
margin-top: 10px; |
|
|
|
margin-top: 10px; |
|
|
|
@apply border-radius-8px bg-[#F9FAFB] p-10; |
|
|
|
@apply border-radius-8px bg-[#F9FAFB] p-10; |
|
|
|
@ -471,7 +477,8 @@ function onOffDeviceTransfer() { |
|
|
|
@apply wh-full; |
|
|
|
@apply wh-full; |
|
|
|
|
|
|
|
|
|
|
|
:deep(.el-checkbox-group) { |
|
|
|
:deep(.el-checkbox-group) { |
|
|
|
@apply wh-full flex flex-wrap gap-col-6 gap-row-4; |
|
|
|
@apply wh-full grid gap-16; |
|
|
|
|
|
|
|
grid-template-columns: repeat(auto-fill, minmax(292px, 1fr)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
:deep(.el-checkbox__inner) { |
|
|
|
:deep(.el-checkbox__inner) { |
|
|
|
@ -488,7 +495,7 @@ function onOffDeviceTransfer() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.device-item { |
|
|
|
.device-item { |
|
|
|
@apply w-292 border border-solid border-[#E0E0E0] rounded-8px p-x-14 p-y-10 flex-col; |
|
|
|
@apply border border-solid border-[#E0E0E0] rounded-8px p-x-14 p-y-10 flex-col; |
|
|
|
|
|
|
|
|
|
|
|
.device-item-header { |
|
|
|
.device-item-header { |
|
|
|
@apply w-full text-black text-18px font-500 flex items-center justify-between; |
|
|
|
@apply w-full text-black text-18px font-500 flex items-center justify-between; |
|
|
|
|