feat: 解绑设备
Some checks failed
CI / Test (ubuntu-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / Lint (ubuntu-latest) (push) Has been cancelled
CI / Lint (windows-latest) (push) Has been cancelled
CI / Check (ubuntu-latest) (push) Has been cancelled
CI / Check (windows-latest) (push) Has been cancelled
CI / CI OK (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Deploy Website on push / Deploy Push Playground Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Docs Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Antd Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Element Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Naive Ftp (push) Has been cancelled
Deploy Website on push / Rerun on failure (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled

This commit is contained in:
shawko 2026-05-10 16:04:11 +08:00
parent 5169a8c50d
commit 883a556ab5
2 changed files with 26 additions and 0 deletions

View File

@ -1,6 +1,14 @@
import { post } from '#/api/http'
import { BasicService } from '../basic'
class ClassStudentService extends BasicService {
async unbindDevice(userId: any) {
await post(
`/org/student/unbindDevice?userId=${encodeURIComponent(userId)}`,
)
}
protected findPageUrl(): string {
return '/org/student/list'
}

View File

@ -11,6 +11,7 @@ import { useAccessStore, useUserStore } from '@vben/stores'
import { classStudentService } from '#/api/service/org/class-student'
import { mj_form_text } from '#/components/mj/mj-table'
import { cellClassName } from '#/hooks/user'
import hud from '#/utils/hud'
import obj from '#/utils/obj'
import CoinAccounts from '../common/coin-accounts.vue'
@ -123,6 +124,10 @@ const grid = {
field: 'account',
title: '学员账号',
},
{
field: 'simSerialNumber',
title: '设备编码',
},
{
field: 'diamond',
title: '钻石',
@ -168,6 +173,18 @@ function checkCoin(row: any) {
selectUser.value = row
showCoinAccount.value = true
}
//
function unbindDevice(row: any) {
hud.confirmLoad(`确定解绑【${row.userName}】的设备吗?`, {
task: async () => {
await classStudentService.unbindDevice(row.userId)
gridRef.value?.reload()
},
hideError: true,
option: '解绑',
})
}
</script>
<template>
@ -189,6 +206,7 @@ function checkCoin(row: any) {
<el-button type="success" :icon="IcomoonCoin" @click="checkCoin(row)">
乐贝账户
</el-button>
<el-button type="danger" @click="unbindDevice(row)"> 解绑 </el-button>
</template>
</MjTable>