This commit is contained in:
@@ -358,7 +358,10 @@
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
</ElTable>
|
||||
<div v-if="deviceCards.length === 0" style="text-align: center; padding: 20px; color: #909399">
|
||||
<div
|
||||
v-if="deviceCards.length === 0"
|
||||
style="text-align: center; padding: 20px; color: #909399"
|
||||
>
|
||||
暂无绑定的卡片
|
||||
</div>
|
||||
</div>
|
||||
@@ -374,7 +377,12 @@
|
||||
|
||||
<!-- 绑定卡弹窗 -->
|
||||
<ElDialog v-model="bindCardDialogVisible" title="绑定卡到设备" width="500px">
|
||||
<ElForm ref="bindCardFormRef" :model="bindCardForm" :rules="bindCardRules" label-width="100px">
|
||||
<ElForm
|
||||
ref="bindCardFormRef"
|
||||
:model="bindCardForm"
|
||||
:rules="bindCardRules"
|
||||
label-width="100px"
|
||||
>
|
||||
<ElFormItem label="IoT卡" prop="iot_card_id">
|
||||
<ElSelect
|
||||
v-model="bindCardForm.iot_card_id"
|
||||
@@ -396,7 +404,11 @@
|
||||
</ElSelect>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="插槽位置" prop="slot_position">
|
||||
<ElSelect v-model="bindCardForm.slot_position" placeholder="请选择插槽位置" style="width: 100%">
|
||||
<ElSelect
|
||||
v-model="bindCardForm.slot_position"
|
||||
placeholder="请选择插槽位置"
|
||||
style="width: 100%"
|
||||
>
|
||||
<ElOption
|
||||
v-for="i in currentDeviceDetail?.max_sim_slots || 4"
|
||||
:key="i"
|
||||
@@ -903,7 +915,9 @@
|
||||
// 重新加载卡列表
|
||||
await loadDeviceCards(currentDeviceDetail.value.id)
|
||||
// 刷新设备详情以更新绑定卡数量
|
||||
const detailRes = await DeviceService.getDeviceByImei(currentDeviceDetail.value.device_no)
|
||||
const detailRes = await DeviceService.getDeviceByImei(
|
||||
currentDeviceDetail.value.device_no
|
||||
)
|
||||
if (detailRes.code === 0 && detailRes.data) {
|
||||
currentDeviceDetail.value = detailRes.data
|
||||
}
|
||||
@@ -929,10 +943,7 @@
|
||||
})
|
||||
.then(async () => {
|
||||
try {
|
||||
const res = await DeviceService.unbindCard(
|
||||
currentDeviceDetail.value.id,
|
||||
row.iot_card_id
|
||||
)
|
||||
const res = await DeviceService.unbindCard(currentDeviceDetail.value.id, row.iot_card_id)
|
||||
if (res.code === 0) {
|
||||
ElMessage.success('解绑成功')
|
||||
// 重新加载卡列表
|
||||
@@ -1070,23 +1081,6 @@
|
||||
label: '创建时间',
|
||||
width: 180,
|
||||
formatter: (row: Device) => formatDateTime(row.created_at)
|
||||
},
|
||||
{
|
||||
prop: 'operation',
|
||||
label: '操作',
|
||||
width: 120,
|
||||
fixed: 'right',
|
||||
formatter: (row: Device) => {
|
||||
// Show "更多操作" only if user has at least one operation permission
|
||||
const hasAnyOperationPermission = hasAuth('devices:delete') || hasAuth('devices:look_binding')
|
||||
if (hasAnyOperationPermission) {
|
||||
return h(ArtButtonTable, {
|
||||
text: '更多操作',
|
||||
onContextmenu: (e: MouseEvent) => showDeviceOperationMenu(e, row.device_no)
|
||||
})
|
||||
}
|
||||
return null
|
||||
}
|
||||
}
|
||||
])
|
||||
|
||||
@@ -1105,8 +1099,8 @@
|
||||
try {
|
||||
const res = await ShopService.getShops({
|
||||
page: 1,
|
||||
page_size: 9999, // 获取所有数据用于构建树形结构
|
||||
status: 1 // 只获取启用的店铺
|
||||
page_size: 9999, // 获取所有数据用于构建树形结构
|
||||
status: 1 // 只获取启用的店铺
|
||||
})
|
||||
if (res.code === 0) {
|
||||
shopTreeData.value = buildShopTree(res.data.items || [])
|
||||
@@ -1349,7 +1343,7 @@
|
||||
const params: any = {
|
||||
page: 1,
|
||||
page_size: 20,
|
||||
status: 1 // 只获取启用的
|
||||
status: 1 // 只获取启用的
|
||||
}
|
||||
if (seriesName) {
|
||||
params.series_name = seriesName
|
||||
@@ -1445,7 +1439,7 @@
|
||||
|
||||
// 通过设备号查看卡片
|
||||
const handleViewCardsByDeviceNo = (deviceNo: string) => {
|
||||
const device = deviceList.value.find(d => d.device_no === deviceNo)
|
||||
const device = deviceList.value.find((d) => d.device_no === deviceNo)
|
||||
if (device) {
|
||||
handleViewCards(device)
|
||||
} else {
|
||||
@@ -1456,7 +1450,7 @@
|
||||
// 通过设备号删除设备
|
||||
const handleDeleteDeviceByNo = async (deviceNo: string) => {
|
||||
// 先根据设备号找到设备对象
|
||||
const device = deviceList.value.find(d => d.device_no === deviceNo)
|
||||
const device = deviceList.value.find((d) => d.device_no === deviceNo)
|
||||
if (device) {
|
||||
deleteDevice(device)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user