diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts index 768b5879..0adbe2b9 100644 --- a/src/locales/zh-CN.ts +++ b/src/locales/zh-CN.ts @@ -406,8 +406,8 @@ export default { nickname: '用户昵称', mobile: '手机号码', email: '用户邮箱', - dept: '所属部门', - posts: '所属岗位', + dept: '所属机构', + posts: '所属权限', roles: '所属角色', sex: '性别', man: '男', diff --git a/src/views/devices/index.vue b/src/views/devices/index.vue index 09fd5d0f..f30d913d 100644 --- a/src/views/devices/index.vue +++ b/src/views/devices/index.vue @@ -123,10 +123,9 @@ const message = useMessage() // 消息弹窗 // 总数据量 const total = ref(0) // 用户信息 -  const userProfile = ref() +const userProfile = ref() // 设备列表数据 const deviceList = ref([]) - // 查询表单引用 const queryFormRef = ref() // 设备表单引用 @@ -166,20 +165,29 @@ const openForm = (type: string) => { // 处理设备操作 const handleDeviceAction = async (action: any) => { - console.log('设备操作:', action) if (action.action === 'details') { // 打开表单并加载设备数据 detailsFormRef.value?.open(action.deviceId) } else if (action.action === 'openECGData') { // 打开心电数据组件 - ecgDataRef.value?.open(action.deviceId, action.deviceName) + const band = await DeviceuserApi.getDevCount(action.deviceId) + if (band > 0) { + ecgDataRef.value?.open(action.deviceId, action.deviceName) + } else { + ElMessageBox.alert('该设备无绑定人员,无法查看心电数据!', '提示', { + confirmButtonText: '确定', + type: 'warning' + }) + } } else if (action.action === 'delete') { // 删除设备 const res = await DeviceuserApi.getDevCount(action.deviceId) if (res> 0) { - message.error('设备下有人员,不能删除,请解绑后再进行操作') - return - } + ElMessageBox.alert('该设备有绑定人员,无法删除!', '提示', { + confirmButtonText: '确定', + type: 'warning' + }) + }else{ ElMessageBox.confirm('是否删除该设备?', '警告', { confirmButtonText: '确定', cancelButtonText: '取消', @@ -191,8 +199,7 @@ const handleDeviceAction = async (action: any) => { handleQuery() } }) - } else { - //设备操作 + } } }