refactor: optimize ticket management system

This commit is contained in:
xboard 2025-01-25 17:46:10 +08:00
parent b2e7ed44f3
commit 239b970055
6 changed files with 62 additions and 44 deletions

View File

@ -70,7 +70,7 @@ class TicketController extends Controller
*/ */
private function fetchTickets(Request $request) private function fetchTickets(Request $request)
{ {
$ticketModel = Ticket::query() $ticketModel = Ticket::with('user')
->when($request->has('status'), function ($query) use ($request) { ->when($request->has('status'), function ($query) use ($request) {
$query->where('status', $request->input('status')); $query->where('status', $request->input('status'));
}) })

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1342,7 +1342,7 @@ window.XBOARD_TRANSLATIONS['en-US'] = {
}, },
"ticket": { "ticket": {
"title": "Ticket Management", "title": "Ticket Management",
"description": "Here you can view user tickets, including viewing, replying, and closing operations.", "description": "View and manage user tickets, including viewing, replying, and closing operations.",
"columns": { "columns": {
"id": "Ticket ID", "id": "Ticket ID",
"subject": "Subject", "subject": "Subject",
@ -1359,13 +1359,13 @@ window.XBOARD_TRANSLATIONS['en-US'] = {
"processing": "Processing" "processing": "Processing"
}, },
"level": { "level": {
"low": "Low", "low": "Low Priority",
"medium": "Medium", "medium": "Medium Priority",
"high": "High" "high": "High Priority"
}, },
"filter": { "filter": {
"placeholder": "Search {field}...", "placeholder": "Search {field}...",
"no_results": "No results found.", "no_results": "No results found",
"selected": "{count} selected", "selected": "{count} selected",
"clear": "Clear filters" "clear": "Clear filters"
}, },
@ -1373,8 +1373,8 @@ window.XBOARD_TRANSLATIONS['en-US'] = {
"view_details": "View Details", "view_details": "View Details",
"close_ticket": "Close Ticket", "close_ticket": "Close Ticket",
"close_confirm_title": "Confirm Close Ticket", "close_confirm_title": "Confirm Close Ticket",
"close_confirm_description": "After closing, you will not be able to reply. Are you sure you want to close this ticket?", "close_confirm_description": "Are you sure you want to close this ticket? You won't be able to reply after closing.",
"close_confirm_button": "Close Ticket", "close_confirm_button": "Confirm Close",
"close_success": "Ticket closed successfully", "close_success": "Ticket closed successfully",
"view_ticket": "View Ticket" "view_ticket": "View Ticket"
}, },
@ -1390,6 +1390,12 @@ window.XBOARD_TRANSLATIONS['en-US'] = {
"sending": "Sending...", "sending": "Sending...",
"send": "Send" "send": "Send"
} }
},
"list": {
"title": "Ticket List",
"search_placeholder": "Search ticket subject or user email",
"no_tickets": "No pending tickets",
"no_search_results": "No matching tickets found"
} }
}, },
"server": { "server": {

View File

@ -1340,54 +1340,60 @@ window.XBOARD_TRANSLATIONS['ko-KR'] = {
}, },
"ticket": { "ticket": {
"title": "티켓 관리", "title": "티켓 관리",
"description": "여기에서 사용자 티켓을 확인할 수 있으며, 조회, 답변 및 종료 작업을 수행할 수 있습니다.", "description": "사용자 티켓을 보고, 답변하고, 닫는 등의 작업을 관리합니다.",
"columns": { "columns": {
"id": "티켓 ID", "id": "티켓 번호",
"subject": "제목", "subject": "제목",
"level": "우선순위", "level": "우선순위",
"status": "상태", "status": "상태",
"updated_at": "최근 업데이트", "updated_at": "최근 업데이트",
"created_at": "생성 시간", "created_at": "생성",
"actions": "작업" "actions": "작업"
}, },
"status": { "status": {
"closed": "종료됨", "closed": "닫힘",
"replied": "답변", "replied": "답변완료",
"pending": "대기 중", "pending": "대기중",
"processing": "처리 중" "processing": "처리중"
}, },
"level": { "level": {
"low": "낮", "low": "낮은 우선순위",
"medium": "중간", "medium": "중간 우선순위",
"high": "높" "high": "높은 우선순위"
}, },
"filter": { "filter": {
"placeholder": "{field} 검색...", "placeholder": "{field} 검색...",
"no_results": "검색 결과가 없습니다.", "no_results": "결과를 찾을 수 없습니다",
"selected": "{count}개 선택됨", "selected": "{count}개 선택됨",
"clear": "필터 초기화" "clear": "필터 초기화"
}, },
"actions": { "actions": {
"view_details": "상세 보기", "view_details": "상세 보기",
"close_ticket": "티켓 종료", "close_ticket": "티켓 닫기",
"close_confirm_title": "티켓 종료 확인", "close_confirm_title": "티켓 닫기 확인",
"close_confirm_description": "종료 후에는 답변할 수 없습니다. 이 티켓을 종료하시겠습니까?", "close_confirm_description": "이 티켓을 닫으시겠습니까? 닫은 후에는 답변할 수 없습니다.",
"close_confirm_button": "티켓 종료", "close_confirm_button": "닫기 확인",
"close_success": "티켓이 성공적으로 종료되었습니다", "close_success": "티켓이 성공적으로 닫혔습니다",
"view_ticket": "티켓 보기" "view_ticket": "티켓 보기"
}, },
"detail": { "detail": {
"no_messages": "메시지가 아직 없습니다", "no_messages": "메시지가 없습니다",
"created_at": "생성 시간", "created_at": "생성",
"user_info": "사용자 정보", "user_info": "사용자 정보",
"traffic_records": "트래픽 기록", "traffic_records": "트래픽 기록",
"order_records": "주문 기록", "order_records": "주문 기록",
"input": { "input": {
"closed_placeholder": "티켓이 종료되었습니다", "closed_placeholder": "티켓이 닫혔습니다",
"reply_placeholder": "답변을 입력하세요...", "reply_placeholder": "답변을 입력하세요...",
"sending": "전송 중...", "sending": "전송중...",
"send": "전송" "send": "전송"
} }
},
"list": {
"title": "티켓 목록",
"search_placeholder": "티켓 제목 또는 사용자 이메일 검색",
"no_tickets": "대기중인 티켓이 없습니다",
"no_search_results": "일치하는 티켓을 찾을 수 없습니다"
} }
}, },
"server": { "server": {

View File

@ -1351,9 +1351,9 @@ window.XBOARD_TRANSLATIONS['zh-CN'] = {
"processing": "处理中" "processing": "处理中"
}, },
"level": { "level": {
"low": "低", "low": "低优先",
"medium": "中", "medium": "中优先",
"high": "高" "high": "高优先"
}, },
"filter": { "filter": {
"placeholder": "搜索{field}...", "placeholder": "搜索{field}...",
@ -1365,8 +1365,8 @@ window.XBOARD_TRANSLATIONS['zh-CN'] = {
"view_details": "查看详情", "view_details": "查看详情",
"close_ticket": "关闭工单", "close_ticket": "关闭工单",
"close_confirm_title": "确认关闭工单", "close_confirm_title": "确认关闭工单",
"close_confirm_description": "关闭后将无法继续回复,是否确认关闭该工单?", "close_confirm_description": "确定要关闭这个工单吗?关闭后将无法继续回复。",
"close_confirm_button": "关闭工单", "close_confirm_button": "确认关闭",
"close_success": "工单已关闭", "close_success": "工单已关闭",
"view_ticket": "查看工单" "view_ticket": "查看工单"
}, },
@ -1378,10 +1378,16 @@ window.XBOARD_TRANSLATIONS['zh-CN'] = {
"order_records": "订单记录", "order_records": "订单记录",
"input": { "input": {
"closed_placeholder": "工单已关闭", "closed_placeholder": "工单已关闭",
"reply_placeholder": "输入回复内容...", "reply_placeholder": "输入回复内容...",
"sending": "发送中...", "sending": "发送中...",
"send": "发送" "send": "发送"
} }
},
"list": {
"title": "工单列表",
"search_placeholder": "搜索工单标题或用户邮箱",
"no_tickets": "暂无待处理工单",
"no_search_results": "未找到匹配的工单"
} }
}, },
"server": { "server": {
@ -1931,12 +1937,12 @@ window.XBOARD_TRANSLATIONS['zh-CN'] = {
"device": { "device": {
"label": "设备限制", "label": "设备限制",
"placeholder": "请输入设备限制", "placeholder": "请输入设备限制",
"unit": "台设备" "unit": "台"
}, },
"capacity": { "capacity": {
"label": "容量限制", "label": "容量限制",
"placeholder": "请输入容量限制", "placeholder": "请输入容量限制",
"unit": "个用户" "unit": ""
}, },
"reset_method": { "reset_method": {
"label": "流量重置方式", "label": "流量重置方式",