286 lines
9.1 KiB
HTML
286 lines
9.1 KiB
HTML
<!--#
|
||
layout("/layouts/platform.html"){
|
||
#-->
|
||
<script src="http://at.alicdn.com/t/font_2063971_cqi5zxu5jgs.js"></script>
|
||
<script src="http://at.alicdn.com/t/font_2064092_sfw4i61tj5s.js"></script>
|
||
<style>
|
||
.icon {
|
||
width: 38px;
|
||
height: 38px;
|
||
}
|
||
|
||
.icon2 {
|
||
width: 50px;
|
||
height: 35px;
|
||
}
|
||
|
||
.card-container {
|
||
display: flex;
|
||
height: calc(100% - 110px);
|
||
justify-content: center;
|
||
}
|
||
|
||
.el-card__body {
|
||
height: 100%;
|
||
}
|
||
|
||
.card-container > .el-card {
|
||
width: 25%;
|
||
margin: 10px 50px;
|
||
}
|
||
|
||
.list-block {
|
||
/*display: inline-flex;*/
|
||
border-bottom: 1px dashed #EBEEF5;
|
||
}
|
||
|
||
.list-item {
|
||
overflow: hidden;
|
||
text-overflow: ellipsis;
|
||
white-space: nowrap;
|
||
padding: 0 20px;
|
||
/*height: 50px;*/
|
||
align-items: center;
|
||
display: flex;
|
||
}
|
||
|
||
.list-item > div {
|
||
height: 40px;
|
||
}
|
||
|
||
.item-right {
|
||
height: 50px;
|
||
display: inline-flex;
|
||
align-items: center;
|
||
width: 100%;
|
||
justify-content: space-between;
|
||
}
|
||
|
||
.el-card__body {
|
||
padding: 20px 0;
|
||
}
|
||
|
||
.card-container .el-card__body {
|
||
padding: 0;
|
||
}
|
||
|
||
.circle4 {
|
||
width: 30px;
|
||
height: 30px;
|
||
text-align: center;
|
||
line-height: 30px;
|
||
margin: 0 auto;
|
||
/*margin-top: 120px;*/
|
||
background-color: #fff;
|
||
border-radius: 50%;
|
||
border: 2px solid red;
|
||
}
|
||
|
||
.element6 {
|
||
width: 30px;
|
||
height: 30px;
|
||
border-radius: 50%;
|
||
border: 2px solid #1296db;
|
||
background: -webkit-radial-gradient(circle closest-side, #1296db 76%, #fff 50%);
|
||
text-align: center;
|
||
line-height: 28px;
|
||
color: #fff;
|
||
}
|
||
|
||
.header_card {
|
||
padding: 0 20px;
|
||
margin: 10px;
|
||
}
|
||
</style>
|
||
<div id="app" v-cloak>
|
||
|
||
<el-card shadow="never" class="header_card">
|
||
<div class="btn-group tool-button">
|
||
<el-date-picker style="width: 100%"
|
||
class="mr5"
|
||
:picker-options="pickerOptions"
|
||
v-model="pageForm.year" :clearable="false"
|
||
type="year"
|
||
value-format="yyyy" @change="getAllHd"
|
||
placeholder="选择年">
|
||
</el-date-picker>
|
||
</div>
|
||
<div class="btn-group tool-button">
|
||
<el-select v-model="pageForm.hdid" placeholder="请选择活动" @change="hdChange"
|
||
filterable style="width: 100%">
|
||
<el-option v-for="o in hdOptions" :label="o.name" :value="o._id"
|
||
:key="o._id"></el-option>
|
||
</el-select>
|
||
</div>
|
||
<div class="btn-group tool-button">
|
||
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword"
|
||
style="width: 100%" @keyup.enter.native="doSearch">
|
||
<el-select v-model="pageForm.searchName" slot="prepend" placeholder="查询类型"
|
||
style="width: 110px;">
|
||
<el-option label="姓名" value="username"></el-option>
|
||
<el-option label="工号" value="loginname"></el-option>
|
||
</el-select>
|
||
</el-input>
|
||
</div>
|
||
<div class="btn-group tool-button">
|
||
<el-select v-model="pageForm.unionId" placeholder="请选择所属工会" @change="unionChange"
|
||
filterable clearable style="width: 350px">
|
||
<el-option
|
||
v-for="item in unionOptions"
|
||
:key="item.id"
|
||
:label="item.unionname"
|
||
:value="item.id">
|
||
</el-option>
|
||
</el-select>
|
||
</div>
|
||
<div class="btn-group tool-button">
|
||
<el-select v-model="pageForm.unitId" placeholder="请选择所属单位会" @change="doSearch"
|
||
filterable clearable style="width: 350px">
|
||
<el-option
|
||
v-for="item in unitOptions"
|
||
:key="item.id"
|
||
:label="item.name"
|
||
:value="item.id">
|
||
</el-option>
|
||
</el-select>
|
||
</div>
|
||
<div class="btn-group tool-button">
|
||
<el-button type="primary" icon="el-icon-search" @click="doSearch"></el-button>
|
||
</div>
|
||
</el-card>
|
||
|
||
<div class="card-container">
|
||
<el-card shadow="hover" v-for="(e,key) in eqe">
|
||
<div slot="header">
|
||
{{lj[key]}}
|
||
</div>
|
||
<div class="list-block" v-if="e.list.length>0">
|
||
<div v-for="(o,i) in e.list" class="list-item">
|
||
<div v-if="['today','summary'].includes(key) && i > 0"
|
||
style="display: inline-flex;align-items: center;justify-content: center;width: 50px">
|
||
<svg v-if="i===1" class="icon" aria-hidden="true">
|
||
<use xlink:href="#icon-gold"></use>
|
||
</svg>
|
||
<svg v-else-if="i===2" class="icon" aria-hidden="true">
|
||
<use xlink:href="#icon-silver"></use>
|
||
</svg>
|
||
<svg v-else-if="i===3" class="icon" aria-hidden="true">
|
||
<use xlink:href="#icon-tongpai"></use>
|
||
</svg>
|
||
<div class="element6" v-else>
|
||
{{i}}
|
||
</div>
|
||
</div>
|
||
|
||
<div class="item-right">
|
||
<div>
|
||
<span v-if="o.loginname">
|
||
{{o.username}}
|
||
</span>
|
||
<span>
|
||
({{o.loginname}})
|
||
</span>
|
||
</div>
|
||
<div>
|
||
<span>
|
||
{{['today','summary'].includes(key) ? o.step : o.unitname}}
|
||
</span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="text-center" v-else>
|
||
暂无数据
|
||
</div>
|
||
</el-card>
|
||
</div>
|
||
</div>
|
||
<script>
|
||
let vue = new Vue({
|
||
el: '#app',
|
||
data() {
|
||
return {
|
||
pickerOptions: {
|
||
disabledDate(time) {
|
||
return (
|
||
time.getFullYear() > new Date().getFullYear()
|
||
);
|
||
}
|
||
},
|
||
eqe: {
|
||
today: {list: []},
|
||
summary: {list: []},
|
||
yesterday: {list: []},
|
||
},
|
||
data: {
|
||
todaylist: [],
|
||
summarylist: [],
|
||
yesterdaylist: [],
|
||
},
|
||
pageForm: {
|
||
year: new Date().getFullYear() + '',
|
||
},
|
||
unionOptions: [],
|
||
unitOptions: [],
|
||
hdOptions: [],
|
||
lj: {today: '当日榜', summary: '累计排行榜', yesterday: '昨日中奖榜'}
|
||
}
|
||
},
|
||
methods: {
|
||
hdChange() {
|
||
|
||
},
|
||
async getAllHd() {
|
||
this.pageForm.hdid = ''
|
||
this.activityOptions = []
|
||
const {year} = this.pageForm
|
||
if (year) {
|
||
const beforeTime = moment().year(year).startOf('year').valueOf();
|
||
const endTime = moment().year(year).endOf('year').valueOf();
|
||
this.pageForm = {...this.pageForm, beforeTime, endTime}
|
||
}
|
||
|
||
const {data} = await $.get('/jsz/common/getAllHd', this.pageForm)
|
||
if (data == null || data.length === 0) {
|
||
this.tableData = []
|
||
return
|
||
}
|
||
|
||
this.hdOptions = data
|
||
if (this.hdOptions) {
|
||
this.pageForm.hdid = this.hdOptions[0]._id
|
||
}
|
||
},
|
||
async unionChange(val) {
|
||
this.pageForm.unitId = null
|
||
this.unitOptions = await getUnits(val)
|
||
this.doSearch()
|
||
},
|
||
doSearch() {
|
||
this.pageForm.pageNumber = 1
|
||
this.pageData()
|
||
},
|
||
async pageData() {
|
||
const resp = await $.post("/jsz/leaderboard/pageData", this.pageForm)
|
||
if (resp.code === 0) {
|
||
const {data} = resp
|
||
this.eqe = data
|
||
console.log(this.eqe)
|
||
} else {
|
||
this.$message.error(resp_data.msg)
|
||
}
|
||
},
|
||
},
|
||
async created() {
|
||
this.unionOptions = await getUnions(null)
|
||
this.unitOptions = await getUnits(null)
|
||
await this.getAllHd()
|
||
this.pageData()
|
||
}
|
||
})
|
||
</script>
|
||
|
||
<!--#
|
||
}
|
||
#-->
|