Commit 9fb865eb by 匡雅琴

表格调整

1 parent f492d89e
......@@ -2,10 +2,11 @@
<div>
<glsx-combi-form ref="staffSendFormRef" :formObj="searchForm" :formData="staffSendFormData" :inline="true">
<span slot="footer" slot-scope="scope" class="select-pro">
<el-button type="primary" :size="size" @click="handleSearch(scope)">查询</el-button>
<el-button type="primary" :size="size" @click="getListApi">查询</el-button>
<el-button type="default" :size="size" @click="handleReset(scope)">重置</el-button>
</span>
</glsx-combi-form>
<GLTable ref="staffSendDetailRef" :hasPage="false" @sortChange="sortChange" @setTableFinishFun="setTableFinishFun" :pageConf="pageConf" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams"></GLTable>
<GLTable ref="staffSendDetailRef" :hasPage="false" :tableData="sendStaffTableData" @sortChange="sortChange" @setTableFinishFun="setTableFinishFun" :beforeSearchFn="beforeSearchFn" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams"></GLTable>
</div>
</template>
......@@ -32,8 +33,154 @@ export default {
prefixIcon: 'el-icon-search'
}
],
getListApi: this.$apis.material.sendDetailPage,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
// getListApi: this.$apis.material.sendDetailPage,
// pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
sendStaffTableData: [
{
id: '2',
employeeName: 'kyd',
sendNumber: 3,
readNumber: 5,
readPeopleNumber: 8,
openRate: 10
},
{
id: '2',
employeeName: 'kyd',
sendNumber: 3,
readNumber: 5,
readPeopleNumber: 8,
openRate: 10
},
{
id: '2',
employeeName: 'kyd',
sendNumber: 3,
readNumber: 5,
readPeopleNumber: 8,
openRate: 10
},
{
id: '2',
employeeName: 'kyd',
sendNumber: 3,
readNumber: 5,
readPeopleNumber: 8,
openRate: 10
},
{
id: '2',
employeeName: 'kyd',
sendNumber: 3,
readNumber: 5,
readPeopleNumber: 8,
openRate: 10
},
{
id: '2',
employeeName: 'kyd',
sendNumber: 3,
readNumber: 5,
readPeopleNumber: 8,
openRate: 10
},
{
id: '2',
employeeName: 'kyd',
sendNumber: 3,
readNumber: 8,
readPeopleNumber: 8,
openRate: 10
},
{
id: '2',
employeeName: 'kyd',
sendNumber: 5,
readNumber: 5,
readPeopleNumber: 8,
openRate: 10
},
{
id: '2',
employeeName: 'kyd',
sendNumber: 9,
readNumber: 6,
readPeopleNumber: 8,
openRate: 10
},
{
id: '2',
employeeName: 'kyd',
sendNumber: 9,
readNumber: 6,
readPeopleNumber: 8,
openRate: 10
},
{
id: '2',
employeeName: 'kyd',
sendNumber: 9,
readNumber: 6,
readPeopleNumber: 8,
openRate: 10
},
{
id: '2',
employeeName: 'kyd',
sendNumber: 9,
readNumber: 6,
readPeopleNumber: 8,
openRate: 10
},
{
id: '2',
employeeName: 'kyd',
sendNumber: 9,
readNumber: 6,
readPeopleNumber: 8,
openRate: 10
},
{
id: '2',
employeeName: 'kyd',
sendNumber: 9,
readNumber: 6,
readPeopleNumber: 8,
openRate: 10
},
{
id: '2',
employeeName: 'kyd',
sendNumber: 9,
readNumber: 6,
readPeopleNumber: 8,
openRate: 10
},
{
id: '2',
employeeName: 'kyd',
sendNumber: 9,
readNumber: 6,
readPeopleNumber: 8,
openRate: 10
},
{
id: '2',
employeeName: 'kyd',
sendNumber: 9,
readNumber: 6,
readPeopleNumber: 8,
openRate: 10
},
{
id: '2',
employeeName: 'kyd',
sendNumber: 9,
readNumber: 6,
readPeopleNumber: 8,
openRate: 10
}
],
tableParams: {
listName: 'data',
tableOption: false,
......@@ -45,18 +192,12 @@ export default {
{
label: '发送次数',
prop: 'sendNumber',
sortable: true,
formatter: cellVal => {
return cellVal.sendNumber
}
sortable: true
},
{
label: '阅读次数',
prop: 'readNumber',
sortable: true,
formatter: cellVal => {
return cellVal.readNumber
}
sortable: true
},
{
label: '阅读人数',
......@@ -70,37 +211,44 @@ export default {
}
}
},
mounted() {
this.getListApi()
},
methods: {
// 搜索
handleSearch() {
this.$refs.staffSendDetailRef.refreshTable()
},
// handleSearch() {
// this.$refs.staffSendDetailRef.refreshTable()
// },
// 重置
handleReset() {
this.searchForm = {
staffName: '',
materialId: this.$route.query.id
}
this.handleSearch()
this.getListApi()
},
setTableFinishFun() {
//接收到的数据为空
this.$refs.staffSendDetailRef.data.length ? (this.$refs.staffSendDetailRef.tableHeightValues = '') : this.$refs.staffSendDetailRef.setTableHeightFun()
},
sortChange({ column, prop, order }) {
// 添加-排序相关参数
console.log(prop, order, '------');
if (order === 'ascending') {
this.searchForm.sort = 2
} else {
this.searchForm.sort = 1
}
if (prop === 'sendNumber') {
this.searchForm.sortValue = 2
} else {
this.searchForm.sortValue = 1
}
this.handleSearch()
order === 'ascending' ? (this.searchForm.sort = 2) : (this.searchForm.sort = 1)
prop === 'sendNumber' ? (this.searchForm.sortValue = 2) : (this.searchForm.sortValue = 1)
this.getListApi()
},
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
return params
},
getListApi() {
var params = this.getParams()
this.$apis.material.sendDetailPage(params).then(res => {
this.sendStaffTableData = res
res.length ? (this.$refs.staffSendDetailRef.tableHeightValues = '230px') : this.$refs.staffSendDetailRef.setTableHeightFun()
// this.$refs.staffSendDetailRef.tableHeightValues = '100px'
// this.$refs.staffSendDetailRef.tableHeightValues = '230px'
})
}
}
}
......
......@@ -131,6 +131,7 @@ export default {
materialGroupDialog: false,
introductionDialog: false,
boxHeight: '',
tableHeight: '',
businessTypes: [],
materialGroupName: '',
materialFormData: [
......@@ -341,6 +342,7 @@ export default {
let clientHeight = document.documentElement.clientHeight
let offTop = document.querySelector('.tabelList').offsetTop
this.boxHeight = clientHeight - offTop - 80 + 'px'
this.tableHeight = clientHeight - offTop - 130 + 'px'
this.findAllDictData('business_type')
this.firstCome()
this.getListApi()
......@@ -444,6 +446,7 @@ export default {
// 获取素材列表
getTableList(params) {
this.$apis.material.materialList(params).then(res => {
console.log(res, '------------');
let data = res
let tableData = []
data.forEach(item => {
......@@ -463,8 +466,9 @@ export default {
tableData.push(item)
})
this.materialTableData = tableData
this.tableTotal = res.count
res.count ? (this.$refs.materialRef.tableHeightValues = '') : this.$refs.materialRef.setTableHeightFun()
this.tableTotal = res.length
this.$refs.materialRef.tableHeightValues = this.tableHeight
// res.length ? (this.$refs.materialRef.tableHeightValues = this.tableHeight) : (this.$refs.materialRef.tableHeightValues = '230px')
})
},
getListApi() {
......@@ -561,7 +565,7 @@ ul {
border-right: 1px solid #e8e8ea;
}
.right {
overflow: auto;
// overflow: auto;
.groupTitle {
padding: 20px 0 16px 19px;
font-weight: 600;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!