Compare commits

..
3 Commits
Author SHA1 Message Date
Your NameandClaude Opus 5 b55f30753c 处方作废不再受签署/审核/订单状态限制,作废后订单随重新开方自动关联;签署原文去掉辅方方名;出丸显示辅方克数;查看处方可下载 CA 原件或药房联/处方联
- 作废:药师签署、审核通过、已有业务订单后均可作废(仍需「作废」权限;已提交药房的订单须先远端取消)。
  作废时关联的待审核/履约中订单处方审核重置为待审核(履约中退回待审核,支付审核保留),
  同诊单重新开方后自动改关联到新处方并写订单日志;已发货/已完成订单按原处方留档。
  迁移 2026_11_30_prescription_order_reissue.sql 新增 reissue_from_prescription_id
- 签署 PDF 不再写入「辅方方名」
- 出丸:有辅方药材时显示「主方 X克,辅方 Y克」(管理后台与桌面端)
- 已开处方「查看处方」下载改为下拉:CA 签署处方 PDF、药房联 PDF、处方联 PDF(A4,按当前笺面样式)
- 重新构建管理后台

Co-Authored-By: Claude Opus 5 <[EMAIL]>
2026-11-30 10:45:08 +08:00
long 0eeb572f0f Update .gitignore 2026-11-28 10:38:10 +08:00
long fce7c78de3 feat(miniapp): 从识糖小课堂打开智慧科技小程序 2026-11-28 10:33:07 +08:00
432 changed files with 3910 additions and 6430 deletions
+1
View File
@@ -38,3 +38,4 @@ app/.test-tmp-stream/
TUICallKit-Vue3/.env
/.codegraph
app/artifacts/
/artifacts
+15 -6
View File
@@ -1595,17 +1595,26 @@ async function goMorePage() {
uni.navigateTo({ url: buildMorePageUrl() })
}
function openGamePage(url) {
function goEndlessGamePage() {
// #ifdef MP-WEIXIN
wx.navigateToMiniProgram({
appId: 'wx0c2a9d5ebad26a3f',
path: 'tongji/endless-game/index',
envVersion: 'release',
fail(err) {
if (err?.errMsg?.includes('cancel')) return
uni.showToast({ title: '暂时无法打开课堂', icon: 'none' })
}
})
// #endif
// #ifndef MP-WEIXIN
uni.navigateTo({
url,
url: '/tongji/endless-game/index',
fail() {
uni.showToast({ title: '暂时无法打开游戏', icon: 'none' })
}
})
}
function goEndlessGamePage() {
openGamePage('/tongji/endless-game/index')
// #endif
}
function navToUser() {
@@ -308,8 +308,29 @@ function computeOutPellet(data: Record<string, any>): string {
return formatNum(perDose * getDoseCount(data))
}
/** 辅方出丸 = 辅方服用天数 × 每日次数 × 每袋用量 × 每次袋数;仅浓缩水丸且确有辅方药材时计算。 */
function computeAuxOutPellet(data: Record<string, any>): string {
if ((data.prescription_type || '浓缩水丸') !== '浓缩水丸' || !getAuxHerbs(data).length) return ''
let raw = data.aux_usage
if (typeof raw === 'string') {
try {
raw = JSON.parse(raw)
} catch {
raw = null
}
}
const aux = normalizeAuxUsageForm(raw, '浓缩水丸')
const days = Number(aux.usage_days)
const times = Number(aux.times_per_day)
const doseG = Number(aux.dosage_amount)
const bags = Number(aux.dosage_bag_count) > 0 ? Number(aux.dosage_bag_count) : 1
return days > 0 && times > 0 && doseG > 0 ? formatNum(days * times * doseG * bags) : ''
}
export function rxOutPelletText(data: Record<string, any> | null | undefined): string {
if (!data) return ''
const out = computeOutPellet(data)
const aux = computeAuxOutPellet(data)
if (out && aux) return `主方 ${out}克,辅方 ${aux}克`
return out ? `${out}克` : ''
}
@@ -701,16 +701,16 @@
{{ requiresOriginalEsignPdf(savedPrescription.esign) ? '下载已签原始 PDF' : '下载PDF' }}
</el-button>
<el-tooltip
v-if="savedPrescription.void_status !== 1 && !approvedPreviewOnly"
:disabled="!hasPrescriptionOrderBlockVoid"
content="该处方已存在业务订单,无法作废,请前往已开处方里修改"
v-if="savedPrescription.void_status !== 1 && savedPrescription.can_void !== false"
:disabled="!hasLinkedPrescriptionOrder"
content="作废后,关联的业务订单会在同诊单重新开方时自动关联到新处方"
placement="top"
>
<span class="inline-block">
<el-button
v-perms="['tcm.prescription/void']"
type="danger"
plain
:disabled="hasPrescriptionOrderBlockVoid"
:loading="voiding"
@click="handleVoid"
>
@@ -1080,8 +1080,8 @@ const approvedPreviewOnly = computed(() => {
return Number(s.audit_status) === 1 && Number(s.void_status) !== 1
})
/** 已有关联业务订单(与列表 has_prescription_order 一致)则禁止作废 */
const hasPrescriptionOrderBlockVoid = computed(() => {
/** 已有关联业务订单(与列表 has_prescription_order 一致):作废时提示订单将随重新开方迁移 */
const hasLinkedPrescriptionOrder = computed(() => {
const s = savedPrescription.value
if (!s) return false
return Number(s.has_prescription_order) === 1
@@ -2165,12 +2165,10 @@ const formatVoidTime = (ts: number | null | undefined) => {
const handleVoid = async () => {
const id = savedPrescription.value?.id
if (!id) return
if (Number(savedPrescription.value?.has_prescription_order) === 1) {
feedback.msgWarning('该处方已存在业务订单,无法作废')
return
}
try {
await feedback.confirm('确定要作废该处方吗?作废后不可恢复。')
await feedback.confirm(Number(savedPrescription.value?.has_prescription_order) === 1
? '确定要作废该处方吗?作废后不可恢复;关联的业务订单将退回待审核,同诊单重新开方后自动关联到新处方。'
: '确定要作废该处方吗?作废后不可恢复。')
voiding.value = true
await prescriptionVoid({ id })
feedback.msgSuccess('作废成功')
+50 -29
View File
@@ -283,7 +283,7 @@
审核
</el-button>
<el-button
v-if="canVoidPendingPrescription(row)"
v-if="canVoidPrescription(row)"
v-perms="['tcm.prescription/void']"
type="danger"
link
@@ -440,16 +440,26 @@
@click="handleReissue(slipView)"
>重新开方</el-button>
<el-button v-if="!requiresOriginalEsignPdf(slipView?.esign)" :icon="Printer" size="small" @click="handlePrintSlip">打印</el-button>
<el-button
type="primary"
:icon="Download"
size="small"
:loading="downloadingSlip"
:disabled="viewDetailLoading || (requiresOriginalEsignPdf(slipView?.esign) && !slipView?.esign?.can_download)"
@click="handleDownloadSlip"
<el-dropdown
trigger="click"
:disabled="viewDetailLoading || downloadingSlip"
@command="handleDownloadSlip"
>
{{ requiresOriginalEsignPdf(slipView?.esign) ? '下载已签原始 PDF' : '下载 PDF (A4)' }}
</el-button>
<el-button type="primary" :icon="Download" size="small" :loading="downloadingSlip">
下载 PDF (A4)
</el-button>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item
v-if="requiresOriginalEsignPdf(slipView?.esign)"
command="esign"
:disabled="!slipView?.esign?.can_download"
>CA 签署处方 PDF</el-dropdown-item>
<el-dropdown-item command="internal">药房联 PDF</el-dropdown-item>
<el-dropdown-item command="user">处方联 PDF</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</div>
<!-- 状态提示(不进入打印区) -->
@@ -1750,7 +1760,7 @@ import PrescriptionSlip from '@/components/prescription-slip/index.vue'
import PrescriptionAuditLayout from '@/components/PrescriptionAuditLayout.vue'
import EsignPrescriptionPanel from '@/components/EsignPrescriptionPanel.vue'
import { usePrescriptionEsignConfig } from '@/hooks/usePrescriptionEsignConfig'
import { canApprovePrescriptionEsign, downloadPrescriptionPdfIfRequired, pendingPrescriptionReviewLabel, requiresOriginalEsignPdf, updatePrescriptionSlipEsign } from '@/utils/prescription-esign'
import { canApprovePrescriptionEsign, downloadOriginalEsignPdf, pendingPrescriptionReviewLabel, requiresOriginalEsignPdf, updatePrescriptionSlipEsign } from '@/utils/prescription-esign'
import type { PrescriptionEsignStatus } from '@/api/tcm'
import { prescriptionListSigningStatus } from './components/prescription-list-signing-status'
import { Search, Download, Printer, EditPen } from '@element-plus/icons-vue'
@@ -2859,18 +2869,25 @@ function handlePrintSlip() {
})
}
/* === 下载 PDF(A4) === */
async function handleDownloadSlip() {
if (downloadingSlip.value) return
downloadingSlip.value = true
try {
if (await downloadPrescriptionPdfIfRequired(Number(slipView.value?.id))) return
} catch (e: any) {
feedback.msgError(e?.message || '下载签署文件失败')
return
} finally {
downloadingSlip.value = false
}
/* === 下载 PDF(A4):CA 签署原件,或按当前笺面样式导出药房联 / 处方联 === */
async function handleDownloadSlip(command: 'esign' | 'internal' | 'user') {
if (downloadingSlip.value || !slipView.value) return
if (command === 'esign') {
downloadingSlip.value = true
try {
await downloadOriginalEsignPdf(Number(slipView.value.id))
} catch (e: any) {
feedback.msgError(e?.message || '下载签署文件失败')
} finally {
downloadingSlip.value = false
}
return
}
// 切到对应联次再截图,导出与页面一致的样式(含医师 / 药师签章)。
if (prescriptionTabType.value !== command) {
prescriptionTabType.value = command
await nextTick()
}
const node = getRxPaperEl()
if (!node) {
feedback.msgWarning('处方笺尚未渲染完成')
@@ -2957,7 +2974,8 @@ async function handleDownloadSlip() {
const name = (slipView.value as any)?.patient_name || '处方'
const id = (slipView.value as any)?.id || ''
const date = (slipView.value as any)?.prescription_date || ''
pdf.save(`处方-${name}${date ? '-' + date : ''}${id ? '-' + id : ''}.pdf`)
const copy = command === 'internal' ? '药房联' : '处方联'
pdf.save(`${copy}-${name}${date ? '-' + date : ''}${id ? '-' + id : ''}.pdf`)
} catch (e: any) {
console.error('下载处方 PDF 失败:', e)
feedback.msgError(e?.message || '下载失败,请重试')
@@ -3338,17 +3356,20 @@ type VoidablePrescriptionRow = Parameters<typeof isPendingPrescriptionAudit>[0]
can_review_prescription?: boolean
}
function canVoidPendingPrescription(row: VoidablePrescriptionRow) {
return isPendingPrescriptionAudit(row) && row.can_void === true
/** 作废不再限于待审核:签署、审核通过或已有业务订单后也可作废(以服务端 can_void 为准) */
function canVoidPrescription(row: VoidablePrescriptionRow) {
return Number(row.void_status) !== 1 && row.can_void === true
}
async function voidPendingPrescription(row: VoidablePrescriptionRow) {
const id = Number(row.id)
if (!Number.isSafeInteger(id) || id <= 0 || voidingPrescriptionId.value || !canVoidPendingPrescription(row)) return
if (!Number.isSafeInteger(id) || id <= 0 || voidingPrescriptionId.value || !canVoidPrescription(row)) return
voidingPrescriptionId.value = id
try {
await feedback.confirm('确定作废这张处方吗?作废后可重新开方。')
await prescriptionVoid({ id, pending_only: true })
await feedback.confirm(Number((row as { has_prescription_order?: number }).has_prescription_order) === 1
? '确定作废这张处方吗?关联的业务订单将退回待审核,同诊单重新开方后自动关联到新处方。'
: '确定作废这张处方吗?作废后可重新开方。')
await prescriptionVoid({ id })
row.void_status = 1
row.can_void = false
row.can_submit_for_review = false
+10 -8
View File
@@ -1425,7 +1425,7 @@ test('list upload can retry and opens signing without exposing audit to the phar
assert.match(messages[0], /请完成医师签署/)
})
test('issued prescriptions can void pending drafts with permission and keep the record', async () => {
test('issued prescriptions can be voided in any review state when the server allows it', async () => {
const calls = []
const messages = []
let cancel = true
@@ -1443,24 +1443,26 @@ test('issued prescriptions can void pending drafts with permission and keep the
msgSuccess: (message) => messages.push(message)
}
}
const { canVoidPendingPrescription, voidPendingPrescription } = pageDeclarations(
const { canVoidPrescription, voidPendingPrescription } = pageDeclarations(
'views/consumer/prescription/index.vue',
['isPendingPrescriptionAudit', 'canVoidPendingPrescription', 'voidPendingPrescription'], globals
['canVoidPrescription', 'voidPendingPrescription'], globals
)
assert.equal(canVoidPendingPrescription(row), true)
for (const other of [{ audit_status: 1 }, { audit_status: 2 }, { void_status: 1 }, { can_void: false }]) {
assert.equal(canVoidPrescription(row), true)
// 审核通过(药师已签署)后仍可作废;以服务端 can_void 为准。
assert.equal(canVoidPrescription({ ...row, audit_status: 1 }), true)
for (const other of [{ void_status: 1 }, { can_void: false }]) {
await voidPendingPrescription({ ...row, ...other })
}
await voidPendingPrescription(row)
assert.deepEqual(calls, [])
cancel = false
await voidPendingPrescription(row)
assert.equal(canVoidPendingPrescription(row), true)
assert.equal(canVoidPrescription(row), true)
await Promise.all([voidPendingPrescription(row), voidPendingPrescription(row)])
assert.deepEqual(calls, [{ id: 17, pending_only: true }, { id: 17, pending_only: true }])
assert.deepEqual(calls, [{ id: 17 }, { id: 17 }])
assert.equal(row.void_status, 1)
assert.equal(row.can_submit_for_review, false)
assert.equal(canVoidPendingPrescription(row), false)
assert.equal(canVoidPrescription(row), false)
assert.equal(refreshes, 1)
assert.deepEqual(messages, ['处方已作废'])
})
+167 -60
View File
@@ -16,6 +16,11 @@ from PySide6.QtGui import QGuiApplication, QIcon
from PySide6.QtWidgets import (
QApplication,
QDialog,
QFrame,
QHBoxLayout,
QLabel,
QPushButton,
QVBoxLayout,
QWidget,
)
@@ -32,13 +37,12 @@ from doctor_workstation.services import (
)
from doctor_workstation.ui import LoginWindow, ShellWindow, apply_theme
from doctor_workstation.ui.dialogs.app_update import AppUpdateSession
from doctor_workstation.ui.dialogs.video_cockpit import VideoCockpitDemoDialog as DemoVideoDialog
from doctor_workstation.ui.widgets import (
first_value,
friendly_error,
gender_text,
get_value,
has_permission,
has_permission,
run_async,
set_authentication_expired_handler,
show_toast,
@@ -291,6 +295,109 @@ class _UnconfiguredRepository:
return None
class DemoVideoDialog(QDialog):
"""Non-network video-room preview used only by the explicit demo mode."""
def __init__(self, patient_name: str, parent: QWidget | None = None) -> None:
super().__init__(parent)
self._seconds = 0
self.setWindowTitle("视频面诊 · 演示模式")
self.setMinimumSize(760, 520)
self.resize(980, 660)
self.setModal(False)
self.setStyleSheet(
"QDialog{background:#F7F9FE;color:#111F46;}"
"QLabel{color:#111F46;}"
"QFrame#RemoteStage{background:#0E1421;border:1px solid #29334F;border-radius:16px;}"
"QFrame#RemoteStage QLabel{color:#F7F9FE;}"
"QFrame#LocalStage{background:#151D31;border:1px solid #3F4E75;border-radius:12px;}"
"QPushButton{min-width:96px;min-height:40px;padding:0 16px;border-radius:9px;"
"background:#FFFFFF;color:#3F4E75;border:1px solid #E6EAF5;font-weight:600;}"
"QPushButton:hover{color:#4451E2;background:#F0F2FF;border-color:#5761F4;}"
"QPushButton:checked{color:#FFFFFF;background:#5761F4;border-color:#5761F4;}"
"QPushButton#Hangup{color:#FFFFFF;background:#C23D4E;border-color:#C23D4E;}"
"QPushButton#Hangup:hover{background:#D94857;border-color:#D94857;}"
)
root = QVBoxLayout(self)
root.setContentsMargins(22, 18, 22, 22)
root.setSpacing(14)
header = QHBoxLayout()
title = QLabel(f"与 {patient_name or '患者'} 的视频面诊")
title.setStyleSheet("font-size:18px;font-weight:700;")
header.addWidget(title)
header.addStretch(1)
demo = QLabel("● 演示模式 · 未连接腾讯云")
demo.setStyleSheet("color:#707584;font-size:12px;")
header.addWidget(demo)
self.duration_label = QLabel("00:00")
self.duration_label.setStyleSheet("font-weight:700;")
header.addWidget(self.duration_label)
root.addLayout(header)
stage = QFrame()
stage.setObjectName("RemoteStage")
stage_layout = QVBoxLayout(stage)
stage_layout.setContentsMargins(22, 22, 22, 22)
stage_layout.addStretch(1)
avatar = QLabel((patient_name or "患")[:1])
avatar.setAlignment(Qt.AlignmentFlag.AlignCenter)
avatar.setFixedSize(104, 104)
avatar.setStyleSheet(
"background:#F0F2FF;color:#5761F4;border-radius:52px;font-size:42px;font-weight:700;"
)
stage_layout.addWidget(avatar, 0, Qt.AlignmentFlag.AlignHCenter)
waiting = QLabel("等待患者接听…")
waiting.setAlignment(Qt.AlignmentFlag.AlignCenter)
waiting.setStyleSheet("font-size:17px;font-weight:600;")
stage_layout.addWidget(waiting)
hint = QLabel("生产模式将通过后端短时 UserSig 初始化腾讯 TUICallKit")
hint.setAlignment(Qt.AlignmentFlag.AlignCenter)
hint.setStyleSheet("color:#A4ADC3;font-size:12px;")
stage_layout.addWidget(hint)
stage_layout.addStretch(1)
local = QFrame(stage)
local.setObjectName("LocalStage")
local.setGeometry(24, 24, 178, 112)
local_layout = QVBoxLayout(local)
local_label = QLabel("医生画面")
local_label.setAlignment(Qt.AlignmentFlag.AlignCenter)
local_label.setStyleSheet("color:#D9E0F2;font-weight:600;")
local_layout.addWidget(local_label)
root.addWidget(stage, 1)
controls = QHBoxLayout()
controls.addStretch(1)
self.mic_button = QPushButton("麦克风 开")
self.mic_button.setCheckable(True)
self.mic_button.toggled.connect(
lambda muted: self.mic_button.setText("麦克风 关" if muted else "麦克风 开")
)
controls.addWidget(self.mic_button)
self.camera_button = QPushButton("摄像头 开")
self.camera_button.setCheckable(True)
self.camera_button.toggled.connect(
lambda off: self.camera_button.setText("摄像头 关" if off else "摄像头 开")
)
controls.addWidget(self.camera_button)
hangup = QPushButton("结束面诊")
hangup.setObjectName("Hangup")
hangup.clicked.connect(self.close)
controls.addWidget(hangup)
controls.addStretch(1)
root.addLayout(controls)
self._timer = QTimer(self)
self._timer.timeout.connect(self._tick)
self._timer.start(1000)
def _tick(self) -> None:
self._seconds += 1
minutes, seconds = divmod(self._seconds, 60)
self.duration_label.setText(f"{minutes:02d}:{seconds:02d}")
class ApplicationController(QObject):
"""Own windows, repositories and the authenticated application lifecycle."""
@@ -307,8 +414,8 @@ class ApplicationController(QObject):
self.current_repository: Any = None
self.current_demo_mode = self.debug_mode and config.demo_mode
self.video_calls: dict[str, Any] = {}
self.video_pending: dict[str, object] = {}
self._pending_im_request: tuple[str, object] | None = None
self.video_pending: dict[str, object] = {}
self._pending_im_request: tuple[str, object] | None = None
self.demo_video_dialogs: dict[str, DemoVideoDialog] = {}
self._video_preview_state: dict[str, Any] | None = None
self._video_preview_generation = 0
@@ -683,8 +790,8 @@ class ApplicationController(QObject):
call.close()
self._wait_for_video_lifecycle(calls, timeout=1.25)
self.video_calls.clear()
self.video_pending.clear()
self._pending_im_request = None
self.video_pending.clear()
self._pending_im_request = None
for dialog in tuple(self.demo_video_dialogs.values()):
dialog.close()
self.demo_video_dialogs.clear()
@@ -714,8 +821,8 @@ class ApplicationController(QObject):
if parent is None or self.current_repository is None:
return
patient_id = payload.get("patient_id")
diagnosis_id = payload.get("diagnosis_id")
appointment_id = int(payload.get("appointment_id") or 0)
diagnosis_id = payload.get("diagnosis_id")
appointment_id = int(payload.get("appointment_id") or 0)
patient_name = str(payload.get("patient_name") or "患者")
open_im = str(payload.get("mode") or "video").lower() == "im"
fallback_record = payload.get("record")
@@ -723,16 +830,16 @@ class ApplicationController(QObject):
show_toast(parent, "患者或诊单信息不完整,无法发起视频。", "danger", 4200)
return
call_key = f"{diagnosis_id}:{appointment_id}"
if open_im and self._pending_im_request is not None:
pending_key, pending_marker = self._pending_im_request
if pending_key != call_key:
# Retire a previous selection before any early return, including
# when the selected IM window is already open.
if self.video_pending.get(pending_key) is pending_marker:
self.video_pending.pop(pending_key, None)
self._pending_im_request = None
existing_call = self.video_calls.get(call_key)
call_key = f"{diagnosis_id}:{appointment_id}"
if open_im and self._pending_im_request is not None:
pending_key, pending_marker = self._pending_im_request
if pending_key != call_key:
# Retire a previous selection before any early return, including
# when the selected IM window is already open.
if self.video_pending.get(pending_key) is pending_marker:
self.video_pending.pop(pending_key, None)
self._pending_im_request = None
existing_call = self.video_calls.get(call_key)
if open_im and existing_call is not None and getattr(existing_call, "open_im", False):
qt_window = getattr(existing_call, "qt_window", None)
if qt_window is not None:
@@ -778,18 +885,18 @@ class ApplicationController(QObject):
)
repository = self.current_repository
marker = object()
self.video_pending[call_key] = marker
if open_im:
self._pending_im_request = (call_key, marker)
self.video_pending[call_key] = marker
if open_im:
self._pending_im_request = (call_key, marker)
def get_video_context() -> tuple[Any, dict[str, str]]:
ticket = repository.get_call_ticket(
patient_id=int(patient_id),
diagnosis_id=int(diagnosis_id),
appointment_id=appointment_id,
)
if appointment_id and int(ticket.raw.get("appointment_id") or 0) != appointment_id:
raise ValueError("通话凭证与本次挂号不匹配,请重新打开聊天窗口。")
diagnosis_id=int(diagnosis_id),
appointment_id=appointment_id,
)
if appointment_id and int(ticket.raw.get("appointment_id") or 0) != appointment_id:
raise ValueError("通话凭证与本次挂号不匹配,请重新打开聊天窗口。")
detail: Any = {}
detail_loader = getattr(repository, "patient_detail", None)
if callable(detail_loader):
@@ -850,12 +957,12 @@ class ApplicationController(QObject):
parent: QWidget,
error: Exception,
) -> None:
if self.video_pending.get(call_key) is not marker:
return
self.video_pending.pop(call_key, None)
if self._pending_im_request == (call_key, marker):
self._pending_im_request = None
if self.shell_window is parent:
if self.video_pending.get(call_key) is not marker:
return
self.video_pending.pop(call_key, None)
if self._pending_im_request == (call_key, marker):
self._pending_im_request = None
if self.shell_window is parent:
show_toast(
parent,
f"视频准备失败:{friendly_error(error)}",
@@ -876,11 +983,11 @@ class ApplicationController(QObject):
patient_name: str = "患者",
patient_case: Mapping[str, Any] | None = None,
) -> None:
if self.video_pending.get(call_key) is not marker:
return
self.video_pending.pop(call_key, None)
if self._pending_im_request == (call_key, marker):
self._pending_im_request = None
if self.video_pending.get(call_key) is not marker:
return
self.video_pending.pop(call_key, None)
if self._pending_im_request == (call_key, marker):
self._pending_im_request = None
if (
self.shell_window is None
or self.current_repository is not repository
@@ -905,13 +1012,13 @@ class ApplicationController(QObject):
open_im=open_im,
patient_name=patient_name,
patient_case=patient_case,
can_ai_assistant=has_permission(
getattr(self.shell_window, "permissions", None),
"tcm.diagnosis/aiAssistant",
default=False,
),
on_open_diagnosis=lambda current_id=diagnosis_id, current_key=call_key: (
self._open_video_diagnosis(current_id, call_key=current_key)
can_ai_assistant=has_permission(
getattr(self.shell_window, "permissions", None),
"tcm.diagnosis/aiAssistant",
default=False,
),
on_open_diagnosis=lambda current_id=diagnosis_id, current_key=call_key: (
self._open_video_diagnosis(current_id, call_key=current_key)
),
)
except Exception as error:
@@ -933,7 +1040,7 @@ class ApplicationController(QObject):
)
)
def _open_video_diagnosis(self, diagnosis_id: Any, *, call_key: str) -> None:
def _open_video_diagnosis(self, diagnosis_id: Any, *, call_key: str) -> None:
"""Open the diagnosis while keeping its live video visible as a preview."""
shell = self.shell_window
@@ -942,7 +1049,7 @@ class ApplicationController(QObject):
dialog = shell.open_diagnosis_by_id(diagnosis_id, modeless=True)
if dialog is None:
return
call = self.video_calls.get(call_key)
call = self.video_calls.get(call_key)
video_window = getattr(call, "qt_window", None)
if video_window is not None:
self._show_video_preview(video_window, dialog)
@@ -975,8 +1082,8 @@ class ApplicationController(QObject):
preview_height = min(380, max(320, round(preview_width * 0.66)))
margin = 18
if callable(getattr(video_window, "setProperty", None)):
video_window.setProperty("doctorSkipOpenGeometry", True)
if callable(getattr(video_window, "setProperty", None)):
video_window.setProperty("doctorSkipOpenGeometry", True)
video_window.showNormal()
video_window.setMinimumSize(440, 300)
video_window.setWindowFlag(Qt.WindowType.WindowStaysOnTopHint, True)
@@ -995,14 +1102,14 @@ class ApplicationController(QObject):
lambda _result, expected=generation: self._restore_video_preview(expected)
)
try:
set_close_handler = getattr(video_window, "set_compact_close_handler", None)
if callable(set_close_handler):
set_close_handler(lambda expected=generation: self._restore_video_preview(expected))
set_close_handler = getattr(video_window, "set_compact_close_handler", None)
if callable(set_close_handler):
set_close_handler(lambda expected=generation: self._restore_video_preview(expected))
video_window.raise_()
dialog.raise_()
dialog.activateWindow()
except RuntimeError:
self._restore_video_preview(generation, activate=False)
self._restore_video_preview(generation, activate=False)
def _restore_video_preview(
self,
@@ -1019,12 +1126,12 @@ class ApplicationController(QObject):
self._video_preview_generation += 1
window = state.get("window")
try:
set_close_handler = getattr(window, "set_compact_close_handler", None)
if callable(set_close_handler):
set_close_handler(None)
restore_screenshot = getattr(window, "restore_screenshot_preview", None)
if callable(restore_screenshot):
restore_screenshot()
set_close_handler = getattr(window, "set_compact_close_handler", None)
if callable(set_close_handler):
set_close_handler(None)
restore_screenshot = getattr(window, "restore_screenshot_preview", None)
if callable(restore_screenshot):
restore_screenshot()
window.setWindowFlag(
Qt.WindowType.WindowStaysOnTopHint,
bool(state.get("stays_on_top")),
@@ -1040,8 +1147,8 @@ class ApplicationController(QObject):
window.raise_()
if activate:
window.activateWindow()
if callable(getattr(window, "setProperty", None)):
window.setProperty("doctorSkipOpenGeometry", False)
if callable(getattr(window, "setProperty", None)):
window.setProperty("doctorSkipOpenGeometry", False)
except (AttributeError, RuntimeError):
return
@@ -41,10 +41,10 @@ from PySide6.QtWidgets import (
QWidget,
)
from ..core.appointment_modes import APPOINTMENT_MODES
from .design_system import PALETTE, clinical_stylesheet
from .theme import main_window_target_rect
from .widgets import (
from ..core.appointment_modes import APPOINTMENT_MODES
from .design_system import clinical_stylesheet
from .theme import main_window_target_rect
from .widgets import (
display_text,
first_value,
friendly_error,
@@ -640,7 +640,7 @@ class _Spinner(QWidget):
del event
painter = QPainter(self)
painter.setRenderHint(QPainter.RenderHint.Antialiasing)
pen = QPen(QColor(PALETTE["accent"]), 3)
pen = QPen(QColor("#4F63D9"), 3)
pen.setCapStyle(Qt.PenCapStyle.RoundCap)
painter.setPen(pen)
painter.drawArc(self.rect().adjusted(4, 4, -4, -4), self._angle * 16, 255 * 16)
@@ -31,27 +31,22 @@ _QSS = """
background: $ds_surface; border: 1px solid $ds_line; border-radius: $ds_radius_panel;
}
#AppointmentsPage QPushButton {
min-height: 32px; padding: 0 13px; border: 1px solid $ds_line_strong;
border-radius: $ds_radius_control; background: $ds_surface; color: $ds_text;
font-weight: 500;
min-height: 30px; padding: 0 12px; border: 1px solid transparent;
border-radius: $ds_radius_control; background: $ds_surface_alt;
}
#AppointmentsPage QPushButton:hover { color: $ds_accent; background: $ds_accent_soft; border-color: #9CCFC7; }
#AppointmentsPage QPushButton:pressed { background: #D7EFEA; }
#AppointmentsPage QPushButton:hover { color: $ds_accent; background: $ds_surface_alt; border-color: $ds_line_strong; }
#AppointmentsPage QPushButton:pressed { background: $ds_accent_soft; }
#AppointmentsPage QPushButton:focus { border-color: $ds_focus; }
#AppointmentsPage QPushButton[variant="primary"] {
background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #12857D, stop:1 $ds_accent);
color: $ds_surface; border-color: $ds_accent;
}
#AppointmentsPage QPushButton[variant="primary"]:hover {
background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #0E726B, stop:1 $ds_accent_hover);
border-color: $ds_accent_hover;
background: $ds_accent; color: $ds_surface; border-color: $ds_accent;
}
#AppointmentsPage QPushButton[variant="primary"]:hover { background: $ds_accent_hover; }
#AppointmentsPage QPushButton[variant="primary"]:pressed { background: $ds_accent_pressed; }
#AppointmentsPage QPushButton[variant="primary"]:focus { border-color: $ds_focus; }
#AppointmentsPage QPushButton[variant="danger"] {
color: $ds_danger; background: $ds_danger_soft; border-color: #F5C8CD;
color: $ds_danger; background: $ds_danger_soft; border-color: transparent;
}
#AppointmentsPage QPushButton[variant="danger"]:hover { background: #FBDCE0; border-color: #E79DA6; }
#AppointmentsPage QPushButton[variant="danger"]:hover { background: $ds_danger_soft; }
#AppointmentsPage QPushButton[variant="danger"]:pressed { border-color: $ds_danger; }
#AppointmentsPage QPushButton[variant="ghost"] { background: transparent; border-color: transparent; }
#AppointmentsPage QPushButton[variant="ghost"]:hover { background: $ds_accent_soft; }
@@ -106,20 +101,9 @@ _QSS = """
min-height: 36px; max-height: 36px; padding: 0 17px; font-size: 13px;
}
#AppointmentsPage QFrame#AppointmentToolbar QPushButton[variant="secondary"]:enabled {
color: $ds_text;
background: $ds_surface;
border: 1px solid $ds_line_strong;
border-radius: $ds_radius_control;
}
#AppointmentsPage QFrame#AppointmentToolbar QPushButton[variant="secondary"]:enabled:hover {
color: $ds_accent;
background: $ds_accent_soft;
border-color: #8FC8C0;
}
#AppointmentsPage QFrame#AppointmentToolbar QPushButton[variant="secondary"]:enabled:pressed {
background: #D6ECE8;
border-color: $ds_accent;
color: $ds_text; border-color: transparent;
}
#AppointmentsPage QFrame#AppointmentToolbar QPushButton[variant="secondary"]:hover { color: $ds_accent; background: $ds_accent_soft; }
#AppointmentsPage QFrame#AppointmentToolbar QPushButton[variant="secondary"]:focus { border-color: $ds_focus; }
#AppointmentsPage QTableWidget#AppointmentTable {
background: $ds_surface; alternate-background-color: $ds_surface; border: 0; border-radius: 0;
@@ -42,58 +42,56 @@ _MAX_CARDS = 5
_POLL_INTERVAL_MS = 5_000
CHAT_NOTIFICATION_QSS = """
/* W8 原语 C:右下角黑曜翡翠临床实时提醒浮卡 + 香槟鎏金切边 */
QFrame#ChatNotifyCard {
background-color: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #103231, stop:1 #071919);
border: 1px solid rgba(223, 199, 147, 136);
border-radius: 13px;
background-color: #FFFFFF;
border: 1px solid #BBF0CE;
border-radius: 12px;
}
QFrame#ChatNotifyCard[kind="left"] { border-color: rgba(164, 196, 192, 90); }
QFrame#ChatNotifyCard[kind="complete"] { border-color: rgba(84, 230, 193, 140); }
QFrame#ChatNotifyCard[kind="left"] { border-color: #E4E4E5; }
QFrame#ChatNotifyCard[kind="complete"] { border-color: #8B9AD9; }
QLabel#ChatNotifyBadge {
min-width: 34px;
max-width: 34px;
min-height: 34px;
max-height: 34px;
color: #FFFFFF;
background-color: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #19B2A8, stop:1 #0B6E68);
border: 1px solid rgba(223, 199, 147, 120);
border-radius: 10px;
font-size: 14px;
background-color: #287B65;
border-radius: 9px;
font-size: 15px;
font-weight: 700;
}
QLabel#ChatNotifyBadge[kind="left"] { background-color: #355250; }
QLabel#ChatNotifyBadge[kind="complete"] { background-color: #B8924A; }
QLabel#ChatNotifyTitle { color: #DFC793; font-size: 13px; font-weight: 700; }
QLabel#ChatNotifyDesc { color: #EEF8F7; font-size: 12px; }
QLabel#ChatNotifyTime { color: #8EB5B1; font-size: 11px; }
QLabel#ChatNotifyBadge[kind="left"] { background-color: #6A6B6D; }
QLabel#ChatNotifyBadge[kind="complete"] { background-color: #4F63D9; }
QLabel#ChatNotifyTitle { color: #1A1C1F; font-size: 13px; font-weight: 700; }
QLabel#ChatNotifyDesc { color: #1A1C1F; font-size: 12px; }
QLabel#ChatNotifyTime { color: #6A6B6D; font-size: 11px; }
QPushButton#ChatNotifyOpen {
min-height: 28px;
padding: 0 12px;
color: #FFFFFF;
background-color: rgba(24, 176, 165, 86);
border: 1px solid rgba(223, 199, 147, 128);
min-height: 26px;
padding: 0 10px;
color: #4F63D9;
background-color: #EEF1FA;
border: 1px solid #EDEDEE;
border-radius: 7px;
font-size: 12px;
font-weight: 600;
}
QPushButton#ChatNotifyOpen:hover {
color: #FFFFFF;
background-color: #0B6E68;
border-color: #DFC793;
color: #4156C4;
background-color: #EEF1FA;
border-color: #8B9AD9;
}
QPushButton#ChatNotifyClose {
min-width: 22px;
max-width: 22px;
min-height: 22px;
max-height: 22px;
color: #93B8B4;
color: #6A6B6D;
background-color: transparent;
border: 0;
border-radius: 6px;
font-size: 14px;
}
QPushButton#ChatNotifyClose:hover { color: #FFFFFF; background-color: rgba(255, 255, 255, 28); }
QPushButton#ChatNotifyClose:hover { color: #1A1C1F; background-color: #F7F7F7; }
"""
@@ -1,341 +0,0 @@
"""Ctrl+K 悬浮智诊命令中枢(Command Palette):键盘优先的现代桌面快捷导航与患者检索."""
from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass
from typing import Any
from PySide6.QtCore import QEvent, QRectF, QSize, Qt
from PySide6.QtGui import (
QColor,
QKeyEvent,
QLinearGradient,
QPainter,
)
from PySide6.QtWidgets import (
QDialog,
QFrame,
QHBoxLayout,
QLabel,
QLineEdit,
QListWidget,
QListWidgetItem,
QPushButton,
QVBoxLayout,
QWidget,
)
from . import icons, motion
from .design_system import clinical_stylesheet
@dataclass(frozen=True)
class CommandEntry:
"""命令中枢中的单条可执行指令。"""
key: str
title: str
subtitle: str
icon_kind: str
category: str
shortcut: str
action: Callable[[], None]
_PALETTE_QSS = clinical_stylesheet(
r"""
QDialog#CommandPaletteDialog {
background: transparent;
}
QFrame#CommandPaletteCard {
background-color: $ds_surface;
border: 1px solid #B7D3CE;
border-radius: 16px;
}
QFrame#CommandPaletteHeader {
background-color: #F7FBFA;
border: 0;
border-bottom: 1px solid $ds_line;
border-top-left-radius: 16px;
border-top-right-radius: 16px;
}
QLineEdit#CommandPaletteInput {
background: transparent;
border: 0;
color: $ds_heading;
font-size: 15px;
font-weight: 500;
padding: 4px 2px;
selection-background-color: $ds_accent_soft;
selection-color: $ds_heading;
}
QLabel#CommandPaletteEsc {
color: $ds_muted;
background-color: $ds_surface;
border: 1px solid $ds_line_strong;
border-radius: 6px;
padding: 2px 7px;
font-size: 11px;
font-weight: 500;
}
QListWidget#CommandPaletteList {
background: transparent;
border: 0;
outline: 0;
padding: 6px 8px;
}
QListWidget#CommandPaletteList::item {
border: 1px solid transparent;
border-radius: 10px;
padding: 8px 10px;
margin: 2px 0;
color: $ds_heading;
}
QListWidget#CommandPaletteList::item:hover {
background-color: #F2FAF9;
border-color: #D5E8E5;
}
QListWidget#CommandPaletteList::item:selected {
background-color: $ds_accent_soft;
border-color: #A9D6CF;
color: $ds_accent_hover;
}
QFrame#CommandPaletteFooter {
background-color: #F7FBFA;
border: 0;
border-top: 1px solid $ds_line;
border-bottom-left-radius: 16px;
border-bottom-right-radius: 16px;
}
QLabel#CommandPaletteHint {
color: $ds_muted;
font-size: 12px;
}
QPushButton#CommandPaletteClose {
min-width: 28px;
max-width: 28px;
min-height: 28px;
max-height: 28px;
padding: 0;
border: 1px solid transparent;
border-radius: 7px;
background: transparent;
color: $ds_muted;
}
QPushButton#CommandPaletteClose:hover {
background-color: $ds_danger_soft;
color: $ds_danger;
}
"""
)
class _PaletteCard(QFrame):
"""带微妙顶缘香槟鎏金高光的悬浮命令卡片。"""
def paintEvent(self, event: Any) -> None: # noqa: N802
super().paintEvent(event)
painter = QPainter(self)
painter.setRenderHint(QPainter.RenderHint.Antialiasing, True)
bar = QRectF(18.0, 1.0, max(0.0, self.width() - 36.0), 2.0)
grad = QLinearGradient(bar.topLeft(), bar.topRight())
grad.setColorAt(0.0, QColor(11, 110, 104, 0))
grad.setColorAt(0.28, QColor(24, 168, 158, 180))
grad.setColorAt(0.50, QColor(223, 199, 147, 210))
grad.setColorAt(0.72, QColor(24, 168, 158, 180))
grad.setColorAt(1.0, QColor(11, 110, 104, 0))
painter.setPen(Qt.PenStyle.NoPen)
painter.setBrush(grad)
painter.drawRoundedRect(bar, 1.0, 1.0)
painter.end()
class CommandPaletteDialog(QDialog):
"""桌面端全局 Ctrl+K 悬浮命令与患者检索面板。"""
def __init__(
self,
entries: list[CommandEntry],
*,
on_search_patient: Callable[[str], None] | None = None,
initial_query: str = "",
parent: QWidget | None = None,
) -> None:
super().__init__(parent)
self.setObjectName("CommandPaletteDialog")
self.setProperty("doctorSkipOpenGeometry", True)
self.setWindowFlags(
Qt.WindowType.FramelessWindowHint
| Qt.WindowType.Dialog
| Qt.WindowType.NoDropShadowWindowHint
)
self.setAttribute(Qt.WidgetAttribute.WA_TranslucentBackground, True)
self.setModal(True)
self.setStyleSheet(_PALETTE_QSS)
self._entries = list(entries)
self._on_search_patient = on_search_patient
self._visible_actions: list[Callable[[], None]] = []
root = QVBoxLayout(self)
root.setContentsMargins(12, 12, 12, 12)
self.card = _PaletteCard(self)
self.card.setObjectName("CommandPaletteCard")
self.card.setFixedWidth(568)
card_layout = QVBoxLayout(self.card)
card_layout.setContentsMargins(0, 0, 0, 0)
card_layout.setSpacing(0)
# 顶部搜索栏
header = QFrame(self.card)
header.setObjectName("CommandPaletteHeader")
header.setFixedHeight(56)
header_layout = QHBoxLayout(header)
header_layout.setContentsMargins(16, 0, 14, 0)
header_layout.setSpacing(10)
search_icon = QLabel(header)
search_icon.setPixmap(icons.pixmap("search", "accent", 18))
header_layout.addWidget(search_icon)
self.input = QLineEdit(header)
self.input.setObjectName("CommandPaletteInput")
self.input.setPlaceholderText("输入页面名称、快捷指令,或患者姓名/手机号回车搜索...")
self.input.setText(initial_query)
self.input.textChanged.connect(self._rebuild_list)
self.input.installEventFilter(self)
header_layout.addWidget(self.input, 1)
esc_hint = QLabel("ESC", header)
esc_hint.setObjectName("CommandPaletteEsc")
esc_hint.setFixedHeight(24)
header_layout.addWidget(esc_hint, 0, Qt.AlignmentFlag.AlignVCenter)
close_btn = QPushButton(header)
close_btn.setObjectName("CommandPaletteClose")
close_btn.setIcon(icons.icon("close", "muted", 14))
close_btn.setIconSize(QSize(14, 14))
close_btn.setCursor(Qt.CursorShape.PointingHandCursor)
close_btn.clicked.connect(self.reject)
header_layout.addWidget(close_btn)
card_layout.addWidget(header)
# 指令列表
self.list_widget = QListWidget(self.card)
self.list_widget.setObjectName("CommandPaletteList")
self.list_widget.setFixedHeight(296)
self.list_widget.setIconSize(QSize(18, 18))
self.list_widget.setSpacing(2)
self.list_widget.itemActivated.connect(self._activate_item)
self.list_widget.itemClicked.connect(self._activate_item)
card_layout.addWidget(self.list_widget)
# 底部键盘引导条
footer = QFrame(self.card)
footer.setObjectName("CommandPaletteFooter")
footer.setFixedHeight(36)
footer_layout = QHBoxLayout(footer)
footer_layout.setContentsMargins(16, 0, 16, 0)
hint = QLabel("↑↓ 选择 · Enter 执行 · Esc 关闭", footer)
hint.setObjectName("CommandPaletteHint")
footer_layout.addWidget(hint)
footer_layout.addStretch(1)
brand = QLabel("甄养堂 · 智诊指令中枢", footer)
brand.setObjectName("CommandPaletteHint")
footer_layout.addWidget(brand)
card_layout.addWidget(footer)
root.addWidget(self.card)
self.adjustSize()
self._rebuild_list(initial_query)
def showEvent(self, event: Any) -> None: # noqa: N802
super().showEvent(event)
parent = self.parentWidget()
if parent is not None:
host = parent.window().frameGeometry()
x = host.center().x() - self.width() // 2
y = host.top() + max(72, round(host.height() * 0.14))
self.move(x, y)
self.input.setFocus(Qt.FocusReason.PopupFocusReason)
self.input.selectAll()
motion.fade_in(self.card, duration=motion.FAST)
def paintEvent(self, event: Any) -> None: # noqa: N802
del event
# 柔和冷青科技外光环,在透明无边框弹窗周围营造立体层次
painter = QPainter(self)
painter.setRenderHint(QPainter.RenderHint.Antialiasing, True)
card_rect = QRectF(self.card.geometry())
for expand, alpha in ((8.0, 14), (5.0, 22), (2.0, 32)):
painter.setPen(Qt.PenStyle.NoPen)
painter.setBrush(QColor(11, 46, 44, alpha))
painter.drawRoundedRect(
card_rect.adjusted(-expand, -expand + 2.0, expand, expand + 4.0),
16.0 + expand * 0.4,
16.0 + expand * 0.4,
)
painter.end()
def _rebuild_list(self, raw_query: str) -> None:
query = raw_query.strip()
lowered = query.lower()
self.list_widget.clear()
self._visible_actions.clear()
if query and self._on_search_patient is not None:
item = QListWidgetItem(
icons.icon("search", "accent", 18),
f"检索患者「{query}」 — 直达患者与问诊列表",
)
self.list_widget.addItem(item)
self._visible_actions.append(
lambda q=query, cb=self._on_search_patient: cb(q)
)
for entry in self._entries:
haystack = f"{entry.title} {entry.subtitle} {entry.category}".lower()
if lowered and lowered not in haystack:
continue
label = f"{entry.title} · {entry.subtitle}"
if entry.shortcut:
label = f"{label} [{entry.shortcut}]"
item = QListWidgetItem(icons.icon(entry.icon_kind, "accent", 18), label)
self.list_widget.addItem(item)
self._visible_actions.append(entry.action)
if self.list_widget.count() > 0:
self.list_widget.setCurrentRow(0)
def _activate_item(self, item: QListWidgetItem | None) -> None:
if item is None:
return
row = self.list_widget.row(item)
if 0 <= row < len(self._visible_actions):
action = self._visible_actions[row]
self.accept()
action()
def eventFilter(self, watched: Any, event: QEvent) -> bool: # noqa: N802
if watched is self.input and event.type() == QEvent.Type.KeyPress:
assert isinstance(event, QKeyEvent)
key = event.key()
if key in (Qt.Key.Key_Down, Qt.Key.Key_Up):
count = self.list_widget.count()
if count > 0:
step = 1 if key == Qt.Key.Key_Down else -1
current = self.list_widget.currentRow()
self.list_widget.setCurrentRow((current + step) % count)
return True
if key in (Qt.Key.Key_Return, Qt.Key.Key_Enter):
self._activate_item(self.list_widget.currentItem())
return True
if key == Qt.Key.Key_Escape:
self.reject()
return True
return super().eventFilter(watched, event)
__all__ = ["CommandEntry", "CommandPaletteDialog"]
@@ -36,26 +36,19 @@ _QSS = """
background: transparent; border: 0; border-top: 1px solid $ds_line; border-radius: 0;
}
#DiagnosisIndex QPushButton {
min-height: 34px; padding: 0 13px; border: 1px solid $ds_line_strong;
border-radius: $ds_radius_control; background: $ds_surface; color: $ds_text; font-weight: 500;
min-height: 34px; padding: 0 13px; border: 1px solid transparent;
border-radius: $ds_radius_control; background: $ds_surface_alt;
}
#DiagnosisIndex QPushButton:hover { color: $ds_accent; background: $ds_accent_soft; border-color: #9CCFC7; }
#DiagnosisIndex QPushButton:pressed { background: #D7EFEA; }
#DiagnosisIndex QPushButton:hover { color: $ds_accent; background: $ds_surface_alt; border-color: $ds_line_strong; }
#DiagnosisIndex QPushButton:pressed { background: $ds_accent_soft; }
#DiagnosisIndex QPushButton:focus { border-color: $ds_focus; }
#DiagnosisIndex QPushButton[variant="primary"] {
color: $ds_surface;
background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #12857D, stop:1 $ds_accent);
border-color: $ds_accent;
}
#DiagnosisIndex QPushButton[variant="primary"]:hover {
background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #0E726B, stop:1 $ds_accent_hover);
border-color: $ds_accent_hover;
}
#DiagnosisIndex QPushButton[variant="primary"] { color: $ds_surface; background: $ds_accent; border-color: $ds_accent; }
#DiagnosisIndex QPushButton[variant="primary"]:hover { background: $ds_accent_hover; }
#DiagnosisIndex QPushButton[variant="primary"]:pressed { background: $ds_accent_pressed; }
#DiagnosisIndex QPushButton[variant="primary"]:focus { border-color: $ds_focus; }
#DiagnosisIndex QPushButton[consultationTool="true"] { color: $ds_text; border-color: $ds_line_strong; background: $ds_surface; }
#DiagnosisIndex QPushButton[consultationTool="true"]:hover { color: $ds_accent; background: $ds_accent_soft; border-color: #9CCFC7; }
#DiagnosisIndex QPushButton[consultationDanger="true"] { color: $ds_danger; background: $ds_danger_soft; border-color: #F5C8CD; }
#DiagnosisIndex QPushButton[consultationTool="true"] { color: $ds_text; border-color: transparent; }
#DiagnosisIndex QPushButton[consultationTool="true"]:hover { color: $ds_accent; background: $ds_accent_soft; }
#DiagnosisIndex QPushButton[consultationDanger="true"] { color: $ds_danger; background: $ds_danger_soft; border-color: transparent; }
#DiagnosisIndex QPushButton[consultationDanger="true"]:hover { border-color: $ds_danger; }
#DiagnosisIndex QPushButton[consultationTool="true"]:focus,
#DiagnosisIndex QPushButton[consultationDanger="true"]:focus { border-color: $ds_focus; }
+48 -68
View File
@@ -1,8 +1,8 @@
"""Clinical desktop design tokens — 御瓷智医 (Luxury Precision MedTech).
"""Clinical desktop design tokens, shared by native pages and dialog chrome.
Fuses medical trust, precision technology, quiet luxury (champagne gold micro-accents)
and contemporary editorial clarity. Shared by native pages, shell chrome, drawers and
dialogs. New rules should use the named ``$ds_*`` tokens rather than legacy colours.
Keep data-series colours and video pixels outside this palette. Existing scoped
QSS can adopt the system without changing selectors, layout or permissions.
New rules should use the named ``$ds_*`` tokens rather than legacy colours.
"""
from __future__ import annotations
@@ -11,80 +11,60 @@ import re
from string import Template
PALETTE = {
# 三阶珍珠青瓷中性面:低眩光护眼,同时具备精密医疗仪器与高定材质层次
"canvas": "#EFF4F3",
"canvas": "#F5F7FA",
"surface": "#FFFFFF",
"surface_alt": "#F6FAFA",
"sidebar": "#E6EEED",
"line": "#DCE6E4",
"line_strong": "#C3D3D0",
# 曜青深墨文字阶梯:锐利、高级、高对比度
"heading": "#0F2120",
"text": "#263938",
"muted": "#5C7270",
"disabled": "#95A8A6",
"disabled_surface": "#EDF2F1",
# 唯一品牌主色:甄养堂精密医疗翡翠青 (Jade Teal)
"accent": "#0B6E68",
"accent_hover": "#085954",
"accent_pressed": "#064743",
"accent_soft": "#E6F4F2",
"focus": "#18A89E",
# 贵气时尚微点缀:香槟鎏金 (Champagne Gold — 克制用于徽标切边、AI 科技星芒、尊享标识)
"gold": "#B8924A",
"gold_light": "#DFC793",
"gold_soft": "#FAF5EA",
# 深曜青科技底(用于 AI 科技卡与登录页品牌沉浸区)
"obsidian": "#0D2424",
"obsidian_alt": "#143534",
# 语义临床色
"success": "#0E8A63",
"success_soft": "#E6F7F1",
"warning": "#B56B00",
"warning_soft": "#FEF5E6",
"danger": "#C83B4B",
"danger_soft": "#FDEEEF",
"surface_alt": "#F7F9FC",
"sidebar": "#F0F3F8",
"line": "#E6EAF0",
"line_strong": "#D4DCE8",
"heading": "#223047",
"text": "#344258",
"muted": "#647287",
"disabled": "#8B96A6",
"disabled_surface": "#F0F2F5",
"accent": "#4267B2",
"accent_hover": "#355995",
"accent_pressed": "#2C4C82",
"accent_soft": "#EAF0FB",
"focus": "#6D8CCB",
"success": "#287B65",
"success_soft": "#EDF7F2",
"warning": "#96601D",
"warning_soft": "#FBF4E8",
"danger": "#B54A59",
"danger_soft": "#FCF0F2",
}
RADII = {"small": 6, "control": 8, "panel": 12, "window": 16}
RADII = {"small": 6, "control": 10, "panel": 16, "window": 20}
SPACING = {"small": 8, "control": 12, "group": 16, "section": 24}
TOKENS = {f"ds_{name}": value for name, value in PALETTE.items()}
TOKENS.update({f"ds_radius_{name}": f"{value}px" for name, value in RADII.items()})
TOKENS.update({f"ds_space_{name}": f"{value}px" for name, value in SPACING.items()})
# 将全量旧版灰蓝/紫蓝/冷灰硬编码色值统一映射至「御瓷智医」设计令牌,确保所有历史弹窗与页面零色差
# Explicit migration of the two existing native palettes. This adapter only
# touches six-digit colour literals; selectors and metrics stay page-owned.
_LEGACY_ROLES = {
"accent": ("4267B2", "1769E8", "4F63D9", "5761F4", "5267DF", "1555B6"),
"accent_hover": ("355995", "155BCC", "4156C4", "4356C4", "4055CA"),
"accent_pressed": ("2C4C82", "124EA9", "354BB4"),
"accent_soft": (
"EAF0FB", "EAF2FF", "EEF1FA", "EEF0FF", "F0F2FF", "DCEAFF", "EDF0FC",
"F0F5FD", "D6E5FB", "E3E8F8",
),
"focus": ("6D8CCB", "75A5F0", "8B9AD9"),
"canvas": ("F5F7FA", "F3F7FD", "F4F6FA", "F6F6F6"),
"surface_alt": ("F7F9FC", "F7F7F7", "F7FAFE", "F5F8FD", "F7F9FE", "F2F7FF"),
"sidebar": ("F0F3F8", "EDF4FF"),
"line": (
"E6EAF0", "DBE5F2", "EDEDEE", "E5ECF6", "E6EDF6", "E7EDF7", "EDF0F5",
"E7EBF2", "E6EAF5", "EDF1F7", "DEE4F6",
),
"line_strong": (
"D4DCE8", "E4E4E5", "C8D5E6", "C9DCF7", "ADC8F0", "B6CDEE", "C4D2E5",
"CEDBEB", "A7B1C9", "8894B2",
),
"heading": ("223047", "1A1C1F", "202C3F", "111F46", "20354E"),
"text": ("344258", "273244", "263551", "24334A", "233149", "3F4E75"),
"muted": ("647287", "606163", "6A6B6D", "5D6B80", "7886AA", "708097", "697386"),
"disabled": ("8B96A6", "8E8F90", "8A97A9", "9AA6B7"),
"disabled_surface": ("F0F2F5", "F2F2F2", "F0F0F0"),
"success": ("287B65",),
"success_soft": ("EDF7F2", "EEF7F3", "EAF9F3", "E8F6F1", "F0FDF4", "ECFDF5"),
"warning": ("96601D", "A9691D", "9C681F", "B96C00"),
"warning_soft": ("FBF4E8", "FCF5E9", "FFF5E6", "FFF6E7", "FFF9EF", "FFF7E9", "FFFBEB"),
"danger": ("B54A59", "BE4B58", "B84652", "C43E55"),
"danger_soft": ("FCF0F2", "FFF0F2", "FFF1F3", "FFF4F5", "FFF7F8", "FEF2F2"),
"accent": ("1769E8", "4F63D9", "5761F4", "5267DF"),
"accent_hover": ("155BCC", "1555B6", "4156C4", "4356C4", "4055CA"),
"accent_pressed": ("124EA9", "354BB4"),
"accent_soft": ("EAF2FF", "EEF1FA", "EEF0FF", "F0F2FF", "DCEAFF", "EDF0FC"),
"focus": ("75A5F0", "8B9AD9"),
"canvas": ("F3F7FD", "F4F6FA", "F6F6F6"),
"surface_alt": ("F7F7F7", "F7FAFE", "F5F8FD", "F7F9FE", "F2F7FF"),
"sidebar": ("EDF4FF",),
"line": ("DBE5F2", "EDEDEE", "E5ECF6", "E6EDF6", "E7EDF7", "EDF0F5", "E7EBF2", "E6EAF5"),
"line_strong": ("E4E4E5", "C8D5E6", "C9DCF7", "ADC8F0", "B6CDEE"),
"heading": ("1A1C1F", "202C3F", "111F46"),
"text": ("273244", "263551", "24334A", "233149", "3F4E75"),
"muted": ("606163", "6A6B6D", "5D6B80", "7886AA", "708097"),
"disabled": ("8E8F90", "8A97A9", "9AA6B7"),
"disabled_surface": ("F2F2F2", "F0F0F0"),
"success_soft": ("EEF7F3", "EAF9F3"),
"warning": ("A9691D", "9C681F"),
"warning_soft": ("FCF5E9", "FFF5E6", "FFF6E7"),
"danger": ("BE4B58", "B84652"),
"danger_soft": ("FFF0F2", "FFF1F3"),
}
_LEGACY = {colour.lower(): PALETTE[role] for role, colours in _LEGACY_ROLES.items() for colour in colours}
_HEX = re.compile(r"#([0-9a-fA-F]{6})(?![0-9a-fA-F])")
@@ -414,21 +414,6 @@ QTimeEdit[diagnosisField="true"] {
QDoubleSpinBox[diagnosisField="true"] {
padding-right: 4px;
}
QComboBox[diagnosisField="true"]::drop-down,
QDateEdit[diagnosisField="true"]::drop-down,
QTimeEdit[diagnosisField="true"]::drop-down {
width: 26px;
border: 0;
background: transparent;
}
QDoubleSpinBox[diagnosisField="true"]::up-button,
QDoubleSpinBox[diagnosisField="true"]::down-button,
QSpinBox[diagnosisField="true"]::up-button,
QSpinBox[diagnosisField="true"]::down-button {
width: 18px;
border: 0;
background: transparent;
}
QPlainTextEdit[diagnosisField="true"] {
padding: 8px 12px;
}
@@ -84,7 +84,7 @@ _INVALID_INDEX = QModelIndex()
# time occupy separate lines; actions keep two inline links plus 更多, with
# the remaining actions in its menu so clinical columns retain more space.
_TABLE_COLUMN_WIDTHS = (48, 70, 60, 100, 175, 88, 120, 100, 72, 110, 96, 160)
_BLUE_COLUMN_WIDTHS = (46, 62, 70, 88, 244, 70, 84, 76, 70, 92, 86, 152)
_BLUE_COLUMN_WIDTHS = (48, 70, 82, 102, 244, 90, 84, 90, 88, 122, 92, 158)
_BLUE_WARNING = QColor(PALETTE["warning"])
_BLUE_DANGER = QColor(PALETTE["danger"])
@@ -454,10 +454,9 @@ def prescription_action(record: Any, *, force_open: bool = False) -> tuple[str,
def can_void_prescription(record: Any) -> bool:
# 已有业务订单、已审核签署的处方也可作废:订单随同诊单重新开方自动关联新处方;权限与药房锁由服务端判定。
_, mode = prescription_action(record)
return mode in {"edit", "view"} and not _as_bool(
first_value(record, "has_prescription_order", default=False)
)
return mode in {"edit", "view"}
def _prescription_action_label(record: Any, *, force_open: bool = False) -> str:
@@ -94,7 +94,6 @@ from ..widgets import (
run_async,
show_toast,
)
from ..window_primitives import ClinicalAccentBar
from .ai_consult_charts import GlucoseChartData
from .ai_consult_drug_names import TCM as DRUG_TCM
from .ai_consult_drug_names import WESTERN as DRUG_WESTERN
@@ -4782,9 +4781,7 @@ class AiConsultDialog(QDialog):
_style_surface(shell)
root = QVBoxLayout(self)
root.setContentsMargins(0, 0, 0, 0)
root.setSpacing(0)
root.addWidget(ClinicalAccentBar(self))
root.addWidget(shell, 1)
root.addWidget(shell)
layout = QVBoxLayout(shell)
layout.setContentsMargins(18, 14, 18, 14)
layout.setSpacing(12)
@@ -99,7 +99,6 @@ from ..widgets import (
page_total,
run_async,
)
from ..window_primitives import ClinicalAccentBar
from .issued_prescription_ai import can_open_issued_ai, present_issued_prescription_ai
from .local_audio_queue import LocalAudioQueueDialog
from .prescription_ai import can_open_diagnosis_ai_report, present_diagnosis_ai_report
@@ -1234,105 +1233,21 @@ class DiagnosisDialog(QDialog):
panel_layout = QVBoxLayout(self.drawer_panel)
panel_layout.setContentsMargins(0, 0, 0, 0)
panel_layout.setSpacing(0)
panel_layout.addWidget(ClinicalAccentBar(self.drawer_panel))
panel_layout.addWidget(self._build_drawer_header())
self.drawer_banner = MessageStrip()
self.drawer_banner.setContentsMargins(16, 8, 16, 0)
self.drawer_banner.action_requested.connect(self._retry_current)
panel_layout.addWidget(self.drawer_banner)
# W5 四诊病历工作室:左侧章节大纲定位轨 + 右侧主编辑工作区
studio_body = QHBoxLayout()
studio_body.setContentsMargins(0, 0, 0, 0)
studio_body.setSpacing(0)
self.studio_outline = QFrame(self.drawer_panel)
self.studio_outline.setObjectName("DiagnosisStudioOutline")
self.studio_outline.setFixedWidth(136)
self.studio_outline.setStyleSheet(
clinical_stylesheet(
r"""
QFrame#DiagnosisStudioOutline {
background-color: #F4F9F8;
border-right: 1px solid $ds_line;
}
QPushButton[studioOutlineBtn="true"] {
min-height: 34px;
max-height: 34px;
padding: 0 10px;
text-align: left;
border: 1px solid transparent;
border-radius: 8px;
background: transparent;
color: $ds_text;
font-size: 12.5px;
font-weight: 500;
}
QPushButton[studioOutlineBtn="true"]:hover {
background-color: #E7F4F2;
color: $ds_accent;
}
QPushButton[studioOutlineBtn="true"]:checked {
background-color: #FFFFFF;
border-color: #BEE0DA;
color: $ds_accent;
font-weight: 600;
}
"""
)
)
self._studio_outline_layout = QVBoxLayout(self.studio_outline)
self._studio_outline_layout.setContentsMargins(10, 12, 10, 12)
self._studio_outline_layout.setSpacing(4)
self._studio_outline_buttons: list[QPushButton] = []
studio_body.addWidget(self.studio_outline)
self.tabs = DiagnosisTabWidget()
self.tabs.setObjectName("DiagnosisDrawerTabs")
self._build_drawer_tabs()
self.tabs.currentChanged.connect(self._tab_changed)
self.tabs.currentChanged.connect(self._sync_studio_outline_selection)
studio_body.addWidget(self.tabs, 1)
panel_layout.addLayout(studio_body, 1)
panel_layout.addWidget(self.tabs, 1)
panel_layout.addWidget(self._build_drawer_footer())
self.drawer_loading = LoadingOverlay(self.drawer_panel)
layout.addWidget(self.drawer_panel)
self._rebuild_studio_outline()
return overlay
def _rebuild_studio_outline(self) -> None:
"""同步左侧章节大纲按钮,使医生可按临床模块一键直达定位。"""
if not hasattr(self, "_studio_outline_layout"):
return
while self._studio_outline_layout.count():
item = self._studio_outline_layout.takeAt(0)
widget = item.widget()
if widget is not None:
widget.hide()
widget.setParent(None)
widget.deleteLater()
self._studio_outline_buttons.clear()
caption = QLabel("四诊病历大纲", self.studio_outline)
caption.setStyleSheet("color: #5F7A78; font-size: 11px; font-weight: 600; padding: 2px 6px 6px;")
self._studio_outline_layout.addWidget(caption)
for index in range(self.tabs.count()):
label = self.tabs.tabText(index)
btn = QPushButton(f"{index + 1:02d} {label}", self.studio_outline)
btn.setProperty("studioOutlineBtn", True)
btn.setCheckable(True)
btn.setChecked(index == self.tabs.currentIndex())
btn.setCursor(Qt.CursorShape.PointingHandCursor)
btn.clicked.connect(lambda _checked=False, i=index: self.tabs.setCurrentIndex(i))
self._studio_outline_layout.addWidget(btn)
self._studio_outline_buttons.append(btn)
self._studio_outline_layout.addStretch(1)
self.studio_outline.setVisible(self.tabs.count() > 1)
def _sync_studio_outline_selection(self, index: int) -> None:
if len(self._studio_outline_buttons) != self.tabs.count():
self._rebuild_studio_outline()
for i, btn in enumerate(self._studio_outline_buttons):
btn.setChecked(i == index)
def _build_drawer_header(self) -> QFrame:
header = QFrame()
header.setObjectName("DiagnosisDrawerHeader")
@@ -1946,7 +1861,6 @@ class DiagnosisDialog(QDialog):
target = index
self.tabs.setCurrentIndex(target)
self.tabs.blockSignals(blocked)
self._rebuild_studio_outline()
section_codes = {key: codes for key, _label, codes in _TAB_DEFINITIONS}
for key, section in self._readonly_sections.items():
section.setVisible(self._tab_allowed(section_codes.get(key, ())))
@@ -24,43 +24,43 @@ from PySide6.QtGui import QFont
from ..design_system import PALETTE
DARK: dict[str, str] = {
# 御瓷暗曜科技面:深翡翠黑曜石底 + 精密青玉科技主色 + 香槟鎏金微光
"canvas": "#071212",
"canvas_soft": "#0A1A1A",
"surface": "#0E2121",
"surface_2": "#122929",
"raised": "#183534",
"line": "#214240",
"line_soft": "#173130",
# ground and cards
"canvas": "#080D18",
"canvas_soft": "#0C1322",
"surface": "#0F1726",
"surface_2": "#131D2E",
"raised": "#1A2637",
"line": "#22304A",
"line_soft": "#18233A",
# type
"heading": "#ECF6F5",
"text": "#BAD0CE",
"muted": "#82A09D",
"faint": "#64827F",
"selected_text": "#ECF6F5",
"heading": "#E8EFFB",
"text": "#B6C5DA",
"muted": "#8195AF",
"faint": "#6A7F99",
"selected_text": "#E8EFFB",
# interface colour
"accent": "#16A89E",
"accent_text": "#5BE0D6",
"accent_pressed": "#0E857D",
"selection": "#123433",
"selection_line": "#1F5C58",
"accent": "#2E7BF6",
"accent_text": "#6BA5FF",
"accent_pressed": "#1A5FD0",
"selection": "#142645",
"selection_line": "#1B3E77",
# model hues
"qwen": "#22C7D6",
"qwen_text": "#69E3EE",
"qwen_dim": "#103238",
"openai": "#D4AF6A",
"openai_text": "#EAD09B",
"openai_dim": "#2D2719",
"qwen": "#17BFDD",
"qwen_text": "#55D8EE",
"qwen_dim": "#10303C",
"openai": "#9B7BFF",
"openai_text": "#B69FFF",
"openai_dim": "#241F48",
# severity
"amber": "#F2B644",
"amber_text": "#F7C96E",
"amber_dim": "#2E2514",
"rose": "#F06A7B",
"rose_text": "#F78D9B",
"rose_dim": "#2E171E",
"ok": "#16A89E",
"zebra": "#0C1D1D",
"grid_line": "#172E2D",
"amber": "#F5B942",
"amber_text": "#F8C661",
"amber_dim": "#2C2415",
"rose": "#F4697A",
"rose_text": "#F88694",
"rose_dim": "#2C1620",
"ok": "#2E7BF6",
"zebra": "#0E1626",
"grid_line": "#191F2C",
}
LIGHT: dict[str, str] = {
@@ -81,21 +81,21 @@ LIGHT: dict[str, str] = {
"accent_pressed": PALETTE["accent_pressed"],
"selection": PALETTE["accent_soft"],
"selection_line": PALETTE["focus"],
"qwen": "#0B8894",
"qwen_text": "#086A74",
"qwen_dim": "#E3F5F7",
"openai": "#A37E38",
"openai_text": "#826124",
"openai_dim": "#FAF4E7",
"amber": "#B56B00",
"amber_text": "#8F5400",
"amber_dim": "#FEF5E6",
"rose": "#C83B4B",
"rose_text": "#A62B3A",
"rose_dim": "#FDEEEF",
"ok": PALETTE["accent"],
"zebra": "#F8FBFB",
"grid_line": PALETTE["line"],
"qwen": "#0C89AC",
"qwen_text": "#086C88",
"qwen_dim": "#E2F5FA",
"openai": "#6B4AE0",
"openai_text": "#5537C6",
"openai_dim": "#EDE8FE",
"amber": "#B4791A",
"amber_text": "#8F5F0B",
"amber_dim": "#FCF2DF",
"rose": "#D0435A",
"rose_text": "#AE3149",
"rose_dim": "#FCE9EC",
"ok": "#1A5FD0",
"zebra": "#FAFBFE",
"grid_line": "#DDE4EE",
}
CONSOLE: dict[str, str] = dict(DARK)
@@ -117,7 +117,6 @@ from ..widgets import (
run_async,
show_toast,
)
from ..window_primitives import ClinicalAccentBar
from .diagnosis import DiagnosisDialog as _StructuredDiagnosisDialog
from .prescription_esign import (
PRESCRIPTION_UPLOAD_BEFORE_SIGNING_PROMPT,
@@ -3119,13 +3118,9 @@ class PrescriptionEditorDialog(QDialog):
surface_layout = QVBoxLayout(self.drawer_surface)
surface_layout.setContentsMargins(0, 0, 0, 0)
surface_layout.setSpacing(0)
surface_layout.addWidget(ClinicalAccentBar(self.drawer_surface))
self.workspace_splitter.addWidget(self.drawer_surface)
self.live_preview_pane = self._build_live_preview_pane()
self.workspace_splitter.addWidget(self.live_preview_pane)
self.workspace_splitter.setStretchFactor(0, 1)
self.workspace_splitter.setStretchFactor(1, 2)
self.workspace_splitter.setStretchFactor(2, 1)
self.workspace_splitter.setStretchFactor(1, 0)
self.header = self._build_header()
surface_layout.addWidget(self.header)
@@ -3208,188 +3203,6 @@ class PrescriptionEditorDialog(QDialog):
self._load_editor_context()
self.save_button.setEnabled(not self._esign_content_locked())
self._load_esign_config()
self._bind_live_preview_signals()
self._refresh_live_preview()
def _build_live_preview_pane(self) -> QFrame:
"""W6 智能开方工作台右侧:实时宣纸仿真处方笺预览 + CA 双签合规进度轨。"""
pane = QFrame(self.workspace_splitter)
pane.setObjectName("PrescriptionLivePreviewPane")
pane.setMinimumWidth(310)
pane.setMaximumWidth(400)
pane.setStyleSheet(
clinical_stylesheet(
r"""
QFrame#PrescriptionLivePreviewPane {
background-color: #EEF5F3;
border-left: 1px solid #C6DAD6;
}
QFrame#LiveRxPaperCard {
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #FFFEFA, stop:1 #FAF7EE);
border: 1px solid #DFD4BC;
border-radius: 13px;
}
QFrame#LiveEsignTrackCard {
background-color: #FFFFFF;
border: 1px solid $ds_line;
border-radius: 12px;
}
QLabel#LiveRxStepDone {
background-color: #E5F4F2;
border: 1px solid #A8D6CF;
border-radius: 7px;
color: #0B6E68;
padding: 5px 8px;
font-size: 11.5px;
font-weight: 600;
}
QLabel#LiveRxStepPending {
background-color: #F4F9F8;
border: 1px solid #D7E5E2;
border-radius: 7px;
color: #5F7A78;
padding: 5px 8px;
font-size: 11.5px;
}
"""
)
)
layout = QVBoxLayout(pane)
layout.setContentsMargins(0, 0, 0, 0)
layout.setSpacing(0)
layout.addWidget(ClinicalAccentBar(pane))
inner = QVBoxLayout()
inner.setContentsMargins(14, 14, 14, 14)
inner.setSpacing(12)
paper = QFrame(pane)
paper.setObjectName("LiveRxPaperCard")
paper_layout = QVBoxLayout(paper)
paper_layout.setContentsMargins(16, 14, 16, 14)
paper_layout.setSpacing(8)
emblem = QLabel("ZHENYANGTANG · 实时电子处方笺", paper)
emblem.setAlignment(Qt.AlignmentFlag.AlignCenter)
emblem.setStyleSheet("color: #8D7240; font-size: 11px; letter-spacing: 1px;")
paper_layout.addWidget(emblem)
title = QLabel("甄养堂互联网医院 · 中医专科处方", paper)
title.setAlignment(Qt.AlignmentFlag.AlignCenter)
title.setStyleSheet("color: #102625; font-size: 14px; font-weight: 700; padding-bottom: 6px; border-bottom: 1px solid #E3D8BF;")
paper_layout.addWidget(title)
self._live_rx_patient = QLabel("患者:— | 剂型:—", paper)
self._live_rx_patient.setWordWrap(True)
self._live_rx_patient.setStyleSheet("color: #274140; font-size: 12px;")
paper_layout.addWidget(self._live_rx_patient)
self._live_rx_diag = QLabel("辨证诊断:—", paper)
self._live_rx_diag.setWordWrap(True)
self._live_rx_diag.setStyleSheet("color: #0B6E68; font-size: 12px; font-weight: 600;")
paper_layout.addWidget(self._live_rx_diag)
rp_mark = QLabel("Rp", paper)
rp_mark.setStyleSheet("color: #0B6E68; font-size: 20px; font-weight: 700;")
paper_layout.addWidget(rp_mark)
self._live_rx_herbs = QLabel("请在左侧录入药材配方,右侧实时同步处方笺排版…", paper)
self._live_rx_herbs.setWordWrap(True)
self._live_rx_herbs.setAlignment(Qt.AlignmentFlag.AlignTop | Qt.AlignmentFlag.AlignLeft)
self._live_rx_herbs.setStyleSheet("color: #102625; font-size: 12.5px; line-height: 1.55;")
paper_layout.addWidget(self._live_rx_herbs, 1)
self._live_rx_footer = QLabel("共 0 味", paper)
self._live_rx_footer.setStyleSheet("color: #5F7A78; font-size: 12px; padding-top: 8px; border-top: 1px dashed #DFD4BC;")
paper_layout.addWidget(self._live_rx_footer)
inner.addWidget(paper, 1)
esign_card = QFrame(pane)
esign_card.setObjectName("LiveEsignTrackCard")
e_layout = QVBoxLayout(esign_card)
e_layout.setContentsMargins(12, 11, 12, 11)
e_layout.setSpacing(7)
e_title = QLabel("CA 合规电子双签进度轨", esign_card)
e_title.setStyleSheet("color: #102625; font-size: 12.5px; font-weight: 600;")
e_layout.addWidget(e_title)
step1 = QLabel("1. 医师编排配方与电子签章", esign_card)
step1.setObjectName("LiveRxStepDone")
step2 = QLabel("2. 自动推送药师审方队列", esign_card)
step2.setObjectName("LiveRxStepPending")
step3 = QLabel("3. 双签归档生成 PDF 原件", esign_card)
step3.setObjectName("LiveRxStepPending")
for s in (step1, step2, step3):
e_layout.addWidget(s)
inner.addWidget(esign_card)
layout.addLayout(inner, 1)
# 默认在大屏模式下自动联动展示,窄屏保持简洁抽屉宽度兼容既有测试
pane.hide()
return pane
def _bind_live_preview_signals(self) -> None:
if hasattr(self, "herbs") and hasattr(self.herbs, "changed"):
self.herbs.changed.connect(self._refresh_live_preview)
for attr in ("patient_name", "clinical_diagnosis", "prescription_type", "usage_days"):
widget = getattr(self, attr, None)
if widget is None:
continue
for sig_name in ("textChanged", "currentTextChanged", "valueChanged"):
sig = getattr(widget, sig_name, None)
if sig is not None:
sig.connect(self._refresh_live_preview)
break
def _refresh_live_preview(self) -> None:
if not hasattr(self, "_live_rx_herbs"):
return
patient = self.patient_name.text().strip() if hasattr(self, "patient_name") else ""
rx_type = ""
if hasattr(self, "prescription_type") and hasattr(self.prescription_type, "currentText"):
rx_type = self.prescription_type.currentText().strip()
if not rx_type:
rx_type = str(first_value(self._source, "prescription_type", default="")).strip()
self._live_rx_patient.setText(
f"患者:{patient or '未填写'} | 剂型:{rx_type or '默认'}"
)
diag = ""
if hasattr(self, "clinical_diagnosis"):
diag = (
self.clinical_diagnosis.toPlainText().strip()
if hasattr(self.clinical_diagnosis, "toPlainText")
else self.clinical_diagnosis.text().strip()
)
self._live_rx_diag.setText(f"辨证诊断:{diag or '待补充临床辨证'}")
herbs_list: list[Any] = []
if hasattr(self, "herbs") and callable(getattr(self.herbs, "values", None)):
herbs_list = list(self.herbs.values())
if herbs_list:
lines: list[str] = []
for idx, item in enumerate(herbs_list, start=1):
name = str(first_value(item, "name", "drug_name", "medicine_name", default="")).strip()
dose = str(first_value(item, "dosage", "dose", "weight", default="")).strip()
unit = str(first_value(item, "unit", default="g")).strip() or "g"
if name:
lines.append(f"{idx:02d}. {name} {dose}{unit if dose else ''}")
self._live_rx_herbs.setText("\n".join(lines) if lines else "暂无有效药味")
days = self.usage_days.value() if hasattr(self, "usage_days") else 0
suffix = f" · 服用 {days} 天" if days else ""
self._live_rx_footer.setText(f"已配 {len(lines)} 味{suffix} · 实时同步")
else:
self._live_rx_herbs.setText("请在左侧录入药材配方,右侧实时同步处方笺排版…")
self._live_rx_footer.setText("共 0 味")
def toggle_live_preview(self) -> None:
"""一键展开或收起右侧实时仿真处方笺与 CA 双签进度轨。"""
if not hasattr(self, "live_preview_pane"):
return
showing = not self.live_preview_pane.isVisible()
self.live_preview_pane.setVisible(showing)
if showing:
self._refresh_live_preview()
if self.width() < 1180:
self.resize(1220, self.height())
def _void_busy_changed(self, busy: bool) -> None:
self.cancel_button.setEnabled(not busy)
@@ -3453,20 +3266,6 @@ class PrescriptionEditorDialog(QDialog):
mode.setObjectName("PrescriptionDrawerMode")
layout.addWidget(mode)
layout.addStretch(1)
self.live_preview_toggle = QPushButton("实时处方笺预览", header)
self.live_preview_toggle.setObjectName("PrescriptionLivePreviewToggle")
self.live_preview_toggle.setCheckable(True)
self.live_preview_toggle.setCursor(Qt.CursorShape.PointingHandCursor)
self.live_preview_toggle.setToolTip("展开或收起右侧实时仿真处方笺与 CA 双签进度轨")
self.live_preview_toggle.setStyleSheet(
"QPushButton#PrescriptionLivePreviewToggle {"
" min-height: 30px; max-height: 30px; padding: 0 11px; border-radius: 7px;"
" background: #F2F9F8; border: 1px solid #C2DBD7; color: #0B6E68; font-size: 12px; font-weight: 600; }"
"QPushButton#PrescriptionLivePreviewToggle:checked {"
" background: #0B6E68; border-color: #0B6E68; color: #FFFFFF; }"
)
self.live_preview_toggle.clicked.connect(self.toggle_live_preview)
layout.addWidget(self.live_preview_toggle, 0, Qt.AlignmentFlag.AlignVCenter)
close_button = QPushButton("×", header)
close_button.setObjectName("PrescriptionDrawerClose")
close_button.setToolTip("关闭")
@@ -5262,6 +5061,14 @@ def render_prescription_html(
bags = positive_number(source.get("dosage_bag_count"), 1)
if prescription_type == "浓缩水丸" and days and times and amount:
out_pellet = f"{number_text(days * times * amount * bags)}克"
# 有辅方药材时同时给出辅方出丸(辅方服用天数 × 每日次数 × 每袋用量 × 每次袋数),与管理后台一致。
aux_days = positive_number(aux_usage.get("usage_days"), 0)
aux_times = positive_number(aux_usage.get("times_per_day"), 0)
aux_amount = positive_number(aux_usage.get("dosage_amount"), 0)
aux_bags = positive_number(aux_usage.get("dosage_bag_count"), 1)
if aux and aux_days and aux_times and aux_amount:
aux_pellet = number_text(aux_days * aux_times * aux_amount * aux_bags)
out_pellet = f"主方 {out_pellet},辅方 {aux_pellet}克"
elif herbs:
total_weight = sum(_float(row.get("dosage")) for row in herbs) * dose_count
out_pellet = f"{number_text(total_weight)}克"
@@ -6153,17 +5960,11 @@ class PrescriptionDetailDialog(QDialog):
self.resize(1240, 800)
# 与「处方电子签署」一致:左侧三联预览,右侧签署流程与操作。
root = QVBoxLayout(self)
root.setContentsMargins(0, 0, 0, 0)
root.setSpacing(0)
root.addWidget(ClinicalAccentBar(self))
body_wrap = QWidget(self)
body_layout = QVBoxLayout(body_wrap)
body_layout.setContentsMargins(20, 16, 20, 20)
self.workspace_splitter = QSplitter(Qt.Orientation.Horizontal, body_wrap)
root.setContentsMargins(20, 20, 20, 20)
self.workspace_splitter = QSplitter(Qt.Orientation.Horizontal, self)
self.workspace_splitter.setChildrenCollapsible(False)
self.workspace_splitter.setHandleWidth(12)
body_layout.addWidget(self.workspace_splitter)
root.addWidget(body_wrap, 1)
root.addWidget(self.workspace_splitter)
preview_panel = QWidget(self.workspace_splitter)
preview_panel.setMinimumWidth(370)
@@ -48,15 +48,7 @@ from ...core.esign import (
signed_pdf_bytes,
)
from ..design_system import clinical_stylesheet
from ..widgets import (
MessageBanner,
first_value,
friendly_error,
has_permission,
run_async,
show_toast,
)
from ..window_primitives import ClinicalAccentBar
from ..widgets import MessageBanner, first_value, friendly_error, has_permission, run_async, show_toast
from .esign_doctor import EsignDoctorDialog
from .esign_webview import create_identity_view
@@ -412,17 +404,11 @@ class PrescriptionEsignDialog(QDialog):
from .prescription import PrescriptionSigningPreview
root = QVBoxLayout(self)
root.setContentsMargins(0, 0, 0, 0)
root.setSpacing(0)
root.addWidget(ClinicalAccentBar(self))
body_wrap = QWidget(self)
body_layout = QVBoxLayout(body_wrap)
body_layout.setContentsMargins(20, 16, 20, 20)
self.workspace_splitter = QSplitter(Qt.Orientation.Horizontal, body_wrap)
root.setContentsMargins(20, 20, 20, 20)
self.workspace_splitter = QSplitter(Qt.Orientation.Horizontal, self)
self.workspace_splitter.setChildrenCollapsible(False)
self.workspace_splitter.setHandleWidth(12)
body_layout.addWidget(self.workspace_splitter)
root.addWidget(body_wrap, 1)
root.addWidget(self.workspace_splitter)
self.prescription_preview = PrescriptionSigningPreview(self.repository, prescription, parent=self.workspace_splitter)
self.prescription_preview.setMinimumWidth(370)
@@ -1,192 +0,0 @@
"""W4 视频问诊双屏协同驾驶舱(演示预览与原生临床速记协同视窗)。"""
from __future__ import annotations
from PySide6.QtCore import Qt, QTimer
from PySide6.QtWidgets import (
QDialog,
QFrame,
QHBoxLayout,
QLabel,
QPlainTextEdit,
QPushButton,
QVBoxLayout,
QWidget,
)
from ..window_primitives import ClinicalAccentBar
class VideoCockpitDemoDialog(QDialog):
"""W4 视频问诊双屏协同驾驶舱:左深曜影院画布 + 底部毛玻璃控坞 + 右伴随四诊速记侧栏。"""
def __init__(self, patient_name: str, parent: QWidget | None = None) -> None:
super().__init__(parent)
self._seconds = 0
self._tongue_count = 0
self.setWindowTitle("视频面诊 · 双屏协同驾驶舱")
self.setMinimumSize(860, 560)
self.resize(1120, 700)
self.setModal(False)
self.setStyleSheet(
"QDialog{background:#071515;color:#EFF9F8;}"
"QFrame#VideoTopHud{background:rgba(12,38,37,220);border:1px solid rgba(223,199,147,90);border-radius:12px;}"
"QFrame#RemoteStage{background:qradialgradient(cx:0.5,cy:0.4,radius:0.8,fx:0.5,fy:0.4,stop:0 #153E3C,stop:0.65 #081A1A,stop:1 #040D0D);"
"border:1px solid rgba(223,199,147,60);border-radius:16px;}"
"QFrame#RemoteStage QLabel{color:#EFF9F8;}"
"QFrame#LocalStage{background:qlineargradient(x1:0,y1:0,x2:1,y2:1,stop:0 #184644,stop:1 #0B2524);"
"border:1.5px solid #DFC793;border-radius:12px;}"
"QFrame#VideoDock{background:rgba(9,28,28,235);border:1px solid rgba(223,199,147,110);border-radius:24px;}"
"QFrame#VideoCompanionRail{background:#F5FAF9;border-left:1px solid #C6DAD6;}"
"QFrame#VideoCompanionRail QLabel{color:#102625;}"
"QPlainTextEdit#VideoQuickNotes{background:#FFFFFF;border:1px solid #C4D8D4;border-radius:10px;padding:8px;color:#102625;font-size:13px;}"
"QPushButton{min-width:88px;min-height:36px;padding:0 14px;border-radius:18px;"
"background:rgba(255,255,255,22);color:#F0FAF9;border:1px solid rgba(255,255,255,48);font-weight:600;}"
"QPushButton:hover{background:rgba(24,176,165,70);border-color:#DFC793;color:#FFFFFF;}"
"QPushButton:checked{background:rgba(223,199,147,60);border-color:#DFC793;color:#DFC793;}"
"QPushButton#TongueBtn{background:rgba(223,199,147,48);border-color:#DFC793;color:#DFC793;}"
"QPushButton#Hangup{color:#FFFFFF;background:#D63F4F;border-color:#D63F4F;}"
"QPushButton#Hangup:hover{background:#B92E3D;border-color:#B92E3D;}"
)
root_col = QVBoxLayout(self)
root_col.setContentsMargins(0, 0, 0, 0)
root_col.setSpacing(0)
root_col.addWidget(ClinicalAccentBar(self))
outer = QHBoxLayout()
outer.setContentsMargins(0, 0, 0, 0)
outer.setSpacing(0)
left_wrap = QWidget(self)
left_layout = QVBoxLayout(left_wrap)
left_layout.setContentsMargins(16, 14, 16, 16)
left_layout.setSpacing(12)
top_hud = QFrame(left_wrap)
top_hud.setObjectName("VideoTopHud")
header = QHBoxLayout(top_hud)
header.setContentsMargins(14, 9, 14, 9)
title = QLabel(f"● 视频面诊 · {patient_name or '患者'}", top_hud)
title.setStyleSheet("font-size:15px;font-weight:700;color:#F4FAF9;")
header.addWidget(title)
header.addStretch(1)
demo = QLabel("本地加密录音就绪 · 演示模式", top_hud)
demo.setStyleSheet("color:#9FC5C1;font-size:12px;")
header.addWidget(demo)
self.duration_label = QLabel("00:00", top_hud)
self.duration_label.setStyleSheet("font-weight:700;color:#DFC793;padding-left:10px;")
header.addWidget(self.duration_label)
left_layout.addWidget(top_hud)
stage = QFrame(left_wrap)
stage.setObjectName("RemoteStage")
stage_layout = QVBoxLayout(stage)
stage_layout.setContentsMargins(22, 22, 22, 22)
stage_layout.addStretch(1)
avatar = QLabel((patient_name or "患")[:1], stage)
avatar.setAlignment(Qt.AlignmentFlag.AlignCenter)
avatar.setFixedSize(96, 96)
avatar.setStyleSheet(
"background:rgba(24,176,165,48);color:#FFFFFF;border:2px solid #DFC793;"
"border-radius:48px;font-size:38px;font-weight:700;"
)
stage_layout.addWidget(avatar, 0, Qt.AlignmentFlag.AlignHCenter)
waiting = QLabel("等待患者接入高清视频画面…", stage)
waiting.setAlignment(Qt.AlignmentFlag.AlignCenter)
waiting.setStyleSheet("font-size:16px;font-weight:600;margin-top:8px;")
stage_layout.addWidget(waiting)
hint = QLabel("生产模式通过后端短时 UserSig 驱动 TRTC,支持舌象高清抓拍与实时转写", stage)
hint.setAlignment(Qt.AlignmentFlag.AlignCenter)
hint.setStyleSheet("color:#91BDB8;font-size:12px;")
stage_layout.addWidget(hint)
self._tongue_status = QLabel("", stage)
self._tongue_status.setAlignment(Qt.AlignmentFlag.AlignCenter)
self._tongue_status.setStyleSheet("color:#DFC793;font-size:12px;font-weight:600;margin-top:6px;")
stage_layout.addWidget(self._tongue_status)
stage_layout.addStretch(1)
local = QFrame(stage)
local.setObjectName("LocalStage")
local.setGeometry(20, 20, 176, 108)
local_layout = QVBoxLayout(local)
local_label = QLabel("陈医生(本机画面)", local)
local_label.setAlignment(Qt.AlignmentFlag.AlignCenter)
local_label.setStyleSheet("color:#EFF9F8;font-weight:600;font-size:12px;")
local_layout.addWidget(local_label)
left_layout.addWidget(stage, 1)
dock = QFrame(left_wrap)
dock.setObjectName("VideoDock")
controls = QHBoxLayout(dock)
controls.setContentsMargins(14, 7, 14, 7)
controls.setSpacing(10)
self.mic_button = QPushButton("麦克风 开", dock)
self.mic_button.setCheckable(True)
self.mic_button.toggled.connect(
lambda muted: self.mic_button.setText("麦克风 关" if muted else "麦克风 开")
)
controls.addWidget(self.mic_button)
self.camera_button = QPushButton("摄像头 开", dock)
self.camera_button.setCheckable(True)
self.camera_button.toggled.connect(
lambda off: self.camera_button.setText("摄像头 关" if off else "摄像头 开")
)
controls.addWidget(self.camera_button)
tongue_btn = QPushButton("舌象高清抓拍", dock)
tongue_btn.setObjectName("TongueBtn")
tongue_btn.clicked.connect(self._capture_demo_tongue)
controls.addWidget(tongue_btn)
hangup = QPushButton("结束面诊", dock)
hangup.setObjectName("Hangup")
hangup.clicked.connect(self.close)
controls.addWidget(hangup)
left_layout.addWidget(dock, 0, Qt.AlignmentFlag.AlignHCenter)
outer.addWidget(left_wrap, 1)
rail = QFrame(self)
rail.setObjectName("VideoCompanionRail")
rail.setFixedWidth(340)
rail_layout = QVBoxLayout(rail)
rail_layout.setContentsMargins(16, 16, 16, 16)
rail_layout.setSpacing(10)
rail_title = QLabel("伴随四诊速记(双屏协同)", rail)
rail_title.setStyleSheet("font-size:15px;font-weight:700;color:#102625;")
rail_layout.addWidget(rail_title)
rail_hint = QLabel("面诊过程中实时记录主诉与舌脉,结束后自动带入病历草稿。", rail)
rail_hint.setWordWrap(True)
rail_hint.setStyleSheet("font-size:12px;color:#5F7A78;")
rail_layout.addWidget(rail_hint)
self.quick_notes = QPlainTextEdit(rail)
self.quick_notes.setObjectName("VideoQuickNotes")
self.quick_notes.setPlaceholderText("在此速记本次视频面诊的主诉、舌质舌苔、脉象与调方思路…")
rail_layout.addWidget(self.quick_notes, 1)
ai_hint_box = QFrame(rail)
ai_hint_box.setStyleSheet(
"QFrame{background:#EAF6F4;border:1px solid #B7DDD6;border-radius:10px;padding:8px;}"
)
ai_hint_l = QVBoxLayout(ai_hint_box)
ai_hint_l.setContentsMargins(10, 8, 10, 8)
ai_lbl = QLabel("AI 问诊提醒:建议核实近期夜间睡眠与餐后 2h 血糖峰值。", ai_hint_box)
ai_lbl.setWordWrap(True)
ai_lbl.setStyleSheet("color:#0B6E68;font-size:12px;font-weight:500;")
ai_hint_l.addWidget(ai_lbl)
rail_layout.addWidget(ai_hint_box)
outer.addWidget(rail)
root_col.addLayout(outer, 1)
self._timer = QTimer(self)
self._timer.timeout.connect(self._tick)
self._timer.start(1000)
def _capture_demo_tongue(self) -> None:
self._tongue_count += 1
self._tongue_status.setText(f"✓ 已抓拍第 {self._tongue_count} 帧高清舌象并准备归档")
def _tick(self) -> None:
self._seconds += 1
minutes, seconds = divmod(self._seconds, 60)
self.duration_label.setText(f"{minutes:02d}:{seconds:02d}")
__all__ = ["VideoCockpitDemoDialog"]
+33 -94
View File
@@ -69,7 +69,6 @@ ROLES = {
"strong": COLORS["text"],
"accent": COLORS["indigo"],
"on_accent": "#FFFFFF",
"gold": COLORS["gold"],
"success": COLORS["success"],
"warning": COLORS["warning"],
"danger": COLORS["danger"],
@@ -125,41 +124,8 @@ def _dot(p: QPainter, cx: float, cy: float, r: float) -> None:
p.setPen(pen)
def _tint_brush(p: QPainter, alpha: int = 38) -> QColor:
"""Return a translucent duotone fill derived from the active stroke colour."""
tint = QColor(p.pen().color())
tint.setAlpha(alpha)
return tint
def _duotone_path(p: QPainter, path: QPainterPath, alpha: int = 38) -> None:
"""Draw a closed path with a subtle duotone tint fill beneath its crisp stroke."""
p.save()
p.setBrush(_tint_brush(p, alpha))
p.drawPath(path)
p.restore()
def _duotone_rounded_rect(
p: QPainter, rect: QRectF, rx: float, ry: float, alpha: int = 38
) -> None:
p.save()
p.setBrush(_tint_brush(p, alpha))
p.drawRoundedRect(rect, rx, ry)
p.restore()
def _duotone_circle(p: QPainter, cx: float, cy: float, r: float, alpha: int = 38) -> None:
p.save()
p.setBrush(_tint_brush(p, alpha))
p.drawEllipse(QPointF(cx, cy), r, r)
p.restore()
def _page(p: QPainter, *, fold: bool = True) -> None:
"""Shared document silhouette with subtle duotone glass tint."""
"""Shared document silhouette so every file-like glyph has one outline."""
path = QPainterPath(QPointF(14.0, 2.5))
path.lineTo(QPointF(6.5, 2.5))
@@ -170,13 +136,13 @@ def _page(p: QPainter, *, fold: bool = True) -> None:
path.quadTo(QPointF(19.0, 21.5), QPointF(19.0, 20.0))
path.lineTo(QPointF(19.0, 7.5))
path.closeSubpath()
_duotone_path(p, path, 34)
p.drawPath(path)
if fold:
_polyline(p, (14.0, 2.5), (14.0, 7.5), (19.0, 7.5))
def _sparkle(p: QPainter, cx: float, cy: float, r: float, *, alpha: int = 56) -> None:
"""Four-point concave star - the precision AI mark with luminous duotone core."""
def _sparkle(p: QPainter, cx: float, cy: float, r: float) -> None:
"""Four-point concave star - the one AI mark used across the product."""
path = QPainterPath(QPointF(cx, cy - r))
path.quadTo(QPointF(cx, cy), QPointF(cx + r, cy))
@@ -184,11 +150,11 @@ def _sparkle(p: QPainter, cx: float, cy: float, r: float, *, alpha: int = 56) ->
path.quadTo(QPointF(cx, cy), QPointF(cx - r, cy))
path.quadTo(QPointF(cx, cy), QPointF(cx, cy - r))
path.closeSubpath()
_duotone_path(p, path, alpha)
p.drawPath(path)
def _panel(p: QPainter) -> None:
_duotone_rounded_rect(p, QRectF(2.5, 4.0, 19.0, 16.0), 3.0, 3.0, 28)
p.drawRoundedRect(QRectF(2.5, 4.0, 19.0, 16.0), 3.0, 3.0)
_line(p, 9.5, 4.0, 9.5, 20.0)
@@ -197,20 +163,18 @@ def _panel(p: QPainter) -> None:
@_glyph("reception", "workbench", "monitor")
def _reception(p: QPainter, w: float) -> None:
_duotone_rounded_rect(p, QRectF(2.5, 3.5, 19.0, 13.5), 3.2, 3.2, 38)
_polyline(p, (5.8, 10.5), (8.6, 10.5), (10.5, 7.2), (13.4, 13.6), (15.3, 10.5), (18.2, 10.5))
p.drawRoundedRect(QRectF(2.5, 3.5, 19.0, 13.5), 3.0, 3.0)
_polyline(p, (6.0, 10.5), (8.8, 10.5), (10.6, 7.5), (13.4, 13.5), (15.2, 10.5), (18.0, 10.5))
_line(p, 12.0, 17.0, 12.0, 20.5)
_line(p, 8.0, 20.5, 16.0, 20.5)
@_glyph("appointments", "calendar")
def _calendar(p: QPainter, w: float) -> None:
_duotone_rounded_rect(p, QRectF(3.0, 5.0, 18.0, 16.5), 3.2, 3.2, 36)
p.drawRoundedRect(QRectF(3.0, 5.0, 18.0, 16.5), 3.0, 3.0)
_line(p, 3.0, 10.0, 21.0, 10.0)
_line(p, 8.0, 2.75, 8.0, 6.8)
_line(p, 16.0, 2.75, 16.0, 6.8)
_line(p, 7.5, 14.0, 11.5, 14.0)
_line(p, 7.5, 17.4, 15.0, 17.4)
_line(p, 8.0, 2.75, 8.0, 7.0)
_line(p, 16.0, 2.75, 16.0, 7.0)
@_glyph("prescription_library", "library", "layers")
@@ -220,7 +184,7 @@ def _layers(p: QPainter, w: float) -> None:
path.lineTo(QPointF(12.0, 11.5))
path.lineTo(QPointF(3.0, 7.0))
path.closeSubpath()
_duotone_path(p, path, 48)
p.drawPath(path)
_polyline(p, (3.0, 12.0), (12.0, 16.5), (21.0, 12.0))
_polyline(p, (3.0, 16.75), (12.0, 21.25), (21.0, 16.75))
@@ -233,12 +197,12 @@ def _file_check(p: QPainter, w: float) -> None:
@_glyph("patients", "users")
def _users(p: QPainter, w: float) -> None:
_duotone_circle(p, 9.0, 8.0, 3.5, 42)
_circle(p, 9.0, 8.0, 3.5)
path = QPainterPath(QPointF(2.5, 20.5))
path.quadTo(QPointF(2.5, 14.5), QPointF(9.0, 14.5))
path.quadTo(QPointF(15.5, 14.5), QPointF(15.5, 20.5))
p.drawPath(path)
_duotone_circle(p, 17.6, 8.0, 2.8, 28)
_circle(p, 17.6, 8.0, 2.8)
tail = QPainterPath(QPointF(17.0, 13.9))
tail.quadTo(QPointF(21.5, 14.6), QPointF(21.5, 20.5))
p.drawPath(tail)
@@ -257,7 +221,7 @@ def _message(p: QPainter, w: float) -> None:
path.quadTo(QPointF(3.5, 16.5), QPointF(3.5, 13.5))
path.lineTo(QPointF(3.5, 6.5))
path.quadTo(QPointF(3.5, 3.5), QPointF(6.5, 3.5))
_duotone_path(p, path, 38)
p.drawPath(path)
_line(p, 7.75, 8.25, 16.25, 8.25)
_line(p, 7.75, 11.75, 13.0, 11.75)
@@ -311,23 +275,10 @@ def _ai(p: QPainter, w: float) -> None:
@_glyph("fullscreen", "expand-corners", "maximize")
def _fullscreen(p: QPainter, w: float) -> None:
# 标准现代桌面端圆角单窗最大化图标,取代生硬的四角取景框
p.drawRoundedRect(QRectF(4.5, 4.5, 15.0, 15.0), 2.8, 2.8)
@_glyph("restore", "unmaximize")
def _restore(p: QPainter, w: float) -> None:
# 标准现代桌面端双窗还原图标
p.drawRoundedRect(QRectF(4.25, 7.25, 12.25, 12.25), 2.4, 2.4)
back = QPainterPath(QPointF(7.75, 7.25))
back.lineTo(QPointF(7.75, 6.2))
back.quadTo(QPointF(7.75, 4.25), QPointF(9.7, 4.25))
back.lineTo(QPointF(17.8, 4.25))
back.quadTo(QPointF(19.75, 4.25), QPointF(19.75, 6.2))
back.lineTo(QPointF(19.75, 14.3))
back.quadTo(QPointF(19.75, 16.25), QPointF(17.8, 16.25))
back.lineTo(QPointF(16.5, 16.25))
p.drawPath(back)
_polyline(p, (9.0, 3.5), (3.5, 3.5), (3.5, 9.0))
_polyline(p, (15.0, 3.5), (20.5, 3.5), (20.5, 9.0))
_polyline(p, (3.5, 15.0), (3.5, 20.5), (9.0, 20.5))
_polyline(p, (20.5, 15.0), (20.5, 20.5), (15.0, 20.5))
@_glyph("minimize")
@@ -367,27 +318,17 @@ def _bell(p: QPainter, w: float) -> None:
path.lineTo(QPointF(6.75, 10.75))
path.arcTo(QRectF(6.75, 5.0, 10.5, 11.5), 180.0, -180.0)
path.lineTo(QPointF(17.25, 17.5))
path.closeSubpath()
_duotone_path(p, path, 36)
p.drawPath(path)
_line(p, 4.5, 17.5, 19.5, 17.5)
p.drawArc(QRectF(10.0, 17.4, 4.0, 3.6), 180 * 16, 180 * 16)
@_glyph("settings", "sliders")
def _settings(p: QPainter, w: float) -> None:
# 精密八齿圆润齿轮 + 双色调内核,替代锯齿硬编码多边形与简陋滑块
_duotone_circle(p, 12.0, 12.0, 5.4, 34)
_circle(p, 12.0, 12.0, 2.35)
for step in range(8):
angle = step * math.pi / 4.0
cos_a, sin_a = math.cos(angle), math.sin(angle)
_line(
p,
12.0 + 5.7 * cos_a,
12.0 + 5.7 * sin_a,
12.0 + 8.6 * cos_a,
12.0 + 8.6 * sin_a,
)
_line(p, 3.5, 8.5, 20.5, 8.5)
_line(p, 3.5, 15.5, 20.5, 15.5)
_circle(p, 9.0, 8.5, 2.4)
_circle(p, 15.0, 15.5, 2.4)
# --- Row and toolbar actions ---------------------------------------------
@@ -398,8 +339,8 @@ def _eye(p: QPainter, w: float) -> None:
path = QPainterPath(QPointF(2.5, 12.0))
path.quadTo(QPointF(12.0, 2.5), QPointF(21.5, 12.0))
path.quadTo(QPointF(12.0, 21.5), QPointF(2.5, 12.0))
_duotone_path(p, path, 28)
_duotone_circle(p, 12.0, 12.0, 3.0, 48)
p.drawPath(path)
_circle(p, 12.0, 12.0, 3.0)
@_glyph("pencil", "edit")
@@ -628,13 +569,13 @@ def _qr(p: QPainter, w: float) -> None:
@_glyph("video", "call")
def _video(p: QPainter, w: float) -> None:
_duotone_rounded_rect(p, QRectF(2.5, 6.0, 13.5, 12.0), 3.0, 3.0, 38)
p.drawRoundedRect(QRectF(2.5, 6.0, 13.5, 12.0), 3.0, 3.0)
path = QPainterPath(QPointF(16.0, 10.5))
path.lineTo(QPointF(21.5, 7.25))
path.lineTo(QPointF(21.5, 16.75))
path.lineTo(QPointF(16.0, 13.5))
path.closeSubpath()
_duotone_path(p, path, 32)
p.drawPath(path)
# --- Clinical measures ----------------------------------------------------
@@ -655,14 +596,14 @@ def _height(p: QPainter, w: float) -> None:
@_glyph("weight", "scale")
def _weight(p: QPainter, w: float) -> None:
_duotone_rounded_rect(p, QRectF(3.0, 5.0, 18.0, 14.5), 3.5, 3.5, 34)
p.drawRoundedRect(QRectF(3.0, 5.0, 18.0, 14.5), 3.5, 3.5)
p.drawArc(QRectF(7.0, 10.0, 10.0, 10.0), 25 * 16, 130 * 16)
_line(p, 12.0, 15.0, 9.9, 10.9)
@_glyph("bmi", "body")
def _bmi(p: QPainter, w: float) -> None:
_duotone_circle(p, 12.0, 5.0, 2.75, 42)
_circle(p, 12.0, 5.0, 2.75)
_line(p, 12.0, 7.75, 12.0, 15.0)
_line(p, 7.25, 11.0, 16.75, 11.0)
_polyline(p, (8.5, 20.75), (12.0, 15.0), (15.5, 20.75))
@@ -670,10 +611,8 @@ def _bmi(p: QPainter, w: float) -> None:
@_glyph("blood_pressure", "gauge", "bp")
def _blood_pressure(p: QPainter, w: float) -> None:
arc_path = QPainterPath(QPointF(3.0, 14.5))
arc_path.arcTo(QRectF(3.0, 5.5, 18.0, 18.0), 180, -180)
arc_path.closeSubpath()
_duotone_path(p, arc_path, 34)
p.drawArc(QRectF(3.0, 5.5, 18.0, 18.0), 0, 180 * 16)
_line(p, 3.0, 14.5, 21.0, 14.5)
_line(p, 12.0, 14.5, 16.4, 9.4)
_dot(p, 12.0, 14.5, 1.15)
@@ -686,7 +625,7 @@ def _pulse(p: QPainter, w: float) -> None:
heart.cubicTo(QPointF(13.5, 4.8), QPointF(16.8, 4.0), QPointF(19.3, 6.7))
heart.cubicTo(QPointF(21.8, 9.6), QPointF(20.8, 13.6), QPointF(12.0, 20.25))
heart.closeSubpath()
_duotone_path(p, heart, 36)
p.drawPath(heart)
_polyline(
p, (5.6, 12.4), (9.0, 12.4), (10.6, 9.7), (13.2, 15.1), (14.7, 12.4), (18.4, 12.4)
)
@@ -1,148 +0,0 @@
"""桌面端全局精工交互引擎:统一手型光标、Windows 11 DWM 视窗融合与优雅按压手感."""
from __future__ import annotations
import ctypes
import sys
from PySide6.QtCore import QEvent, QObject, Qt
from PySide6.QtWidgets import (
QAbstractButton,
QApplication,
QComboBox,
QDialog,
QFileDialog,
QInputDialog,
QMessageBox,
QTabBar,
QWidget,
)
from .design_system import PALETTE
# Windows 11 DWM 窗口装饰属性常量
_DWMWA_USE_IMMERSIVE_DARK_MODE = 20
_DWMWA_WINDOW_CORNER_PREFERENCE = 33
_DWMWA_BORDER_COLOR = 34
_DWMWA_CAPTION_COLOR = 35
_DWMWA_TEXT_COLOR = 36
_DWMWCP_ROUND = 2
def _colorref(hex_color: str) -> int:
"""将 ``#RRGGBB`` 转为 Win32 DWM 所需的 ``0x00BBGGRR`` 整型。"""
clean = hex_color.lstrip("#")
red, green, blue = (int(clean[i : i + 2], 16) for i in (0, 2, 4))
return (blue << 16) | (green << 8) | red
def apply_luxury_dwm_chrome(widget: QWidget, *, dark: bool = False) -> bool:
"""在 Windows 11 上同步原生子视窗标题栏、圆角偏好与边框至「御瓷智医」色系。"""
if sys.platform != "win32":
return False
if widget.windowFlags() & Qt.WindowType.FramelessWindowHint:
return False
try:
handle = int(widget.winId())
except Exception:
return False
if not handle:
return False
try:
dwm = ctypes.windll.dwmapi
except (AttributeError, OSError):
return False
caption_hex = PALETTE["obsidian"] if dark else PALETTE["surface"]
text_hex = "#F2FAF9" if dark else PALETTE["heading"]
border_hex = PALETTE["gold"] if dark else PALETTE["line_strong"]
dark_val = ctypes.c_int(1 if dark else 0)
corner_val = ctypes.c_int(_DWMWCP_ROUND)
caption_val = ctypes.c_uint(_colorref(caption_hex))
text_val = ctypes.c_uint(_colorref(text_hex))
border_val = ctypes.c_uint(_colorref(border_hex))
applied = False
for attr, value in (
(_DWMWA_USE_IMMERSIVE_DARK_MODE, dark_val),
(_DWMWA_WINDOW_CORNER_PREFERENCE, corner_val),
(_DWMWA_CAPTION_COLOR, caption_val),
(_DWMWA_TEXT_COLOR, text_val),
(_DWMWA_BORDER_COLOR, border_val),
):
try:
res = dwm.DwmSetWindowAttribute(
ctypes.c_void_p(handle),
ctypes.c_int(attr),
ctypes.byref(value),
ctypes.sizeof(value),
)
applied = applied or res == 0
except OSError:
continue
return applied
class _TactileInteractionFilter(QObject):
"""全局轻量事件过滤器:自动补齐手型光标与子视窗 DWM 高定视觉融合。"""
_INTERACTIVE_TYPES = (QAbstractButton, QTabBar, QComboBox)
_WATCHED_EVENTS = frozenset({QEvent.Type.Polish, QEvent.Type.EnabledChange, QEvent.Type.Show})
def eventFilter(self, watched: QObject, event: QEvent) -> bool: # noqa: N802
try:
event_type = event.type()
except RuntimeError:
return False
if event_type not in self._WATCHED_EVENTS:
return False
if isinstance(watched, self._INTERACTIVE_TYPES):
if event_type in (QEvent.Type.Polish, QEvent.Type.EnabledChange):
if watched.isEnabled():
if watched.cursor().shape() == Qt.CursorShape.ArrowCursor:
watched.setCursor(Qt.CursorShape.PointingHandCursor)
else:
if watched.cursor().shape() == Qt.CursorShape.PointingHandCursor:
watched.setCursor(Qt.CursorShape.ArrowCursor)
return False
if (
event_type is QEvent.Type.Show
and isinstance(watched, QDialog)
and not isinstance(watched, (QFileDialog, QMessageBox, QInputDialog))
and not watched.testAttribute(Qt.WidgetAttribute.WA_TranslucentBackground)
):
name = watched.objectName() or ""
is_dark = any(tag in name for tag in ("Video", "IssuedPrescriptionAi", "AiConsult"))
apply_luxury_dwm_chrome(watched, dark=is_dark)
# W8 原语 B:自动为所有标准业务弹窗顶部注入 3px 翡翠-鎏金饰线(避免重复插入)
if (
not (watched.windowFlags() & Qt.WindowType.FramelessWindowHint)
and not getattr(watched, "_doctor_accent_bar_injected", False)
):
from PySide6.QtWidgets import QVBoxLayout
from .window_primitives import ClinicalAccentBar
layout = watched.layout()
if isinstance(layout, QVBoxLayout) and not watched.findChildren(ClinicalAccentBar):
watched._doctor_accent_bar_injected = True # type: ignore[attr-defined]
layout.insertWidget(0, ClinicalAccentBar(watched))
return False
def install_tactile_interactions(app: QApplication) -> None:
"""幂等安装全局精工交互过滤器。"""
if getattr(app, "_doctor_tactile_interaction_filter", None) is not None:
return
flt = _TactileInteractionFilter(app)
app.installEventFilter(flt)
app._doctor_tactile_interaction_filter = flt
__all__ = ["apply_luxury_dwm_chrome", "install_tactile_interactions"]
+52 -284
View File
@@ -5,18 +5,15 @@ from __future__ import annotations
from contextlib import suppress
from typing import Any
from PySide6.QtCore import QEvent, QPoint, QPointF, QRectF, QSettings, QSize, Qt, QTimer, Signal
from PySide6.QtCore import QEvent, QPoint, QPointF, QRectF, QSettings, Qt, QTimer, Signal
from PySide6.QtGui import (
QColor,
QFont,
QIcon,
QLinearGradient,
QMouseEvent,
QPainter,
QPainterPath,
QPen,
QPixmap,
QRadialGradient,
QResizeEvent,
)
from PySide6.QtWidgets import (
@@ -126,7 +123,7 @@ def _round_pen(color: QColor | str, width: float) -> QPen:
class _BrandPanel(QWidget):
"""御瓷智医 · 深曜翡翠科技医疗奢雅品牌沉浸区."""
"""A flat, readable introduction to the clinician's daily workflow."""
def __init__(self, parent: QWidget | None = None) -> None:
super().__init__(parent)
@@ -141,237 +138,60 @@ class _BrandPanel(QWidget):
painter = QPainter(self)
painter.setRenderHint(QPainter.RenderHint.Antialiasing)
bounds = QRectF(self.rect()).adjusted(1, 1, -1, -1)
clip = QPainterPath()
clip.addRoundedRect(bounds, 20, 20)
painter.setClipPath(clip)
# 深曜翡翠渐变底 + 右上角精密青玉科技辉光
bg = QLinearGradient(bounds.topLeft(), bounds.bottomRight())
bg.setColorAt(0.0, QColor("#0E3F3C"))
bg.setColorAt(0.52, QColor("#092726"))
bg.setColorAt(1.0, QColor("#061717"))
painter.setPen(Qt.PenStyle.NoPen)
painter.setBrush(bg)
painter.drawRect(bounds)
glow = QRadialGradient(
QPointF(bounds.right() - 70.0, bounds.top() + 90.0),
max(280.0, bounds.width() * 0.55),
)
glow.setColorAt(0.0, QColor(24, 184, 173, 74))
glow.setColorAt(0.55, QColor(14, 120, 114, 24))
glow.setColorAt(1.0, QColor(14, 120, 114, 0))
painter.setBrush(glow)
painter.drawRect(bounds)
# 精密医疗科技同心轨道 + 微光心电脉搏线
ring_center = QPointF(bounds.right() - 48.0, bounds.top() + 86.0)
painter.setBrush(Qt.BrushStyle.NoBrush)
painter.setPen(QPen(QColor(223, 199, 147, 36), 1.0))
painter.drawEllipse(ring_center, 155.0, 155.0)
dash_pen = QPen(QColor(110, 224, 214, 34), 1.0, Qt.PenStyle.DashLine)
painter.setPen(dash_pen)
painter.drawEllipse(ring_center, 230.0, 230.0)
pulse_y = bounds.bottom() - 96.0
pulse = QPainterPath(QPointF(bounds.left(), pulse_y))
pulse.lineTo(QPointF(bounds.left() + bounds.width() * 0.36, pulse_y))
pulse.lineTo(QPointF(bounds.left() + bounds.width() * 0.43, pulse_y - 38.0))
pulse.lineTo(QPointF(bounds.left() + bounds.width() * 0.50, pulse_y + 30.0))
pulse.lineTo(QPointF(bounds.left() + bounds.width() * 0.56, pulse_y - 16.0))
pulse.lineTo(QPointF(bounds.left() + bounds.width() * 0.61, pulse_y))
pulse.lineTo(QPointF(bounds.right(), pulse_y))
painter.setPen(QPen(QColor(110, 224, 214, 40), 1.4))
painter.drawPath(pulse)
# 顶部 1px 香槟鎏金奢雅边框
painter.setPen(QPen(QColor(223, 199, 147, 72), 1.0))
painter.setBrush(QColor(PALETTE["sidebar"]))
painter.drawRoundedRect(bounds, 20, 20)
left = 36.0
width = max(240.0, self.width() - 72.0)
if not self._brand_lockup.isNull():
brand = self._brand_lockup.scaled(
226, 58, Qt.AspectRatioMode.KeepAspectRatio,
Qt.TransformationMode.SmoothTransformation,
)
painter.drawPixmap(QPointF(left, 36), brand)
else:
painter.setFont(_font(22, QFont.Weight.DemiBold))
painter.setPen(QColor(PALETTE["heading"]))
painter.drawText(QPointF(left, 70), "甄养堂 · 医生工作站")
left = 40.0
width = max(240.0, self.width() - 80.0)
# 甄养堂高定翡翠鎏金徽标 + 精致反白品牌锁标
emblem = QRectF(left, 36.0, 44.0, 44.0)
em_grad = QLinearGradient(emblem.topLeft(), emblem.bottomRight())
em_grad.setColorAt(0.0, QColor("#18B0A5"))
em_grad.setColorAt(1.0, QColor("#09615C"))
painter.setBrush(em_grad)
painter.setPen(QPen(QColor(PALETTE["gold_light"]), 1.2))
painter.drawRoundedRect(emblem, 12.0, 12.0)
painter.save()
painter.translate(emblem.topLeft())
painter.scale(44.0 / 38.0, 44.0 / 38.0)
drop = QPainterPath(QPointF(19.0, 7.6))
drop.cubicTo(QPointF(14.8, 13.2), QPointF(11.2, 17.8), QPointF(11.2, 22.4))
drop.cubicTo(QPointF(11.2, 26.8), QPointF(14.7, 30.4), QPointF(19.0, 30.4))
drop.cubicTo(QPointF(23.3, 30.4), QPointF(26.8, 26.8), QPointF(26.8, 22.4))
drop.cubicTo(QPointF(26.8, 17.8), QPointF(23.2, 13.2), QPointF(19.0, 7.6))
drop.closeSubpath()
painter.setPen(Qt.PenStyle.NoPen)
painter.setBrush(QColor("#FFFFFF"))
painter.drawPath(drop)
mini_pulse = QPainterPath(QPointF(13.5, 22.4))
mini_pulse.lineTo(QPointF(16.2, 22.4))
mini_pulse.lineTo(QPointF(17.8, 18.8))
mini_pulse.lineTo(QPointF(20.0, 25.6))
mini_pulse.lineTo(QPointF(21.6, 22.4))
mini_pulse.lineTo(QPointF(24.5, 22.4))
painter.setBrush(Qt.BrushStyle.NoBrush)
painter.setPen(_round_pen("#0B6E68", 2.0))
painter.drawPath(mini_pulse)
painter.restore()
painter.setFont(_font(20, QFont.Weight.DemiBold))
painter.setPen(QColor("#FFFFFF"))
painter.drawText(QPointF(left + 58.0, 56.0), "甄养堂")
painter.setFont(_font(11, QFont.Weight.Medium))
painter.setPen(QColor(PALETTE["gold_light"]))
painter.drawText(QPointF(left + 58.0, 74.0), "DIABETES TELEHEALTH · 糖尿病专科工作站")
heading_y = max(162.0, min(214.0, self.height() * 0.27))
painter.setPen(QColor("#7CE4DB"))
painter.setFont(_font(12, QFont.Weight.Medium))
painter.drawText(QPointF(left, heading_y - 34), "PRECISION CLINICAL WORKSTATION")
painter.setPen(QColor("#FFFFFF"))
painter.setFont(_font(31, QFont.Weight.DemiBold))
painter.drawText(QPointF(left, heading_y), "让每一次辨证,")
painter.drawText(QPointF(left, heading_y + 44), "更专注、更有序。")
heading_y = max(158.0, min(218.0, self.height() * .27))
painter.setPen(QColor(PALETTE["muted"]))
painter.setFont(_font(13, QFont.Weight.Medium))
painter.drawText(QPointF(left, heading_y - 36), "医 生 工 作 台")
painter.setPen(QColor(PALETTE["heading"]))
painter.setFont(_font(30, QFont.Weight.DemiBold))
painter.drawText(QPointF(left, heading_y), "让诊疗有序,")
painter.drawText(QPointF(left, heading_y + 44), "让沟通更专注。")
painter.setFont(_font(14))
painter.setPen(QColor("#A4C9C5"))
painter.drawText(QPointF(left, heading_y + 82), "融合智能辨证、纵向血糖洞察与合规双签的一体化医疗桌面。")
painter.setPen(QColor(PALETTE["muted"]))
painter.drawText(QPointF(left, heading_y + 82), "从接诊、病历到处方,在一个工作台完成。")
row_y = heading_y + 122
for index, (title, detail) in enumerate((
("今日接诊 · 三栏直览", "待诊队列、四诊病历与视频房间同屏高效衔接"),
("AI 临床辨证辅助", "多模态聚合历次复诊与血糖波动,梳理随访要点"),
("处方协作 · CA 合规双签", "经验方一键复用,开方与药师审核签署全流程留痕"),
("今日接诊", "快速找到待接诊患者与预约安排"),
("诊疗记录", "病历、随访与面诊资料集中查看"),
("处方协作", "开方与审核流程清晰衔接"),
), start=1):
row = QRectF(left, row_y, width, 66)
painter.setPen(QPen(QColor(223, 199, 147, 52), 1.0))
painter.setBrush(QColor(255, 255, 255, 16))
painter.setPen(Qt.PenStyle.NoPen)
painter.setBrush(QColor(PALETTE["surface"]))
painter.drawRoundedRect(row, 12, 12)
badge_rect = QRectF(left + 14, row_y + 17, 32, 32)
painter.setPen(QPen(QColor(223, 199, 147, 96), 1.0))
painter.setBrush(QColor(223, 199, 147, 24))
painter.drawRoundedRect(badge_rect, 8, 8)
painter.setFont(_font(12, QFont.Weight.DemiBold))
painter.setPen(QColor(PALETTE["gold_light"]))
painter.drawText(badge_rect, Qt.AlignmentFlag.AlignCenter, f"0{index}")
painter.setFont(_font(13, QFont.Weight.DemiBold))
painter.setPen(QColor(PALETTE["accent"]))
painter.drawText(QRectF(left + 16, row_y, 28, 66), Qt.AlignmentFlag.AlignCenter, f"0{index}")
painter.setFont(_font(15, QFont.Weight.Medium))
painter.setPen(QColor("#F4FAF9"))
painter.drawText(QPointF(left + 60, row_y + 28), title)
painter.setPen(QColor(PALETTE["heading"]))
painter.drawText(QPointF(left + 58, row_y + 27), title)
painter.setFont(_font(12))
painter.setPen(QColor("#9AC0BC"))
painter.drawText(QPointF(left + 60, row_y + 49), detail)
painter.setPen(QColor(PALETTE["muted"]))
painter.drawText(QPointF(left + 58, row_y + 47), detail)
row_y += 78
if self.height() > row_y + 48:
if self.height() > row_y + 50:
painter.setFont(_font(12))
painter.setPen(QColor("#749E99"))
painter.drawText(QPointF(left, self.height() - 28), "仅供获授权的执业医疗人员使用 · 端到端加密传输")
painter.setPen(QColor(PALETTE["muted"]))
painter.drawText(QPointF(left, self.height() - 28), "仅供获授权的医疗人员使用")
painter.end()
def mousePressEvent(self, event: QMouseEvent) -> None: # noqa: N802 - Qt API
if event.button() == Qt.MouseButton.LeftButton:
handle = self.window().windowHandle()
if handle is not None and handle.startSystemMove():
event.accept()
return
super().mousePressEvent(event)
class _LoginWindowControlButton(QToolButton):
"""登录悬浮窗右上角原生桌面最小化/关闭按钮。"""
def __init__(self, kind: str, parent: QWidget | None = None) -> None:
super().__init__(parent)
self._kind = kind
self.setObjectName("LoginWindowControl")
self.setProperty("windowControl", kind)
self.setCursor(Qt.CursorShape.PointingHandCursor)
self.setAutoRaise(True)
self.setFixedSize(34, 34)
self.setIcon(icons.icon(kind, "muted", 16))
self.setIconSize(QSize(16, 16))
def enterEvent(self, event: Any) -> None: # noqa: N802 - Qt API
if self._kind == "close":
self.setIcon(icons.icon("close", "inverse", 16))
else:
self.setIcon(icons.icon(self._kind, "heading", 16))
super().enterEvent(event)
def leaveEvent(self, event: Any) -> None: # noqa: N802 - Qt API
self.setIcon(icons.icon(self._kind, "muted", 16))
super().leaveEvent(event)
class _LoginWindowShell(QWidget):
"""无边框奢雅青瓷圆角悬浮视窗,支持原生拖动与边缘缩放。"""
_RESIZE_MARGIN = 8
def __init__(self, parent: QWidget | None = None) -> None:
super().__init__(parent)
self.setMouseTracking(True)
def paintEvent(self, event: Any) -> None: # noqa: N802 - Qt API
del event
painter = QPainter(self)
painter.setRenderHint(QPainter.RenderHint.Antialiasing, True)
bounds = QRectF(self.rect()).adjusted(0.5, 0.5, -0.5, -0.5)
painter.setBrush(QColor(PALETTE["canvas"]))
painter.setPen(QPen(QColor("#B5CAC6"), 1.0))
painter.drawRoundedRect(bounds, 18.0, 18.0)
painter.end()
def _resize_edges(self, position: QPointF) -> Qt.Edge:
edges = Qt.Edge(0)
if position.x() <= self._RESIZE_MARGIN:
edges |= Qt.Edge.LeftEdge
elif position.x() >= self.width() - self._RESIZE_MARGIN:
edges |= Qt.Edge.RightEdge
if position.y() <= self._RESIZE_MARGIN:
edges |= Qt.Edge.TopEdge
elif position.y() >= self.height() - self._RESIZE_MARGIN:
edges |= Qt.Edge.BottomEdge
return edges
def mouseMoveEvent(self, event: QMouseEvent) -> None: # noqa: N802 - Qt API
edges = self._resize_edges(event.position())
if edges in (
Qt.Edge.LeftEdge | Qt.Edge.TopEdge,
Qt.Edge.RightEdge | Qt.Edge.BottomEdge,
):
self.setCursor(Qt.CursorShape.SizeFDiagCursor)
elif edges in (
Qt.Edge.LeftEdge | Qt.Edge.BottomEdge,
Qt.Edge.RightEdge | Qt.Edge.TopEdge,
):
self.setCursor(Qt.CursorShape.SizeBDiagCursor)
elif edges in (Qt.Edge.LeftEdge, Qt.Edge.RightEdge):
self.setCursor(Qt.CursorShape.SizeHorCursor)
elif edges in (Qt.Edge.TopEdge, Qt.Edge.BottomEdge):
self.setCursor(Qt.CursorShape.SizeVerCursor)
else:
self.unsetCursor()
super().mouseMoveEvent(event)
def mousePressEvent(self, event: QMouseEvent) -> None: # noqa: N802 - Qt API
if event.button() == Qt.MouseButton.LeftButton:
handle = self.window().windowHandle()
if handle is not None:
edges = self._resize_edges(event.position())
if edges and handle.startSystemResize(edges):
event.accept()
return
if handle.startSystemMove():
event.accept()
return
super().mousePressEvent(event)
class _PasswordField(QFrame):
"""Keep the grouped password control visibly focused for keyboard users."""
@@ -498,48 +318,25 @@ class LoginWindow(QMainWindow):
self.setWindowTitle("甄养堂 · 医生工作站 - 甄养堂医生工作站")
self.setWindowIcon(self._window_icon())
self.setWindowFlag(Qt.WindowType.FramelessWindowHint, True)
self.setAttribute(Qt.WidgetAttribute.WA_TranslucentBackground, True)
self.setStyleSheet("QMainWindow { background: transparent; }")
self.setMinimumSize(860, 590)
self.resize(1280, 800)
canvas = _LoginWindowShell(self)
canvas = QWidget()
canvas.setObjectName("LoginCanvas")
canvas.setStyleSheet(
"""
QWidget#LoginCanvas {
color: #1A1C1F;
background-color: transparent;
background-color: #F4F6FA;
font-size: 16px;
}
QToolButton#LoginWindowControl {
background: transparent;
border: 1px solid transparent;
border-radius: 9px;
}
QToolButton#LoginWindowControl:hover {
background-color: #E2ECEA;
border-color: #C7DCD8;
}
QToolButton#LoginWindowControl:pressed {
background-color: #D6E4E1;
}
QToolButton#LoginWindowControl[windowControl="close"]:hover {
background-color: #D63F4F;
border-color: #D63F4F;
}
QToolButton#LoginWindowControl[windowControl="close"]:pressed {
background-color: #B92E3D;
border-color: #B92E3D;
}
QWidget#LoginBrandPanel {
background-color: transparent;
border: 0;
}
QFrame#LoginCard {
background-color: #FFFFFF;
border: 1px solid #D3E1DF;
border: 1px solid #EDEDEE;
border-radius: 20px;
}
QFrame#LoginCard QFrame#SubtleCard {
@@ -610,25 +407,22 @@ class LoginWindow(QMainWindow):
padding: 0;
}
QFrame#LoginCard QPushButton[variant="primary"] {
min-height: 54px;
max-height: 54px;
min-height: 58px;
max-height: 58px;
color: #FFFFFF;
background-color: qlineargradient(x1:0, y1:0, x2:1, y2:0, stop:0 #14968D, stop:1 $ds_accent);
border: 1px solid $ds_accent;
background-color: #4F63D9;
border: 0;
border-radius: 12px;
font-size: 17px;
font-weight: 600;
font-size: 18px;
font-weight: 500;
}
QFrame#LoginCard QPushButton#ServerSettingsToggle {
min-height: 52px;
max-height: 52px;
min-height: 56px;
max-height: 56px;
padding: 0;
}
QFrame#LoginCard QPushButton[variant="primary"]:hover {
background-color: qlineargradient(x1:0, y1:0, x2:1, y2:0, stop:0 #0F8078, stop:1 $ds_accent_hover);
}
QFrame#LoginCard QPushButton[variant="primary"]:pressed {
background-color: $ds_accent_pressed;
background-color: #4156C4;
}
QFrame#LoginCard QPushButton[variant="secondary"] {
color: #1A1C1F;
@@ -655,26 +449,6 @@ class LoginWindow(QMainWindow):
self.brand_panel = self._build_brand_panel()
self.login_root.addWidget(self.brand_panel, 60)
self.login_root.addWidget(self._build_login_area(), 40)
# 悬浮于无边框登录视窗右上角的原生最小化/关闭控件,不占用表单区纵向高度
self.window_controls_host = QWidget(canvas)
self.window_controls_host.setObjectName("LoginWindowControls")
controls_layout = QHBoxLayout(self.window_controls_host)
controls_layout.setContentsMargins(0, 0, 0, 0)
controls_layout.setSpacing(6)
self.minimize_button = _LoginWindowControlButton("minimize", self.window_controls_host)
self.minimize_button.setToolTip("最小化")
self.minimize_button.setAccessibleName("最小化登录窗口")
self.minimize_button.clicked.connect(self.showMinimized)
controls_layout.addWidget(self.minimize_button)
self.close_button = _LoginWindowControlButton("close", self.window_controls_host)
self.close_button.setToolTip("关闭")
self.close_button.setAccessibleName("关闭登录窗口")
self.close_button.clicked.connect(self.close)
controls_layout.addWidget(self.close_button)
self.window_controls_host.adjustSize()
self.window_controls_host.raise_()
self._restore_settings()
for widget in (canvas, *canvas.findChildren(QWidget)):
if widget.styleSheet():
@@ -704,12 +478,6 @@ class LoginWindow(QMainWindow):
0, 12 if compact_height else min(104, max(24, (event.size().height() - 694) // 2)), 0, 12
)
super().resizeEvent(event)
if hasattr(self, "window_controls_host"):
self.window_controls_host.move(
max(12, self.width() - self.window_controls_host.width() - 16),
14,
)
self.window_controls_host.raise_()
def _build_brand_panel(self) -> QWidget:
panel = _BrandPanel()
@@ -45,24 +45,24 @@ from ..appointments_style import appointments_stylesheet
from ..dialogs import DiagnosisDialog
from ..dialogs.ai_consult import can_open_ai_consult, present_ai_consult
from ..dialogs.prescription import (
PRESCRIPTION_VOIDED_RESULT,
PRESCRIPTION_VOIDED_RESULT,
PrescriptionDetailDialog,
PrescriptionEditorDialog,
build_prescription_clinical_diagnosis,
build_prescription_visit_no,
can_reissue_prescription,
prescription_edit_is_locked,
prescription_matches_appointment,
reissue_prescription_seed,
can_reissue_prescription,
prescription_edit_is_locked,
prescription_matches_appointment,
reissue_prescription_seed,
)
from ..dialogs.prescription_ai import (
can_open_diagnosis_ai_report,
present_diagnosis_ai_report,
)
from ..dialogs.prescription_esign import (
resume_saved_prescription,
saved_prescription_message,
)
from ..dialogs.prescription_esign import (
resume_saved_prescription,
saved_prescription_message,
)
from ..filter_disclosure import FilterDisclosure
from ..icons import icon
from ..infinite_list import InfiniteList
@@ -84,7 +84,6 @@ from ..widgets import (
run_async,
show_toast,
)
from ..window_primitives import ClinicalInspectorPanel
STATUS_TABS: tuple[tuple[str, str | int], ...] = (
("待接诊", 1),
@@ -718,9 +717,6 @@ class AppointmentsPage(QWidget):
self.content_layout = layout
self.table_card = self._build_table_card()
layout.addWidget(self.table_card, 1)
self.inspector_panel = ClinicalInspectorPanel(host, width=360)
self.inspector_panel.closed.connect(self._on_inspector_closed)
layout.addWidget(self.inspector_panel)
return host
def _build_table_card(self) -> QWidget:
@@ -814,13 +810,6 @@ class AppointmentsPage(QWidget):
self.toolbar_cancel_button.clicked.connect(self._cancel_selected)
actions.addWidget(self.toolbar_cancel_button)
actions.addStretch(1)
self.inspector_toggle_button = QPushButton("右侧检视", card)
self.inspector_toggle_button.setProperty("variant", "secondary")
self.inspector_toggle_button.setProperty("compactAction", True)
self.inspector_toggle_button.setCheckable(True)
self.inspector_toggle_button.setToolTip("展开或收起右侧非阻塞患者临床检视器")
self.inspector_toggle_button.clicked.connect(self._toggle_clinical_inspector)
actions.addWidget(self.inspector_toggle_button)
refresh = QPushButton("刷新", card)
refresh.setProperty("variant", "ghost")
refresh.setProperty("compactAction", True)
@@ -1445,59 +1434,6 @@ class AppointmentsPage(QWidget):
text = f"{label} ({count})" if count else label
self.tab_bar.setTabText(index, text)
def _on_inspector_closed(self) -> None:
if hasattr(self, "inspector_toggle_button"):
self.inspector_toggle_button.setChecked(False)
def _toggle_clinical_inspector(self, checked: bool) -> None:
if not hasattr(self, "inspector_panel"):
return
if not checked:
self.inspector_panel.hide()
return
self._sync_clinical_inspector(force_open=True)
def _sync_clinical_inspector(self, *, force_open: bool = False) -> None:
if not hasattr(self, "inspector_panel"):
return
if not force_open and not self.inspector_panel.isVisible():
return
row = self.table.current_data() if hasattr(self, "table") else None
if row is None:
if force_open:
self.inspector_panel.set_summary(
title="未选中挂号记录",
subtitle="请在左侧表格中单击任意患者行以实时预览临床摘要",
rows=[("提示", "支持无弹窗快速核查挂号时段、医助与接诊操作")],
actions=[],
)
return
patient = display_text(first_value(row, "patient_name", "name", default="患者"))
phone = display_text(first_value(row, "phone", "mobile", "patient_phone", default="—"))
doctor = display_text(first_value(row, "doctor_name", default="—"))
assistant = display_text(first_value(row, "assistant_name", default="—"))
appt_time = display_text(first_value(row, "appointment_time", "time_text", default="—"))
appt_date = display_text(first_value(row, "appointment_date", default=""))
mode_desc = appointment_type_description(appointment_type_value(row))
actions: list[tuple[str, str, Any]] = []
if self.toolbar_edit_button.isEnabled():
actions.append(("编辑四诊病历", "primary", self._edit_patient))
if self.toolbar_ai_consult_button.isEnabled():
actions.append(("启动 AI 辨证分析", "secondary", self._open_ai_consult))
if self.toolbar_cancel_button.isEnabled():
actions.append(("取消当前挂号", "danger", self._cancel_selected))
self.inspector_panel.set_summary(
title=patient,
subtitle=f"{mode_desc} · 手机 {phone}",
rows=[
("预约时间", f"{appt_date} {appt_time}".strip()),
("接诊医生", doctor),
("协作医助", assistant),
("挂号编号", str(first_value(row, "id", default="—"))),
],
actions=actions,
)
def _selection_changed(self) -> None:
for row_index in range(self.table.rowCount()):
host = self.table.cellWidget(row_index, 0)
@@ -1548,7 +1484,6 @@ class AppointmentsPage(QWidget):
and _as_int(first_value(row, "doctor_id", default=0)) > 0
)
self.toolbar_cancel_button.setEnabled(has_row and status == 1)
self._sync_clinical_inspector()
def _current_row(self) -> Any | None:
return self.table.current_data()
File diff suppressed because it is too large Load Diff
@@ -1466,15 +1466,15 @@ class PatientListWorkspace(QWidget):
target.addWidget(self.custom_date_button)
self.filter_card.setFixedHeight(194 if narrow else 148)
self._narrow_dates = narrow
# 优化列宽配比(总计 1106px),确保 1440px 视窗下右侧「操作」及「更多」按钮不被裁切
widths = (40, 140, 86, 156, 126, 62, 92, 104, 124, 176)
# Keep readable data and complete actions; narrow windows scroll horizontally.
widths = (46, 154, 100, 172, 136, 72, 108, 122, 138, 194)
for column, width in enumerate(widths):
if column != 1:
self.table.setColumnWidth(column, width)
header = self.table.horizontalHeader()
header.setSectionResizeMode(1, QHeaderView.ResizeMode.Interactive if self.width() < 1180 else QHeaderView.ResizeMode.Stretch)
if self.width() < 1180:
self.table.setColumnWidth(1, 140)
header.setSectionResizeMode(1, QHeaderView.ResizeMode.Interactive if self.width() < 1230 else QHeaderView.ResizeMode.Stretch)
if self.width() < 1230:
self.table.setColumnWidth(1, 154)
def _build_filters(self) -> QWidget:
card = QFrame()
@@ -1511,8 +1511,7 @@ class PrescriptionsPage(QWidget):
self.table.horizontalHeader().setDefaultAlignment(Qt.AlignmentFlag.AlignLeft | Qt.AlignmentFlag.AlignVCenter)
self.table.horizontalHeader().setSectionResizeMode(QHeaderView.ResizeMode.Interactive)
self.table.horizontalHeader().moveSection(2, 10)
# 紧凑配比列宽(总计 1124px),确保 1440px 与 1536px 桌面视窗下右侧「操作」列完整呈现无横向溢出
for column, width in enumerate((40, 174, 134, 88, 76, 132, 92, 64, 122, 78, 124)):
for column, width in enumerate((42, 192, 144, 108, 94, 144, 108, 80, 137, 83, 128)):
self.table.setColumnWidth(column, width)
self.table.setColumnHidden(11, True)
self.table.setColumnHidden(12, True)
+20 -149
View File
@@ -1177,47 +1177,13 @@ QWidget#ReceptionPage QPushButton#ReceptionHistoryButton,
QWidget#ReceptionPage QPushButton#ReceptionImButton,
QWidget#ReceptionPage QPushButton#ReceptionMoreButton,
QWidget#ReceptionPage QPushButton#ReceptionCompleteButton {
min-height: 36px;
max-height: 36px;
padding: 0 13px;
min-height: 38px;
max-height: 38px;
padding: 0 12px;
font-size: 13px;
font-weight: 500;
border-radius: 8px;
}
QWidget#ReceptionPage QPushButton#ReceptionNotifyButton:enabled,
QWidget#ReceptionPage QPushButton#ReceptionHistoryButton:enabled,
QWidget#ReceptionPage QPushButton#ReceptionMoreButton:enabled {
color: #16302E;
background-color: #FFFFFF;
border: 1px solid #C6D8D5;
}
QWidget#ReceptionPage QPushButton#ReceptionNotifyButton:enabled:hover,
QWidget#ReceptionPage QPushButton#ReceptionHistoryButton:enabled:hover,
QWidget#ReceptionPage QPushButton#ReceptionMoreButton:enabled:hover {
color: #0B6E68;
background-color: #EAF6F4;
border-color: #8FC8C0;
}
QWidget#ReceptionPage QPushButton#ReceptionNotifyButton:enabled:pressed,
QWidget#ReceptionPage QPushButton#ReceptionHistoryButton:enabled:pressed,
QWidget#ReceptionPage QPushButton#ReceptionMoreButton:enabled:pressed {
background-color: #D7EDE9;
border-color: #0B6E68;
}
QWidget#ReceptionPage QPushButton#ReceptionCompleteButton:enabled {
color: #C93B4E;
background-color: #FFF6F7;
border: 1px solid #F0BDC5;
}
QWidget#ReceptionPage QPushButton#ReceptionCompleteButton:enabled:hover {
color: #B42C3F;
background-color: #FDE8EB;
border-color: #DF8F9C;
}
QWidget#ReceptionPage QPushButton#ReceptionCompleteButton:enabled:pressed {
background-color: #FAD6DC;
border-color: #C93B4E;
border-radius: 5px;
}
QWidget#ReceptionPage QPushButton#ReceptionCompleteButton:enabled { background-color: #FFFFFF; }
QWidget#ReceptionPage QPushButton#ReceptionMoreButton { padding: 0 6px; }
QWidget#ReceptionPage QTabBar#ReceptionDetailTabs {
border-top-left-radius: 0;
@@ -2453,21 +2419,15 @@ class _ReceptionCompleteButton(QPushButton):
super().__init__("结束问诊", parent)
self.setObjectName("ReceptionCompleteButton")
self.setCursor(Qt.CursorShape.PointingHandCursor)
self.setIcon(icons.icon("check_circle", "danger", 15))
self.setIconSize(QSize(15, 15))
def changeEvent(self, event: QEvent) -> None: # noqa: N802 - Qt API
super().changeEvent(event)
if event.type() == QEvent.Type.EnabledChange:
enabled = self.isEnabled()
self.setCursor(
Qt.CursorShape.PointingHandCursor
if enabled
if self.isEnabled()
else Qt.CursorShape.ArrowCursor
)
self.setIcon(
icons.icon("check_circle", "danger" if enabled else "disabled", 15)
)
class _NoteAttachmentPreview(QPushButton):
@@ -4488,7 +4448,7 @@ class ReceptionPage(QWidget):
actions = QHBoxLayout()
hero.actions_layout = actions
actions.setContentsMargins(0, 0, 0, 0)
actions.setSpacing(10)
actions.setSpacing(14)
actions.addStretch(1)
action_group = QVBoxLayout()
hero.action_group = action_group
@@ -4508,20 +4468,14 @@ class ReceptionPage(QWidget):
self.complete_button.setVisible(self._can_complete)
self.notify_button = QPushButton("通知医助", hero)
self.notify_button.setObjectName("ReceptionNotifyButton")
self.notify_button.setIcon(icons.icon("notification", "accent", 15))
self.notify_button.setIconSize(QSize(15, 15))
self.notify_button.clicked.connect(self._notify_assistant)
actions.addWidget(self.notify_button)
self.history_button = QPushButton("查看历史", hero)
self.history_button.setObjectName("ReceptionHistoryButton")
self.history_button.setIcon(icons.icon("followup", "muted", 15))
self.history_button.setIconSize(QSize(15, 15))
self.history_button.clicked.connect(lambda: self.detail_tabs.setCurrentIndex(4))
actions.addWidget(self.history_button)
self.video_button = QPushButton("IM 问诊", hero)
self.video_button.setObjectName("ReceptionImButton")
self.video_button.setIcon(icons.icon("message", "inverse", 15))
self.video_button.setIconSize(QSize(15, 15))
self.video_button.setToolTip("打开患者 IM,可发送消息并从会话中发起视频")
self.video_button.setProperty("variant", "primary")
self.video_button.clicked.connect(self._request_video)
@@ -4532,7 +4486,7 @@ class ReceptionPage(QWidget):
self.more_button.setToolTip("更多操作")
self.more_button.setAccessibleName("更多操作")
self.more_button.setObjectName("ReceptionMoreButton")
self.more_button.setFixedWidth(40)
self.more_button.setFixedWidth(46)
hero.more_control = self.more_button
more_menu = QMenu(self.more_button)
edit_action = more_menu.addAction("编辑病历")
@@ -4546,7 +4500,7 @@ class ReceptionPage(QWidget):
consult_action.triggered.connect(self._open_ai_consult)
self.more_button.setMenu(more_menu)
actions.addWidget(self.more_button)
actions.addSpacing(8)
actions.addSpacing(16)
hero.complete_gap = actions.itemAt(actions.count() - 1).spacerItem()
actions.addWidget(self.complete_button)
@@ -4618,33 +4572,11 @@ class ReceptionPage(QWidget):
history_card.setObjectName("ReceptionHistoryCard")
history_layout = QVBoxLayout(history_card)
history_layout.setContentsMargins(0, 0, 0, 0)
history_layout.setSpacing(11)
history_head = QHBoxLayout()
history_head.setContentsMargins(0, 0, 0, 0)
history_head.setSpacing(8)
history_layout.setSpacing(14)
history_title = QLabel("病情与用药", history_card)
history_title.setObjectName("ReceptionCaseHeading")
history_head.addWidget(history_title)
history_head.addStretch(1)
self.inline_edit_record_button = QPushButton("编辑四诊", history_card)
self.inline_edit_record_button.setObjectName("ReceptionInlineAction")
self.inline_edit_record_button.setIcon(icons.icon("edit", "accent", 14))
self.inline_edit_record_button.setIconSize(QSize(14, 14))
self.inline_edit_record_button.setCursor(Qt.CursorShape.PointingHandCursor)
self.inline_edit_record_button.setVisible(self._can_edit)
self.inline_edit_record_button.clicked.connect(self._edit_diagnosis)
history_head.addWidget(self.inline_edit_record_button)
self.inline_ai_consult_button = QPushButton("AI 辨证", history_card)
self.inline_ai_consult_button.setObjectName("ReceptionInlineAiAction")
self.inline_ai_consult_button.setIcon(icons.icon("ai", "gold", 14))
self.inline_ai_consult_button.setIconSize(QSize(14, 14))
self.inline_ai_consult_button.setCursor(Qt.CursorShape.PointingHandCursor)
self.inline_ai_consult_button.setVisible(self._can_ai_assistant)
self.inline_ai_consult_button.clicked.connect(self._open_ai_consult)
history_head.addWidget(self.inline_ai_consult_button)
history_layout.addLayout(history_head)
history_layout.addWidget(history_title)
self.case_labels: dict[str, QLabel] = {}
self._case_field_frames: dict[str, QFrame] = {}
def add_case_field(
target: QVBoxLayout,
@@ -4655,17 +4587,10 @@ class ReceptionPage(QWidget):
) -> None:
field = QFrame(history_card)
field.setObjectName("ReceptionCaseField")
if key == "chief":
field.setProperty("chiefFocus", True)
if stacked:
field_layout = QVBoxLayout(field)
field_layout.setContentsMargins(
12 if key == "chief" else 0,
9 if key == "chief" else 0,
12 if key == "chief" else 0,
9 if key == "chief" else 6,
)
field_layout.setSpacing(5)
field_layout.setContentsMargins(0, 0, 0, 0)
field_layout.setSpacing(6)
title_label = QLabel(caption, field)
title_label.setProperty("receptionBlockTitle", True)
field_layout.addWidget(title_label)
@@ -4674,7 +4599,7 @@ class ReceptionPage(QWidget):
field_layout.addWidget(value_label)
else:
field_layout = QHBoxLayout(field)
field_layout.setContentsMargins(0, 0, 0, 6)
field_layout.setContentsMargins(0, 0, 0, 0)
field_layout.setSpacing(10)
title_label = QLabel(caption, field)
title_label.setProperty("receptionInlineCaption", True)
@@ -4686,7 +4611,6 @@ class ReceptionPage(QWidget):
value_label.setProperty("receptionInlineValue", True)
field_layout.addWidget(value_label, 1)
self.case_labels[key] = value_label
self._case_field_frames[key] = field
target.addWidget(field)
add_case_field(history_layout, "chief", "本次主诉", stacked=True)
@@ -4729,47 +4653,13 @@ class ReceptionPage(QWidget):
history_layout.addWidget(lifestyle_field)
add_case_field(history_layout, "diet", "饮食习惯")
# W2 Bento 驾驶舱:将未填写的可选病史自动折叠为快捷补录胶囊,消除满屏空白「—」占位行
self._missing_fields_host = QFrame(history_card)
self._missing_fields_host.setObjectName("ReceptionMissingFieldsBar")
missing_outer = QVBoxLayout(self._missing_fields_host)
missing_outer.setContentsMargins(0, 4, 0, 0)
missing_outer.setSpacing(6)
missing_caption = QLabel("待补录病史(点击快捷补录)", self._missing_fields_host)
missing_caption.setProperty("receptionInlineCaption", True)
missing_outer.addWidget(missing_caption)
missing_row = QHBoxLayout()
missing_row.setContentsMargins(0, 0, 0, 0)
missing_row.setSpacing(6)
self._missing_field_pills: dict[str, QPushButton] = {}
for key, label in (
("course", "+ 患病时长"),
("past", "+ 既往史"),
("family", "+ 家族史"),
("allergy", "+ 过敏史"),
("diet", "+ 饮食习惯"),
):
pill = QPushButton(label, self._missing_fields_host)
pill.setProperty("receptionQuickFill", True)
pill.setCursor(Qt.CursorShape.PointingHandCursor)
pill.setEnabled(self._can_edit)
pill.setToolTip(f"打开四诊病历补录{label[2:]}")
pill.clicked.connect(self._edit_diagnosis)
self._missing_field_pills[key] = pill
missing_row.addWidget(pill)
missing_row.addStretch(1)
missing_outer.addLayout(missing_row)
self._missing_fields_host.hide()
history_layout.addWidget(self._missing_fields_host)
history_layout.addStretch(1)
consultation_layout.addWidget(history_card, 1)
right_clinical = QWidget(consultation_page)
right_layout = QVBoxLayout(right_clinical)
right_layout.setContentsMargins(0, 0, 0, 0)
right_layout.setSpacing(8)
right_layout.setSpacing(10)
self.patient_summary_card, self.patient_summary_labels = self._field_card(
"患者基本信息",
@@ -4791,8 +4681,8 @@ class ReceptionPage(QWidget):
vitals_card.setMinimumHeight(0)
vitals_card.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum)
vitals_layout = QVBoxLayout(vitals_card)
vitals_layout.setContentsMargins(12, 10, 12, 10)
vitals_layout.setSpacing(6)
vitals_layout.setContentsMargins(14, 14, 14, 14)
vitals_layout.setSpacing(8)
vitals_title = QLabel("生命体征", vitals_card)
vitals_title.setProperty("receptionBlockTitle", True)
vitals_layout.addWidget(vitals_title)
@@ -4856,8 +4746,8 @@ class ReceptionPage(QWidget):
labs_card = QFrame(right_clinical)
labs_card.setObjectName("ReceptionLabsCard")
labs_layout = QVBoxLayout(labs_card)
labs_layout.setContentsMargins(12, 10, 12, 10)
labs_layout.setSpacing(6)
labs_layout.setContentsMargins(14, 14, 14, 14)
labs_layout.setSpacing(9)
labs_title = QLabel("检查结果", labs_card)
labs_title.setProperty("receptionBlockTitle", True)
labs_layout.addWidget(labs_title)
@@ -4867,7 +4757,7 @@ class ReceptionPage(QWidget):
self._show_missing_labs = False
labs_grid.setContentsMargins(0, 0, 0, 0)
labs_grid.setHorizontalSpacing(7)
labs_grid.setVerticalSpacing(5)
labs_grid.setVerticalSpacing(7)
self.lab_labels: dict[str, QLabel] = {}
self.lab_state_labels: dict[str, QLabel] = {}
lab_definitions = (
@@ -8734,7 +8624,6 @@ class ReceptionPage(QWidget):
}
for key, value in case_values.items():
self.case_labels[key].setText(display_text(value))
self._sync_case_field_folding()
self._set_patient_summary_value("course", case_values["course"])
self._set_patient_summary_value(
"diagnosis", case_value("clinical_diagnosis", "diagnosis_name", "disease_name")
@@ -9168,24 +9057,6 @@ class ReceptionPage(QWidget):
button.setText("预览")
show_toast(self, f"图片预览失败:{friendly_error(error)}", "danger", 5200)
def _sync_case_field_folding(self) -> None:
"""将未录入的可选病史字段折叠为底部快捷补录胶囊,保持主病历画布清爽高密。"""
if not hasattr(self, "_missing_field_pills"):
return
any_missing = False
for key, pill in self._missing_field_pills.items():
label = self.case_labels.get(key)
frame = self._case_field_frames.get(key)
text = (label.text().strip() if label is not None else "")
is_empty = text in {"", "—", "-"}
if frame is not None:
frame.setVisible(not is_empty)
pill.setVisible(is_empty)
if is_empty:
any_missing = True
self._missing_fields_host.setVisible(any_missing)
def _reset_detail_content(self, seed: Any = None) -> None:
for cancel_event in self._patient_ai_generation_cancel_events.values():
cancel_event.set()
@@ -26,25 +26,20 @@ _ORDERS = """
}
#PatientOrdersWorkspace QFrame#OrderSummaryStrip { background: transparent; border: 0; }
#PatientOrdersWorkspace QPushButton, #PatientOrdersWorkspace QToolButton {
min-height: 36px; max-height: 36px; padding: 0 15px; border: 1px solid $ds_line_strong;
border-radius: $ds_radius_control; background: $ds_surface; color: $ds_text; font-weight: 500;
min-height: 38px; max-height: 38px; padding: 0 16px; border: 1px solid transparent;
border-radius: $ds_radius_control; background: $ds_surface_alt; color: $ds_text;
}
#PatientOrdersWorkspace QPushButton:hover, #PatientOrdersWorkspace QToolButton:hover {
background: $ds_accent_soft; border-color: #9CCFC7; color: $ds_accent;
background: $ds_surface_alt; border-color: $ds_line_strong; color: $ds_accent;
}
#PatientOrdersWorkspace QPushButton:pressed, #PatientOrdersWorkspace QToolButton:pressed { background: #D7EFEA; }
#PatientOrdersWorkspace QPushButton:pressed, #PatientOrdersWorkspace QToolButton:pressed { background: $ds_accent_soft; }
#PatientOrdersWorkspace QPushButton:focus, #PatientOrdersWorkspace QToolButton:focus { border-color: $ds_focus; }
#PatientOrdersWorkspace QPushButton#OrderSearchButton,
#PatientOrdersWorkspace QPushButton#OrderDetailButton {
color: $ds_surface;
background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #12857D, stop:1 $ds_accent);
border-color: $ds_accent;
color: $ds_surface; background: $ds_accent; border-color: $ds_accent;
}
#PatientOrdersWorkspace QPushButton#OrderSearchButton:hover,
#PatientOrdersWorkspace QPushButton#OrderDetailButton:hover {
background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #0E726B, stop:1 $ds_accent_hover);
border-color: $ds_accent_hover;
}
#PatientOrdersWorkspace QPushButton#OrderDetailButton:hover { background: $ds_accent_hover; border-color: $ds_accent_hover; }
#PatientOrdersWorkspace QPushButton#OrderSearchButton:pressed,
#PatientOrdersWorkspace QPushButton#OrderDetailButton:pressed { background: $ds_accent_pressed; border-color: $ds_accent_pressed; }
#PatientOrdersWorkspace QPushButton#OrderSearchButton:focus,
@@ -61,22 +61,18 @@ _LIST = """
}
#PatientListWorkspace QFrame#PatientSummaryStrip { background: transparent; border: 0; }
#PatientListWorkspace QPushButton, #PatientSearchToolbar QPushButton {
min-height: 36px; max-height: 36px; padding: 0 15px;
border: 1px solid $ds_line_strong; border-radius: $ds_radius_control; background: $ds_surface; font-weight: 500;
min-height: 38px; max-height: 38px; padding: 0 16px;
border: 1px solid transparent; border-radius: $ds_radius_control; background: $ds_surface_alt;
}
#PatientListWorkspace QPushButton:hover, #PatientSearchToolbar QPushButton:hover {
color: $ds_accent; background: $ds_accent_soft; border-color: #9CCFC7;
color: $ds_accent; background: $ds_surface_alt; border-color: $ds_line_strong;
}
#PatientListWorkspace QPushButton:pressed, #PatientSearchToolbar QPushButton:pressed { background: #D7EFEA; }
#PatientListWorkspace QPushButton:pressed, #PatientSearchToolbar QPushButton:pressed { background: $ds_accent_soft; }
#PatientListWorkspace QPushButton:focus, #PatientSearchToolbar QPushButton:focus { border-color: $ds_focus; }
#PatientSearchToolbar QPushButton#PatientSearchButton {
min-height: 36px; max-height: 36px; color: $ds_surface;
background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #12857D, stop:1 $ds_accent);
border-color: $ds_accent;
}
#PatientSearchToolbar QPushButton#PatientSearchButton:hover {
background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #0E726B, stop:1 $ds_accent_hover);
min-height: 38px; max-height: 38px; color: $ds_surface; background: $ds_accent; border-color: $ds_accent;
}
#PatientSearchToolbar QPushButton#PatientSearchButton:hover { background: $ds_accent_hover; }
#PatientSearchToolbar QPushButton#PatientSearchButton:pressed { background: $ds_accent_pressed; }
#PatientSearchToolbar QPushButton#PatientSearchButton:focus { border-color: $ds_focus; }
#PatientSearchToolbar QLineEdit {
@@ -323,21 +323,19 @@ _LIBRARY = """
border: 0; border-radius: 0; background: transparent;
}
#PrescriptionLibraryPage QPushButton {
min-height: 36px; max-height: 36px; padding: 0 15px; border-radius: $ds_radius_control;
border: 1px solid $ds_line_strong; background: $ds_surface; color: $ds_text; font-weight: 500;
min-height: 38px; max-height: 38px; padding: 0 16px; border-radius: $ds_radius_control;
border: 1px solid transparent; background: $ds_surface_alt; color: $ds_text;
}
#PrescriptionLibraryPage QPushButton:hover { background: $ds_accent_soft; border-color: #9CCFC7; color: $ds_accent; }
#PrescriptionLibraryPage QPushButton:pressed { background: #D7EFEA; }
#PrescriptionLibraryPage QPushButton:hover { background: $ds_surface_alt; border-color: $ds_line_strong; color: $ds_accent; }
#PrescriptionLibraryPage QPushButton:pressed { background: $ds_accent_soft; }
#PrescriptionLibraryPage QPushButton:focus { border-color: $ds_focus; }
#PrescriptionLibraryPage QPushButton#PrescriptionLibraryAddButton,
#PrescriptionLibraryPage QPushButton#PrescriptionLibraryQueryButton {
background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #12857D, stop:1 $ds_accent);
border-color: $ds_accent; color: $ds_surface;
background: $ds_accent; border-color: $ds_accent; color: $ds_surface;
}
#PrescriptionLibraryPage QPushButton#PrescriptionLibraryAddButton:hover,
#PrescriptionLibraryPage QPushButton#PrescriptionLibraryQueryButton:hover {
background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #0E726B, stop:1 $ds_accent_hover);
border-color: $ds_accent_hover;
background: $ds_accent_hover; border-color: $ds_accent_hover;
}
#PrescriptionLibraryPage QPushButton#PrescriptionLibraryAddButton:pressed,
#PrescriptionLibraryPage QPushButton#PrescriptionLibraryQueryButton:pressed {
@@ -345,7 +343,7 @@ _LIBRARY = """
}
#PrescriptionLibraryPage QPushButton#PrescriptionLibraryAddButton:focus,
#PrescriptionLibraryPage QPushButton#PrescriptionLibraryQueryButton:focus { border-color: $ds_focus; }
#PrescriptionLibraryPage QPushButton[variant="danger"] { color: $ds_danger; background: $ds_danger_soft; border-color: #F5C8CD; }
#PrescriptionLibraryPage QPushButton[variant="danger"] { color: $ds_danger; background: $ds_danger_soft; border-color: transparent; }
#PrescriptionLibraryPage QPushButton[variant="danger"]:hover { border-color: $ds_danger; }
#PrescriptionLibraryPage QPushButton[variant="danger"]:focus { border-color: $ds_focus; }
#PrescriptionLibraryPage QPushButton:disabled,
@@ -31,26 +31,24 @@ _PRESCRIPTIONS = """
}
#PrescriptionsPage QFrame#PrescriptionToolbar { background: transparent; border: 0; }
#PrescriptionsPage QPushButton {
min-height: 36px; max-height: 36px; padding: 0 15px; border-radius: $ds_radius_control;
border: 1px solid $ds_line_strong; background: $ds_surface; color: $ds_text; font-weight: 500;
min-height: 38px; max-height: 38px; padding: 0 16px; border-radius: $ds_radius_control;
border: 1px solid transparent; background: $ds_surface_alt; color: $ds_text;
}
#PrescriptionsPage QPushButton:hover { background: $ds_accent_soft; border-color: #9CCFC7; color: $ds_accent; }
#PrescriptionsPage QPushButton:pressed { background: #D7EFEA; }
#PrescriptionsPage QPushButton:hover { background: $ds_surface_alt; border-color: $ds_line_strong; color: $ds_accent; }
#PrescriptionsPage QPushButton:pressed { background: $ds_accent_soft; }
#PrescriptionsPage QPushButton:focus { border-color: $ds_focus; }
#PrescriptionsPage QPushButton#PrescriptionAddButton, #PrescriptionsPage QPushButton#PrescriptionQueryButton {
background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #12857D, stop:1 $ds_accent);
color: $ds_surface; border-color: $ds_accent;
background: $ds_accent; color: $ds_surface; border-color: $ds_accent;
}
#PrescriptionsPage QPushButton#PrescriptionAddButton:hover, #PrescriptionsPage QPushButton#PrescriptionQueryButton:hover {
background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #0E726B, stop:1 $ds_accent_hover);
border-color: $ds_accent_hover;
background: $ds_accent_hover; border-color: $ds_accent_hover;
}
#PrescriptionsPage QPushButton#PrescriptionAddButton:pressed, #PrescriptionsPage QPushButton#PrescriptionQueryButton:pressed {
background: $ds_accent_pressed; border-color: $ds_accent_pressed;
}
#PrescriptionsPage QPushButton#PrescriptionAddButton:focus,
#PrescriptionsPage QPushButton#PrescriptionQueryButton:focus { border-color: $ds_focus; }
#PrescriptionsPage QPushButton[variant="danger"] { color: $ds_danger; background: $ds_danger_soft; border-color: #F5C8CD; }
#PrescriptionsPage QPushButton[variant="danger"] { color: $ds_danger; background: $ds_danger_soft; border-color: transparent; }
#PrescriptionsPage QPushButton[variant="danger"]:hover { border-color: $ds_danger; }
#PrescriptionsPage QPushButton[variant="danger"]:focus { border-color: $ds_focus; }
#PrescriptionsPage QPushButton:disabled, #PrescriptionsPage QPushButton[variant="danger"]:disabled,
@@ -169,24 +169,23 @@ QWidget#ReceptionPage QStackedWidget#ReceptionNarrowWorkspace {
border: 0;
}
QWidget#ReceptionPage QFrame#ReceptionQueuePanel {
background-color: $ds_surface;
border: 1px solid $ds_line;
border-radius: $ds_radius_panel;
background-color: #FFFFFF;
border: 1px solid #EDF0F5;
border-radius: 16px;
}
QWidget#ReceptionPage QLabel#ReceptionQueueTitle {
color: $ds_heading;
font-size: 17px;
font-size: 18px;
font-weight: 600;
}
QWidget#ReceptionPage QLabel#ReceptionQueueName {
font-size: 15px;
font-weight: 600;
font-weight: 500;
}
QWidget#ReceptionPage QLabel#ReceptionQueueMeta,
QWidget#ReceptionPage QLabel#ReceptionQueueTime,
QWidget#ReceptionPage QLabel#ReceptionQueueSubline,
QWidget#ReceptionPage QLabel#ReceptionQueueSummary {
color: $ds_muted;
color: #5D6B80;
font-size: 12px;
font-weight: 400;
}
@@ -194,137 +193,79 @@ QWidget#ReceptionPage QLabel#ReceptionQueueMetric {
font-size: 13px;
}
QWidget#ReceptionPage QLabel#ReceptionQueueMetric[tone="description"] {
color: $ds_muted;
color: #5D6B80;
font-size: 12px;
}
QWidget#ReceptionPage QFrame#ReceptionHero,
QWidget#ReceptionPage QFrame#ReceptionClinicalCard {
min-height: 0;
background-color: $ds_surface;
border: 1px solid $ds_line;
border-radius: $ds_radius_panel;
background-color: #FFFFFF;
border: 1px solid #EDF0F5;
border-radius: 16px;
}
QWidget#ReceptionPage QLabel#ReceptionPatientName {
color: $ds_heading;
font-size: 20px;
font-weight: 600;
}
QWidget#ReceptionPage QLabel#ReceptionPatientMeta {
color: $ds_muted;
color: #5D6B80;
font-size: 13px;
}
QWidget#ReceptionPage QLabel#ReceptionAvatar {
color: $ds_accent;
background-color: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #E9F6F4, stop:1 #CDEAE5);
border: 1px solid #DFC793;
color: #1555B6;
background-color: #EAF2FF;
border-radius: 12px;
font-size: 20px;
font-weight: 600;
}
QWidget#ReceptionPage QTabBar#ReceptionDetailTabs,
QWidget#ReceptionPage QTabBar#ReceptionWorkspaceTabs {
background-color: $ds_surface_alt;
background-color: #FFFFFF;
border: 0;
border-bottom: 1px solid $ds_line;
border-top-left-radius: $ds_radius_panel;
border-top-right-radius: $ds_radius_panel;
border-bottom: 1px solid #E5ECF6;
border-top-left-radius: 16px;
border-top-right-radius: 16px;
}
QWidget#ReceptionPage QTabBar#ReceptionDetailTabs::tab,
QWidget#ReceptionPage QTabBar#ReceptionWorkspaceTabs::tab {
min-height: 40px;
margin: 0;
padding: 0 15px;
color: $ds_muted;
padding: 0 14px;
color: #5D6B80;
background-color: transparent;
border: 0;
border-bottom: 2px solid transparent;
border-radius: 0;
font-size: 13px;
font-weight: 500;
font-weight: 400;
}
QWidget#ReceptionPage QTabBar#ReceptionDetailTabs::tab:first {
margin-left: 0;
padding-left: 15px;
padding-left: 14px;
}
QWidget#ReceptionPage QTabBar#ReceptionDetailTabs::tab:hover,
QWidget#ReceptionPage QTabBar#ReceptionWorkspaceTabs::tab:hover {
color: $ds_accent;
background-color: rgba(11, 110, 104, 14);
color: #1769E8;
background-color: #F3F7FD;
}
QWidget#ReceptionPage QTabBar#ReceptionDetailTabs::tab:selected,
QWidget#ReceptionPage QTabBar#ReceptionWorkspaceTabs::tab:selected {
color: $ds_accent;
color: #1769E8;
background-color: transparent;
border-bottom: 2px solid $ds_accent;
font-weight: 600;
border-bottom: 2px solid #1769E8;
font-weight: 500;
}
QWidget#ReceptionPage QFrame#ReceptionHistoryCard {
background-color: #FFFFFF;
border: 0;
border-radius: 0;
}
QWidget#ReceptionPage QWidget#ReceptionCaseField,
QWidget#ReceptionPage QFrame#ReceptionCaseField {
QWidget#ReceptionPage QWidget#ReceptionCaseField {
background-color: transparent;
border: 0;
border-bottom: 1px solid $ds_line;
border-bottom: 1px solid #EDF1F7;
border-radius: 0;
}
QWidget#ReceptionPage QFrame#ReceptionCaseField[chiefFocus="true"] {
background-color: qlineargradient(x1:0, y1:0, x2:1, y2:0, stop:0 #EEF9F7, stop:1 #FFFFFF);
border: 1px solid #C6E3DE;
border-left: 3px solid $ds_accent;
border-radius: 10px;
}
QWidget#ReceptionPage QPushButton#ReceptionInlineAction {
min-height: 28px;
max-height: 28px;
padding: 0 10px;
border-radius: 7px;
background-color: $ds_surface;
border: 1px solid $ds_line_strong;
color: $ds_accent;
font-size: 12px;
font-weight: 500;
}
QWidget#ReceptionPage QPushButton#ReceptionInlineAction:hover {
background-color: $ds_accent_soft;
border-color: #8FC8C0;
}
QWidget#ReceptionPage QPushButton#ReceptionInlineAiAction {
min-height: 28px;
max-height: 28px;
padding: 0 10px;
border-radius: 7px;
background-color: qlineargradient(x1:0, y1:0, x2:1, y2:0, stop:0 #123433, stop:1 #091E1E);
border: 1px solid rgba(223, 199, 147, 120);
color: #DFC793;
font-size: 12px;
font-weight: 600;
}
QWidget#ReceptionPage QPushButton#ReceptionInlineAiAction:hover {
background-color: #174240;
color: #FFFFFF;
}
QWidget#ReceptionPage QFrame#ReceptionMissingFieldsBar {
background-color: transparent;
border: 0;
}
QWidget#ReceptionPage QPushButton[receptionQuickFill="true"] {
min-height: 26px;
max-height: 26px;
padding: 0 10px;
border-radius: 13px;
background-color: $ds_surface_alt;
border: 1px dashed $ds_line_strong;
color: $ds_muted;
font-size: 11.5px;
}
QWidget#ReceptionPage QPushButton[receptionQuickFill="true"]:hover {
background-color: $ds_accent_soft;
border: 1px solid $ds_accent;
color: $ds_accent;
}
QWidget#ReceptionPage QLabel#ReceptionCaseHeading {
color: #202C3F;
font-size: 16px;
@@ -353,17 +294,17 @@ QWidget#ReceptionPage QLabel[receptionLifestyleChip="true"] {
QWidget#ReceptionPage QFrame#ReceptionPatientSummaryCard,
QWidget#ReceptionPage QFrame#ReceptionVitalsCard,
QWidget#ReceptionPage QFrame#ReceptionLabsCard {
background-color: $ds_surface;
border: 1px solid $ds_line;
border-radius: $ds_radius_panel;
background-color: #FFFFFF;
border: 1px solid #EDF0F5;
border-radius: 16px;
}
QWidget#ReceptionPage QLabel#ReceptionPatientSummaryValue {
color: $ds_heading;
color: #24334A;
font-size: 13px;
font-weight: 500;
}
QWidget#ReceptionPage QLabel#ReceptionPatientSummaryValue[missing="true"] {
color: $ds_muted;
color: #697386;
font-weight: 400;
}
QWidget#ReceptionPage QFrame#ReceptionMetricCell,
@@ -375,109 +316,76 @@ QWidget#ReceptionPage QFrame#ReceptionMetricCell[firstMetric="true"] {
QWidget#ReceptionPage QLabel[receptionMetricCaption="true"],
QWidget#ReceptionPage QLabel[receptionMetricUnit="true"],
QWidget#ReceptionPage QLabel[receptionBmiState="true"] {
color: $ds_muted;
color: #5D6B80;
font-size: 12px;
font-weight: 400;
}
QWidget#ReceptionPage QFrame#ReceptionMetricCell QLabel[receptionMetricValue="true"] {
color: $ds_heading;
font-size: 18px;
font-weight: 600;
font-weight: 500;
}
QWidget#ReceptionPage QFrame#ReceptionLabCell {
min-height: 0;
padding: 0;
background-color: $ds_surface;
background-color: #FFFFFF;
border: 0;
border-bottom: 1px solid $ds_line;
border-bottom: 1px solid #EDF1F7;
border-radius: 0;
}
QWidget#ReceptionPage QFrame#ReceptionLabCell QLabel[receptionMetricValue="true"] {
font-size: 13px;
font-weight: 500;
font-weight: 400;
}
QWidget#ReceptionPage QPushButton#ReceptionMissingLabsButton {
min-height: 28px;
max-height: 28px;
padding: 0;
color: $ds_accent;
color: #1769E8;
background: transparent;
border: 0;
text-align: left;
font-size: 12px;
font-weight: 500;
}
QWidget#ReceptionPage QLabel[receptionMetricState="true"] {
min-height: 18px;
padding: 0 6px;
background-color: $ds_accent_soft;
border: 1px solid #C5E2DE;
border-radius: $ds_radius_small;
font-size: 12px;
font-weight: 500;
}
QWidget#ReceptionPage QLabel[receptionMetricState="true"][alert="true"] {
color: $ds_danger;
background-color: $ds_danger_soft;
border-color: #F5C8CD;
}
QWidget#ReceptionPage QLabel[receptionMetricState="true"][alert="true"][warning="true"] {
color: $ds_warning;
background-color: $ds_warning_soft;
border-color: #F7DFB7;
border-radius: $ds_radius_small;
}
QWidget#ReceptionPage QFrame#ReceptionAiAnalysisCard,
QWidget#ReceptionPage QFrame#ReceptionAiAssistantCard {
background-color: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #103231, stop:0.6 #092020, stop:1 #061515);
border: 1px solid rgba(223, 199, 147, 108);
border-radius: $ds_radius_panel;
}
QWidget#ReceptionPage QFrame#ReceptionAiAnalysisCard QLabel,
QWidget#ReceptionPage QFrame#ReceptionAiAssistantCard QLabel {
color: #DDF0ED;
background: transparent;
}
QWidget#ReceptionPage QStackedWidget#ReceptionAiAnalysisStack,
QWidget#ReceptionPage QStackedWidget#ReceptionAiAnalysisStack > QWidget,
QWidget#ReceptionPage QWidget#ReceptionAiAnalysisSections {
background: transparent;
padding: 0 5px;
background-color: #F0F5FD;
border: 0;
}
QWidget#ReceptionPage QLabel#ReceptionAiTitle,
QWidget#ReceptionPage QPushButton#ReceptionAiTitle {
color: #DFC793;
font-size: 14px;
font-weight: 600;
background: transparent;
border: 0;
}
QWidget#ReceptionPage QLabel#ReceptionAiAnalysisSnapshotMeta,
QWidget#ReceptionPage QLabel#ReceptionAiAssistantHint {
color: #93B8B4;
border-radius: 4px;
font-size: 12px;
font-weight: 400;
}
QWidget#ReceptionPage QComboBox#ReceptionAiAnalysisModelSelector {
background-color: rgba(255, 255, 255, 22);
border: 1px solid rgba(223, 199, 147, 92);
border-radius: 7px;
color: #F2FAF9;
padding: 2px 8px;
QWidget#ReceptionPage QLabel[receptionMetricState="true"][alert="true"] {
color: #BE4B58;
background-color: #FFF4F5;
}
QWidget#ReceptionPage QLabel[receptionMetricState="true"][alert="true"][warning="true"] {
color: #A9691D;
background-color: #FFF9EF;
border-radius: 4px;
}
QWidget#ReceptionPage QFrame#ReceptionAiAnalysisCard,
QWidget#ReceptionPage QFrame#ReceptionAiAssistantCard {
background-color: #FFFFFF;
border: 1px solid $ds_line;
border-radius: $ds_radius_panel;
}
QWidget#ReceptionPage QLabel#ReceptionAiTitle,
QWidget#ReceptionPage QPushButton#ReceptionAiTitle {
font-size: 14px;
font-weight: 500;
}
QWidget#ReceptionPage QLabel#ReceptionAiAssistantHint {
color: #5D6B80;
font-size: 13px;
font-weight: 400;
}
QWidget#ReceptionPage QPushButton[receptionAiPrompt="true"] {
min-height: 28px;
max-height: 28px;
padding: 0 9px;
padding: 0 8px;
font-size: 12px;
border-radius: 7px;
background-color: rgba(24, 176, 165, 42);
border: 1px solid rgba(84, 230, 193, 96);
color: #A8F3DF;
}
QWidget#ReceptionPage QPushButton[receptionAiPrompt="true"]:hover {
background-color: rgba(24, 176, 165, 86);
color: #FFFFFF;
border-radius: 6px;
}
QWidget#ReceptionPage QScrollArea#ReceptionInsightsScroll {
background-color: transparent;
File diff suppressed because it is too large Load Diff
+19 -38
View File
@@ -40,7 +40,7 @@ from doctor_workstation.resources import resource_path
# ``motion`` deliberately imports nothing from this module, so this stays a
# one-way dependency: tokens here, animation there.
from . import interactions, motion
from . import motion
from .design_system import PALETTE, RADII, SPACING, clinical_stylesheet
# Shared reading colors keep native pages and dialog chrome consistent.
@@ -81,11 +81,6 @@ COLORS = {
"teal": PALETTE["accent"],
"teal_dark": PALETTE["accent_pressed"],
"teal_pale": PALETTE["accent_soft"],
"gold": PALETTE["gold"],
"gold_light": PALETTE["gold_light"],
"gold_soft": PALETTE["gold_soft"],
"obsidian": PALETTE["obsidian"],
"obsidian_alt": PALETTE["obsidian_alt"],
}
@@ -380,12 +375,12 @@ QPushButton:disabled {
QPushButton[variant="primary"] {
color: #FFFFFF;
background-color: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #12857D, stop:1 $indigo);
background-color: $indigo;
border-color: $indigo;
}
QPushButton[variant="primary"]:hover,
QPushButton[variant="primary"]:checked:hover {
background-color: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #0E726B, stop:1 $indigo_hover);
background-color: $indigo_hover;
border-color: $indigo_hover;
}
QPushButton[variant="primary"]:pressed,
@@ -394,7 +389,7 @@ QPushButton[variant="primary"]:checked {
border-color: $indigo_pressed;
}
QPushButton[variant="primary"]:focus {
border: 1px solid $focus;
border: 1px solid $indigo_pressed;
background-color: $indigo_hover;
}
QPushButton[variant="primary"]:disabled {
@@ -406,12 +401,12 @@ QPushButton[variant="primary"]:disabled {
QPushButton[variant="secondary"] {
color: $indigo_hover;
background-color: $indigo_pale;
border-color: #C4E2DD;
border-color: $indigo_pale;
}
QPushButton[variant="secondary"]:hover {
color: $indigo_pressed;
background-color: #D7EFEA;
border-color: #9CCFC7;
background-color: $raised;
border-color: $indigo_hover;
}
QPushButton[variant="secondary"]:pressed,
QPushButton[variant="secondary"]:checked {
@@ -621,7 +616,7 @@ QLineEdit, QTextEdit, QPlainTextEdit, QComboBox, QDateEdit, QDateTimeEdit,
QTimeEdit, QSpinBox, QDoubleSpinBox, QKeySequenceEdit {
min-height: $h_default;
padding: 0 $pad_control;
border: 1px solid $line_soft;
border: 1px solid $line;
border-radius: $r_md;
background-color: $surface;
color: $text;
@@ -631,11 +626,11 @@ QTimeEdit, QSpinBox, QDoubleSpinBox, QKeySequenceEdit {
QTextEdit, QPlainTextEdit { padding: 7px $pad_control; }
QLineEdit:hover, QTextEdit:hover, QPlainTextEdit:hover, QComboBox:hover,
QDateEdit:hover, QDateTimeEdit:hover, QTimeEdit:hover, QSpinBox:hover,
QDoubleSpinBox:hover, QKeySequenceEdit:hover { border-color: #8FBDB6; }
QDoubleSpinBox:hover, QKeySequenceEdit:hover { border-color: $indigo_hover; }
QLineEdit:focus, QTextEdit:focus, QPlainTextEdit:focus, QComboBox:focus,
QDateEdit:focus, QDateTimeEdit:focus, QTimeEdit:focus, QSpinBox:focus,
QDoubleSpinBox:focus, QKeySequenceEdit:focus {
border: 1.5px solid $focus;
border: 1px solid $indigo;
background-color: $surface;
}
QLineEdit:read-only, QTextEdit:read-only, QPlainTextEdit:read-only {
@@ -1505,28 +1500,15 @@ def _size_new_window_to_main(window: QWidget) -> None:
target_width = target.width()
target_height = target.height()
# 紧凑业务轻弹窗(如二维码、完成确认、收退款、更新等)保持自身合理尺寸并居中,
# 仅大型工作台窗口(宽>=760 且高>=640)扩展至主视窗 85%,避免小窗被强行撑大造成内容错位。
current_size = window.size()
hint_size = window.sizeHint()
desired_w = max(current_size.width(), hint_size.width(), window.minimumWidth())
desired_h = max(current_size.height(), hint_size.height(), window.minimumHeight())
is_compact_dialog = isinstance(window, QDialog) and (desired_w < 760 or desired_h < 640)
if is_compact_dialog:
final_width = min(desired_w, target_width)
final_height = min(desired_h, target_height)
else:
final_width = target_width
final_height = target_height
if window.minimumWidth() > final_width:
window.setMinimumWidth(final_width)
if window.minimumHeight() > final_height:
window.setMinimumHeight(final_height)
if window.maximumWidth() < final_width:
window.setMaximumWidth(final_width)
if window.maximumHeight() < final_height:
window.setMaximumHeight(final_height)
window.resize(final_width, final_height)
if window.minimumWidth() > target_width:
window.setMinimumWidth(target_width)
if window.minimumHeight() > target_height:
window.setMinimumHeight(target_height)
if window.maximumWidth() < target_width:
window.setMaximumWidth(target_width)
if window.maximumHeight() < target_height:
window.setMaximumHeight(target_height)
window.resize(target_width, target_height)
frame = window.frameGeometry()
window.move(
target.center().x() - frame.width() // 2,
@@ -1601,7 +1583,6 @@ class _BusinessDialogStyleFilter(QObject):
def _install_business_dialog_styling(app: QApplication) -> None:
interactions.install_tactile_interactions(app)
existing = getattr(app, "_doctor_business_dialog_style_filter", None)
if existing is not None:
return
@@ -1,486 +0,0 @@
"""Clinical OS 2.0 统一桌面视窗原语库(W8 三大标准视窗容器 + W3 主从组件)。
提供跨全站 35+ 窗口复用的结构级原生组件,彻底告别杂乱的原生灰白弹窗与后台套壳:
1. 原语 A · ClinicalSlideDrawer:右侧 520px 非阻塞滑出工作抽屉(吸顶标题 + 吸底操作条)
2. 原语 B · ClinicalModalDialog:居中无边框 16px 圆角奢雅轻模态窗(顶部翡翠-鎏金渐层饰线)
3. 原语 C · ClinicalToastFrame:右下角黑曜翡翠临床实时提醒浮卡样式基类
4. W3 主从组件 · ClinicalInspectorPanel(420px 滑出临床检视器)与 ClinicalFloatingDock(选中浮现操作坞)
"""
from __future__ import annotations
from typing import Any
from PySide6.QtCore import QPoint, QRectF, QSize, Qt, Signal
from PySide6.QtGui import (
QColor,
QLinearGradient,
QMouseEvent,
QPainter,
QPen,
)
from PySide6.QtWidgets import (
QDialog,
QFrame,
QHBoxLayout,
QLabel,
QPushButton,
QScrollArea,
QSizePolicy,
QToolButton,
QVBoxLayout,
QWidget,
)
from . import icons, motion
from .design_system import PALETTE, clinical_stylesheet
# 统一原语样式表(基于御瓷智医设计令牌)
WINDOW_PRIMITIVES_QSS = clinical_stylesheet(
r"""
QFrame#ClinicalInspectorPanel {
background-color: $ds_surface;
border: 1px solid #BCD6D1;
border-radius: 14px;
}
QFrame#ClinicalInspectorHeader {
background-color: #F6FBFA;
border: 0;
border-bottom: 1px solid $ds_line;
border-top-left-radius: 14px;
border-top-right-radius: 14px;
}
QLabel#ClinicalInspectorTitle {
color: $ds_heading;
font-size: 16px;
font-weight: 600;
}
QLabel#ClinicalInspectorSubtitle {
color: $ds_muted;
font-size: 12px;
}
QFrame#ClinicalInspectorSummaryBox {
background-color: #F4F9F8;
border: 1px solid $ds_line;
border-radius: 10px;
}
QFrame#ClinicalFloatingDock {
background-color: qlineargradient(x1:0, y1:0, x2:1, y2:0, stop:0 #0E2B2A, stop:1 #071919);
border: 1px solid rgba(223, 199, 147, 130);
border-radius: 14px;
}
QLabel#ClinicalFloatingDockCount {
color: #DFC793;
font-size: 13px;
font-weight: 600;
}
QFrame#ClinicalFloatingDock QPushButton {
min-height: 30px;
max-height: 30px;
padding: 0 12px;
border-radius: 8px;
background-color: rgba(255, 255, 255, 24);
border: 1px solid rgba(255, 255, 255, 42);
color: #F2FAF9;
font-size: 12px;
font-weight: 500;
}
QFrame#ClinicalFloatingDock QPushButton:hover {
background-color: rgba(24, 176, 165, 90);
border-color: #DFC793;
color: #FFFFFF;
}
QFrame#ClinicalFloatingDock QPushButton[dockDanger="true"] {
background-color: rgba(214, 63, 79, 210);
border-color: #D63F4F;
color: #FFFFFF;
}
QFrame#ClinicalFloatingDock QPushButton[dockDanger="true"]:hover {
background-color: #B92E3D;
}
QFrame#ClinicalKpiTile {
background-color: $ds_surface;
border: 1px solid $ds_line;
border-radius: 12px;
}
QFrame#ClinicalKpiTile:hover {
border-color: #8FC8C0;
background-color: #F9FDFC;
}
QFrame#ClinicalKpiTile[active="true"] {
background-color: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #EBF8F6, stop:1 #FFFFFF);
border: 1.5px solid $ds_accent;
}
QFrame#ClinicalAccentHeader {
background-color: #F6FBFA;
border: 0;
border-bottom: 1px solid $ds_line;
}
QLabel#ClinicalAccentHeaderTitle {
color: $ds_heading;
font-size: 15px;
font-weight: 600;
}
QLabel#ClinicalAccentHeaderSub {
color: $ds_muted;
font-size: 12px;
}
"""
)
class ClinicalAccentBar(QWidget):
"""顶部 3px 翡翠青至香槟鎏金渐变饰线,统一所有高级视窗与工作室的奢雅科技识别。"""
def __init__(self, parent: QWidget | None = None) -> None:
super().__init__(parent)
self.setFixedHeight(3)
def paintEvent(self, event: Any) -> None: # noqa: N802 - Qt virtual
del event
painter = QPainter(self)
grad = QLinearGradient(0.0, 0.0, float(self.width()), 0.0)
grad.setColorAt(0.0, QColor(PALETTE["accent"]))
grad.setColorAt(0.58, QColor("#18B0A5"))
grad.setColorAt(1.0, QColor(PALETTE["gold_light"]))
painter.fillRect(self.rect(), grad)
painter.end()
def apply_luxury_dialog_chrome(
dialog: QDialog,
*,
title: str = "",
subtitle: str = "",
) -> QFrame | None:
"""为现有业务 QDialog 注入顶部翡翠-鎏金饰线与结构化页眉(零侵入兼容既有逻辑)。"""
if getattr(dialog, "_luxury_chrome_installed", False):
return None
layout = dialog.layout()
if not isinstance(layout, QVBoxLayout):
return None
dialog._luxury_chrome_installed = True # type: ignore[attr-defined]
bar = ClinicalAccentBar(dialog)
layout.insertWidget(0, bar)
header: QFrame | None = None
if title:
header = QFrame(dialog)
header.setObjectName("ClinicalAccentHeader")
header.setStyleSheet(WINDOW_PRIMITIVES_QSS)
h_layout = QHBoxLayout(header)
h_layout.setContentsMargins(18, 11, 16, 11)
h_layout.setSpacing(10)
copy = QVBoxLayout()
copy.setContentsMargins(0, 0, 0, 0)
copy.setSpacing(2)
t_lbl = QLabel(title, header)
t_lbl.setObjectName("ClinicalAccentHeaderTitle")
copy.addWidget(t_lbl)
if subtitle:
s_lbl = QLabel(subtitle, header)
s_lbl.setObjectName("ClinicalAccentHeaderSub")
copy.addWidget(s_lbl)
h_layout.addLayout(copy, 1)
layout.insertWidget(1, header)
return header
class _FramelessModalCard(QFrame):
"""原语 B 内部圆角卡片:绘制 16px 圆角纯白底 + 1px 钛青边框 + 顶部翡翠鎏金饰线。"""
def paintEvent(self, event: Any) -> None: # noqa: N802 - Qt virtual
del event
painter = QPainter(self)
painter.setRenderHint(QPainter.RenderHint.Antialiasing, True)
bounds = QRectF(self.rect()).adjusted(0.5, 0.5, -0.5, -0.5)
painter.setBrush(QColor(PALETTE["surface"]))
painter.setPen(QPen(QColor("#B5CFCB"), 1.0))
painter.drawRoundedRect(bounds, 16.0, 16.0)
# 顶部渐层饰线
grad = QLinearGradient(bounds.left() + 18, bounds.top(), bounds.right() - 18, bounds.top())
grad.setColorAt(0.0, QColor(PALETTE["accent"]))
grad.setColorAt(0.58, QColor("#18B0A5"))
grad.setColorAt(1.0, QColor(PALETTE["gold_light"]))
painter.setPen(Qt.PenStyle.NoPen)
painter.setBrush(grad)
painter.drawRoundedRect(QRectF(bounds.left() + 14, bounds.top() + 1, bounds.width() - 28, 2.5), 1.2, 1.2)
painter.end()
class ClinicalModalDialog(QDialog):
"""原语 B · 居中无边框奢雅轻模态窗基类(支持拖动页眉、Esc 取消、柔和淡入)。"""
def __init__(
self,
title: str,
subtitle: str = "",
*,
width: int = 520,
parent: QWidget | None = None,
) -> None:
super().__init__(parent)
self.setObjectName("ClinicalModalDialog")
self.setWindowTitle(title)
self.setWindowFlags(
Qt.WindowType.FramelessWindowHint
| Qt.WindowType.Dialog
| Qt.WindowType.NoDropShadowWindowHint
)
self.setAttribute(Qt.WidgetAttribute.WA_TranslucentBackground, True)
self.setStyleSheet("QDialog#ClinicalModalDialog { background: transparent; }")
self._drag_origin: QPoint | None = None
outer = QVBoxLayout(self)
outer.setContentsMargins(10, 10, 10, 10)
self.card = _FramelessModalCard(self)
self.card.setMinimumWidth(width)
card_layout = QVBoxLayout(self.card)
card_layout.setContentsMargins(0, 4, 0, 0)
card_layout.setSpacing(0)
self.header = QFrame(self.card)
self.header.setObjectName("ClinicalAccentHeader")
self.header.setStyleSheet(WINDOW_PRIMITIVES_QSS)
header_layout = QHBoxLayout(self.header)
header_layout.setContentsMargins(20, 13, 14, 12)
title_box = QVBoxLayout()
title_box.setContentsMargins(0, 0, 0, 0)
title_box.setSpacing(2)
self.title_label = QLabel(title, self.header)
self.title_label.setObjectName("ClinicalAccentHeaderTitle")
title_box.addWidget(self.title_label)
self.subtitle_label = QLabel(subtitle, self.header)
self.subtitle_label.setObjectName("ClinicalAccentHeaderSub")
self.subtitle_label.setVisible(bool(subtitle))
title_box.addWidget(self.subtitle_label)
header_layout.addLayout(title_box, 1)
self.close_button = QToolButton(self.header)
self.close_button.setAutoRaise(True)
self.close_button.setFixedSize(30, 30)
self.close_button.setCursor(Qt.CursorShape.PointingHandCursor)
self.close_button.setIcon(icons.icon("close", "muted", 15))
self.close_button.setIconSize(QSize(15, 15))
self.close_button.clicked.connect(self.reject)
header_layout.addWidget(self.close_button)
card_layout.addWidget(self.header)
self.body_widget = QWidget(self.card)
self.body_layout = QVBoxLayout(self.body_widget)
self.body_layout.setContentsMargins(20, 16, 20, 16)
self.body_layout.setSpacing(12)
card_layout.addWidget(self.body_widget, 1)
self.footer = QFrame(self.card)
self.footer.setStyleSheet(
f"QFrame {{ background: #F7FBFA; border-top: 1px solid {PALETTE['line']};"
" border-bottom-left-radius: 16px; border-bottom-right-radius: 16px; }}"
)
self.footer_layout = QHBoxLayout(self.footer)
self.footer_layout.setContentsMargins(20, 12, 20, 12)
self.footer_layout.setSpacing(10)
card_layout.addWidget(self.footer)
outer.addWidget(self.card)
def showEvent(self, event: Any) -> None: # noqa: N802 - Qt virtual
super().showEvent(event)
if not motion.reduced_motion():
motion.fade_in(self.card)
def mousePressEvent(self, event: QMouseEvent) -> None: # noqa: N802 - Qt virtual
if event.button() == Qt.MouseButton.LeftButton and event.position().y() <= 68:
handle = self.windowHandle()
if handle is not None and handle.startSystemMove():
event.accept()
return
super().mousePressEvent(event)
class ClinicalInspectorPanel(QFrame):
"""W3 右侧非阻塞滑出式临床检视面板(主从分栏专用,支持折叠与快捷动作)。"""
closed = Signal()
def __init__(self, parent: QWidget | None = None, *, width: int = 388) -> None:
super().__init__(parent)
self.setObjectName("ClinicalInspectorPanel")
self.setStyleSheet(WINDOW_PRIMITIVES_QSS)
self._panel_width = width
self.setFixedWidth(width)
self.setSizePolicy(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Expanding)
root = QVBoxLayout(self)
root.setContentsMargins(0, 0, 0, 0)
root.setSpacing(0)
# 顶部 3px 翡翠-鎏金饰线 + 标题栏
root.addWidget(ClinicalAccentBar(self))
header = QFrame(self)
header.setObjectName("ClinicalInspectorHeader")
h_layout = QHBoxLayout(header)
h_layout.setContentsMargins(16, 12, 12, 12)
h_layout.setSpacing(8)
title_col = QVBoxLayout()
title_col.setContentsMargins(0, 0, 0, 0)
title_col.setSpacing(2)
self.title_label = QLabel("临床摘要检视", header)
self.title_label.setObjectName("ClinicalInspectorTitle")
title_col.addWidget(self.title_label)
self.subtitle_label = QLabel("单击列表行实时预览关键病历与快捷操作", header)
self.subtitle_label.setObjectName("ClinicalInspectorSubtitle")
self.subtitle_label.setWordWrap(True)
title_col.addWidget(self.subtitle_label)
h_layout.addLayout(title_col, 1)
self.close_button = QToolButton(header)
self.close_button.setAutoRaise(True)
self.close_button.setFixedSize(28, 28)
self.close_button.setCursor(Qt.CursorShape.PointingHandCursor)
self.close_button.setIcon(icons.icon("close", "muted", 14))
self.close_button.setIconSize(QSize(14, 14))
self.close_button.setToolTip("收起右侧临床检视器")
self.close_button.clicked.connect(self._handle_close)
h_layout.addWidget(self.close_button)
root.addWidget(header)
scroll = QScrollArea(self)
scroll.setWidgetResizable(True)
scroll.setFrameShape(QFrame.Shape.NoFrame)
scroll.setHorizontalScrollBarPolicy(Qt.ScrollBarPolicy.ScrollBarAlwaysOff)
content = QWidget(scroll)
self.content_layout = QVBoxLayout(content)
self.content_layout.setContentsMargins(16, 14, 16, 14)
self.content_layout.setSpacing(10)
scroll.setWidget(content)
root.addWidget(scroll, 1)
self.actions_host = QFrame(self)
self.actions_host.setStyleSheet(
f"QFrame {{ background: #F7FBFA; border-top: 1px solid {PALETTE['line']};"
" border-bottom-left-radius: 14px; border-bottom-right-radius: 14px; }}"
)
self.actions_layout = QVBoxLayout(self.actions_host)
self.actions_layout.setContentsMargins(14, 12, 14, 12)
self.actions_layout.setSpacing(8)
root.addWidget(self.actions_host)
self.hide()
def _handle_close(self) -> None:
self.hide()
self.closed.emit()
def set_summary(
self,
*,
title: str,
subtitle: str,
rows: list[tuple[str, str]],
actions: list[tuple[str, str, Any]] | None = None,
) -> None:
"""更新右侧临床检视内容并平滑展示。"""
self.title_label.setText(title or "未命名记录")
self.subtitle_label.setText(subtitle or "")
while self.content_layout.count():
item = self.content_layout.takeAt(0)
widget = item.widget()
if widget is not None:
widget.deleteLater()
summary_box = QFrame(self)
summary_box.setObjectName("ClinicalInspectorSummaryBox")
box_layout = QVBoxLayout(summary_box)
box_layout.setContentsMargins(12, 10, 12, 10)
box_layout.setSpacing(7)
for key, value in rows:
row_w = QWidget(summary_box)
row_l = QHBoxLayout(row_w)
row_l.setContentsMargins(0, 0, 0, 0)
row_l.setSpacing(8)
k_lbl = QLabel(key, row_w)
k_lbl.setStyleSheet(f"color: {PALETTE['muted']}; font-size: 12px;")
k_lbl.setFixedWidth(74)
v_lbl = QLabel(value or "—", row_w)
v_lbl.setWordWrap(True)
v_lbl.setStyleSheet(f"color: {PALETTE['heading']}; font-size: 12.5px; font-weight: 500;")
row_l.addWidget(k_lbl, 0, Qt.AlignmentFlag.AlignTop)
row_l.addWidget(v_lbl, 1)
box_layout.addWidget(row_w)
self.content_layout.addWidget(summary_box)
self.content_layout.addStretch(1)
while self.actions_layout.count():
item = self.actions_layout.takeAt(0)
widget = item.widget()
if widget is not None:
widget.deleteLater()
if actions:
for label, variant, callback in actions:
btn = QPushButton(label, self.actions_host)
btn.setProperty("variant", variant)
btn.setCursor(Qt.CursorShape.PointingHandCursor)
btn.setFixedHeight(34)
btn.clicked.connect(callback)
self.actions_layout.addWidget(btn)
self.actions_host.setVisible(bool(actions))
was_hidden = not self.isVisible()
self.show()
if was_hidden and not motion.reduced_motion():
motion.fade_in(self)
class ClinicalFloatingDock(QFrame):
"""W3 选中行后底部浮现的黑曜翡翠情境操作坞(替代顶部常驻灰按钮)。"""
def __init__(self, parent: QWidget | None = None) -> None:
super().__init__(parent)
self.setObjectName("ClinicalFloatingDock")
self.setStyleSheet(WINDOW_PRIMITIVES_QSS)
self._layout = QHBoxLayout(self)
self._layout.setContentsMargins(14, 7, 14, 7)
self._layout.setSpacing(8)
self.count_label = QLabel("已选 0 项", self)
self.count_label.setObjectName("ClinicalFloatingDockCount")
self._layout.addWidget(self.count_label)
self._buttons: list[QPushButton] = []
self.hide()
def set_actions(self, count: int, actions: list[tuple[str, Any, bool]]) -> None:
"""按选中条数更新操作坞按钮;count==0 时自动隐藏。"""
for btn in self._buttons:
self._layout.removeWidget(btn)
btn.deleteLater()
self._buttons.clear()
if count <= 0 or not actions:
self.hide()
return
self.count_label.setText(f"已选 {count} 项")
for label, callback, is_danger in actions:
btn = QPushButton(label, self)
btn.setCursor(Qt.CursorShape.PointingHandCursor)
if is_danger:
btn.setProperty("dockDanger", True)
btn.clicked.connect(callback)
self._layout.addWidget(btn)
self._buttons.append(btn)
self.adjustSize()
self.show()
self.raise_()
__all__ = [
"WINDOW_PRIMITIVES_QSS",
"ClinicalAccentBar",
"ClinicalFloatingDock",
"ClinicalInspectorPanel",
"ClinicalModalDialog",
"apply_luxury_dialog_chrome",
]
+2 -79
View File
@@ -50,17 +50,7 @@ try: # Optional by design: core-only builds must still import this module.
QWebEngineSettings,
)
from PySide6.QtWebEngineWidgets import QWebEngineView
from PySide6.QtWidgets import (
QApplication,
QFrame,
QHBoxLayout,
QLabel,
QMainWindow,
QPlainTextEdit,
QPushButton,
QVBoxLayout,
QWidget,
)
from PySide6.QtWidgets import QApplication, QMainWindow
except (ImportError, OSError) as _qt_import_error: # pragma: no cover - no Qt runtime.
QObject = QTimer = Qt = QUrl = Signal = Slot = None # type: ignore[assignment]
QWebChannel = QWebEnginePage = QWebEngineProfile = None # type: ignore[assignment]
@@ -472,74 +462,7 @@ if WEBENGINE_AVAILABLE: # pragma: no cover - GUI behavior needs an integration
self.web_view,
)
self.web_view.setPage(self._page)
# W4 双屏协同视频驾驶舱:顶部黑曜翡翠 HUD + 左侧主视频画布 + 右侧可折叠临床伴随速记侧栏
shell = QWidget(self)
shell_layout = QVBoxLayout(shell)
shell_layout.setContentsMargins(0, 0, 0, 0)
shell_layout.setSpacing(0)
hud = QFrame(shell)
hud.setObjectName("VideoCockpitHud")
hud.setFixedHeight(44)
hud.setStyleSheet(
"QFrame#VideoCockpitHud { background: qlineargradient(x1:0,y1:0,x2:1,y2:0,stop:0 #0E2B2A,stop:1 #071919);"
" border-bottom: 1px solid rgba(223,199,147,96); }"
"QLabel { color: #EFF9F8; font-size: 13px; font-weight: 600; }"
"QPushButton { min-height: 28px; max-height: 28px; padding: 0 11px; border-radius: 7px;"
" background: rgba(255,255,255,22); border: 1px solid rgba(223,199,147,96);"
" color: #DFC793; font-size: 12px; font-weight: 600; }"
"QPushButton:hover { background: rgba(24,176,165,86); color: #FFFFFF; }"
)
hud_row = QHBoxLayout(hud)
hud_row.setContentsMargins(14, 0, 14, 0)
hud_row.setSpacing(10)
mode_tag = "IM 会话" if self.open_im else "高清视频面诊"
hud_row.addWidget(QLabel(f"● {mode_tag} · {self.patient_name}", hud))
hud_row.addStretch(1)
if callable(self._on_open_diagnosis):
diag_btn = QPushButton("打开完整诊单", hud)
diag_btn.setCursor(Qt.CursorShape.PointingHandCursor)
diag_btn.clicked.connect(self._on_open_diagnosis)
hud_row.addWidget(diag_btn)
self._companion_toggle = QPushButton("四诊速记侧栏", hud)
self._companion_toggle.setCheckable(True)
self._companion_toggle.setCursor(Qt.CursorShape.PointingHandCursor)
hud_row.addWidget(self._companion_toggle)
shell_layout.addWidget(hud)
stage_row = QHBoxLayout()
stage_row.setContentsMargins(0, 0, 0, 0)
stage_row.setSpacing(0)
stage_row.addWidget(self.web_view, 1)
self._companion_rail = QFrame(shell)
self._companion_rail.setFixedWidth(320)
self._companion_rail.setStyleSheet(
"QFrame { background: #F4F9F8; border-left: 1px solid #C6DAD6; }"
"QLabel { color: #102625; }"
"QPlainTextEdit { background: #FFFFFF; border: 1px solid #C2D7D3; border-radius: 10px; padding: 8px; color: #102625; font-size: 13px; }"
)
rail_l = QVBoxLayout(self._companion_rail)
rail_l.setContentsMargins(14, 14, 14, 14)
rail_l.setSpacing(8)
r_title = QLabel("伴随四诊速记(免切窗)", self._companion_rail)
r_title.setStyleSheet("font-size: 14px; font-weight: 700; color: #102625;")
rail_l.addWidget(r_title)
chief = str(self.patient_case.get("chief_complaint") or self.patient_case.get("chief") or "").strip()
if chief:
c_lbl = QLabel(f"主诉参考:{chief}", self._companion_rail)
c_lbl.setWordWrap(True)
c_lbl.setStyleSheet("background: #E8F5F3; border-radius: 8px; padding: 8px; color: #0B6E68; font-size: 12px;")
rail_l.addWidget(c_lbl)
self._quick_scratchpad = QPlainTextEdit(self._companion_rail)
self._quick_scratchpad.setPlaceholderText("边面诊边速记舌脉、血糖波动与调方要点…")
rail_l.addWidget(self._quick_scratchpad, 1)
self._companion_rail.hide()
self._companion_toggle.toggled.connect(self._companion_rail.setVisible)
stage_row.addWidget(self._companion_rail)
shell_layout.addLayout(stage_row, 1)
self.setCentralWidget(shell)
self.setCentralWidget(self.web_view)
self._configure_settings(self._page.settings())
self._bridge = _QtVideoBridge(
+5 -5
View File
@@ -296,19 +296,19 @@ def test_page_typography_remains_compact_and_chrome_restores(
assert page.header.subtitle_label.font().pixelSize() == 13
assert page.more_filters_button.font().pixelSize() == 13
assert shell.sidebar.width() == 208
assert shell.topbar.height() == 60
assert shell.topbar.height() == 76
assert shell.navigate("reception")
_settle(application)
assert shell.sidebar.width() == 208
assert shell.topbar.height() == 60
assert shell.topbar.height() == 76
assert shell.navigate("patients")
_settle(application)
assert shell.sidebar.width() == 208
assert shell.topbar.height() == 60
assert shell.topbar.height() == 76
assert shell.navigate("prescriptions")
_settle(application)
assert shell.sidebar.width() == 208
assert shell.topbar.height() == 60
assert shell.topbar.height() == 76
assert shell.navigate("legacy_reference")
_settle(application)
assert shell.sidebar.width() == 190
@@ -321,6 +321,6 @@ def test_page_typography_remains_compact_and_chrome_restores(
assert shell.navigate("appointments")
_settle(application)
assert shell.sidebar.width() == 208
assert shell.topbar.height() == 60
assert shell.topbar.height() == 76
assert page.header.title_label.font().pixelSize() == 20
assert application.styleSheet() == original_qss
+4 -8
View File
@@ -105,7 +105,7 @@ def test_blue_metrics_are_opt_in_and_expand_for_complete_content(application: QA
blue.set_rows([row, single, long])
legacy.set_rows([row])
assert blue.model.columnCount() == 12
assert [blue.main.columnWidth(i) for i in range(10)] == [46, 62, 70, 88, 244, 70, 84, 76, 70, 92]
assert [blue.main.columnWidth(i) for i in range(10)] == [48, 70, 82, 102, 244, 90, 84, 90, 88, 122]
assert blue.main.horizontalHeader().height() == 41
assert legacy.main.horizontalHeader().height() == 39
assert blue.main.rowHeight(0) == 108
@@ -149,11 +149,7 @@ def test_followup_paint_keeps_time_whole_and_preserves_density(
host.show()
_settle(application)
try:
actual_width = host.main.columnWidth(6)
if size[0] == 1024:
assert actual_width == column_width
else:
assert actual_width >= column_width
assert host.main.columnWidth(6) == column_width
assert host.main.rowHeight(0) == row_height
assert host.fixed.rowHeight(0) == row_height
index = host.model.index(0, 6)
@@ -161,8 +157,8 @@ def test_followup_paint_keeps_time_whole_and_preserves_density(
assert index.data() == full_text
assert index.data(Qt.ItemDataRole.ToolTipRole) == full_text
option = QStyleOptionViewItem()
option.rect = QRect(0, 0, actual_width, row_height)
image = QImage(actual_width, row_height, QImage.Format.Format_ARGB32)
option.rect = QRect(0, 0, column_width, row_height)
image = QImage(column_width, row_height, QImage.Format.Format_ARGB32)
painter = RecordingPainter(image)
host.main.itemDelegate().paint(painter, option, index)
painter.end()
+23 -16
View File
@@ -98,17 +98,17 @@ def test_approved_chrome_restores_styles_fonts_icons_and_geometry(
assert window.navigate(key)
application.processEvents()
assert window.sidebar.width() == 208
assert _pixel(window, 6, 300) == TECH_BLUE["sidebar"].upper()
assert _pixel(window.sidebar, 5, 300) == TECH_BLUE["sidebar"].upper()
assert _pixel(window, 6, 300) == "#F3F7FD"
assert _pixel(window.sidebar, 5, 300) == "#F3F7FD"
assert _pixel(window.workspace, 600, 10) == TECH_BLUE["surface"]
assert window.nav_buttons[key].font().family() == body_family()
assert window.nav_buttons[key].font().weight() in (QFont.Weight.Normal, QFont.Weight.Medium, QFont.Weight.DemiBold)
assert window.nav_buttons[key].font().weight() == QFont.Weight.Normal
assert window.brand_name.font().family() == heading_family()
assert window.brand_name.font().weight() == QFont.Weight.DemiBold
assert window.assistant_glyph.property("receptionTechBlue") is True
assert window.assistant_status.property("receptionTechBlue") is True
assert original_avatar != window.user_menu_button.icon().pixmap(34, 34).toImage()
assert not window.ai_top_button.icon().isNull()
assert original_ai != window.ai_top_button.icon().pixmap(18, 18).toImage()
assert (
original_nav
!= window.nav_buttons["reception"]
@@ -155,9 +155,10 @@ def test_selected_navigation_and_ai_tile_use_approved_blue(
button = window.nav_buttons[key]
button.clearFocus()
application.processEvents()
assert _pixel(button, button.width() - 12, button.height() // 2) == TECH_BLUE["surface"]
assert _pixel(window.assistant_glyph, 10, 10) != TECH_BLUE["sidebar"].upper()
assert _pixel(window.assistant_status, 3, 9) == "#54E6C1"
assert _pixel(button, 1, button.height() // 2) == TECH_BLUE["accent"]
assert _pixel(button, button.width() - 12, button.height() // 2) == TECH_BLUE["selection"]
assert _pixel(window.assistant_glyph, 10, 25) == TECH_BLUE["accent"]
assert _pixel(window.assistant_status, 3, 9) == TECH_BLUE["accent"]
@pytest.mark.parametrize("key", ["appointments", "consultations", "reception", "patients", "prescriptions", "prescription_library"])
@@ -171,7 +172,10 @@ def test_approved_brand_mark_uses_blue_medical_cross_and_restores_original(
assert window.navigate(key)
application.processEvents()
assert mark.property("receptionTechBlue") is True
assert mark.width() == mark.height() == 36
assert mark.width() == mark.height() == 38
assert _pixel(mark, 5, 18) == TECH_BLUE["accent"]
assert _pixel(mark, 19, 19) == TECH_BLUE["accent"]
assert _pixel(mark, 18, 9) == TECH_BLUE["surface"]
assert original != mark.grab().toImage()
assert window.navigate("legacy_reference")
application.processEvents()
@@ -253,18 +257,21 @@ def test_approved_shell_geometry_and_function_entries_restore(
assert window.navigate(key)
application.processEvents()
assert window.workspace.pos() == QPoint(208, 0)
assert window.topbar.height() == 60
assert window.topbar.height() == 76
assert window.centralWidget().layout().contentsMargins().isNull()
assert window.search_host.size() == QSize(340, 38)
assert window.assistant_card.height() == 124
assert window.assistant_button.height() == 34
assert window.search_host.mapTo(window, QPoint()) == QPoint(234, 15)
assert window.search_host.size() == QSize(384, 44)
assert window.assistant_card.mapTo(window, QPoint()) == QPoint(20, 776)
assert window.assistant_card.size() == QSize(168, 132)
assert window.assistant_button.height() == 36
assert window.brand_name.font().pixelSize() == 16
assert window.brand_subtitle.font().pixelSize() == 12
for button in window.nav_buttons.values():
for index, button in enumerate(window.nav_buttons.values()):
assert button.mapTo(window, QPoint()).y() == 99 + 48 * index
assert button.height() == 44
assert button.font().pixelSize() == 14
assert button.iconSize() == QSize(20, 20)
assert window.fold_button.isVisible()
assert not window.fold_button.isVisible()
assert not window.ai_top_button.isVisible()
assert window.menu_sidebar_action.isVisible()
assert window.menu_ai_action.isVisible()
@@ -312,7 +319,7 @@ def test_minimum_window_keeps_search_and_all_chrome_actions_separate(
window.resize(1024, 640)
application.processEvents()
assert window.width() == 1024
assert 200 <= window.search_host.width() <= 340
assert 220 <= window.search_host.width() < 384
controls = (
window.search_host, window.refresh_button, window.notification_button,
window.settings_button, window.user_menu_button, window.minimize_button,
@@ -323,7 +330,7 @@ def test_minimum_window_keeps_search_and_all_chrome_actions_separate(
assert right.x() + right.width() <= window.topbar.width()
window.resize(1536, 960)
application.processEvents()
assert window.search_host.size() == QSize(340, 38)
assert window.search_host.size() == QSize(384, 44)
def test_refresh_animation_keeps_running_and_restores_palette_on_page_switch(
+2 -2
View File
@@ -558,7 +558,7 @@ def test_shell_hides_global_ai_entries_without_ai_permission(
assert window.menu_sidebar_action.isVisible()
assert window._active_page_key == key
assert window.sidebar.width() == 208
assert window.topbar.height() == 60
assert window.topbar.height() == 76
assert window.centralWidget().layout().contentsMargins().isNull()
window.close()
@@ -838,7 +838,7 @@ def test_approved_pages_share_shell_geometry_and_other_pages_restore(
)
if key in {"appointments", "consultations", "reception", "patients", "prescriptions", "prescription_library"}:
assert geometry == (208, 208, shell_window.width() - 208, shell_window.width() - 208)
assert shell_window.topbar.height() == 60
assert shell_window.topbar.height() == 76
assert shell_window.workspace.y() == 0
else:
assert geometry == (190, 203, shell_window.width() - 216, shell_window.width() - 216)
+3 -4
View File
@@ -19,7 +19,7 @@ endobj
<< /Type /Page /Parent 2 0 R /MediaBox [0 0 595 842] /Resources << /Font << /F1 3 0 R >> >> /Contents 7 0 R >>
endobj
7 0 obj
<< /Length 1969>>
<< /Length 1889>>
stream
BT /F1 20 Tf 1 0 0 1 235 795 Tm <4e2d533b590465b97b3a> Tj ET
BT /F1 12 Tf 1 0 0 1 170 770 Tm <6c997bb16d4b8bd565874ef6002000b700204e0d75284e8e6b635f0f53d1836f> Tj ET
@@ -33,8 +33,7 @@ BT /F1 11 Tf 1 0 0 1 45 630 Tm <836f54c100200032ff1a752891cf002000360020002f0020
BT /F1 11 Tf 1 0 0 1 45 612 Tm <53556b21888b6570ff1a0033> Tj ET
BT /F1 11 Tf 1 0 0 1 45 594 Tm <4ee3714eff1a5426> Tj ET
BT /F1 11 Tf 1 0 0 1 45 576 Tm <8f8565b953556b21888b6570ff1a0034> Tj ET
BT /F1 11 Tf 1 0 0 1 45 558 Tm <8f8565b965b9540dff1a8f8552a965b96a21677f> Tj ET
BT /F1 11 Tf 1 0 0 1 45 540 Tm <8f8565b9670d752859296570ff1a0038> Tj ET
BT /F1 11 Tf 1 0 0 1 45 558 Tm <8f8565b9670d752859296570ff1a0038> Tj ET
0.7 w 45 133 m 550 133 l S
BT /F1 12 Tf 1 0 0 1 45 110 Tm <5f0065b9533b5e08ff1a6d4b8bd5533b5e08> Tj ET
BT /F1 11 Tf 1 0 0 1 420 104 Tm <533b5e0875355b507b7e7ae0> Tj ET
@@ -55,5 +54,5 @@ xref
0000000735 00000 n
trailer << /Size 8 /Root 1 0 R >>
startxref
2754
2674
%%EOF
@@ -325,7 +325,6 @@ class PrescriptionLists extends BaseAdminDataLists implements ListsSearchInterfa
$rid = (int) $item['id'];
$item['can_void'] = empty($item['void_status'])
&& PrescriptionLogic::hasVoidAccess($item, $this->adminId, $this->adminInfo, $voidAccess)
&& !PrescriptionLogic::hasBlockingVoidOrder($item, $ordersByPrescription[$rid] ?? [])
&& (empty($ordersByPrescription[$rid]) || PrescriptionOrderLogic::remoteSnapshotLockErrorForPrescription($rid) === null);
$item['can_restore_rejected'] = PrescriptionLogic::canRestoreRejected($item);
$item = PrescriptionLogic::withSigningStatus($item, $this->adminId, $maySubmit);
@@ -248,7 +248,8 @@ class PrescriptionLogic
!in_array((int) $order['fulfillment_status'], PrescriptionOrder::RELEASED_PRESCRIPTION_STATUSES, true)) !== [];
$row['has_prescription_order'] = $hasBizOrder ? 1 : 0;
$row['can_restore_rejected'] = self::canRestoreRejected($row);
$row['can_void'] = empty($row['void_status']) && !self::hasBlockingVoidOrder($row, $orders)
// 作废不再受审核、签署或订单状态限制;仅已提交药房的订单(须先远端取消)会阻止作废。
$row['can_void'] = empty($row['void_status'])
&& self::hasVoidAccess(
$row,
$viewerAdminId,
@@ -260,24 +261,6 @@ class PrescriptionLogic
return $row;
}
/** Pending prescriptions can be voided while any active order is still waiting for both reviews. */
public static function hasBlockingVoidOrder(array $prescription, array $orders): bool
{
foreach ($orders as $order) {
$fulfillmentStatus = (int) ($order['fulfillment_status'] ?? -1);
if (in_array($fulfillmentStatus, PrescriptionOrder::RELEASED_PRESCRIPTION_STATUSES, true)) {
continue;
}
if ($fulfillmentStatus !== 1
|| !in_array($order['prescription_audit_status'] ?? null, [0, '0'], true)
|| !in_array($order['payment_slip_audit_status'] ?? null, [0, '0'], true)
|| !PrescriptionEsignPolicy::isPendingReview($prescription)) {
return true;
}
}
return false;
}
private static function generateSn(): string
{
return 'RX' . date('Ymd') . str_pad((string)mt_rand(1, 9999), 4, '0', STR_PAD_LEFT);
@@ -539,7 +522,8 @@ class PrescriptionLogic
$data['esign_status'] = 'pending';
}
try {
return Db::transaction(static function () use ($data, $params, $adminId, $adminInfo, $diagnosisIdRule, $dateYmd): int {
$relinkedOrderIds = [];
$newId = Db::transaction(static function () use ($data, $params, $adminId, $adminInfo, $diagnosisIdRule, $dateYmd, &$relinkedOrderIds): int {
$replayed = PrescriptionAiRequest::replay($params, $adminId, true);
if ($replayed !== null) {
return $replayed;
@@ -553,6 +537,8 @@ class PrescriptionLogic
$prescription = new Prescription();
$prescription->save($data);
$id = (int) $prescription->id;
// 原处方作废后挂起的业务订单,随本次重新开方自动关联到新处方。
$relinkedOrderIds = PrescriptionOrderLogic::relinkOrdersToReissue($diagnosisIdRule, $id, $data['sn'], $adminId, $adminInfo);
// Read database defaults and JSON exactly as workers will fingerprint them.
$saved = Db::name('tcm_prescription')->where('id', $id)->find();
self::scheduleAiSaved($saved, $adminId, $adminInfo,
@@ -560,6 +546,10 @@ class PrescriptionLogic
PrescriptionAiRequest::complete($params, $adminId, $id);
return $id;
});
foreach ($relinkedOrderIds as $orderId) {
\app\common\service\tcm\RevisitDueHook::onOrderChanged($diagnosisIdRule, $orderId, 'reissue');
}
return $newId;
} catch (\Throwable $e) {
self::setError($e instanceof \DomainException ? $e->getMessage() : '处方保存失败,请稍后重试');
return null;
@@ -1456,17 +1446,14 @@ class PrescriptionLogic
self::setError('处方审核状态已变化,请刷新列表后查看');
return false;
}
if (self::hasBlockingVoidOrder($row->toArray(), $orders)) {
self::setError('关联业务订单的审核或履约状态不允许作废此处方');
return false;
}
$row->void_status = 1;
$row->void_time = time();
$row->void_by = $adminId;
$row->void_by_name = (string) ($adminInfo['name'] ?? '');
$saved = (bool) $row->save();
if ($saved) {
// 关联订单挂起,待同诊单重新开方后自动关联新处方。
PrescriptionOrderLogic::holdOrdersForReissue($row->toArray(), $orders, $adminId, $adminInfo);
PrescriptionAiStore::invalidate($id, 'voided');
}
return $saved;
@@ -5886,6 +5886,66 @@ class PrescriptionOrderLogic
];
}
/** 处方作废时可随重新开方迁移的订单状态:待审核(1)、履约中(2);已发货/已完成的订单按原处方留档。 */
private const REISSUE_FOLLOW_STATUSES = [1, 2];
/**
* 处方作废后挂起关联的业务订单:处方审核退回待审核、履约中退回待审核,等待同诊单重新开方后自动关联新处方。
* 由 PrescriptionLogic::void 在处方与订单的同一锁内调用。
*
* @param array<int, array<string, mixed>> $orders 已加锁的订单行
*/
public static function holdOrdersForReissue(array $voided, array $orders, int $adminId, array $adminInfo): void
{
$sn = (string) ($voided['sn'] ?? '');
foreach ($orders as $order) {
if (!in_array((int) ($order['fulfillment_status'] ?? 0), self::REISSUE_FOLLOW_STATUSES, true)) {
continue;
}
$updates = ['reissue_from_prescription_id' => (int) $voided['id'],
'prescription_audit_status' => 0, 'prescription_audit_remark' => '', 'update_time' => time()];
if ((int) $order['fulfillment_status'] === 2) {
$updates['fulfillment_status'] = 1;
}
Db::name('tcm_prescription_order')->where('id', (int) $order['id'])->update($updates);
self::writeLog((int) $order['id'], $adminId, $adminInfo, 'rx_void_hold',
"处方 {$sn} 已作废,订单处方审核重置为待审核;同诊单重新开方后将自动关联新处方", true);
}
}
/**
* 新处方保存后,把同诊单中因处方作废而挂起的订单关联到新处方。在开方事务内调用。
*
* @return int[] 已改关联的订单 ID
*/
public static function relinkOrdersToReissue(int $diagnosisId, int $prescriptionId, string $sn, int $adminId, array $adminInfo): array
{
if ($diagnosisId <= 0) {
return [];
}
$orders = Db::name('tcm_prescription_order')->alias('o')
->join([Db::name('tcm_prescription')->getTable() => 'p'], 'p.id = o.prescription_id')
->where('o.diagnosis_id', $diagnosisId)->where('o.reissue_from_prescription_id', '>', 0)
->whereColumn('o.reissue_from_prescription_id', '=', 'o.prescription_id')
->where('p.void_status', 1)->whereNull('o.delete_time')
->whereNotIn('o.fulfillment_status', PrescriptionOrder::RELEASED_PRESCRIPTION_STATUSES)
->field('o.*,p.sn AS voided_sn')->order('o.id')->lock(true)->select()->toArray();
$relinked = [];
foreach ($orders as $order) {
if (PharmacyRemoteSnapshotPolicy::isLocked($order, PharmacySubmissionClaimService::claimForOrder((int) $order['id']))) {
continue; // 已提交药房的订单不改处方,须先完成远端取消。
}
Db::name('tcm_prescription_order')->where('id', (int) $order['id'])->update([
'prescription_id' => $prescriptionId, 'reissue_from_prescription_id' => 0,
'prescription_audit_status' => 0, 'prescription_audit_remark' => '', 'update_time' => time(),
]);
self::writeLog((int) $order['id'], $adminId, $adminInfo, 'rx_reissue_link',
"重新开方 {$sn},自动关联新处方(原处方 {$order['voided_sn']} 已作废)", true);
$relinked[] = (int) $order['id'];
}
return $relinked;
}
private static function writeLog(
int $orderId,
int $adminId,
@@ -79,6 +79,9 @@ final class PrescriptionPdf
$label = ['dosage_amount' => '单次用量', 'dosage_bag_count' => '单次袋数', 'need_decoction' => '代煎',
'times_per_day' => '每日次数', 'usage_days' => '服用天数',
'prescription_name' => '方名'][$key] ?? $key;
if ($key === 'prescription_name') {
continue; // 辅方方名仅内部使用,不提交签署原文。
}
if ($key === 'need_decoction') {
// 辅方不代煎(0)时不写;代煎时与主方一样显示「是」。
if ((int) $value === 0) {
@@ -0,0 +1,11 @@
-- 处方作废后,关联的业务订单挂起并记录原处方 ID;同诊单重新开方时自动改关联到新处方(PrescriptionOrderLogic::relinkOrdersToReissue)。
SET @has_reissue_from = (
SELECT COUNT(*) FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'zyt_tcm_prescription_order' AND COLUMN_NAME = 'reissue_from_prescription_id'
);
SET @ddl = IF(@has_reissue_from = 0, 'ALTER TABLE `zyt_tcm_prescription_order`
ADD COLUMN `reissue_from_prescription_id` int unsigned NOT NULL DEFAULT 0 COMMENT ''处方作废后待重新开方关联:原处方 ID,0 表示无'',
ADD KEY `idx_order_reissue` (`diagnosis_id`, `reissue_from_prescription_id`)', 'SELECT 1');
PREPARE stmt FROM @ddl;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
@@ -1 +1 @@
import t from"./error--OD9Gfho.js";import{o,q as r,r as a,v as n,D as c,s}from"./.pnpm-DnXobOVo.js";import"./index-B5yNocKV.js";const p="/admin/assets/no_perms-jDxcYpYC.png",i={class:"error404"},x=o({__name:"403",setup(m){return(_,e)=>(r(),a("div",i,[n(t,{code:"403",title:"您的账号权限不足,请联系管理员添加权限!","show-btn":!1},{content:c(()=>[...e[0]||(e[0]=[s("div",{class:"flex justify-center"},[s("img",{class:"w-[150px] h-[150px]",src:p,alt:""})],-1)])]),_:1})]))}});export{x as default};
import t from"./error-H4PA8MMH.js";import{o,q as r,r as a,v as n,D as c,s}from"./.pnpm-DnXobOVo.js";import"./index-CtDDMof-.js";const p="/admin/assets/no_perms-jDxcYpYC.png",i={class:"error404"},x=o({__name:"403",setup(m){return(_,e)=>(r(),a("div",i,[n(t,{code:"403",title:"您的账号权限不足,请联系管理员添加权限!","show-btn":!1},{content:c(()=>[...e[0]||(e[0]=[s("div",{class:"flex justify-center"},[s("img",{class:"w-[150px] h-[150px]",src:p,alt:""})],-1)])]),_:1})]))}});export{x as default};
@@ -1 +1 @@
import e from"./error--OD9Gfho.js";import{o,q as r,r as t,v as s}from"./.pnpm-DnXobOVo.js";import"./index-B5yNocKV.js";const a={class:"error404"},d=o({__name:"404",setup(c){return(n,_)=>(r(),t("div",a,[s(e,{code:"404",title:"哎呀,出错了!您访问的页面不存在…"})]))}});export{d as default};
import e from"./error-H4PA8MMH.js";import{o,q as r,r as t,v as s}from"./.pnpm-DnXobOVo.js";import"./index-CtDDMof-.js";const a={class:"error404"},d=o({__name:"404",setup(c){return(n,_)=>(r(),t("div",a,[s(e,{code:"404",title:"哎呀,出错了!您访问的页面不存在…"})]))}});export{d as default};
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
import{o as C,R as D,q as d,r as I,ag as N,O as u,bn as B,D as o,v as l,bo as E,bp as L,L as i,T as r,s as p,bq as R,M as w}from"./.pnpm-DnXobOVo.js";import{a as V}from"./doctor-B7efth9T.js";import{s as q,_ as A}from"./index-B5yNocKV.js";const M={class:"appointment-record-panel"},P={class:"cell-stack"},$={class:"font-medium"},O={class:"text-gray-500 text-sm"},j={class:"cell-stack"},F={class:"text-gray-500 text-sm"},G=C({__name:"AppointmentRecordPanel",props:{diagnosisId:{}},setup(v,{expose:y}){const f=v,m=w(!1),g=w([]),h=w({});function x(t){return t?String(t).length>=8?String(t).slice(0,5):t:""}function k(t){return t==="morning"?"上午":t==="afternoon"?"下午":t==="all"?"全天":t||"—"}function S(t){const n=t.channel_source??t.channels??"";if(n===""||n===null||n===void 0)return"—";const a=String(n),s=h.value[a]||a,c=String(t.channel_source_detail??"").trim();return c!==""?`${s}(${c})`:s}function T(t){return[...t].sort((n,a)=>{const s=String(n.appointment_date||""),c=String(a.appointment_date||"");if(s!==c)return c.localeCompare(s);const _=String(n.appointment_time||""),e=String(a.appointment_time||"");return _!==e?e.localeCompare(_):Number(a.id||0)-Number(n.id||0)})}const z=async()=>{try{const t=await q({type:"channels"}),n=((t==null?void 0:t.channels)||[]).filter(s=>s.status!==0),a={};for(const s of n)s.value!=null&&(a[String(s.value)]=s.name||String(s.value));h.value=a}catch{h.value={}}},b=async()=>{if(f.diagnosisId){m.value=!0;try{await z();const t=await V({patient_id:f.diagnosisId,diag_scope_relax:1,page_no:1,page_size:500}),n=(t==null?void 0:t.lists)||[];g.value=T(n)}catch(t){console.error(t),g.value=[]}finally{m.value=!1}}};return D(()=>f.diagnosisId,()=>{b()},{immediate:!0}),y({refresh:b}),(t,n)=>{const a=E,s=L,c=B,_=R;return d(),I("div",M,[N((d(),u(c,{data:g.value,border:"",stripe:"","empty-text":"暂无挂号记录"},{default:o(()=>[l(a,{label:"ID",prop:"id",width:"72",align:"center"}),l(a,{label:"状态",width:"100",align:"center"},{default:o(({row:e})=>[l(s,{type:e.status===1?"success":e.status===2?"info":e.status===3?"primary":"danger",size:"small",effect:"light"},{default:o(()=>[i(r(e.status_desc||"—"),1)]),_:2},1032,["type"])]),_:1}),l(a,{label:"患者(挂号人)","min-width":"150"},{default:o(({row:e})=>[p("div",P,[p("span",$,r(e.patient_name||"—"),1),p("span",O,r(e.patient_phone||""),1)])]),_:1}),l(a,{label:"挂号医生",prop:"doctor_name",width:"110","show-overflow-tooltip":""}),l(a,{label:"挂号助理",width:"110","show-overflow-tooltip":""},{default:o(({row:e})=>[i(r(e.assistant_name||"—"),1)]),_:1}),l(a,{label:"预约时间","min-width":"130"},{default:o(({row:e})=>[p("div",j,[p("span",null,r(e.appointment_date||"—"),1),p("span",F,r(x(e.appointment_time)),1)])]),_:1}),l(a,{label:"时段",width:"80",align:"center"},{default:o(({row:e})=>[i(r(k(e.period)),1)]),_:1}),l(a,{label:"类型",width:"100","show-overflow-tooltip":""},{default:o(({row:e})=>[i(r(e.appointment_type_desc||"—"),1)]),_:1}),l(a,{label:"渠道",width:"110","show-overflow-tooltip":""},{default:o(({row:e})=>[i(r(S(e)),1)]),_:1}),l(a,{label:"确认诊单",width:"92",align:"center"},{default:o(({row:e})=>[e.diagnosis_confirmed?(d(),u(s,{key:0,type:"success",size:"small",effect:"plain"},{default:o(()=>[...n[0]||(n[0]=[i("已确认",-1)])]),_:1})):(d(),u(s,{key:1,type:"warning",size:"small",effect:"plain"},{default:o(()=>[...n[1]||(n[1]=[i("未确认",-1)])]),_:1}))]),_:1}),l(a,{label:"开方",width:"80",align:"center"},{default:o(({row:e})=>[e.has_prescription?(d(),u(s,{key:0,type:"success",size:"small",effect:"plain"},{default:o(()=>[...n[2]||(n[2]=[i("已开方",-1)])]),_:1})):(d(),u(s,{key:1,type:"info",size:"small",effect:"plain"},{default:o(()=>[...n[3]||(n[3]=[i("未开方",-1)])]),_:1}))]),_:1}),l(a,{label:"备注",prop:"remark","min-width":"100","show-overflow-tooltip":""}),l(a,{label:"创建时间",width:"165",prop:"create_time"})]),_:1},8,["data"])),[[_,m.value]])])}}}),Q=A(G,[["__scopeId","data-v-4de87dfa"]]);export{Q as default};
import{o as C,R as D,q as d,r as I,ag as N,O as u,bn as B,D as o,v as l,bo as E,bp as L,L as i,T as r,s as p,bq as R,M as w}from"./.pnpm-DnXobOVo.js";import{a as V}from"./doctor-ByMfF4JT.js";import{s as q,_ as A}from"./index-CtDDMof-.js";const M={class:"appointment-record-panel"},P={class:"cell-stack"},$={class:"font-medium"},O={class:"text-gray-500 text-sm"},j={class:"cell-stack"},F={class:"text-gray-500 text-sm"},G=C({__name:"AppointmentRecordPanel",props:{diagnosisId:{}},setup(v,{expose:y}){const f=v,m=w(!1),g=w([]),h=w({});function x(t){return t?String(t).length>=8?String(t).slice(0,5):t:""}function k(t){return t==="morning"?"上午":t==="afternoon"?"下午":t==="all"?"全天":t||"—"}function S(t){const n=t.channel_source??t.channels??"";if(n===""||n===null||n===void 0)return"—";const a=String(n),s=h.value[a]||a,c=String(t.channel_source_detail??"").trim();return c!==""?`${s}(${c})`:s}function T(t){return[...t].sort((n,a)=>{const s=String(n.appointment_date||""),c=String(a.appointment_date||"");if(s!==c)return c.localeCompare(s);const _=String(n.appointment_time||""),e=String(a.appointment_time||"");return _!==e?e.localeCompare(_):Number(a.id||0)-Number(n.id||0)})}const z=async()=>{try{const t=await q({type:"channels"}),n=((t==null?void 0:t.channels)||[]).filter(s=>s.status!==0),a={};for(const s of n)s.value!=null&&(a[String(s.value)]=s.name||String(s.value));h.value=a}catch{h.value={}}},b=async()=>{if(f.diagnosisId){m.value=!0;try{await z();const t=await V({patient_id:f.diagnosisId,diag_scope_relax:1,page_no:1,page_size:500}),n=(t==null?void 0:t.lists)||[];g.value=T(n)}catch(t){console.error(t),g.value=[]}finally{m.value=!1}}};return D(()=>f.diagnosisId,()=>{b()},{immediate:!0}),y({refresh:b}),(t,n)=>{const a=E,s=L,c=B,_=R;return d(),I("div",M,[N((d(),u(c,{data:g.value,border:"",stripe:"","empty-text":"暂无挂号记录"},{default:o(()=>[l(a,{label:"ID",prop:"id",width:"72",align:"center"}),l(a,{label:"状态",width:"100",align:"center"},{default:o(({row:e})=>[l(s,{type:e.status===1?"success":e.status===2?"info":e.status===3?"primary":"danger",size:"small",effect:"light"},{default:o(()=>[i(r(e.status_desc||"—"),1)]),_:2},1032,["type"])]),_:1}),l(a,{label:"患者(挂号人)","min-width":"150"},{default:o(({row:e})=>[p("div",P,[p("span",$,r(e.patient_name||"—"),1),p("span",O,r(e.patient_phone||""),1)])]),_:1}),l(a,{label:"挂号医生",prop:"doctor_name",width:"110","show-overflow-tooltip":""}),l(a,{label:"挂号助理",width:"110","show-overflow-tooltip":""},{default:o(({row:e})=>[i(r(e.assistant_name||"—"),1)]),_:1}),l(a,{label:"预约时间","min-width":"130"},{default:o(({row:e})=>[p("div",j,[p("span",null,r(e.appointment_date||"—"),1),p("span",F,r(x(e.appointment_time)),1)])]),_:1}),l(a,{label:"时段",width:"80",align:"center"},{default:o(({row:e})=>[i(r(k(e.period)),1)]),_:1}),l(a,{label:"类型",width:"100","show-overflow-tooltip":""},{default:o(({row:e})=>[i(r(e.appointment_type_desc||"—"),1)]),_:1}),l(a,{label:"渠道",width:"110","show-overflow-tooltip":""},{default:o(({row:e})=>[i(r(S(e)),1)]),_:1}),l(a,{label:"确认诊单",width:"92",align:"center"},{default:o(({row:e})=>[e.diagnosis_confirmed?(d(),u(s,{key:0,type:"success",size:"small",effect:"plain"},{default:o(()=>[...n[0]||(n[0]=[i("已确认",-1)])]),_:1})):(d(),u(s,{key:1,type:"warning",size:"small",effect:"plain"},{default:o(()=>[...n[1]||(n[1]=[i("未确认",-1)])]),_:1}))]),_:1}),l(a,{label:"开方",width:"80",align:"center"},{default:o(({row:e})=>[e.has_prescription?(d(),u(s,{key:0,type:"success",size:"small",effect:"plain"},{default:o(()=>[...n[2]||(n[2]=[i("已开方",-1)])]),_:1})):(d(),u(s,{key:1,type:"info",size:"small",effect:"plain"},{default:o(()=>[...n[3]||(n[3]=[i("未开方",-1)])]),_:1}))]),_:1}),l(a,{label:"备注",prop:"remark","min-width":"100","show-overflow-tooltip":""}),l(a,{label:"创建时间",width:"165",prop:"create_time"})]),_:1},8,["data"])),[[_,m.value]])])}}}),Q=A(G,[["__scopeId","data-v-4de87dfa"]]);export{Q as default};
@@ -1 +1 @@
import{o as $,R as D,q as c,r as u,ag as F,O as L,bn as E,D as o,v as s,bo as P,L as _,T as d,F as A,bp as B,P as V,s as v,a5 as q,w as M,u as N,cl as w,bq as z,M as x}from"./.pnpm-DnXobOVo.js";import{bz as K,_ as H}from"./index-B5yNocKV.js";const O={class:"assign-log-panel"},R={key:0,class:"assign-log-inherit-slot"},Y={key:1,class:"text-gray-400"},j=$({__name:"AssignLogPanel",props:{diagnosisId:{}},setup(y,{expose:S}){const m=y,p=x(!1),f=x([]);function T(n){const t=n.related_po_creator_name;if(t!=null&&String(t).trim()!=="")return String(t);const e=Number(n.related_po_creator_id);return Number.isFinite(e)&&e>0?`ID:${e}`:"—"}function k(n){const t=n.related_po_create_time_text;if(t!=null&&String(t).trim()!=="")return String(t);const e=Number(n.related_po_create_time);if(!Number.isFinite(e)||e<=0)return"—";const a=new Date(e*1e3);if(Number.isNaN(a.getTime()))return"—";const i=l=>String(l).padStart(2,"0");return`${a.getFullYear()}-${i(a.getMonth()+1)}-${i(a.getDate())} ${i(a.getHours())}:${i(a.getMinutes())}:${i(a.getSeconds())}`}function g(n){const t=n.inherit_visit_slot_text;if(t!=null&&String(t).trim()!=="")return String(t);const e=Number(n.inherit_visit_slot_calc_time);if(!Number.isFinite(e)||e<=0)return"";const a=Number(n.inherit_visit_slot);return Number.isFinite(a)&&a>0?`继承时第 ${a} 诊`:"继承时未成交"}function b(n,t){const e=t==="from"?"from_assistant_name":"to_assistant_name",a=t==="from"?"from_assistant_id":"to_assistant_id",i=n[e];if(i!=null&&String(i).trim()!==""&&String(i)!=="—")return String(i);const l=Number(n[a]);return Number.isFinite(l)&&l>0?`ID:${l}`:"—"}const h=async()=>{if(m.diagnosisId){p.value=!0;try{const n=await K({id:m.diagnosisId}),t=Array.isArray(n)?n:[];f.value=t}catch(n){console.error(n),f.value=[]}finally{p.value=!1}}};return D(()=>m.diagnosisId,()=>{h()},{immediate:!0}),S({refresh:h}),(n,t)=>{const e=P,a=M,i=q,l=B,C=E,I=z;return c(),u("div",O,[F((c(),L(C,{data:f.value,border:"",stripe:"","empty-text":"暂无指派记录"},{default:o(()=>[s(e,{label:"操作时间",width:"175",prop:"create_time_text"}),s(e,{label:"原医助","min-width":"120"},{default:o(({row:r})=>[_(d(b(r,"from")),1)]),_:1}),s(e,{label:"新医助","min-width":"120"},{default:o(({row:r})=>[_(d(b(r,"to")),1)]),_:1}),s(e,{label:"继承",width:"118",align:"center"},{header:o(()=>[t[0]||(t[0]=v("span",null,"继承",-1)),s(i,{placement:"top",content:"继承时第 k 诊:继承时刻之前患者已完成的诊次(有效实单数 + 偏移),复诊接诊率从第 k+1 诊起计入新医助分母;2026-10 前的继承记录无此快照"},{default:o(()=>[s(a,{class:"assign-log-col-hint"},{default:o(()=>[s(N(w))]),_:1})]),_:1})]),default:o(({row:r})=>[Number(r.is_inherit)===1?(c(),u(A,{key:0},[s(l,{type:"success",size:"small"},{default:o(()=>[...t[1]||(t[1]=[_("是",-1)])]),_:1}),g(r)?(c(),u("div",R,d(g(r)),1)):V("",!0)],64)):(c(),u("span",Y,"否"))]),_:1}),s(e,{label:"快照·业务单创建人","min-width":"130","show-overflow-tooltip":""},{default:o(({row:r})=>[_(d(T(r)),1)]),_:1}),s(e,{label:"快照·业务单创建时间",width:"190"},{header:o(()=>[t[2]||(t[2]=v("span",null,"快照·业务单创建时间",-1)),s(i,{placement:"top",content:"related_po_create_time:触发本次操作的处方业务订单 create_time;与原文助一致时表示医助创建订单时间"},{default:o(()=>[s(a,{class:"assign-log-col-hint"},{default:o(()=>[s(N(w))]),_:1})]),_:1})]),default:o(({row:r})=>[_(d(k(r)),1)]),_:1}),s(e,{label:"操作人",width:"110",prop:"operator_name"}),s(e,{label:"操作账号",width:"120",prop:"operator_account","show-overflow-tooltip":""}),s(e,{label:"IP",width:"130",prop:"ip","show-overflow-tooltip":""})]),_:1},8,["data"])),[[I,p.value]])])}}}),Q=H(j,[["__scopeId","data-v-078f6683"]]);export{Q as default};
import{o as $,R as D,q as c,r as u,ag as F,O as L,bn as E,D as o,v as s,bo as P,L as _,T as d,F as A,bp as B,P as V,s as v,a5 as q,w as M,u as N,cl as w,bq as z,M as x}from"./.pnpm-DnXobOVo.js";import{bz as K,_ as H}from"./index-CtDDMof-.js";const O={class:"assign-log-panel"},R={key:0,class:"assign-log-inherit-slot"},Y={key:1,class:"text-gray-400"},j=$({__name:"AssignLogPanel",props:{diagnosisId:{}},setup(y,{expose:S}){const m=y,p=x(!1),f=x([]);function T(n){const t=n.related_po_creator_name;if(t!=null&&String(t).trim()!=="")return String(t);const e=Number(n.related_po_creator_id);return Number.isFinite(e)&&e>0?`ID:${e}`:"—"}function k(n){const t=n.related_po_create_time_text;if(t!=null&&String(t).trim()!=="")return String(t);const e=Number(n.related_po_create_time);if(!Number.isFinite(e)||e<=0)return"—";const a=new Date(e*1e3);if(Number.isNaN(a.getTime()))return"—";const i=l=>String(l).padStart(2,"0");return`${a.getFullYear()}-${i(a.getMonth()+1)}-${i(a.getDate())} ${i(a.getHours())}:${i(a.getMinutes())}:${i(a.getSeconds())}`}function g(n){const t=n.inherit_visit_slot_text;if(t!=null&&String(t).trim()!=="")return String(t);const e=Number(n.inherit_visit_slot_calc_time);if(!Number.isFinite(e)||e<=0)return"";const a=Number(n.inherit_visit_slot);return Number.isFinite(a)&&a>0?`继承时第 ${a} 诊`:"继承时未成交"}function b(n,t){const e=t==="from"?"from_assistant_name":"to_assistant_name",a=t==="from"?"from_assistant_id":"to_assistant_id",i=n[e];if(i!=null&&String(i).trim()!==""&&String(i)!=="—")return String(i);const l=Number(n[a]);return Number.isFinite(l)&&l>0?`ID:${l}`:"—"}const h=async()=>{if(m.diagnosisId){p.value=!0;try{const n=await K({id:m.diagnosisId}),t=Array.isArray(n)?n:[];f.value=t}catch(n){console.error(n),f.value=[]}finally{p.value=!1}}};return D(()=>m.diagnosisId,()=>{h()},{immediate:!0}),S({refresh:h}),(n,t)=>{const e=P,a=M,i=q,l=B,C=E,I=z;return c(),u("div",O,[F((c(),L(C,{data:f.value,border:"",stripe:"","empty-text":"暂无指派记录"},{default:o(()=>[s(e,{label:"操作时间",width:"175",prop:"create_time_text"}),s(e,{label:"原医助","min-width":"120"},{default:o(({row:r})=>[_(d(b(r,"from")),1)]),_:1}),s(e,{label:"新医助","min-width":"120"},{default:o(({row:r})=>[_(d(b(r,"to")),1)]),_:1}),s(e,{label:"继承",width:"118",align:"center"},{header:o(()=>[t[0]||(t[0]=v("span",null,"继承",-1)),s(i,{placement:"top",content:"继承时第 k 诊:继承时刻之前患者已完成的诊次(有效实单数 + 偏移),复诊接诊率从第 k+1 诊起计入新医助分母;2026-10 前的继承记录无此快照"},{default:o(()=>[s(a,{class:"assign-log-col-hint"},{default:o(()=>[s(N(w))]),_:1})]),_:1})]),default:o(({row:r})=>[Number(r.is_inherit)===1?(c(),u(A,{key:0},[s(l,{type:"success",size:"small"},{default:o(()=>[...t[1]||(t[1]=[_("是",-1)])]),_:1}),g(r)?(c(),u("div",R,d(g(r)),1)):V("",!0)],64)):(c(),u("span",Y,"否"))]),_:1}),s(e,{label:"快照·业务单创建人","min-width":"130","show-overflow-tooltip":""},{default:o(({row:r})=>[_(d(T(r)),1)]),_:1}),s(e,{label:"快照·业务单创建时间",width:"190"},{header:o(()=>[t[2]||(t[2]=v("span",null,"快照·业务单创建时间",-1)),s(i,{placement:"top",content:"related_po_create_time:触发本次操作的处方业务订单 create_time;与原文助一致时表示医助创建订单时间"},{default:o(()=>[s(a,{class:"assign-log-col-hint"},{default:o(()=>[s(N(w))]),_:1})]),_:1})]),default:o(({row:r})=>[_(d(k(r)),1)]),_:1}),s(e,{label:"操作人",width:"110",prop:"operator_name"}),s(e,{label:"操作账号",width:"120",prop:"operator_account","show-overflow-tooltip":""}),s(e,{label:"IP",width:"130",prop:"ip","show-overflow-tooltip":""})]),_:1},8,["data"])),[[I,p.value]])])}}}),Q=H(j,[["__scopeId","data-v-078f6683"]]);export{Q as default};
@@ -1 +1 @@
import{o as B,R as D,q as E,O,D as I,r as _,T as S,P as x,ag as W,s as h,ah as j,v as P,K as U,L as $,a2 as H,p as K,M as v,dj as c}from"./.pnpm-DnXobOVo.js";import{bA as Y,_ as q}from"./index-B5yNocKV.js";const z={key:0,class:"watch-state"},F={key:1,class:"watch-state watch-error"},G=B({__name:"AssistantWatchCallDialog",props:{modelValue:{type:Boolean},diagnosisId:{}},emits:["update:modelValue","closed"],setup(A,{emit:R}){const u=A,g=R,y=K({get:()=>u.modelValue,set:t=>g("update:modelValue",t)}),r=v(null),l=v(!1),i=v(""),p=v("旁观视频通话"),n=new Map;let a=null,f=0;function w(t,e){return`${t}\0${String(e)}`}function N(t){return t.startsWith("patient_")?"患者":t.startsWith("doctor_")?"医护":t}async function T(t){if(!a||!r.value||t.streamType!==c.TYPE.STREAM_TYPE_MAIN)return;const e=w(t.userId,t.streamType);if(n.has(e))return;const o=document.createElement("div");o.className="watch-tile";const s=document.createElement("div");s.className="watch-tile-cap",s.textContent=N(t.userId);const d=document.createElement("div");d.className="watch-tile-view",o.appendChild(s),o.appendChild(d),r.value.appendChild(o),n.set(e,{wrap:o,userId:t.userId,streamType:t.streamType});try{await a.startRemoteVideo({userId:t.userId,streamType:t.streamType,view:d})}catch(b){console.warn("[AssistantWatchCall] startRemoteVideo",b)}}async function V(t){if(!a)return;const e=w(t.userId,t.streamType),o=n.get(e);if(o){try{await a.stopRemoteVideo({userId:t.userId,streamType:t.streamType})}catch{}o.wrap.remove(),n.delete(e)}}function C(){a&&(a.on(c.EVENT.REMOTE_VIDEO_AVAILABLE,T),a.on(c.EVENT.REMOTE_VIDEO_UNAVAILABLE,V))}function k(){a&&(a.off(c.EVENT.REMOTE_VIDEO_AVAILABLE,T),a.off(c.EVENT.REMOTE_VIDEO_UNAVAILABLE,V))}async function m(){if(k(),a){for(const[,t]of n){try{await a.stopRemoteVideo({userId:t.userId,streamType:t.streamType})}catch{}t.wrap.remove()}n.clear(),r.value&&(r.value.innerHTML="");try{await a.exitRoom()}catch{}try{a.destroy()}catch{}a=null}else n.clear(),r.value&&(r.value.innerHTML="")}async function L(){const t=++f;if(await m(),!u.diagnosisId){i.value="诊单无效";return}l.value=!0,i.value="",p.value="旁观视频通话";try{const e=await Y({diagnosis_id:u.diagnosisId});if(t!==f)return;e.patientName&&(p.value=`旁观视频通话 · ${e.patientName}`),a=c.create(),C();const o={sdkAppId:e.sdkAppId,userId:e.userId,userSig:e.userSig,autoReceiveAudio:!0,autoReceiveVideo:!0,...e.roomId!=null&&e.roomId>0?{roomId:e.roomId}:{strRoomId:e.strRoomId}};if(!(e.roomId!=null&&e.roomId>0)&&!e.strRoomId)throw new Error("缺少房间号");if(await a.enterRoom(o),t!==f){await m();return}l.value=!1}catch(e){l.value=!1;let o="进入房间失败";if(typeof e=="string")o=e;else if(e&&typeof e=="object"){const s=e;s.msg?o=String(s.msg):s.message&&(o=String(s.message))}i.value=o,await m()}}function M(){m(),l.value=!1,i.value="",p.value="旁观视频通话",g("closed")}return D(()=>[u.modelValue,u.diagnosisId],([t,e])=>{if(!t){f++,m();return}e>0&&L()}),(t,e)=>{const o=U,s=H;return E(),O(s,{modelValue:y.value,"onUpdate:modelValue":e[1]||(e[1]=d=>y.value=d),title:p.value,width:"760px","destroy-on-close":"","append-to-body":"","close-on-click-modal":!1,class:"assistant-watch-call-dialog",onClosed:M},{footer:I(()=>[e[3]||(e[3]=h("span",{class:"watch-hint"},"仅观看,不会开启摄像头与麦克风",-1)),P(o,{type:"primary",onClick:e[0]||(e[0]=d=>y.value=!1)},{default:I(()=>[...e[2]||(e[2]=[$("离开",-1)])]),_:1})]),default:I(()=>[l.value?(E(),_("div",z,"正在连接房间…")):i.value?(E(),_("div",F,S(i.value),1)):x("",!0),W(h("div",{ref_key:"gridRef",ref:r,class:"watch-grid"},null,512),[[j,!l.value&&!i.value]])]),_:1},8,["modelValue","title"])}}}),X=q(G,[["__scopeId","data-v-8c719418"]]);export{X as default};
import{o as B,R as D,q as E,O,D as I,r as _,T as S,P as x,ag as W,s as h,ah as j,v as P,K as U,L as $,a2 as H,p as K,M as v,dj as c}from"./.pnpm-DnXobOVo.js";import{bA as Y,_ as q}from"./index-CtDDMof-.js";const z={key:0,class:"watch-state"},F={key:1,class:"watch-state watch-error"},G=B({__name:"AssistantWatchCallDialog",props:{modelValue:{type:Boolean},diagnosisId:{}},emits:["update:modelValue","closed"],setup(A,{emit:R}){const u=A,g=R,y=K({get:()=>u.modelValue,set:t=>g("update:modelValue",t)}),r=v(null),l=v(!1),i=v(""),p=v("旁观视频通话"),n=new Map;let a=null,f=0;function w(t,e){return`${t}\0${String(e)}`}function N(t){return t.startsWith("patient_")?"患者":t.startsWith("doctor_")?"医护":t}async function T(t){if(!a||!r.value||t.streamType!==c.TYPE.STREAM_TYPE_MAIN)return;const e=w(t.userId,t.streamType);if(n.has(e))return;const o=document.createElement("div");o.className="watch-tile";const s=document.createElement("div");s.className="watch-tile-cap",s.textContent=N(t.userId);const d=document.createElement("div");d.className="watch-tile-view",o.appendChild(s),o.appendChild(d),r.value.appendChild(o),n.set(e,{wrap:o,userId:t.userId,streamType:t.streamType});try{await a.startRemoteVideo({userId:t.userId,streamType:t.streamType,view:d})}catch(b){console.warn("[AssistantWatchCall] startRemoteVideo",b)}}async function V(t){if(!a)return;const e=w(t.userId,t.streamType),o=n.get(e);if(o){try{await a.stopRemoteVideo({userId:t.userId,streamType:t.streamType})}catch{}o.wrap.remove(),n.delete(e)}}function C(){a&&(a.on(c.EVENT.REMOTE_VIDEO_AVAILABLE,T),a.on(c.EVENT.REMOTE_VIDEO_UNAVAILABLE,V))}function k(){a&&(a.off(c.EVENT.REMOTE_VIDEO_AVAILABLE,T),a.off(c.EVENT.REMOTE_VIDEO_UNAVAILABLE,V))}async function m(){if(k(),a){for(const[,t]of n){try{await a.stopRemoteVideo({userId:t.userId,streamType:t.streamType})}catch{}t.wrap.remove()}n.clear(),r.value&&(r.value.innerHTML="");try{await a.exitRoom()}catch{}try{a.destroy()}catch{}a=null}else n.clear(),r.value&&(r.value.innerHTML="")}async function L(){const t=++f;if(await m(),!u.diagnosisId){i.value="诊单无效";return}l.value=!0,i.value="",p.value="旁观视频通话";try{const e=await Y({diagnosis_id:u.diagnosisId});if(t!==f)return;e.patientName&&(p.value=`旁观视频通话 · ${e.patientName}`),a=c.create(),C();const o={sdkAppId:e.sdkAppId,userId:e.userId,userSig:e.userSig,autoReceiveAudio:!0,autoReceiveVideo:!0,...e.roomId!=null&&e.roomId>0?{roomId:e.roomId}:{strRoomId:e.strRoomId}};if(!(e.roomId!=null&&e.roomId>0)&&!e.strRoomId)throw new Error("缺少房间号");if(await a.enterRoom(o),t!==f){await m();return}l.value=!1}catch(e){l.value=!1;let o="进入房间失败";if(typeof e=="string")o=e;else if(e&&typeof e=="object"){const s=e;s.msg?o=String(s.msg):s.message&&(o=String(s.message))}i.value=o,await m()}}function M(){m(),l.value=!1,i.value="",p.value="旁观视频通话",g("closed")}return D(()=>[u.modelValue,u.diagnosisId],([t,e])=>{if(!t){f++,m();return}e>0&&L()}),(t,e)=>{const o=U,s=H;return E(),O(s,{modelValue:y.value,"onUpdate:modelValue":e[1]||(e[1]=d=>y.value=d),title:p.value,width:"760px","destroy-on-close":"","append-to-body":"","close-on-click-modal":!1,class:"assistant-watch-call-dialog",onClosed:M},{footer:I(()=>[e[3]||(e[3]=h("span",{class:"watch-hint"},"仅观看,不会开启摄像头与麦克风",-1)),P(o,{type:"primary",onClick:e[0]||(e[0]=d=>y.value=!1)},{default:I(()=>[...e[2]||(e[2]=[$("离开",-1)])]),_:1})]),default:I(()=>[l.value?(E(),_("div",z,"正在连接房间…")):i.value?(E(),_("div",F,S(i.value),1)):x("",!0),W(h("div",{ref_key:"gridRef",ref:r,class:"watch-grid"},null,512),[[j,!l.value&&!i.value]])]),_:1},8,["modelValue","title"])}}}),X=q(G,[["__scopeId","data-v-8c719418"]]);export{X as default};
@@ -1 +1 @@
import{o as N,dl as O,R as P,q as r,r as f,v as o,D as i,K as V,L as n,P as h,ag as D,O as w,bn as L,bo as q,T as u,s as y,bq as z,M as v}from"./.pnpm-DnXobOVo.js";import M from"./RecordingPlaybackBlock-2brEtpcH.js";import{U as x}from"./index-BwIr9qiy.js";import{bE as F,f as c,bF as R,bG as G,_ as K}from"./index-B5yNocKV.js";import"./RecordingVideoPlayer-D3EW1shD.js";import"./file-CN5TlpMj.js";const j={class:"call-record-panel"},A={key:0,class:"call-record-toolbar"},H={class:"call-record-empty"},J={class:"call-record-empty__desc"},Q={key:0,class:"text-primary"},W={key:1,class:"text-gray-400"},X=N({__name:"CallRecordPanel",props:{diagnosisId:{},readOnly:{type:Boolean,default:!1}},setup(_,{expose:k}){const d=_,p=v(!1),g=v([]),U=O("toolbarUploadRef"),m=async()=>{if(d.diagnosisId){p.value=!0;try{g.value=await F({diagnosis_id:d.diagnosisId})||[]}catch(e){console.error(e),g.value=[]}finally{p.value=!1}}};P(()=>d.diagnosisId,()=>{m()},{immediate:!0}),k({refresh:m});function C(e){return{1:"进行中",2:"已结束",3:"未接听",4:"已取消"}[e]??"—"}async function E(e){const t=b(e);if(!t){c.msgError("上传成功但未返回视频地址");return}try{const a=await G({diagnosis_id:d.diagnosisId});await R({diagnosis_id:d.diagnosisId,call_record_id:Number((a==null?void 0:a.id)||0),file_url:t}),c.msgSuccess("视频回放上传成功"),await m()}catch(a){c.msgError((a==null?void 0:a.message)||"写入回放失败")}}async function S(e,t){const a=b(t);if(!a){c.msgError("上传成功但未返回视频地址");return}try{await R({diagnosis_id:d.diagnosisId,call_record_id:Number(e.id||0),file_url:a}),c.msgSuccess("视频回放上传成功"),await m()}catch(l){c.msgError((l==null?void 0:l.message)||"写入回放失败")}}function b(e){var t,a;return String(((t=e==null?void 0:e.data)==null?void 0:t.uri)||((a=e==null?void 0:e.data)==null?void 0:a.url)||"").trim()}return(e,t)=>{const a=V,l=q,I=L,B=z;return r(),f("div",j,[_.readOnly?h("",!0):(r(),f("div",A,[o(x,{ref_key:"toolbarUploadRef",ref:U,type:"video",direct:"",multiple:!1,limit:1,"show-progress":!0,onSuccess:E},{default:i(()=>[o(a,{type:"primary"},{default:i(()=>[...t[0]||(t[0]=[n("上传视频",-1)])]),_:1})]),_:1},512)])),D((r(),w(I,{data:g.value,border:"",stripe:""},{empty:i(()=>[y("div",H,[t[1]||(t[1]=y("div",{class:"call-record-empty__title"},"暂无通话记录",-1)),y("div",J,u(_.readOnly?"暂无录制回放数据。":"现在可以直接点击上方“上传视频”。系统会自动生成一条默认通话记录来承载回放。"),1)])]),default:i(()=>[o(l,{label:"录制回放","min-width":"320"},{default:i(({row:s})=>[o(M,{"record-id":s.id,urls:s.recording_urls_list},null,8,["record-id","urls"])]),_:1}),o(l,{label:"开始时间",width:"170",prop:"start_time_text"}),o(l,{label:"结束时间",width:"170",prop:"end_time_text"}),o(l,{label:"通话类型",width:"100"},{default:i(({row:s})=>[n(u(s.call_type===1?"语音":"视频"),1)]),_:1}),o(l,{label:"房间号",width:"180"},{default:i(({row:s})=>[s.room_id?(r(),f("span",Q,u(s.room_id),1)):(r(),f("span",W,"—"))]),_:1}),o(l,{label:"时长",width:"110",prop:"duration_text"}),o(l,{label:"状态",width:"90"},{default:i(({row:s})=>[n(u(C(s.status)),1)]),_:1}),o(l,{label:"录制",width:"100"},{default:i(({row:s})=>[n(u(s.recording_status_text||"—"),1)]),_:1}),_.readOnly?h("",!0):(r(),w(l,{key:0,label:"上传回放",width:"180"},{default:i(({row:s})=>[o(x,{type:"video",direct:"",multiple:!1,limit:1,"show-progress":!0,onSuccess:T=>S(s,T)},{default:i(()=>[o(a,{type:"primary",plain:"",size:"small"},{default:i(()=>[...t[2]||(t[2]=[n("上传视频",-1)])]),_:1})]),_:1},8,["onSuccess"])]),_:1}))]),_:1},8,["data"])),[[B,p.value]])])}}}),la=K(X,[["__scopeId","data-v-78d5c9e4"]]);export{la as default};
import{o as N,dl as O,R as P,q as r,r as f,v as o,D as i,K as V,L as n,P as h,ag as D,O as w,bn as L,bo as q,T as u,s as y,bq as z,M as v}from"./.pnpm-DnXobOVo.js";import M from"./RecordingPlaybackBlock-CEx76abT.js";import{U as x}from"./index-BIk_Y15k.js";import{bE as F,f as c,bF as R,bG as G,_ as K}from"./index-CtDDMof-.js";import"./RecordingVideoPlayer-DXLif0vn.js";import"./file-u1OP1ZCG.js";const j={class:"call-record-panel"},A={key:0,class:"call-record-toolbar"},H={class:"call-record-empty"},J={class:"call-record-empty__desc"},Q={key:0,class:"text-primary"},W={key:1,class:"text-gray-400"},X=N({__name:"CallRecordPanel",props:{diagnosisId:{},readOnly:{type:Boolean,default:!1}},setup(_,{expose:k}){const d=_,p=v(!1),g=v([]),U=O("toolbarUploadRef"),m=async()=>{if(d.diagnosisId){p.value=!0;try{g.value=await F({diagnosis_id:d.diagnosisId})||[]}catch(e){console.error(e),g.value=[]}finally{p.value=!1}}};P(()=>d.diagnosisId,()=>{m()},{immediate:!0}),k({refresh:m});function C(e){return{1:"进行中",2:"已结束",3:"未接听",4:"已取消"}[e]??"—"}async function E(e){const t=b(e);if(!t){c.msgError("上传成功但未返回视频地址");return}try{const a=await G({diagnosis_id:d.diagnosisId});await R({diagnosis_id:d.diagnosisId,call_record_id:Number((a==null?void 0:a.id)||0),file_url:t}),c.msgSuccess("视频回放上传成功"),await m()}catch(a){c.msgError((a==null?void 0:a.message)||"写入回放失败")}}async function S(e,t){const a=b(t);if(!a){c.msgError("上传成功但未返回视频地址");return}try{await R({diagnosis_id:d.diagnosisId,call_record_id:Number(e.id||0),file_url:a}),c.msgSuccess("视频回放上传成功"),await m()}catch(l){c.msgError((l==null?void 0:l.message)||"写入回放失败")}}function b(e){var t,a;return String(((t=e==null?void 0:e.data)==null?void 0:t.uri)||((a=e==null?void 0:e.data)==null?void 0:a.url)||"").trim()}return(e,t)=>{const a=V,l=q,I=L,B=z;return r(),f("div",j,[_.readOnly?h("",!0):(r(),f("div",A,[o(x,{ref_key:"toolbarUploadRef",ref:U,type:"video",direct:"",multiple:!1,limit:1,"show-progress":!0,onSuccess:E},{default:i(()=>[o(a,{type:"primary"},{default:i(()=>[...t[0]||(t[0]=[n("上传视频",-1)])]),_:1})]),_:1},512)])),D((r(),w(I,{data:g.value,border:"",stripe:""},{empty:i(()=>[y("div",H,[t[1]||(t[1]=y("div",{class:"call-record-empty__title"},"暂无通话记录",-1)),y("div",J,u(_.readOnly?"暂无录制回放数据。":"现在可以直接点击上方“上传视频”。系统会自动生成一条默认通话记录来承载回放。"),1)])]),default:i(()=>[o(l,{label:"录制回放","min-width":"320"},{default:i(({row:s})=>[o(M,{"record-id":s.id,urls:s.recording_urls_list},null,8,["record-id","urls"])]),_:1}),o(l,{label:"开始时间",width:"170",prop:"start_time_text"}),o(l,{label:"结束时间",width:"170",prop:"end_time_text"}),o(l,{label:"通话类型",width:"100"},{default:i(({row:s})=>[n(u(s.call_type===1?"语音":"视频"),1)]),_:1}),o(l,{label:"房间号",width:"180"},{default:i(({row:s})=>[s.room_id?(r(),f("span",Q,u(s.room_id),1)):(r(),f("span",W,"—"))]),_:1}),o(l,{label:"时长",width:"110",prop:"duration_text"}),o(l,{label:"状态",width:"90"},{default:i(({row:s})=>[n(u(C(s.status)),1)]),_:1}),o(l,{label:"录制",width:"100"},{default:i(({row:s})=>[n(u(s.recording_status_text||"—"),1)]),_:1}),_.readOnly?h("",!0):(r(),w(l,{key:0,label:"上传回放",width:"180"},{default:i(({row:s})=>[o(x,{type:"video",direct:"",multiple:!1,limit:1,"show-progress":!0,onSuccess:T=>S(s,T)},{default:i(()=>[o(a,{type:"primary",plain:"",size:"small"},{default:i(()=>[...t[2]||(t[2]=[n("上传视频",-1)])]),_:1})]),_:1},8,["onSuccess"])]),_:1}))]),_:1},8,["data"])),[[B,p.value]])])}}}),la=K(X,[["__scopeId","data-v-78d5c9e4"]]);export{la as default};
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
import{o as T,a0 as V,R as I,q as o,r as l,v as a,K as N,D as n,L as c,P as w,ag as z,bq as M,u as p,O as f,bo as O,T as _,F as P,bp as F,s as R,bn as j,by as q,M as k}from"./.pnpm-DnXobOVo.js";import{bH as A,_ as H}from"./index-B5yNocKV.js";const K={class:"case-record-list"},Y={key:0,class:"mb-3 flex justify-end"},G={key:0},J={key:1,class:"text-gray-400"},Q={class:"void-detail text-xs text-gray-500 mt-1"},U=T({__name:"CaseRecordList",props:{diagnosisId:{type:Number,default:0},readOnly:{type:Boolean,default:!1}},emits:["view","openPrescription"],setup(y,{expose:x,emit:C}){const m=y,b=C,r=k([]),d=k(!1),u=async()=>{if(m.diagnosisId){d.value=!0;try{const t=await A({diagnosis_id:m.diagnosisId});r.value=Array.isArray(t)?t:[]}catch(t){console.error("获取病历记录失败:",t),r.value=[]}finally{d.value=!1}}},S=t=>{if(!t)return"";const e=new Date(t*1e3);return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")} ${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`},$=t=>{b("view",t)},B=()=>{b("openPrescription")};return V(()=>{u()}),I(()=>m.diagnosisId,()=>{u()}),x({refresh:u}),(t,e)=>{const h=N,i=O,v=F,E=j,D=q,L=M;return o(),l("div",K,[y.readOnly?w("",!0):(o(),l("div",Y,[a(h,{type:"primary",size:"small",onClick:B},{default:n(()=>[...e[0]||(e[0]=[c("开方",-1)])]),_:1})])),z((o(),f(E,{data:p(r),border:""},{default:n(()=>[a(i,{prop:"prescription_date",label:"就诊日期",width:"120"}),a(i,{prop:"visit_no",label:"门诊号",width:"120"}),a(i,{prop:"clinical_diagnosis",label:"临床诊断","min-width":"160","show-overflow-tooltip":""}),a(i,{label:"处方摘要","min-width":"180"},{default:n(({row:s})=>[s.herbs&&s.herbs.length?(o(),l("span",G,_(s.herbs.slice(0,3).map(g=>`${g.name}${g.dosage}克`).join("、"))+_(s.herbs.length>3?"...":""),1)):(o(),l("span",J,"—"))]),_:1}),a(i,{prop:"doctor_name",label:"医师",width:"90","show-overflow-tooltip":""}),a(i,{label:"状态",width:"140",align:"center"},{default:n(({row:s})=>[s.void_status===1?(o(),l(P,{key:0},[a(v,{type:"danger",size:"small"},{default:n(()=>[...e[1]||(e[1]=[c("已作废",-1)])]),_:1}),R("div",Q,_(s.void_by_name||"—")+" "+_(S(s.void_time)),1)],64)):(o(),f(v,{key:1,type:"success",size:"small"},{default:n(()=>[...e[2]||(e[2]=[c("正常",-1)])]),_:1}))]),_:1}),a(i,{label:"操作",width:"120",fixed:"right"},{default:n(({row:s})=>[a(h,{link:"",type:"primary",size:"small",onClick:g=>$(s)},{default:n(()=>[...e[3]||(e[3]=[c(" 查看 ",-1)])]),_:1},8,["onClick"])]),_:1})]),_:1},8,["data"])),[[L,p(d)]]),!p(d)&&p(r).length===0?(o(),f(D,{key:1,description:"暂无病历记录,开方后会自动显示",class:"mt-4"})):w("",!0)])}}}),Z=H(U,[["__scopeId","data-v-043d2738"]]);export{Z as default};
import{o as T,a0 as V,R as I,q as o,r as l,v as a,K as N,D as n,L as c,P as w,ag as z,bq as M,u as p,O as f,bo as O,T as _,F as P,bp as F,s as R,bn as j,by as q,M as k}from"./.pnpm-DnXobOVo.js";import{bH as A,_ as H}from"./index-CtDDMof-.js";const K={class:"case-record-list"},Y={key:0,class:"mb-3 flex justify-end"},G={key:0},J={key:1,class:"text-gray-400"},Q={class:"void-detail text-xs text-gray-500 mt-1"},U=T({__name:"CaseRecordList",props:{diagnosisId:{type:Number,default:0},readOnly:{type:Boolean,default:!1}},emits:["view","openPrescription"],setup(y,{expose:x,emit:C}){const m=y,b=C,r=k([]),d=k(!1),u=async()=>{if(m.diagnosisId){d.value=!0;try{const t=await A({diagnosis_id:m.diagnosisId});r.value=Array.isArray(t)?t:[]}catch(t){console.error("获取病历记录失败:",t),r.value=[]}finally{d.value=!1}}},S=t=>{if(!t)return"";const e=new Date(t*1e3);return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")} ${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`},$=t=>{b("view",t)},B=()=>{b("openPrescription")};return V(()=>{u()}),I(()=>m.diagnosisId,()=>{u()}),x({refresh:u}),(t,e)=>{const h=N,i=O,v=F,E=j,D=q,L=M;return o(),l("div",K,[y.readOnly?w("",!0):(o(),l("div",Y,[a(h,{type:"primary",size:"small",onClick:B},{default:n(()=>[...e[0]||(e[0]=[c("开方",-1)])]),_:1})])),z((o(),f(E,{data:p(r),border:""},{default:n(()=>[a(i,{prop:"prescription_date",label:"就诊日期",width:"120"}),a(i,{prop:"visit_no",label:"门诊号",width:"120"}),a(i,{prop:"clinical_diagnosis",label:"临床诊断","min-width":"160","show-overflow-tooltip":""}),a(i,{label:"处方摘要","min-width":"180"},{default:n(({row:s})=>[s.herbs&&s.herbs.length?(o(),l("span",G,_(s.herbs.slice(0,3).map(g=>`${g.name}${g.dosage}克`).join("、"))+_(s.herbs.length>3?"...":""),1)):(o(),l("span",J,"—"))]),_:1}),a(i,{prop:"doctor_name",label:"医师",width:"90","show-overflow-tooltip":""}),a(i,{label:"状态",width:"140",align:"center"},{default:n(({row:s})=>[s.void_status===1?(o(),l(P,{key:0},[a(v,{type:"danger",size:"small"},{default:n(()=>[...e[1]||(e[1]=[c("已作废",-1)])]),_:1}),R("div",Q,_(s.void_by_name||"—")+" "+_(S(s.void_time)),1)],64)):(o(),f(v,{key:1,type:"success",size:"small"},{default:n(()=>[...e[2]||(e[2]=[c("正常",-1)])]),_:1}))]),_:1}),a(i,{label:"操作",width:"120",fixed:"right"},{default:n(({row:s})=>[a(h,{link:"",type:"primary",size:"small",onClick:g=>$(s)},{default:n(()=>[...e[3]||(e[3]=[c(" 查看 ",-1)])]),_:1},8,["onClick"])]),_:1})]),_:1},8,["data"])),[[L,p(d)]]),!p(d)&&p(r).length===0?(o(),f(D,{key:1,description:"暂无病历记录,开方后会自动显示",class:"mt-4"})):w("",!0)])}}}),Z=H(U,[["__scopeId","data-v-043d2738"]]);export{Z as default};
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
import{_ as o}from"./GancaoSubmissionReconcileButton.vue_vue_type_script_setup_true_lang-DLJNTnAP.js";import"./.pnpm-DnXobOVo.js";import"./index-CtDDMof-.js";export{o as default};
@@ -1 +0,0 @@
import{_ as o}from"./GancaoSubmissionReconcileButton.vue_vue_type_script_setup_true_lang-DLsU5t1Y.js";import"./.pnpm-DnXobOVo.js";import"./index-B5yNocKV.js";export{o as default};
@@ -1 +1 @@
import{o as U,br as F,q as f,r as k,F as D,ag as M,O as E,D as t,L as u,K as G,v as r,a2 as B,bf as q,be as P,az as A,bc as L,bi as T,bs as z,a3 as K,P as g,p as W,M as v,aD as $}from"./.pnpm-DnXobOVo.js";import{f as C,x as j}from"./index-B5yNocKV.js";const Q=U({__name:"GancaoSubmissionReconcileButton",props:{order:{}},emits:["resolved"],setup(N,{emit:y}){const d=N,V=y,w=W(()=>{var m,_,a;const i=String(((m=d.order)==null?void 0:m.pharmacy_claim_target)||"").trim().toLowerCase(),e=String(((_=d.order)==null?void 0:_.pharmacy_claim_status)||"").trim().toUpperCase(),n=Number(((a=d.order)==null?void 0:a.pharmacy_claim_lease_expires_at)||0),c=e==="PENDING"&&n>0&&n<=Math.floor(Date.now()/1e3);return i==="gancao"&&(c||["UNKNOWN","PENDING_RECONCILE"].includes(e))}),s=v(!1),p=v(!1),o=$({resolution:"CONFIRM_SUCCESS",remote_order_no:"",note:""});function x(){o.resolution="CONFIRM_SUCCESS",o.remote_order_no="",o.note="",s.value=!0}async function b(){var e;const i=Number((e=d.order)==null?void 0:e.id);if(i){if(o.resolution==="CONFIRM_SUCCESS"&&!o.remote_order_no.trim()){C.msgError("请填写甘草药方单号");return}if(!o.note.trim()){C.msgError("请填写甘草后台核对依据");return}p.value=!0;try{await j({id:i,resolution:o.resolution,remote_order_no:o.resolution==="CONFIRM_SUCCESS"?o.remote_order_no.trim():"",note:o.note.trim()}),C.msgSuccess("甘草提交核对已记录"),s.value=!1,V("resolved")}catch{}finally{p.value=!1}}}return(i,e)=>{const n=G,c=q,m=z,_=T,a=L,S=K,O=P,R=B,I=F("perms");return w.value?(f(),k(D,{key:0},[M((f(),E(n,{type:"danger",size:"small",plain:"",onClick:x},{default:t(()=>[...e[5]||(e[5]=[u("核对甘草提交",-1)])]),_:1})),[[I,["tcm.prescriptionOrder/confirmGancaoSubmission"]]]),r(R,{modelValue:s.value,"onUpdate:modelValue":e[4]||(e[4]=l=>s.value=l),title:"人工核对甘草提交",width:"min(92vw, 520px)","append-to-body":"","destroy-on-close":"","close-on-click-modal":!1},{footer:t(()=>[r(n,{onClick:e[3]||(e[3]=l=>s.value=!1)},{default:t(()=>[...e[8]||(e[8]=[u("取消",-1)])]),_:1}),r(n,{type:"primary",loading:p.value,onClick:b},{default:t(()=>[...e[9]||(e[9]=[u("确认并记录",-1)])]),_:1},8,["loading"])]),default:t(()=>[r(c,{title:"请先在甘草后台核对。本操作会写入不可变更的审计记录。",type:"warning",closable:!1,"show-icon":"",class:"mb-4"}),r(O,{"label-width":"100px",onSubmit:A(b,["prevent"])},{default:t(()=>[r(a,{label:"核对结果",required:""},{default:t(()=>[r(_,{modelValue:o.resolution,"onUpdate:modelValue":e[0]||(e[0]=l=>o.resolution=l)},{default:t(()=>[r(m,{label:"CONFIRM_SUCCESS"},{default:t(()=>[...e[6]||(e[6]=[u("确认已创建",-1)])]),_:1}),r(m,{label:"CONFIRM_NOT_CREATED"},{default:t(()=>[...e[7]||(e[7]=[u("确认未创建",-1)])]),_:1})]),_:1},8,["modelValue"])]),_:1}),o.resolution==="CONFIRM_SUCCESS"?(f(),E(a,{key:0,label:"甘草单号",required:""},{default:t(()=>[r(S,{modelValue:o.remote_order_no,"onUpdate:modelValue":e[1]||(e[1]=l=>o.remote_order_no=l),maxlength:"64",clearable:""},null,8,["modelValue"])]),_:1})):g("",!0),r(a,{label:"核对依据",required:""},{default:t(()=>[r(S,{modelValue:o.note,"onUpdate:modelValue":e[2]||(e[2]=l=>o.note=l),type:"textarea",rows:3,maxlength:"1000","show-word-limit":"",placeholder:"例如:核对时间、甘草后台查询条件及结果"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1},8,["modelValue"])],64)):g("",!0)}}});export{Q as _};
import{o as U,br as F,q as f,r as k,F as D,ag as M,O as E,D as t,L as u,K as G,v as r,a2 as B,bf as q,be as P,az as A,bc as L,bi as T,bs as z,a3 as K,P as g,p as W,M as v,aD as $}from"./.pnpm-DnXobOVo.js";import{f as C,x as j}from"./index-CtDDMof-.js";const Q=U({__name:"GancaoSubmissionReconcileButton",props:{order:{}},emits:["resolved"],setup(N,{emit:y}){const d=N,V=y,w=W(()=>{var m,_,a;const i=String(((m=d.order)==null?void 0:m.pharmacy_claim_target)||"").trim().toLowerCase(),e=String(((_=d.order)==null?void 0:_.pharmacy_claim_status)||"").trim().toUpperCase(),n=Number(((a=d.order)==null?void 0:a.pharmacy_claim_lease_expires_at)||0),c=e==="PENDING"&&n>0&&n<=Math.floor(Date.now()/1e3);return i==="gancao"&&(c||["UNKNOWN","PENDING_RECONCILE"].includes(e))}),s=v(!1),p=v(!1),o=$({resolution:"CONFIRM_SUCCESS",remote_order_no:"",note:""});function x(){o.resolution="CONFIRM_SUCCESS",o.remote_order_no="",o.note="",s.value=!0}async function b(){var e;const i=Number((e=d.order)==null?void 0:e.id);if(i){if(o.resolution==="CONFIRM_SUCCESS"&&!o.remote_order_no.trim()){C.msgError("请填写甘草药方单号");return}if(!o.note.trim()){C.msgError("请填写甘草后台核对依据");return}p.value=!0;try{await j({id:i,resolution:o.resolution,remote_order_no:o.resolution==="CONFIRM_SUCCESS"?o.remote_order_no.trim():"",note:o.note.trim()}),C.msgSuccess("甘草提交核对已记录"),s.value=!1,V("resolved")}catch{}finally{p.value=!1}}}return(i,e)=>{const n=G,c=q,m=z,_=T,a=L,S=K,O=P,R=B,I=F("perms");return w.value?(f(),k(D,{key:0},[M((f(),E(n,{type:"danger",size:"small",plain:"",onClick:x},{default:t(()=>[...e[5]||(e[5]=[u("核对甘草提交",-1)])]),_:1})),[[I,["tcm.prescriptionOrder/confirmGancaoSubmission"]]]),r(R,{modelValue:s.value,"onUpdate:modelValue":e[4]||(e[4]=l=>s.value=l),title:"人工核对甘草提交",width:"min(92vw, 520px)","append-to-body":"","destroy-on-close":"","close-on-click-modal":!1},{footer:t(()=>[r(n,{onClick:e[3]||(e[3]=l=>s.value=!1)},{default:t(()=>[...e[8]||(e[8]=[u("取消",-1)])]),_:1}),r(n,{type:"primary",loading:p.value,onClick:b},{default:t(()=>[...e[9]||(e[9]=[u("确认并记录",-1)])]),_:1},8,["loading"])]),default:t(()=>[r(c,{title:"请先在甘草后台核对。本操作会写入不可变更的审计记录。",type:"warning",closable:!1,"show-icon":"",class:"mb-4"}),r(O,{"label-width":"100px",onSubmit:A(b,["prevent"])},{default:t(()=>[r(a,{label:"核对结果",required:""},{default:t(()=>[r(_,{modelValue:o.resolution,"onUpdate:modelValue":e[0]||(e[0]=l=>o.resolution=l)},{default:t(()=>[r(m,{label:"CONFIRM_SUCCESS"},{default:t(()=>[...e[6]||(e[6]=[u("确认已创建",-1)])]),_:1}),r(m,{label:"CONFIRM_NOT_CREATED"},{default:t(()=>[...e[7]||(e[7]=[u("确认未创建",-1)])]),_:1})]),_:1},8,["modelValue"])]),_:1}),o.resolution==="CONFIRM_SUCCESS"?(f(),E(a,{key:0,label:"甘草单号",required:""},{default:t(()=>[r(S,{modelValue:o.remote_order_no,"onUpdate:modelValue":e[1]||(e[1]=l=>o.remote_order_no=l),maxlength:"64",clearable:""},null,8,["modelValue"])]),_:1})):g("",!0),r(a,{label:"核对依据",required:""},{default:t(()=>[r(S,{modelValue:o.note,"onUpdate:modelValue":e[2]||(e[2]=l=>o.note=l),type:"textarea",rows:3,maxlength:"1000","show-word-limit":"",placeholder:"例如:核对时间、甘草后台查询条件及结果"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1},8,["modelValue"])],64)):g("",!0)}}});export{Q as _};
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
import{o as I,q as a,r as l,ai as x,v as r,D as m,L as d,T as i,a4 as D,s as n,O as g,bp as K,P as B,ae as L,u as v,bS as U,w as q,bT as A,bU as G,bV as O,F as P,K as j,p as u}from"./.pnpm-DnXobOVo.js";import{t as H,_ as J}from"./index-B5yNocKV.js";const Q={class:"msg-body"},R={class:"msg-meta"},W={class:"msg-sender"},X={class:"msg-time"},Y={key:0,class:"content-text"},Z={key:2,class:"content-pending"},ee=["src"],se={key:4,class:"content-pending"},te=["src"],ae={key:6,class:"content-pending"},ne={key:7,class:"content-file"},le={class:"file-meta"},ie=["title"],oe={class:"file-info"},ce={key:8,class:"content-fallback"},re={class:"fallback-title"},me={class:"fallback-desc"},ue=I({__name:"MessageBubble",props:{message:{}},setup(s){const o=s,w=u(()=>o.message.from_is_staff),c=u(()=>(o.message.media||[]).find(t=>t.status===1)??null),_=u(()=>{const e=o.message.from_profile;return e&&e.name||o.message.from_user}),z=u(()=>{const e=o.message.from_profile;return(e==null?void 0:e.avatar)||""}),F=u(()=>(_.value||"").slice(-2)||"?"),C=u(()=>{const e=o.message.msgtype;return e==="image"||e==="video"||e==="voice"?"bubble-media":e==="file"?"bubble-file":"bubble-text"}),E=u(()=>{switch(o.message.msgtype){case"link":return"[链接]";case"weapp":return"[小程序]";case"chatrecord":return"[聊天记录]";case"location":return"[位置]";case"card":return"[名片]";case"meeting":return"[会议]";case"docmsg":return"[文档]";case"mixed":return"[混合消息]";case"emotion":return"[表情]";default:return`[${o.message.msgtype}]`}});function M(e){return e?H(e*1e3,"mm-dd hh:MM"):""}function N(e){return e?e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/1024/1024).toFixed(2)} MB`:`${(e/1024/1024/1024).toFixed(2)} GB`:""}function $(e){window.open(e,"_blank","noopener")}return(e,t)=>{var b,y,p,h;const T=D,k=K,V=L,f=q,S=j;return a(),l("div",{class:x(["msg-bubble",{"is-staff":w.value}])},[r(T,{class:"msg-avatar",size:36,src:z.value},{default:m(()=>[d(i(F.value),1)]),_:1},8,["src"]),n("div",Q,[n("div",R,[n("span",W,i(_.value),1),n("span",X,i(M(s.message.send_time)),1),s.message.action==="recall"?(a(),g(k,{key:0,size:"small",type:"info"},{default:m(()=>[...t[1]||(t[1]=[d(" 已撤回 ",-1)])]),_:1})):B("",!0)]),n("div",{class:x(["msg-content",C.value])},[s.message.msgtype==="text"||s.message.msgtype==="markdown"?(a(),l("div",Y,i(s.message.content),1)):s.message.msgtype==="image"&&((b=c.value)!=null&&b.file_url)?(a(),g(V,{key:1,src:c.value.file_url,"preview-src-list":[c.value.file_url],fit:"contain",class:"content-image","hide-on-click-modal":""},null,8,["src","preview-src-list"])):s.message.msgtype==="image"?(a(),l("div",Z,[r(f,null,{default:m(()=>[r(v(U))]),_:1}),t[2]||(t[2]=n("span",null,"图片下载中…",-1))])):s.message.msgtype==="video"&&((y=c.value)!=null&&y.file_url)?(a(),l("video",{key:3,src:c.value.file_url,controls:"",class:"content-video"},null,8,ee)):s.message.msgtype==="video"?(a(),l("div",se,[r(f,null,{default:m(()=>[r(v(A))]),_:1}),t[3]||(t[3]=n("span",null,"视频下载中…",-1))])):s.message.msgtype==="voice"&&((p=c.value)!=null&&p.file_url)?(a(),l("audio",{key:5,src:c.value.file_url,controls:"",class:"content-audio"},null,8,te)):s.message.msgtype==="voice"?(a(),l("div",ae,[r(f,null,{default:m(()=>[r(v(G))]),_:1}),n("span",null,"语音下载中…("+i(s.message.play_length)+"s)",1)])):s.message.msgtype==="file"?(a(),l("div",ne,[r(f,{size:24},{default:m(()=>[r(v(O))]),_:1}),n("div",le,[n("div",{class:"file-name",title:s.message.file_name},i(s.message.file_name||"未命名文件"),9,ie),n("div",oe,[d(i(N(s.message.file_size))+" ",1),s.message.file_ext?(a(),l(P,{key:0},[d("· "+i(s.message.file_ext),1)],64)):B("",!0)])]),(h=c.value)!=null&&h.file_url?(a(),g(S,{key:0,size:"small",type:"primary",link:"",onClick:t[0]||(t[0]=de=>$(c.value.file_url))},{default:m(()=>[...t[4]||(t[4]=[d(" 下载 ",-1)])]),_:1})):(a(),g(k,{key:1,size:"small",type:"info"},{default:m(()=>[...t[5]||(t[5]=[d("下载中…",-1)])]),_:1}))])):(a(),l("div",ce,[n("div",re,i(E.value),1),n("div",me,i(s.message.content),1)]))],2)])],2)}}}),ve=J(ue,[["__scopeId","data-v-80799394"]]);export{ve as default};
import{o as I,q as a,r as l,ai as x,v as r,D as m,L as d,T as i,a4 as D,s as n,O as g,bp as K,P as B,ae as L,u as v,bS as U,w as q,bT as A,bU as G,bV as O,F as P,K as j,p as u}from"./.pnpm-DnXobOVo.js";import{t as H,_ as J}from"./index-CtDDMof-.js";const Q={class:"msg-body"},R={class:"msg-meta"},W={class:"msg-sender"},X={class:"msg-time"},Y={key:0,class:"content-text"},Z={key:2,class:"content-pending"},ee=["src"],se={key:4,class:"content-pending"},te=["src"],ae={key:6,class:"content-pending"},ne={key:7,class:"content-file"},le={class:"file-meta"},ie=["title"],oe={class:"file-info"},ce={key:8,class:"content-fallback"},re={class:"fallback-title"},me={class:"fallback-desc"},ue=I({__name:"MessageBubble",props:{message:{}},setup(s){const o=s,w=u(()=>o.message.from_is_staff),c=u(()=>(o.message.media||[]).find(t=>t.status===1)??null),_=u(()=>{const e=o.message.from_profile;return e&&e.name||o.message.from_user}),z=u(()=>{const e=o.message.from_profile;return(e==null?void 0:e.avatar)||""}),F=u(()=>(_.value||"").slice(-2)||"?"),C=u(()=>{const e=o.message.msgtype;return e==="image"||e==="video"||e==="voice"?"bubble-media":e==="file"?"bubble-file":"bubble-text"}),E=u(()=>{switch(o.message.msgtype){case"link":return"[链接]";case"weapp":return"[小程序]";case"chatrecord":return"[聊天记录]";case"location":return"[位置]";case"card":return"[名片]";case"meeting":return"[会议]";case"docmsg":return"[文档]";case"mixed":return"[混合消息]";case"emotion":return"[表情]";default:return`[${o.message.msgtype}]`}});function M(e){return e?H(e*1e3,"mm-dd hh:MM"):""}function N(e){return e?e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/1024/1024).toFixed(2)} MB`:`${(e/1024/1024/1024).toFixed(2)} GB`:""}function $(e){window.open(e,"_blank","noopener")}return(e,t)=>{var b,y,p,h;const T=D,k=K,V=L,f=q,S=j;return a(),l("div",{class:x(["msg-bubble",{"is-staff":w.value}])},[r(T,{class:"msg-avatar",size:36,src:z.value},{default:m(()=>[d(i(F.value),1)]),_:1},8,["src"]),n("div",Q,[n("div",R,[n("span",W,i(_.value),1),n("span",X,i(M(s.message.send_time)),1),s.message.action==="recall"?(a(),g(k,{key:0,size:"small",type:"info"},{default:m(()=>[...t[1]||(t[1]=[d(" 已撤回 ",-1)])]),_:1})):B("",!0)]),n("div",{class:x(["msg-content",C.value])},[s.message.msgtype==="text"||s.message.msgtype==="markdown"?(a(),l("div",Y,i(s.message.content),1)):s.message.msgtype==="image"&&((b=c.value)!=null&&b.file_url)?(a(),g(V,{key:1,src:c.value.file_url,"preview-src-list":[c.value.file_url],fit:"contain",class:"content-image","hide-on-click-modal":""},null,8,["src","preview-src-list"])):s.message.msgtype==="image"?(a(),l("div",Z,[r(f,null,{default:m(()=>[r(v(U))]),_:1}),t[2]||(t[2]=n("span",null,"图片下载中…",-1))])):s.message.msgtype==="video"&&((y=c.value)!=null&&y.file_url)?(a(),l("video",{key:3,src:c.value.file_url,controls:"",class:"content-video"},null,8,ee)):s.message.msgtype==="video"?(a(),l("div",se,[r(f,null,{default:m(()=>[r(v(A))]),_:1}),t[3]||(t[3]=n("span",null,"视频下载中…",-1))])):s.message.msgtype==="voice"&&((p=c.value)!=null&&p.file_url)?(a(),l("audio",{key:5,src:c.value.file_url,controls:"",class:"content-audio"},null,8,te)):s.message.msgtype==="voice"?(a(),l("div",ae,[r(f,null,{default:m(()=>[r(v(G))]),_:1}),n("span",null,"语音下载中…("+i(s.message.play_length)+"s)",1)])):s.message.msgtype==="file"?(a(),l("div",ne,[r(f,{size:24},{default:m(()=>[r(v(O))]),_:1}),n("div",le,[n("div",{class:"file-name",title:s.message.file_name},i(s.message.file_name||"未命名文件"),9,ie),n("div",oe,[d(i(N(s.message.file_size))+" ",1),s.message.file_ext?(a(),l(P,{key:0},[d("· "+i(s.message.file_ext),1)],64)):B("",!0)])]),(h=c.value)!=null&&h.file_url?(a(),g(S,{key:0,size:"small",type:"primary",link:"",onClick:t[0]||(t[0]=de=>$(c.value.file_url))},{default:m(()=>[...t[4]||(t[4]=[d(" 下载 ",-1)])]),_:1})):(a(),g(k,{key:1,size:"small",type:"info"},{default:m(()=>[...t[5]||(t[5]=[d("下载中…",-1)])]),_:1}))])):(a(),l("div",ce,[n("div",re,i(E.value),1),n("div",me,i(s.message.content),1)]))],2)])],2)}}}),ve=J(ue,[["__scopeId","data-v-80799394"]]);export{ve as default};
@@ -1,2 +1,2 @@
import{o as ie,R as oe,q as n,r as o,O as k,K as le,D as r,L as B,P as m,v as l,s as d,F as w,G as V,by as ae,a3 as re,a2 as de,p as ue,M as g,T as P,ae as me,u as E,db as U,az as M,w as ce,bV as pe,e as ge}from"./.pnpm-DnXobOVo.js";import{_ as fe}from"./picker-BeXyJvkw.js";import{h as ve,c as _e,f,O as ye,_ as he}from"./index-B5yNocKV.js";import{a as T,d as ke}from"./patient-CqiBEV1n.js";import"./index-DR8bxDFy.js";import"./index-Iz1Kn8Vz.js";import"./index.vue_vue_type_script_setup_true_lang-GSVwwezT.js";import"./index-D413krku.js";import"./index-BwIr9qiy.js";import"./file-CN5TlpMj.js";import"./index.vue_vue_type_script_setup_true_lang-Bxg_mWlx.js";import"./usePaging-DdtNlhkl.js";const we={class:"note-timeline-wrap"},Ie={key:0,class:"timeline-actions"},Ce={class:"upload-trigger"},xe={class:"upload-trigger"},be={key:1,class:"note-timeline"},Ve={class:"timeline-date"},Ee={class:"timeline-body"},Ne={key:0,class:"timeline-content"},Se={key:1,class:"timeline-images"},De={key:2,class:"timeline-images"},ze={key:0,class:"thumb-wrap"},Ae={key:1,class:"file-wrap"},Be=["href","title"],Pe={class:"file-name"},W=8e3,Ue=ie({__name:"NoteTimeline",props:{notes:{},diagnosisId:{},readonly:{type:Boolean}},emits:["refresh"],setup(u,{emit:j}){const c=u,I=j,X=ue(()=>ye(["doctor.appointment/addDoctorNote"])),v=g(!1),C=g(""),N=g(!1),q=ve(),_=t=>q.getImageUrl(t),S=g([]),D=g([]),y=g(0),h=g(0),K=["jpg","jpeg","png","gif","bmp","webp","svg"],z=t=>{var i;const e=((i=t.split(".").pop())==null?void 0:i.toLowerCase().split("?")[0])||"";return K.includes(e)},$=t=>{var i;const e=t.split("/");return decodeURIComponent(((i=e[e.length-1])==null?void 0:i.split("?")[0])||"文件")},Z=t=>t.filter(z).map(_),H=(t,e)=>{const i=t.filter(z),x=t[e];return i.indexOf(x)},J=t=>t?t.split(`
import{o as ie,R as oe,q as n,r as o,O as k,K as le,D as r,L as B,P as m,v as l,s as d,F as w,G as V,by as ae,a3 as re,a2 as de,p as ue,M as g,T as P,ae as me,u as E,db as U,az as M,w as ce,bV as pe,e as ge}from"./.pnpm-DnXobOVo.js";import{_ as fe}from"./picker-XkvlrY02.js";import{h as ve,c as _e,f,O as ye,_ as he}from"./index-CtDDMof-.js";import{a as T,d as ke}from"./patient-BJpvM5oP.js";import"./index-DA1wTakk.js";import"./index-BBOU6YoR.js";import"./index.vue_vue_type_script_setup_true_lang-GSVwwezT.js";import"./index-Dkmpcn4K.js";import"./index-BIk_Y15k.js";import"./file-u1OP1ZCG.js";import"./index.vue_vue_type_script_setup_true_lang-Bxg_mWlx.js";import"./usePaging-DdtNlhkl.js";const we={class:"note-timeline-wrap"},Ie={key:0,class:"timeline-actions"},Ce={class:"upload-trigger"},xe={class:"upload-trigger"},be={key:1,class:"note-timeline"},Ve={class:"timeline-date"},Ee={class:"timeline-body"},Ne={key:0,class:"timeline-content"},Se={key:1,class:"timeline-images"},De={key:2,class:"timeline-images"},ze={key:0,class:"thumb-wrap"},Ae={key:1,class:"file-wrap"},Be=["href","title"],Pe={class:"file-name"},W=8e3,Ue=ie({__name:"NoteTimeline",props:{notes:{},diagnosisId:{},readonly:{type:Boolean}},emits:["refresh"],setup(u,{emit:j}){const c=u,I=j,X=ue(()=>ye(["doctor.appointment/addDoctorNote"])),v=g(!1),C=g(""),N=g(!1),q=ve(),_=t=>q.getImageUrl(t),S=g([]),D=g([]),y=g(0),h=g(0),K=["jpg","jpeg","png","gif","bmp","webp","svg"],z=t=>{var i;const e=((i=t.split(".").pop())==null?void 0:i.toLowerCase().split("?")[0])||"";return K.includes(e)},$=t=>{var i;const e=t.split("/");return decodeURIComponent(((i=e[e.length-1])==null?void 0:i.split("?")[0])||"文件")},Z=t=>t.filter(z).map(_),H=(t,e)=>{const i=t.filter(z),x=t[e];return i.indexOf(x)},J=t=>t?t.split(`
`).filter(Boolean):[],Q=t=>{if(!c.diagnosisId)return;const e=Array.isArray(t)?t:[t];if(e.length<=y.value){y.value=e.length;return}const i=e.slice(y.value);y.value=e.length,i.length>0&&T({diagnosis_id:c.diagnosisId,tongue_images:i}).then(()=>{f.msgSuccess("舌苔照片已添加"),I("refresh")})},Y=t=>{if(!c.diagnosisId)return;const e=Array.isArray(t)?t:[t];if(e.length<=h.value){h.value=e.length;return}const i=e.slice(h.value);h.value=e.length,i.length>0&&T({diagnosis_id:c.diagnosisId,report_files:i}).then(()=>{f.msgSuccess("检查报告已添加"),I("refresh")})};oe(()=>c.notes,()=>{S.value=[],D.value=[],y.value=0,h.value=0});const ee=async()=>{if(!c.diagnosisId){f.msgWarning("当前无诊单,无法添加备注");return}const t=C.value.trim();if(!t){f.msgWarning("请输入备注内容");return}N.value=!0;try{await T({diagnosis_id:c.diagnosisId,content:t}),f.msgSuccess("备注保存成功"),C.value="",v.value=!1,I("refresh")}catch(e){f.msgError((e==null?void 0:e.message)||"保存失败")}finally{N.value=!1}},A=async(t,e,i)=>{try{await ge.confirm("确认删除?","提示",{type:"warning"})}catch{return}await ke({note_id:t,image_type:e,image_path:i}),f.msgSuccess("已删除"),I("refresh")};return(t,e)=>{const i=le,x=_e,F=fe,L=me,b=ce,te=ae,se=re,ne=de;return n(),o("div",we,[!u.readonly&&u.diagnosisId?(n(),o("div",Ie,[X.value?(n(),k(i,{key:0,type:"primary",plain:"",size:"small",onClick:e[0]||(e[0]=s=>v.value=!0)},{default:r(()=>[...e[6]||(e[6]=[B(" 添加备注 ",-1)])]),_:1})):m("",!0),l(F,{modelValue:S.value,"onUpdate:modelValue":e[1]||(e[1]=s=>S.value=s),limit:99,type:"image","exclude-domain":!0,onChange:Q},{upload:r(()=>[d("div",Ce,[l(x,{size:20,name:"el-icon-Plus"}),e[7]||(e[7]=d("span",null,"舌苔照片",-1))])]),_:1},8,["modelValue"]),l(F,{modelValue:D.value,"onUpdate:modelValue":e[2]||(e[2]=s=>D.value=s),limit:99,type:"file","exclude-domain":!0,onChange:Y},{upload:r(()=>[d("div",xe,[l(x,{size:20,name:"el-icon-Plus"}),e[8]||(e[8]=d("span",null,"检查报告",-1))])]),_:1},8,["modelValue"])])):m("",!0),u.notes.length?(n(),o("div",be,[(n(!0),o(w,null,V(u.notes,s=>{var R,O;return n(),o("div",{key:s.id,class:"timeline-node"},[e[11]||(e[11]=d("div",{class:"timeline-dot"},null,-1)),d("div",Ve,P(s.note_date),1),d("div",Ee,[s.content?(n(),o("div",Ne,[(n(!0),o(w,null,V(J(s.content),(a,p)=>(n(),o("div",{key:p,class:"content-line"},P(a),1))),128))])):m("",!0),(R=s.tongue_images)!=null&&R.length?(n(),o("div",Se,[e[9]||(e[9]=d("span",{class:"images-label"},"舌苔照片",-1)),(n(!0),o(w,null,V(s.tongue_images,(a,p)=>(n(),o("div",{key:p,class:"thumb-wrap"},[l(L,{src:_(a),"preview-src-list":s.tongue_images.map(_),"initial-index":p,"z-index":W,fit:"cover",class:"timeline-thumb","preview-teleported":""},null,8,["src","preview-src-list","initial-index"]),u.readonly?m("",!0):(n(),k(b,{key:0,class:"thumb-delete",onClick:M(G=>A(s.id,"tongue_images",a),["stop"])},{default:r(()=>[l(E(U))]),_:1},8,["onClick"]))]))),128))])):m("",!0),(O=s.report_files)!=null&&O.length?(n(),o("div",De,[e[10]||(e[10]=d("span",{class:"images-label"},"检查报告",-1)),(n(!0),o(w,null,V(s.report_files,(a,p)=>(n(),o(w,{key:p},[z(a)?(n(),o("div",ze,[l(L,{src:_(a),"preview-src-list":Z(s.report_files),"initial-index":H(s.report_files,p),"z-index":W,fit:"cover",class:"timeline-thumb","preview-teleported":""},null,8,["src","preview-src-list","initial-index"]),u.readonly?m("",!0):(n(),k(b,{key:0,class:"thumb-delete",onClick:M(G=>A(s.id,"report_files",a),["stop"])},{default:r(()=>[l(E(U))]),_:1},8,["onClick"]))])):(n(),o("div",Ae,[d("a",{href:_(a),target:"_blank",class:"file-link",title:$(a)},[l(b,{size:20},{default:r(()=>[l(E(pe))]),_:1}),d("span",Pe,P($(a)),1)],8,Be),u.readonly?m("",!0):(n(),k(b,{key:0,class:"file-delete",onClick:M(G=>A(s.id,"report_files",a),["stop"])},{default:r(()=>[l(E(U))]),_:1},8,["onClick"]))]))],64))),128))])):m("",!0)])])}),128))])):m("",!0),!u.notes.length&&u.readonly?(n(),k(te,{key:2,description:"暂无备注","image-size":48})):m("",!0),l(ne,{modelValue:v.value,"onUpdate:modelValue":e[5]||(e[5]=s=>v.value=s),title:"添加备注",width:"480px","append-to-body":""},{footer:r(()=>[l(i,{onClick:e[4]||(e[4]=s=>v.value=!1)},{default:r(()=>[...e[12]||(e[12]=[B("取消",-1)])]),_:1}),l(i,{type:"primary",loading:N.value,onClick:ee},{default:r(()=>[...e[13]||(e[13]=[B("保存",-1)])]),_:1},8,["loading"])]),default:r(()=>[l(se,{modelValue:C.value,"onUpdate:modelValue":e[3]||(e[3]=s=>C.value=s),type:"textarea",rows:4,placeholder:"输入今日备注...",maxlength:"500","show-word-limit":""},null,8,["modelValue"])]),_:1},8,["modelValue"])])}}}),Ke=he(Ue,[["__scopeId","data-v-e548427d"]]);export{Ke as default};
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
import{m as I,f as p,a as w}from"./diag-display-DCz_VAqj.js";import{o as y,q as x,r as B,s as e,T as a,u as i,P as N}from"./.pnpm-DnXobOVo.js";import{_ as V}from"./index-B5yNocKV.js";const b={class:"card patient-card"},q={class:"patient-hero"},D={class:"patient-name"},E={class:"patient-meta"},G={key:0},S=y({__name:"PatientInfoCard",props:{apt:{default:()=>({})},diag:{default:()=>({})}},setup(t){return(T,n)=>{var d,s,o,c,m,l,r,g,u,f,h,v,k,P,C;return x(),B("div",b,[n[0]||(n[0]=e("div",{class:"card-title"},"患者信息",-1)),e("div",q,[e("div",D,a(((d=t.apt)==null?void 0:d.patient_name)||"—"),1),e("div",E,[e("div",null,a(i(I)((s=t.apt)==null?void 0:s.patient_phone))+" · "+a(i(p)((o=t.diag)==null?void 0:o.gender))+" · "+a(((c=t.diag)==null?void 0:c.age)!=null?t.diag.age+"岁":"—"),1),e("div",null,a((m=t.diag)!=null&&m.height?t.diag.height+"cm":"—")+" / "+a((l=t.diag)!=null&&l.weight?t.diag.weight+"kg":"—")+" · "+a(((r=t.diag)==null?void 0:r.region)||"—"),1),e("div",null," 预约:"+a((g=t.apt)==null?void 0:g.appointment_date)+" "+a((u=t.apt)==null?void 0:u.appointment_time)+" · "+a(i(w)((f=t.apt)==null?void 0:f.period)),1),e("div",null,"医生:"+a(((h=t.apt)==null?void 0:h.doctor_name)||"—")+" 客服:"+a(((v=t.apt)==null?void 0:v.assistant_name)||"—"),1),e("div",null," 状态:"+a(((k=t.apt)==null?void 0:k.status_desc)||"—")+" · "+a((P=t.apt)!=null&&P.has_prescription?"已开方":"未开方"),1),(C=t.apt)!=null&&C.remark?(x(),B("div",G,"备注:"+a(t.apt.remark),1)):N("",!0)])])])}}}),F=V(S,[["__scopeId","data-v-37de0c0b"]]);export{F as default};
import{m as I,f as p,a as w}from"./diag-display-DCz_VAqj.js";import{o as y,q as x,r as B,s as e,T as a,u as i,P as N}from"./.pnpm-DnXobOVo.js";import{_ as V}from"./index-CtDDMof-.js";const b={class:"card patient-card"},q={class:"patient-hero"},D={class:"patient-name"},E={class:"patient-meta"},G={key:0},S=y({__name:"PatientInfoCard",props:{apt:{default:()=>({})},diag:{default:()=>({})}},setup(t){return(T,n)=>{var d,s,o,c,m,l,r,g,u,f,h,v,k,P,C;return x(),B("div",b,[n[0]||(n[0]=e("div",{class:"card-title"},"患者信息",-1)),e("div",q,[e("div",D,a(((d=t.apt)==null?void 0:d.patient_name)||"—"),1),e("div",E,[e("div",null,a(i(I)((s=t.apt)==null?void 0:s.patient_phone))+" · "+a(i(p)((o=t.diag)==null?void 0:o.gender))+" · "+a(((c=t.diag)==null?void 0:c.age)!=null?t.diag.age+"岁":"—"),1),e("div",null,a((m=t.diag)!=null&&m.height?t.diag.height+"cm":"—")+" / "+a((l=t.diag)!=null&&l.weight?t.diag.weight+"kg":"—")+" · "+a(((r=t.diag)==null?void 0:r.region)||"—"),1),e("div",null," 预约:"+a((g=t.apt)==null?void 0:g.appointment_date)+" "+a((u=t.apt)==null?void 0:u.appointment_time)+" · "+a(i(w)((f=t.apt)==null?void 0:f.period)),1),e("div",null,"医生:"+a(((h=t.apt)==null?void 0:h.doctor_name)||"—")+" 客服:"+a(((v=t.apt)==null?void 0:v.assistant_name)||"—"),1),e("div",null," 状态:"+a(((k=t.apt)==null?void 0:k.status_desc)||"—")+" · "+a((P=t.apt)!=null&&P.has_prescription?"已开方":"未开方"),1),(C=t.apt)!=null&&C.remark?(x(),B("div",G,"备注:"+a(t.apt.remark),1)):N("",!0)])])])}}}),F=V(S,[["__scopeId","data-v-37de0c0b"]]);export{F as default};
@@ -1 +1 @@
import{o as N,a0 as D,a1 as K,q as l,O as d,D as c,v as E,a3 as L,bd as T,K as U,L as P,bf as A,P as g,ag as F,r as b,F as M,G as $,ai as G,s as p,T as f,by as O,bq as S,bw as j,bg as H,M as o}from"./.pnpm-DnXobOVo.js";import{a as J}from"./assistantService-D5p4fZs8.js";import{i as Q,e as R}from"./shared-lpbp3iP7.js";import{_ as W}from"./index-B5yNocKV.js";const X={class:"count"},Y={class:"patient-list"},Z=["aria-pressed","onClick"],q=N({__name:"PatientPicker",props:{selectedId:{}},emits:["select"],setup(C){const y=o(""),m=o(1),s=o(0),v=o([]),r=o(!1),n=o("");let i=0,t;async function _(){const u=++i;t==null||t.abort(),t=new AbortController,r.value=!0,n.value="";try{const e=await J({keyword:y.value.trim(),page_no:m.value,page_size:10},t.signal);if(u!==i)return;v.value=e.lists,s.value=e.count}catch(e){if(u!==i||Q(e))return;v.value=[],s.value=0,n.value=R(e)}finally{u===i&&(r.value=!1)}}function k(){m.value=1,_()}return D(_),K(()=>{i++,t==null||t.abort()}),(u,e)=>{const w=U,V=L,h=A,x=O,B=j,I=H,z=S;return l(),d(I,{shadow:"never",class:"patient-picker"},{header:c(()=>[e[2]||(e[2]=p("strong",null,"授权患者",-1)),p("span",X,f(s.value)+" 位",1)]),default:c(()=>[E(V,{modelValue:y.value,"onUpdate:modelValue":e[0]||(e[0]=a=>y.value=a),clearable:"",placeholder:"搜索患者姓名 / 手机号","aria-label":"搜索授权患者",onKeyup:T(k,["enter"]),onClear:k},{append:c(()=>[E(w,{loading:r.value,onClick:k},{default:c(()=>[...e[3]||(e[3]=[P("搜索",-1)])]),_:1},8,["loading"])]),_:1},8,["modelValue"]),n.value?(l(),d(h,{key:0,class:"mt-3",title:n.value,type:"error",closable:!1,"show-icon":""},null,8,["title"])):g("",!0),n.value?(l(),d(w,{key:1,link:"",type:"primary",onClick:_},{default:c(()=>[...e[4]||(e[4]=[P("重新加载",-1)])]),_:1})):g("",!0),F((l(),b("div",Y,[(l(!0),b(M,null,$(v.value,a=>(l(),b("button",{key:a.diagnosis_id,type:"button",class:G(["patient-row",{selected:C.selectedId===a.diagnosis_id}]),"aria-pressed":C.selectedId===a.diagnosis_id,onClick:ee=>u.$emit("select",a)},[p("strong",null,f(a.patient_name||"未命名患者"),1),p("span",null,f(a.phone_masked||"未提供手机号"),1),p("small",null,"诊单 #"+f(a.diagnosis_id),1)],10,Z))),128)),!r.value&&!v.value.length&&!n.value?(l(),d(x,{key:0,description:"当前范围内暂无匹配患者","image-size":70})):g("",!0)])),[[z,r.value]]),s.value?(l(),d(B,{key:2,"current-page":m.value,"onUpdate:currentPage":e[1]||(e[1]=a=>m.value=a),small:"",layout:"prev, pager, next","pager-count":5,total:s.value,"page-size":10,onCurrentChange:_},null,8,["current-page","total"])):g("",!0)]),_:1})}}}),oe=W(q,[["__scopeId","data-v-dee52133"]]);export{oe as default};
import{o as N,a0 as D,a1 as K,q as l,O as d,D as c,v as E,a3 as L,bd as T,K as U,L as P,bf as A,P as g,ag as F,r as b,F as M,G as $,ai as G,s as p,T as f,by as O,bq as S,bw as j,bg as H,M as o}from"./.pnpm-DnXobOVo.js";import{a as J}from"./assistantService-CazTbyZa.js";import{i as Q,e as R}from"./shared-lpbp3iP7.js";import{_ as W}from"./index-CtDDMof-.js";const X={class:"count"},Y={class:"patient-list"},Z=["aria-pressed","onClick"],q=N({__name:"PatientPicker",props:{selectedId:{}},emits:["select"],setup(C){const y=o(""),m=o(1),s=o(0),v=o([]),r=o(!1),n=o("");let i=0,t;async function _(){const u=++i;t==null||t.abort(),t=new AbortController,r.value=!0,n.value="";try{const e=await J({keyword:y.value.trim(),page_no:m.value,page_size:10},t.signal);if(u!==i)return;v.value=e.lists,s.value=e.count}catch(e){if(u!==i||Q(e))return;v.value=[],s.value=0,n.value=R(e)}finally{u===i&&(r.value=!1)}}function k(){m.value=1,_()}return D(_),K(()=>{i++,t==null||t.abort()}),(u,e)=>{const w=U,V=L,h=A,x=O,B=j,I=H,z=S;return l(),d(I,{shadow:"never",class:"patient-picker"},{header:c(()=>[e[2]||(e[2]=p("strong",null,"授权患者",-1)),p("span",X,f(s.value)+" 位",1)]),default:c(()=>[E(V,{modelValue:y.value,"onUpdate:modelValue":e[0]||(e[0]=a=>y.value=a),clearable:"",placeholder:"搜索患者姓名 / 手机号","aria-label":"搜索授权患者",onKeyup:T(k,["enter"]),onClear:k},{append:c(()=>[E(w,{loading:r.value,onClick:k},{default:c(()=>[...e[3]||(e[3]=[P("搜索",-1)])]),_:1},8,["loading"])]),_:1},8,["modelValue"]),n.value?(l(),d(h,{key:0,class:"mt-3",title:n.value,type:"error",closable:!1,"show-icon":""},null,8,["title"])):g("",!0),n.value?(l(),d(w,{key:1,link:"",type:"primary",onClick:_},{default:c(()=>[...e[4]||(e[4]=[P("重新加载",-1)])]),_:1})):g("",!0),F((l(),b("div",Y,[(l(!0),b(M,null,$(v.value,a=>(l(),b("button",{key:a.diagnosis_id,type:"button",class:G(["patient-row",{selected:C.selectedId===a.diagnosis_id}]),"aria-pressed":C.selectedId===a.diagnosis_id,onClick:ee=>u.$emit("select",a)},[p("strong",null,f(a.patient_name||"未命名患者"),1),p("span",null,f(a.phone_masked||"未提供手机号"),1),p("small",null,"诊单 #"+f(a.diagnosis_id),1)],10,Z))),128)),!r.value&&!v.value.length&&!n.value?(l(),d(x,{key:0,description:"当前范围内暂无匹配患者","image-size":70})):g("",!0)])),[[z,r.value]]),s.value?(l(),d(B,{key:2,"current-page":m.value,"onUpdate:currentPage":e[1]||(e[1]=a=>m.value=a),small:"",layout:"prev, pager, next","pager-count":5,total:s.value,"page-size":10,onCurrentChange:_},null,8,["current-page","total"])):g("",!0)]),_:1})}}}),oe=W(q,[["__scopeId","data-v-dee52133"]]);export{oe as default};
@@ -1 +1 @@
import{o as I,R as P,q as l,r as w,s as v,O as y,bz as A,P as g,T as B,D as C,L as N,K as E,al as S,M as p}from"./.pnpm-DnXobOVo.js";import{Q as x,_ as D}from"./index-B5yNocKV.js";import{P as L}from"./EsignPrescriptionPanel-DPb9D_2v.js";const V={key:0,class:"prescription-audit-layout"},$=["aria-busy"],z={key:2,class:"prescription-audit-preview__error",role:"status"},T={class:"prescription-audit-controls","aria-label":"签署和审核"},q=I({__name:"PrescriptionAuditLayout",props:{prescriptionId:{},doctorSignedAt:{},pharmacistSignedAt:{}},setup(f){const m=f,s=p(null),b=p(0),n=p(!1),r=p("");return P([()=>m.prescriptionId,()=>m.doctorSignedAt,()=>m.pharmacistSignedAt,b],async([e,a,c,_],o,h)=>{var k;if(e!==(o==null?void 0:o[0])&&(s.value=null),n.value=!1,r.value="",e===null)return;if(!Number.isSafeInteger(e)||e<=0){r.value="当前订单未关联处方";return}const t=(k=s.value)==null?void 0:k.esign;if(s.value&&_===(o==null?void 0:o[3])&&(!a||a===((t==null?void 0:t.signature_time)||(t==null?void 0:t.signed_at)))&&(!c||c===(t==null?void 0:t.review_signature_time)))return;const i=new AbortController;h(()=>i.abort()),n.value=!0;try{const u=await x({id:e},i.signal),d=(u==null?void 0:u.data)??u;if(i.signal.aborted)return;if(Number(d==null?void 0:d.id)!==e)throw new Error("处方编号不匹配");s.value=d}catch{i.signal.aborted||(r.value="无法加载处方单,请重试。")}finally{i.signal.aborted||(n.value=!1)}},{immediate:!0}),(e,a)=>{const c=A,_=E;return f.prescriptionId!==null?(l(),w("div",V,[v("section",{class:"prescription-audit-preview","aria-label":"处方单","aria-busy":n.value},[s.value?(l(),y(L,{key:0,data:s.value,compact:""},null,8,["data"])):n.value?(l(),y(c,{key:1,rows:8,animated:""})):g("",!0),r.value?(l(),w("div",z,[v("span",null,B(r.value),1),f.prescriptionId>0?(l(),y(_,{key:0,size:"small",onClick:a[0]||(a[0]=o=>b.value++)},{default:C(()=>[...a[1]||(a[1]=[N("重试加载处方",-1)])]),_:1})):g("",!0)])):g("",!0)],8,$),v("section",T,[S(e.$slots,"default",{},void 0,!0)])])):S(e.$slots,"default",{key:1},void 0,!0)}}}),Q=D(q,[["__scopeId","data-v-006ac7ff"]]);export{Q as P};
import{o as I,R as P,q as l,r as w,s as v,O as y,bz as A,P as g,T as B,D as C,L as N,K as E,al as S,M as p}from"./.pnpm-DnXobOVo.js";import{Q as x,_ as D}from"./index-CtDDMof-.js";import{P as L}from"./EsignPrescriptionPanel-BvFYHe-6.js";const V={key:0,class:"prescription-audit-layout"},$=["aria-busy"],z={key:2,class:"prescription-audit-preview__error",role:"status"},T={class:"prescription-audit-controls","aria-label":"签署和审核"},q=I({__name:"PrescriptionAuditLayout",props:{prescriptionId:{},doctorSignedAt:{},pharmacistSignedAt:{}},setup(f){const m=f,s=p(null),b=p(0),n=p(!1),r=p("");return P([()=>m.prescriptionId,()=>m.doctorSignedAt,()=>m.pharmacistSignedAt,b],async([e,a,c,_],o,h)=>{var k;if(e!==(o==null?void 0:o[0])&&(s.value=null),n.value=!1,r.value="",e===null)return;if(!Number.isSafeInteger(e)||e<=0){r.value="当前订单未关联处方";return}const t=(k=s.value)==null?void 0:k.esign;if(s.value&&_===(o==null?void 0:o[3])&&(!a||a===((t==null?void 0:t.signature_time)||(t==null?void 0:t.signed_at)))&&(!c||c===(t==null?void 0:t.review_signature_time)))return;const i=new AbortController;h(()=>i.abort()),n.value=!0;try{const u=await x({id:e},i.signal),d=(u==null?void 0:u.data)??u;if(i.signal.aborted)return;if(Number(d==null?void 0:d.id)!==e)throw new Error("处方编号不匹配");s.value=d}catch{i.signal.aborted||(r.value="无法加载处方单,请重试。")}finally{i.signal.aborted||(n.value=!1)}},{immediate:!0}),(e,a)=>{const c=A,_=E;return f.prescriptionId!==null?(l(),w("div",V,[v("section",{class:"prescription-audit-preview","aria-label":"处方单","aria-busy":n.value},[s.value?(l(),y(L,{key:0,data:s.value,compact:""},null,8,["data"])):n.value?(l(),y(c,{key:1,rows:8,animated:""})):g("",!0),r.value?(l(),w("div",z,[v("span",null,B(r.value),1),f.prescriptionId>0?(l(),y(_,{key:0,size:"small",onClick:a[0]||(a[0]=o=>b.value++)},{default:C(()=>[...a[1]||(a[1]=[N("重试加载处方",-1)])]),_:1})):g("",!0)])):g("",!0)],8,$),v("section",T,[S(e.$slots,"default",{},void 0,!0)])])):S(e.$slots,"default",{key:1},void 0,!0)}}}),Q=D(q,[["__scopeId","data-v-006ac7ff"]]);export{Q as P};
@@ -1 +0,0 @@
import{_ as o}from"./PrescriptionOrderTimeDialog.vue_vue_type_script_setup_true_lang-C8BTNyp-.js";import"./.pnpm-DnXobOVo.js";import"./index-B5yNocKV.js";export{o as default};
@@ -0,0 +1 @@
import{_ as o}from"./PrescriptionOrderTimeDialog.vue_vue_type_script_setup_true_lang-YaW9WSvs.js";import"./.pnpm-DnXobOVo.js";import"./index-CtDDMof-.js";export{o as default};
@@ -1 +1 @@
import{o as $,q as T,O as Y,D as r,v as n,be as M,bc as w,s as _,T as E,aC as S,K as C,L as v,a2 as H,M as f,aD as B,n as F}from"./.pnpm-DnXobOVo.js";import{M as O,f as q}from"./index-B5yNocKV.js";const P={class:"break-all"},K=$({__name:"PrescriptionOrderTimeDialog",emits:["saved"],setup(R,{expose:b,emit:g}){const D=g,d=f(!1),t=f(!1),p=f(""),m=f(),a=B({id:0,create_time:""}),k={create_time:[{required:!0,message:"请选择创建时间",trigger:"change"}]};function y(o){const e=String(o??"").trim();if(/^\d{4}-\d{2}-\d{2}[ T]\d{2}:\d{2}(:\d{2})?$/.test(e))return e.replace("T"," ").padEnd(19,":00");if(!/^\d+$/.test(e)||Number(e)<=0)return"";const i=Number(e),l=new Date(i<1e11?i*1e3:i);if(Number.isNaN(l.getTime()))return"";const s=u=>String(u).padStart(2,"0");return`${l.getFullYear()}-${s(l.getMonth()+1)}-${s(l.getDate())} ${s(l.getHours())}:${s(l.getMinutes())}:${s(l.getSeconds())}`}function N(o){t.value||!Number(o.id)||(a.id=Number(o.id),a.create_time=y(o.create_time),p.value=String(o.order_no||""),d.value=!0,F(()=>{var e;return(e=m.value)==null?void 0:e.clearValidate()}))}async function x(){if(!(t.value||!m.value)){t.value=!0;try{if(!await m.value.validate().catch(()=>!1))return;await O({id:a.id,create_time:a.create_time}),q.msgSuccess("订单创建时间已修改"),d.value=!1,D("saved",a.id)}catch{}finally{t.value=!1}}}return b({open:N}),(o,e)=>{const i=w,l=S,s=M,u=C,V=H;return T(),Y(V,{modelValue:d.value,"onUpdate:modelValue":e[2]||(e[2]=c=>d.value=c),title:"修改订单创建时间",width:"min(440px, 94vw)","append-to-body":"","destroy-on-close":"","close-on-click-modal":!1,"close-on-press-escape":!t.value,"show-close":!t.value},{footer:r(()=>[n(u,{disabled:t.value,onClick:e[1]||(e[1]=c=>d.value=!1)},{default:r(()=>[...e[3]||(e[3]=[v("取消",-1)])]),_:1},8,["disabled"]),n(u,{type:"primary",loading:t.value,onClick:x},{default:r(()=>[...e[4]||(e[4]=[v("保存",-1)])]),_:1},8,["loading"])]),default:r(()=>[n(s,{ref_key:"formRef",ref:m,model:a,rules:k,"label-position":"top"},{default:r(()=>[n(i,{label:"业务订单"},{default:r(()=>[_("span",P,E(p.value||`#${a.id}`),1)]),_:1}),n(i,{label:"创建时间",prop:"create_time"},{default:r(()=>[n(l,{modelValue:a.create_time,"onUpdate:modelValue":e[0]||(e[0]=c=>a.create_time=c),type:"datetime",format:"YYYY-MM-DD HH:mm:ss","value-format":"YYYY-MM-DD HH:mm:ss",placeholder:"请选择创建时间",clearable:!1,disabled:t.value,class:"!w-full"},null,8,["modelValue","disabled"])]),_:1})]),_:1},8,["model"]),e[5]||(e[5]=_("p",{class:"text-xs text-gray-500"},"保存后,列表和业绩统计将按新的创建时间归属日期,修改记录可在订单日志中查看。",-1))]),_:1},8,["modelValue","close-on-press-escape","show-close"])}}});export{K as _};
import{o as $,q as T,O as Y,D as r,v as n,be as M,bc as w,s as _,T as E,aC as S,K as C,L as v,a2 as H,M as f,aD as B,n as F}from"./.pnpm-DnXobOVo.js";import{M as O,f as q}from"./index-CtDDMof-.js";const P={class:"break-all"},K=$({__name:"PrescriptionOrderTimeDialog",emits:["saved"],setup(R,{expose:b,emit:g}){const D=g,d=f(!1),t=f(!1),p=f(""),m=f(),a=B({id:0,create_time:""}),k={create_time:[{required:!0,message:"请选择创建时间",trigger:"change"}]};function y(o){const e=String(o??"").trim();if(/^\d{4}-\d{2}-\d{2}[ T]\d{2}:\d{2}(:\d{2})?$/.test(e))return e.replace("T"," ").padEnd(19,":00");if(!/^\d+$/.test(e)||Number(e)<=0)return"";const i=Number(e),l=new Date(i<1e11?i*1e3:i);if(Number.isNaN(l.getTime()))return"";const s=u=>String(u).padStart(2,"0");return`${l.getFullYear()}-${s(l.getMonth()+1)}-${s(l.getDate())} ${s(l.getHours())}:${s(l.getMinutes())}:${s(l.getSeconds())}`}function N(o){t.value||!Number(o.id)||(a.id=Number(o.id),a.create_time=y(o.create_time),p.value=String(o.order_no||""),d.value=!0,F(()=>{var e;return(e=m.value)==null?void 0:e.clearValidate()}))}async function x(){if(!(t.value||!m.value)){t.value=!0;try{if(!await m.value.validate().catch(()=>!1))return;await O({id:a.id,create_time:a.create_time}),q.msgSuccess("订单创建时间已修改"),d.value=!1,D("saved",a.id)}catch{}finally{t.value=!1}}}return b({open:N}),(o,e)=>{const i=w,l=S,s=M,u=C,V=H;return T(),Y(V,{modelValue:d.value,"onUpdate:modelValue":e[2]||(e[2]=c=>d.value=c),title:"修改订单创建时间",width:"min(440px, 94vw)","append-to-body":"","destroy-on-close":"","close-on-click-modal":!1,"close-on-press-escape":!t.value,"show-close":!t.value},{footer:r(()=>[n(u,{disabled:t.value,onClick:e[1]||(e[1]=c=>d.value=!1)},{default:r(()=>[...e[3]||(e[3]=[v("取消",-1)])]),_:1},8,["disabled"]),n(u,{type:"primary",loading:t.value,onClick:x},{default:r(()=>[...e[4]||(e[4]=[v("保存",-1)])]),_:1},8,["loading"])]),default:r(()=>[n(s,{ref_key:"formRef",ref:m,model:a,rules:k,"label-position":"top"},{default:r(()=>[n(i,{label:"业务订单"},{default:r(()=>[_("span",P,E(p.value||`#${a.id}`),1)]),_:1}),n(i,{label:"创建时间",prop:"create_time"},{default:r(()=>[n(l,{modelValue:a.create_time,"onUpdate:modelValue":e[0]||(e[0]=c=>a.create_time=c),type:"datetime",format:"YYYY-MM-DD HH:mm:ss","value-format":"YYYY-MM-DD HH:mm:ss",placeholder:"请选择创建时间",clearable:!1,disabled:t.value,class:"!w-full"},null,8,["modelValue","disabled"])]),_:1})]),_:1},8,["model"]),e[5]||(e[5]=_("p",{class:"text-xs text-gray-500"},"保存后,列表和业绩统计将按新的创建时间归属日期,修改记录可在订单日志中查看。",-1))]),_:1},8,["modelValue","close-on-press-escape","show-close"])}}});export{K as _};
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
import{_ as o}from"./RecordDialog.vue_vue_type_script_setup_true_lang-BErHGZ_U.js";import"./.pnpm-DnXobOVo.js";import"./assistantService-D5p4fZs8.js";import"./index-B5yNocKV.js";import"./shared-lpbp3iP7.js";export{o as default};
@@ -0,0 +1 @@
import{_ as o}from"./RecordDialog.vue_vue_type_script_setup_true_lang-D5ka6GeE.js";import"./.pnpm-DnXobOVo.js";import"./assistantService-CazTbyZa.js";import"./index-CtDDMof-.js";import"./shared-lpbp3iP7.js";export{o as default};
@@ -1 +1 @@
import{o as q,bB as N,a1 as A,q as p,O as _,a2 as F,D as o,v as a,bf as P,be as S,az as $,bc as z,bi as G,bs as K,L as d,aC as L,a3 as O,bk as j,P as v,r as H,K as J,bC as x,aD as Q,M as b}from"./.pnpm-DnXobOVo.js";import{u as W}from"./assistantService-D5p4fZs8.js";import{f as X}from"./index-B5yNocKV.js";import{e as Y}from"./shared-lpbp3iP7.js";const Z={key:1,class:"text-xs text-tx-secondary mt-2"},ae=q({__name:"RecordDialog",props:x({diagnosisId:{},maxChars:{}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:x(["saved"],["update:modelValue"]),setup(c,{emit:w}){const E=c,C=w,i=N(c,"modelValue"),t=Q({record_type:"service_note",content:"",speaker_confirmed:!1}),n=b(new Date),r=b(!1),s=b("");let u=!1;const D=m=>m.getTime()>Date.now();async function k(){if(!r.value){if(s.value="",!t.content.trim()||!n.value){s.value="请填写内容和实际发生时间";return}if(n.value.getTime()>Date.now()){s.value="发生时间不能晚于现在";return}if(t.record_type==="verified_transcript"&&!t.speaker_confirmed){s.value="请先核对并确认转写内容与说话人";return}r.value=!0;try{if(await W({...t,content:t.content.trim(),diagnosis_id:E.diagnosisId,occurred_at:Math.floor(n.value.getTime()/1e3),speaker_confirmed:t.record_type==="verified_transcript"&&t.speaker_confirmed}),u)return;X.msgSuccess("服务记录已保存"),i.value=!1,t.content="",t.speaker_confirmed=!1,C("saved")}catch(m){u||(s.value=`${Y(m)}。若连接中断,请先关闭弹窗刷新来源,确认是否已保存,避免重复录入。`)}finally{u||(r.value=!1)}}}return A(()=>{u=!0}),(m,e)=>{const y=P,V=K,B=G,f=z,M=L,U=O,T=j,I=S,g=J,R=F;return p(),_(R,{modelValue:i.value,"onUpdate:modelValue":e[5]||(e[5]=l=>i.value=l),title:"录入服务记录",width:"min(640px, 94vw)","close-on-click-modal":!1,"close-on-press-escape":!r.value,"show-close":!r.value},{footer:o(()=>[a(g,{disabled:r.value,onClick:e[4]||(e[4]=l=>i.value=!1)},{default:o(()=>[...e[9]||(e[9]=[d("取消",-1)])]),_:1},8,["disabled"]),a(g,{type:"primary",loading:r.value,onClick:k},{default:o(()=>[...e[10]||(e[10]=[d("保存记录",-1)])]),_:1},8,["loading"])]),default:o(()=>[a(y,{title:"记录将作为本患者的服务分析来源,请核对时间与说话人。",type:"info",closable:!1,class:"mb-4"}),a(I,{"label-position":"top",disabled:r.value,onSubmit:$(k,["prevent"])},{default:o(()=>[a(f,{label:"记录类型"},{default:o(()=>[a(B,{modelValue:t.record_type,"onUpdate:modelValue":e[0]||(e[0]=l=>t.record_type=l)},{default:o(()=>[a(V,{value:"service_note"},{default:o(()=>[...e[6]||(e[6]=[d("人工服务记录",-1)])]),_:1}),a(V,{value:"verified_transcript"},{default:o(()=>[...e[7]||(e[7]=[d("已核对转写",-1)])]),_:1})]),_:1},8,["modelValue"])]),_:1}),a(f,{label:"实际发生时间(本地时间)",required:""},{default:o(()=>[a(M,{modelValue:n.value,"onUpdate:modelValue":e[1]||(e[1]=l=>n.value=l),type:"datetime",placeholder:"选择发生时间","disabled-date":D},null,8,["modelValue"])]),_:1}),a(f,{label:"服务内容",required:""},{default:o(()=>[a(U,{modelValue:t.content,"onUpdate:modelValue":e[2]||(e[2]=l=>t.content=l),type:"textarea",rows:8,maxlength:c.maxChars,"show-word-limit":"",placeholder:"记录服务诉求、已沟通事项和后续约定;转写请逐段标明实际说话人。"},null,8,["modelValue","maxlength"])]),_:1}),t.record_type==="verified_transcript"?(p(),_(T,{key:0,modelValue:t.speaker_confirmed,"onUpdate:modelValue":e[3]||(e[3]=l=>t.speaker_confirmed=l)},{default:o(()=>[...e[8]||(e[8]=[d("我已对照原始材料核对文字、患者身份与说话人",-1)])]),_:1},8,["modelValue"])):v("",!0),t.record_type==="verified_transcript"?(p(),H("p",Z," 上传者不会自动认定为原对话的服务员工;此记录仅表示素材已核对,不直接用于员工评分。 ")):v("",!0),s.value?(p(),_(y,{key:2,title:s.value,type:"error",closable:!1,class:"mt-4"},null,8,["title"])):v("",!0)]),_:1},8,["disabled"])]),_:1},8,["modelValue","close-on-press-escape","show-close"])}}});export{ae as _};
import{o as q,bB as N,a1 as A,q as p,O as _,a2 as F,D as o,v as a,bf as P,be as S,az as $,bc as z,bi as G,bs as K,L as d,aC as L,a3 as O,bk as j,P as v,r as H,K as J,bC as x,aD as Q,M as b}from"./.pnpm-DnXobOVo.js";import{u as W}from"./assistantService-CazTbyZa.js";import{f as X}from"./index-CtDDMof-.js";import{e as Y}from"./shared-lpbp3iP7.js";const Z={key:1,class:"text-xs text-tx-secondary mt-2"},ae=q({__name:"RecordDialog",props:x({diagnosisId:{},maxChars:{}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:x(["saved"],["update:modelValue"]),setup(c,{emit:w}){const E=c,C=w,i=N(c,"modelValue"),t=Q({record_type:"service_note",content:"",speaker_confirmed:!1}),n=b(new Date),r=b(!1),s=b("");let u=!1;const D=m=>m.getTime()>Date.now();async function k(){if(!r.value){if(s.value="",!t.content.trim()||!n.value){s.value="请填写内容和实际发生时间";return}if(n.value.getTime()>Date.now()){s.value="发生时间不能晚于现在";return}if(t.record_type==="verified_transcript"&&!t.speaker_confirmed){s.value="请先核对并确认转写内容与说话人";return}r.value=!0;try{if(await W({...t,content:t.content.trim(),diagnosis_id:E.diagnosisId,occurred_at:Math.floor(n.value.getTime()/1e3),speaker_confirmed:t.record_type==="verified_transcript"&&t.speaker_confirmed}),u)return;X.msgSuccess("服务记录已保存"),i.value=!1,t.content="",t.speaker_confirmed=!1,C("saved")}catch(m){u||(s.value=`${Y(m)}。若连接中断,请先关闭弹窗刷新来源,确认是否已保存,避免重复录入。`)}finally{u||(r.value=!1)}}}return A(()=>{u=!0}),(m,e)=>{const y=P,V=K,B=G,f=z,M=L,U=O,T=j,I=S,g=J,R=F;return p(),_(R,{modelValue:i.value,"onUpdate:modelValue":e[5]||(e[5]=l=>i.value=l),title:"录入服务记录",width:"min(640px, 94vw)","close-on-click-modal":!1,"close-on-press-escape":!r.value,"show-close":!r.value},{footer:o(()=>[a(g,{disabled:r.value,onClick:e[4]||(e[4]=l=>i.value=!1)},{default:o(()=>[...e[9]||(e[9]=[d("取消",-1)])]),_:1},8,["disabled"]),a(g,{type:"primary",loading:r.value,onClick:k},{default:o(()=>[...e[10]||(e[10]=[d("保存记录",-1)])]),_:1},8,["loading"])]),default:o(()=>[a(y,{title:"记录将作为本患者的服务分析来源,请核对时间与说话人。",type:"info",closable:!1,class:"mb-4"}),a(I,{"label-position":"top",disabled:r.value,onSubmit:$(k,["prevent"])},{default:o(()=>[a(f,{label:"记录类型"},{default:o(()=>[a(B,{modelValue:t.record_type,"onUpdate:modelValue":e[0]||(e[0]=l=>t.record_type=l)},{default:o(()=>[a(V,{value:"service_note"},{default:o(()=>[...e[6]||(e[6]=[d("人工服务记录",-1)])]),_:1}),a(V,{value:"verified_transcript"},{default:o(()=>[...e[7]||(e[7]=[d("已核对转写",-1)])]),_:1})]),_:1},8,["modelValue"])]),_:1}),a(f,{label:"实际发生时间(本地时间)",required:""},{default:o(()=>[a(M,{modelValue:n.value,"onUpdate:modelValue":e[1]||(e[1]=l=>n.value=l),type:"datetime",placeholder:"选择发生时间","disabled-date":D},null,8,["modelValue"])]),_:1}),a(f,{label:"服务内容",required:""},{default:o(()=>[a(U,{modelValue:t.content,"onUpdate:modelValue":e[2]||(e[2]=l=>t.content=l),type:"textarea",rows:8,maxlength:c.maxChars,"show-word-limit":"",placeholder:"记录服务诉求、已沟通事项和后续约定;转写请逐段标明实际说话人。"},null,8,["modelValue","maxlength"])]),_:1}),t.record_type==="verified_transcript"?(p(),_(T,{key:0,modelValue:t.speaker_confirmed,"onUpdate:modelValue":e[3]||(e[3]=l=>t.speaker_confirmed=l)},{default:o(()=>[...e[8]||(e[8]=[d("我已对照原始材料核对文字、患者身份与说话人",-1)])]),_:1},8,["modelValue"])):v("",!0),t.record_type==="verified_transcript"?(p(),H("p",Z," 上传者不会自动认定为原对话的服务员工;此记录仅表示素材已核对,不直接用于员工评分。 ")):v("",!0),s.value?(p(),_(y,{key:2,title:s.value,type:"error",closable:!1,class:"mt-4"},null,8,["title"])):v("",!0)]),_:1},8,["disabled"])]),_:1},8,["modelValue","close-on-press-escape","show-close"])}}});export{ae as _};
@@ -1 +1 @@
import{o as L,q as a,r as c,s as m,F as v,O as d,bv as B,D as _,L as k,P as y,G as q,p as f,T as w}from"./.pnpm-DnXobOVo.js";import H from"./RecordingVideoPlayer-D3EW1shD.js";import{h as I,_ as P}from"./index-B5yNocKV.js";const R={key:0,class:"recording-list"},C={class:"recording-item"},V={key:1,class:"recording-alternates"},N={class:"recording-alternates__links"},D={key:1,class:"text-gray-400"},E=L({__name:"RecordingPlaybackBlock",props:{recordId:{},urls:{}},setup(l){const $=l,h=I(),u=f(()=>{const e=$.urls||[],t=new Set,r=[];for(const o of e){const s=String(o??"").trim();!s||t.has(s)||(t.add(s),r.push(s))}return r}),i=f(()=>{const e=u.value;if(!e.length)return null;const t=e.find(n=>/\.mp4(\?|#|$)/i.test(n));if(t)return t;const r=e.find(n=>/\.m3u8(\?|#|$)/i.test(n)&&/vod-qcloud\.com/i.test(n));if(r)return r;const o=e.find(n=>/\.m3u8(\?|#|$)/i.test(n)&&/\.cos\.[^/]+\.myqcloud\.com/i.test(n));if(o)return o;const s=e.find(n=>/\.m3u8(\?|#|$)/i.test(n));return s||e[0]}),p=f(()=>{const e=u.value,t=i.value;return t?e.filter(r=>r!==t):e.slice(1)});function b(e){if(!e||typeof e!="string")return!1;const t=e.trim();return/^https?:\/\//i.test(t)?/\.(mp4|webm|ogg|mov|mkv|m4v|m3u8)(\?|#|$)/i.test(t):/\.(mp4|webm|ogg|mov|mkv|m4v|m3u8)(\?|#|$)/i.test(t)||t.startsWith("/uploads/")}function g(e){return h.getImageUrl(String(e||"").trim())}function S(e,t){const r=e.trim();return/\.mp4(\?|#|$)/i.test(r)?`MP4 ${t+1}`:/vod-qcloud\.com/i.test(r)&&/\.m3u8/i.test(r)?`点播 ${t+1}`:/\.cos\.[^/]+\.myqcloud\.com/i.test(r)&&/\.m3u8/i.test(r)?`COS HLS ${t+1}`:/\.m3u8/i.test(r)?`HLS ${t+1}`:`链接 ${t+1}`}return(e,t)=>{const r=B;return u.value.length?(a(),c("div",R,[m("div",C,[i.value?(a(),c(v,{key:0},[b(i.value)?(a(),d(H,{key:`${l.recordId}-${i.value}`,src:i.value},null,8,["src"])):(a(),d(r,{key:1,href:g(i.value),target:"_blank",type:"primary"},{default:_(()=>[...t[0]||(t[0]=[k(" 打开回放 ",-1)])]),_:1},8,["href"]))],64)):y("",!0),p.value.length?(a(),c("div",V,[t[1]||(t[1]=m("span",{class:"recording-alternates__label"},"备用地址",-1)),m("div",N,[(a(!0),c(v,null,q(p.value,(o,s)=>(a(),d(r,{key:`${l.recordId}-alt-${s}-${o.slice(-32)}`,href:g(o),target:"_blank",type:"primary",class:"recording-alternates__link"},{default:_(()=>[k(w(S(o,s)),1)]),_:2},1032,["href"]))),128))])])):y("",!0)])])):(a(),c("span",D,"暂无"))}}}),x=P(E,[["__scopeId","data-v-597ae096"]]);export{x as default};
import{o as L,q as a,r as c,s as m,F as v,O as d,bv as B,D as _,L as k,P as y,G as q,p as f,T as w}from"./.pnpm-DnXobOVo.js";import H from"./RecordingVideoPlayer-DXLif0vn.js";import{h as I,_ as P}from"./index-CtDDMof-.js";const R={key:0,class:"recording-list"},C={class:"recording-item"},V={key:1,class:"recording-alternates"},N={class:"recording-alternates__links"},D={key:1,class:"text-gray-400"},E=L({__name:"RecordingPlaybackBlock",props:{recordId:{},urls:{}},setup(l){const $=l,h=I(),u=f(()=>{const e=$.urls||[],t=new Set,r=[];for(const o of e){const s=String(o??"").trim();!s||t.has(s)||(t.add(s),r.push(s))}return r}),i=f(()=>{const e=u.value;if(!e.length)return null;const t=e.find(n=>/\.mp4(\?|#|$)/i.test(n));if(t)return t;const r=e.find(n=>/\.m3u8(\?|#|$)/i.test(n)&&/vod-qcloud\.com/i.test(n));if(r)return r;const o=e.find(n=>/\.m3u8(\?|#|$)/i.test(n)&&/\.cos\.[^/]+\.myqcloud\.com/i.test(n));if(o)return o;const s=e.find(n=>/\.m3u8(\?|#|$)/i.test(n));return s||e[0]}),p=f(()=>{const e=u.value,t=i.value;return t?e.filter(r=>r!==t):e.slice(1)});function b(e){if(!e||typeof e!="string")return!1;const t=e.trim();return/^https?:\/\//i.test(t)?/\.(mp4|webm|ogg|mov|mkv|m4v|m3u8)(\?|#|$)/i.test(t):/\.(mp4|webm|ogg|mov|mkv|m4v|m3u8)(\?|#|$)/i.test(t)||t.startsWith("/uploads/")}function g(e){return h.getImageUrl(String(e||"").trim())}function S(e,t){const r=e.trim();return/\.mp4(\?|#|$)/i.test(r)?`MP4 ${t+1}`:/vod-qcloud\.com/i.test(r)&&/\.m3u8/i.test(r)?`点播 ${t+1}`:/\.cos\.[^/]+\.myqcloud\.com/i.test(r)&&/\.m3u8/i.test(r)?`COS HLS ${t+1}`:/\.m3u8/i.test(r)?`HLS ${t+1}`:`链接 ${t+1}`}return(e,t)=>{const r=B;return u.value.length?(a(),c("div",R,[m("div",C,[i.value?(a(),c(v,{key:0},[b(i.value)?(a(),d(H,{key:`${l.recordId}-${i.value}`,src:i.value},null,8,["src"])):(a(),d(r,{key:1,href:g(i.value),target:"_blank",type:"primary"},{default:_(()=>[...t[0]||(t[0]=[k(" 打开回放 ",-1)])]),_:1},8,["href"]))],64)):y("",!0),p.value.length?(a(),c("div",V,[t[1]||(t[1]=m("span",{class:"recording-alternates__label"},"备用地址",-1)),m("div",N,[(a(!0),c(v,null,q(p.value,(o,s)=>(a(),d(r,{key:`${l.recordId}-alt-${s}-${o.slice(-32)}`,href:g(o),target:"_blank",type:"primary",class:"recording-alternates__link"},{default:_(()=>[k(w(S(o,s)),1)]),_:2},1032,["href"]))),128))])])):y("",!0)])])):(a(),c("span",D,"暂无"))}}}),x=P(E,[["__scopeId","data-v-597ae096"]]);export{x as default};
@@ -1,2 +1,2 @@
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/.pnpm-DnXobOVo.js","assets/.pnpm-BPY-zlC2.css"])))=>i.map(i=>d[i]);
import{o as F,a0 as K,n as S,R as H,at as G,q as v,r as p,s as f,ag as O,ah as Q,bd as W,az as $,F as b,v as k,D as I,u as j,bb as J,w as X,P,L as Y,bv as Z,M as _,p as w,ap as ee}from"./.pnpm-DnXobOVo.js";import{h as ae,_ as ne}from"./index-B5yNocKV.js";const te={class:"recording-playback__shell"},re=["preload"],oe=["onKeydown"],le=F({__name:"RecordingVideoPlayer",props:{src:{}},setup(B){const V=B,A=ae(),E=_(null),m=_(null),c=_(!1),s=_(!1),t=_(!1);let d=null,r=null,l=0,u=null;function i(){u!==null&&(clearTimeout(u),u=null)}const y=w(()=>{const e=String(V.src||"").trim();return e?C(A.getImageUrl(e)):""}),D=w(()=>{if(!s.value)return"none";const e=y.value;return e&&!L(e)?"metadata":"none"}),U=w(()=>!s.value||t.value);function C(e){if(!e||!/^https?:\/\//i.test(e))return e;try{const a=new URL(e),n=a.hostname.toLowerCase();if(n.includes("myqcloud.com")||n.includes("vod-qcloud.com")||n.includes("vod-qcloud"))return a.pathname.includes("+")&&(a.pathname=a.pathname.replace(/\+/g,"%2B")),a.href}catch{}return e}function L(e){return/\.m3u8(\?|#|$)/i.test(e)}function N(){var n;t.value=!1,i();const e=m.value,a=(n=e==null?void 0:e.error)==null?void 0:n.code;a===MediaError.MEDIA_ERR_ABORTED||a===1||(c.value=!0)}function h(){d&&(d.destroy(),d=null);const e=m.value;e&&(e.pause(),e.removeAttribute("src"),e.load())}function R(e,a){let n=!1;const o=()=>{n||a!==l||(n=!0,i(),t.value=!1)};e.addEventListener("loadedmetadata",()=>o(),{once:!0}),e.addEventListener("loadeddata",()=>o(),{once:!0}),e.addEventListener("canplay",()=>o(),{once:!0}),e.addEventListener("playing",()=>o(),{once:!0}),e.addEventListener("progress",()=>{try{e.buffered.length>0&&e.buffered.end(0)>0&&o("progress-buffered")}catch{}},{passive:!0})}async function g(){if(!s.value)return;await S();const e=m.value,a=y.value;if(!e)return;if(!a){t.value=!1,i();return}const n=++l;if(t.value=!0,i(),h(),c.value=!1,L(a)){try{const o=await ee(()=>import("./.pnpm-DnXobOVo.js").then(M=>M.dQ),__vite__mapDeps([0,1])),x=o.default;if(x.isSupported()){d=new x({enableWorker:!0,lowLatencyMode:!1,maxBufferLength:20,maxMaxBufferLength:120}),d.on(o.Events.MANIFEST_PARSED,()=>{n===l&&(t.value=!1,i())}),d.on(o.Events.ERROR,(M,z)=>{if(z.fatal){if(n!==l)return;t.value=!1,i(),c.value=!0,h()}}),d.loadSource(a),d.attachMedia(e),u=setTimeout(()=>{u=null,n===l&&t.value&&(t.value=!1)},45e3);return}if(e.canPlayType("application/vnd.apple.mpegurl")){R(e,n),e.src=a,u=setTimeout(()=>{u=null,n===l&&t.value&&(t.value=!1)},45e3);return}}catch{if(n!==l)return;t.value=!1,i(),c.value=!0;return}if(n!==l)return;t.value=!1,i(),c.value=!0;return}R(e,n),e.src=a,u=setTimeout(()=>{u=null,n===l&&t.value&&(t.value=!1)},25e3)}function q(){const e=E.value;if(!e||typeof IntersectionObserver>"u"){s.value=!0,g();return}r=new IntersectionObserver(a=>{for(const n of a)if(n.isIntersecting){r==null||r.disconnect(),r=null,s.value=!0,g();break}},{root:null,rootMargin:"240px 0px",threshold:0}),r.observe(e)}function T(){r==null||r.disconnect(),r=null,s.value||(s.value=!0),g()}return K(()=>{S(()=>{q()})}),H(y,()=>{s.value&&g()}),G(()=>{r==null||r.disconnect(),r=null,i(),l++,h()}),(e,a)=>{const n=X,o=Z;return v(),p("div",{ref_key:"wrapRef",ref:E,class:"recording-playback"},[f("div",te,[O(f("video",{ref_key:"videoRef",ref:m,class:"recording-video",controls:"",playsinline:"","webkit-playsinline":"",preload:D.value,onError:N},null,40,re),[[Q,!c.value]]),!c.value&&U.value?(v(),p("div",{key:0,class:"recording-playback__overlay",role:"button",tabindex:"0",onClick:T,onKeydown:W($(T,["prevent"]),["enter"])},[s.value?(v(),p(b,{key:1},[k(n,{class:"recording-playback__spin"},{default:I(()=>[k(j(J))]),_:1}),a[2]||(a[2]=f("span",null,"正在加载…",-1))],64)):(v(),p(b,{key:0},[a[0]||(a[0]=f("span",{class:"recording-playback__overlay-title"},"预览待加载",-1)),a[1]||(a[1]=f("span",{class:"recording-playback__overlay-desc"},"滚动至此处将自动加载(减轻并发卡顿),也可点击立即加载",-1))],64))],40,oe)):P("",!0)]),c.value?(v(),p(b,{key:0},[k(o,{href:y.value||"#",target:"_blank",type:"primary"},{default:I(()=>[...a[3]||(a[3]=[Y("在新窗口打开",-1)])]),_:1},8,["href"]),a[4]||(a[4]=f("div",{class:"recording-playback__hint"}," 内嵌播放失败(编码不支持、跨域或私有存储等)时可尝试在新窗口打开。 ",-1))],64)):P("",!0)],512)}}}),ie=ne(le,[["__scopeId","data-v-2b85f631"]]);export{ie as default};
import{o as F,a0 as K,n as S,R as H,at as G,q as v,r as p,s as f,ag as O,ah as Q,bd as W,az as $,F as b,v as k,D as I,u as j,bb as J,w as X,P,L as Y,bv as Z,M as _,p as w,ap as ee}from"./.pnpm-DnXobOVo.js";import{h as ae,_ as ne}from"./index-CtDDMof-.js";const te={class:"recording-playback__shell"},re=["preload"],oe=["onKeydown"],le=F({__name:"RecordingVideoPlayer",props:{src:{}},setup(B){const V=B,A=ae(),E=_(null),m=_(null),c=_(!1),s=_(!1),t=_(!1);let d=null,r=null,l=0,u=null;function i(){u!==null&&(clearTimeout(u),u=null)}const y=w(()=>{const e=String(V.src||"").trim();return e?C(A.getImageUrl(e)):""}),D=w(()=>{if(!s.value)return"none";const e=y.value;return e&&!L(e)?"metadata":"none"}),U=w(()=>!s.value||t.value);function C(e){if(!e||!/^https?:\/\//i.test(e))return e;try{const a=new URL(e),n=a.hostname.toLowerCase();if(n.includes("myqcloud.com")||n.includes("vod-qcloud.com")||n.includes("vod-qcloud"))return a.pathname.includes("+")&&(a.pathname=a.pathname.replace(/\+/g,"%2B")),a.href}catch{}return e}function L(e){return/\.m3u8(\?|#|$)/i.test(e)}function N(){var n;t.value=!1,i();const e=m.value,a=(n=e==null?void 0:e.error)==null?void 0:n.code;a===MediaError.MEDIA_ERR_ABORTED||a===1||(c.value=!0)}function h(){d&&(d.destroy(),d=null);const e=m.value;e&&(e.pause(),e.removeAttribute("src"),e.load())}function R(e,a){let n=!1;const o=()=>{n||a!==l||(n=!0,i(),t.value=!1)};e.addEventListener("loadedmetadata",()=>o(),{once:!0}),e.addEventListener("loadeddata",()=>o(),{once:!0}),e.addEventListener("canplay",()=>o(),{once:!0}),e.addEventListener("playing",()=>o(),{once:!0}),e.addEventListener("progress",()=>{try{e.buffered.length>0&&e.buffered.end(0)>0&&o("progress-buffered")}catch{}},{passive:!0})}async function g(){if(!s.value)return;await S();const e=m.value,a=y.value;if(!e)return;if(!a){t.value=!1,i();return}const n=++l;if(t.value=!0,i(),h(),c.value=!1,L(a)){try{const o=await ee(()=>import("./.pnpm-DnXobOVo.js").then(M=>M.dQ),__vite__mapDeps([0,1])),x=o.default;if(x.isSupported()){d=new x({enableWorker:!0,lowLatencyMode:!1,maxBufferLength:20,maxMaxBufferLength:120}),d.on(o.Events.MANIFEST_PARSED,()=>{n===l&&(t.value=!1,i())}),d.on(o.Events.ERROR,(M,z)=>{if(z.fatal){if(n!==l)return;t.value=!1,i(),c.value=!0,h()}}),d.loadSource(a),d.attachMedia(e),u=setTimeout(()=>{u=null,n===l&&t.value&&(t.value=!1)},45e3);return}if(e.canPlayType("application/vnd.apple.mpegurl")){R(e,n),e.src=a,u=setTimeout(()=>{u=null,n===l&&t.value&&(t.value=!1)},45e3);return}}catch{if(n!==l)return;t.value=!1,i(),c.value=!0;return}if(n!==l)return;t.value=!1,i(),c.value=!0;return}R(e,n),e.src=a,u=setTimeout(()=>{u=null,n===l&&t.value&&(t.value=!1)},25e3)}function q(){const e=E.value;if(!e||typeof IntersectionObserver>"u"){s.value=!0,g();return}r=new IntersectionObserver(a=>{for(const n of a)if(n.isIntersecting){r==null||r.disconnect(),r=null,s.value=!0,g();break}},{root:null,rootMargin:"240px 0px",threshold:0}),r.observe(e)}function T(){r==null||r.disconnect(),r=null,s.value||(s.value=!0),g()}return K(()=>{S(()=>{q()})}),H(y,()=>{s.value&&g()}),G(()=>{r==null||r.disconnect(),r=null,i(),l++,h()}),(e,a)=>{const n=X,o=Z;return v(),p("div",{ref_key:"wrapRef",ref:E,class:"recording-playback"},[f("div",te,[O(f("video",{ref_key:"videoRef",ref:m,class:"recording-video",controls:"",playsinline:"","webkit-playsinline":"",preload:D.value,onError:N},null,40,re),[[Q,!c.value]]),!c.value&&U.value?(v(),p("div",{key:0,class:"recording-playback__overlay",role:"button",tabindex:"0",onClick:T,onKeydown:W($(T,["prevent"]),["enter"])},[s.value?(v(),p(b,{key:1},[k(n,{class:"recording-playback__spin"},{default:I(()=>[k(j(J))]),_:1}),a[2]||(a[2]=f("span",null,"正在加载…",-1))],64)):(v(),p(b,{key:0},[a[0]||(a[0]=f("span",{class:"recording-playback__overlay-title"},"预览待加载",-1)),a[1]||(a[1]=f("span",{class:"recording-playback__overlay-desc"},"滚动至此处将自动加载(减轻并发卡顿),也可点击立即加载",-1))],64))],40,oe)):P("",!0)]),c.value?(v(),p(b,{key:0},[k(o,{href:y.value||"#",target:"_blank",type:"primary"},{default:I(()=>[...a[3]||(a[3]=[Y("在新窗口打开",-1)])]),_:1},8,["href"]),a[4]||(a[4]=f("div",{class:"recording-playback__hint"}," 内嵌播放失败(编码不支持、跨域或私有存储等)时可尝试在新窗口打开。 ",-1))],64)):P("",!0)],512)}}}),ie=ne(le,[["__scopeId","data-v-2b85f631"]]);export{ie as default};
@@ -1 +1 @@
import{o as V,q as t,r as o,ai as v,s as i,O as h,D as u,v as z,bp as M,L as d,T as l,F as y,G as P,a5 as F,P as r,p as a}from"./.pnpm-DnXobOVo.js";import{bQ as q,bR as A,bS as G,bl as I,bT as O,bU as Q,bV as U,bW as W,br as X,bo as j,bn as H,bm as J,bX as K,_ as Y}from"./index-B5yNocKV.js";const Z={class:"rv-line rv-line--head"},$={class:"rv-tooltip"},ee={key:3,class:"rv-doctor"},te={key:0,class:"rv-dot"},se={class:"rv-line rv-line--order"},ae={key:0,class:"rv-order-date"},oe={key:1,class:"rv-dot"},le={class:"rv-anchor"},re={class:"rv-line rv-line--due"},ie={key:0,class:"rv-due-date"},ce={key:0,class:"rv-line rv-line--follow"},ne={key:1,class:"rv-none"},ue=V({__name:"RevisitNodeCell",props:{due:{},compact:{type:Boolean,default:!1},hasPrescription:{type:Boolean,default:!1},followupDoctorName:{default:""},prescribedText:{}},setup(n){const e=n,c=a(()=>q(e.due)),p=a(()=>e.prescribedText!==void 0?e.prescribedText:e.hasPrescription?"已开方":"未开方"),m=a(()=>A(e.due)),T=a(()=>{var s;return c.value&&Number((s=e.due)==null?void 0:s.current_slot)>0?"primary":"info"}),b=a(()=>G(e.due)),f=a(()=>{var s;return c.value?I((s=e.due)==null?void 0:s.order_date):""}),x=a(()=>O(e.due)),S=a(()=>Q(e.due)),k=a(()=>{var s;return c.value?U((s=e.due)==null?void 0:s.anchor_src):""}),g=a(()=>W(e.due)),D=a(()=>X(e.due)),L=a(()=>{var s;return j((s=e.due)==null?void 0:s.state)}),B=a(()=>{var s;return H((s=e.due)==null?void 0:s.state)}),R=a(()=>J(e.due)),C=a(()=>K(e.due));return(s,N)=>{const _=M,E=F;return t(),o("div",{class:v(["rv-cell",{"rv-cell--compact":n.compact}])},[i("div",Z,[c.value&&b.value.length?(t(),h(E,{key:0,placement:"top","show-after":300,"hide-after":0},{content:u(()=>[i("div",$,[(t(!0),o(y,null,P(b.value,w=>(t(),o("div",{key:w},l(w),1))),128))])]),default:u(()=>[z(_,{size:"small",type:T.value,effect:"light",class:"rv-slot-tag"},{default:u(()=>[d(l(m.value),1)]),_:1},8,["type"])]),_:1})):c.value?(t(),h(_,{key:1,size:"small",type:T.value,effect:"light",class:"rv-slot-tag"},{default:u(()=>[d(l(m.value),1)]),_:1},8,["type"])):r("",!0),p.value?(t(),o("span",{key:2,class:v(["rv-prescribed",n.hasPrescription?"rv-prescribed--yes":"rv-prescribed--no"])},l(p.value),3)):r("",!0),n.followupDoctorName?(t(),o("span",ee,[p.value?(t(),o("span",te,"·")):r("",!0),d(l(n.followupDoctorName),1)])):r("",!0)]),c.value?(t(),o(y,{key:0},[i("div",se,[f.value?(t(),o("span",ae,l(f.value)+" 开药",1)):r("",!0),f.value?(t(),o("span",oe,"·")):r("",!0),i("span",{class:v(["rv-days",{"rv-days--missing":x.value}])},l(S.value),3),!x.value&&k.value?(t(),o(y,{key:2},[N[0]||(N[0]=i("span",{class:"rv-dot"},"·",-1)),i("span",le,l(k.value),1)],64)):r("",!0)]),i("div",re,[g.value?(t(),o("span",ie,l(g.value),1)):r("",!0),D.value?(t(),h(_,{key:1,size:"small",type:L.value,effect:B.value,class:v(R.value)},{default:u(()=>[d(l(D.value),1)]),_:1},8,["type","effect","class"])):r("",!0)]),C.value?(t(),o("div",ce,l(C.value),1)):r("",!0)],64)):(t(),o("span",ne,"—"))],2)}}}),pe=Y(ue,[["__scopeId","data-v-fb0ce27b"]]);export{pe as default};
import{o as V,q as t,r as o,ai as v,s as i,O as h,D as u,v as z,bp as M,L as d,T as l,F as y,G as P,a5 as F,P as r,p as a}from"./.pnpm-DnXobOVo.js";import{bQ as q,bR as A,bS as G,bl as I,bT as O,bU as Q,bV as U,bW as W,br as X,bo as j,bn as H,bm as J,bX as K,_ as Y}from"./index-CtDDMof-.js";const Z={class:"rv-line rv-line--head"},$={class:"rv-tooltip"},ee={key:3,class:"rv-doctor"},te={key:0,class:"rv-dot"},se={class:"rv-line rv-line--order"},ae={key:0,class:"rv-order-date"},oe={key:1,class:"rv-dot"},le={class:"rv-anchor"},re={class:"rv-line rv-line--due"},ie={key:0,class:"rv-due-date"},ce={key:0,class:"rv-line rv-line--follow"},ne={key:1,class:"rv-none"},ue=V({__name:"RevisitNodeCell",props:{due:{},compact:{type:Boolean,default:!1},hasPrescription:{type:Boolean,default:!1},followupDoctorName:{default:""},prescribedText:{}},setup(n){const e=n,c=a(()=>q(e.due)),p=a(()=>e.prescribedText!==void 0?e.prescribedText:e.hasPrescription?"已开方":"未开方"),m=a(()=>A(e.due)),T=a(()=>{var s;return c.value&&Number((s=e.due)==null?void 0:s.current_slot)>0?"primary":"info"}),b=a(()=>G(e.due)),f=a(()=>{var s;return c.value?I((s=e.due)==null?void 0:s.order_date):""}),x=a(()=>O(e.due)),S=a(()=>Q(e.due)),k=a(()=>{var s;return c.value?U((s=e.due)==null?void 0:s.anchor_src):""}),g=a(()=>W(e.due)),D=a(()=>X(e.due)),L=a(()=>{var s;return j((s=e.due)==null?void 0:s.state)}),B=a(()=>{var s;return H((s=e.due)==null?void 0:s.state)}),R=a(()=>J(e.due)),C=a(()=>K(e.due));return(s,N)=>{const _=M,E=F;return t(),o("div",{class:v(["rv-cell",{"rv-cell--compact":n.compact}])},[i("div",Z,[c.value&&b.value.length?(t(),h(E,{key:0,placement:"top","show-after":300,"hide-after":0},{content:u(()=>[i("div",$,[(t(!0),o(y,null,P(b.value,w=>(t(),o("div",{key:w},l(w),1))),128))])]),default:u(()=>[z(_,{size:"small",type:T.value,effect:"light",class:"rv-slot-tag"},{default:u(()=>[d(l(m.value),1)]),_:1},8,["type"])]),_:1})):c.value?(t(),h(_,{key:1,size:"small",type:T.value,effect:"light",class:"rv-slot-tag"},{default:u(()=>[d(l(m.value),1)]),_:1},8,["type"])):r("",!0),p.value?(t(),o("span",{key:2,class:v(["rv-prescribed",n.hasPrescription?"rv-prescribed--yes":"rv-prescribed--no"])},l(p.value),3)):r("",!0),n.followupDoctorName?(t(),o("span",ee,[p.value?(t(),o("span",te,"·")):r("",!0),d(l(n.followupDoctorName),1)])):r("",!0)]),c.value?(t(),o(y,{key:0},[i("div",se,[f.value?(t(),o("span",ae,l(f.value)+" 开药",1)):r("",!0),f.value?(t(),o("span",oe,"·")):r("",!0),i("span",{class:v(["rv-days",{"rv-days--missing":x.value}])},l(S.value),3),!x.value&&k.value?(t(),o(y,{key:2},[N[0]||(N[0]=i("span",{class:"rv-dot"},"·",-1)),i("span",le,l(k.value),1)],64)):r("",!0)]),i("div",re,[g.value?(t(),o("span",ie,l(g.value),1)):r("",!0),D.value?(t(),h(_,{key:1,size:"small",type:L.value,effect:B.value,class:v(R.value)},{default:u(()=>[d(l(D.value),1)]),_:1},8,["type","effect","class"])):r("",!0)]),C.value?(t(),o("div",ce,l(C.value),1)):r("",!0)],64)):(t(),o("span",ne,"—"))],2)}}}),pe=Y(ue,[["__scopeId","data-v-fb0ce27b"]]);export{pe as default};

Some files were not shown because too many files have changed in this diff Show More