Commit a062dfb6 by xinla

Merge branch 'front_end_dev_1.5'

2 parents 783da596 adeb3a49
Showing 18 changed files with 708 additions and 579 deletions
import request from '@/utils/request'
const getExternalChatList = (params) => {
// 外部联系人 会话列表
const getExternalChatList = (fromId) => {
return request({
url: '/chat/msg/selectExternalChatList/'+ params.fromId,
url: '/chat/msg/selectExternalChatList/' + fromId,
method: 'get'
})
}
// 单聊 会话列表
const selectAloneChatList = (params) => {
return request({
url: '/chat/msg/selectAloneChatList\n/',
url: '/chat/msg/selectAloneChatList',
method: 'get',
params
})
}
const getInternalChatList = (params) => {
// 内部联系人列表
const getInternalChatList = (fromId) => {
return request({
url: '/chat/msg/selectInternalChatList/'+ params.fromId,
url: '/chat/msg/selectInternalChatList/' + fromId,
method: 'get'
})
}
const getGroupChatList = (params) => {
const getGroupChatList = (fromId) => {
return request({
url: '/chat/msg/selectGroupChatList/'+ params.fromId,
url: '/chat/msg/selectGroupChatList/' + fromId,
method: 'get'
})
}
const chatList = (params) => {
return request({
url: '/chat/msg/list',
method: 'get',
params,
})
}
// const chatList = (params) => {
// return request({
// url: '/chat/msg/list',
// method: 'get',
// params
// })
// }
const indexTable = () => {
return request({
url: '/wecom/page/getCorpBasicData',
......@@ -49,18 +53,22 @@ const indexEchart = () => {
})
}
const listByCustomer = (params) => {
// 全文检索 会话列表
export const getChatList = (params) => {
return request({
url: '/wecom/customer/list',
url: '/chat/msg/selectFullSearchChatList',
method: 'get',
params,
params
})
}
const getFullSearchChatList = (params) => {
// 全文检索 导出列表
export const exportList = (params) => {
return request({
url: '/chat/msg/selectFullSearchChatList',
url: '/chat/msg/selectFullSearchChatList/export',
method: 'get',
params,
params
// responseType: 'blob'
})
}
//
......@@ -71,7 +79,8 @@ export const content = {
selectAloneChatList,
getInternalChatList,
getGroupChatList,
chatList,
listByCustomer,
getFullSearchChatList
// chatList,
getChatList
}
export default content
<script>
// import { AMapManager } from 'vue-amap'
// import Video from 'video.js'
export default {
name: 'ChatContent',
props: {
message: {
type: Object,
default: () => ({})
}
},
components: {},
data() {
return {
dialogVisible: false,
audioSrc: []
}
},
computed: {
content() {
let typeDict = {
text: 'content',
image: 'attachment',
emotion: 'attachment',
file: 'filename',
docmsg: 'title',
video: 'attachment',
voice: 'attachment',
location: 'address',
weapp: 'title',
card: 'corpname'
}
return JSON.parse(this.message.contact)[typeDict[this.message.msgType]]
}
},
watch: {},
created() {},
mounted() {},
methods: {
close() {
this.dialogVisible = false
const mp3 = this.$refs.AudioPlayer
mp3.pause()
},
playAudio(type) {
this.audioSrc = [JSON.parse(this.message.contact)[type]]
this.dialogVisible = true
},
onBeforePlay(next) {
next() // 开始播放
},
play(e) {
this.dia = true
const player = this.$refs.videoPlayer.player
this.playerOptions['sources'][0]['src'] = e.attachment
player.play()
},
down(type) {
let contact = JSON.parse(this.message.contact)
const url = window.URL.createObjectURL(
new Blob([contact[type]], {
type:
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'
})
)
const link = document.createElement('a')
link.href = url
link.setAttribute('download', this.content) // 下载文件的名称及文件类型后缀
document.body.appendChild(link)
link.click()
document.body.removeChild(link) // 下载完成移除元素
window.URL.revokeObjectURL(url) // 释放掉blob对象
}
}
}
</script>
<template>
<div>
<div v-if="message.msgType === 'text'" class="msgtypetext">
{{ content }}
</div>
<div
v-else-if="'image,emotion'.includes(message.msgType)"
class="msgtypeimg"
>
<el-image
style="width: 100px; height: 100px"
:src="content"
fit="fit"
:preview-src-list="[content]"
>
</el-image>
</div>
<a
v-else-if="'file'.includes(message.msgType)"
class="msgtypefile"
:href="JSON.parse(this.message.contact).attachment"
target="balnk"
>
{{ content }}
</a>
<a
v-else-if="'docmsg'.includes(message.msgType)"
class="msgtypefile"
:href="JSON.parse(this.message.contact).link_url"
target="balnk"
>
{{ content }}
</a>
<div v-else-if="message.msgType === 'voice'" class="msgtypevoice">
<i
class="el-icon-microphone"
style=" font-size: 40px; color: #199ed8;"
@click="playAudio('attachment')"
></i>
</div>
<template v-else-if="message.msgType === 'video'">
<video
id="video"
class="video-js vjs-default-skin vjs-big-play-centered"
controls
webkit-playsinline="true"
playsinline="true"
:autoplay="false"
preload="none"
>
<source :src="content" type="video/mp4" />
</video>
<!-- <video-player
class="video-player vjs-custom-skin"
ref="videoPlayer"
style="width: 150px;"
:playsinline="true"
:options="{
playbackRates: [0.7, 1.0, 1.5, 2.0], //播放速度
autoplay: false, //如果true,浏览器准备好时开始回放。
controls: true, //控制条
preload: 'none', //视频预加载
muted: false, //默认情况下将会消除任何音频。
loop: false, //导致视频一结束就重新开始。
language: 'zh-CN',
aspectRatio: '16:9', // 将播放器置于流畅模式,并在计算播放器的动态大小时使用该值。值应该代表一个比例 - 用冒号分隔的两个数字(
fluid: true,
sources: [
{
type: 'video/mp4',
src: content
}
],
poster: '',
width: '175',
height: '75',
notSupportedMessage: '此视频暂无法播放,请稍后再试'
}"
></video-player> -->
</template>
<div v-else-if="message.msgType === 'location'" class="msgtypecard">
<div class="card_name">
<el-amap
ref="map"
vid="amapDemo"
:center="[
JSON.parse(message.contact).longitude,
JSON.parse(message.contact).latitude
]"
:zoom="15"
class="amap-demo"
style="pointer-events: none;"
>
<el-amap-marker
:position="[
JSON.parse(message.contact).longitude,
JSON.parse(message.contact).latitude
]"
></el-amap-marker>
</el-amap>
</div>
<div class="card_foot">{{ content }}</div>
</div>
<div v-else-if="message.msgType === 'weapp'" class="msgtypecard">
<div class="card_name">{{ content }}</div>
<div class="card_foot">小程序</div>
</div>
<div v-else-if="message.msgType === 'card'" class="msgtypecard ">
<div class="card_name">{{ content }}</div>
<div class="card_foot">个人名片</div>
</div>
<el-dialog
v-if="audioSrc[0]"
:visible.sync="dialogVisible"
width="30%"
@close="close"
>
<div class="shabowboxvidoe shabowboxaudio">
<AudioPlayer
:audio-list="audioSrc"
ref="AudioPlayer"
:before-play="onBeforePlay"
/>
<!-- <audio controls>
<source :src="audioSrc[0]" type="audio/mpeg" />
</audio> -->
</div>
<span slot="footer" class="dialog-footer"> </span>
</el-dialog>
</div>
</template>
<style lang="scss" scoped>
.msgtypefile {
margin: 5px;
width: 200px;
display: inline-block;
line-height: 30px;
cursor: pointer;
color: #199ed8;
// text-indent: 10px;
// box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.2), 0 1px 4px 0 rgba(0, 0, 0, 0.19);
}
.msgtypecard {
width: 320px;
height: 140px;
margin: 10px 5px;
border-radius: 8px;
-webkit-box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2),
0 6px 8px 0 rgba(0, 0, 0, 0.19);
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 8px 0 rgba(0, 0, 0, 0.19);
position: relative;
.card_name {
width: 320px;
height: 105px;
line-height: 80px;
text-indent: 10px;
}
.card_foot {
position: absolute;
height: 20px;
border-top: 1px solid #efefef;
text-align: left;
bottom: 15px;
padding: 10px;
color: #333;
font-weight: bold;
width: 100%;
}
}
</style>
<template>
<div class="takecontent">
<ul>
<li v-for="(item, index) in allChat" :key="index">
<!-- <span v-if="item.fromInfo.name">{{item.fromInfo.name}}</span> -->
<div :style="{ color: item.action == 'send' ? '#199ed8' : '#999' }">
<span v-if="item">{{ item.name }}</span>
<span
:style="{ color: item.action == 'send' ? '#199ed8' : '#999' }"
>{{ item.msgTime }}</span
>
</div>
<div v-if="item.msgType == 'text'" class="msgtypetext">
{{ JSON.parse(item.contact).content }}
</div>
<div v-else-if="item.msgType == 'image'" class="msgtypeimg">
<img :src="JSON.parse(item.contact).attachment" @click="showImg(JSON.parse(item.contact))" />
</div>
<div
v-else-if="item.msgType == 'file'"
class="msgtypefile"
@click="down(JSON.parse(item.contact))"
>
{{ JSON.parse(item.contact).fileName }}
</div>
<div v-else-if="item.msgType == 'voice'" class="msgtypevoice">
<i
class="el-icon-microphone"
style=" font-size: 40px; color: #199ed8;"
@click="playVideo(JSON.parse(item.contact))"
></i>
</div>
<div v-else-if="item.msgType == 'emotion'" class="msgtypeimg">
<img :src="JSON.parse(item.contact).attachment" @click="showImg(item)" />
</div>
<div v-else-if="item.msgType == 'video'" class="msgtypevideo">
<i
class="el-icon-video-play"
style=" font-size: 40px; color: #199ed8;"
@click="play(JSON.parse(item.contact), 'video')"
></i>
</div>
<div v-else-if="item.msgType == 'location'" class="msgtypecard">
<div class="card_name">
<el-amap
ref="map"
vid="amapDemo"
:center="[JSON.parse(item.contact).longitude, JSON.parse(item.contact).latitude]"
:zoom="zoom"
class="amap-demo"
style="pointer-events: none;"
>
<el-amap-marker
:position="[JSON.parse(item.contact).longitude, iJSON.parse(item.contact).latitude]"
></el-amap-marker>
</el-amap>
</div>
<div class="card_foot">{{ JSON.parse(item.contact).address }}</div>
</div>
<div v-else-if="item.msgType == 'weapp'" class="msgtypecard">
<div class="card_name">{{ JSON.parse(item.contact).title }}</div>
<div class="card_foot">小程序</div>
</div>
<div v-else-if="item.msgType == 'card'" class="msgtypecard ">
<div class="card_name">{{ JSON.parse(item.contact).corpName }}</div>
<div class="card_foot">个人名片</div>
</div>
</li>
</ul>
<div class="shabowbox" v-show="dia">
<div class="close" @click="dia = false">
<i class="el-icon-circle-close"></i>
</div>
<div class="shabowboxvidoe">
<video-player
class="video-player vjs-custom-skin"
ref="videoPlayer"
id="videoPlayer"
:playsinline="true"
:options="playerOptions"
></video-player>
</div>
</div>
<div class="shabowbox" v-show="diavioce">
<div class="close" @click="vioceClose">
<i class="el-icon-circle-close"></i>
</div>
<div class="shabowboxvidoe shabowboxaudio">
<AudioPlayer
:audio-list="vioceSrc"
ref="AudioPlayer"
:before-play="onBeforePlay"
/>
</div>
</div>
<el-dialog :visible.sync="dialogVisible" width="30%">
<img :src="imgSrc" style="width:100%;max-height:600px" />
<span slot="footer" class="dialog-footer"> </span>
</el-dialog>
</div>
</template>
<script>
import { AMapManager } from 'vue-amap'
import 'video.js/dist/video-js.css'
import 'vue-video-player/src/custom-theme.css'
import { parseTime, yearMouthDay } from '@/utils/common.js'
export default {
components: {
AMapManager
},
props: {
allChat: {
type: Array,
defluat: () => []
}
},
mounted() {},
data() {
return {
dia: false,
diavioce: false,
dialogVisible: false,
imgSrc: '',
vioceSrc: [],
playerOptions: {
playbackRates: [0.7, 1.0, 1.5, 2.0], //播放速度
autoplay: false, //如果true,浏览器准备好时开始回放。
controls: true, //控制条
preload: 'auto', //视频预加载
muted: false, //默认情况下将会消除任何音频。
loop: false, //导致视频一结束就重新开始。
language: 'zh-CN',
aspectRatio: '16:9', // 将播放器置于流畅模式,并在计算播放器的动态大小时使用该值。值应该代表一个比例 - 用冒号分隔的两个数字(例如"16:9"或"4:3")
fluid: true, // 当true时,Video.js player将拥有流体大小。换句话说,它将按比例缩放以适应其容器。
sources: [
{
type: 'video/mp4',
src: 'https://v-cdn.zjol.com.cn/280443.mp4' //你所放置的视频的地址,最好是放在服务器上
}
],
poster: '', //你的封面地址(覆盖在视频上面的图片)
width: document.documentElement.clientWidth,
height: '475',
notSupportedMessage: '此视频暂无法播放,请稍后再试' //允许覆盖Video.js无法播放媒体源时显示的默认信息。
},
zoom: 15,
center: [117.148118, 36.660223],
markers: [
{
position: [117.148118, 36.660223],
visible: false,
draggable: false
}
]
}
},
methods: {
vioceClose() {
this.diavioce = false
const mp3 = this.$refs.AudioPlayer
mp3.pause()
},
playVideo(e) {
this.vioceSrc = [e.attachment]
this.diavioce = true
},
onBeforePlay(next) {
next() // 开始播放
},
showImg(e) {
this.imgSrc = e.attachment
this.dialogVisible = true
},
play(e) {
this.dia = true
const player = this.$refs.videoPlayer.player
this.playerOptions['sources'][0]['src'] = e.attachment
player.play()
},
down(e) {
const url = window.URL.createObjectURL(
new Blob([e.attachment], {
type:
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'
})
)
const link = document.createElement('a')
link.href = url
link.setAttribute('download', e.filename) // 下载文件的名称及文件类型后缀
document.body.appendChild(link)
link.click()
document.body.removeChild(link) // 下载完成移除元素
window.URL.revokeObjectURL(url) // 释放掉blob对象
}
}
}
</script>
<style lang="scss" scoped>
#videoPlayer /deep/ .vjs-tech {
height: 450px;
}
.shabowbox {
position: fixed;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.4);
left: 0;
top: 0;
z-index: 2000;
}
.shabowboxvidoe {
position: fixed;
width: 800px;
height: 475px;
left: 50%;
margin-left: -400px;
top: 50%;
margin-top: -235px;
z-index: 2001;
background: #fff;
}
.shabowboxaudio {
height: 125px;
padding: 12px;
}
.close {
position: fixed;
width: 50px;
height: 50px;
right: 10px;
z-index: 2012;
top: 10px;
text-align: center;
line-height: 50px;
font-size: 20px;
color: #fff;
cursor: pointer;
font-size: 43px;
}
.takecontent {
text-align: left;
width: 100%;
height: 600px;
overflow-y: scroll;
::-webkit-scrollbar {
display: none;
}
ul li {
padding: 8px;
}
.msgtypetext {
padding: 10px 0;
}
.msgtypevoice {
margin: 10px;
}
.msgtypefile {
margin: 10px;
width: 200px;
height: 40px;
line-height: 40px;
cursor: pointer;
color: #199ed8;
text-indent: 10px;
box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.2), 0 1px 4px 0 rgba(0, 0, 0, 0.19);
}
.card_name {
width: 320px;
height: 105px;
line-height: 80px;
text-indent: 10px;
}
.msgtypevideo {
margin: 10px;
cursor: pointer;
border-radius: 8px;
}
.msgtypeimg {
width: 100px;
height: 80px;
margin: 10px;
img {
width: 100px;
height: 80px;
}
}
.msgtypecard {
width: 320px;
height: 140px;
margin: 10px;
border-radius: 8px;
-webkit-box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2),
0 6px 8px 0 rgba(0, 0, 0, 0.19);
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 8px 0 rgba(0, 0, 0, 0.19);
position: relative;
.card_foot {
position: absolute;
height: 20px;
border-top: 1px solid #efefef;
text-align: left;
bottom: 15px;
padding: 10px;
color: #333;
font-weight: bold;
width: 100%;
}
}
}
</style>
<template>
<div class="takecontent">
<ul>
<li v-for="(item, index) in allChat" :key="index">
<!-- <span v-if="item.fromInfo.name">{{item.fromInfo.name}}</span> -->
<div class="mb15">
<span class="mr20">{{ item.fromId }}</span>
<span
:style="{ color: item.action == 'send' ? '#199ed8' : '#999' }"
>{{ item.msgTime }}</span
>
</div>
<ChatContent :message="item"></ChatContent>
</li>
</ul>
</div>
</template>
<script>
import ChatContent from '@/components/ChatContent'
export default {
components: {
ChatContent
},
props: {
allChat: {
type: Array,
defluat: () => []
}
},
mounted() {},
data() {
return {}
},
methods: {}
}
</script>
<style lang="scss" scoped>
#videoPlayer /deep/ .vjs-tech {
height: 450px;
}
.shabowbox {
position: fixed;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.4);
left: 0;
top: 0;
z-index: 2000;
}
.shabowboxvidoe {
position: fixed;
width: 800px;
height: 475px;
left: 50%;
margin-left: -400px;
top: 50%;
margin-top: -235px;
z-index: 2001;
background: #fff;
}
.shabowboxaudio {
height: 125px;
padding: 12px;
}
.close {
position: fixed;
width: 50px;
height: 50px;
right: 10px;
z-index: 2012;
top: 10px;
text-align: center;
line-height: 50px;
font-size: 20px;
color: #fff;
cursor: pointer;
font-size: 43px;
}
.takecontent {
text-align: left;
width: 100%;
height: 600px;
overflow-y: scroll;
::-webkit-scrollbar {
display: none;
}
ul li {
padding: 10px;
}
.msgtypetext {
padding: 10px 0;
}
.msgtypevoice {
margin: 10px;
}
.msgtypefile {
margin: 10px;
width: 200px;
height: 40px;
line-height: 40px;
cursor: pointer;
color: #199ed8;
text-indent: 10px;
box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.2), 0 1px 4px 0 rgba(0, 0, 0, 0.19);
}
.card_name {
width: 320px;
height: 105px;
line-height: 80px;
text-indent: 10px;
}
.msgtypevideo {
margin: 10px;
cursor: pointer;
border-radius: 8px;
}
.msgtypeimg {
width: 100px;
height: 80px;
margin: 10px;
img {
width: 100px;
height: 80px;
}
}
.msgtypecard {
width: 320px;
height: 140px;
margin: 10px;
border-radius: 8px;
-webkit-box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2),
0 6px 8px 0 rgba(0, 0, 0, 0.19);
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 8px 0 rgba(0, 0, 0, 0.19);
position: relative;
.card_foot {
position: absolute;
height: 20px;
border-top: 1px solid #efefef;
text-align: left;
bottom: 15px;
padding: 10px;
color: #333;
font-weight: bold;
width: 100%;
}
}
}
</style>
......@@ -70,7 +70,7 @@
<span v-if="chat.receiveWeCustomer">
与{{ chat.receiveWeCustomer.name }}的聊天</span
>
<span class="fr hd_nameRi">下载会话</span>
<span class="fr hd_nameRi" @click="exportList()">下载会话</span>
</div>
</div>
<div class=" hd_tabthree">
......@@ -78,21 +78,22 @@
v-model="activeNameThree"
@tab-click="activeNameThreeClick()"
>
<div class="date-range">
<el-date-picker
v-model="dateRange"
type="daterange"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
align="right"
@change="activeNameThreeClick"
>
</el-date-picker>
</div>
<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>
<chat
:allChat="allChat"
v-if="allChat && allChat.length >= 1"
......@@ -111,19 +112,6 @@
</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 && allChatImg.length >= 1"
......@@ -135,26 +123,13 @@
layout="prev, pager, next"
:total="total"
@current-change="currentChange"
:current-page="currentPage"
:current-page.sync="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
......@@ -192,37 +167,10 @@
</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="ct_box"></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="allVoice"
stripe
......@@ -265,13 +213,12 @@
</div>
</template>
<script>
import list from '../component/list.vue'
import chat from '../component/chat.vue'
import insideList from '../component/insideList.vue'
import grouplist from '../component/groupList.vue'
import * as api from '@/api/organization'
import { content } from '@/api/conversation/content.js'
import { yearMouthDay, parseTime } from '@/utils/common.js'
import list from './component/list.vue'
import chat from './component/chat.vue'
import insideList from './component/insideList.vue'
import grouplist from './component/groupList.vue'
import * as apiOrg from '@/api/organization'
import api from '@/api/conversation/content.js'
export default {
components: {
......@@ -293,7 +240,7 @@ export default {
},
activeName: '0',
activeNameThree: '0',
takeTime: '',
dateRange: [],
fileData: [],
chat: {},
......@@ -367,7 +314,7 @@ export default {
this.activeNameThreeClick(true)
},
activeNameThreeClick(page, group) {
console.log(this.chat.receiver, this.fromId, 'this.chat.id')
// console.log(this.chat.receiver, this.fromId, 'this.chat.id')
if (!!!this.chat.receiver) {
return //没有选择人
}
......@@ -390,11 +337,16 @@ export default {
let query = {
msgType,
pageSize: '10',
pageNum: this.currentPage,
orderByColumn: 'msg_time',
isAsc: 'asc',
beginTime: this.takeTime ? yearMouthDay(this.takeTime[0]) : '',
endTime: this.takeTime ? yearMouthDay(this.takeTime[1]) : ''
pageNum: this.currentPage
// orderByColumn: 'msg_time',
// isAsc: 'asc'
}
if (this.dateRange) {
query.beginTime = this.dateRange[0]
query.endTime = this.dateRange[1]
} else {
query.beginTime = ''
query.endTime = ''
}
if (this.activeName != '2') {
query.fromId = this.fromId
......@@ -402,9 +354,10 @@ export default {
} else {
query.roomId = this.chat.receiver
}
content.chatList(query).then((res) => {
this.query = query
api.getChatList(query).then((res) => {
console.log(res.rows, 'ssss')
this.total = Number(res.total)
this.total = ~~res.total
this.resortData(res)
})
}
......@@ -438,7 +391,7 @@ export default {
this.activeNameThreeClick('', true)
},
getTree() {
api.getTree().then(({ data }) => {
apiOrg.getTree().then(({ data }) => {
this.treeData = this.handleTree(data)
this.handleNodeClick(this.treeData[0], true)
})
......@@ -452,10 +405,8 @@ export default {
this.loading = true
}
if (this.activeName == 0) {
content
.getInternalChatList({
fromId: this.fromId
})
api
.getInternalChatList(this.fromId)
.then(({ data }) => {
this.loading = false
this.personList = data
......@@ -464,10 +415,8 @@ export default {
this.loading = false
})
} else if (this.activeName == 1) {
content
.getExternalChatList({
fromId: this.fromId
})
api
.getExternalChatList(this.fromId)
.then(({ data }) => {
this.loading = false
this.personList = data
......@@ -476,10 +425,8 @@ export default {
this.loading = false
})
} else {
content
.getGroupChatList({
fromId: this.fromId
})
api
.getGroupChatList(this.fromId)
.then(({ data }) => {
this.loading = false
this.personList = data
......@@ -502,7 +449,7 @@ export default {
pageSize: '999',
department: data.id
}
api.getList(querys).then(({ rows }) => {
apiOrg.getList(querys).then(({ rows }) => {
this.$set(data, 'children', [])
data.children = rows
......@@ -512,6 +459,20 @@ export default {
this.fromId = data.userId
this.tabClick()
}
},
exportList() {
this.$confirm('是否确认导出所有数据项?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
return api.exportList(this.query)
})
.then((response) => {
this.download(response.msg)
})
.catch(function() {})
}
}
}
......@@ -577,15 +538,12 @@ export default {
::-webkit-scrollbar {
display: none;
}
.hds_time {
text-align: left;
width: 100%;
padding: 10px 0;
}
}
}
.date-range {
padding: 10px;
background: #fff;
}
.pagination {
padding: 10px 0;
height: 30px;
......
......@@ -14,9 +14,9 @@
</div>
</template>
<script>
import employee from './page/employeeTest.vue'
import user from './page/userTest.vue'
import role from './page/roleTest.vue'
import employee from './employeeTest.vue'
import user from './userTest.vue'
import role from './roleTest.vue'
export default {
components: { employee, user, role },
data() {
......
<template>
<div>
<el-form :inline="true" :model="form" class="top-serach">
<el-form :inline="true" :model="query" class="top-serach">
<el-form-item label="员工名称">
<el-input v-model="form.Ename" placeholder="客户名称"></el-input>
<el-input
v-model="query.userName"
clearable
placeholder="客户名称"
></el-input>
</el-form-item>
<el-form-item label="客户名称">
<el-input v-model="form.Cname" placeholder="客户名称"></el-input>
<el-input
v-model="query.customerName"
clearable
placeholder="客户名称"
></el-input>
</el-form-item>
<el-form-item label="查找内容">
<el-input v-model="form.Scontent" placeholder="查找内容"></el-input>
<el-input
v-model="query.contact"
clearable
placeholder="查找内容"
></el-input>
</el-form-item>
<el-form-item label="时间范围">
<el-date-picker
v-model="form.Stime"
type="datetimerange"
v-model="dateRange"
type="daterange"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
align="right"
:picker-options="pickerOptions"
>
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="init">查询</el-button>
<el-button type="primary" @click="getList(1)">查询</el-button>
</el-form-item>
<el-form-item>
<el-button>导出列表</el-button>
<el-button @click="exportList()">导出列表</el-button>
</el-form-item>
</el-form>
<div>
<el-table
v-loading="loading"
:data="fileData"
stripe
style="width: 100%"
:header-cell-style="{ background: '#fff' }"
>
<el-table-column prop="date" label="发送者" width="180">
......@@ -43,15 +56,8 @@
</template>
</el-table-column>
<el-table-column prop="name" label=" 内容">
<template slot-scope="scope">
<p
v-if="!!scope.row.contact"
class="emcode"
v-html="scope.row.contact"
></p>
<p v-else-if="!!!scope.row.contact && scope.row.text">
{{ JSON.parse(scope.row.contact).content }}
</p>
<template slot-scope="{ row }">
<ChatContent :message="row"></ChatContent>
</template>
</el-table-column>
<el-table-column label="消息状态" width="200">
......@@ -101,26 +107,30 @@
class="pagination"
layout="prev, pager, next"
:total="total"
@current-change="currentChange"
:current-page="currentPage"
@current-change="getList"
:current-page.sync="query.pageNum"
>
</el-pagination>
</div>
</div>
</template>
<script>
import { content } from '@/api/conversation/content.js'
import { yearMouthDay, parseTime } from '@/utils/common.js'
import { getChatList, exportList } from '@/api/conversation/content.js'
import ChatContent from '@/components/ChatContent'
export default {
components: { ChatContent },
data() {
return {
form: {
Ename: '',
Cname: '',
Scontent: '',
Stime: ''
query: {
userName: '',
customerName: '',
contact: '',
beginTime: '',
endTime: '',
pageNum: 1,
pageSize: 10
},
currentPage: 1,
dateRange: [],
total: 0,
ac: '',
fileData: [],
......@@ -142,36 +152,46 @@ export default {
value: 'switch',
label: '切回企业日志'
}
]
],
loading: false
}
},
mounted() {
this.init()
created() {
this.getList()
},
methods: {
currentChange(e) {
this.currentPage = e
this.init(true)
},
init(flag) {
if (!!!flag) {
this.currentPage = 1
}
let query = {
name: this.form.Ename,
customerName: this.form.Cname,
contact: this.form.Scontent,
beginTime: this.form.Stime ? yearMouthDay(this.form.Stime[0]) : '',
endTime: this.form.Stime ? yearMouthDay(this.form.Stime[1]) : '',
pageNum: this.currentPage,
action: this.ac,
orderByColumn: 'msg_time',
isAsc: 'desc'
getList(page) {
if (this.dateRange) {
this.query.beginTime = this.dateRange[0]
this.query.endTime = this.dateRange[1]
} else {
this.query.beginTime = ''
this.query.endTime = ''
}
content.getFullSearchChatList(query).then((res) => {
this.fileData = res.rows
this.total = Number(res.total)
})
page && (this.query.pageNum = page)
this.loading = true
// let query = {
// name: this.form.userName,
// customerName: this.form.customerName,
// contact: this.form.contact,
// beginTime: this.form.Stime ? yearMouthDay(this.form.Stime[0]) : '',
// endTime: this.form.Stime ? yearMouthDay(this.form.Stime[1]) : '',
// pageNum: this.query.pageNum,
// pageSize: 10,
// action: this.ac,
// orderByColumn: 'msg_time',
// isAsc: 'desc'
// }
getChatList(this.query)
.then((res) => {
this.fileData = res.rows
this.total = ~~res.total
this.loading = false
})
.catch(() => {
this.loading = false
})
},
chechName(e) {
if (e == '') {
......@@ -188,7 +208,30 @@ export default {
this.ac = 'switch'
}
console.log(e, this.ac)
this.init()
this.getList()
},
parseMesContent(data, type) {
let contact = JSON.parse(data)
let typeDict = {
text: 'content',
image: 'attachment',
text: 'content'
}
return contact[type]
},
exportList() {
this.$confirm('是否确认导出所有数据项?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
return exportList(this.query)
})
.then((response) => {
this.download(response.msg)
})
.catch(function() {})
}
}
}
......
......@@ -3,34 +3,49 @@
<el-row>
<el-col :span="6" class="borderR">
<div class="hd_box">
<div class="hd_name">客户列表({{ employAmount }})</div>
<div class="hd_name">客户列表({{ customerTotal }})</div>
<div class="paddingT10">
<el-input
placeholder="搜索客户"
prefix-icon="el-icon-search"
v-model="employName"
@keyup.enter.native="customerList"
v-model="customerQuery.name"
@keyup.enter.native="getCustomerList(1)"
>
</el-input>
</div>
</div>
<div class="ct_box ct_boxFirst" style="height: calc(100vh - 288px)">
<ul>
<li
v-for="(i, t) in CList"
<div v-loading="customerLoading" class="ct_box">
<ul v-infinite-scroll="getCustomerList" class="customer-wrap">
<el-row
v-for="(item, t) in customerList"
:key="t"
@click="personCheck(i, t)"
tag="li"
@click.native="personCheck(item, t)"
class="customer-li"
:class="{ liActive: t == personIndex }"
:gutter="20"
type="flex"
align="middle"
>
<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="20" v-if="i"
><span style="line-height:40px">{{ i.name }}</span></el-col
>
</el-row>
</li>
<el-col :span="4">
<img v-if="item.avatar" :src="item.avatar" alt="头像" />
</el-col>
<el-col :span="10" v-if="item" class="toe">
<span style="line-height:40px">{{ item.name }}</span>
</el-col>
<el-col :span="10" class="ar">
<span
:style="{ color: item.type === 1 ? '#4bde03' : '#f9a90b' }"
>{{ { 1: '@微信', 2: '@企业微信' }[item.type] }}
</span>
<i
:class="[
'el-icon-s-custom',
{ 1: 'man', 2: 'woman' }[item.gender]
]"
></i>
</el-col>
</el-row>
</ul>
</div>
</el-col>
......@@ -246,11 +261,12 @@
</div>
</template>
<script>
import list from '../component/customerList.vue'
import chats from '../component/chat.vue'
import list from './component/customerList.vue'
import chats from './component/chat.vue'
import grouplist from '../component/groupList.vue'
import { content } from '@/api/conversation/content.js'
import grouplist from './component/groupList.vue'
import api from '@/api/conversation/content.js'
import * as apiCustomer from '@/api/customer/index'
import { yearMouthDay } from '@/utils/common.js'
export default {
components: {
......@@ -260,8 +276,14 @@ export default {
},
data() {
return {
employAmount: 1,
employName: '',
customerLoading: false,
customerQuery: {
pageNum: 1,
pageSize: 10,
name: ''
},
customerList: [],
customerTotal: 0,
talkName: '',
chatContent: '',
personIndex: '-1',
......@@ -269,7 +291,6 @@ export default {
activeNameThree: '0',
takeTime: '',
fileData: [],
CList: [],
personList: [],
loading: false,
fromId: '',
......@@ -285,7 +306,9 @@ export default {
total: 0
}
},
created() {
// this.customerList()
},
methods: {
chatFn(data) {
this.chatData = data
......@@ -318,7 +341,7 @@ export default {
}
this.personList = []
if (this.activeName == '0') {
content
api
.selectAloneChatList({
fromId: this.fromId,
contact: this.chatContent
......@@ -331,7 +354,7 @@ export default {
this.loading = false
})
} else {
content
api
.getGroupChatList({
fromId: this.fromId
})
......@@ -375,12 +398,12 @@ export default {
query.toList = this.chatData.receiver
}
if (group) {
content.chatList(query).then((res) => {
api.getChatList(query).then((res) => {
this.total = Number(res.total)
this.resortData(res)
})
} else {
content.chatList(query).then((res) => {
api.getChatList(query).then((res) => {
this.total = Number(res.total)
this.resortData(res)
})
......@@ -403,25 +426,23 @@ export default {
return (this.allVoice = res.rows)
}
},
customerList() {
let querys = {
pageNum: 1,
pageSize: 999,
name: this.employName,
isOpenChat: '1'
getCustomerList(page) {
this.customerLoading = true
if (page) {
this.customerQuery.pageNum = page
this.customerList = []
}
content.listByCustomer(querys).then((res) => {
console.log(res, 'rows')
this.CList = res.rows
this.employAmount = res.total
page && (this.customerQuery.pageNum = page)
apiCustomer.getList(this.customerQuery).then((res) => {
this.customerList.push(...res.rows)
this.customerTotal = ~~res.total
this.customerQuery.pageNum++
this.customerLoading = false
})
},
chatMsgList() {
this.getChatList()
}
},
mounted() {
this.customerList()
}
}
</script>
......@@ -469,32 +490,30 @@ export default {
cursor: pointer;
}
.ct_boxFirst {
}
.ct_box {
.customer-wrap {
position: relative;
height: calc(100vh - 288px);
background: white;
border-bottom: 1px solid #efefef;
padding: 10px;
overflow-y: scroll;
color: #999;
text-align: center;
::-webkit-scrollbar {
display: none;
.customer-li {
padding: 10px;
}
}
ul {
margin: 0;
padding: 0;
}
.ct_box {
// ::-webkit-scrollbar {
// display: none;
// }
ul li {
text-align: left;
cursor: pointer;
border-bottom: 1px solid #efefef;
:hover {
&:hover {
background: #efefef;
}
......@@ -504,8 +523,8 @@ export default {
}
.liActive {
background: lightblue !important;
color: #199ed8;
background: #e2e2e2 !important;
// color: #fff;
}
.hds_time {
......@@ -521,4 +540,16 @@ export default {
height: 30px;
float: left;
}
.el-icon-s-custom {
font-size: 16px;
margin-left: 4px;
color: #999;
&.man {
color: #13a2e8;
}
&.woman {
color: #f753b2;
}
}
</style>
......@@ -14,9 +14,9 @@
</div>
</template>
<script>
import alarmingSensitive from './securityPage/alarmingSensitive.vue'
import sensitiveList from './securityPage/sensitiveList.vue'
import setSensitiveWord from './securityPage/setSensitiveWord'
import alarmingSensitive from './alarmingSensitive.vue'
import sensitiveList from './sensitiveList.vue'
import setSensitiveWord from './setSensitiveWord'
export default {
components: {
sensitiveList,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!