Commit 84737aeb by qiyeqing

会话!

1 parent 071aaeb1
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
"js-beautify": "1.10.2", "js-beautify": "1.10.2",
"js-cookie": "2.2.0", "js-cookie": "2.2.0",
"jsencrypt": "3.0.0-rc.1", "jsencrypt": "3.0.0-rc.1",
"moment": "^2.29.1",
"normalize.css": "7.0.0", "normalize.css": "7.0.0",
"nprogress": "0.2.0", "nprogress": "0.2.0",
"path-to-regexp": "2.4.0", "path-to-regexp": "2.4.0",
......
import request from '@/utils/request'
const getTree=(params)=>{
return request({
url:'/chat/mapping/list',
method: 'get',
params,
})
}
const chatList=(params)=>{
return request({
url:'/wecom/finance/getChatContactList',
method: 'get',
params,
})
}
const listByCustomer=(params)=>{
return request({
url:'/chat/mapping/listByCustomer',
method: 'get',
params,
})
}
const getChatAllList=(params)=>{
return request({
url:'/wecom/finance/getChatAllList',
method: 'get',
params,
})
}
//
export const content={
getTree,
chatList,
listByCustomer,
getChatAllList
}
\ No newline at end of file \ No newline at end of file
...@@ -52,6 +52,19 @@ export function resetForm(refName) { ...@@ -52,6 +52,19 @@ export function resetForm(refName) {
} }
} }
//年月日格式
export function yearMouthDay(data) {
var time = new Date(data);
var year = time.getFullYear();
var month = time.getMonth()+1;
var date = time.getDate();
console.log(year+'-'+add0(month)+'-'+add0(date))
return year+'-'+add0(month)+'-'+add0(date)
}
function add0(m){return m<10?'0'+m:m }
// 添加日期范围 // 添加日期范围
export function addDateRange(params, dateRange) { export function addDateRange(params, dateRange) {
var search = params; var search = params;
......
<template>
<div class="takecontent">
<ul>
<li v-for="(item,index) in allChat" :key="index">
<div :style="{'color':item.action=='send'?'#199ed8':'#999'}">{{item.from}} <span
:style="{'color':item.action=='send'?'#199ed8':'#999'}">{{parseTime(item.msgtime)}}</span></div>
<div v-if="item.msgtype=='text'" class="msgtypetext">
{{item.text.content}}
</div>
<div v-else-if="item.msgtype=='image'" class="msgtypeimg">
<img :src="item.image.attachment">
</div>
<div v-else-if="item.msgtype=='file'" class="msgtypefile" @click="down(item.file)">
{{item.file.filename}}
</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">
<i class="el-icon-video-play" @click="play(item,'voice')"></i>
</div>
<div v-else-if="item.msgtype=='video'" class="msgtypevideo">
<i class="el-icon-video-play" @click="play(item,'video')"></i>
</div>
<div v-else-if="item.msgtype=='location'" class="msgtypecard ">
<div class="card_name"></div>
<div class="card_foot">{{item.location.address}}</div>
</div>
<div v-else-if="item.msgtype=='weapp'" class="msgtypecard ">
<div class="card_name"></div>
<div class="card_foot">小程序</div>
</div>
<div v-else-if="item.msgtype=='card'" class="msgtypecard ">
<div class="card_name">{{item.card.corpname}}</div>
<div class="card_foot">个人名片</div>
</div>
</li>
</ul>
<el-dialog :visible.sync="dia" :show-close='false'>
<p>播放</p>
</el-dialog>
</div>
</template>
<script>
import {
parseTime,
yearMouthDay,
} from '@/utils/common.js'
export default {
props: {
allChat: {
type: Array,
defluat: () => []
}
},
data() {
return {
dia: false
}
},
methods: {
play() {
this.dia = true
},
down(e){
//下载文件
}
}
}
</script>
<style lang="scss" scoped>
* {
padding: 0;
margin: 0;
}
.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{ line-height: 80px;text-indent: 10px;}
.msgtypevideo {
margin: 10px;
font-size: 40px;
cursor: pointer;
color: #199ed8;
border-radius: 8px;
}
.msgtypeimg {
width: 100px;
height: 80px;
margin: 10px;
}
.msgtypecard {
width: 300px;
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>
\ 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">
<el-col :span="4"> <img :src="item.finalChatContext.fromInfo.avatar"></el-col>
<el-col :span="20">
<p>{{item.roomInfo.groupName}} <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: 652px;
::-webkit-scrollbar {
display: none;
}
/deep/ .el-loading-spinner{margin-top: 20px;}
.fr{float:right;}
.gray{color: #999;}
.padt10{padding-top: 10px;}
ul li {
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="takecontent">
<ul>
<li v-for="(item,index) in allChat" :key="index">
<div :style="{'color':item.action=='send'?'#199ed8':'#999'}">{{item.from}} <span
:style="{'color':item.action=='send'?'#199ed8':'#999'}">{{parseTime(item.msgtime)}}</span></div>
<div v-if="item.msgtype=='text'" class="msgtypetext">
{{item.text.content}}
</div>
<div v-else-if="item.msgtype=='image'" class="msgtypeimg">
<img :src="item.image.attachment">
</div>
<div v-else-if="item.msgtype=='file'" class="msgtypefile" @click="down(item.file)">
{{item.file.filename}}
</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">
<i class="el-icon-video-play" @click="play(item,'voice')"></i>
</div>
<div v-else-if="item.msgtype=='video'" class="msgtypevideo">
<i class="el-icon-video-play" @click="play(item,'video')"></i>
</div>
<div v-else-if="item.msgtype=='location'" class="msgtypecard ">
<div class="card_name"></div>
<div class="card_foot">{{item.location.address}}</div>
</div>
<div v-else-if="item.msgtype=='weapp'" class="msgtypecard ">
<div class="card_name"></div>
<div class="card_foot">小程序</div>
</div>
<div v-else-if="item.msgtype=='card'" class="msgtypecard ">
<div class="card_name">{{item.card.corpname}}</div>
<div class="card_foot">个人名片</div>
</div>
</li>
</ul>
<el-dialog :visible.sync="dia" :show-close='false'>
<p>播放</p>
</el-dialog>
</div>
</template>
<script>
import {
parseTime,
yearMouthDay,
} from '@/utils/common.js'
export default {
props: {
allChat: {
type: Array,
defluat: () => []
}
},
data() {
return {
dia: false
}
},
methods: {
play() {
this.dia = true
},
down(e){
//下载文件
}
}
}
</script>
<style lang="scss" scoped>
* {
padding: 0;
margin: 0;
}
.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{ line-height: 80px;text-indent: 10px;}
.msgtypevideo {
margin: 10px;
font-size: 40px;
cursor: pointer;
color: #199ed8;
border-radius: 8px;
}
.msgtypeimg {
width: 100px;
height: 80px;
margin: 10px;
}
.msgtypecard {
width: 300px;
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>
\ 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">
<el-col :span="4"> <img :src="item.receiveWeCustomer.avatar"></el-col>
<el-col :span="20">
<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>
</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: 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
<template> <template>
<div class="content"> <div class="content">
<el-tabs v-model="activeName" @tab-click="handleClick"> <el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="根据员工检测" name="1"> <el-tab-pane label="员工检索" name="1">
<employee></employee> <employee></employee>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="根据用户检测" name="2"> <el-tab-pane label="客户检索" name="2" >
<user></user> <user v-if="activeName==2"></user>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="全局检测" name="3"> <el-tab-pane label="全局检索" name="3">
<role></role> <role v-if="activeName==3"></role>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
</template> </template>
<script> <script>
...@@ -33,3 +32,6 @@ import role from './page/roleTest.vue' ...@@ -33,3 +32,6 @@ import role from './page/roleTest.vue'
} }
} }
</script> </script>
<style scoped>
*{margin: 0;padding: 0;}
</style>
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
<el-form :inline="true" :model="form" class="demo-form-inline"> <el-form :inline="true" :model="form" class="demo-form-inline">
<el-row> <el-row>
<el-form-item label="员工名称"> <el-form-item label="员工名称">
<el-select v-model="form.Ename" placeholder="员工名称" style="width:300px"> <el-input v-model="form.Ename" placeholder="客户名称" style="width:300px"></el-input>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="客户名称"> <el-form-item label="客户名称">
<el-input v-model="form.Cname" placeholder="客户名称" style="width:300px"></el-input> <el-input v-model="form.Cname" placeholder="客户名称" style="width:300px"></el-input>
...@@ -15,14 +15,16 @@ ...@@ -15,14 +15,16 @@
<el-input v-model="form.Scontent" placeholder="查找内容" style="width:300px"></el-input> <el-input v-model="form.Scontent" placeholder="查找内容" style="width:300px"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="时间范围"> <el-form-item label="时间范围">
<el-time-picker is-range v-model="form.Stime" range-separator="至" start-placeholder="开始时间"
end-placeholder="结束时间" placeholder="选择时间范围"> <el-date-picker v-model="form.Stime" type="datetimerange" format='yyyy-MM-dd'
</el-time-picker> range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
align="right">
</el-date-picker>
</el-form-item> </el-form-item>
</el-row> </el-row>
<el-row> <el-row>
<el-form-item> <el-form-item>
<el-button type="primary">查询</el-button> <el-button type="primary" @click="init">查询</el-button>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button>导出列表</el-button> <el-button>导出列表</el-button>
...@@ -31,13 +33,18 @@ ...@@ -31,13 +33,18 @@
</el-form> </el-form>
<div class="content"> <div class="content">
<el-table :data="fileData" stripe style="width: 100%" :header-cell-style="{background:'#fff'}"> <el-table :data="fileData" stripe style="width: 100%" :header-cell-style="{background:'#fff'}">
<el-table-column prop="date" label="发送者" width="200"> <el-table-column prop="date" label="发送者" width="300">
<template slot-scope="scope">
{{scope.row.from}}
</template>
</el-table-column> </el-table-column>
<el-table-column prop="name" label=" 内容"> <el-table-column prop="name" label=" 内容">
<template slot-scope="scope" v-if="scope.row.text">
{{scope.row.text.content}}
</template>
</el-table-column> </el-table-column>
<el-table-column label="消息状态" width="200"> <el-table-column label="消息状态" width="200">
<template slot="header" > <template slot="header">
{{floorRange}} {{floorRange}}
<el-select size="mini" v-model="floorRange" class="noborder" @change="chechName(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" <el-option v-for="item in displayOptions" :key="item.value" :label="item.label"
...@@ -45,22 +52,45 @@ ...@@ -45,22 +52,45 @@
</el-option> </el-option>
</el-select> </el-select>
</template> </template>
<template slot-scope="scope">
<div class="pers">
<span v-if="scope.row.action==''">
</span>
<span v-else-if="scope.row.action=='send'">
<span class="green"></span>
已发送
</span>
<span v-else-if="scope.row.action=='recall'">
<span class="red"></span>
已撤回
</span>
<span v-else-if="scope.row.action=='switch'">
<span class="gay"></span>
企业日志
</span>
</div>
</template>
</el-table-column> </el-table-column>
<el-table-column prop="address" label="发送时间" width="200"> <el-table-column prop="address" label="发送时间" width="200">
<template slot-scope="scope" v-if="scope.row.text">
{{parseTime(scope.row.msgtime)}}
</template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-pagination <el-pagination background class="pagination" layout="prev, pager, next" :total="total"
:page-size="20" @current-change="currentChange" :current-page="currentPage">
style="padding:10px" </el-pagination>
:pager-count="11"
layout="prev, pager, next"
:total="1000">
</el-pagination>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import {
content
} from '@/api/content.js'
import {
yearMouthDay,
parseTime
} from '@/utils/common.js'
export default { export default {
data() { data() {
return { return {
...@@ -70,46 +100,79 @@ ...@@ -70,46 +100,79 @@
Scontent: '', Scontent: '',
Stime: '' Stime: ''
}, },
currentPage: 1,
total: 0,
ac:'',
fileData: [], fileData: [],
floorRange:'全部', floorRange: '全部',
displayOptions: [{ displayOptions: [{
value: "0", value: "",
label: "全部" label: "全部"
}, },
{ {
value: "1", value: "send",
label: "已发送" label: "已发送"
}, },
{ {
value: "2", value: "recall",
label: "已撤回" label: "已撤回"
}, },
{ {
value: "3", value: "switch",
label: "切回企业日志" label: "切回企业日志"
} }
] ]
} }
}, },
methods:{ mounted() {
chechName(e){ this.init()
if(e==0){ },
this.floorRange='全部' methods: {
currentChange(e) {
this.currentPage = e
this.init(true)
},
init(flag) {
if (!!!flag) {
this.currentPage = 1
} }
else if(e==1){ let query = {
this.floorRange='已发送' userName: this.form.Ename,
}else if(e==2){ customerName: this.form.Cname,
this.floorRange='已撤回' keyWord: this.form.Scontent,
}else{ beginTime: this.form.Stime ? yearMouthDay(this.form.Stime[0]) : "",
this.floorRange='切回企业日志' endTime: this.form.Stime ? yearMouthDay(this.form.Stime[1]) : "",
pageNum: this.currentPage,
action:this.ac
} }
content.getChatAllList(query).then(res => {
console.log(res)
this.fileData = res.rows;
this.total = Number(res.total)
})
},
chechName(e) {
if (e == 0) {
this.floorRange = '全部'
this.ac=''
} else if (e == 1) {
this.floorRange = '已发送'
this.ac='send'
} else if (e == 2) {
this.floorRange = '已撤回'
this.ac='recall'
} else {
this.floorRange = '切回企业日志'
this.ac='switch'
}
this.init()
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.demo-form-inline { .demo-form-inline {
background: #efefef; background: #f1f1f1;
padding: 18px 10px 0 10px; padding: 18px 10px 0 10px;
} }
...@@ -117,7 +180,46 @@ ...@@ -117,7 +180,46 @@
margin-top: 15px; margin-top: 15px;
padding: 10px; padding: 10px;
} }
.pers {
position: relative;
.green {
background: greenyellow;
position: absolute;
width: 6px;
height: 6px;
border-radius: 50%;
top: 10px;
left: -8px;
}
.red {
background: red;
position: absolute;
width: 6px;
height: 6px;
border-radius: 50%;
top: 10px;
left: -8px;
}
.gay {
background: gray;
position: absolute;
width: 6px;
height: 6px;
border-radius: 50%;
top: 10px;
left: -8px;
}
}
.noborder { .noborder {
/deep/ .el-input--mini .el-input__inner{width: 2px;border:none} /deep/ .el-input--mini .el-input__inner {
width: 2px;
border: none
}
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!