This commit is contained in:
@@ -3,8 +3,10 @@
|
||||
<div class="standalone-card-list-page" id="table-full-screen">
|
||||
<!-- 搜索栏 -->
|
||||
<ArtSearchBar
|
||||
v-model:filter="formFilters"
|
||||
:filter="formFilters"
|
||||
@update:filter="(value) => Object.assign(formFilters, value)"
|
||||
:items="formItems"
|
||||
:show-expand="formItems.length >= 4"
|
||||
label-width="90px"
|
||||
@reset="handleReset"
|
||||
@search="handleSearch"
|
||||
@@ -18,6 +20,15 @@
|
||||
@refresh="handleRefresh"
|
||||
>
|
||||
<template #left>
|
||||
<ElButton
|
||||
v-if="
|
||||
canPollingBatch(userStore.info.user_type) &&
|
||||
hasAuth(SCHEDULER_PERMISSIONS.cardBatch)
|
||||
"
|
||||
:disabled="!selectedCards.length"
|
||||
@click="openPollingBatch"
|
||||
>批量开关轮询</ElButton
|
||||
>
|
||||
<ElButton
|
||||
type="success"
|
||||
:disabled="selectedCards.length === 0"
|
||||
@@ -1026,10 +1037,18 @@
|
||||
</ElCard>
|
||||
</div>
|
||||
</ArtTableFullScreen>
|
||||
<PollingBatchDialog
|
||||
v-if="pollingBatchIds"
|
||||
target="iot_card"
|
||||
:ids="pollingBatchIds"
|
||||
:permission="SCHEDULER_PERMISSIONS.cardBatch"
|
||||
@close="pollingBatchIds = null"
|
||||
@done="getTableData"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, h } from 'vue'
|
||||
import { computed, h, watch } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { RoutesAlias } from '@/router/routesAlias'
|
||||
import { AUDIT_PERMISSIONS } from '@/config/constants/audit'
|
||||
@@ -1053,6 +1072,9 @@
|
||||
import type { SearchFormItem } from '@/types'
|
||||
import { useCheckedColumns } from '@/composables/useCheckedColumns'
|
||||
import { useAuth } from '@/composables/useAuth'
|
||||
import PollingBatchDialog from '@/components/business/polling/PollingBatchDialog.vue'
|
||||
import { SCHEDULER_PERMISSIONS } from '@/config/constants/pollingScheduler'
|
||||
import { canPollingBatch, pollingScope } from '@/utils/business/pollingScheduler'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { formatDateTime } from '@/utils/business/format'
|
||||
@@ -1094,6 +1116,12 @@
|
||||
const allocateFormRef = ref<FormInstance>()
|
||||
const recallFormRef = ref<FormInstance>()
|
||||
const selectedCards = ref<StandaloneIotCard[]>([])
|
||||
const pollingBatchIds = ref<number[] | null>(null)
|
||||
function openPollingBatch() {
|
||||
if (!canPollingBatch(userStore.info.user_type) || !hasAuth(SCHEDULER_PERMISSIONS.cardBatch))
|
||||
return
|
||||
pollingBatchIds.value = selectedCards.value.map((row) => row.id)
|
||||
}
|
||||
const batchRealnamePolicyDialogVisible = ref(false)
|
||||
const batchRealnamePolicyLoading = ref(false)
|
||||
const batchRealnamePolicyError = ref('')
|
||||
@@ -1585,6 +1613,7 @@
|
||||
is_authorized_to_enterprise: undefined | boolean
|
||||
[key: string]: any
|
||||
} = {
|
||||
enable_polling: undefined,
|
||||
status: undefined,
|
||||
network_status: undefined,
|
||||
real_name_status: undefined,
|
||||
@@ -1607,6 +1636,13 @@
|
||||
|
||||
// 搜索表单
|
||||
const formFilters = reactive({ ...initialSearchState })
|
||||
watch(
|
||||
() => JSON.stringify([formFilters, pollingScope(userStore)]),
|
||||
() => {
|
||||
pollingBatchIds.value = null
|
||||
selectedCards.value = []
|
||||
}
|
||||
)
|
||||
|
||||
// 批量分配表单
|
||||
const allocateForm = reactive<Partial<AllocateStandaloneCardsRequest>>({
|
||||
@@ -1940,6 +1976,16 @@
|
||||
})
|
||||
|
||||
const formItems: SearchFormItem[] = baseFormItems
|
||||
formItems.push({
|
||||
label: '是否轮询',
|
||||
prop: 'enable_polling',
|
||||
type: 'select',
|
||||
options: [
|
||||
{ label: '轮询中', value: true },
|
||||
{ label: '已关闭', value: false }
|
||||
],
|
||||
config: { clearable: true }
|
||||
})
|
||||
|
||||
// 列配置
|
||||
const columnOptions = [
|
||||
@@ -2068,7 +2114,7 @@
|
||||
prop: 'iccid',
|
||||
label: 'ICCID',
|
||||
minWidth: 200,
|
||||
fixed:true,
|
||||
fixed: true,
|
||||
formatter: (row: StandaloneIotCard) => {
|
||||
return h(
|
||||
'span',
|
||||
@@ -2718,10 +2764,7 @@
|
||||
|
||||
const showEnterpriseCardRecallDialog = async () => {
|
||||
resetEnterpriseCardRecallForm()
|
||||
await Promise.all([
|
||||
handleSearchEnterprise(),
|
||||
loadAllocateCarrierOptions()
|
||||
])
|
||||
await Promise.all([handleSearchEnterprise(), loadAllocateCarrierOptions()])
|
||||
enterpriseCardRecallDialogVisible.value = true
|
||||
enterpriseCardRecallFormRef.value?.clearValidate()
|
||||
}
|
||||
@@ -2841,10 +2884,7 @@
|
||||
selection_type:
|
||||
selectedCards.value.length > 0 ? CardSelectionType.LIST : CardSelectionType.FILTER
|
||||
})
|
||||
await Promise.all([
|
||||
loadPackageSeriesList(),
|
||||
loadAllocateCarrierOptions()
|
||||
])
|
||||
await Promise.all([loadPackageSeriesList(), loadAllocateCarrierOptions()])
|
||||
seriesBindingDialogVisible.value = true
|
||||
seriesBindingFormRef.value?.clearValidate()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user