fix: req:bug
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
</div>
|
||||
<div class="card-header-right">
|
||||
<ElTooltip content="开启后系统将自动轮询更新资产状态" placement="top">
|
||||
<div class="polling-switch-wrapper">
|
||||
<div v-if="canShowPolling" class="polling-switch-wrapper">
|
||||
<span class="polling-label">自动轮询</span>
|
||||
<ElSwitch
|
||||
:model-value="pollingEnabled"
|
||||
@@ -131,9 +131,6 @@
|
||||
</ElTag>
|
||||
</ElDescriptionsItem>
|
||||
|
||||
<ElDescriptionsItem label="固件版本">{{
|
||||
cardInfo?.software_version || '-'
|
||||
}}</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="切卡模式">{{
|
||||
getSwitchModeName(cardInfo?.switch_mode)
|
||||
}}</ElDescriptionsItem>
|
||||
@@ -211,7 +208,7 @@
|
||||
size="small"
|
||||
link
|
||||
@click="handleEnableBindingCard(scope.row)"
|
||||
v-permission="'iot_card:start'"
|
||||
v-permission="'iot_info:start'"
|
||||
>
|
||||
启用此卡
|
||||
</ElButton>
|
||||
@@ -221,7 +218,7 @@
|
||||
size="small"
|
||||
link
|
||||
@click="handleDisableBindingCard(scope.row)"
|
||||
v-permission="'iot_card:stop'"
|
||||
v-permission="'iot_info:stop'"
|
||||
>
|
||||
停用此卡
|
||||
</ElButton>
|
||||
@@ -367,20 +364,53 @@
|
||||
class="card-operations"
|
||||
style="margin-top: 16px; text-align: right"
|
||||
>
|
||||
<ElButton type="success" @click="handleEnableCard"> 启用此卡 </ElButton>
|
||||
<ElButton type="warning" @click="handleDisableCard"> 停用此卡 </ElButton>
|
||||
<!--<ElButton type="danger" @click="handleManualDeactivate"> 手动停用 </ElButton>-->
|
||||
<ElButton v-if="canShowRealnamePolicy" type="primary" @click="handleShowRealnamePolicy"> 实名认证策略 </ElButton>
|
||||
<ElButton v-permission="'iot_info:start'" type="success" @click="handleEnableCard">
|
||||
启用此卡
|
||||
</ElButton>
|
||||
<ElButton v-permission="'iot_info:stop'" type="warning" @click="handleDisableCard">
|
||||
停用此卡
|
||||
</ElButton>
|
||||
<!--<ElButton type="danger" v-permission="'iot_info:handler_stop'" @click="handleManualDeactivate"> 手动停用 </ElButton>-->
|
||||
<!-- 手动停用暂时不开放 -->
|
||||
<ElButton
|
||||
v-if="canShowRealnamePolicy"
|
||||
v-permission="'asset:card_realname_policy'"
|
||||
type="primary"
|
||||
@click="handleShowRealnamePolicy"
|
||||
>
|
||||
实名认证策略
|
||||
</ElButton>
|
||||
</div>
|
||||
|
||||
<!-- 设备操作按钮 -->
|
||||
<div v-else class="device-operations" style="margin-top: 16px; text-align: right">
|
||||
<ElButton type="info" @click="handleShowSwitchMode">设置切卡模式</ElButton>
|
||||
<ElButton type="primary" @click="handleRebootDevice"> 重启设备 </ElButton>
|
||||
<ElButton type="warning" @click="handleResetDevice"> 恢复出厂 </ElButton>
|
||||
<ElButton type="success" @click="handleShowSwitchCard"> 切换SIM卡 </ElButton>
|
||||
<ElButton type="primary" @click="handleShowSetWiFi"> 设置WiFi </ElButton>
|
||||
<ElButton v-if="canShowRealnamePolicy" type="primary" @click="handleShowRealnamePolicy"> 实名认证策略 </ElButton>
|
||||
<ElButton v-permission="'device_info:switch_mode'" type="info" @click="handleShowSwitchMode"
|
||||
>设置切卡模式</ElButton
|
||||
>
|
||||
<ElButton v-permission="'device_info:reboot'" type="primary" @click="handleRebootDevice">
|
||||
重启设备
|
||||
</ElButton>
|
||||
<ElButton v-permission="'device_info:reset'" type="warning" @click="handleResetDevice">
|
||||
恢复出厂
|
||||
</ElButton>
|
||||
<ElButton
|
||||
v-permission="'device_info:switch_card'"
|
||||
type="success"
|
||||
@click="handleShowSwitchCard"
|
||||
>
|
||||
切换SIM卡
|
||||
</ElButton>
|
||||
<ElButton v-permission="'device_info:set_wifi'" type="primary" @click="handleShowSetWiFi">
|
||||
设置WiFi
|
||||
</ElButton>
|
||||
<ElButton
|
||||
v-if="canShowRealnamePolicy"
|
||||
v-permission="'asset_info:device_realname_policy'"
|
||||
type="primary"
|
||||
@click="handleShowRealnamePolicy"
|
||||
>
|
||||
实名认证策略
|
||||
</ElButton>
|
||||
</div>
|
||||
</ElCard>
|
||||
</template>
|
||||
@@ -499,11 +529,21 @@
|
||||
const { hasAuth } = useAuth()
|
||||
|
||||
const realnamePolicyPermission = computed(() => {
|
||||
return props.cardInfo?.asset_type === 'card' ? 'asset:card_realname_policy' : 'asset:device_realname_policy'
|
||||
return props.cardInfo?.asset_type === 'card'
|
||||
? 'asset:card_realname_policy'
|
||||
: 'asset:device_realname_policy'
|
||||
})
|
||||
|
||||
const canShowRealnamePolicy = computed(() => hasAuth(realnamePolicyPermission.value))
|
||||
|
||||
const pollingPermission = computed(() => {
|
||||
return props.cardInfo?.asset_type === 'card'
|
||||
? 'iot_info:auto_polling'
|
||||
: 'device_info:auto_polling'
|
||||
})
|
||||
|
||||
const canShowPolling = computed(() => hasAuth(pollingPermission.value))
|
||||
|
||||
// Emits
|
||||
interface Emits {
|
||||
(e: 'update:pollingEnabled', value: boolean): void
|
||||
|
||||
@@ -87,7 +87,8 @@
|
||||
<!-- 对话框组件 -->
|
||||
<SwitchCardDialog
|
||||
v-model="switchCardDialogVisible"
|
||||
:cards="cardInfo?.cards"
|
||||
:device-info="cardInfo?.virtual_no || ''"
|
||||
:cards="cardInfo?.cards || []"
|
||||
@confirm="handleConfirmSwitchCard"
|
||||
/>
|
||||
<SwitchModeDialog
|
||||
@@ -140,13 +141,13 @@
|
||||
|
||||
// 引入对话框组件
|
||||
import {
|
||||
SwitchCardDialog,
|
||||
SwitchModeDialog,
|
||||
WiFiConfigDialog,
|
||||
PackageRechargeDialog,
|
||||
DailyRecordsDialog,
|
||||
OrderHistoryDialog
|
||||
} from './components/dialogs'
|
||||
import SwitchCardDialog from '@/components/device/SwitchCardDialog.vue'
|
||||
import RealnamePolicyDialog from '@/components/device/RealnamePolicyDialog.vue'
|
||||
|
||||
// 引入 composables
|
||||
|
||||
Reference in New Issue
Block a user