feat(ui): 为工单对话页新增用户与订单跳转入口
在工单工作台对话页为当前工单用户增加“查看用户” 和“用户订单”入口,支持直接跳转到用户管理与订单管理 用户管理页新增 `user_id/user_email` 路由作用域, 进入后按用户 ID 精准筛选,并支持在重置筛选时清除 该作用域 同步更新 admin-frontend 模块文档、变更归档与测试环境 compose 配置
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref, watch } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { ChatLineRound, DataAnalysis, Picture, Search } from '@element-plus/icons-vue'
|
||||
import { ChatLineRound, DataAnalysis, Picture, Search, Tickets, User } from '@element-plus/icons-vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { closeTicket, fetchTickets, getTicketById, replyTicket } from '@/api/admin'
|
||||
import type { AdminTicketDetail, AdminTicketListItem } from '@/types/api'
|
||||
import { formatDateTime } from '@/utils/dashboard'
|
||||
@@ -25,6 +26,7 @@ const emit = defineEmits<{
|
||||
updated: []
|
||||
}>()
|
||||
|
||||
const router = useRouter()
|
||||
const loadingSidebar = ref(false)
|
||||
const loadingDetail = ref(false)
|
||||
const replying = ref(false)
|
||||
@@ -138,6 +140,34 @@ async function handleCloseTicket() {
|
||||
}
|
||||
}
|
||||
|
||||
async function openTicketUser() {
|
||||
if (!detail.value?.user?.id) {
|
||||
return
|
||||
}
|
||||
|
||||
await router.push({
|
||||
name: 'Users',
|
||||
query: {
|
||||
user_id: String(detail.value.user.id),
|
||||
user_email: detail.value.user.email,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
async function openTicketUserOrders() {
|
||||
if (!detail.value?.user?.id) {
|
||||
return
|
||||
}
|
||||
|
||||
await router.push({
|
||||
name: 'SubscriptionOrders',
|
||||
query: {
|
||||
user_id: String(detail.value.user.id),
|
||||
user_email: detail.value.user.email,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
function closeDialog() {
|
||||
resetReplyDragState()
|
||||
emit('update:visible', false)
|
||||
@@ -189,6 +219,24 @@ watch(
|
||||
</div>
|
||||
|
||||
<div class="workspace-header__actions">
|
||||
<ElButton
|
||||
v-if="detail?.user?.id"
|
||||
text
|
||||
class="ghost-action"
|
||||
@click="openTicketUser"
|
||||
>
|
||||
<ElIcon><User /></ElIcon>
|
||||
查看用户
|
||||
</ElButton>
|
||||
<ElButton
|
||||
v-if="detail?.user?.id"
|
||||
text
|
||||
class="ghost-action"
|
||||
@click="openTicketUserOrders"
|
||||
>
|
||||
<ElIcon><Tickets /></ElIcon>
|
||||
用户订单
|
||||
</ElButton>
|
||||
<ElButton
|
||||
v-if="detail?.user?.id"
|
||||
text
|
||||
|
||||
Reference in New Issue
Block a user