H5实名购买顺序与后台批量配置
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 5m48s
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 5m48s
This commit is contained in:
@@ -40,6 +40,14 @@
|
||||
>
|
||||
批量设置套餐系列
|
||||
</ElButton>
|
||||
<ElButton
|
||||
type="primary"
|
||||
:disabled="!selectedDevices.length"
|
||||
@click="showBatchRealnamePolicyDialog"
|
||||
v-permission="'device:realname_policy'"
|
||||
>
|
||||
批量修改实名顺序
|
||||
</ElButton>
|
||||
<ElButton
|
||||
type="primary"
|
||||
:disabled="!selectedDevices.length"
|
||||
@@ -685,6 +693,15 @@
|
||||
:current-policy="currentRealnamePolicy"
|
||||
@confirm="handleConfirmRealnamePolicy"
|
||||
/>
|
||||
<BatchRealnamePolicyDialog
|
||||
v-model="batchRealnamePolicyDialogVisible"
|
||||
:selected-count="selectedDevices.length"
|
||||
asset-unit="台设备"
|
||||
:loading="batchRealnamePolicyLoading"
|
||||
:error-message="batchRealnamePolicyError"
|
||||
device-policy-hint
|
||||
@confirm="handleConfirmBatchRealnamePolicy"
|
||||
/>
|
||||
|
||||
<!-- 操作审计日志弹窗 -->
|
||||
<OperationLogsDialog
|
||||
@@ -985,8 +1002,10 @@
|
||||
EnterpriseRecallDevicesResponse
|
||||
} from '@/types/api/enterpriseDevice'
|
||||
import RealnamePolicyDialog from '@/components/device/RealnamePolicyDialog.vue'
|
||||
import BatchRealnamePolicyDialog from '@/components/business/BatchRealnamePolicyDialog.vue'
|
||||
import OperationLogsDialog from '@/components/business/OperationLogsDialog.vue'
|
||||
import ExportTaskCreateDialog from '@/components/business/ExportTaskCreateDialog.vue'
|
||||
import type { AssetRealnamePolicy } from '@/types/api'
|
||||
|
||||
defineOptions({ name: 'DeviceList' })
|
||||
|
||||
@@ -1013,6 +1032,9 @@
|
||||
const allocateDialogVisible = ref(false)
|
||||
const recallDialogVisible = ref(false)
|
||||
const selectedDevices = ref<Device[]>([])
|
||||
const batchRealnamePolicyDialogVisible = ref(false)
|
||||
const batchRealnamePolicyLoading = ref(false)
|
||||
const batchRealnamePolicyError = ref('')
|
||||
const operationLogsDialogVisible = ref(false)
|
||||
const operationLogsIdentifier = ref('')
|
||||
const exportDialogVisible = ref(false)
|
||||
@@ -2201,6 +2223,50 @@
|
||||
selectedDevices.value = selection
|
||||
}
|
||||
|
||||
const showBatchRealnamePolicyDialog = () => {
|
||||
if (selectedDevices.value.length === 0) {
|
||||
ElMessage.warning('请先选择要修改的设备')
|
||||
return
|
||||
}
|
||||
|
||||
batchRealnamePolicyError.value = ''
|
||||
batchRealnamePolicyDialogVisible.value = true
|
||||
}
|
||||
|
||||
const handleConfirmBatchRealnamePolicy = async (realnamePolicy: AssetRealnamePolicy) => {
|
||||
const assetIds = selectedDevices.value.map((device) => device.id)
|
||||
if (assetIds.length === 0) {
|
||||
batchRealnamePolicyError.value = '请先选择要修改的设备'
|
||||
return
|
||||
}
|
||||
if (assetIds.length > 500) {
|
||||
batchRealnamePolicyError.value = '单次最多可修改500台设备'
|
||||
return
|
||||
}
|
||||
|
||||
batchRealnamePolicyError.value = ''
|
||||
batchRealnamePolicyLoading.value = true
|
||||
try {
|
||||
const res = await DeviceService.batchUpdateRealnamePolicy(
|
||||
{ asset_ids: assetIds, realname_policy: realnamePolicy },
|
||||
{ requestOptions: { errorMessageMode: 'none' } }
|
||||
)
|
||||
if (res.code !== 0) {
|
||||
batchRealnamePolicyError.value = res.msg || '批量修改实名顺序失败'
|
||||
return
|
||||
}
|
||||
|
||||
ElMessage.success('批量修改实名顺序成功')
|
||||
batchRealnamePolicyDialogVisible.value = false
|
||||
selectedDevices.value = []
|
||||
await getTableData()
|
||||
} catch (error: any) {
|
||||
batchRealnamePolicyError.value = error?.response?.data?.msg || '批量修改实名顺序失败'
|
||||
} finally {
|
||||
batchRealnamePolicyLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 删除设备
|
||||
const deleteDevice = (row: Device) => {
|
||||
ElMessageBox.confirm(
|
||||
|
||||
Reference in New Issue
Block a user