Commit 58f22719 by qiyeqing

会话优化

1 parent 30d31820
<template> <template>
<div class="list" v-loading="loading"> <div class="list" v-loading="loading">
<div v-if="personList.length>=1"> <div v-if="personList">
<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" v-if="item.finalChatContext.msgtype=='text'"> <el-row style="padding:10px" v-if="item.finalChatContext.msgtype=='text'">
......
<template> <template>
<div class="list" v-loading="loading"> <div class="list" v-loading="loading">
<div v-if="personList.length>=1"> <div v-if="personList">
<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">
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
}, },
methods:{ methods:{
liClick(e){ liClick(e){
console.log(e,'liClick')
this.$emit('chatFn',e) this.$emit('chatFn',e)
} }
} }
......
...@@ -251,7 +251,7 @@ ...@@ -251,7 +251,7 @@
this.activeNameThreeClick(true) this.activeNameThreeClick(true)
}, },
activeNameThreeClick(page, group) { activeNameThreeClick(page, group) {
console.log(!!this.chat.id) console.log(this.chat.id,'this.chat.id')
if(!!!this.chat.id){ if(!!!this.chat.id){
return //没有选择人 return //没有选择人
} }
...@@ -287,12 +287,15 @@ ...@@ -287,12 +287,15 @@
if (this.activeName=='2') { if (this.activeName=='2') {
content.chatGrounpList(query).then(res => { content.chatGrounpList(query).then(res => {
this.total = Number(res.total) this.total = Number(res.total)
this.resortData(res) console.log(res,'this.activeName=')
this.resortData(res.data)
}) })
} else { } else {
content.chatList(query).then(res => { content.chatList(query).then(res => {
console.log(res,'ssss')
this.total = Number(res.total) this.total = Number(res.total)
this.resortData(res) this.resortData(res.data)
}) })
} }
} }
...@@ -338,17 +341,16 @@ ...@@ -338,17 +341,16 @@
if (!this.employId) { if (!this.employId) {
return return
} }
console.log
if (flag) { if (flag) {
this.loading = true this.loading = true
} }
content.getTree({ content.getTree({
fromId: this.employId, fromId: this.employId,
searchType: this.activeName searchType: this.activeName
}).then(({ }).then((res) => {
rows
}) => {
this.loading = false this.loading = false
this.personList = rows this.personList = res.data.rows
}).catch(err => { }).catch(err => {
this.loading = false this.loading = false
}) })
...@@ -377,14 +379,10 @@ ...@@ -377,14 +379,10 @@
pageSize: '999', pageSize: '999',
department: data.id department: data.id
} }
api.getList(querys).then(({ api.getList(querys).then(res => {
rows
}) => {
this.$set(data, 'children', []); this.$set(data, 'children', []);
data.children = rows data.children = res.data.rows
}) })
} else { } else {
this.talkName = data.name; this.talkName = data.name;
this.employId = data.userId; this.employId = data.userId;
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
<el-row> <el-row>
<el-form-item label="员工名称"> <el-form-item label="员工名称">
<el-input v-model="form.Ename" placeholder="客户名称" style="width:300px"></el-input> <el-input v-model="form.Ename" placeholder="客户名称" style="width:300px"></el-input>
</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,7 +14,6 @@ ...@@ -15,7 +14,6 @@
<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-date-picker v-model="form.Stime" type="datetimerange" format='yyyy-MM-dd' range-separator="至" <el-date-picker v-model="form.Stime" type="datetimerange" format='yyyy-MM-dd' range-separator="至"
start-placeholder="开始日期" end-placeholder="结束日期" align="right"> start-placeholder="开始日期" end-placeholder="结束日期" align="right">
</el-date-picker> </el-date-picker>
...@@ -146,8 +144,8 @@ ...@@ -146,8 +144,8 @@
} }
content.getChatAllList(query).then(res => { content.getChatAllList(query).then(res => {
console.log(res) console.log(res)
this.fileData = res.rows; this.fileData = res.data.rows;
this.total = Number(res.total) this.total = Number(res.data.total)
}) })
}, },
chechName(e) { chechName(e) {
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<el-col :span="4"> <el-col :span="4">
<img v-if="i.avatar" :src="i.avatar" alt="头像"> <img v-if="i.avatar" :src="i.avatar" alt="头像">
</el-col> </el-col>
<el-col :span="16" v-if="i"><span style="line-height:40px">{{i.name}}</span></el-col> <el-col :span="20" v-if="i"><span style="line-height:40px">{{i.name}}</span></el-col>
</el-row> </el-row>
</li> </li>
</ul> </ul>
...@@ -230,11 +230,11 @@ ...@@ -230,11 +230,11 @@
content.getTree({ content.getTree({
fromId: this.employId, fromId: this.employId,
searchType: this.activeName searchType: this.activeName
}).then(({ }).then((
rows res
}) => { ) => {
this.loading = false this.loading = false
this.personList = rows this.personList =res.data.rows
}).catch(err => { }).catch(err => {
this.loading = false this.loading = false
}) })
...@@ -255,7 +255,6 @@ ...@@ -255,7 +255,6 @@
} else if (this.activeNameThree == 4) { } else if (this.activeNameThree == 4) {
msgType = 'voice' msgType = 'voice'
} }
let query = { let query = {
fromId: this.chatData.fromId, fromId: this.chatData.fromId,
msgType, msgType,
...@@ -271,13 +270,13 @@ ...@@ -271,13 +270,13 @@
} }
if (group) { if (group) {
content.chatGrounpList(query).then(res => { content.chatGrounpList(query).then(res => {
this.total = Number(res.total) this.total = Number(res.data.total)
this.resortData(res) this.resortData(res.data)
}) })
} else { } else {
content.chatList(query).then(res => { content.chatList(query).then(res => {
this.total = Number(res.total) this.total = Number(res.data.total)
this.resortData(res) this.resortData(res.data)
}) })
} }
}, },
...@@ -312,11 +311,11 @@ ...@@ -312,11 +311,11 @@
} }
content.listByCustomer(querys).then(res => { content.listByCustomer(querys).then(res => {
console.log(res) console.log(res)
res.rows = res.rows.filter((a, b) => { res.rows = res.data.rows.filter((a, b) => {
return a && a.name return a && a.name
}) })
this.CList = res.rows this.CList = res.data.rows
this.employAmount = res.total; this.employAmount = res.data.total;
}) })
} }
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!