This commit is contained in:
@@ -9,6 +9,22 @@
|
||||
</ElTag>
|
||||
</div>
|
||||
<div class="card-header-right">
|
||||
<ElButton
|
||||
v-if="
|
||||
cardInfo?.asset_type === 'card' &&
|
||||
Number.isInteger(cardInfo.asset_id) &&
|
||||
hasAuth('iot_info:stop_resume_records')
|
||||
"
|
||||
type="primary"
|
||||
link
|
||||
@click="
|
||||
emit('showStopResumeRecords', {
|
||||
cardId: cardInfo.asset_id,
|
||||
iccid: cardInfo.iccid || cardInfo.identifier
|
||||
})
|
||||
"
|
||||
>停复机记录</ElButton
|
||||
>
|
||||
<ElButton v-if="auditTarget" type="primary" link @click="openAssetAudit">
|
||||
{{ isSubjectActivityView ? '活动记录' : '审计记录' }}
|
||||
</ElButton>
|
||||
@@ -485,6 +501,17 @@
|
||||
</div>
|
||||
|
||||
<div class="binding-card-actions">
|
||||
<ElButton
|
||||
v-if="bindingCard.card_id != null && hasAuth('device_info:stop_resume_records')"
|
||||
type="primary"
|
||||
@click="
|
||||
emit('showStopResumeRecords', {
|
||||
cardId: bindingCard.card_id,
|
||||
iccid: bindingCard.iccid
|
||||
})
|
||||
"
|
||||
>停复机记录</ElButton
|
||||
>
|
||||
<ElButton
|
||||
v-if="bindingCard.network_status === 0 && hasAuth('iot_info:start')"
|
||||
type="success"
|
||||
@@ -910,6 +937,7 @@
|
||||
|
||||
// Emits
|
||||
interface Emits {
|
||||
(e: 'showStopResumeRecords', payload: { cardId: number; iccid: string }): void
|
||||
(e: 'update:pollingEnabled', value: boolean): void
|
||||
(e: 'enableCard'): void
|
||||
(e: 'disableCard'): void
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
@show-set-wifi="showSetWiFiDialog"
|
||||
@show-realname-policy="showRealnamePolicyDialog"
|
||||
@show-speed-limit="speedLimitDialogVisible = true"
|
||||
@show-stop-resume-records="showStopResumeRecords"
|
||||
@show-update-realname-status="showUpdateRealnameStatusDialog"
|
||||
@enable-binding-card="handleEnableBindingCard"
|
||||
@disable-binding-card="handleDisableBindingCard"
|
||||
@@ -109,6 +110,19 @@
|
||||
</ElCard>
|
||||
|
||||
<!-- 对话框组件 -->
|
||||
<ElDialog
|
||||
v-model="stopResumeVisible"
|
||||
:title="`停复机记录:${stopResumeTarget?.iccid || ''}`"
|
||||
width="min(1200px, 96vw)"
|
||||
destroy-on-close
|
||||
>
|
||||
<StopResumeRecords
|
||||
v-if="stopResumeVisible && stopResumeTarget"
|
||||
:key="stopResumeTarget.cardId"
|
||||
:card-id="stopResumeTarget.cardId"
|
||||
:permission="stopResumePermission"
|
||||
/>
|
||||
</ElDialog>
|
||||
<SwitchCardDialog
|
||||
v-model="switchCardDialogVisible"
|
||||
:device-info="cardInfo?.virtual_no || ''"
|
||||
@@ -183,6 +197,8 @@
|
||||
import { CardService, DeviceService } from '@/api/modules'
|
||||
import { JULY_PERMISSIONS } from '@/config/constants'
|
||||
import { useAuth } from '@/composables/useAuth'
|
||||
import { GATEWAY_PERMISSIONS } from '@/config/constants/gateway'
|
||||
import StopResumeRecords from '@/components/business/gateway/StopResumeRecords.vue'
|
||||
import {
|
||||
formatRemainingTime,
|
||||
FrontendRateLimitError,
|
||||
@@ -285,6 +301,40 @@
|
||||
const rechargeDialogVisible = ref(false)
|
||||
const dailyRecordsDialogVisible = ref(false)
|
||||
const orderHistoryDialogVisible = ref(false)
|
||||
const stopResumeVisible = ref(false)
|
||||
const stopResumeTarget = ref<{ cardId: number; iccid: string } | null>(null)
|
||||
const stopResumePermission = computed(() =>
|
||||
cardInfo.value?.asset_type === 'card'
|
||||
? GATEWAY_PERMISSIONS.cardHistory
|
||||
: GATEWAY_PERMISSIONS.deviceCardHistory
|
||||
)
|
||||
function showStopResumeRecords(target: { cardId: number; iccid: string }) {
|
||||
if (
|
||||
!hasAuth(stopResumePermission.value) ||
|
||||
!Number.isInteger(target.cardId) ||
|
||||
target.cardId < 0
|
||||
)
|
||||
return
|
||||
const asset = cardInfo.value
|
||||
const belongsToAsset =
|
||||
asset?.asset_type === 'card'
|
||||
? target.cardId === asset.asset_id
|
||||
: asset?.cards?.some(
|
||||
(card: { card_id: number; iccid: string }) =>
|
||||
card.card_id === target.cardId && card.iccid === target.iccid
|
||||
)
|
||||
if (!belongsToAsset) return
|
||||
stopResumeTarget.value = { ...target }
|
||||
stopResumeVisible.value = true
|
||||
}
|
||||
watch(
|
||||
() =>
|
||||
`${cardInfo.value?.asset_type}:${cardInfo.value?.asset_id}:${cardInfo.value?.identifier}:${JSON.stringify(cardInfo.value?.cards?.map((card: { card_id?: number; iccid: string }) => [card.card_id, card.iccid]))}`,
|
||||
() => {
|
||||
stopResumeVisible.value = false
|
||||
stopResumeTarget.value = null
|
||||
}
|
||||
)
|
||||
const realnamePolicyDialogVisible = ref(false)
|
||||
const updateRealnameStatusDialogVisible = ref(false)
|
||||
const selectedPackageUsageId = ref<number | null>(null)
|
||||
@@ -598,7 +648,9 @@
|
||||
*/
|
||||
const handleBindingCardRealnameStatusSuccess = async () => {
|
||||
if (bindingCardRealnameStatusAsset && cardInfo.value === bindingCardRealnameStatusAsset) {
|
||||
await fetchAssetDetail(bindingCardRealnameStatusAsset.identifier, { preservePackageList: true })
|
||||
await fetchAssetDetail(bindingCardRealnameStatusAsset.identifier, {
|
||||
preservePackageList: true
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user