模型、消息通知

Branch_d40a2540
yujialong 2 years ago
parent 690554178d
commit 743ff5e560
  1. 6
      src/api/index.js
  2. 19
      src/layouts/header/index.vue
  3. 6
      src/pages/expSystem/backstage/addModel.vue
  4. 30
      src/pages/expSystem/backstage/model.vue
  5. 10
      src/pages/expSystem/backstage/modelType.vue
  6. 142
      src/pages/expSystem/backstage/sourceModel.vue
  7. 95
      src/pages/expSystem/backstage/sourceType.vue
  8. 832
      src/pages/match/list/index.vue
  9. 30
      src/pages/match/manage/matchRank.vue
  10. 36
      src/pages/station/preview/index.vue

@ -232,6 +232,9 @@ export default {
toggleTheSortingMode: `competition/competition/rank/toggleTheSortingMode`,
selectTheLastSortStatus: `competition/competition/rank/selectTheLastSortStatus`,
cancelImport: `competition/competition/rank/cancelImport`,
addCompetitionStageRankingTime: `competition/competitionReleaseTime/addCompetitionStageRankingTime`,
cancelCompetitionStageRankingTime: `competition/competitionReleaseTime/cancelCompetitionStageRankingTime`,
getCompetitionStageRankingTime: `competition/competitionReleaseTime/getCompetitionStageRankingTime`,
gradeImport: `https://www.occupationlab.com/template/赛事成绩导入模板.xlsx`,
rankImportTeam: `https://www.occupationlab.com/template/赛事排名导入模板(团队赛).xlsx`,
rankImportPerson: `https://www.occupationlab.com/template/赛事排名导入模板(个人赛).xlsx`,
@ -434,6 +437,9 @@ export default {
referenceDemoList: `nakadai/nakadai/model/reference/demo/referenceDemoList`,
getAllModelList: `nakadai/nakadai/model/reference/demo/getAllModelList`,
synchronizationMdel: `nakadai/nakadai/model/reference/demo/synchronizationMdel`,
builtInClassificationByNakadai: `nakadai/nakadai/model/reference/builtInClassificationByNakadai`,
disableModelDemo: `nakadai/nakadai/model/demo/disabledEvents`,
synchronizationMdelByOccupationlab: `nakadai/nakadai/model/reference/demo/synchronizationMdelByOccupationlab`,
// 教师评语
addComment: `evaluation/cevaluation/comment/addComment`,

@ -73,7 +73,7 @@
<script>
import { mapState, mapMutations, mapActions } from "vuex";
import util from "@/libs/util";
import Setting from "@/setting";
export default {
data () {
return {
@ -83,7 +83,8 @@ export default {
newPassword: "",
reNewPassword: ""
},
notices: []
notices: [],
noticeTimer: null
};
},
computed: {
@ -120,11 +121,15 @@ export default {
},
//
getNotice () {
this.$get(this.api.messageNotificationList, {
type: 2
}).then(res => {
this.notices = res.notificationList
}).catch(res => { });
if (!Setting.isDev) {
this.noticeTimer = setInterval(() => {
this.$get(this.api.messageNotificationList, {
type: 2
}).then(res => {
this.notices = res.notificationList
}).catch(res => { });
}, 1000)
}
},
//
toComment (item) {

@ -114,9 +114,7 @@ export default {
},
//
getType () {
this.$post(this.api.sourceModelClassification, {
founder: 1
}).then(({ data }) => {
this.$post(this.api.sourceModelClassification + '?founder=1').then(({ data }) => {
// children
const handleLeaf = list => {
list.map(e => {
@ -128,7 +126,7 @@ export default {
})
}
handleLeaf(data)
this.categoryList = data
this.categoryList = data[0].children
if (this.id) {
this.getData()
} else {

@ -120,7 +120,8 @@ export default {
modelVisible: false,
modelLoading: false,
modelData: [],
submiting: false
submiting: false,
timer: null
};
},
components: {
@ -134,14 +135,19 @@ export default {
}, 500)
}
},
mounted () { },
mounted () {
this.$once('hook:beforeDestroy', function () {
clearInterval(this.timer)
})
},
methods: {
getData () {
getList () {
const curNode = this.$refs.tree.$refs.tree.getCurrentNode() //
this.isTopLevel = !curNode.level && curNode.categoryName === '全部'
this.isTopLevel = !curNode.level
//
if (this.isTopLevel) {
this.$post(this.api.getAllModelList, {
founder: 1,
modelName: this.keyword,
pageNum: this.page,
pageSize: this.pageSize,
@ -163,6 +169,11 @@ export default {
}).catch(res => { })
}
},
getData () {
clearInterval(this.timer)
this.getList()
// this.timer = setInterval(this.getList, 1000)
},
initData () {
this.$refs.table.clearSelection()
this.page = 1
@ -176,6 +187,7 @@ export default {
this.modelLoading = true
//
this.$post(this.api.getAllModelList, {
founder: 1,
pageNum: 1,
pageSize: 10000,
systemId: this.systemId
@ -183,9 +195,7 @@ export default {
const modelList = res.data.records
//
this.$post(this.api.sourceModelClassification, {
founder: 1
}).then(res => {
this.$post(this.api.sourceModelClassification + '?founder=1').then(res => {
let { data } = res
const promises = []
const addType = list => {
@ -196,7 +206,11 @@ export default {
this.$post(this.api.sysModelDemoList, {
pageNum: 1,
pageSize: 10000,
categoryId: e.id
categoryId: e.id,
founder: 1,
postStatus: 1,
isOpen: 0,
ztOpen: 0
}).then(res => {
const { records } = res.data
const modelChildren = []

@ -103,7 +103,7 @@ export default {
methods: {
//
getType () {
this.$post(`${this.api.modelClassList}?systemId=${this.systemId}`).then(res => {
this.$post(`${this.api.modelClassList}?systemId=${this.systemId}&founder=1`).then(res => {
const { data } = res
this.orgList = data
data.length && this.$nextTick(() => {
@ -142,8 +142,8 @@ export default {
},
syncModelData () {
//
this.$post(`${this.api.delModelInfoBySystemId}?systemId=${this.systemId}`).then(res => {
this.$post(`${this.api.synchronizationMdel}?systemId=${this.systemId}`).then(res => {
this.$post(`${this.api.delModelInfoBySystemId}?systemId=${this.systemId}&founder=1`).then(res => {
this.$post(`${this.api.synchronizationMdelByOccupationlab}?systemId=${this.systemId}`).then(res => {
this.$router.push({
path: 'backstage',
query: {
@ -169,9 +169,7 @@ export default {
//
async addData (id) {
//
this.$post(this.api.sourceModelClassification, {
founder: 1
}).then(res => {
this.$post(this.api.sourceModelClassification + '?founder=1').then(res => {
const { data } = res
const systemId = this.systemId
const promises = []

@ -17,7 +17,7 @@
clearable></el-input>
</li>
</ul>
<div>
<div v-if="!isSystem">
<el-button type="primary"
round
@click="add">新增模型</el-button>
@ -54,9 +54,14 @@
label="分类"
width="150"
align="center"></el-table-column>
<el-table-column prop="modifyName"
<el-table-column v-if="isTopLevel || !isSystem"
prop="modifyName"
label="编辑人"
align="center"></el-table-column>
align="center">
<template slot-scope="scope">
{{ isSystem ? '系统' : scope.row.modifyName }}
</template>
</el-table-column>
<el-table-column prop="updateTime"
label="最新编辑时间"
width="150"
@ -66,10 +71,13 @@
width="100"
align="center">
<template slot-scope="scope">
{{ scope.row.postStatus ? '已发布' : '草稿' }}
{{ isSystem ?
(scope.row.isOpen ? '禁用' : '启用') :
(scope.row.postStatus ? '已发布' : '草稿') }}
</template>
</el-table-column>
<el-table-column label="操作"
<el-table-column v-if="!isSystem"
label="操作"
width="230">
<template slot-scope="scope">
<el-button type="text"
@ -110,7 +118,9 @@ export default {
page: +this.$route.query.page || 1,
pageSize: 10,
total: 0,
multipleSelection: []
multipleSelection: [],
isSystem: 0, //
timer: null
};
},
components: {
@ -125,42 +135,54 @@ export default {
}
},
mounted () {
this.$once('hook:beforeDestroy', function () {
clearInterval(this.timer)
})
},
methods: {
//
getData () {
const curNode = this.$refs.tree.$refs.tree.getCurrentNode() //
async getList (school = 0) {
this.isSystem = school
const curNode = this.$refs.tree.$refs[school ? 'systemTree' : 'tree'].getCurrentNode() || {}//
this.isTopLevel = !curNode.level
//
// if (!curNode.level) {
// this.$post(this.api.getAllModelListBySys, {
// modelName: this.keyword,
// pageNum: this.page,
// pageSize: this.pageSize,
// founder: 1
// }).then(res => {
// this.listData = res.data.records
// this.total = res.data.total
// }).catch(res => { })
// } else {
this.$post(this.api.InstitutionSourceModel, {
modelName: this.keyword,
pageNum: this.page,
pageSize: this.pageSize,
categoryId: curNode.id,
systemId: this.systemId,
founder: 1
}).then(res => {
this.listData = res.data.records
this.total = res.data.total
}).catch(res => { })
// }
let res
//
if (school) {
//
const data = {
modelName: this.keyword,
pageNum: this.page,
pageSize: this.pageSize,
systemId: this.systemId,
founder: 0
}
if (curNode.level) data.categoryId = curNode.id
res = await this.$post(this.api[!curNode.level ? 'getAllModelList' : 'referenceDemoList'], data)
} else {
//
res = await this.$post(this.api.InstitutionSourceModel, {
modelName: this.keyword,
pageNum: this.page,
pageSize: this.pageSize,
categoryId: curNode.id,
systemId: this.systemId,
founder: 1
})
}
this.listData = res.data.records
this.total = res.data.total
},
getData (school) {
clearInterval(this.timer)
this.getList(school)
// this.timer = setInterval(() => {
// this.getList(school)
// }, 1000)
},
initData () {
initData (school) {
this.$refs.table.clearSelection()
this.page = 1
this.getData()
this.getData(school)
},
//
add () {
@ -183,24 +205,6 @@ export default {
this.$message.error("请先选择模型 !")
}
},
//
batchOff (isOpen) {
const off = isOpen === 0
if (this.multipleSelection.length) {
//
let ids = this.multipleSelection.map(e => e.id)
this.$confirm(`确定要${off ? '启用' : '禁用'}吗?`, "提示", {
type: "warning"
}).then(() => {
this.$post(`${this.api.bulkDisable}?isOpen=${isOpen}`, ids).then(res => {
this.$message.success(`${off ? '启用' : '禁用'}成功`)
this.getData()
}).catch(res => { })
}).catch(() => { })
} else {
this.$message.error("请先选择模型 !")
}
},
//
show (row) {
this.$router.push(`addModel?categoryId=${this.$refs.tree.$refs.tree.getCurrentKey()}&id=${row.id}&show=1`)
@ -219,8 +223,38 @@ export default {
}).catch(res => { })
}).catch(() => { })
},
//
batchOff (ztOpen) {
const off = ztOpen === 0
if (this.multipleSelection.length) {
//
let list = []
this.multipleSelection.map(e => {
list.push({
isOpen: ztOpen,
modelId: e.id,
type: 1
})
})
this.$confirm(`确定要${off ? '启用' : '禁用'}吗?`, "提示", {
type: "warning"
}).then(() => {
this.$post(this.api.disableModelDemo, list).then(res => {
this.$message.success(`${off ? '启用' : '禁用'}成功`)
this.getData()
}).catch(res => { })
}).catch(() => { })
} else {
this.$message.error("请先选择模型 !")
}
},
//
switchOff (val, row, index) {
this.$post(`${this.api.bulkDisable}?isOpen=${val}`, [row.id]).then(res => {
this.$post(this.api.disableModelDemo, [{
isOpen: val,
modelId: row.id,
type: 1
}]).then(res => {
this.$message.success(val ? '禁用成功' : '启用成功')
}).catch(res => { })
},

@ -1,20 +1,13 @@
<template>
<div>
<div>
<!-- <div class="text-right">
<el-button type="text"
icon="el-icon-circle-plus-outline"
@click="addType(0)">
</el-button>
</div> -->
<org-tree :data="orgList"
default-expand-all
ref="tree"
node-key="id"
highlight-current
:expand-on-click-node="false"
@node-click="getSingle"
:props="{children: 'children', label: 'categoryName', isLeaf: 'leaf'}">
<el-tree :data="orgList"
ref="tree"
node-key="id"
highlight-current
:expand-on-click-node="false"
@node-click="nodeClick"
:props="{children: 'children', label: 'categoryName', isLeaf: 'leaf'}">
<span class="custom-tree-node"
slot-scope="{ node, data }">
<span style="display: inline-block; margin-right: 20px">{{ node.label }}</span>
@ -35,7 +28,16 @@
</el-button>
</span>
</span>
</org-tree>
</el-tree>
<el-tree :data="orgListSystem"
ref="systemTree"
node-key="id"
highlight-current
:expand-on-click-node="false"
@node-click="nodeSystemClick"
:props="{children: 'children', label: 'categoryName', isLeaf: 'leaf'}">
</el-tree>
</div>
<el-dialog :title="Form.id ? '编辑分类' : '新增分类'"
@ -69,6 +71,7 @@ export default {
return {
systemId: this.$route.query.systemId,
orgList: [],
orgListSystem: [],
typeVisible: false,
Form: {
id: '',
@ -80,7 +83,7 @@ export default {
categoryName: [
{ required: true, message: "请输入分类名称", trigger: "blur" }
]
}
},
};
},
components: {
@ -90,27 +93,30 @@ export default {
this.getType()
},
methods: {
getType () {
this.$post(this.api.sourceModelClassification, {
founder: 1
}).then(res => {
const { data } = res
this.orgList = data
data.length && this.$nextTick(() => {
const categoryId = this.$route.query.categoryId
this.$refs.tree.setCurrentKey(categoryId || data[0].id)
this.$router.push({
path: 'backstage',
query: {
...this.$route.query,
categoryId: this.$refs.tree.getCurrentKey()
}
}).catch(err => { })
this.$emit('getData')
})
}).catch(res => { })
async getType () {
//
const { data } = await this.$post(this.api.sourceModelClassification + '?founder=1')
this.orgList = data
data.length && this.$nextTick(() => {
const categoryId = this.$route.query.categoryId
this.$refs.tree.setCurrentKey(categoryId || data[0].id)
this.$router.push({
path: 'backstage',
query: {
...this.$route.query,
categoryId: this.$refs.tree.getCurrentKey()
}
}).catch(err => { })
this.$emit('getData')
})
//
const res = await this.$post(`${this.api.builtInClassificationByNakadai}?systemId=${this.systemId}`)
this.orgListSystem = res.data
},
getSingle () {
//
nodeClick () {
this.$refs.systemTree.setCurrentKey(null)
this.$router.push({
path: 'backstage',
query: {
@ -120,6 +126,11 @@ export default {
}).catch(err => { })
this.$emit('initData')
},
//
nodeSystemClick () {
this.$refs.tree.setCurrentKey(null)
this.$emit('initData', 1)
},
//
addType (node, data) {
this.typeVisible = true
@ -186,4 +197,16 @@ export default {
};
</script>
<style lang="scss" scoped>
.school-create {
padding: 3px 5px 3px 23px;
margin-top: 5px;
font-size: 14px;
cursor: pointer;
&.active {
background-color: #f0f7ff;
}
&:hover {
background-color: #f0f7ff;
}
}
</style>

@ -1,125 +1,207 @@
<template>
<div class="page">
<h6 class="p-title">筛选</h6>
<div class="tool mul">
<ul class="filter">
<li>
<label>创建时间</label>
<div class="single-choice">
<dl>
<dd>
<el-radio-group 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>
</dd>
</dl>
</div>
</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>
</li>
<li>
<label>搜索</label>
<el-input placeholder="请输入竞赛名称/创建人" suffix-icon="el-icon-search" v-model="keyword" clearable></el-input>
</li>
</ul>
</div>
<div class="tool mul">
<ul class="filter">
<li>
<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>
</dd>
</dl>
</li>
</ul>
<div>
<el-button type="primary" round @click="add" v-auth>创建竞赛</el-button>
<el-button type="primary" round @click="delAllSelection" v-auth>批量删除</el-button>
</div>
</div>
<el-table ref="table" :data="matchData" 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="competitionName" 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">
<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 class="page">
<h6 class="p-title">筛选</h6>
<div class="tool mul">
<ul class="filter">
<li>
<label>创建时间</label>
<div class="single-choice">
<dl>
<dd>
<el-radio-group 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>
</dd>
</dl>
</div>
</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>
</li>
<li>
<label>搜索</label>
<el-input placeholder="请输入竞赛名称/创建人"
suffix-icon="el-icon-search"
v-model="keyword"
clearable></el-input>
</li>
</ul>
</div>
<div class="tool mul">
<ul class="filter">
<li>
<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>
</dd>
</dl>
</li>
</ul>
<div>
<el-button type="primary"
round
@click="add"
v-auth>创建竞赛</el-button>
<el-button type="primary"
round
@click="delAllSelection"
v-auth>批量删除</el-button>
</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>
<el-table ref="table"
:data="matchData"
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="competitionName"
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">
<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>
<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>
<script>
@ -129,271 +211,271 @@ import { mapMutations } from "vuex";
import { Loading } from 'element-ui'
export default {
name: "match",
data() {
return {
timer: null,
keyword: "",
matchData: [],
statuses: [
{
id: '',
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 = [];
}
name: "match",
data () {
return {
timer: null,
keyword: "",
matchData: [],
statuses: [
{
id: '',
name: '不限'
},
date: function(val) {
if (val) {
this.form.startTime = val[0];
this.form.endTime = val[1];
} else {
this.form.startTime = "";
this.form.endTime = "";
}
this.initData();
{
id: 0,
name: '待发布'
},
keyword: function(val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.initData();
}, 500);
{
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 = [];
}
},
mounted() {
this.getData()
this.$once('hook:beforeDestroy', function() {
clearInterval(this.timer)
clearInterval(this.redisTimer)
})
date: function (val) {
if (val) {
this.form.startTime = val[0];
this.form.endTime = val[1];
} else {
this.form.startTime = "";
this.form.endTime = "";
}
this.initData();
},
methods: {
...mapMutations('match', [
'setPage'
]),
getList() {
// const load = Loading.service()
const { form } = this
this.$post(this.api.competitionPageConditionQueryByOccupationlab, {
pageNum: this.page,
pageSize: this.pageSize,
competitionScope: 0, // (0: 1: 2.)
endTime: form.endTime || null,
keyWord: this.keyword || null,
platformSource: 1, // (01)
startTime: form.startTime || null,
publishStatus: form.publishStatus === '' ? null : form.publishStatus
}).then(({ data }) => {
// load.close()
const list = data.records
//
this.timer = setInterval(() => {
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)
}
}
keyword: function (val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.initData();
}, 500);
}
},
mounted () {
this.getData()
this.$once('hook:beforeDestroy', function () {
clearInterval(this.timer)
clearInterval(this.redisTimer)
})
},
methods: {
...mapMutations('match', [
'setPage'
]),
getList () {
// const load = Loading.service()
const { form } = this
this.$post(this.api.competitionPageConditionQueryByOccupationlab, {
pageNum: this.page,
pageSize: this.pageSize,
competitionScope: 0, // (0: 1: 2.)
endTime: form.endTime || null,
keyWord: this.keyword || null,
platformSource: 1, // (01)
startTime: form.startTime || null,
publishStatus: form.publishStatus === '' ? null : form.publishStatus
}).then(({ data }) => {
// load.close()
const list = data.records
//
this.timer = setInterval(() => {
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, {
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}`)
},
}, 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, {
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() {
this.$refs.table.clearSelection();
this.initData();
},
delData(row) {
this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", {
type: "warning"
})
.then(() => {
this.$post(`${this.api.batchDeleteCompetition}?competitionIds=${row.id}`).then(res => {
util.successMsg("删除成功");
this.getData();
}).catch(res => {
});
})
.catch(() => {
});
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
//
delAllSelection() {
if (this.multipleSelection.length) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
let ids = this.multipleSelection.map(i => 'competitionIds=' + i.id);
this.$post(`${this.api.batchDeleteCompetition}?${ids.join('&')}`).then(res => {
this.getData();
this.$message.success("删除成功");
this.$refs.table.clearSelection()
}).catch(err => {
});
}).catch(() => {
});
} else {
this.$message.warning("请先选择赛事 !");
}
},
handleCurrentChange(val) {
this.page = val;
this.$router.push(`list?page=${val}`)
this.getData()
this.setPage(val)
},
transferTime(date, type) {
if (date == "0000-00-00 00:00:00") return "---";
return date;
},
switchOff(val, row) {
this.$post(this.api.disabledEventsCompetition, {
competitionId: row.id,
isOpen: val,
type: 1 // (01)
}).then(res => {
util.successMsg(val == 1 ? '禁用成功' : '启用成功')
}).catch(err => {})
},
}
changeType () {
this.$refs.table.clearSelection();
this.initData();
},
delData (row) {
this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", {
type: "warning"
})
.then(() => {
this.$post(`${this.api.batchDeleteCompetition}?competitionIds=${row.id}`).then(res => {
util.successMsg("删除成功");
this.getData();
}).catch(res => {
});
})
.catch(() => {
});
},
handleSelectionChange (val) {
this.multipleSelection = val;
},
//
delAllSelection () {
if (this.multipleSelection.length) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
let ids = this.multipleSelection.map(i => 'competitionIds=' + i.id);
this.$post(`${this.api.batchDeleteCompetition}?${ids.join('&')}`).then(res => {
this.getData();
this.$message.success("删除成功");
this.$refs.table.clearSelection()
}).catch(err => {
});
}).catch(() => {
});
} else {
this.$message.warning("请先选择赛事 !");
}
},
handleCurrentChange (val) {
this.page = val;
this.$router.push(`list?page=${val}`)
this.getData()
this.setPage(val)
},
transferTime (date, type) {
if (date == "0000-00-00 00:00:00") return "---";
return date;
},
switchOff (val, row) {
this.$post(this.api.disabledEventsCompetition, {
competitionId: row.id,
isOpen: val,
type: 1 // (01)
}).then(res => {
util.successMsg(val == 1 ? '禁用成功' : '启用成功')
}).catch(err => { })
},
}
};
</script>
@ -406,7 +488,7 @@ export default {
}
}
@media(max-width: 1640px) {
@media (max-width: 1640px) {
.page .page-content .tool .filter {
flex-wrap: wrap;
margin-bottom: -15px;

@ -40,9 +40,12 @@
<el-button v-if="!published"
type="primary"
@click="cancelPublish(1)">发布排名</el-button>
<el-button v-else
<div v-else>
<span>{{ publishTime }}发布排名</span>
<el-button class="m-l-5"
type="primary"
@click="cancelPublish(0)">取消发布</el-button>
</div>
</div>
</div>
<el-table :data="list"
@ -236,7 +239,7 @@
@click="publishVisible = false"> </el-button>
<el-button size="small"
type="primary"
@click="publishSubmit"> </el-button>
@click="publishTimeSubmit"> </el-button>
</span>
</el-dialog>
</div>
@ -409,6 +412,7 @@ export default {
stageId: 0,
stageName: '总分'
})
this.getPublishTime()
this.getData()
}).catch(res => { });
},
@ -416,7 +420,6 @@ export default {
typeChange (val) {
this.$post(`${this.api.toggleTheSortingMode}?competitionId=${this.id}&stageId=${this.active || this.stageId}&isOverallRanking=${this.active ? 0 : 1}&whetherToManuallyPublish=${this.type}`).then(res => { }).catch(res => { })
// this.$post(`${this.api.whetherToPublish}?competitionId=${this.id}&stageId=${this.active || this.stageId}&isOverallRanking=${this.active ? 0 : 1}&publicationType=${this.type}`).then(({ whetherToPublish }) => {
// if (whetherToPublish && !val) this.sourceType = '0'
this.getRank()
@ -588,9 +591,26 @@ export default {
}).catch(res => { })
// this.publishSubmit()
},
//
async getPublishTime () {
const res = this.$post(this.api.getCompetitionStageRankingTime, {
competitionId: this.id,
isOverallRanking: this.active ? 0 : 1,
publicationType: this.type,
stageId: this.active || this.stageId,
})
},
//
publishSubmit () {
async publishTimeSubmit () {
this.$post(this.api.addCompetitionStageRankingTime, {
competitionId: this.id,
isOverallRanking: this.active ? 0 : 1,
publicationType: this.type,
stageId: this.active || this.stageId,
releaseTime: util.formatDate("yyyy-MM-dd hh:mm:ss", this.publishTime)
})
util.successMsg('发布成功')
this.publishVisible = false
},
//
cancelPublish (publish) {

@ -392,11 +392,11 @@ export default {
data () {
return {
editorConfig,
courseId: this.$route.query.courseId,
mallId: this.$route.query.mallId || '',
curriculumName: this.$route.query.curriculumName,
commentId: this.$route.query.commentId, //
notifyId: this.$route.query.notifyId,
mallId: '',
courseId: '',
curriculumName: '',
commentId: '', //
notifyId: '',
chapter: this.$route.query.chapter,
section: this.$route.query.section,
fromAdmin: this.$route.query.admin, // or
@ -479,6 +479,17 @@ export default {
])
},
watch: {
'$route': {
handler () {
this.mallId = this.$route.query.mallId || ''
this.courseId = +this.$route.query.courseId
this.curriculumName = this.$route.query.curriculumName
this.commentId = this.$route.query.commentId //
this.notifyId = this.$route.query.notifyId
this.init()
},
immediate: true
},
noteKeyword: function (val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
@ -487,11 +498,7 @@ export default {
}
},
mounted () {
this.insertScript();
this.getData();
this.addRecord()
this.getNote()
this.getComment()
this.init()
},
methods: {
goBack () {
@ -499,6 +506,13 @@ export default {
this.$router.back() :
this.$router.push('/station')
},
init () {
this.insertScript();
this.getData();
this.addRecord()
this.getNote()
this.getComment()
},
async getData () {
let { data } = await this.$post(`${this.api.curriculumDetail}?cid=${this.courseId}&mallId=${this.mallId}`);
this.courseName = data.curriculumName;
@ -654,7 +668,7 @@ export default {
content,
pid: row ? row.commentId : 0,
replyAccountId: row.createAccountId || '',
status: reply ? 2 : 1
status: row ? 2 : 1
}).then(res => {
this.comment = ''
this.getComment()

Loading…
Cancel
Save