Commit 58f22719 by qiyeqing

会话优化

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