fix:工单样式兼容移动端
This commit is contained in:
@@ -24,9 +24,15 @@
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="管理员组" v-if="queryParams.owner_type === 'group'">
|
||||
<el-select v-model="queryParams.admin_group_id" placeholder="请选择管理员组" clearable filterable style="width: 200px">
|
||||
<el-option v-for="item in adminGroupOptions" :key="item.id" :label="`${item.name} (ID: ${item.id})`" :value="item.id" />
|
||||
</el-select>
|
||||
<div class="selector-inline">
|
||||
<el-tag v-if="queryParams.admin_group_id" type="success" closable @close="clearQueryGroup" style="margin-right: 8px;">
|
||||
{{ getQueryGroupName() }}
|
||||
</el-tag>
|
||||
<el-button type="success" plain @click="openQueryGroupSelector" size="default">
|
||||
<el-icon><User /></el-icon>
|
||||
{{ queryParams.admin_group_id ? '重新选择' : '选择管理员组' }}
|
||||
</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="handleQuery">
|
||||
@@ -115,14 +121,34 @@
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<!-- 用户选择弹窗 -->
|
||||
<el-dialog
|
||||
<!-- 用户选择弹窗 - 使用UserListSelector组件 -->
|
||||
<UserListSelector
|
||||
v-model="userSelectorVisible"
|
||||
:current-user-id="selectorType === 'query' ? queryParams.user_id : permissionForm.user_id"
|
||||
@confirm="handleUserSelectorConfirm"
|
||||
/>
|
||||
|
||||
<!-- 管理员组选择弹窗 - 使用UserGroupSelector组件 -->
|
||||
<UserGroupSelector
|
||||
v-model="groupSelectorVisible"
|
||||
:current-group-id="selectorType === 'query' ? queryParams.admin_group_id : permissionForm.admin_group_id"
|
||||
@confirm="handleGroupSelectorConfirm"
|
||||
/>
|
||||
|
||||
<!-- 路径权限选择弹窗 -->
|
||||
<PermissionPathSelector
|
||||
v-model="permissionSelectorVisible"
|
||||
:current-permission-id="permissionForm.permission_id"
|
||||
@confirm="handlePermissionSelectorConfirm"
|
||||
/>
|
||||
|
||||
<!-- 旧的用户选择弹窗 - 已废弃 -->
|
||||
<!-- <el-dialog
|
||||
v-model="userSelectorVisibleOld"
|
||||
title="选择用户"
|
||||
width="800px"
|
||||
class="user-selector-dialog"
|
||||
>
|
||||
<!-- 搜索栏 -->
|
||||
<div class="selector-search">
|
||||
<el-input
|
||||
v-model="userSearchParams.key"
|
||||
@@ -142,7 +168,6 @@
|
||||
<el-button @click="resetUserSearch">重置</el-button>
|
||||
</div>
|
||||
|
||||
<!-- 用户表格 -->
|
||||
<el-table
|
||||
v-loading="userSelectorLoading"
|
||||
:data="userSelectorList"
|
||||
@@ -164,7 +189,7 @@
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 分页 -->
|
||||
|
||||
<el-pagination
|
||||
v-model:current-page="userSearchParams.page"
|
||||
v-model:page-size="userSearchParams.count"
|
||||
@@ -178,12 +203,12 @@
|
||||
/>
|
||||
|
||||
<template #footer>
|
||||
<el-button @click="userSelectorVisible = false">取消</el-button>
|
||||
<el-button @click="userSelectorVisibleOld = false">取消</el-button>
|
||||
<el-button type="primary" @click="confirmUserSelection" :disabled="!selectedUserTemp">
|
||||
确定选择
|
||||
</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</el-dialog> -->
|
||||
<!-- 分配权限对话框 -->
|
||||
<el-dialog
|
||||
v-model="dialogVisible"
|
||||
@@ -204,45 +229,80 @@
|
||||
<div class="form-tip">如果是 user 则填写 user_id,如果是 group 则填写 admin_group_id</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户" prop="user_id" v-if="permissionForm.owner_type === 'user'" >
|
||||
<div class="user_selector-inline">
|
||||
<el-tag v-if="permissionForm.user_id" type="primary" closable @close="clearFormUser" style="margin-right: 8px;">
|
||||
{{ getFormUserName() }}
|
||||
</el-tag>
|
||||
<el-button type="primary" plain @click="openFormUserSelector" size="default" :disabled="permissionForm.user_id">
|
||||
<el-icon><User /></el-icon>
|
||||
{{ permissionForm.user_id ? '重新选择' : '选择用户' }}
|
||||
<div class="recommend-user-selector">
|
||||
<el-input
|
||||
:model-value="getFormUserName()"
|
||||
placeholder="点击选择用户"
|
||||
readonly
|
||||
@click="openFormUserSelector"
|
||||
:disabled="!!permissionForm.id"
|
||||
>
|
||||
<template #append>
|
||||
<el-button @click="openFormUserSelector" :disabled="!!permissionForm.id">
|
||||
<el-icon><Search /></el-icon>
|
||||
</el-button>
|
||||
</template>
|
||||
</el-input>
|
||||
<el-button
|
||||
v-if="permissionForm.user_id && !permissionForm.id"
|
||||
type="danger"
|
||||
link
|
||||
@click="clearFormUser"
|
||||
class="clear-btn"
|
||||
>
|
||||
清除
|
||||
</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="管理员组" prop="admin_group_id" v-if="permissionForm.owner_type === 'group'">
|
||||
<el-select v-model="permissionForm.admin_group_id" placeholder="请选择管理员组" filterable style="width: 100%">
|
||||
<el-option v-for="item in adminGroupOptions" :key="item.id" :label="`${item.name} (ID: ${item.id})`" :value="item.id" />
|
||||
</el-select>
|
||||
<div class="recommend-user-selector">
|
||||
<el-input
|
||||
:model-value="getFormGroupName()"
|
||||
placeholder="点击选择管理员组"
|
||||
readonly
|
||||
@click="openFormGroupSelector"
|
||||
:disabled="!!permissionForm.id"
|
||||
>
|
||||
<template #append>
|
||||
<el-button @click="openFormGroupSelector" :disabled="!!permissionForm.id">
|
||||
<el-icon><Search /></el-icon>
|
||||
</el-button>
|
||||
</template>
|
||||
</el-input>
|
||||
<el-button
|
||||
v-if="permissionForm.admin_group_id && !permissionForm.id"
|
||||
type="danger"
|
||||
link
|
||||
@click="clearFormGroup"
|
||||
class="clear-btn"
|
||||
>
|
||||
清除
|
||||
</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="路径权限" prop="permission_id">
|
||||
<div style="display: flex; gap: 8px;">
|
||||
<el-select
|
||||
v-model="permissionForm.permission_id"
|
||||
placeholder="请选择路径权限"
|
||||
filterable
|
||||
style="flex: 1"
|
||||
:loading="permissionLoading"
|
||||
<div class="recommend-user-selector">
|
||||
<el-input
|
||||
:model-value="getFormPermissionName()"
|
||||
placeholder="点击选择路径权限"
|
||||
readonly
|
||||
@click="openPermissionSelector"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in permissionOptions"
|
||||
:key="item.id"
|
||||
:value="item.id"
|
||||
>
|
||||
<div style="display: flex; justify-content: space-between; align-items: center;">
|
||||
<span>
|
||||
<el-tag v-if="item.method" :type="getMethodTag(item.method)" size="small" style="margin-right: 8px;">{{ item.method }}</el-tag>
|
||||
{{ item.path }}
|
||||
</span>
|
||||
<span style="color: #999; font-size: 12px; margin-left: 12px;">{{ item.note || item.name || `ID: ${item.id}` }}</span>
|
||||
</div>
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-button @click="fetchPermissionList" :loading="permissionLoading" :icon="Refresh">刷新</el-button>
|
||||
<template #append>
|
||||
<el-button @click="openPermissionSelector">
|
||||
<el-icon><Search /></el-icon>
|
||||
</el-button>
|
||||
</template>
|
||||
</el-input>
|
||||
<el-button
|
||||
v-if="permissionForm.permission_id"
|
||||
type="danger"
|
||||
link
|
||||
@click="clearFormPermission"
|
||||
class="clear-btn"
|
||||
>
|
||||
清除
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="form-tip">共 {{ permissionOptions.length }} 个路径权限可选</div>
|
||||
</el-form-item>
|
||||
@@ -283,6 +343,9 @@
|
||||
import { ref, reactive, onMounted } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { Plus, Search, Refresh, User } from '@element-plus/icons-vue'
|
||||
import UserListSelector from '@/components/admin/UserListSelector.vue'
|
||||
import UserGroupSelector from '@/components/admin/UserGroupSelector.vue'
|
||||
import PermissionPathSelector from '@/components/admin/PermissionPathSelector.vue'
|
||||
import {
|
||||
getPermissionListByAdmin,
|
||||
addPermissionAdmin,
|
||||
@@ -297,6 +360,8 @@ import { formatDate ,timeToTimestamp} from '@/utils/tool'
|
||||
|
||||
const selectorType = ref('query')
|
||||
const userSelectorVisible = ref(false)
|
||||
const groupSelectorVisible = ref(false)
|
||||
const permissionSelectorVisible = ref(false)
|
||||
const userSelectorList = ref([])
|
||||
const userSelectorTotal = ref(0)
|
||||
const userSearchParams = reactive({
|
||||
@@ -307,6 +372,8 @@ const userSearchParams = reactive({
|
||||
const selectedUserTemp = ref(null)
|
||||
const userSelectorLoading = ref(false)
|
||||
const UserOptions = ref([])
|
||||
const GroupOptions = ref([])
|
||||
const selectedPermission = ref(null)
|
||||
// 查询参数
|
||||
const queryParams = reactive({
|
||||
owner_type: '',
|
||||
@@ -324,16 +391,122 @@ const getQueryUserName = () => {
|
||||
const user = UserOptions.value.find(u => u.UserId === queryParams.user_id)
|
||||
return user ? `${user.UserName} (ID: ${user.UserId})` : `用户ID: ${queryParams.user_id}`
|
||||
}
|
||||
// 清除查询管理员组
|
||||
const clearQueryGroup = () => {
|
||||
queryParams.admin_group_id = undefined
|
||||
}
|
||||
// 获取查询管理员组名称
|
||||
const getQueryGroupName = () => {
|
||||
const group = GroupOptions.value.find(g => g.id === queryParams.admin_group_id) ||
|
||||
adminGroupOptions.value.find(g => g.id === queryParams.admin_group_id)
|
||||
return group ? `${group.name} (ID: ${group.id})` : `管理员组ID: ${queryParams.admin_group_id}`
|
||||
}
|
||||
// 打开查询管理员组选择器
|
||||
const openQueryGroupSelector = () => {
|
||||
selectorType.value = 'query'
|
||||
groupSelectorVisible.value = true
|
||||
}
|
||||
// 表单:清除用户
|
||||
const clearFormUser = () => {
|
||||
permissionForm.user_id = undefined
|
||||
}
|
||||
// 表单:获取显示名称
|
||||
const getFormUserName = () => {
|
||||
if (!permissionForm.user_id) return ''
|
||||
const user = UserOptions.value.find(u => u.UserId === permissionForm.user_id)
|
||||
return user ? `${user.UserName} (ID: ${user.UserId})` : `用户ID: ${permissionForm.user_id}`
|
||||
}
|
||||
// 确认用户选择
|
||||
|
||||
// 表单:获取管理员组显示名称
|
||||
const getFormGroupName = () => {
|
||||
if (!permissionForm.admin_group_id) return ''
|
||||
const group = GroupOptions.value.find(g => g.id === permissionForm.admin_group_id)
|
||||
return group ? `${group.name} (ID: ${group.id})` : `管理员组ID: ${permissionForm.admin_group_id}`
|
||||
}
|
||||
|
||||
// 表单:获取路径权限显示名称
|
||||
const getFormPermissionName = () => {
|
||||
if (!permissionForm.permission_id) return ''
|
||||
if (selectedPermission.value && selectedPermission.value.id === permissionForm.permission_id) {
|
||||
const p = selectedPermission.value
|
||||
return `${p.method || ''} ${p.path}${p.name ? ' - ' + p.name : ''}`
|
||||
}
|
||||
const perm = permissionOptions.value.find(p => p.id === permissionForm.permission_id)
|
||||
return perm ? `${perm.method || ''} ${perm.path}${perm.name ? ' - ' + perm.name : ''}` : `权限ID: ${permissionForm.permission_id}`
|
||||
}
|
||||
|
||||
// 清除表单管理员组
|
||||
const clearFormGroup = () => {
|
||||
permissionForm.admin_group_id = undefined
|
||||
}
|
||||
|
||||
// 清除表单路径权限
|
||||
const clearFormPermission = () => {
|
||||
permissionForm.permission_id = undefined
|
||||
selectedPermission.value = null
|
||||
}
|
||||
|
||||
// 打开管理员组选择器
|
||||
const openFormGroupSelector = () => {
|
||||
selectorType.value = 'form'
|
||||
groupSelectorVisible.value = true
|
||||
}
|
||||
|
||||
// 打开路径权限选择器
|
||||
const openPermissionSelector = () => {
|
||||
permissionSelectorVisible.value = true
|
||||
}
|
||||
|
||||
// 管理员组选择确认
|
||||
const handleGroupSelectorConfirm = (group) => {
|
||||
if (group) {
|
||||
const groupId = group.id || group.Id
|
||||
const groupName = group.name || group.Name
|
||||
|
||||
if (selectorType.value === 'query') {
|
||||
queryParams.admin_group_id = groupId
|
||||
} else {
|
||||
permissionForm.admin_group_id = groupId
|
||||
}
|
||||
|
||||
if (!GroupOptions.value.find(g => g.id === groupId)) {
|
||||
GroupOptions.value.push({ id: groupId, name: groupName })
|
||||
}
|
||||
}
|
||||
groupSelectorVisible.value = false
|
||||
}
|
||||
|
||||
// 路径权限选择确认
|
||||
const handlePermissionSelectorConfirm = (permission) => {
|
||||
if (permission) {
|
||||
permissionForm.permission_id = permission.id
|
||||
selectedPermission.value = permission
|
||||
}
|
||||
permissionSelectorVisible.value = false
|
||||
}
|
||||
// UserListSelector 组件确认回调
|
||||
const handleUserSelectorConfirm = (user) => {
|
||||
if (user) {
|
||||
const userId = user.user_id || user.UserId
|
||||
const userName = user.user_name || user.UserName
|
||||
|
||||
if (selectorType.value === 'query') {
|
||||
queryParams.user_id = userId
|
||||
// 添加到 UserOptions 用于显示名称
|
||||
if (!UserOptions.value.find(u => u.UserId === userId)) {
|
||||
UserOptions.value.push({ UserId: userId, UserName: userName })
|
||||
}
|
||||
} else if (selectorType.value === 'form') {
|
||||
permissionForm.user_id = userId
|
||||
if (!UserOptions.value.find(u => u.UserId === userId)) {
|
||||
UserOptions.value.push({ UserId: userId, UserName: userName })
|
||||
}
|
||||
}
|
||||
}
|
||||
userSelectorVisible.value = false
|
||||
}
|
||||
|
||||
// 确认用户选择(旧方法,保留兼容)
|
||||
const confirmUserSelection = () => {
|
||||
if (!selectedUserTemp.value) {
|
||||
ElMessage.warning('请选择一个用户')
|
||||
@@ -684,7 +857,7 @@ const fetchUserList = async () => {
|
||||
try {
|
||||
const res = await getUserList({
|
||||
page: 1,
|
||||
count: 10000,
|
||||
count: 10,
|
||||
key: ''
|
||||
})
|
||||
if (res.data.code === 200) {
|
||||
@@ -700,7 +873,7 @@ const fetchAdminGroupList = async () => {
|
||||
try {
|
||||
const res = await getAdminGroupList({
|
||||
page: 1,
|
||||
count: 1000
|
||||
count: 10
|
||||
})
|
||||
if (res.data.code === 200) {
|
||||
adminGroupOptions.value = res.data.data?.data || []
|
||||
@@ -716,7 +889,7 @@ const fetchPermissionList = async () => {
|
||||
try {
|
||||
const res = await getPermissionList({
|
||||
page: 1,
|
||||
count: 10000
|
||||
count: 10
|
||||
})
|
||||
if (res.data.code === 200) {
|
||||
permissionOptions.value = res.data.data?.list || []
|
||||
@@ -837,4 +1010,34 @@ onMounted(() => {
|
||||
:deep(.el-card__body) {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/* 推介人选择器样式 - 与UserList.vue保持一致 */
|
||||
.recommend-user-selector {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.recommend-user-selector .el-input {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.recommend-user-selector .clear-btn {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.selector-inline {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.user_selector-inline {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -437,7 +437,7 @@ const fetchGroupList = async () => {
|
||||
|
||||
const fetchAllGroupList = async () => {
|
||||
try {
|
||||
const res = await getSettingGroupList({ page: 1, count: 1000 })
|
||||
const res = await getSettingGroupList({ page: 1, count: 10 })
|
||||
if (res.data.code === 200) {
|
||||
allGroupList.value = res.data.data.data || []
|
||||
}
|
||||
@@ -635,8 +635,10 @@ const handleTypeChange = (type) => {
|
||||
}
|
||||
}
|
||||
|
||||
const handleAddSetting = () => {
|
||||
const handleAddSetting = async () => {
|
||||
settingDialogTitle.value = '新增配置'
|
||||
// 刷新配置组列表以确保数据最新
|
||||
await fetchAllGroupList()
|
||||
Object.assign(settingForm, {
|
||||
id: undefined,
|
||||
name: '',
|
||||
@@ -780,6 +782,7 @@ watch(activeTab, (newVal) => {
|
||||
if (newVal === 'group') {
|
||||
fetchGroupList()
|
||||
} else if (newVal === 'setting') {
|
||||
fetchAllGroupList() // 切换到配置管理时刷新配置组列表用于下拉筛选
|
||||
fetchSettingList()
|
||||
}
|
||||
})
|
||||
|
||||
@@ -1322,4 +1322,202 @@ onBeforeUnmount(() => {
|
||||
font-size: 12px;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
/* 平板尺寸响应式样式 */
|
||||
@media (max-width: 1024px) and (min-width: 769px) {
|
||||
.page-header {
|
||||
padding: 12px 16px;
|
||||
flex-wrap: wrap;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.header-left {
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.ticket-title {
|
||||
max-width: 200px;
|
||||
}
|
||||
|
||||
.header-right {
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.message-content {
|
||||
max-width: 70%;
|
||||
}
|
||||
|
||||
.quick-replies {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.input-area {
|
||||
gap: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
/* 移动端响应式样式 */
|
||||
@media (max-width: 768px) {
|
||||
.ticket-detail-page {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.page-header {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
gap: 12px;
|
||||
padding: 12px;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.header-left {
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.header-left .el-button {
|
||||
padding: 8px 12px;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.user-info {
|
||||
order: 3;
|
||||
width: 100%;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.ticket-title {
|
||||
order: 4;
|
||||
width: 100%;
|
||||
max-width: none;
|
||||
margin-top: 8px;
|
||||
white-space: normal;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.header-right {
|
||||
width: 100%;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.header-right .ticket-id {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.header-right .el-select {
|
||||
width: 100px !important;
|
||||
}
|
||||
|
||||
.header-right .el-button {
|
||||
font-size: 12px;
|
||||
padding: 6px 10px;
|
||||
}
|
||||
|
||||
.chat-container {
|
||||
min-height: 300px;
|
||||
}
|
||||
|
||||
.chat-messages {
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.message-content {
|
||||
max-width: 80%;
|
||||
}
|
||||
|
||||
.message-text {
|
||||
padding: 10px 12px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.message-image {
|
||||
max-width: 150px;
|
||||
max-height: 150px;
|
||||
}
|
||||
|
||||
.reply-container {
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.quick-replies {
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.quick-replies .el-button {
|
||||
font-size: 12px;
|
||||
padding: 6px 10px;
|
||||
}
|
||||
|
||||
.input-actions {
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.left-actions {
|
||||
width: 100%;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
.input-actions .el-button--primary {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.hint-text {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* 用户信息弹窗 */
|
||||
.user-popover {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.popover-header {
|
||||
flex-direction: column;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.popover-info {
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
/* 编辑消息弹窗 */
|
||||
:deep(.el-dialog) {
|
||||
width: 90% !important;
|
||||
margin: 5vh auto !important;
|
||||
}
|
||||
|
||||
.edit-images-container {
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.edit-preview-item,
|
||||
.add-image-btn {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 480px) {
|
||||
.header-left .el-button span {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.header-left .el-button .el-icon {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.message-content {
|
||||
max-width: 85%;
|
||||
}
|
||||
|
||||
.preview-item {
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -63,13 +63,14 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 工单表格 -->
|
||||
<!-- 工单表格(PC端) -->
|
||||
<el-table
|
||||
v-loading="isLoading"
|
||||
:data="filteredTickets"
|
||||
stripe
|
||||
style="width: 100%"
|
||||
@row-click="handleRowClick"
|
||||
class="desktop-table"
|
||||
>
|
||||
<el-table-column prop="id" label="工单号" width="100" />
|
||||
<el-table-column label="用户" width="180">
|
||||
@@ -107,6 +108,41 @@
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 移动端卡片列表 -->
|
||||
<div class="mobile-ticket-list" v-loading="isLoading">
|
||||
<div
|
||||
v-for="ticket in filteredTickets"
|
||||
:key="ticket.id"
|
||||
class="ticket-card"
|
||||
@click="goToDetail(ticket)"
|
||||
>
|
||||
<div class="ticket-card-header">
|
||||
<span class="ticket-card-id">#{{ ticket.id }}</span>
|
||||
<el-tag :type="getStatusType(ticket.status)" size="small">
|
||||
{{ getStatusText(ticket.status) }}
|
||||
</el-tag>
|
||||
</div>
|
||||
<div class="ticket-card-user">
|
||||
<el-avatar :size="28" :src="ticket.avatar">{{ ticket.username?.charAt(0) }}</el-avatar>
|
||||
<span class="ticket-card-username">{{ ticket.username }}</span>
|
||||
</div>
|
||||
<div class="ticket-card-title">{{ ticket.title }}</div>
|
||||
<div class="ticket-card-footer">
|
||||
<span class="ticket-card-time">{{ ticket.createTime }}</span>
|
||||
<div class="ticket-card-actions">
|
||||
<el-button type="primary" size="small" @click.stop="goToDetail(ticket)">回复</el-button>
|
||||
<el-button
|
||||
v-if="ticket.status !== 'completed'"
|
||||
type="success"
|
||||
size="small"
|
||||
@click.stop="handleComplete(ticket)"
|
||||
>结束</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-empty v-if="filteredTickets.length === 0 && !isLoading" description="暂无工单数据" />
|
||||
</div>
|
||||
|
||||
<!-- 分页 -->
|
||||
<div class="pagination-wrapper">
|
||||
<el-pagination
|
||||
@@ -659,4 +695,248 @@ onBeforeUnmount(() => {
|
||||
:deep(.el-table tr) {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/* 移动端卡片列表 */
|
||||
.mobile-ticket-list {
|
||||
display: none;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
padding: 12px;
|
||||
overflow-y: auto;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.ticket-card {
|
||||
background: #fff;
|
||||
border: 1px solid #ebeef5;
|
||||
border-radius: 8px;
|
||||
padding: 12px;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.ticket-card:active {
|
||||
background: #f5f7fa;
|
||||
}
|
||||
|
||||
.ticket-card-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.ticket-card-id {
|
||||
font-size: 12px;
|
||||
color: #909399;
|
||||
}
|
||||
|
||||
.ticket-card-user {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.ticket-card-username {
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
.ticket-card-title {
|
||||
font-size: 14px;
|
||||
color: #303133;
|
||||
margin-bottom: 8px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.ticket-card-footer {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.ticket-card-time {
|
||||
font-size: 12px;
|
||||
color: #909399;
|
||||
}
|
||||
|
||||
.ticket-card-actions {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
/* 大屏平板尺寸响应式样式 (1020px - 1280px) */
|
||||
@media (max-width: 1280px) and (min-width: 1021px) {
|
||||
.toolbar {
|
||||
padding: 12px 16px;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.toolbar-right {
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.toolbar-right .el-select {
|
||||
width: 120px !important;
|
||||
}
|
||||
|
||||
.toolbar-right .el-input {
|
||||
min-width: 160px;
|
||||
}
|
||||
|
||||
/* 表格列宽调整 */
|
||||
:deep(.el-table) {
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
:deep(.el-table .el-table__cell) {
|
||||
padding: 10px 8px;
|
||||
}
|
||||
}
|
||||
|
||||
/* 平板尺寸响应式样式 (769px - 1020px) */
|
||||
@media (max-width: 1020px) and (min-width: 769px) {
|
||||
.toolbar {
|
||||
flex-direction: column;
|
||||
height: auto;
|
||||
padding: 12px 16px;
|
||||
gap: 12px;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.status-tabs {
|
||||
width: 100%;
|
||||
justify-content: flex-start;
|
||||
overflow-x: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
.status-tabs::-webkit-scrollbar {
|
||||
height: 4px;
|
||||
}
|
||||
|
||||
.status-tabs::-webkit-scrollbar-thumb {
|
||||
background: #dcdfe6;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.toolbar-right {
|
||||
width: 100%;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.toolbar-right .el-select {
|
||||
width: 120px !important;
|
||||
}
|
||||
|
||||
.toolbar-right .el-input {
|
||||
flex: 1;
|
||||
min-width: 150px;
|
||||
}
|
||||
|
||||
/* 表格列宽调整 */
|
||||
:deep(.el-table) {
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
:deep(.el-table .el-table__cell) {
|
||||
padding: 8px 6px;
|
||||
}
|
||||
}
|
||||
|
||||
/* 移动端响应式样式 */
|
||||
@media (max-width: 768px) {
|
||||
.ticket-list-page {
|
||||
height: auto;
|
||||
min-height: calc(100vh - 60px);
|
||||
}
|
||||
|
||||
.toolbar {
|
||||
flex-direction: column;
|
||||
height: auto;
|
||||
padding: 12px;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.status-tabs {
|
||||
width: 100%;
|
||||
overflow-x: auto;
|
||||
padding-bottom: 4px;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
.status-tabs::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.tab-item {
|
||||
flex-shrink: 0;
|
||||
padding: 8px 12px;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.toolbar-right {
|
||||
width: 100%;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.toolbar-right .el-select,
|
||||
.toolbar-right .el-input {
|
||||
flex: 1;
|
||||
min-width: 120px;
|
||||
}
|
||||
|
||||
.toolbar-right .el-button {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
/* 隐藏PC端表格,显示移动端卡片 */
|
||||
:deep(.el-table) {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.mobile-ticket-list {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.pagination-wrapper {
|
||||
padding: 12px;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.pagination-wrapper :deep(.el-pagination) {
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.pagination-wrapper :deep(.el-pagination__sizes),
|
||||
.pagination-wrapper :deep(.el-pagination__jump) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* 用户选择弹窗移动端适配 */
|
||||
:deep(.el-dialog) {
|
||||
width: 90% !important;
|
||||
margin: 5vh auto !important;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 480px) {
|
||||
.tab-item {
|
||||
padding: 6px 10px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.tab-item .count {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user