fix:每个分页的条数改为20

This commit is contained in:
xiongchengqiang 2020-05-20 16:24:24 +08:00
parent 66d2716924
commit 7884b74565
9 changed files with 119 additions and 105 deletions

View File

@ -1,9 +1,5 @@
<template>
<el-dialog
title="日志列表"
:close-on-click-modal="false"
:visible.sync="visible"
width="75%">
<el-dialog title="日志列表" :close-on-click-modal="false" :visible.sync="visible" width="75%">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="handleGetTableList()">
<el-form-item>
<el-input v-model="dataForm.id" placeholder="任务ID" clearable></el-input>
@ -20,11 +16,23 @@
<el-table-column prop="status" header-align="center" align="center" label="状态">
<template slot-scope="scope">
<el-tag v-if="scope.row.status === 0" size="small">成功</el-tag>
<el-tag v-else @click.native="handleShowErrorInfo(scope.row.logId)" size="small" type="danger" style="cursor: pointer;">失败</el-tag>
<el-tag
v-else
@click.native="handleShowErrorInfo(scope.row.logId)"
size="small"
type="danger"
style="cursor: pointer;"
>失败</el-tag>
</template>
</el-table-column>
<el-table-column prop="times" header-align="center" align="center" label="耗时(单位: 毫秒)"></el-table-column>
<el-table-column prop="createTime" header-align="center" align="center" width="180" label="执行时间"></el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
width="180"
label="执行时间"
></el-table-column>
</el-table>
<el-pagination
@size-change="handleChangeSize"
@ -33,71 +41,71 @@
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
layout="total, sizes, prev, pager, next, jumper"
></el-pagination>
</el-dialog>
</template>
<script>
import { apiSysScheduleLogList, apiSysScheduleLogInfo } from '@/api/api_sys'
import { apiSysScheduleLogList, apiSysScheduleLogInfo } from '@/api/api_sys'
export default {
data () {
return {
visible: false,
dataForm: {
id: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false
}
export default {
data () {
return {
visible: false,
dataForm: {
id: ''
},
dataList: [],
pageIndex: 1,
pageSize: 20,
totalPage: 0,
dataListLoading: false
}
},
methods: {
init () {
this.visible = true
this.handleGetTableList()
},
methods: {
init () {
this.visible = true
this.handleGetTableList()
},
//
handleGetTableList () {
apiSysScheduleLogList({
'page': this.pageIndex,
'limit': this.pageSize,
'jobId': this.dataForm.id
}).then(res => {
if (res && res.code === 0) {
this.dataList = res.page.list
this.totalPage = res.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
handleChangeSize (val) {
this.pageSize = val
this.pageIndex = 1
this.handleGetTableList()
},
//
handleChangeCurrent (val) {
this.pageIndex = val
this.handleGetTableList()
},
//
handleShowErrorInfo (id) {
apiSysScheduleLogInfo({}, `/${id}`).then(res => {
if (res && res.code === 0) {
this.$alert(res.log.error)
} else {
this.$message.error(res.msg)
}
})
}
//
handleGetTableList () {
apiSysScheduleLogList({
'page': this.pageIndex,
'limit': this.pageSize,
'jobId': this.dataForm.id
}).then(res => {
if (res && res.code === 0) {
this.dataList = res.page.list
this.totalPage = res.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
handleChangeSize (val) {
this.pageSize = val
this.pageIndex = 1
this.handleGetTableList()
},
//
handleChangeCurrent (val) {
this.pageIndex = val
this.handleGetTableList()
},
//
handleShowErrorInfo (id) {
apiSysScheduleLogInfo({}, `/${id}`).then(res => {
if (res && res.code === 0) {
this.$alert(res.log.error)
} else {
this.$message.error(res.msg)
}
})
}
}
}
</script>

View File

@ -121,7 +121,7 @@ export default {
},
dataList: [],
pageIndex: 1,
pageSize: 10,
pageSize: 20,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],

View File

@ -61,7 +61,7 @@ export default {
dataForm: {},
dataList: [],
pageIndex: 1,
pageSize: 10,
pageSize: 20,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],

View File

@ -35,8 +35,8 @@
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" :loading="loading" @click="getTable">查询</el-button>
<el-button :loading="loading" @click="clear">重置</el-button>
<el-button type="primary" :loading="loading" @click="handleGetTable">查询</el-button>
<el-button @click="clear">重置</el-button>
</el-form-item>
</el-form>
</div>
@ -77,6 +77,7 @@
@current-change="handleCurrentChange"
:current-page.sync="query.currentPage"
:page-sizes="[10, 20, 50]"
:page-size="query.limit"
layout="total, sizes, prev, pager, next"
:total="query.pageTotal"
></el-pagination>
@ -146,7 +147,7 @@ export default {
loading: false,
query: {
page: 1,
limit: 10,
limit: 20,
pageTotal: 0,
departmentId: null
}
@ -179,25 +180,21 @@ export default {
} else {
this.$message.error(result.msg)
}
console.log('result: ', result)
},
handleNodeClick (data) {
// highlight - current
this.query.departmentId = data.departmentId
this.handleGetTableList()
console.log('data', data)
},
//
async handleGetMenuList () {
const result = await apiOrganizationList()
console.log('result: ', result)
this.menuList = result
},
// { page: 0, limit: 5 }
async handleGetTableList (id) {
this.loading = true
let result = await apiEmployeesList(Object.assign({}, this.query, { limit: this.query.pageSize }))
console.log('result: ', result)
let result = await apiEmployeesList(Object.assign({}, this.query, { limit: this.query.limit }))
if (result.code === 0) {
this.tableData = result.page.list
this.query.pageTotal = result.page.totalCount
@ -216,17 +213,18 @@ export default {
this.$refs.treeList.setCurrentKey()
this.handleGetTableList()
},
getTable () {
async handleGetTable () {
this.query.page = 1
this.handleGetTableList()
this.loading = true
await this.handleGetTableList()
this.loading = false
},
handleCurrentChange (val) {
console.log('val: ', val)
this.query.page = val
this.handleGetTableList()
},
handleSizeChange (val) {
this.query.pageSize = val
this.query.limit = val
this.handleGetTableList()
},
//
@ -234,7 +232,6 @@ export default {
console.log(tab, event)
},
async handleView (data) {
console.log('data: ', data)
await this.getEmployeesInfo(data.staffId)
}
}

View File

@ -1,26 +1,28 @@
<!-- -->
<template>
<div class="staff-archives">
<el-card>
<query-form @submit="submit" />
</el-card>
<el-card>
<employees-number :dataInfo="dataInfo" />
</el-card>
<div class="staff-archives-chart">
<el-card v-if="dataInfo.genderDistribution">
<chart-form :dataInfo="dataInfo.genderDistribution" title="性别分布" />
<el-main :loding="true">
<el-card>
<query-form @submit="submit" />
</el-card>
<el-card v-if="dataInfo.ageDistribution">
<chart-form :dataInfo="dataInfo.ageDistribution" title="年龄分布" />
<el-card>
<employees-number :dataInfo="dataInfo" />
</el-card>
<el-card v-if="dataInfo.jobSeniorityDistribution">
<chart-form :dataInfo="dataInfo.jobSeniorityDistribution" title="岗位工龄分布" />
</el-card>
<el-card v-if="dataInfo.educationDistribution">
<chart-form :dataInfo="dataInfo.educationDistribution" title="学历分布" />
</el-card>
</div>
<div class="staff-archives-chart">
<el-card v-if="dataInfo.genderDistribution">
<chart-form :dataInfo="dataInfo.genderDistribution" title="性别分布" />
</el-card>
<el-card v-if="dataInfo.ageDistribution">
<chart-form :dataInfo="dataInfo.ageDistribution" title="年龄分布" />
</el-card>
<el-card v-if="dataInfo.jobSeniorityDistribution">
<chart-form :dataInfo="dataInfo.jobSeniorityDistribution" title="岗位工龄分布" />
</el-card>
<el-card v-if="dataInfo.educationDistribution">
<chart-form :dataInfo="dataInfo.educationDistribution" title="学历分布" />
</el-card>
</div>
</el-main>
</div>
</template>
@ -59,7 +61,14 @@ export default {
},
//
async initData () {
this.handleGetEmployeessItuation()
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
await this.handleGetEmployeessItuation()
loading.close()
},
submit (data) {
this.handleGetEmployeessItuation(data)

View File

@ -63,7 +63,7 @@ export default {
},
dataList: [],
pageIndex: 1,
pageSize: 10,
pageSize: 20,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],

View File

@ -61,7 +61,7 @@ export default {
},
dataList: [],
pageIndex: 1,
pageSize: 10,
pageSize: 20,
totalPage: 0,
dataListLoading: false,
selectionDataList: []

View File

@ -86,7 +86,7 @@ export default {
},
dataList: [],
pageIndex: 1,
pageSize: 10,
pageSize: 20,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],

View File

@ -87,7 +87,7 @@ export default {
},
dataList: [],
pageIndex: 1,
pageSize: 10,
pageSize: 20,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],