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