添加个人信息,修改历史记录路径
This commit is contained in:
parent
4ab2211cd8
commit
e1acfde13f
@ -45,7 +45,7 @@
|
||||
</div>
|
||||
|
||||
<div class="top-bar-right">
|
||||
<el-icon class="top-icon" @click="routerClick">
|
||||
<el-icon title="历史记录" class="top-icon" @click="routerClick">
|
||||
<Clock />
|
||||
</el-icon>
|
||||
<!-- <el-icon class="top-icon">
|
||||
@ -538,6 +538,9 @@
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<el-dialog class="historyDialogVisible" v-model="historyDialogVisible" center title="历史记录" width="100%">
|
||||
<HistoryDashboard v-if="historyDialogVisible" :patientId="patientId"/>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -551,6 +554,7 @@ import { useAuthStore } from '../stores/index.js'
|
||||
import * as echarts from 'echarts'
|
||||
import { getBackendUrl, patientAPI } from '../services/api.js'
|
||||
import noImageSvg from '@/assets/no-image.svg'
|
||||
import HistoryDashboard from '@/views/PatientProfile.vue'
|
||||
const authStore = useAuthStore()
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
@ -565,6 +569,7 @@ const cameraDialogVisible =ref(false) // 设置相机参数弹框
|
||||
const contenGridRef =ref(null) // 实时检查整体box
|
||||
const wholeBodyRef = ref(null) // 身体姿态ref
|
||||
const videoImgRef =ref(null) // 视频流图片ref
|
||||
const historyDialogVisible = ref(false)
|
||||
// 录像相关变量
|
||||
let mediaRecorder = null
|
||||
let recordedChunks = []
|
||||
@ -1696,19 +1701,19 @@ const formatDate = (dateString) => {
|
||||
const date = new Date(dateString)
|
||||
return date.toLocaleDateString('zh-CN')
|
||||
}
|
||||
|
||||
const patientId = ref("")
|
||||
// 加载患者信息
|
||||
const loadPatientInfo = async () => {
|
||||
try {
|
||||
// 从路由参数获取患者ID
|
||||
const patientId = route.params.id
|
||||
if (!patientId) {
|
||||
patientId.value = route.params.id
|
||||
if (patientId.value == '' || patientId.value == null) {
|
||||
console.warn('未找到患者ID参数')
|
||||
return
|
||||
}
|
||||
|
||||
// 调用API获取患者信息
|
||||
const response = await fetch(`${BACKEND_URL}/api/patients/${patientId}`)
|
||||
const response = await fetch(`${BACKEND_URL}/api/patients/${patientId.value}`)
|
||||
if (response.ok) {
|
||||
const result = await response.json()
|
||||
if (result.success) {
|
||||
@ -2037,7 +2042,8 @@ const stopRecord = async () => { // 停止录屏
|
||||
}
|
||||
}
|
||||
function routerClick(){
|
||||
router.push(`/patient/${patientInfo.value.id}`)
|
||||
historyDialogVisible.value = true
|
||||
// router.push(`/patient/${patientInfo.value.id}`)
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -2819,3 +2825,12 @@ function routerClick(){
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.historyDialogVisible.el-dialog{
|
||||
--el-dialog-margin-top: 0 !important;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.historyDialogVisible .el-dialog__body{
|
||||
padding: 0;
|
||||
}
|
||||
</style>
|
@ -18,7 +18,7 @@
|
||||
<User />
|
||||
</el-icon>
|
||||
</el-avatar> -->
|
||||
<span class="username">{{ userInfo.username }}</span>
|
||||
<span class="username">{{ userInfo.name }}</span>
|
||||
<el-dropdown @command="handleUserCommand">
|
||||
<el-button link class="user-dropdown">
|
||||
<el-icon>
|
||||
@ -28,7 +28,6 @@
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item command="profile">个人信息</el-dropdown-item>
|
||||
<el-dropdown-item command="settings">系统设置</el-dropdown-item>
|
||||
<el-dropdown-item command="logout" divided>退出登录</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
@ -36,12 +35,28 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-dialog v-model="dialogVisible" title="个人信息" width="600px" :before-close="handleClose"
|
||||
class="userInfoviewDialog">
|
||||
<div class="form-box" style="margin-top: 10px;">
|
||||
<el-form :model="userInfo" :rules="formRules" label-width="100px" class="patient-form">
|
||||
<el-form-item label="账号">
|
||||
<el-input v-model="userInfo.username" placeholder="请输入" disabled style="color: #fff !important " />
|
||||
</el-form-item>
|
||||
<el-form-item label="姓名">
|
||||
<el-input v-model="userInfo.name" placeholder="请输入" disabled/>
|
||||
</el-form-item>
|
||||
<el-form-item label="电话">
|
||||
<el-input v-model="userInfo.phone" placeholder="请输入" disabled/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { useRouter, viewDepthKey } from 'vue-router'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { useAuthStore } from '../stores/index.js'
|
||||
|
||||
@ -57,6 +72,7 @@
|
||||
const handleUserCommand = (command) => {
|
||||
switch (command) {
|
||||
case 'profile':
|
||||
viewInfoClick()
|
||||
// 个人信息
|
||||
break
|
||||
case 'settings':
|
||||
@ -67,6 +83,13 @@
|
||||
break
|
||||
}
|
||||
}
|
||||
const dialogVisible =ref(false)
|
||||
function viewInfoClick(){
|
||||
dialogVisible.value = true
|
||||
}
|
||||
function handleClose(){
|
||||
dialogVisible.value = false
|
||||
}
|
||||
function dateFormat(row) {
|
||||
const daterc = row;
|
||||
if (daterc != null) {
|
||||
@ -105,8 +128,10 @@
|
||||
// 从认证状态管理中加载用户信息
|
||||
if (authStore.currentUser) {
|
||||
Object.assign(userInfo, {
|
||||
username: authStore.currentUser.name,
|
||||
avatar: authStore.currentUser.avatar || ''
|
||||
name: authStore.currentUser.name,
|
||||
username: authStore.currentUser.username,
|
||||
phone: authStore.currentUser.phone || '',
|
||||
avatar: authStore.currentUser.avatar || '',
|
||||
})
|
||||
}
|
||||
time.value = dateFormat(new Date())
|
||||
@ -184,4 +209,9 @@
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<style>
|
||||
.userInfoviewDialog .el-input__inner{
|
||||
color: #fff !important;
|
||||
-webkit-text-fill-color: #fff !important;
|
||||
}
|
||||
</style>
|
@ -1,7 +1,8 @@
|
||||
<template>
|
||||
<div class="patient-profile-container">
|
||||
<div class="patient-profile-container"
|
||||
:class="{'videoDialog-patient-profile':isHeader == true}">
|
||||
<!-- 顶部导航 -->
|
||||
<Header />
|
||||
<Header v-if="isHeader == false" />
|
||||
<div class="nav-container">
|
||||
<div class="nav-container-title" @click="goBack">
|
||||
<img src="@/assets/svg/goback.svg" alt="">
|
||||
@ -399,17 +400,25 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, computed, onMounted } from 'vue'
|
||||
import { ref, reactive, computed, onMounted, isShallow } from 'vue'
|
||||
import { useRouter, useRoute } from 'vue-router'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { patientAPI, detectionAPI,historyAPI,getBackendUrl } from '@/services/api.js'
|
||||
import Header from '@/views/Header.vue'
|
||||
import { useAuthStore } from '@/stores/index.js'
|
||||
const props = defineProps({
|
||||
patientId: {
|
||||
required: false,
|
||||
type: String,
|
||||
default: null
|
||||
}
|
||||
})
|
||||
const authStore = useAuthStore()
|
||||
const BACKEND_URL = getBackendUrl()
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
|
||||
const isHeader = ref(false)
|
||||
const patientId = ref("")
|
||||
// 响应式数据
|
||||
const patient = ref(null)
|
||||
const detectionRecords = ref([])
|
||||
@ -674,8 +683,7 @@ const formatFileSize = (bytes) => {
|
||||
|
||||
const loadPatientInfo = async () => {
|
||||
try {
|
||||
const patientId = route.params.id
|
||||
const response = await patientAPI.getById(patientId)
|
||||
const response = await patientAPI.getById(patientId.value)
|
||||
if (response.success) {
|
||||
patient.value = response.data
|
||||
selectedPatient.value = response.data
|
||||
@ -702,8 +710,7 @@ const loadPatientInfo = async () => {
|
||||
|
||||
const loadDetectionRecords = async () => {
|
||||
try {
|
||||
const patientId = route.params.id
|
||||
const response = await detectionAPI.getByPatientId(patientId)
|
||||
const response = await detectionAPI.getByPatientId(patientId.value)
|
||||
if (response.success) {
|
||||
detectionRecords.value = response.data
|
||||
} else {
|
||||
@ -715,7 +722,7 @@ const loadDetectionRecords = async () => {
|
||||
detectionRecords.value = [
|
||||
{
|
||||
id: 1,
|
||||
patientId: route.params.id,
|
||||
patientId: patientId.value,
|
||||
status: '已完成',
|
||||
duration: 300,
|
||||
doctor: '李医生',
|
||||
@ -753,7 +760,7 @@ const loadDetectionRecords = async () => {
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
patientId: route.params.id,
|
||||
patientId: patientId.value,
|
||||
status: '已完成',
|
||||
duration: 240,
|
||||
doctor: '王医生',
|
||||
@ -943,6 +950,13 @@ const detectionLatestList = async(id)=>{
|
||||
// }
|
||||
// 生命周期
|
||||
onMounted(() => {
|
||||
if(props.patientId != "" && props.patientId != null ){
|
||||
patientId.value = props.patientId
|
||||
isHeader.value = true
|
||||
}else{
|
||||
isHeader.value = false
|
||||
patientId.value = route.params.id
|
||||
}
|
||||
loadPatientInfo()
|
||||
sessionsInit()
|
||||
if (authStore.currentUser) {
|
||||
@ -1144,7 +1158,9 @@ onMounted(() => {
|
||||
flex-direction: column;
|
||||
background: #000000;
|
||||
}
|
||||
|
||||
.videoDialog-patient-profile{
|
||||
height: calc(100vh - 80px) ;
|
||||
}
|
||||
|
||||
.nav-container {
|
||||
display: flex;
|
||||
|
Loading…
Reference in New Issue
Block a user