更新
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export interface MobileRecordingMetadata {
|
||||
id: number
|
||||
diagnosis_id: number
|
||||
source_platform: 'android_bcr'
|
||||
recorded_at: number
|
||||
duration_ms: number
|
||||
bound_by: string
|
||||
playback_location: 'original_device'
|
||||
created_at: number
|
||||
updated_at: number
|
||||
}
|
||||
|
||||
export interface MobileRecordingPage {
|
||||
lists: MobileRecordingMetadata[]
|
||||
count: number
|
||||
page_no: number
|
||||
page_size: number
|
||||
}
|
||||
|
||||
export function mobileRecordingPatientLists(params: {
|
||||
diagnosis_id: number
|
||||
page_no: number
|
||||
page_size: number
|
||||
}): Promise<MobileRecordingPage> {
|
||||
return request.get({ url: '/tcm.mobileRecording/patientLists', params })
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
<template>
|
||||
<div class="mobile-recording-panel">
|
||||
<div class="panel-toolbar">
|
||||
<span>仅同步关联信息;音频和转写保存在原手机,请在原手机播放。</span>
|
||||
<el-button :loading="loading" @click="load">刷新</el-button>
|
||||
</div>
|
||||
<el-alert v-if="error" :title="error" type="error" :closable="false" show-icon />
|
||||
<el-table v-loading="loading" :data="rows" border stripe empty-text="暂无手机录音关联">
|
||||
<el-table-column label="来源" width="140">
|
||||
<template #default>安卓手机录音</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="录音时间(北京时间)" min-width="190">
|
||||
<template #default="{ row }">{{ recordedTime(row.recorded_at) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="时长" width="120">
|
||||
<template #default="{ row }">{{ durationText(row.duration_ms) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="绑定账号" prop="bound_by" min-width="130" />
|
||||
<el-table-column label="播放位置" min-width="170">
|
||||
<template #default>仅原手机可播放</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
v-if="total > pageSize"
|
||||
v-model:current-page="page"
|
||||
:page-size="pageSize"
|
||||
:total="total"
|
||||
layout="total, prev, pager, next"
|
||||
@current-change="load"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onBeforeUnmount, ref, watch } from 'vue'
|
||||
import { mobileRecordingPatientLists, type MobileRecordingMetadata } from '@/api/mobileRecording'
|
||||
|
||||
const props = defineProps<{ diagnosisId: number }>()
|
||||
const rows = ref<MobileRecordingMetadata[]>([])
|
||||
const loading = ref(false)
|
||||
const error = ref('')
|
||||
const page = ref(1)
|
||||
const pageSize = 20
|
||||
const total = ref(0)
|
||||
let generation = 0
|
||||
|
||||
const timeFormatter = new Intl.DateTimeFormat('zh-CN', {
|
||||
timeZone: 'Asia/Shanghai',
|
||||
year: 'numeric', month: '2-digit', day: '2-digit',
|
||||
hour: '2-digit', minute: '2-digit', second: '2-digit', hour12: false
|
||||
})
|
||||
function recordedTime(value: number): string {
|
||||
return value > 0 && Number.isFinite(value) ? timeFormatter.format(new Date(value)) : '未知'
|
||||
}
|
||||
function durationText(value: number): string {
|
||||
if (!Number.isFinite(value) || value <= 0) return '未知'
|
||||
const seconds = Math.floor(value / 1000)
|
||||
const hours = Math.floor(seconds / 3600)
|
||||
const minutes = Math.floor((seconds % 3600) / 60)
|
||||
const remaining = String(seconds % 60).padStart(2, '0')
|
||||
return hours ? hours + ':' + String(minutes).padStart(2, '0') + ':' + remaining : minutes + ':' + remaining
|
||||
}
|
||||
async function load() {
|
||||
const requestId = ++generation
|
||||
const diagnosisId = props.diagnosisId
|
||||
const requestedPage = page.value
|
||||
error.value = ''
|
||||
rows.value = []
|
||||
total.value = 0
|
||||
if (!Number.isInteger(diagnosisId) || diagnosisId <= 0) {
|
||||
loading.value = false
|
||||
return
|
||||
}
|
||||
loading.value = true
|
||||
try {
|
||||
const result = await mobileRecordingPatientLists({
|
||||
diagnosis_id: diagnosisId, page_no: requestedPage, page_size: pageSize
|
||||
})
|
||||
if (requestId !== generation || diagnosisId !== props.diagnosisId) return
|
||||
const lastPage = Math.max(1, Math.ceil(result.count / pageSize))
|
||||
if (requestedPage > lastPage) {
|
||||
page.value = lastPage
|
||||
await load()
|
||||
return
|
||||
}
|
||||
rows.value = result.lists
|
||||
total.value = result.count
|
||||
} catch {
|
||||
if (requestId === generation) error.value = '无法读取手机录音关联,请确认患者权限后重试。'
|
||||
} finally {
|
||||
if (requestId === generation) loading.value = false
|
||||
}
|
||||
}
|
||||
watch(() => props.diagnosisId, () => { page.value = 1; void load() }, { immediate: true })
|
||||
onBeforeUnmount(() => { generation++ })
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.mobile-recording-panel { display: flex; flex-direction: column; gap: 12px; }
|
||||
.panel-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; color: #606266; }
|
||||
.el-pagination { justify-content: flex-end; }
|
||||
</style>
|
||||
@@ -800,6 +800,19 @@
|
||||
<el-empty v-else description="请先保存诊单后再查看挂号记录" />
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane
|
||||
v-if="hasPermission(['firstvisit.myPatient/lists'])"
|
||||
label="手机录音关联"
|
||||
name="mobileRecording"
|
||||
:disabled="!formData.id"
|
||||
lazy
|
||||
>
|
||||
<MobileRecordingPanel
|
||||
v-if="visible && activeTab === 'mobileRecording' && formData.id"
|
||||
:key="Number(formData.id)"
|
||||
:diagnosis-id="Number(formData.id)"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
<!-- 处方详情(查看病历) -->
|
||||
@@ -840,6 +853,7 @@ import DailyMatrix from './components/DailyMatrix.vue'
|
||||
import FollowupAudioPanel from './components/FollowupAudioPanel.vue'
|
||||
import { followupAudioCapabilities, type FollowupCapabilities } from '@/api/followupAudio'
|
||||
import CaseRecordList from './components/CaseRecordList.vue'
|
||||
import MobileRecordingPanel from './components/MobileRecordingPanel.vue'
|
||||
import CallRecordPanel from './components/CallRecordPanel.vue'
|
||||
import ConsultationTranscriptPanel from './components/ConsultationTranscriptPanel.vue'
|
||||
import ImChatRecordPanel from './components/ImChatRecordPanel.vue'
|
||||
|
||||
@@ -98,6 +98,16 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="hasPermission(['firstvisit.myPatient/lists'])" class="card section-card">
|
||||
<div class="card-title">手机录音关联</div>
|
||||
<div class="card-body card-body--matrix-align">
|
||||
<MobileRecordingPanel
|
||||
v-if="diagnosisNumericId > 0"
|
||||
:key="diagnosisNumericId"
|
||||
:diagnosis-id="diagnosisNumericId"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 视频录制回放记录 -->
|
||||
<div v-if="hasPermission(['tcm.diagnosis/huifang'])" class="card section-card">
|
||||
<div class="card-title">视频录制回放记录</div>
|
||||
@@ -176,6 +186,7 @@ import {
|
||||
import PatientInfoCard from './components/PatientInfoCard.vue'
|
||||
import PatientCaseCard from './components/PatientCaseCard.vue'
|
||||
import DailyMatrix from './components/DailyMatrix.vue'
|
||||
import MobileRecordingPanel from './components/MobileRecordingPanel.vue'
|
||||
import CallRecordPanel from './components/CallRecordPanel.vue'
|
||||
import ImChatRecordPanel from './components/ImChatRecordPanel.vue'
|
||||
import AssignLogPanel from './components/AssignLogPanel.vue'
|
||||
|
||||
Reference in New Issue
Block a user