添加个人信息,修改历史记录路径

This commit is contained in:
limengnan 2025-09-27 13:16:03 +08:00
parent 4ab2211cd8
commit e1acfde13f
3 changed files with 84 additions and 23 deletions

View File

@ -45,7 +45,7 @@
</div> </div>
<div class="top-bar-right"> <div class="top-bar-right">
<el-icon class="top-icon" @click="routerClick"> <el-icon title="历史记录" class="top-icon" @click="routerClick">
<Clock /> <Clock />
</el-icon> </el-icon>
<!-- <el-icon class="top-icon"> <!-- <el-icon class="top-icon">
@ -538,6 +538,9 @@
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
<el-dialog class="historyDialogVisible" v-model="historyDialogVisible" center title="历史记录" width="100%">
<HistoryDashboard v-if="historyDialogVisible" :patientId="patientId"/>
</el-dialog>
</div> </div>
</template> </template>
@ -551,6 +554,7 @@ import { useAuthStore } from '../stores/index.js'
import * as echarts from 'echarts' import * as echarts from 'echarts'
import { getBackendUrl, patientAPI } from '../services/api.js' import { getBackendUrl, patientAPI } from '../services/api.js'
import noImageSvg from '@/assets/no-image.svg' import noImageSvg from '@/assets/no-image.svg'
import HistoryDashboard from '@/views/PatientProfile.vue'
const authStore = useAuthStore() const authStore = useAuthStore()
const router = useRouter() const router = useRouter()
const route = useRoute() const route = useRoute()
@ -565,6 +569,7 @@ const cameraDialogVisible =ref(false) // 设置相机参数弹框
const contenGridRef =ref(null) // box const contenGridRef =ref(null) // box
const wholeBodyRef = ref(null) // 姿ref const wholeBodyRef = ref(null) // 姿ref
const videoImgRef =ref(null) // ref const videoImgRef =ref(null) // ref
const historyDialogVisible = ref(false)
// //
let mediaRecorder = null let mediaRecorder = null
let recordedChunks = [] let recordedChunks = []
@ -1696,19 +1701,19 @@ const formatDate = (dateString) => {
const date = new Date(dateString) const date = new Date(dateString)
return date.toLocaleDateString('zh-CN') return date.toLocaleDateString('zh-CN')
} }
const patientId = ref("")
// //
const loadPatientInfo = async () => { const loadPatientInfo = async () => {
try { try {
// ID // ID
const patientId = route.params.id patientId.value = route.params.id
if (!patientId) { if (patientId.value == '' || patientId.value == null) {
console.warn('未找到患者ID参数') console.warn('未找到患者ID参数')
return return
} }
// API // API
const response = await fetch(`${BACKEND_URL}/api/patients/${patientId}`) const response = await fetch(`${BACKEND_URL}/api/patients/${patientId.value}`)
if (response.ok) { if (response.ok) {
const result = await response.json() const result = await response.json()
if (result.success) { if (result.success) {
@ -2037,7 +2042,8 @@ const stopRecord = async () => { // 停止录屏
} }
} }
function routerClick(){ function routerClick(){
router.push(`/patient/${patientInfo.value.id}`) historyDialogVisible.value = true
// router.push(`/patient/${patientInfo.value.id}`)
} }
</script> </script>
@ -2818,4 +2824,13 @@ function routerClick(){
color: #30F3FF; color: #30F3FF;
text-align: center; text-align: center;
} }
</style>
<style>
.historyDialogVisible.el-dialog{
--el-dialog-margin-top: 0 !important;
margin-bottom: 0;
}
.historyDialogVisible .el-dialog__body{
padding: 0;
}
</style> </style>

View File

@ -18,7 +18,7 @@
<User /> <User />
</el-icon> </el-icon>
</el-avatar> --> </el-avatar> -->
<span class="username">{{ userInfo.username }}</span> <span class="username">{{ userInfo.name }}</span>
<el-dropdown @command="handleUserCommand"> <el-dropdown @command="handleUserCommand">
<el-button link class="user-dropdown"> <el-button link class="user-dropdown">
<el-icon> <el-icon>
@ -28,7 +28,6 @@
<template #dropdown> <template #dropdown>
<el-dropdown-menu> <el-dropdown-menu>
<el-dropdown-item command="profile">个人信息</el-dropdown-item> <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-item command="logout" divided>退出登录</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</template> </template>
@ -36,12 +35,28 @@
</div> </div>
</div> </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> </div>
</template> </template>
<script setup> <script setup>
import { ref, reactive, onMounted } from 'vue' import { ref, reactive, onMounted } from 'vue'
import { useRouter } from 'vue-router' import { useRouter, viewDepthKey } from 'vue-router'
import { ElMessage, ElMessageBox } from 'element-plus' import { ElMessage, ElMessageBox } from 'element-plus'
import { useAuthStore } from '../stores/index.js' import { useAuthStore } from '../stores/index.js'
@ -57,6 +72,7 @@
const handleUserCommand = (command) => { const handleUserCommand = (command) => {
switch (command) { switch (command) {
case 'profile': case 'profile':
viewInfoClick()
// //
break break
case 'settings': case 'settings':
@ -67,6 +83,13 @@
break break
} }
} }
const dialogVisible =ref(false)
function viewInfoClick(){
dialogVisible.value = true
}
function handleClose(){
dialogVisible.value = false
}
function dateFormat(row) { function dateFormat(row) {
const daterc = row; const daterc = row;
if (daterc != null) { if (daterc != null) {
@ -105,8 +128,10 @@
// //
if (authStore.currentUser) { if (authStore.currentUser) {
Object.assign(userInfo, { Object.assign(userInfo, {
username: authStore.currentUser.name, name: authStore.currentUser.name,
avatar: authStore.currentUser.avatar || '' username: authStore.currentUser.username,
phone: authStore.currentUser.phone || '',
avatar: authStore.currentUser.avatar || '',
}) })
} }
time.value = dateFormat(new Date()) time.value = dateFormat(new Date())
@ -184,4 +209,9 @@
} }
</style> </style>
<style>
.userInfoviewDialog .el-input__inner{
color: #fff !important;
-webkit-text-fill-color: #fff !important;
}
</style>

View File

@ -1,7 +1,8 @@
<template> <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">
<div class="nav-container-title" @click="goBack"> <div class="nav-container-title" @click="goBack">
<img src="@/assets/svg/goback.svg" alt=""> <img src="@/assets/svg/goback.svg" alt="">
@ -399,17 +400,25 @@
</template> </template>
<script setup> <script setup>
import { ref, reactive, computed, onMounted } from 'vue' import { ref, reactive, computed, onMounted, isShallow } from 'vue'
import { useRouter, useRoute } from 'vue-router' import { useRouter, useRoute } from 'vue-router'
import { ElMessage, ElMessageBox } from 'element-plus' import { ElMessage, ElMessageBox } from 'element-plus'
import { patientAPI, detectionAPI,historyAPI,getBackendUrl } from '@/services/api.js' import { patientAPI, detectionAPI,historyAPI,getBackendUrl } from '@/services/api.js'
import Header from '@/views/Header.vue' import Header from '@/views/Header.vue'
import { useAuthStore } from '@/stores/index.js' import { useAuthStore } from '@/stores/index.js'
const props = defineProps({
patientId: {
required: false,
type: String,
default: null
}
})
const authStore = useAuthStore() const authStore = useAuthStore()
const BACKEND_URL = getBackendUrl() const BACKEND_URL = getBackendUrl()
const router = useRouter() const router = useRouter()
const route = useRoute() const route = useRoute()
const isHeader = ref(false)
const patientId = ref("")
// //
const patient = ref(null) const patient = ref(null)
const detectionRecords = ref([]) const detectionRecords = ref([])
@ -674,8 +683,7 @@ const formatFileSize = (bytes) => {
const loadPatientInfo = async () => { const loadPatientInfo = async () => {
try { try {
const patientId = route.params.id const response = await patientAPI.getById(patientId.value)
const response = await patientAPI.getById(patientId)
if (response.success) { if (response.success) {
patient.value = response.data patient.value = response.data
selectedPatient.value = response.data selectedPatient.value = response.data
@ -702,8 +710,7 @@ const loadPatientInfo = async () => {
const loadDetectionRecords = async () => { const loadDetectionRecords = async () => {
try { try {
const patientId = route.params.id const response = await detectionAPI.getByPatientId(patientId.value)
const response = await detectionAPI.getByPatientId(patientId)
if (response.success) { if (response.success) {
detectionRecords.value = response.data detectionRecords.value = response.data
} else { } else {
@ -715,7 +722,7 @@ const loadDetectionRecords = async () => {
detectionRecords.value = [ detectionRecords.value = [
{ {
id: 1, id: 1,
patientId: route.params.id, patientId: patientId.value,
status: '已完成', status: '已完成',
duration: 300, duration: 300,
doctor: '李医生', doctor: '李医生',
@ -753,7 +760,7 @@ const loadDetectionRecords = async () => {
}, },
{ {
id: 2, id: 2,
patientId: route.params.id, patientId: patientId.value,
status: '已完成', status: '已完成',
duration: 240, duration: 240,
doctor: '王医生', doctor: '王医生',
@ -943,6 +950,13 @@ const detectionLatestList = async(id)=>{
// } // }
// //
onMounted(() => { onMounted(() => {
if(props.patientId != "" && props.patientId != null ){
patientId.value = props.patientId
isHeader.value = true
}else{
isHeader.value = false
patientId.value = route.params.id
}
loadPatientInfo() loadPatientInfo()
sessionsInit() sessionsInit()
if (authStore.currentUser) { if (authStore.currentUser) {
@ -1144,7 +1158,9 @@ onMounted(() => {
flex-direction: column; flex-direction: column;
background: #000000; background: #000000;
} }
.videoDialog-patient-profile{
height: calc(100vh - 80px) ;
}
.nav-container { .nav-container {
display: flex; display: flex;