Commit e5ef8cd9 by unknown

Merge branch 'front_end_dev' of https://gitee.com/LinkWeChat/link-wechat into front_end_dev

2 parents 183be53b 1920600b
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<div align="center"> <div align="center">
![GVP Stars](http://img.shields.io/badge/GPV%20Stars-600+-yellow) ![GVP Stars](http://img.shields.io/badge/GPV%20Stars-700+-yellow)
![GVP Forks](http://img.shields.io/badge/GPV%20Forks-200+-yellow) ![GVP Forks](http://img.shields.io/badge/GPV%20Forks-200+-yellow)
![license](http://img.shields.io/badge/license-GPL%203.0-green) ![license](http://img.shields.io/badge/license-GPL%203.0-green)
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> <link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title> <title><%= htmlWebpackPlugin.options.title %></title>
<script src="./jweixin-1.2.0.js"></script> <script src="./jweixin-1.2.0.js"></script>
<script src="https://open.work.weixin.qq.com/wwopen/js/jwxwork-1.0.0.js"></script>
</head> </head>
<body> <body>
......
...@@ -4,26 +4,82 @@ export default { ...@@ -4,26 +4,82 @@ export default {
name: 'App', name: 'App',
data() { data() {
return { return {
timestamp: '', appId: 'appId',
nonceStr: '', agentId: '1000005',
signature: '',
} }
}, },
created() { created() {
// 调取服务端signature // this.wxConfig()
}, },
watch: { watch: {
// 通过config接口注入权限验证配置 // 通过config接口注入权限验证配置
// 所有需要使用JS-SDK的页面必须先注入配置信息,否则将无法调用(同一个url仅需调用一次,对于变化url的SPA(single-page application)的web app可在每次url变化时进行调用) // 所有需要使用JS-SDK的页面必须先注入配置信息,否则将无法调用(同一个url仅需调用一次,对于变化url的SPA(single-page application)的web app可在每次url变化时进行调用)
$router() { $route() {
this.wxConfig()
},
},
methods: {
wxConfig() {
getAgentTicket(window.location.href.split('#')[0]).then(({ data }) => {
let { timestamp, nonceStr, signature } = data
wx.agentConfig({
corpid: this.appId, // 必填,企业微信的corpid,必须与当前登录的企业一致
agentid: this.agentId, // 必填,企业微信的应用id (e.g. 1000247)
timestamp, // 必填,生成签名的时间戳
nonceStr, // 必填,生成签名的随机串
signature, // 必填,签名,见附录-JS-SDK使用权限签名算法
jsApiList: ['sendChatMessage'], //必填
success: (res) => {
// 回调
},
fail: (res) => {
if (res.errMsg.indexOf('function not exist') > -1) {
alert('版本过低请升级')
}
},
})
})
},
_wxConfig() {
// 获取企业的jsapi_ticket
getAppTicket(window.location.href).then(({ data }) => {
let { timestamp, nonceStr, signature } = data
wx.config({ wx.config({
beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题 beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。 debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
appId: '123456', // 必填,企业微信的corpID appId: this.appId, // 必填,企业微信的corpID
timestamp: this.timestamp, // 必填,生成签名的时间戳 timestamp, // 必填,生成签名的时间戳
nonceStr: this.nonceStr, // 必填,生成签名的随机串 nonceStr, // 必填,生成签名的随机串
signature: this.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法 signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
jsApiList: [], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来 jsApiList: ['getContext', 'sendChatMessage'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
})
wx.ready(() => {
// config信息验证后会执行ready方法,所有接口调用都必须在config接口获得结果之后,config是一个客户端的异步操作,所以如果需要在页面加载时就调用相关接口,则须把相关接口放在ready函数中调用来确保正确执行。对于用户触发时才调用的接口,则可以直接调用,不需要放在ready函数中。
getAgentTicket(window.location.href).then(({ data }) => {
let { timestamp, nonceStr, signature } = data
wx.agentConfig({
corpid: this.appId, // 必填,企业微信的corpid,必须与当前登录的企业一致
agentid: this.agentId, // 必填,企业微信的应用id (e.g. 1000247)
timestamp, // 必填,生成签名的时间戳
nonceStr, // 必填,生成签名的随机串
signature, // 必填,签名,见附录-JS-SDK使用权限签名算法
jsApiList: ['sendChatMessage'], //必填
success: (res) => {
// 回调
},
fail: (res) => {
if (res.errMsg.indexOf('function not exist') > -1) {
alert('版本过低请升级')
}
},
})
})
})
wx.error(function(res) {
console.error(res)
// config信息验证失败会执行error函数,如签名过期导致验证失败,具体错误信息可以打开config的debug模式查看,也可以在返回的res参数中查看,对于SPA可以在这里更新签名。
})
}) })
}, },
}, },
......
...@@ -5,12 +5,9 @@ const service = window.CONFIG.services.wecom + '/chat' ...@@ -5,12 +5,9 @@ const service = window.CONFIG.services.wecom + '/chat'
* 侧边栏列表 * 侧边栏列表
* @param {*} params * @param {*} params
*/ */
export function getTypeList(params) { export function getTypeList() {
return request({ return request({
url: service + '/side/list', url: service + '/side/h5List',
params: {
h5: 1,
},
}) })
} }
...@@ -18,12 +15,10 @@ export function getTypeList(params) { ...@@ -18,12 +15,10 @@ export function getTypeList(params) {
* 素材列表 * 素材列表
* @param {*} sideId * @param {*} sideId
*/ */
export function getMaterialList(sideId) { export function getMaterialList(params) {
return request({ return request({
url: service + '/item/list', url: service + '/item/list',
params: { params,
sideId,
},
}) })
} }
...@@ -31,12 +26,10 @@ export function getMaterialList(sideId) { ...@@ -31,12 +26,10 @@ export function getMaterialList(sideId) {
* 收藏列表(h5我的) * 收藏列表(h5我的)
* @param {*} userId * @param {*} userId
*/ */
export function getCollectionList(userId) { export function getCollectionList(params) {
return request({ return request({
url: service + '/collection/list', url: service + '/collection/list',
params: { params,
userId,
},
}) })
} }
...@@ -57,7 +50,7 @@ export function addCollection(data) { ...@@ -57,7 +50,7 @@ export function addCollection(data) {
} }
/** /**
* 侧边栏抓取素材 * 取消收藏
* @param {*} data * @param {*} data
* { * {
materialId:素材id materialId:素材id
...@@ -67,7 +60,7 @@ userId:用户id ...@@ -67,7 +60,7 @@ userId:用户id
export function cancleCollection(data) { export function cancleCollection(data) {
return request({ return request({
url: service + '/collection/cancleCollection', url: service + '/collection/cancleCollection',
method: 'put', method: 'post',
data, data,
}) })
} }
import request from '@/utils/request' import request from '@/utils/request'
const service = window.CONFIG.services.wecom + '/ticket' import config from '@/config'
const service = config.services.wecom
/** /**
* 获取应用的jsapi_ticket * 获取应用的jsapi_ticket
...@@ -7,7 +8,7 @@ const service = window.CONFIG.services.wecom + '/ticket' ...@@ -7,7 +8,7 @@ const service = window.CONFIG.services.wecom + '/ticket'
*/ */
export function getAgentTicket(url) { export function getAgentTicket(url) {
return request({ return request({
url: service + '/getAgentTicket', url: service + '/ticket/getAgentTicket',
params: { params: {
url, url,
}, },
...@@ -20,7 +21,7 @@ export function getAgentTicket(url) { ...@@ -20,7 +21,7 @@ export function getAgentTicket(url) {
*/ */
export function getAppTicket(url) { export function getAppTicket(url) {
return request({ return request({
url: service + '/getAppTicket', url: service + '/ticket/getAppTicket',
params: { params: {
url, url,
}, },
...@@ -28,46 +29,14 @@ export function getAppTicket(url) { ...@@ -28,46 +29,14 @@ export function getAppTicket(url) {
} }
/** /**
* 收藏列表(h5我的) * 获取企业的jsapi_ticket
* @param {*} userId * @param {*} url 页面url
*/ */
export function getCollectionList(userId) { export function getUserInfo(code) {
return request({ return request({
url: service + '/collection/list', url: service + '/user/getUserInfo',
params: { params: {
userId, code,
}, },
}) })
} }
/**
* 添加收藏
* @param {*} data
* {
materialId:素材id
userId:用户id
}
*/
export function addCollection(data) {
return request({
url: service + '/collection/addCollection',
method: 'post',
data,
})
}
/**
* 侧边栏抓取素材
* @param {*} data
* {
materialId:素材id
userId:用户id
}
*/
export function cancleCollection(data) {
return request({
url: service + '/collection/cancleCollection',
method: 'put',
data,
})
}
import axios from 'axios' import axios from 'axios'
import { Toast } from 'vant'
function createAxios(baseURL) { function createAxios(baseURL) {
const instance = axios.create({ const instance = axios.create({
...@@ -24,8 +25,8 @@ function createAxios(baseURL) { ...@@ -24,8 +25,8 @@ function createAxios(baseURL) {
// console.log('res: ' + res) // console.log('res: ' + res)
const { data, status } = res const { data, status } = res
// code 0:成功,-1/其它:错误 // code 0:成功,-1/其它:错误
if (status === 200 && data.code === 0) { if (status === 200 && data.code === 200) {
return JSON.stringify(data.result) ? data.result : data.data return data
} else if (data.code === 201) { } else if (data.code === 201) {
// Message.error({ // Message.error({
// content: `产品已存在`, // content: `产品已存在`,
...@@ -44,10 +45,7 @@ function createAxios(baseURL) { ...@@ -44,10 +45,7 @@ function createAxios(baseURL) {
if (error.response) { if (error.response) {
addErrorLog(error.response) addErrorLog(error.response)
} else { } else {
// Message.error({ Toast.fail('服务器未启动或连接超时')
// content: `服务器未启动或连接超时`,
// duration: 3
// })
console.error('服务器未启动或连接超时') console.error('服务器未启动或连接超时')
} }
return Promise.reject(error) return Promise.reject(error)
...@@ -71,6 +69,7 @@ function createAxios(baseURL) { ...@@ -71,6 +69,7 @@ function createAxios(baseURL) {
process.env.NODE_ENV === 'development' process.env.NODE_ENV === 'development'
? console.error(`错误: 路径: ${responseURL}, 返回值 : ${responseText}`) ? console.error(`错误: 路径: ${responseURL}, 返回值 : ${responseText}`)
: console.error(`${JSON.parse(responseText).message}`) : console.error(`${JSON.parse(responseText).message}`)
Toast.fail(`${responseText}`)
} }
return instance return instance
......
...@@ -16,48 +16,130 @@ export default { ...@@ -16,48 +16,130 @@ export default {
type: String, type: String,
default: '', default: '',
}, },
keyword: {
type: String,
default: '',
},
}, },
data() { data() {
return { return {
list: [{}],
loading: false, loading: false,
finished: false, finished: false,
error: false,
pageSize: 1,
pageNum: 10,
list: [],
collectList: [], collectList: [],
} }
}, },
watch: {}, watch: {},
computed: {}, computed: {},
created() {}, created() {
this.getList()
this.userId && this.getCollectionList()
},
mounted() {}, mounted() {},
methods: { methods: {
getList() { getList(page) {
let pageSize = page || this.pageSize++
let pageNum = this.pageNum
let keyword = this.keyword
page == 1 && (this.list = [])
this.loading = true this.loading = true
;(this.userId ? getCollectionList : getMaterialList)() ;(this.sideId
? getMaterialList({ sideId: this.sideId, pageSize, pageNum, keyword })
: getCollectionList({ userId: this.userId, pageSize, pageNum, keyword })
)
.then(({ rows, total }) => { .then(({ rows, total }) => {
this.list = rows this.list.push(...rows)
this.loading = false this.loading = false
// 数据全部加载完成
if (this.list.length >= total) {
this.finished = true this.finished = true
}
}) })
.catch(() => { .catch(() => {
this.loading = false this.error = true
this.finished = true
}) })
}, },
getCollectionList() { getCollectionList() {
getCollectionList().then(({ rows, total }) => { let data = { userId: this.userId, pageSize: 1, pageNum: 1000 }
getCollectionList(data).then(({ rows, total }) => {
this.collectList = rows.map((d) => d.id) this.collectList = rows.map((d) => d.id)
}) })
}, },
isCollected(id) { isCollected(id) {
return this.collectList.includes(id) return this.collectList.includes(id)
}, },
send() {}, send(data) {
let entry = undefined
wx.invoke('getContext', {}, function(res) {
if (res.err_msg == 'getContext:ok') {
entry = res.entry //返回进入H5页面的入口类型,目前有normal、contact_profile、single_chat_tools、group_chat_tools
if (!['single_chat_tools', 'group_chat_tools'].includes(entry)) {
return
}
// mediaType 0 图片(image)、1 语音(voice)、2 视频(video),3 普通文件(file) 4 文本 5 海报
// msgtype 文本(“text”),图片(“image”),视频(“video”),文件(“file”),H5(“news”)和小程序(“miniprogram”)
let mes = {}
let msgtype = {
0: 'image',
2: 'video',
3: 'file',
4: 'text',
5: 'news',
}
switch (data.mediaType) {
case '4':
default:
mes.text = {
content: data.content, //文本内容
}
break
case '0':
case '2':
case '3':
mes[msgtype[data.mediaType]] = {
mediaid: data.materialId, //
}
break
case '5':
mes.news = {
link: '', //H5消息页面url 必填
title: '', //H5消息标题
desc: '', //H5消息摘要
imgUrl: '', //H5消息封面图片URL
}
break
// case '6':
// mes.miniprogram = {
// appid: 'wx8bd80126147df384', //小程序的appid
// title: 'this is title', //小程序消息的title
// imgUrl:
// 'https://search-operate.cdn.bcebos.com/d054b8892a7ab572cb296d62ec7f97b6.png', //小程序消息的封面图。必须带http或者https协议头,否则报错 $apiName$:fail invalid imgUrl
// page: '/index/page.html', //小程序消息打开后的路径,注意要以.html作为后缀,否则在微信端打开会提示找不到页面
// }
// break
}
mes.msgtype = msgtype[data.mediaType]
wx.invoke('sendChatMessage', mes, function(res) {
if (res.err_msg == 'sendChatMessage:ok') {
//发送成功
}
})
} else {
//错误处理
}
})
},
collect(materialId) { collect(materialId) {
;(this.isCollected(materialId) ? cancleCollection : addCollection)({ ;(this.isCollected(materialId) ? cancleCollection : addCollection)({
userId, userId: this.userId,
materialId, materialId,
}).then(({ data }) => { }).then(({ data }) => {
this.isCollected.splice(this.isCollected.indexOf(materialId), 1) this.isCollected(materialId)
? this.isCollected.splice(this.isCollected.indexOf(materialId), 1)
: this.isCollected.push(materialId)
}) })
}, },
}, },
...@@ -70,17 +152,19 @@ export default { ...@@ -70,17 +152,19 @@ export default {
v-model="loading" v-model="loading"
:finished="finished" :finished="finished"
finished-text="没有更多了" finished-text="没有更多了"
@load="getList" :error.sync="error"
error-text="请求失败,点击重新加载"
@load="getList()"
> >
<div v-for="(item, index) in list" class="list" :key="index"> <div v-for="(item, index) in list" class="list" :key="index">
<div class="title">dsdsds</div> <div class="title">{{ item.content }}</div>
<div class="info"> <div class="info">
素材库 {{ item.content }}
<span>2020/2/4</span> <span>2020/2/4</span>
<div class="fr flex"> <div class="fr flex">
<div class="action" @click="send">发送</div> <div class="action" @click="send(item)">发送</div>
<div class="action" @click="collect(item.id)"> <div v-if="!!userId" class="action" @click="collect(item.id)">
{{ isCollected(item.id) ? '已' : '' }}收藏 {{ isCollected(item.id) ? '已' : '' }}收藏
</div> </div>
</div> </div>
......
2
<script> <script>
import { getUserInfo } from '@/api/common'
import { getTypeList } from '@/api/chat' import { getTypeList } from '@/api/chat'
import List from './List' import List from './List'
export default { export default {
...@@ -6,18 +8,60 @@ export default { ...@@ -6,18 +8,60 @@ export default {
props: {}, props: {},
data() { data() {
return { return {
keywords: '', keyword: '',
active: 2, active: 0,
list: [], list: [],
loading: false, loading: false,
finished: false, finished: false,
show: false, show: false,
userId: '',
auth_code: '',
auth_code1: '',
} }
}, },
watch: {}, watch: {},
computed: {}, computed: {},
beforeCreate() {
// http://106.13.201.219/?auth_code=xxx#/authWehatCallback
// console.log('routerbeforeCreate', this.$route);
// let auth_code = location.search
// .slice(1)
// .split('&')[0]
// .split('=')[1]
// this.auth_code1 = auth_code
// if (!auth_code) {
// this.$toast('未获得授权')
// return
// }
// getUserInfo(auth_code)
// .then(({ data }) => {
// this.userId = data.userId
// this.$toast('userId:' + this.userId)
// })
// .catch((err) => {
// this.$toast('err:' + err)
// })
},
created() { created() {
let auth_code = location.search
.slice(1)
.split('&')[0]
.split('=')[1]
this.auth_code1 = auth_code
if (!auth_code) {
this.$toast('未获得授权')
return
}
getUserInfo(auth_code)
.then(({ data }) => {
this.userId = data.userId
this.$toast('userId:' + this.userId)
})
.catch((err) => {
this.$toast('err:' + err)
})
this.getList() this.getList()
this.auth_code = location
}, },
mounted() {}, mounted() {},
methods: { methods: {
...@@ -26,7 +70,9 @@ export default { ...@@ -26,7 +70,9 @@ export default {
this.list = rows this.list = rows
}) })
}, },
search() {}, search() {
this.$refs['list' + this.active].getList(1)
},
add() {}, add() {},
}, },
} }
...@@ -35,7 +81,7 @@ export default { ...@@ -35,7 +81,7 @@ export default {
<template> <template>
<div> <div>
<van-search <van-search
v-model="keywords" v-model="keyword"
show-action show-action
placeholder="请输入搜索关键词" placeholder="请输入搜索关键词"
@search="search" @search="search"
...@@ -44,11 +90,26 @@ export default { ...@@ -44,11 +90,26 @@ export default {
<van-icon name="plus" @click="add" /> <van-icon name="plus" @click="add" />
</template> --> </template> -->
</van-search> </van-search>
<span>{{ auth_code }}</span>
<br />
<span>auth_code:{{ auth_code1 }}</span>
<van-tabs v-model="active"> <van-tabs v-model="active">
<van-tab title="标签 1"> <van-tab v-if="!!userId" title="我的">
<List></List> <List ref="list0" :userId="userId" :keyword="keyword"></List>
</van-tab>
<van-tab
:title="item.sideName"
v-for="(item, index) in list"
:key="index"
>
<List
:ref="'list' + (index + 1)"
:sideId="item.sideId"
:userId="userId"
:keyword="keyword"
></List>
</van-tab> </van-tab>
<van-tab title="标签 2"><List></List></van-tab>
</van-tabs> </van-tabs>
<!-- <van-dialog <!-- <van-dialog
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
ENV = 'development' ENV = 'development'
# 塬微管理系统/开发环境 # 塬微管理系统/开发环境
VUE_APP_BASE_API = 'http://106.13.201.219' VUE_APP_BASE_API = 'http://146.56.222.200/api/'
# VUE_APP_BASE_API = 'http://n3rpzt.natappfree.cc' # VUE_APP_BASE_API = 'http://n3rpzt.natappfree.cc'
# 开发环境IP # 开发环境IP
......
...@@ -2,15 +2,12 @@ import request from '@/utils/request' ...@@ -2,15 +2,12 @@ import request from '@/utils/request'
const service = window.CONFIG.services.wecom + '/chat' const service = window.CONFIG.services.wecom + '/chat'
/** /**
* * 侧边栏列表
* @param {*} params * @param {*} params
*/ */
export function getList(params) { export function getList() {
return request({ return request({
url: service + '/side/list', url: service + '/side/list',
params: {
h5: 0,
},
}) })
} }
......
...@@ -14,9 +14,16 @@ const getTree=(params)=>{ ...@@ -14,9 +14,16 @@ const getTree=(params)=>{
params, params,
}) })
} }
const chatGrounpList=(params)=>{
return request({
url:'/wecom/finance/getChatRoomContactList',
method: 'get',
params,
})
}
const listByCustomer=(params)=>{ const listByCustomer=(params)=>{
return request({ return request({
url:'/chat/mapping/listByCustomer', url:'/wecom/customer/list',
method: 'get', method: 'get',
params, params,
}) })
...@@ -33,5 +40,6 @@ const getTree=(params)=>{ ...@@ -33,5 +40,6 @@ const getTree=(params)=>{
getTree, getTree,
chatList, chatList,
listByCustomer, listByCustomer,
getChatAllList getChatAllList,
chatGrounpList
} }
\ No newline at end of file \ No newline at end of file
import request from '@/utils/request'
const service = window.CONFIG.services.wecom + '/sensitive'
/**
* 获取敏感词触发列表
* @param {*} params
*
*/
export function getSecurityList(params) {
return request({
url: service + '/hit/list',
method: 'get',
params,
})
}
/**
* 获取敏感词设置列表
* @param {*} params
*
*/
export function getSettingSensitiveList(params) {
return request({
url: service + '/list',
method: 'get',
params,
})
}
/**
* 添加敏感词设置
* @param {*} params
*
*/
export function addSettingSensitive(data) {
return request({
url: service,
method: 'post',
data: data
})
}
/**
* 修改敏感词设置
* @param {*} params
*
*/
export function modifySettingSensitive(data) {
return request({
url: service,
method: 'put',
data: data
})
}
/**
* 获取敏感词详情
* @param {*} params
*
*/
export function getSensitiveDetails(tableId) {
return request({
url: service + '/' + tableId,
method: 'get'
})
}
/**
* 删除敏感词
* @param {*} params
*
*/
export function deleteSensitive(tableId) {
return request({
url: service + '/' + tableId,
method: 'delete'
})
}
/**
* 获取敏感行为警告敏感记录列表
* @param {*} params
*
*/
export function getSensitiveRecord(params) {
return request({
url: service + '/act/hit/list',
method: 'get',
params,
})
}
/**
* 获取敏感行为管理列表
* @param {*} params
*
*/
export function getSensitiveManagement(params) {
return request({
url: service + '/act/list',
method: 'get',
params,
})
}
import request from "@/utils/request"; import request from '@/utils/request'
const service = window.CONFIG.services.wecom + "/customerMessagePush"; const service = window.CONFIG.services.wecom + '/customerMessagePush'
/** /**
* 新增企业id * 新增企业id
...@@ -35,10 +35,10 @@ const service = window.CONFIG.services.wecom + "/customerMessagePush"; ...@@ -35,10 +35,10 @@ const service = window.CONFIG.services.wecom + "/customerMessagePush";
*/ */
export function add(data) { export function add(data) {
return request({ return request({
url: service + "/add", url: service + '/add',
method: "post", method: 'post',
data data,
}); })
} }
/** /**
...@@ -53,9 +53,9 @@ endTime:结束时间} ...@@ -53,9 +53,9 @@ endTime:结束时间}
*/ */
export function getList(params) { export function getList(params) {
return request({ return request({
url: service + "/list", url: service + '/list',
params params,
}); })
} }
/** /**
...@@ -64,9 +64,9 @@ export function getList(params) { ...@@ -64,9 +64,9 @@ export function getList(params) {
*/ */
export function getDetail(messageId) { export function getDetail(messageId) {
return request({ return request({
url: service + "/getInfo", url: service + '/getInfo',
params: { messageId } params: { messageId },
}); })
} }
/** /**
...@@ -77,7 +77,21 @@ status:发送状态 0-未发送 1-已发送 2-因客户不是好友导致发送 ...@@ -77,7 +77,21 @@ status:发送状态 0-未发送 1-已发送 2-因客户不是好友导致发送
*/ */
export function getPushResult(params) { export function getPushResult(params) {
return request({ return request({
url: service + "/pushResults", url: service + '/pushResults',
params params,
}); })
}
/**
* 同步消息发送结果
* @param {*} data
* msgid:列表msgid
messageId:消息id
*/
export function syncMsg(data) {
return request({
url: service + '/asyncResult',
method: 'post',
data,
})
} }
<script> <script>
import { getTree, getList } from '@/api/material' import { getTree, getList } from "@/api/material";
export default { export default {
components: {}, components: {},
props: { props: {
type: { type: {
type: String, type: String,
default: '4', default: "4",
}, },
multiple: { multiple: {
type: Boolean, type: Boolean,
...@@ -23,82 +23,83 @@ export default { ...@@ -23,82 +23,83 @@ export default {
query: { query: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
categoryId: '', categoryId: "",
search: '', search: "",
mediaType: '4', mediaType: "4",
}, },
list: [], // 列表 list: [], // 列表
total: 0, // 总条数 total: 0, // 总条数
treeData: [], // 树 treeData: [], // 树
// 树props // 树props
treeProps: { treeProps: {
children: 'children', children: "children",
label: 'name', label: "name",
}, },
// 分组props // 分组props
groupProps: { groupProps: {
// expandTrigger: 'hover', // expandTrigger: 'hover',
checkStrictly: true, checkStrictly: true,
children: 'children', children: "children",
label: 'name', label: "name",
value: 'id', value: "id",
emitPath: false, emitPath: false,
}, },
radio: '', radio: "",
// 树props // 树props
treeProps: { treeProps: {
children: 'children', children: "children",
label: 'name', label: "name",
}, },
} selectedx: []
};
}, },
watch: { watch: {
radio(val) { radio(val) {
this.$emit('change', val) this.$emit("change", val);
}, },
}, },
computed: {}, computed: {},
created() { created() {
this.query.mediaType = this.type this.query.mediaType = this.type;
this.getTree() this.getTree();
this.getList() this.getList();
}, },
mounted() {}, mounted() {},
methods: { methods: {
// 获取类目树 // 获取类目树
getTree() { getTree() {
getTree(this.type).then(({ data }) => { getTree(this.type).then(({ data }) => {
this.treeData = data this.treeData = data;
}) });
}, },
// 获取素材列表 // 获取素材列表
getList(page) { getList(page) {
page && (this.query.pageNum = page) page && (this.query.pageNum = page);
this.loading = true this.loading = true;
getList(this.query) getList(this.query)
.then(({ rows, total }) => { .then(({ rows, total }) => {
this.list = rows this.list = rows;
this.total = +total this.total = +total;
this.loading = false this.loading = false;
this.$emit('listChange', this.list) this.$emit("listChange", this.list);
}) })
.catch(() => { .catch(() => {
this.loading = false this.loading = false;
}) });
}, },
// 节点单击事件 // 节点单击事件
handleNodeClick(data) { handleNodeClick(data) {
this.query.categoryId = data.id this.query.categoryId = data.id;
this.getList(1) this.getList(1);
}, },
// 多选框选中数据 // 多选框选中数据
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.$emit('update:selected', selection) this.$emit("update:selected", selection);
}, },
}, },
} };
</script> </script>
<template> <template>
...@@ -114,7 +115,7 @@ export default { ...@@ -114,7 +115,7 @@ export default {
<el-input <el-input
v-model="query.search" v-model="query.search"
class="ml10 mr10" class="ml10 mr10"
style="width: 150px;" style="width: 150px"
@keydown.enter="getList(1)" @keydown.enter="getList(1)"
></el-input> ></el-input>
<el-button <el-button
...@@ -200,9 +201,10 @@ export default { ...@@ -200,9 +201,10 @@ export default {
</el-table> </el-table>
<el-row v-else :gutter="20"> <el-row v-else :gutter="20">
<el-checkbox-group v-model="selectedx" @change="handleSelectionChange">
<el-col <el-col
:span="6" :span="6"
style="margin-bottom: 24px;min-width: 220px;" style="margin-bottom: 24px; min-width: 220px"
v-for="(item, index) in list" v-for="(item, index) in list"
:key="index" :key="index"
> >
...@@ -210,13 +212,14 @@ export default { ...@@ -210,13 +212,14 @@ export default {
<div class="img-wrap"> <div class="img-wrap">
<el-image :src="item.materialUrl" fit="contain"></el-image> <el-image :src="item.materialUrl" fit="contain"></el-image>
</div> </div>
<div style="padding: 14px;"> <div style="padding: 14px">
<el-checkbox v-model="ids" :label="item.id">{{ <el-checkbox :label="item">{{
item.materialName item.materialName
}}</el-checkbox> }}</el-checkbox>
</div> </div>
</el-card> </el-card>
</el-col> </el-col>
</el-checkbox-group>
</el-row> </el-row>
</el-col> </el-col>
</el-row> </el-row>
......
...@@ -33,6 +33,7 @@ export default { ...@@ -33,6 +33,7 @@ export default {
window.CONFIG.services.wecom + window.CONFIG.services.wecom +
'/material/upload', '/material/upload',
headers: window.CONFIG.headers, headers: window.CONFIG.headers,
domain: process.env.VUE_APP_BASE_API
} }
}, },
watch: {}, watch: {},
...@@ -131,7 +132,7 @@ export default { ...@@ -131,7 +132,7 @@ export default {
> >
<slot> <slot>
<template v-if="fileUrl"> <template v-if="fileUrl">
<img v-if="type === '0'" :src="fileUrl" class="upload-img" /> <img v-if="type === '0'" :src="domain + fileUrl" class="upload-img" />
<div v-else-if="type === '2'"> <div v-else-if="type === '2'">
<video <video
id="myVideo" id="myVideo"
...@@ -144,7 +145,7 @@ export default { ...@@ -144,7 +145,7 @@ export default {
:autoplay="false" :autoplay="false"
preload="auto" preload="auto"
> >
<source :src="fileUrl" type="video/mp4" /> <source :src="domain + fileUrl" type="video/mp4" />
</video> </video>
</div> </div>
<div v-else>{{ fileName }}</div> <div v-else>{{ fileName }}</div>
......
...@@ -60,7 +60,7 @@ export default { ...@@ -60,7 +60,7 @@ export default {
background: 'rgba(0, 0, 0, 0.7)', background: 'rgba(0, 0, 0, 0.7)',
}) })
this.metarialParams.materialIds = this.selectedMaterial.map((d) => d.id) this.metarialParams.materialIds = this.selectedMaterial.map((d) => d.id)
if (metarialParams.checkAll == 0) { if (this.metarialParams.checkAll == 0) {
this.metarialParams.materialIds = [] this.metarialParams.materialIds = []
} }
getMaterial(this.metarialParams) getMaterial(this.metarialParams)
...@@ -80,6 +80,7 @@ export default { ...@@ -80,6 +80,7 @@ export default {
update(data) update(data)
.then(() => { .then(() => {
this.msgSuccess('操作成功') this.msgSuccess('操作成功')
this.$set(data, 'isEdit', false)
this.loading = false this.loading = false
}) })
.catch(() => { .catch(() => {
...@@ -110,11 +111,31 @@ export default { ...@@ -110,11 +111,31 @@ export default {
{{ mediaType[scope.row.mediaType] }} {{ mediaType[scope.row.mediaType] }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="聊天工具栏名称" align="center" prop="sideName">
label="聊天工具栏名称" <template slot-scope="{ row }">
align="center" <el-input
prop="sideName" class="bfc-d"
/> style="width: 100px;"
v-if="row.isEdit"
v-model="row.sideName"
placeholder="请输入"
></el-input>
<span v-else>
{{ row.sideName }}
</span>
<i
v-if="!row.isEdit"
class="row-icon el-icon-edit"
@click="$set(row, 'isEdit', true)"
></i>
<i
v-else
class="row-icon el-icon-circle-check"
@click="update(row)"
></i>
</template>
</el-table-column>
<el-table-column label="已抓取素材数量" align="center" prop="total" /> <el-table-column label="已抓取素材数量" align="center" prop="total" />
<el-table-column <el-table-column
label="是否启用" label="是否启用"
...@@ -241,4 +262,22 @@ export default { ...@@ -241,4 +262,22 @@ export default {
width: 100%; width: 100%;
} }
} }
.el-table__row {
.el-icon-edit {
visibility: hidden;
}
&:hover {
.el-icon-edit {
visibility: visible;
}
}
}
.row-icon {
font-size: 14px;
// vertical-align: middle;
margin-left: 5px;
}
.el-icon-circle-check {
margin-top: 10px;
}
</style> </style>
...@@ -8,14 +8,13 @@ ...@@ -8,14 +8,13 @@
{{item.text.content}} {{item.text.content}}
</div> </div>
<div v-else-if="item.msgtype=='image'" class="msgtypeimg"> <div v-else-if="item.msgtype=='image'" class="msgtypeimg">
<img :src="item.image.attachment"> <img src="http://146.56.222.200/api/profile/upload/2021/01/14/544c8259-b3b6-4a49-8a53-b5eeac476384.png">
</div> </div>
<div v-else-if="item.msgtype=='file'" class="msgtypefile" @click="down(item.file)"> <div v-else-if="item.msgtype=='file'" class="msgtypefile" @click="down(item.file)">
{{item.file.filename}} {{item.file.filename}}
</div> </div>
<!-- <div v-else-if="item.msgtype=='link'&&item.text" class="msgtypelink">
{{item.text.content}}
</div>-->
<div v-else-if="item.msgtype=='voice'" class="msgtypevoice"> <div v-else-if="item.msgtype=='voice'" class="msgtypevoice">
<i class="el-icon-video-play" @click="play(item,'voice')"></i> <i class="el-icon-video-play" @click="play(item,'voice')"></i>
</div> </div>
...@@ -124,6 +123,8 @@ ...@@ -124,6 +123,8 @@
width: 100px; width: 100px;
height: 80px; height: 80px;
margin: 10px; margin: 10px;
img{width: 100px;
height: 80px;}
} }
.msgtypecard { .msgtypecard {
......
<template>
<div class="list" v-loading="loading">
<div v-if="personList.length>=1">
<ul>
<li v-for="(item,index) in personList" :key="index" @click="liClick(item)">
<el-row style="padding:10px">
<el-col :span="3"><img :src="item.receiveWeUser.avatarMediaid" ></el-col>
<el-col :span="21">
<p>{{item.receiveWeUser.name}} <span class="fr gray">{{parseTime(item.finalChatContext.msgtime)}}</span></p>
<p class="gray padt10" v-if="item.finalChatContext.text">{{item.finalChatContext.text.content}}</p>
</el-col>
</el-row>
</li>
</ul>
</div>
<div v-else></div>
</div>
</template>
<script>
import {parseTime} from '@/utils/common.js'
export default {
props: {
personList: {
type: Array,
defluat: () => []
},
loading: {
type: Boolean,
defluat: false
},
},
data() {
return{
loadings:true
}
},
methods:{
liClick(e){
this.$emit('chatFn',e)
}
}
}
</script>
<style lang="scss" scoped>
*{ padding: 0;
margin: 0;}
.list {
overflow-y:scroll;
height: 651px;
::-webkit-scrollbar {
display: none;
}
/deep/ .el-loading-spinner{margin-top: 20px;}
.fr{float:right;}
.gray{color: #999;}
.padt10{padding-top: 10px;}
ul li {
padding: 10px;
overflow: hidden;
border-bottom: 1px solid #efefef;
cursor: pointer;
p{white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;}
:hover{ background: #efefef;}
img {
width: 40px;
height: 40px;
float: left
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="list" v-loading="loading">
<div v-if="personList.length>=1">
<ul>
<li v-for="(item,index) in personList" :key="index" @click="liClick(item)">
<el-row style="padding:10px" v-if="item.finalChatContext.msgtype=='text'">
<el-col :span="3"> <img v-if="item.finalChatContext.fromInfo" :src="item.finalChatContext.fromInfo.avatar"></el-col>
<el-col :span="21">
<p>{{item.finalChatContext.roomInfo.name}} <span class="fr gray">{{parseTime(item.finalChatContext.fromInfo.updateTime)}}</span></p>
<p class="gray padt10" v-if="item.finalChatContext.fromInfo">{{item.finalChatContext.fromInfo.name}}:{{item.finalChatContext.text.content}}</p>
</el-col>
</el-row>
<el-row style="padding:10px" v-if="item.finalChatContext.msgtype=='file'">
<el-col :span="3">&nbsp; `</el-col>
<el-col :span="21">
<p><span class="fr gray">{{parseTime(item.finalChatContext.msgtime)}}</span></p>
<p class="gray padt10" >{{item.finalChatContext.from}}:
<span v-if="item.finalChatContext.file.fileext=='mp4'">[视频]</span>
</p>
</el-col>
</el-row>
</li>
</ul>
</div>
<div v-else></div>
</div>
</template>
<script>
import {parseTime} from '@/utils/common.js'
export default {
props: {
personList: {
type: Array,
defluat: () => []
},
loading: {
type: Boolean,
defluat: false
},
},
data() {
return{
loadings:true
}
},
methods:{
liClick(e){
this.$emit('groupFn',e)
}
}
}
</script>
<style lang="scss" scoped>
*{ padding: 0;
margin: 0;}
.list {
overflow-y:scroll;
height: 708px;
::-webkit-scrollbar {
display: none;
}
/deep/ .el-loading-spinner{margin-top: 20px;}
.fr{float:right;}
.gray{color: #999;}
.padt10{padding-top: 10px;}
ul li {
padding: 10px;
overflow: hidden;
border-bottom: 1px solid #efefef;
cursor: pointer;
p{white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;}
:hover{ background: #efefef;}
img {
width: 40px;
height: 40px;
float: left
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
<ul> <ul>
<li v-for="(item,index) in personList" :key="index" @click="liClick(item)"> <li v-for="(item,index) in personList" :key="index" @click="liClick(item)">
<el-row style="padding:10px"> <el-row style="padding:10px">
<el-col :span="4"> <img :src="item.receiveWeCustomer.avatar"></el-col> <el-col :span="3"> <img :src="item.receiveWeCustomer.avatar"></el-col>
<el-col :span="20"> <el-col :span="21">
<p>{{item.receiveWeCustomer.name}} <span class="fr gray">{{parseTime(item.finalChatContext.msgtime)}}</span></p> <p>{{item.receiveWeCustomer.name}} <span class="fr gray">{{parseTime(item.finalChatContext.msgtime)}}</span></p>
<p class="gray padt10" v-if="item.finalChatContext.text">{{item.finalChatContext.text.content}}</p> <p class="gray padt10" v-if="item.finalChatContext.text">{{item.finalChatContext.text.content}}</p>
</el-col> </el-col>
......
...@@ -32,7 +32,8 @@ ...@@ -32,7 +32,8 @@
</list> </list>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="群聊" name="2"> <el-tab-pane label="群聊" name="2">
<grouplist v-if="activeName==2" :personList="personList" :loading="loading" @groupFn='groupFn'>
</grouplist>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
...@@ -48,43 +49,37 @@ ...@@ -48,43 +49,37 @@
<el-tab-pane label="全部" name="0"> <el-tab-pane label="全部" name="0">
<div class="ct_box"> <div class="ct_box">
<div class="hds_time"> <div class="hds_time">
<el-date-picker v-model="takeTime" type="datetimerange" format='yyyy-MM-dd' <el-date-picker v-model="takeTime" type="datetimerange" format='yyyy-MM-dd' range-separator="至"
range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" start-placeholder="开始日期" end-placeholder="结束日期" align="right" @change="activeNameThreeClick">
align="right" @change="activeNameThreeClick">
</el-date-picker> </el-date-picker>
</div> </div>
<chat :allChat="allChat" v-if="allChat.length>=1"></chat> <chat :allChat="allChat" v-if="allChat.length>=1"></chat>
<el-pagination background v-if="allChat.length>=1" layout="prev, pager, next" <el-pagination background v-if="allChat.length>=1" layout="prev, pager, next" class="pagination"
class="pagination" :current-page="currentPage" @current-change="currentChange" :current-page="currentPage" @current-change="currentChange" :total="total">
:total="total">
</el-pagination> </el-pagination>
</div> </div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="图片及视频" name="1"> <el-tab-pane label="图片及视频" name="1">
<div class="ct_box"> <div class="ct_box">
<div class="hds_time"> <div class="hds_time">
<el-date-picker v-model="takeTime" type="datetimerange" format='yyyy-MM-dd' <el-date-picker v-model="takeTime" type="datetimerange" format='yyyy-MM-dd' range-separator="至"
range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" start-placeholder="开始日期" end-placeholder="结束日期" align="right" @change="activeNameThreeClick">
align="right" @change="activeNameThreeClick">
</el-date-picker> </el-date-picker>
</div> </div>
<chat :allChat="allChatImg" v-if="allChatImg.length>=1"></chat> <chat :allChat="allChatImg" v-if="allChatImg.length>=1"></chat>
<el-pagination background v-if="allChatImg.length>=1" class="pagination" <el-pagination background v-if="allChatImg.length>=1" class="pagination" layout="prev, pager, next"
layout="prev, pager, next" :total="total" @current-change="currentChange" :total="total" @current-change="currentChange" :current-page="currentPage">
:current-page="currentPage">
</el-pagination> </el-pagination>
</div> </div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="文件" name="2"> <el-tab-pane label="文件" name="2">
<div class="ct_box"> <div class="ct_box">
<div class="hds_time"> <div class="hds_time">
<el-date-picker v-model="takeTime" type="datetimerange" format='yyyy-MM-dd' <el-date-picker v-model="takeTime" type="datetimerange" format='yyyy-MM-dd' range-separator="至"
range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" start-placeholder="开始日期" end-placeholder="结束日期" align="right" @change="activeNameThreeClick">
align="right" @change="activeNameThreeClick">
</el-date-picker> </el-date-picker>
</div> </div>
<el-table :data="allFile" stripe style="width: 100%" <el-table :data="allFile" stripe style="width: 100%" :header-cell-style="{background:'#fff'}">
:header-cell-style="{background:'#fff'}">
<el-table-column prop="msgtype" label="类型"> <el-table-column prop="msgtype" label="类型">
</el-table-column> </el-table-column>
<el-table-column label="名称"> <el-table-column label="名称">
...@@ -114,9 +109,8 @@ ...@@ -114,9 +109,8 @@
<el-tab-pane label="链接" name="3"> <el-tab-pane label="链接" name="3">
<div class="ct_box"> <div class="ct_box">
<div class="hds_time"> <div class="hds_time">
<el-date-picker v-model="takeTime" type="datetimerange" format='yyyy-MM-dd' <el-date-picker v-model="takeTime" type="datetimerange" format='yyyy-MM-dd' range-separator="至"
range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" start-placeholder="开始日期" end-placeholder="结束日期" align="right" @change="activeNameThreeClick">
align="right" @change="activeNameThreeClick">
</el-date-picker> </el-date-picker>
</div> </div>
</div> </div>
...@@ -124,13 +118,11 @@ ...@@ -124,13 +118,11 @@
<el-tab-pane label="语音通话" name="4"> <el-tab-pane label="语音通话" name="4">
<div class="ct_box"> <div class="ct_box">
<div class="hds_time"> <div class="hds_time">
<el-date-picker v-model="takeTime" type="datetimerange" format='yyyy-MM-dd' <el-date-picker v-model="takeTime" type="datetimerange" format='yyyy-MM-dd' range-separator="至"
range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" start-placeholder="开始日期" end-placeholder="结束日期" align="right" @change="activeNameThreeClick">
align="right" @change="activeNameThreeClick">
</el-date-picker> </el-date-picker>
</div> </div>
<el-table :data="fileData" stripe style="width: 100%" <el-table :data="fileData" stripe style="width: 100%" :header-cell-style="{background:'#fff'}">
:header-cell-style="{background:'#fff'}">
<el-table-column prop="date" label="发起人"> <el-table-column prop="date" label="发起人">
</el-table-column> </el-table-column>
<el-table-column prop="name" label="通话时间"> <el-table-column prop="name" label="通话时间">
...@@ -151,6 +143,7 @@ ...@@ -151,6 +143,7 @@
<script> <script>
import list from '../component/list.vue' import list from '../component/list.vue'
import chat from '../component/chat.vue' import chat from '../component/chat.vue'
import grouplist from '../component/groupList.vue'
import * as api from '@/api/organization' import * as api from '@/api/organization'
import { import {
content content
...@@ -161,6 +154,7 @@ ...@@ -161,6 +154,7 @@
export default { export default {
components: { components: {
list, list,
grouplist,
chat chat
}, },
data() { data() {
...@@ -214,9 +208,12 @@ ...@@ -214,9 +208,12 @@
}, },
currentChange(e) { currentChange(e) {
this.currentPage = e this.currentPage = e
if (this.activeName == '2') {
return this.activeNameThreeClick(true, true)
}
this.activeNameThreeClick(true) this.activeNameThreeClick(true)
}, },
activeNameThreeClick(page) { activeNameThreeClick(page, group) {
if (!!!page) { if (!!!page) {
this.currentPage = 1 this.currentPage = 1
} }
...@@ -233,18 +230,34 @@ ...@@ -233,18 +230,34 @@
} else if (this.activeNameThree == 4) { } else if (this.activeNameThree == 4) {
msgType = 'voice' msgType = 'voice'
} }
let query = { let query = {
fromId: this.employId, fromId: this.employId,
receiveId: this.chat.receiveId,
msgType, msgType,
pageSize: '10', pageSize: '10',
pageNum: this.currentPage, pageNum: this.currentPage,
beginTime: this.takeTime ? yearMouthDay(this.takeTime[0]) : "", beginTime: this.takeTime ? yearMouthDay(this.takeTime[0]) : "",
endTime: this.takeTime ? yearMouthDay(this.takeTime[1]) : '', endTime: this.takeTime ? yearMouthDay(this.takeTime[1]) : '',
} }
if (group) {
query.roomId = this.chat.roomId
} else {
query.receiveId = this.chat.receiveId
}
if (group) {
content.chatGrounpList(query).then(res => {
this.total = Number(res.total)
this.resortData(res)
})
} else {
content.chatList(query).then(res => { content.chatList(query).then(res => {
this.total = Number(res.total) this.total = Number(res.total)
this.resortData(res)
})
}
}
},
resortData(res){
if (this.activeNameThree == 0) { if (this.activeNameThree == 0) {
return this.allChat = res.rows return this.allChat = res.rows
} }
...@@ -260,8 +273,6 @@ ...@@ -260,8 +273,6 @@
if (this.activeNameThree == 4) { if (this.activeNameThree == 4) {
return this.allVoice = res.rows return this.allVoice = res.rows
} }
})
}
}, },
chatFn(data) { chatFn(data) {
this.chat = data; this.chat = data;
...@@ -269,6 +280,11 @@ ...@@ -269,6 +280,11 @@
this.activeNameThreeClick() this.activeNameThreeClick()
} }
}, },
groupFn(data) {
this.chat = data;
this.chat.receiveWeCustomer = 'a'
this.activeNameThreeClick('', true)
},
getTree() { getTree() {
api.getTree().then(({ api.getTree().then(({
data data
...@@ -332,6 +348,7 @@ ...@@ -332,6 +348,7 @@
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
* { * {
...@@ -401,6 +418,7 @@ ...@@ -401,6 +418,7 @@
border-bottom: 1px solid #efefef; border-bottom: 1px solid #efefef;
color: #999; color: #999;
text-align: center; text-align: center;
::-webkit-scrollbar { ::-webkit-scrollbar {
display: none; display: none;
} }
...@@ -413,10 +431,12 @@ ...@@ -413,10 +431,12 @@
} }
} }
.pagination { .pagination {
padding: 10px 0; padding: 10px 0;
height: 30px; height: 30px;
float: left; float: left;
} }
</style> </style>
...@@ -11,14 +11,10 @@ ...@@ -11,14 +11,10 @@
</div> </div>
<div class="ct_box ct_boxFirst"> <div class="ct_box ct_boxFirst">
<ul> <ul>
<!-- -->
<li v-for="(i,t) in CList" :key="t" @click="personCheck(i,t)" :class="{'liActive':t==personIndex}"> <li v-for="(i,t) in CList" :key="t" @click="personCheck(i,t)" :class="{'liActive':t==personIndex}">
<el-row :gutter="20" style=" padding: 10px 0;margin:0"> <el-row :gutter="20" style=" padding: 10px 0;margin:0">
<el-col :span="4"> <el-col :span="4">
<img <img v-if="i.avatar" :src="i.avatar" alt="头像">
v-if="i.avatar"
:src="i.avatar"
alt="头像">
</el-col> </el-col>
<el-col :span="16" v-if="i"><span style="line-height:40px">{{i.name}}</span></el-col> <el-col :span="16" v-if="i"><span style="line-height:40px">{{i.name}}</span></el-col>
</el-row> </el-row>
...@@ -34,27 +30,26 @@ ...@@ -34,27 +30,26 @@
</el-input> </el-input>
</div> </div>
</div> </div>
<div class="hd_tabs"> <div class="hd_tabs">
<el-tabs v-model="activeName"> <el-tabs v-model="activeName" @tab-click="getChatList()">
<el-tab-pane label="单聊" name="0"> <el-tab-pane label="单聊" name="0">
<div class="hd_tabs_content"> <div class="hd_tabs_content">
<!-- <list v-if="activeName==0" :personList="personList" :loading="loading" > <list v-if="activeName==0" :personList="personList" :loading="loading" @chatFn="chatFn">
</list> --> </list>
</div> </div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="群聊" name="2"> <el-tab-pane label="群聊" name="2">
<list v-if="activeName==2" :personList="personList" :loading="loading" @chatFn="chatFn"> <grouplist v-if="activeName==2" :personList="personList" :loading="loading" @groupFn='groupFn'>
</list> </grouplist>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<div class="hd_box"> <div class="hd_box">
<div class="hd_name"><span v-if="chatData&&chatData.finalChatContext">与{{chatData.finalChatContext.roomInfo.name}} 的聊天</span> <div class="hd_name">
<!-- <span
v-if="chatData&&chatData.finalChatContext">与{{chatData.finalChatContext.fromInfo.name}} 的聊天</span> -->
<span class="fr hd_nameRi">下载会话</span></div> <span class="fr hd_nameRi">下载会话</span></div>
</div> </div>
<div class=" hd_tabthree"> <div class=" hd_tabthree">
...@@ -62,43 +57,37 @@ ...@@ -62,43 +57,37 @@
<el-tab-pane label="全部" name="0"> <el-tab-pane label="全部" name="0">
<div class="ct_box"> <div class="ct_box">
<div class="hds_time"> <div class="hds_time">
<el-date-picker v-model="takeTime" type="datetimerange" format='yyyy-MM-dd' <el-date-picker v-model="takeTime" type="datetimerange" format='yyyy-MM-dd' range-separator="至"
range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" start-placeholder="开始日期" end-placeholder="结束日期" align="right" @change="activeNameThreeClick">
align="right" @change="activeNameThreeClick">
</el-date-picker> </el-date-picker>
</div> </div>~
<chat :allChat="allChat" v-if="allChat.length>=1"></chat> <chats :allChat="allChat" v-if="allChat.length>=1"></chats>
<el-pagination background v-if="allChat.length>=1" layout="prev, pager, next" <el-pagination background v-if="allChat.length>=1" layout="prev, pager, next" class="pagination"
class="pagination" :current-page="currentPage" @current-change="currentChange" :current-page="currentPage" @current-change="currentChange" :total="total">
:total="total">
</el-pagination> </el-pagination>
</div> </div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="图片及视频" name="1"> <el-tab-pane label="图片及视频" name="1">
<div class="ct_box"> <div class="ct_box">
<div class="hds_time"> <div class="hds_time">
<el-date-picker v-model="takeTime" type="datetimerange" format='yyyy-MM-dd' <el-date-picker v-model="takeTime" type="datetimerange" format='yyyy-MM-dd' range-separator="至"
range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" start-placeholder="开始日期" end-placeholder="结束日期" align="right" @change="activeNameThreeClick">
align="right" @change="activeNameThreeClick">
</el-date-picker> </el-date-picker>
</div> </div>
<chat :allChat="allChatImg" v-if="allChatImg.length>=1"></chat> <!-- <chat :allChat="allChatImg" v-if="allChatImg.length>=1"></chat> -->
<el-pagination background v-if="allChatImg.length>=1" class="pagination" <el-pagination background v-if="allChatImg.length>=1" class="pagination" layout="prev, pager, next"
layout="prev, pager, next" :total="total" @current-change="currentChange" :total="total" @current-change="currentChange" :current-page="currentPage">
:current-page="currentPage">
</el-pagination> </el-pagination>
</div> </div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="文件" name="2"> <el-tab-pane label="文件" name="2">
<div class="ct_box"> <div class="ct_box">
<div class="hds_time"> <div class="hds_time">
<el-date-picker v-model="takeTime" type="datetimerange" format='yyyy-MM-dd' <el-date-picker v-model="takeTime" type="datetimerange" format='yyyy-MM-dd' range-separator="至"
range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" start-placeholder="开始日期" end-placeholder="结束日期" align="right" @change="activeNameThreeClick">
align="right" @change="activeNameThreeClick">
</el-date-picker> </el-date-picker>
</div> </div>
<el-table :data="allFile" stripe style="width: 100%" <el-table :data="allFile" stripe style="width: 100%" :header-cell-style="{background:'#fff'}">
:header-cell-style="{background:'#fff'}">
<el-table-column prop="msgtype" label="类型"> <el-table-column prop="msgtype" label="类型">
</el-table-column> </el-table-column>
<el-table-column label="名称"> <el-table-column label="名称">
...@@ -128,9 +117,8 @@ ...@@ -128,9 +117,8 @@
<el-tab-pane label="链接" name="3"> <el-tab-pane label="链接" name="3">
<div class="ct_box"> <div class="ct_box">
<div class="hds_time"> <div class="hds_time">
<el-date-picker v-model="takeTime" type="datetimerange" format='yyyy-MM-dd' <el-date-picker v-model="takeTime" type="datetimerange" format='yyyy-MM-dd' range-separator="至"
range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" start-placeholder="开始日期" end-placeholder="结束日期" align="right" @change="activeNameThreeClick">
align="right" @change="activeNameThreeClick">
</el-date-picker> </el-date-picker>
</div> </div>
</div> </div>
...@@ -138,13 +126,11 @@ ...@@ -138,13 +126,11 @@
<el-tab-pane label="语音通话" name="4"> <el-tab-pane label="语音通话" name="4">
<div class="ct_box"> <div class="ct_box">
<div class="hds_time"> <div class="hds_time">
<el-date-picker v-model="takeTime" type="datetimerange" format='yyyy-MM-dd' <el-date-picker v-model="takeTime" type="datetimerange" format='yyyy-MM-dd' range-separator="至"
range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" start-placeholder="开始日期" end-placeholder="结束日期" align="right" @change="activeNameThreeClick">
align="right" @change="activeNameThreeClick">
</el-date-picker> </el-date-picker>
</div> </div>
<el-table :data="fileData" stripe style="width: 100%" <el-table :data="fileData" stripe style="width: 100%" :header-cell-style="{background:'#fff'}">
:header-cell-style="{background:'#fff'}">
<el-table-column prop="date" label="发起人"> <el-table-column prop="date" label="发起人">
</el-table-column> </el-table-column>
<el-table-column prop="name" label="通话时间"> <el-table-column prop="name" label="通话时间">
...@@ -164,17 +150,21 @@ ...@@ -164,17 +150,21 @@
</div> </div>
</template> </template>
<script> <script>
import list from '../component/curList.vue' import list from '../component/customerList.vue'
import chat from '../component/chat.vue' import chats from '../component/chat.vue'
import {
import grouplist from '../component/groupList.vue'
import {
content content
} from '@/api/content.js' } from '@/api/content.js'
import { import {
yearMouthDay yearMouthDay
} from '@/utils/common.js' } from '@/utils/common.js'
export default { export default {
components:{ components: {
list,chat list,
chats,
grouplist
}, },
data() { data() {
return { return {
...@@ -182,66 +172,72 @@ import { ...@@ -182,66 +172,72 @@ import {
employName: '', employName: '',
talkName: '', talkName: '',
personIndex: '-1', personIndex: '-1',
activeName: "2", activeName: "0",
activeNameThree: '0', activeNameThree: '0',
takeTime: '', takeTime: '',
fileData: [], fileData: [],
CList:[], CList: [],
personList:[], personList: [],
loading:false, loading: false,
employId:'', employId: '',
chatData:{}, chatData: {},
allChat:[], allChat: [],
allChatImg:[], allChatImg: [],
allFile:[], allFile: [],
allLInk:[], allLInk: [],
allVoice:[], allVoice: [],
//分页 //分页
currentPage:1, currentPage: 1,
total:0 total: 0
}; };
}, },
methods: { methods: {
chatFn(data){ chatFn(data) {
this.chatData=data this.chatData = data
if (data.fromId) { console.log(data)
this.activeNameThreeClick() this.activeNameThreeClick()
}
}, },
currentChange(){ groupFn(data){
this.chatData = data;
this.activeNameThreeClick('', true)
},
currentChange() {
this.currentPage = e this.currentPage = e
if (this.activeName == '2') {
return this.activeNameThreeClick(true, true)
}
this.activeNameThreeClick(true) this.activeNameThreeClick(true)
}, },
personCheck(data, e) { personCheck(data, e) {
this.personIndex = e this.personIndex = e
this.talkName = data.name; this.talkName = data.name;
this.employId=data.externalUserid this.employId = data.externalUserid
this.getChatList() this.getChatList()
}, },
getChatList(flag){ getChatList(flag) {
if (!this.employId) { if (!this.employId) {
return return
} }
if (flag) { if (flag) {
this.loading = true this.loading = true
} }
this.personList = []
content.getTree({ content.getTree({
fromId: this.employId, fromId: this.employId,
searchType: this.activeName searchType: this.activeName
}).then(({ }).then(({
rows rows
}) => { }) => {
console.log(rows)
this.loading = false this.loading = false
this.personList = rows this.personList = rows
}).catch(err => { }).catch(err => {
this.loading = false this.loading = false
}) })
}, },
activeNameThreeClick(page){ activeNameThreeClick(page,group) {
if (!!!page) { if (!!!page) {
this.currentPage = 1 this.currentPage = 1
} }
...@@ -257,18 +253,33 @@ import { ...@@ -257,18 +253,33 @@ import {
} else if (this.activeNameThree == 4) { } else if (this.activeNameThree == 4) {
msgType = 'voice' msgType = 'voice'
} }
let query = { let query = {
fromId: this.chatData.fromId, fromId: this.chatData.fromId,
receiveId: this.chatData.roomId,
msgType, msgType,
pageSize: '10', pageSize: '10',
pageNum: this.currentPage, pageNum: this.currentPage,
beginTime: this.takeTime ? yearMouthDay(this.takeTime[0]) : "", beginTime: this.takeTime ? yearMouthDay(this.takeTime[0]) : "",
endTime: this.takeTime ? yearMouthDay(this.takeTime[1]) : '', endTime: this.takeTime ? yearMouthDay(this.takeTime[1]) : '',
} }
if (group) {
query.roomId = this.chatData.roomId
} else {
query.receiveId = this.chatData.receiveId
}
if (group) {
content.chatGrounpList(query).then(res => {
this.total = Number(res.total)
this.resortData(res)
})
} else {
content.chatList(query).then(res => { content.chatList(query).then(res => {
this.total = Number(res.total) this.total = Number(res.total)
console.log(res,'chatData') this.resortData(res)
})
}
},
resortData(res){
if (this.activeNameThree == 0) { if (this.activeNameThree == 0) {
return this.allChat = res.rows return this.allChat = res.rows
} }
...@@ -284,27 +295,45 @@ import { ...@@ -284,27 +295,45 @@ import {
if (this.activeNameThree == 4) { if (this.activeNameThree == 4) {
return this.allVoice = res.rows return this.allVoice = res.rows
} }
})
}, },
customerList(){ customerList() {
content.listByCustomer().then(res=>{ let querys = {
res.rows= res.rows.filter((a,b)=>{ return a&&a.name}) pageNum: 1,
this.CList=res.rows pageSize: 999,
this.employAmount=res.total; name: this.employName,
userId: '',
tagIds: '',
beginTime: '',
endTime: '',
status: '',
isOpenChat: '1'
}
content.listByCustomer(querys).then(res => {
console.log(res)
res.rows = res.rows.filter((a, b) => {
return a && a.name
})
this.CList = res.rows
this.employAmount = res.total;
}) })
} }
}, },
mounted(){ mounted() {
this.customerList() this.customerList()
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
/deep/.el-tabs__nav-scroll { /deep/.el-tabs__nav-scroll {
padding-left: 15px; padding-left: 15px;
} }
.fr{float:right;}
.fr {
float: right;
}
.borderR { .borderR {
border-right: 2px solid #ccc; border-right: 2px solid #ccc;
} }
...@@ -335,7 +364,13 @@ import { ...@@ -335,7 +364,13 @@ import {
font-size: 18px; font-size: 18px;
min-height: 20px; min-height: 20px;
} }
.hd_tabs_content{ width: 100%;min-height: 653px;border-bottom: 1px solid #efefef; }
.hd_tabs_content {
width: 100%;
min-height: 653px;
border-bottom: 1px solid #efefef;
}
.hd_nameRi { .hd_nameRi {
color: #199ed8; color: #199ed8;
text-align: right; text-align: right;
...@@ -370,7 +405,11 @@ import { ...@@ -370,7 +405,11 @@ import {
text-align: left; text-align: left;
cursor: pointer; cursor: pointer;
border-bottom: 1px solid #efefef; border-bottom: 1px solid #efefef;
:hover{ background: #efefef;}
:hover {
background: #efefef;
}
img { img {
width: 40px; width: 40px;
} }
...@@ -391,9 +430,11 @@ import { ...@@ -391,9 +430,11 @@ import {
} }
} }
.pagination { .pagination {
padding: 10px 0; padding: 10px 0;
height: 30px; height: 30px;
float: left; float: left;
} }
</style> </style>
<template>
<div class="security">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="敏感词触发" name="1">
<sensitive-list />
</el-tab-pane>
<el-tab-pane label="敏感词设置" name="2">
<set-sensitive-word />
</el-tab-pane>
<el-tab-pane label="敏感行为警告" name="3">
<alarming-sensitive />
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import alarmingSensitive from './securityPage/alarmingSensitive.vue'
import sensitiveList from './securityPage/sensitiveList.vue'
import setSensitiveWord from './securityPage/setSensitiveWord'
export default {
components:{
sensitiveList,
setSensitiveWord,
alarmingSensitive
},
data() {
return {
activeName: '1',
}
},
methods: {
handleClick(tab, event) {
console.log(tab, event);
}
}
}
</script>
<!-- 敏感行为警告页面 -->
<template>
<div class="alarming">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="敏感记录" name="1">
<el-table :data="recordSensitive" stripe style="width: 100%"
:header-cell-style="{background:'#fff'}">
<el-table-column prop="operator" label="操作员工">
</el-table-column>
<el-table-column prop="operateTarget" label="操作对象">
</el-table-column>
<el-table-column prop="sensitiveAct" label="敏感行为">
</el-table-column>
<el-table-column prop="updateTime" label="操作时间">
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="recordPageTotal"
:page.sync="recordPageConfig.pageNum"
:limit.sync="recordPageConfig.pageSize"
@pagination="getSensiveRecordList()"
/>
</el-tab-pane>
<el-tab-pane label="敏感行为管理" name="2">
<el-table :data="tabData" stripe style="width: 100%"
:header-cell-style="{background:'#fff'}">
<el-table-column prop="actName" label="敏感操作">
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-switch v-model="scope.row.enableFlag" :active-value="1" :inactive-value="2" @change="handleStatusChange(scope.row)"></el-switch>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="query.pageNum"
:limit.sync="query.pageSize"
@pagination="getSensitiveManagementList()"
/>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import * as sensitiveApis from '@/api/conversation/security'
export default {
data() {
return {
activeName: '1',
recordSensitive: [],
tabData: [],
total: 0,
query: {
pageNum: 1,
pageSize: 10
},
recordPageTotal: 0,
recordPageConfig: {
pageNum: 1,
pageSize: 10
}
}
},
mounted() {
this.getSensiveRecordList()
this.getSensitiveManagementList()
},
methods: {
getSensiveRecordList() {
sensitiveApis.getSensitiveRecord(this.recordPageConfig).then(res => {
if (res.code === 200) {
this.recordSensitive = res.rows
this.recordPageTotal = Number(res.total)
}
})
},
getSensitiveManagementList() {
sensitiveApis.getSensitiveManagement(this.query).then(res => {
if (res.code === 200) {
this.tabData = res.rows
this.total = Number(res.total)
}
})
},
handleStatusChange(e) {
console.log(e)
},
handleClick(tab, event) {
console.log(tab, event)
}
}
}
</script>
\ No newline at end of file \ No newline at end of file
<!-- 敏感词触发页面 -->
<template>
<div>
<el-form :inline="true" :model="form" class="demo-form-inline">
<el-form-item label="添加人">
<div class="tag-input" @click="dialogVisibleSelectUser = true">
<span class="tag-place" v-if="!queryUser.length">请选择</span>
<template v-else>
<el-tag
type="info"
v-for="(unit, unique) in queryUser"
:key="unique"
>{{ unit.name }}</el-tag
>
</template>
</div>
</el-form-item>
<el-form-item>
<el-input v-model="form.keyword" placeholder="搜索关键词" style="width:300px">
<el-button slot="prepend" icon="el-icon-search"></el-button>
</el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="getSensitiveList">查询</el-button>
</el-form-item>
</el-form>
<div class="search-content">
<el-row>
<el-col :span="8">
<div class="left-title">触发记录</div>
</el-col>
<el-col :span="16" style="text-align: right;">
<el-radio-group v-model="selectDate" size="small">
<el-radio-button label="昨日"></el-radio-button>
<el-radio-button label="7日"></el-radio-button>
<el-radio-button label="30日"></el-radio-button>
</el-radio-group>
<el-date-picker
v-model="dateRangeValue"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
class="date-range">
</el-date-picker>
</el-col>
</el-row>
</div>
<el-table :data="tableData" stripe style="width: 100%"
:header-cell-style="{background:'#fff'}">
<el-table-column prop="pattern_words" label="敏感词">
</el-table-column>
<el-table-column prop="content" label="内容">
</el-table-column>
<el-table-column prop="from" label="触发者">
</el-table-column>
<el-table-column prop="status" label="消息状态">
<template slot="header" >
{{floorRange}}
<el-select size="mini" v-model="floorRange" class="noborder" @change="chechName(floorRange)">
<el-option v-for="item in displayOptions" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column prop="msgtime" label="发送时间">
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="query.pageNum"
:limit.sync="query.pageSize"
@pagination="getSensitiveList()"
/>
<!-- 选择添加人弹窗 -->
<SelectUser
:visible.sync="dialogVisibleSelectUser"
title="选择添加人"
:isSigleSelect="true"
@success="selectedUser"
></SelectUser>
</div>
</template>
<script>
import * as sensitiveApis from '@/api/conversation/security'
import SelectUser from "@/components/SelectUser"
export default {
components: {
SelectUser
},
data() {
return {
form: {
pageSize: 10,
pageNum: 1,
scopeType: '',
auditScopeId: '',
keyword: '' // 关键词
},
selectDate: '',
dateRangeValue: '', // 时间选择
tableData: [],
queryUser: [], // 搜索框选择的添加人
query: {
pageNum: 1,
pageSize: 10
},
total: 0,
dialogVisibleSelectUser: false, // 选择添加人弹窗显隐
floorRange:'全部',
displayOptions: [{
value: "0",
label: "全部"
},
{
value: "1",
label: "已发送"
},
{
value: "2",
label: "已撤回"
},
{
value: "3",
label: "已删除"
}
]
}
},
methods: {
getSensitiveList() {
if (this.queryUser.length > 0) {
this.form.pageSize = this.query.pageSize
this.form.pageNum = this.query.pageNum
sensitiveApis.getSecurityList(this.form).then(res => {
if (res.code === 200) {
this.tableData = res.rows
this.total = Number(res.total)
}
})
} else {
this.$message.warning('请选择人员!')
}
},
chechName(e) {
if (e == 0) {
this.floorRange = '全部'
} else if (e == 1) {
this.floorRange = '已发送'
} else if (e == 2) {
this.floorRange = '已撤回'
} else {
this.floorRange = '切回企业日志'
}
},
selectedUser(list) {
// console.log(list)
this.queryUser = list
this.form.scopeType = list.map(d => d.department) + ""
this.form.auditScopeId = list.map(d => d.userId) + ""
this.getSensitiveList()
}
}
}
</script>
<style lang="scss" scoped>
.demo-form-inline {
background: #efefef;
padding: 18px 10px 0 10px;
}
.tag-input {
width: 240px;
display: flex;
border-radius: 4px;
border: 1px solid #dcdfe6;
align-items: center;
padding: 0 15px;
overflow: hidden;
height: 32px;
background: #fff;
.tag-place {
color: #bbb;
font-size: 14px;
}
}
.search-content {
height: 40px;
margin-top: 15px;
padding: 10px;
.left-title {
height: 40px;
line-height: 40px;
}
.date-range {
margin-left: 10px;
width: 300px;
}
}
.noborder {
/deep/ .el-input--mini .el-input__inner{
width: 2px;
border: none;
}
}
.content {
margin-top: 15px;
padding: 10px;
}
</style>
\ No newline at end of file \ No newline at end of file
<!-- 敏感词设置页面 -->
<template>
<div class="add-sensitive-word">
<el-form :inline="true" :model="form" class="demo-form-inline">
<el-button type="primary" class="add-btn" icon="el-icon-plus" @click="addSensitive">添加敏感词</el-button>
<el-form-item>
<el-input v-model="form.patternWords" placeholder="搜索关键词" style="width:300px">
<el-button slot="prepend" icon="el-icon-search" @click="getSettingList"></el-button>
</el-input>
</el-form-item>
</el-form>
<el-table :data="tableData" stripe style="width: 100%" :header-cell-style="{background:'#fff'}">
<el-table-column prop="strategyName" label="策略名称">
</el-table-column>
<el-table-column prop="patternWords" label="匹配词">
</el-table-column>
<el-table-column prop="auditScopeName" label="审计范围">
<template slot-scope="scope">
<el-tag size="medium">{{ scope.row.auditUserScope[0].auditScopeName }}</el-tag>
</template>
</el-table-column>
<el-table-column prop="auditUserName" label="审计人">
</el-table-column>
<el-table-column label="消息通知">
<template slot-scope="scope">
<el-switch v-model="scope.row.alertFlag" :active-value="1" :inactive-value="0" @change="handleStatusChange(scope.row)"></el-switch>
</template>
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="query.pageNum"
:limit.sync="query.pageSize"
@pagination="getSettingList()"
/>
<!-- 添加敏感词 -->
<el-dialog title="添加敏感词" :visible.sync="open" width="600px" append-to-body>
<el-form ref="addForm" :model="addForm" :rules="rules" label-width="130px">
<el-form-item label="敏感词策略名称" prop="strategyName">
<el-input v-model="addForm.strategyName" placeholder="例:红包" />
</el-form-item>
<el-form-item label="匹配词" prop="patternWords">
<el-input v-model="addForm.patternWords" placeholder="例:红包,hongbao,hb" />
<div class="sub-title">匹配词间用逗号隔开</div>
</el-form-item>
<el-form-item label="审计范围" :required="true" :error="rangeErrorMsg">
<div class="tag-input" @click="openAuditUserRange">
<span class="tag-place" v-if="!auditUserRange.length">请选择<span class="prompt-title">若不选择,则默认全体成员</span></span>
<template v-else>
<el-tag
type="info"
v-for="(unit, unique) in auditUserRange"
:key="unique"
>{{ unit.name }}</el-tag
>
</template>
</div>
</el-form-item>
<el-form-item label="审计人" :required="true" :error="errorMsg">
<div class="tag-input" @click="openAuditUser">
<span class="tag-place" v-if="!auditUser.length">请选择<span class="prompt-title">请选择部门负责人</span></span>
<template v-else>
<el-tag
type="info"
v-for="(unit, unique) in auditUser"
:key="unique"
>{{ unit.name }}</el-tag
>
</template>
</div>
</el-form-item>
<el-form-item label="消息通知">
<el-switch v-model="alertFlag" :active-value="1" :inactive-value="0"></el-switch>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="addSensitiveForm">确 定</el-button>
<el-button @click="open=false">取 消</el-button>
</div>
</el-dialog>
<!-- 选择审计范围弹窗 -->
<SelectUser
:visible.sync="dialogVisibleSelectUser"
title="选择添加人"
:isSigleSelect="true"
@success="selectedUser"
></SelectUser>
<!-- 选择审计人弹窗 -->
<SelectUser
:visible.sync="dialogVisibleSelectAuditUser"
title="选择添加人"
:isSigleSelect="true"
@success="selectedAuditUser"
></SelectUser>
</div>
</template>
<script>
import * as sensitiveApis from '@/api/conversation/security'
import SelectUser from "@/components/SelectUser"
export default {
components: {
SelectUser
},
data() {
return {
form: {
pageSize: 10,
pageNum: 1,
patternWords: '' // 关键词
},
addForm: {
strategyName: '', // 策略名称
patternWords: '' // 匹配词
},
alertFlag: 0, // 消息通知
tableData: [], // 敏感词列表
errorMsg: '', // 审计人错误提示
rangeErrorMsg: '', // 审计范围错误提示
query: {
pageNum: 1,
pageSize: 10
},
auditUserRange: [], // 审计范围
auditUser: [], // 审计人
total: 0,
dialogVisibleSelectUser: false, // 是否显示审计范围
dialogVisibleSelectAuditUser: false, // 是否显示审计人
open: false, // 是否显示添加敏感词弹框
submitFlag: '', // 添加或者修改
rowId: '', // 修改的数据id
rules: {
strategyName: [
{ required: true, message: "敏感词策略不能为空", trigger: "blur" }
],
patternWords: [
{ required: true, message: "匹配词不能为空", trigger: "blur" }
]
}
}
},
mounted() {
this.getSettingList()
},
methods: {
// 获取敏感词设置列表
getSettingList() {
this.form.pageSize = this.query.pageSize
this.form.pageNum = this.query.pageNum
sensitiveApis.getSettingSensitiveList(this.form).then(res => {
if (res.code === 200) {
this.tableData = res.rows
this.total = Number(res.total)
}
})
},
// 提交敏感词表单
addSensitiveForm() {
// console.log(this.auditUser)
this.$refs.addForm.validate(valid => {
if (valid) {
if (this.auditUserRange.length === 0) {
this.rangeErrorMsg = '请选择审计范围'
return
} else {
this.rangeErrorMsg = ''
}
if (this.auditUser.length === 0) {
this.errorMsg = '请选择审计人'
return
} else {
this.rangeErrorMsg = ''
}
const params = this.addForm
let auditUserScope = []
const obj = {
scopeType: this.auditUserRange.map(d => d.department) + "",
auditScopeId: this.auditUserRange.map(d => d.userId) + "",
auditScopeName: this.auditUserRange.map(d => d.name) + ""
}
auditUserScope.push(obj)
params.auditUserScope = auditUserScope
params.auditUserId = this.auditUser.map(d => d.userId) + ""
params.auditUserName = this.auditUser.map(d => d.name) + ""
params.alertFlag = this.alertFlag
if (this.submitFlag === 'add') {
sensitiveApis.addSettingSensitive(params).then(res => {
if (res.code === 200) {
this.open = false
this.getSettingList()
}
})
}
if (this.submitFlag === 'modify') {
params.id = this.rowId
sensitiveApis.modifySettingSensitive(params).then(res => {
if (res.code === 200) {
this.open = false
this.getSettingList()
}
})
}
}
})
},
// 打开审计范围
openAuditUserRange() {
this.dialogVisibleSelectUser = true
},
// 打开审计人
openAuditUser() {
this.dialogVisibleSelectAuditUser = true
},
resetForm() {
this.addForm = {
strategyName: '',
patternWords: ''
}
this.auditUserRange = [] // 审计范围
this.auditUser = []
this.alertFlag = 0
this.errorMsg = ''
},
// 添加敏感词
addSensitive() {
this.submitFlag = 'add'
this.resetForm()
this.open = true
},
selectedUser(list) {
// console.log(list)
this.auditUserRange = list
// this.form.scopeType = list.map(d => d.department) + ""
// this.form.auditScopeId = list.map(d => d.userId) + ""
},
selectedAuditUser(list) {
this.auditUser = list
},
// 修改敏感词
handleUpdate(row) {
// console.log(row)
this.submitFlag = 'modify'
this.errorMsg = ''
this.rowId = row.id
sensitiveApis.getSensitiveDetails(this.rowId).then(res => {
if (res.code === 200) {
this.addForm.strategyName = res.data.strategyName
this.addForm.patternWords = res.data.patternWords
this.auditUser = [{
name: res.data.auditUserName,
userId: res.data.auditUserId
}]
this.auditUserRange = [{
name: res.data.auditUserScope[0].auditScopeName,
userId: res.data.auditUserScope[0].auditScopeId,
department: res.data.auditUserScope[0].scopeType
}]
this.alertFlag = res.data.alertFlag
}
})
this.open = true
},
// 删除敏感词
handleDelete(row) {
sensitiveApis.deleteSensitive(row.id).then(res => {
if (res.code === 200) {
this.$message.success(res.msg)
this.getSettingList()
}
})
},
handleStatusChange(row) {
}
}
}
</script>
<style lang="scss" scoped>
.demo-form-inline {
background: #efefef;
padding: 18px 10px 0 10px;
}
/deep/ .add-btn {
margin-right: 10px;
}
.content {
margin-top: 15px;
padding: 10px;
}
.prompt-title {
margin-left: 10px;
color: #999;
}
.tag-place {
color: #1890ff;
}
.sub-title {
font-size: 13px;
color: #999;
}
</style>
\ No newline at end of file \ No newline at end of file
<script> <script>
import { getList } from "@/api/groupMessage"; import { getList, syncMsg } from '@/api/groupMessage'
export default { export default {
name: "Operlog", name: 'Operlog',
filters: { filters: {
sendInfo(data) { sendInfo(data) {
if (data.timedTask == 1) { if (data.timedTask == 1) {
return "定时任务 发送时间:" + data.settingTime; return '定时任务 发送时间:' + data.settingTime
} else { } else {
let unit = data.expectSend == 1 ? "个群" : "人"; let unit = data.expectSend == 1 ? '个群' : '人'
return `预计发送${data.expectSend}${unit},已成功发送${data.actualSend}${unit}`; return `预计发送${data.expectSend}${unit},已成功发送${data.actualSend}${unit}`
}
} }
}, },
},
data() { data() {
return { return {
// 遮罩层 // 遮罩层
...@@ -32,78 +32,91 @@ export default { ...@@ -32,78 +32,91 @@ export default {
content: undefined, content: undefined,
pushType: undefined, pushType: undefined,
beginTime: undefined, beginTime: undefined,
endTime: undefined endTime: undefined,
}, },
pushType: { pushType: {
0: "发给客户", 0: '发给客户',
1: "发给客户群" 1: '发给客户群',
}, },
pickerOptions: { pickerOptions: {
disabledDate(time) { disabledDate(time) {
return time.getTime() > Date.now(); // 选当前时间之前的时间 return time.getTime() > Date.now() // 选当前时间之前的时间
} },
},
} }
};
}, },
created() { created() {
this.getList(); this.getList()
}, },
methods: { methods: {
getList(page) { getList(page) {
if (this.dateRange[0]) { if (this.dateRange[0]) {
this.query.beginTime = this.dateRange[0]; this.query.beginTime = this.dateRange[0]
this.query.endTime = this.dateRange[1]; this.query.endTime = this.dateRange[1]
} else { } else {
this.query.beginTime = ""; this.query.beginTime = ''
this.query.endTime = ""; this.query.endTime = ''
} }
page && (this.query.pageNum = page); page && (this.query.pageNum = page)
this.loading = true; this.loading = true
getList(this.query) getList(this.query)
.then(({ rows, total }) => { .then(({ rows, total }) => {
this.list = rows; this.list = rows
this.total = +total; this.total = +total
this.loading = false; this.loading = false
this.ids = []; this.ids = []
}) })
.catch(() => { .catch(() => {
this.loading = false; this.loading = false
}); })
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.dateRange = []; this.dateRange = []
this.$refs["queryForm"].resetFields(); this.$refs['queryForm'].resetFields()
this.getList(1); this.getList(1)
}, },
// 多选框选中数据 // 多选框选中数据
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.id); this.ids = selection.map((item) => item.id)
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const operIds = row.operId || this.ids; const operIds = row.operId || this.ids
this.$confirm( this.$confirm(
'是否确认删除日志编号为"' + operIds + '"的数据项?', '是否确认删除日志编号为"' + operIds + '"的数据项?',
"警告", '警告',
{ {
confirmButtonText: "确定", confirmButtonText: '确定',
cancelButtonText: "取消", cancelButtonText: '取消',
type: "warning" type: 'warning',
} }
) )
.then(function() {}) .then(function() {})
.then(() => { .then(() => {
this.getList(); this.getList()
this.msgSuccess("删除成功"); this.msgSuccess('删除成功')
}) })
.catch(function() {}); .catch(function() {})
}, },
goRoute(id, path) { goRoute(id, path) {
this.$router.push({ path: "/groupMessage/" + path, query: { id } }); this.$router.push({ path: '/groupMessage/' + path, query: { id } })
} },
} syncMsg(data) {
}; let { msgid, messageId } = data
syncMsg({ msgid, messageId })
.then(({ data }) => {
// this.list = rows
// this.total = +total
// this.loading = false
// this.ids = []
})
.catch(() => {
this.loading = false
})
},
},
}
</script> </script>
<template> <template>
<div> <div>
...@@ -188,7 +201,6 @@ export default { ...@@ -188,7 +201,6 @@ export default {
v-hasPermi="['enterpriseWechat:view']" v-hasPermi="['enterpriseWechat:view']"
size="mini" size="mini"
type="text" type="text"
icon="el-icon-view"
@click="goRoute(scope.row.messageId, 'detail')" @click="goRoute(scope.row.messageId, 'detail')"
>查看</el-button >查看</el-button
> >
...@@ -196,11 +208,17 @@ export default { ...@@ -196,11 +208,17 @@ export default {
v-hasPermi="['enterpriseWechat:edit']" v-hasPermi="['enterpriseWechat:edit']"
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit"
disabled="" disabled=""
@click="goRoute(scope.row, 1)" @click="goRoute(scope.row, 1)"
>编辑</el-button >编辑</el-button
> >
<el-button
v-hasPermi="['enterpriseWechat:edit']"
size="mini"
type="text"
@click="syncMsg(scope.row)"
>同步</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!