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() {
wx.config({ this.wxConfig()
beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题 },
debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。 },
appId: '123456', // 必填,企业微信的corpID methods: {
timestamp: this.timestamp, // 必填,生成签名的时间戳 wxConfig() {
nonceStr: this.nonceStr, // 必填,生成签名的随机串 getAgentTicket(window.location.href.split('#')[0]).then(({ data }) => {
signature: this.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法 let { timestamp, nonceStr, signature } = data
jsApiList: [], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来 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({
beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
appId: this.appId, // 必填,企业微信的corpID
timestamp, // 必填,生成签名的时间戳
nonceStr, // 必填,生成签名的随机串
signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
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
this.finished = true // 数据全部加载完成
if (this.list.length >= total) {
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,23 +201,25 @@ export default { ...@@ -200,23 +201,25 @@ export default {
</el-table> </el-table>
<el-row v-else :gutter="20"> <el-row v-else :gutter="20">
<el-col <el-checkbox-group v-model="selectedx" @change="handleSelectionChange">
:span="6" <el-col
style="margin-bottom: 24px;min-width: 220px;" :span="6"
v-for="(item, index) in list" style="margin-bottom: 24px; min-width: 220px"
:key="index" v-for="(item, index) in list"
> :key="index"
<el-card shadow="hover" body-style="padding: 0px;"> >
<div class="img-wrap"> <el-card shadow="hover" body-style="padding: 0px;">
<el-image :src="item.materialUrl" fit="contain"></el-image> <div class="img-wrap">
</div> <el-image :src="item.materialUrl" fit="contain"></el-image>
<div style="padding: 14px;"> </div>
<el-checkbox v-model="ids" :label="item.id">{{ <div style="padding: 14px">
item.materialName <el-checkbox :label="item">{{
}}</el-checkbox> item.materialName
</div> }}</el-checkbox>
</el-card> </div>
</el-col> </el-card>
</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,8 +123,10 @@ ...@@ -124,8 +123,10 @@
width: 100px; width: 100px;
height: 80px; height: 80px;
margin: 10px; margin: 10px;
img{width: 100px;
height: 80px;}
} }
.msgtypecard { .msgtypecard {
width: 300px; width: 300px;
height: 140px; height: 140px;
......
<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,10 +4,10 @@ ...@@ -4,10 +4,10 @@
<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>
</el-row> </el-row>
</li> </li>
......
<template> <template>
<div class="employ"> <div class="employ">
<el-row> <el-row>
<el-col :span="6" class="borderR"> <el-col :span="6" class="borderR">
<div class="hd_box"> <div class="hd_box">
<div class="hd_name">成员({{employAmount}})</div> <div class="hd_name">成员({{employAmount}})</div>
<div class="paddingT10"> <div class="paddingT10">
<el-input placeholder="请输入内容" prefix-icon="el-icon-search" v-model="employName"> <el-input placeholder="请输入内容" prefix-icon="el-icon-search" v-model="employName">
</el-input> </el-input>
</div> </div>
</div> </div>
<div class="ct_box ct_boxFirst"> <div class="ct_box ct_boxFirst">
<el-tree class="filter-tree" :data="treeData" :props="defaultProps" :filter-node-method="filterNode" <el-tree class="filter-tree" :data="treeData" :props="defaultProps" :filter-node-method="filterNode"
ref="tree" @node-click="handleNodeClick" :default-expand-all="true"> ref="tree" @node-click="handleNodeClick" :default-expand-all="true">
</el-tree> </el-tree>
</div>
</el-col>
<el-col :span="6" class="borderR">
<div class="hd_box">
<div class="hd_name">{{talkName}}</div>
</div>
<div class="hd_tabs">
<el-tabs v-model="activeName" @tab-click="tabClick(true)">
<el-tab-pane label="内部联系人" name="0">
<div class="ct_box">
<list v-if="activeName==0" :personList="personList" :loading="loading" @chatFn='chatFn'>
</list>
</div>
</el-tab-pane>
<el-tab-pane label="外部联系人" name="1">
<list v-if="activeName==1" :personList="personList" :loading="loading" @chatFn='chatFn'>
</list>
</el-tab-pane>
<el-tab-pane label="群聊" name="2">
<grouplist v-if="activeName==2" :personList="personList" :loading="loading" @groupFn='groupFn'>
</grouplist>
</el-tab-pane>
</el-tabs>
</div>
</el-col>
<el-col :span="12">
<div class="hd_box">
<div class="hd_name"><span v-if="chat.receiveWeCustomer"> 与{{chat.receiveWeCustomer.name}}的聊天</span>
<span class="fr hd_nameRi">下载会话</span></div>
</div>
<div class=" hd_tabthree">
<el-tabs v-model="activeNameThree" @tab-click="activeNameThreeClick()">
<el-tab-pane label="全部" name="0">
<div class="ct_box">
<div class="hds_time">
<el-date-picker v-model="takeTime" type="datetimerange" format='yyyy-MM-dd' range-separator="至"
start-placeholder="开始日期" end-placeholder="结束日期" align="right" @change="activeNameThreeClick">
</el-date-picker>
</div> </div>
</el-col> <chat :allChat="allChat" v-if="allChat.length>=1"></chat>
<el-col :span="6" class="borderR"> <el-pagination background v-if="allChat.length>=1" layout="prev, pager, next" class="pagination"
<div class="hd_box"> :current-page="currentPage" @current-change="currentChange" :total="total">
<div class="hd_name">{{talkName}}</div> </el-pagination>
</div>
</el-tab-pane>
<el-tab-pane label="图片及视频" name="1">
<div class="ct_box">
<div class="hds_time">
<el-date-picker v-model="takeTime" type="datetimerange" format='yyyy-MM-dd' range-separator="至"
start-placeholder="开始日期" end-placeholder="结束日期" align="right" @change="activeNameThreeClick">
</el-date-picker>
</div> </div>
<div class="hd_tabs"> <chat :allChat="allChatImg" v-if="allChatImg.length>=1"></chat>
<el-tabs v-model="activeName" @tab-click="tabClick(true)"> <el-pagination background v-if="allChatImg.length>=1" class="pagination" layout="prev, pager, next"
<el-tab-pane label="内部联系人" name="0"> :total="total" @current-change="currentChange" :current-page="currentPage">
<div class="ct_box"> </el-pagination>
<list v-if="activeName==0" :personList="personList" :loading="loading" @chatFn='chatFn'> </div>
</list> </el-tab-pane>
</div> <el-tab-pane label="文件" name="2">
</el-tab-pane> <div class="ct_box">
<el-tab-pane label="外部联系人" name="1"> <div class="hds_time">
<list v-if="activeName==1" :personList="personList" :loading="loading" @chatFn='chatFn'> <el-date-picker v-model="takeTime" type="datetimerange" format='yyyy-MM-dd' range-separator="至"
</list> start-placeholder="开始日期" end-placeholder="结束日期" align="right" @change="activeNameThreeClick">
</el-tab-pane> </el-date-picker>
<el-tab-pane label="群聊" name="2">
</el-tab-pane>
</el-tabs>
</div> </div>
</el-col> <el-table :data="allFile" stripe style="width: 100%" :header-cell-style="{background:'#fff'}">
<el-col :span="12"> <el-table-column prop="msgtype" label="类型">
<div class="hd_box"> </el-table-column>
<div class="hd_name"><span v-if="chat.receiveWeCustomer"> 与{{chat.receiveWeCustomer.name}}的聊天</span> <el-table-column label="名称">
<span class="fr hd_nameRi">下载会话</span></div> <template slot-scope="scope">
{{scope.row.file.filename}}
</template>
</el-table-column>
<el-table-column label="大小">
<template slot-scope="scope">
{{filterSize(scope.row.file.filesize)}}
</template>
</el-table-column>
<el-table-column prop="action" label="来源">
<template slot-scope="scope">
{{scope.row.tolist[0]}}
</template>
</el-table-column>
<el-table-column prop="action" label="操作">
<template slot-scope="scope">
<el-button type="text" size="small">下载</el-button>
<el-button type="text" size="small">查看</el-button>
</template>
</el-table-column>
</el-table>
</div>
</el-tab-pane>
<el-tab-pane label="链接" name="3">
<div class="ct_box">
<div class="hds_time">
<el-date-picker v-model="takeTime" type="datetimerange" format='yyyy-MM-dd' range-separator="至"
start-placeholder="开始日期" end-placeholder="结束日期" align="right" @change="activeNameThreeClick">
</el-date-picker>
</div> </div>
<div class=" hd_tabthree"> </div>
<el-tabs v-model="activeNameThree" @tab-click="activeNameThreeClick()"> </el-tab-pane>
<el-tab-pane label="全部" name="0"> <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>
<chat :allChat="allChat" v-if="allChat.length>=1"></chat>
<el-pagination background v-if="allChat.length>=1" layout="prev, pager, next"
class="pagination" :current-page="currentPage" @current-change="currentChange"
:total="total">
</el-pagination>
</div>
</el-tab-pane>
<el-tab-pane label="图片及视频" name="1">
<div class="ct_box">
<div class="hds_time">
<el-date-picker v-model="takeTime" type="datetimerange" format='yyyy-MM-dd'
range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
align="right" @change="activeNameThreeClick">
</el-date-picker>
</div>
<chat :allChat="allChatImg" v-if="allChatImg.length>=1"></chat>
<el-pagination background v-if="allChatImg.length>=1" class="pagination"
layout="prev, pager, next" :total="total" @current-change="currentChange"
:current-page="currentPage">
</el-pagination>
</div>
</el-tab-pane>
<el-tab-pane label="文件" name="2">
<div class="ct_box">
<div class="hds_time">
<el-date-picker v-model="takeTime" type="datetimerange" format='yyyy-MM-dd'
range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
align="right" @change="activeNameThreeClick">
</el-date-picker>
</div>
<el-table :data="allFile" stripe style="width: 100%"
:header-cell-style="{background:'#fff'}">
<el-table-column prop="msgtype" label="类型">
</el-table-column>
<el-table-column label="名称">
<template slot-scope="scope">
{{scope.row.file.filename}}
</template>
</el-table-column>
<el-table-column label="大小">
<template slot-scope="scope">
{{filterSize(scope.row.file.filesize)}}
</template>
</el-table-column>
<el-table-column prop="action" label="来源">
<template slot-scope="scope">
{{scope.row.tolist[0]}}
</template>
</el-table-column>
<el-table-column prop="action" label="操作">
<template slot-scope="scope">
<el-button type="text" size="small">下载</el-button>
<el-button type="text" size="small">查看</el-button>
</template>
</el-table-column>
</el-table>
</div>
</el-tab-pane>
<el-tab-pane label="链接" name="3">
<div class="ct_box">
<div class="hds_time">
<el-date-picker v-model="takeTime" type="datetimerange" format='yyyy-MM-dd'
range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
align="right" @change="activeNameThreeClick">
</el-date-picker>
</div>
</div>
</el-tab-pane>
<el-tab-pane label="语音通话" name="4">
<div class="ct_box">
<div class="hds_time">
<el-date-picker v-model="takeTime" type="datetimerange" format='yyyy-MM-dd'
range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
align="right" @change="activeNameThreeClick">
</el-date-picker>
</div>
<el-table :data="fileData" stripe style="width: 100%"
:header-cell-style="{background:'#fff'}">
<el-table-column prop="date" label="发起人">
</el-table-column>
<el-table-column prop="name" label="通话时间">
</el-table-column>
<el-table-column prop="address" label="时长">
</el-table-column>
<el-table-column prop="address" label="操作">
</el-table-column>
</el-table>
</div>
</el-tab-pane>
</el-tabs>
</div> </div>
</el-col> <el-table :data="fileData" stripe style="width: 100%" :header-cell-style="{background:'#fff'}">
</el-row> <el-table-column prop="date" label="发起人">
</div> </el-table-column>
<el-table-column prop="name" label="通话时间">
</el-table-column>
<el-table-column prop="address" label="时长">
</el-table-column>
<el-table-column prop="address" label="操作">
</el-table-column>
</el-table>
</div>
</el-tab-pane>
</el-tabs>
</div>
</el-col>
</el-row>
</div>
</template> </template>
<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 * as api from '@/api/organization' import grouplist from '../component/groupList.vue'
import { import * as api from '@/api/organization'
content import {
} from '@/api/content.js' content
import { } from '@/api/content.js'
yearMouthDay import {
} from '@/utils/common.js' yearMouthDay
export default { } from '@/utils/common.js'
components: { export default {
list, components: {
chat list,
grouplist,
chat
},
data() {
return {
employAmount: 1,
employId: '',
employName: '',
talkName: '',
treeData: [],
defaultProps: {
label: 'name',
children: 'children',
}, },
data() { activeName: "1",
return { activeNameThree: '0',
employAmount: 1, takeTime: '',
employId: '', fileData: [],
employName: '', chat: {},
talkName: '',
treeData: [],
defaultProps: {
label: 'name',
children: 'children',
},
activeName: "1",
activeNameThree: '0',
takeTime: '',
fileData: [],
chat: {},
personList: [], personList: [],
loading: false, loading: false,
allChat: [], //全部聊天记录 allChat: [], //全部聊天记录
allChatImg: [], //图片, allChatImg: [], //图片,
allVoice: [], allVoice: [],
allFile: [], allFile: [],
allLInk: [], allLInk: [],
//分页 //分页
total: '', total: '',
currentPage: '' currentPage: ''
}; };
}, },
watch: { watch: {
employName(val) { employName(val) {
this.$refs.tree.filter(val); this.$refs.tree.filter(val);
} }
}, },
mounted() { mounted() {
this.getTree() this.getTree()
}, },
methods: { methods: {
filterSize(size) { filterSize(size) {
if (!size) return ''; if (!size) return '';
if (size < this.pow1024(1)) return size + ' B'; if (size < this.pow1024(1)) return size + ' B';
if (size < this.pow1024(2)) return (size / this.pow1024(1)).toFixed(2) + ' KB'; if (size < this.pow1024(2)) return (size / this.pow1024(1)).toFixed(2) + ' KB';
if (size < this.pow1024(3)) return (size / this.pow1024(2)).toFixed(2) + ' MB'; if (size < this.pow1024(3)) return (size / this.pow1024(2)).toFixed(2) + ' MB';
if (size < this.pow1024(4)) return (size / this.pow1024(3)).toFixed(2) + ' GB'; if (size < this.pow1024(4)) return (size / this.pow1024(3)).toFixed(2) + ' GB';
return (size / pow1024(4)).toFixed(2) + ' TB' return (size / pow1024(4)).toFixed(2) + ' TB'
}, },
pow1024(num) { pow1024(num) {
return Math.pow(1024, num) return Math.pow(1024, num)
}, },
currentChange(e) { currentChange(e) {
this.currentPage = e this.currentPage = e
this.activeNameThreeClick(true) if (this.activeName == '2') {
}, return this.activeNameThreeClick(true, true)
activeNameThreeClick(page) { }
if (!!!page) { this.activeNameThreeClick(true)
this.currentPage = 1 },
} activeNameThreeClick(page, group) {
if (this.chat && this.chat.receiveWeCustomer) { if (!!!page) {
let msgType = '' this.currentPage = 1
if (this.activeNameThree == 0) { }
msgType = '' if (this.chat && this.chat.receiveWeCustomer) {
} else if (this.activeNameThree == 1) { let msgType = ''
msgType = 'image' if (this.activeNameThree == 0) {
} else if (this.activeNameThree == 2) { msgType = ''
msgType = 'file' } else if (this.activeNameThree == 1) {
} else if (this.activeNameThree == 3) { msgType = 'image'
msgType = 'link' } else if (this.activeNameThree == 2) {
} else if (this.activeNameThree == 4) { msgType = 'file'
msgType = 'voice' } else if (this.activeNameThree == 3) {
} msgType = 'link'
} else if (this.activeNameThree == 4) {
msgType = 'voice'
}
let query = {
fromId: this.employId,
msgType,
pageSize: '10',
pageNum: this.currentPage,
beginTime: this.takeTime ? yearMouthDay(this.takeTime[0]) : "",
endTime: this.takeTime ? yearMouthDay(this.takeTime[1]) : '',
}
if (group) {
query.roomId = this.chat.roomId
} else {
query.receiveId = this.chat.receiveId
}
let query = { if (group) {
fromId: this.employId, content.chatGrounpList(query).then(res => {
receiveId: this.chat.receiveId, this.total = Number(res.total)
msgType, this.resortData(res)
pageSize: '10', })
pageNum: this.currentPage, } else {
beginTime: this.takeTime ? yearMouthDay(this.takeTime[0]) : "", content.chatList(query).then(res => {
endTime: this.takeTime ? yearMouthDay(this.takeTime[1]) : '', this.total = Number(res.total)
} this.resortData(res)
content.chatList(query).then(res => { })
this.total = Number(res.total) }
if (this.activeNameThree == 0) { }
return this.allChat = res.rows },
} resortData(res){
if (this.activeNameThree == 1) { if (this.activeNameThree == 0) {
return this.allChatImg = res.rows return this.allChat = res.rows
} }
if (this.activeNameThree == 2) { if (this.activeNameThree == 1) {
return this.allFile = res.rows return this.allChatImg = res.rows
} }
if (this.activeNameThree == 3) { if (this.activeNameThree == 2) {
return this.allLInk = res.rows return this.allFile = res.rows
} }
if (this.activeNameThree == 4) { if (this.activeNameThree == 3) {
return this.allVoice = res.rows return this.allLInk = res.rows
} }
}) if (this.activeNameThree == 4) {
} return this.allVoice = res.rows
}, }
chatFn(data) { },
this.chat = data; chatFn(data) {
if (data.receiveWeCustomer) { this.chat = data;
this.activeNameThreeClick() if (data.receiveWeCustomer) {
} this.activeNameThreeClick()
}, }
getTree() { },
api.getTree().then(({ groupFn(data) {
data this.chat = data;
}) => { this.chat.receiveWeCustomer = 'a'
this.treeData = this.handleTree(data) this.activeNameThreeClick('', true)
this.handleNodeClick(this.treeData[0], true) },
}) getTree() {
}, api.getTree().then(({
tabClick(flag) { data
this.personList = [] }) => {
if (!this.employId) { this.treeData = this.handleTree(data)
return this.handleNodeClick(this.treeData[0], true)
} })
if (flag) { },
this.loading = true tabClick(flag) {
} this.personList = []
content.getTree({ if (!this.employId) {
fromId: this.employId, return
searchType: this.activeName }
}).then(({ if (flag) {
rows this.loading = true
}) => { }
this.loading = false content.getTree({
this.personList = rows fromId: this.employId,
}).catch(err => { searchType: this.activeName
this.loading = false }).then(({
}) rows
}, }) => {
filterNode(value, data) { this.loading = false
console.log(value, data) this.personList = rows
if (!value) return true; }).catch(err => {
return data.name.indexOf(value) !== -1; this.loading = false
}, })
handleNodeClick(data, add) { },
if (!data.gender) { filterNode(value, data) {
let querys = { console.log(value, data)
pageNum: '1', if (!value) return true;
pageSize: '999', return data.name.indexOf(value) !== -1;
isActivate: '4', },
department: data.id handleNodeClick(data, add) {
} if (!data.gender) {
api.getList(querys).then(({ let querys = {
rows pageNum: '1',
}) => { pageSize: '999',
if (add == true) { isActivate: '4',
console.log(this.treeData, data, rows) department: data.id
this.treeData[0].children = data.children.concat(rows) }
return api.getList(querys).then(({
} else { rows
const newChild = rows; }) => {
this.$set(data, 'children', []); if (add == true) {
data.children = rows console.log(this.treeData, data, rows)
} this.treeData[0].children = data.children.concat(rows)
}) return
} else { } else {
this.talkName = data.name; const newChild = rows;
this.employId = data.userId; this.$set(data, 'children', []);
this.tabClick() data.children = rows
}
} }
})
} else {
this.talkName = data.name;
this.employId = data.userId;
this.tabClick()
} }
}
} }
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
* { * {
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
/deep/.el-tabs__nav-scroll { /deep/.el-tabs__nav-scroll {
padding-left: 15px; padding-left: 15px;
} }
.fr { .fr {
float: right; float: right;
} }
.borderR { .borderR {
border-right: 2px solid #ccc; border-right: 2px solid #ccc;
} }
.paddingT10 { .paddingT10 {
padding-top: 10px padding-top: 10px
} }
.employ { .employ {
background: #f6f6f9; background: #f6f6f9;
min-height: 800px; min-height: 800px;
.hd_tabs { .hd_tabs {
background: #fff; background: #fff;
/deep/ .el-tabs__header { /deep/ .el-tabs__header {
margin: 0; margin: 0;
} }
} }
.hd_tabthree { .hd_tabthree {
/deep/ .el-tabs__header { /deep/ .el-tabs__header {
margin: 0; margin: 0;
} }
} }
.hd_box { .hd_box {
padding: 15px; padding: 15px;
} }
.hd_name { .hd_name {
font-size: 18px; font-size: 18px;
min-height: 20px; min-height: 20px;
} }
.hd_nameRi { .hd_nameRi {
color: #199ed8; color: #199ed8;
text-align: right; text-align: right;
font-size: 16px; font-size: 16px;
cursor: pointer; cursor: pointer;
} }
.ct_boxFirst { .ct_boxFirst {
height: 707px !important; height: 707px !important;
} }
.ct_box { .ct_box {
background: white; background: white;
height: 710px; height: 710px;
padding: 10px; padding: 10px;
overflow-y: scroll; overflow-y: scroll;
border-bottom: 1px solid #efefef; border-bottom: 1px solid #efefef;
color: #999; color: #999;
text-align: center; text-align: center;
::-webkit-scrollbar {
display: none;
}
.hds_time { ::-webkit-scrollbar {
text-align: left; display: none;
width: 100%; }
padding: 10px 0;
}
} .hds_time {
} text-align: left;
.pagination { width: 100%;
padding: 10px 0; padding: 10px 0;
height: 30px; }
float: left;
} }
</style>
\ No newline at end of file \ No newline at end of file
}
.pagination {
padding: 10px 0;
height: 30px;
float: left;
}
</style>
<template> <template>
<div class="employ"> <div class="employ">
<el-row> <el-row>
<el-col :span="6" class="borderR"> <el-col :span="6" class="borderR">
<div class="hd_box"> <div class="hd_box">
<div class="hd_name">客户列表({{employAmount}})</div> <div class="hd_name">客户列表({{employAmount}})</div>
<div class="paddingT10"> <div class="paddingT10">
<el-input placeholder="搜索客户" prefix-icon="el-icon-search" v-model="employName"> <el-input placeholder="搜索客户" prefix-icon="el-icon-search" v-model="employName">
</el-input> </el-input>
</div> </div>
</div>
<div class="ct_box ct_boxFirst">
<ul>
<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-col :span="4">
<img v-if="i.avatar" :src="i.avatar" alt="头像">
</el-col>
<el-col :span="16" v-if="i"><span style="line-height:40px">{{i.name}}</span></el-col>
</el-row>
</li>
</ul>
</div>
</el-col>
<el-col :span="6" class="borderR">
<div class="hd_box">
<div class="hd_name">{{talkName}}</div>
<div class="paddingT10">
<el-input placeholder="搜索聊天记录" prefix-icon="el-icon-search" v-model="employName">
</el-input>
</div>
</div>
<div class="hd_tabs">
<el-tabs v-model="activeName" @tab-click="getChatList()">
<el-tab-pane label="单聊" name="0">
<div class="hd_tabs_content">
<list v-if="activeName==0" :personList="personList" :loading="loading" @chatFn="chatFn">
</list>
</div>
</el-tab-pane>
<el-tab-pane label="群聊" name="2">
<grouplist v-if="activeName==2" :personList="personList" :loading="loading" @groupFn='groupFn'>
</grouplist>
</el-tab-pane>
</el-tabs>
</div>
</el-col>
<el-col :span="12">
<div class="hd_box">
<div class="hd_name">
<!-- <span
v-if="chatData&&chatData.finalChatContext">与{{chatData.finalChatContext.fromInfo.name}} 的聊天</span> -->
<span class="fr hd_nameRi">下载会话</span></div>
</div>
<div class=" hd_tabthree">
<el-tabs v-model="activeNameThree" @tab-click="activeNameThreeClick()">
<el-tab-pane label="全部" name="0">
<div class="ct_box">
<div class="hds_time">
<el-date-picker v-model="takeTime" type="datetimerange" format='yyyy-MM-dd' range-separator="至"
start-placeholder="开始日期" end-placeholder="结束日期" align="right" @change="activeNameThreeClick">
</el-date-picker>
</div>~
<chats :allChat="allChat" v-if="allChat.length>=1"></chats>
<el-pagination background v-if="allChat.length>=1" layout="prev, pager, next" class="pagination"
:current-page="currentPage" @current-change="currentChange" :total="total">
</el-pagination>
</div>
</el-tab-pane>
<el-tab-pane label="图片及视频" name="1">
<div class="ct_box">
<div class="hds_time">
<el-date-picker v-model="takeTime" type="datetimerange" format='yyyy-MM-dd' range-separator="至"
start-placeholder="开始日期" end-placeholder="结束日期" align="right" @change="activeNameThreeClick">
</el-date-picker>
</div> </div>
<div class="ct_box ct_boxFirst"> <!-- <chat :allChat="allChatImg" v-if="allChatImg.length>=1"></chat> -->
<ul> <el-pagination background v-if="allChatImg.length>=1" class="pagination" layout="prev, pager, next"
<!-- --> :total="total" @current-change="currentChange" :current-page="currentPage">
<li v-for="(i,t) in CList" :key="t" @click="personCheck(i,t)" :class="{'liActive':t==personIndex}"> </el-pagination>
<el-row :gutter="20" style=" padding: 10px 0;margin:0"> </div>
<el-col :span="4"> </el-tab-pane>
<img <el-tab-pane label="文件" name="2">
v-if="i.avatar" <div class="ct_box">
:src="i.avatar" <div class="hds_time">
alt="头像"> <el-date-picker v-model="takeTime" type="datetimerange" format='yyyy-MM-dd' range-separator="至"
</el-col> start-placeholder="开始日期" end-placeholder="结束日期" align="right" @change="activeNameThreeClick">
<el-col :span="16" v-if="i"><span style="line-height:40px">{{i.name}}</span></el-col> </el-date-picker>
</el-row>
</li>
</ul>
</div> </div>
</el-col> <el-table :data="allFile" stripe style="width: 100%" :header-cell-style="{background:'#fff'}">
<el-col :span="6" class="borderR"> <el-table-column prop="msgtype" label="类型">
<div class="hd_box"> </el-table-column>
<div class="hd_name">{{talkName}}</div> <el-table-column label="名称">
<div class="paddingT10"> <template slot-scope="scope">
<el-input placeholder="搜索聊天记录" prefix-icon="el-icon-search" v-model="employName"> {{scope.row.file.filename}}
</el-input> </template>
</div> </el-table-column>
<el-table-column label="大小">
<template slot-scope="scope">
{{filterSize(scope.row.file.filesize)}}
</template>
</el-table-column>
<el-table-column prop="action" label="来源">
<template slot-scope="scope">
{{scope.row.tolist[0]}}
</template>
</el-table-column>
<el-table-column prop="action" label="操作">
<template slot-scope="scope">
<el-button type="text" size="small">下载</el-button>
<el-button type="text" size="small">查看</el-button>
</template>
</el-table-column>
</el-table>
</div>
</el-tab-pane>
<el-tab-pane label="链接" name="3">
<div class="ct_box">
<div class="hds_time">
<el-date-picker v-model="takeTime" type="datetimerange" format='yyyy-MM-dd' range-separator="至"
start-placeholder="开始日期" end-placeholder="结束日期" align="right" @change="activeNameThreeClick">
</el-date-picker>
</div> </div>
</div>
<div class="hd_tabs"> </el-tab-pane>
<el-tabs v-model="activeName"> <el-tab-pane label="语音通话" name="4">
<el-tab-pane label="单聊" name="0"> <div class="ct_box">
<div class="hd_tabs_content"> <div class="hds_time">
<!-- <list v-if="activeName==0" :personList="personList" :loading="loading" > <el-date-picker v-model="takeTime" type="datetimerange" format='yyyy-MM-dd' range-separator="至"
</list> --> start-placeholder="开始日期" end-placeholder="结束日期" align="right" @change="activeNameThreeClick">
</div> </el-date-picker>
</el-tab-pane>
<el-tab-pane label="群聊" name="2">
<list v-if="activeName==2" :personList="personList" :loading="loading" @chatFn="chatFn">
</list>
</el-tab-pane>
</el-tabs>
</div> </div>
<el-table :data="fileData" stripe style="width: 100%" :header-cell-style="{background:'#fff'}">
<el-table-column prop="date" label="发起人">
</el-col> </el-table-column>
<el-col :span="12"> <el-table-column prop="name" label="通话时间">
<div class="hd_box"> </el-table-column>
<div class="hd_name"><span v-if="chatData&&chatData.finalChatContext">与{{chatData.finalChatContext.roomInfo.name}} 的聊天</span> <el-table-column prop="address" label="时长">
<span class="fr hd_nameRi">下载会话</span></div> </el-table-column>
</div> <el-table-column prop="address" label="操作">
<div class=" hd_tabthree"> </el-table-column>
<el-tabs v-model="activeNameThree" @tab-click="activeNameThreeClick()"> </el-table>
<el-tab-pane label="全部" name="0"> </div>
<div class="ct_box"> </el-tab-pane>
<div class="hds_time"> </el-tabs>
<el-date-picker v-model="takeTime" type="datetimerange" format='yyyy-MM-dd' </div>
range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" </el-col>
align="right" @change="activeNameThreeClick"> </el-row>
</el-date-picker>
</div>
<chat :allChat="allChat" v-if="allChat.length>=1"></chat>
<el-pagination background v-if="allChat.length>=1" layout="prev, pager, next"
class="pagination" :current-page="currentPage" @current-change="currentChange"
:total="total">
</el-pagination>
</div>
</el-tab-pane>
<el-tab-pane label="图片及视频" name="1">
<div class="ct_box">
<div class="hds_time">
<el-date-picker v-model="takeTime" type="datetimerange" format='yyyy-MM-dd'
range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
align="right" @change="activeNameThreeClick">
</el-date-picker>
</div>
<chat :allChat="allChatImg" v-if="allChatImg.length>=1"></chat>
<el-pagination background v-if="allChatImg.length>=1" class="pagination"
layout="prev, pager, next" :total="total" @current-change="currentChange"
:current-page="currentPage">
</el-pagination>
</div>
</el-tab-pane>
<el-tab-pane label="文件" name="2">
<div class="ct_box">
<div class="hds_time">
<el-date-picker v-model="takeTime" type="datetimerange" format='yyyy-MM-dd'
range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
align="right" @change="activeNameThreeClick">
</el-date-picker>
</div>
<el-table :data="allFile" stripe style="width: 100%"
:header-cell-style="{background:'#fff'}">
<el-table-column prop="msgtype" label="类型">
</el-table-column>
<el-table-column label="名称">
<template slot-scope="scope">
{{scope.row.file.filename}}
</template>
</el-table-column>
<el-table-column label="大小">
<template slot-scope="scope">
{{filterSize(scope.row.file.filesize)}}
</template>
</el-table-column>
<el-table-column prop="action" label="来源">
<template slot-scope="scope">
{{scope.row.tolist[0]}}
</template>
</el-table-column>
<el-table-column prop="action" label="操作">
<template slot-scope="scope">
<el-button type="text" size="small">下载</el-button>
<el-button type="text" size="small">查看</el-button>
</template>
</el-table-column>
</el-table>
</div>
</el-tab-pane>
<el-tab-pane label="链接" name="3">
<div class="ct_box">
<div class="hds_time">
<el-date-picker v-model="takeTime" type="datetimerange" format='yyyy-MM-dd'
range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
align="right" @change="activeNameThreeClick">
</el-date-picker>
</div>
</div>
</el-tab-pane>
<el-tab-pane label="语音通话" name="4">
<div class="ct_box">
<div class="hds_time">
<el-date-picker v-model="takeTime" type="datetimerange" format='yyyy-MM-dd'
range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
align="right" @change="activeNameThreeClick">
</el-date-picker>
</div>
<el-table :data="fileData" stripe style="width: 100%"
:header-cell-style="{background:'#fff'}">
<el-table-column prop="date" label="发起人">
</el-table-column>
<el-table-column prop="name" label="通话时间">
</el-table-column>
<el-table-column prop="address" label="时长">
</el-table-column>
<el-table-column prop="address" label="操作">
</el-table-column>
</el-table>
</div>
</el-tab-pane>
</el-tabs>
</div>
</el-col>
</el-row>
</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 {
content import grouplist from '../component/groupList.vue'
} from '@/api/content.js' import {
import { content
yearMouthDay } from '@/api/content.js'
} from '@/utils/common.js' import {
export default { yearMouthDay
components:{ } from '@/utils/common.js'
list,chat export default {
}, components: {
data() { list,
return { chats,
employAmount: 1, grouplist
employName: '', },
talkName: '', data() {
personIndex: '-1', return {
activeName: "2", employAmount: 1,
activeNameThree: '0', employName: '',
takeTime: '', talkName: '',
fileData: [], personIndex: '-1',
CList:[], activeName: "0",
personList:[], activeNameThree: '0',
loading:false, takeTime: '',
employId:'', fileData: [],
chatData:{}, CList: [],
personList: [],
allChat:[], loading: false,
allChatImg:[], employId: '',
allFile:[], chatData: {},
allLInk:[],
allVoice:[], allChat: [],
//分页 allChatImg: [],
currentPage:1, allFile: [],
total:0 allLInk: [],
allVoice: [],
}; //分页
}, currentPage: 1,
total: 0
methods: {
chatFn(data){ };
this.chatData=data },
if (data.fromId) {
this.activeNameThreeClick() methods: {
} chatFn(data) {
}, this.chatData = data
currentChange(){ console.log(data)
this.currentPage = e this.activeNameThreeClick()
this.activeNameThreeClick(true) },
}, groupFn(data){
personCheck(data, e) { this.chatData = data;
this.personIndex = e this.activeNameThreeClick('', true)
this.talkName = data.name; },
this.employId=data.externalUserid currentChange() {
this.getChatList() this.currentPage = e
}, if (this.activeName == '2') {
getChatList(flag){ return this.activeNameThreeClick(true, true)
if (!this.employId) { }
return this.activeNameThreeClick(true)
} },
if (flag) { personCheck(data, e) {
this.loading = true this.personIndex = e
} this.talkName = data.name;
content.getTree({ this.employId = data.externalUserid
fromId: this.employId, this.getChatList()
searchType: this.activeName },
}).then(({ getChatList(flag) {
rows if (!this.employId) {
}) => { return
console.log(rows) }
this.loading = false if (flag) {
this.personList = rows this.loading = true
}).catch(err => { }
this.loading = false this.personList = []
}) content.getTree({
}, fromId: this.employId,
activeNameThreeClick(page){ searchType: this.activeName
if (!!!page) { }).then(({
this.currentPage = 1 rows
} }) => {
let msgType = '' this.loading = false
if (this.activeNameThree == 0) { this.personList = rows
msgType = '' }).catch(err => {
} else if (this.activeNameThree == 1) { this.loading = false
msgType = 'image' })
} else if (this.activeNameThree == 2) { },
msgType = 'file' activeNameThreeClick(page,group) {
} else if (this.activeNameThree == 3) { if (!!!page) {
msgType = 'link' this.currentPage = 1
} else if (this.activeNameThree == 4) { }
msgType = 'voice' let msgType = ''
} if (this.activeNameThree == 0) {
let query = { msgType = ''
fromId: this.chatData.fromId, } else if (this.activeNameThree == 1) {
receiveId: this.chatData.roomId, msgType = 'image'
msgType, } else if (this.activeNameThree == 2) {
pageSize: '10', msgType = 'file'
pageNum: this.currentPage, } else if (this.activeNameThree == 3) {
beginTime: this.takeTime ? yearMouthDay(this.takeTime[0]) : "", msgType = 'link'
endTime: this.takeTime ? yearMouthDay(this.takeTime[1]) : '', } else if (this.activeNameThree == 4) {
} msgType = 'voice'
content.chatList(query).then(res => {
this.total = Number(res.total)
console.log(res,'chatData')
if (this.activeNameThree == 0) {
return this.allChat = res.rows
}
if (this.activeNameThree == 1) {
return this.allChatImg = res.rows
}
if (this.activeNameThree == 2) {
return this.allFile = res.rows
}
if (this.activeNameThree == 3) {
return this.allLInk = res.rows
}
if (this.activeNameThree == 4) {
return this.allVoice = res.rows
}
})
},
customerList(){
content.listByCustomer().then(res=>{
res.rows= res.rows.filter((a,b)=>{ return a&&a.name})
this.CList=res.rows
this.employAmount=res.total;
})
}
},
mounted(){
this.customerList()
} }
let query = {
fromId: this.chatData.fromId,
msgType,
pageSize: '10',
pageNum: this.currentPage,
beginTime: this.takeTime ? yearMouthDay(this.takeTime[0]) : "",
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 => {
this.total = Number(res.total)
this.resortData(res)
})
}
},
resortData(res){
if (this.activeNameThree == 0) {
return this.allChat = res.rows
}
if (this.activeNameThree == 1) {
return this.allChatImg = res.rows
}
if (this.activeNameThree == 2) {
return this.allFile = res.rows
}
if (this.activeNameThree == 3) {
return this.allLInk = res.rows
}
if (this.activeNameThree == 4) {
return this.allVoice = res.rows
}
},
customerList() {
let querys = {
pageNum: 1,
pageSize: 999,
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() {
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;
}
.borderR {
border-right: 2px solid #ccc;
}
.paddingT10 {
padding-top: 10px
}
.employ {
background: #f6f6f9;
min-height: 800px;
.hd_tabs {
background: #fff;
} }
.fr{float:right;}
.borderR { .hd_tabthree {
border-right: 2px solid #ccc; /deep/ .el-tabs__header {
margin: 0;
}
} }
.paddingT10 { .hd_box {
padding-top: 10px padding: 15px;
} }
.employ { .hd_name {
background: #f6f6f9; font-size: 18px;
min-height: 800px; min-height: 20px;
}
.hd_tabs { .hd_tabs_content {
background: #fff; width: 100%;
} min-height: 653px;
border-bottom: 1px solid #efefef;
}
.hd_tabthree { .hd_nameRi {
/deep/ .el-tabs__header { color: #199ed8;
margin: 0; text-align: right;
} font-size: 16px;
} cursor: pointer;
}
.hd_box { .ct_boxFirst {
padding: 15px; height: 700px;
} }
.hd_name { .ct_box {
font-size: 18px; background: white;
min-height: 20px; border-bottom: 1px solid #efefef;
} min-height: 709px;
.hd_tabs_content{ width: 100%;min-height: 653px;border-bottom: 1px solid #efefef; } padding: 10px;
.hd_nameRi { overflow-y: scroll;
color: #199ed8; color: #999;
text-align: right; text-align: center;
font-size: 16px;
cursor: pointer; ::-webkit-scrollbar {
} display: none;
}
.ct_boxFirst { ul {
height: 700px; margin: 0;
padding: 0;
}
ul li {
text-align: left;
cursor: pointer;
border-bottom: 1px solid #efefef;
:hover {
background: #efefef;
} }
.ct_box { img {
background: white; width: 40px;
border-bottom: 1px solid #efefef;
min-height: 709px;
padding: 10px;
overflow-y: scroll;
color: #999;
text-align: center;
::-webkit-scrollbar {
display: none;
}
ul {
margin: 0;
padding: 0;
}
ul li {
text-align: left;
cursor: pointer;
border-bottom: 1px solid #efefef;
:hover{ background: #efefef;}
img {
width: 40px;
}
;
}
.liActive {
background: lightblue !important;
color: #199ed8;
}
.hds_time {
text-align: left;
width: 100%;
padding: 10px 0;
}
} }
} ;
.pagination { }
.liActive {
background: lightblue !important;
color: #199ed8;
}
.hds_time {
text-align: left;
width: 100%;
padding: 10px 0; padding: 10px 0;
height: 30px; }
float: left;
} }
</style>
\ No newline at end of file \ No newline at end of file
}
.pagination {
padding: 10px 0;
height: 30px;
float: left;
}
</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!