Commit e677db5d by 怪兽?别跑

bug修复

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