修改智能表单 #122
@ -12,12 +12,27 @@ export const FollowUpRecordApi = {
|
||||
return await request.post({ url: `/intelligentForm/saveDynamicData`, data })
|
||||
},
|
||||
|
||||
//查询对应表单的采集数据列表
|
||||
collectDataList: async(query) => {
|
||||
return await request.get({
|
||||
url: '/intelligentForm/collectDataList',
|
||||
method: 'get',
|
||||
params: {id:query}
|
||||
})
|
||||
//修改智能表单
|
||||
updateDynamicData: async (data) => {
|
||||
return await request.post({ url: `/intelligentForm/updateDynamicData`, data })
|
||||
},
|
||||
|
||||
//删除智能表单
|
||||
deleteDynamicDataById: async (id) => {
|
||||
return await request.get({ url: `/intelligentForm/deleteDynamicDataById?id=` + id, })
|
||||
},
|
||||
|
||||
// 查询文章管理列表
|
||||
collectDataList: async (id) => {
|
||||
return await request.get({ url: `/intelligentForm/collectDataList?id=` + id, })
|
||||
}
|
||||
|
||||
// //查询对应表单的采集数据列表
|
||||
// collectDataList: async(query) => {
|
||||
// return await request.get({
|
||||
// url: '/intelligentForm/collectDataList',
|
||||
// method: 'get',
|
||||
// params: {id:query}
|
||||
// })
|
||||
// }
|
||||
}
|
||||
|
@ -25,8 +25,8 @@ export const saveDynamicData = async (data: ArticleVO) => {
|
||||
}
|
||||
|
||||
// 查询文章管理列表
|
||||
export const collectDataList = async (query: any) => {
|
||||
return await request.get({ url: `/intelligentForm/collectDataList`, query })
|
||||
export const collectDataList = async (id: any) => {
|
||||
return await request.get({ url: `/intelligentForm/collectDataList?id=` + id, })
|
||||
}
|
||||
|
||||
// // 修改文章管理
|
||||
|
@ -44,5 +44,12 @@ export const SupportStaffApi = {
|
||||
// 导出客服人员 Excel
|
||||
exportSupportStaff: async (params) => {
|
||||
return await request.download({ url: `/promotion/support-staff/export-excel`, params })
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
// 修改客服人员
|
||||
updateLineStatus: async (id: string,lineStatus: number) => {
|
||||
return await request.get({ url: `/promotion/support-staff/updateLineStatus?id=` + id + `&lineStatus=` + lineStatus })
|
||||
},
|
||||
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ export const useRenderLayout = () => {
|
||||
|
||||
<div
|
||||
|
||||
style="transition: all var(--transition-time-02);width:85%;margin:0 auto;"
|
||||
style="transition: all var(--transition-time-02);width:83%;margin:0 auto;"
|
||||
>
|
||||
<ElScrollbar
|
||||
v-loading={pageLoading.value}
|
||||
|
@ -8,7 +8,7 @@
|
||||
<el-radio-group v-model="radios" @change="handleRadioChange">
|
||||
<el-radio value="1" size="large">系统客服</el-radio>
|
||||
<el-radio value="2" size="large">拨打电话</el-radio>
|
||||
<el-radio value="3" size="large">跳转链接</el-radio>
|
||||
<!-- <el-radio value="3" size="large">跳转链接</el-radio> -->
|
||||
</el-radio-group>
|
||||
</span>
|
||||
<p style="margin-left: 80px;color:#bcbaba;font-size:13px">系统客服:点击联系客服使用系统的自带客服;拨打电话:点击联系客服拨打客服电话;跳转链接:跳转外部链接联系客服</p>
|
||||
|
@ -11,14 +11,17 @@
|
||||
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
|
||||
<el-card class="box-card" v-for="o in cardList" :key="o">
|
||||
<div class="clearfix">
|
||||
<span style="font-size: 23px;
|
||||
color: #000000;
|
||||
background-color:#ffffff;
|
||||
border-color: #fdfdff;">{{o.title}}</span>
|
||||
<el-button style="float: right; padding: 3px 0" type="text" @click="handelExtend(o.id)">推广</el-button>
|
||||
<el-button style="float: right;" type="text" @click="deleteForm(o.id)"> 删除</el-button>
|
||||
<el-button style="float: right;" type="text" @click="handelExtend(o.id)">推广</el-button>
|
||||
<el-button style="float: right;" type="text" @click="preview(o.id)">预览</el-button>
|
||||
<el-button style="float: right;" type="text" @click="redacts(o)">编辑</el-button>
|
||||
</div>
|
||||
<div style="display: flex;justify-content: space-between">
|
||||
<div style="width: 30%">
|
||||
@ -31,8 +34,8 @@
|
||||
<el-link style="font-size: 18px;
|
||||
color: #999595;
|
||||
background-color:#ffffff;
|
||||
border-color: #fdfdff;" @click="extendList(o.id)">采集数量</el-link>
|
||||
<p style="font-size: 25px" @click="extendList(o.id)">{{o.collectionQuantity}}</p>
|
||||
border-color: #fdfdff;" @click="extendList(o.id,o.title)">采集数量</el-link>
|
||||
<p style="font-size: 25px" @click="extendList(o.id,o.title)">{{o.collectionQuantity}}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: flex;justify-content: space-between">
|
||||
@ -48,71 +51,111 @@
|
||||
border-color: #fdfdff;">创建时间:{{o.createTime}}</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
|
||||
<!-- 添加表单对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500">
|
||||
|
||||
|
||||
<div style="text-align: center">
|
||||
<!-- <el-form-item label="表单标题">-->
|
||||
<div><span>标题</span> <el-input style="border-bottom: 1px solid skyblue;margin-bottom: 10px"
|
||||
<div>
|
||||
<span>标题</span>
|
||||
<el-input
|
||||
style="border-left: none; border-right: none; border-top: none; border-bottom: 1px solid skyblue; margin-bottom: 10px"
|
||||
v-model="addParams.title" placeholder="请输入表单标题" />
|
||||
</div>
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="字段名称">-->
|
||||
<div v-for="(item,index) in inputarr" :key="index" style="margin-bottom: 10px;">
|
||||
<span>字段</span>
|
||||
<el-input style="border: 1px solid #DCDFE6;border-radius: 3px; "
|
||||
v-model="inputarr[index]" placeholder="请输入字段" />
|
||||
<span>字段</span>
|
||||
<el-input style="border: 1px solid #DCDFE6;border-radius: 3px; " v-model="inputarr[index]"
|
||||
placeholder="请输入字段" />
|
||||
</div>
|
||||
<div>
|
||||
<el-button @click="adinput"
|
||||
style="text-align: center;width: 90%;background-color: rgb(232,244,255);color:#1890ff">添加字段</el-button>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- </el-form-item>-->
|
||||
</div>
|
||||
|
||||
|
||||
<div class="el-input-foot">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
<!-- 推广链接对话框-->
|
||||
<el-dialog :title="extendTitle" v-model="extendOpen" width="500px" append-to-body>
|
||||
<el-input v-model="extendLink" placeholder="请输入内容" :disabled="true" />
|
||||
<el-button @click="copyAddress">复制</el-button>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
<!-- 采集数据列表 -->
|
||||
<el-dialog :title="collectTitle" v-model="collectOpen" append-to-body>
|
||||
<el-table border v-loading="loading" :data="collectLink" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<div>
|
||||
<el-dialog :title="collectTitle" v-model="collectOpen" append-to-body>
|
||||
|
||||
</div>
|
||||
<!-- <el-table-column label="编号" align="center" prop="id" />-->
|
||||
<!-- <el-table-column label="id" align="center" prop="dynamicDataId" />-->
|
||||
<!-- <el-table-column v-for="item in collectLink" :label="item.map" align="center" :prop="item" />-->
|
||||
<template v-for="(item, index) in Object.keys(collectLink[0])" :key="index">
|
||||
<el-table-column :label="item">
|
||||
<template #default="scope">
|
||||
<span>{{scope.row[item]}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table border v-loading="loading" :data="collectLink" @selection-change="handleSelectionChange">
|
||||
<!-- <el-table-column type="selection" width="55" align="center" /> -->
|
||||
|
||||
<template v-for="(item, index) in getColumnNames" :key="index">
|
||||
<el-table-column
|
||||
:label="capitalize(item)"
|
||||
:prop="item"
|
||||
/>
|
||||
</template>
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
|
||||
<!--编辑弹出框-->
|
||||
<el-dialog :title="redactTitle" v-model="redactOpen" width="500">
|
||||
|
||||
<div style="text-align: center">
|
||||
<!-- 标题 -->
|
||||
<div>
|
||||
<span>标题</span>
|
||||
<el-input
|
||||
style="border-left: none; border-right: none; border-top: none; border-bottom: 1px solid skyblue; margin-bottom: 10px"
|
||||
v-model="redactName" placeholder="请输入表单标题" />
|
||||
</div>
|
||||
<!-- 字段 -->
|
||||
<div v-for="(item,index) in inputarr" :key="index" style="margin-bottom: 10px;">
|
||||
<span>字段</span>
|
||||
<el-input style="border: 1px solid #DCDFE6;border-radius: 3px; " v-model="inputarr[index]"
|
||||
placeholder="请输入字段" />
|
||||
</div>
|
||||
<!-- 添加字段按钮 -->
|
||||
<div>
|
||||
<el-button @click="adinput"
|
||||
style="text-align: center;width: 90%;background-color: rgb(232,244,255);color:#1890ff">添加字段</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="el-input-foot">
|
||||
<el-button type="primary" @click="submitForms">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {FollowUpRecordApi} from "@/api/crm/intelligent.ts";
|
||||
import { FollowUpRecordApi} from "@/api/crm/intelligent.ts";
|
||||
// import {Message} from 'element-ui';
|
||||
export default {
|
||||
name: "Business",
|
||||
dicts: ['stage_type', 'sales_stage'],
|
||||
data() {
|
||||
return {
|
||||
// 编辑弹出层标题
|
||||
redactTitle: "编辑",
|
||||
// 是否显示编辑弹出层
|
||||
redactOpen: false,
|
||||
//编辑id
|
||||
redactId: '',
|
||||
//编辑标题
|
||||
redactName: '',
|
||||
id: '',
|
||||
inputarr: [''],
|
||||
// 遮罩层
|
||||
@ -142,12 +185,13 @@
|
||||
//推广链接数据
|
||||
extendLink: '',
|
||||
//采集数据列表数据
|
||||
collectLink: [{}],
|
||||
collectLink: [],
|
||||
//下拉框客户列表
|
||||
customerList: [],
|
||||
//卡片列表
|
||||
cardList: [],
|
||||
addParams: {
|
||||
id: '',
|
||||
title: '',
|
||||
pageView: '',
|
||||
collectionQuantity: '',
|
||||
@ -158,23 +202,38 @@
|
||||
created() {
|
||||
this.getIntelligentList();
|
||||
},
|
||||
computed: {
|
||||
// 获取数据对象的所有键名(字段名),用于动态渲染列
|
||||
getColumnNames() {
|
||||
// 确保 collectLink 不是 null 或 undefined,并且不是空数组
|
||||
if (!this.collectLink || this.collectLink.length === 0) {
|
||||
return [];
|
||||
}
|
||||
return Object.keys(this.collectLink[0]);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
capitalize(str) {
|
||||
return str.charAt(0).toUpperCase() + str.slice(1);
|
||||
},
|
||||
//添加表单
|
||||
adinput() {
|
||||
this.inputarr.push('')
|
||||
console.log(this.inputarr)
|
||||
},
|
||||
//卡片数据
|
||||
getIntelligentList() {
|
||||
this.loading = true;
|
||||
FollowUpRecordApi.selectDynamicData().then(response => {
|
||||
this.cardList = response;
|
||||
console.log(response,'response.data')
|
||||
console.log(response, 'response.data')
|
||||
// this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.redactOpen = false;
|
||||
this.open = false;
|
||||
},
|
||||
//提交按钮
|
||||
@ -191,6 +250,25 @@
|
||||
this.getIntelligentList();
|
||||
});
|
||||
},
|
||||
//修改提交按钮
|
||||
submitForms() {
|
||||
|
||||
this.addParams.id = this.redactId
|
||||
this.addParams.inputarr = this.inputarr
|
||||
this.addParams.title = this.redactName
|
||||
|
||||
FollowUpRecordApi.updateDynamicData(this.addParams).then(response => {
|
||||
// this.cardList = response.data;
|
||||
// this.total = response.total;
|
||||
this.loading = false;
|
||||
this.redactOpen = false;
|
||||
this.getIntelligentList();
|
||||
// this.$message({
|
||||
// message: '修改成功',
|
||||
// type: 'success'
|
||||
// });
|
||||
});
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.inputarr = []
|
||||
@ -206,6 +284,53 @@
|
||||
this.extendLink = 'http://zysc.fjptzykj.com/form/extendLink/form?id=' + id
|
||||
this.extendOpen = true;
|
||||
this.extendTitle = "推广链接";
|
||||
},
|
||||
//删除按钮操作
|
||||
deleteForm(id) {
|
||||
// this.$confirm('此操作将永久删除该表单, 是否继续?', '提示', {
|
||||
// confirmButtonText: '确定',
|
||||
// cancelButtonText: '取消',
|
||||
// type: 'warning'
|
||||
// }).then(() => {
|
||||
// this.$message({
|
||||
// type: 'success',
|
||||
// message: '删除成功!'
|
||||
// });
|
||||
// }).catch(() => {
|
||||
// this.$message({
|
||||
// type: 'info',
|
||||
// message: '已取消删除'
|
||||
// });
|
||||
// });
|
||||
FollowUpRecordApi.deleteDynamicDataById(id).then(response => {
|
||||
// this.cardList = response.data;
|
||||
// this.total = response.total;
|
||||
this.getIntelligentList();
|
||||
});
|
||||
},
|
||||
// 预览
|
||||
preview(id) {
|
||||
this.extendLink = 'http://zysc.fjptzykj.com/form/extendLink/form?id=' + id
|
||||
// 打开新页面
|
||||
const newWindow = window.open(this.extendLink, '_blank');
|
||||
// 设置手机端视口(Viewport)meta标签,用来模拟手机尺寸
|
||||
newWindow.onload = () => {
|
||||
const metaTag = newWindow.document.createElement('meta');
|
||||
metaTag.name = 'viewport';
|
||||
metaTag.content = 'width=device-width, initial-scale=1.0, user-scalable=no'; // 设置视口宽度为设备宽度,并禁用缩放
|
||||
newWindow.document.head.appendChild(metaTag);
|
||||
};
|
||||
},
|
||||
// 编辑点击事件
|
||||
redacts(cardData) {
|
||||
this.inputarr = [''];
|
||||
// 1. 获取 cardData.data 中的所有键名
|
||||
this.inputarr = Object.keys(cardData.data);
|
||||
this.redactOpen = true;
|
||||
this.redactId = cardData.id
|
||||
this.redactName = cardData.title;
|
||||
|
||||
|
||||
},
|
||||
//复制按钮操作
|
||||
copyAddress() {
|
||||
@ -218,14 +343,17 @@
|
||||
alert('已复制到剪贴板');
|
||||
},
|
||||
//采集数据展示
|
||||
extendList(id) {
|
||||
extendList(id,title) {
|
||||
FollowUpRecordApi.collectDataList(id).then(response => {
|
||||
this.collectLink = response
|
||||
console.log('111111: ' + JSON.stringify(response));
|
||||
});
|
||||
|
||||
this.collectLink = null;
|
||||
this.id = id
|
||||
this.collectOpen = true;
|
||||
this.collectTitle = "采集数据";
|
||||
collectDataList(this.id).then(response => {
|
||||
this.collectLink = response.data
|
||||
});
|
||||
this.collectTitle = title+"采集数据";
|
||||
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
@ -276,6 +404,6 @@
|
||||
|
||||
::v-deep.el-input--medium .el-input__inner {
|
||||
border: none;
|
||||
/* border-bottom:1px solid blue; */
|
||||
border-bottom: 1px solid blue;
|
||||
}
|
||||
</style>
|
||||
|
@ -36,9 +36,11 @@
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- 右键,进行操作(类似微信) -->
|
||||
<ul v-show="showRightMenu" :style="rightMenuStyle" class="right-menu-ul">
|
||||
<li
|
||||
@ -182,16 +184,18 @@ watch(showRightMenu, (val) => {
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.kefu {
|
||||
background-color: white;
|
||||
|
||||
&-conversation {
|
||||
height: 55px;
|
||||
padding: 8px;
|
||||
height: 50px;
|
||||
padding: 5px;
|
||||
//background-color: #fff;
|
||||
transition: border-left 0.05s ease-in-out; /* 设置过渡效果 */
|
||||
|
||||
.username {
|
||||
font-size: 20%;
|
||||
font-size: 15%;
|
||||
min-width: 0;
|
||||
max-width: 60%;
|
||||
max-width: 50%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
@ -201,7 +205,7 @@ watch(showRightMenu, (val) => {
|
||||
|
||||
.last-message {
|
||||
font-size: 15px;
|
||||
width: 200px;
|
||||
width: 170px;
|
||||
overflow: hidden; // 隐藏超出的文本
|
||||
white-space: nowrap; // 禁止换行
|
||||
text-overflow: ellipsis; // 添加省略号
|
||||
|
@ -1,10 +1,11 @@
|
||||
<template>
|
||||
<el-container v-if="showKeFuMessageList" class="kefu">
|
||||
<el-container v-if="showKeFuMessageList" style="background-color: white;height:98%" class="kefu">
|
||||
<!-- <el-header>
|
||||
<div class="kefu-title">{{ conversation.userNickname }}</div>
|
||||
</el-header> -->
|
||||
<el-main class="kefu-content overflow-visible">
|
||||
<el-scrollbar ref="scrollbarRef" always height="calc(100vh - 390px)" @scroll="handleScroll">
|
||||
<!-- <ContentWrap></ContentWrap> -->
|
||||
<el-main class="kefu-content overflow-visible">
|
||||
<el-scrollbar ref="scrollbarRef" always height="calc(100vh - 350px)" @scroll="handleScroll" style="overflow: hidden;">
|
||||
<div v-if="refreshContent" ref="innerRef" class="w-[100%] pb-3px">
|
||||
|
||||
|
||||
@ -31,7 +32,7 @@
|
||||
? `ss-row-right`
|
||||
: ''
|
||||
]" class="flex mb-20px w-[100%]">
|
||||
<el-avatar v-if="item.senderType === UserTypeEnum.MEMBER" :src="conversation.userAvatar"
|
||||
<el-avatar v-if="item.senderType === UserTypeEnum.MEMBER" :src="conversation.userAvatar"
|
||||
alt="avatar" class="w-60px h-60px" />
|
||||
<div :class="{ 'kefu-message': KeFuMessageContentTypeEnum.TEXT === item.contentType }"
|
||||
class="p-10px">
|
||||
@ -63,7 +64,7 @@
|
||||
:message="item" class="max-w-100%" />
|
||||
</MessageItem>
|
||||
</div>
|
||||
<el-avatar v-if="item.senderType === UserTypeEnum.ADMIN" :src="item.senderAvatar"
|
||||
<el-avatar style="margin-right: 12px;" v-if="item.senderType === UserTypeEnum.ADMIN" :src="item.senderAvatar"
|
||||
alt="avatar" />
|
||||
</div>
|
||||
</div>
|
||||
@ -79,7 +80,7 @@
|
||||
|
||||
<el-divider style="margin: 4px 0;" />
|
||||
|
||||
<el-footer height="185px">
|
||||
<el-footer height="186px">
|
||||
<div class="h-[100%]">
|
||||
<div class="flex items-center">
|
||||
<EmojiSelectPopover @select-emoji="handleEmojiSelect" />
|
||||
@ -107,7 +108,7 @@
|
||||
<br/>
|
||||
<textarea style="border: none; outline: none;" v-model="message" placeholder="请输入文字内容" rows="5" cols="75"></textarea>
|
||||
<div class="h-45px flex justify-end">
|
||||
<el-button class="mt-10px" type="primary" @click="handleSendMessage">发送</el-button>
|
||||
<el-button class="mt-5px" type="primary" @click="handleSendMessage">发送</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-footer>
|
||||
@ -539,6 +540,7 @@
|
||||
|
||||
// 消息气泡
|
||||
.kefu-message {
|
||||
font-size: 14px;
|
||||
color: #101010;
|
||||
border-radius: 5px;
|
||||
box-shadow: 3px 3px 5px rgba(220, 220, 220, 0.1);
|
||||
|
@ -3,7 +3,7 @@
|
||||
<el-popover :width="500" placement="top" trigger="click">
|
||||
<template #reference>
|
||||
<!-- <Icon :size="30" class="ml-10px cursor-pointer" icon="twemoji:grinning-face" /> -->
|
||||
<img :src="biaoqing" class="w-23px h-25px" />
|
||||
<img :src="biaoqing" style="margin-left:20px" class="w-23px h-25px" />
|
||||
</template>
|
||||
<ElScrollbar height="300px">
|
||||
<ul class="ml-2 flex flex-wrap px-2">
|
||||
|
@ -4,7 +4,7 @@
|
||||
<el-row style="display: flex; justify-content: center;">
|
||||
|
||||
<el-col :span="24">
|
||||
<div style="width:100%;height:70px;background-color:#3c80ff;">
|
||||
<div style="width:100%;height:68px;background-color:#3c80ff;">
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<el-input
|
||||
@ -19,15 +19,17 @@
|
||||
:src="pic"
|
||||
/>
|
||||
<span style="margin-left:5px;margin-top: 9px;">{{name}}</span>
|
||||
<!-- <el-switch
|
||||
<el-switch
|
||||
style="margin-top: 4px;--el-switch-on-color: #13ce66; --el-switch-off-color: #b6bac1;"
|
||||
v-model="value6"
|
||||
v-model="lineStatus"
|
||||
class="ml-2"
|
||||
width="60"
|
||||
inline-prompt
|
||||
active-text="在线"
|
||||
inactive-text="下线"
|
||||
/> -->
|
||||
@change="handleSwitchChange"
|
||||
|
||||
/>
|
||||
</span>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
@ -64,9 +66,9 @@
|
||||
|
||||
<!-- 会话详情(选中会话的消息列表) -->
|
||||
<el-col :span="12">
|
||||
<ContentWrap>
|
||||
|
||||
<KeFuMessageList ref="keFuChatBoxRef" @change="getConversationList"/>
|
||||
</ContentWrap>
|
||||
|
||||
</el-col>
|
||||
|
||||
<!-- 会员足迹(选中会话的会员足迹) -->
|
||||
@ -134,18 +136,20 @@
|
||||
import {useWebSocket} from '@vueuse/core'
|
||||
import {Search} from '@element-plus/icons-vue'
|
||||
import * as UserApi from '@/api/member/user'
|
||||
import { SupportStaffApi, SupportStaffVO } from '@/api/mall/promotion/supportstaff'
|
||||
|
||||
|
||||
|
||||
defineOptions({name: 'KeFu'})
|
||||
|
||||
const value6 = ref(true)
|
||||
const lineStatus = ref(true)
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
const name = params.get('name');
|
||||
const pic = params.get('pic');
|
||||
const kefuId = params.get('id')
|
||||
const conversations = ref<KeFuConversationRespVO[]>([])
|
||||
// const userInfoRef = ref<InstanceType<typeof UserInfo>>()
|
||||
const user = ref<UserApi.UserVO>({} as UserApi.UserVO)
|
||||
@ -160,6 +164,23 @@
|
||||
// 使用 getRefreshToken() 方法,而不使用 getAccessToken() 方法的原因:WebSocket 无法方便的刷新访问令牌
|
||||
) // WebSocket 服务地址
|
||||
|
||||
const handleSwitchChange = async (value) =>{
|
||||
console.log('11111:',value)
|
||||
let a = 0;
|
||||
|
||||
if(value == true){
|
||||
a = 1;
|
||||
await SupportStaffApi.updateLineStatus(kefuId,a)
|
||||
message.success('已上线')
|
||||
}else{
|
||||
a = 2;
|
||||
await SupportStaffApi.updateLineStatus(kefuId,a)
|
||||
message.success('已下线')
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
let a = 0;
|
||||
|
||||
|
@ -246,8 +246,9 @@ const handleDelete = async (id: number) => {
|
||||
}
|
||||
/** 客服进入工作台 */
|
||||
const handleEnterConsole = async (id: number,name: string,pic: string) => {
|
||||
await SupportStaffApi.updateLineStatus(JSON.stringify(id),1)
|
||||
setStaffToken(id);
|
||||
const url = `${window.location.origin}/kefu/kefu?name=${encodeURIComponent(name)}&pic=${encodeURIComponent(pic)}`;
|
||||
const url = `${window.location.origin}/kefu/kefu?id=${encodeURIComponent(id)}&name=${encodeURIComponent(name)}&pic=${encodeURIComponent(pic)}`;
|
||||
window.open(url, '_blank');
|
||||
}
|
||||
/** 导出按钮操作 */
|
||||
|
@ -19,6 +19,8 @@ public interface ErrorCodeConstants {
|
||||
// ========== 兑换记录 TODO 补充编号 ==========
|
||||
ErrorCode POINT_ORDER_NOT_EXISTS = new ErrorCode(11111, "兑换记录不存在");
|
||||
|
||||
ErrorCode ADVERTISING_NOT_EXISTS = new ErrorCode(333333, "开屏广告不存在");
|
||||
|
||||
|
||||
ErrorCode KE_FU_CONFIGURATION_NOT_EXISTS = new ErrorCode(22222222, "客服配置不存在");
|
||||
// ========== Banner 相关 1-013-002-000 ============
|
||||
|
@ -38,6 +38,14 @@ public class DynamicDataController {
|
||||
return success("保存成功");
|
||||
}
|
||||
|
||||
|
||||
//修改数据
|
||||
@PostMapping("/updateDynamicData")
|
||||
public CommonResult<String> updateDynamicData(@RequestBody Map<String, Object> requestData) {
|
||||
dynamicDataService.updateDynamicData(requestData);
|
||||
return success("保存成功");
|
||||
}
|
||||
|
||||
//查询全部数据
|
||||
@GetMapping("/selectDynamicData")
|
||||
public CommonResult<List<DynamicData>> selectDynamicData(@RequestHeader("Tenant-Id") String userAgent) {
|
||||
@ -52,6 +60,13 @@ public class DynamicDataController {
|
||||
return success(dynamicDataService.doSelectDynamicDataById(id));
|
||||
}
|
||||
|
||||
//根据id查询数据
|
||||
@GetMapping("/deleteDynamicDataById")
|
||||
@PermitAll
|
||||
public CommonResult<Boolean> deleteDynamicDataById(String id){
|
||||
return success(dynamicDataService.deleteDynamicDataById(id));
|
||||
}
|
||||
|
||||
//采集数据
|
||||
@PostMapping("/collectData")
|
||||
@PermitAll
|
||||
|
@ -91,4 +91,9 @@ public class SupportStaffController {
|
||||
BeanUtils.toBean(list, SupportStaffRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/updateLineStatus")
|
||||
public CommonResult<Boolean> updateLineStatus (String id , Integer lineStatus){
|
||||
supportStaffService.updateLineStatus(id, lineStatus);
|
||||
return success(true);
|
||||
}
|
||||
}
|
@ -38,6 +38,9 @@ public class SupportStaffPageReqVO extends PageParam {
|
||||
@Schema(description = "订单通知")
|
||||
private Integer orderInform;
|
||||
|
||||
@Schema(description = "线上状态")
|
||||
private Integer lineStatus;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
@ -55,4 +55,6 @@ public class SupportStaffRespVO {
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
private Integer lineStatus;
|
||||
|
||||
}
|
@ -39,4 +39,6 @@ public class SupportStaffSaveReqVO {
|
||||
@Schema(description = "订单通知")
|
||||
private Integer orderInform;
|
||||
|
||||
private Integer lineStatus;
|
||||
|
||||
}
|
@ -63,4 +63,9 @@ public class SupportStaffDO extends BaseDO {
|
||||
*/
|
||||
private Integer orderInform;
|
||||
|
||||
/**
|
||||
* 线上状态
|
||||
*/
|
||||
private Integer lineStatus;
|
||||
|
||||
}
|
@ -13,6 +13,8 @@ import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
import static cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils.getLoginUserId;
|
||||
|
||||
|
||||
@ -31,6 +33,7 @@ public class DynamicDataService {
|
||||
String pageView = (String)requestData.get("pageView");
|
||||
String collectionQuantity = (String)requestData.get("collectionQuantity");
|
||||
dynamicData.setTitle(title);
|
||||
requestData.remove("id");
|
||||
requestData.remove("title");
|
||||
dynamicData.setPageView(pageView);
|
||||
requestData.remove("pageView");
|
||||
@ -51,6 +54,31 @@ public class DynamicDataService {
|
||||
return dynamicDataRepository.save(dynamicData);//插入dynamicData数据
|
||||
}
|
||||
|
||||
|
||||
//修改数据
|
||||
public DynamicData updateDynamicData(Map<String, Object> requestData){
|
||||
|
||||
//构造数据结构、
|
||||
Optional<DynamicData> id = dynamicDataRepository.findById((String) requestData.get("id"));
|
||||
DynamicData dynamicData = id.get();
|
||||
|
||||
String title = (String)requestData.get("title");
|
||||
dynamicData.setTitle(title);
|
||||
requestData.remove("title");
|
||||
requestData.remove("id");
|
||||
requestData.remove("pageView");
|
||||
requestData.remove("collectionQuantity");
|
||||
|
||||
ArrayList<String> inputarr = (ArrayList)requestData.get("inputarr");
|
||||
for (String s : inputarr) {
|
||||
requestData.put(s,null);
|
||||
}
|
||||
requestData.remove("inputarr");
|
||||
dynamicData.setData(requestData);
|
||||
|
||||
return dynamicDataRepository.save(dynamicData);//插入dynamicData数据
|
||||
}
|
||||
|
||||
//查询全部数据
|
||||
public List<DynamicData> doSelectDynamicData(String httpServletRequest){
|
||||
//查询对应租户下的卡片列表数据
|
||||
@ -71,4 +99,12 @@ public class DynamicDataService {
|
||||
return dynamicDataRepository.save(dynamicData);
|
||||
}
|
||||
|
||||
//根据id查询数据
|
||||
public boolean deleteDynamicDataById(String id){
|
||||
dynamicDataRepository.deleteById(id);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -50,4 +50,9 @@ public interface SupportStaffService {
|
||||
*/
|
||||
PageResult<SupportStaffDO> getSupportStaffPage(SupportStaffPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 修改客服是否在线状态
|
||||
*/
|
||||
void updateLineStatus(String id , Integer lineStatus );
|
||||
|
||||
}
|
@ -27,6 +27,7 @@ public class SupportStaffServiceImpl implements SupportStaffService {
|
||||
public Integer createSupportStaff(SupportStaffSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
SupportStaffDO supportStaff = BeanUtils.toBean(createReqVO, SupportStaffDO.class);
|
||||
supportStaff.setLineStatus(2);
|
||||
supportStaffMapper.insert(supportStaff);
|
||||
// 返回
|
||||
return supportStaff.getId();
|
||||
@ -65,4 +66,11 @@ public class SupportStaffServiceImpl implements SupportStaffService {
|
||||
return supportStaffMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateLineStatus(String id,Integer lineStatus) {
|
||||
SupportStaffDO supportStaffDO = supportStaffMapper.selectOne("id", id);
|
||||
supportStaffDO.setLineStatus(lineStatus);
|
||||
supportStaffMapper.updateById(supportStaffDO);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user