Commit 6e368308 by xinla

会话存档布局优化

1 parent d6446855
...@@ -8,15 +8,11 @@ ...@@ -8,15 +8,11 @@
@click="liClick(item)" @click="liClick(item)"
> >
<el-row style="padding:10px"> <el-row style="padding:10px">
<el-col :span="3" <el-col :span="3"><img :src="item.avatar"/></el-col>
><img :src="item.avatar"
/></el-col>
<el-col :span="21"> <el-col :span="21">
<p> <p>
{{ item.name }} {{ item.name }}
<span class="fr gray">{{ <span class="fr gray">{{ item.msgTime }}</span>
item.msgTime
}}</span>
</p> </p>
<p class="gray padt10" v-if="item.contact"> <p class="gray padt10" v-if="item.contact">
{{ JSON.parse(item.contact).content }} {{ JSON.parse(item.contact).content }}
...@@ -58,7 +54,7 @@ export default { ...@@ -58,7 +54,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.list { .list {
overflow-y: scroll; overflow-y: scroll;
height: 651px; height: calc(100vh - 328px);
::-webkit-scrollbar { ::-webkit-scrollbar {
display: none; display: none;
} }
......
<template> <template>
<div class="list" v-loading="loading"> <div class="list" v-loading="loading">
<div v-if="personList"> <div v-if="personList.length">
<ul> <ul>
<li <li
v-for="(item, index) in personList" v-for="(item, index) in personList"
:key="index" :key="index"
@click="liClick(item)" @click="liClick(item)"
> >
<el-row style="padding:10px" v-if="item.msgType == 'text'"> <el-row type="flex" v-if="item.msgType == 'text'">
<span class="fl"> <div class="ninebox">
<div class="ninebox"> <ul v-if="item.avatar">
<ul v-if="item.avatar"> <li v-for="(a, i) in item.avatar.split(',')" :key="i">
<li <img :src="a" />
v-for="(a, i) in item.avatar.split(',')" </li>
:key="i" </ul>
> </div>
<img :src="a" /> <div class="fl" style="margin-left:8px;line-height:60px">
</li>
</ul>
</div>
</span>
<span class="fl" style="margin-left:8px;line-height:60px">
<p> <p>
{{ item.name }} {{ item.name }}
<span class="fr gray">{{ <!-- <span class="fr gray">{{ item.msgTime }}</span> -->
item.msgTime
}}</span>
</p> </p>
<p class="gray" v-if="item"> <!-- <p class="gray" v-if="item">
{{ item.name }}:{{ {{ item.name }}:
item.content {{ item.content }}
}} </p> -->
</p> </div>
</span>
</el-row> </el-row>
<!-- <el-row style="padding:10px" v-if="item.finalChatContext.msgtype=='file'"> <!-- <el-row style="padding:10px" v-if="item.finalChatContext.msgtype=='file'">
<el-col :span="3">&nbsp;</el-col> <el-col :span="3">&nbsp;</el-col>
...@@ -46,7 +38,9 @@ ...@@ -46,7 +38,9 @@
</li> </li>
</ul> </ul>
</div> </div>
<div v-else></div> <div class="ac" v-else>
暂无数据
</div>
</div> </div>
</template> </template>
<script> <script>
...@@ -77,6 +71,7 @@ export default { ...@@ -77,6 +71,7 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.ninebox { .ninebox {
flex: none;
width: 54px; width: 54px;
height: 52px; height: 52px;
border: 1px solid #199ed8; border: 1px solid #199ed8;
...@@ -90,6 +85,7 @@ export default { ...@@ -90,6 +85,7 @@ export default {
} }
.list { .list {
overflow-y: scroll; overflow-y: scroll;
height: calc(100vh - 328px);
::-webkit-scrollbar { ::-webkit-scrollbar {
display: none; display: none;
......
<template> <template>
<div class="list" v-loading="loading"> <div class="list" v-loading="loading">
<div v-if="personList.length >= 1"> <div v-if="personList.length">
<ul> <ul>
<li <li
v-for="(item, index) in personList" v-for="(item, index) in personList"
...@@ -8,9 +8,7 @@ ...@@ -8,9 +8,7 @@
@click="liClick(item)" @click="liClick(item)"
> >
<el-row style="padding:10px"> <el-row style="padding:10px">
<span class="fl"> <span class="fl"> <img :src="item.avatar"/></span>
<img :src="item.avatar"
/></span>
<span class="fl" style="margin-left:8px"> <span class="fl" style="margin-left:8px">
<p>{{ item.name }}</p> <p>{{ item.name }}</p>
</span> </span>
...@@ -18,7 +16,9 @@ ...@@ -18,7 +16,9 @@
</li> </li>
</ul> </ul>
</div> </div>
<div v-else></div> <div class="ac" v-else>
暂无数据
</div>
</div> </div>
</template> </template>
<script> <script>
...@@ -51,7 +51,8 @@ export default { ...@@ -51,7 +51,8 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.list { .list {
overflow-y: scroll; overflow-y: scroll;
height: 708px; height: calc(100vh - 328px);
::-webkit-scrollbar { ::-webkit-scrollbar {
display: none; display: none;
} }
......
<template> <template>
<div class="list" v-loading="loading"> <div class="list" v-loading="loading">
<div v-if="personList.length >= 1"> <div v-if="personList.length">
<ul> <ul>
<li <li
v-for="(item, index) in personList" v-for="(item, index) in personList"
:key="index" :key="index"
@click="liClick(item)" @click="liClick(item)"
> >
<el-row style="padding:10px"> <el-row>
<span class="fl"> <img :src="item.avatar"/></span> <span class="fl"> <img :src="item.avatar"/></span>
<span class="fl" style="margin-left:8px"> <span class="fl" style="margin-left:8px">
<p>{{ item.name }}</p> <p>{{ item.name }}</p>
</span> </span>
<span class="fl"> <!-- <span class="fl">
<p>{{ item.contact }}</p> <p>{{ item.contact }}</p>
</span> </span> -->
</el-row> </el-row>
</li> </li>
</ul> </ul>
</div> </div>
<div v-else></div> <div class="ac" v-else>
暂无数据
</div>
</div> </div>
</template> </template>
<script> <script>
...@@ -45,8 +47,8 @@ export default { ...@@ -45,8 +47,8 @@ export default {
console.log(e, 'liClick') console.log(e, 'liClick')
this.$emit('chatFn', e) this.$emit('chatFn', e)
}, },
msgContentType(type,msg){ msgContentType(type, msg) {
console.log(type,msg, 'msgContentType') console.log(type, msg, 'msgContentType')
//消息获取 //消息获取
/*case msg = JSON.parse(msg); /*case msg = JSON.parse(msg);
switch (type){ switch (type){
...@@ -59,7 +61,7 @@ export default { ...@@ -59,7 +61,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.list { .list {
overflow-y: scroll; overflow-y: scroll;
height: 708px; height: calc(100vh - 328px);
::-webkit-scrollbar { ::-webkit-scrollbar {
display: none; display: none;
} }
......
...@@ -9,253 +9,258 @@ ...@@ -9,253 +9,258 @@
</el-input> </el-input>
</div> </div>
</div> --> </div> -->
<div class="ct_box ct_boxFirst"> <div class="ct_box ct_boxFirst" style="height: calc(100vh - 197px)">
<el-tree <el-tree
ref="tree"
class="filter-tree" class="filter-tree"
:data="treeData" :data="treeData"
:props="defaultProps" :props="defaultProps"
:filter-node-method="filterNode" :filter-node-method="filterNode"
ref="tree" highlight-current
@node-click="handleNodeClick" @node-click="handleNodeClick"
:default-expand-all="true" :default-expand-all="true"
> >
</el-tree> </el-tree>
</div> </div>
</el-col> </el-col>
<el-col :span="6" class="borderR"> <template v-if="talkName">
<div class="hd_box"> <el-col :span="6" class="borderR">
<div class="hd_name">{{ talkName }}</div> <div class="hd_box">
</div> <div class="hd_name">{{ talkName }}</div>
<div class="hd_tabs"> </div>
<el-tabs v-model="activeName" @tab-click="tabClick(true)"> <div class="hd_tabs">
<el-tab-pane label="内部联系人" name="0"> <el-tabs v-model="activeName" @tab-click="tabClick(true)">
<div class="ct_box"> <el-tab-pane label="内部联系人" name="0">
<insideList <div class="ct_box">
v-if="activeName == 0" <insideList
v-if="activeName == 0"
:personList="personList"
:loading="loading"
@chatFn="chatFn"
>
</insideList>
</div>
</el-tab-pane>
<el-tab-pane label="外部联系人" name="1">
<list
class="ct_box"
v-if="activeName == 1"
:personList="personList" :personList="personList"
:loading="loading" :loading="loading"
@chatFn="chatFn" @chatFn="chatFn"
> >
</insideList> </list>
</div> </el-tab-pane>
</el-tab-pane> <el-tab-pane label="群聊" name="2">
<el-tab-pane label="外部联系人" name="1"> <grouplist
<list class="ct_box"
v-if="activeName == 1" v-if="activeName == 2"
:personList="personList" :personList="personList"
:loading="loading" :loading="loading"
@chatFn="chatFn" @groupFn="groupFn"
> >
</list> </grouplist>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="群聊" name="2"> </el-tabs>
<grouplist </div>
v-if="activeName == 2" </el-col>
:personList="personList" <el-col :span="12">
:loading="loading" <div class="hd_box">
@groupFn="groupFn" <div class="hd_name">
<span v-if="chat.receiveWeCustomer">
与{{ chat.receiveWeCustomer.name }}的聊天</span
> >
</grouplist> <span class="fr hd_nameRi">下载会话</span>
</el-tab-pane> </div>
</el-tabs>
</div>
</el-col>
<el-col :span="12">
<div class="hd_box">
<div class="hd_name">
<span v-if="chat.receiveWeCustomer">
与{{ chat.receiveWeCustomer.name }}的聊天</span
>
<span class="fr hd_nameRi">下载会话</span>
</div> </div>
</div> <div class=" hd_tabthree">
<div class=" hd_tabthree"> <el-tabs
<el-tabs v-model="activeNameThree"
v-model="activeNameThree" @tab-click="activeNameThreeClick()"
@tab-click="activeNameThreeClick()" >
> <el-tab-pane label="全部" name="0">
<el-tab-pane label="全部" name="0"> <div class="ct_box">
<div class="ct_box"> <div class="hds_time">
<div class="hds_time"> <el-date-picker
<el-date-picker v-model="takeTime"
v-model="takeTime" type="datetimerange"
type="datetimerange" format="yyyy-MM-dd"
format="yyyy-MM-dd" range-separator="至"
range-separator="至" start-placeholder="开始日期"
start-placeholder="开始日期" end-placeholder="结束日期"
end-placeholder="结束日期" align="right"
align="right" @change="activeNameThreeClick"
@change="activeNameThreeClick" >
</el-date-picker>
</div>
<chat
:allChat="allChat"
v-if="allChat && allChat.length >= 1"
></chat>
<el-pagination
background
v-if="allChat && allChat.length >= 1"
layout="prev, pager, next"
class="pagination"
:current-page="currentPage"
@current-change="currentChange"
:total="total"
> >
</el-date-picker> </el-pagination>
</div> </div>
<chat </el-tab-pane>
:allChat="allChat" <el-tab-pane label="图片及视频" name="1">
v-if="allChat && allChat.length >= 1" <div class="ct_box">
></chat> <div class="hds_time">
<el-pagination <el-date-picker
background v-model="takeTime"
v-if="allChat && allChat.length >= 1" type="datetimerange"
layout="prev, pager, next" format="yyyy-MM-dd"
class="pagination" range-separator="至"
:current-page="currentPage" start-placeholder="开始日期"
@current-change="currentChange" end-placeholder="结束日期"
:total="total" align="right"
> @change="activeNameThreeClick"
</el-pagination> >
</div> </el-date-picker>
</el-tab-pane> </div>
<el-tab-pane label="图片及视频" name="1"> <chat
<div class="ct_box"> :allChat="allChatImg"
<div class="hds_time"> v-if="allChatImg && allChatImg.length >= 1"
<el-date-picker ></chat>
v-model="takeTime" <el-pagination
type="datetimerange" background
format="yyyy-MM-dd" v-if="allChatImg && allChatImg.length >= 1"
range-separator="至" class="pagination"
start-placeholder="开始日期" layout="prev, pager, next"
end-placeholder="结束日期" :total="total"
align="right" @current-change="currentChange"
@change="activeNameThreeClick" :current-page="currentPage"
> >
</el-date-picker> </el-pagination>
</div> </div>
<chat </el-tab-pane>
:allChat="allChatImg" <el-tab-pane label="文件" name="2">
v-if="allChatImg && allChatImg.length >= 1" <div class="ct_box">
></chat> <div class="hds_time">
<el-pagination <el-date-picker
background v-model="takeTime"
v-if="allChatImg && allChatImg.length >= 1" type="datetimerange"
class="pagination" format="yyyy-MM-dd"
layout="prev, pager, next" range-separator="至"
:total="total" start-placeholder="开始日期"
@current-change="currentChange" end-placeholder="结束日期"
:current-page="currentPage" align="right"
> @change="activeNameThreeClick"
</el-pagination> >
</div> </el-date-picker>
</el-tab-pane> </div>
<el-tab-pane label="文件" name="2"> <el-table
<div class="ct_box"> :data="allFile"
<div class="hds_time"> stripe
<el-date-picker style="width: 100%"
v-model="takeTime" :header-cell-style="{ background: '#fff' }"
type="datetimerange"
format="yyyy-MM-dd"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
align="right"
@change="activeNameThreeClick"
> >
</el-date-picker> <el-table-column prop="msgtype" label="类型">
</el-table-column>
<el-table-column label="名称">
<template slot-scope="scope">
{{ scope.row.file.filename }}
</template>
</el-table-column>
<el-table-column label="大小">
<template slot-scope="scope">
{{ filterSize(scope.row.file.filesize) }}
</template>
</el-table-column>
<el-table-column prop="action" label="来源">
<template slot-scope="scope">
{{ scope.row.tolist[0] }}
</template>
</el-table-column>
<el-table-column prop="action" label="操作">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click="downloadFile(scope.row)"
>下载</el-button
>
</template>
</el-table-column>
</el-table>
</div> </div>
<el-table </el-tab-pane>
:data="allFile" <el-tab-pane label="链接" name="3">
stripe <div class="ct_box">
style="width: 100%" <div class="hds_time">
:header-cell-style="{ background: '#fff' }" <el-date-picker
> v-model="takeTime"
<el-table-column prop="msgtype" label="类型"> type="datetimerange"
</el-table-column> format="yyyy-MM-dd"
<el-table-column label="名称"> range-separator="至"
<template slot-scope="scope"> start-placeholder="开始日期"
{{ scope.row.file.filename }} end-placeholder="结束日期"
</template> align="right"
</el-table-column> @change="activeNameThreeClick"
<el-table-column label="大小"> >
<template slot-scope="scope"> </el-date-picker>
{{ filterSize(scope.row.file.filesize) }} </div>
</template>
</el-table-column>
<el-table-column prop="action" label="来源">
<template slot-scope="scope">
{{ scope.row.tolist[0] }}
</template>
</el-table-column>
<el-table-column prop="action" label="操作">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click="downloadFile(scope.row)"
>下载</el-button
>
</template>
</el-table-column>
</el-table>
</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> </el-tab-pane>
</el-tab-pane> <el-tab-pane label="语音通话" name="4">
<el-tab-pane label="语音通话" name="4"> <div class="ct_box">
<div class="ct_box"> <div class="hds_time">
<div class="hds_time"> <el-date-picker
<el-date-picker v-model="takeTime"
v-model="takeTime" type="datetimerange"
type="datetimerange" format="yyyy-MM-dd"
format="yyyy-MM-dd" range-separator="至"
range-separator="至" start-placeholder="开始日期"
start-placeholder="开始日期" end-placeholder="结束日期"
end-placeholder="结束日期" align="right"
align="right" @change="activeNameThreeClick"
@change="activeNameThreeClick" >
</el-date-picker>
</div>
<el-table
:data="allVoice"
stripe
style="width: 100%"
:header-cell-style="{ background: '#fff' }"
> >
</el-date-picker> <el-table-column prop="date" label="发起人">
<template slot-scope="scope">
{{ scope.row.name }}
</template>
</el-table-column>
<el-table-column prop="name" label="通话时间">
<template slot-scope="scope">
{{ scope.row.msgTime }}
</template>
</el-table-column>
<el-table-column prop="address" label="时长">
<template slot-scope="scope">
{{ JSON.parse(scope.row.contact).play_length }}s
</template>
</el-table-column>
<el-table-column prop="address" label="操作">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click="voiceLook(JSON.parse(scope.row.contact))"
>查看</el-button
>
</template>
</el-table-column>
</el-table>
</div> </div>
<el-table </el-tab-pane>
:data="allVoice" </el-tabs>
stripe </div>
style="width: 100%" </el-col>
:header-cell-style="{ background: '#fff' }" </template>
>
<el-table-column prop="date" label="发起人">
<template slot-scope="scope">
{{ scope.row.name }}
</template>
</el-table-column>
<el-table-column prop="name" label="通话时间">
<template slot-scope="scope">
{{ scope.row.msgTime }}
</template>
</el-table-column>
<el-table-column prop="address" label="时长">
<template slot-scope="scope">
{{ JSON.parse(scope.row.contact).play_length }}s
</template>
</el-table-column>
<el-table-column prop="address" label="操作">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click="voiceLook(JSON.parse(scope.row.contact))"
>查看</el-button
>
</template>
</el-table-column>
</el-table>
</div>
</el-tab-pane>
</el-tabs>
</div>
</el-col>
</el-row> </el-row>
</div> </div>
</template> </template>
...@@ -286,7 +291,7 @@ export default { ...@@ -286,7 +291,7 @@ export default {
label: 'name', label: 'name',
children: 'children' children: 'children'
}, },
activeName: '1', activeName: '0',
activeNameThree: '0', activeNameThree: '0',
takeTime: '', takeTime: '',
fileData: [], fileData: [],
...@@ -362,7 +367,7 @@ export default { ...@@ -362,7 +367,7 @@ export default {
this.activeNameThreeClick(true) this.activeNameThreeClick(true)
}, },
activeNameThreeClick(page, group) { 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) { if (!!!this.chat.receiver) {
return //没有选择人 return //没有选择人
} }
...@@ -386,16 +391,16 @@ export default { ...@@ -386,16 +391,16 @@ export default {
msgType, msgType,
pageSize: '10', pageSize: '10',
pageNum: this.currentPage, pageNum: this.currentPage,
orderByColumn: "msg_time", orderByColumn: 'msg_time',
isAsc: "asc", isAsc: 'asc',
beginTime: this.takeTime ? yearMouthDay(this.takeTime[0]) : '', beginTime: this.takeTime ? yearMouthDay(this.takeTime[0]) : '',
endTime: this.takeTime ? yearMouthDay(this.takeTime[1]) : '' endTime: this.takeTime ? yearMouthDay(this.takeTime[1]) : ''
} }
if (this.activeName != '2') { if (this.activeName != '2') {
query.fromId = this.fromId query.fromId = this.fromId
query.toList = this.chat.receiver query.toList = this.chat.receiver
}else { } else {
query.roomId = this.chat.receiver query.roomId = this.chat.receiver
} }
content.chatList(query).then((res) => { content.chatList(query).then((res) => {
console.log(res.rows, 'ssss') console.log(res.rows, 'ssss')
...@@ -446,7 +451,7 @@ export default { ...@@ -446,7 +451,7 @@ export default {
if (flag) { if (flag) {
this.loading = true this.loading = true
} }
if(this.activeName == 0){ if (this.activeName == 0) {
content content
.getInternalChatList({ .getInternalChatList({
fromId: this.fromId fromId: this.fromId
...@@ -458,7 +463,7 @@ export default { ...@@ -458,7 +463,7 @@ export default {
.catch((err) => { .catch((err) => {
this.loading = false this.loading = false
}) })
}else if(this.activeName == 1){ } else if (this.activeName == 1) {
content content
.getExternalChatList({ .getExternalChatList({
fromId: this.fromId fromId: this.fromId
...@@ -470,7 +475,7 @@ export default { ...@@ -470,7 +475,7 @@ export default {
.catch((err) => { .catch((err) => {
this.loading = false this.loading = false
}) })
}else { } else {
content content
.getGroupChatList({ .getGroupChatList({
fromId: this.fromId fromId: this.fromId
...@@ -483,7 +488,6 @@ export default { ...@@ -483,7 +488,6 @@ export default {
this.loading = false this.loading = false
}) })
} }
}, },
filterNode(value, data) { filterNode(value, data) {
console.log(value, data) console.log(value, data)
...@@ -527,7 +531,6 @@ export default { ...@@ -527,7 +531,6 @@ export default {
.employ { .employ {
background: #f6f6f9; background: #f6f6f9;
min-height: 800px;
.hd_tabs { .hd_tabs {
background: #fff; background: #fff;
...@@ -560,12 +563,11 @@ export default { ...@@ -560,12 +563,11 @@ export default {
} }
.ct_boxFirst { .ct_boxFirst {
height: 800px !important;
} }
.ct_box { .ct_box {
background: white; background: white;
height: 710px; height: calc(100vh - 286px);
padding: 10px; padding: 10px;
overflow-y: scroll; overflow-y: scroll;
border-bottom: 1px solid #efefef; border-bottom: 1px solid #efefef;
......
<template> <template>
<div> <div>
<el-form :inline="true" :model="form" class="demo-form-inline"> <el-form :inline="true" :model="form" class="top-serach">
<el-row> <el-form-item label="员工名称">
<el-form-item label="员工名称"> <el-input v-model="form.Ename" placeholder="客户名称"></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="客户名称"></el-input>
<el-input v-model="form.Cname" placeholder="客户名称" style="width:300px"></el-input> </el-form-item>
</el-form-item> <el-form-item label="查找内容">
</el-row> <el-input v-model="form.Scontent" placeholder="查找内容"></el-input>
<el-row> </el-form-item>
<el-form-item label="查找内容"> <el-form-item label="时间范围">
<el-input v-model="form.Scontent" placeholder="查找内容" style="width:300px"></el-input> <el-date-picker
</el-form-item> v-model="form.Stime"
<el-form-item label="时间范围"> type="datetimerange"
<el-date-picker v-model="form.Stime" type="datetimerange" format='yyyy-MM-dd' range-separator="至" format="yyyy-MM-dd"
start-placeholder="开始日期" end-placeholder="结束日期" align="right"> range-separator="至"
</el-date-picker> start-placeholder="开始日期"
</el-form-item> end-placeholder="结束日期"
</el-row> align="right"
<el-row> >
<el-form-item> </el-date-picker>
<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 type="primary" @click="init">查询</el-button>
</el-form-item> </el-form-item>
</el-row> <el-form-item>
<el-button>导出列表</el-button>
</el-form-item>
</el-form> </el-form>
<div class="content"> <div>
<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="180"> <el-table-column prop="date" label="发送者" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<p v-if="scope.row">{{scope.row.name}}</p> <p v-if="scope.row">{{ scope.row.name }}</p>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="name" label=" 内容"> <el-table-column prop="name" label=" 内容">
<template slot-scope="scope"> <template slot-scope="scope">
<p v-if="!!scope.row.contact" class="emcode" v-html="scope.row.contact"></p> <p
<p v-else-if="!!!scope.row.contact&&scope.row.text">{{JSON.parse(scope.row.contact).content}}</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> </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
<el-option v-for="item in displayOptions" :key="item.value" :label="item.label" :value="item.value"> size="mini"
v-model="floorRange"
class="noborder"
@change="chechName(floorRange)"
>
<el-option
v-for="item in displayOptions"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option> </el-option>
</el-select> </el-select>
</template> </template>
<template slot-scope="scope"> <template slot-scope="scope">
<div class="pers"> <div class="pers">
<span v-if="scope.row.action==''"> <span v-if="scope.row.action == ''"> </span>
</span> <span v-else-if="scope.row.action == 'send'">
<span v-else-if="scope.row.action=='send'">
<span class="green"></span> <span class="green"></span>
已发送 已发送
</span> </span>
<span v-else-if="scope.row.action=='recall'"> <span v-else-if="scope.row.action == 'recall'">
<span class="red"></span> <span class="red"></span>
已撤回 已撤回
</span> </span>
<span v-else-if="scope.row.action=='switch'"> <span v-else-if="scope.row.action == 'switch'">
<span class="gay"></span> <span class="gay"></span>
企业日志 企业日志
</span> </span>
...@@ -74,157 +96,156 @@ ...@@ -74,157 +96,156 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-pagination background class="pagination" layout="prev, pager, next" :total="total" <el-pagination
@current-change="currentChange" :current-page="currentPage"> background
class="pagination"
layout="prev, pager, next"
:total="total"
@current-change="currentChange"
:current-page="currentPage"
>
</el-pagination> </el-pagination>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { import { content } from '@/api/conversation/content.js'
content import { yearMouthDay, parseTime } from '@/utils/common.js'
} from '@/api/conversation/content.js' export default {
import { data() {
yearMouthDay, return {
parseTime form: {
} from '@/utils/common.js' Ename: '',
export default { Cname: '',
data() { Scontent: '',
return { Stime: ''
form: { },
Ename: "", currentPage: 1,
Cname: '', total: 0,
Scontent: '', ac: '',
Stime: '' fileData: [],
floorRange: '全部',
displayOptions: [
{
value: '',
label: '全部'
}, },
currentPage: 1, {
total: 0, value: 'send',
ac: '', label: '已发送'
fileData: [], },
floorRange: '全部', {
displayOptions: [{ value: 'recall',
value: "", label: '已撤回'
label: "全部" },
}, {
{ value: 'switch',
value: "send", label: '切回企业日志'
label: "已发送" }
}, ]
{ }
value: "recall", },
label: "已撤回" mounted() {
}, this.init()
{ },
value: "switch", methods: {
label: "切回企业日志" currentChange(e) {
} this.currentPage = e
] this.init(true)
}
}, },
mounted() { init(flag) {
this.init() 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'
}
content.getFullSearchChatList(query).then((res) => {
this.fileData = res.rows
this.total = Number(res.total)
})
}, },
methods: { chechName(e) {
currentChange(e) { if (e == '') {
this.currentPage = e this.floorRange = '全部'
this.init(true) this.ac = ''
}, } else if (e == 'send') {
init(flag) { this.floorRange = '已发送'
if (!!!flag) { this.ac = 'send'
this.currentPage = 1 } else if (e == 'recall') {
} this.floorRange = '已撤回'
let query = { this.ac = 'recall'
name: this.form.Ename, } else {
customerName: this.form.Cname, this.floorRange = '切回企业日志'
contact: this.form.Scontent, this.ac = 'switch'
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"
}
content.getFullSearchChatList(query).then(res => {
this.fileData = res.rows;
this.total = Number(res.total)
})
},
chechName(e) {
if (e == '') {
this.floorRange = '全部'
this.ac = ''
} else if (e == 'send') {
this.floorRange = '已发送'
this.ac = 'send'
} else if (e == 'recall') {
this.floorRange = '已撤回'
this.ac = 'recall'
} else {
this.floorRange = '切回企业日志'
this.ac = 'switch'
}
console.log(e,this.ac)
this.init()
} }
console.log(e, this.ac)
this.init()
} }
} }
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.demo-form-inline { .demo-form-inline {
background: #f1f1f1; background: #f1f1f1;
padding: 18px 10px 0 10px; padding: 18px 10px 0 10px;
} }
.content { .content {
margin-top: 15px; margin-top: 15px;
padding: 10px; padding: 10px;
} }
.pers { .pers {
position: relative; position: relative;
.green { .green {
background: greenyellow; background: greenyellow;
position: absolute; position: absolute;
width: 6px; width: 6px;
height: 6px; height: 6px;
border-radius: 50%; border-radius: 50%;
top: 10px; top: 10px;
left: -8px; 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;
}
} }
.red {
background: red;
position: absolute;
width: 6px;
height: 6px;
border-radius: 50%;
top: 10px;
left: -8px;
}
.noborder { .gay {
/deep/ .el-input--mini .el-input__inner { background: gray;
width: 2px; position: absolute;
border: none width: 6px;
} height: 6px;
border-radius: 50%;
top: 10px;
left: -8px;
} }
}
.emcode /deep/ em { .noborder {
color: #ff0000; /deep/ .el-input--mini .el-input__inner {
width: 2px;
border: none;
} }
}
.emcode /deep/ em {
color: #ff0000;
}
</style> </style>
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
</el-input> </el-input>
</div> </div>
</div> </div>
<div class="ct_box ct_boxFirst"> <div class="ct_box ct_boxFirst" style="height: calc(100vh - 288px)">
<ul> <ul>
<li <li
v-for="(i, t) in CList" v-for="(i, t) in CList"
...@@ -289,7 +289,7 @@ export default { ...@@ -289,7 +289,7 @@ export default {
methods: { methods: {
chatFn(data) { chatFn(data) {
this.chatData = data this.chatData = data
console.log(data,"<><><><>><") console.log(data, '<><><><>><')
this.activeNameThreeClick() this.activeNameThreeClick()
}, },
groupFn(data) { groupFn(data) {
...@@ -317,7 +317,7 @@ export default { ...@@ -317,7 +317,7 @@ export default {
this.loading = true this.loading = true
} }
this.personList = [] this.personList = []
if(this.activeName == '0'){ if (this.activeName == '0') {
content content
.selectAloneChatList({ .selectAloneChatList({
fromId: this.fromId, fromId: this.fromId,
...@@ -330,7 +330,7 @@ export default { ...@@ -330,7 +330,7 @@ export default {
.catch((err) => { .catch((err) => {
this.loading = false this.loading = false
}) })
}else { } else {
content content
.getGroupChatList({ .getGroupChatList({
fromId: this.fromId fromId: this.fromId
...@@ -417,7 +417,7 @@ export default { ...@@ -417,7 +417,7 @@ export default {
}) })
}, },
chatMsgList() { chatMsgList() {
this.getChatList(); this.getChatList()
} }
}, },
mounted() { mounted() {
...@@ -440,7 +440,6 @@ export default { ...@@ -440,7 +440,6 @@ export default {
.employ { .employ {
background: #f6f6f9; background: #f6f6f9;
min-height: 800px;
.hd_tabs { .hd_tabs {
background: #fff; background: #fff;
...@@ -460,7 +459,6 @@ export default { ...@@ -460,7 +459,6 @@ export default {
.hd_tabs_content { .hd_tabs_content {
width: 100%; width: 100%;
min-height: 653px;
border-bottom: 1px solid #efefef; border-bottom: 1px solid #efefef;
} }
...@@ -472,13 +470,11 @@ export default { ...@@ -472,13 +470,11 @@ export default {
} }
.ct_boxFirst { .ct_boxFirst {
height: 700px;
} }
.ct_box { .ct_box {
background: white; background: white;
border-bottom: 1px solid #efefef; border-bottom: 1px solid #efefef;
min-height: 709px;
padding: 10px; padding: 10px;
overflow-y: scroll; overflow-y: scroll;
color: #999; color: #999;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!