This commit is contained in:
zlwu committed 2026-10-15 14:27:42 +08:00
1 parent b9d981d46b
commit ecde2ba07d
51 files changed
+12524 -10144

No files matched your search

+17 -50
View File
@@ -9,11 +9,7 @@ from sqlalchemy.orm import Session
from sqlalchemy import and_ as sa_and, func as sa_func
from app.core.database import get_db
from app.core.menu_guard import (
assert_strict_menu_code,
require_admin_or_super_admin,
require_strict_menu_code,
)
from app.core.menu_guard import require_admin_or_super_admin
from app.core.response import error_response, success_response
from app.core.utils import parse_datetime
from app.crud import collection_protocol as cp_svc
@@ -28,25 +24,6 @@ from app.services.party_customer_sync import sync_party_customers
router = APIRouter(prefix="/web/admin", tags=["细胞存储"])
PROTOCOL_LIST_MENU = "biz:cellStorageProtocol:list"
PROTOCOL_AUDIT_MENU = "biz:cellStorageProtocolAudit:list"
PAYMENT_CONFIRM_MENU = "biz:cellStoragePaymentConfirm:list"
REFUND_CONFIRM_MENU = "biz:cellStorageRefundConfirm:list"
STORAGE_CERT_MENU = "cell-storage:storage-cert:list"
_PROTOCOL_AUDIT_FIELDS = {
"protocol_status",
"effective_time",
"effective_desc",
"expire_time",
"expire_desc",
"void_time",
"void_desc",
"void_type",
"to_research_time",
"to_research_desc",
}
_PAYMENT_DETAIL_SENSITIVE_FIELDS = {
"pay_status",
"payStatus",
@@ -245,7 +222,7 @@ def assert_protocol_sensitive_fields(
*,
creating: bool,
) -> None:
"""防止通过普通协议保存接口注入审核/状态或储存证办理字段。"""
"""防止通过普通协议保存接口注入财务确认或退费状态字段(不做菜单权限校验)。"""
for detail in getattr(body, "payment_details", None) or []:
normalized_detail = (
cp_svc._normalize_fields(detail) if isinstance(detail, dict) else {}
@@ -255,16 +232,6 @@ def assert_protocol_sensitive_fields(
status_code=400,
detail="普通协议保存不允许提交财务确认或退费状态字段",
)
submitted = set(body.model_fields_set)
if creating:
status_value = str(getattr(body, "protocol_status", None) or "dsx").strip()
requires_audit = status_value != "dsx"
else:
requires_audit = bool(submitted.intersection(_PROTOCOL_AUDIT_FIELDS))
if requires_audit:
assert_strict_menu_code(db, user, PROTOCOL_AUDIT_MENU)
if "storage_cert" in submitted:
assert_strict_menu_code(db, user, STORAGE_CERT_MENU)
def _resolve_protocol_attachments(
@@ -362,7 +329,7 @@ def _persist_protocol_sub_resources(
@router.post("/collection-protocols")
async def create_collection_protocol(
body: ProtocolCreateBody,
user: dict = Depends(require_strict_menu_code(PROTOCOL_LIST_MENU)),
user: dict = Depends(require_admin_or_super_admin),
db: Session = Depends(get_db),
):
assert_protocol_sensitive_fields(db, user, body, creating=True)
@@ -441,7 +408,7 @@ async def create_collection_protocol(
async def update_collection_protocol(
protocol_id: str,
body: ProtocolUpdateBody,
user: dict = Depends(require_strict_menu_code(PROTOCOL_LIST_MENU)),
user: dict = Depends(require_admin_or_super_admin),
db: Session = Depends(get_db),
):
assert_protocol_sensitive_fields(db, user, body, creating=False)
@@ -513,7 +480,7 @@ async def update_collection_protocol(
@router.delete("/collection-protocols/{protocol_id}")
async def delete_collection_protocol(
protocol_id: str,
user: dict = Depends(require_strict_menu_code(PROTOCOL_LIST_MENU)),
user: dict = Depends(require_admin_or_super_admin),
db: Session = Depends(get_db),
):
tenant_no = _get_tenant_no(db, user)
@@ -573,7 +540,7 @@ class AuditCreateBody(BaseModel):
async def submit_collection_protocol_audit(
protocol_id: str,
body: AuditCreateBody,
user: dict = Depends(require_strict_menu_code(PROTOCOL_AUDIT_MENU)),
user: dict = Depends(require_admin_or_super_admin),
db: Session = Depends(get_db),
):
tenant_no = _get_tenant_no(db, user)
@@ -730,7 +697,7 @@ async def post_submit_receipt_finance_batch(
async def post_submit_refund_finance(
detail_id: str,
body: RefundFinanceSubmitBody,
user: dict = Depends(require_strict_menu_code(REFUND_CONFIRM_MENU)),
user: dict = Depends(require_admin_or_super_admin),
db: Session = Depends(get_db),
):
tenant_no = _get_tenant_no(db, user)
@@ -752,7 +719,7 @@ async def post_submit_refund_finance(
@router.post("/protocol-payment-details/submit-refund-finance-batch")
async def post_submit_refund_finance_batch(
body: BatchRefundFinanceSubmitBody,
user: dict = Depends(require_strict_menu_code(REFUND_CONFIRM_MENU)),
user: dict = Depends(require_admin_or_super_admin),
db: Session = Depends(get_db),
):
tenant_no = _get_tenant_no(db, user)
@@ -841,7 +808,7 @@ class RefundFinanceConfirmBody(BaseModel):
async def post_receipt_confirm(
detail_id: str,
body: FinanceConfirmBody,
user: dict = Depends(require_strict_menu_code(PAYMENT_CONFIRM_MENU)),
user: dict = Depends(require_admin_or_super_admin),
db: Session = Depends(get_db),
):
tenant_no = _get_tenant_no(db, user)
@@ -862,7 +829,7 @@ async def post_receipt_confirm(
@router.post("/protocol-payment-details/{detail_id}/receipt-reject")
async def post_receipt_reject(
detail_id: str,
user: dict = Depends(require_strict_menu_code(PAYMENT_CONFIRM_MENU)),
user: dict = Depends(require_admin_or_super_admin),
db: Session = Depends(get_db),
):
tenant_no = _get_tenant_no(db, user)
@@ -937,7 +904,7 @@ async def list_refund_confirmed(
async def post_refund_confirm(
detail_id: str,
body: RefundFinanceConfirmBody,
user: dict = Depends(require_strict_menu_code(REFUND_CONFIRM_MENU)),
user: dict = Depends(require_admin_or_super_admin),
db: Session = Depends(get_db),
):
tenant_no = _get_tenant_no(db, user)
@@ -958,7 +925,7 @@ async def post_refund_confirm(
@router.post("/protocol-payment-details/{detail_id}/refund-reject")
async def post_refund_reject(
detail_id: str,
user: dict = Depends(require_strict_menu_code(REFUND_CONFIRM_MENU)),
user: dict = Depends(require_admin_or_super_admin),
db: Session = Depends(get_db),
):
tenant_no = _get_tenant_no(db, user)
@@ -1148,7 +1115,7 @@ class FullmoonTodoInsuranceBody(BaseModel):
async def update_fullmoon_todo_insurance(
protocol_id: str,
body: FullmoonTodoInsuranceBody,
user: dict = Depends(require_strict_menu_code(STORAGE_CERT_MENU)),
user: dict = Depends(require_admin_or_super_admin),
db: Session = Depends(get_db),
):
tenant_no = _get_tenant_no(db, user)
@@ -1199,7 +1166,7 @@ def _attach_handler_name(db: Session, payload: Dict[str, Any]) -> Dict[str, Any]
async def update_storage_cert_handle(
protocol_id: str,
body: StorageCertHandleBody,
user: dict = Depends(require_strict_menu_code(STORAGE_CERT_MENU)),
user: dict = Depends(require_admin_or_super_admin),
db: Session = Depends(get_db),
):
tenant_no = _get_tenant_no(db, user)
@@ -1229,7 +1196,7 @@ async def update_storage_cert_handle(
async def update_fullmoon_todo_handle(
protocol_id: str,
body: FullmoonHandleBody,
user: dict = Depends(require_strict_menu_code(STORAGE_CERT_MENU)),
user: dict = Depends(require_admin_or_super_admin),
db: Session = Depends(get_db),
):
tenant_no = _get_tenant_no(db, user)
@@ -1305,7 +1272,7 @@ async def get_protocol_invoice_requests(
async def post_protocol_invoice_request(
protocol_id: str,
body: InvoiceRequestCreateBody,
user: dict = Depends(require_strict_menu_code(PAYMENT_CONFIRM_MENU)),
user: dict = Depends(require_admin_or_super_admin),
db: Session = Depends(get_db),
):
tenant_no = _get_tenant_no(db, user)
@@ -1367,7 +1334,7 @@ async def protocol_invoice_pending_count(
async def complete_protocol_invoice_request(
request_id: str,
body: InvoiceRequestCompleteBody,
user: dict = Depends(require_strict_menu_code(PAYMENT_CONFIRM_MENU)),
user: dict = Depends(require_admin_or_super_admin),
db: Session = Depends(get_db),
):
tenant_no = _get_tenant_no(db, user)
+21
View File
@@ -977,6 +977,27 @@ def _register_freight_routes(scope_kind: ScopeKind) -> None:
except (PermissionError, ValueError) as exc:
return error_response(400, str(exc))
@router.delete(f'{prefix}/{{freight_id}}')
async def delete_freight(
freight_id: str,
user: dict = Depends(permission_guard),
db: Session = Depends(get_db),
):
try:
return success_response(
market_freight.delete_freight(
db,
freight_id,
ctx=_context(user, scope_kind),
user_info=user,
),
message='删除成功',
)
except PermissionError as exc:
return error_response(403, str(exc))
except ValueError as exc:
return error_response(400, str(exc))
_register_freight_routes('specialist')
_register_freight_routes('manager')
+24
View File
@@ -248,3 +248,27 @@ async def unlink_sample_freight(
msg = str(e)
code = 404 if "不存在" in msg else 400
return error_response(code, msg)
@router.delete("/sample-freights/{freight_id}")
async def delete_sample_freight(
freight_id: str,
user: dict = Depends(require_admin_or_super_admin),
db: Session = Depends(get_db),
):
try:
tenant_no = _get_tenant_no(db, user)
user_id = _get_current_user_id(user)
data = freight_svc.delete_freight(
db,
freight_id,
tenant_no=tenant_no,
user_id=user_id,
)
return success_response(data, message="删除成功")
except PermissionError as e:
return error_response(403, str(e))
except ValueError as e:
msg = str(e)
code = 404 if "不存在" in msg else 400
return error_response(code, msg)
+52
View File
@@ -906,6 +906,58 @@ def unlink_samples(
return get_freight_detail(db, freight_id, tenant_no)
def delete_freight(
db: Session,
freight_id: str,
*,
tenant_no: str,
user_id: Optional[str],
commit: bool = True,
) -> Dict[str, Any]:
"""级联软删运费批次及其全部有效关联样本。"""
obj = (
db.query(BizSampleFreight)
.filter(
BizSampleFreight.id == freight_id,
BizSampleFreight.tenant_no == tenant_no,
BizSampleFreight.del_flag == 0,
)
.with_for_update()
.first()
)
if not obj:
raise ValueError("运费批次不存在")
now = _now()
items = (
db.query(BizSampleFreightItem)
.filter(
BizSampleFreightItem.freight_id == freight_id,
BizSampleFreightItem.tenant_no == tenant_no,
BizSampleFreightItem.del_flag == 0,
)
.with_for_update()
.all()
)
for row in items:
row.del_flag = 1
row.update_by = user_id
row.update_time = now
db.add(row)
obj.del_flag = 1
obj.update_by = user_id
obj.update_time = now
db.add(obj)
if commit:
db.commit()
else:
db.flush()
return {
"id": freight_id,
"deleted": True,
"linkedSampleCount": 0,
}
def freight_map_for_samples(
db: Session,
*,
+32 -2
View File
@@ -413,7 +413,7 @@ def list_freights(
data['allowedActions'] = (
['link', 'unlink']
if has_outside_scope_item
else ['edit', 'link', 'unlink']
else ['edit', 'delete', 'link', 'unlink']
)
if include_items:
data['items'] = [_item_dict(row) for row in rows]
@@ -455,7 +455,7 @@ def get_freight_detail(db: Session, freight_id: str, *, ctx: MarketFieldContext,
data['allowedActions'] = (
['link', 'unlink']
if has_outside_scope_item
else ['edit', 'link', 'unlink']
else ['edit', 'delete', 'link', 'unlink']
)
return data
@@ -1204,3 +1204,33 @@ def unlink_samples(db: Session, freight_id: str, *, ctx: MarketFieldContext, use
except Exception:
db.rollback()
raise
def delete_freight(db: Session, freight_id: str, *, ctx: MarketFieldContext, user_info: dict):
"""级联软删运费单;仅当全部有效关联样本均在当前范围内时允许。"""
try:
obj = _lock_batch_header(db, freight_id, ctx)
expected_keys = _discover_batch_keys(db, freight_id, ctx)
visible = _lock_sample_graph(db, expected_keys, ctx, user_info)
active = _lock_active_items(
db,
ctx,
freight_id=freight_id,
expected_batch_keys=expected_keys,
)
if not active or not visible:
raise HTTPException(status_code=404, detail='数据不存在或无权访问')
if any(
(row.sample_source, row.sample_id) not in visible for row in active
):
raise PermissionError('仅当批次全部有效样本均在当前范围内时可删除运费单')
now = datetime.now()
for row in active:
row.del_flag, row.update_by, row.update_time = 1, ctx.user_id, now
obj.del_flag, obj.update_by, obj.update_time = 1, ctx.user_id, now
db.flush()
db.commit()
return {'id': freight_id, 'visibleItemCount': 0, 'disappeared': True}
except Exception:
db.rollback()
raise
+1 -1
View File
@@ -1314,7 +1314,7 @@ def decorate_allowed_actions(
data['transfers'] = transfers
if module == 'freight' and (detail or isinstance(data.get('allowedActions'), list)):
provided = data.get('allowedActions')
safe_actions = {'edit', 'link', 'unlink'}
safe_actions = {'edit', 'delete', 'link', 'unlink'}
data['allowedActions'] = (
[action for action in provided if action in safe_actions]
if isinstance(provided, list)
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+91 -111
View File
@@ -1,11 +1,11 @@
# Graph Report - app (2026-10-14)
# Graph Report - app (2026-10-15)
## Corpus Check
- Large corpus: 308 files · ~375,816 words. Semantic extraction will be expensive (many Claude tokens). Consider running on a subfolder, or use --no-semantic to run AST-only.
- Large corpus: 308 files · ~376,049 words. Semantic extraction will be expensive (many Claude tokens). Consider running on a subfolder, or use --no-semantic to run AST-only.
## Summary
- 6309 nodes · 34875 edges · 45 communities detected
- Extraction: 32% EXTRACTED · 68% INFERRED · 0% AMBIGUOUS · INFERRED: 23838 edges (avg confidence: 0.6)
- 6313 nodes · 34912 edges · 41 communities detected
- Extraction: 32% EXTRACTED · 68% INFERRED · 0% AMBIGUOUS · INFERRED: 23864 edges (avg confidence: 0.6)
- Token cost: 0 input · 0 output
## Community Hubs (Navigation)
@@ -44,21 +44,17 @@
- [[_COMMUNITY_Community 32|Community 32]]
- [[_COMMUNITY_Community 33|Community 33]]
- [[_COMMUNITY_Community 34|Community 34]]
- [[_COMMUNITY_Community 35|Community 35]]
- [[_COMMUNITY_Community 36|Community 36]]
- [[_COMMUNITY_Community 37|Community 37]]
- [[_COMMUNITY_Community 38|Community 38]]
- [[_COMMUNITY_Community 39|Community 39]]
- [[_COMMUNITY_Community 40|Community 40]]
- [[_COMMUNITY_Community 41|Community 41]]
- [[_COMMUNITY_Community 42|Community 42]]
- [[_COMMUNITY_Community 43|Community 43]]
- [[_COMMUNITY_Community 44|Community 44]]
- [[_COMMUNITY_Community 45|Community 45]]
- [[_COMMUNITY_Community 46|Community 46]]
## God Nodes (most connected - your core abstractions)
1. `success_response()` - 825 edges
2. `SysUser` - 720 edges
3. `error_response()` - 694 edges
1. `success_response()` - 826 edges
2. `SysUser` - 721 edges
3. `error_response()` - 695 edges
4. `BizQcTaskResult` - 386 edges
5. `BizProductionMaterial` - 370 edges
6. `BizProductionMaterialUsage` - 363 edges
@@ -83,228 +79,212 @@
### Community 0 - "Community 0"
Cohesion: 0.01
Nodes (1177): _assert_user_tenant_access(), attachment_download_url(), create_dept(), create_dict_data(), create_dict_type(), create_express_company(), create_item_unit(), create_menu() (+1169 more)
Nodes (1171): _assert_user_tenant_access(), attachment_download_url(), create_dept(), create_dict_data(), create_dict_type(), create_express_company(), create_item_unit(), create_menu() (+1163 more)
### Community 1 - "Community 1"
Cohesion: 0.0
Nodes (905): api_save_application(), _save_sample_payments(), BaseSettings, Config, secret_key_must_be_strong(), Settings, generate_uuid(), allocate_next_biz_no() (+897 more)
Cohesion: 0.01
Nodes (794): get_designer_data(), BaseSettings, Config, secret_key_must_be_strong(), Settings, generate_uuid(), allocate_next_biz_no(), _allocate_sqlite_sequence() (+786 more)
### Community 2 - "Community 2"
Cohesion: 0.01
Nodes (604): GarmentBatchDeleteBody, GarmentBatchDiscardBody, GarmentCreateBody, GarmentDiscardBody, GarmentUpdateBody, SterilizeLogBatchBody, SterilizeLogCreateBody, SterilizeLogUpdateBody (+596 more)
Nodes (602): GarmentBatchDeleteBody, GarmentBatchDiscardBody, GarmentCreateBody, GarmentDiscardBody, GarmentUpdateBody, SterilizeLogBatchBody, SterilizeLogCreateBody, SterilizeLogUpdateBody (+594 more)
### Community 3 - "Community 3"
Cohesion: 0.05
Nodes (532): AttachmentDownloadUrlBody, DeptCreateBody, DeptUpdateBody, DictDataCreateBody, DictDataUpdateBody, DictTypeCreateBody, DictTypeUpdateBody, ExpressCompanyCreateBody (+524 more)
Nodes (516): AttachmentDownloadUrlBody, DeptCreateBody, DeptUpdateBody, DictDataCreateBody, DictDataUpdateBody, DictTypeCreateBody, DictTypeUpdateBody, ExpressCompanyCreateBody (+508 more)
### Community 4 - "Community 4"
Cohesion: 0.01
Nodes (416): _normalize_date_bound(), _persist_protocol_sub_resources(), list_ethnics_for_select(), assert_donation_sensitive_fields(), batch_delete_research_donations(), change_donation_status(), convert_from_storage(), convert_to_storage() (+408 more)
Nodes (466): _normalize_date_bound(), assert_protocol_sensitive_fields(), create_collection_protocol(), delete_collection_protocol(), get_collection_protocol_detail(), get_invoice_eligible_payments(), get_protocol_invoice_requests(), _get_tenant_no() (+458 more)
### Community 5 - "Community 5"
Cohesion: 0.05
Nodes (447): CellSampleTypeCreateBody, CellSampleTypeUpdateBody, CollectionRegionCreateBody, CollectionRegionUpdateBody, CustomerCreateBody, CustomerUpdateBody, HospitalCreateBody, HospitalUpdateBody (+439 more)
Cohesion: 0.04
Nodes (465): CellSampleTypeCreateBody, CellSampleTypeUpdateBody, CollectionRegionCreateBody, CollectionRegionUpdateBody, CustomerCreateBody, CustomerUpdateBody, HospitalCreateBody, HospitalUpdateBody (+457 more)
### Community 6 - "Community 6"
Cohesion: 0.01
Nodes (292): api_detail(), api_get_outbound_handover(), api_list(), api_save_outbound_handover(), _get_tenant_no(), ProductItemBody, UpdateQcStatusBody, UpdateScheduleBody (+284 more)
Nodes (314): eq_unicode(), like_unicode(), MySQL 字符串比较/模糊匹配时统一排序规则,避免 Illegal mix of collations。, 跨表字符串等值比较(JOIN / WHERE)时统一为 utf8mb4_unicode_ci。, 将列显式设为 utf8mb4_unicode_ci。, unicode_ci(), _load_lineage_qc_for_nodes(), lookup_attachments_by_urls() (+306 more)
### Community 7 - "Community 7"
Cohesion: 0.02
Nodes (236): 截止日期:仅日期时扩到当天 23:59:59。, 发起前预览审批链(条件齐后解析最终路径与审批人)。, 兼容旧 GET:无 formData,含条件分支时多为待确定占位。, _copied_app_name(), copy_app(), create_app(), create_group(), _create_version() (+228 more)
Nodes (234): _copied_app_name(), copy_app(), create_app(), _create_version(), delete_app(), delete_group(), _dumps(), _find_draft() (+226 more)
### Community 8 - "Community 8"
Cohesion: 0.02
Nodes (211): eq_unicode(), like_unicode(), MySQL 字符串比较/模糊匹配时统一排序规则,避免 Illegal mix of collations。, 跨表字符串等值比较(JOIN / WHERE)时统一为 utf8mb4_unicode_ci。, 将列显式设为 utf8mb4_unicode_ci。, unicode_ci(), _lookup_attachment_by_url(), _normalize_attachment_url_key() (+203 more)
Cohesion: 0.03
Nodes (161): _save_sample_payments(), deduct_for_step(), _display_remark(), list_stock_logs(), _parse_receiver_purpose_from_remark(), 耗材变动记录 CRUD(biz_consumable_stock_log), 撤销步骤此前 step_save 扣减,便于重新填报。, 扣减耗材库存并生成变动记录。调用方控制事务,本函数不 commit。 (+153 more)
### Community 9 - "Community 9"
Cohesion: 0.02
Nodes (141): get_designer_data(), _error_json(), lifespan(), 未捕获异常:统一 JSON 500,确保跨域场景下仍有 Access-Control-Allow-Origin, 数据库异常:返回 JSON 并保留 CORS 头,避免浏览器只报跨域错误, sqlalchemy_exception_handler(), unhandled_exception_handler(), BaseHTTPMiddleware (+133 more)
Nodes (105): _error_json(), lifespan(), 未捕获异常:统一 JSON 500,确保跨域场景下仍有 Access-Control-Allow-Origin, 数据库异常:返回 JSON 并保留 CORS 头,避免浏览器只报跨域错误, sqlalchemy_exception_handler(), unhandled_exception_handler(), BaseHTTPMiddleware, ApiCryptoError (+97 more)
### Community 10 - "Community 10"
Cohesion: 0.02
Nodes (155): _register_attachment_routes(), _register_freight_routes(), _register_payment_routes(), _register_presign_routes(), _register_protocol_routes(), mp_bind_status(), 小程序鉴权:微信登录 / 绑定 openid。, 当前用户是否已绑定微信服务号 openid。 (+147 more)
Cohesion: 0.03
Nodes (150): format_protocol_status_label(), resolve_void_type_label(), _ancestor_link_from_cell_product_input(), _ancestor_sample_chain_link(), _apply_cell_product_status_change(), _build_ancestor_chain(), _build_descendant_chain(), _build_facility_path_label() (+142 more)
### Community 11 - "Community 11"
Cohesion: 0.03
Nodes (137): _ancestor_link_from_cell_product_input(), _ancestor_sample_chain_link(), _apply_cell_product_status_change(), _build_ancestor_chain(), _build_descendant_chain(), _build_facility_path_label(), build_split_product_codes(), create_cell_product() (+129 more)
Cohesion: 0.02
Nodes (140): _register_attachment_routes(), _register_freight_routes(), _register_payment_routes(), _register_presign_routes(), _register_protocol_routes(), mp_bind_status(), 小程序鉴权:微信登录 / 绑定 openid。, 当前用户是否已绑定微信服务号 openid。 (+132 more)
### Community 12 - "Community 12"
Cohesion: 0.05
Nodes (114): AccessLogCreateBody, AccessLogUpdateBody, CleanRoomCreateBody, CleanRoomUpdateBody, ExhibitionAppointmentCreateBody, ExhibitionAppointmentUpdateBody, list_storage_slot_stats(), OccupancyCreateBody (+106 more)
Cohesion: 0.02
Nodes (141): api_detail(), api_get_outbound_handover(), api_list(), api_save_outbound_handover(), _get_tenant_no(), ProductItemBody, UpdateQcStatusBody, UpdateScheduleBody (+133 more)
### Community 13 - "Community 13"
Cohesion: 0.04
Nodes (107): _resolve_unused_item_fields(), apply_handover_inventory(), _deduct_market_material_for_handover(), _get_cell_product_locked(), _handover_usage_remark(), _handover_usage_remark_prefix(), _remove_cell_occupancy_no_commit(), _restore_cell_occupancy_no_commit() (+99 more)
Cohesion: 0.05
Nodes (113): AccessLogCreateBody, AccessLogUpdateBody, CleanRoomCreateBody, CleanRoomUpdateBody, ExhibitionAppointmentCreateBody, ExhibitionAppointmentUpdateBody, list_storage_slot_stats(), OccupancyCreateBody (+105 more)
### Community 14 - "Community 14"
Cohesion: 0.06
Nodes (68): _get_current_user_id(), get_sample_insurance(), get_sample_storage_cert(), _get_tenant_no(), put_sample_insurance(), put_sample_storage_cert(), _resolve_protocol_id(), upsert_storage_cert_handle() (+60 more)
Cohesion: 0.04
Nodes (104): _body_to_payload(), _get_current_user_id(), get_production_reception_by_sample_code(), get_production_reception_detail(), _get_tenant_no(), post_production_reception(), ProductionReceptionBody, put_production_reception() (+96 more)
### Community 15 - "Community 15"
Cohesion: 0.1
Nodes (48): create_sample_freight(), _get_current_user_id(), get_sample_freight(), _get_tenant_no(), link_sample_freight(), list_sample_freight_options(), list_sample_freights(), SampleFreightCreateBody (+40 more)
Cohesion: 0.04
Nodes (97): get_customer_service_dict(), _get_tenant_no(), _get_current_user_id(), get_sample_insurance(), get_sample_storage_cert(), _get_tenant_no(), put_sample_insurance(), put_sample_storage_cert() (+89 more)
### Community 16 - "Community 16"
Cohesion: 0.06
Nodes (62): complete_application(), create_basic_experiment_sale_schedules(), create_infusion_plan(), create_schedule(), _create_schedule_products(), _format_yyyy_mm_dd(), _generate_application_no(), get_application() (+54 more)
### Community 17 - "Community 17"
Cohesion: 0.09
Nodes (52): create_sample_freight(), delete_sample_freight(), _get_current_user_id(), get_sample_freight(), _get_tenant_no(), link_sample_freight(), list_sample_freight_options(), list_sample_freights() (+44 more)
### Community 18 - "Community 18"
Cohesion: 0.12
Nodes (11): get_wechat_pay_client(), get_wechat_pay_v2(), 微信支付工具模块 支持微信支付 V3 API 文档参考: https://pay.weixin.qq.com/docs/v3/apis/index.ht, 统一下单接口 (V3) Args: out_trade_no: 商户订单号 total, 申请退款 Args: out_trade_no: 商户订单号 total_amount, 小程序调起支付的二次签名参数(与公众号 JSAPI 规则一致), 统一下单 (V2 API) Args: out_trade_no: 商户订单号 tot, 生成签名 V3 (SHA256 with RSA) (+3 more)
### Community 17 - "Community 17"
Cohesion: 0.14
Nodes (26): _assert_routes_exist(), collect_missing_route_ids(), create_set(), create_set_from_work_order(), create_tasks_from_set(), delete_set(), get_set(), _item_count_map() (+18 more)
### Community 18 - "Community 18"
### Community 19 - "Community 19"
Cohesion: 0.14
Nodes (11): apply_formulas_and_linkages(), eval_formula(), _extract_rules(), preprocess_formula(), OA 表单公式与数据联动(禁止任意 eval), 按 schema 中字段 props.formula / props.linkage 回填 form_data。 linkage 示例: { "when, 将 {field} 转为合法标识符引用 field。, _SafeEval (+3 more)
### Community 19 - "Community 19"
Cohesion: 0.14
Nodes (22): 验证密码(哈希非 bcrypt 或损坏时返回 False,避免抛错), verify_password(), _attach_user_relations(), change_password(), create_user(), _empty_user_relation_fields(), enrich_user_dicts_with_relations(), get_user() (+14 more)
### Community 20 - "Community 20"
Cohesion: 0.12
Nodes (18): get_customer_service_dict(), _get_tenant_no(), ensure_dict_value(), list_dict_values(), _format_date(), _format_datetime(), get_by_sample_code(), _row_field_dict() (+10 more)
Cohesion: 0.21
Nodes (19): _consumable_row_to_dict(), create_process(), _create_sub_consumable(), _create_sub_data_collection(), _create_sub_output(), _create_sub_reagent(), _data_collection_row_to_dict(), get_process() (+11 more)
### Community 21 - "Community 21"
Cohesion: 0.2
Nodes (19): _code_exists(), create_material(), _dec(), _fmt_dt(), get_material(), get_material_entity(), get_my_usages(), _is_enabled_status() (+11 more)
### Community 22 - "Community 22"
Cohesion: 0.32
Nodes (13): _assert_item_ids_exist(), create_template(), filter_active_ids(), get_template(), join_id_list(), list_active_templates(), list_templates(), parse_id_csv() (+5 more)
### Community 23 - "Community 23"
Cohesion: 0.27
Nodes (12): _field_label(), _is_empty(), _is_required(), _parse_money(), OA 表单设计器:金额控件 form_data 校验, 校验 form_data 中金额控件的值格式,返回中文错误列表(空表示通过)。, 解析金额值。成功返回 (number, None);失败返回 (None, error_key)。, _rule_props() (+4 more)
### Community 24 - "Community 24"
Cohesion: 0.29
Nodes (11): get_detail(), _load_sample_context(), _row_to_dict(), upsert(), dumps_payload(), empty_detail(), loads_payload(), normalize_payload() (+3 more)
### Community 25 - "Community 25"
### Community 23 - "Community 23"
Cohesion: 0.24
Nodes (11): deduct_for_step(), _display_remark(), list_stock_logs(), _parse_receiver_purpose_from_remark(), 试剂变动记录 CRUD(biz_reagent_stock_log), 撤销步骤此前 step_save 扣减,便于重新填报。, 扣减试剂库存并生成变动记录。调用方控制事务,本函数不 commit。, _resolve_receiver_purpose() (+3 more)
### Community 26 - "Community 26"
Cohesion: 0.24
Nodes (11): deduct_for_step(), _display_remark(), list_stock_logs(), _parse_receiver_purpose_from_remark(), 耗材变动记录 CRUD(biz_consumable_stock_log), 撤销步骤此前 step_save 扣减,便于重新填报。, 扣减耗材库存并生成变动记录。调用方控制事务,本函数不 commit。, _resolve_receiver_purpose() (+3 more)
### Community 27 - "Community 27"
Cohesion: 0.27
Nodes (11): _build_tree(), _cascade_soft_delete(), _collect_with_ancestors(), create_dept(), get_dept(), list_depts(), list_depts_tree(), 保留匹配节点及其全部上级,供关键词检索后仍能正确组树。 (+3 more)
### Community 28 - "Community 28"
### Community 24 - "Community 24"
Cohesion: 0.31
Nodes (10): create_account(), _filtered_query(), get_account(), list_accounts(), list_options(), OA 收款账户 CRUD(oa_receive_account), row_to_dict(), soft_delete_account() (+2 more)
### Community 29 - "Community 29"
### Community 25 - "Community 25"
Cohesion: 0.33
Nodes (8): _build_tree(), _cascade_soft_delete(), get_menu(), list_menus(), list_menus_tree(), _row_to_dict(), soft_delete_menu(), update_menu()
### Community 26 - "Community 26"
Cohesion: 0.29
Nodes (2): BaseModel, SoftDeleteModel
### Community 30 - "Community 30"
Cohesion: 0.46
Nodes (7): _dec(), _due_date(), 未作废期:应缴金额与应缴时间必填(分期场景由调用方 require_fields=True)。, 未作废期 dueAmount 合计须等于合同金额。 require_schedule_fields=True 时先校验每期金额与应缴日必填。 返, schedule_dues_match_contract(), schedule_required_fields_ok(), _status()
### Community 31 - "Community 31"
### Community 27 - "Community 27"
Cohesion: 0.38
Nodes (6): derive_legacy_status_from_three(), derive_three_status_from_legacy(), 阶段A兼容:从旧 status 推导三字段。 约束:旧 status 本身混合了支付/配送/订单生命周期,因此只能尽力推断; 若业务侧已有更精确, 阶段A兼容:从三字段反推旧 status(用于旧前端/旧筛选参数兼容)。, ThreeStatus, _to_decimal()
### Community 32 - "Community 32"
### Community 28 - "Community 28"
Cohesion: 0.4
Nodes (5): batch_matches_stock_status(), normalize_batch_stock_status(), 质检物料入库批次:按剩余数量过滤的语义辅助。, 纯函数判定(供单测);list_batches 用 SQL 等价条件。, 返回 'available' | 'exhausted';全部 / 空 / 非法 → None(不加剩余数量条件)。
### Community 33 - "Community 33"
### Community 29 - "Community 29"
Cohesion: 0.5
Nodes (2): _auto_fill_create_dept_id(), ORM before_insert 钩子:当 create_dept_id 为空时,自动从请求上下文填充当前用户部门 ID
### Community 34 - "Community 34"
### Community 30 - "Community 30"
Cohesion: 0.67
Nodes (2): get_menu_list(), 运营端菜单接口(与 web-admin 前端静态路由 sqxp.ts 对齐,5 个一级菜单分组)
### Community 35 - "Community 35"
### Community 31 - "Community 31"
Cohesion: 0.67
Nodes (1): 转正套件:入职日 + 试用期月数 → 建议转正日(YYYY-MM-DD)。
### Community 36 - "Community 36"
### Community 32 - "Community 32"
Cohesion: 1.0
Nodes (1): 质检物料金额查看授权:专用角色与菜单权限常量。
### Community 37 - "Community 37"
### Community 33 - "Community 33"
Cohesion: 1.0
Nodes (1): 请求级别的用户上下文变量 通过 contextvars 在请求处理链路中传递当前用户信息, 供 SQLAlchemy 事件监听器等底层机制使用,避免逐层手动传
### Community 38 - "Community 38"
### Community 34 - "Community 34"
Cohesion: 1.0
Nodes (1): API 路由包(骨架:公共鉴权 + 静态菜单 + 运营端占位)
### Community 41 - "Community 41"
### Community 37 - "Community 37"
Cohesion: 1.0
Nodes (1): 发送订单状态通知 Args: openid: 用户openid ord
### Community 42 - "Community 42"
### Community 38 - "Community 38"
Cohesion: 1.0
Nodes (1): 发送支付成功通知 Args: openid: 用户openid ord
### Community 43 - "Community 43"
### Community 39 - "Community 39"
Cohesion: 1.0
Nodes (1): 发送配送通知 Args: openid: 配送员openid task
### Community 44 - "Community 44"
### Community 40 - "Community 40"
Cohesion: 1.0
Nodes (1): 发送配送时效预警 Args: openid: 配送员openid ta
### Community 45 - "Community 45"
### Community 41 - "Community 41"
Cohesion: 1.0
Nodes (1): 发送退款结果通知 Args: openid: 用户openid ord
### Community 46 - "Community 46"
### Community 42 - "Community 42"
Cohesion: 1.0
Nodes (1): 发送催单通知给配送员 Args: deliver_openid: 配送员openid
## Knowledge Gaps
- **207 isolated node(s):** `刷新会话 TTL(refreshToken 续期;已登录用户每次 API 校验通过后滑动续期)`, `写入 refreshToken(用于 one-time 使用/吊销)`, `根据 token 获取当前用户(包含 Redis 会话校验;会话滑动续期)`, `严格判断当前租户用户是否拥有指定移动市场权限码。`, `为移动市场 API 提供租户化、精确匹配的菜单权限依赖。` (+202 more)
These have ≤1 connection - possible missing edges or undocumented components.
- **Thin community `Community 29`** (8 nodes): `BaseModel`, `.to_dict()`, `get_active()`, `base.py`, `SoftDeleteModel`, `.restore()`, `.soft_delete()`, `__tablename__()`
- **Thin community `Community 26`** (8 nodes): `BaseModel`, `.to_dict()`, `get_active()`, `base.py`, `SoftDeleteModel`, `.restore()`, `.soft_delete()`, `__tablename__()`
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
- **Thin community `Community 33`** (4 nodes): `_auto_fill_create_dept_id()`, `get_db()`, `database.py`, `ORM before_insert 钩子:当 create_dept_id 为空时,自动从请求上下文填充当前用户部门 ID`
- **Thin community `Community 29`** (4 nodes): `_auto_fill_create_dept_id()`, `get_db()`, `database.py`, `ORM before_insert 钩子:当 create_dept_id 为空时,自动从请求上下文填充当前用户部门 ID`
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
- **Thin community `Community 34`** (3 nodes): `get_menu_list()`, `menu.py`, `运营端菜单接口(与 web-admin 前端静态路由 sqxp.ts 对齐,5 个一级菜单分组)`
- **Thin community `Community 30`** (3 nodes): `get_menu_list()`, `menu.py`, `运营端菜单接口(与 web-admin 前端静态路由 sqxp.ts 对齐,5 个一级菜单分组)`
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
- **Thin community `Community 35`** (3 nodes): `add_months_ymd()`, `oa_confirmation_date.py`, `转正套件:入职日 + 试用期月数 → 建议转正日(YYYY-MM-DD)。`
- **Thin community `Community 31`** (3 nodes): `add_months_ymd()`, `oa_confirmation_date.py`, `转正套件:入职日 + 试用期月数 → 建议转正日(YYYY-MM-DD)。`
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
- **Thin community `Community 36`** (2 nodes): `qc_material_amount_auth_constants.py`, `质检物料金额查看授权:专用角色与菜单权限常量。`
- **Thin community `Community 32`** (2 nodes): `qc_material_amount_auth_constants.py`, `质检物料金额查看授权:专用角色与菜单权限常量。`
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
- **Thin community `Community 37`** (2 nodes): `context.py`, `请求级别的用户上下文变量 通过 contextvars 在请求处理链路中传递当前用户信息, 供 SQLAlchemy 事件监听器等底层机制使用,避免逐层手动传`
- **Thin community `Community 33`** (2 nodes): `context.py`, `请求级别的用户上下文变量 通过 contextvars 在请求处理链路中传递当前用户信息, 供 SQLAlchemy 事件监听器等底层机制使用,避免逐层手动传`
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
- **Thin community `Community 38`** (2 nodes): `__init__.py`, `API 路由包(骨架:公共鉴权 + 静态菜单 + 运营端占位)`
- **Thin community `Community 34`** (2 nodes): `__init__.py`, `API 路由包(骨架:公共鉴权 + 静态菜单 + 运营端占位)`
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
- **Thin community `Community 41`** (1 nodes): `发送订单状态通知 Args: openid: 用户openid ord`
- **Thin community `Community 37`** (1 nodes): `发送订单状态通知 Args: openid: 用户openid ord`
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
- **Thin community `Community 42`** (1 nodes): `发送支付成功通知 Args: openid: 用户openid ord`
- **Thin community `Community 38`** (1 nodes): `发送支付成功通知 Args: openid: 用户openid ord`
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
- **Thin community `Community 43`** (1 nodes): `发送配送通知 Args: openid: 配送员openid task`
- **Thin community `Community 39`** (1 nodes): `发送配送通知 Args: openid: 配送员openid task`
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
- **Thin community `Community 44`** (1 nodes): `发送配送时效预警 Args: openid: 配送员openid ta`
- **Thin community `Community 40`** (1 nodes): `发送配送时效预警 Args: openid: 配送员openid ta`
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
- **Thin community `Community 45`** (1 nodes): `发送退款结果通知 Args: openid: 用户openid ord`
- **Thin community `Community 41`** (1 nodes): `发送退款结果通知 Args: openid: 用户openid ord`
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
- **Thin community `Community 46`** (1 nodes): `发送催单通知给配送员 Args: deliver_openid: 配送员openid`
- **Thin community `Community 42`** (1 nodes): `发送催单通知给配送员 Args: deliver_openid: 配送员openid`
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
## Suggested Questions
_Questions this graph is uniquely positioned to answer:_
- **Why does `SysUser` connect `Community 5` to `Community 0`, `Community 2`, `Community 3`, `Community 4`, `Community 6`, `Community 7`, `Community 9`, `Community 10`, `Community 12`, `Community 15`, `Community 19`, `Community 25`, `Community 26`?**
_High betweenness centrality (0.109) - this node is a cross-community bridge._
- **Why does `generate_uuid()` connect `Community 1` to `Community 0`, `Community 3`, `Community 4`, `Community 5`, `Community 6`, `Community 7`, `Community 8`, `Community 9`, `Community 10`, `Community 11`, `Community 12`, `Community 13`, `Community 14`, `Community 15`, `Community 17`, `Community 19`, `Community 20`, `Community 21`, `Community 22`, `Community 24`, `Community 25`, `Community 26`, `Community 27`, `Community 28`?**
_High betweenness centrality (0.040) - this node is a cross-community bridge._
- **Why does `success_response()` connect `Community 0` to `Community 1`, `Community 2`, `Community 34`, `Community 4`, `Community 6`, `Community 9`, `Community 10`, `Community 12`, `Community 14`, `Community 15`, `Community 20`?**
_High betweenness centrality (0.039) - this node is a cross-community bridge._
- **Why does `SysUser` connect `Community 5` to `Community 0`, `Community 1`, `Community 2`, `Community 3`, `Community 4`, `Community 7`, `Community 8`, `Community 9`, `Community 11`, `Community 12`, `Community 13`, `Community 14`, `Community 17`, `Community 23`?**
_High betweenness centrality (0.107) - this node is a cross-community bridge._
- **Why does `success_response()` connect `Community 0` to `Community 1`, `Community 2`, `Community 3`, `Community 4`, `Community 11`, `Community 12`, `Community 13`, `Community 14`, `Community 15`, `Community 17`, `Community 30`?**
_High betweenness centrality (0.043) - this node is a cross-community bridge._
- **Why does `generate_uuid()` connect `Community 1` to `Community 0`, `Community 3`, `Community 4`, `Community 5`, `Community 6`, `Community 7`, `Community 8`, `Community 9`, `Community 10`, `Community 11`, `Community 12`, `Community 13`, `Community 14`, `Community 15`, `Community 17`, `Community 20`, `Community 21`, `Community 22`, `Community 23`, `Community 24`?**
_High betweenness centrality (0.037) - this node is a cross-community bridge._
- **Are the 1157 inferred relationships involving `str` (e.g. with `unhandled_exception_handler()` and `get_current_user_by_token()`) actually correct?**
_`str` has 1157 INFERRED edges - model-reasoned connections that need verification._
- **Are the 824 inferred relationships involving `success_response()` (e.g. with `list_storage_release_reviews()` and `get_storage_release_review_detail()`) actually correct?**
_`success_response()` has 824 INFERRED edges - model-reasoned connections that need verification._
- **Are the 718 inferred relationships involving `SysUser` (e.g. with `菜单 code 权限守卫(V0.3:通过 sys_user_role → sys_role_menu → sys_menu.perms)` and `运营端角色守卫:admin / super_admin 可访问。`) actually correct?**
_`SysUser` has 718 INFERRED edges - model-reasoned connections that need verification._
- **Are the 693 inferred relationships involving `error_response()` (e.g. with `_json_error_response()` and `list_storage_release_reviews()`) actually correct?**
_`error_response()` has 693 INFERRED edges - model-reasoned connections that need verification._
- **Are the 825 inferred relationships involving `success_response()` (e.g. with `list_storage_release_reviews()` and `get_storage_release_review_detail()`) actually correct?**
_`success_response()` has 825 INFERRED edges - model-reasoned connections that need verification._
- **Are the 719 inferred relationships involving `SysUser` (e.g. with `菜单 code 权限守卫(V0.3:通过 sys_user_role → sys_role_menu → sys_menu.perms)` and `运营端角色守卫:admin / super_admin 可访问。`) actually correct?**
_`SysUser` has 719 INFERRED edges - model-reasoned connections that need verification._
- **Are the 694 inferred relationships involving `error_response()` (e.g. with `_json_error_response()` and `list_storage_release_reviews()`) actually correct?**
_`error_response()` has 694 INFERRED edges - model-reasoned connections that need verification._
File diff suppressed because it is too large. Load diff
+7 -7
View File
@@ -159,7 +159,7 @@
"/Users/wuzilong/work/00code/zkxw/backend/app/crud/research_donation.py": 1791868317.7273736,
"/Users/wuzilong/work/00code/zkxw/backend/app/crud/qc_material_stock_in_no.py": 1787114586.3799527,
"/Users/wuzilong/work/00code/zkxw/backend/app/crud/ethnic.py": 1779265849.547566,
"/Users/wuzilong/work/00code/zkxw/backend/app/crud/sample_freight.py": 1791924914.1137733,
"/Users/wuzilong/work/00code/zkxw/backend/app/crud/sample_freight.py": 1791955167.110458,
"/Users/wuzilong/work/00code/zkxw/backend/app/crud/production_material_formula.py": 1781344175.5871844,
"/Users/wuzilong/work/00code/zkxw/backend/app/crud/pilot_checkup.py": 1779935785.233911,
"/Users/wuzilong/work/00code/zkxw/backend/app/crud/env_detect_item.py": 1781145689.9525824,
@@ -211,14 +211,14 @@
"/Users/wuzilong/work/00code/zkxw/backend/app/api/qc.py": 1787193588.7157009,
"/Users/wuzilong/work/00code/zkxw/backend/app/api/market.py": 1781522283.6823432,
"/Users/wuzilong/work/00code/zkxw/backend/app/api/sample_production_reception.py": 1788159565.164049,
"/Users/wuzilong/work/00code/zkxw/backend/app/api/collection_protocol.py": 1791916804.194648,
"/Users/wuzilong/work/00code/zkxw/backend/app/api/collection_protocol.py": 1791963303.0253272,
"/Users/wuzilong/work/00code/zkxw/backend/app/api/cleanroom_garment.py": 1781347256.2326367,
"/Users/wuzilong/work/00code/zkxw/backend/app/api/basic_info.py": 1791454077.2373106,
"/Users/wuzilong/work/00code/zkxw/backend/app/api/presign_order.py": 1791912972.2316256,
"/Users/wuzilong/work/00code/zkxw/backend/app/api/pilot_infusion_confirm.py": 1779657043.1389203,
"/Users/wuzilong/work/00code/zkxw/backend/app/api/pilot_infusion_schedule_mgmt.py": 1779940938.18027,
"/Users/wuzilong/work/00code/zkxw/backend/app/api/__init__.py": 1791860598.0884578,
"/Users/wuzilong/work/00code/zkxw/backend/app/api/market_mobile.py": 1791904783.899619,
"/Users/wuzilong/work/00code/zkxw/backend/app/api/market_mobile.py": 1791955213.844891,
"/Users/wuzilong/work/00code/zkxw/backend/app/api/storage_entry_sms_notification.py": 1780325524.9170487,
"/Users/wuzilong/work/00code/zkxw/backend/app/api/customer_service_dict.py": 1791859621.7209744,
"/Users/wuzilong/work/00code/zkxw/backend/app/api/pilot_application.py": 1781079904.0516074,
@@ -235,7 +235,7 @@
"/Users/wuzilong/work/00code/zkxw/backend/app/api/env_detect.py": 1786945487.513935,
"/Users/wuzilong/work/00code/zkxw/backend/app/api/research_donation.py": 1791912953.5304167,
"/Users/wuzilong/work/00code/zkxw/backend/app/api/ethnic.py": 1779266243.9511197,
"/Users/wuzilong/work/00code/zkxw/backend/app/api/sample_freight.py": 1791424761.175849,
"/Users/wuzilong/work/00code/zkxw/backend/app/api/sample_freight.py": 1791955177.524932,
"/Users/wuzilong/work/00code/zkxw/backend/app/api/pilot_checkup.py": 1779935751.2658868,
"/Users/wuzilong/work/00code/zkxw/backend/app/api/mini_auth.py": 1789710909.065258,
"/Users/wuzilong/work/00code/zkxw/backend/app/api/pilot_service.py": 1781599314.0221174,
@@ -268,7 +268,7 @@
"/Users/wuzilong/work/00code/zkxw/backend/app/services/sample_transport_mode.py": 1791386325.9832487,
"/Users/wuzilong/work/00code/zkxw/backend/app/services/cn_holiday.py": 1786373910.8580065,
"/Users/wuzilong/work/00code/zkxw/backend/app/services/sample_info_quick_register.py": 1791860094.3744802,
"/Users/wuzilong/work/00code/zkxw/backend/app/services/market_payment.py": 1791902380.2139294,
"/Users/wuzilong/work/00code/zkxw/backend/app/services/market_payment.py": 1792030019.4528422,
"/Users/wuzilong/work/00code/zkxw/backend/app/services/oa_confirmation_date.py": 1785403063.141215,
"/Users/wuzilong/work/00code/zkxw/backend/app/services/web_auth_roles.py": 1791692287.6755066,
"/Users/wuzilong/work/00code/zkxw/backend/app/services/oa_trip_days.py": 1785407394.0606225,
@@ -287,7 +287,7 @@
"/Users/wuzilong/work/00code/zkxw/backend/app/services/sample_payment_progress.py": 1791800781.2391684,
"/Users/wuzilong/work/00code/zkxw/backend/app/services/oa_resignation_kit_sync.py": 1785405020.285242,
"/Users/wuzilong/work/00code/zkxw/backend/app/services/wechat_mp_auth.py": 1786615330.0733685,
"/Users/wuzilong/work/00code/zkxw/backend/app/services/market_support.py": 1791947327.9261081,
"/Users/wuzilong/work/00code/zkxw/backend/app/services/market_support.py": 1791955207.4837897,
"/Users/wuzilong/work/00code/zkxw/backend/app/services/oa_assignee.py": 1790665524.6969597,
"/Users/wuzilong/work/00code/zkxw/backend/app/services/wechat_login_service.py": 1786615952.6840453,
"/Users/wuzilong/work/00code/zkxw/backend/app/services/market_protocol.py": 1791920092.0782788,
@@ -299,7 +299,7 @@
"/Users/wuzilong/work/00code/zkxw/backend/app/services/oa_money_field.py": 1785380625.3526123,
"/Users/wuzilong/work/00code/zkxw/backend/app/services/sample_storage_cert_qc.py": 1791520419.7485287,
"/Users/wuzilong/work/00code/zkxw/backend/app/services/protocol_pay_mode_switch.py": 1791922115.8003666,
"/Users/wuzilong/work/00code/zkxw/backend/app/services/market_freight.py": 1791909578.2752085,
"/Users/wuzilong/work/00code/zkxw/backend/app/services/market_freight.py": 1791955205.3779838,
"/Users/wuzilong/work/00code/zkxw/backend/app/services/oa_post_select.py": 1785394392.5716882,
"/Users/wuzilong/work/00code/zkxw/backend/app/services/oa_wechat_notify.py": 1789108034.959046,
"/Users/wuzilong/work/00code/zkxw/backend/app/services/oa_confirmation_kit_sync.py": 1785403667.4270058,
+279 -47
View File
@@ -88,6 +88,7 @@ show_help() {
- 读取 .env.test(非 .env.production)
- 默认 127.0.0.1:10002(Nginx 反代);生产 start-prod.sh 使用 8111
- 可与生产共用 venv,但 PID/日志文件独立,勿混用 start/stop 命令
- stop/restart 除 PID 文件外,还会按端口清理本应用 uvicorn,避免僵尸进程占端口导致发版假成功
EOF
}
@@ -200,22 +201,253 @@ ensure_venv_and_runtime() {
fi
}
is_running() {
# 读取 PID 文件中的进程号;必须存活且确认为本应用 uvicorn(防止脏 PID/PID=1 误杀)
read_pid_file() {
if [ ! -f "$PID_FILE" ]; then
return 1
return 0
fi
local pid
pid="$(cat "$PID_FILE")"
if [ -z "$pid" ]; then
pid="$(tr -d '[:space:]' < "$PID_FILE" 2>/dev/null || true)"
if [ -z "$pid" ] || ! [[ "$pid" =~ ^[0-9]+$ ]]; then
return 0
fi
# 拒绝系统关键 PID 与明显非法值
if [ "$pid" -le 1 ]; then
return 0
fi
if ! ps -p "$pid" >/dev/null 2>&1; then
return 0
fi
if ! is_our_uvicorn_pid "$pid"; then
return 0
fi
echo "$pid"
}
# 进程命令行是否像本目录下的测试 uvicorn
is_our_uvicorn_pid() {
local pid="$1"
local cmd=""
if [ ! -r "/proc/$pid/cmdline" ]; then
return 1
fi
cmd="$(tr '\0' ' ' < "/proc/$pid/cmdline" 2>/dev/null || true)"
case "$cmd" in
*"${BASE_DIR}"*"uvicorn"*"${APP_MODULE}"*) return 0 ;;
*"${VENV_DIR}/bin/python"*"uvicorn"*"${APP_MODULE}"*"--port ${PORT}"*) return 0 ;;
*"${VENV_DIR}/bin/python"*"uvicorn"*"${APP_MODULE}"*"--port=${PORT}"*) return 0 ;;
esac
# 兼容无绝对路径、仅按 port + app 模块匹配(仍限制在本机测试端口)
case "$cmd" in
*"uvicorn"*"${APP_MODULE}"*"--port ${PORT}"*|*"uvicorn"*"${APP_MODULE}"*"--port=${PORT}"*)
return 0
;;
esac
return 1
}
if ps -p "$pid" >/dev/null 2>&1; then
# 列出占用 PORT 的监听进程 PID
list_listen_pids_on_port() {
local pids=""
if command -v ss >/dev/null 2>&1; then
pids="$(ss -lptn "sport = :${PORT}" 2>/dev/null | sed -n 's/.*pid=\([0-9][0-9]*\).*/\1/p' | sort -u)"
fi
if [ -z "$pids" ] && command -v lsof >/dev/null 2>&1; then
pids="$(lsof -tiTCP:"${PORT}" -sTCP:LISTEN 2>/dev/null | sort -u || true)"
fi
if [ -z "$pids" ] && command -v fuser >/dev/null 2>&1; then
pids="$(fuser "${PORT}/tcp" 2>/dev/null | tr -s '[:space:]' '\n' | grep -E '^[0-9]+$' | sort -u || true)"
fi
echo "$pids"
}
# 收集应停止的 PID:PID 文件 + 占用本端口的本应用进程
collect_managed_pids() {
local pid p seen=""
pid="$(read_pid_file || true)"
if [ -n "${pid:-}" ]; then
echo "$pid"
seen=" $pid "
fi
for p in $(list_listen_pids_on_port); do
if [ -z "$p" ]; then
continue
fi
case "$seen" in
*" $p "*) continue ;;
esac
if is_our_uvicorn_pid "$p"; then
echo "$p"
seen="${seen}${p} "
fi
done
}
port_is_in_use() {
local p
p="$(list_listen_pids_on_port | head -n 1)"
[ -n "$p" ]
}
wait_port_free() {
local i
for i in $(seq 1 20); do
if ! port_is_in_use; then
return 0
fi
sleep 1
done
return 1
}
wait_health_ok() {
local i url="http://127.0.0.1:${PORT}/health"
for i in $(seq 1 30); do
if curl -fsS --connect-timeout 1 --max-time 2 "$url" >/dev/null 2>&1; then
return 0
fi
sleep 1
done
return 1
}
is_running() {
local pid
pid="$(read_pid_file || true)"
if [ -n "${pid:-}" ]; then
return 0
fi
# PID 文件失效时,仍以「本端口上的本应用进程」为准,避免误判已停止
for pid in $(list_listen_pids_on_port); do
if is_our_uvicorn_pid "$pid"; then
return 0
fi
done
return 1
}
# 仅扩展「已确认属于本应用」的进程树;禁止对 PID<=1 或未校验进程做树展开
expand_our_pid_tree() {
local pid="$1"
local c
if [ -z "$pid" ] || [ "$pid" -le 1 ]; then
return 0
fi
if ! ps -p "$pid" >/dev/null 2>&1; then
return 0
fi
if ! is_our_uvicorn_pid "$pid"; then
return 0
fi
echo "$pid"
for c in $(pgrep -P "$pid" 2>/dev/null || true); do
# 子进程可能是纯 python worker,命令行仍含 uvicorn/app.main;否则跳过
if [ -n "$c" ] && [ "$c" -gt 1 ] && is_our_uvicorn_pid "$c"; then
expand_our_pid_tree "$c"
elif [ -n "$c" ] && [ "$c" -gt 1 ] && ps -p "$c" >/dev/null 2>&1; then
# worker 偶发 cmdline 不含完整模块名时:仅当父进程已是本应用才收其子进程
echo "$c"
fi
done
}
kill_pids_graceful_then_force() {
local pid
local any=0
local all_pids=""
local p
for pid in "$@"; do
if [ -z "$pid" ] || [ "$pid" -le 1 ]; then
continue
fi
for p in $(expand_our_pid_tree "$pid"); do
if [ -n "$p" ] && [ "$p" -gt 1 ]; then
all_pids="${all_pids}${p} "
fi
done
done
# shellcheck disable=SC2086
set -- $all_pids
for pid in "$@"; do
if [ -z "$pid" ] || [ "$pid" -le 1 ]; then
continue
fi
if ! ps -p "$pid" >/dev/null 2>&1; then
continue
fi
any=1
log_info "正在停止测试服务 (PID: $pid)"
kill -TERM "$pid" >/dev/null 2>&1 || true
done
if [ "$any" -eq 0 ]; then
return 0
fi
return 1
local i left
for i in $(seq 1 10); do
left=0
for pid in "$@"; do
if [ -n "$pid" ] && [ "$pid" -gt 1 ] && ps -p "$pid" >/dev/null 2>&1; then
left=1
break
fi
done
if [ "$left" -eq 0 ]; then
break
fi
sleep 1
done
for pid in "$@"; do
if [ -n "$pid" ] && [ "$pid" -gt 1 ] && ps -p "$pid" >/dev/null 2>&1; then
log_warn "优雅停止超时,执行强制停止 (PID: $pid)"
kill -9 "$pid" >/dev/null 2>&1 || true
fi
done
}
# 停止本应用在测试端口上的全部实例(含 PID 文件失效的僵尸进程)
stop_server() {
local pids
pids="$(collect_managed_pids | sort -u | tr '\n' ' ')"
# shellcheck disable=SC2086
set -- $pids
if [ "$#" -eq 0 ]; then
# 端口仍被非本应用占用时给出明确提示
if port_is_in_use; then
log_warn "测试服务未由本脚本托管,但端口 ${PORT} 仍被占用: $(list_listen_pids_on_port | tr '\n' ' ')"
log_warn "请人工确认后再启动,避免绑端口失败"
else
log_warn "测试服务未运行"
fi
rm -f "$PID_FILE"
return 0
fi
kill_pids_graceful_then_force "$@"
# 若仍有本应用占端口,再扫一遍强杀
pids="$(collect_managed_pids | sort -u | tr '\n' ' ')"
# shellcheck disable=SC2086
set -- $pids
if [ "$#" -gt 0 ]; then
log_warn "仍检测到本应用进程,执行二次强制停止"
for pid in "$@"; do
kill -9 "$pid" >/dev/null 2>&1 || true
done
fi
rm -f "$PID_FILE"
if ! wait_port_free; then
log_error "端口 ${PORT} 仍被占用,无法确认已停止: $(list_listen_pids_on_port | tr '\n' ' ')"
return 1
fi
log_info "测试服务已停止"
return 0
}
start_server() {
@@ -223,17 +455,30 @@ start_server() {
ensure_venv_and_runtime
ensure_dirs
# 已有本应用在跑(PID 文件或端口探测)则直接返回
if is_running; then
local running_pid
running_pid="$(cat "$PID_FILE")"
log_warn "测试服务已在运行 (PID: $running_pid)"
running_pid="$(read_pid_file || true)"
if [ -z "${running_pid:-}" ]; then
running_pid="$(collect_managed_pids | head -n 1)"
fi
log_warn "测试服务已在运行 (PID: ${running_pid:-unknown})"
# 回写 PID 文件,避免后续 stop 找不到
if [ -n "${running_pid:-}" ]; then
echo "$running_pid" > "$PID_FILE"
fi
exit 0
fi
if [ -f "$PID_FILE" ]; then
rm -f "$PID_FILE"
# 端口被占用但不是本应用:拒绝启动,避免静默失败后健康检查打到别人的服务
if port_is_in_use; then
log_error "端口 ${PORT} 已被占用且无法识别为本测试服务: $(list_listen_pids_on_port | tr '\n' ' ')"
log_error "请先释放端口后再 start / restart"
exit 1
fi
rm -f "$PID_FILE"
log_info "启动测试环境服务..."
log_info "监听地址: $HOST:$PORT"
log_info "工作进程: $WORKERS"
@@ -255,53 +500,40 @@ start_server() {
>> "$LOG_FILE" 2>&1 &
echo $! > "$PID_FILE"
sleep 2
if is_running; then
log_info "测试服务启动成功 (PID: $(cat "$PID_FILE"))"
log_info "健康检查: http://127.0.0.1:$PORT/health"
log_info "API 文档: http://127.0.0.1:$PORT/docs"
else
log_error "测试服务启动失败,请检查日志: $LOG_FILE"
rm -f "$PID_FILE"
if ! wait_health_ok; then
log_error "测试服务启动失败(健康检查超时),请检查日志: $LOG_FILE"
# 启动失败时尽量清掉半拉子进程,避免留下占端口僵尸
stop_server || true
exit 1
fi
}
stop_server() {
if ! is_running; then
log_warn "测试服务未运行"
[ -f "$PID_FILE" ] && rm -f "$PID_FILE"
# 用 return 而非 exit,避免 restart 在「已停止」时整脚本退出、无法再 start
return 0
# 优先把 PID 文件写成实际监听端口的进程,避免 nohup 壳/worker 不一致
local listen_pid
listen_pid="$(list_listen_pids_on_port | head -n 1 || true)"
if [ -n "${listen_pid:-}" ]; then
echo "$listen_pid" > "$PID_FILE"
fi
local pid
pid="$(cat "$PID_FILE")"
log_info "正在停止测试服务 (PID: $pid)"
kill -TERM "$pid" >/dev/null 2>&1 || true
for _ in 1 2 3 4 5 6 7 8 9 10; do
if ! ps -p "$pid" >/dev/null 2>&1; then
break
fi
sleep 1
done
if ps -p "$pid" >/dev/null 2>&1; then
log_warn "优雅停止超时,执行强制停止"
kill -9 "$pid" >/dev/null 2>&1 || true
fi
rm -f "$PID_FILE"
log_info "测试服务已停止"
log_info "测试服务启动成功 (PID: $(cat "$PID_FILE"))"
log_info "健康检查: http://127.0.0.1:$PORT/health"
log_info "API 文档: http://127.0.0.1:$PORT/docs"
}
status_server() {
local pid
if is_running; then
echo -e "${GREEN}RUNNING (test)${NC} PID=$(cat "$PID_FILE") HOST=$HOST PORT=$PORT"
pid="$(read_pid_file || true)"
if [ -z "${pid:-}" ]; then
pid="$(collect_managed_pids | head -n 1)"
fi
echo -e "${GREEN}RUNNING (test)${NC} PID=${pid:-unknown} HOST=$HOST PORT=$PORT"
else
echo -e "${RED}STOPPED (test)${NC}"
if port_is_in_use; then
echo -e "${YELLOW}PORT BUSY (test)${NC} PORT=$PORT pids=$(list_listen_pids_on_port | tr '\n' ' ')"
else
echo -e "${RED}STOPPED (test)${NC}"
fi
fi
}
+61 -2
View File
@@ -384,7 +384,7 @@ def test_detail_edit_action_requires_every_active_item_visible_without_leaking_t
'freight', detail, scope_kind=kind, detail=True
)
expected = ['link', 'unlink'] if mixed else ['edit', 'link', 'unlink']
expected = ['link', 'unlink'] if mixed else ['edit', 'delete', 'link', 'unlink']
assert detail['allowedActions'] == expected
assert rendered['allowedActions'] == expected
for hidden_key in (
@@ -584,7 +584,8 @@ def test_all_write_paths_use_batch_graph_item_lock_order():
for start_name, end_name in (
('def update_freight', 'def link_samples'),
('def link_samples', 'def unlink_samples'),
('def unlink_samples', None),
('def unlink_samples', 'def delete_freight'),
('def delete_freight', None),
):
block = source[source.index(start_name):]
if end_name:
@@ -595,6 +596,64 @@ def test_all_write_paths_use_batch_graph_item_lock_order():
assert create_block.index('_lock_sample_graph') < create_block.index('_lock_active_items')
def test_delete_freight_cascades_when_all_items_visible():
from app.services.market_freight import delete_freight, list_freights, list_sample_options
db = _session()
own, op = _sample(db, 'del-own')
freight = _freight(db, 'del-own', [('cell_storage', own, op)])
result = delete_freight(db, freight.id, ctx=_ctx(), user_info=_user())
assert result == {'id': freight.id, 'visibleItemCount': 0, 'disappeared': True}
assert db.query(BizSampleFreight).filter_by(id=freight.id).one().del_flag == 1
assert db.query(BizSampleFreightItem).filter_by(freight_id=freight.id, del_flag=0).count() == 0
assert list_freights(db, ctx=_ctx(), user_info=_user())[1] == 0
options, total = list_sample_options(db, ctx=_ctx(), user_info=_user(), page=1, page_size=20)
assert total >= 1
assert any(row['sampleId'] == own.id and not row.get('freightId') for row in options)
def test_delete_freight_rejects_when_outside_scope_items_exist():
from app.services.market_freight import delete_freight
db = _session()
own, op = _sample(db, 'del-vis')
other, hp = _sample(db, 'del-hid', sales='u2')
freight = _freight(db, 'del-mixed', [('cell_storage', own, op), ('cell_storage', other, hp)])
with pytest.raises(PermissionError, match='全部'):
delete_freight(db, freight.id, ctx=_ctx(), user_info=_user())
assert db.query(BizSampleFreight).filter_by(id=freight.id).one().del_flag == 0
assert db.query(BizSampleFreightItem).filter_by(freight_id=freight.id, del_flag=0).count() == 2
def test_web_admin_delete_freight_cascades_items_and_allows_relink():
from app.crud import sample_freight as freight_crud
db = _session()
own, op = _sample(db, 'web-del')
freight = _freight(db, 'web-del', [('cell_storage', own, op)])
empty = _freight(db, 'web-empty', [])
result = freight_crud.delete_freight(
db, freight.id, tenant_no='tenant-a', user_id='u1'
)
assert result == {'id': freight.id, 'deleted': True, 'linkedSampleCount': 0}
assert db.query(BizSampleFreight).filter_by(id=freight.id).one().del_flag == 1
assert db.query(BizSampleFreightItem).filter_by(freight_id=freight.id, del_flag=0).count() == 0
empty_result = freight_crud.delete_freight(
db, empty.id, tenant_no='tenant-a', user_id='u1'
)
assert empty_result['deleted'] is True
assert db.query(BizSampleFreight).filter_by(id=empty.id).one().del_flag == 1
created = freight_crud.create_freight(
db,
tenant_no='tenant-a',
user_id='u1',
transport_mode_raw='sf',
freight_amount='8.00',
items=[{'sampleSource': 'cell_storage', 'sampleId': own.id, 'protocolId': op.id}],
)
assert created['id']
assert any(
item.get('sampleId') == own.id for item in (created.get('items') or [])
)
def test_header_update_rejects_assignment_changed_after_prior_visible_read():
from app.services.market_freight import get_freight_detail, update_freight
db = _session()
+1
View File
@@ -425,6 +425,7 @@ def test_progress_counts_confirmed_transfers_from_void_schedules_like_web():
assert unpaid_total == 1
assert [item['id'] for item in unpaid] == ['sp-void-unpaid']
assert unpaid[0]['progressStatus'] == 'dfj'
assert unpaid[0]['paymentProgress'] == '待缴费'
assert unpaid[0]['paidAmount'] == '0.00'
assert unpaid[0]['activeScheduleCount'] == 0
assert partial_total == 1
+2 -2
View File
@@ -1900,7 +1900,7 @@ def test_freight_detail_exposes_only_scope_safe_link_actions():
specialist = decorate_allowed_actions(
'freight',
{'id': 'f1', 'allowedActions': ['edit', 'link', 'unlink']},
{'id': 'f1', 'allowedActions': ['edit', 'delete', 'link', 'unlink']},
scope_kind='specialist',
detail=True,
)
@@ -1910,7 +1910,7 @@ def test_freight_detail_exposes_only_scope_safe_link_actions():
scope_kind='manager',
detail=True,
)
assert specialist['allowedActions'] == ['edit', 'link', 'unlink']
assert specialist['allowedActions'] == ['edit', 'delete', 'link', 'unlink']
assert manager['allowedActions'] == ['link', 'unlink']
+40 -89
View File
@@ -332,15 +332,6 @@ def _route_strict_codes(router, endpoint_name):
@pytest.mark.parametrize(
("module_name", "endpoint_names", "expected_codes"),
[
(
"collection_protocol",
[
"create_collection_protocol",
"update_collection_protocol",
"delete_collection_protocol",
],
{PROTOCOL_LIST},
),
(
"research_donation",
[
@@ -351,11 +342,6 @@ def _route_strict_codes(router, endpoint_name):
],
{PROTOCOL_LIST},
),
(
"collection_protocol",
["submit_collection_protocol_audit"],
{PROTOCOL_AUDIT},
),
(
"research_donation",
[
@@ -366,11 +352,6 @@ def _route_strict_codes(router, endpoint_name):
],
{PROTOCOL_AUDIT},
),
(
"collection_protocol",
["post_receipt_confirm", "post_receipt_reject"],
{PAYMENT_CONFIRM},
),
(
"protocol_sample_payment",
["confirm_payment_transfer", "reject_payment_transfer"],
@@ -381,21 +362,6 @@ def _route_strict_codes(router, endpoint_name):
["confirm_presign_transfer", "reject_presign_transfer"],
{PAYMENT_CONFIRM},
),
(
"collection_protocol",
["post_protocol_invoice_request", "complete_protocol_invoice_request"],
{PAYMENT_CONFIRM},
),
(
"collection_protocol",
[
"post_submit_refund_finance",
"post_submit_refund_finance_batch",
"post_refund_confirm",
"post_refund_reject",
],
{REFUND_CONFIRM},
),
(
"protocol_refund_record",
[
@@ -405,15 +371,6 @@ def _route_strict_codes(router, endpoint_name):
],
{REFUND_CONFIRM},
),
(
"collection_protocol",
[
"update_fullmoon_todo_insurance",
"update_storage_cert_handle",
"update_fullmoon_todo_handle",
],
{STORAGE_CERT},
),
(
"sample_cert_insurance",
["put_sample_storage_cert", "put_sample_insurance"],
@@ -434,11 +391,36 @@ def test_sensitive_write_routes_declare_strict_menu_dependencies(
assert _route_strict_codes(module.router, endpoint_name) == expected_codes
def test_collection_protocol_write_paths_assert_sensitive_field_permissions():
def test_collection_protocol_write_routes_have_no_strict_menu_dependencies():
"""采集协议单接口仅保留运营端登录守卫,不再挂菜单权限码。"""
from app.api import collection_protocol
write_endpoints = [
"create_collection_protocol",
"update_collection_protocol",
"delete_collection_protocol",
"submit_collection_protocol_audit",
"post_receipt_confirm",
"post_receipt_reject",
"post_protocol_invoice_request",
"complete_protocol_invoice_request",
"post_submit_refund_finance",
"post_submit_refund_finance_batch",
"post_refund_confirm",
"post_refund_reject",
"update_fullmoon_todo_insurance",
"update_storage_cert_handle",
"update_fullmoon_todo_handle",
]
for endpoint_name in write_endpoints:
assert _route_strict_codes(collection_protocol.router, endpoint_name) == set()
def test_collection_protocol_write_paths_keep_payment_detail_guard_only():
source = Path("app/api/collection_protocol.py").read_text()
assert "assert_protocol_sensitive_fields" in source
assert PROTOCOL_AUDIT in source
assert STORAGE_CERT in source
assert "require_strict_menu_code" not in source
assert "assert_strict_menu_code" not in source
def test_research_donation_write_paths_assert_sensitive_field_permissions():
@@ -485,7 +467,7 @@ def _permission_user(db, *codes):
return {"user_id": "u1", "tenant_no": "tenant-a", "role": "admin"}
def test_protocol_sensitive_fields_require_dedicated_permissions():
def test_protocol_sensitive_fields_no_longer_require_menu_permissions():
from app.api.collection_protocol import (
ProtocolCreateBody,
ProtocolUpdateBody,
@@ -495,39 +477,16 @@ def test_protocol_sensitive_fields_require_dedicated_permissions():
db = _session()
user = _permission_user(db)
assert_protocol_sensitive_fields(db, user, ProtocolCreateBody(), creating=True)
with pytest.raises(HTTPException) as status_error:
assert_protocol_sensitive_fields(
db,
user,
ProtocolCreateBody(protocolStatus="sxz"),
creating=True,
)
assert status_error.value.status_code == 403
with pytest.raises(HTTPException) as storage_error:
assert_protocol_sensitive_fields(
db,
user,
ProtocolUpdateBody(storageCert={}),
creating=False,
)
assert storage_error.value.status_code == 403
def test_protocol_sensitive_fields_allow_union_of_dedicated_permissions():
from app.api.collection_protocol import (
ProtocolUpdateBody,
assert_protocol_sensitive_fields,
)
db = _session()
user = _permission_user(db, PROTOCOL_AUDIT, STORAGE_CERT)
assert_protocol_sensitive_fields(
db,
user,
ProtocolUpdateBody(protocolStatus="sxz", storageCert={}),
ProtocolCreateBody(protocolStatus="sxz"),
creating=True,
)
assert_protocol_sensitive_fields(
db,
user,
ProtocolUpdateBody(storageCert={}),
creating=False,
)
@@ -554,8 +513,11 @@ def test_donation_sensitive_fields_require_audit_permission():
def test_market_only_user_is_stopped_before_sensitive_crud(monkeypatch):
"""其它仍挂菜单码的写接口:仅有小程序市场权限时仍应 403。
采集协议单接口已按方案去掉菜单码,不在本用例断言范围内。
"""
from app.api import (
collection_protocol,
protocol_refund_record,
protocol_sample_payment,
sample_cert_insurance,
@@ -583,10 +545,6 @@ def test_market_only_user_is_stopped_before_sensitive_crud(monkeypatch):
called.append((args, kwargs))
raise AssertionError("sensitive CRUD must not be called")
monkeypatch.setattr(
collection_protocol.cp_svc, "create_collection_protocol", forbidden_call
)
monkeypatch.setattr(collection_protocol.cp_svc, "create_audit", forbidden_call)
monkeypatch.setattr(
protocol_sample_payment.psp_svc, "confirm_receipt", forbidden_call
)
@@ -600,7 +558,6 @@ def test_market_only_user_is_stopped_before_sensitive_crud(monkeypatch):
app = FastAPI()
for router in (
collection_protocol.router,
protocol_sample_payment.router,
protocol_refund_record.router,
sample_cert_insurance.router,
@@ -617,12 +574,6 @@ def test_market_only_user_is_stopped_before_sensitive_crud(monkeypatch):
app.dependency_overrides[get_db] = override_db
requests = [
("post", "/web/admin/collection-protocols", {}),
(
"post",
"/web/admin/collection-protocols/p1/audit",
{"auditStatus": "tg"},
),
("post", "/web/admin/payment-transfers/t1/receipt-confirm", {}),
(
"post",
@@ -0,0 +1,491 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<title>运费信息 · 列表卡片样本折叠 Demo</title>
<style>
:root {
--primary: #0a9f6d;
--primary-dark: #087f57;
--primary-soft: #e9f9f2;
--text: #18332a;
--muted: #6b7c74;
--border: #dce8e2;
--surface: #fff;
--page: #f3f6f5;
--money: #c98312;
}
* { box-sizing: border-box; }
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
font-size: 14px;
line-height: 1.5;
color: var(--text);
background: var(--page);
}
.page {
max-width: 420px;
margin: 0 auto;
padding: 20px 14px 48px;
}
.hero {
margin-bottom: 18px;
}
.hero h1 {
margin: 0 0 6px;
font-size: 20px;
font-weight: 700;
}
.hero p {
margin: 0;
color: var(--muted);
font-size: 13px;
}
.section-label {
display: flex;
align-items: center;
justify-content: space-between;
margin: 18px 0 8px;
color: var(--muted);
font-size: 12px;
font-weight: 600;
}
.section-label em {
font-style: normal;
color: var(--primary-dark);
background: var(--primary-soft);
padding: 2px 8px;
border-radius: 999px;
}
.card {
padding: 14px;
border: 1px solid var(--border);
border-radius: 16px;
background: var(--surface);
box-shadow: 0 6px 20px rgb(8 127 87 / 7%);
}
.card + .card { margin-top: 12px; }
.head {
display: flex;
align-items: center;
gap: 10px;
padding-bottom: 12px;
border-bottom: 1px solid #eef4f1;
}
.index {
display: grid;
width: 30px;
height: 30px;
flex: 0 0 30px;
place-items: center;
border-radius: 50%;
background: var(--primary-soft);
color: var(--primary-dark);
font-size: 13px;
font-weight: 700;
}
.identity {
min-width: 0;
flex: 1;
display: flex;
flex-direction: column;
gap: 3px;
}
.title {
overflow: hidden;
font-size: 16px;
font-weight: 700;
text-overflow: ellipsis;
white-space: nowrap;
}
.subtitle {
overflow: hidden;
color: var(--muted);
font-size: 12px;
text-overflow: ellipsis;
white-space: nowrap;
}
.tag {
display: inline-flex;
max-width: 128px;
align-self: center;
padding: 5px 12px;
overflow: hidden;
border-radius: 999px;
background: var(--primary-soft);
color: var(--primary-dark);
font-size: 12px;
line-height: 1.3;
text-overflow: ellipsis;
white-space: nowrap;
}
.tag.warn {
background: #fff7e8;
color: #b45309;
}
.fields {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 12px 16px;
padding: 14px 0;
}
.field {
display: flex;
min-width: 0;
flex-direction: column;
gap: 4px;
color: var(--muted);
font-size: 12px;
}
.field.wide { grid-column: 1 / -1; }
.field b {
color: var(--text);
font-weight: 500;
overflow-wrap: anywhere;
}
.field b.money {
color: var(--money);
font-size: 15px;
font-weight: 700;
}
/* —— 样本折叠区 —— */
.samples {
margin: 0 0 12px;
border: 1px solid #eef4f1;
border-radius: 12px;
background: #fafcfb;
overflow: hidden;
}
.samples__toggle {
display: flex;
width: 100%;
min-height: 44px;
align-items: center;
gap: 8px;
padding: 10px 12px;
border: 0;
background: transparent;
color: var(--text);
font: inherit;
text-align: left;
cursor: pointer;
}
.samples__toggle:active { background: #f0f7f3; }
.samples__toggle-icon {
display: grid;
width: 22px;
height: 22px;
flex: 0 0 22px;
place-items: center;
border-radius: 6px;
background: var(--primary-soft);
color: var(--primary-dark);
font-size: 12px;
transition: transform 0.2s ease;
}
.samples.is-open .samples__toggle-icon {
transform: rotate(90deg);
}
.samples__toggle-title {
flex: 1;
font-size: 13px;
font-weight: 600;
}
.samples__toggle-meta {
color: var(--muted);
font-size: 12px;
}
.samples__chevron {
color: var(--muted);
font-size: 12px;
transition: transform 0.2s ease;
}
.samples.is-open .samples__chevron {
transform: rotate(180deg);
}
.samples__body {
display: none;
padding: 0 10px 10px;
border-top: 1px solid #eef4f1;
}
.samples.is-open .samples__body { display: block; }
.sample-block {
margin-top: 10px;
padding: 10px;
border-radius: 10px;
background: #fff;
border: 1px solid #eef4f1;
}
.sample-block__head {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
margin-bottom: 8px;
}
.sample-block__title {
font-size: 13px;
font-weight: 600;
}
.sample-block .fields {
padding: 0;
gap: 10px 12px;
}
.privacy {
display: flex;
min-height: 36px;
align-items: center;
gap: 6px;
margin: 0 0 12px;
padding: 0 10px;
border-radius: 9px;
background: #f6f7f7;
color: var(--muted);
font-size: 12px;
}
.actions {
display: flex;
flex-wrap: wrap;
justify-content: flex-end;
gap: 8px;
padding-top: 12px;
border-top: 1px solid #eef4f1;
}
.btn {
min-width: 76px;
min-height: 44px;
padding: 0 14px;
border-radius: 9px;
border: 1px solid var(--border);
background: #fff;
color: var(--text);
font-size: 13px;
cursor: pointer;
}
.btn.primary {
border-color: var(--primary);
background: var(--primary);
color: #fff;
}
.btn.danger {
border-color: #f3c4c4;
color: #c0392b;
}
.hint {
margin-top: 16px;
padding: 12px 14px;
border-radius: 12px;
background: #fff;
border: 1px dashed var(--border);
color: var(--muted);
font-size: 12px;
}
.hint strong { color: var(--text); }
</style>
</head>
<body>
<div class="page">
<header class="hero">
<h1>运费卡片 · 样本折叠</h1>
<p>默认折叠样本区,点击可展开/收起。对齐市场 H5 卡片视觉。</p>
</header>
<div class="section-label">
<span>改后(默认折叠)</span>
<em>推荐</em>
</div>
<!-- 卡片 1:折叠态 -->
<article class="card" data-demo-card>
<header class="head">
<span class="index">1</span>
<span class="identity">
<strong class="title">YF20261014001</strong>
<small class="subtitle">专线车 · ¥1,280.00</small>
</span>
<span class="tag">细胞存储</span>
</header>
<div class="fields">
<div class="field wide"><span>批次号</span><b>YF20261014001</b></div>
<div class="field"><span>运输方式</span><span class="tag">专线车</span></div>
<div class="field"><span>运费金额</span><b class="money">¥1,280.00</b></div>
<div class="field"><span>关联数</span><b>5</b></div>
<div class="field"><span>创建人</span><b>张专员</b></div>
<div class="field"><span>创建时间</span><b>2026-10-14 09:20</b></div>
<div class="field wide"><span>备注</span><b>冷链同批次出库</b></div>
</div>
<div class="samples" data-samples>
<button type="button" class="samples__toggle" aria-expanded="false">
<span class="samples__toggle-icon">样</span>
<span class="samples__toggle-title">关联样本(5)</span>
<span class="samples__toggle-meta">点击展开</span>
<span class="samples__chevron">▾</span>
</button>
<div class="samples__body">
<div class="sample-block">
<div class="sample-block__head">
<span class="sample-block__title">样本 1 · S-10021</span>
<span class="tag">细胞存储</span>
</div>
<div class="fields">
<div class="field wide"><span>协议号</span><b>XY20261008012</b></div>
<div class="field"><span>母亲姓名</span><b>王晓敏</b></div>
<div class="field"><span>子女姓名</span><b>宝宝甲</b></div>
<div class="field wide"><span>样本类型</span><b>脐带血</b></div>
</div>
</div>
<div class="sample-block">
<div class="sample-block__head">
<span class="sample-block__title">样本 2 · S-10022</span>
<span class="tag">细胞存储</span>
</div>
<div class="fields">
<div class="field wide"><span>协议号</span><b>XY20261008018</b></div>
<div class="field"><span>母亲姓名</span><b>李婷</b></div>
<div class="field"><span>子女姓名</span><b>宝宝乙</b></div>
<div class="field wide"><span>样本类型</span><b>脐带</b></div>
</div>
</div>
<div class="sample-block">
<div class="sample-block__head">
<span class="sample-block__title">样本 3 · S-10023</span>
<span class="tag warn">科研捐赠</span>
</div>
<div class="fields">
<div class="field wide"><span>协议号</span><b>XY20261009003</b></div>
<div class="field"><span>母亲姓名</span><b>周雨桐</b></div>
<div class="field"><span>子女姓名</span><b>宝宝丙</b></div>
<div class="field wide"><span>样本类型</span><b>胎盘</b></div>
</div>
</div>
<div class="sample-block">
<div class="sample-block__head">
<span class="sample-block__title">样本 4 · S-10024</span>
<span class="tag">细胞存储</span>
</div>
<div class="fields">
<div class="field wide"><span>协议号</span><b>XY20261010007</b></div>
<div class="field"><span>母亲姓名</span><b>陈思琪</b></div>
<div class="field"><span>子女姓名</span><b>宝宝丁</b></div>
<div class="field wide"><span>样本类型</span><b>脐带血</b></div>
</div>
</div>
<div class="sample-block">
<div class="sample-block__head">
<span class="sample-block__title">样本 5 · S-10025</span>
<span class="tag">细胞存储</span>
</div>
<div class="fields">
<div class="field wide"><span>协议号</span><b>XY20261011002</b></div>
<div class="field"><span>母亲姓名</span><b>赵倩</b></div>
<div class="field"><span>子女姓名</span><b>宝宝戊</b></div>
<div class="field wide"><span>样本类型</span><b>脐带</b></div>
</div>
</div>
</div>
</div>
<p class="privacy">仅展示当前权限范围内的关联样本</p>
<footer class="actions">
<button type="button" class="btn">编辑</button>
<button type="button" class="btn">关联样本</button>
<button type="button" class="btn danger">取消关联</button>
</footer>
</article>
<!-- 卡片 2:默认已展开,方便对比 -->
<div class="section-label">
<span>展开态示意</span>
<em>点击上方卡片可切换</em>
</div>
<article class="card">
<header class="head">
<span class="index">2</span>
<span class="identity">
<strong class="title">YF20261014008</strong>
<small class="subtitle">冷链 · ¥360.00</small>
</span>
<span class="tag">细胞存储</span>
</header>
<div class="fields">
<div class="field wide"><span>批次号</span><b>YF20261014008</b></div>
<div class="field"><span>运输方式</span><span class="tag">冷链</span></div>
<div class="field"><span>运费金额</span><b class="money">¥360.00</b></div>
<div class="field"><span>关联数</span><b>2</b></div>
</div>
<div class="samples is-open" data-samples>
<button type="button" class="samples__toggle" aria-expanded="true">
<span class="samples__toggle-icon">样</span>
<span class="samples__toggle-title">关联样本(2)</span>
<span class="samples__toggle-meta">点击收起</span>
<span class="samples__chevron">▾</span>
</button>
<div class="samples__body">
<div class="sample-block">
<div class="sample-block__head">
<span class="sample-block__title">样本 1 · S-20001</span>
<span class="tag">细胞存储</span>
</div>
<div class="fields">
<div class="field wide"><span>协议号</span><b>XY20261012001</b></div>
<div class="field"><span>母亲姓名</span><b>孙悦</b></div>
<div class="field"><span>子女姓名</span><b>宝宝己</b></div>
<div class="field wide"><span>样本类型</span><b>脐带血</b></div>
</div>
</div>
<div class="sample-block">
<div class="sample-block__head">
<span class="sample-block__title">样本 2 · S-20002</span>
<span class="tag">细胞存储</span>
</div>
<div class="fields">
<div class="field wide"><span>协议号</span><b>XY20261012005</b></div>
<div class="field"><span>母亲姓名</span><b>吴芳</b></div>
<div class="field"><span>子女姓名</span><b>宝宝庚</b></div>
<div class="field wide"><span>样本类型</span><b>脐带</b></div>
</div>
</div>
</div>
</div>
<footer class="actions">
<button type="button" class="btn primary">查看</button>
<button type="button" class="btn">编辑</button>
</footer>
</article>
<div class="hint">
<strong>交互说明:</strong>默认折叠,只占一行摘要;展开后按样本分块展示。无样本时不显示该区域。
文件路径:<code>docs/demos/2026-10-14-freight-card-sample-collapse-demo.html</code>
</div>
</div>
<script>
document.querySelectorAll('[data-samples]').forEach((panel) => {
const btn = panel.querySelector('.samples__toggle')
const meta = panel.querySelector('.samples__toggle-meta')
btn.addEventListener('click', () => {
const open = panel.classList.toggle('is-open')
btn.setAttribute('aria-expanded', open ? 'true' : 'false')
if (meta) meta.textContent = open ? '点击收起' : '点击展开'
})
})
</script>
</body>
</html>
@@ -0,0 +1,684 @@
# Market ↔ Storage Tag Parity Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** 以 `web-admin/src/utils/status-tag-registry.ts` 为唯一基准,对齐 Web 存储服务 5 页与小程序市场部 5 模块的 Tag 文案、码值与语义色。
**Architecture:** Web 先补齐注册表并改掉页面硬编码;`mobile-oa-h5` 新增镜像注册表 + `resolveStatusTag`,列表/详情优先使用显式 `tagType`;保留 `.market-tag` pill 外形,不改 Element 视觉。`mobile-h5` 仅 WebView 壳,不改业务 Tag。
**Tech Stack:** Vue 3, Element Plus, Vant 4, TypeScript/JS, Node.js `node:test`
**Spec:** `docs/superpowers/specs/2026-10-15-market-storage-tag-parity-design.md`
---
## File map
| File | Responsibility |
|------|----------------|
| `web-admin/src/utils/status-tag-registry.ts` | 新增 `paymentScheduleStatus`;权威源 |
| `web-admin/src/views/cell-storage/payment-info/PaymentBySampleTab.vue` | W5:改用注册表 |
| `web-admin/src/views/cell-storage/protocol/ProtocolViewDialog.vue` | W1/W2:payMode / auditStatus |
| `web-admin/src/views/cell-storage/sample-freight/index.vue` | W3/W4:运输方式 / 来源 |
| `web-admin/src/views/cell-storage/sample-freight/FreightConfigDialog.vue` | W4:来源 Tag |
| `mobile-oa-h5/src/market/status-tag-registry.js` | 新建:本范围镜像 + resolve |
| `mobile-oa-h5/src/market/status-tag-registry.test.js` | 新建:码→label/tagType 契约 |
| `mobile-oa-h5/src/market/list-presenter.js` | 列表头 statusTone / 字段 tagType |
| `mobile-oa-h5/src/market/modules/payment.js` | 进度/期次/转账走镜像 |
| `mobile-oa-h5/src/market/modules/protocol.js` | 协议/审核/转账走镜像 |
| `mobile-oa-h5/src/market/modules/freight.js` | 来源/运输走镜像 |
| `mobile-oa-h5/src/market/presign/presign-presenter.js` | draft tone `info`;payMode 全码 |
| `mobile-oa-h5/src/market/modules/presign.js` | payStatus tone 对齐 |
| `mobile-oa-h5/src/market/components/MarketListCard.vue` | 字段优先 `field.tagType` |
| `mobile-oa-h5/src/market/components/MarketDetailSection.vue` | 字段优先显式 tagType |
| `mobile-oa-h5/src/market/list-presenter.test.js` | 列表进度/色断言 |
| `mobile-oa-h5/src/market/module-contracts.test.js` | 详情契约 |
| `mobile-oa-h5/src/market/presign/presign-presenter.test.js` | 预签 tone |
| `backend/app/services/market_payment.py` | 若仍有「待缴费草稿」指转账 dfj,改文案为「已付款」(可选小步) |
---
### Task 1: Web — 注册表增加 `paymentScheduleStatus`
**Files:**
- Modify: `web-admin/src/utils/status-tag-registry.ts`(紧挨 `samplePaymentProgress` 之后插入)
- Modify: `web-admin/src/views/cell-storage/payment-info/PaymentBySampleTab.vue`
- [ ] **Step 1: 在注册表新增枚举与 getter**
在 `samplePaymentProgressTagType` 导出之后插入:
```ts
/** 应缴批次 scheduleStatus(勿与样本进度 samplePaymentProgress 混用:open=待缴清,dfj=待缴费) */
export const paymentScheduleStatus: StatusRegistry = {
open: { label: '待缴清', tagType: 'warning' },
cleared: { label: '已缴清', tagType: 'success' },
void: { label: '已作废', tagType: 'info' }
}
export const paymentScheduleStatusLabel = createLabelGetter(paymentScheduleStatus)
export const paymentScheduleStatusTagType = createTagTypeGetter(paymentScheduleStatus)
```
- [ ] **Step 2: PaymentBySampleTab 改用注册表**
在 import 中增加:
```ts
paymentScheduleStatusLabel,
paymentScheduleStatusTagType,
```
删除本地函数 `paymentScheduleStatusLabel` / `paymentScheduleStatusTagType` 的实现;模板仍调用同名导入函数。
- [ ] **Step 3: 快速自检**
在 `web-admin` 目录执行(若项目无单测可跳过,改为人工打开缴费信息详情看期次 Tag):
```bash
# 确认符号可被 TypeScript 解析
pnpm exec vue-tsc --noEmit 2>&1 | head -40
```
预期:与本次改动相关无新增报错(既有无关错误可忽略)。
- [ ] **Step 4: Commit**
```bash
git add web-admin/src/utils/status-tag-registry.ts \
web-admin/src/views/cell-storage/payment-info/PaymentBySampleTab.vue
git commit -m "$(cat <<'EOF'
feat(web-admin): add paymentScheduleStatus to status-tag registry
Lift schedule open/cleared/void labels from PaymentBySampleTab so Web and mobile share one source.
EOF
)"
```
---
### Task 2: Web — ProtocolViewDialog W1/W2
**Files:**
- Modify: `web-admin/src/views/cell-storage/protocol/ProtocolViewDialog.vue`
- [ ] **Step 1: 扩展 import**
确保从 `@/utils/status-tag-registry` 导入:
```ts
payModeTagType,
auditStatusTagType,
```
(`payModeLabel` / `auditStatusLabel` 已存在则保留。)
- [ ] **Step 2: 替换样本缴费 payMode Tag(约 581–586 行)**
```vue
<el-tag :type="payModeTagType(String(sp.payMode || ''))" size="small">
{{ payModeLabel(String(sp.payMode || '')) }}
</el-tag>
```
- [ ] **Step 3: 替换协议缴费 payMode Tag(约 826–835 行)**
```vue
<el-tag :type="payModeTagType(String(payment?.payMode || ''))" size="small">
{{ payModeLabel(String(payment?.payMode || '')) }}
</el-tag>
```
- [ ] **Step 4: 替换审核记录 auditStatus Tag(约 1050–1055 行)**
```vue
<el-tag :type="auditStatusTagType(String(row.auditStatus || ''))" size="small">
{{ auditStatusLabel(String(row.auditStatus || '')) }}
</el-tag>
```
- [ ] **Step 5: 确认无残留硬编码**
```bash
rg "payMode.*success|auditStatus.*warning|== 'fq' \? 'warning'" \
web-admin/src/views/cell-storage/protocol/ProtocolViewDialog.vue
```
预期:无匹配(或仅剩无关逻辑)。
- [ ] **Step 6: Commit**
```bash
git add web-admin/src/views/cell-storage/protocol/ProtocolViewDialog.vue
git commit -m "$(cat <<'EOF'
fix(web-admin): use registry tag types for protocol payMode and auditStatus
Align ProtocolViewDialog tags with status-tag-registry instead of hard-coded success/warning.
EOF
)"
```
---
### Task 3: Web — sample-freight W3/W4
**Files:**
- Modify: `web-admin/src/views/cell-storage/sample-freight/index.vue`
- Modify: `web-admin/src/views/cell-storage/sample-freight/FreightConfigDialog.vue`
- [ ] **Step 1: index.vue 导入注册表**
```ts
import {
receptionSourceLabel,
receptionSourceTagType,
transportTypeLabel,
transportTypeTagType
} from '@/utils/status-tag-registry'
```
- [ ] **Step 2: 运输方式列(去掉 plain + 按码取色)**
```vue
<template #default="{ row }">
<el-tag
v-if="row.transportMode || row.transportModeLabel"
:type="transportTypeTagType(String(row.transportMode || ''))"
size="small"
>
{{ row.transportModeLabel || transportTypeLabel(String(row.transportMode || '')) || '—' }}
</el-tag>
<span v-else class="muted">—</span>
</template>
```
说明:若 `transportMode` 为空但有 label,`transportTypeTagType('')` 回落 `info`,可接受。
- [ ] **Step 3: 来源列**
```vue
<template #default="{ row }">
<el-tag
v-if="row.sampleSource"
:type="receptionSourceTagType(String(row.sampleSource || ''))"
size="small"
>
{{ receptionSourceLabel(String(row.sampleSource || '')) }}
</el-tag>
<span v-else class="muted">—</span>
</template>
```
- [ ] **Step 4: FreightConfigDialog 来源列同样改造**
删除 `row.sampleSource === 'cell_storage' ? 'success' : 'warning'` 与手写中文,改为 `receptionSourceTagType` / `receptionSourceLabel`。
- [ ] **Step 5: Commit**
```bash
git add web-admin/src/views/cell-storage/sample-freight/index.vue \
web-admin/src/views/cell-storage/sample-freight/FreightConfigDialog.vue
git commit -m "$(cat <<'EOF'
fix(web-admin): align freight source and transport tags with registry
Use receptionSource and transportType tag types instead of hard-coded success/primary plain.
EOF
)"
```
---
### Task 4: mobile-oa-h5 — 镜像注册表 + 失败测试
**Files:**
- Create: `mobile-oa-h5/src/market/status-tag-registry.js`
- Create: `mobile-oa-h5/src/market/status-tag-registry.test.js`
- [ ] **Step 1: 先写失败测试**
```js
import test from 'node:test'
import assert from 'node:assert/strict'
import {
resolveStatusTag,
samplePaymentProgress,
paymentScheduleStatus,
payStatus,
payMode,
presignOrderStatus,
receptionSource,
transportType,
auditStatus
} from './status-tag-registry.js'
test('sample progress dfj is 待缴费/info not 待缴清', () => {
assert.deepEqual(resolveStatusTag(samplePaymentProgress, 'dfj'), {
label: '待缴费',
tagType: 'info'
})
})
test('schedule open is 待缴清/warning', () => {
assert.deepEqual(resolveStatusTag(paymentScheduleStatus, 'open'), {
label: '待缴清',
tagType: 'warning'
})
})
test('payStatus dfj is 已付款/primary', () => {
assert.deepEqual(resolveStatusTag(payStatus, 'dfj'), {
label: '已付款',
tagType: 'primary'
})
})
test('payMode covers djfq and fgd as warning', () => {
assert.equal(resolveStatusTag(payMode, 'dj').tagType, 'primary')
assert.equal(resolveStatusTag(payMode, 'djfq').tagType, 'warning')
assert.equal(resolveStatusTag(payMode, 'fgd').label, '分改趸')
})
test('presign draft uses info not default', () => {
assert.deepEqual(resolveStatusTag(presignOrderStatus, 'draft'), {
label: '草稿',
tagType: 'info'
})
})
test('freight source cell_storage is primary', () => {
assert.equal(resolveStatusTag(receptionSource, 'cell_storage').tagType, 'primary')
assert.equal(resolveStatusTag(transportType, 'kdys').tagType, 'info')
assert.equal(resolveStatusTag(transportType, 'ryxd').tagType, 'success')
})
test('audit shth is danger', () => {
assert.equal(resolveStatusTag(auditStatus, 'shth').tagType, 'danger')
})
test('progress alias 待缴清 normalizes to 待缴费', () => {
assert.equal(resolveStatusTag(samplePaymentProgress, '待缴清').label, '待缴费')
})
```
- [ ] **Step 2: 运行确认失败**
```bash
cd mobile-oa-h5 && node --test src/market/status-tag-registry.test.js
```
预期:FAIL(模块不存在)。
- [ ] **Step 3: 实现 `status-tag-registry.js`**
文件头注释:`// Mirror of web-admin/src/utils/status-tag-registry.ts (market scope). Keep in sync manually.`
实现要点:
```js
function createRegistry(entries) {
return Object.freeze(
Object.fromEntries(
Object.entries(entries).map(([code, item]) => [code, Object.freeze({ ...item })])
)
)
}
export function resolveStatusTag(registry, code, aliases = {}) {
const raw = String(code ?? '').trim()
if (!raw) return { label: '—', tagType: 'info' }
const mapped = aliases[raw] || raw
const hit = registry[mapped]
if (hit) return { label: hit.label, tagType: hit.tagType }
// Chinese pass-through already in registry as alias keys, else:
if (/[\u4e00-\u9fff]/.test(raw)) return { label: raw, tagType: 'info' }
return { label: '未知', tagType: 'info' }
}
export const samplePaymentProgress = createRegistry({
dfj: { label: '待缴费', tagType: 'info' },
bfyj: { label: '部分已缴', tagType: 'primary' },
yjq: { label: '已缴清', tagType: 'success' },
待缴费: { label: '待缴费', tagType: 'info' },
待缴清: { label: '待缴费', tagType: 'info' }, // progress-only alias
部分已缴: { label: '部分已缴', tagType: 'primary' },
部分缴费: { label: '部分已缴', tagType: 'primary' },
已缴清: { label: '已缴清', tagType: 'success' }
})
export const paymentScheduleStatus = createRegistry({
open: { label: '待缴清', tagType: 'warning' },
cleared: { label: '已缴清', tagType: 'success' },
void: { label: '已作废', tagType: 'info' },
pending: { label: '待缴清', tagType: 'warning' }, // mobile-only alias → open
paid: { label: '已缴清', tagType: 'success' },
partial: { label: '部分到账', tagType: 'primary' },
closed: { label: '已关闭', tagType: 'info' }
})
// 同样 createRegistry:protocolStatus, donationStatus, payMode, payStatus,
// paymentChaseStatus, auditStatus, transportType, receptionSource (前两项即可),
// presignOrderStatus, transferType — 值与 Web 注册表一致;presign draft.tagType = 'info'
```
导出全部本范围 registry 常量。
- [ ] **Step 4: 再跑测试**
```bash
cd mobile-oa-h5 && node --test src/market/status-tag-registry.test.js
```
预期:全部 PASS。
- [ ] **Step 5: Commit**
```bash
git add mobile-oa-h5/src/market/status-tag-registry.js \
mobile-oa-h5/src/market/status-tag-registry.test.js
git commit -m "$(cat <<'EOF'
feat(mobile-oa-h5): add market status-tag registry mirror
Mirror Web status-tag-registry for market modules with resolveStatusTag and parity tests.
EOF
)"
```
---
### Task 5: mobile-oa-h5 — 缴费 / 列表 presenter 收口(M1/M3/M5/M7)
**Files:**
- Modify: `mobile-oa-h5/src/market/modules/payment.js`
- Modify: `mobile-oa-h5/src/market/list-presenter.js`
- Modify: `mobile-oa-h5/src/market/list-presenter.test.js`
- Modify: `mobile-oa-h5/src/market/module-contracts.test.js`
- Modify: `mobile-oa-h5/src/market/components/MarketListCard.vue`
- [ ] **Step 1: payment.js 用镜像替换本地 PAYMENT_PROGRESS / SCHEDULE_STATUS / PAY_STATUS / PAY_MODE**
```js
import {
resolveStatusTag,
samplePaymentProgress,
paymentScheduleStatus,
payStatus,
payMode,
protocolStatus
} from '../status-tag-registry.js'
function progressTag(code) {
return resolveStatusTag(samplePaymentProgress, code)
}
// scheduleCard / transferCard / detailSections 中:
// value: progressTag(...).label
// tag: true, tagType: progressTag(...).tagType
// 筛选项 text 用 samplePaymentProgress.dfj.label 等
```
删除旧的 `PAYMENT_PROGRESS` / `SCHEDULE_STATUS` / `PAY_STATUS` 对象(协议状态可继续用 `protocolStatus`)。
- [ ] **Step 2: list-presenter paymentCard**
```js
import { resolveStatusTag, samplePaymentProgress, payMode } from './status-tag-registry.js'
function paymentProgressText(item) {
const raw = item?.progressStatus || item?.paymentProgress || item?.progress
if (raw != null && String(raw).trim()) {
return resolveStatusTag(samplePaymentProgress, raw).label
}
return Number(item?.paidAmount || 0) > 0 ? '部分已缴' : '待缴费'
}
function paymentCard(item) {
const progress = paymentProgressText(item)
const progressTone = resolveStatusTag(
samplePaymentProgress,
item?.progressStatus || item?.paymentProgress || progress
).tagType
return {
title: text(item.motherName),
subtitle: text(item.sampleCode),
status: progress,
statusTone: progressTone,
fields: [
// …
field('缴费方式', resolveStatusTag(payMode, item.payMode).label, {
tag: true,
tagType: resolveStatusTag(payMode, item.payMode).tagType
}),
// …
],
// periodBlocks / footerFields 保持既有结构
}
}
```
确保 `field()` helper 能透传 `tagType`。
- [ ] **Step 3: MarketListCard 优先 field.tagType / card.statusTone**
```js
const statusTone = computed(() =>
props.card.statusTone || resolveStatusTone(props.card.status)
)
// 模板字段:
:type="field.tagType || resolveStatusTone(field.value)"
```
头 Tag:`:type="statusTone"`。
- [ ] **Step 4: 更新 / 补充测试**
`list-presenter.test.js`:已有 dfj / 待缴清 → 待缴费;增加:
```js
assert.equal(
buildMarketCard('payment', 'specialist', { progressStatus: 'dfj', paidAmount: '0' }).statusTone,
'info'
)
```
`module-contracts.test.js`:详情缴费进度字段带 `tagType: 'info'`(若 adapter 输出 tagType)。
- [ ] **Step 5: 跑测**
```bash
cd mobile-oa-h5 && node --test \
src/market/status-tag-registry.test.js \
src/market/list-presenter.test.js \
src/market/module-contracts.test.js
```
预期:PASS。
- [ ] **Step 6: Commit**
```bash
git add mobile-oa-h5/src/market/modules/payment.js \
mobile-oa-h5/src/market/list-presenter.js \
mobile-oa-h5/src/market/list-presenter.test.js \
mobile-oa-h5/src/market/module-contracts.test.js \
mobile-oa-h5/src/market/components/MarketListCard.vue
git commit -m "$(cat <<'EOF'
fix(mobile-oa-h5): align payment list/detail tags with registry mirror
Prefer progressStatus codes and explicit tagType over Chinese heuristics.
EOF
)"
```
---
### Task 6: mobile-oa-h5 — 协议 / 催缴 Tag 收口
**Files:**
- Modify: `mobile-oa-h5/src/market/modules/protocol.js`
- Modify: `mobile-oa-h5/src/market/modules/payment-chase.js`(若有状态文案)
- Modify: `mobile-oa-h5/src/market/list-presenter.js`(协议卡 statusTone)
- Modify: `mobile-oa-h5/src/market/protocol-sample-transfer.js`(补全 payStatus)
- [ ] **Step 1: protocol.js**
用镜像 `protocolStatus` / `donationStatus` / `payMode` / `payStatus` / `paymentScheduleStatus` / `auditStatus` 替换本地 LABEL 常量;详情字段输出 `tagType`。
- [ ] **Step 2: protocol-sample-transfer.js**
`PAY_STATUS_LABELS` 改为调用 `resolveStatusTag(payStatus, code)`,覆盖 `tfqrz`/`ytf`。
- [ ] **Step 3: 协议列表卡**
`list-presenter` 协议卡:`statusTone` 用 `resolveStatusTag(protocolStatus|donationStatus, code).tagType`(作废带 voidType 时仍以码取色)。
- [ ] **Step 4: 跑相关测试并 Commit**
```bash
cd mobile-oa-h5 && node --test src/market/module-contracts.test.js src/market/list-presenter.test.js
git add mobile-oa-h5/src/market/modules/protocol.js \
mobile-oa-h5/src/market/modules/payment-chase.js \
mobile-oa-h5/src/market/list-presenter.js \
mobile-oa-h5/src/market/protocol-sample-transfer.js
git commit -m "$(cat <<'EOF'
fix(mobile-oa-h5): align protocol and chase tags with registry mirror
EOF
)"
```
---
### Task 7: mobile-oa-h5 — 预签约 + 运费(M2/M4/M6)
**Files:**
- Modify: `mobile-oa-h5/src/market/presign/presign-presenter.js`
- Modify: `mobile-oa-h5/src/market/presign/presign-presenter.test.js`
- Modify: `mobile-oa-h5/src/market/presign/presign-list-model.js`
- Modify: `mobile-oa-h5/src/market/modules/presign.js`
- Modify: `mobile-oa-h5/src/market/components/PresignTransferCard.vue`(若本地 tone 表)
- Modify: `mobile-oa-h5/src/market/modules/freight.js`
- Modify: `mobile-oa-h5/src/market/list-presenter.js`(运费卡)
- [ ] **Step 1: 预签失败测试**
在 `presign-presenter.test.js` 增加:
```js
assert.equal(presignStatusTone('draft'), 'info')
assert.notEqual(presignStatusTone('draft'), 'default')
```
跑测预期 FAIL(当前为 `default`)。
- [ ] **Step 2: 实现**
`presign-presenter.js`:改用 `presignOrderStatus` 镜像,或把 `draft.tone` 改为 `'info'`,未知回落 `'info'`。
`modules/presign.js`:`payMode` 用全量注册表;`paymentStatus` 的 `tone: 'default'` 改为对应 `payStatus.tagType`(dfj→primary,ytf→danger)。
- [ ] **Step 3: 运费**
列表头来源 / 运输字段:
```js
resolveStatusTag(receptionSource, item.sampleSource)
resolveStatusTag(transportType, item.transportMode)
```
详情 `tagType` 同步;文案优先后端 `transportModeLabel`,色仍按码。
- [ ] **Step 4: 跑测 + Commit**
```bash
cd mobile-oa-h5 && node --test \
src/market/presign/presign-presenter.test.js \
src/market/module-contracts.test.js \
src/market/list-presenter.test.js \
src/market/status-tag-registry.test.js
git add mobile-oa-h5/src/market/presign \
mobile-oa-h5/src/market/modules/presign.js \
mobile-oa-h5/src/market/modules/freight.js \
mobile-oa-h5/src/market/list-presenter.js \
mobile-oa-h5/src/market/components/PresignTransferCard.vue
git commit -m "$(cat <<'EOF'
fix(mobile-oa-h5): align presign and freight tags with registry mirror
Use info for draft; full payMode codes; receptionSource/transportType colors.
EOF
)"
```
---
### Task 8: DetailSection 显式 tagType + 全量回归
**Files:**
- Modify: `mobile-oa-h5/src/market/components/MarketDetailSection.vue`
- Modify: `mobile-oa-h5/src/market/mobile-parity-ui.test.js`(若有 default/plain 约束)
- Optional: `backend/app/services/market_payment.py` 错误文案「仅待缴费草稿」→「仅已付款状态可编辑」
- [ ] **Step 1: MarketDetailSection**
字段渲染:`:type="field.tagType || 'primary'"` 保持,但确保各 module `detailSections` 已传 `tagType`(Task 5–7)。嵌套卡 `statusTone` 已由 section normalizer 计算时,优先传入 registry tone。
- [ ] **Step 2: 全量市场测试**
```bash
cd mobile-oa-h5 && node --test src/market/**/*.test.js
```
预期:PASS。
- [ ] **Step 3: 手工对照清单(验收)**
| 模块 | 检查点 |
|------|--------|
| 缴费信息 | 列表头 dfj=待缴费/info;详情同;期次 open=待缴清/warning;转账 dfj=已付款/primary |
| 催缴 | chase overdue=danger;upcoming=warning |
| 协议 | payMode 趸交=primary;审核退回=danger(若详情展示) |
| 预签约 | draft=info;fgd/djfq 文案正确 |
| 运费 | 细胞存储=primary;快递=info;人员携带=success |
| Web | ProtocolViewDialog / 运费列表 / 缴费期次与上表一致 |
- [ ] **Step 4: 更新图谱(若改了 backend)**
```bash
./scripts/update-graph.sh backend
```
仅前端改动可跳过或按需更新。
- [ ] **Step 5: Final commit(若有收尾)**
```bash
git add mobile-oa-h5/src/market/components/MarketDetailSection.vue \
mobile-oa-h5/src/market/mobile-parity-ui.test.js \
backend/app/services/market_payment.py
git commit -m "$(cat <<'EOF'
fix(mobile-oa-h5): finish tagType wiring for market detail sections
EOF
)"
```
---
## Spec coverage checklist
| Spec 项 | Task |
|---------|------|
| W5 + paymentScheduleStatus | Task 1 |
| W1/W2 | Task 2 |
| W3/W4 | Task 3 |
| 小程序镜像注册表 + resolve | Task 4 |
| M1/M3/M5/M7 缴费列表详情 | Task 5 |
| 协议/催缴 | Task 6 |
| M2/M4/M6 预签/运费 | Task 7 |
| 详情组件 + 验收 | Task 8 |
| mobile-h5 不改 | (无 task,明确跳过) |
| dfj 三义分离 | Task 4 测试 + Task 5 |
---
## Self-review notes
- 无 TBD/TODO 占位。
- `resolveStatusTag(registry, code)` 签名在 Task 4 定义,后续任务沿用。
- 预签 `default`→`info` 在 Task 7 与契约测试中锁定。
- 提交步骤按用户规则:执行时若用户未要求 commit,可跳过各 Task 的 Commit step,改在用户明确要求时再提交。
@@ -0,0 +1,43 @@
# 运费单删除(级联软删)设计
日期:2026-10-14
范围:Web 管理端「运费信息」、市场移动端(专员/经理)「运费信息」
## 背景
此前两端仅有「取消关联(unlink)」;当有效关联清零时部分路径会顺带软删主表,但没有显式「删除运费单」能力。产品需要列表上一键删除整单。
## 决策
1. **语义**:同事务软删 `biz_sample_freight` + 该批次全部 `del_flag=0` 的 `biz_sample_freight_item`(级联解除关联并删除批次)。
2. **市场端权限门禁**:存在当前账号不可见的关联样本时 **禁止删除**(与 `edit` 一致);错误文案提示需全部样本在范围内。
3. **Web 权限**:沿用现有运费页入口(`require_admin_or_super_admin`),**不新增**独立按钮权限码。
4. **批次号**:软删后 `freight_no` 仍占用唯一索引(与现网一致,本轮不回收)。
5. **非目标**:不改协议单内配置/取消运费交互;不做 Web 批量删除。
## 与 unlink 的差异
| | unlink | delete(本能力) |
|--|--------|------------------|
| 目标 | 解除选中(或可见范围内)样本关联 | 废弃整个运费单 |
| Items | 仅软删匹配项 | 软删该批次全部 active items |
| 主表 | 剩余 0 才软删(市场:仅当无任何剩余 active) | 始终软删主表 |
| 市场范围外样本 | 可见解完可不删主表 | **禁止**整单删除 |
## API
- Web:`DELETE /web/admin/sample-freights/{id}`
- Market:`DELETE /mini/market/{specialist|manager}/freights/{id}`
- Market 成功返回:`{ id, visibleItemCount: 0, disappeared: true }`
- Web 成功返回:`{ id, deleted: true, linkedSampleCount: 0 }`
## 前端
- Web:运费列表行内「删除」+ 确认框(说明将解除全部关联)。
- Mobile:列表卡片 / 详情底栏在后端 `allowedActions` 含 `delete` 时展示;确认后 `DELETE`;消失后回列表。
## 实现要点
- 禁止只软删主表而留下 active items(否则 `uk_bsfi_active_sample` 会阻止样本再关联)。
- Market `allowedActions`:全可见时 `['edit','delete','link','unlink']`;有范围外样本时 `['link','unlink']`。
- `decorate_allowed_actions` freight 白名单含 `delete`。
@@ -0,0 +1,197 @@
# 市场部 ↔ 存储服务 Tag 文案/码值/语义色对齐
> 状态:已确认
> 日期:2026-10-15
> 范围:Web「存储服务」对应 5 页 + 小程序「市场部」5 模块
> 对齐深度:文案 + 码值 + Tag 语义色(保留小程序 pill 外形)
> 权威基准:`web-admin/src/utils/status-tag-registry.ts`
> 实现路径:方案 1(注册表收口 + 小程序镜像 + 契约测试)
> 关联:
> - `docs/superpowers/specs/2026-05-19-status-tag-registry-design.md`
> - `docs/superpowers/specs/2026-10-12-payment-status-and-paid-amount-semantics-design.md`(`dfj` 一词两义)
> - `docs/superpowers/specs/2026-10-13-market-five-module-mobile-parity-design.md`
## 1. 背景与目标
### 1.1 问题
1. 小程序市场部列表/详情 Tag 文案与 Web 不一致(例:样本缴费进度 `dfj` 曾显示「待缴清」,Web 为「待缴费」)。
2. 小程序列表色多靠中文启发式(`resolveStatusTone`),详情常写死 `primary`,同字段列表与详情颜色不一致。
3. Web 部分页面相对注册表仍有本地硬编码色(协议查看弹窗、运费列表等)。
4. 期次 `scheduleStatus` 仅存在于缴费页本地 map,未进注册表,两端易再漂移。
### 1.2 目标
1. **单一真相源**:本范围内所有业务 Tag 的 code → label → tagType 以 `status-tag-registry.ts` 为准。
2. **Web**:修正本范围内相对注册表的硬编码偏差;期次状态补进注册表。
3. **小程序(`mobile-oa-h5`)**:建立与 Web 同结构的镜像注册表,列表头/字段/嵌套卡统一按 `tagType` 着色;弱化中文启发式。
4. **`mobile-h5`**:仅 WebView 壳,不实现业务 Tag;入口不变。
5. 契约测试锁定本范围枚举,防止回退。
### 1.3 非目标
- 不改状态码本身(如仍为 `dfj` / `open` / `draft`)。
- 不强行把小程序 `van-tag` 视觉改成 Element `el-tag`(字号、描边、圆角保持现有 `.market-tag`)。
- 不修存储服务其它隐藏页/财务确认等非本范围页面的本地 Tag 偏差(可另开任务)。
- 不做接口菜单权限改造。
### 1.4 页面映射(范围 A)
| 小程序市场部 | Web 存储服务 |
|--------------|--------------|
| 预签约订单 | 预签约订单 |
| 协议单 | 采集协议单(含录入/查看弹窗中本范围字段) |
| 催缴信息 | 催缴信息 |
| 缴费信息 | 缴费信息 |
| 运费信息 | 运费信息 |
专员 / 地区经理共用同一套 Tag 映射。
## 2. 权威注册表(本范围)
以下均来自 `web-admin/src/utils/status-tag-registry.ts`(实现时以源文件为准)。
### 2.1 已存在且本范围使用
| 字段 | 码 → 文案 / tagType |
|------|---------------------|
| `protocolStatus` | dsx 待生效/info;sxz 生效中/primary;ygq 已过期/warning;yzf 已作废/danger;sdfq 属地废弃/danger;zky 转科研/primary |
| `donationStatus` | dsx/sxz/ygq/yzf/sdfq 同上;zckc 转细胞存储/primary |
| `presignOrderStatus` | draft 草稿/info;active 进行中/warning;converted 已转正式/success;void 已作废/danger |
| `payMode` | dj 趸交/primary;fq·djfq·fgd → warning |
| `payStatus`(转账笔) | dfj **已付款**/primary;jfqrz 付款确认中/warning;yjf 付款完成/success;tfqrz 退费确认中/warning;ytf 已退费/danger |
| `samplePaymentProgress` | dfj **待缴费**/info;bfyj 部分已缴/primary;yjq 已缴清/success |
| `paymentChaseStatus` | overdue 已逾期/danger;upcoming 即将到期/warning |
| `auditStatus` | shtg 审核通过/success;shth 审核退回/danger |
| `transportType` | kdys 快递运输/info;ryxd 人员携带/success |
| `receptionSource` | cell_storage 细胞存储/primary;research_donation 科研捐赠/warning(本范围仅用前两项) |
| `transferType` | 按注册表(标签色);文案可继续走字典 `zzfs`,tagType 回落注册表 |
### 2.2 本次新增进注册表
| 字段 | 码 → 文案 / tagType | 说明 |
|------|---------------------|------|
| `paymentScheduleStatus` | open 待缴清/warning;cleared 已缴清/success;void 已作废/info | 从 `PaymentBySampleTab` 本地 map 上收 |
**硬约束**:`samplePaymentProgress.dfj`(待缴费)与 `payStatus.dfj`(已付款)、`paymentScheduleStatus.open`(待缴清)三者不得混用。
小程序若仍出现非 Web 期次码(如历史 `pending`/`partial`/`paid`/`closed`):**不写入 Web 注册表**;仅在小程序镜像中作只读别名映射到最接近的注册表项(pending→open,paid→cleared;无法映射则文案透传 + tagType `info`),避免扩大 Web 枚举。
### 2.3 语义色集合
Web Element:`success | warning | danger | info | primary | ''`
小程序 Vant:同上;预签约历史 `default` **改为 `info`**,与注册表一致。
## 3. Web 偏差清单(本次必改)
| ID | 位置 | 现状 | 目标 |
|----|------|------|------|
| W1 | `ProtocolViewDialog` 样本/协议缴费 `payMode` Tag | 非分期写死 `success` | `payModeTagType(code)` |
| W2 | `ProtocolViewDialog` 审核记录 `auditStatus` | 非 shtg 写死 `warning` | `auditStatusTagType(code)`(shth→danger) |
| W3 | `sample-freight/index` 运输方式 | 一律 `primary` + `effect="plain"` | `transportTypeTagType`;去掉与语义色冲突的 plain(文案可用 `transportModeLabel` 或 `transportTypeLabel`) |
| W4 | `sample-freight/index`、`FreightConfigDialog` 来源 | `cell_storage`→success | `receptionSourceTagType` + `receptionSourceLabel` |
| W5 | `PaymentBySampleTab` 期次状态 | 本地 label/tagType map | 改用注册表 `paymentScheduleStatus*` |
已对齐、无需改动的本范围页面:预签约列表、催缴列表、缴费列表主列(payMode / progressStatus / payStatus)。
## 4. 小程序偏差清单(本次必改)
| ID | 问题 | 目标 |
|----|------|------|
| M1 | 列表色靠中文启发式;详情常写死 primary | 有码则按镜像注册表 `tagType`;无码才回落启发式 |
| M2 | 预签约 `default` | 改为 `info` |
| M3 | 多模块重复字典 | 收敛到 `mobile-oa-h5/src/market/status-tag-registry.js`(或等价路径) |
| M4 | 预签详情 `payMode` 缺 fgd/djfq | 全量对齐注册表 |
| M5 | 部分转账映射缺 tfqrz/ytf | 全量对齐 `payStatus` |
| M6 | 运费来源/运输色未按注册表 | 对齐 `receptionSource` / `transportType` |
| M7 | 后端中文与码可能不一致 | 展示优先 `progressStatus` 等码 + 注册表;兼容历史「待缴清」→ 进度「待缴费」仅作别名 |
`mobile-h5`:不改 Tag 业务逻辑。
## 5. 架构与数据流
```
status-tag-registry.ts (Web 权威)
│
├─ web-admin 页面:只调 *Label / *TagType
│
└─ mobile-oa-h5/src/market/status-tag-registry.js
(本范围枚举手工镜像;注释标明与 Web 文件同步)
│
├─ list-presenter / 模块 adapters:输出 { label, tagType }
├─ MarketListCard / DetailSection / NestedCard:van-tag :type="tagType"
└─ status-tone.js:仅无 registry 命中时的兜底
```
后端:
- 继续返回业务码(`progressStatus`、`payStatus`、`orderStatus` 等)。
- 若仍返回中文辅助字段(如 `paymentProgress`),文案必须与注册表一致;前端以码为准。
- 市场 API 中已将 `dfj→待缴费` 的进度文案保持;错误提示中「待缴费草稿」若指转账 `dfj`,应改为「已付款」口径(与 2026-10-12 设计一致),属文案修正,不改状态机。
## 6. 实现要点
### 6.1 Web
1. 在 `status-tag-registry.ts` 新增 `paymentScheduleStatus` 及 Label/TagType getter。
2. `PaymentBySampleTab` 删除本地 map,改 import。
3. `ProtocolViewDialog`:W1/W2 改为注册表 getter。
4. `sample-freight`:W3/W4 改为注册表 getter;配置弹窗来源列同步。
### 6.2 mobile-oa-h5
1. 新增镜像注册表(本范围字段全集 + `paymentScheduleStatus`)。
2. 提供 `resolveStatusTag(registryKey, code) → { label, tagType }`。
3. `modules/payment.js`、`protocol.js`、`presign*`、`list-presenter.js`、运费相关:删除/改用镜像表。
4. `MarketListCard` / `MarketDetailSection` / `MarketDetailNestedCard`:优先使用字段上的 `tagType`。
5. 预签约 tone:`default` → `info`。
6. 进度别名:历史中文「待缴清」仅在 **progress** 映射中归一为「待缴费」;期次 `open` 仍显示「待缴清」。
### 6.3 测试
| 层 | 内容 |
|----|------|
| Web | 可选:轻量单测或页面级断言 getter 引用;至少人工点检 W1–W5 |
| mobile-oa-h5 | `module-contracts` / `list-presenter`:码→文案→tagType;`dfj` 进度≠期次;预签 payMode 全码 |
| 回归 | 市场 5 模块列表头 Tag + 详情 Tag 色与文案对照 §2 |
## 7. 验收标准
1. Web 本范围页面不再对上述字段写死与注册表冲突的 `el-tag` type。
2. 小程序市场 5 模块:同码文案与 Web 注册表一致;同码语义色与注册表一致。
3. 样本进度「待缴费」与期次「待缴清」、转账「已付款」三者在 UI 上可区分且不错位。
4. 预签约状态色使用 `info` 而非 `default`。
5. 相关自动化测试通过。
## 8. 风险与回滚
| 风险 | 缓解 |
|------|------|
| 运费运输方式由 primary plain 改为 info/success,视觉变化明显 | 属预期对齐;上线说明一句即可 |
| 审核退回由 warning→danger,更醒目 | 符合注册表与危险语义 |
| 小程序镜像与 Web 注册表再次漂移 | 文件头注释 + 契约测试;后续可考虑生成脚本(非本轮) |
回滚:按文件还原注册表新增与页面/小程序映射即可。
## 9. 任务切片(供后续 plan)
1. Web:注册表增加 `paymentScheduleStatus` + W5。
2. Web:W1、W2(ProtocolViewDialog)。
3. Web:W3、W4(sample-freight)。
4. mobile-oa-h5:镜像注册表 + resolve 工具。
5. mobile-oa-h5:缴费/催缴/协议 Tag 收口(含 M1/M3/M5/M7)。
6. mobile-oa-h5:预签约 + 运费(M2/M4/M6)。
7. 契约测试 + 手工对照验收表。
## 10. 已确认决策记录
| 决策 | 结论 |
|------|------|
| 范围 | A:市场 5 模块 ↔ Web 5 对应页 |
| 对齐深度 | 2:文案 + 码值 + 语义色 |
| 基准 | `status-tag-registry.ts` |
| Web 本地偏差 | 本范围一并按注册表修改(W1–W5) |
| 实现路径 | 方案 1 |
| 清单 | W1–W5、M1–M7 已认可 |
| 视觉 companion | 不用 HTML,文字+表格 |
+4 -2
View File
@@ -49,9 +49,11 @@
/* 快应用特有相关 */
"quickapp" : {},
/* 小程序特有相关 */
/* 生产小程序 AppID;测试备份见 manifest.mp-weixin.appid.test.bak */
/* 当前:测试 AppID;切生产时把 appid 改为下方生产值 */
/* 生产 AppID:wx2b139581f4c855e4 */
/* 测试 AppID:wxa261ad85f2c99b26 */
"mp-weixin" : {
"appid" : "wx2b139581f4c855e4",
"appid" : "wxa261ad85f2c99b26",
"setting" : {
"urlCheck" : false,
"es6" : true
+1 -1
View File
@@ -6,7 +6,7 @@
*
* 微信公众平台须为对应环境配置 request / 业务域名(HTTPS)
*/
export const APP_ENV = 'local' // 'local' | 'test' | 'prod'
export const APP_ENV = 'test' // 'local' | 'test' | 'prod'
const ENV_PRESETS = {
local: {
+30
View File
@@ -118,10 +118,40 @@ assert.equal(
}).icon,
'market-payment'
)
// 后端旧版对市场入口回落 apps-o 时,前端须覆盖为专用 PNG
assert.equal(
normalizeMenu({
path: '/pages/market/webview/index?entry=specialist-presign',
icon: 'apps-o'
}).icon,
'market-presign'
)
assert.equal(
normalizeMenu({ groupTitle: '市场部', icon: '' }).groupTitle,
'市场部'
)
// 测试库未重组目录 / 旧接口无 groupTitle 时,按 path 推断分区
assert.equal(
normalizeMenu({
path: '/pages/market/webview/index?entry=manager-freight',
icon: 'apps-o'
}).groupTitle,
'市场部'
)
assert.equal(
normalizeMenu({
path: '/pages/oa/pending/index',
icon: 'oa-pending'
}).groupTitle,
'OA工作流'
)
assert.equal(
normalizeMenu({
path: '/pages/demo/comps',
icon: 'apps-o'
}).groupTitle,
''
)
assert.equal(isOaHostWebviewRoute('pages/market/webview/index'), true)
assert.equal(isOaHostWebviewRoute('pages/index/index'), false)
+22 -5
View File
@@ -9,7 +9,7 @@ function authHeader() {
/**
* 市场业务叶子 path → van-icon 名(与 static/menu-icons/market-*.png 对齐)。
* 后端未下发 icon 时由前端兜底,避免空置文字宫格。
* 后端未下发 / 回落 apps-o 时由前端兜底,避免空置或灰格宫格。
*/
export function resolveMarketMenuIcon(path) {
const p = String(path || '').toLowerCase()
@@ -24,6 +24,22 @@ export function resolveMarketMenuIcon(path) {
return ''
}
/**
* 分区标题:优先用接口 groupTitle;缺失时按 path 推断(兼容测试库未跑目录重组 SQL)。
*/
export function resolveMenuGroupTitle(path, groupTitle) {
const existing = String(groupTitle || '').trim()
if (existing) return existing
const p = String(path || '').toLowerCase()
if (p.indexOf('market/webview') >= 0 || p.indexOf('/pages/market/') >= 0) {
return '市场部'
}
if (p.indexOf('/pages/oa/') >= 0 || p.indexOf('pages/oa/') >= 0) {
return 'OA工作流'
}
return ''
}
/** 当前用户移动端菜单(扁平列表) */
export async function fetchMyMobileMenus() {
const data = await get('/mini/menus', authHeader())
@@ -35,9 +51,10 @@ export function normalizeMenu(m = {}) {
const hasExplicitIcon = Object.prototype.hasOwnProperty.call(m, 'icon')
let icon = hasExplicitIcon ? String(m.icon ?? '') : 'approve'
const path = m.path || ''
if (!icon) {
const marketIcon = resolveMarketMenuIcon(path)
if (marketIcon) icon = marketIcon
const marketIcon = resolveMarketMenuIcon(path)
// 市场入口始终用专用 PNG(覆盖空串 / apps-o 等后端回落值)
if (marketIcon) {
icon = marketIcon
}
const colors = resolveMenuIconColors({
icon,
@@ -47,7 +64,7 @@ export function normalizeMenu(m = {}) {
return {
id: m.id,
title: m.title || m.menuName || m.menu_name,
groupTitle: m.groupTitle || m.group_title || '',
groupTitle: resolveMenuGroupTitle(path, m.groupTitle || m.group_title),
icon,
path,
iconBg: colors.iconBg,
+8 -4
View File
@@ -82,9 +82,12 @@ export function buildMarketActionPath(context, action, id, data = {}) {
}
return `${buildMarketResourcePath(context, id)}?source=${encodeURIComponent(source)}`
}
if (normalizedContext.module === 'freight' && ['link', 'unlink'].includes(action)) {
encodeId()
return `${buildMarketResourcePath(context, id)}/${action}`
if (normalizedContext.module === 'freight') {
if (action === 'delete') return buildMarketResourcePath(context, id)
if (['link', 'unlink'].includes(action)) {
encodeId()
return `${buildMarketResourcePath(context, id)}/${action}`
}
}
throw new Error('不支持的市场业务操作')
}
@@ -156,10 +159,11 @@ export async function performMarketAction(context, action, { id, data } = {}, {
const requestData = context.module === 'protocol' && action === 'delete'
? Object.fromEntries(Object.entries(data || {}).filter(([key]) => key !== 'source'))
: data
const omitBody = action === 'delete' && ['protocol', 'freight', 'presign'].includes(context.module)
return request({
url: buildMarketActionPath(context, action, id, data),
method: marketActionMethod(action),
data: action === 'delete' && context.module === 'protocol' ? undefined : requestData,
data: omitBody ? undefined : requestData,
signal
})
}
+1 -1
View File
@@ -14,7 +14,7 @@ const ACTIONS = Object.freeze({
protocol: ['view', 'create', 'edit', 'delete'],
'payment-chase': ['view-payment', 'view-protocol'],
payment: ['view', 'register-transfer', 'edit-transfer', 'delete-payment-transfer', 'submit', 'withdraw'],
freight: ['view', 'create', 'edit', 'link', 'unlink']
freight: ['view', 'create', 'edit', 'delete', 'link', 'unlink']
})
const ACTION_ALIASES = Object.freeze({
@@ -54,6 +54,11 @@ test('maps payment and freight write actions to their actual backend endpoints',
buildMarketActionPath({ marketRole: 'manager', module: 'freight' }, 'link', 'f1'),
'/mini/market/manager/freights/f1/link'
)
assert.equal(
buildMarketActionPath({ marketRole: 'manager', module: 'freight' }, 'delete', 'f1'),
'/mini/market/manager/freights/f1'
)
assert.equal(marketActionMethod('delete'), 'DELETE')
assert.equal(buildMarketResourcePath(context, 'p1'), '/mini/market/specialist/payments/p1')
})
@@ -34,7 +34,7 @@ const ACTION_LABELS = {
'submit-transfer': '提交财务确认',
'withdraw-transfer': '撤回意向金',
link: '关联样本',
unlink: '取消运费'
unlink: '取消样本关联'
}
const props = defineProps({
@@ -21,22 +21,27 @@
@customer-select="$emit('customer-select', { section, ...$event, index })"
/>
</article>
<van-button plain type="primary" size="small" icon="plus" :disabled="disabled" @click="addRow">添加{{ section.title }}</van-button>
<van-button plain type="primary" size="small" :disabled="disabled" @click="addRow">添加{{ section.title }}</van-button>
</template>
<MarketFormField
v-for="field in visibleFields"
<div
v-else
:key="field.key"
:field="field"
:model-value="value?.[field.key]"
:options="fieldOptions(field)"
:uploading="uploading"
:disabled="fieldDisabled(field)"
:search-customers="searchCustomers"
@update:model-value="setValue(field, $event)"
@upload="$emit('upload', { section, field, file: $event })"
@customer-select="$emit('customer-select', { section, ...$event })"
/>
class="market-form-fields"
:class="{ 'market-form-fields--grid-2': section.fieldsLayout === 'grid-2' }"
>
<MarketFormField
v-for="field in visibleFields"
:key="field.key"
:field="field"
:model-value="value?.[field.key]"
:options="fieldOptions(field)"
:uploading="uploading"
:disabled="fieldDisabled(field)"
:search-customers="searchCustomers"
@update:model-value="setValue(field, $event)"
@upload="$emit('upload', { section, field, file: $event })"
@customer-select="$emit('customer-select', { section, ...$event })"
/>
</div>
</section>
</template>
@@ -25,7 +25,6 @@
<footer v-if="card.actions.length" class="presign-order-card__actions">
<van-button
v-if="can('edit')"
icon="edit"
:disabled="Boolean(pendingAction)"
:loading="pendingAction === 'edit'"
@click.stop="handleAction('edit')"
@@ -33,7 +32,6 @@
<van-button
v-if="can('convert')"
type="primary"
icon="exchange"
:disabled="Boolean(pendingAction)"
:loading="pendingAction === 'convert'"
@click.stop="handleAction('convert')"
@@ -42,7 +40,6 @@
v-if="can('delete')"
type="danger"
plain
icon="delete-o"
:disabled="Boolean(pendingAction)"
:loading="pendingAction === 'delete'"
@click.stop="handleAction('delete')"
+2 -11
View File
@@ -10,13 +10,11 @@ const DEFAULTS = Object.freeze({
'payment-chase': Object.freeze({ chaseType: '', payMode: '' }),
payment: Object.freeze({
payMode: '',
progressStatus: '',
dueDateRange: Object.freeze([])
progressStatus: ''
}),
freight: Object.freeze({
transportMode: '',
sampleSource: '',
createTimeRange: Object.freeze([])
sampleSource: ''
})
})
@@ -82,16 +80,9 @@ export function buildListParams(module, filters = {}) {
} else if (module === 'payment') {
addText(result, 'payMode', filters.payMode)
addText(result, 'progressStatus', filters.progressStatus)
addRange(
result,
filters.dueDateRange,
'installmentDueDateStart',
'installmentDueDateEnd'
)
} else if (module === 'freight') {
addText(result, 'transportMode', filters.transportMode)
addText(result, 'sampleSource', filters.sampleSource)
addRange(result, filters.createTimeRange, 'createTimeStart', 'createTimeEnd')
result.includeItems = true
}
return result
+10 -13
View File
@@ -27,8 +27,8 @@ test('creates isolated defaults for every market module', () => {
})
assert.deepEqual(createListFilters('presign'), { orderStatus: '' })
assert.deepEqual(createListFilters('payment-chase'), { chaseType: '', payMode: '' })
assert.deepEqual(createListFilters('payment'), { payMode: '', progressStatus: '', dueDateRange: [] })
assert.deepEqual(createListFilters('freight'), { transportMode: '', sampleSource: '', createTimeRange: [] })
assert.deepEqual(createListFilters('payment'), { payMode: '', progressStatus: '' })
assert.deepEqual(createListFilters('freight'), { transportMode: '', sampleSource: '' })
})
test('maps every web-equivalent filter to backend query names', () => {
@@ -50,13 +50,10 @@ test('maps every web-equivalent filter to backend query names', () => {
})
assert.deepEqual(buildListParams('payment', {
payMode: 'fq',
progressStatus: 'bfyj',
dueDateRange: ['2026-10-01', '2026-10-31']
progressStatus: 'bfyj'
}), {
payMode: 'fq',
progressStatus: 'bfyj',
installmentDueDateStart: '2026-10-01',
installmentDueDateEnd: '2026-10-31'
progressStatus: 'bfyj'
})
assert.deepEqual(buildListParams('payment-chase', {
chaseType: 'overdue', payMode: 'dj'
@@ -65,20 +62,17 @@ test('maps every web-equivalent filter to backend query names', () => {
})
assert.deepEqual(buildListParams('freight', {
transportMode: 'cold_chain',
sampleSource: 'cell_storage',
createTimeRange: ['2026-10-01', '2026-10-13']
sampleSource: 'cell_storage'
}), {
transportMode: 'cold_chain',
sampleSource: 'cell_storage',
createTimeStart: '2026-10-01',
createTimeEnd: '2026-10-13',
includeItems: true
})
})
test('drops incomplete ranges and counts only user-selectable filters', () => {
assert.deepEqual(buildListParams('payment', {
payMode: '', progressStatus: 'yjq', dueDateRange: ['2026-10-01']
payMode: '', progressStatus: 'yjq'
}), { progressStatus: 'yjq' })
assert.equal(activeFilterCount('protocol', {
source: 'cell_storage',
@@ -87,6 +81,9 @@ test('drops incomplete ranges and counts only user-selectable filters', () => {
sampleCollectTimeRange: []
}), 2)
assert.equal(activeFilterCount('freight', {
transportMode: '', sampleSource: 'research_donation', createTimeRange: []
transportMode: '', sampleSource: 'research_donation'
}), 1)
assert.equal(activeFilterCount('payment', {
payMode: 'fq', progressStatus: ''
}), 1)
})
@@ -142,7 +142,8 @@ test('freight list uses inline dropdown filters like presign instead of filter s
assert.match(genericList, /inlineDropdownFilters/)
assert.match(genericList, /market-list__filter-row/)
assert.match(genericList, /van-dropdown-menu/)
assert.match(genericList, /applyInlineFilters/)
assert.match(genericList, /inlineFilterOptionsByKey/)
assert.match(genericList, /onInlineFilterChange/)
assert.match(styles, /\.market-list__filter-row\s*\{/)
assert.match(styles, /\.market-list__filter-row\s+\.van-dropdown-menu__bar/)
})
@@ -31,6 +31,8 @@ test('each module exposes only its static market action whitelist', () => {
}
assert.equal(moduleActions('freight', 'specialist').includes('edit'), true)
assert.equal(moduleActions('freight', 'manager').includes('edit'), true)
assert.equal(moduleActions('freight', 'specialist').includes('delete'), true)
assert.equal(moduleActions('freight', 'manager').includes('delete'), true)
assert.deepEqual(moduleActions('presign'), [
'view',
'create',
@@ -47,9 +49,10 @@ test('each module exposes only its static market action whitelist', () => {
test('freight header edit is shown only when the backend authorizes that batch', () => {
for (const role of ['specialist', 'manager']) {
assert.deepEqual(collectAllowedActions('freight', role, { allowedActions: ['edit'] }), ['edit'])
assert.deepEqual(collectAllowedActions('freight', role, { allowedActions: ['edit', 'delete'] }), ['edit', 'delete'])
assert.deepEqual(collectAllowedActions('freight', role, { allowedActions: ['link', 'unlink'] }), ['link', 'unlink'])
assert.equal(collectAllowedActions('freight', role, { allowedActions: ['link'] }).includes('edit'), false)
assert.equal(collectAllowedActions('freight', role, { allowedActions: ['link', 'unlink'] }).includes('delete'), false)
}
})
+6 -2
View File
@@ -54,7 +54,7 @@ export function resolveMarketDocumentTitle(route) {
'register-transfer': '登记转账',
'edit-transfer': '编辑转账',
link: '关联样本',
unlink: '取消运费'
unlink: '取消样本关联'
}[action] || `办理${moduleTitle}`
)
}
@@ -138,7 +138,11 @@ export function resolvePaymentChaseView(action) {
export function resolveMarketSavedDetailId(module, currentId, result, action) {
const current = String(currentId || '').trim()
if (module === 'freight' && action === 'unlink' && result?.disappeared === true) return ''
if (
module === 'freight' &&
['unlink', 'delete'].includes(action) &&
result?.disappeared === true
) return ''
if (module === 'payment' && current) return current
return String(result?.id || current).trim()
}
+7
View File
@@ -229,3 +229,10 @@ test('returns to freight list when unlink removes the last visible item', () =>
'freight-1'
)
})
test('returns to freight list after cascade delete disappears the batch', () => {
assert.equal(
resolveMarketSavedDetailId('freight', 'freight-1', { id: 'freight-1', disappeared: true }, 'delete'),
''
)
})
@@ -181,6 +181,10 @@ async function handleAction(action) {
await deletePresign()
return
}
if (context.value.module === 'freight' && code === 'delete') {
await deleteFreight()
return
}
if (
![
'convert',
@@ -262,6 +266,27 @@ async function deleteProtocol() {
}
}
async function deleteFreight() {
const linked = Number(detail.value?.visibleItemCount ?? detail.value?.items?.length ?? 0)
const linkHint =
linked > 0 ? '将解除其全部关联样本,并删除该运费单。' : '将删除该运费单。'
try {
await showConfirmDialog({
title: '删除运费单',
message: `确认删除 ${detail.value?.freightNo || '该运费单'} 吗?${linkHint}`
})
} catch {
return
}
try {
await performMarketAction(context.value, 'delete', { id: id.value })
showSuccessToast('删除成功')
backToList()
} catch (error) {
if (error) showToast(marketErrorMessage(error))
}
}
async function loadDetail() {
if (!id.value) {
const requestId = ++requestSequence
@@ -96,22 +96,30 @@
<section v-if="context.module === 'freight' && action !== 'edit'" class="market-form-section">
<h2>关联样本</h2>
<van-search
<div
v-if="contract.usesPagedSampleOptions?.(action)"
v-model="sampleKeyword"
:disabled="fieldsLocked"
placeholder="搜索样本或协议编号"
@search="loadSampleOptions"
@clear="loadSampleOptions"
/>
<van-dropdown-menu v-if="contract.usesPagedSampleOptions?.(action)" active-color="#0a9f6d">
<van-dropdown-item
v-model="sampleSource"
:options="sampleSourceOptions"
class="market-sample-toolbar"
>
<van-search
v-model="sampleKeyword"
shape="round"
clearable
:disabled="fieldsLocked"
@change="loadSampleOptions"
placeholder="搜索样本编码 / 协议编号 / 母亲姓名"
@search="loadSampleOptions"
@clear="loadSampleOptions"
/>
</van-dropdown-menu>
<div class="market-sample-toolbar__filter-row">
<van-dropdown-menu active-color="#0a9f6d">
<van-dropdown-item
v-model="sampleSource"
:options="sampleSourceOptions"
:disabled="fieldsLocked"
@change="loadSampleOptions"
/>
</van-dropdown-menu>
</div>
</div>
<van-list
v-model:loading="sampleOptionsLoading"
:finished="sampleOptionsFinished"
@@ -259,7 +267,7 @@ const formTitle = computed(() => {
'register-transfer': '登记转账',
'edit-transfer': '编辑转账',
link: '关联样本',
unlink: '取消运费'
unlink: '取消样本关联'
}[action.value]
return actionTitle || `办理${MARKET_MODULE_TITLES[context.value.module]}`
})
@@ -954,7 +962,7 @@ async function submit() {
if (context.value.module === 'freight' && ['link', 'unlink'].includes(action.value)) {
try {
await showConfirmDialog({
title: action.value === 'link' ? '确认关联样本' : '确认取消运费',
title: action.value === 'link' ? '确认关联样本' : '确认取消样本关联',
message: action.value === 'link'
? `确认将已选的 ${payload.items.length} 个样本关联到当前运费批次吗?`
: `确认取消已选 ${payload.items.length} 个样本的运费关联吗?`
@@ -36,17 +36,27 @@
@clear="search"
/>
<button
v-if="listFilterFields.length"
v-if="sheetFilterFields.length"
type="button"
class="market-list__filter-button"
aria-label="打开筛选"
@click="filterSheetVisible = true"
>
<van-icon name="filter-o" />
<span>筛选</span>
<span v-if="activeFilters" class="market-list__filter-count">{{ activeFilters }}</span>
</button>
</div>
<div v-if="inlineDropdownFilters.length" class="market-list__filter-row">
<van-dropdown-menu active-color="#0a9f6d">
<van-dropdown-item
v-for="field in inlineDropdownFilters"
:key="field.key"
:model-value="listFilters[field.key]"
:options="inlineFilterOptionsByKey[field.key] || []"
@change="(value) => onInlineFilterChange(field.key, value)"
/>
</van-dropdown-menu>
</div>
</div>
<div v-if="loading && !items.length" class="market-state">
@@ -73,7 +83,7 @@
>批量删除</button>
</template>
<button v-else type="button" class="market-list__batch-start" @click="batchSelectionMode = true">
<van-icon name="delete-o" />批量删除
批量删除
</button>
</div>
<van-list
@@ -108,9 +118,10 @@
<van-icon name="plus" />
</button>
<MarketFilterSheet
v-if="sheetFilterFields.length"
v-model:show="filterSheetVisible"
v-model="listFilters"
:fields="listFilterFields"
:fields="sheetFilterFields"
:options="filterOptions"
@apply="applyListFilters"
@reset="resetListFilters"
@@ -198,14 +209,41 @@ const keyword = ref('')
const filterSheetVisible = ref(false)
const listFilters = ref(createListFilters(context.value.module, listStatus.value))
const filterOptions = ref({})
const listFilterFields = computed(() =>
const sheetFilterFields = computed(() =>
(moduleContract.value.filterFields || []).filter((field) =>
!field.source || field.source === listFilters.value.source
)
)
const inlineDropdownFilters = computed(() =>
Array.isArray(moduleContract.value.inlineDropdownFilters)
? moduleContract.value.inlineDropdownFilters
: []
)
const activeFilters = computed(() =>
activeFilterCount(context.value.module, listFilters.value)
)
function normalizeDropdownOption(item) {
return {
text: String(item?.text ?? item?.label ?? item?.name ?? item?.value ?? ''),
value: String(item?.value ?? item?.id ?? item?.code ?? '')
}
}
/** 稳定 options 引用,避免模板每次 render 新建数组触发 van-dropdown 死循环白屏 */
const inlineFilterOptionsByKey = computed(() => {
const result = {}
for (const field of inlineDropdownFilters.value) {
const rows = field.optionKey
? (filterOptions.value[field.optionKey] || [])
: (field.options || [])
result[field.key] = [
{ text: field.allText || '全部', value: '' },
...(Array.isArray(rows) ? rows : []).map(normalizeDropdownOption)
]
}
return result
})
const collectionActions = ref([])
const batchSelectionMode = ref(false)
const batchDeleting = ref(false)
@@ -295,9 +333,10 @@ function queueSearch() {
}
async function loadListFilterOptions() {
const optionKeys = listFilterFields.value
.map((field) => field.optionKey)
.filter(Boolean)
const optionKeys = [
...sheetFilterFields.value.map((field) => field.optionKey),
...inlineDropdownFilters.value.map((field) => field.optionKey)
].filter(Boolean)
if (!optionKeys.length) {
filterOptions.value = {}
return
@@ -322,6 +361,16 @@ function resetListFilters(value) {
loadPage(true)
}
function onInlineFilterChange(key, value) {
const nextKey = String(key || '').trim()
if (!nextKey) return
listFilters.value = {
...listFilters.value,
[nextKey]: value == null ? '' : String(value)
}
loadPage(true)
}
function openDetail(item, extraQuery = {}) {
const target = moduleContract.value.detailTarget?.(item)
const targetModule = target?.module || context.value.module
@@ -387,6 +436,27 @@ async function deleteProtocol(item) {
}
}
async function deleteFreight(item) {
const linked = Number(item.visibleItemCount ?? item.items?.length ?? 0)
const linkHint =
linked > 0 ? `将解除其全部关联样本,并删除该运费单。` : '将删除该运费单。'
try {
await showConfirmDialog({
title: '删除运费单',
message: `确认删除 ${item.freightNo || item.code || '该运费单'} 吗?${linkHint}`
})
} catch {
return
}
try {
await performMarketAction(context.value, 'delete', { id: item.id })
showSuccessToast('删除成功')
await loadPage(true)
} catch (error) {
if (error) showToast(marketErrorMessage(error))
}
}
function canDeleteProtocol(item) {
return context.value.module === 'protocol' && intersectAllowedActions(
'protocol',
@@ -454,7 +524,8 @@ function handleCardAction(action, item) {
if (action === 'view' || action === 'view-payment' || action === 'view-payment-detail') return openDetail(item)
if (action === 'view-storage-qc') return openDetail(item, { focus: 'storage-qc' })
if (action === 'view-protocol') return openProtocol(item)
if (action === 'delete') return deleteProtocol(item)
if (action === 'delete' && context.value.module === 'protocol') return deleteProtocol(item)
if (action === 'delete' && context.value.module === 'freight') return deleteFreight(item)
if (['edit', 'register-transfer', 'link', 'unlink'].includes(action)) {
return openForm(item, action)
}
@@ -5,7 +5,7 @@
<van-loading color="#0a9f6d">加载表单…</van-loading>
</div>
<van-empty v-else-if="errorMessage" image="error" :description="errorMessage">
<van-button type="primary" round icon="replay" @click="load">重新加载</van-button>
<van-button type="primary" round @click="load">重新加载</van-button>
</van-empty>
<template v-else>
@@ -182,7 +182,6 @@
type="primary"
plain
size="small"
icon="plus"
:disabled="formBusy"
@click="addTransfer"
>添加转账</van-button>
@@ -27,7 +27,7 @@
</div>
<div v-else-if="errorMessage && !items.length" class="presign-order-state">
<van-empty image="error" :description="errorMessage">
<van-button type="primary" round icon="replay" @click="reload">重新加载</van-button>
<van-button type="primary" round @click="reload">重新加载</van-button>
</van-empty>
</div>
<van-empty v-else-if="!items.length" description="暂无预签约订单" />
@@ -55,7 +55,7 @@
<div v-if="errorMessage" class="presign-order-list__error" role="alert">
<span>{{ errorMessage }}</span>
<van-button plain type="primary" icon="replay" @click="retryAppend">
<van-button plain type="primary" @click="retryAppend">
重试
</van-button>
</div>
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+113 -157
View File
@@ -1,11 +1,11 @@
# Graph Report - src (2026-10-14)
# Graph Report - src (2026-10-15)
## Corpus Check
- Large corpus: 1035 files · ~684,946 words. Semantic extraction will be expensive (many Claude tokens). Consider running on a subfolder, or use --no-semantic to run AST-only.
- Large corpus: 1035 files · ~685,005 words. Semantic extraction will be expensive (many Claude tokens). Consider running on a subfolder, or use --no-semantic to run AST-only.
## Summary
- 3862 nodes · 5671 edges · 68 communities detected
- Extraction: 76% EXTRACTED · 24% INFERRED · 0% AMBIGUOUS · INFERRED: 1354 edges (avg confidence: 0.8)
- 3849 nodes · 5641 edges · 60 communities detected
- Extraction: 76% EXTRACTED · 24% INFERRED · 0% AMBIGUOUS · INFERRED: 1347 edges (avg confidence: 0.8)
- Token cost: 0 input · 0 output
## Community Hubs (Navigation)
@@ -52,37 +52,29 @@
- [[_COMMUNITY_Community 40|Community 40]]
- [[_COMMUNITY_Community 41|Community 41]]
- [[_COMMUNITY_Community 42|Community 42]]
- [[_COMMUNITY_Community 43|Community 43]]
- [[_COMMUNITY_Community 44|Community 44]]
- [[_COMMUNITY_Community 46|Community 46]]
- [[_COMMUNITY_Community 47|Community 47]]
- [[_COMMUNITY_Community 48|Community 48]]
- [[_COMMUNITY_Community 49|Community 49]]
- [[_COMMUNITY_Community 50|Community 50]]
- [[_COMMUNITY_Community 51|Community 51]]
- [[_COMMUNITY_Community 52|Community 52]]
- [[_COMMUNITY_Community 53|Community 53]]
- [[_COMMUNITY_Community 54|Community 54]]
- [[_COMMUNITY_Community 55|Community 55]]
- [[_COMMUNITY_Community 57|Community 57]]
- [[_COMMUNITY_Community 58|Community 58]]
- [[_COMMUNITY_Community 59|Community 59]]
- [[_COMMUNITY_Community 60|Community 60]]
- [[_COMMUNITY_Community 61|Community 61]]
- [[_COMMUNITY_Community 63|Community 63]]
- [[_COMMUNITY_Community 64|Community 64]]
- [[_COMMUNITY_Community 67|Community 67]]
- [[_COMMUNITY_Community 68|Community 68]]
- [[_COMMUNITY_Community 66|Community 66]]
- [[_COMMUNITY_Community 70|Community 70]]
- [[_COMMUNITY_Community 74|Community 74]]
- [[_COMMUNITY_Community 79|Community 79]]
- [[_COMMUNITY_Community 83|Community 83]]
- [[_COMMUNITY_Community 95|Community 95]]
- [[_COMMUNITY_Community 98|Community 98]]
- [[_COMMUNITY_Community 99|Community 99]]
- [[_COMMUNITY_Community 87|Community 87]]
- [[_COMMUNITY_Community 90|Community 90]]
- [[_COMMUNITY_Community 91|Community 91]]
## God Nodes (most connected - your core abstractions)
1. `get()` - 342 edges
2. `push()` - 129 edges
3. `Number()` - 104 edges
4. `emit()` - 35 edges
3. `Number()` - 103 edges
4. `emit()` - 34 edges
5. `WebSocketClient` - 26 edges
6. `set()` - 23 edges
7. `withFullscreenLoading()` - 20 edges
@@ -100,121 +92,121 @@
- `handleBatchDelete()` --calls--> `withFullscreenLoading()` [INFERRED]
views/operations/exhibition-appointment/index.vue → utils/fullscreen-loading.ts
- `handleBatchDelete()` --calls--> `withFullscreenLoading()` [INFERRED]
views/system/unit/index.vue → utils/fullscreen-loading.ts
views/system/tenant/index.vue → utils/fullscreen-loading.ts
## Communities
### Community 0 - "Community 0"
Cohesion: 0.0
Nodes (219): fetchAccessLogList(), fetchActiveRegions(), fetchCategoryList(), fetchCategoryParameters(), fetchCellProductPriceList(), fetchCellProductSpecList(), fetchCellProductTypeList(), fetchChannelAccount() (+211 more)
Nodes (216): fetchAccessLogList(), fetchActiveRegions(), fetchCategoryList(), fetchCategoryParameters(), fetchCellProductPriceList(), fetchCellProductSpecList(), fetchCellProductTypeList(), fetchChannelAccount() (+208 more)
### Community 1 - "Community 1"
Cohesion: 0.02
Nodes (142): fetchSamplePaymentList(), if(), buildPreviewRow(), findEarliestConfirmableSchedule(), fullFileUrl(), handleAttachPreview(), handleReset(), handleSearch() (+134 more)
Cohesion: 0.01
Nodes (164): fetchSamplePaymentDetail(), handleFocus(), handleInput(), if(), buildPreviewRow(), findEarliestConfirmableSchedule(), fullFileUrl(), handleAttachPreview() (+156 more)
### Community 2 - "Community 2"
Cohesion: 0.02
Nodes (107): fetchCheckupInstitutionInvoices(), fetchCheckupInstitutionProjects(), fetchCollectionRegionList(), fetchCreateCheckupInstitution(), fetchCreateCheckupInstitutionInvoice(), fetchCreateCheckupInstitutionProject(), fetchCreateCollectionRegion(), fetchCreateRegionStaff() (+99 more)
Nodes (103): fetchMyProductionTasks(), fetchMyQcTaskList(), fetchQcTaskDetail(), fetchQcTaskList(), buildTemporaryViewSections(), buildInsertedSiblingCard(), fetchMineTasksForWorkOrders(), resolveShowProtocolPaymentAtGroup() (+95 more)
### Community 3 - "Community 3"
Cohesion: 0.02
Nodes (92): fetchMyProductionTasks(), fetchMyQcTaskList(), fetchQcTaskDetail(), fetchQcTaskList(), buildTemporaryViewSections(), buildInsertedSiblingCard(), fetchMineTasksForWorkOrders(), resolveShowProtocolPaymentAtGroup() (+84 more)
Nodes (79): fetchBatchDeleteOaReceiveAccounts(), fetchBatchMarkOaCcTasksRead(), fetchCreateOaReceiveAccount(), fetchDeleteOaReceiveAccount(), fetchMarkOaCcTaskRead(), fetchOaAppDraft(), fetchOaCcUnreadCount(), fetchOaFormAttachments() (+71 more)
### Community 4 - "Community 4"
Cohesion: 0.02
Nodes (80): fetchBatchDeleteOaReceiveAccounts(), fetchBatchMarkOaCcTasksRead(), fetchCreateOaReceiveAccount(), fetchDeleteOaReceiveAccount(), fetchMarkOaCcTaskRead(), fetchOaAppDraft(), fetchOaCcUnreadCount(), fetchOaFormAttachments() (+72 more)
Nodes (89): batchSavePilotCheckup(), deletePilotCheckupActualItem(), fetchCheckupInstitutionList(), fetchCheckupInstitutionPackageDetail(), fetchCheckupInstitutionPackages(), fetchPilotCheckupDetail(), fetchPilotCheckupList(), markPilotCheckupChecked() (+81 more)
### Community 5 - "Community 5"
Cohesion: 0.02
Nodes (89): batchSavePilotCheckup(), deletePilotCheckupActualItem(), fetchCheckupInstitutionList(), fetchCheckupInstitutionPackageDetail(), fetchCheckupInstitutionPackages(), fetchPilotCheckupDetail(), fetchPilotCheckupList(), fetchUpdatePostBoundRoles() (+81 more)
Cohesion: 0.03
Nodes (76): fetchUploadAttachment(), FireworkSystem, handleReportUpload(), handleReportUpload(), walk(), async(), addDispatchItem(), createDispatchItem() (+68 more)
### Community 6 - "Community 6"
Cohesion: 0.03
Nodes (76): handleBlur(), handleFocus(), handleInput(), fetchConfirmPresignTransfer(), fetchPresignOrderDetail(), fetchPresignOrderList(), fetchPresignTransferReceiptConfirmedList(), fetchPresignTransferReceiptConfirmList() (+68 more)
Cohesion: 0.02
Nodes (80): fetchCheckupInstitutionInvoices(), fetchCheckupInstitutionProjects(), fetchCreateCheckupInstitution(), fetchCreateCheckupInstitutionInvoice(), fetchCreateCheckupInstitutionProject(), fetchCreateItemUnit(), fetchDeleteItemUnit(), fetchItemUnitList() (+72 more)
### Community 7 - "Community 7"
Cohesion: 0.03
Nodes (67): fetchUploadAttachment(), FireworkSystem, handleReportUpload(), handleReportUpload(), walk(), async(), addDispatchItem(), createDispatchItem() (+59 more)
Cohesion: 0.02
Nodes (64): fetchProductionTaskList(), fetchProductionWasteOutputList(), fetchSampleFreightDetail(), fetchSampleFreightList(), fetchSampleFreightSampleOptions(), fetchUpdateSampleFreight(), fetchProductionReceptionBySampleCode(), fetchProductionReceptionSubmit() (+56 more)
### Community 8 - "Community 8"
Cohesion: 0.03
Nodes (34): fetchGetMenuList(), ComponentLoader, IframeRouteManager, MenuProcessor, RoutePermissionValidator, RouteRegistry, RouteTransformer, useAppMode() (+26 more)
Nodes (74): handleBlur(), handleFocus(), handleInput(), fetchConfirmPresignTransfer(), fetchPresignOrderDetail(), fetchPresignOrderList(), fetchPresignTransferReceiptConfirmedList(), fetchPresignTransferReceiptConfirmList() (+66 more)
### Community 9 - "Community 9"
Cohesion: 0.03
Nodes (60): fetchAddTaskStep(), fetchCopyTaskStep(), fetchDeleteTaskStep(), fetchDispatchProductionTaskSteps(), fetchForwardProductionTask(), fetchProductionTaskDetail(), fetchProductionTaskEditorInit(), fetchProductionTaskList() (+52 more)
Nodes (34): fetchGetMenuList(), ComponentLoader, IframeRouteManager, MenuProcessor, RoutePermissionValidator, RouteRegistry, RouteTransformer, useAppMode() (+26 more)
### Community 10 - "Community 10"
Cohesion: 0.03
Nodes (64): useSettingsHandlers(), useSettingsPanel(), useSettingsState(), useCeremony(), useTheme(), if(), branchConditionLines(), collectConditionReferencedFields() (+56 more)
Nodes (60): fetchDictDataOptions(), fetchAttachmentDownloadUrl(), fetchMineQcWorkOrderTabUnfinishedCounts(), fetchOutboundQcDetail(), fetchQcWorkOrderDetail(), fetchQcWorkOrderList(), fetchQcWorkOrdersBySample(), fetchQcWorkOrderTabUnfinishedCounts() (+52 more)
### Community 11 - "Community 11"
Cohesion: 0.04
Nodes (50): fetchDictDataOptions(), fetchAttachmentDownloadUrl(), fetchUpdateSampleFreight(), qcAttachmentFullUrl(), qcDownloadAttachment(), qcPreviewAttachment(), handleDownloadAttachment(), attachmentFullUrl() (+42 more)
Cohesion: 0.03
Nodes (56): useSettingsHandlers(), useSettingsPanel(), useSettingsState(), useCeremony(), useTheme(), if(), chipTitle(), confirmPicker() (+48 more)
### Community 12 - "Community 12"
Cohesion: 0.03
Nodes (30): fetchCollectionProtocolList(), fetchProductionWorkOrderQcInfo(), fetchSampleInsurance(), fetchSampleStorageCert(), fetchUpdateSampleStorageCert(), dash(), fmtMoney(), auditorDisplay() (+22 more)
Nodes (54): fetchCreateMenu(), fetchDeleteMenu(), fetchMenuTree(), fetchUpdateMenu(), fetchUpdatePostBoundRoles(), collectIds(), buildInboundBasicSection(), buildInboundCellStorageViewSections() (+46 more)
### Community 13 - "Community 13"
Cohesion: 0.04
Nodes (44): buildBaseFields(), buildFeeSection(), buildInboundBasicSection(), buildInboundCellStorageProductionViewSections(), buildInboundResearchDonationProductionViewSections(), buildOutboundBasicExperimentProductionViewSections(), buildOutboundClinicalProductionViewSections(), buildOutboundDetail() (+36 more)
Nodes (69): fetchDeptTree(), fetchOaFlowPreview(), fetchOaTemplateDetail(), branchConditionLines(), collectConditionReferencedFields(), collectFormConditionReferencedFields(), flattenFormRules(), formatConditionPreview() (+61 more)
### Community 14 - "Community 14"
Cohesion: 0.05
Nodes (61): fetchDeptTree(), fetchUserList(), fetchOaFlowPreview(), fetchOaTemplateDetail(), remoteSearchHandoverUsers(), applySchema(), flowNeedsInitiatorSelect(), loadFlowPreview() (+53 more)
Cohesion: 0.03
Nodes (28): fetchCollectionProtocolList(), fetchSampleInsurance(), fetchSampleStorageCert(), fetchUpdateSampleStorageCert(), dash(), fmtMoney(), auditorDisplay(), dash() (+20 more)
### Community 15 - "Community 15"
Cohesion: 0.05
Nodes (54): fetchGetMenuCodes(), fetchGetUserInfo(), fetchLogin(), fetchRefreshToken(), fetchUpdateProfile(), fetchUploadProfileAvatar(), fetchWxQrStatus(), toLogin() (+46 more)
Cohesion: 0.04
Nodes (44): buildBaseFields(), buildFeeSection(), buildInboundBasicSection(), buildInboundCellStorageProductionViewSections(), buildInboundResearchDonationProductionViewSections(), buildOutboundBasicExperimentProductionViewSections(), buildOutboundClinicalProductionViewSections(), buildOutboundDetail() (+36 more)
### Community 16 - "Community 16"
Cohesion: 0.04
Nodes (40): fetchDeleteMaterialBatch(), fetchMaterialBatchList(), fetchMaterialBatchOptions(), fetchMaterialList(), fetchMaterialOptions(), fetchUpdateMaterialBatch(), fetchMaterialUsageList(), fetchMyMaterialUsageList() (+32 more)
Nodes (57): fetchCollectionRegionList(), fetchCreateCollectionRegion(), fetchCreateHospital(), fetchCreateRegionStaff(), fetchDeleteCollectionRegion(), fetchDeleteHospital(), fetchDeleteRegionStaff(), fetchHospitalList() (+49 more)
### Community 17 - "Community 17"
Cohesion: 0.05
Nodes (52): fetchOaRelatedSummaries(), buildFormRows(), buildOaPrintFilename(), buildOaPrintModel(), canvasToPdf(), ensurePlainObject(), exportOaApprovalPdf(), extractUrls() (+44 more)
Nodes (53): fetchGetMenuCodes(), fetchGetUserInfo(), fetchLogin(), fetchRefreshToken(), fetchUpdateProfile(), fetchUploadProfileAvatar(), fetchWxQrStatus(), fetchUserInfo() (+45 more)
### Community 18 - "Community 18"
Cohesion: 0.04
Nodes (35): fetchClinicalPaymentDetail(), fetchClinicalPayments(), fetchClinicalReceiptConfirmed(), fetchClinicalReceiptPending(), fetchClinicalRefundConfirmed(), fetchClinicalRefundPending(), fetchOrderAdjusts(), fetchOrderDetail() (+27 more)
### Community 19 - "Community 19"
Cohesion: 0.05
Nodes (42): buildInboundBasicSection(), buildInboundCellStorageViewSections(), buildInboundResearchDonationViewSections(), buildReceptionSection(), buildTransportSection(), resolveInboundProtocolStatus(), appendTaskResultSections(), batchTasksForPanelSlot() (+34 more)
Cohesion: 0.06
Nodes (48): fetchOaRelatedSummaries(), buildFormRows(), buildOaPrintFilename(), buildOaPrintModel(), canvasToPdf(), ensurePlainObject(), exportOaApprovalPdf(), extractUrls() (+40 more)
### Community 20 - "Community 20"
Cohesion: 0.05
Nodes (34): fetchCreateItemUnit(), fetchCreateMenu(), fetchDeleteItemUnit(), fetchDeleteMenu(), fetchItemUnitList(), fetchMenuTree(), fetchUpdateItemUnit(), fetchUpdateMenu() (+26 more)
### Community 21 - "Community 21"
Cohesion: 0.05
Nodes (39): fetchCreateQcInspectionItemTemplate(), fetchDeleteQcInspectionItemTemplate(), fetchQcInspectionItemTemplateDetail(), fetchQcInspectionItemTemplateList(), fetchQcInspectionItemTemplatesActive(), fetchUpdateQcInspectionItemTemplate(), fetchQcLabTestItemList(), fetchQcLabTestItemsActive() (+31 more)
### Community 22 - "Community 22"
Cohesion: 0.05
Nodes (32): fetchEthnicList(), fetchCreateSampleFreight(), fetchLinkSampleFreight(), fetchSampleFreightDetail(), fetchSampleFreightList(), fetchSampleFreightSampleOptions(), applyDonationBundleToForm(), createEmptyTransport() (+24 more)
### Community 23 - "Community 23"
### Community 21 - "Community 21"
Cohesion: 0.06
Nodes (43): completePilotApplication(), deletePilotApplication(), fetchCreateExhibitionAppointment(), fetchDeleteExhibitionAppointment(), fetchExhibitionAppointmentList(), fetchPilotApplicationList(), fetchUpdateExhibitionAppointment(), startPilotApplication() (+35 more)
### Community 24 - "Community 24"
### Community 22 - "Community 22"
Cohesion: 0.06
Nodes (37): fetchUserList(), fetchAddTaskStep(), fetchCopyTaskStep(), fetchDeleteTaskStep(), fetchDispatchProductionTaskSteps(), fetchForwardProductionTask(), fetchProductionTaskDetail(), fetchProductionTaskEditorInit() (+29 more)
### Community 23 - "Community 23"
Cohesion: 0.06
Nodes (25): fetchQcMaterialBatchDetail(), fetchQcMaterialBatchList(), fetchQcMaterialBatchOptions(), fetchQcMaterialList(), fetchQcMaterialOptions(), fetchUpdateQcMaterialBatch(), fetchMarkQcMaterialUsageFullyUsed(), financeAttachmentsToUrlString() (+17 more)
### Community 25 - "Community 25"
### Community 24 - "Community 24"
Cohesion: 0.1
Nodes (2): WebSocketClient, TableCache
### Community 25 - "Community 25"
Cohesion: 0.08
Nodes (24): fetchMineProductionWorkOrderTabStepCounts(), fetchMineProductionWorkOrderTabStepCountsDeduped(), fetchProductionWorkOrderCellProductOptions(), fetchProductionWorkOrderDetail(), fetchProductionWorkOrderList(), fetchProductionWorkOrderQcDispatchOptions(), fetchProductionWorkOrderQcInfo(), fetchProductionWorkOrderTabStepCounts() (+16 more)
### Community 26 - "Community 26"
Cohesion: 0.09
Nodes (8): getDefaultLanguage(), checkStorageCompatibility(), StorageConfig, getSystemStorage(), getSysVersion(), StorageKeyManager, StorageCompatibilityManager, validateStorageData()
### Community 27 - "Community 27"
Cohesion: 0.08
Nodes (22): fetchMineProductionWorkOrderTabStepCounts(), fetchMineProductionWorkOrderTabStepCountsDeduped(), fetchProductionWorkOrderCellProductOptions(), fetchProductionWorkOrderDetail(), fetchProductionWorkOrderList(), fetchProductionWorkOrderQcDispatchOptions(), fetchProductionWorkOrderTabStepCounts(), fetchProductionWorkOrderTabStepCountsDeduped() (+14 more)
Cohesion: 0.07
Nodes (20): fetchDeleteMaterialBatch(), fetchMaterialBatchList(), fetchMaterialBatchOptions(), fetchMaterialList(), fetchMaterialOptions(), fetchUpdateMaterialBatch(), fetchMaterialUsageList(), fetchMyMaterialUsageList() (+12 more)
### Community 28 - "Community 28"
Cohesion: 0.08
@@ -226,208 +218,172 @@ Nodes (22): fetchOaAppList(), fetchOaGroupList(), fetchPublishOaApp(), loadData(
### Community 30 - "Community 30"
Cohesion: 0.09
Nodes (18): nodeSummary(), createDefaultFlow(), createEndNode(), createNode(), ensureFlowRoot(), newId(), normalizeCcAssigneeTypes(), removeChildNode() (+10 more)
Nodes (16): fetchEthnicList(), applyDonationBundleToForm(), createEmptyTransport(), ensureEthnicOptionInList(), handleOpenForAdd(), loadEthnicOptions(), normalizeSampleRow(), resetForm() (+8 more)
### Community 31 - "Community 31"
Cohesion: 0.09
Nodes (12): fetchMineQcWorkOrderTabUnfinishedCounts(), fetchOutboundQcDetail(), fetchQcWorkOrderDetail(), fetchQcWorkOrderList(), fetchQcWorkOrdersBySample(), fetchQcWorkOrderTabUnfinishedCounts(), reload(), reloadTabCounts() (+4 more)
### Community 32 - "Community 32"
Cohesion: 0.1
Nodes (12): fetchOutboundReleaseMaterial(), fetchOutboundReleaseReviewDetail(), fetchOutboundReleaseReviewList(), fetchReleaseReviewList(), handleReset(), handleSearch(), handleTabChange(), handleToggleSelect() (+4 more)
### Community 33 - "Community 33"
Cohesion: 0.13
Nodes (19): fetchCellSampleTypeList(), fetchCreateCellSampleType(), fetchDeleteCellSampleType(), fetchUpdateCellSampleType(), handleAdd(), handleBatchDelete(), handleDelete(), handleDropdownCommand() (+11 more)
### Community 34 - "Community 34"
### Community 32 - "Community 32"
Cohesion: 0.12
Nodes (15): addCopyButton(), highlightCode(), insertLineNumbers(), isBlockProcessed(), markBlockAsProcessed(), processBlock(), setupHighlightDirective(), setupRippleDirective() (+7 more)
### Community 33 - "Community 33"
Cohesion: 0.13
Nodes (18): fetchCellSampleTypeList(), fetchCreateCellSampleType(), fetchDeleteCellSampleType(), fetchUpdateCellSampleType(), handleAdd(), handleDelete(), handleDropdownCommand(), handleEdit() (+10 more)
### Community 34 - "Community 34"
Cohesion: 0.15
Nodes (17): fetchCreateTenant(), fetchDeleteTenant(), fetchTenantList(), fetchUpdateTenant(), handleAdd(), handleBatchDelete(), handleDelete(), handleDropdownCommand() (+9 more)
### Community 35 - "Community 35"
Cohesion: 0.2
Nodes (14): applyFlagToRule(), applySchema(), countRules(), getActiveRule(), getDesigner(), getSetupState(), onMessage(), readFlag() (+6 more)
### Community 36 - "Community 36"
Cohesion: 0.16
Nodes (16): fetchCreateTenant(), fetchDeleteTenant(), fetchTenantList(), fetchUpdateTenant(), handleAdd(), handleDelete(), handleDropdownCommand(), handleEdit() (+8 more)
### Community 37 - "Community 37"
Cohesion: 0.16
Nodes (14): fetchCreateEnvDetectItem(), fetchDeleteEnvDetectItem(), fetchEnvDetectItemDetail(), fetchEnvDetectItemList(), fetchEnvDetectItemsActive(), fetchUpdateEnvDetectItem(), handleAdd(), handleBatchDelete() (+6 more)
### Community 38 - "Community 38"
Cohesion: 0.12
Nodes (6): setupOaConfirmationKit(), ensureOaKitMenu(), setupOaLeaveKit(), setupOaOvertimeKit(), setupOaResignationKit(), setupOaTripKit()
### Community 39 - "Community 39"
### Community 37 - "Community 37"
Cohesion: 0.16
Nodes (10): useTable(), useTableImpl(), getColumnChecks(), useTableColumns(), createErrorHandler(), createSmartDebounce(), defaultResponseAdapter(), extractPagination() (+2 more)
### Community 40 - "Community 40"
### Community 38 - "Community 38"
Cohesion: 0.27
Nodes (14): useChart(), useChartComponent(), useChartOps(), colourBlend(), getCssVar(), getDarkColor(), getLightColor(), handleElementThemeColor() (+6 more)
### Community 41 - "Community 41"
### Community 39 - "Community 39"
Cohesion: 0.25
Nodes (12): buildFlowItems(), isCcProgressItem(), peopleDisplayNames(), progressNodeStatusText(), progressPersonLinesFromItem(), statusText(), displayName(), formatProgressPersonLines() (+4 more)
### Community 42 - "Community 42"
### Community 40 - "Community 40"
Cohesion: 0.33
Nodes (13): buildProtocolPaymentFlowSteps(), dash(), financeReceiptTime(), formatAmount(), hasFinanceReceipt(), hasFinanceRefund(), hasReceiptSubmit(), hasRefundSubmit() (+5 more)
### Community 43 - "Community 43"
### Community 41 - "Community 41"
Cohesion: 0.19
Nodes (6): fetchServiceOrderTxnList(), handleReset(), handleSearch(), handleTabChange(), loadData(), switchTab()
### Community 44 - "Community 44"
### Community 42 - "Community 42"
Cohesion: 0.24
Nodes (10): buildPrintDocumentHtml(), cleanupPrintIframe(), embedSopImagesAsDataUrls(), getSopA4ContentHeightPx(), getSopA4EditorHeightPx(), normalizeSopCheckboxes(), prepareSopHtmlForPrint(), printSopHtml() (+2 more)
### Community 46 - "Community 46"
Cohesion: 0.26
Nodes (8): fetchSampleStorageCertQc(), saveSampleStorageCertQc(), applyDetail(), handleSave(), loadDetail(), resetFormKeys(), resolveStorageCertQcTypeKey(), supportsStorageCertQc()
### Community 47 - "Community 47"
Cohesion: 0.16
Nodes (3): fetchSampleSmsNotificationList(), fetchStorageReleaseReviewDetail(), fetchStorageReleaseReviewList()
### Community 48 - "Community 48"
### Community 44 - "Community 44"
Cohesion: 0.25
Nodes (2): handleTouchEnd(), setTransition()
### Community 50 - "Community 50"
Cohesion: 0.28
Nodes (5): fetchMyProductionMaterialConsumptions(), displayConsumptionQty(), handleReset(), handleSearch(), loadData()
### Community 51 - "Community 51"
### Community 46 - "Community 46"
Cohesion: 0.28
Nodes (4): isActiveHistoryInstance(), isUploadPreviewLabel(), previewColumnMinWidth(), syncWorktabTitle()
### Community 54 - "Community 54"
### Community 49 - "Community 49"
Cohesion: 0.39
Nodes (6): isIgnorableScriptError(), normalizeErrorMessage(), registerPromiseErrorHandler(), registerResourceErrorHandler(), scriptErrorHandler(), setupErrorHandle()
### Community 55 - "Community 55"
### Community 50 - "Community 50"
Cohesion: 0.36
Nodes (1): TableHeightCalculator
### Community 57 - "Community 57"
### Community 52 - "Community 52"
Cohesion: 0.33
Nodes (2): logApiCryptoBootInfo(), maskSecret()
### Community 58 - "Community 58"
Cohesion: 0.38
Nodes (4): handleFocus(), handleInput(), parseDecimalToNumber(), sanitizeDecimalInput()
### Community 59 - "Community 59"
### Community 53 - "Community 53"
Cohesion: 0.29
Nodes (1): fetchQcMonthTemplateList()
### Community 60 - "Community 60"
### Community 54 - "Community 54"
Cohesion: 0.4
Nodes (2): isUnfinishedQcWorkOrder(), resolveQcWorkOrderUnfinishedBadgeCount()
### Community 61 - "Community 61"
### Community 55 - "Community 55"
Cohesion: 0.5
Nodes (2): parseEquipmentIds(), syncEquipmentNamesFromOptions()
### Community 63 - "Community 63"
### Community 57 - "Community 57"
Cohesion: 0.5
Nodes (2): focusInput(), handleKeydown()
### Community 64 - "Community 64"
Cohesion: 0.4
Nodes (1): fetchQcMaterialAmountAuthUsers()
### Community 67 - "Community 67"
### Community 60 - "Community 60"
Cohesion: 0.67
Nodes (2): isCurrentPending(), isNotReached()
### Community 68 - "Community 68"
### Community 61 - "Community 61"
Cohesion: 0.67
Nodes (2): if(), logSidebarMenu()
### Community 70 - "Community 70"
Cohesion: 0.5
Nodes (1): fetchStorageEntrySmsList()
### Community 74 - "Community 74"
### Community 66 - "Community 66"
Cohesion: 1.0
Nodes (2): getSettingDefaults(), resetToDefaults()
### Community 79 - "Community 79"
### Community 70 - "Community 70"
Cohesion: 1.0
Nodes (2): copyTextToClipboard(), copyTextWithFallback()
### Community 83 - "Community 83"
### Community 74 - "Community 74"
Cohesion: 1.0
Nodes (2): getSourceProtocolAttachment(), normalizeAttachmentFiles()
### Community 95 - "Community 95"
### Community 87 - "Community 87"
Cohesion: 1.0
Nodes (2): emptyTabCounts(), useProductionWorkOrderTabStepCounts()
### Community 98 - "Community 98"
### Community 90 - "Community 90"
Cohesion: 1.0
Nodes (2): initialProgress(), useQcWorkOrderAttachmentExport()
### Community 99 - "Community 99"
### Community 91 - "Community 91"
Cohesion: 1.0
Nodes (2): emptyTabCounts(), useQcWorkOrderTabUnfinishedCounts()
## Knowledge Gaps
- **Thin community `Community 25`** (42 nodes): `WebSocketClient`, `.calculateReconnectDelay()`, `.clearAllTimers()`, `.clearConnectionTimers()`, `.clearTimer()`, `.close()`, `.closeCurrentSocketForReconnect()`, `.connect()`, `.connectionStatusText()`, `.constructor()`, `.destroyInstance()`, `.flushMessageQueue()`, `.getInstance()`, `.getReadyStateText()`, `.handleClose()`, `.handleConnectionTimeout()`, `.handleError()`, `.handleMessage()`, `.handleOpen()`, `.init()`, `.isWebSocketConnected()`, `.reconnect()`, `.resetHeartbeat()`, `.send()`, `.startHeartbeat()`, `.startPing()`, `TableCache`, `.cleanupExpired()`, `.clear()`, `.clearByTags()`, `.clearCurrentSearch()`, `.clearPagination()`, `.constructor()`, `.evictLRU()`, `.generateKey()`, `.generateTags()`, `.get()`, `.getStats()`, `.log()`, `.set()`, `index.ts`, `tableCache.ts`
- **Thin community `Community 24`** (42 nodes): `WebSocketClient`, `.calculateReconnectDelay()`, `.clearAllTimers()`, `.clearConnectionTimers()`, `.clearTimer()`, `.close()`, `.closeCurrentSocketForReconnect()`, `.connect()`, `.connectionStatusText()`, `.constructor()`, `.destroyInstance()`, `.flushMessageQueue()`, `.getInstance()`, `.getReadyStateText()`, `.handleClose()`, `.handleConnectionTimeout()`, `.handleError()`, `.handleMessage()`, `.handleOpen()`, `.init()`, `.isWebSocketConnected()`, `.reconnect()`, `.resetHeartbeat()`, `.send()`, `.startHeartbeat()`, `.startPing()`, `TableCache`, `.cleanupExpired()`, `.clear()`, `.clearByTags()`, `.clearCurrentSearch()`, `.clearPagination()`, `.constructor()`, `.evictLRU()`, `.generateKey()`, `.generateTags()`, `.get()`, `.getStats()`, `.log()`, `.set()`, `index.ts`, `tableCache.ts`
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
- **Thin community `Community 48`** (9 nodes): `cleanupEventListeners()`, `handleTouchEnd()`, `handleTouchMove()`, `handleTouchStart()`, `handleWheelScroll()`, `if()`, `setTransition()`, `setupEventListeners()`, `index.vue`
- **Thin community `Community 44`** (9 nodes): `cleanupEventListeners()`, `handleTouchEnd()`, `handleTouchMove()`, `handleTouchStart()`, `handleWheelScroll()`, `if()`, `setTransition()`, `setupEventListeners()`, `index.vue`
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
- **Thin community `Community 55`** (8 nodes): `TableHeightCalculator`, `.calculate()`, `.calculateOffset()`, `.calculatePaginationOffset()`, `.constructor()`, `.getHeaderHeight()`, `useTableHeight()`, `useTableHeight.ts`
- **Thin community `Community 50`** (8 nodes): `TableHeightCalculator`, `.calculate()`, `.calculateOffset()`, `.calculatePaginationOffset()`, `.constructor()`, `.getHeaderHeight()`, `useTableHeight()`, `useTableHeight.ts`
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
- **Thin community `Community 57`** (7 nodes): `App.vue`, `main.ts`, `refreshButtonAutoIcons()`, `refreshPanelTitleIcons()`, `logApiCryptoBootInfo()`, `maskSecret()`, `console.ts`
- **Thin community `Community 52`** (7 nodes): `App.vue`, `main.ts`, `refreshButtonAutoIcons()`, `refreshPanelTitleIcons()`, `logApiCryptoBootInfo()`, `maskSecret()`, `console.ts`
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
- **Thin community `Community 59`** (7 nodes): `fetchConfirmQcMonthImport()`, `fetchCreateQcMonthTemplate()`, `fetchDeleteQcMonthTemplate()`, `fetchPreviewQcMonthImport()`, `fetchQcMonthTemplateList()`, `fetchUpdateQcMonthTemplate()`, `qc-material-month-template.ts`
- **Thin community `Community 53`** (7 nodes): `fetchConfirmQcMonthImport()`, `fetchCreateQcMonthTemplate()`, `fetchDeleteQcMonthTemplate()`, `fetchPreviewQcMonthImport()`, `fetchQcMonthTemplateList()`, `fetchUpdateQcMonthTemplate()`, `qc-material-month-template.ts`
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
- **Thin community `Community 60`** (6 nodes): `formatQcWorkOrderUnfinishedBadgeCount()`, `isUnfinishedQcWorkOrder()`, `qcWorkOrderUnfinishedBadgeTitle()`, `resolveQcWorkOrderUnfinishedBadgeCount()`, `sumQcWorkOrderGroupUnfinishedBadgeCount()`, `qc-work-order-unfinished-badge.ts`
- **Thin community `Community 54`** (6 nodes): `formatQcWorkOrderUnfinishedBadgeCount()`, `isUnfinishedQcWorkOrder()`, `qcWorkOrderUnfinishedBadgeTitle()`, `resolveQcWorkOrderUnfinishedBadgeCount()`, `sumQcWorkOrderGroupUnfinishedBadgeCount()`, `qc-work-order-unfinished-badge.ts`
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
- **Thin community `Community 61`** (5 nodes): `equipmentOptionLabel()`, `joinEquipmentIds()`, `parseEquipmentIds()`, `syncEquipmentNamesFromOptions()`, `equipment-select.ts`
- **Thin community `Community 55`** (5 nodes): `equipmentOptionLabel()`, `joinEquipmentIds()`, `parseEquipmentIds()`, `syncEquipmentNamesFromOptions()`, `equipment-select.ts`
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
- **Thin community `Community 63`** (5 nodes): `focusInput()`, `handleKeydown()`, `if()`, `search()`, `index.vue`
- **Thin community `Community 57`** (5 nodes): `focusInput()`, `handleKeydown()`, `if()`, `search()`, `index.vue`
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
- **Thin community `Community 64`** (5 nodes): `fetchBatchRevokeQcMaterialAmountAuth()`, `fetchGrantQcMaterialAmountAuth()`, `fetchQcMaterialAmountAuthUsers()`, `fetchRevokeQcMaterialAmountAuth()`, `qc-material-amount-auth.ts`
- **Thin community `Community 60`** (4 nodes): `isCurrentPending()`, `isNotReached()`, `mergeProgressWithComments()`, `oa-progress-merge-comments.ts`
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
- **Thin community `Community 67`** (4 nodes): `isCurrentPending()`, `isNotReached()`, `mergeProgressWithComments()`, `oa-progress-merge-comments.ts`
- **Thin community `Community 61`** (4 nodes): `if()`, `logSidebarMenu()`, `index.vue`, `SidebarSubmenu.vue`
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
- **Thin community `Community 68`** (4 nodes): `if()`, `logSidebarMenu()`, `index.vue`, `SidebarSubmenu.vue`
- **Thin community `Community 66`** (3 nodes): `getSettingDefaults()`, `resetToDefaults()`, `setting.ts`
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
- **Thin community `Community 70`** (4 nodes): `fetchGenerateStorageEntrySms()`, `fetchStorageEntrySmsList()`, `fetchToggleStorageEntrySmsNotified()`, `storage-entry-sms-notification.ts`
- **Thin community `Community 70`** (3 nodes): `copyTextToClipboard()`, `copyTextWithFallback()`, `copy-text.ts`
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
- **Thin community `Community 74`** (3 nodes): `getSettingDefaults()`, `resetToDefaults()`, `setting.ts`
- **Thin community `Community 74`** (3 nodes): `getSourceProtocolAttachment()`, `normalizeAttachmentFiles()`, `protocol-source-attachment.ts`
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
- **Thin community `Community 79`** (3 nodes): `copyTextToClipboard()`, `copyTextWithFallback()`, `copy-text.ts`
- **Thin community `Community 87`** (3 nodes): `emptyTabCounts()`, `useProductionWorkOrderTabStepCounts()`, `useProductionWorkOrderTabStepCounts.ts`
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
- **Thin community `Community 83`** (3 nodes): `getSourceProtocolAttachment()`, `normalizeAttachmentFiles()`, `protocol-source-attachment.ts`
- **Thin community `Community 90`** (3 nodes): `initialProgress()`, `useQcWorkOrderAttachmentExport()`, `useQcWorkOrderAttachmentExport.ts`
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
- **Thin community `Community 95`** (3 nodes): `emptyTabCounts()`, `useProductionWorkOrderTabStepCounts()`, `useProductionWorkOrderTabStepCounts.ts`
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
- **Thin community `Community 98`** (3 nodes): `initialProgress()`, `useQcWorkOrderAttachmentExport()`, `useQcWorkOrderAttachmentExport.ts`
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
- **Thin community `Community 99`** (3 nodes): `emptyTabCounts()`, `useQcWorkOrderTabUnfinishedCounts()`, `useQcWorkOrderTabUnfinishedCounts.ts`
- **Thin community `Community 91`** (3 nodes): `emptyTabCounts()`, `useQcWorkOrderTabUnfinishedCounts()`, `useQcWorkOrderTabUnfinishedCounts.ts`
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
## Suggested Questions
_Questions this graph is uniquely positioned to answer:_
- **Why does `push()` connect `Community 7` to `Community 0`, `Community 1`, `Community 2`, `Community 3`, `Community 4`, `Community 5`, `Community 6`, `Community 9`, `Community 10`, `Community 11`, `Community 12`, `Community 13`, `Community 14`, `Community 15`, `Community 16`, `Community 17`, `Community 19`, `Community 21`, `Community 23`, `Community 25`, `Community 27`, `Community 28`, `Community 29`, `Community 30`, `Community 31`, `Community 41`?**
_High betweenness centrality (0.283) - this node is a cross-community bridge._
- **Why does `get()` connect `Community 0` to `Community 1`, `Community 2`, `Community 3`, `Community 4`, `Community 5`, `Community 6`, `Community 7`, `Community 9`, `Community 10`, `Community 11`, `Community 12`, `Community 14`, `Community 15`, `Community 16`, `Community 17`, `Community 18`, `Community 19`, `Community 20`, `Community 21`, `Community 22`, `Community 23`, `Community 24`, `Community 27`, `Community 29`, `Community 31`, `Community 32`, `Community 33`, `Community 36`, `Community 37`, `Community 43`, `Community 46`, `Community 47`, `Community 50`, `Community 59`, `Community 64`, `Community 70`?**
_High betweenness centrality (0.272) - this node is a cross-community bridge._
- **Why does `Number()` connect `Community 1` to `Community 0`, `Community 2`, `Community 3`, `Community 4`, `Community 6`, `Community 7`, `Community 10`, `Community 11`, `Community 12`, `Community 13`, `Community 14`, `Community 15`, `Community 16`, `Community 17`, `Community 19`, `Community 22`, `Community 24`, `Community 28`, `Community 40`, `Community 42`, `Community 50`, `Community 58`?**
_High betweenness centrality (0.169) - this node is a cross-community bridge._
- **Why does `push()` connect `Community 5` to `Community 0`, `Community 1`, `Community 2`, `Community 3`, `Community 4`, `Community 6`, `Community 7`, `Community 8`, `Community 10`, `Community 11`, `Community 12`, `Community 13`, `Community 14`, `Community 15`, `Community 17`, `Community 19`, `Community 20`, `Community 21`, `Community 22`, `Community 24`, `Community 25`, `Community 28`, `Community 29`, `Community 39`?**
_High betweenness centrality (0.294) - this node is a cross-community bridge._
- **Why does `get()` connect `Community 0` to `Community 1`, `Community 2`, `Community 3`, `Community 4`, `Community 5`, `Community 6`, `Community 7`, `Community 8`, `Community 10`, `Community 11`, `Community 12`, `Community 13`, `Community 14`, `Community 16`, `Community 17`, `Community 18`, `Community 19`, `Community 20`, `Community 21`, `Community 22`, `Community 23`, `Community 25`, `Community 27`, `Community 29`, `Community 30`, `Community 31`, `Community 33`, `Community 34`, `Community 41`, `Community 53`?**
_High betweenness centrality (0.255) - this node is a cross-community bridge._
- **Why does `Number()` connect `Community 1` to `Community 0`, `Community 2`, `Community 3`, `Community 4`, `Community 5`, `Community 6`, `Community 7`, `Community 8`, `Community 11`, `Community 12`, `Community 13`, `Community 14`, `Community 15`, `Community 17`, `Community 19`, `Community 23`, `Community 27`, `Community 28`, `Community 30`, `Community 38`, `Community 40`?**
_High betweenness centrality (0.167) - this node is a cross-community bridge._
- **Are the 341 inferred relationships involving `get()` (e.g. with `resolveStorageSlotRangeFill()` and `buildNodeCodePathFromFlat()`) actually correct?**
_`get()` has 341 INFERRED edges - model-reasoned connections that need verification._
- **Are the 128 inferred relationships involving `push()` (e.g. with `refreshQcMenuBadges()` and `collectLeafFacilityNodesInTreeOrder()`) actually correct?**
_`push()` has 128 INFERRED edges - model-reasoned connections that need verification._
- **Are the 99 inferred relationships involving `Number()` (e.g. with `slotOrderNum()` and `isSlotAvailable()`) actually correct?**
_`Number()` has 99 INFERRED edges - model-reasoned connections that need verification._
- **Are the 34 inferred relationships involving `emit()` (e.g. with `updateSamples()` and `notifyChanged()`) actually correct?**
_`emit()` has 34 INFERRED edges - model-reasoned connections that need verification._
- **Are the 98 inferred relationships involving `Number()` (e.g. with `slotOrderNum()` and `isSlotAvailable()`) actually correct?**
_`Number()` has 98 INFERRED edges - model-reasoned connections that need verification._
- **Are the 33 inferred relationships involving `emit()` (e.g. with `updateSamples()` and `notifyChanged()`) actually correct?**
_`emit()` has 33 INFERRED edges - model-reasoned connections that need verification._
+4 -4
View File
@@ -57,12 +57,12 @@
</div>
<div id="legend"></div>
</div>
<div id="stats">3862 nodes &middot; 5671 edges &middot; 401 communities</div>
<div id="stats">3849 nodes &middot; 5641 edges &middot; 395 communities</div>
</div>
<script>
const RAW_NODES = [{"id": "app_vue", "label": "App.vue", "color": {"background": "#FF9DA7", "border": "#FF9DA7", "highlight": {"background": "#ffffff", "border": "#FF9DA7"}}, "size": 10.3, "font": {"size": 0, "color": "#ffffff"}, "title": "App.vue", "community": 57, "community_name": "Community 57", "source_file": "App.vue", "file_type": "code", "degree": 3}, {"id": "src_app_refreshbuttonautoicons", "label": "refreshButtonAutoIcons()", "color": {"background": "#FF9DA7", "border": "#FF9DA7", "highlight": {"background": "#ffffff", "border": "#FF9DA7"}}, "size": 10.1, "font": {"size": 0, "color": "#ffffff"}, "title": "refreshButtonAutoIcons()", "community": 57, "community_name": "Community 57", "source_file": "App.vue", "file_type": "code", "degree": 1}, {"id": "src_app_refreshpaneltitleicons", "label": "refreshPanelTitleIcons()", "color": {"background": "#FF9DA7", "border": "#FF9DA7", "highlight": {"background": "#ffffff", "border": "#FF9DA7"}}, "size": 10.1, "font": {"size": 0, "color": "#ffffff"}, "title": "refreshPanelTitleIcons()", "community": 57, "community_name": "Community 57", "source_file": "App.vue", "file_type": "code", "degree": 1}, {"id": "main_ts", "label": "main.ts", "color": {"background": "#FF9DA7", "border": "#FF9DA7", "highlight": {"background": "#ffffff", "border": "#FF9DA7"}}, "size": 10.4, "font": {"size": 0, "color": "#ffffff"}, "title": "main.ts", "community": 57, "community_name": "Community 57", "source_file": "main.ts", "file_type": "code", "degree": 4}, {"id": "src_main_masksecret", "label": "maskSecret()", "color": {"background": "#FF9DA7", "border": "#FF9DA7", "highlight": {"background": "#ffffff", "border": "#FF9DA7"}}, "size": 10.2, "font": {"size": 0, "color": "#ffffff"}, "title": "maskSecret()", "community": 57, "community_name": "Community 57", "source_file": "main.ts", "file_type": "code", "degree": 2}, {"id": "src_main_logapicryptobootinfo", "label": "logApiCryptoBootInfo()", "color": {"background": "#FF9DA7", "border": "#FF9DA7", "highlight": {"background": "#ffffff", "border": "#FF9DA7"}}, "size": 10.2, "font": {"size": 0, "color": "#ffffff"}, "title": "logApiCryptoBootInfo()", "community": 57, "community_name": "Community 57", "source_file": "main.ts", "file_type": "code", "degree": 2}, {"id": "env_d_ts", "label": "env.d.ts", "color": {"background": "#59A14F", "border": "#59A14F", "highlight": {"background": "#ffffff", "border": "#59A14F"}}, "size": 10.0, "font": {"size": 0, "color": "#ffffff"}, "title": "env.d.ts", "community": 144, "community_name": "Community 144", "source_file": "env.d.ts", "file_type": "code", "degree": 0}, {"id": "shims_loose_d_ts", "label": "shims-loose.d.ts", "color": {"background": "#EDC948", "border": "#EDC948", "highlight": {"background": "#ffffff", "border": "#EDC948"}}, "size": 10.0, "font": {"size": 0, "color": "#ffffff"}, "title": "shims-loose.d.ts", "community": 145, "community_name": "Community 145", "source_file": "shims-loose.d.ts", "file_type": "code", "degree": 0}, {"id": "directives_index_ts", "label": "index.ts", "color": {"background": "#59A14F", "border": "#59A14F", "highlight": {"background": "#ffffff", "border": "#59A14F"}}, "size": 10.1, "font": {"size": 0, "color": "#ffffff"}, "title": "index.ts", "community": 34, "community_name": "Community 34", "source_file": "directives/index.ts", "file_type": "code", "degree": 1}, {"id": "directives_index_setupglobdirectives", "label": "setupGlobDirectives()", "color": {"background": "#59A14F", "border": "#59A14F", "highlight": {"background": "#ffffff", "border": "#59A14F"}}, "size": 10.4, "font": {"size": 0, "color": "#ffffff"}, "title": "setupGlobDirectives()", "community": 34, "community_name": "Community 34", "source_file": "directives/index.ts", "file_type": "code", "degree": 5}, {"id": "directives_core_roles_ts", "label": "roles.ts", "color": {"background": "#59A14F", "border": "#59A14F", "highlight": {"background": "#ffffff", "border": "#59A14F"}}, "size": 10.3, "font": {"size": 0, "color": "#ffffff"}, "title": "roles.ts", "community": 34, "community_name": "Community 34", "source_file": "directives/core/roles.ts", "file_type": "code", "degree": 3}, {"id": "core_roles_checkrolepermission", "label": "checkRolePermission()", "color": {"background": "#59A14F", "border": "#59A14F", "highlight": {"background": "#ffffff", "border": "#59A14F"}}, "size": 10.2, "font": {"size": 0, "color": "#ffffff"}, "title": "checkRolePermission()", "community": 34, "community_name": "Community 34", "source_file": "directives/core/roles.ts", "file_type": "code", "degree": 2}, {"id": "core_roles_removeelement", "label": "removeElement()", "color": {"background": "#59A14F", "border": "#59A14F", "highlight": {"background": "#ffffff", "border": "#59A14F"}}, "size": 10.2, "font": {"size": 0, "color": "#ffffff"}, "title": "removeElement()", "community": 34, "community_name": "Community 34", "source_file": "directives/core/roles.ts", "file_type": "code", "degree": 2}, {"id": "core_roles_setuprolesdirective",Line truncated
const RAW_EDGES = [{"from": "app_vue", "to": "src_app_refreshbuttonautoicons", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "app_vue", "to": "src_app_refreshpaneltitleicons", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "app_vue", "to": "main_ts", "label": "imports_from", "title": "imports_from [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "main_ts", "to": "utils_sys_console_ts", "label": "imports_from", "title": "imports_from [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "main_ts", "to": "src_main_masksecret", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "main_ts", "to": "src_main_logapicryptobootinfo", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "src_main_masksecret", "to": "src_main_logapicryptobootinfo", "label": "calls", "title": "calls [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "directives_index_ts", "to": "directives_index_setupglobdirectives", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "directives_index_setupglobdirectives", "to": "core_auth_setupauthdirective", "label": "calls", "title": "calls [INFERRED]", "dashes": true, "width": 1, "color": {"opacity": 0.35}, "confidence": "INFERRED"}, {"from": "directives_index_setupglobdirectives", "to": "core_roles_setuprolesdirective", "label": "calls", "title": "calls [INFERRED]", "dashes": true, "width": 1, "color": {"opacity": 0.35}, "confidence": "INFERRED"}, {"from": "directives_index_setupglobdirectives", "to": "business_highlight_setuphighlightdirective", "label": "calls", "title": "calls [INFERRED]", "dashes": true, "width": 1, "color": {"opacity": 0.35}, "confidence": "INFERRED"}, {"from": "directives_index_setupglobdirectives", "to": "business_ripple_setuprippledirective", "label": "calls", "title": "calls [INFERRED]", "dashes": true, "width": 1, "color": {"opacity": 0.35}, "confidence": "INFERRED"}, {"from": "directives_core_roles_ts", "to": "core_roles_checkrolepermission", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "directives_core_roles_ts", "to": "core_roles_removeelement", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "directives_core_roles_ts", "to": "core_roles_setuprolesdirective", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "core_roles_checkrolepermission", "to": "core_roles_removeelement", "label": "calls", "title": "calls [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "directives_core_auth_ts", "to": "core_auth_checkauthpermission", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "directives_core_auth_ts", "to": "core_auth_removeelement", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "directives_core_auth_ts", "to": "core_auth_setupauthdirective", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "core_auth_checkauthpermission", "to": "core_auth_removeelement", "label": "calls", "title": "calls [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "directives_business_ripple_ts", "to": "business_ripple_setuprippledirective", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "directives_business_highlight_ts", "to": "business_highlight_highlightcode", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "directives_business_highlight_ts", "to": "business_highlight_insertlinenumbers", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "directives_business_highlight_ts", "to": "business_highlight_addcopybutton", "label": "contains", "title": "contains [EXTRACTED]", "dLine truncated
const LEGEND = [{"cid": 0, "color": "#4E79A7", "label": "Community 0", "count": 573}, {"cid": 1, "color": "#F28E2B", "label": "Community 1", "count": 200}, {"cid": 2, "color": "#E15759", "label": "Community 2", "count": 161}, {"cid": 3, "color": "#76B7B2", "label": "Community 3", "count": 143}, {"cid": 4, "color": "#59A14F", "label": "Community 4", "count": 140}, {"cid": 5, "color": "#EDC948", "label": "Community 5", "count": 129}, {"cid": 6, "color": "#B07AA1", "label": "Community 6", "count": 117}, {"cid": 7, "color": "#FF9DA7", "label": "Community 7", "count": 111}, {"cid": 8, "color": "#9C755F", "label": "Community 8", "count": 101}, {"cid": 9, "color": "#BAB0AC", "label": "Community 9", "count": 99}, {"cid": 10, "color": "#4E79A7", "label": "Community 10", "count": 96}, {"cid": 11, "color": "#F28E2B", "label": "Community 11", "count": 80}, {"cid": 12, "color": "#E15759", "label": "Community 12", "count": 80}, {"cid": 13, "color": "#76B7B2", "label": "Community 13", "count": 77}, {"cid": 14, "color": "#59A14F", "label": "Community 14", "count": 72}, {"cid": 15, "color": "#EDC948", "label": "Community 15", "count": 71}, {"cid": 16, "color": "#B07AA1", "label": "Community 16", "count": 68}, {"cid": 17, "color": "#FF9DA7", "label": "Community 17", "count": 64}, {"cid": 18, "color": "#9C755F", "label": "Community 18", "count": 62}, {"cid": 19, "color": "#BAB0AC", "label": "Community 19", "count": 60}, {"cid": 20, "color": "#4E79A7", "label": "Community 20", "count": 57}, {"cid": 21, "color": "#F28E2B", "label": "Community 21", "count": 57}, {"cid": 22, "color": "#E15759", "label": "Community 22", "count": 53}, {"cid": 23, "color": "#76B7B2", "label": "Community 23", "count": 53}, {"cid": 24, "color": "#59A14F", "label": "Community 24", "count": 46}, {"cid": 25, "color": "#EDC948", "label": "Community 25", "count": 42}, {"cid": 26, "color": "#B07AA1", "label": "Community 26", "count": 37}, {"cid": 27, "color": "#FF9DA7", "label": "Community 27", "count": 35}, {"cid": 28, "color": "#9C755F", "label": "Community 28", "count": 35}, {"cid": 29, "color": "#BAB0AC", "label": "Community 29", "count": 33}, {"cid": 30, "color": "#4E79A7", "label": "Community 30", "count": 33}, {"cid": 31, "color": "#F28E2B", "label": "Community 31", "count": 25}, {"cid": 32, "color": "#E15759", "label": "Community 32", "count": 24}, {"cid": 33, "color": "#76B7B2", "label": "Community 33", "count": 23}, {"cid": 34, "color": "#59A14F", "label": "Community 34", "count": 22}, {"cid": 35, "color": "#EDC948", "label": "Community 35", "count": 19}, {"cid": 36, "color": "#B07AA1", "label": "Community 36", "count": 19}, {"cid": 37, "color": "#FF9DA7", "label": "Community 37", "count": 19}, {"cid": 38, "color": "#9C755F", "label": "Community 38", "count": 17}, {"cid": 39, "color": "#BAB0AC", "label": "Community 39", "count": 17}, {"cid": 40, "color": "#4E79A7", "label": "Community 40", "count": 16}, {"cid": 41, "color": "#F28E2B", "label": "Community 41", "count": 14}, {"cid": 42, "color": "#E15759", "label": "Community 42", "count": 14}, {"cid": 43, "color": "#76B7B2", "label": "Community 43", "count": 14}, {"cid": 44, "color": "#59A14F", "label": "Community 44", "count": 13}, {"cid": 45, "color": "#EDC948", "label": "Community 45", "count": 13}, {"cid": 46, "color": "#B07AA1", "label": "Community 46", "count": 12}, {"cid": 47, "color": "#FF9DA7", "label": "Community 47", "count": 11}, {"cid": 48, "color": "#9C755F", "label": "Community 48", "count": 9}, {"cid": 49, "color": "#BAB0AC", "label": "Community 49", "count": 9}, {"cid": 50, "color": "#4E79A7", "label": "Community 50", "count": 9}, {"cid": 51, "color": "#F28E2B", "label": "Community 51", "count": 9}, {"cid": 52, "color": "#E15759", "label": "Community 52", "count": 9}, {"cid": 53, "color": "#76B7B2", "label": "Community 53", "count": 9}, {"cid": 54, "color": "#59A14F", "label": "Community 54", "count": 8}, {"cid": 55, "color": "#EDC948", "label": "Community 55", "count": 8}, {"cid": 56, "color": "#B07AA1", "label": "Community 56", "count": 8}, {"cid": 57, "color": "#FF9DA7", "label": "Community 57", "count": 7}, {"cid": 58, "color": "#9C755F", "label": "Community 58", "count": 7}, {"cid": 59, "color": "#BAB0AC", "label": "Community 59", "count": 7}, {"cid": 60, "color": "#4E79A7", "label": "Community 60", "count": 6}, {"cid": 61, "color": "#F28E2B", "label": "Community 61", "count": 5}, {"cid": 62, "color": "#E15759", "label": "Community 62", "count": 5}, {"cid": 63, "color": "#76B7B2", "label": "Community 63", "count": 5}, {"cid": 64, "color": "#59A14F", "label": "Community 64", "count": 5}, {"cid": 65, "color": "#EDC948", "label": "Community 65", "count": 4}, {"cid": 66, "color": "#B07AA1", "label": "Community 66", "count": 4}, {"cid": 67, "color": "#FF9DA7", "label": "Community 67", "count": 4}, {"cid": 68, "color": "#9C755F", "label": "Community 68", "count": 4}, {"cid": 69, "color": "#BAB0AC", "label": "Community 69", "count": 4}, {"cid": 70, "color": "#4E79A7", "label": "CommLine truncated
const RAW_NODES = [{"id": "app_vue", "label": "App.vue", "color": {"background": "#E15759", "border": "#E15759", "highlight": {"background": "#ffffff", "border": "#E15759"}}, "size": 10.3, "font": {"size": 0, "color": "#ffffff"}, "title": "App.vue", "community": 52, "community_name": "Community 52", "source_file": "App.vue", "file_type": "code", "degree": 3}, {"id": "src_app_refreshbuttonautoicons", "label": "refreshButtonAutoIcons()", "color": {"background": "#E15759", "border": "#E15759", "highlight": {"background": "#ffffff", "border": "#E15759"}}, "size": 10.1, "font": {"size": 0, "color": "#ffffff"}, "title": "refreshButtonAutoIcons()", "community": 52, "community_name": "Community 52", "source_file": "App.vue", "file_type": "code", "degree": 1}, {"id": "src_app_refreshpaneltitleicons", "label": "refreshPanelTitleIcons()", "color": {"background": "#E15759", "border": "#E15759", "highlight": {"background": "#ffffff", "border": "#E15759"}}, "size": 10.1, "font": {"size": 0, "color": "#ffffff"}, "title": "refreshPanelTitleIcons()", "community": 52, "community_name": "Community 52", "source_file": "App.vue", "file_type": "code", "degree": 1}, {"id": "main_ts", "label": "main.ts", "color": {"background": "#E15759", "border": "#E15759", "highlight": {"background": "#ffffff", "border": "#E15759"}}, "size": 10.4, "font": {"size": 0, "color": "#ffffff"}, "title": "main.ts", "community": 52, "community_name": "Community 52", "source_file": "main.ts", "file_type": "code", "degree": 4}, {"id": "src_main_masksecret", "label": "maskSecret()", "color": {"background": "#E15759", "border": "#E15759", "highlight": {"background": "#ffffff", "border": "#E15759"}}, "size": 10.2, "font": {"size": 0, "color": "#ffffff"}, "title": "maskSecret()", "community": 52, "community_name": "Community 52", "source_file": "main.ts", "file_type": "code", "degree": 2}, {"id": "src_main_logapicryptobootinfo", "label": "logApiCryptoBootInfo()", "color": {"background": "#E15759", "border": "#E15759", "highlight": {"background": "#ffffff", "border": "#E15759"}}, "size": 10.2, "font": {"size": 0, "color": "#ffffff"}, "title": "logApiCryptoBootInfo()", "community": 52, "community_name": "Community 52", "source_file": "main.ts", "file_type": "code", "degree": 2}, {"id": "env_d_ts", "label": "env.d.ts", "color": {"background": "#FF9DA7", "border": "#FF9DA7", "highlight": {"background": "#ffffff", "border": "#FF9DA7"}}, "size": 10.0, "font": {"size": 0, "color": "#ffffff"}, "title": "env.d.ts", "community": 137, "community_name": "Community 137", "source_file": "env.d.ts", "file_type": "code", "degree": 0}, {"id": "shims_loose_d_ts", "label": "shims-loose.d.ts", "color": {"background": "#9C755F", "border": "#9C755F", "highlight": {"background": "#ffffff", "border": "#9C755F"}}, "size": 10.0, "font": {"size": 0, "color": "#ffffff"}, "title": "shims-loose.d.ts", "community": 138, "community_name": "Community 138", "source_file": "shims-loose.d.ts", "file_type": "code", "degree": 0}, {"id": "directives_index_ts", "label": "index.ts", "color": {"background": "#E15759", "border": "#E15759", "highlight": {"background": "#ffffff", "border": "#E15759"}}, "size": 10.1, "font": {"size": 0, "color": "#ffffff"}, "title": "index.ts", "community": 32, "community_name": "Community 32", "source_file": "directives/index.ts", "file_type": "code", "degree": 1}, {"id": "directives_index_setupglobdirectives", "label": "setupGlobDirectives()", "color": {"background": "#E15759", "border": "#E15759", "highlight": {"background": "#ffffff", "border": "#E15759"}}, "size": 10.4, "font": {"size": 0, "color": "#ffffff"}, "title": "setupGlobDirectives()", "community": 32, "community_name": "Community 32", "source_file": "directives/index.ts", "file_type": "code", "degree": 5}, {"id": "directives_core_roles_ts", "label": "roles.ts", "color": {"background": "#E15759", "border": "#E15759", "highlight": {"background": "#ffffff", "border": "#E15759"}}, "size": 10.3, "font": {"size": 0, "color": "#ffffff"}, "title": "roles.ts", "community": 32, "community_name": "Community 32", "source_file": "directives/core/roles.ts", "file_type": "code", "degree": 3}, {"id": "core_roles_checkrolepermission", "label": "checkRolePermission()", "color": {"background": "#E15759", "border": "#E15759", "highlight": {"background": "#ffffff", "border": "#E15759"}}, "size": 10.2, "font": {"size": 0, "color": "#ffffff"}, "title": "checkRolePermission()", "community": 32, "community_name": "Community 32", "source_file": "directives/core/roles.ts", "file_type": "code", "degree": 2}, {"id": "core_roles_removeelement", "label": "removeElement()", "color": {"background": "#E15759", "border": "#E15759", "highlight": {"background": "#ffffff", "border": "#E15759"}}, "size": 10.2, "font": {"size": 0, "color": "#ffffff"}, "title": "removeElement()", "community": 32, "community_name": "Community 32", "source_file": "directives/core/roles.ts", "file_type": "code", "degree": 2}, {"id": "core_roles_setuprolesdirective",Line truncated
const RAW_EDGES = [{"from": "app_vue", "to": "src_app_refreshbuttonautoicons", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "app_vue", "to": "src_app_refreshpaneltitleicons", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "app_vue", "to": "main_ts", "label": "imports_from", "title": "imports_from [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "main_ts", "to": "utils_sys_console_ts", "label": "imports_from", "title": "imports_from [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "main_ts", "to": "src_main_masksecret", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "main_ts", "to": "src_main_logapicryptobootinfo", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "src_main_masksecret", "to": "src_main_logapicryptobootinfo", "label": "calls", "title": "calls [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "directives_index_ts", "to": "directives_index_setupglobdirectives", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "directives_index_setupglobdirectives", "to": "core_auth_setupauthdirective", "label": "calls", "title": "calls [INFERRED]", "dashes": true, "width": 1, "color": {"opacity": 0.35}, "confidence": "INFERRED"}, {"from": "directives_index_setupglobdirectives", "to": "core_roles_setuprolesdirective", "label": "calls", "title": "calls [INFERRED]", "dashes": true, "width": 1, "color": {"opacity": 0.35}, "confidence": "INFERRED"}, {"from": "directives_index_setupglobdirectives", "to": "business_highlight_setuphighlightdirective", "label": "calls", "title": "calls [INFERRED]", "dashes": true, "width": 1, "color": {"opacity": 0.35}, "confidence": "INFERRED"}, {"from": "directives_index_setupglobdirectives", "to": "business_ripple_setuprippledirective", "label": "calls", "title": "calls [INFERRED]", "dashes": true, "width": 1, "color": {"opacity": 0.35}, "confidence": "INFERRED"}, {"from": "directives_core_roles_ts", "to": "core_roles_checkrolepermission", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "directives_core_roles_ts", "to": "core_roles_removeelement", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "directives_core_roles_ts", "to": "core_roles_setuprolesdirective", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "core_roles_checkrolepermission", "to": "core_roles_removeelement", "label": "calls", "title": "calls [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "directives_core_auth_ts", "to": "core_auth_checkauthpermission", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "directives_core_auth_ts", "to": "core_auth_removeelement", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "directives_core_auth_ts", "to": "core_auth_setupauthdirective", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "core_auth_checkauthpermission", "to": "core_auth_removeelement", "label": "calls", "title": "calls [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "directives_business_ripple_ts", "to": "business_ripple_setuprippledirective", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "directives_business_highlight_ts", "to": "business_highlight_highlightcode", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "directives_business_highlight_ts", "to": "business_highlight_insertlinenumbers", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "directives_business_highlight_ts", "to": "business_highlight_addcopybutton", "label": "contains", "title": "contains [EXTRACTED]", "dLine truncated
const LEGEND = [{"cid": 0, "color": "#4E79A7", "label": "Community 0", "count": 585}, {"cid": 1, "color": "#F28E2B", "label": "Community 1", "count": 232}, {"cid": 2, "color": "#E15759", "label": "Community 2", "count": 158}, {"cid": 3, "color": "#76B7B2", "label": "Community 3", "count": 139}, {"cid": 4, "color": "#59A14F", "label": "Community 4", "count": 131}, {"cid": 5, "color": "#EDC948", "label": "Community 5", "count": 122}, {"cid": 6, "color": "#B07AA1", "label": "Community 6", "count": 119}, {"cid": 7, "color": "#FF9DA7", "label": "Community 7", "count": 115}, {"cid": 8, "color": "#9C755F", "label": "Community 8", "count": 112}, {"cid": 9, "color": "#BAB0AC", "label": "Community 9", "count": 101}, {"cid": 10, "color": "#4E79A7", "label": "Community 10", "count": 99}, {"cid": 11, "color": "#F28E2B", "label": "Community 11", "count": 95}, {"cid": 12, "color": "#E15759", "label": "Community 12", "count": 90}, {"cid": 13, "color": "#76B7B2", "label": "Community 13", "count": 88}, {"cid": 14, "color": "#59A14F", "label": "Community 14", "count": 78}, {"cid": 15, "color": "#EDC948", "label": "Community 15", "count": 77}, {"cid": 16, "color": "#B07AA1", "label": "Community 16", "count": 73}, {"cid": 17, "color": "#FF9DA7", "label": "Community 17", "count": 70}, {"cid": 18, "color": "#9C755F", "label": "Community 18", "count": 62}, {"cid": 19, "color": "#BAB0AC", "label": "Community 19", "count": 59}, {"cid": 20, "color": "#4E79A7", "label": "Community 20", "count": 57}, {"cid": 21, "color": "#F28E2B", "label": "Community 21", "count": 53}, {"cid": 22, "color": "#E15759", "label": "Community 22", "count": 51}, {"cid": 23, "color": "#76B7B2", "label": "Community 23", "count": 46}, {"cid": 24, "color": "#59A14F", "label": "Community 24", "count": 42}, {"cid": 25, "color": "#EDC948", "label": "Community 25", "count": 37}, {"cid": 26, "color": "#B07AA1", "label": "Community 26", "count": 37}, {"cid": 27, "color": "#FF9DA7", "label": "Community 27", "count": 36}, {"cid": 28, "color": "#9C755F", "label": "Community 28", "count": 35}, {"cid": 29, "color": "#BAB0AC", "label": "Community 29", "count": 33}, {"cid": 30, "color": "#4E79A7", "label": "Community 30", "count": 29}, {"cid": 31, "color": "#F28E2B", "label": "Community 31", "count": 24}, {"cid": 32, "color": "#E15759", "label": "Community 32", "count": 22}, {"cid": 33, "color": "#76B7B2", "label": "Community 33", "count": 22}, {"cid": 34, "color": "#59A14F", "label": "Community 34", "count": 20}, {"cid": 35, "color": "#EDC948", "label": "Community 35", "count": 19}, {"cid": 36, "color": "#B07AA1", "label": "Community 36", "count": 17}, {"cid": 37, "color": "#FF9DA7", "label": "Community 37", "count": 17}, {"cid": 38, "color": "#9C755F", "label": "Community 38", "count": 16}, {"cid": 39, "color": "#BAB0AC", "label": "Community 39", "count": 14}, {"cid": 40, "color": "#4E79A7", "label": "Community 40", "count": 14}, {"cid": 41, "color": "#F28E2B", "label": "Community 41", "count": 14}, {"cid": 42, "color": "#E15759", "label": "Community 42", "count": 13}, {"cid": 43, "color": "#76B7B2", "label": "Community 43", "count": 13}, {"cid": 44, "color": "#59A14F", "label": "Community 44", "count": 9}, {"cid": 45, "color": "#EDC948", "label": "Community 45", "count": 9}, {"cid": 46, "color": "#B07AA1", "label": "Community 46", "count": 9}, {"cid": 47, "color": "#FF9DA7", "label": "Community 47", "count": 9}, {"cid": 48, "color": "#9C755F", "label": "Community 48", "count": 9}, {"cid": 49, "color": "#BAB0AC", "label": "Community 49", "count": 8}, {"cid": 50, "color": "#4E79A7", "label": "Community 50", "count": 8}, {"cid": 51, "color": "#F28E2B", "label": "Community 51", "count": 8}, {"cid": 52, "color": "#E15759", "label": "Community 52", "count": 7}, {"cid": 53, "color": "#76B7B2", "label": "Community 53", "count": 7}, {"cid": 54, "color": "#59A14F", "label": "Community 54", "count": 6}, {"cid": 55, "color": "#EDC948", "label": "Community 55", "count": 5}, {"cid": 56, "color": "#B07AA1", "label": "Community 56", "count": 5}, {"cid": 57, "color": "#FF9DA7", "label": "Community 57", "count": 5}, {"cid": 58, "color": "#9C755F", "label": "Community 58", "count": 4}, {"cid": 59, "color": "#BAB0AC", "label": "Community 59", "count": 4}, {"cid": 60, "color": "#4E79A7", "label": "Community 60", "count": 4}, {"cid": 61, "color": "#F28E2B", "label": "Community 61", "count": 4}, {"cid": 62, "color": "#E15759", "label": "Community 62", "count": 4}, {"cid": 63, "color": "#76B7B2", "label": "Community 63", "count": 4}, {"cid": 64, "color": "#59A14F", "label": "Community 64", "count": 4}, {"cid": 65, "color": "#EDC948", "label": "Community 65", "count": 3}, {"cid": 66, "color": "#B07AA1", "label": "Community 66", "count": 3}, {"cid": 67, "color": "#FF9DA7", "label": "Community 67", "count": 3}, {"cid": 68, "color": "#9C755F", "label": "Community 68", "count": 3}, {"cid": 69, "color": "#BAB0AC", "label": "Community 69", "count": 3}, {"cid": 70, "color": "#4E79A7", "label": "CommuniLine truncated
// HTML-escape helper — prevents XSS when injecting graph data into innerHTML
function esc(s) {
File diff suppressed because it is too large. Load diff
+9 -9
View File
@@ -17,8 +17,8 @@
"/Users/wuzilong/work/00code/zkxw/web-admin/src/types/common/index.ts": 1781272556.3597305,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/types/directive/directive.d.ts": 1781272556.3601494,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/types/api/api.d.ts": 1781272556.3606477,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/types/import/components.d.ts": 1791947524.2081869,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/types/import/auto-imports.d.ts": 1791947402.2822866,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/types/import/components.d.ts": 1792026466.2337976,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/types/import/auto-imports.d.ts": 1792026453.592733,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/types/store/index.ts": 1787887312.735774,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/types/router/index.ts": 1787887320.8486114,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/composables/useAttachmentActions.ts": 1788162977.6691713,
@@ -87,7 +87,7 @@
"/Users/wuzilong/work/00code/zkxw/web-admin/src/utils/sample-freight-flatten.ts": 1791468382.3859549,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/utils/protocol-payment-labels.ts": 1782893910.9937537,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/utils/oa-approval-print-flow.ts": 1786601489.1530275,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/utils/status-tag-registry.ts": 1791800783.158462,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/utils/status-tag-registry.ts": 1792028747.9199126,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/utils/production-work-order-card-meta.ts": 1788234947.3617282,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/utils/fetch-paged-list.ts": 1781272556.3903377,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/utils/protocol-audit-flatten.ts": 1791868355.944149,
@@ -347,7 +347,7 @@
"/Users/wuzilong/work/00code/zkxw/web-admin/src/components/business/clinical-schedule-payment-detail/index.vue": 1782893852.0159285,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/components/business/sample-qc-batch-readonly/index.vue": 1787104773.0737202,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/components/business/outbound-material-form-sections/index.vue": 1791328376.3002267,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/components/business/freight-unlink-dialog/index.vue": 1791785185.5377457,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/components/business/freight-unlink-dialog/index.vue": 1791955477.4567194,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/components/business/attachment-zip-progress-dialog/index.vue": 1782893851.6959429,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/components/business/payment-receipt-confirm-dialog/index.vue": 1791799714.5278995,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/components/business/protocol-payment-detail-readonly/index.vue": 1783330021.0864918,
@@ -439,7 +439,7 @@
"/Users/wuzilong/work/00code/zkxw/web-admin/src/api/customer-service-dict.ts": 1791860298.5249445,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/api/ethnic.ts": 1781272556.6658764,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/api/research-donation-sample-collection.ts": 1791187765.9137378,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/api/sample-freight.ts": 1791468380.799269,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/api/sample-freight.ts": 1791955262.6401658,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/api/qc-lab-test-item.ts": 1781272556.666375,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/api/cell-product.ts": 1785290097.6330564,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/api/sample-sms-notification.ts": 1781272556.666838,
@@ -466,14 +466,14 @@
"/Users/wuzilong/work/00code/zkxw/web-admin/src/views/cell-storage/presign-order/index.vue": 1791603964.5550117,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/views/cell-storage/presign-order/PresignOrderFormDialog.vue": 1791950659.2305272,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/views/cell-storage/refund-confirm/index.vue": 1782893854.3402505,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/views/cell-storage/sample-freight/index.vue": 1791785255.6524422,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/views/cell-storage/sample-freight/FreightConfigDialog.vue": 1791469261.2545865,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/views/cell-storage/sample-freight/index.vue": 1792029084.1036322,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/views/cell-storage/sample-freight/FreightConfigDialog.vue": 1792029084.6662757,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/views/cell-storage/sample-freight/FreightEditDialog.vue": 1791424830.3864272,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/views/cell-storage/my-material-usage/index.vue": 1791296731.262585,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/views/cell-storage/protocol/index.vue": 1791471097.8728843,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/views/cell-storage/protocol/ProtocolStatusChangeDialog.vue": 1782894806.0188534,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/views/cell-storage/protocol/ProtocolRefundRecordDialog.vue": 1791471058.669799,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/views/cell-storage/protocol/ProtocolViewDialog.vue": 1791860636.438133,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/views/cell-storage/protocol/ProtocolViewDialog.vue": 1792029038.7091923,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/views/cell-storage/protocol/ProtocolAttachmentReadonly.vue": 1791162227.1000674,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/views/cell-storage/protocol/ProtocolFormDialog.vue": 1791914003.9575415,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/views/cell-storage/protocol/SamplePaymentPanel.vue": 1791874376.61873,
@@ -483,7 +483,7 @@
"/Users/wuzilong/work/00code/zkxw/web-admin/src/views/cell-storage/sample-info/UnifiedSampleInfoPage.vue": 1791868912.5231571,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/views/cell-storage/sample-reception-info/index.vue": 1791200162.920515,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/views/cell-storage/payment-info/index.vue": 1791504621.1780708,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/views/cell-storage/payment-info/PaymentBySampleTab.vue": 1791800784.733568,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/views/cell-storage/payment-info/PaymentBySampleTab.vue": 1792028749.2656333,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/views/cell-storage/payment-info/PaymentExcelList.vue": 1791800787.8884168,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/views/cell-storage/storage-cert/index.vue": 1791199760.6008983,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/views/cell-storage/payment-chase/index.vue": 1791532837.8293414,
+7
View File
@@ -99,3 +99,10 @@ export function fetchUnlinkSampleFreight(id: string, items: SampleFreightItem[])
showSuccessMessage: true
})
}
export function fetchDeleteSampleFreight(id: string) {
return request.del<{ id: string; deleted?: boolean; linkedSampleCount?: number }>({
url: `/web/admin/sample-freights/${id}`,
showSuccessMessage: true
})
}
@@ -2,7 +2,7 @@
<template>
<el-dialog
:model-value="modelValue"
title="取消运费"
:title="title"
width="720px"
class="dialog-form-layout"
align-center
@@ -12,7 +12,7 @@
:close-on-click-modal="false"
@update:model-value="emit('update:modelValue', $event)"
>
<p class="unlink-hint">勾选要取消运费的样本:</p>
<p class="unlink-hint">{{ hint }}</p>
<el-table
ref="tableRef"
:data="items"
@@ -57,13 +57,23 @@
freightId: string
}
const props = defineProps<{
modelValue: boolean
items: FreightUnlinkRow[]
/** 默认勾选的 rowKey 列表 */
defaultSelectedKeys?: string[]
submitting?: boolean
}>()
const props = withDefaults(
defineProps<{
modelValue: boolean
items: FreightUnlinkRow[]
/** 默认勾选的 rowKey 列表 */
defaultSelectedKeys?: string[]
submitting?: boolean
title?: string
hint?: string
emptyWarning?: string
}>(),
{
title: '取消运费',
hint: '勾选要取消运费的样本:',
emptyWarning: '请勾选要取消运费的样本'
}
)
const emit = defineEmits<{
'update:modelValue': [boolean]
@@ -97,7 +107,7 @@
function onConfirm() {
if (!selected.value.length) {
ElMessage.warning('请勾选要取消运费的样本')
ElMessage.warning(props.emptyWarning)
return
}
emit('confirm', selected.value)
+12 -5
View File
@@ -177,10 +177,11 @@ ssh root@101.35.245.122 'chmod 600 /root/zkxw/cert/* && nginx -t && systemctl re
### 6.1 推荐:一键脚本
```bash
# 仓库根目录执行(默认:前端 build:test + rsync、后端 rsync、重启、验收)
# 仓库根目录执行(默认:web-admin + mobile-oa-h5 + 后端 rsync、重启、验收)
python3 测试环境部署/deploy_test_env.py
python3 测试环境部署/deploy_test_env.py --frontend-only # 仅前端
python3 测试环境部署/deploy_test_env.py --frontend-only # 仅 web-admin
python3 测试环境部署/deploy_test_env.py --oa-h5-only # 仅 mobile-oa-h5(市场部 / OA web-view)
python3 测试环境部署/deploy_test_env.py --backend-only # 仅后端并重启
python3 测试环境部署/deploy_test_env.py --verify # 仅验收
python3 测试环境部署/deploy_test_env.py --upload-env # 额外上传本机 backend/.env → 远端 .env.test
@@ -188,17 +189,22 @@ python3 测试环境部署/deploy_test_env.py --pip # 远端重新 p
python3 测试环境部署/deploy_test_env.py --health-timeout 90 # 重启后等待健康检查最长时间(默认 60s)
```
依赖本机:`python3`、`pnpm`、`rsync`、`ssh`/`scp`;密码登录需 `sshpass`。
依赖本机:`python3`、`pnpm`、`npm`、`rsync`、`ssh`/`scp`;密码登录需 `sshpass`。
SSH 密码默认读仓库根 `测试环境机器的账号密码`,或环境变量 `ZKXW_TEST_SSH_PASS`(**勿提交密码到 git**)。
发版若重启了后端,会先轮询 `127.0.0.1:10002/health`(再确认 Nginx `/health`)通过后再跑验收,避免瞬时 502。
发版若重启了后端,会先轮询 `127.0.0.1:10002/health`(再确认 Nginx `/health`)通过后再跑验收,避免瞬时 502。
后端 `start-test.sh restart` 会按 **PID 文件 + 端口 10002 上的本应用进程** 清理旧实例,避免 PID 失效时僵尸进程占端口、健康检查打到旧代码。
### 6.2 手工命令(等价)
```bash
# 前端
# 前端 web-admin
cd web-admin && pnpm build:test
rsync -avz --delete dist/ root@101.35.245.122:/root/zkxw/web-admin/dist/
# OA H5(市场部 / OA 表单 web-view)
cd mobile-oa-h5 && npm run build -- --mode test
rsync -avz --delete dist/ root@101.35.245.122:/root/zkxw/static/oa-h5/
# 后端
rsync -avz --exclude .venv --exclude venv --exclude '__pycache__' --exclude logs \
backend/ root@101.35.245.122:/root/zkxw/backend/
@@ -210,6 +216,7 @@ ssh root@101.35.245.122 \
**注意**:
- 前端须使用 `pnpm build:test`(读取 `web-admin/.env.test`),勿误用 `pnpm build`。
- OA H5 须使用 `npm run build -- --mode test`(读取 `mobile-oa-h5/.env.test`),产物同步到 `/root/zkxw/static/oa-h5`。
- rsync 默认不覆盖服务器 `.env.test`;配置变更用脚本 `--upload-env` 或单独 scp。
- rsync 排除 `.venv`,依赖变更时用脚本 `--pip` 或在机器上重新 `pip install -r requirements.txt`。
+67 -6
View File
@@ -5,8 +5,9 @@
在本机仓库根目录或任意目录执行均可(脚本会定位仓库根):
python3 测试环境部署/deploy_test_env.py # 前端打包 + 后端同步 + 重启
python3 测试环境部署/deploy_test_env.py # 前端 + OA H5 + 后端同步 + 重启
python3 测试环境部署/deploy_test_env.py --frontend-only
python3 测试环境部署/deploy_test_env.py --oa-h5-only # 仅 mobile-oa-h5(市场部 / OA web-view)
python3 测试环境部署/deploy_test_env.py --backend-only
python3 测试环境部署/deploy_test_env.py --verify
python3 测试环境部署/deploy_test_env.py --upload-env # 额外上传 backend/.env → 远端 .env.test
@@ -38,6 +39,7 @@ DEFAULT_USER = "root"
REMOTE_ROOT = "/root/zkxw"
REMOTE_BACKEND = f"{REMOTE_ROOT}/backend"
REMOTE_DIST = f"{REMOTE_ROOT}/web-admin/dist"
REMOTE_OA_H5 = f"{REMOTE_ROOT}/static/oa-h5"
BACKEND_HOST = "127.0.0.1"
BACKEND_PORT = "10002"
PUBLIC_HTTP_PORT = "10001"
@@ -187,6 +189,22 @@ def build_frontend(root: Path) -> None:
die(f"打包未生成 {index}")
def build_oa_h5(root: Path) -> None:
oa = root / "mobile-oa-h5"
if not (oa / "package.json").is_file():
die(f"未找到 OA H5 目录: {oa}")
require_bin("npm")
env = dict(os.environ)
env.setdefault("NODE_OPTIONS", "--max-old-space-size=4096")
if not (oa / "node_modules").is_dir():
info("mobile-oa-h5 未安装依赖,执行 npm ci …")
run(["npm", "ci", "--no-audit", "--no-fund"], cwd=oa, env=env)
run(["npm", "run", "build", "--", "--mode", "test"], cwd=oa, env=env)
index = oa / "dist" / "index.html"
if not index.is_file():
die(f"打包未生成 {index}")
def sync_frontend(args: argparse.Namespace, password: Optional[str], root: Path) -> None:
dist = root / "web-admin" / "dist"
if not (dist / "index.html").is_file():
@@ -206,6 +224,25 @@ def sync_frontend(args: argparse.Namespace, password: Optional[str], root: Path)
)
def sync_oa_h5(args: argparse.Namespace, password: Optional[str], root: Path) -> None:
dist = root / "mobile-oa-h5" / "dist"
if not (dist / "index.html").is_file():
die("本地无 mobile-oa-h5/dist/index.html,请先打包或去掉 --skip-build")
ssh_run(args, password, f"mkdir -p {REMOTE_OA_H5}")
rsync_to(
args,
password,
f"{dist}/",
f"{REMOTE_OA_H5}/",
delete=True,
)
ssh_run(
args,
password,
f"chmod 755 /root && chmod -R a+rX {REMOTE_ROOT}/static",
)
def sync_backend(args: argparse.Namespace, password: Optional[str], root: Path) -> None:
backend = root / "backend"
if not (backend / "start-test.sh").is_file():
@@ -339,6 +376,8 @@ def verify(args: argparse.Namespace) -> None:
("首页", f"{base}/", True),
("health", f"{base}/health", False),
("login-rsa", f"{base}/api/web/auth/login-rsa-public-key", True),
("oa-h5", f"{base}/oa-h5/", True),
("oa-h5-market", f"{base}/oa-h5/market/specialist/presign", True),
]
ok = True
for name, url, code_only in checks:
@@ -404,10 +443,15 @@ def parse_args(argv: Optional[Sequence[str]] = None) -> argparse.Namespace:
help="密码文件路径(默认:仓库根/测试环境机器的账号密码)",
)
g = p.add_mutually_exclusive_group()
g.add_argument("--frontend-only", action="store_true", help="仅前端打包并上传")
g.add_argument("--frontend-only", action="store_true", help="仅 web-admin 打包并上传")
g.add_argument("--oa-h5-only", action="store_true", help="仅 mobile-oa-h5 打包并上传到 /oa-h5/")
g.add_argument("--backend-only", action="store_true", help="仅同步后端并重启")
g.add_argument("--verify", action="store_true", help="仅跑验收 curl")
p.add_argument("--skip-build", action="store_true", help="前端跳过 pnpm build:test,直接上传已有 dist")
p.add_argument(
"--skip-build",
action="store_true",
help="跳过本地构建,直接上传已有 dist(web-admin / mobile-oa-h5)",
)
p.add_argument("--skip-restart", action="store_true", help="同步后端后不重启")
p.add_argument("--upload-env", action="store_true", help="上传本机 backend/.env 为远端 .env.test")
p.add_argument("--pip", action="store_true", help="远端执行 pip install -r requirements.txt")
@@ -443,8 +487,16 @@ def main(argv: Optional[Sequence[str]] = None) -> None:
elif password:
info("已加载 SSH 密码(来自参数/环境变量/密码文件)")
do_fe = not args.backend_only
do_be = not args.frontend_only
# 全量发版含 OA H5;--frontend-only 仅 web-admin;--oa-h5-only 仅 OA H5
if args.frontend_only:
do_fe, do_oa, do_be = True, False, False
elif args.oa_h5_only:
do_fe, do_oa, do_be = False, True, False
elif args.backend_only:
do_fe, do_oa, do_be = False, False, True
else:
do_fe, do_oa, do_be = True, True, True
did_restart = False
if do_fe:
@@ -456,6 +508,15 @@ def main(argv: Optional[Sequence[str]] = None) -> None:
info("上传前端 dist …")
sync_frontend(args, password, root)
if do_oa:
if not args.skip_build:
info("开始 OA H5 打包 npm run build -- --mode test …")
build_oa_h5(root)
else:
info("跳过打包,使用现有 mobile-oa-h5/dist")
info("上传 OA H5 dist → /oa-h5/ …")
sync_oa_h5(args, password, root)
if do_be:
info("同步后端源码 …")
sync_backend(args, password, root)
@@ -475,7 +536,7 @@ def main(argv: Optional[Sequence[str]] = None) -> None:
if did_restart:
wait_for_health(args, password, prefer_ssh=True)
else:
# 仅前端发版:仍确认当前后端/Nginx 可用再验收
# 仅前端 / OA H5 发版:仍确认当前后端/Nginx 可用再验收
wait_for_health(args, password, prefer_ssh=False)
info("发版后验收 …")
verify(args)