Commit fc06369a by xinla

会话存档修改

1 parent c3dff32c
Showing 16 changed files with 266 additions and 238 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
......@@ -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>
......@@ -93,29 +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: [],
......@@ -141,36 +156,37 @@ export default {
loading: false
}
},
mounted() {
this.init()
created() {
this.getList()
},
methods: {
currentChange(e) {
this.currentPage = e
this.init(true)
},
init(flag) {
this.loading = true
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,
pageSize: 10,
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)
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 = Number(res.total)
this.total = ~~res.total
this.loading = false
})
.catch(() => {
......@@ -192,7 +208,7 @@ export default {
this.ac = 'switch'
}
console.log(e, this.ac)
this.init()
this.getList()
},
parseMesContent(data, type) {
let contact = JSON.parse(data)
......@@ -202,6 +218,20 @@ export default {
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!