倒计时没有覆盖复机停机的问题
This commit is contained in:
@@ -184,7 +184,7 @@
|
||||
<el-icon
|
||||
class="copy-icon"
|
||||
@click="handleCopyICCID(scope.row.iccid)"
|
||||
style=" color: var(--el-color-primary);cursor: pointer"
|
||||
style="color: var(--el-color-primary); cursor: pointer"
|
||||
>
|
||||
<CopyDocument />
|
||||
</el-icon>
|
||||
@@ -239,20 +239,22 @@
|
||||
type="success"
|
||||
size="small"
|
||||
link
|
||||
:disabled="isBindingStartDisabled(scope.row)"
|
||||
@click="handleEnableBindingCard(scope.row)"
|
||||
v-permission="'iot_info:start'"
|
||||
>
|
||||
启用此卡
|
||||
{{ getBindingStartButtonText(scope.row) }}
|
||||
</ElButton>
|
||||
<ElButton
|
||||
v-if="scope.row.network_status === 1"
|
||||
type="warning"
|
||||
size="small"
|
||||
link
|
||||
:disabled="isBindingStopDisabled(scope.row)"
|
||||
@click="handleDisableBindingCard(scope.row)"
|
||||
v-permission="'iot_info:stop'"
|
||||
>
|
||||
停用此卡
|
||||
{{ getBindingStopButtonText(scope.row) }}
|
||||
</ElButton>
|
||||
<ElButton
|
||||
type="primary"
|
||||
@@ -397,17 +399,19 @@
|
||||
v-if="cardInfo?.network_status === 0"
|
||||
v-permission="'iot_info:start'"
|
||||
type="success"
|
||||
:disabled="startDisabled"
|
||||
@click="handleEnableCard"
|
||||
>
|
||||
启用此卡
|
||||
{{ startRemainingText ? `启用此卡(${startRemainingText})` : '启用此卡' }}
|
||||
</ElButton>
|
||||
<ElButton
|
||||
v-if="cardInfo?.network_status === 1"
|
||||
v-permission="'iot_info:stop'"
|
||||
type="warning"
|
||||
:disabled="stopDisabled"
|
||||
@click="handleDisableCard"
|
||||
>
|
||||
停用此卡
|
||||
{{ stopRemainingText ? `停用此卡(${stopRemainingText})` : '停用此卡' }}
|
||||
</ElButton>
|
||||
<!--<ElButton type="danger" v-permission="'iot_info:handler_stop'" @click="handleManualDeactivate"> 手动停用 </ElButton>-->
|
||||
<!-- 手动停用暂时不开放 -->
|
||||
@@ -580,10 +584,22 @@
|
||||
deviceRealtime: DeviceRealtimeInfo | null
|
||||
pollingEnabled: boolean
|
||||
realtimeLoading?: boolean
|
||||
startDisabled?: boolean
|
||||
stopDisabled?: boolean
|
||||
startRemainingText?: string
|
||||
stopRemainingText?: string
|
||||
getStartRemainingText?: (identifier: string) => string
|
||||
getStopRemainingText?: (identifier: string) => string
|
||||
isStartDisabled?: (identifier: string) => boolean
|
||||
isStopDisabled?: (identifier: string) => boolean
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
realtimeLoading: false
|
||||
realtimeLoading: false,
|
||||
startDisabled: false,
|
||||
stopDisabled: false,
|
||||
startRemainingText: '',
|
||||
stopRemainingText: ''
|
||||
})
|
||||
|
||||
const { hasAuth } = useAuth()
|
||||
@@ -717,17 +733,15 @@
|
||||
|
||||
// 卡操作
|
||||
const handleEnableCard = () => {
|
||||
if (props.startDisabled) return
|
||||
emit('enableCard')
|
||||
}
|
||||
|
||||
const handleDisableCard = () => {
|
||||
if (props.stopDisabled) return
|
||||
emit('disableCard')
|
||||
}
|
||||
|
||||
const handleManualDeactivate = () => {
|
||||
emit('manualDeactivate')
|
||||
}
|
||||
|
||||
// 设备操作
|
||||
const handleRebootDevice = () => {
|
||||
emit('rebootDevice')
|
||||
@@ -758,7 +772,28 @@
|
||||
}
|
||||
|
||||
// 绑定卡操作
|
||||
const getBindingStartRemainingText = (card: BindingCard) =>
|
||||
props.getStartRemainingText?.(card.iccid) || ''
|
||||
|
||||
const getBindingStopRemainingText = (card: BindingCard) =>
|
||||
props.getStopRemainingText?.(card.iccid) || ''
|
||||
|
||||
const isBindingStartDisabled = (card: BindingCard) => props.isStartDisabled?.(card.iccid) || false
|
||||
|
||||
const isBindingStopDisabled = (card: BindingCard) => props.isStopDisabled?.(card.iccid) || false
|
||||
|
||||
const getBindingStartButtonText = (card: BindingCard) => {
|
||||
const remainingText = getBindingStartRemainingText(card)
|
||||
return remainingText ? `启用此卡(${remainingText})` : '启用此卡'
|
||||
}
|
||||
|
||||
const getBindingStopButtonText = (card: BindingCard) => {
|
||||
const remainingText = getBindingStopRemainingText(card)
|
||||
return remainingText ? `停用此卡(${remainingText})` : '停用此卡'
|
||||
}
|
||||
|
||||
const handleEnableBindingCard = (card: BindingCard) => {
|
||||
if (isBindingStartDisabled(card)) return
|
||||
ElMessageBox.confirm(`确定要启用此卡(${card.iccid})吗?`, '启用确认', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
@@ -771,6 +806,7 @@
|
||||
}
|
||||
|
||||
const handleDisableBindingCard = (card: BindingCard) => {
|
||||
if (isBindingStopDisabled(card)) return
|
||||
ElMessageBox.confirm(`确定要停用此卡(${card.iccid})吗?`, '停用确认', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
|
||||
Reference in New Issue
Block a user