Commit 6c9982b2 authored by 张伯涛's avatar 张伯涛

bug修改

parent 68fddf63
<template>
<el-drawer
title="统计明细"
:visible.sync="dialogManager.dialogVisible"
direction="rtl"
size="60%"
:before-close="
() => {
dialogManager.dialogVisible = false
}
"
>
<el-row class="search-form">
<el-col :span="12" :key="k" v-for="(i, k) in dialogManager.query">
<div class="search-form-item">
<div class="item-label">{{ i.name }}:</div>
<div class="item-content" :class="i.class">
{{ i.value }}
</div>
</div>
</el-col>
</el-row>
<div style="padding: 20px;">
<el-table :data="tableData" v-loading="loading" style="width: 100%">
<el-table-column type="index" width="70" label="序号" align="center">
<template slot-scope="scope">
<span>{{ scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column
v-for="(item, key) in dialogManager.tableColumn"
:key="key"
:prop="item.prop"
:label="item.label"
min-width="120"
align="center"
>
</el-table-column>
</el-table>
<div class="pagination-list" v-show="total > 0">
<pagination
:total="total"
:background="false"
layout="total, sizes, prev, pager, next, jumper"
:page.sync="queryParams.page"
:limit.sync="queryParams.rows"
@pagination="loadData"
/>
</div>
</div>
</el-drawer>
</template>
<script>
import page from '@/mixins/page'
import request from '@/utils/request'
export default {
props: {
dialogManager: {}
},
data() {
return {
tableData: [],
queryParams: {
page: 1,
rows: 20
}
}
},
mixins: [page],
methods: {
loadData() {
if (!this.dialogManager.url) {
return
}
this.loading = true
request({
url: '/blesson/pagingStatisticsDetail',
method: 'get',
params: {
...this.queryParams,
...{
lessonId: this.dialogManager.lessonId, //课程id
userId: this.dialogManager.userId, //用户id
viewType: 1, // 视图类型(0:课程;1:学员)
statisticalType: this.dialogManager.url
}
},
headers: {
// 'Content-Type': 'application/json'
'Content-Type': 'application/x-www-form-urlencode'
}
})
.then(res => {
console.log('cehhsdd')
this.tableData = res.data.records
console.log(this.tableData)
console.log(this.dialogManager.tableColumn)
this.total = res.data.total
this.loading = false
})
.catch(error => {
if (error.msg) {
this.$message.error(error.msg)
}
this.loading = false
})
}
},
watch: {
'dialogManager.dialogVisible'(val) {
if (val) {
this.loadData()
}
}
}
}
</script>
<style></style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment