feat(admin): open ticket creation in a dialog on the list page

Move "代客提交工单" back into a native <dialog> on the ticket list while
the ticket workspace stays a full page. Closing asks before discarding
input, ignores backdrop clicks, resets the form and returns focus; an
uncertain create result keeps the form locked behind "重新加载".

Remove the ?view=new create page route and its styles.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
kate522andClaude Fable 5 committed 2026-10-31 14:57:35 +08:00
1 parent d86a85e6a6
commit 54cc5301c3
9 files changed
+169 -65

No files matched your search

+3 -2
View File
@@ -12,7 +12,7 @@ defined('ABSPATH') || exit;
trait UsersMenusTicketsList {
private function render_ticket_list_page(array $filters, int $paged): void {
// 先查询并夹取页码,页头「代客提交」链接才能带上实际页码。
// 先查询并夹取页码,创建成功后跳转的工作区链接才能带上实际页码。
[$result, $paged] = $this->ticket_list_result($filters, $paged);
NativeUi::header(
__('工单管理', 'aksrt'),
@@ -21,7 +21,7 @@ trait UsersMenusTicketsList {
[
[
'label' => __('代客提交工单', 'aksrt'),
'url' => $this->ticket_page_url(['view' => 'new'] + $this->ticket_context($filters, $paged)),
'dialog' => self::TICKET_CREATE_DIALOG,
'primary' => true,
'icon' => 'dashicons-plus-alt2',
],
@@ -33,6 +33,7 @@ trait UsersMenusTicketsList {
]
);
$this->render_ticket_list($filters, $paged, $result);
$this->render_ticket_create_dialog();
}
/** 越界页码夹到末页,避免处理最后一条工单后停在空页。返回 [查询结果, 实际页码]。 */