feat: enhance LicenseInfo component by adding MessageBoxInputData type for better type safety

This commit is contained in:
jie committed 2026-03-12 22:37:06 +08:00
1 parent 10030f2fc7
commit a0ff21ad3f
1 file changed
+3 -3
@@ -184,7 +184,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, onMounted, watch, reactive, computed, nextTick } from 'vue' import { ref, onMounted, watch, reactive, computed, nextTick } from 'vue'
import { ElMessage, ElMessageBox, type FormInstance, type FormRules } from 'element-plus' import { ElMessage, ElMessageBox, type FormInstance, type FormRules, type MessageBoxInputData } from 'element-plus'
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
import type { AuthorizationCode, LicenseDevice, LicenseDeviceCreateRequest } from '@/api/license' import type { AuthorizationCode, LicenseDevice, LicenseDeviceCreateRequest } from '@/api/license'
import { getLicenseDevices, getLicenseDeviceDetail, createLicenseDevice, downloadLicenseFile, revokeLicense } from '@/api/license' import { getLicenseDevices, getLicenseDeviceDetail, createLicenseDevice, downloadLicenseFile, revokeLicense } from '@/api/license'
@@ -421,7 +421,7 @@ const handleRevokeLicense = async (device: LicenseDevice) => {
let reason = '' let reason = ''
try { try {
const { value } = await ElMessageBox.prompt( const { value } = (await ElMessageBox.prompt(
t('pages.licenses.detail.messages.revokeConfirm'), t('pages.licenses.detail.messages.revokeConfirm'),
t('pages.licenses.detail.messages.revokeTitle'), t('pages.licenses.detail.messages.revokeTitle'),
{ {
@@ -441,7 +441,7 @@ const handleRevokeLicense = async (device: LicenseDevice) => {
}, },
inputErrorMessage: t('pages.licenses.detail.messages.revokeReasonRequired') inputErrorMessage: t('pages.licenses.detail.messages.revokeReasonRequired')
} }
) )) as MessageBoxInputData
reason = value.trim() reason = value.trim()
} catch { } catch {
return return