feat: 新增更新资产实名认证策略
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 5m5s
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 5m5s
This commit is contained in:
@@ -592,6 +592,14 @@
|
||||
</ElButton>
|
||||
</template>
|
||||
</ElDialog>
|
||||
|
||||
<!-- 实名认证策略对话框 -->
|
||||
<RealnamePolicyDialog
|
||||
v-model="realnamePolicyDialogVisible"
|
||||
:asset-identifier="currentRealnamePolicyAsset"
|
||||
:current-policy="currentRealnamePolicy"
|
||||
@confirm="handleConfirmRealnamePolicy"
|
||||
/>
|
||||
</ElCard>
|
||||
</div>
|
||||
</ArtTableFullScreen>
|
||||
@@ -623,6 +631,7 @@
|
||||
import { useAuth } from '@/composables/useAuth'
|
||||
import { formatDateTime } from '@/utils/business/format'
|
||||
import type { PackageSeriesResponse } from '@/types/api'
|
||||
import RealnamePolicyDialog from '@/components/device/RealnamePolicyDialog.vue'
|
||||
|
||||
defineOptions({ name: 'DeviceList' })
|
||||
|
||||
@@ -755,6 +764,11 @@
|
||||
switch_mode: [{ required: true, message: '请选择切卡模式', trigger: 'change' }]
|
||||
})
|
||||
|
||||
// 实名认证策略相关
|
||||
const realnamePolicyDialogVisible = ref(false)
|
||||
const currentRealnamePolicyAsset = ref<string>('')
|
||||
const currentRealnamePolicy = ref<string>('none')
|
||||
|
||||
// 搜索表单初始值
|
||||
const initialSearchState = {
|
||||
virtual_no: '',
|
||||
@@ -1601,6 +1615,35 @@
|
||||
case 'switch-mode':
|
||||
showSwitchModeDialog(deviceNo, device?.switch_mode)
|
||||
break
|
||||
case 'realname-policy':
|
||||
showRealnamePolicyDialog(deviceNo, device?.realname_policy)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
// 显示实名认证策略对话框
|
||||
const showRealnamePolicyDialog = (deviceNo: string, currentPolicy?: string) => {
|
||||
currentRealnamePolicyAsset.value = deviceNo
|
||||
currentRealnamePolicy.value = currentPolicy ?? 'none'
|
||||
realnamePolicyDialogVisible.value = true
|
||||
}
|
||||
|
||||
// 确认设置实名认证策略
|
||||
const handleConfirmRealnamePolicy = async (data: { realname_policy: string }) => {
|
||||
try {
|
||||
const res = await AssetService.updateRealnamePolicy(
|
||||
currentRealnamePolicyAsset.value,
|
||||
data.realname_policy
|
||||
)
|
||||
if (res.code === 0) {
|
||||
ElMessage.success('设置实名认证策略成功')
|
||||
realnamePolicyDialogVisible.value = false
|
||||
await getTableData()
|
||||
} else {
|
||||
ElMessage.error(res.msg || '设置失败')
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('设置实名认证策略失败:', error)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1913,6 +1956,14 @@
|
||||
})
|
||||
}
|
||||
|
||||
if (hasAuth('asset:realname_policy')) {
|
||||
moreActions.push({
|
||||
label: '实名认证策略',
|
||||
handler: () => handleDeviceOperation('realname-policy', row.virtual_no, row),
|
||||
type: 'primary'
|
||||
})
|
||||
}
|
||||
|
||||
// if (hasAuth('device:manual_deactivate')) {
|
||||
// moreActions.push({
|
||||
// label: '手动停用',
|
||||
|
||||
Reference in New Issue
Block a user