fix:项目初始化
This commit is contained in:
@@ -0,0 +1,128 @@
|
||||
<template>
|
||||
<div class="pf-warpper avlist">
|
||||
<el-row class="table-form">
|
||||
<el-form :inline="true" :model="searchData.param" class="form-inline" size="mini">
|
||||
<el-form-item>
|
||||
<el-input placeholder="请输入渠道" clearable v-model="searchData.param.channel" @clear="onClear('channel')" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-date-picker end-placeholder="结束日期" range-separator="至" start-placeholder="开始日期" type="datetimerange" v-model="time" value-format="yyyy-MM-ddTHH:mm:ss+08:00" :default-time="['00:00:00', '23:59:59']" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="onSearch" icon="el-icon-search" plain type="primary">搜索</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-table :data="resData" element-loading-text="拼命加载中" border height="750" highlight-current-row style="width: 100%" v-loading="loading">
|
||||
<el-table-column align="center" label="时间" width="160">
|
||||
<template slot-scope="scope">{{ scope.row.from | BeiJingTime}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="渠道">
|
||||
<template slot-scope="scope">{{ scope.row.channel }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="完成率" width="100" show-overflow-tooltip>
|
||||
<template slot-scope="scope">{{
|
||||
scope.row.completeRate === 0 ? 0 : scope.row.completeRate * 100 + '%'
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="总订单" width="100">
|
||||
<template slot-scope="scope">{{ scope.row.orders }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="完成金额" width="200">
|
||||
<template slot-scope="scope">{{
|
||||
scope.row.payCoins | changeMoneyYuan
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="完成订单" width="100" show-overflow-tooltip>
|
||||
<template slot-scope="scope">{{ scope.row.payOrders }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="总金额" width="200">
|
||||
<template slot-scope="scope">{{ scope.row.total | changeMoneyYuan }}</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="table-pagination">
|
||||
<el-pagination :current-page="searchData.pageNum" :page-size="searchData.pageSize" :page-sizes="[50, 100, 200, 300, 500]" :total="total" @current-change="handleCurrentChange" @size-change="handleSizeChange" layout="total, sizes, prev, pager, next, jumper" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
// 引入模块
|
||||
import { hourStatList } from '@/api/tran/stat'
|
||||
export default {
|
||||
name: 'HourStat',
|
||||
|
||||
data() {
|
||||
return {
|
||||
time: undefined,
|
||||
// 请求列表参数
|
||||
searchData: {
|
||||
pageNum: 1,
|
||||
pageSize: 50,
|
||||
param: {
|
||||
end: undefined, // "string",结束时间
|
||||
start: undefined, // "string",开始时间
|
||||
channel: undefined, // 0,
|
||||
},
|
||||
},
|
||||
resData: [], // el-table表格数据
|
||||
total: 0, // 数据总条数
|
||||
loading: true, // 列表加载状态
|
||||
}
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
// TODO:请求每小时充值成功率数据
|
||||
getList() {
|
||||
this.loading = true
|
||||
if (this.time) {
|
||||
this.searchData.param.start = this.time[0]
|
||||
this.searchData.param.end = this.time[1]
|
||||
} else {
|
||||
this.searchData.param.start = undefined
|
||||
this.searchData.param.end = undefined
|
||||
}
|
||||
hourStatList(this.searchData).then((res) => {
|
||||
if (res.code === 200) {
|
||||
this.resData = res.data.list
|
||||
this.total = res.data.total
|
||||
} else {
|
||||
this.resData = []
|
||||
this.total = 0
|
||||
this.$message.error('请求列表失败!')
|
||||
}
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
onSearch() {
|
||||
this.searchData.pageNum = 1
|
||||
this.searchData.pageSize = 50
|
||||
this.getList()
|
||||
},
|
||||
|
||||
// 切换每页数据量
|
||||
handleSizeChange(val) {
|
||||
this.searchData.pageSize = val
|
||||
this.getList()
|
||||
},
|
||||
// 切换页数
|
||||
handleCurrentChange(val) {
|
||||
this.searchData.pageNum = val
|
||||
this.getList()
|
||||
},
|
||||
|
||||
// 清空某一项筛选列表
|
||||
onClear(key) {
|
||||
this.searchData.param[key] = undefined
|
||||
this.getList()
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user