Commit e677db5d by 怪兽?别跑

bug修复

1 parent df212675
...@@ -9,7 +9,8 @@ ...@@ -9,7 +9,8 @@
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"
align="right" align="right"
@change="getList(1)"></el-date-picker> @change="getList(1)"
></el-date-picker>
<div class="list"> <div class="list">
<template v-if="list.length"> <template v-if="list.length">
<chatList :queryChat="queryChat" v-if="'all,image,video,link,'.includes(type)" :data="list"></chatList> <chatList :queryChat="queryChat" v-if="'all,image,video,link,'.includes(type)" :data="list"></chatList>
...@@ -18,8 +19,9 @@ ...@@ -18,8 +19,9 @@
v-else-if="type == 'file'" v-else-if="type == 'file'"
:data="list" :data="list"
stripe stripe
style="width: 100%" style="width: 100%;"
:header-cell-style="{ background: '#fff' }"> :header-cell-style="{ background: '#fff' }"
>
<!-- <el-table-column prop="msgtype" label="类型"> </el-table-column> --> <!-- <el-table-column prop="msgtype" label="类型"> </el-table-column> -->
<el-table-column label="名称"> <el-table-column label="名称">
<template slot-scope="{ row }"> <template slot-scope="{ row }">
...@@ -36,6 +38,11 @@ ...@@ -36,6 +38,11 @@
{{ row.name }} {{ row.name }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="发送时间">
<template slot-scope="{ row }">
{{ row.msgTime }}
</template>
</el-table-column>
<el-table-column prop="action" label="操作"> <el-table-column prop="action" label="操作">
<template slot-scope="{ row }"> <template slot-scope="{ row }">
<el-button type="text" @click="downloadFile(row)">下载</el-button> <el-button type="text" @click="downloadFile(row)">下载</el-button>
...@@ -47,7 +54,8 @@ ...@@ -47,7 +54,8 @@
v-else-if="'voice,meeting_voice_call'.includes(type)" v-else-if="'voice,meeting_voice_call'.includes(type)"
:data="list" :data="list"
stripe stripe
:header-cell-style="{ background: '#fff' }"> :header-cell-style="{ background: '#fff' }"
>
<el-table-column prop="date" label="发起人"> <el-table-column prop="date" label="发起人">
<template slot-scope="{ row }"> <template slot-scope="{ row }">
{{ row.name }} {{ row.name }}
...@@ -100,130 +108,131 @@ ...@@ -100,130 +108,131 @@
layout="prev, pager, next" layout="prev, pager, next"
:current-page.sync="currentPage" :current-page.sync="currentPage"
@current-change="getList" @current-change="getList"
:total="total" /> :total="total"
/>
</div> </div>
</template> </template>
<script> <script>
import chatList from './chatList.vue' import chatList from './chatList.vue'
import * as api from '@/api/conversation/content.js' import * as api from '@/api/conversation/content.js'
import Voice from '@/components/Voice' import Voice from '@/components/Voice'
import { download } from '@/api/common.js' import { download } from '@/api/common.js'
import { diffDate } from '@/utils/index' import { diffDate } from '@/utils/index'
import { parseTime } from '@/utils/common' import { parseTime } from '@/utils/common'
export default { export default {
name: '', name: '',
components: { chatList, Voice }, components: { chatList, Voice },
props: { props: {
// 消息收发者 // 消息收发者
queryChat: { queryChat: {
type: Object, type: Object,
default: () => ({}), default: () => ({})
}, },
// 消息类型 // 消息类型
type: { type: {
type: String | Number, type: String | Number,
default: 0, default: 0
},
},
data() {
return {
loading: false,
currentPage: 1,
dateRange: [],
list: [],
total: 0,
}
},
computed: {},
watch: {
queryChat() {
this.getList(1)
},
},
created() {
this.getList(1)
},
mounted() {},
methods: {
setDate(start, end) {
return diffDate(end, parseTime(start))
},
getList(page) {
// if (!this.queryChat.fromId) {
// return //没有选择人
// }
this.loading = true
console.log(this.type)
let query = {
msgType: this.type == 'all' ? '' : this.type,
pageSize: '10',
orderByColumn: 't.msg_time',
isAsc: 'desc',
} }
if (this.dateRange) { },
query.beginTime = this.dateRange[0] data() {
query.endTime = this.dateRange[1] return {
} else { loading: false,
query.beginTime = '' currentPage: 1,
query.endTime = '' dateRange: [],
list: [],
total: 0
} }
page && (query.pageNum = this.currentPage = page)
Object.assign(query, this.queryChat)
api
.getChatList(query)
.then((res) => {
this.total = ~~res.total
this.list = res.rows
this.loading = false
})
.catch((err) => {
this.loading = false
})
}, },
filterSize(size) { computed: {},
if (!size) return '' watch: {
if (size < pow1024(1)) return size + ' B' queryChat() {
if (size < pow1024(2)) return (size / pow1024(1)).toFixed(2) + ' KB' this.getList(1)
if (size < pow1024(3)) return (size / pow1024(2)).toFixed(2) + ' MB'
if (size < pow1024(4)) return (size / pow1024(3)).toFixed(2) + ' GB'
return (size / pow1024(4)).toFixed(2) + ' TB'
function pow1024(num) {
return Math.pow(1024, num)
} }
}, },
downloadFile(row) { created() {
this.$confirm('是否确认下载该文件?', '警告', { this.getList(1)
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then((response) => {
this.downloadNet(JSON.parse(row.contact).attachment, JSON.parse(row.contact).filename)
})
.catch(function () {})
}, },
}, mounted() {},
} methods: {
setDate(start, end) {
return diffDate(end, parseTime(start))
},
getList(page) {
// if (!this.queryChat.fromId) {
// return //没有选择人
// }
this.loading = true
console.log(this.type)
let query = {
msgType: this.type == 'all' ? '' : this.type,
pageSize: '10',
orderByColumn: 't.msg_time',
isAsc: 'desc'
}
if (this.dateRange) {
query.beginTime = this.dateRange[0]
query.endTime = this.dateRange[1]
} else {
query.beginTime = ''
query.endTime = ''
}
page && (query.pageNum = this.currentPage = page)
Object.assign(query, this.queryChat)
api
.getChatList(query)
.then((res) => {
this.total = ~~res.total
this.list = res.rows
this.loading = false
})
.catch((err) => {
this.loading = false
})
},
filterSize(size) {
if (!size) return ''
if (size < pow1024(1)) return size + ' B'
if (size < pow1024(2)) return (size / pow1024(1)).toFixed(2) + ' KB'
if (size < pow1024(3)) return (size / pow1024(2)).toFixed(2) + ' MB'
if (size < pow1024(4)) return (size / pow1024(3)).toFixed(2) + ' GB'
return (size / pow1024(4)).toFixed(2) + ' TB'
function pow1024(num) {
return Math.pow(1024, num)
}
},
downloadFile(row) {
this.$confirm('是否确认下载该文件?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then((response) => {
this.downloadNet(JSON.parse(row.contact).attachment, JSON.parse(row.contact).filename)
})
.catch(function () {})
}
}
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.list { .list {
height: calc(100vh - 420px); height: calc(100vh - 420px);
margin-top: 10px; margin-top: 10px;
background: white; background: white;
overflow-y: scroll; overflow-y: scroll;
border-bottom: 1px solid #efefef; border-bottom: 1px solid #efefef;
color: #999; color: #999;
text-align: center; text-align: center;
::-webkit-scrollbar { ::-webkit-scrollbar {
display: none; display: none;
}
}
.chatListClassTab {
padding: 10px 10px 0;
background: #fff;
text-align: left;
} }
}
.chatListClassTab {
padding: 10px 10px 0;
background: #fff;
text-align: left;
}
</style> </style>
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<el-table :data="dataList" @selection-change="handleSelectionChange"> <el-table :data="dataList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="员工名称" align="center" prop="businessName" show-overflow-tooltip /> <el-table-column label="员工名称" align="center" prop="businessName" show-overflow-tooltip />
<el-table-column label="每日添加上线" align="center" width="150" prop="businessNumber" show-overflow-tooltip> <el-table-column label="每日添加上限" align="center" width="150" prop="businessNumber" show-overflow-tooltip>
<template slot-scope="scope"> <template slot-scope="scope">
<el-input-number <el-input-number
size="mini" size="mini"
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!