|
|
|
@ -6,17 +6,33 @@ |
|
|
|
|
<ul class="filter"> |
|
|
|
|
<li> |
|
|
|
|
<label>创建时间:</label> |
|
|
|
|
<el-radio-group size="small" v-model="form.month" @change="changeType"> |
|
|
|
|
<el-radio v-for="(item,index) in dateList" :key="index" :label="item.id" border>{{ item.name }}</el-radio> |
|
|
|
|
<el-radio-group size="small" |
|
|
|
|
v-model="form.month" |
|
|
|
|
@change="changeType"> |
|
|
|
|
<el-radio v-for="(item,index) in dateList" |
|
|
|
|
:key="index" |
|
|
|
|
:label="item.id" |
|
|
|
|
border>{{ item.name }}</el-radio> |
|
|
|
|
</el-radio-group> |
|
|
|
|
</li> |
|
|
|
|
<li> |
|
|
|
|
<label>创建区间:</label> |
|
|
|
|
<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> |
|
|
|
|
<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> |
|
|
|
|
</li> |
|
|
|
|
<li> |
|
|
|
|
<label>搜索:</label> |
|
|
|
|
<el-input placeholder="请输入项目名称/创建人" suffix-icon="el-icon-search" v-model="keyword" clearable></el-input> |
|
|
|
|
<el-input placeholder="请输入项目名称/创建人" |
|
|
|
|
suffix-icon="el-icon-search" |
|
|
|
|
v-model="keyword" |
|
|
|
|
clearable></el-input> |
|
|
|
|
</li> |
|
|
|
|
</ul> |
|
|
|
|
</div> |
|
|
|
@ -26,62 +42,105 @@ |
|
|
|
|
<label>状态:</label> |
|
|
|
|
<dl> |
|
|
|
|
<dd> |
|
|
|
|
<el-radio-group v-model="form.publishStatus" @change="changeType"> |
|
|
|
|
<el-radio v-for="(item,index) in statuses" :key="index" :label="item.id" border>{{ item.name }}</el-radio> |
|
|
|
|
<el-radio-group v-model="form.publishStatus" |
|
|
|
|
@change="changeType"> |
|
|
|
|
<el-radio v-for="(item,index) in statuses" |
|
|
|
|
:key="index" |
|
|
|
|
:label="item.id" |
|
|
|
|
border>{{ item.name }}</el-radio> |
|
|
|
|
</el-radio-group> |
|
|
|
|
</dd> |
|
|
|
|
</dl> |
|
|
|
|
</li> |
|
|
|
|
</ul> |
|
|
|
|
<div> |
|
|
|
|
<el-button type="primary" round @click="add">创建项目</el-button> |
|
|
|
|
<el-button type="primary" round @click="delAllSelection">批量删除</el-button> |
|
|
|
|
<el-button type="primary" |
|
|
|
|
round |
|
|
|
|
@click="add">创建项目</el-button> |
|
|
|
|
<el-button type="primary" |
|
|
|
|
round |
|
|
|
|
@click="delAllSelection">批量删除</el-button> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<el-table ref="table" :data="activityData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id"> |
|
|
|
|
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column> |
|
|
|
|
<el-table-column type="index" width="60" label="序号" align="center"> |
|
|
|
|
<el-table ref="table" |
|
|
|
|
:data="activityData" |
|
|
|
|
class="table" |
|
|
|
|
stripe |
|
|
|
|
header-align="center" |
|
|
|
|
@selection-change="handleSelectionChange" |
|
|
|
|
row-key="id"> |
|
|
|
|
<el-table-column type="selection" |
|
|
|
|
width="55" |
|
|
|
|
align="center" |
|
|
|
|
:reserve-selection="true"></el-table-column> |
|
|
|
|
<el-table-column type="index" |
|
|
|
|
width="60" |
|
|
|
|
label="序号" |
|
|
|
|
align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
{{ scope.$index + (page - 1) * pageSize + 1 }} |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="projectName" label="项目名称" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="applicantNum" label="报名人数" align="center" width="150"></el-table-column> |
|
|
|
|
<el-table-column prop="status" label="状态" align="center" width="90"> |
|
|
|
|
<el-table-column prop="projectName" |
|
|
|
|
label="项目名称" |
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="applicantNum" |
|
|
|
|
label="报名人数" |
|
|
|
|
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"> |
|
|
|
|
<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"> |
|
|
|
|
<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"> |
|
|
|
|
<el-table-column label="操作" |
|
|
|
|
align="center" |
|
|
|
|
width="170"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-button type="text" @click="manage(scope.row)">管理</el-button> |
|
|
|
|
<el-button type="text" @click="delData(scope.row)">删除</el-button> |
|
|
|
|
<el-switch |
|
|
|
|
v-if="scope.row.publishStatus" |
|
|
|
|
<el-button type="text" |
|
|
|
|
@click="manage(scope.row)">管理</el-button> |
|
|
|
|
<el-button type="text" |
|
|
|
|
@click="delData(scope.row)">删除</el-button> |
|
|
|
|
<el-switch v-if="scope.row.publishStatus" |
|
|
|
|
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> |
|
|
|
|
@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 background |
|
|
|
|
layout="total, prev, pager, next" |
|
|
|
|
:total="total" |
|
|
|
|
@current-change="handleCurrentChange" |
|
|
|
|
:current-page="page"> |
|
|
|
|
</el-pagination> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
@ -94,7 +153,7 @@ import Setting from "@/setting"; |
|
|
|
|
import { mapMutations } from "vuex"; |
|
|
|
|
import { Loading } from 'element-ui' |
|
|
|
|
export default { |
|
|
|
|
data() { |
|
|
|
|
data () { |
|
|
|
|
return { |
|
|
|
|
timer: null, |
|
|
|
|
keyword: "", |
|
|
|
@ -142,7 +201,7 @@ export default { |
|
|
|
|
page: +this.$route.query.page || 1, |
|
|
|
|
pageSize: 10, |
|
|
|
|
total: 0, |
|
|
|
|
transferPublishStatus: [ "未发布", "已发布"], |
|
|
|
|
transferPublishStatus: ["未发布", "已发布"], |
|
|
|
|
modifyVisible: false, |
|
|
|
|
curRow: { |
|
|
|
|
playingStages: [] |
|
|
|
@ -152,7 +211,7 @@ export default { |
|
|
|
|
pickerOptions: { |
|
|
|
|
shortcuts: [{ |
|
|
|
|
text: '此刻', |
|
|
|
|
onClick(picker) { |
|
|
|
|
onClick (picker) { |
|
|
|
|
picker.$emit('pick', new Date(Date.now() + 5000)) |
|
|
|
|
} |
|
|
|
|
}] |
|
|
|
@ -160,7 +219,7 @@ export default { |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
watch: { |
|
|
|
|
"form.month": function(val) { |
|
|
|
|
"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))]; |
|
|
|
@ -168,7 +227,7 @@ export default { |
|
|
|
|
this.date = []; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
date: function(val) { |
|
|
|
|
date: function (val) { |
|
|
|
|
if (val) { |
|
|
|
|
this.form.startTime = val[0]; |
|
|
|
|
this.form.endTime = val[1]; |
|
|
|
@ -178,16 +237,16 @@ export default { |
|
|
|
|
} |
|
|
|
|
this.initData(); |
|
|
|
|
}, |
|
|
|
|
keyword: function(val) { |
|
|
|
|
keyword: function (val) { |
|
|
|
|
clearTimeout(this.searchTimer); |
|
|
|
|
this.searchTimer = setTimeout(() => { |
|
|
|
|
this.initData(); |
|
|
|
|
}, 500); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
mounted () { |
|
|
|
|
this.getData() |
|
|
|
|
this.$once('hook:beforeDestroy', function() { |
|
|
|
|
this.$once('hook:beforeDestroy', function () { |
|
|
|
|
clearInterval(this.timer) |
|
|
|
|
clearInterval(this.redisTimer) |
|
|
|
|
}) |
|
|
|
@ -196,7 +255,7 @@ export default { |
|
|
|
|
...mapMutations('activity', [ |
|
|
|
|
'setPage' |
|
|
|
|
]), |
|
|
|
|
getList() { |
|
|
|
|
getList () { |
|
|
|
|
// const load = Loading.service() |
|
|
|
|
const { form } = this |
|
|
|
|
this.$post(this.api.myActivities, { |
|
|
|
@ -249,41 +308,41 @@ export default { |
|
|
|
|
// load.close() |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
getData() { |
|
|
|
|
getData () { |
|
|
|
|
this.getList() |
|
|
|
|
}, |
|
|
|
|
initData() { |
|
|
|
|
initData () { |
|
|
|
|
this.page = 1; |
|
|
|
|
this.getData(); |
|
|
|
|
}, |
|
|
|
|
// 获取redis缓存 |
|
|
|
|
getRedis() { |
|
|
|
|
getRedis () { |
|
|
|
|
this.$post(this.api.getRedisCacheActivity).then(({ data }) => { |
|
|
|
|
if (data) { |
|
|
|
|
localStorage.getItem('activityTimestampClient') !== data && this.getList() // 本地缓存跟redis返回的不一样,就查询列表 |
|
|
|
|
localStorage.setItem('activityTimestampClient', data) |
|
|
|
|
} |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
}).catch(res => { }) |
|
|
|
|
}, |
|
|
|
|
getData() { |
|
|
|
|
getData () { |
|
|
|
|
this.getList() |
|
|
|
|
// if (!Setting.isDev) { |
|
|
|
|
clearInterval(this.redisTimer) |
|
|
|
|
this.redisTimer = setInterval(this.getRedis, 1000) |
|
|
|
|
// } |
|
|
|
|
}, |
|
|
|
|
add() { |
|
|
|
|
add () { |
|
|
|
|
this.$router.push("add"); |
|
|
|
|
}, |
|
|
|
|
manage(row) { |
|
|
|
|
manage (row) { |
|
|
|
|
this.$router.push(`manageDetail?id=${row.id}&name=${row.projectName}`) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
changeType() { |
|
|
|
|
changeType () { |
|
|
|
|
this.$refs.table.clearSelection(); |
|
|
|
|
this.initData(); |
|
|
|
|
}, |
|
|
|
|
delData(row) { |
|
|
|
|
delData (row) { |
|
|
|
|
this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", { |
|
|
|
|
type: "warning" |
|
|
|
|
}) |
|
|
|
@ -297,11 +356,11 @@ export default { |
|
|
|
|
.catch(() => { |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
handleSelectionChange(val) { |
|
|
|
|
handleSelectionChange (val) { |
|
|
|
|
this.multipleSelection = val; |
|
|
|
|
}, |
|
|
|
|
// 批量删除 |
|
|
|
|
delAllSelection() { |
|
|
|
|
delAllSelection () { |
|
|
|
|
if (this.multipleSelection.length) { |
|
|
|
|
this.$confirm("确定要删除吗?", "提示", { |
|
|
|
|
type: "warning" |
|
|
|
@ -319,22 +378,24 @@ export default { |
|
|
|
|
this.$message.warning("请先选择项目 !"); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
handleCurrentChange(val) { |
|
|
|
|
handleCurrentChange (val) { |
|
|
|
|
this.page = val; |
|
|
|
|
this.$router.push(`list?page=${val}`) |
|
|
|
|
this.getData() |
|
|
|
|
this.setPage(val) |
|
|
|
|
}, |
|
|
|
|
transferTime(date, type) { |
|
|
|
|
transferTime (date, type) { |
|
|
|
|
if (date == "0000-00-00 00:00:00") return "---"; |
|
|
|
|
return date; |
|
|
|
|
}, |
|
|
|
|
switchOff(val, row) { |
|
|
|
|
switchOff (val, row) { |
|
|
|
|
this.$post(this.api.disabledEventsActivity, { |
|
|
|
|
activityId: row.id, |
|
|
|
|
isOpen: val, |
|
|
|
|
type: 2 // 禁用平台来源(0中台,1职站) |
|
|
|
|
}).then(res => {}).catch(err => {}) |
|
|
|
|
type: 2 |
|
|
|
|
}).then(res => { }).catch(err => { |
|
|
|
|
row.isOpen = val ? 0 : 1 |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|