fix: role_type
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 4m56s
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 4m56s
This commit is contained in:
@@ -599,7 +599,7 @@
|
|||||||
const params: any = {
|
const params: any = {
|
||||||
page: 1,
|
page: 1,
|
||||||
page_size: keyword ? 100 : 20, // 搜索时加载更多,默认20条
|
page_size: keyword ? 100 : 20, // 搜索时加载更多,默认20条
|
||||||
role_type: currentAccountType.value === 2 ? 1 : 2
|
role_type: 1
|
||||||
}
|
}
|
||||||
if (keyword) {
|
if (keyword) {
|
||||||
params.role_name = keyword
|
params.role_name = keyword
|
||||||
|
|||||||
@@ -1,136 +0,0 @@
|
|||||||
<template>
|
|
||||||
<ElDialog v-model="visible" title="切换SIM卡" width="600px">
|
|
||||||
<ElAlert
|
|
||||||
v-if="bindingCards.length === 0"
|
|
||||||
title="该设备暂无绑定的SIM卡"
|
|
||||||
type="warning"
|
|
||||||
:closable="false"
|
|
||||||
style="margin-bottom: 20px"
|
|
||||||
>
|
|
||||||
<template #default>
|
|
||||||
<div>当前设备没有绑定任何SIM卡,无法进行切换操作。</div>
|
|
||||||
<div>请先为设备绑定SIM卡后再进行切换。</div>
|
|
||||||
</template>
|
|
||||||
</ElAlert>
|
|
||||||
|
|
||||||
<ElForm
|
|
||||||
v-if="bindingCards.length > 0"
|
|
||||||
ref="formRef"
|
|
||||||
:model="form"
|
|
||||||
:rules="rules"
|
|
||||||
label-width="120px"
|
|
||||||
>
|
|
||||||
<ElFormItem label="目标ICCID" prop="target_iccid">
|
|
||||||
<ElSelect
|
|
||||||
v-model="form.target_iccid"
|
|
||||||
placeholder="请选择要切换到的目标ICCID"
|
|
||||||
style="width: 100%"
|
|
||||||
clearable
|
|
||||||
>
|
|
||||||
<ElOption
|
|
||||||
v-for="card in bindingCards"
|
|
||||||
:key="card.iccid"
|
|
||||||
:label="`${card.iccid} - 插槽${card.slot_position} - ${card.carrier_name || '-'}`"
|
|
||||||
:value="card.iccid"
|
|
||||||
>
|
|
||||||
<div style="display: flex; align-items: center; justify-content: space-between">
|
|
||||||
<span>{{ card.iccid }}</span>
|
|
||||||
<ElTag size="small" style="margin-left: 10px">插槽{{ card.slot_position }}</ElTag>
|
|
||||||
</div>
|
|
||||||
</ElOption>
|
|
||||||
</ElSelect>
|
|
||||||
<div style="margin-top: 8px; font-size: 12px; color: #909399">
|
|
||||||
当前设备共绑定 {{ bindingCards.length }} 张SIM卡
|
|
||||||
</div>
|
|
||||||
</ElFormItem>
|
|
||||||
</ElForm>
|
|
||||||
|
|
||||||
<template #footer>
|
|
||||||
<ElButton @click="handleCancel">取消</ElButton>
|
|
||||||
<ElButton
|
|
||||||
v-if="bindingCards.length > 0"
|
|
||||||
type="primary"
|
|
||||||
@click="handleConfirm"
|
|
||||||
:loading="confirmLoading"
|
|
||||||
>
|
|
||||||
确认切换
|
|
||||||
</ElButton>
|
|
||||||
</template>
|
|
||||||
</ElDialog>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup lang="ts">
|
|
||||||
import { ref, reactive, computed, watch } from 'vue'
|
|
||||||
import {
|
|
||||||
ElDialog,
|
|
||||||
ElForm,
|
|
||||||
ElFormItem,
|
|
||||||
ElSelect,
|
|
||||||
ElOption,
|
|
||||||
ElButton,
|
|
||||||
ElAlert,
|
|
||||||
ElTag
|
|
||||||
} from 'element-plus'
|
|
||||||
import type { FormInstance, FormRules } from 'element-plus'
|
|
||||||
|
|
||||||
interface BindingCard {
|
|
||||||
iccid: string
|
|
||||||
slot_position?: number
|
|
||||||
carrier_name?: string
|
|
||||||
is_current?: boolean
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Props {
|
|
||||||
modelValue: boolean
|
|
||||||
cards?: BindingCard[]
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Emits {
|
|
||||||
(e: 'update:modelValue', value: boolean): void
|
|
||||||
(e: 'confirm', data: { target_iccid: string }): void
|
|
||||||
}
|
|
||||||
|
|
||||||
const props = withDefaults(defineProps<Props>(), {
|
|
||||||
cards: () => []
|
|
||||||
})
|
|
||||||
const emit = defineEmits<Emits>()
|
|
||||||
|
|
||||||
const formRef = ref<FormInstance>()
|
|
||||||
const confirmLoading = ref(false)
|
|
||||||
|
|
||||||
const form = reactive({ target_iccid: '' })
|
|
||||||
|
|
||||||
const rules: FormRules = {
|
|
||||||
target_iccid: [{ required: true, message: '请选择目标ICCID', trigger: 'change' }]
|
|
||||||
}
|
|
||||||
|
|
||||||
const visible = computed({
|
|
||||||
get: () => props.modelValue,
|
|
||||||
set: (value) => emit('update:modelValue', value)
|
|
||||||
})
|
|
||||||
|
|
||||||
const bindingCards = computed(() => props.cards || [])
|
|
||||||
|
|
||||||
// 打开时重置选中
|
|
||||||
watch(visible, (newVal) => {
|
|
||||||
if (newVal) {
|
|
||||||
form.target_iccid = ''
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
const handleCancel = () => {
|
|
||||||
visible.value = false
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleConfirm = async () => {
|
|
||||||
if (!formRef.value) return
|
|
||||||
try {
|
|
||||||
await formRef.value.validate()
|
|
||||||
emit('confirm', { target_iccid: form.target_iccid })
|
|
||||||
} catch (error) {
|
|
||||||
console.error('表单验证失败:', error)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped></style>
|
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
export { default as SpeedLimitDialog } from './SpeedLimitDialog.vue'
|
export { default as SpeedLimitDialog } from './SpeedLimitDialog.vue'
|
||||||
export { default as SwitchCardDialog } from './SwitchCardDialog.vue'
|
|
||||||
export { default as SwitchModeDialog } from './SwitchModeDialog.vue'
|
export { default as SwitchModeDialog } from './SwitchModeDialog.vue'
|
||||||
export { default as WiFiConfigDialog } from './WiFiConfigDialog.vue'
|
export { default as WiFiConfigDialog } from './WiFiConfigDialog.vue'
|
||||||
export { default as PackageRechargeDialog } from './PackageRechargeDialog.vue'
|
export { default as PackageRechargeDialog } from './PackageRechargeDialog.vue'
|
||||||
|
|||||||
@@ -1093,7 +1093,8 @@
|
|||||||
{
|
{
|
||||||
prop: 'device_name',
|
prop: 'device_name',
|
||||||
label: '设备名称',
|
label: '设备名称',
|
||||||
minWidth: 120
|
showOverflowTooltip: true,
|
||||||
|
minWidth: 150
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'shop_name',
|
prop: 'shop_name',
|
||||||
|
|||||||
Reference in New Issue
Block a user