忘记密码方法bug,编辑按钮修改,修改相机参数方法,页头图标和用户名修改
This commit is contained in:
parent
230a0503fd
commit
004e32b63d
1
frontend/src/renderer/src/assets/svg/avatar.svg
Normal file
1
frontend/src/renderer/src/assets/svg/avatar.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1755591402762" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7849" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><path d="M512 512a256 256 0 1 0-257.28-256A256 256 0 0 0 512 512z m0 128c-171.52 0-512 82.651429-512 256v128h1024v-128c2.742857-173.348571-337.737143-256-512-256z" fill="#ffffff" p-id="7850"></path></svg>
|
After Width: | Height: | Size: 526 B |
@ -607,7 +607,7 @@ export const getBackendUrl = () => {
|
||||
if (window.electronAPI) {
|
||||
return window.electronAPI.getBackendUrl()
|
||||
} else {
|
||||
return 'http://localhost:5000'
|
||||
return 'http://192.168.1.58:5000'
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -62,7 +62,7 @@
|
||||
<div class="module-title-text">基础信息</div>
|
||||
</div>
|
||||
<el-button link @click="editPatient">
|
||||
<el-icon>
|
||||
<el-icon class="edit-icon" style="width: 28px;height: 28px;font-size: 28px;cursor: pointer;color: #CCCCCC;">
|
||||
<Edit />
|
||||
</el-icon>
|
||||
</el-button>
|
||||
|
@ -12,7 +12,7 @@
|
||||
<span class="page-title">实时检测</span>
|
||||
</div>
|
||||
|
||||
<img src="@/assets/sz.png" alt="" style="margin-left: 20px;cursor: pointer;"
|
||||
<img src="@/assets/sz.png" alt="" title="编辑相机参数" style="margin-left: 20px;cursor: pointer; width: 24px;height: 24px;"
|
||||
@click="cameraUpdate">
|
||||
|
||||
|
||||
@ -67,7 +67,7 @@
|
||||
<div style="display: flex;justify-content: center;height: 100%;padding-top: 0px;">
|
||||
<!-- 使用深度相机视频流替换静态图片 -->
|
||||
<img :src="(femtoboltStatus === '已连接' && depthCameraImgSrc) ? depthCameraImgSrc : noImageSvg" alt="深度相机视频流"
|
||||
style="width: 100%;height: calc(100% - 10px);object-fit:contain;background:#323232;">
|
||||
style="width: 100%;height: calc(100% - 40px);object-fit:contain;background:#323232;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="body-posture" style="width: 45%;display: flex;margin-right: 1px;
|
||||
@ -494,36 +494,28 @@
|
||||
<el-form :model="cameraForm" label-width="100px">
|
||||
<div class="cameraFormTitle">足部相机</div>
|
||||
<el-form-item label="序号">
|
||||
<el-radio-group v-model="cameraForm.device_index">
|
||||
<el-radio value="0">0</el-radio>
|
||||
<el-radio value="1">1</el-radio>
|
||||
<el-radio value="2">2</el-radio>
|
||||
<el-radio value="3">3</el-radio>
|
||||
<el-radio value="4">4</el-radio>
|
||||
<el-radio value="5">5</el-radio>
|
||||
<el-radio-group v-model="cameraForm.camera.device_index">
|
||||
<el-radio :value="0">0</el-radio>
|
||||
<el-radio :value="1">1</el-radio>
|
||||
<el-radio :value="2">2</el-radio>
|
||||
<el-radio :value="3">3</el-radio>
|
||||
<el-radio :value="4">4</el-radio>
|
||||
<el-radio :value="5">5</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<div class="cameraFormTitle">深度相机</div>
|
||||
<el-form-item label="相机模式">
|
||||
<el-select v-model="cameraForm.depth_mode" placeholder="请选择">
|
||||
<el-option label="NFOV_UNBINNED" value="NFOV_UNBINNED" />
|
||||
<el-option label="NFOV_UNBINNED1" value="NFOV_UNBINNED1" />
|
||||
<el-option label="NFOV_UNBINNED2" value="NFOV_UNBINNED2" />
|
||||
<el-option label="NFOV_UNBINNED3" value="NFOV_UNBINNED3" />
|
||||
<!-- <el-option label="NFOV_UNBINNED" value="NFOV_UNBINNED" /> -->
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="距离范围">
|
||||
<div >
|
||||
<el-input v-model="diagnosticForm.depth_range_min" placeholder="请输入最小值" style="width: 216px;" />
|
||||
<el-input v-model="cameraForm.femtobolt.depth_range_min" placeholder="请输入最小值" style="width: 216px;" />
|
||||
<span> 到 </span>
|
||||
<el-input v-model="diagnosticForm.depth_range_max" placeholder="请输入最大值" style="width: 218px;"/>
|
||||
<el-input v-model="cameraForm.femtobolt.depth_range_max" placeholder="请输入最大值" style="width: 218px;"/>
|
||||
</div>
|
||||
|
||||
</el-form-item>
|
||||
<div class="cameraFormTitle">头部IMU</div>
|
||||
<el-form-item label="IMU串口号">
|
||||
<el-select v-model="cameraForm.imu_port" placeholder="请选择">
|
||||
<el-select v-model="cameraForm.imu.port" placeholder="请选择">
|
||||
<el-option label="COM1" value="COM1" />
|
||||
<el-option label="COM2" value="COM2" />
|
||||
<el-option label="COM3" value="COM3" />
|
||||
@ -660,11 +652,17 @@ const diagnosticForm = ref({
|
||||
suggestion_info: ''
|
||||
})
|
||||
const cameraForm = ref({ // 相机参数
|
||||
device_index: '', // 序号
|
||||
depth_mode: '', // 相机模式
|
||||
depth_range_min: '', // 距离范围最小值
|
||||
depth_range_max: '', // 距离范围最大值
|
||||
imu_port: '', // IMU串口号
|
||||
camera:{
|
||||
device_index: '', // 序号
|
||||
},
|
||||
femtobolt:{
|
||||
depth_mode: '', // 相机模式
|
||||
depth_range_min: '', // 距离范围最小值
|
||||
depth_range_max: '', // 距离范围最大值
|
||||
},
|
||||
imu:{
|
||||
port: '', // IMU串口号
|
||||
}
|
||||
})
|
||||
const calculatedAge = ref(null)
|
||||
//修改
|
||||
@ -870,7 +868,22 @@ function routeTo(path) {
|
||||
router.push(`/`)
|
||||
}
|
||||
function cameraUpdate() { // 相机设置数据更新弹框
|
||||
cameraDialogVisible.value = true
|
||||
cameraForm.value = { // 相机参数
|
||||
camera:{
|
||||
device_index: '', // 序号
|
||||
},
|
||||
femtobolt:{
|
||||
depth_mode: '', // 相机模式
|
||||
depth_range_min: '', // 距离范围最小值
|
||||
depth_range_max: '', // 距离范围最大值
|
||||
},
|
||||
imu:{
|
||||
port: '', // IMU串口号
|
||||
}
|
||||
}
|
||||
// 加载相机参数信息
|
||||
getDevicesInit()
|
||||
|
||||
}
|
||||
const calculateAge = (birthDate) => {
|
||||
if (!birthDate) return '-'
|
||||
@ -2245,8 +2258,15 @@ const calibrationClick = async () => {
|
||||
|
||||
const cameraSubmit = async () => {
|
||||
|
||||
|
||||
const response = await fetch(`${BACKEND_URL}/api/devices/calibrate/imu`, {
|
||||
// let data = {
|
||||
// "imu": {"device_type": "real", "port": "COM7", "baudrate": 9600},
|
||||
// "pressure": {"device_type": "real", "port": "COM8", "baudrate": 115200},
|
||||
// "camera": {"device_index": 0, "width": 1280, "height": 720, "fps": 30},
|
||||
// "femtobolt": {"color_resolution": "1080P", "depth_mode": "NFOV_UNBINNED", "fps": 15}
|
||||
// }
|
||||
|
||||
//
|
||||
const response = await fetch(`${BACKEND_URL}/api/config/devices/all`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
@ -2257,13 +2277,36 @@ const cameraSubmit = async () => {
|
||||
const result = await response.json()
|
||||
if (result.success) {
|
||||
ElMessage.success(result.message)
|
||||
cameraDialogVisible.value = false
|
||||
} else {
|
||||
ElMessage.error(result.message)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 加载相机参数信息
|
||||
const getDevicesInit = async () => {
|
||||
try {
|
||||
// 调用API获取患者信息
|
||||
const response = await fetch(`${BACKEND_URL}/api/config/devices`)
|
||||
if (response.ok) {
|
||||
const result = await response.json()
|
||||
if (result.success) {
|
||||
console.log('相机参数加载成功:', result.data)
|
||||
cameraForm.value = result.data
|
||||
cameraDialogVisible.value = true
|
||||
// console.log('相机参数加载成功:', patientInfo.value)
|
||||
} else {
|
||||
throw new Error(result.message)
|
||||
}
|
||||
} else {
|
||||
throw new Error(`HTTP ${response.status}: ${response.statusText}`)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('加载相机参数失败:', error)
|
||||
ElMessage.warning('加载相机参数失败,请检查网络连接')
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
// 加载患者信息
|
||||
|
@ -12,11 +12,12 @@
|
||||
<div style="color:#fff;margin-right: 20px;">登录时间:{{ time }} </div>
|
||||
|
||||
<div class="user-info">
|
||||
<el-avatar :size="40" :src="userInfo.avatar">
|
||||
<img src="@/assets/svg/avatar.svg" alt="Avatar" style="width: 20px;height: 20px;">
|
||||
<!-- <el-avatar :size="40" :src="userInfo.avatar">
|
||||
<el-icon>
|
||||
<User />
|
||||
</el-icon>
|
||||
</el-avatar>
|
||||
</el-avatar> -->
|
||||
<span class="username">{{ userInfo.username }}</span>
|
||||
<el-dropdown @command="handleUserCommand">
|
||||
<el-button link class="user-dropdown">
|
||||
@ -104,7 +105,7 @@
|
||||
// 从认证状态管理中加载用户信息
|
||||
if (authStore.currentUser) {
|
||||
Object.assign(userInfo, {
|
||||
username: authStore.currentUser.username,
|
||||
username: authStore.currentUser.name,
|
||||
avatar: authStore.currentUser.avatar || ''
|
||||
})
|
||||
}
|
||||
|
@ -217,7 +217,8 @@ import { useAuthStore } from '../stores'
|
||||
import { User, Lock, View, Hide, Phone } from '@element-plus/icons-vue'
|
||||
|
||||
import bg from '@/assets/bg.png'
|
||||
|
||||
import { getBackendUrl } from '../services/api.js'
|
||||
const BACKEND_URL = getBackendUrl()
|
||||
const router = useRouter()
|
||||
const authStore = useAuthStore()
|
||||
|
||||
@ -487,7 +488,7 @@ const handleForgotPasswordSubmit = async () => {
|
||||
|
||||
try {
|
||||
// 调用后端API验证用户信息并获取密码
|
||||
const response = await fetch('http://127.0.0.1:5000/api/auth/forgot-password', {
|
||||
const response = await fetch( `${BACKEND_URL}/api/auth/forgot-password`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
|
Loading…
Reference in New Issue
Block a user