10/10
1. 设备管理界面完成 2. 用户管理界面完成 3. 会话列表完成
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="p-2 app-container monitor-online-page">
|
||||
<Pagecrumb></Pagecrumb>
|
||||
<Pagecrumb style="margin-top:22px"></Pagecrumb>
|
||||
<div class="search-wrap">
|
||||
<el-card class="search-panel" shadow="hover">
|
||||
<el-form ref="queryFormRef" :inline="true" :model="queryParams" class="query-form" label-position="top">
|
||||
@@ -22,10 +22,8 @@
|
||||
size="large"
|
||||
style="width: 150px"
|
||||
>
|
||||
<el-option label="机器人" value="0"></el-option>
|
||||
<el-option label="排队" value="1"></el-option>
|
||||
<el-option label="人工" value="2"></el-option>
|
||||
<el-option label="已结束" value="3"></el-option>
|
||||
<el-option v-for="(item,index) in com_session_state " :key="index" :label="item.label"
|
||||
:value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="问题类型" prop="problemType">
|
||||
@@ -87,10 +85,10 @@
|
||||
<span style="margin:0 8px;color: #fff;">全部</span>
|
||||
<span style="color: #fff;font-weight: bold">1286</span>
|
||||
</el-button>
|
||||
<tableTag circle-color="#7c3aed" num="862" title="机器人接待"></tableTag>
|
||||
<tableTag circle-color="#ea580c" num="7" title="排队等待"></tableTag>
|
||||
<tableTag num="12" title="人工接待"></tableTag>
|
||||
<tableTag circle-color="#94a3b8" num="405" title="已结束"></tableTag>
|
||||
<tableTag :num="862" circle-color="#7c3aed" title="机器人接待"></tableTag>
|
||||
<tableTag :num="7" circle-color="#ea580c" title="排队等待"></tableTag>
|
||||
<tableTag :num="12" title="人工接待"></tableTag>
|
||||
<tableTag :num="405" circle-color="#94a3b8" title="已结束"></tableTag>
|
||||
</div>
|
||||
<div>
|
||||
<el-button plain type="info">批量导出</el-button>
|
||||
@@ -106,41 +104,55 @@
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column align="center" type="selection"></el-table-column>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="会话ID" prop="tokenId"/>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="用户信息" prop="userName"/>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="关联设备" prop="clientKey"/>
|
||||
<el-table-column align="center" label="会话状态">
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="会话ID" prop="sessionNo"/>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="用户信息" prop="userNickName"/>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="关联设备" prop="deviceId"/>
|
||||
<el-table-column align="center" label="会话状态" width="100">
|
||||
<template #default="scope">
|
||||
<el-tag type="primary">在线</el-tag>
|
||||
<el-tag type="danger">离线</el-tag>
|
||||
<dict-tag :options="com_session_state" :value="scope.row.status"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="当前接待人" prop="deptName"/>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="用户问题摘要" prop="ipaddr"/>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="排队序号" prop="loginLocation"/>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="等待时长" prop="os"/>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="最后消息时间" prop="browser"/>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="当前接待人" prop="agentName" width="160">
|
||||
<template #default="scope">
|
||||
<div class="name">{{ scope.row.agentName }}</div>
|
||||
<div class="no"></div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="用户问题摘要" prop="summary"/>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="排队序号" prop="queueNo" width="100"/>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="等待时长" prop="os" width="100"/>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="最后消息时间" prop="lastMessageTime"
|
||||
width="160"/>
|
||||
<el-table-column align="center" class-name="small-padding fixed-width" label="操作" min-width="200">
|
||||
<template #default="scope">
|
||||
<div>
|
||||
<el-button
|
||||
v-if="scope.row.staus !== '3'"
|
||||
v-hasPermi="['cs:session:query']"
|
||||
type="primary"
|
||||
@click="handleOpenConversation(scope.row)"
|
||||
>进入会话
|
||||
</el-button>
|
||||
<el-button
|
||||
v-hasPermi="['monitor:online:forceLogout']"
|
||||
type="primary"
|
||||
v-else
|
||||
@click="handleMain(scope.row)"
|
||||
>进入会话
|
||||
>查看会话
|
||||
</el-button>
|
||||
<el-button
|
||||
v-hasPermi="['monitor:online:forceLogout']"
|
||||
plain
|
||||
type="info"
|
||||
@click="handleMain(scope.row)"
|
||||
@click="handleUserMain(scope.row)"
|
||||
>用户档案
|
||||
</el-button>
|
||||
<el-button
|
||||
v-hasPermi="['monitor:online:forceLogout']"
|
||||
plain
|
||||
type="danger"
|
||||
@click="handleMain(scope.row)"
|
||||
v-if="scope.row.status === '2'"
|
||||
@click="handleCloseConversation(scope.row)"
|
||||
>关闭会话
|
||||
</el-button>
|
||||
</div>
|
||||
@@ -160,13 +172,13 @@
|
||||
|
||||
<script lang="ts" name="Online" setup>
|
||||
import {to} from 'await-to-js';
|
||||
import {listCsSession as initData} from '@/api/system/conversation/index';
|
||||
import {closeCsSession, listCsSession as initData} from '@/api/system/conversation/index';
|
||||
import {CsSessionQuery, CsSessionVO} from '@/api/system/conversation/types';
|
||||
import modal from '@/plugins/modal';
|
||||
import {useDict} from '@/utils/dict';
|
||||
import {parseTime} from '@/utils/ruoyi';
|
||||
|
||||
const {sys_device_type} = toRefs<any>(useDict('sys_device_type'));
|
||||
const {com_session_state} = toRefs<any>(useDict('com_session_state'));
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
@@ -202,7 +214,35 @@ const resetQuery = () => {
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
function handleMain(row) {
|
||||
// 用户 档案
|
||||
function handleUserMain(row: Partial<CsSessionVO>) {
|
||||
router.push({
|
||||
path: '/customer/customerMain',
|
||||
query: {
|
||||
id: row.userId,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 进入会话
|
||||
function handleOpenConversation(row: Partial<CsSessionVO>) {
|
||||
router.push({
|
||||
path: '/conversation/conversationMain',
|
||||
query: {
|
||||
id: row.sessionId,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// close conversation
|
||||
function handleCloseConversation(row: Partial<CsSessionVO>) {
|
||||
closeCsSession(row.sessionId).then(() => {
|
||||
getList();
|
||||
modal.msgSuccess('关闭会话成功')
|
||||
})
|
||||
}
|
||||
|
||||
function handleMain(row: Partial<CsSessionVO>) {
|
||||
console.log(row);
|
||||
router.push({
|
||||
path: '/conversation/conversationMain'
|
||||
|
||||
Reference in New Issue
Block a user