10/15
1. 工作人员账号添加 2. 优化打包 3. 日志 4. 用户头像列表
This commit is contained in:
@@ -42,7 +42,7 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="关联设备" prop="deviceId">
|
||||
<el-input v-model="queryParams.deviceId" clearable placeholder="请输入MAC/设备名称" size="large"
|
||||
style="width: 150px" @keyup.enter="handleQuery"/>
|
||||
style="width: 190px" @keyup.enter="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="会话创建时间" prop="startTime">
|
||||
<el-date-picker
|
||||
@@ -85,14 +85,13 @@
|
||||
<span style="margin:0 8px;color: #fff;">全部</span>
|
||||
<span style="color: #fff;font-weight: bold">1286</span>
|
||||
</el-button>
|
||||
<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>
|
||||
<tableTag v-for="(item,index) in overViewList" :key="index" :circle-color="colorList[index]"
|
||||
:num="item.count"
|
||||
:title="item.statusName"></tableTag>
|
||||
</div>
|
||||
<div>
|
||||
<el-button plain type="info">批量导出</el-button>
|
||||
<el-button plain type="info">刷新</el-button>
|
||||
<el-button plain type="info" @click="handleExport">批量导出会话记录</el-button>
|
||||
<el-button plain type="info" @click="getList">刷新</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -105,7 +104,17 @@
|
||||
>
|
||||
<el-table-column align="center" type="selection"></el-table-column>
|
||||
<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="userNickName">
|
||||
<template #default="scope">
|
||||
<div class="userInfoBox">
|
||||
<div class="nameBox">
|
||||
<i class="circle"></i>
|
||||
<span>{{ scope.row.customer.nickName }}</span>
|
||||
</div>
|
||||
<div style="color: #9CA3AF;font-size: 12px;">{{ hiddenPhone(scope.row.customer.phonenumber) }}</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="关联设备" prop="deviceId"/>
|
||||
<el-table-column align="center" label="会话状态" width="100">
|
||||
<template #default="scope">
|
||||
@@ -115,7 +124,6 @@
|
||||
<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"/>
|
||||
@@ -123,20 +131,13 @@
|
||||
<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">
|
||||
<el-table-column align="center" class-name="small-padding fixed-width" fixed="right" 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>
|
||||
@@ -147,14 +148,6 @@
|
||||
@click="handleUserMain(scope.row)"
|
||||
>用户档案
|
||||
</el-button>
|
||||
<el-button
|
||||
v-hasPermi="['monitor:online:forceLogout']"
|
||||
plain
|
||||
type="danger"
|
||||
v-if="scope.row.status === '2'"
|
||||
@click="handleCloseConversation(scope.row)"
|
||||
>关闭会话
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -171,12 +164,13 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="Online" setup>
|
||||
import {to} from 'await-to-js';
|
||||
import {closeCsSession, listCsSession as initData} from '@/api/system/conversation/index';
|
||||
import {listCsSession as initData, overViewCsSession} 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';
|
||||
import {hiddenPhone} from "@/utils/phone";
|
||||
import {download as requestDownload} from "@/utils/request";
|
||||
import {useTableSelection} from "@/hooks/table/useTableSelection";
|
||||
import {CsAgentVO} from "@/api/system/cssAgent/types";
|
||||
|
||||
const {com_session_state} = toRefs<any>(useDict('com_session_state'));
|
||||
|
||||
@@ -185,7 +179,7 @@ const router = useRouter();
|
||||
const onlineList = ref<CsSessionVO[]>([]);
|
||||
const loading = ref(true);
|
||||
const total = ref(0);
|
||||
|
||||
const {ids, single, multiple, handleSelectionChange} = useTableSelection<CsSessionVO>(item => item.sessionId);
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
|
||||
const queryParams = ref<CsSessionQuery>({
|
||||
@@ -214,6 +208,38 @@ const resetQuery = () => {
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
const colorList = ['#7c3aed', '#ea580c', '#1db954', '#94a3b8']
|
||||
const overViewList = ref([
|
||||
{
|
||||
"count": 0,
|
||||
"status": "0",
|
||||
"statusName": "机器人"
|
||||
},
|
||||
{
|
||||
"count": 0,
|
||||
"status": "1",
|
||||
"statusName": "排队"
|
||||
},
|
||||
{
|
||||
"count": 0,
|
||||
"status": "2",
|
||||
"statusName": "人工"
|
||||
},
|
||||
{
|
||||
"count": 0,
|
||||
"status": "3",
|
||||
"statusName": "已结束"
|
||||
}
|
||||
])
|
||||
|
||||
// 查看客服会话状态统计
|
||||
function getOverViewSession() {
|
||||
overViewCsSession().then((res) => {
|
||||
overViewList.value = res.data.statuses || [];
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 用户 档案
|
||||
function handleUserMain(row: Partial<CsSessionVO>) {
|
||||
router.push({
|
||||
@@ -224,8 +250,8 @@ function handleUserMain(row: Partial<CsSessionVO>) {
|
||||
})
|
||||
}
|
||||
|
||||
// 进入会话
|
||||
function handleOpenConversation(row: Partial<CsSessionVO>) {
|
||||
|
||||
function handleMain(row: Partial<CsSessionVO>) {
|
||||
router.push({
|
||||
path: '/conversation/conversationMain',
|
||||
query: {
|
||||
@@ -234,23 +260,20 @@ function handleOpenConversation(row: Partial<CsSessionVO>) {
|
||||
})
|
||||
}
|
||||
|
||||
// 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'
|
||||
})
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = () => {
|
||||
requestDownload(
|
||||
'/cs/session/exportSelected',
|
||||
{
|
||||
sessionIds: ids.value.join(',')
|
||||
},
|
||||
`批量会话导出${new Date().getTime()}.xlsx`
|
||||
);
|
||||
};
|
||||
onMounted(() => {
|
||||
getList();
|
||||
getOverViewSession()
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -258,12 +281,36 @@ onMounted(() => {
|
||||
@use '@/assets/styles/components/page-shell' as pageShell;
|
||||
|
||||
@include pageShell.table-crud-page;
|
||||
|
||||
|
||||
.circle {
|
||||
width: 7px;
|
||||
height: 6px;
|
||||
border-radius: 3px;
|
||||
background-color: rgba(124, 58, 237, 1)
|
||||
}
|
||||
|
||||
|
||||
.userInfoBox {
|
||||
|
||||
.nameBox {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.circle {
|
||||
display: block;
|
||||
width: 9px;
|
||||
height: 9px;
|
||||
border-radius: 4px;
|
||||
background-color: #EF4444;
|
||||
margin-right: 2px;
|
||||
}
|
||||
|
||||
span {
|
||||
color: rgba(37, 99, 235, 1);
|
||||
font-size: 13px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user