更新
This commit is contained in:
@@ -327,13 +327,18 @@ class ReceptionPage(QWidget):
|
||||
splitter.setSizes([350, 760])
|
||||
root.addWidget(splitter, 1)
|
||||
|
||||
self.diagnosis_dialog = DiagnosisDialog(repository, self)
|
||||
self.diagnosis_dialog.saved.connect(self._diagnosis_saved)
|
||||
|
||||
self.poll_timer = QTimer(self)
|
||||
self.poll_timer.setInterval(5_000)
|
||||
self.poll_timer.timeout.connect(lambda: self.refresh(silent=True))
|
||||
|
||||
def _ensure_diagnosis_dialog(self) -> DiagnosisDialog:
|
||||
dialog = getattr(self, "diagnosis_dialog", None)
|
||||
if dialog is None:
|
||||
dialog = DiagnosisDialog(self.repository, self)
|
||||
dialog.saved.connect(self._diagnosis_saved)
|
||||
self.diagnosis_dialog = dialog
|
||||
return dialog
|
||||
|
||||
def _build_queue_panel(self) -> QWidget:
|
||||
panel = QFrame()
|
||||
panel.setObjectName("Card")
|
||||
@@ -1355,9 +1360,7 @@ class ReceptionPage(QWidget):
|
||||
image_grid.setContentsMargins(0, 0, 0, 0)
|
||||
image_grid.setHorizontalSpacing(10)
|
||||
image_grid.setVerticalSpacing(10)
|
||||
for index, (image_type, caption, path_text) in enumerate(
|
||||
image_attachments
|
||||
):
|
||||
for index, (image_type, caption, path_text) in enumerate(image_attachments):
|
||||
tile = QFrame()
|
||||
tile.setObjectName("NoteAttachmentTile")
|
||||
tile_layout = QVBoxLayout(tile)
|
||||
@@ -1376,13 +1379,9 @@ class ReceptionPage(QWidget):
|
||||
label = QLabel(f"{caption} · {_attachment_name(path_text)}")
|
||||
label.setObjectName("NoteAttachmentName")
|
||||
label.setToolTip(path_text)
|
||||
label.setTextInteractionFlags(
|
||||
Qt.TextInteractionFlag.TextSelectableByMouse
|
||||
)
|
||||
label.setTextInteractionFlags(Qt.TextInteractionFlag.TextSelectableByMouse)
|
||||
label.setMinimumWidth(0)
|
||||
label.setSizePolicy(
|
||||
QSizePolicy.Policy.Ignored, QSizePolicy.Policy.Preferred
|
||||
)
|
||||
label.setSizePolicy(QSizePolicy.Policy.Ignored, QSizePolicy.Policy.Preferred)
|
||||
footer.addWidget(label, 1)
|
||||
if self._can_note and note_id is not None:
|
||||
delete_button = QPushButton("删除")
|
||||
@@ -1448,9 +1447,7 @@ class ReceptionPage(QWidget):
|
||||
return
|
||||
run_async(
|
||||
lambda: invoke(self.repository, "download_public_image", url=path),
|
||||
on_success=lambda payload: self._apply_note_thumbnail(
|
||||
payload, preview, generation
|
||||
),
|
||||
on_success=lambda payload: self._apply_note_thumbnail(payload, preview, generation),
|
||||
on_error=lambda _error: self._fail_note_thumbnail(preview, generation),
|
||||
)
|
||||
|
||||
@@ -1493,11 +1490,7 @@ class ReceptionPage(QWidget):
|
||||
return
|
||||
if not _is_image_attachment(target):
|
||||
url = QUrl(target)
|
||||
if (
|
||||
not url.isValid()
|
||||
or url.scheme().lower() not in {"https", "http"}
|
||||
or not url.host()
|
||||
):
|
||||
if not url.isValid() or url.scheme().lower() not in {"https", "http"} or not url.host():
|
||||
show_toast(self, "附件地址无效,无法打开。", "warning", 4200)
|
||||
return
|
||||
if not QDesktopServices.openUrl(url):
|
||||
@@ -1520,9 +1513,7 @@ class ReceptionPage(QWidget):
|
||||
on_success=lambda payload: self._show_note_image_preview(
|
||||
target, payload, button, generation
|
||||
),
|
||||
on_error=lambda error: self._note_image_preview_failed(
|
||||
error, button, generation
|
||||
),
|
||||
on_error=lambda error: self._note_image_preview_failed(error, button, generation),
|
||||
)
|
||||
|
||||
def _show_note_image_preview(
|
||||
@@ -1974,7 +1965,7 @@ class ReceptionPage(QWidget):
|
||||
if context is None or context[2] is None:
|
||||
show_toast(self, "当前患者缺少诊单编号。", "danger")
|
||||
return
|
||||
self.diagnosis_dialog.open_for(
|
||||
self._ensure_diagnosis_dialog().open_for(
|
||||
context[2], editable=True, seed=self._selected_detail or self._selected_record
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user