This commit is contained in:
Your Name
2026-09-01 11:26:47 +08:00
parent 5bd5eae62d
commit 398f9f3726
357 changed files with 733 additions and 343 deletions
@@ -9,7 +9,7 @@ from math import ceil
from typing import Any
from PySide6.QtCore import QDateTime, QModelIndex, QRectF, QSize, Qt
from PySide6.QtGui import QColor, QFont, QIcon, QPainter, QPen, QPixmap, QTextDocument, QTextOption
from PySide6.QtGui import QColor, QFont, QIcon, QPainter, QPen, QTextDocument, QTextOption
from PySide6.QtWidgets import (
QComboBox,
QDateTimeEdit,
@@ -398,7 +398,10 @@ def _order_warnings(row: Any) -> list[str]:
return []
herbs = get_value(source, "herbs", None)
herbs = herbs if isinstance(herbs, (list, tuple)) else []
names = [str(get_value(herb, "name", "") or "").strip() for herb in herbs]
names = []
for herb in herbs:
raw_name = get_value(herb, "name", "")
names.append(str("" if raw_name is None else raw_name).strip())
names = [name for name in names if name]
if not names:
return ["请开方,当前处方药材为空白"]