浏览代码

feat: 完善纪检反馈平台管理功能与移动端体验

- 增加角色维护、多联系方式配置和举报人单位职务字段
- 完善附件预览、上传校验及权限错误处理
- 更新管理端与移动端页面、品牌素材和交互
- 补充数据库迁移、测试、启动配置和部署文档

验证:后端 66 项测试通过;管理端与移动端 H5 构建通过。
wuzilong 3 周之前
父节点
当前提交
584d219f49
共有 83 个文件被更改,包括 2731 次插入 和 525 次删除
  1. 72 1
      backend/app/api/admin.py
  2. 1 5
      backend/app/core/upload_validate.py
  3. 4 0
      backend/app/crud/feedback.py
  4. 12 2
      backend/app/crud/oper_log.py
  5. 63 1
      backend/app/crud/role.py
  6. 5 3
      backend/app/models/business.py
  7. 5 0
      backend/app/schemas/business.py
  8. 11 0
      backend/app/schemas/system.py
  9. 2 0
      backend/app/services/admin_ledger_service.py
  10. 65 7
      backend/app/services/config_service.py
  11. 4 0
      backend/app/services/feedback_service.py
  12. 5 3
      backend/docs/sql/001_init.sql
  13. 4 0
      backend/docs/sql/002_feedback_reporter_unit_post.sql
  14. 2 0
      backend/docs/sql/003_hotline_phone_widen.sql
  15. 3 0
      backend/docs/sql/004_hotline_email_address_widen.sql
  16. 43 7
      backend/start.sh
  17. 127 0
      backend/tests/test_hotline_phones.py
  18. 18 0
      backend/tests/test_public_feedback.py
  19. 154 0
      backend/tests/test_role_menus.py
  20. 6 6
      backend/tests/test_upload.py
  21. 5 0
      backend/tests/test_upload_validate.py
  22. 6 2
      docs/deploy-test.md
  23. 二进制
      docs/安建医院纪检数字化监督平台-系统建设内容.docx
  24. 216 20
      mobile-wx/App.vue
  25. 1 1
      mobile-wx/config/api.js
  26. 5 0
      mobile-wx/manifest.json
  27. 25 0
      mobile-wx/package.json
  28. 50 50
      mobile-wx/pages.json
  29. 36 9
      mobile-wx/pages/feedback/index.vue
  30. 262 72
      mobile-wx/pages/home/index.vue
  31. 223 36
      mobile-wx/pages/hotline/index.vue
  32. 64 32
      mobile-wx/pages/notice/index.vue
  33. 36 9
      mobile-wx/pages/suggest/index.vue
  34. 1 0
      mobile-wx/src/App.vue
  35. 1 0
      mobile-wx/src/api
  36. 1 0
      mobile-wx/src/config
  37. 1 0
      mobile-wx/src/index.html
  38. 1 0
      mobile-wx/src/main.js
  39. 1 0
      mobile-wx/src/manifest.json
  40. 1 0
      mobile-wx/src/pages
  41. 1 0
      mobile-wx/src/pages.json
  42. 1 0
      mobile-wx/src/static
  43. 1 0
      mobile-wx/src/uni.promisify.adaptor.js
  44. 1 0
      mobile-wx/src/uni.scss
  45. 1 0
      mobile-wx/src/utils
  46. 二进制
      mobile-wx/static/_orig/ajyy.jpeg
  47. 二进制
      mobile-wx/static/_orig/home-banner.png
  48. 二进制
      mobile-wx/static/_orig/logo1.png
  49. 二进制
      mobile-wx/static/ajyy.jpeg
  50. 二进制
      mobile-wx/static/home-banner.jpg
  51. 二进制
      mobile-wx/static/home-banner.png
  52. 1 0
      mobile-wx/static/icons/edit.svg
  53. 1 0
      mobile-wx/static/icons/location.svg
  54. 1 0
      mobile-wx/static/icons/mail.svg
  55. 1 0
      mobile-wx/static/icons/phone-red.svg
  56. 1 0
      mobile-wx/static/icons/phone.svg
  57. 1 0
      mobile-wx/static/icons/qrcode.svg
  58. 1 0
      mobile-wx/static/icons/shield.svg
  59. 二进制
      mobile-wx/static/logo1.jpg
  60. 二进制
      mobile-wx/static/logo1.png
  61. 76 76
      mobile-wx/uni.scss
  62. 118 51
      mobile-wx/utils/upload.js
  63. 9 0
      mobile-wx/vite.config.js
  64. 67 0
      nginx-ajyy.conf
  65. 0 0
      openspec/changes/archive/.gitkeep
  66. 32 0
      openspec/config.yaml
  67. 0 0
      openspec/specs/.gitkeep
  68. 2 9
      web-admin/package-lock.json
  69. 68 4
      web-admin/src/api/admin.ts
  70. 二进制
      web-admin/src/assets/logo1.jpeg
  71. 255 0
      web-admin/src/components/AttachmentGrid.vue
  72. 24 4
      web-admin/src/layouts/AdminLayout.vue
  73. 3 2
      web-admin/src/router/index.ts
  74. 12 6
      web-admin/src/stores/user.ts
  75. 15 0
      web-admin/src/styles/index.css
  76. 53 0
      web-admin/src/utils/attachment.ts
  77. 40 8
      web-admin/src/utils/http.ts
  78. 26 6
      web-admin/src/views/audit/index.vue
  79. 42 28
      web-admin/src/views/feedback/index.vue
  80. 95 14
      web-admin/src/views/hotline/index.vue
  81. 33 7
      web-admin/src/views/login/index.vue
  82. 162 10
      web-admin/src/views/role/index.vue
  83. 45 34
      web-admin/src/views/suggestion/index.vue

+ 72 - 1
backend/app/api/admin.py

@@ -24,7 +24,9 @@ from app.models.system import SysUser
 from app.schemas.business import HotlineUpdateBody, QrcodeUpdateBody, StatusUpdateBody
 from app.schemas.system import (
     ResetPasswordBody,
+    RoleCreateBody,
     RoleMenusBody,
+    RoleUpdateBody,
     UserCreateBody,
     UserUpdateBody,
 )
@@ -207,7 +209,9 @@ def put_hotline(
             phone=body.phone,
             phones=body.phones,
             email=body.email,
+            emails=body.emails,
             address=body.address,
+            addresses=body.addresses,
             work_time=body.work_time,
         )
     )
@@ -389,6 +393,65 @@ def list_roles(
     return success_response([_role_to_dict(r) for r in role_crud.list_roles(db)])
 
 
+@router.post("/roles")
+def create_role(
+    body: RoleCreateBody,
+    db: Annotated[Session, Depends(get_db)],
+    _user: Annotated[SysUser, Depends(require_menu("role:grant"))],
+):
+    role_code = (body.role_code or "").strip()
+    role_name = (body.role_name or "").strip()
+    remark = (body.remark or "").strip() if body.remark is not None else ""
+    if not role_code or not role_name:
+        raise AppHTTPError(400, "角色编码、角色名称不能为空")
+    if role_crud.get_role_by_code(db, role_code):
+        raise AppHTTPError(400, "角色编码已存在")
+    row = role_crud.create_role(
+        db, role_code=role_code, role_name=role_name, remark=remark or None
+    )
+    return success_response(_role_to_dict(row))
+
+
+@router.put("/roles/{role_id}")
+def update_role(
+    role_id: str,
+    body: RoleUpdateBody,
+    db: Annotated[Session, Depends(get_db)],
+    _user: Annotated[SysUser, Depends(require_menu("role:grant"))],
+):
+    row = role_crud.get_role_by_id(db, role_id)
+    if not row:
+        raise AppHTTPError(400, "角色不存在")
+    role_name = body.role_name
+    if role_name is not None:
+        role_name = role_name.strip()
+        if not role_name:
+            raise AppHTTPError(400, "角色名称不能为空")
+    remark = body.remark
+    if remark is not None:
+        remark = remark.strip()
+    updated = role_crud.update_role(db, row, role_name=role_name, remark=remark)
+    return success_response(_role_to_dict(updated))
+
+
+@router.delete("/roles/{role_id}")
+def delete_role(
+    role_id: str,
+    db: Annotated[Session, Depends(get_db)],
+    _user: Annotated[SysUser, Depends(require_menu("role:grant"))],
+):
+    row = role_crud.get_role_by_id(db, role_id)
+    if not row:
+        raise AppHTTPError(400, "角色不存在")
+    if row.role_code == "admin":
+        raise AppHTTPError(400, "系统管理员角色不可删除")
+    user_count = role_crud.count_users_for_role(db, role_id)
+    if user_count > 0:
+        raise AppHTTPError(400, f"该角色下仍有 {user_count} 个用户,无法删除")
+    role_crud.delete_role(db, row)
+    return success_response({"id": role_id})
+
+
 @router.get("/menus/tree")
 def menus_tree(
     db: Annotated[Session, Depends(get_db)],
@@ -436,8 +499,16 @@ def list_oper_logs(
     _user: Annotated[SysUser, Depends(require_menu("audit"))],
     page: int = Query(1, ge=1),
     pageSize: int = Query(10, ge=1, le=100),
+    username: Optional[str] = Query(None),
+    keyword: Optional[str] = Query(None),
 ):
-    items, total = oper_log_crud.list_oper_logs(db, page=page, page_size=pageSize)
+    items, total = oper_log_crud.list_oper_logs(
+        db,
+        username=username,
+        keyword=keyword,
+        page=page,
+        page_size=pageSize,
+    )
     return success_response(
         {
             "list": [_oper_log_to_dict(r) for r in items],

+ 1 - 5
backend/app/core/upload_validate.py

@@ -1,4 +1,4 @@
-"""上传文件校验:扩展名白名单与大小限制。"""
+"""上传文件校验:扩展名白名单与内容 magic。"""
 from __future__ import annotations
 
 import os
@@ -28,8 +28,6 @@ ALLOWED_EXTENSIONS = {
 
 IMAGE_EXTENSIONS = {".jpg", ".jpeg", ".png", ".gif", ".webp", ".bmp"}
 
-MAX_UPLOAD_BYTES = 20 * 1024 * 1024  # 20MB
-
 
 def _starts_with(prefix: bytes) -> Callable[[bytes], bool]:
     def check(content: bytes) -> bool:
@@ -70,8 +68,6 @@ def validate_upload(filename: Optional[str], content: bytes) -> None:
     ext = file_extension(filename)
     if ext not in ALLOWED_EXTENSIONS:
         raise AppHTTPError(400, "不支持的文件类型")
-    if len(content) > MAX_UPLOAD_BYTES:
-        raise AppHTTPError(400, "文件过大,单文件不超过 20MB")
     magic_check = _MAGIC_CHECKS.get(ext)
     if magic_check is not None and not magic_check(content):
         raise AppHTTPError(400, "文件内容与扩展名不符")

+ 4 - 0
backend/app/crud/feedback.py

@@ -37,6 +37,8 @@ def create_feedback(
     target_dept: Optional[str] = None,
     target_post: Optional[str] = None,
     reporter_name: Optional[str] = None,
+    reporter_unit: Optional[str] = None,
+    reporter_post: Optional[str] = None,
     reporter_phone: Optional[str] = None,
     attachments: Optional[List[str]] = None,
     status: str = "待处理",
@@ -49,6 +51,8 @@ def create_feedback(
         target_dept=target_dept,
         target_post=target_post,
         reporter_name=reporter_name,
+        reporter_unit=reporter_unit,
+        reporter_post=reporter_post,
         reporter_phone=reporter_phone,
         attachments=list(attachments or []),
         status=status,

+ 12 - 2
backend/app/crud/oper_log.py

@@ -33,9 +33,19 @@ def create_oper_log(
 
 
 def list_oper_logs(
-    db: Session, *, page: int = 1, page_size: int = 10
+    db: Session,
+    *,
+    username: Optional[str] = None,
+    keyword: Optional[str] = None,
+    page: int = 1,
+    page_size: int = 10,
 ) -> Tuple[List[OperLog], int]:
-    q = db.query(OperLog).order_by(OperLog.create_time.desc())
+    q = db.query(OperLog)
+    if username:
+        q = q.filter(OperLog.username.like(f"%{username}%"))
+    if keyword:
+        q = q.filter(OperLog.detail.like(f"%{keyword}%"))
+    q = q.order_by(OperLog.create_time.desc())
     total = q.count()
     items = q.offset((page - 1) * page_size).limit(page_size).all()
     return items, total

+ 63 - 1
backend/app/crud/role.py

@@ -1,10 +1,11 @@
 """角色 CRUD"""
 import uuid
+from datetime import datetime
 from typing import List, Optional
 
 from sqlalchemy.orm import Session
 
-from app.models.system import SysRole, SysRoleMenu
+from app.models.system import SysRole, SysRoleMenu, SysUser
 
 
 def list_roles(db: Session) -> List[SysRole]:
@@ -24,6 +25,67 @@ def get_role_by_id(db: Session, role_id: str) -> Optional[SysRole]:
     )
 
 
+def get_role_by_code(db: Session, role_code: str) -> Optional[SysRole]:
+    return (
+        db.query(SysRole)
+        .filter(SysRole.role_code == role_code, SysRole.del_flag == "0")
+        .first()
+    )
+
+
+def create_role(
+    db: Session,
+    *,
+    role_code: str,
+    role_name: str,
+    remark: Optional[str] = None,
+) -> SysRole:
+    row = SysRole(
+        id=str(uuid.uuid4()),
+        role_code=role_code,
+        role_name=role_name,
+        remark=remark or None,
+    )
+    db.add(row)
+    db.commit()
+    db.refresh(row)
+    return row
+
+
+def update_role(
+    db: Session,
+    row: SysRole,
+    *,
+    role_name: Optional[str] = None,
+    remark: Optional[str] = None,
+) -> SysRole:
+    if role_name is not None:
+        row.role_name = role_name
+    if remark is not None:
+        row.remark = remark or None
+    row.update_time = datetime.utcnow()
+    db.commit()
+    db.refresh(row)
+    return row
+
+
+def count_users_for_role(db: Session, role_id: str) -> int:
+    return (
+        db.query(SysUser)
+        .filter(SysUser.role_id == role_id, SysUser.del_flag == "0")
+        .count()
+    )
+
+
+def delete_role(db: Session, row: SysRole) -> None:
+    db.query(SysRoleMenu).filter(SysRoleMenu.role_id == row.id).delete(
+        synchronize_session=False
+    )
+    row.del_flag = "1"
+    row.update_time = datetime.utcnow()
+    db.commit()
+
+
 def list_menu_ids_for_role(db: Session, role_id: str) -> List[str]:
     rows = (
         db.query(SysRoleMenu.menu_id)

+ 5 - 3
backend/app/models/business.py

@@ -23,6 +23,8 @@ class Feedback(Base):
     target_post = Column(String(64), nullable=True)
     content = Column(Text, nullable=False)
     reporter_name = Column(String(64), nullable=True)
+    reporter_unit = Column(String(128), nullable=True)
+    reporter_post = Column(String(64), nullable=True)
     reporter_phone = Column(String(32), nullable=True)
     attachments = Column(JSON, nullable=False, default=list)
     status = Column(String(16), nullable=False, default="待处理")  # 待处理|处理中|已办结
@@ -58,9 +60,9 @@ class HotlineConfig(Base):
     __tablename__ = "hotline_config"
 
     id = Column(String(64), primary_key=True, default=_uuid)
-    phone = Column(String(64), nullable=True, default="")
-    email = Column(String(128), nullable=True, default="")
-    address = Column(String(255), nullable=True, default="")
+    phone = Column(String(512), nullable=True, default="")
+    email = Column(String(512), nullable=True, default="")
+    address = Column(String(1024), nullable=True, default="")
     work_time = Column(String(255), nullable=True, default="")
     del_flag = Column(String(1), nullable=False, default="0")
     create_time = Column(DateTime, default=datetime.utcnow)

+ 5 - 0
backend/app/schemas/business.py

@@ -23,6 +23,8 @@ class FeedbackCreateBody(CamelModel):
     target_dept: Optional[str] = None
     target_post: Optional[str] = None
     reporter_name: Optional[str] = None
+    reporter_unit: Optional[str] = None
+    reporter_post: Optional[str] = None
     reporter_phone: Optional[str] = None
     attachment_urls: Optional[List[str]] = None
 
@@ -43,8 +45,11 @@ class StatusUpdateBody(CamelModel):
 
 class HotlineUpdateBody(CamelModel):
     phone: Optional[str] = None
+    phones: Optional[List[str]] = None
     email: Optional[str] = None
+    emails: Optional[List[str]] = None
     address: Optional[str] = None
+    addresses: Optional[List[str]] = None
     work_time: Optional[str] = None
 
 

+ 11 - 0
backend/app/schemas/system.py

@@ -33,5 +33,16 @@ class ResetPasswordBody(CamelModel):
     password: str
 
 
+class RoleCreateBody(CamelModel):
+    role_code: str
+    role_name: str
+    remark: Optional[str] = None
+
+
+class RoleUpdateBody(CamelModel):
+    role_name: Optional[str] = None
+    remark: Optional[str] = None
+
+
 class RoleMenusBody(CamelModel):
     menu_ids: List[str]

+ 2 - 0
backend/app/services/admin_ledger_service.py

@@ -39,6 +39,8 @@ def feedback_to_dict(row: Feedback) -> Dict[str, Any]:
         "targetPost": row.target_post,
         "content": row.content,
         "reporterName": row.reporter_name,
+        "reporterUnit": row.reporter_unit,
+        "reporterPost": row.reporter_post,
         "reporterPhone": row.reporter_phone,
         "attachmentUrls": list(row.attachments or []),
         "status": row.status,

+ 65 - 7
backend/app/services/config_service.py

@@ -1,5 +1,6 @@
 """热线 / 二维码配置读写"""
-from typing import Any, Dict, Optional
+import re
+from typing import Any, Dict, List, Optional
 
 from sqlalchemy.orm import Session
 
@@ -7,16 +8,51 @@ from app.core.response import AppHTTPError
 from app.crud import config as config_crud
 from app.crud import oper_log as oper_log_crud
 
+_MULTI_SPLIT_RE = re.compile(r"[,,、;\n\r]+")
+
+
+def parse_multi(raw: Optional[str]) -> List[str]:
+    """将存储串拆成去重后的列表(兼容逗号/顿号/分号/换行)。"""
+    if not raw or not str(raw).strip():
+        return []
+    seen = set()
+    out: List[str] = []
+    for part in _MULTI_SPLIT_RE.split(str(raw)):
+        item = part.strip()
+        if not item or item in seen:
+            continue
+        seen.add(item)
+        out.append(item)
+    return out
+
+
+def join_multi(items: Optional[List[str]]) -> str:
+    """规范化列表为逗号分隔存储串。"""
+    if not items:
+        return ""
+    return ",".join(parse_multi(",".join(str(p) for p in items if p is not None)))
+
+
+# 兼容旧名称
+parse_phones = parse_multi
+join_phones = join_multi
+
 
 def get_hotline_payload(db: Session) -> Dict[str, Any]:
     row = config_crud.get_hotline(db)
     if not row:
         raise AppHTTPError(404, "热线配置不存在")
+    phones = parse_multi(row.phone)
+    emails = parse_multi(row.email)
+    addresses = parse_multi(row.address)
     return {
         "id": row.id,
-        "phone": row.phone or "",
-        "email": row.email or "",
-        "address": row.address or "",
+        "phone": phones[0] if phones else "",
+        "phones": phones,
+        "email": emails[0] if emails else "",
+        "emails": emails,
+        "address": addresses[0] if addresses else "",
+        "addresses": addresses,
         "workTime": row.work_time or "",
     }
 
@@ -38,19 +74,41 @@ def update_hotline(
     user,
     *,
     phone: Optional[str] = None,
+    phones: Optional[List[str]] = None,
     email: Optional[str] = None,
+    emails: Optional[List[str]] = None,
     address: Optional[str] = None,
+    addresses: Optional[List[str]] = None,
     work_time: Optional[str] = None,
 ) -> Dict[str, Any]:
     row = config_crud.get_hotline(db)
     if not row:
         raise AppHTTPError(404, "热线配置不存在")
+
+    stored_phone = phone
+    if phones is not None:
+        stored_phone = join_multi(phones)
+    elif phone is not None:
+        stored_phone = join_multi(parse_multi(phone))
+
+    stored_email = email
+    if emails is not None:
+        stored_email = join_multi(emails)
+    elif email is not None:
+        stored_email = join_multi(parse_multi(email))
+
+    stored_address = address
+    if addresses is not None:
+        stored_address = join_multi(addresses)
+    elif address is not None:
+        stored_address = join_multi(parse_multi(address))
+
     config_crud.update_hotline(
         db,
         row,
-        phone=phone,
-        email=email,
-        address=address,
+        phone=stored_phone,
+        email=stored_email,
+        address=stored_address,
         work_time=work_time,
         update_by=user.username,
     )

+ 4 - 0
backend/app/services/feedback_service.py

@@ -16,6 +16,8 @@ def submit_feedback(
     target_dept: Optional[str] = None,
     target_post: Optional[str] = None,
     reporter_name: Optional[str] = None,
+    reporter_unit: Optional[str] = None,
+    reporter_post: Optional[str] = None,
     reporter_phone: Optional[str] = None,
     attachment_urls: Optional[List[str]] = None,
 ) -> Dict[str, Any]:
@@ -34,6 +36,8 @@ def submit_feedback(
         target_dept=target_dept,
         target_post=target_post,
         reporter_name=reporter_name,
+        reporter_unit=reporter_unit,
+        reporter_post=reporter_post,
         reporter_phone=reporter_phone,
         attachments=attachment_urls,
         status="待处理",

+ 5 - 3
backend/docs/sql/001_init.sql

@@ -72,6 +72,8 @@ CREATE TABLE IF NOT EXISTS `feedback` (
   `target_post` varchar(64) DEFAULT NULL,
   `content` text NOT NULL,
   `reporter_name` varchar(64) DEFAULT NULL,
+  `reporter_unit` varchar(128) DEFAULT NULL,
+  `reporter_post` varchar(64) DEFAULT NULL,
   `reporter_phone` varchar(32) DEFAULT NULL,
   `attachments` json DEFAULT NULL,
   `status` varchar(16) NOT NULL DEFAULT '待处理' COMMENT '待处理|处理中|已办结',
@@ -107,9 +109,9 @@ CREATE TABLE IF NOT EXISTS `suggestion` (
 
 CREATE TABLE IF NOT EXISTS `hotline_config` (
   `id` varchar(64) NOT NULL,
-  `phone` varchar(64) DEFAULT '',
-  `email` varchar(128) DEFAULT '',
-  `address` varchar(255) DEFAULT '',
+  `phone` varchar(512) DEFAULT '',
+  `email` varchar(512) DEFAULT '',
+  `address` varchar(1024) DEFAULT '',
   `work_time` varchar(255) DEFAULT '',
   `del_flag` varchar(1) NOT NULL DEFAULT '0',
   `create_time` datetime DEFAULT NULL,

+ 4 - 0
backend/docs/sql/002_feedback_reporter_unit_post.sql

@@ -0,0 +1,4 @@
+-- 反馈表补充举报人单位、职务(对齐原型表单)
+ALTER TABLE `feedback`
+  ADD COLUMN `reporter_unit` varchar(128) DEFAULT NULL AFTER `reporter_name`,
+  ADD COLUMN `reporter_post` varchar(64) DEFAULT NULL AFTER `reporter_unit`;

+ 2 - 0
backend/docs/sql/003_hotline_phone_widen.sql

@@ -0,0 +1,2 @@
+-- 监督电话支持多个号码(逗号分隔),加宽 phone 字段
+ALTER TABLE `hotline_config` MODIFY COLUMN `phone` varchar(512) DEFAULT '';

+ 3 - 0
backend/docs/sql/004_hotline_email_address_widen.sql

@@ -0,0 +1,3 @@
+-- 热线邮箱/地址支持多值存储(逗号分隔),加宽字段
+ALTER TABLE `hotline_config` MODIFY COLUMN `email` varchar(512) DEFAULT '';
+ALTER TABLE `hotline_config` MODIFY COLUMN `address` varchar(1024) DEFAULT '';

+ 43 - 7
backend/start.sh

@@ -65,19 +65,47 @@ show_help() {
 EOF
 }
 
+# 代码使用 PEP604 (X | Y) 等语法,创建 venv 时优先 3.10+
+resolve_python() {
+  local cand ver major minor
+  for cand in \
+    "${PYTHON_BIN:-}" \
+    python3.12 python3.11 python3.10 \
+    "${HOME}/.pyenv/versions/3.12.13/bin/python3" \
+    "${HOME}/.pyenv/versions/3.12.13/bin/python" \
+    python3
+  do
+    [ -n "$cand" ] || continue
+    if ! command -v "$cand" >/dev/null 2>&1 && [ ! -x "$cand" ]; then
+      continue
+    fi
+    ver="$("$cand" -c 'import sys; print("%d.%d" % sys.version_info[:2])' 2>/dev/null)" || continue
+    major="${ver%%.*}"
+    minor="${ver#*.}"
+    if [ "$major" -gt 3 ] || { [ "$major" -eq 3 ] && [ "$minor" -ge 10 ]; }; then
+      echo "$cand"
+      return 0
+    fi
+  done
+  return 1
+}
+
 check_python() {
-  if ! command -v python3 >/dev/null 2>&1; then
-    log_error "未找到 python3,请先安装 Python 3.9+"
+  local py
+  if ! py="$(resolve_python)"; then
+    log_error "未找到 Python 3.10+(当前系统 python3 可能过旧)。可用: pyenv install 3.12 && pyenv local 3.12"
     exit 1
   fi
+  HOST_PYTHON="$py"
   local ver
-  ver="$(python3 -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')"
-  log_info "Python 版本: $ver"
+  ver="$("$HOST_PYTHON" -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')"
+  log_info "Python 版本: $ver ($HOST_PYTHON)"
 }
 
 create_venv() {
+  check_python
   log_info "创建虚拟环境: $VENV_DIR"
-  python3 -m venv "$VENV_DIR"
+  "$HOST_PYTHON" -m venv "$VENV_DIR"
   log_success "虚拟环境已创建"
 }
 
@@ -108,12 +136,20 @@ ensure_env_file() {
   fi
 }
 
+venv_usable() {
+  # 路径迁移/换机后 shebang 可能仍指向旧解释器
+  [ -x "$PYTHON" ] && "$PYTHON" -c "import sys" >/dev/null 2>&1
+}
+
 check_env() {
   if [ ! -d "$VENV_DIR" ]; then
     log_warn "虚拟环境不存在,正在创建并安装依赖..."
     install_dependencies
-  fi
-  if ! "$PYTHON" -c "import fastapi" >/dev/null 2>&1; then
+  elif ! venv_usable; then
+    log_warn "虚拟环境不可用(解释器路径失效),正在重建..."
+    rm -rf "$VENV_DIR"
+    install_dependencies
+  elif ! "$PYTHON" -c "import fastapi" >/dev/null 2>&1; then
     log_warn "依赖不完整,正在安装..."
     install_dependencies
   fi

+ 127 - 0
backend/tests/test_hotline_phones.py

@@ -0,0 +1,127 @@
+"""Hotline multi-phone / email / address parse / API."""
+import pytest
+
+from app.services.config_service import join_multi, parse_multi
+
+
+def _login(client, username: str, password: str) -> dict:
+    r = client.post(
+        "/api/web/auth/login", json={"username": username, "password": password}
+    )
+    assert r.status_code == 200, r.text
+    token = r.json()["data"]["token"]
+    return {"Authorization": f"Bearer {token}"}
+
+
+@pytest.fixture()
+def admin_headers(client):
+    return _login(client, "admin", "Admin@123")
+
+
+def test_parse_multi_splits_comma_and_chinese_顿号():
+    assert parse_multi("0551-11111111,0551-22222222") == [
+        "0551-11111111",
+        "0551-22222222",
+    ]
+    assert parse_multi("a@x.com、b@y.com") == ["a@x.com", "b@y.com"]
+
+
+def test_parse_multi_strips_blank_and_dedupes():
+    assert parse_multi(" 0551-1 , , 0551-2 , 0551-1 ") == ["0551-1", "0551-2"]
+
+
+def test_parse_multi_empty():
+    assert parse_multi(None) == []
+    assert parse_multi("") == []
+    assert parse_multi("   ") == []
+
+
+def test_join_multi():
+    assert join_multi(["0551-1", "0551-2"]) == "0551-1,0551-2"
+    assert join_multi([]) == ""
+
+
+# backward-compatible aliases used by older imports
+def test_parse_phones_alias():
+    from app.services.config_service import join_phones, parse_phones
+
+    assert parse_phones("a,b") == ["a", "b"]
+    assert join_phones(["a", "b"]) == "a,b"
+
+
+def test_hotline_payload_includes_phones_emails_addresses(client):
+    data = client.get("/api/public/hotline").json()["data"]
+    assert "phones" in data and isinstance(data["phones"], list)
+    assert "emails" in data and isinstance(data["emails"], list)
+    assert "addresses" in data and isinstance(data["addresses"], list)
+    if data.get("phone"):
+        assert data["phones"][0] == data["phone"] or data["phone"] in data["phones"]
+    if data.get("email"):
+        assert data["emails"][0] == data["email"] or data["email"] in data["emails"]
+    if data.get("address"):
+        assert (
+            data["addresses"][0] == data["address"]
+            or data["address"] in data["addresses"]
+        )
+
+
+def test_admin_update_hotline_phones(client, admin_headers):
+    r = client.put(
+        "/api/web/admin/hotline",
+        headers=admin_headers,
+        json={"phones": ["0551-11111111", "0551-22222222"]},
+    )
+    assert r.status_code == 200
+    data = r.json()["data"]
+    assert data["phones"] == ["0551-11111111", "0551-22222222"]
+    assert data["phone"] == "0551-11111111"
+    pub = client.get("/api/public/hotline").json()["data"]
+    assert pub["phones"] == ["0551-11111111", "0551-22222222"]
+    assert pub["phone"] == "0551-11111111"
+
+
+def test_admin_update_hotline_emails_and_addresses(client, admin_headers):
+    r = client.put(
+        "/api/web/admin/hotline",
+        headers=admin_headers,
+        json={
+            "phones": ["0551-11111111"],
+            "emails": ["a@example.com", "b@example.com"],
+            "addresses": ["地址一", "地址二"],
+        },
+    )
+    assert r.status_code == 200
+    data = r.json()["data"]
+    assert data["emails"] == ["a@example.com", "b@example.com"]
+    assert data["email"] == "a@example.com"
+    assert data["addresses"] == ["地址一", "地址二"]
+    assert data["address"] == "地址一"
+    pub = client.get("/api/public/hotline").json()["data"]
+    assert pub["emails"] == ["a@example.com", "b@example.com"]
+    assert pub["addresses"] == ["地址一", "地址二"]
+
+
+def test_admin_update_hotline_email_address_string_still_works(client, admin_headers):
+    r = client.put(
+        "/api/web/admin/hotline",
+        headers=admin_headers,
+        json={"email": "only@example.com", "address": "唯一地址"},
+    )
+    assert r.status_code == 200
+    data = r.json()["data"]
+    assert data["emails"] == ["only@example.com"]
+    assert data["email"] == "only@example.com"
+    assert data["addresses"] == ["唯一地址"]
+    assert data["address"] == "唯一地址"
+
+
+def test_admin_update_hotline_phone_string_still_works(client, admin_headers):
+    r = client.put(
+        "/api/web/admin/hotline",
+        headers=admin_headers,
+        json={"phone": "0551-99999999"},
+    )
+    assert r.status_code == 200
+    data = r.json()["data"]
+    assert data["phones"] == ["0551-99999999"]
+    assert data["phone"] == "0551-99999999"

+ 18 - 0
backend/tests/test_public_feedback.py

@@ -91,6 +91,24 @@ def test_feedback_default_status_and_attachments(db_session):
     assert row.attachments == ["/uploads/a.png", "/uploads/b.png"]
 
 
+def test_feedback_reporter_unit_and_post(db_session):
+    seed_if_empty(db_session)
+    result = feedback_service.submit_feedback(
+        db_session,
+        fb_type="投诉",
+        content="含举报人单位职务",
+        reporter_name="张三",
+        reporter_unit="门诊部",
+        reporter_post="护士",
+        reporter_phone="13800000000",
+    )
+    row = db_session.query(Feedback).filter(Feedback.id == result["id"]).one()
+    assert row.reporter_name == "张三"
+    assert row.reporter_unit == "门诊部"
+    assert row.reporter_post == "护士"
+    assert row.reporter_phone == "13800000000"
+
+
 def test_suggestion_default_status(db_session):
     seed_if_empty(db_session)
     result = suggestion_service.submit_suggestion(

+ 154 - 0
backend/tests/test_role_menus.py

@@ -153,3 +153,157 @@ def test_oper_logs_list_requires_audit(client):
         params={"page": 1, "pageSize": 10},
     )
     assert denied.status_code == 403
+
+
+def test_oper_logs_filter_by_username_and_keyword(client):
+    from app.crud import oper_log as oper_log_crud
+
+    db = _client_db()
+    oper_log_crud.create_oper_log(
+        db,
+        module="用户管理",
+        action="创建",
+        username="filter_alice",
+        detail="创建用户 alice_unique_detail",
+    )
+    oper_log_crud.create_oper_log(
+        db,
+        module="角色管理",
+        action="更新",
+        username="filter_bob",
+        detail="更新角色 bob_other_detail",
+    )
+
+    admin_headers = _login(client, "admin", "Admin@123")
+
+    by_user = client.get(
+        "/api/web/admin/oper-logs",
+        headers=admin_headers,
+        params={"username": "filter_alice", "page": 1, "pageSize": 10},
+    )
+    assert by_user.status_code == 200
+    user_data = by_user.json()["data"]
+    assert user_data["total"] >= 1
+    assert all("filter_alice" in (row["username"] or "") for row in user_data["list"])
+
+    by_keyword = client.get(
+        "/api/web/admin/oper-logs",
+        headers=admin_headers,
+        params={"keyword": "alice_unique_detail", "page": 1, "pageSize": 10},
+    )
+    assert by_keyword.status_code == 200
+    kw_data = by_keyword.json()["data"]
+    assert kw_data["total"] >= 1
+    assert all(
+        "alice_unique_detail" in (row["detail"] or "") for row in kw_data["list"]
+    )
+    assert not any(
+        "bob_other_detail" in (row["detail"] or "") for row in kw_data["list"]
+    )
+
+
+def test_role_create_and_update(client):
+    admin_headers = _login(client, "admin", "Admin@123")
+
+    created = client.post(
+        "/api/web/admin/roles",
+        headers=admin_headers,
+        json={
+            "roleCode": "custom_role",
+            "roleName": "自定义角色",
+            "remark": "备注A",
+        },
+    )
+    assert created.status_code == 200, created.text
+    role = created.json()["data"]
+    assert role["roleCode"] == "custom_role"
+    assert role["roleName"] == "自定义角色"
+    assert role["remark"] == "备注A"
+    assert role["id"]
+
+    dup = client.post(
+        "/api/web/admin/roles",
+        headers=admin_headers,
+        json={"roleCode": "custom_role", "roleName": "重复编码"},
+    )
+    assert dup.status_code == 400
+
+    updated = client.put(
+        f"/api/web/admin/roles/{role['id']}",
+        headers=admin_headers,
+        json={"roleName": "已改名", "remark": "备注B"},
+    )
+    assert updated.status_code == 200, updated.text
+    data = updated.json()["data"]
+    assert data["roleCode"] == "custom_role"
+    assert data["roleName"] == "已改名"
+    assert data["remark"] == "备注B"
+
+    listed = client.get("/api/web/admin/roles", headers=admin_headers).json()["data"]
+    found = next(r for r in listed if r["id"] == role["id"])
+    assert found["roleName"] == "已改名"
+
+
+def test_role_delete(client):
+    admin_headers = _login(client, "admin", "Admin@123")
+
+    created = client.post(
+        "/api/web/admin/roles",
+        headers=admin_headers,
+        json={"roleCode": "to_delete", "roleName": "待删角色"},
+    )
+    assert created.status_code == 200, created.text
+    role = created.json()["data"]
+
+    # 授权后再删,菜单关联应一并清理
+    tree = client.get("/api/web/admin/menus/tree", headers=admin_headers).json()["data"]
+
+    def _collect(nodes):
+        ids = []
+        for n in nodes:
+            ids.append(n["id"])
+            ids.extend(_collect(n.get("children") or []))
+        return ids
+
+    menu_ids = _collect(tree)[:1]
+    assert menu_ids
+    grant = client.put(
+        f"/api/web/admin/roles/{role['id']}/menus",
+        headers=admin_headers,
+        json={"menuIds": menu_ids},
+    )
+    assert grant.status_code == 200, grant.text
+
+    deleted = client.delete(
+        f"/api/web/admin/roles/{role['id']}", headers=admin_headers
+    )
+    assert deleted.status_code == 200, deleted.text
+
+    listed = client.get("/api/web/admin/roles", headers=admin_headers).json()["data"]
+    assert all(r["id"] != role["id"] for r in listed)
+
+    # 再次删除应报不存在
+    again = client.delete(
+        f"/api/web/admin/roles/{role['id']}", headers=admin_headers
+    )
+    assert again.status_code == 400
+
+
+def test_role_delete_rejects_admin_and_in_use(client):
+    admin_headers = _login(client, "admin", "Admin@123")
+    roles = client.get("/api/web/admin/roles", headers=admin_headers).json()["data"]
+    admin_role = next(r for r in roles if r["roleCode"] == "admin")
+    viewer = next(r for r in roles if r["roleCode"] == "viewer")
+
+    deny_admin = client.delete(
+        f"/api/web/admin/roles/{admin_role['id']}", headers=admin_headers
+    )
+    assert deny_admin.status_code == 400
+
+    # viewer 已被测试用户占用时不可删
+    _ensure_role_user(client, "viewer_keep", "viewer")
+    deny_in_use = client.delete(
+        f"/api/web/admin/roles/{viewer['id']}", headers=admin_headers
+    )
+    assert deny_in_use.status_code == 400
+    assert "用户" in deny_in_use.json().get("message", "")

+ 6 - 6
backend/tests/test_upload.py

@@ -58,8 +58,8 @@ def test_public_upload_rejects_disallowed_extension(client, local_storage_env):
     assert "类型" in body["message"] or "格式" in body["message"] or "不支持" in body["message"]
 
 
-def test_public_upload_rejects_oversized(client, local_storage_env):
-    # 20MB + 1 byte
+def test_public_upload_allows_large_file(client, local_storage_env):
+    # 原 20MB 限制已取消;略超原阈值仍应成功
     big = b"%PDF-1.4" + b"x" * (20 * 1024 * 1024)
     files = {"file": ("big.pdf", big, "application/pdf")}
     r = client.post(
@@ -67,10 +67,10 @@ def test_public_upload_rejects_oversized(client, local_storage_env):
         files=files,
         data={"folder": "feedback"},
     )
-    assert r.status_code == 400
-    body = r.json()
-    assert body["code"] == 400
-    assert "大小" in body["message"] or "过大" in body["message"] or "MB" in body["message"]
+    assert r.status_code == 200
+    data = r.json()["data"]
+    assert data["fileName"] == "big.pdf"
+    assert data["size"] == len(big)
 
 
 def test_public_upload_rejects_path_traversal(client, local_storage_env):

+ 5 - 0
backend/tests/test_upload_validate.py

@@ -30,6 +30,11 @@ def test_accepts_jpeg_and_pdf():
     validate_upload("a.pdf", PDF)
 
 
+def test_accepts_file_over_former_20mb_limit():
+    big = b"%PDF-1.4" + b"x" * (20 * 1024 * 1024)
+    validate_upload("big.pdf", big)
+
+
 def test_image_upload_rejects_pdf():
     with pytest.raises(AppHTTPError):
         validate_image_upload("x.pdf", PDF)

+ 6 - 2
docs/deploy-test.md

@@ -49,10 +49,12 @@ uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
 
 ## 4. Web 管理端
 
+开发端口:**5173**(`web-admin/vite.config.ts`)。
+
 ```bash
 cd web-admin
 npm install
-npm run dev                # 开发:代理 /api → VITE_API_PROXY_TARGET
+npm run dev                # http://127.0.0.1:5173 ,代理 /api → VITE_API_PROXY_TARGET
 # 或
 npm run build              # 产物在 dist/
 ```
@@ -76,9 +78,11 @@ location / {
 
 ## 5. 移动端 H5(uni-app)
 
+开发端口:**5174**(`mobile-wx/manifest.json` → `h5.devServer.port`),与 web-admin 的 5173 区分。
+
 1. 用 HBuilderX 打开 `mobile-wx/`
 2. 修改 `mobile-wx/config/api.js` 中 `BASE_URL` 为可访问的后端地址(真机勿用 127.0.0.1)
-3. 运行到浏览器 / 发行 H5,将静态资源部署到 HTTPS 域名
+3. 运行到浏览器(本地一般为 `http://127.0.0.1:5174`)/ 发行 H5,将静态资源部署到 HTTPS 域名
 4. 管理端「二维码配置」中把 `land_url` 设为该 H5 落地地址;可上传自定义二维码图供分享弹层展示
 
 ## 6. 最小联调路径

二进制
docs/安建医院纪检数字化监督平台-系统建设内容.docx


+ 216 - 20
mobile-wx/App.vue

@@ -17,49 +17,245 @@
     --line: #ececec;
     --bg: #f4f4f4;
     --card: #ffffff;
-    --radius: 12px;
+    --radius: 24rpx;
+    --shadow: 0 8rpx 32rpx rgba(0, 0, 0, 0.06);
     background: var(--bg);
     color: var(--ink);
-    font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
+    font-family: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, sans-serif;
     font-size: 28rpx;
+    line-height: 1.5;
   }
 
   .card {
     background: var(--card);
     border-radius: var(--radius);
-    box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.06);
+    box-shadow: var(--shadow);
   }
 
-  .btn-primary {
+  .form-section {
+    margin: 24rpx 28rpx 0;
+    background: var(--card);
+    border-radius: var(--radius);
+    box-shadow: var(--shadow);
+    overflow: hidden;
+  }
+
+  .form-section .sec-title {
+    padding: 24rpx 28rpx 16rpx;
+    font-size: 26rpx;
+    font-weight: 600;
+    color: var(--primary);
+    display: flex;
+    align-items: center;
+    gap: 12rpx;
+  }
+
+  .form-section .sec-title::before {
+    content: '';
+    width: 6rpx;
+    height: 24rpx;
     background: var(--primary);
-    color: #fff;
-    border-radius: 12rpx;
-    text-align: center;
-    padding: 24rpx;
-    font-size: 30rpx;
+    border-radius: 4rpx;
+    flex-shrink: 0;
+  }
+
+  .field-row {
+    display: flex;
+    align-items: center;
+    padding: 0 28rpx;
+    min-height: 96rpx;
+    border-top: 1rpx solid var(--line);
+    gap: 24rpx;
+  }
+
+  .field-row.top {
+    align-items: flex-start;
+    padding-top: 24rpx;
+    padding-bottom: 24rpx;
   }
 
-  .btn-primary.disabled {
-    opacity: 0.5;
+  .field-row .label {
+    width: 144rpx;
+    flex-shrink: 0;
+    font-size: 28rpx;
+    color: #333;
+  }
+
+  .field-row .label .req {
+    color: var(--primary);
+    margin-right: 4rpx;
   }
 
-  .sec-title {
+  .field-row input,
+  .field-row textarea {
+    flex: 1;
+    border: 0;
+    outline: none;
     font-size: 28rpx;
+    color: var(--ink);
+    background: transparent;
+    width: 100%;
+    padding: 0;
+    min-height: 40rpx;
+  }
+
+  .field-row textarea {
+    min-height: 200rpx;
+    line-height: 1.6;
+  }
+
+  .type-switch {
+    display: flex;
+    gap: 20rpx;
+    flex: 1;
+  }
+
+  .type-switch .type {
+    flex: 1;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    height: 72rpx;
+    border-radius: 16rpx;
+    border: 1rpx solid var(--line);
+    font-size: 28rpx;
+    background: #fafafa;
+    color: #666;
+  }
+
+  .type-switch .type.on {
+    border-color: var(--primary);
+    background: var(--primary-soft);
+    color: var(--primary);
     font-weight: 600;
-    margin-bottom: 16rpx;
   }
 
-  .field {
+  .upload-area {
+    padding: 24rpx 28rpx 32rpx;
+    border-top: 1rpx solid var(--line);
+  }
+
+  .upload-hint {
+    font-size: 24rpx;
+    color: var(--muted);
     margin-bottom: 20rpx;
   }
 
-  .field input,
-  .field textarea {
-    width: 100%;
+  .upload-list {
+    display: flex;
+    flex-wrap: wrap;
+    gap: 20rpx;
+  }
+
+  .upload-item,
+  .upload-add {
+    width: 144rpx;
+    height: 144rpx;
+    border-radius: 16rpx;
+    position: relative;
+  }
+
+  .upload-add {
+    border: 1rpx dashed #ccc;
     background: #fafafa;
-    border: 1rpx solid var(--line);
-    border-radius: 10rpx;
-    padding: 20rpx;
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    justify-content: center;
+    gap: 8rpx;
+    color: #999;
+    font-size: 22rpx;
+  }
+
+  .upload-add.disabled {
+    opacity: 0.55;
+    pointer-events: none;
+  }
+
+  .upload-add .plus {
+    font-size: 56rpx;
+    line-height: 1;
+    color: #bbb;
+    font-weight: 300;
+  }
+
+  .upload-item {
+    background: #eee;
+    overflow: hidden;
+  }
+
+  .upload-item image {
+    width: 100%;
+    height: 100%;
+  }
+
+  .upload-item .rm {
+    position: absolute;
+    top: 4rpx;
+    right: 4rpx;
+    width: 36rpx;
+    height: 36rpx;
+    border-radius: 50%;
+    background: var(--primary);
+    color: #fff;
+    font-size: 22rpx;
+    line-height: 36rpx;
+    text-align: center;
+    z-index: 2;
+  }
+
+  .upload-mask {
+    position: absolute;
+    inset: 0;
+    background: rgba(0, 0, 0, 0.45);
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    z-index: 3;
+  }
+
+  .upload-pct {
+    color: #fff;
+    font-size: 24rpx;
+    font-weight: 600;
+  }
+
+  .submit-bar {
+    padding: 32rpx 28rpx 16rpx;
+  }
+
+  .btn-primary {
+    width: 100%;
+    height: 92rpx;
+    line-height: 92rpx;
+    border: 0;
+    border-radius: 46rpx;
+    background: var(--primary);
+    color: #fff;
+    font-size: 32rpx;
+    font-weight: 600;
+    letter-spacing: 0.1em;
+    text-align: center;
+  }
+
+  .btn-primary.disabled,
+  .btn-primary[disabled] {
+    background: #ccc;
+    opacity: 1;
+  }
+
+  .btn-ghost {
+    width: 100%;
+    height: 88rpx;
+    line-height: 88rpx;
+    border: 1rpx solid var(--primary);
+    border-radius: 44rpx;
+    background: #fff;
+    color: var(--primary);
+    font-size: 30rpx;
+    font-weight: 600;
+    text-align: center;
+    margin-top: 20rpx;
     box-sizing: border-box;
   }
 </style>

+ 1 - 1
mobile-wx/config/api.js

@@ -1 +1 @@
-export const BASE_URL = 'http://127.0.0.1:8000/api'
+export const BASE_URL = '/api'

+ 5 - 0
mobile-wx/manifest.json

@@ -68,5 +68,10 @@
     "uniStatistics" : {
         "enable" : false
     },
+    "h5" : {
+        "devServer" : {
+            "port" : 5174
+        }
+    },
     "vueVersion" : "3"
 }

+ 25 - 0
mobile-wx/package.json

@@ -0,0 +1,25 @@
+{
+  "name": "mobile-wx",
+  "version": "1.0.0",
+  "private": true,
+  "scripts": {
+    "dev:h5": "uni",
+    "build:h5": "uni build -p h5"
+  },
+  "dependencies": {
+    "@dcloudio/uni-app": "3.0.0-alpha-5000120260205002",
+    "@dcloudio/uni-app-plus": "3.0.0-alpha-5000120260205002",
+    "@dcloudio/uni-components": "3.0.0-alpha-5000120260205002",
+    "@dcloudio/uni-h5": "3.0.0-alpha-5000120260205002",
+    "vue": "3.4.21"
+  },
+  "devDependencies": {
+    "@dcloudio/types": "^3.4.8",
+    "@dcloudio/uni-automator": "3.0.0-alpha-5000120260205002",
+    "@dcloudio/uni-cli-shared": "3.0.0-alpha-5000120260205002",
+    "@dcloudio/uni-stacktracey": "3.0.0-alpha-5000120260205002",
+    "@dcloudio/vite-plugin-uni": "3.0.0-alpha-5000120260205002",
+    "sass": "^1.77.0",
+    "vite": "5.2.8"
+  }
+}

+ 50 - 50
mobile-wx/pages.json

@@ -1,50 +1,50 @@
-{
-  "pages": [
-    {
-      "path": "pages/home/index",
-      "style": {
-        "navigationBarTitleText": "首页",
-        "navigationBarBackgroundColor": "#a51f23",
-        "navigationBarTextStyle": "white"
-      }
-    },
-    {
-      "path": "pages/notice/index",
-      "style": {
-        "navigationBarTitleText": "反馈须知",
-        "navigationBarBackgroundColor": "#a51f23",
-        "navigationBarTextStyle": "white"
-      }
-    },
-    {
-      "path": "pages/feedback/index",
-      "style": {
-        "navigationBarTitleText": "在线反馈",
-        "navigationBarBackgroundColor": "#a51f23",
-        "navigationBarTextStyle": "white"
-      }
-    },
-    {
-      "path": "pages/suggest/index",
-      "style": {
-        "navigationBarTitleText": "建言献策",
-        "navigationBarBackgroundColor": "#a51f23",
-        "navigationBarTextStyle": "white"
-      }
-    },
-    {
-      "path": "pages/hotline/index",
-      "style": {
-        "navigationBarTitleText": "监督热线",
-        "navigationBarBackgroundColor": "#a51f23",
-        "navigationBarTextStyle": "white"
-      }
-    }
-  ],
-  "globalStyle": {
-    "navigationBarTextStyle": "white",
-    "navigationBarTitleText": "安徽建工集团医院纪检室",
-    "navigationBarBackgroundColor": "#a51f23",
-    "backgroundColor": "#f4f4f4"
-  }
-}
+{
+  "pages": [
+    {
+      "path": "pages/home/index",
+      "style": {
+        "navigationBarTitleText": "安徽建工集团医院纪检室",
+        "navigationBarBackgroundColor": "#a51f23",
+        "navigationBarTextStyle": "white"
+      }
+    },
+    {
+      "path": "pages/notice/index",
+      "style": {
+        "navigationBarTitleText": "反馈须知",
+        "navigationBarBackgroundColor": "#a51f23",
+        "navigationBarTextStyle": "white"
+      }
+    },
+    {
+      "path": "pages/feedback/index",
+      "style": {
+        "navigationBarTitleText": "在线反馈",
+        "navigationBarBackgroundColor": "#a51f23",
+        "navigationBarTextStyle": "white"
+      }
+    },
+    {
+      "path": "pages/suggest/index",
+      "style": {
+        "navigationBarTitleText": "建言献策",
+        "navigationBarBackgroundColor": "#a51f23",
+        "navigationBarTextStyle": "white"
+      }
+    },
+    {
+      "path": "pages/hotline/index",
+      "style": {
+        "navigationBarTitleText": "监督热线",
+        "navigationBarBackgroundColor": "#a51f23",
+        "navigationBarTextStyle": "white"
+      }
+    }
+  ],
+  "globalStyle": {
+    "navigationBarTextStyle": "white",
+    "navigationBarTitleText": "安徽建工集团医院纪检室",
+    "navigationBarBackgroundColor": "#a51f23",
+    "backgroundColor": "#f4f4f4"
+  }
+}

+ 36 - 9
mobile-wx/pages/feedback/index.vue

@@ -40,17 +40,20 @@
       <view class="upload-area">
         <view class="upload-hint">反馈材料(选填)· 支持图片、视频、文件,可多选</view>
         <view class="upload-list">
-          <view v-for="(item, i) in attachments" :key="i" class="upload-item">
+          <view v-for="(item, i) in attachments" :key="item.id || i" class="upload-item">
             <image v-if="isImage(item)" :src="item.previewUrl" mode="aspectFill" />
             <view v-else class="file-chip">
               <text class="file-ext">{{ extLabel(item) }}</text>
               <text class="file-name">{{ item.fileName || '附件' }}</text>
             </view>
-            <view class="rm" @click="removeFile(i)">×</view>
+            <view v-if="item.uploading" class="upload-mask">
+              <text class="upload-pct">{{ item.progress || 0 }}%</text>
+            </view>
+            <view v-else class="rm" @click="removeFile(i)">×</view>
           </view>
-          <view class="upload-add" @click="pickFiles">
+          <view class="upload-add" :class="{ disabled: uploading }" @click="pickFiles">
             <text class="plus">+</text>
-            <text>上传</text>
+            <text>{{ uploading ? '上传中' : '上传' }}</text>
           </view>
         </view>
       </view>
@@ -95,6 +98,7 @@
     data() {
       return {
         submitting: false,
+        uploading: false,
         attachments: [],
         form: {
           fbType: '投诉',
@@ -127,14 +131,33 @@
         return i >= 0 ? name.slice(i + 1).toUpperCase() : 'FILE'
       },
       async pickFiles() {
+        if (this.uploading) return
+        this.uploading = true
         try {
-          const items = await chooseAndUploadFiles('feedback')
-          this.attachments = this.attachments.concat(items)
-        } catch (e) {}
+          await chooseAndUploadFiles('feedback', {
+            onItemAdd: (item) => {
+              this.attachments.push(item)
+            },
+            onProgress: (item, progress) => {
+              item.progress = progress
+            },
+            onItemError: (item) => {
+              const idx = this.attachments.findIndex((a) => a === item || a.id === item.id)
+              if (idx >= 0) {
+                revokePreview(this.attachments[idx])
+                this.attachments.splice(idx, 1)
+              }
+            }
+          })
+        } catch (e) {
+        } finally {
+          this.uploading = false
+        }
       },
       removeFile(i) {
         const item = this.attachments[i]
-        if (item) revokePreview(item)
+        if (!item || item.uploading) return
+        revokePreview(item)
         this.attachments.splice(i, 1)
       },
       async submit() {
@@ -142,12 +165,16 @@
           uni.showToast({ title: '请填写反馈内容', icon: 'none' })
           return
         }
+        if (this.uploading) {
+          uni.showToast({ title: '请等待附件上传完成', icon: 'none' })
+          return
+        }
         if (this.submitting) return
         this.submitting = true
         try {
           await submitFeedback({
             ...this.form,
-            attachmentUrls: this.attachments.map((a) => a.url)
+            attachmentUrls: this.attachments.map((a) => a.url).filter(Boolean)
           })
           ;(this.attachments || []).forEach((a) => revokePreview(a))
           this.attachments = []

+ 262 - 72
mobile-wx/pages/home/index.vue

@@ -1,41 +1,80 @@
 <template>
-  <view class="page">
-    <view class="hero card">
-      <view class="org">安徽建工集团医院纪检室</view>
-      <view class="slogan">扫码监督 · 阳光纪检</view>
-      <view class="tip">扫码即可反馈 · 支持匿名 · 信息严格保密</view>
+  <view class="home-scroll">
+    <image class="home-bg" src="/static/ajyy.jpeg" mode="aspectFill" />
+
+    <view class="home-hero">
+      <view class="logo-wrap">
+        <image class="logo" src="/static/logo1.png" mode="aspectFit" />
+      </view>
+      <view class="brand-title">安建医院纪检</view>
+      <view class="brand-motto">
+        <view class="line" />
+        <text>忠诚</text>
+        <text class="sep">|</text>
+        <text>干净</text>
+        <text class="sep">|</text>
+        <text>担当</text>
+        <view class="line" />
+      </view>
     </view>
 
-    <view class="grid">
-      <view class="entry card" @click="goNotice">
-        <view class="title">在线反馈</view>
-        <view class="desc">投诉表扬
+    <view class="nav-grid">
+      <view class="nav-card" @click="goNotice">
+        <view class="nav-icon">
+          <image src="/static/icons/shield.svg" mode="aspectFit" />
+        </view>
+        <view class="nav-title">在线反馈</view>
+        <view class="divider" />
+        <view class="nav-desc">投诉表扬
 有序反馈</view>
       </view>
-      <view class="entry card" @click="goSuggest">
-        <view class="title">建言献策</view>
-        <view class="desc">建言献策
+      <view class="nav-card" @click="goSuggest">
+        <view class="nav-icon">
+          <image src="/static/icons/edit.svg" mode="aspectFit" />
+        </view>
+        <view class="nav-title">建言献策</view>
+        <view class="divider" />
+        <view class="nav-desc">建言献策
 促进完善</view>
       </view>
-      <view class="entry card" @click="goHotline">
-        <view class="title">监督热线</view>
-        <view class="desc">电话邮箱
-一键联系</view>
+      <view class="nav-card" @click="goHotline">
+        <view class="nav-icon">
+          <image src="/static/icons/phone.svg" mode="aspectFit" />
+        </view>
+        <view class="nav-title">监督热线</view>
+        <view class="divider" />
+        <view class="nav-desc">倾听诉求
+及时回应</view>
       </view>
-      <view class="entry card" @click="openShare">
-        <view class="title">扫码分享</view>
-        <view class="desc">生成二维码
+      <view class="nav-card" @click="openShare">
+        <view class="nav-icon">
+          <image src="/static/icons/qrcode.svg" mode="aspectFit" />
+        </view>
+        <view class="nav-title">扫码分享</view>
+        <view class="divider" />
+        <view class="nav-desc">生成二维码
 转发分享</view>
       </view>
     </view>
 
-    <view v-if="shareVisible" class="mask" @click="shareVisible = false">
-      <view class="share-box card" @click.stop>
-        <view class="share-title">{{ qr.title || '安建医院纪检 · 扫码反馈' }}</view>
-        <image v-if="qr.imageUrl" class="qr-img" :src="qr.imageUrl" mode="aspectFit" />
-        <view v-else class="qr-fallback">
-          <view>请使用后台上传自定义二维码图片</view>
-          <view class="url">{{ qr.landUrl || '未配置落地链接' }}</view>
+    <view class="mission-banner">
+      <image src="/static/home-banner.png" mode="widthFix" />
+    </view>
+
+    <view class="page-hint">扫码即可反馈 · 支持匿名 · 信息严格保密</view>
+
+    <view v-if="shareVisible" class="overlay" @click="shareVisible = false">
+      <view class="modal" @click.stop>
+        <view class="modal-title">扫码分享</view>
+        <view class="modal-sub">长按或截图保存二维码,发给同事扫码反馈</view>
+        <view class="qr-box">
+          <image v-if="qr.imageUrl" class="qr-img" :src="qr.imageUrl" mode="aspectFit" />
+          <view v-else class="qr-fallback">
+            <view>请使用后台上传自定义二维码图片</view>
+          </view>
+          <view class="qr-logo">
+            <image src="/static/logo1.png" mode="aspectFit" />
+          </view>
         </view>
         <view class="btn-primary" @click="shareVisible = false">关闭</view>
       </view>
@@ -77,81 +116,232 @@
 </script>
 
 <style scoped>
-  .page {
-    padding: 32rpx 28rpx 48rpx;
+  .home-scroll {
+    position: relative;
+    min-height: 100vh;
+    background: #f5f5f5;
+    padding-bottom: calc(40rpx + env(safe-area-inset-bottom));
+    overflow: hidden;
   }
-  .hero {
-    padding: 40rpx 32rpx;
-    background: linear-gradient(145deg, #a51f23, #8a1a1d);
-    color: #fff;
-    margin-bottom: 28rpx;
+
+  .home-bg {
+    position: absolute;
+    top: 0;
+    left: 0;
+    right: 0;
+    width: 100%;
+    height: 640rpx;
+    opacity: 0.1;
+    z-index: 0;
+    pointer-events: none;
+    -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
+    mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
   }
-  .org {
-    font-size: 34rpx;
-    font-weight: 700;
+
+  .home-hero {
+    position: relative;
+    z-index: 1;
+    padding: 52rpx 40rpx 36rpx;
+    text-align: center;
   }
-  .slogan {
-    margin-top: 12rpx;
-    color: #f0d78c;
-    font-size: 28rpx;
+
+  .logo-wrap {
+    width: 256rpx;
+    height: 256rpx;
+    margin: 0 auto 24rpx;
   }
-  .tip {
-    margin-top: 18rpx;
-    font-size: 24rpx;
-    opacity: 0.9;
+
+  .logo {
+    width: 100%;
+    height: 100%;
   }
-  .grid {
+
+  .brand-title {
+    font-family: 'Songti SC', 'STSong', 'SimSun', 'Noto Serif SC', serif;
+    font-size: 52rpx;
+    font-weight: 900;
+    color: var(--primary);
+    letter-spacing: 0.14em;
+  }
+
+  .brand-motto {
+    margin: 24rpx auto 0;
+    max-width: 560rpx;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    gap: 16rpx;
+    font-size: 26rpx;
+    color: #888;
+    letter-spacing: 0.22em;
+  }
+
+  .brand-motto .line {
+    flex: 1;
+    height: 1rpx;
+    max-width: 112rpx;
+    background: linear-gradient(90deg, transparent, rgba(140, 140, 140, 0.75));
+  }
+
+  .brand-motto .line:last-child {
+    background: linear-gradient(90deg, rgba(140, 140, 140, 0.75), transparent);
+  }
+
+  .brand-motto .sep {
+    margin: 0 8rpx;
+    color: #c8c8c8;
+    letter-spacing: 0;
+  }
+
+  .nav-grid {
+    position: relative;
+    z-index: 1;
     display: grid;
-    grid-template-columns: 1fr 1fr;
-    gap: 20rpx;
+    grid-template-columns: repeat(4, 1fr);
+    gap: 16rpx;
+    padding: 12rpx 24rpx 0;
   }
-  .entry {
-    padding: 28rpx 24rpx;
-    min-height: 180rpx;
+
+  .nav-card {
+    background: var(--card);
+    border-radius: 20rpx;
+    box-shadow: var(--shadow);
+    padding: 28rpx 8rpx 24rpx;
+    text-align: center;
   }
-  .entry .title {
-    font-size: 30rpx;
+
+  .nav-icon {
+    width: 80rpx;
+    height: 80rpx;
+    margin: 0 auto 20rpx;
+    border-radius: 50%;
+    background: var(--primary);
+    display: flex;
+    align-items: center;
+    justify-content: center;
+  }
+
+  .nav-icon image {
+    width: 40rpx;
+    height: 40rpx;
+  }
+
+  .nav-title {
+    font-size: 26rpx;
     font-weight: 600;
-    color: var(--primary);
+    margin-bottom: 12rpx;
   }
-  .entry .desc {
-    margin-top: 16rpx;
+
+  .divider {
+    width: 28rpx;
+    height: 4rpx;
+    background: var(--primary);
+    margin: 0 auto 12rpx;
+    border-radius: 4rpx;
+  }
+
+  .nav-desc {
+    font-size: 20rpx;
     color: var(--muted);
-    font-size: 24rpx;
+    line-height: 1.45;
     white-space: pre-line;
-    line-height: 1.5;
   }
-  .mask {
+
+  .mission-banner {
+    position: relative;
+    z-index: 1;
+    margin: 32rpx 28rpx 0;
+    border-radius: var(--radius);
+    box-shadow: var(--shadow);
+    overflow: hidden;
+    background: #fff;
+  }
+
+  .mission-banner image {
+    display: block;
+    width: 100%;
+  }
+
+  .page-hint {
+    position: relative;
+    z-index: 1;
+    text-align: center;
+    padding: 28rpx 24rpx 16rpx;
+    font-size: 22rpx;
+    color: #aaa;
+  }
+
+  .overlay {
     position: fixed;
     inset: 0;
-    background: rgba(0, 0, 0, 0.45);
+    background: rgba(0, 0, 0, 0.55);
+    z-index: 100;
     display: flex;
     align-items: center;
     justify-content: center;
-    z-index: 99;
+    padding: 48rpx;
   }
-  .share-box {
-    width: 78%;
-    padding: 32rpx;
+
+  .modal {
+    background: #fff;
+    border-radius: 32rpx;
+    width: 100%;
+    max-width: 640rpx;
+    padding: 48rpx 40rpx 40rpx;
     text-align: center;
   }
-  .share-title {
+
+  .modal-title {
+    font-size: 34rpx;
+    color: var(--primary);
+    margin-bottom: 12rpx;
+    letter-spacing: 0.06em;
     font-weight: 600;
-    margin-bottom: 20rpx;
   }
+
+  .modal-sub {
+    font-size: 24rpx;
+    color: var(--muted);
+    margin-bottom: 32rpx;
+  }
+
+  .qr-box {
+    width: 400rpx;
+    height: 400rpx;
+    margin: 0 auto 28rpx;
+    background: #fff;
+    border: 1rpx solid var(--line);
+    border-radius: 16rpx;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    position: relative;
+    overflow: hidden;
+  }
+
   .qr-img {
     width: 360rpx;
     height: 360rpx;
-    margin: 0 auto 24rpx;
   }
+
   .qr-fallback {
-    color: var(--muted);
+    padding: 24rpx;
     font-size: 24rpx;
-    margin-bottom: 24rpx;
+    color: var(--muted);
+  }
+
+  .qr-logo {
+    position: absolute;
+    width: 72rpx;
+    height: 72rpx;
+    border-radius: 12rpx;
+    background: #fff;
+    padding: 6rpx;
+    box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.12);
   }
-  .url {
-    margin-top: 12rpx;
-    word-break: break-all;
-    color: var(--ink);
+
+  .qr-logo image {
+    width: 100%;
+    height: 100%;
   }
 </style>

+ 223 - 36
mobile-wx/pages/hotline/index.vue

@@ -1,24 +1,96 @@
 <template>
   <view class="page">
-    <view class="card box">
-      <view class="title">监督热线</view>
-      <view class="row" @click="call">
-        <view class="label">电话</view>
-        <view class="value link">{{ info.phone || '-' }}</view>
+    <view class="hotline-hero">
+      <view class="icon-big">
+        <image src="/static/icons/phone.svg" mode="aspectFit" />
       </view>
-      <view class="row">
-        <view class="label">邮箱</view>
-        <view class="value">{{ info.email || '-' }}</view>
+      <view class="hero-title">监督举报热线</view>
+      <view class="hero-sub">倾听诉求 · 及时回应 · 严格保密</view>
+    </view>
+
+    <view class="info-list">
+      <view
+        v-for="(phone, idx) in phoneList"
+        :key="'phone-' + idx"
+        class="info-item tel"
+        @click="call(phone)"
+      >
+        <view class="ii">
+          <image src="/static/icons/phone-red.svg" mode="aspectFit" />
+        </view>
+        <view class="meta">
+          <text class="small">{{
+            phoneList.length > 1 ? '监督电话 ' + (idx + 1) + '(点击拨打)' : '监督电话(点击拨打)'
+          }}</text>
+          <text class="strong">{{ phone }}</text>
+        </view>
+        <view class="arrow">›</view>
+      </view>
+      <view v-if="!phoneList.length" class="info-item tel">
+        <view class="ii">
+          <image src="/static/icons/phone-red.svg" mode="aspectFit" />
+        </view>
+        <view class="meta">
+          <text class="small">监督电话</text>
+          <text class="strong">-</text>
+        </view>
       </view>
-      <view class="row">
-        <view class="label">地址</view>
-        <view class="value">{{ info.address || '-' }}</view>
+
+      <view
+        v-for="(email, idx) in emailList"
+        :key="'email-' + idx"
+        class="info-item"
+        @click="copyEmail(email)"
+      >
+        <view class="ii">
+          <image src="/static/icons/mail.svg" mode="aspectFit" />
+        </view>
+        <view class="meta">
+          <text class="small">{{
+            emailList.length > 1 ? '电子邮箱 ' + (idx + 1) + '(点击复制)' : '电子邮箱(点击复制)'
+          }}</text>
+          <text class="strong">{{ email }}</text>
+        </view>
+        <view class="arrow">›</view>
+      </view>
+      <view v-if="!emailList.length" class="info-item">
+        <view class="ii">
+          <image src="/static/icons/mail.svg" mode="aspectFit" />
+        </view>
+        <view class="meta">
+          <text class="small">电子邮箱</text>
+          <text class="strong">-</text>
+        </view>
       </view>
-      <view class="row">
-        <view class="label">受理时间</view>
-        <view class="value">{{ info.workTime || '-' }}</view>
+
+      <view
+        v-for="(address, idx) in addressList"
+        :key="'addr-' + idx"
+        class="info-item"
+      >
+        <view class="ii">
+          <image src="/static/icons/location.svg" mode="aspectFit" />
+        </view>
+        <view class="meta">
+          <text class="small">{{
+            addressList.length > 1 ? '通讯地址 ' + (idx + 1) : '通讯地址'
+          }}</text>
+          <text class="strong">{{ address }}</text>
+        </view>
       </view>
-      <view class="btn-primary" @click="call">一键拨打</view>
+      <view v-if="!addressList.length" class="info-item">
+        <view class="ii">
+          <image src="/static/icons/location.svg" mode="aspectFit" />
+        </view>
+        <view class="meta">
+          <text class="small">通讯地址</text>
+          <text class="strong">-</text>
+        </view>
+      </view>
+    </view>
+
+    <view class="submit-bar">
+      <view class="btn-primary" @click="goFeedback">去在线反馈</view>
     </view>
   </view>
 </template>
@@ -26,10 +98,37 @@
 <script>
   import { getHotline } from '../../api/public.js'
 
+  function normalizeList(list, single) {
+    const fromList = Array.isArray(list)
+      ? list.map((p) => String(p || '').trim()).filter(Boolean)
+      : []
+    if (fromList.length) return fromList
+    const one = String(single || '').trim()
+    return one ? [one] : []
+  }
+
   export default {
     data() {
       return {
-        info: { phone: '', email: '', address: '', workTime: '' }
+        info: {
+          phone: '',
+          phones: [],
+          email: '',
+          emails: [],
+          address: '',
+          addresses: []
+        }
+      }
+    },
+    computed: {
+      phoneList() {
+        return normalizeList(this.info.phones, this.info.phone)
+      },
+      emailList() {
+        return normalizeList(this.info.emails, this.info.email)
+      },
+      addressList() {
+        return normalizeList(this.info.addresses, this.info.address)
       }
     },
     async onShow() {
@@ -39,12 +138,24 @@
       } catch (e) {}
     },
     methods: {
-      call() {
-        if (!this.info.phone) {
+      call(phone) {
+        const raw = String(phone || '').trim()
+        if (!raw) {
           uni.showToast({ title: '未配置电话', icon: 'none' })
           return
         }
-        uni.makePhoneCall({ phoneNumber: String(this.info.phone).replace(/[^\d+]/g, '') })
+        uni.makePhoneCall({ phoneNumber: raw.replace(/[^\d+]/g, '') })
+      },
+      copyEmail(email) {
+        const raw = String(email || '').trim()
+        if (!raw) return
+        uni.setClipboardData({
+          data: raw,
+          success: () => uni.showToast({ title: '邮箱已复制', icon: 'none' })
+        })
+      },
+      goFeedback() {
+        uni.navigateTo({ url: '/pages/notice/index' })
       }
     }
   }
@@ -52,32 +163,108 @@
 
 <style scoped>
   .page {
-    padding: 28rpx;
+    min-height: 100vh;
+    box-sizing: border-box;
+    background: var(--bg);
+    padding-bottom: calc(40rpx + env(safe-area-inset-bottom));
   }
-  .box {
-    padding: 32rpx;
-  }
-  .title {
-    font-size: 34rpx;
-    font-weight: 700;
-    margin-bottom: 24rpx;
+
+  .hotline-hero {
+    text-align: center;
+    padding: 48rpx 40rpx 16rpx;
   }
-  .row {
+
+  .icon-big {
+    width: 128rpx;
+    height: 128rpx;
+    margin: 0 auto 24rpx;
+    border-radius: 50%;
+    background: var(--primary);
     display: flex;
-    padding: 18rpx 0;
-    border-bottom: 1rpx solid var(--line);
+    align-items: center;
+    justify-content: center;
+  }
+
+  .icon-big image {
+    width: 60rpx;
+    height: 60rpx;
+  }
+
+  .hero-title {
+    font-size: 36rpx;
+    color: var(--primary);
+    letter-spacing: 0.08em;
+    font-weight: 600;
   }
-  .label {
-    width: 140rpx;
+
+  .hero-sub {
+    margin-top: 12rpx;
+    font-size: 26rpx;
     color: var(--muted);
   }
-  .value {
+
+  .info-list {
+    margin: 32rpx 28rpx 0;
+    background: var(--card);
+    border-radius: var(--radius);
+    box-shadow: var(--shadow);
+    overflow: hidden;
+  }
+
+  .info-item {
+    display: flex;
+    align-items: flex-start;
+    gap: 24rpx;
+    padding: 32rpx 28rpx;
+    border-top: 1rpx solid var(--line);
+  }
+
+  .info-item:first-child {
+    border-top: 0;
+  }
+
+  .ii {
+    width: 80rpx;
+    height: 80rpx;
+    border-radius: 20rpx;
+    background: var(--primary-soft);
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    flex-shrink: 0;
+  }
+
+  .ii image {
+    width: 40rpx;
+    height: 40rpx;
+  }
+
+  .meta {
     flex: 1;
+    min-width: 0;
+    display: flex;
+    flex-direction: column;
   }
-  .link {
+
+  .meta .small {
+    font-size: 24rpx;
+    color: var(--muted);
+    margin-bottom: 8rpx;
+  }
+
+  .meta .strong {
+    font-size: 30rpx;
+    font-weight: 600;
+    word-break: break-all;
+  }
+
+  .info-item.tel .strong {
     color: var(--primary);
   }
-  .btn-primary {
-    margin-top: 32rpx;
+
+  .arrow {
+    color: #ccc;
+    font-size: 36rpx;
+    align-self: center;
   }
 </style>

+ 64 - 32
mobile-wx/pages/notice/index.vue

@@ -1,17 +1,29 @@
 <template>
-  <view class="page">
-    <view class="card box">
-      <view class="title">在线反馈须知</view>
-      <view class="list">
-        <view>1. 反馈内容应客观具体,尽量写明时间、地点、人物及相关事实。</view>
-        <view>2. 请勿提交涉密信息或不实材料。</view>
-        <view>3. 举报人信息为选填,可匿名反馈;若留联系方式,便于核实回访。</view>
-        <view>4. 纪检室将对反馈信息严格保密,依法依规办理。</view>
+  <view class="notice-body">
+    <view class="notice-card">
+      <view class="notice-title">在线反馈须知</view>
+      <view class="notice-list">
+        <view class="item">1. 请如实反映情况,对所提供信息的真实性负责。</view>
+        <view class="item">2. 反馈内容应客观具体,尽量写明时间、地点、人物及相关事实。</view>
+        <view class="item">3. 可上传图片、视频或文件作为佐证材料,支持多附件。</view>
+        <view class="item">4. 举报人信息为选填,可匿名反馈;若留联系方式,便于核实回访。</view>
+        <view class="item">5. 纪检室将对反馈信息严格保密,依法依规办理。</view>
+        <view class="item">6. 禁止恶意诬告、捏造事实,违者将依法追究责任。</view>
       </view>
-      <view class="hint">温馨提示:反馈类型可选「投诉」或「表扬」。反馈内容为必填项,其他信息均可选填。</view>
-      <view class="count">请仔细阅读须知,<text class="n">{{ seconds }}</text> 秒后进入反馈页面</view>
+      <view class="emphasize">
+        温馨提示:反馈类型可选「投诉」或「表扬」。反馈内容为必填项,其他信息均可选填。
+      </view>
+    </view>
+
+    <view class="countdown-tip">
+      请仔细阅读须知,
+      <text class="n">{{ seconds }}</text>
+      秒后进入反馈页面
+    </view>
+
+    <view class="submit-bar">
       <view class="btn-primary" :class="{ disabled: seconds > 0 }" @click="go">
-        {{ seconds > 0 ? `请阅读(${seconds})` : '已阅读并继续' }}
+        {{ seconds > 0 ? `请阅读须知(${seconds}s)` : '已阅读并继续' }}
       </view>
     </view>
   </view>
@@ -47,37 +59,57 @@
 </script>
 
 <style scoped>
-  .page {
-    padding: 28rpx;
+  .notice-body {
+    min-height: 100vh;
+    box-sizing: border-box;
+    padding: 40rpx 36rpx calc(24rpx + env(safe-area-inset-bottom));
+    background: var(--bg);
   }
-  .box {
-    padding: 32rpx;
+
+  .notice-card {
+    background: var(--card);
+    border-radius: var(--radius);
+    box-shadow: var(--shadow);
+    padding: 40rpx 36rpx;
   }
-  .title {
-    font-size: 34rpx;
-    font-weight: 700;
-    margin-bottom: 20rpx;
+
+  .notice-title {
+    text-align: center;
+    font-size: 36rpx;
+    color: var(--primary);
+    margin-bottom: 32rpx;
+    letter-spacing: 0.08em;
+    font-weight: 600;
   }
-  .list view {
+
+  .notice-list .item {
+    font-size: 28rpx;
+    line-height: 1.85;
     color: #444;
-    line-height: 1.7;
-    margin-bottom: 10rpx;
+    margin-bottom: 16rpx;
   }
-  .hint {
-    margin-top: 16rpx;
-    padding: 16rpx;
+
+  .emphasize {
+    margin-top: 28rpx;
+    padding: 24rpx;
     background: var(--primary-soft);
-    color: var(--primary-dark);
-    border-radius: 10rpx;
-    font-size: 24rpx;
+    border-radius: 16rpx;
+    font-size: 26rpx;
+    color: var(--primary);
+    line-height: 1.7;
   }
-  .count {
-    margin: 24rpx 0;
+
+  .countdown-tip {
+    text-align: center;
+    margin-top: 40rpx;
+    font-size: 28rpx;
     color: var(--muted);
-    font-size: 24rpx;
   }
-  .n {
+
+  .countdown-tip .n {
     color: var(--primary);
+    font-size: 40rpx;
     font-weight: 700;
+    margin: 0 8rpx;
   }
 </style>

+ 36 - 9
mobile-wx/pages/suggest/index.vue

@@ -13,17 +13,20 @@
       <view class="upload-area">
         <view class="upload-hint">附件(选填)· 支持图片、视频、文件,可多选</view>
         <view class="upload-list">
-          <view v-for="(item, i) in attachments" :key="i" class="upload-item">
+          <view v-for="(item, i) in attachments" :key="item.id || i" class="upload-item">
             <image v-if="isImage(item)" :src="item.previewUrl" mode="aspectFill" />
             <view v-else class="file-chip">
               <text class="file-ext">{{ extLabel(item) }}</text>
               <text class="file-name">{{ item.fileName || '附件' }}</text>
             </view>
-            <view class="rm" @click="removeFile(i)">×</view>
+            <view v-if="item.uploading" class="upload-mask">
+              <text class="upload-pct">{{ item.progress || 0 }}%</text>
+            </view>
+            <view v-else class="rm" @click="removeFile(i)">×</view>
           </view>
-          <view class="upload-add" @click="pickFiles">
+          <view class="upload-add" :class="{ disabled: uploading }" @click="pickFiles">
             <text class="plus">+</text>
-            <text>上传</text>
+            <text>{{ uploading ? '上传中' : '上传' }}</text>
           </view>
         </view>
       </view>
@@ -68,6 +71,7 @@
     data() {
       return {
         submitting: false,
+        uploading: false,
         attachments: [],
         form: {
           content: '',
@@ -96,14 +100,33 @@
         return i >= 0 ? name.slice(i + 1).toUpperCase() : 'FILE'
       },
       async pickFiles() {
+        if (this.uploading) return
+        this.uploading = true
         try {
-          const items = await chooseAndUploadFiles('suggestion')
-          this.attachments = this.attachments.concat(items)
-        } catch (e) {}
+          await chooseAndUploadFiles('suggestion', {
+            onItemAdd: (item) => {
+              this.attachments.push(item)
+            },
+            onProgress: (item, progress) => {
+              item.progress = progress
+            },
+            onItemError: (item) => {
+              const idx = this.attachments.findIndex((a) => a === item || a.id === item.id)
+              if (idx >= 0) {
+                revokePreview(this.attachments[idx])
+                this.attachments.splice(idx, 1)
+              }
+            }
+          })
+        } catch (e) {
+        } finally {
+          this.uploading = false
+        }
       },
       removeFile(i) {
         const item = this.attachments[i]
-        if (item) revokePreview(item)
+        if (!item || item.uploading) return
+        revokePreview(item)
         this.attachments.splice(i, 1)
       },
       async submit() {
@@ -111,12 +134,16 @@
           uni.showToast({ title: '请填写建议内容', icon: 'none' })
           return
         }
+        if (this.uploading) {
+          uni.showToast({ title: '请等待附件上传完成', icon: 'none' })
+          return
+        }
         if (this.submitting) return
         this.submitting = true
         try {
           await submitSuggestion({
             ...this.form,
-            attachmentUrls: this.attachments.map((a) => a.url)
+            attachmentUrls: this.attachments.map((a) => a.url).filter(Boolean)
           })
           ;(this.attachments || []).forEach((a) => revokePreview(a))
           this.attachments = []

+ 1 - 0
mobile-wx/src/App.vue

@@ -0,0 +1 @@
+../App.vue

+ 1 - 0
mobile-wx/src/api

@@ -0,0 +1 @@
+../api

+ 1 - 0
mobile-wx/src/config

@@ -0,0 +1 @@
+../config

+ 1 - 0
mobile-wx/src/index.html

@@ -0,0 +1 @@
+../index.html

+ 1 - 0
mobile-wx/src/main.js

@@ -0,0 +1 @@
+../main.js

+ 1 - 0
mobile-wx/src/manifest.json

@@ -0,0 +1 @@
+../manifest.json

+ 1 - 0
mobile-wx/src/pages

@@ -0,0 +1 @@
+../pages

+ 1 - 0
mobile-wx/src/pages.json

@@ -0,0 +1 @@
+../pages.json

+ 1 - 0
mobile-wx/src/static

@@ -0,0 +1 @@
+../static

+ 1 - 0
mobile-wx/src/uni.promisify.adaptor.js

@@ -0,0 +1 @@
+../uni.promisify.adaptor.js

+ 1 - 0
mobile-wx/src/uni.scss

@@ -0,0 +1 @@
+../uni.scss

+ 1 - 0
mobile-wx/src/utils

@@ -0,0 +1 @@
+../utils

二进制
mobile-wx/static/_orig/ajyy.jpeg


二进制
mobile-wx/static/_orig/home-banner.png


二进制
mobile-wx/static/_orig/logo1.png


二进制
mobile-wx/static/ajyy.jpeg


二进制
mobile-wx/static/home-banner.jpg


二进制
mobile-wx/static/home-banner.png


+ 1 - 0
mobile-wx/static/icons/edit.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#fff" d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04a1.003 1.003 0 0 0 0-1.42l-2.34-2.34a1.003 1.003 0 0 0-1.42 0l-1.83 1.83 3.75 3.75 1.84-1.82z"/></svg>

+ 1 - 0
mobile-wx/static/icons/location.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#a51f23" d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5A2.5 2.5 0 1 1 12 6a2.5 2.5 0 0 1 0 5.5z"/></svg>

+ 1 - 0
mobile-wx/static/icons/mail.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#a51f23" d="M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z"/></svg>

+ 1 - 0
mobile-wx/static/icons/phone-red.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#a51f23" d="M6.62 10.79a15.05 15.05 0 0 0 6.59 6.59l2.2-2.2a1 1 0 0 1 1.01-.24c1.12.37 2.33.57 3.58.57a1 1 0 0 1 1 1V20a1 1 0 0 1-1 1C10.4 21 3 13.6 3 4a1 1 0 0 1 1-1h3.5a1 1 0 0 1 1 1c0 1.25.2 2.46.57 3.58a1 1 0 0 1-.25 1.02l-2.2 2.19z"/></svg>

+ 1 - 0
mobile-wx/static/icons/phone.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#fff" d="M6.62 10.79a15.05 15.05 0 0 0 6.59 6.59l2.2-2.2a1 1 0 0 1 1.01-.24c1.12.37 2.33.57 3.58.57a1 1 0 0 1 1 1V20a1 1 0 0 1-1 1C10.4 21 3 13.6 3 4a1 1 0 0 1 1-1h3.5a1 1 0 0 1 1 1c0 1.25.2 2.46.57 3.58a1 1 0 0 1-.25 1.02l-2.2 2.19z"/></svg>

+ 1 - 0
mobile-wx/static/icons/qrcode.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#fff" d="M3 11h8V3H3v8zm2-6h4v4H5V5zm8-2v8h8V3h-8zm6 6h-4V5h4v4M3 21h8v-8H3v8zm2-6h4v4H5v-4zm10 2h2v2h-2zm4-2h-4v4h2v-2h2v-2zm-2-2h2v2h-2zm4 6h-2v2h4v-4h-2z"/></svg>

+ 1 - 0
mobile-wx/static/icons/shield.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#fff" d="M12 1L3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4zm-1 6h2v6h-2V7zm0 8h2v2h-2v-2z"/></svg>

二进制
mobile-wx/static/logo1.jpg


二进制
mobile-wx/static/logo1.png


+ 76 - 76
mobile-wx/uni.scss

@@ -1,76 +1,76 @@
-/**
- * 这里是uni-app内置的常用样式变量
- *
- * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
- * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
- *
- */
-
-/**
- * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
- *
- * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
- */
-
-/* 颜色变量 */
-
-/* 行为相关颜色 */
-$uni-color-primary: #007aff;
-$uni-color-success: #4cd964;
-$uni-color-warning: #f0ad4e;
-$uni-color-error: #dd524d;
-
-/* 文字基本颜色 */
-$uni-text-color:#333;//基本色
-$uni-text-color-inverse:#fff;//反色
-$uni-text-color-grey:#999;//辅助灰色,如加载更多的提示信息
-$uni-text-color-placeholder: #808080;
-$uni-text-color-disable:#c0c0c0;
-
-/* 背景颜色 */
-$uni-bg-color:#ffffff;
-$uni-bg-color-grey:#f8f8f8;
-$uni-bg-color-hover:#f1f1f1;//点击状态颜色
-$uni-bg-color-mask:rgba(0, 0, 0, 0.4);//遮罩颜色
-
-/* 边框颜色 */
-$uni-border-color:#c8c7cc;
-
-/* 尺寸变量 */
-
-/* 文字尺寸 */
-$uni-font-size-sm:12px;
-$uni-font-size-base:14px;
-$uni-font-size-lg:16px;
-
-/* 图片尺寸 */
-$uni-img-size-sm:20px;
-$uni-img-size-base:26px;
-$uni-img-size-lg:40px;
-
-/* Border Radius */
-$uni-border-radius-sm: 2px;
-$uni-border-radius-base: 3px;
-$uni-border-radius-lg: 6px;
-$uni-border-radius-circle: 50%;
-
-/* 水平间距 */
-$uni-spacing-row-sm: 5px;
-$uni-spacing-row-base: 10px;
-$uni-spacing-row-lg: 15px;
-
-/* 垂直间距 */
-$uni-spacing-col-sm: 4px;
-$uni-spacing-col-base: 8px;
-$uni-spacing-col-lg: 12px;
-
-/* 透明度 */
-$uni-opacity-disabled: 0.3; // 组件禁用态的透明度
-
-/* 文章场景相关 */
-$uni-color-title: #2C405A; // 文章标题颜色
-$uni-font-size-title:20px;
-$uni-color-subtitle: #555555; // 二级标题颜色
-$uni-font-size-subtitle:26px;
-$uni-color-paragraph: #3F536E; // 文章段落颜色
-$uni-font-size-paragraph:15px;
+/**
+ * 这里是uni-app内置的常用样式变量
+ *
+ * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
+ * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
+ *
+ */
+
+/**
+ * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
+ *
+ * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
+ */
+
+/* 颜色变量 */
+
+/* 行为相关颜色 */
+$uni-color-primary: #007aff;
+$uni-color-success: #4cd964;
+$uni-color-warning: #f0ad4e;
+$uni-color-error: #dd524d;
+
+/* 文字基本颜色 */
+$uni-text-color:#333;//基本色
+$uni-text-color-inverse:#fff;//反色
+$uni-text-color-grey:#999;//辅助灰色,如加载更多的提示信息
+$uni-text-color-placeholder: #808080;
+$uni-text-color-disable:#c0c0c0;
+
+/* 背景颜色 */
+$uni-bg-color:#ffffff;
+$uni-bg-color-grey:#f8f8f8;
+$uni-bg-color-hover:#f1f1f1;//点击状态颜色
+$uni-bg-color-mask:rgba(0, 0, 0, 0.4);//遮罩颜色
+
+/* 边框颜色 */
+$uni-border-color:#c8c7cc;
+
+/* 尺寸变量 */
+
+/* 文字尺寸 */
+$uni-font-size-sm:12px;
+$uni-font-size-base:14px;
+$uni-font-size-lg:16px;
+
+/* 图片尺寸 */
+$uni-img-size-sm:20px;
+$uni-img-size-base:26px;
+$uni-img-size-lg:40px;
+
+/* Border Radius */
+$uni-border-radius-sm: 2px;
+$uni-border-radius-base: 3px;
+$uni-border-radius-lg: 6px;
+$uni-border-radius-circle: 50%;
+
+/* 水平间距 */
+$uni-spacing-row-sm: 5px;
+$uni-spacing-row-base: 10px;
+$uni-spacing-row-lg: 15px;
+
+/* 垂直间距 */
+$uni-spacing-col-sm: 4px;
+$uni-spacing-col-base: 8px;
+$uni-spacing-col-lg: 12px;
+
+/* 透明度 */
+$uni-opacity-disabled: 0.3; // 组件禁用态的透明度
+
+/* 文章场景相关 */
+$uni-color-title: #2C405A; // 文章标题颜色
+$uni-font-size-title:20px;
+$uni-color-subtitle: #555555; // 二级标题颜色
+$uni-font-size-subtitle:26px;
+$uni-color-paragraph: #3F536E; // 文章段落颜色
+$uni-font-size-paragraph:15px;

+ 118 - 51
mobile-wx/utils/upload.js

@@ -24,6 +24,12 @@ export const ACCEPT_EXTENSIONS = [
 
 const IMAGE_EXTS = ['.jpg', '.jpeg', '.png', '.gif', '.webp', '.bmp']
 
+let _uploadSeq = 0
+function nextUploadId() {
+  _uploadSeq += 1
+  return `up_${Date.now()}_${_uploadSeq}`
+}
+
 export function isImageUrl(urlOrName = '') {
   const name = String(urlOrName).split('?')[0].toLowerCase()
   return IMAGE_EXTS.some((ext) => name.endsWith(ext))
@@ -48,30 +54,38 @@ export function revokePreview(item) {
   }
 }
 
-export function uploadFile(filePath, folder = 'feedback', fileName) {
+function parseUploadBody(raw) {
+  const body = typeof raw === 'string' ? JSON.parse(raw) : raw
+  if (body && body.code === 200) return body.data
+  const err = body || { message: '上传失败' }
+  uni.showToast({ title: err.message || '上传失败', icon: 'none' })
+  throw err
+}
+
+export function uploadFile(filePath, folder = 'feedback', fileName, onProgress) {
   return new Promise((resolve, reject) => {
     const formData = { folder }
     if (fileName) formData.fileName = fileName
-    uni.uploadFile({
+    const task = uni.uploadFile({
       url: `${BASE_URL}/public/attachment/upload`,
       filePath,
       name: 'file',
       formData,
       success: (res) => {
         try {
-          const body = typeof res.data === 'string' ? JSON.parse(res.data) : res.data
-          if (body.code === 200) {
-            resolve(body.data)
-            return
-          }
-          uni.showToast({ title: body.message || '上传失败', icon: 'none' })
-          reject(body)
+          resolve(parseUploadBody(res.data))
         } catch (e) {
           reject(e)
         }
       },
       fail: reject
     })
+    if (task && typeof task.onProgressUpdate === 'function' && onProgress) {
+      task.onProgressUpdate((res) => {
+        const p = typeof res.progress === 'number' ? res.progress : 0
+        onProgress(Math.max(0, Math.min(100, Math.round(p))))
+      })
+    }
   })
 }
 
@@ -104,25 +118,30 @@ function pickFilesViaInput() {
   })
 }
 
-function uploadBlobAsFile(file, folder) {
-  // H5: uni.uploadFile 需要本地临时路径;用 blob URL / File 路径
+function uploadBlobAsFile(file, folder, onProgress) {
   return new Promise((resolve, reject) => {
     // #ifdef H5
     const url = `${BASE_URL}/public/attachment/upload`
     const fd = new FormData()
     fd.append('file', file, file.name)
     fd.append('folder', folder)
-    fetch(url, { method: 'POST', body: fd })
-      .then((r) => r.json())
-      .then((body) => {
-        if (body.code === 200) {
-          resolve(body.data)
-          return
-        }
-        uni.showToast({ title: body.message || '上传失败', icon: 'none' })
-        reject(body)
-      })
-      .catch(reject)
+    const xhr = new XMLHttpRequest()
+    xhr.open('POST', url)
+    if (xhr.upload && onProgress) {
+      xhr.upload.onprogress = (e) => {
+        if (!e.lengthComputable) return
+        onProgress(Math.max(0, Math.min(100, Math.round((e.loaded / e.total) * 100))))
+      }
+    }
+    xhr.onload = () => {
+      try {
+        resolve(parseUploadBody(xhr.responseText))
+      } catch (e) {
+        reject(e)
+      }
+    }
+    xhr.onerror = () => reject(new Error('network'))
+    xhr.send(fd)
     // #endif
     // #ifndef H5
     reject(new Error('unsupported'))
@@ -132,9 +151,39 @@ function uploadBlobAsFile(file, folder) {
 
 /**
  * 选择并上传多种类型附件,不限制个数。
+ * @param {string} folder
+ * @param {{
+ *   onItemAdd?: (item: object) => void,
+ *   onProgress?: (item: object, progress: number) => void,
+ *   onItemSuccess?: (item: object, data: object) => void,
+ *   onItemError?: (item: object, err: any) => void
+ * }} handlers
  * @returns {Promise<Array<{previewUrl:string,url:string,fileName?:string,size?:number}>>}
  */
-export function chooseAndUploadFiles(folder = 'feedback') {
+export function chooseAndUploadFiles(folder = 'feedback', handlers = {}) {
+  const { onItemAdd, onProgress, onItemSuccess, onItemError } = handlers || {}
+
+  const trackUpload = async (draft, uploadFn) => {
+    onItemAdd && onItemAdd(draft)
+    try {
+      const data = await uploadFn((p) => {
+        draft.progress = p
+        onProgress && onProgress(draft, p)
+      })
+      draft.uploading = false
+      draft.progress = 100
+      draft.url = data?.url || ''
+      if (data?.fileName) draft.fileName = data.fileName
+      if (data?.size != null) draft.size = data.size
+      onItemSuccess && onItemSuccess(draft, data)
+      return draft
+    } catch (err) {
+      draft.uploading = false
+      onItemError && onItemError(draft, err)
+      throw err
+    }
+  }
+
   return new Promise(async (resolve, reject) => {
     try {
       // 优先 H5 原生多选(支持任意类型、不限个数)
@@ -148,21 +197,24 @@ export function chooseAndUploadFiles(folder = 'feedback') {
         const items = []
         for (const file of files) {
           const previewUrl = URL.createObjectURL(file)
+          const draft = {
+            id: nextUploadId(),
+            previewUrl,
+            url: '',
+            fileName: file.name,
+            size: file.size,
+            uploading: true,
+            progress: 0
+          }
           try {
-            const data = await uploadBlobAsFile(file, folder)
-            if (data?.url) {
-              items.push({
-                previewUrl,
-                url: data.url,
-                fileName: data.fileName || file.name,
-                size: data.size
-              })
-            } else {
-              URL.revokeObjectURL(previewUrl)
-            }
+            const done = await trackUpload(draft, (onP) =>
+              uploadBlobAsFile(file, folder, onP)
+            )
+            if (done?.url) items.push(done)
+            else URL.revokeObjectURL(previewUrl)
           } catch (err) {
             URL.revokeObjectURL(previewUrl)
-            throw err
+            // 单项失败已 toast;继续后续文件
           }
         }
         resolve(items)
@@ -189,14 +241,22 @@ export function chooseAndUploadFiles(folder = 'feedback') {
               for (let i = 0; i < paths.length; i++) {
                 const path = paths[i]
                 const name = tempFiles[i]?.name
-                const data = await uploadFile(path, folder, name)
-                if (data?.url) {
-                  items.push({
-                    previewUrl: path,
-                    url: data.url,
-                    fileName: data.fileName || name || fileNameFromUrl(data.url),
-                    size: data.size
-                  })
+                const draft = {
+                  id: nextUploadId(),
+                  previewUrl: path,
+                  url: '',
+                  fileName: name || fileNameFromUrl(path),
+                  size: tempFiles[i]?.size,
+                  uploading: true,
+                  progress: 0
+                }
+                try {
+                  const done = await trackUpload(draft, (onP) =>
+                    uploadFile(path, folder, name, onP)
+                  )
+                  if (done?.url) items.push(done)
+                } catch (err) {
+                  // 单项失败已 toast
                 }
               }
               resolve(items)
@@ -222,14 +282,21 @@ export function chooseAndUploadFiles(folder = 'feedback') {
           try {
             const items = []
             for (const path of res.tempFilePaths || []) {
-              const data = await uploadFile(path, folder)
-              if (data?.url) {
-                items.push({
-                  previewUrl: path,
-                  url: data.url,
-                  fileName: data.fileName || fileNameFromUrl(data.url),
-                  size: data.size
-                })
+              const draft = {
+                id: nextUploadId(),
+                previewUrl: path,
+                url: '',
+                fileName: fileNameFromUrl(path),
+                uploading: true,
+                progress: 0
+              }
+              try {
+                const done = await trackUpload(draft, (onP) =>
+                  uploadFile(path, folder, undefined, onP)
+                )
+                if (done?.url) items.push(done)
+              } catch (err) {
+                // 单项失败已 toast
               }
             }
             resolve(items)

+ 9 - 0
mobile-wx/vite.config.js

@@ -0,0 +1,9 @@
+import { defineConfig } from "vite";
+import uni from "@dcloudio/vite-plugin-uni";
+
+/**
+ * @type {import('vite').UserConfig}
+ */
+export default defineConfig({
+  plugins: [uni()],
+});

+ 67 - 0
nginx-ajyy.conf

@@ -0,0 +1,67 @@
+# ajyy 开发环境 — 放到 /root/ajyy/nginx-ajyy.conf
+# 启用: ln -sf /root/ajyy/nginx-ajyy.conf /etc/nginx/conf.d/ajyy.conf
+# 然后: nginx -t && nginx -s reload
+
+upstream ajyy_backend {
+    server 127.0.0.1:18080;
+}
+
+# web-admin
+server {
+    listen 18081;
+    server_name _;
+
+    root /root/ajyy/web-admin/dist;
+    index index.html;
+
+    client_max_body_size 50m;
+
+    location /api/ {
+        proxy_pass http://ajyy_backend/api/;
+        proxy_set_header Host $host;
+        proxy_set_header X-Real-IP $remote_addr;
+        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+        proxy_set_header X-Forwarded-Proto $scheme;
+    }
+
+    location /uploads/ {
+        proxy_pass http://ajyy_backend/uploads/;
+        proxy_set_header Host $host;
+        proxy_set_header X-Real-IP $remote_addr;
+        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+    }
+
+    location / {
+        try_files $uri $uri/ /index.html;
+    }
+}
+
+# mobile-wx H5
+server {
+    listen 18082;
+    server_name _;
+
+    root /root/ajyy/mobile-wx/dist/build/h5;
+    index index.html;
+
+    client_max_body_size 50m;
+
+    location /api/ {
+        proxy_pass http://ajyy_backend/api/;
+        proxy_set_header Host $host;
+        proxy_set_header X-Real-IP $remote_addr;
+        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+        proxy_set_header X-Forwarded-Proto $scheme;
+    }
+
+    location /uploads/ {
+        proxy_pass http://ajyy_backend/uploads/;
+        proxy_set_header Host $host;
+        proxy_set_header X-Real-IP $remote_addr;
+        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+    }
+
+    location / {
+        try_files $uri $uri/ /index.html;
+    }
+}

+ 0 - 0
openspec/changes/archive/.gitkeep


+ 32 - 0
openspec/config.yaml

@@ -0,0 +1,32 @@
+schema: spec-driven
+
+# Project context (optional)
+# This is shown to AI when creating artifacts.
+# Add your tech stack, conventions, style guides, domain knowledge, etc.
+# Example:
+#   context: |
+#     Tech stack: TypeScript, React, Node.js
+#     We use conventional commits
+#     Domain: e-commerce platform
+
+# Per-artifact rules (optional)
+# Add custom rules for specific artifacts.
+# Example:
+#   rules:
+#     proposal:
+#       - Keep proposals under 500 words
+#       - Always include a "Non-goals" section
+#     tasks:
+#       - Break tasks into chunks of max 2 hours
+
+# Per-operation guidance (optional)
+# Add advisory guidance for how apply and archive work should be conducted.
+# This is separate from artifact rules above.
+# Example:
+#   operations:
+#     apply:
+#       guidance:
+#         - Keep test summaries concise
+#     archive:
+#       guidance:
+#         - Summarize the archive outcome before finishing

+ 0 - 0
openspec/specs/.gitkeep


+ 2 - 9
web-admin/package-lock.json

@@ -955,7 +955,6 @@
       "resolved": "https://registry.npmmirror.com/@types/lodash-es/-/lodash-es-4.17.12.tgz",
       "integrity": "sha512-0NgftHUcV4v34VhXm8QBSftKVXtbkBG3ViCjs6+eJ5a6y6Mi/jiFGPc1sC7QK+9BFhWrURE3EOggmWaSxL9OzQ==",
       "license": "MIT",
-      "peer": true,
       "dependencies": {
         "@types/lodash": "*"
       }
@@ -1709,15 +1708,13 @@
       "version": "4.18.1",
       "resolved": "https://registry.npmmirror.com/lodash/-/lodash-4.18.1.tgz",
       "integrity": "sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==",
-      "license": "MIT",
-      "peer": true
+      "license": "MIT"
     },
     "node_modules/lodash-es": {
       "version": "4.18.1",
       "resolved": "https://registry.npmmirror.com/lodash-es/-/lodash-es-4.18.1.tgz",
       "integrity": "sha512-J8xewKD/Gk22OZbhpOVSwcs60zhd95ESDwezOFuA3/099925PdHJ7OFHNTGtajL3AlZkykD32HykiMo+BIBI8A==",
-      "license": "MIT",
-      "peer": true
+      "license": "MIT"
     },
     "node_modules/lodash-unified": {
       "version": "1.0.3",
@@ -1859,7 +1856,6 @@
       "integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==",
       "dev": true,
       "license": "MIT",
-      "peer": true,
       "engines": {
         "node": ">=12"
       },
@@ -2030,7 +2026,6 @@
       "integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==",
       "devOptional": true,
       "license": "Apache-2.0",
-      "peer": true,
       "bin": {
         "tsc": "bin/tsc",
         "tsserver": "bin/tsserver"
@@ -2045,7 +2040,6 @@
       "integrity": "sha512-NTKlcQjlAK7MlQoyb6LgaqHc8sso/pVyUJYWMws3jg21uTJw/LddqIFPcPqP6PzpgbIcZyKI85sFE4HBrQDA8A==",
       "dev": true,
       "license": "MIT",
-      "peer": true,
       "dependencies": {
         "esbuild": "^0.25.0",
         "fdir": "^6.4.4",
@@ -2127,7 +2121,6 @@
       "resolved": "https://registry.npmmirror.com/vue/-/vue-3.5.42.tgz",
       "integrity": "sha512-4RyHQTbQvOPs3MfvUO1Sg0YRrKNnA0mAVtvpd12Tg1fKDN7OHBUl1IqSn8zGJjK9nI3NkNp8cgTpVrSZC5TTcA==",
       "license": "MIT",
-      "peer": true,
       "dependencies": {
         "@vue/compiler-dom": "3.5.42",
         "@vue/compiler-sfc": "3.5.42",

+ 68 - 4
web-admin/src/api/admin.ts

@@ -57,20 +57,72 @@ export function uploadAdminFile(file: File, folder = 'admin') {
   })
 }
 
-/** 经 JWT 代理打开私有附件(返回原始字节,不用统一 JSON 拦截器) */
-export async function openAdminAttachment(url: string) {
+function attachmentFileNameFromUrl(url: string): string {
+  try {
+    const path = String(url).split('?')[0]
+    const seg = path.substring(path.lastIndexOf('/') + 1)
+    return decodeURIComponent(seg || '附件')
+  } catch {
+    return '附件'
+  }
+}
+
+function attachmentFileNameFromHeader(disposition?: string): string | null {
+  if (!disposition) return null
+  const utf8 = /filename\*=UTF-8''([^;]+)/i.exec(disposition)
+  if (utf8?.[1]) {
+    try {
+      return decodeURIComponent(utf8[1].trim())
+    } catch {
+      /* ignore */
+    }
+  }
+  const plain = /filename="?([^";]+)"?/i.exec(disposition)
+  return plain?.[1]?.trim() || null
+}
+
+/** 经 JWT 代理拉取私有附件 blob(不用统一 JSON 拦截器) */
+export async function fetchAdminAttachmentBlob(
+  url: string,
+  options?: { signal?: AbortSignal }
+) {
   const token = localStorage.getItem('ajyy_token')
   const base = import.meta.env.VITE_API_BASE_URL || '/api'
   const res = await axios.get(`${base}/web/admin/attachment/file`, {
     params: { url },
     headers: token ? { Authorization: `Bearer ${token}` } : {},
-    responseType: 'blob'
+    responseType: 'blob',
+    signal: options?.signal
   })
-  const blobUrl = URL.createObjectURL(res.data)
+  const filename =
+    attachmentFileNameFromHeader(res.headers?.['content-disposition']) ||
+    attachmentFileNameFromUrl(url)
+  return { blob: res.data as Blob, filename }
+}
+
+/** 经 JWT 代理打开私有附件(新窗口预览) */
+export async function openAdminAttachment(url: string) {
+  const { blob } = await fetchAdminAttachmentBlob(url)
+  const blobUrl = URL.createObjectURL(blob)
   window.open(blobUrl, '_blank', 'noopener,noreferrer')
   setTimeout(() => URL.revokeObjectURL(blobUrl), 60_000)
 }
 
+/** 经 JWT 代理下载私有附件 */
+export async function downloadAdminAttachment(url: string, filename?: string) {
+  const { blob, filename: nameFromRes } = await fetchAdminAttachmentBlob(url)
+  const name = filename || nameFromRes || '附件'
+  const blobUrl = URL.createObjectURL(blob)
+  const a = document.createElement('a')
+  a.href = blobUrl
+  a.download = name
+  a.rel = 'noopener'
+  document.body.appendChild(a)
+  a.click()
+  a.remove()
+  setTimeout(() => URL.revokeObjectURL(blobUrl), 60_000)
+}
+
 export function fetchUsers() {
   return http.get('/web/admin/users')
 }
@@ -91,6 +143,18 @@ export function fetchRoles() {
   return http.get('/web/admin/roles')
 }
 
+export function createRole(data: Record<string, any>) {
+  return http.post('/web/admin/roles', data)
+}
+
+export function updateRole(id: string, data: Record<string, any>) {
+  return http.put(`/web/admin/roles/${id}`, data)
+}
+
+export function deleteRole(id: string) {
+  return http.delete(`/web/admin/roles/${id}`)
+}
+
 export function fetchMenusTree() {
   return http.get('/web/admin/menus/tree')
 }

二进制
web-admin/src/assets/logo1.jpeg


+ 255 - 0
web-admin/src/components/AttachmentGrid.vue

@@ -0,0 +1,255 @@
+<template>
+  <div v-if="items.length" class="att-grid">
+    <div v-for="(item, i) in items" :key="item.url + '-' + i" class="att-card">
+      <div class="att-thumb">
+        <template v-if="item.kind === 'image'">
+          <div v-if="item.loading" class="att-placeholder loading">加载中</div>
+          <el-image
+            v-else-if="item.previewUrl"
+            :src="item.previewUrl"
+            :preview-src-list="imagePreviewList"
+            :initial-index="imagePreviewIndex(item)"
+            fit="cover"
+            preview-teleported
+            class="att-image"
+          />
+          <div v-else class="att-placeholder" @click="previewItem(item)">
+            <el-icon :size="28"><Picture /></el-icon>
+            <span>{{ item.extLabel }}</span>
+          </div>
+        </template>
+        <div
+          v-else
+          class="att-placeholder"
+          :class="item.kind"
+          @click="previewItem(item)"
+        >
+          <el-icon :size="32">
+            <VideoPlay v-if="item.kind === 'video'" />
+            <Document v-else />
+          </el-icon>
+          <span>{{ item.extLabel }}</span>
+        </div>
+      </div>
+      <div class="att-meta" :title="item.name">{{ item.name }}</div>
+      <el-button
+        link
+        type="primary"
+        size="small"
+        :loading="item.downloading"
+        @click="downloadItem(item)"
+      >
+        <el-icon><Download /></el-icon>
+        下载
+      </el-button>
+    </div>
+  </div>
+  <span v-else>无</span>
+</template>
+
+<script setup lang="ts">
+  import { computed, onBeforeUnmount, ref, watch } from 'vue'
+  import { ElMessage } from 'element-plus'
+  import { Document, Download, Picture, VideoPlay } from '@element-plus/icons-vue'
+  import {
+    downloadAdminAttachment,
+    fetchAdminAttachmentBlob,
+    openAdminAttachment
+  } from '@/api/admin'
+  import {
+    classifyAttachment,
+    extLabelOf,
+    fileNameFromUrl,
+    mapPool,
+    type AttKind
+  } from '@/utils/attachment'
+
+  type AttItem = {
+    url: string
+    name: string
+    kind: AttKind
+    extLabel: string
+    previewUrl?: string
+    loading?: boolean
+    downloading?: boolean
+  }
+
+  const props = defineProps<{
+    urls?: string[] | null
+  }>()
+
+  const items = ref<AttItem[]>([])
+  let abortCtrl: AbortController | null = null
+  let loadSeq = 0
+
+  const IMAGE_CONCURRENCY = 2
+
+  const imagePreviewList = computed(() =>
+    items.value.filter((i) => i.kind === 'image' && i.previewUrl).map((i) => i.previewUrl as string)
+  )
+
+  function imagePreviewIndex(item: AttItem) {
+    if (!item.previewUrl) return 0
+    const idx = imagePreviewList.value.indexOf(item.previewUrl)
+    return idx >= 0 ? idx : 0
+  }
+
+  function revokePreviews() {
+    items.value.forEach((item) => {
+      if (item.previewUrl?.startsWith('blob:')) {
+        try {
+          URL.revokeObjectURL(item.previewUrl)
+        } catch {
+          /* ignore */
+        }
+      }
+    })
+  }
+
+  function cancelLoad() {
+    abortCtrl?.abort()
+    abortCtrl = null
+  }
+
+  async function loadThumbs(urls: string[]) {
+    cancelLoad()
+    revokePreviews()
+    const seq = ++loadSeq
+    const ctrl = new AbortController()
+    abortCtrl = ctrl
+
+    items.value = urls.map((url) => {
+      const kind = classifyAttachment(url)
+      return {
+        url,
+        name: fileNameFromUrl(url),
+        kind,
+        extLabel: extLabelOf(url, kind),
+        loading: kind === 'image'
+      }
+    })
+
+    const imageEntries = items.value
+      .map((item, idx) => ({ item, idx }))
+      .filter((e) => e.item.kind === 'image')
+
+    await mapPool(imageEntries, IMAGE_CONCURRENCY, async ({ item, idx }) => {
+      if (seq !== loadSeq || ctrl.signal.aborted) return
+      try {
+        const { blob } = await fetchAdminAttachmentBlob(item.url, { signal: ctrl.signal })
+        if (seq !== loadSeq || ctrl.signal.aborted) return
+        const previewUrl = URL.createObjectURL(blob)
+        const cur = items.value[idx]
+        if (!cur || cur.url !== item.url) {
+          URL.revokeObjectURL(previewUrl)
+          return
+        }
+        items.value[idx] = { ...cur, previewUrl, loading: false }
+      } catch (err: any) {
+        if (err?.code === 'ERR_CANCELED' || err?.name === 'CanceledError' || ctrl.signal.aborted) {
+          return
+        }
+        if (seq !== loadSeq) return
+        const cur = items.value[idx]
+        if (cur) items.value[idx] = { ...cur, loading: false }
+      }
+    })
+  }
+
+  async function previewItem(item: AttItem) {
+    try {
+      await openAdminAttachment(item.url)
+    } catch {
+      ElMessage.error('打开附件失败')
+    }
+  }
+
+  async function downloadItem(item: AttItem) {
+    item.downloading = true
+    try {
+      await downloadAdminAttachment(item.url, item.name)
+    } catch {
+      ElMessage.error('下载失败')
+    } finally {
+      item.downloading = false
+    }
+  }
+
+  watch(
+    () => props.urls,
+    (urls) => {
+      loadThumbs(Array.isArray(urls) ? urls.filter(Boolean) : [])
+    },
+    { immediate: true, deep: true }
+  )
+
+  onBeforeUnmount(() => {
+    cancelLoad()
+    revokePreviews()
+    items.value = []
+  })
+</script>
+
+<style scoped>
+  .att-grid {
+    display: flex;
+    flex-wrap: wrap;
+    gap: 12px;
+  }
+  .att-card {
+    width: 112px;
+    display: flex;
+    flex-direction: column;
+    align-items: stretch;
+    gap: 6px;
+  }
+  .att-thumb {
+    width: 112px;
+    height: 112px;
+    border-radius: 8px;
+    overflow: hidden;
+    border: 1px solid #e5e7eb;
+    background: #f8fafc;
+  }
+  .att-image {
+    width: 100%;
+    height: 100%;
+    cursor: zoom-in;
+  }
+  .att-placeholder {
+    width: 100%;
+    height: 100%;
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    justify-content: center;
+    gap: 6px;
+    cursor: pointer;
+    color: #64748b;
+    font-size: 12px;
+    font-weight: 600;
+    letter-spacing: 0.02em;
+    user-select: none;
+  }
+  .att-placeholder.loading {
+    cursor: default;
+    font-weight: 400;
+    color: #94a3b8;
+  }
+  .att-placeholder.video {
+    background: #eff6ff;
+    color: #1d4ed8;
+  }
+  .att-placeholder.file {
+    background: #f8fafc;
+    color: #475569;
+  }
+  .att-meta {
+    font-size: 12px;
+    color: #64748b;
+    line-height: 1.3;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+  }
+</style>

+ 24 - 4
web-admin/src/layouts/AdminLayout.vue

@@ -2,8 +2,11 @@
   <div class="layout">
     <aside class="sidebar">
       <div class="brand">
-        <div class="brand-title">安徽建工集团医院</div>
-        <div class="brand-sub">纪检室管理后台</div>
+        <img class="brand-logo" src="@/assets/logo1.jpeg" alt="安徽建工" />
+        <div class="brand-text">
+          <div class="brand-title">安徽建工集团医院</div>
+          <div class="brand-sub">纪检室管理后台</div>
+        </div>
       </div>
       <el-menu
         :default-active="active"
@@ -89,17 +92,34 @@
     overflow: auto;
   }
   .brand {
-    padding: 20px 16px;
+    display: flex;
+    align-items: center;
+    gap: 10px;
+    padding: 16px 12px;
     border-bottom: 1px solid #333;
   }
+  .brand-logo {
+    width: 44px;
+    height: 44px;
+    flex-shrink: 0;
+    object-fit: contain;
+    background: #fff;
+    border-radius: 6px;
+    border: 1px solid #e5e5e5;
+  }
+  .brand-text {
+    min-width: 0;
+  }
   .brand-title {
-    font-size: 15px;
+    font-size: 14px;
     font-weight: 600;
+    line-height: 1.3;
   }
   .brand-sub {
     margin-top: 4px;
     font-size: 12px;
     color: #aaa;
+    line-height: 1.3;
   }
   .main {
     flex: 1;

+ 3 - 2
web-admin/src/router/index.ts

@@ -92,8 +92,9 @@ router.beforeEach(async (to) => {
     try {
       await store.fetchProfile()
     } catch {
-      await store.logout()
-      return { name: 'login' }
+      // token 失效时 http 拦截器已静默跳转;此处只清本地态,勿再调 logout 接口
+      store.clearAuth()
+      return { name: 'login', query: { redirect: to.fullPath } }
     }
   }
   const code = to.meta.menuCode as string | undefined

+ 12 - 6
web-admin/src/stores/user.ts

@@ -46,17 +46,23 @@ export const useUserStore = defineStore('user', {
       this.menus = menus.data?.tree || []
       this.permCodes = menus.data?.permCodes || []
     },
-    async logout() {
-      try {
-        await logoutApi()
-      } catch {
-        /* ignore */
-      }
+    /** 仅清本地会话,不调 logout 接口(避免无效 token 再触发一次 401) */
+    clearAuth() {
       this.token = ''
       this.user = null
       this.menus = []
       this.permCodes = []
       localStorage.removeItem('ajyy_token')
+    },
+    async logout() {
+      if (this.token) {
+        try {
+          await logoutApi()
+        } catch {
+          /* ignore */
+        }
+      }
+      this.clearAuth()
     }
   }
 })

+ 15 - 0
web-admin/src/styles/index.css

@@ -3,6 +3,15 @@
   --ajyy-primary-dark: #8a1a1d;
   --ajyy-bg: #f5f5f5;
   --ajyy-sidebar: #1f1f1f;
+
+  /* Element Plus 主题色:品牌红 */
+  --el-color-primary: #a51f23;
+  --el-color-primary-light-3: #c06265;
+  --el-color-primary-light-5: #d28f91;
+  --el-color-primary-light-7: #e4bcbd;
+  --el-color-primary-light-8: #edd2d3;
+  --el-color-primary-light-9: #f6e9e9;
+  --el-color-primary-dark-2: #84191c;
 }
 
 * {
@@ -25,3 +34,9 @@ body,
   --el-button-hover-bg-color: var(--ajyy-primary-dark);
   --el-button-hover-border-color: var(--ajyy-primary-dark);
 }
+
+/* 列表表格正文字体改为近黑色 */
+.el-table {
+  --el-table-text-color: #1f1f1f;
+  --el-table-header-text-color: #1f1f1f;
+}

+ 53 - 0
web-admin/src/utils/attachment.ts

@@ -0,0 +1,53 @@
+export type AttKind = 'image' | 'video' | 'file'
+
+const IMAGE_EXTS = ['.jpg', '.jpeg', '.png', '.gif', '.webp', '.bmp']
+const VIDEO_EXTS = ['.mp4', '.mov', '.avi', '.webm']
+
+export function fileNameFromUrl(url = '') {
+  try {
+    const path = String(url).split('?')[0]
+    const seg = path.substring(path.lastIndexOf('/') + 1)
+    return decodeURIComponent(seg || '附件')
+  } catch {
+    return '附件'
+  }
+}
+
+export function extOf(urlOrName = '') {
+  const name = String(urlOrName).split('?')[0].toLowerCase()
+  const idx = name.lastIndexOf('.')
+  return idx >= 0 ? name.slice(idx) : ''
+}
+
+export function classifyAttachment(url: string): AttKind {
+  const ext = extOf(url)
+  if (IMAGE_EXTS.includes(ext)) return 'image'
+  if (VIDEO_EXTS.includes(ext)) return 'video'
+  return 'file'
+}
+
+export function extLabelOf(url: string, kind: AttKind) {
+  const ext = extOf(url).replace('.', '').toUpperCase()
+  if (ext) return ext
+  if (kind === 'video') return 'VIDEO'
+  if (kind === 'image') return 'IMG'
+  return 'FILE'
+}
+
+/** 限制并发执行异步任务 */
+export async function mapPool<T, R>(
+  items: T[],
+  limit: number,
+  fn: (item: T, index: number) => Promise<R>
+): Promise<R[]> {
+  const results = new Array<R>(items.length)
+  let next = 0
+  const workers = Array.from({ length: Math.max(1, Math.min(limit, items.length || 1)) }, async () => {
+    while (next < items.length) {
+      const idx = next++
+      results[idx] = await fn(items[idx], idx)
+    }
+  })
+  await Promise.all(workers)
+  return results
+}

+ 40 - 8
web-admin/src/utils/http.ts

@@ -7,11 +7,35 @@ const http = axios.create({
   timeout: 30000
 })
 
+let handling401 = false
+
+function isLoginRequest(config?: { url?: string }) {
+  return Boolean(config?.url && config.url.includes('/auth/login'))
+}
+
+/** 会话失效:清 token 并静默跳转登录,避免打开首页连弹「未登录或令牌无效」 */
+function handleUnauthorized() {
+  localStorage.removeItem('ajyy_token')
+  if (handling401) return
+  handling401 = true
+  const redirect =
+    router.currentRoute.value.name === 'login'
+      ? undefined
+      : router.currentRoute.value.fullPath
+  router
+    .replace({
+      name: 'login',
+      query: redirect && redirect !== '/login' ? { redirect } : undefined
+    })
+    .finally(() => {
+      handling401 = false
+    })
+}
+
 http.interceptors.request.use((config) => {
   const token = localStorage.getItem('ajyy_token')
   if (token) {
-    config.headers = config.headers || {}
-    config.headers.Authorization = `Bearer ${token}`
+    config.headers.set('Authorization', `Bearer ${token}`)
   }
   return config
 })
@@ -20,10 +44,14 @@ http.interceptors.response.use(
   (response) => {
     const body = response.data
     if (body && typeof body.code === 'number' && body.code !== 200) {
-      ElMessage.error(body.message || '请求失败')
       if (body.code === 401) {
-        localStorage.removeItem('ajyy_token')
-        router.push({ name: 'login' })
+        if (isLoginRequest(response.config)) {
+          ElMessage.error(body.message || '请求失败')
+        } else {
+          handleUnauthorized()
+        }
+      } else {
+        ElMessage.error(body.message || '请求失败')
       }
       return Promise.reject(body)
     }
@@ -34,10 +62,14 @@ http.interceptors.response.use(
     const data = error?.response?.data
     const msg = data?.message || error.message || '网络错误'
     if (status === 401) {
-      localStorage.removeItem('ajyy_token')
-      router.push({ name: 'login' })
+      if (isLoginRequest(error.config)) {
+        ElMessage.error(msg)
+      } else {
+        handleUnauthorized()
+      }
+    } else {
+      ElMessage.error(msg)
     }
-    ElMessage.error(msg)
     return Promise.reject(error)
   }
 )

+ 26 - 6
web-admin/src/views/audit/index.vue

@@ -1,5 +1,10 @@
 <template>
   <div class="panel">
+    <div class="toolbar">
+      <el-input v-model="query.username" clearable placeholder="操作人" style="width: 160px" />
+      <el-input v-model="query.keyword" clearable placeholder="关键词" style="width: 220px" />
+      <el-button type="primary" @click="onSearch">查询</el-button>
+    </div>
     <el-table :data="list" v-loading="loading" stripe>
       <el-table-column prop="username" label="操作人" width="120" />
       <el-table-column prop="module" label="模块" width="120" />
@@ -12,8 +17,8 @@
         background
         layout="total, prev, pager, next"
         :total="total"
-        v-model:current-page="page"
-        :page-size="pageSize"
+        v-model:current-page="query.page"
+        :page-size="query.pageSize"
         @current-change="load"
       />
     </div>
@@ -21,19 +26,23 @@
 </template>
 
 <script setup lang="ts">
-  import { onMounted, ref } from 'vue'
+  import { onMounted, reactive, ref } from 'vue'
   import { fetchOperLogs } from '@/api/admin'
 
   const loading = ref(false)
   const list = ref<any[]>([])
   const total = ref(0)
-  const page = ref(1)
-  const pageSize = 10
+  const query = reactive({
+    username: '',
+    keyword: '',
+    page: 1,
+    pageSize: 10
+  })
 
   async function load() {
     loading.value = true
     try {
-      const res: any = await fetchOperLogs({ page: page.value, pageSize })
+      const res: any = await fetchOperLogs({ ...query })
       list.value = res.data.list || []
       total.value = res.data.total || 0
     } finally {
@@ -41,6 +50,11 @@
     }
   }
 
+  function onSearch() {
+    query.page = 1
+    load()
+  }
+
   onMounted(load)
 </script>
 
@@ -50,6 +64,12 @@
     border-radius: 10px;
     padding: 20px;
   }
+  .toolbar {
+    display: flex;
+    gap: 10px;
+    margin-bottom: 14px;
+    flex-wrap: wrap;
+  }
   .pager {
     margin-top: 14px;
     display: flex;

+ 42 - 28
web-admin/src/views/feedback/index.vue

@@ -14,6 +14,13 @@
       <el-button type="primary" @click="load">查询</el-button>
     </div>
     <el-table :data="list" v-loading="loading" stripe>
+      <el-table-column
+        type="index"
+        label="序号"
+        width="60"
+        align="center"
+        :index="(index) => (query.page - 1) * query.pageSize + index + 1"
+      />
       <el-table-column prop="bizNo" label="编号" min-width="140" />
       <el-table-column prop="fbType" label="类型" width="90" />
       <el-table-column prop="targetName" label="被反馈人" width="110" />
@@ -38,9 +45,16 @@
       />
     </div>
 
-    <el-drawer v-model="drawer" title="反馈详情" size="480px">
+    <el-dialog
+      v-model="dialogVisible"
+      title="反馈详情"
+      width="860px"
+      class="feedback-detail-dialog"
+      destroy-on-close
+      @closed="onDialogClosed"
+    >
       <template v-if="detail">
-        <el-descriptions :column="1" border>
+        <el-descriptions :column="2" border>
           <el-descriptions-item label="编号">{{ detail.bizNo }}</el-descriptions-item>
           <el-descriptions-item label="类型">{{ detail.fbType }}</el-descriptions-item>
           <el-descriptions-item label="状态">{{ detail.status }}</el-descriptions-item>
@@ -48,25 +62,16 @@
             {{ detail.targetName || '-' }} / {{ detail.targetDept || '-' }} /
             {{ detail.targetPost || '-' }}
           </el-descriptions-item>
-          <el-descriptions-item label="内容">{{ detail.content }}</el-descriptions-item>
-          <el-descriptions-item label="举报人">
+          <el-descriptions-item label="举报人" :span="2">
             {{ detail.reporterName || '匿名' }}
             <template v-if="detail.reporterUnit || detail.reporterPost">
               ({{ detail.reporterUnit || '-' }} / {{ detail.reporterPost || '-' }})
             </template>
             {{ detail.reporterPhone || '' }}
           </el-descriptions-item>
-          <el-descriptions-item label="附件">
-            <div v-if="detail.attachmentUrls?.length" class="att-list">
-              <a
-                v-for="(u, i) in detail.attachmentUrls"
-                :key="i"
-                href="#"
-                @click.prevent="openAdminAttachment(u)"
-                >附件{{ i + 1 }}</a
-              >
-            </div>
-            <span v-else>无</span>
+          <el-descriptions-item label="内容" :span="2">{{ detail.content }}</el-descriptions-item>
+          <el-descriptions-item label="附件" :span="2">
+            <AttachmentGrid :urls="detail.attachmentUrls" />
           </el-descriptions-item>
         </el-descriptions>
         <div v-if="canHandle" class="handle-box">
@@ -82,19 +87,21 @@
             :rows="3"
             placeholder="办理备注"
           />
-          <el-button type="primary" style="margin-top: 12px" :loading="saving" @click="saveHandle"
-            >保存</el-button
-          >
         </div>
       </template>
-    </el-drawer>
+      <template v-if="canHandle" #footer>
+        <el-button @click="dialogVisible = false">取消</el-button>
+        <el-button type="primary" :loading="saving" @click="saveHandle">保存</el-button>
+      </template>
+    </el-dialog>
   </div>
 </template>
 
 <script setup lang="ts">
   import { computed, onMounted, reactive, ref } from 'vue'
   import { ElMessage } from 'element-plus'
-  import { fetchFeedback, fetchFeedbacks, openAdminAttachment, updateFeedbackStatus } from '@/api/admin'
+  import { fetchFeedback, fetchFeedbacks, updateFeedbackStatus } from '@/api/admin'
+  import AttachmentGrid from '@/components/AttachmentGrid.vue'
   import { useUserStore } from '@/stores/user'
 
   const userStore = useUserStore()
@@ -103,7 +110,7 @@
   const saving = ref(false)
   const list = ref<any[]>([])
   const total = ref(0)
-  const drawer = ref(false)
+  const dialogVisible = ref(false)
   const detail = ref<any>(null)
   const query = reactive({
     status: '',
@@ -114,6 +121,10 @@
   })
   const handleForm = reactive({ status: '', handleRemark: '' })
 
+  function onDialogClosed() {
+    detail.value = null
+  }
+
   async function load() {
     loading.value = true
     try {
@@ -130,20 +141,20 @@
     detail.value = res.data
     handleForm.status = res.data.status
     handleForm.handleRemark = res.data.handleRemark || ''
-    drawer.value = true
+    dialogVisible.value = true
   }
 
   async function saveHandle() {
     if (!detail.value) return
     saving.value = true
     try {
-      const res: any = await updateFeedbackStatus(detail.value.id, {
+      await updateFeedbackStatus(detail.value.id, {
         status: handleForm.status,
         handleRemark: handleForm.handleRemark
       })
-      detail.value = res.data
       ElMessage.success('已保存')
-      load()
+      dialogVisible.value = false
+      await load()
     } finally {
       saving.value = false
     }
@@ -172,8 +183,11 @@
   .handle-box {
     margin-top: 20px;
   }
-  a {
-    display: block;
-    color: #a51f23;
+</style>
+
+<style>
+  .feedback-detail-dialog .el-dialog__body {
+    max-height: calc(100vh - 160px);
+    overflow-y: auto;
   }
 </style>

+ 95 - 14
web-admin/src/views/hotline/index.vue

@@ -1,19 +1,52 @@
 <template>
   <div class="panel">
     <h2>监督热线配置</h2>
-    <p class="desc">配置后同步至移动端「监督热线」页面展示。</p>
+    <p class="desc">配置后同步至移动端「监督热线」页面展示。电话、邮箱、地址均可添加多项。</p>
     <el-form :model="form" label-position="top" style="max-width: 520px" :disabled="!canWrite">
       <el-form-item label="监督电话">
-        <el-input v-model="form.phone" />
+        <div class="multi-list">
+          <div v-for="(p, idx) in form.phones" :key="'phone-' + idx" class="multi-row">
+            <el-input v-model="form.phones[idx]" placeholder="如 0551-11111111" />
+            <el-button
+              v-if="canWrite"
+              :disabled="form.phones.length <= 1"
+              @click="removeItem(form.phones, idx)"
+            >
+              删除
+            </el-button>
+          </div>
+          <el-button v-if="canWrite" @click="addItem(form.phones)">添加号码</el-button>
+        </div>
       </el-form-item>
       <el-form-item label="电子邮箱">
-        <el-input v-model="form.email" />
+        <div class="multi-list">
+          <div v-for="(e, idx) in form.emails" :key="'email-' + idx" class="multi-row">
+            <el-input v-model="form.emails[idx]" placeholder="如 jj@example.com" />
+            <el-button
+              v-if="canWrite"
+              :disabled="form.emails.length <= 1"
+              @click="removeItem(form.emails, idx)"
+            >
+              删除
+            </el-button>
+          </div>
+          <el-button v-if="canWrite" @click="addItem(form.emails)">添加邮箱</el-button>
+        </div>
       </el-form-item>
       <el-form-item label="通讯地址">
-        <el-input v-model="form.address" />
-      </el-form-item>
-      <el-form-item label="受理时间说明">
-        <el-input v-model="form.workTime" type="textarea" :rows="3" />
+        <div class="multi-list">
+          <div v-for="(a, idx) in form.addresses" :key="'addr-' + idx" class="multi-row">
+            <el-input v-model="form.addresses[idx]" placeholder="通讯地址" />
+            <el-button
+              v-if="canWrite"
+              :disabled="form.addresses.length <= 1"
+              @click="removeItem(form.addresses, idx)"
+            >
+              删除
+            </el-button>
+          </div>
+          <el-button v-if="canWrite" @click="addItem(form.addresses)">添加地址</el-button>
+        </div>
       </el-form-item>
       <el-button v-if="canWrite" type="primary" :loading="saving" @click="save">保存</el-button>
     </el-form>
@@ -30,22 +63,56 @@
   const canWrite = computed(() => userStore.hasPerm('hotline:write'))
   const saving = ref(false)
   const form = reactive({
-    phone: '',
-    email: '',
-    address: '',
-    workTime: ''
+    phones: [''] as string[],
+    emails: [''] as string[],
+    addresses: [''] as string[]
   })
 
+  function normalizeListFromPayload(
+    data: Record<string, any>,
+    listKey: string,
+    singleKey: string
+  ) {
+    const list = Array.isArray(data?.[listKey])
+      ? data[listKey].map((x: any) => String(x || '').trim()).filter(Boolean)
+      : []
+    if (list.length) return list
+    const single = String(data?.[singleKey] || '').trim()
+    return single ? [single] : ['']
+  }
+
+  function applyPayload(data: Record<string, any>) {
+    form.phones = normalizeListFromPayload(data, 'phones', 'phone')
+    form.emails = normalizeListFromPayload(data, 'emails', 'email')
+    form.addresses = normalizeListFromPayload(data, 'addresses', 'address')
+  }
+
+  function addItem(list: string[]) {
+    list.push('')
+  }
+
+  function removeItem(list: string[], idx: number) {
+    if (list.length <= 1) return
+    list.splice(idx, 1)
+  }
+
   onMounted(async () => {
     const res: any = await fetchHotline()
-    Object.assign(form, res.data || {})
+    applyPayload(res.data || {})
   })
 
   async function save() {
+    const phones = form.phones.map((p) => p.trim()).filter(Boolean)
+    if (!phones.length) {
+      ElMessage.warning('请至少填写一个监督电话')
+      return
+    }
+    const emails = form.emails.map((e) => e.trim()).filter(Boolean)
+    const addresses = form.addresses.map((a) => a.trim()).filter(Boolean)
     saving.value = true
     try {
-      const res: any = await saveHotline({ ...form })
-      Object.assign(form, res.data || {})
+      const res: any = await saveHotline({ phones, emails, addresses })
+      applyPayload(res.data || {})
       ElMessage.success('已保存')
     } finally {
       saving.value = false
@@ -67,4 +134,18 @@
     font-size: 13px;
     margin-bottom: 16px;
   }
+  .multi-list {
+    display: flex;
+    flex-direction: column;
+    gap: 10px;
+    width: 100%;
+  }
+  .multi-row {
+    display: flex;
+    gap: 8px;
+    align-items: center;
+  }
+  .multi-row .el-input {
+    flex: 1;
+  }
 </style>

+ 33 - 7
web-admin/src/views/login/index.vue

@@ -1,8 +1,13 @@
 <template>
   <div class="login-page">
     <div class="card">
-      <h1>安徽建工集团医院纪检室</h1>
-      <p class="sub">管理后台登录</p>
+      <div class="brand">
+        <img class="brand-logo" src="@/assets/logo1.jpeg" alt="安徽建工" />
+        <div class="brand-text">
+          <h1>安徽建工集团医院纪检室</h1>
+          <p class="sub">管理后台登录</p>
+        </div>
+      </div>
       <el-form :model="form" @submit.prevent="onSubmit">
         <el-form-item label="账号">
           <el-input v-model="form.username" placeholder="请输入账号" />
@@ -67,22 +72,43 @@
     background: linear-gradient(160deg, #3a0d0f 0%, #a51f23 45%, #f5f5f5 100%);
   }
   .card {
-    width: 380px;
+    width: 400px;
     background: #fff;
     border-radius: 12px;
     padding: 32px 28px 28px;
     box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
   }
+  .brand {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    gap: 12px;
+    margin-bottom: 24px;
+  }
+  .brand-logo {
+    width: 56px;
+    height: 56px;
+    flex-shrink: 0;
+    object-fit: contain;
+    background: #fff;
+    border-radius: 8px;
+    border: 1px solid #eee;
+  }
+  .brand-text {
+    min-width: 0;
+    text-align: left;
+  }
   h1 {
     margin: 0;
-    font-size: 20px;
-    text-align: center;
+    font-size: 18px;
+    line-height: 1.35;
+    font-weight: 600;
   }
   .sub {
-    margin: 8px 0 24px;
-    text-align: center;
+    margin: 6px 0 0;
     color: #888;
     font-size: 13px;
+    line-height: 1.3;
   }
   .submit {
     width: 100%;

+ 162 - 10
web-admin/src/views/role/index.vue

@@ -1,7 +1,10 @@
 <template>
   <div class="panel role-page">
     <aside class="roles">
-      <h3>角色</h3>
+      <div class="roles-head">
+        <h3>角色</h3>
+        <el-button type="primary" size="small" @click="openCreate">新增</el-button>
+      </div>
       <div
         v-for="r in roles"
         :key="r.id"
@@ -9,8 +12,20 @@
         :class="{ active: r.id === currentId }"
         @click="selectRole(r)"
       >
-        <div class="name">{{ r.roleName }}</div>
-        <div class="code">{{ r.roleCode }}</div>
+        <div class="role-main">
+          <div class="name">{{ r.roleName }}</div>
+          <div class="code">{{ r.roleCode }}</div>
+        </div>
+        <div class="role-actions">
+          <el-button link type="primary" @click.stop="openEdit(r)">编辑</el-button>
+          <el-button
+            link
+            type="danger"
+            :disabled="r.roleCode === 'admin'"
+            @click.stop="removeRole(r)"
+            >删除</el-button
+          >
+        </div>
       </div>
     </aside>
     <section class="grant">
@@ -31,26 +46,75 @@
       />
       <el-empty v-else description="暂无菜单" />
     </section>
+
+    <el-dialog v-model="editVisible" :title="editingId ? '编辑角色' : '新增角色'" width="480px">
+      <el-form :model="form" label-position="top">
+        <el-form-item label="角色编码">
+          <el-input
+            v-model="form.roleCode"
+            :disabled="!!editingId"
+            placeholder="创建后不可修改"
+          />
+        </el-form-item>
+        <el-form-item label="角色名称">
+          <el-input v-model="form.roleName" placeholder="请输入角色名称" />
+        </el-form-item>
+        <el-form-item label="备注">
+          <el-input v-model="form.remark" type="textarea" :rows="2" placeholder="选填" />
+        </el-form-item>
+      </el-form>
+      <template #footer>
+        <el-button @click="editVisible = false">取消</el-button>
+        <el-button type="primary" :loading="formSaving" @click="saveRole">确定</el-button>
+      </template>
+    </el-dialog>
   </div>
 </template>
 
 <script setup lang="ts">
-  import { nextTick, onMounted, ref } from 'vue'
-  import { ElMessage } from 'element-plus'
-  import { fetchMenusTree, fetchRoleMenus, fetchRoles, saveRoleMenus } from '@/api/admin'
+  import { nextTick, onMounted, reactive, ref } from 'vue'
+  import { ElMessage, ElMessageBox } from 'element-plus'
+  import {
+    createRole,
+    deleteRole,
+    fetchMenusTree,
+    fetchRoleMenus,
+    fetchRoles,
+    saveRoleMenus,
+    updateRole
+  } from '@/api/admin'
 
   const roles = ref<any[]>([])
   const treeData = ref<any[]>([])
   const currentId = ref('')
   const current = ref<any>(null)
   const saving = ref(false)
+  const formSaving = ref(false)
   const treeRef = ref()
+  const editVisible = ref(false)
+  const editingId = ref('')
+  const form = reactive({
+    roleCode: '',
+    roleName: '',
+    remark: ''
+  })
 
-  async function loadRoles() {
+  async function loadRoles(preferId?: string) {
     const res: any = await fetchRoles()
     roles.value = res.data || []
-    if (roles.value.length && !currentId.value) {
-      selectRole(roles.value[0])
+    const targetId = preferId || currentId.value
+    if (targetId) {
+      const found = roles.value.find((r) => r.id === targetId)
+      if (found) {
+        await selectRole(found)
+        return
+      }
+    }
+    if (roles.value.length) {
+      await selectRole(roles.value[0])
+    } else {
+      current.value = null
+      currentId.value = ''
     }
   }
 
@@ -68,6 +132,72 @@
     treeRef.value?.setCheckedKeys(ids, false)
   }
 
+  function openCreate() {
+    editingId.value = ''
+    Object.assign(form, { roleCode: '', roleName: '', remark: '' })
+    editVisible.value = true
+  }
+
+  function openEdit(r: any) {
+    editingId.value = r.id
+    Object.assign(form, {
+      roleCode: r.roleCode || '',
+      roleName: r.roleName || '',
+      remark: r.remark || ''
+    })
+    editVisible.value = true
+  }
+
+  async function removeRole(r: any) {
+    if (r.roleCode === 'admin') {
+      ElMessage.warning('系统管理员角色不可删除')
+      return
+    }
+    try {
+      await ElMessageBox.confirm(
+        `确定删除角色「${r.roleName}」吗?删除后不可恢复。`,
+        '删除确认',
+        { type: 'warning', confirmButtonText: '删除', cancelButtonText: '取消' }
+      )
+    } catch {
+      return
+    }
+    await deleteRole(r.id)
+    ElMessage.success('已删除')
+    const preferId = currentId.value === r.id ? undefined : currentId.value
+    await loadRoles(preferId)
+  }
+
+  async function saveRole() {
+    const roleCode = form.roleCode.trim()
+    const roleName = form.roleName.trim()
+    const remark = form.remark.trim()
+    if (!editingId.value && !roleCode) {
+      ElMessage.warning('请输入角色编码')
+      return
+    }
+    if (!roleName) {
+      ElMessage.warning('请输入角色名称')
+      return
+    }
+    formSaving.value = true
+    try {
+      if (editingId.value) {
+        await updateRole(editingId.value, { roleName, remark })
+        ElMessage.success('已保存')
+        editVisible.value = false
+        await loadRoles(editingId.value)
+      } else {
+        const res: any = await createRole({ roleCode, roleName, remark })
+        ElMessage.success('已创建')
+        editVisible.value = false
+        await loadRoles(res.data?.id)
+      }
+    } finally {
+      formSaving.value = false
+    }
+  }
+
   async function save() {
     if (!currentId.value) return
     saving.value = true
@@ -98,11 +228,24 @@
     min-height: 520px;
   }
   .roles {
-    width: 220px;
+    width: 260px;
     border-right: 1px solid #eee;
     padding-right: 12px;
   }
+  .roles-head {
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    margin-bottom: 12px;
+  }
+  .roles-head h3 {
+    margin: 0;
+  }
   .role-item {
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    gap: 8px;
     padding: 10px 12px;
     border-radius: 8px;
     cursor: pointer;
@@ -112,6 +255,15 @@
   .role-item.active {
     background: #f8ecec;
   }
+  .role-main {
+    min-width: 0;
+    flex: 1;
+  }
+  .role-actions {
+    display: flex;
+    flex-shrink: 0;
+    gap: 2px;
+  }
   .role-item .name {
     font-weight: 600;
   }

+ 45 - 34
web-admin/src/views/suggestion/index.vue

@@ -10,6 +10,13 @@
       <el-button type="primary" @click="load">查询</el-button>
     </div>
     <el-table :data="list" v-loading="loading" stripe>
+      <el-table-column
+        type="index"
+        label="序号"
+        width="60"
+        align="center"
+        :index="(index) => (query.page - 1) * query.pageSize + index + 1"
+      />
       <el-table-column prop="bizNo" label="编号" min-width="140" />
       <el-table-column prop="content" label="建议内容" min-width="220" show-overflow-tooltip />
       <el-table-column prop="contactName" label="联系人" width="100" />
@@ -34,28 +41,28 @@
       />
     </div>
 
-    <el-drawer v-model="drawer" title="建言详情" size="480px">
+    <el-dialog
+      v-model="dialogVisible"
+      title="建言详情"
+      width="860px"
+      class="suggestion-detail-dialog"
+      destroy-on-close
+      @closed="onDialogClosed"
+    >
       <template v-if="detail">
-        <el-descriptions :column="1" border>
+        <el-descriptions :column="2" border>
           <el-descriptions-item label="编号">{{ detail.bizNo }}</el-descriptions-item>
           <el-descriptions-item label="状态">{{ detail.status }}</el-descriptions-item>
-          <el-descriptions-item label="内容">{{ detail.content }}</el-descriptions-item>
-          <el-descriptions-item label="联系人">
+          <el-descriptions-item label="内容" :span="2">{{ detail.content }}</el-descriptions-item>
+          <el-descriptions-item label="联系人" :span="2">
             {{ detail.contactName || '-' }} / {{ detail.contactUnit || '-' }} /
             {{ detail.contactPost || '-' }}
           </el-descriptions-item>
-          <el-descriptions-item label="联系方式">{{ detail.contactPhone || '-' }}</el-descriptions-item>
-          <el-descriptions-item label="附件">
-            <div v-if="detail.attachmentUrls?.length" class="att-list">
-              <a
-                v-for="(u, i) in detail.attachmentUrls"
-                :key="i"
-                href="#"
-                @click.prevent="openAdminAttachment(u)"
-                >附件{{ i + 1 }}</a
-              >
-            </div>
-            <span v-else>无</span>
+          <el-descriptions-item label="联系方式" :span="2">{{
+            detail.contactPhone || '-'
+          }}</el-descriptions-item>
+          <el-descriptions-item label="附件" :span="2">
+            <AttachmentGrid :urls="detail.attachmentUrls" />
           </el-descriptions-item>
         </el-descriptions>
         <div v-if="canHandle" class="handle-box">
@@ -71,24 +78,21 @@
             :rows="3"
             placeholder="办理备注"
           />
-          <el-button type="primary" style="margin-top: 12px" :loading="saving" @click="saveHandle"
-            >保存</el-button
-          >
         </div>
       </template>
-    </el-drawer>
+      <template v-if="canHandle" #footer>
+        <el-button @click="dialogVisible = false">取消</el-button>
+        <el-button type="primary" :loading="saving" @click="saveHandle">保存</el-button>
+      </template>
+    </el-dialog>
   </div>
 </template>
 
 <script setup lang="ts">
   import { computed, onMounted, reactive, ref } from 'vue'
   import { ElMessage } from 'element-plus'
-  import {
-    fetchSuggestion,
-    fetchSuggestions,
-    openAdminAttachment,
-    updateSuggestionStatus
-  } from '@/api/admin'
+  import { fetchSuggestion, fetchSuggestions, updateSuggestionStatus } from '@/api/admin'
+  import AttachmentGrid from '@/components/AttachmentGrid.vue'
   import { useUserStore } from '@/stores/user'
 
   const userStore = useUserStore()
@@ -97,11 +101,15 @@
   const saving = ref(false)
   const list = ref<any[]>([])
   const total = ref(0)
-  const drawer = ref(false)
+  const dialogVisible = ref(false)
   const detail = ref<any>(null)
   const query = reactive({ status: '', keyword: '', page: 1, pageSize: 10 })
   const handleForm = reactive({ status: '', handleRemark: '' })
 
+  function onDialogClosed() {
+    detail.value = null
+  }
+
   async function load() {
     loading.value = true
     try {
@@ -118,20 +126,20 @@
     detail.value = res.data
     handleForm.status = res.data.status
     handleForm.handleRemark = res.data.handleRemark || ''
-    drawer.value = true
+    dialogVisible.value = true
   }
 
   async function saveHandle() {
     if (!detail.value) return
     saving.value = true
     try {
-      const res: any = await updateSuggestionStatus(detail.value.id, {
+      await updateSuggestionStatus(detail.value.id, {
         status: handleForm.status,
         handleRemark: handleForm.handleRemark
       })
-      detail.value = res.data
       ElMessage.success('已保存')
-      load()
+      dialogVisible.value = false
+      await load()
     } finally {
       saving.value = false
     }
@@ -159,8 +167,11 @@
   .handle-box {
     margin-top: 20px;
   }
-  .att-list a {
-    display: block;
-    color: #a51f23;
+</style>
+
+<style>
+  .suggestion-detail-dialog .el-dialog__body {
+    max-height: calc(100vh - 160px);
+    overflow-y: auto;
   }
 </style>