合并缺失弥补
This commit is contained in:
parent
1040539640
commit
f887d00a60
@ -5,9 +5,7 @@
|
|||||||
<view class="patient-info-content">
|
<view class="patient-info-content">
|
||||||
<view class="patient-basic-info">
|
<view class="patient-basic-info">
|
||||||
<text class="patient-name">{{ patientInfo.name }}</text>
|
<text class="patient-name">{{ patientInfo.name }}</text>
|
||||||
<text class="patient-detail"
|
<text class="patient-detail">{{ patientInfo.sex }} · {{ patientInfo.age }}岁</text>
|
||||||
>{{ patientInfo.sex }} · {{ patientInfo.age }}岁</text
|
|
||||||
>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="header-actions">
|
<view class="header-actions">
|
||||||
<view class="patient-detail-btn" @click="handleViewPatientDetail">
|
<view class="patient-detail-btn" @click="handleViewPatientDetail">
|
||||||
@ -21,16 +19,8 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 聊天消息区域 -->
|
<!-- 聊天消息区域 -->
|
||||||
<scroll-view
|
<scroll-view class="chat-content" scroll-y="true" enhanced="true" bounces="false" :scroll-into-view="scrollIntoView"
|
||||||
class="chat-content"
|
@scroll="onScroll" @scrolltoupper="handleScrollToUpper" ref="chatScrollView">
|
||||||
scroll-y="true"
|
|
||||||
enhanced="true"
|
|
||||||
bounces="false"
|
|
||||||
:scroll-into-view="scrollIntoView"
|
|
||||||
@scroll="onScroll"
|
|
||||||
@scrolltoupper="handleScrollToUpper"
|
|
||||||
ref="chatScrollView"
|
|
||||||
>
|
|
||||||
<!-- 加载更多提示 -->
|
<!-- 加载更多提示 -->
|
||||||
<view class="load-more-tip" v-if="messageList.length >= 15">
|
<view class="load-more-tip" v-if="messageList.length >= 15">
|
||||||
<view class="loading" v-if="isLoadingMore">
|
<view class="loading" v-if="isLoadingMore">
|
||||||
@ -46,21 +36,13 @@
|
|||||||
|
|
||||||
<!-- 聊天消息列表 -->
|
<!-- 聊天消息列表 -->
|
||||||
<view class="message-list" @click="closeMorePanel">
|
<view class="message-list" @click="closeMorePanel">
|
||||||
<view
|
<view v-for="(message, index) in messageList" :key="message.ID" :id="`msg-${message.ID}`" class="message-item"
|
||||||
v-for="(message, index) in messageList"
|
|
||||||
:key="message.ID"
|
|
||||||
:id="`msg-${message.ID}`"
|
|
||||||
class="message-item"
|
|
||||||
:class="{
|
:class="{
|
||||||
'message-right': message.flow === 'out',
|
'message-right': message.flow === 'out',
|
||||||
'message-left': message.flow === 'in',
|
'message-left': message.flow === 'in',
|
||||||
}"
|
}">
|
||||||
>
|
|
||||||
<!-- 时间分割线 -->
|
<!-- 时间分割线 -->
|
||||||
<view
|
<view v-if="shouldShowTime(message, index, messageList)" class="time-divider">
|
||||||
v-if="shouldShowTime(message, index, messageList)"
|
|
||||||
class="time-divider"
|
|
||||||
>
|
|
||||||
<text class="time-text">{{ formatTime(message.lastTime) }}</text>
|
<text class="time-text">{{ formatTime(message.lastTime) }}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@ -70,29 +52,18 @@
|
|||||||
|
|
||||||
<!-- 消息内容 -->
|
<!-- 消息内容 -->
|
||||||
<view v-else class="message-content">
|
<view v-else class="message-content">
|
||||||
<image
|
<image v-if="message.flow === 'in'" class="doctor-msg-avatar" :src="getUserAvatar(message.from)"
|
||||||
v-if="message.flow === 'in'"
|
mode="aspectFill" />
|
||||||
class="doctor-msg-avatar"
|
<image v-if="message.flow === 'out'" class="user-msg-avatar" :src="getUserAvatar(message.from)"
|
||||||
:src="getUserAvatar(message.from)"
|
mode="aspectFill" />
|
||||||
mode="aspectFill"
|
|
||||||
/>
|
|
||||||
<image
|
|
||||||
v-if="message.flow === 'out'"
|
|
||||||
class="user-msg-avatar"
|
|
||||||
:src="getUserAvatar(message.from)"
|
|
||||||
mode="aspectFill"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- 消息内容区域 -->
|
<!-- 消息内容区域 -->
|
||||||
<view class="message-bubble-container">
|
<view class="message-bubble-container">
|
||||||
<!-- 用户名显示 -->
|
<!-- 用户名显示 -->
|
||||||
<view
|
<view class="username-label" :class="{
|
||||||
class="username-label"
|
left: message.flow === 'in',
|
||||||
:class="{
|
right: message.flow === 'out',
|
||||||
left: message.flow === 'in',
|
}">
|
||||||
right: message.flow === 'out',
|
|
||||||
}"
|
|
||||||
>
|
|
||||||
<text class="username-text">{{
|
<text class="username-text">{{
|
||||||
chatMember[message.from]?.name
|
chatMember[message.from]?.name
|
||||||
}}</text>
|
}}</text>
|
||||||
@ -100,24 +71,15 @@
|
|||||||
|
|
||||||
<view class="message-bubble" :class="getBubbleClass(message)">
|
<view class="message-bubble" :class="getBubbleClass(message)">
|
||||||
<!-- 消息内容 -->
|
<!-- 消息内容 -->
|
||||||
<MessageTypes
|
<MessageTypes :message="message" :formatTime="formatTime" :playingVoiceId="playingVoiceId"
|
||||||
:message="message"
|
@playVoice="playVoice" @previewImage="previewImage"
|
||||||
:formatTime="formatTime"
|
@viewDetail="(message) => handleViewDetail(message)" />
|
||||||
:playingVoiceId="playingVoiceId"
|
|
||||||
@playVoice="playVoice"
|
|
||||||
@previewImage="previewImage"
|
|
||||||
@viewDetail="(message) => handleViewDetail(message)"
|
|
||||||
/>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 发送状态 -->
|
<!-- 发送状态 -->
|
||||||
<view v-if="message.flow === 'out'" class="message-status">
|
<view v-if="message.flow === 'out'" class="message-status">
|
||||||
<text
|
<text v-if="message.status === 'failed'" class="status-text failed">发送失败</text>
|
||||||
v-if="message.status === 'failed'"
|
|
||||||
class="status-text failed"
|
|
||||||
>发送失败</text
|
|
||||||
>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -125,75 +87,38 @@
|
|||||||
</scroll-view>
|
</scroll-view>
|
||||||
|
|
||||||
<!-- 接受问诊组件 -->
|
<!-- 接受问诊组件 -->
|
||||||
<ConsultAccept
|
<ConsultAccept v-if="showConsultAccept" @accept="handleAcceptConsult" @reject="handleRejectConsult" />
|
||||||
v-if="showConsultAccept"
|
|
||||||
@accept="handleAcceptConsult"
|
|
||||||
@reject="handleRejectConsult"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- 拒绝原因对话框 -->
|
<!-- 拒绝原因对话框 -->
|
||||||
<RejectReasonModal
|
<RejectReasonModal :visible="showRejectReasonModal" @confirm="handleRejectReasonConfirm"
|
||||||
:visible="showRejectReasonModal"
|
@cancel="handleRejectReasonCancel" />
|
||||||
@confirm="handleRejectReasonConfirm"
|
|
||||||
@cancel="handleRejectReasonCancel"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- 聊天输入组件 -->
|
<!-- 聊天输入组件 -->
|
||||||
<ChatInput
|
<ChatInput v-if="!isEvaluationPopupOpen && !showConsultAccept" ref="chatInputRef" :timChatManager="timChatManager"
|
||||||
v-if="!isEvaluationPopupOpen && !showConsultAccept"
|
:formatTime="formatTime" :groupId="chatInfo.conversationID
|
||||||
ref="chatInputRef"
|
? chatInfo.conversationID.replace('GROUP', '')
|
||||||
:timChatManager="timChatManager"
|
: ''
|
||||||
:formatTime="formatTime"
|
" :userId="openid" :teamId="teamId" :patientId="patientId" :corpId="corpId" :patientInfo="patientInfo"
|
||||||
:groupId="
|
:orderStatus="orderStatus" :isGenerating="isGenerating"
|
||||||
chatInfo.conversationID
|
:canBenefitEntry="isBenefitEntryEnabled"
|
||||||
? chatInfo.conversationID.replace('GROUP', '')
|
@scrollToBottom="() => scrollToBottom(true)" @messageSent="() => scrollToBottom(true)"
|
||||||
: ''
|
@endConsult="handleEndConsult" @openConsult="handleOpenConsult">
|
||||||
"
|
|
||||||
:userId="openid"
|
|
||||||
:teamId="teamId"
|
|
||||||
:patientId="patientId"
|
|
||||||
:corpId="corpId"
|
|
||||||
:patientInfo="patientInfo"
|
|
||||||
:orderStatus="orderStatus"
|
|
||||||
:isGenerating="isGenerating"
|
|
||||||
@scrollToBottom="() => scrollToBottom(true)"
|
|
||||||
@messageSent="() => scrollToBottom(true)"
|
|
||||||
@endConsult="handleEndConsult"
|
|
||||||
@openConsult="handleOpenConsult"
|
|
||||||
>
|
|
||||||
<!-- AI助手按钮组插槽 -->
|
<!-- AI助手按钮组插槽 -->
|
||||||
<template #ai-assistant>
|
<template #ai-assistant>
|
||||||
<AIAssistantButtons
|
<AIAssistantButtons v-if="orderStatus === 'processing'" ref="aiAssistantRef" :groupId="groupId"
|
||||||
v-if="orderStatus === 'processing'"
|
:patientAccountId="chatInfo.userID || ''" :patientId="patientId" :corpId="corpId"
|
||||||
ref="aiAssistantRef"
|
:typeSelectorRef="typeSelectorRef" :progressRef="progressRef" @streamText="handleStreamText"
|
||||||
:groupId="groupId"
|
@clearInput="handleClearInput" @generatingStateChange="handleGeneratingStateChange"
|
||||||
:patientAccountId="chatInfo.userID || ''"
|
@caseTypeSelect="handleCaseTypeSelect" @regenerateFromProgress="handleRegenerateFromProgress"
|
||||||
:patientId="patientId"
|
@nextFromProgress="handleNextFromProgress" />
|
||||||
:corpId="corpId"
|
|
||||||
:typeSelectorRef="typeSelectorRef"
|
|
||||||
:progressRef="progressRef"
|
|
||||||
@streamText="handleStreamText"
|
|
||||||
@clearInput="handleClearInput"
|
|
||||||
@generatingStateChange="handleGeneratingStateChange"
|
|
||||||
@caseTypeSelect="handleCaseTypeSelect"
|
|
||||||
@regenerateFromProgress="handleRegenerateFromProgress"
|
|
||||||
@nextFromProgress="handleNextFromProgress"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
</ChatInput>
|
</ChatInput>
|
||||||
|
|
||||||
<!-- 病历类型选择弹窗 -->
|
<!-- 病历类型选择弹窗 -->
|
||||||
<MedicalCaseTypeSelector
|
<MedicalCaseTypeSelector ref="typeSelectorRef" @select="handleCaseTypeSelect" />
|
||||||
ref="typeSelectorRef"
|
|
||||||
@select="handleCaseTypeSelect"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- 进度显示弹窗 -->
|
<!-- 进度显示弹窗 -->
|
||||||
<MedicalCaseProgress
|
<MedicalCaseProgress ref="progressRef" @regenerate="handleRegenerateFromProgress" @next="handleNextFromProgress" />
|
||||||
ref="progressRef"
|
|
||||||
@regenerate="handleRegenerateFromProgress"
|
|
||||||
@next="handleNextFromProgress"
|
|
||||||
/>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -308,10 +233,11 @@ const env = __VITE_ENV__;
|
|||||||
const corpId = env.MP_CORP_ID || "";
|
const corpId = env.MP_CORP_ID || "";
|
||||||
|
|
||||||
// 获取登录状态
|
// 获取登录状态
|
||||||
|
const accountStore = useAccountStore();
|
||||||
const { account, openid, isIMInitialized, doctorInfo } = storeToRefs(
|
const { account, openid, isIMInitialized, doctorInfo } = storeToRefs(
|
||||||
useAccountStore()
|
accountStore
|
||||||
);
|
);
|
||||||
const { initIMAfterLogin } = useAccountStore();
|
const { getDoctorInfo, initIMAfterLogin } = useAccountStore();
|
||||||
|
|
||||||
// 聊天输入组件引用
|
// 聊天输入组件引用
|
||||||
const chatInputRef = ref(null);
|
const chatInputRef = ref(null);
|
||||||
@ -358,6 +284,11 @@ const teamId = ref("");
|
|||||||
// 计算弹框显示状态 - 只有 pending 状态才显示接受问诊组件
|
// 计算弹框显示状态 - 只有 pending 状态才显示接受问诊组件
|
||||||
const showConsultAccept = computed(() => orderStatus.value === "pending");
|
const showConsultAccept = computed(() => orderStatus.value === "pending");
|
||||||
|
|
||||||
|
const isBenefitEntryEnabled = computed(() => {
|
||||||
|
const value = doctorInfo.value?.benefitEntryEnabled ?? doctorInfo.value?.canBenefitEntry;
|
||||||
|
return value === true || value === 1 || ["true", "1", "yes"].includes(String(value).toLowerCase());
|
||||||
|
});
|
||||||
|
|
||||||
// 拒绝原因对话框状态
|
// 拒绝原因对话框状态
|
||||||
const showRejectReasonModal = ref(false);
|
const showRejectReasonModal = ref(false);
|
||||||
// 消息列表相关状态
|
// 消息列表相关状态
|
||||||
@ -536,7 +467,7 @@ const initTIMCallbacks = async () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
timChatManager.setCallback("onSDKNotReady", () => {});
|
timChatManager.setCallback("onSDKNotReady", () => { });
|
||||||
|
|
||||||
timChatManager.setCallback("onMessageReceived", (message) => {
|
timChatManager.setCallback("onMessageReceived", (message) => {
|
||||||
console.log("页面收到消息:", {
|
console.log("页面收到消息:", {
|
||||||
@ -905,14 +836,14 @@ const handleScrollToUpper = async () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// 页面显示
|
// 页面显示
|
||||||
onShow(() => {
|
onShow(async () => {
|
||||||
if (!account.value || !openid.value) {
|
if (!account.value || !openid.value) {
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url: "/pages-center/login/login",
|
url: "/pages-center/login/login",
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
await getDoctorInfo();
|
||||||
if (!isIMInitialized.value) {
|
if (!isIMInitialized.value) {
|
||||||
checkLoginAndInitTIM();
|
checkLoginAndInitTIM();
|
||||||
} else if (timChatManager.tim && !timChatManager.isLoggedIn) {
|
} else if (timChatManager.tim && !timChatManager.isLoggedIn) {
|
||||||
@ -1172,11 +1103,10 @@ const handleNextFromProgress = (data) => {
|
|||||||
|
|
||||||
// 跳转到病历填写页面
|
// 跳转到病历填写页面
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/case/ai-medical-case-form?caseType=${data.caseType}&patientId=${
|
url: `/pages/case/ai-medical-case-form?caseType=${data.caseType}&patientId=${patientId.value
|
||||||
patientId.value
|
}&groupId=${groupId.value}&formData=${encodeURIComponent(
|
||||||
}&groupId=${groupId.value}&formData=${encodeURIComponent(
|
JSON.stringify(extractedData)
|
||||||
JSON.stringify(extractedData)
|
)}`,
|
||||||
)}`,
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user