Files
cmanager/src/views/report/postInfo.vue

137 lines
3.2 KiB
Vue
Raw Normal View History

2024-03-31 14:50:51 +08:00
<template>
2024-03-31 16:52:37 +08:00
<basic-container style="position: relative">
<avue-crud
:data="infoData"
:option="options"
:search.sync="search"
2024-04-01 17:07:27 +08:00
:table-loading="visible"
2024-03-31 16:52:37 +08:00
:page.sync="infoPages"
@search-change="searchChange"
@search-reset="resetChange"
@size-change="sizeChange"
@current-change="currentChange"
>
</avue-crud>
2024-03-31 14:50:51 +08:00
</basic-container>
</template>
<script>
2024-03-31 16:52:37 +08:00
import {roleCount} from '@/api/report/report'
import CustomLoading from "@/components/Custom-Loading/index.vue";
import { dateFormat } from "@/util/date";
const pages = { total: 0, size: 10, currentPage: 1 }
const baseOptions = {
dateBtn: false,
addBtn: false,
editBtn: false,
delBtn: false,
height: "auto",
reserveSelection: false,
border: true,
columnBtn: false,
refreshBtn: false,
menu: false,
tip: false,
2024-03-31 17:08:12 +08:00
searchMenuSpan: 6,
2024-03-31 16:52:37 +08:00
selection: false,
2024-03-31 20:32:05 +08:00
headerAlign: 'center',
2024-03-31 16:52:37 +08:00
}
2024-03-31 14:50:51 +08:00
export default {
2024-03-31 16:52:37 +08:00
components: {CustomLoading},
2024-03-31 14:50:51 +08:00
data() {
return {
2024-03-31 16:52:37 +08:00
infoPages: Object.assign({}, pages),
infoData: [],
visible: false,
search: {},
2024-03-31 14:50:51 +08:00
}
},
2024-03-31 16:52:37 +08:00
created() {
this.getList()
},
computed: {
options() {
return {
...baseOptions,
column: [{
label: '机构名称',
prop: 'name',
search:true,
},{
2024-03-31 17:08:12 +08:00
label: '发布岗位数',
2024-03-31 16:52:37 +08:00
prop: 'count',
},{
label: '推送数',
prop: 'serveCount',
},{
2024-03-31 17:08:12 +08:00
label: '服务成功次数',
2024-03-31 16:52:37 +08:00
prop: 'successCount',
},{
2024-03-31 17:08:12 +08:00
label: '跟踪服务次数',
2024-03-31 16:52:37 +08:00
prop: 'traceCount'
},{
label: '日期',
prop: 'date',
hide: true,
display: false,
type:'date',
searchSpan: 8,
searchRange:true,
search:true,
}]
}
}
2024-03-31 14:50:51 +08:00
},
methods: {
2024-03-31 16:52:37 +08:00
sizeChange(size) {
this.infoPages.size = size
this.getList()
},
currentChange(page) {
this.infoPages.page = page
this.getList()
},
searchChange(values, done) {
this.getList().then(() => {done()})
},
resetChange() {
this.search = {}
let params = { size: 10, current: 1 }
this.getList()
},
getList(values) {
return new Promise(async(resolve, reject) => {
this.visible = true
let params = {
size: this.infoPages.size,
current: this.infoPages.currentPage,
...this.search,
}
if( Array.isArray(this.search.date) && this.search.date.length ) {
const [stime, etime] = this.search.date
params.stime = dateFormat(stime, "yyyy-MM-dd")
params.etime = dateFormat(etime, "yyyy-MM-dd")
delete params.date
}
console.log(123123, params)
let resData = await roleCount(params)
if(resData.data.code === 200) {
const { records, current, total, size } = resData.data.data
this.infoData = records
this.infoPages = { ...this.infoPages, currentPage: current, total, size}
2024-04-01 17:07:27 +08:00
this.visible = false;
resolve(true)
2024-03-31 16:52:37 +08:00
} else {
reject()
}
})
}
2024-03-31 14:50:51 +08:00
}
}
</script>
<style scoped lang="scss">
</style>
2024-03-31 16:52:37 +08:00