会话存档

This commit is contained in:
liuye
2023-06-08 16:53:49 +08:00
parent 4392aed3f6
commit 7e0bc1ef61
2 changed files with 43 additions and 52 deletions

View File

@@ -26,7 +26,7 @@ export default {
}, },
data() { data() {
return { return {
component: "Detail", component: "List",
params: {}, params: {},
include: [], include: [],
}; };

View File

@@ -47,46 +47,44 @@
<el-input size="small" placeholder="输入搜索内容" v-model="searchMsg" clearable <el-input size="small" placeholder="输入搜索内容" v-model="searchMsg" clearable
@clear="msgCurrent = 1, searchMsg = '', getMsgListInit()" suffix-icon="iconfont iconSearch" @clear="msgCurrent = 1, searchMsg = '', getMsgListInit()" suffix-icon="iconfont iconSearch"
v-throttle="() => {(msgCurrent = 1), getMsgListInit();}"/> v-throttle="() => {(msgCurrent = 1), getMsgListInit();}"/>
<ai-download :instance="instance" url="/app/appconvenientaddressbook/export" :params="search" fileName="会话存档" <!-- <ai-download :instance="instance" url="/app/appconvenientaddressbook/export" :params="search" fileName="会话存档"
:disabled="msgList.length == 0"> :disabled="msgList.length == 0">
<el-button icon="iconfont iconExported" :disabled="msgList.length == 0">导出</el-button> <el-button icon="iconfont iconExported" :disabled="msgList.length == 0">导出</el-button>
</ai-download> </ai-download> -->
</div> </div>
</div> </div>
<div class="content-right-info"> <div class="content-right-info">
<div v-for="(item, index) in msgList" :key="index"> <div v-for="(item, index) in msgList" :key="index">
<div class="item item-right" v-if="item.userId == user.wxUserId"> <div class="item" :class="item.userId == user.wxUserId ? 'item-right' : 'item-left'">
<p class="time" v-if="index == 0">{{item.createTime}}</p> <p class="time" v-if="index == 0">{{item.createTime}}</p>
<div class="item-content-flex"> <div class="item-content-flex">
<!-- <i class="el-icon-warning"></i> --> <!-- <i class="el-icon-warning" v-if="item.userId == user.wxUserId"></i> -->
<img :src="item.userAvatar" alt="" class="user-img" v-if="item.userId != user.wxUserId">
<div class="content" v-if="item.msgType == 'text'"> <div class="content" v-if="item.msgType == 'text'">
<span></span> <span></span>
<p>{{item.content}}</p> <p>{{item.content}}</p>
</div> </div>
<div class="img-list" v-if="item.msgType == 'image'"> <div class="img-list" v-if="item.msgType == 'image'">
<img :src="item.sdkFileUrl" alt="" v-viewer> <img :src="item.sdkFileUrl" alt="" v-viewer>
</div> </div>
<div class="voice-info">
<ai-audio :src="item.sdkFileUrl" skin="flat" v-if="item.msgType == 'voice'" /> <div class="voice-info" v-if="item.msgType == 'voice'">
<ai-audio :src="item.sdkFileUrl" skin="flat" />
</div> </div>
<img :src="item.userAvatar" alt="" class="user-img">
</div> <video style="width: 300px; object-fit: fill;" controls :src="item.sdkFileUrl" v-if="item.msgType == 'video'"></video>
</div>
<div class="item item-left" v-else> <ai-file-list v-if="item.msgType == 'file'"
<p class="time" v-if="index == 0">{{item.createTime}}</p> :fileList="item.files"
<div class="item-content-flex"> :fileOps="{ name: 'name', size: 'fileSizeStr' }"
<img :src="item.userAvatar" alt="" class="user-img"> ></ai-file-list>
<div class="content" v-if="item.msgType == 'text'">
<span></span> <div class="revoke-text" v-if="item.msgType == 'revoke'">{{item.userName}}{{item.msgSendTime.substring(0, 16)}}撤回了一条消息</div>
<p>{{item.content}}</p>
</div> <img :src="item.userAvatar" alt="" class="user-img" v-if="item.userId == user.wxUserId">
<div class="img-list" v-if="item.msgType == 'image'"> <!-- <i class="el-icon-warning" v-if="item.userId != user.wxUserId"></i> -->
<img :src="item.sdkFileUrl" alt="" v-viewer>
</div>
<div class="voice-info">
<ai-audio :src="item.sdkFileUrl" skin="flat" v-if="item.msgType == 'voice'" />
</div>
<!-- <i class="el-icon-warning"></i> -->
</div> </div>
</div> </div>
</div> </div>
@@ -131,12 +129,12 @@
msgType: 0, msgType: 0,
msgTypeList: [ msgTypeList: [
{name: '全部', value: ''}, {name: '全部', value: ''},
{name: '文本', value: 'text'}, {name: '图片/视频', value: 'imagevideo'},
{name: '图片', value: 'image'},
{name: '语音', value: 'voice'}, {name: '语音', value: 'voice'},
{name: '文件', value: 'file'},
], ],
searchMsg: '', searchMsg: '',
id: 'LiuYe' id: ''
} }
}, },
computed: { computed: {
@@ -148,7 +146,6 @@
this.id = this.params.id this.id = this.params.id
this.getList() this.getList()
} }
this.getList()
}, },
methods: { methods: {
@@ -188,10 +185,11 @@
this.instance.post(`/app/appsessionarchiveinfo/listByUser`, null, { this.instance.post(`/app/appsessionarchiveinfo/listByUser`, null, {
params: { params: {
userId: this.id, userId: this.id,
type: this.tabIndex, // type: this.tabIndex,
size: 20, size: 20,
current: this.msgCurrent, current: this.msgCurrent,
msgType: this.msgTypeList[this.msgType].value, msgType: this.msgTypeList[this.msgType].value,
// msgType: 'file',
toUserId: this.list[this.leftActiveIndex].type == 1 ? '' : this.list[this.leftActiveIndex].toUserId, toUserId: this.list[this.leftActiveIndex].type == 1 ? '' : this.list[this.leftActiveIndex].toUserId,
roomId: this.list[this.leftActiveIndex].type == 1 ? this.list[this.leftActiveIndex].roomId : '', roomId: this.list[this.leftActiveIndex].type == 1 ? this.list[this.leftActiveIndex].roomId : '',
type: this.list[this.leftActiveIndex].type, type: this.list[this.leftActiveIndex].type,
@@ -201,6 +199,11 @@
} }
}).then(res => { }).then(res => {
if (res.code === 0) { if (res.code === 0) {
res.data.records.map((item) => {
if(item.msgType == 'file') {
item.files = [{url: item.sdkFileUrl, accessUrl: item.sdkFileUrl, name: item.sdkFileName, fileSizeStr: item.fileSizeStr}]
}
})
this.msgList = res.data.records this.msgList = res.data.records
this.msgTotal = res.data.total || 0 this.msgTotal = res.data.total || 0
} }
@@ -233,26 +236,6 @@
this.msgType = index this.msgType = index
this.getMsgListInit() this.getMsgListInit()
}, },
onConfirm() {
this.$refs.form.validate((valid) => {
if (valid) {
this.instance.post(`/app/appintegralmerchandiseorder/writeOffOrder`, null, {
params: {
code: this.form.code,
id: this.params.id,
}
}).then(res => {
if (res.code == 0) {
this.isShow = false
this.getInfo(this.params.id)
this.$message.success('核销成功')
}
})
}
})
},
cancel () { cancel () {
this.$emit('change', { this.$emit('change', {
type: 'List', type: 'List',
@@ -470,6 +453,14 @@
color: #f46; color: #f46;
margin-top: 8px; margin-top: 8px;
} }
.revoke-text {
line-height: 44px;
padding: 0 6px;
border-radius: 4px;
background-color: #EEE;
color: #999;
margin-top: 4px;
}
} }
} }
.item-left { .item-left {