Browse Source

feat: emu 设备批量选择增加全选

main
betaqi 6 days ago
parent
commit
13713870da
  1. 3
      src/views/stationData/transfer/components/offTransferDlg.vue
  2. 20
      src/views/stationData/transfer/index.vue

3
src/views/stationData/transfer/components/offTransferDlg.vue

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
<template>
<EdfsDialog :title="'数据导'" :is-show="visible" width="580px" :btnLoading="btnLoading"
<EdfsDialog :title="'数据导'" :is-show="visible" width="580px" :btnLoading="btnLoading"
@on-close="close"
@on-save="onSave">
<div class="flex-col gap-10 w-80% m-x-30px">
@ -31,6 +31,7 @@ import { useMessage } from '@/composables/useMessage' @@ -31,6 +31,7 @@ import { useMessage } from '@/composables/useMessage'
import type { IOfflineDevice } from '../../type'
import type { ISite } from '@/api/module/transfer'
import { createTask, type TaskCreateParams } from '@/api/module/taks'
import EdfsDialog from "@/components/Edfs-dialog.vue";
const message = useMessage()

20
src/views/stationData/transfer/index.vue

@ -12,6 +12,14 @@ @@ -12,6 +12,14 @@
<template #title-right>
<template v-if="env.VITE_APP_ENV == 'local'">
<template v-if="isBatchTransfer || isBatchUpgrade">
<el-button
color="#3894FF"
@click="onSelectAllCheckbox">
<span class="text-white">{{
isSelectAllCheckbox ? '取消全选' : '全选'
}}
</span>
</el-button>
<el-button type="primary" @click="onBatchSave">
确定{{ batchText }}
</el-button>
@ -269,9 +277,19 @@ function onBatchUpgrade() { @@ -269,9 +277,19 @@ function onBatchUpgrade() {
}
const batchText = computed(() => {
return isBatchTransfer.value ? '迁移' : '升级'
return isBatchTransfer.value ? isonLineTransfer.value ? '迁移' : '导出' : '升级'
})
const isSelectAllCheckbox = computed(() => checkDeviceList.value.length === devices.value.length)
function onSelectAllCheckbox() {
if (isSelectAllCheckbox.value) {
checkDeviceList.value = []
return
}
checkDeviceList.value = devices.value.map((item) => item.sn)
}
function onBatchSave() {
if (!checkDeviceList.value.length) {
message.error(`请选择要${batchText.value}的设备`)

Loading…
Cancel
Save