修改智能表单

This commit is contained in:
sonjinyon 2024-11-14 14:14:21 +08:00
parent 569cbad572
commit b64e9830ea
21 changed files with 331 additions and 70 deletions

View File

@ -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}
// })
// }
}

View File

@ -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, })
}
// // 修改文章管理

View File

@ -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 })
},
}

View File

@ -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}

View File

@ -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>

View File

@ -18,7 +18,10 @@
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)">&nbsp;&nbsp;&nbsp;删除</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">
@ -54,15 +57,18 @@
<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="请输入字段" />
<el-input style="border: 1px solid #DCDFE6;border-radius: 3px; " v-model="inputarr[index]"
placeholder="请输入字段" />
</div>
<div>
<el-button @click="adinput"
@ -86,33 +92,70 @@
<!-- 采集数据列表 -->
<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-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');
// Viewportmeta
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>

View File

@ -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; //

View File

@ -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> -->
<!-- <ContentWrap></ContentWrap> -->
<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">
@ -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);

View File

@ -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">

View File

@ -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;

View File

@ -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');
}
/** 导出按钮操作 */

View File

@ -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 ============

View File

@ -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

View File

@ -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);
}
}

View File

@ -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;

View File

@ -55,4 +55,6 @@ public class SupportStaffRespVO {
@ExcelProperty("创建时间")
private LocalDateTime createTime;
private Integer lineStatus;
}

View File

@ -39,4 +39,6 @@ public class SupportStaffSaveReqVO {
@Schema(description = "订单通知")
private Integer orderInform;
private Integer lineStatus;
}

View File

@ -63,4 +63,9 @@ public class SupportStaffDO extends BaseDO {
*/
private Integer orderInform;
/**
* 线上状态
*/
private Integer lineStatus;
}

View File

@ -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;
}
}

View File

@ -50,4 +50,9 @@ public interface SupportStaffService {
*/
PageResult<SupportStaffDO> getSupportStaffPage(SupportStaffPageReqVO pageReqVO);
/**
* 修改客服是否在线状态
*/
void updateLineStatus(String id , Integer lineStatus );
}

View File

@ -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);
}
}