|
|
@ -1,125 +1,207 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div class="page"> |
|
|
|
<div class="page"> |
|
|
|
<h6 class="p-title">筛选</h6> |
|
|
|
<h6 class="p-title">筛选</h6> |
|
|
|
<div class="tool mul"> |
|
|
|
<div class="tool mul"> |
|
|
|
<ul class="filter"> |
|
|
|
<ul class="filter"> |
|
|
|
<li> |
|
|
|
<li> |
|
|
|
<label>创建时间:</label> |
|
|
|
<label>创建时间:</label> |
|
|
|
<div class="single-choice"> |
|
|
|
<div class="single-choice"> |
|
|
|
<dl> |
|
|
|
<dl> |
|
|
|
<dd> |
|
|
|
<dd> |
|
|
|
<el-radio-group v-model="form.month" @change="changeType"> |
|
|
|
<el-radio-group v-model="form.month" |
|
|
|
<el-radio v-for="(item,index) in dateList" :key="index" :label="item.id" border>{{ item.name }}</el-radio> |
|
|
|
@change="changeType"> |
|
|
|
</el-radio-group> |
|
|
|
<el-radio v-for="(item,index) in dateList" |
|
|
|
</dd> |
|
|
|
:key="index" |
|
|
|
</dl> |
|
|
|
:label="item.id" |
|
|
|
</div> |
|
|
|
border>{{ item.name }}</el-radio> |
|
|
|
</li> |
|
|
|
</el-radio-group> |
|
|
|
<li> |
|
|
|
</dd> |
|
|
|
<label>创建区间:</label> |
|
|
|
</dl> |
|
|
|
<el-date-picker v-model="date" align="right" unlink-panels type="daterange" start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" clearable></el-date-picker> |
|
|
|
</div> |
|
|
|
</li> |
|
|
|
</li> |
|
|
|
<li> |
|
|
|
<li> |
|
|
|
<label>搜索:</label> |
|
|
|
<label>创建区间:</label> |
|
|
|
<el-input placeholder="请输入竞赛名称/创建人" suffix-icon="el-icon-search" v-model="keyword" clearable></el-input> |
|
|
|
<el-date-picker v-model="date" |
|
|
|
</li> |
|
|
|
align="right" |
|
|
|
</ul> |
|
|
|
unlink-panels |
|
|
|
</div> |
|
|
|
type="daterange" |
|
|
|
<div class="tool mul"> |
|
|
|
start-placeholder="开始日期" |
|
|
|
<ul class="filter"> |
|
|
|
end-placeholder="结束日期" |
|
|
|
<li> |
|
|
|
format="yyyy-MM-dd" |
|
|
|
<label>状态:</label> |
|
|
|
value-format="yyyy-MM-dd" |
|
|
|
<dl> |
|
|
|
clearable></el-date-picker> |
|
|
|
<dd> |
|
|
|
</li> |
|
|
|
<el-radio-group v-model="form.publishStatus" @change="changeType"> |
|
|
|
<li> |
|
|
|
<el-radio v-for="(item,index) in statuses" :key="index" :label="item.id" border>{{ item.name }}</el-radio> |
|
|
|
<label>搜索:</label> |
|
|
|
</el-radio-group> |
|
|
|
<el-input placeholder="请输入竞赛名称/创建人" |
|
|
|
</dd> |
|
|
|
suffix-icon="el-icon-search" |
|
|
|
</dl> |
|
|
|
v-model="keyword" |
|
|
|
</li> |
|
|
|
clearable></el-input> |
|
|
|
</ul> |
|
|
|
</li> |
|
|
|
<div> |
|
|
|
</ul> |
|
|
|
<el-button type="primary" round @click="add" v-auth>创建竞赛</el-button> |
|
|
|
</div> |
|
|
|
<el-button type="primary" round @click="delAllSelection" v-auth>批量删除</el-button> |
|
|
|
<div class="tool mul"> |
|
|
|
</div> |
|
|
|
<ul class="filter"> |
|
|
|
</div> |
|
|
|
<li> |
|
|
|
|
|
|
|
<label>状态:</label> |
|
|
|
<el-table ref="table" :data="matchData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id"> |
|
|
|
<dl> |
|
|
|
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column> |
|
|
|
<dd> |
|
|
|
<el-table-column type="index" width="60" label="序号" align="center"> |
|
|
|
<el-radio-group v-model="form.publishStatus" |
|
|
|
<template slot-scope="scope"> |
|
|
|
@change="changeType"> |
|
|
|
{{ scope.$index + (page - 1) * pageSize + 1 }} |
|
|
|
<el-radio v-for="(item,index) in statuses" |
|
|
|
</template> |
|
|
|
:key="index" |
|
|
|
</el-table-column> |
|
|
|
:label="item.id" |
|
|
|
<el-table-column prop="competitionName" label="竞赛名称" align="center"></el-table-column> |
|
|
|
border>{{ item.name }}</el-radio> |
|
|
|
<el-table-column prop="applicantNum" label="报名人数" align="center" width="150"></el-table-column> |
|
|
|
</el-radio-group> |
|
|
|
<el-table-column prop="status" label="状态" align="center" width="90"> |
|
|
|
</dd> |
|
|
|
<template slot-scope="scope"> |
|
|
|
</dl> |
|
|
|
{{ scope.row.publishStatus ? '已发布' : '未发布' }} |
|
|
|
</li> |
|
|
|
</template> |
|
|
|
</ul> |
|
|
|
</el-table-column> |
|
|
|
<div> |
|
|
|
<el-table-column prop="time" label="竞赛时间" align="center" width="300"> |
|
|
|
<el-button type="primary" |
|
|
|
<template slot-scope="scope"> |
|
|
|
round |
|
|
|
{{ scope.row.playStartTime }} ~ {{ scope.row.playEndTime }} |
|
|
|
@click="add" |
|
|
|
</template> |
|
|
|
v-auth>创建竞赛</el-button> |
|
|
|
</el-table-column> |
|
|
|
<el-button type="primary" |
|
|
|
<el-table-column prop="createTime" label="创建时间" align="center" width="160"></el-table-column> |
|
|
|
round |
|
|
|
<el-table-column prop="founderName" label="创建人" align="center" width="130"> |
|
|
|
@click="delAllSelection" |
|
|
|
<template slot-scope="scope"> |
|
|
|
v-auth>批量删除</el-button> |
|
|
|
{{ scope.row.founderName || '学校超管' }} |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</div> |
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column label="操作" align="center" width="170"> |
|
|
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
|
|
<el-button v-if="scope.row.playingStages && scope.row.playingStages.length" type="text" @click="editEndTime(scope.row)" v-auth>修改结束时间</el-button> |
|
|
|
|
|
|
|
<el-button v-auth type="text" @click="manage(scope.row)">管理</el-button> |
|
|
|
|
|
|
|
<el-button v-auth type="text" @click="delData(scope.row)">删除</el-button> |
|
|
|
|
|
|
|
<!-- 列表展示中台的禁启用依据zt_open展示,职站的禁启用依据is_open展示 --> |
|
|
|
|
|
|
|
<!-- 中台禁用了这个学校发布的学校这边还能看到,但是学校这边不能启用。 --> |
|
|
|
|
|
|
|
<el-switch |
|
|
|
|
|
|
|
v-if="scope.row.publishStatus" |
|
|
|
|
|
|
|
v-auth="'禁用'" |
|
|
|
|
|
|
|
v-model="scope.row.isOpen" |
|
|
|
|
|
|
|
:active-value="0" |
|
|
|
|
|
|
|
:inactive-value="1" |
|
|
|
|
|
|
|
style="margin: 0 10px 0 5px" |
|
|
|
|
|
|
|
:active-text="scope.row.isOpen ? '关' : '开'" |
|
|
|
|
|
|
|
@change="switchOff($event,scope.row,scope.$index)" |
|
|
|
|
|
|
|
></el-switch> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
</el-table> |
|
|
|
|
|
|
|
<div class="pagination"> |
|
|
|
|
|
|
|
<el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" :current-page="page"> |
|
|
|
|
|
|
|
</el-pagination> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-dialog title="修改当前阶段结束时间" :visible.sync="modifyVisible" width="900px" :close-on-click-modal="false"> |
|
|
|
<el-table ref="table" |
|
|
|
<el-table :data="curRow.playingStages" class="table" ref="table" stripe header-align="center"> |
|
|
|
:data="matchData" |
|
|
|
<el-table-column prop="stageName" label="阶段名称" min-width="100" align="center"></el-table-column> |
|
|
|
class="table" |
|
|
|
<el-table-column label="竞赛起止时间" width="300" align="center"> |
|
|
|
stripe |
|
|
|
<template slot-scope="scope"> |
|
|
|
header-align="center" |
|
|
|
{{ scope.row.startTime + ' ~ ' + scope.row.endTime }} |
|
|
|
@selection-change="handleSelectionChange" |
|
|
|
</template> |
|
|
|
row-key="id"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column type="selection" |
|
|
|
<el-table-column label="结束时间调整为" align="center" width="280"> |
|
|
|
width="55" |
|
|
|
<template slot-scope="scope"> |
|
|
|
align="center" |
|
|
|
<el-date-picker |
|
|
|
:reserve-selection="true"></el-table-column> |
|
|
|
popper-class="no-atTheMoment" |
|
|
|
<el-table-column type="index" |
|
|
|
v-model="scope.row.newEndTime" |
|
|
|
width="60" |
|
|
|
placeholder="请选择结束时间" |
|
|
|
label="序号" |
|
|
|
type="datetime" |
|
|
|
align="center"> |
|
|
|
:picker-options="pickerOptions"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
</el-date-picker> |
|
|
|
{{ scope.$index + (page - 1) * pageSize + 1 }} |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
<el-table-column prop="competitionName" |
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
label="竞赛名称" |
|
|
|
<el-button size="small" @click="modifyVisible = false">取 消</el-button> |
|
|
|
align="center"></el-table-column> |
|
|
|
<el-button size="small" type="primary" @click="modifySubmit">确 定</el-button> |
|
|
|
<el-table-column prop="applicantNum" |
|
|
|
</span> |
|
|
|
label="报名人数" |
|
|
|
</el-dialog> |
|
|
|
align="center" |
|
|
|
|
|
|
|
width="150"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="status" |
|
|
|
|
|
|
|
label="状态" |
|
|
|
|
|
|
|
align="center" |
|
|
|
|
|
|
|
width="90"> |
|
|
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
|
|
{{ scope.row.publishStatus ? '已发布' : '未发布' }} |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="time" |
|
|
|
|
|
|
|
label="竞赛时间" |
|
|
|
|
|
|
|
align="center" |
|
|
|
|
|
|
|
width="300"> |
|
|
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
|
|
{{ scope.row.playStartTime }} ~ {{ scope.row.playEndTime }} |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="createTime" |
|
|
|
|
|
|
|
label="创建时间" |
|
|
|
|
|
|
|
align="center" |
|
|
|
|
|
|
|
width="160"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="founderName" |
|
|
|
|
|
|
|
label="创建人" |
|
|
|
|
|
|
|
align="center" |
|
|
|
|
|
|
|
width="130"> |
|
|
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
|
|
{{ scope.row.founderName || '学校超管' }} |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column label="操作" |
|
|
|
|
|
|
|
align="center" |
|
|
|
|
|
|
|
width="170"> |
|
|
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
|
|
<el-button v-if="scope.row.playingStages && scope.row.playingStages.length" |
|
|
|
|
|
|
|
type="text" |
|
|
|
|
|
|
|
@click="editEndTime(scope.row)" |
|
|
|
|
|
|
|
v-auth>修改结束时间</el-button> |
|
|
|
|
|
|
|
<el-button v-auth |
|
|
|
|
|
|
|
type="text" |
|
|
|
|
|
|
|
@click="manage(scope.row)">管理</el-button> |
|
|
|
|
|
|
|
<el-button v-auth |
|
|
|
|
|
|
|
type="text" |
|
|
|
|
|
|
|
@click="delData(scope.row)">删除</el-button> |
|
|
|
|
|
|
|
<!-- 列表展示中台的禁启用依据zt_open展示,职站的禁启用依据is_open展示 --> |
|
|
|
|
|
|
|
<!-- 中台禁用了这个学校发布的学校这边还能看到,但是学校这边不能启用。 --> |
|
|
|
|
|
|
|
<el-switch v-if="scope.row.publishStatus" |
|
|
|
|
|
|
|
v-auth="'禁用'" |
|
|
|
|
|
|
|
v-model="scope.row.isOpen" |
|
|
|
|
|
|
|
:active-value="0" |
|
|
|
|
|
|
|
:inactive-value="1" |
|
|
|
|
|
|
|
style="margin: 0 10px 0 5px" |
|
|
|
|
|
|
|
:active-text="scope.row.isOpen ? '关' : '开'" |
|
|
|
|
|
|
|
@change="switchOff($event,scope.row,scope.$index)"></el-switch> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
</el-table> |
|
|
|
|
|
|
|
<div class="pagination"> |
|
|
|
|
|
|
|
<el-pagination background |
|
|
|
|
|
|
|
layout="total, prev, pager, next" |
|
|
|
|
|
|
|
:total="total" |
|
|
|
|
|
|
|
@current-change="handleCurrentChange" |
|
|
|
|
|
|
|
:current-page="page"> |
|
|
|
|
|
|
|
</el-pagination> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-dialog title="修改当前阶段结束时间" |
|
|
|
|
|
|
|
:visible.sync="modifyVisible" |
|
|
|
|
|
|
|
width="900px" |
|
|
|
|
|
|
|
:close-on-click-modal="false"> |
|
|
|
|
|
|
|
<el-table :data="curRow.playingStages" |
|
|
|
|
|
|
|
class="table" |
|
|
|
|
|
|
|
ref="table" |
|
|
|
|
|
|
|
stripe |
|
|
|
|
|
|
|
header-align="center"> |
|
|
|
|
|
|
|
<el-table-column prop="stageName" |
|
|
|
|
|
|
|
label="阶段名称" |
|
|
|
|
|
|
|
min-width="100" |
|
|
|
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column label="竞赛起止时间" |
|
|
|
|
|
|
|
width="300" |
|
|
|
|
|
|
|
align="center"> |
|
|
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
|
|
{{ scope.row.startTime + ' ~ ' + scope.row.endTime }} |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column label="结束时间调整为" |
|
|
|
|
|
|
|
align="center" |
|
|
|
|
|
|
|
width="280"> |
|
|
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
|
|
<el-date-picker popper-class="no-atTheMoment" |
|
|
|
|
|
|
|
v-model="scope.row.newEndTime" |
|
|
|
|
|
|
|
placeholder="请选择结束时间" |
|
|
|
|
|
|
|
type="datetime" |
|
|
|
|
|
|
|
:picker-options="pickerOptions"> |
|
|
|
|
|
|
|
</el-date-picker> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
</el-table> |
|
|
|
|
|
|
|
<span slot="footer" |
|
|
|
|
|
|
|
class="dialog-footer"> |
|
|
|
|
|
|
|
<el-button size="small" |
|
|
|
|
|
|
|
@click="modifyVisible = false">取 消</el-button> |
|
|
|
|
|
|
|
<el-button size="small" |
|
|
|
|
|
|
|
type="primary" |
|
|
|
|
|
|
|
@click="modifySubmit">确 定</el-button> |
|
|
|
|
|
|
|
</span> |
|
|
|
|
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
<script> |
|
|
@ -129,271 +211,271 @@ import { mapMutations } from "vuex"; |
|
|
|
import { Loading } from 'element-ui' |
|
|
|
import { Loading } from 'element-ui' |
|
|
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
export default { |
|
|
|
name: "match", |
|
|
|
name: "match", |
|
|
|
data() { |
|
|
|
data () { |
|
|
|
return { |
|
|
|
return { |
|
|
|
timer: null, |
|
|
|
timer: null, |
|
|
|
keyword: "", |
|
|
|
keyword: "", |
|
|
|
matchData: [], |
|
|
|
matchData: [], |
|
|
|
statuses: [ |
|
|
|
statuses: [ |
|
|
|
{ |
|
|
|
{ |
|
|
|
id: '', |
|
|
|
id: '', |
|
|
|
name: '不限' |
|
|
|
name: '不限' |
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
id: 0, |
|
|
|
|
|
|
|
name: '待发布' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
id: 1, |
|
|
|
|
|
|
|
name: '已发布' |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
form: { |
|
|
|
|
|
|
|
month: "", |
|
|
|
|
|
|
|
publishStatus: "", |
|
|
|
|
|
|
|
startTime: "", |
|
|
|
|
|
|
|
endTime: "", |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
multipleSelection: [], |
|
|
|
|
|
|
|
dateList: [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
id: "", |
|
|
|
|
|
|
|
name: "不限" |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
id: 1, |
|
|
|
|
|
|
|
name: "近一个月" |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
id: 3, |
|
|
|
|
|
|
|
name: "近三个月" |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
id: 6, |
|
|
|
|
|
|
|
name: "近六个月" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
date: [], |
|
|
|
|
|
|
|
page: +this.$route.query.page || 1, |
|
|
|
|
|
|
|
pageSize: 10, |
|
|
|
|
|
|
|
total: 0, |
|
|
|
|
|
|
|
transferPublishStatus: [ "未发布", "已发布"], |
|
|
|
|
|
|
|
modifyVisible: false, |
|
|
|
|
|
|
|
curRow: { |
|
|
|
|
|
|
|
playingStages: [] |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
timer: null, |
|
|
|
|
|
|
|
redisTimer: null, |
|
|
|
|
|
|
|
pickerOptions: { |
|
|
|
|
|
|
|
shortcuts: [{ |
|
|
|
|
|
|
|
text: '此刻', |
|
|
|
|
|
|
|
onClick(picker) { |
|
|
|
|
|
|
|
picker.$emit('pick', new Date(Date.now() + 5000)) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}] |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
watch: { |
|
|
|
|
|
|
|
"form.month": function(val) { |
|
|
|
|
|
|
|
if (val) { |
|
|
|
|
|
|
|
let unit = 24 * 60 * 60 * 1000; |
|
|
|
|
|
|
|
this.date = [util.formatDate("yyyy-MM-dd", new Date(new Date().getTime() - unit * 30 * val)), util.formatDate("yyyy-MM-dd", new Date(new Date().getTime() + unit))]; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.date = []; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
date: function(val) { |
|
|
|
{ |
|
|
|
if (val) { |
|
|
|
id: 0, |
|
|
|
this.form.startTime = val[0]; |
|
|
|
name: '待发布' |
|
|
|
this.form.endTime = val[1]; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.form.startTime = ""; |
|
|
|
|
|
|
|
this.form.endTime = ""; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.initData(); |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
keyword: function(val) { |
|
|
|
{ |
|
|
|
clearTimeout(this.searchTimer); |
|
|
|
id: 1, |
|
|
|
this.searchTimer = setTimeout(() => { |
|
|
|
name: '已发布' |
|
|
|
this.initData(); |
|
|
|
|
|
|
|
}, 500); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
form: { |
|
|
|
|
|
|
|
month: "", |
|
|
|
|
|
|
|
publishStatus: "", |
|
|
|
|
|
|
|
startTime: "", |
|
|
|
|
|
|
|
endTime: "", |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
multipleSelection: [], |
|
|
|
|
|
|
|
dateList: [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
id: "", |
|
|
|
|
|
|
|
name: "不限" |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
id: 1, |
|
|
|
|
|
|
|
name: "近一个月" |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
id: 3, |
|
|
|
|
|
|
|
name: "近三个月" |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
id: 6, |
|
|
|
|
|
|
|
name: "近六个月" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
date: [], |
|
|
|
|
|
|
|
page: +this.$route.query.page || 1, |
|
|
|
|
|
|
|
pageSize: 10, |
|
|
|
|
|
|
|
total: 0, |
|
|
|
|
|
|
|
transferPublishStatus: ["未发布", "已发布"], |
|
|
|
|
|
|
|
modifyVisible: false, |
|
|
|
|
|
|
|
curRow: { |
|
|
|
|
|
|
|
playingStages: [] |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
timer: null, |
|
|
|
|
|
|
|
redisTimer: null, |
|
|
|
|
|
|
|
pickerOptions: { |
|
|
|
|
|
|
|
shortcuts: [{ |
|
|
|
|
|
|
|
text: '此刻', |
|
|
|
|
|
|
|
onClick (picker) { |
|
|
|
|
|
|
|
picker.$emit('pick', new Date(Date.now() + 5000)) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}] |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
watch: { |
|
|
|
|
|
|
|
"form.month": function (val) { |
|
|
|
|
|
|
|
if (val) { |
|
|
|
|
|
|
|
let unit = 24 * 60 * 60 * 1000; |
|
|
|
|
|
|
|
this.date = [util.formatDate("yyyy-MM-dd", new Date(new Date().getTime() - unit * 30 * val)), util.formatDate("yyyy-MM-dd", new Date(new Date().getTime() + unit))]; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.date = []; |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
date: function (val) { |
|
|
|
this.getData() |
|
|
|
if (val) { |
|
|
|
this.$once('hook:beforeDestroy', function() { |
|
|
|
this.form.startTime = val[0]; |
|
|
|
clearInterval(this.timer) |
|
|
|
this.form.endTime = val[1]; |
|
|
|
clearInterval(this.redisTimer) |
|
|
|
} else { |
|
|
|
}) |
|
|
|
this.form.startTime = ""; |
|
|
|
|
|
|
|
this.form.endTime = ""; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.initData(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
keyword: function (val) { |
|
|
|
...mapMutations('match', [ |
|
|
|
clearTimeout(this.searchTimer); |
|
|
|
'setPage' |
|
|
|
this.searchTimer = setTimeout(() => { |
|
|
|
]), |
|
|
|
this.initData(); |
|
|
|
getList() { |
|
|
|
}, 500); |
|
|
|
// const load = Loading.service() |
|
|
|
} |
|
|
|
const { form } = this |
|
|
|
}, |
|
|
|
this.$post(this.api.competitionPageConditionQueryByOccupationlab, { |
|
|
|
mounted () { |
|
|
|
pageNum: this.page, |
|
|
|
this.getData() |
|
|
|
pageSize: this.pageSize, |
|
|
|
this.$once('hook:beforeDestroy', function () { |
|
|
|
competitionScope: 0, // 大赛范围(0:本校内 1:全平台 2.指定区域、院校) |
|
|
|
clearInterval(this.timer) |
|
|
|
endTime: form.endTime || null, |
|
|
|
clearInterval(this.redisTimer) |
|
|
|
keyWord: this.keyword || null, |
|
|
|
}) |
|
|
|
platformSource: 1, // 大赛来源(0中台,1职站) |
|
|
|
}, |
|
|
|
startTime: form.startTime || null, |
|
|
|
methods: { |
|
|
|
publishStatus: form.publishStatus === '' ? null : form.publishStatus |
|
|
|
...mapMutations('match', [ |
|
|
|
}).then(({ data }) => { |
|
|
|
'setPage' |
|
|
|
// load.close() |
|
|
|
]), |
|
|
|
const list = data.records |
|
|
|
getList () { |
|
|
|
// 定时处理是否要显示修改结束时间按钮 |
|
|
|
// const load = Loading.service() |
|
|
|
this.timer = setInterval(() => { |
|
|
|
const { form } = this |
|
|
|
const now = new Date() |
|
|
|
this.$post(this.api.competitionPageConditionQueryByOccupationlab, { |
|
|
|
list.map(e => { |
|
|
|
pageNum: this.page, |
|
|
|
if (!e.playingStages) { |
|
|
|
pageSize: this.pageSize, |
|
|
|
this.$set(e, 'playingStages', []) |
|
|
|
competitionScope: 0, // 大赛范围(0:本校内 1:全平台 2.指定区域、院校) |
|
|
|
} else { |
|
|
|
endTime: form.endTime || null, |
|
|
|
e.playingStages = [] |
|
|
|
keyWord: this.keyword || null, |
|
|
|
} |
|
|
|
platformSource: 1, // 大赛来源(0中台,1职站) |
|
|
|
// 如果当前时间在竞赛开始结束时间之间 |
|
|
|
startTime: form.startTime || null, |
|
|
|
if (now >= new Date(e.playStartTime) && now <= new Date(e.playEndTime)) { |
|
|
|
publishStatus: form.publishStatus === '' ? null : form.publishStatus |
|
|
|
// 遍历赛事阶段 |
|
|
|
}).then(({ data }) => { |
|
|
|
if (e.competitionStageList) { |
|
|
|
// load.close() |
|
|
|
for (const n of e.competitionStageList) { |
|
|
|
const list = data.records |
|
|
|
// 判断是否有开始了的阶段 |
|
|
|
// 定时处理是否要显示修改结束时间按钮 |
|
|
|
if (now >= new Date(n.startTime) && now <= new Date(n.endTime)) { |
|
|
|
this.timer = setInterval(() => { |
|
|
|
e.playingStages.push(n) |
|
|
|
const now = new Date() |
|
|
|
} |
|
|
|
list.map(e => { |
|
|
|
} |
|
|
|
if (!e.playingStages) { |
|
|
|
|
|
|
|
this.$set(e, 'playingStages', []) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
e.playingStages = [] |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// 如果当前时间在竞赛开始结束时间之间 |
|
|
|
|
|
|
|
if (now >= new Date(e.playStartTime) && now <= new Date(e.playEndTime)) { |
|
|
|
|
|
|
|
// 遍历赛事阶段 |
|
|
|
|
|
|
|
if (e.competitionStageList) { |
|
|
|
|
|
|
|
for (const n of e.competitionStageList) { |
|
|
|
|
|
|
|
// 判断是否有开始了的阶段 |
|
|
|
|
|
|
|
if (now >= new Date(n.startTime) && now <= new Date(n.endTime)) { |
|
|
|
|
|
|
|
e.playingStages.push(n) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}, 1000) |
|
|
|
|
|
|
|
list.map(e => { |
|
|
|
|
|
|
|
if (e.ztOpen) e.isOpen = 1 |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
this.matchData = list |
|
|
|
|
|
|
|
this.total = data.total |
|
|
|
|
|
|
|
this.$refs.table.clearSelection() |
|
|
|
|
|
|
|
if (!this.matchData.length && this.total) { |
|
|
|
|
|
|
|
this.page-- |
|
|
|
|
|
|
|
this.getData() |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}).catch(res => { |
|
|
|
|
|
|
|
// load.close() |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
getData() { |
|
|
|
|
|
|
|
this.getList() |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
initData() { |
|
|
|
|
|
|
|
this.page = 1; |
|
|
|
|
|
|
|
this.getData(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 获取redis缓存 |
|
|
|
|
|
|
|
getRedis() { |
|
|
|
|
|
|
|
this.$post(this.api.getRedisCacheCompetition).then(({ data }) => { |
|
|
|
|
|
|
|
data && this.getList() |
|
|
|
|
|
|
|
}).catch(res => {}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
getData() { |
|
|
|
|
|
|
|
this.getList() |
|
|
|
|
|
|
|
// if (!Setting.isDev) { |
|
|
|
|
|
|
|
clearInterval(this.redisTimer) |
|
|
|
|
|
|
|
this.redisTimer = setInterval(this.getRedis, 1000) |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
add() { |
|
|
|
|
|
|
|
this.$router.push("/match/add"); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 修改结束时间 |
|
|
|
|
|
|
|
editEndTime(row) { |
|
|
|
|
|
|
|
this.modifyVisible = true |
|
|
|
|
|
|
|
row.newEndTime = '' |
|
|
|
|
|
|
|
this.curRow = row |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 修改结束时间提交 |
|
|
|
|
|
|
|
modifySubmit() { |
|
|
|
|
|
|
|
const row = this.curRow |
|
|
|
|
|
|
|
const data = [] |
|
|
|
|
|
|
|
row.competitionStageList.map(e => { |
|
|
|
|
|
|
|
const stage = row.playingStages.find(n => n.contentId === e.contentId && n.newEndTime) |
|
|
|
|
|
|
|
if (stage && stage.newEndTime) stage.endTime = this.formatDate('yyyy-MM-dd hh:mm:ss', stage.newEndTime) |
|
|
|
|
|
|
|
data.push(stage || e) |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
this.$post(this.api.editCompetitionContent, { |
|
|
|
}, 1000) |
|
|
|
competitionContents: data |
|
|
|
list.map(e => { |
|
|
|
}).then(res => { |
|
|
|
if (e.ztOpen) e.isOpen = 1 |
|
|
|
util.successMsg('修改成功') |
|
|
|
}) |
|
|
|
this.modifyVisible = false |
|
|
|
this.matchData = list |
|
|
|
this.getData() |
|
|
|
this.total = data.total |
|
|
|
}).catch(err => {}) |
|
|
|
this.$refs.table.clearSelection() |
|
|
|
}, |
|
|
|
if (!this.matchData.length && this.total) { |
|
|
|
manage(row) { |
|
|
|
this.page-- |
|
|
|
this.$router.push(`/match/manage?id=${row.id}&name=${row.competitionName}`) |
|
|
|
this.getData() |
|
|
|
}, |
|
|
|
} |
|
|
|
|
|
|
|
}).catch(res => { |
|
|
|
|
|
|
|
// load.close() |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
getData () { |
|
|
|
|
|
|
|
this.getList() |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
initData () { |
|
|
|
|
|
|
|
this.page = 1; |
|
|
|
|
|
|
|
this.getData(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 获取redis缓存 |
|
|
|
|
|
|
|
getRedis () { |
|
|
|
|
|
|
|
this.$post(this.api.getRedisCacheCompetition).then(({ data }) => { |
|
|
|
|
|
|
|
data && this.getList() |
|
|
|
|
|
|
|
}).catch(res => { }) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
getData () { |
|
|
|
|
|
|
|
this.getList() |
|
|
|
|
|
|
|
if (!Setting.isDev) { |
|
|
|
|
|
|
|
clearInterval(this.redisTimer) |
|
|
|
|
|
|
|
this.redisTimer = setInterval(this.getRedis, 1000) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
add () { |
|
|
|
|
|
|
|
this.$router.push("/match/add"); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 修改结束时间 |
|
|
|
|
|
|
|
editEndTime (row) { |
|
|
|
|
|
|
|
this.modifyVisible = true |
|
|
|
|
|
|
|
row.newEndTime = '' |
|
|
|
|
|
|
|
this.curRow = row |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 修改结束时间提交 |
|
|
|
|
|
|
|
modifySubmit () { |
|
|
|
|
|
|
|
const row = this.curRow |
|
|
|
|
|
|
|
const data = [] |
|
|
|
|
|
|
|
row.competitionStageList.map(e => { |
|
|
|
|
|
|
|
const stage = row.playingStages.find(n => n.contentId === e.contentId && n.newEndTime) |
|
|
|
|
|
|
|
if (stage && stage.newEndTime) stage.endTime = this.formatDate('yyyy-MM-dd hh:mm:ss', stage.newEndTime) |
|
|
|
|
|
|
|
data.push(stage || e) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
this.$post(this.api.editCompetitionContent, { |
|
|
|
|
|
|
|
competitionContents: data |
|
|
|
|
|
|
|
}).then(res => { |
|
|
|
|
|
|
|
util.successMsg('修改成功') |
|
|
|
|
|
|
|
this.modifyVisible = false |
|
|
|
|
|
|
|
this.getData() |
|
|
|
|
|
|
|
}).catch(err => { }) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
manage (row) { |
|
|
|
|
|
|
|
this.$router.push(`/match/manage?id=${row.id}&name=${row.competitionName}`) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
changeType() { |
|
|
|
changeType () { |
|
|
|
this.$refs.table.clearSelection(); |
|
|
|
this.$refs.table.clearSelection(); |
|
|
|
this.initData(); |
|
|
|
this.initData(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
delData(row) { |
|
|
|
delData (row) { |
|
|
|
this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", { |
|
|
|
this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", { |
|
|
|
type: "warning" |
|
|
|
type: "warning" |
|
|
|
}) |
|
|
|
}) |
|
|
|
.then(() => { |
|
|
|
.then(() => { |
|
|
|
this.$post(`${this.api.batchDeleteCompetition}?competitionIds=${row.id}`).then(res => { |
|
|
|
this.$post(`${this.api.batchDeleteCompetition}?competitionIds=${row.id}`).then(res => { |
|
|
|
util.successMsg("删除成功"); |
|
|
|
util.successMsg("删除成功"); |
|
|
|
this.getData(); |
|
|
|
this.getData(); |
|
|
|
}).catch(res => { |
|
|
|
}).catch(res => { |
|
|
|
}); |
|
|
|
}); |
|
|
|
}) |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
.catch(() => { |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleSelectionChange(val) { |
|
|
|
handleSelectionChange (val) { |
|
|
|
this.multipleSelection = val; |
|
|
|
this.multipleSelection = val; |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 批量删除 |
|
|
|
// 批量删除 |
|
|
|
delAllSelection() { |
|
|
|
delAllSelection () { |
|
|
|
if (this.multipleSelection.length) { |
|
|
|
if (this.multipleSelection.length) { |
|
|
|
this.$confirm("确定要删除吗?", "提示", { |
|
|
|
this.$confirm("确定要删除吗?", "提示", { |
|
|
|
type: "warning" |
|
|
|
type: "warning" |
|
|
|
}).then(() => { |
|
|
|
}).then(() => { |
|
|
|
let ids = this.multipleSelection.map(i => 'competitionIds=' + i.id); |
|
|
|
let ids = this.multipleSelection.map(i => 'competitionIds=' + i.id); |
|
|
|
this.$post(`${this.api.batchDeleteCompetition}?${ids.join('&')}`).then(res => { |
|
|
|
this.$post(`${this.api.batchDeleteCompetition}?${ids.join('&')}`).then(res => { |
|
|
|
this.getData(); |
|
|
|
this.getData(); |
|
|
|
this.$message.success("删除成功"); |
|
|
|
this.$message.success("删除成功"); |
|
|
|
this.$refs.table.clearSelection() |
|
|
|
this.$refs.table.clearSelection() |
|
|
|
}).catch(err => { |
|
|
|
}).catch(err => { |
|
|
|
}); |
|
|
|
}); |
|
|
|
}).catch(() => { |
|
|
|
}).catch(() => { |
|
|
|
}); |
|
|
|
}); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.$message.warning("请先选择赛事 !"); |
|
|
|
this.$message.warning("请先选择赛事 !"); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleCurrentChange(val) { |
|
|
|
handleCurrentChange (val) { |
|
|
|
this.page = val; |
|
|
|
this.page = val; |
|
|
|
this.$router.push(`list?page=${val}`) |
|
|
|
this.$router.push(`list?page=${val}`) |
|
|
|
this.getData() |
|
|
|
this.getData() |
|
|
|
this.setPage(val) |
|
|
|
this.setPage(val) |
|
|
|
}, |
|
|
|
}, |
|
|
|
transferTime(date, type) { |
|
|
|
transferTime (date, type) { |
|
|
|
if (date == "0000-00-00 00:00:00") return "---"; |
|
|
|
if (date == "0000-00-00 00:00:00") return "---"; |
|
|
|
return date; |
|
|
|
return date; |
|
|
|
}, |
|
|
|
}, |
|
|
|
switchOff(val, row) { |
|
|
|
switchOff (val, row) { |
|
|
|
this.$post(this.api.disabledEventsCompetition, { |
|
|
|
this.$post(this.api.disabledEventsCompetition, { |
|
|
|
competitionId: row.id, |
|
|
|
competitionId: row.id, |
|
|
|
isOpen: val, |
|
|
|
isOpen: val, |
|
|
|
type: 1 // 禁用平台来源(0中台,1职站) |
|
|
|
type: 1 // 禁用平台来源(0中台,1职站) |
|
|
|
}).then(res => { |
|
|
|
}).then(res => { |
|
|
|
util.successMsg(val == 1 ? '禁用成功' : '启用成功') |
|
|
|
util.successMsg(val == 1 ? '禁用成功' : '启用成功') |
|
|
|
}).catch(err => {}) |
|
|
|
}).catch(err => { }) |
|
|
|
}, |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
@ -406,7 +488,7 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@media(max-width: 1640px) { |
|
|
|
@media (max-width: 1640px) { |
|
|
|
.page .page-content .tool .filter { |
|
|
|
.page .page-content .tool .filter { |
|
|
|
flex-wrap: wrap; |
|
|
|
flex-wrap: wrap; |
|
|
|
margin-bottom: -15px; |
|
|
|
margin-bottom: -15px; |
|
|
|