1
0
forked from dyf/dyf-vue-ui

查看用户绑定,解绑接口对接联调

This commit is contained in:
fengerli
2025-07-14 15:34:38 +08:00
parent a01f66dcc4
commit a6b07348a6
4 changed files with 40 additions and 44 deletions

View File

@ -34,9 +34,9 @@
</div>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="loginDate" width="180">
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template #default="scope">
<span>{{ proxy.parseTime(scope.row.loginDate) }}</span>
<span>{{ proxy.parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" align="center">

View File

@ -16,18 +16,18 @@
<el-table-column prop="deviceName" label="设备名称" />
<el-table-column prop="devicePic" label="设备图片">
<template #default="scope">
<el-image style="width: 40px; height: 40px" :src="scope.row.devicePic"
:preview-src-list="[scope.row.devicePic]" />
<el-popover placement="right" trigger="click">
<template #reference>
<img :src="scope.row.devicePic" style="width: 40px; height: 40px; cursor: pointer;"
class="hover:opacity-80 transition-opacity" />
</template>
<img :src="scope.row.devicePic" style="max-width: 600px; max-height: 600px;" />
</el-popover>
</template>
</el-table-column>
<el-table-column prop="deviceMac" label="设备MAC" />
<el-table-column prop="deviceImei" label="设备IMEI" />
<el-table-column prop="deviceTypeName" label="设备类型" />
<el-table-column prop="deviceStatus" label="状态">
<template #default="scope">
<span>{{ scope.row.deviceStatus === 1 ? '正常' : '失效' }}</span>
</template>
</el-table-column>
<el-table-column prop="typeName" label="设备类型" />
<el-table-column prop="createTime" label="绑定日期" />
<el-table-column label="操作" width="100" align="center">
<template #default="scope">
@ -58,8 +58,6 @@ const queryParams = reactive({
deviceImei: ''
})
function openDialog(row: OperLogForm) {
console.log(row,'roe11');
info.value = row;
open.value = true;
getList();
@ -80,23 +78,32 @@ const resetQuery = () => {
// 列表
const getList = async () => {
bindingLoading.value = true;
const res = await api.deviceList(queryParams);
let data = {
bindingUserId: info.value.userId,
pageNum: queryParams.pageNum,
pageSize: queryParams.pageSize,
deviceName: queryParams.deviceName,
deviceMac: queryParams.deviceMac,
deviceImei: queryParams.deviceImei
}
const res = await api.deviceList(data);
boundDevices.value = res.rows;
total.value = res.total;
bindingLoading.value = false;
};
// 解绑
const handleUnbind = (row) => {
proxy?.$modal.confirm.confirm('此操作将解绑设备 "' + row.deviceName + '", 是否继续?', '提示', {
proxy?.$modal.confirm('此操作将解绑设备 "' + row.deviceName + '", 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const data = {
deviceMac: row.deviceMac,
customerId: info.value.id
// deviceMac: row.deviceMac,
id: row.id
}
api.deviceList(data).then(() => {
api.deviceUnBind(data).then(() => {
proxy?.$modal.msgSuccess({ type: 'success', message: '解绑成功!' })
getList()
})