1. 设备管理界面完成
2. 用户管理界面完成
3. 会话列表完成
This commit is contained in:
Zy
2026-10-10 17:02:31 +08:00
parent 23703a66c2
commit 2ccce95d44
64 changed files with 5341 additions and 1254 deletions

View File

@@ -1,61 +1,117 @@
<script lang="ts" setup>
import FormItemTip from "@/components/FormItemTip/index.vue";
import {getCsAgent, updateCsAgent} from "@/api/system/cssAgent";
import modal from '@/plugins/modal';
const router = useRouter();
const route = useRoute();
const form = ref({
phone: "",
username: "",
sex: 1,
creatDay: '',
status: 1,
img: ''
"account": "",
"agentId": "",
"agentNo": "",
"avatarUrl": "",
"activeSessionCount": 0,
"createTime": "",
"jobNo": "",
"name": "",
"onlineStatus": "0",
"onlineStatusName": "离线",
"phone": null,
"status": "0",
"statusName": "启用",
"password": ''
})
const editForm = ref({...form.value})
const defaultImag = computed(() => {
if (form.value.avatarUrl) {
return form.value.avatarUrl
}
return import.meta.env.VITE_DEFAULT_USER_IMAGE
})
function init() {
if (route.query.id) {
getCsAgent(route.query.id as string).then(res => {
form.value = {
...form.value,
...res.data,
password: "",
}
editForm.value = JSON.parse(JSON.stringify(form.value))
})
}
}
init()
function handleBack() {
router.replace({
path: "/customer/customerList"
path: "/conversation/csAgent"
})
}
function handleChangeFile(file: File) {
console.log(file)
function handleSubmit() {
if (!editForm.value.account || editForm.value.account.trim() === '') {
modal.msgWarning('登录账号不能为空')
return;
}
if (!editForm.value.name || editForm.value.name.trim() === '') {
modal.msgWarning('客服姓名不能为空')
return;
}
editForm.value.phone = editForm.value.account;
updateCsAgent(editForm.value).then(() => {
handleBack()
})
}
function resetForm() {
editForm.value = JSON.parse(JSON.stringify(form.value))
}
</script>
<template>
<div class="edit">
<div class="flex justify-between">
<div class="flex justify-between" style="margin-top: 22px">
<pagecrumb></pagecrumb>
<el-button plain type="info" @click="handleBack"> 返回客服列表</el-button>
</div>
<!-- 用户信息-->
<section class="customerInfoBox commonCard flex justify-between flex-items-center">
<div class="flex infoBox">
<el-image
class="customer-Img"
src="https://ts3.tc.mm.bing.net/th?id=ORMS.48a27ca8353fa47bf0dc8df38854d0e1&pid=Wdp&w=312&h=172&qlt=90&c=1&rs=1&dpr=1&p=0"></el-image>
<el-image :src="defaultImag" class="customer-Img"></el-image>
<div class="flex flex-col justify-between">
<div>
<span class="userName">林小满</span>
<el-tag effect="light" round style="margin: 0 12px " type="success">
<span class="userName">{{ form.name }}</span>
<el-tag v-if="form.status === '0' " effect="light" round style="margin: 0 12px " type="success">
<div class="flex flex-items-center">
<span>启用</span></div>
</el-tag>
<el-tag v-else effect="light" round style="margin: 0 12px " type="danger">
<div class="flex flex-items-center">
<span>禁用</span></div>
</el-tag>
</div>
<div class="subInfoBox">
<span> KF-001 </span>
<span> {{ form.agentNo }} </span>
<span class="dat">·</span>
<span>工号 8823 </span>
<span>工号 {{ form.account }} </span>
<span class="dat">·</span>
<span>138****6688</span>
<span class="dat">·</span>
<span>创建于 2025-11-08</span>
<span>创建于 {{ form.createTime }}</span>
</div>
</div>
</div>
<div>
当前在线·接待中3/5
<div :class="{
offline:form.onlineStatus === '0'
}" class="onlineStatus">
<span>当前{{ form.onlineStatusName }}</span>
<span v-if="form.onlineStatus !== '0'">·接待中 {{ form.activeSessionCount }}</span>
</div>
</section>
@@ -68,11 +124,11 @@ function handleChangeFile(file: File) {
<el-row :gutter="24">
<el-col :span="12">
<FormItemTip
v-model="form.phone"
v-model="editForm.jobNo"
:inputAttrs="{ placeholder: '请输入工号', disabled: true , showWordLimit:false ,maxlength:11}"
:required="true"
label="工号"
prop="phone"
prop="jobNo"
tip="必填且全平台唯一,示例:8823"
>
<template #suffix>不可修改</template>
@@ -80,10 +136,10 @@ function handleChangeFile(file: File) {
</el-col>
<el-col :span="12">
<FormItemTip
v-model="form.username"
v-model="editForm.name"
:inputAttrs="{ placeholder: '请输入客服姓名', disabled: false , showWordLimit:true ,maxlength:20}"
:required="true"
prop="username"
prop="name"
tip="必填,将在会话列表与用户端展示"
>
<template #label>
@@ -95,10 +151,10 @@ function handleChangeFile(file: File) {
<el-row :gutter="24">
<el-col :span="12">
<FormItemTip
v-model="form.username"
v-model="editForm.account"
:inputAttrs="{ placeholder: '请输入登录账号', disabled: false , showWordLimit:true ,maxlength:20}"
:required="true"
prop="username"
prop="account"
tip="必填,手机号格式,全平台唯一,同时作为登录账号"
>
<template #label>
@@ -108,10 +164,10 @@ function handleChangeFile(file: File) {
</el-col>
<el-col :span="12">
<FormItemTip
v-model="form.username"
v-model="editForm.password"
:inputAttrs="{ placeholder: '不修改请留空', disabled: false , showWordLimit:true ,maxlength:20, minlength:8}"
:required="true"
prop="username"
prop="password"
tip="如需修改请重新输入,长度 8–20 位,含字母与数字"
>
<template #label>
@@ -123,11 +179,11 @@ function handleChangeFile(file: File) {
<el-row :gutter="24">
<el-col :span="12">
<FormItemTip
v-model="form.status"
v-model="editForm.status"
:inputAttrs="{ placeholder: '', disabled: false }"
:radioOptions="[
{label:'启用',value:1},
{label:'禁用',value:0},
{label:'启用',value:'0'},
{label:'禁用',value:'1'},
]"
label="账号状态"
prop="status"
@@ -141,8 +197,8 @@ function handleChangeFile(file: File) {
</div>
</section>
<div class="footer">
<el-button>取消</el-button>
<el-button type="primary">保存</el-button>
<el-button @click="resetForm">取消</el-button>
<el-button type="primary" @click="handleSubmit">保存</el-button>
</div>
</div>
</template>
@@ -187,6 +243,16 @@ function handleChangeFile(file: File) {
margin: 0 1px;
}
}
.onlineStatus {
line-height: 18px;
color: rgba(37, 99, 235, 1);
font-size: 12px;
&.offline {
color: red;
}
}
}