添加websocket(赛事、创业、模型)

Branch_d40a2540
yujialong 2 years ago
parent 4def1d805f
commit 559a044844
  1. 1
      src/api/index.js
  2. 62
      src/layouts/header/index.vue
  3. 18
      src/pages/activity/list/index.vue
  4. 37
      src/pages/activity/manage/list/index.vue
  5. 872
      src/pages/assessment/list/index.vue
  6. 26
      src/pages/expSystem/backstage/model.vue
  7. 33
      src/pages/expSystem/backstage/sourceModel.vue
  8. 24
      src/pages/match/list/index.vue
  9. 759
      src/pages/match/preview/index.vue
  10. 68
      src/pages/product/show/index.vue
  11. 2
      src/pages/station/preview/index.vue
  12. 2001
      src/pages/student/list/index.vue
  13. 2
      src/setting.js

@ -12,6 +12,7 @@ export default {
getUserAllRoleByToken : `users/users/role/getUserAllRoleByToken`,
getSchoolIdByToken : `users/users/data/user/getSchoolIdByToken`,
deleteProfile : `users/users/userInfo/deleteProfile`,
refreshPageNotification : `nakadai/message/refreshPageNotification`,
platformLogList: `nakadai/nakadai/log/platformLogList`,
logNotification: `nakadai/nakadai/log/logNotification`,

@ -74,6 +74,7 @@
import { mapState, mapMutations, mapActions } from "vuex";
import util from "@/libs/util";
import Setting from "@/setting";
import Bus from '@/libs/bus'
export default {
data () {
return {
@ -119,24 +120,65 @@ export default {
}
}).catch(res => { })
},
// socket
open () {
console.log("socket连接成功");
},
// socket
error () {
console.log("连接错误");
},
//
getMessage (msg) {
console.log("==websocket接收数据==");
console.log(JSON.parse(msg.data));
const { content } = JSON.parse(msg.data)
// 1234-id
if (content == 1) {
Bus.$emit('matchSocket')
} else if (content == 2) {
Bus.$emit('activitySocket')
} else if (content == 4) {
Bus.$emit('modelSocket')
} else {
this.getNotice()
}
},
// socket
close () {
console.log("socket已经关闭");
},
initSocket ({ id, account }) {
// socket
// this.socket = new WebSocket(`ws://${Setting.isDev ? '192.168.31.51' : location.host}:9100/nakadai/websocket/${id}/${account}`)
this.socket = new WebSocket(`ws://121.37.12.51:9100/nakadai/websocket/${id}/${account}`)
// socket
this.socket.onopen = this.open;
// socket
this.socket.onerror = this.error;
// socket
this.socket.onmessage = this.getMessage;
},
//
getNotice () {
if (!Setting.isDev) {
this.noticeTimer = setInterval(() => {
this.$get(this.api.messageNotificationList, {
type: 2
}).then(res => {
this.notices = res.notificationList
}).catch(res => { });
}, 5000)
}
this.$get(this.api.messageNotificationList, {
type: 2
}).then(res => {
this.notices = res.notificationList
}).catch(res => { });
},
//
toComment (item) {
async toComment (item) {
await this.$post(`${this.api.noticeRead}?isRead=1&notifyId=${item.notifyId}`) //
this.$router.push(`/station/preview?courseId=${item.cid}&commentId=${item.commentId}&notifyId=${item.notifyId}`)
},
getUserDetail () { //
this.$get(this.api.queryUserInfoDetails).then(res => {
this.initSocket(res.result.userAccount)
let { hrUserInfo } = res.result
if (hrUserInfo) {
const { userAvatars, userName, userId } = hrUserInfo

@ -141,11 +141,11 @@ import { mapState, mapMutations } from "vuex";
import { Loading } from "element-ui";
import Setting from "@/setting"
import util from "@/libs/util"
import Bus from '@/libs/bus'
export default {
data () {
return {
timer: null,
redisTimer: null,
token: util.local.get(Setting.tokenKey),
statusList: ["待报名", "取消报名", "马上报名", "报名截止", "已结束"],
endList: ["报名开始", "报名截止", "报名截止", "项目开始", "项目结束"],
@ -200,14 +200,18 @@ export default {
}
},
mounted () {
// websocket
Bus.$on('activitySocket', () => {
this.getData()
})
this.getData()
this.$once('hook:beforeDestroy', function () {
this.clearTimer()
clearInterval(this.redisTimer)
})
},
methods: {
getList () {
getData () {
this.clearTimer()
const { form } = this
const data = {
@ -278,14 +282,6 @@ export default {
})
this.timerList = []
},
getData () {
// this.loadIns = Loading.service()
this.getList()
if (!Setting.isDev) {
clearInterval(this.redisTimer)
this.redisTimer = setInterval(this.getRedis, 1000)
}
},
initData () {
this.page = 1
this.getData()

@ -179,6 +179,7 @@ import util from "@/libs/util";
import Setting from "@/setting";
import { mapMutations } from "vuex";
import { Loading } from 'element-ui'
import Bus from '@/libs/bus'
export default {
data () {
return {
@ -249,7 +250,6 @@ export default {
playingStages: []
},
timer: null,
redisTimer: null,
pickerOptions: {
shortcuts: [{
text: '此刻',
@ -287,17 +287,21 @@ export default {
}
},
mounted () {
// websocket
Bus.$on('activitySocket', () => {
this.getData()
})
this.getData()
this.$once('hook:beforeDestroy', function () {
clearInterval(this.timer)
clearInterval(this.redisTimer)
})
},
methods: {
...mapMutations('activity', [
'setPage'
]),
getList () {
getData () {
// const load = Loading.service()
const { form } = this
this.$post(this.api.activityList, {
@ -318,33 +322,12 @@ export default {
this.page--
this.getData()
}
}).catch(res => {
// load.close()
})
},
getData () {
this.getList()
}).catch(res => { })
},
initData () {
this.page = 1;
this.getData();
},
// redis
getRedis () {
this.$post(this.api.getRedisCacheActivity).then(({ data }) => {
if (data) {
localStorage.getItem('activityTimestamp') !== data && this.getList() // redis
localStorage.setItem('activityTimestamp', data)
}
}).catch(res => { })
},
getData () {
this.getList()
// if (!Setting.isDev) {
clearInterval(this.redisTimer)
this.redisTimer = setInterval(this.getRedis, 1000)
// }
},
add () {
this.$router.push("add");
},
@ -397,7 +380,7 @@ export default {
if (date == "0000-00-00 00:00:00") return "---";
return date;
},
switchOff (val, row) {
async switchOff (val, row) {
this.$post(this.api.disabledEventsActivity, {
activityId: row.id,
isOpen: val,
@ -405,6 +388,8 @@ export default {
}).then(res => { }).catch(err => {
row.schoolOpen = val ? 0 : 1
})
await this.$post(`${this.api.refreshPageNotification}?content=2`)
},
}
};

@ -1,410 +1,510 @@
<template>
<div class="page">
<h6 class="p-title">筛选</h6>
<div class="tool mul">
<ul class="filter">
<li>
<label>创建时间</label>
<el-radio-group v-model="form.month" @change="initData">
<el-radio v-for="(item,index) in dateList" :key="index" :label="item.id" border>{{ item.name }}</el-radio>
</el-radio-group>
<el-date-picker v-model="date" @blur='pickerInput' align="right" unlink-panels type="daterange" style="width: 300px;margin-left: 10px;" start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" clearable></el-date-picker>
</li>
<li>
<label>发布类型</label>
<el-select v-model="form.type" clearable placeholder="请选择发布类型" @change="initData">
<el-option v-for="(item,index) in typeList" :key="index" :label="item.name" :value="item.value"></el-option>
</el-select>
</li>
<li>
<label>实验状态</label>
<el-select v-model="form.status" clearable placeholder="请选择实验状态" @change="initData">
<el-option v-for="(item,index) in statusList" :key="index" :label="item.name" :value="item.value"></el-option>
</el-select>
</li>
<li>
<label>课程</label>
<el-select v-model="curriculumId" placeholder="请选择" @change="initData">
<el-option label="不限" value=""></el-option>
<el-option
v-for="item in curriculumList"
:key="item.cid"
:label="item.curriculumName"
:value="item.cid"
></el-option>
</el-select>
</li>
</ul>
</div>
<div class="tool mul">
<ul class="filter">
<li>
<el-input placeholder="请输入实验班级/项目名称/考核名称" prefix-icon="el-icon-search" v-model.trim="keyWord" clearable style="width: 300px"></el-input>
</li>
</ul>
<div>
<div>
<el-button v-auth type="info" round @click="add" >创建考核</el-button>
<el-button v-auth type="primary" round @click="delAllData">批量删除</el-button>
</div>
</div>
<div class="page">
<h6 class="p-title">筛选</h6>
<div class="tool mul">
<ul class="filter">
<li>
<label>创建时间</label>
<el-radio-group v-model="form.month"
@change="initData">
<el-radio v-for="(item,index) in dateList"
:key="index"
:label="item.id"
border>{{ item.name }}</el-radio>
</el-radio-group>
<el-date-picker v-model="date"
@blur='pickerInput'
align="right"
unlink-panels
type="daterange"
style="width: 300px;margin-left: 10px;"
start-placeholder="开始日期"
end-placeholder="结束日期"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
clearable></el-date-picker>
</li>
<li>
<label>发布类型</label>
<el-select v-model="form.type"
clearable
placeholder="请选择发布类型"
@change="initData">
<el-option v-for="(item,index) in typeList"
:key="index"
:label="item.name"
:value="item.value"></el-option>
</el-select>
</li>
<li>
<label>实验状态</label>
<el-select v-model="form.status"
clearable
placeholder="请选择实验状态"
@change="initData">
<el-option v-for="(item,index) in statusList"
:key="index"
:label="item.name"
:value="item.value"></el-option>
</el-select>
</li>
<li>
<label>课程</label>
<el-select v-model="curriculumId"
placeholder="请选择"
@change="initData">
<el-option label="不限"
value=""></el-option>
<el-option v-for="item in curriculumList"
:key="item.cid"
:label="item.curriculumName"
:value="item.cid"></el-option>
</el-select>
</li>
</ul>
</div>
<div class="tool mul">
<ul class="filter">
<li>
<el-input placeholder="请输入实验班级/项目名称/考核名称"
prefix-icon="el-icon-search"
v-model.trim="keyWord"
clearable
style="width: 300px"></el-input>
</li>
</ul>
<div>
<div>
<el-button v-auth
type="info"
round
@click="add">创建考核</el-button>
<el-button v-auth
type="primary"
round
@click="delAllData">批量删除</el-button>
</div>
</div>
</div>
<el-table v-loading="listLoading" ref="table" :data="listData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id">
<el-table-column type="selection" :selectable="row => row.status !== 1" width="50" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="60" label="序号" align="center">
<template slot-scope="scope">
{{ scope.$index + (pageNum - 1) * pageSize + 1 }}
</template>
</el-table-column>
<el-table-column prop="className" label="实验班级" align="center" min-width="120px" show-overflow-tooltip></el-table-column>
<el-table-column prop="experimentalName" label="考核名称" align="center" min-width="120px" show-overflow-tooltip></el-table-column>
<el-table-column prop="projectName" label="项目名称" min-width="200" show-overflow-tooltip align="center"></el-table-column>
<el-table-column prop="experimenterNum" label="实验人数" align="center"></el-table-column>
<el-table-column prop="experimentDuration" label="实验时长" align="center"></el-table-column>
<el-table-column label="邀请码" align="center">
<template slot-scope="scope">
<span>{{ scope.row.isEnableCode == 1 ? scope.row.invitationCode : "" }}</span>
</template>
</el-table-column>
<el-table-column prop="type" label="发布类型" align="center">
<template slot-scope="scope">
<span>{{ types[scope.row.type] }}</span>
</template>
</el-table-column>
<el-table-column prop="createTime" width="150" label="创建时间" align="center">
</el-table-column>
<el-table-column prop="startTime" width="150" label="起始时间" align="center">
<template slot-scope="scope">
<span>{{ transferTime(scope.row.startTime) }}</span>
</template>
</el-table-column>
<el-table-column prop="stopTime" width="150" label="结束时间" align="center">
<template slot-scope="scope">
<span>{{ transferTime(scope.row.stopTime) }}</span>
</template>
</el-table-column>
<el-table-column label="倒计时" align="center">
<template slot-scope="scope">
<span>{{ timeFilter(scope.row) }}</span>
</template>
</el-table-column>
<el-table-column label="实验状态" align="center">
<template slot-scope="scope">
<span>
{{ status[scope.row.status] }}
</span>
</template>
</el-table-column>
<el-table-column label="操作" width="170" align="center">
<template slot-scope="scope">
<template v-if="scope.row.status == 0 && (roleName.includes('超级') || roleName === scope.row.roleName || (roleName === '管理员' && !scope.row.roleName.includes('超级')))">
<el-button v-auth v-if="scope.row.type == 1" type="text" @click="start(scope.row)">启动</el-button>
<el-button v-auth type="text" @click="edit(scope.row)">修改</el-button>
</template>
<template v-else-if="scope.row.status == 1 && (roleName.includes('超级') || roleName === scope.row.roleName || (roleName === '管理员' && !scope.row.roleName.includes('超级')))">
<el-button v-auth type="text" @click="finish(scope.row)">提前结束</el-button>
</template>
<template v-else-if="scope.row.status == 2">
<el-button v-auth type="text" @click="show(scope.row)">查看成绩</el-button>
</template>
<el-button v-auth v-if="(scope.row.status == 0 || scope.row.status == 2) && (roleName.includes('超级') || roleName === scope.row.roleName || (roleName === '管理员' && !scope.row.roleName.includes('超级')))" type="text" @click="delData(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" :current-page="pageNum"></el-pagination>
</div>
<el-table v-loading="listLoading"
ref="table"
:data="listData"
class="table"
stripe
header-align="center"
@selection-change="handleSelectionChange"
row-key="id">
<el-table-column type="selection"
:selectable="row => row.status !== 1"
width="50"
align="center"
:reserve-selection="true"></el-table-column>
<el-table-column type="index"
width="60"
label="序号"
align="center">
<template slot-scope="scope">
{{ scope.$index + (pageNum - 1) * pageSize + 1 }}
</template>
</el-table-column>
<el-table-column prop="className"
label="实验班级"
align="center"
min-width="120px"
show-overflow-tooltip></el-table-column>
<el-table-column prop="experimentalName"
label="考核名称"
align="center"
min-width="120px"
show-overflow-tooltip></el-table-column>
<el-table-column prop="projectName"
label="项目名称"
min-width="200"
show-overflow-tooltip
align="center"></el-table-column>
<el-table-column prop="experimenterNum"
label="实验人数"
align="center"></el-table-column>
<el-table-column prop="experimentDuration"
label="实验时长"
align="center"></el-table-column>
<el-table-column label="邀请码"
align="center">
<template slot-scope="scope">
<span>{{ scope.row.isEnableCode == 1 ? scope.row.invitationCode : "" }}</span>
</template>
</el-table-column>
<el-table-column prop="type"
label="发布类型"
align="center">
<template slot-scope="scope">
<span>{{ types[scope.row.type] }}</span>
</template>
</el-table-column>
<el-table-column prop="createTime"
width="150"
label="创建时间"
align="center">
</el-table-column>
<el-table-column prop="startTime"
width="150"
label="起始时间"
align="center">
<template slot-scope="scope">
<span>{{ transferTime(scope.row.startTime) }}</span>
</template>
</el-table-column>
<el-table-column prop="stopTime"
width="150"
label="结束时间"
align="center">
<template slot-scope="scope">
<span>{{ transferTime(scope.row.stopTime) }}</span>
</template>
</el-table-column>
<el-table-column label="倒计时"
align="center">
<template slot-scope="scope">
<span>{{ timeFilter(scope.row) }}</span>
</template>
</el-table-column>
<el-table-column label="实验状态"
align="center">
<template slot-scope="scope">
<span>
{{ status[scope.row.status] }}
</span>
</template>
</el-table-column>
<el-table-column label="操作"
width="170"
align="center">
<template slot-scope="scope">
<template v-if="scope.row.status == 0 && (roleName.includes('超级') || roleName === scope.row.roleName || (roleName === '管理员' && !scope.row.roleName.includes('超级')))">
<el-button v-auth
v-if="scope.row.type == 1"
type="text"
@click="start(scope.row)">启动</el-button>
<el-button v-auth
type="text"
@click="edit(scope.row)">修改</el-button>
</template>
<template v-else-if="scope.row.status == 1 && (roleName.includes('超级') || roleName === scope.row.roleName || (roleName === '管理员' && !scope.row.roleName.includes('超级')))">
<el-button v-auth
type="text"
@click="finish(scope.row)">提前结束</el-button>
</template>
<template v-else-if="scope.row.status == 2">
<el-button v-auth
type="text"
@click="show(scope.row)">查看成绩</el-button>
</template>
<el-button v-auth
v-if="(scope.row.status == 0 || scope.row.status == 2) && (roleName.includes('超级') || roleName === scope.row.roleName || (roleName === '管理员' && !scope.row.roleName.includes('超级')))"
type="text"
@click="delData(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background
layout="total, prev, pager, next"
:total="total"
@current-change="handleCurrentChange"
:current-page="pageNum"></el-pagination>
</div>
</div>
</template>
<script>
import { mapState } from "vuex";
import util from "@/libs/util";
export default {
data() {
return {
typeList: [
{
value: "",
name: "不限"
}, {
value: 1,
name: "手动发布"
}, {
value: 2,
name: "定时发布"
}
],
types: ["", "手动发布", "定时发布"],
statusList: [
{
value: "",
name: "不限"
}, {
value: 0,
name: "待开始"
}, {
value: 1,
name: "进行中"
}, {
value: 2,
name: "已结束"
}
],
status: ["待开始", "进行中", "已结束"],
dateList: [
{
id: "",
name: "不限"
}, {
id: 1,
name: "近一个月"
}, {
id: 3,
name: "近三个月"
}, {
id: 6,
name: "近六个月"
}
],
date: [],
curriculumList: [],
curriculumId: "",
keyWord: "", //
searchTimer: null,
form: {
type: "",
status: "",
startTime: "",
endTime: "",
month: ""
},
pageNum: +this.$route.query.page || 1, //
pageSize: 10, // 10
total: 0, //
listData: [], //
multipleSelection: [], //
listLoading:false,//
ticker: null, //
};
data () {
return {
typeList: [
{
value: "",
name: "不限"
}, {
value: 1,
name: "手动发布"
}, {
value: 2,
name: "定时发布"
}
],
types: ["", "手动发布", "定时发布"],
statusList: [
{
value: "",
name: "不限"
}, {
value: 0,
name: "待开始"
}, {
value: 1,
name: "进行中"
}, {
value: 2,
name: "已结束"
}
],
status: ["待开始", "进行中", "已结束"],
dateList: [
{
id: "",
name: "不限"
}, {
id: 1,
name: "近一个月"
}, {
id: 3,
name: "近三个月"
}, {
id: 6,
name: "近六个月"
}
],
date: [],
curriculumList: [],
curriculumId: "",
keyWord: "", //
searchTimer: null,
form: {
type: "",
status: "",
startTime: "",
endTime: "",
month: ""
},
pageNum: +this.$route.query.page || 1, //
pageSize: 10, // 10
total: 0, //
listData: [], //
multipleSelection: [], //
listLoading: false,//
ticker: null, //
};
},
computed: {
...mapState("user", [
'roleName'
])
},
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 = [];
}
},
computed: {
...mapState("user", [
'roleName'
])
date: function (val) {
if (val) {
this.form.startTime = val[0];
this.form.endTime = val[1];
} else {
this.form.startTime = "";
this.form.endTime = "";
this.form.month = '';
}
this.initData();
},
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) {
this.form.startTime = val[0];
this.form.endTime = val[1];
} else {
this.form.startTime = "";
this.form.endTime = "";
this.form.month = '';
keyWord: function (val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.initData();
}, 500);
}
},
mounted () {
//
this.$once("hook:beforeDestroy", function () {
clearInterval(this.ticker);
this.ticker = null;
});
this.getData(1);
this.getschoolCourse();
},
methods: {
pickerInput () {
this.form.month = '6'
},
beginTimer () {
clearInterval(this.ticker)
this.ticker = setInterval(() => {
for (let i = 0; i < this.listData.length; i++) {
const item = this.listData[i];
if (item.countDown > 0) {
item.countDown--;
} else {
if (item.status == 0 && item.type == 2) { // -
item.status = 1;
item.countDown = (new Date(item.stopTime).getTime() - new Date().getTime()) / 1000;
// }
} else if (item.status == 1) {
// item.status = 2;
}
this.initData();
},
keyWord: function(val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.initData();
}, 500);
}
this.$set(this.listData, i, item);
}
}, 1000);
},
mounted() {
//
this.$once("hook:beforeDestroy", function() {
clearInterval(this.ticker);
this.ticker = null;
});
this.getData(1);
this.getschoolCourse();
timeFilter (countDown) {
if (countDown.countDown > 0) {
let h = Math.floor(countDown.countDown / (60 * 60));
let m = Math.floor(countDown.countDown % (60 * 60) / 60);
let s = Math.floor(countDown.countDown % (60 * 60) % 60);
return `${h > 9 ? h : `0${h}`}:${m > 9 ? m : `0${m}`}:${s > 9 ? s : `0${s}`}`;
} else {
if (countDown.status == 1) {
countDown.status = 2
}
return "00:00:00";
}
},
methods: {
pickerInput(){
this.form.month = '6'
},
beginTimer() {
clearInterval(this.ticker)
this.ticker = setInterval(() => {
for (let i = 0; i < this.listData.length; i++) {
const item = this.listData[i];
if (item.countDown > 0) {
item.countDown--;
} else {
if (item.status == 0 && item.type == 2) { // -
item.status = 1;
item.countDown = (new Date(item.stopTime).getTime() - new Date().getTime()) / 1000;
// }
} else if (item.status == 1) {
// item.status = 2;
}
}
this.$set(this.listData, i, item);
getData (counddown) {
this.listLoading = true;
let data = {
...this.form,
keyWord: this.keyWord,
pageNum: this.pageNum,
pageSize: this.pageSize,
curriculumId: this.curriculumId
};
this.$post(this.api.pageByCondition, data).then(res => {
this.listData = res.list;
this.total = res.total;
this.listData.forEach(i => {
if (i.status == 2) { //
i.countDown = 0;
} else {
if (i.type == 2) { //
if (i.status == 0) {
//
i.countDown = (new Date(i.startTime).getTime() - new Date().getTime()) / 1000; //
} else if (i.status == 1) {
//
i.countDown = (new Date(i.stopTime).getTime() - new Date().getTime()) / 1000;
}
} else if (i.type == 1) { //
if (i.status == 0) {
//
i.countDown = 0;
} else if (i.status == 1) {
//
i.countDown = (new Date(i.stopTime).getTime() - new Date().getTime()) / 1000;
}
}, 1000);
},
timeFilter(countDown) {
if (countDown.countDown > 0) {
let h = Math.floor(countDown.countDown / (60 * 60));
let m = Math.floor(countDown.countDown % (60 * 60) / 60);
let s = Math.floor(countDown.countDown % (60 * 60) % 60);
return `${h > 9 ? h : `0${h}`}:${m > 9 ? m : `0${m}`}:${s > 9 ? s : `0${s}`}`;
} else {
if(countDown.status == 1){
countDown.status = 2
}
return "00:00:00";
}
},
getData(counddown) {
this.listLoading = true;
let data = {
...this.form,
keyWord: this.keyWord,
pageNum: this.pageNum,
pageSize: this.pageSize,
curriculumId: this.curriculumId
};
this.$post(this.api.pageByCondition, data).then(res => {
this.listData = res.list;
this.total = res.total;
this.listData.forEach(i => {
if (i.status == 2) { //
i.countDown = 0;
} else {
if (i.type == 2) { //
if (i.status == 0) {
//
i.countDown = (new Date(i.startTime).getTime() - new Date().getTime()) / 1000; //
} else if (i.status == 1) {
//
i.countDown = (new Date(i.stopTime).getTime() - new Date().getTime()) / 1000;
}
} else if (i.type == 1) { //
if (i.status == 0) {
//
i.countDown = 0;
} else if (i.status == 1) {
//
i.countDown = (new Date(i.stopTime).getTime() - new Date().getTime()) / 1000;
}
}
}
});
counddown && this.beginTimer()
this.listLoading = false;
}).catch(err => {
this.listLoading = false;
});
},
initData() {
}
});
counddown && this.beginTimer()
this.listLoading = false;
}).catch(err => {
this.listLoading = false;
});
},
initData () {
this.$refs.table.clearSelection();
this.pageNum = 1;
this.getData();
},
getschoolCourse () { //
this.$get(this.api.schoolCourse).then(res => {
this.curriculumList = res.data;
}).catch(err => {
console.log(err);
});
},
add () {
this.$router.push("add");
},
edit (row) {
this.$router.push(`add?id=${row.id}`);
},
show (row) {
this.$router.push(`/achievement/teach?id=${row.id}&projectName=${row.projectName}&permissions=1`)
},
start (row) {
this.$post(`${this.api.enableAssessment}?id=${row.id}`).then(res => {
util.successMsg("启动成功!");
this.getData(1);
}).catch(err => {
console.log(err);
});
},
finish (row) {
this.$confirm("确定要提前结束吗?", "提示", {
type: "warning"
}).then(() => {
let data = {
id: row.id,
endTime: util.formatDate("yyyy-MM-dd hh:mm:ss", new Date()),
status: 2
};
this.$post(`${this.api.collectPaper}?id=${row.id}`).then(async res => {
util.successMsg("提前结束成功!");
this.getData();
// await this.$post(`${this.api.refreshPageNotification}?content=3-${row.id}`)
}).catch(err => {
console.log(err);
});
}).catch(() => {
});
},
delData (row) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
this.$post(this.api.deleteAssessment, [row.id]).then(res => {
util.successMsg("删除成功");
this.getData();
}).catch(res => {
});
}).catch(() => {
});
},
delAllData () {
if (this.multipleSelection.length) {
let ids = this.multipleSelection.map(item => {
return item.id;
});
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
this.$post(this.api.deleteAssessment, ids).then(res => {
this.multipleSelection = [];
this.$refs.table.clearSelection();
this.pageNum = 1;
util.successMsg("删除成功");
this.getData();
},
getschoolCourse() { //
this.$get(this.api.schoolCourse).then(res => {
this.curriculumList = res.data;
}).catch(err => {
console.log(err);
});
},
add() {
this.$router.push("add");
},
edit(row) {
this.$router.push(`add?id=${row.id}`);
},
show(row) {
this.$router.push(`/achievement/teach?id=${row.id}&projectName=${row.projectName}&permissions=1`)
},
start(row) {
this.$post(`${this.api.enableAssessment}?id=${row.id}`).then(res => {
util.successMsg("启动成功!");
this.getData(1);
}).catch(err => {
console.log(err);
});
},
finish(row) {
this.$confirm("确定要提前结束吗?", "提示", {
type: "warning"
}).then(() => {
let data = {
id: row.id,
endTime: util.formatDate("yyyy-MM-dd hh:mm:ss", new Date()),
status: 2
};
this.$post(`${this.api.collectPaper}?id=${row.id}`).then(res => {
util.successMsg("提前结束成功!");
this.getData();
}).catch(err => {
console.log(err);
});
}).catch(() => {
});
},
delData(row) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
this.$post(this.api.deleteAssessment, [row.id]).then(res => {
util.successMsg("删除成功");
this.getData();
}).catch(res => {
});
}).catch(() => {
});
},
delAllData() {
if (this.multipleSelection.length) {
let ids = this.multipleSelection.map(item => {
return item.id;
});
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
this.$post(this.api.deleteAssessment, ids).then(res => {
this.multipleSelection = [];
this.$refs.table.clearSelection();
util.successMsg("删除成功");
this.getData();
}).catch(res => {
});
if(this.multipleSelection.length === this.listData.length && this.pageNum>1) {
this.handleCurrentChange(this.pageNum - 1)
}
}).catch(() => {
});
} else {
util.errorMsg("请先选择数据 !");
}
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
handleCurrentChange(val) {
this.pageNum = val
this.$router.push(`list?page=${val}`)
this.getData();
},
transferTime(date) {
if (date == "0000-00-00 00:00:00" || !date) return "---";
return date;
}
}).catch(res => {
});
if (this.multipleSelection.length === this.listData.length && this.pageNum > 1) {
this.handleCurrentChange(this.pageNum - 1)
}
}).catch(() => {
});
} else {
util.errorMsg("请先选择数据 !");
}
},
handleSelectionChange (val) {
this.multipleSelection = val;
},
handleCurrentChange (val) {
this.pageNum = val
this.$router.push(`list?page=${val}`)
this.getData();
},
transferTime (date) {
if (date == "0000-00-00 00:00:00" || !date) return "---";
return date;
}
}
};
</script>

@ -120,6 +120,7 @@
<script>
import org from "./modelType"
import Setting from '@/setting'
import Bus from '@/libs/bus'
export default {
data () {
return {
@ -136,7 +137,6 @@ export default {
schoolModels: [],
systemModels: [],
submiting: false,
timer: null
};
},
components: {
@ -151,13 +151,15 @@ export default {
}
},
mounted () {
this.$once('hook:beforeDestroy', function () {
clearInterval(this.timer)
// websocket
Bus.$on('modelSocket', () => {
this.getData()
})
},
methods: {
getList () {
getData () {
const curNode = this.$refs.tree.$refs.tree.getCurrentNode() //
console.log("🚀 ~ file: model.vue:162 ~ getData ~ this.$refs.tree:", this.$refs.tree)
if (curNode) {
this.isTopLevel = !curNode.level
//
@ -186,22 +188,6 @@ export default {
}
}
},
getData () {
clearInterval(this.timer)
this.getList()
if (!Setting.isDev) {
this.timer = setInterval(this.getRedis, 1000)
}
},
// redis
getRedis () {
this.$post(this.api.modelRedis).then(({ data }) => {
if (data) {
localStorage.getItem('modelAdmin') !== data && this.getList() // redis
localStorage.setItem('modelAdmin', data)
}
}).catch(res => { })
},
initData () {
this.page = 1
this.getData()

@ -129,6 +129,7 @@
<script>
import org from "./sourceType"
import Setting from '@/setting'
import Bus from '@/libs/bus'
export default {
data () {
return {
@ -141,7 +142,6 @@ export default {
total: 0,
multipleSelection: [],
isSystem: 0, //
timer: null
};
},
components: {
@ -156,13 +156,14 @@ export default {
}
},
mounted () {
this.$once('hook:beforeDestroy', function () {
clearInterval(this.timer)
// websocket
Bus.$on('modelSocket', () => {
this.getData()
})
},
methods: {
//
async getList () {
async getData () {
const curNode = this.$refs.tree.$refs.tree.getCurrentNode() || {}//
this.isTopLevel = !curNode.level
let res
@ -174,7 +175,6 @@ export default {
founder: 0
}
if (curNode.level) data.categoryId = curNode.id
console.log("🚀 ~ file: sourceModel.vue:177 ~ getList ~ this.isSystem:", this.isSystem)
//
if (this.isSystem) {
//
@ -191,22 +191,6 @@ export default {
this.listData = res.data.records
this.total = res.data.total
},
getData () {
clearInterval(this.timer)
this.getList()
if (!Setting.isDev) {
this.timer = setInterval(this.getRedis, 1000)
}
},
// redis
getRedis () {
this.$post(this.api.modelRedis).then(({ data }) => {
if (data) {
localStorage.getItem('modelAdmin') !== data && this.getList() // redis
localStorage.setItem('modelAdmin', data)
}
}).catch(res => { })
},
//
catetoryClick (school) {
this.isSystem = school
@ -272,7 +256,8 @@ export default {
type: "warning"
}).then(() => {
//
this.$post(this.api[isSystem ? (off ? 'demoHiddenOpen' : 'demoHiddenClose') : 'disableModelDemo'], list).then(res => {
this.$post(this.api[isSystem ? (off ? 'demoHiddenOpen' : 'demoHiddenClose') : 'disableModelDemo'], list).then(async res => {
await this.$post(`${this.api.refreshPageNotification}?content=4`)
this.$refs.table.clearSelection()
this.$message.success(`${off ? '启用' : '禁用'}成功`)
this.getData()
@ -285,7 +270,7 @@ export default {
}
},
//
switchOff (val, row) {
async switchOff (val, row) {
this.$post(this.api.disableModelDemo, [{
isOpen: val,
modelId: row.id,
@ -295,6 +280,8 @@ export default {
}).catch(res => {
this.getList()
})
await this.$post(`${this.api.refreshPageNotification}?content=4`)
},
//
switchOffSystem (val, row) {

@ -209,7 +209,7 @@ import util from "@/libs/util";
import Setting from "@/setting";
import { mapMutations } from "vuex";
import { Loading } from 'element-ui'
import Bus from '@/libs/bus'
export default {
name: "match",
data () {
@ -266,7 +266,6 @@ export default {
playingStages: []
},
timer: null,
redisTimer: null,
pickerOptions: {
shortcuts: [{
text: '此刻',
@ -304,17 +303,20 @@ export default {
}
},
mounted () {
// websocket
Bus.$on('matchSocket', () => {
this.getData()
})
this.getData()
this.$once('hook:beforeDestroy', function () {
clearInterval(this.timer)
clearInterval(this.redisTimer)
})
},
methods: {
...mapMutations('match', [
'setPage'
]),
getList () {
getData () {
// const load = Loading.service()
const { form } = this
this.$post(this.api.competitionPageConditionQueryByOccupationlab, {
@ -366,9 +368,6 @@ export default {
// load.close()
})
},
getData () {
this.getList()
},
initData () {
this.page = 1;
this.getData();
@ -379,13 +378,6 @@ export default {
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");
},
@ -466,7 +458,7 @@ export default {
if (date == "0000-00-00 00:00:00") return "---";
return date;
},
switchOff (val, row) {
async switchOff (val, row) {
this.$post(this.api.disabledEventsCompetition, {
competitionId: row.id,
isOpen: val,
@ -474,6 +466,8 @@ export default {
}).then(res => {
util.successMsg(val == 1 ? '禁用成功' : '启用成功')
}).catch(err => { })
await this.$post(`${this.api.refreshPageNotification}?content=1`)
},
}
};

@ -1,112 +1,150 @@
<template>
<div class="match">
<div class="banner" :style="{backgroundImage: 'url(' + (form.carouselUrl || 'https://huoran.oss-cn-shenzhen.aliyuncs.com/20220613/png/1536269450851409920.png') + ')'}"></div>
<div class="center">
<breadcrumb ref="breadcrumb" :data="'全部赛事/' + form.name" route="matchPreview"></breadcrumb>
<div class="match-inner">
<div class="flex-between">
<el-tabs v-model="curType" @tab-click="typeChange">
<el-tab-pane v-for="(item, index) in typeList" :key="index" :label="item.name" :name="item.id"></el-tab-pane>
</el-tabs>
<div class="status wait">等待报名</div>
</div>
<div class="info">
<h6 class="title">{{ form.name }}</h6>
<div class="meta">最近编辑时间{{ form.updateTime }}</div>
<div class="match">
<div class="banner"
:style="{backgroundImage: 'url(' + (form.carouselUrl || 'https://huoran.oss-cn-shenzhen.aliyuncs.com/20220613/png/1536269450851409920.png') + ')'}"></div>
<div class="center">
<breadcrumb ref="breadcrumb"
:data="'全部赛事/' + form.name"
route="list"></breadcrumb>
<div class="match-inner">
<div class="flex-between">
<el-tabs v-model="curType"
@tab-click="typeChange">
<el-tab-pane v-for="(item, index) in typeList"
:key="index"
:label="item.name"
:name="item.id"></el-tab-pane>
</el-tabs>
<div class="status wait">等待报名</div>
</div>
<div class="info">
<h6 class="title">{{ form.name }}</h6>
<div class="meta">最近编辑时间{{ form.updateTime }}</div>
</div>
<div class="l-title"
id="part1"><img src="@/assets/img/label.png"
alt=""> 竞赛信息</div>
<div v-if="form.description"
class="texts ql-editor"
v-html="form.description"></div>
<template v-if="form.competitionAnnexList && form.competitionAnnexList.length">
<h6 class="p-title">附件下载</h6>
<ul class="files">
<li v-for="(item, i) in form.competitionAnnexList"
:key="i">
<el-link v-if="item.canPreview"
class="m-r-10"
type="primary"
@click="previewFile(item)">{{ item.fileName }}</el-link>
<span v-else
class="file-name">{{ item.fileName }}</span>
<el-link type="primary"
:underline="false"
@click="download(item)">下载</el-link>
</li>
</ul>
</template>
<template v-if="!form.description && (!form.competitionAnnexList || !form.competitionAnnexList.length )">
<div class="empty">
<div>
<img src="@/assets/img/none.png"
alt="">
<p>暂无数据</p>
</div>
</div>
</template>
<div class="l-title" id="part1"><img src="@/assets/img/label.png" alt=""> 竞赛信息</div>
<div v-if="form.description" class="texts ql-editor" v-html="form.description"></div>
<template v-if="form.competitionAnnexList && form.competitionAnnexList.length">
<h6 class="p-title">附件下载</h6>
<ul class="files">
<li v-for="(item, i) in form.competitionAnnexList" :key="i">
<el-link v-if="item.canPreview" class="m-r-10" type="primary" @click="previewFile(item)">{{ item.fileName }}</el-link>
<span v-else class="file-name">{{ item.fileName }}</span>
<el-link type="primary" :underline="false" @click="download(item)">下载</el-link>
</li>
</ul>
</template>
<template v-if="!form.description && (!form.competitionAnnexList || !form.competitionAnnexList.length )">
<div class="empty">
<div>
<img src="@/assets/img/none.png" alt="">
<p>暂无数据</p>
</div>
</div>
</template>
<template v-if="form.releaseType && form.competitionStage.length">
<div class="l-title"><img src="@/assets/img/label.png"
alt=""> 赛程规则与内容</div>
<h6 class="rule-title">{{ form.competitionStage.length }}个竞赛阶段同一个团队每个成员只能参加一个阶段赛项</h6>
<div v-for="(rule, i) in form.competitionStage"
:key="i"
class="rule">
<p style="font-size: 16px;color: #333;">{{ rule.stageName }}</p>
<p>比赛时间{{ rule.startTime && rule.startTime + ' ~ ' + rule.endTime }}</p>
<p>比赛方式{{ methods.find(e => e.id == rule.method) && methods.find(e => e.id == rule.method).name }}</p>
<p v-if="!rule.method">课程系统{{ rule.systemName }}</p>
<p v-if="rule.onlineButton">线上地点{{ rule.onlineAddress }}</p>
<p v-if="rule.offlineButton">线下地点{{ rule.offlineAddress }}</p>
<template v-if="rule.method === 2">
<p>线下地点{{ rule.offlineAddress }}</p>
<p>比赛内容{{ rule.contentDescription }}</p>
<p>评分规则{{ rule.scoreRule }}</p>
</template>
<template v-if="form.releaseType && form.competitionStage.length">
<div class="l-title"><img src="@/assets/img/label.png" alt=""> 赛程规则与内容</div>
<h6 class="rule-title">{{ form.competitionStage.length }}个竞赛阶段同一个团队每个成员只能参加一个阶段赛项</h6>
<div v-for="(rule, i) in form.competitionStage" :key="i" class="rule">
<p style="font-size: 16px;color: #333;">{{ rule.stageName }}</p>
<p>比赛时间{{ rule.startTime && rule.startTime + ' ~ ' + rule.endTime }}</p>
<p>比赛方式{{ methods.find(e => e.id == rule.method) && methods.find(e => e.id == rule.method).name }}</p>
<p v-if="!rule.method">课程系统{{ rule.systemName }}</p>
<p v-if="rule.onlineButton">线上地点{{ rule.onlineAddress }}</p>
<p v-if="rule.offlineButton">线下地点{{ rule.offlineAddress }}</p>
<template v-if="rule.method === 2">
<p>线下地点{{ rule.offlineAddress }}</p>
<p>比赛内容{{ rule.contentDescription }}</p>
<p>评分规则{{ rule.scoreRule }}</p>
</template>
<template v-if="form.completeCompetitionSetup.competitionType">
<p>团队参赛人数限制{{ rule.teamNumLimit || '不限制' }}</p>
<p>团队成绩计算方式{{ teamCalculationMethods.find(e => e.id == rule.teamCalculationMethod) && teamCalculationMethods.find(e => e.id == rule.teamCalculationMethod).name }}</p>
</template>
<p>阶段比赛结束后{{ rule.resultAnnouncementTime }}小时公布阶段比赛成绩</p>
<div v-if="form.rule === 1" class="flex">
<p>晋级规则</p>
<div>
<p v-if="rule.peopleLimit">本阶段成绩排名前{{ rule.peopleLimit }}可晋级下一阶段比赛</p>
<p v-if="rule.percentageLimit">本阶段成绩排名前{{ rule.percentageLimit }}%可晋级下一阶段比赛</p>
<p v-if="rule.scoreLimit">本阶段成绩{{ rule.scoreLimit }}可晋级下一阶段比赛</p>
</div>
<template v-if="form.completeCompetitionSetup.competitionType">
<p>团队参赛人数限制{{ rule.teamNumLimit || '不限制' }}</p>
<p>团队成绩计算方式{{ teamCalculationMethods.find(e => e.id == rule.teamCalculationMethod) && teamCalculationMethods.find(e => e.id == rule.teamCalculationMethod).name }}</p>
</template>
<p>阶段比赛结束后{{ rule.resultAnnouncementTime }}小时公布阶段比赛成绩</p>
<div v-if="form.rule === 1"
class="flex">
<p>晋级规则</p>
<div>
<p v-if="rule.peopleLimit">本阶段成绩排名前{{ rule.peopleLimit }}可晋级下一阶段比赛</p>
<p v-if="rule.percentageLimit">本阶段成绩排名前{{ rule.percentageLimit }}%可晋级下一阶段比赛</p>
<p v-if="rule.scoreLimit">本阶段成绩{{ rule.scoreLimit }}可晋级下一阶段比赛</p>
</div>
</div>
</template>
</div>
</template>
<!-- 进展 -->
<div class="l-title" id="part2"><img src="@/assets/img/label.png" alt=""> 竞赛进展</div>
<ul class="progress" v-if="progress.length">
<li v-for="(item,index) in progress" :key="index" :class="item.status == 0 ? 'not' : (item.status == 1 ? 'ing' : 'done')">
<i class="dot"></i>
<p class="name">{{item.title}}</p>
<p class="desc">{{item.description}}</p>
</li>
<img class="rocket" src="@/assets/img/rocket.png" alt="">
</ul>
<template v-else>
<div class="empty">
<div>
<img src="@/assets/img/none.png" alt="">
<p>暂无数据</p>
</div>
</div>
</template>
<!-- 公告 -->
<div class="l-title" id="part3"><img src="@/assets/img/label.png" alt=""> 通知公告</div>
<ul class="notice-list" v-if="notices.length">
<li v-for="(item, i) in notices" :key="i" @click="toNotice(item)">
<h6>{{ item.announcementTitle }}</h6>
<p class="meta">{{ item.updateTime }}</p>
<div class="des" v-html="item.announcementText"></div>
</li>
</ul>
<template v-else>
<div class="empty">
<div>
<img src="@/assets/img/none.png" alt="">
<p>暂无通知公告</p>
</div>
</div>
</template>
</div>
<!-- 进展 -->
<div class="l-title"
id="part2"><img src="@/assets/img/label.png"
alt=""> 竞赛进展</div>
<ul class="progress"
v-if="progress.length">
<li v-for="(item,index) in progress"
:key="index"
:class="item.status == 0 ? 'not' : (item.status == 1 ? 'ing' : 'done')">
<i class="dot"></i>
<p class="name">{{item.title}}</p>
<p class="desc">{{item.description}}</p>
</li>
<img class="rocket"
src="@/assets/img/rocket.png"
alt="">
</ul>
<template v-else>
<div class="empty">
<div>
<img src="@/assets/img/none.png"
alt="">
<p>暂无数据</p>
</div>
</div>
</template>
<!-- 公告 -->
<div class="l-title"
id="part3"><img src="@/assets/img/label.png"
alt=""> 通知公告</div>
<ul class="notice-list"
v-if="notices.length">
<li v-for="(item, i) in notices"
:key="i"
@click="toNotice(item)">
<h6>{{ item.announcementTitle }}</h6>
<p class="meta">{{ item.updateTime }}</p>
<div class="des"
v-html="item.announcementText"></div>
</li>
</ul>
<template v-else>
<div class="empty">
<div>
<img src="@/assets/img/none.png"
alt="">
<p>暂无通知公告</p>
</div>
</div>
</template>
</div>
</div>
</div>
</template>
<script>
@ -114,210 +152,214 @@ import util from "@/libs/util";
import breadcrumb from '@/components/breadcrumb'
import Const from '@/const/match'
export default {
name: "match",
data() {
return {
rules: Const.rules,
methods: Const.methods,
teamCalculationMethods: Const.teamCalculationMethods,
curType: '1',
typeList: [
{
id: '1',
name: '竞赛信息'
},
{
id: '2',
name: '竞赛进展'
},
{
id: '3',
name: '通知公告'
}
],
form: util.local.get('match'),
progress: [],
notices: [],
};
name: "match",
data () {
return {
rules: Const.rules,
methods: Const.methods,
teamCalculationMethods: Const.teamCalculationMethods,
curType: '1',
typeList: [
{
id: '1',
name: '竞赛信息'
},
{
id: '2',
name: '竞赛进展'
},
{
id: '3',
name: '通知公告'
}
],
form: util.local.get('match'),
progress: [],
notices: [],
};
},
components: {
breadcrumb
},
mounted () {
this.handleAnnex()
if (this.form.id) {
this.getProgress()
this.getNotice()
}
},
methods: {
//
handleAnnex () {
const list = this.form.competitionAnnexList
if (list) {
list.map(e => {
const { filePath } = e
e.canPreview = util.canPreview(filePath.substr(filePath.lastIndexOf('.') + 1)) //
})
this.$forceUpdate()
}
},
components: {
breadcrumb
getProgress () { //
this.$get(this.api.getCompetitionProgress, {
competitionId: this.form.id
}).then(res => {
this.progress = res.competitionProgressList.reverse()
}).catch(err => { });
},
mounted() {
this.handleAnnex()
if (this.form.id) {
this.getProgress()
this.getNotice()
}
//
getNotice () {
this.$post(`${this.api.queryAnnouncementByCompetitionId}?pageNum=1&pageSize=1000&competitionId=${this.form.id}`).then(({ data }) => {
const records = data.records.filter(e => e.status) // status 0稿 1
records.map(e => {
e.announcementText = e.announcementText.replace(/<img.*?(?:>|\/>)/gi, '')
})
this.notices = records
}).catch(res => { })
},
methods: {
//
handleAnnex() {
const list = this.form.competitionAnnexList
if (list) {
list.map(e => {
const { filePath } = e
e.canPreview = util.canPreview(filePath.substr(filePath.lastIndexOf('.') + 1)) //
})
this.$forceUpdate()
}
},
getProgress() { //
this.$get(this.api.getCompetitionProgress, {
competitionId: this.form.id
}).then(res => {
this.progress = res.competitionProgressList.reverse()
}).catch(err => {});
},
//
getNotice() {
this.$post(`${this.api.queryAnnouncementByCompetitionId}?pageNum=1&pageSize=1000&competitionId=${this.form.id}`).then(({ data }) => {
const records = data.records.filter(e => e.status) // status 0稿 1
records.map(e => {
e.announcementText = e.announcementText.replace(/<img.*?(?:>|\/>)/gi, '')
})
this.notices = records
}).catch(res => {})
},
//
previewFile(item) {
const { filePath } = item
const suffix = filePath.substr(filePath.lastIndexOf('.') + 1)
window.open((util.isDoc(suffix) || suffix === 'pdf' ? 'https://view.officeapps.live.com/op/view.aspx?src=' : '') + item.filePath)
},
//
download(item) {
util.downloadFile(item.fileName, item.filePath)
},
// tab
typeChange() {
document.querySelector(`#part${this.curType}`).scrollIntoView()
},
}
//
previewFile (item) {
const { filePath } = item
const suffix = filePath.substr(filePath.lastIndexOf('.') + 1)
window.open((util.isDoc(suffix) || suffix === 'pdf' ? 'https://view.officeapps.live.com/op/view.aspx?src=' : '') + item.filePath)
},
//
download (item) {
util.downloadFile(item.fileName, item.filePath)
},
// tab
typeChange () {
document.querySelector(`#part${this.curType}`).scrollIntoView()
},
}
};
</script>
<style lang="scss" scoped>
/deep/.breadcrumb .el-breadcrumb__item .is-link {
color: #007eff;
}
.match {
padding-bottom: 20px;
background-color: #F3F6FA;
.banner{
width: 100%;
height: 350px;
color: #fff;
background-size: 100% 350px;
background-repeat: no-repeat;
box-sizing: border-box;
}
.center {
width: 1000px;
margin: 40px auto 0;
}
.match-inner {
min-height: calc(100vh - 465px);
padding: 30px 40px 20px;
background-color: #fff;
box-sizing: border-box;
}
/deep/.el-tabs {
.el-tabs__item.is-active, .el-tabs__item:hover {
color: #007EFF;
padding-bottom: 20px;
background-color: #f3f6fa;
.banner {
width: 100%;
height: 350px;
color: #fff;
background-size: 100% 350px;
background-repeat: no-repeat;
box-sizing: border-box;
}
.el-tabs__active-bar {
background-color: #007EFF;
.center {
width: 1000px;
margin: 40px auto 0;
}
}
.p-title {
border-left-color: #007EFF;
}
.l-title{
display: flex;
align-items: center;
margin-bottom: 12px;
font-size: 18px;
color: #333;
img{
margin-right: 5px;
.match-inner {
min-height: calc(100vh - 465px);
padding: 30px 40px 20px;
background-color: #fff;
box-sizing: border-box;
}
}
.status {
padding: 0 16px;
margin-left: 20px;
line-height: 34px;
font-size: 14px;
color: #fff;
background-color: #52C41A;
border-radius: 4px;
cursor: pointer;
&.wait {
background-color: #FAAD14;
}
&.signing {
background-color: #007EFF;
}
&.signed {
background-color: #52C41A;
}
&.finish {
background-color: #ccc;
}
/deep/.el-tabs {
.el-tabs__item.is-active,
.el-tabs__item:hover {
color: #007eff;
}
.el-tabs__active-bar {
background-color: #007eff;
}
}
.title{
width: 67%;
margin: 0 auto;
font-size: 28px;
text-align: center;
color: #0B1D30;
}
.info .meta{
padding: 16px 0;
font-size: 12px;
color: #999;
text-align: center;
}
.texts {
margin-bottom: 30px;
font-size: 14px;
line-height: 1.6;
text-indent: 2em;
overflow: hidden;
/deep/img{
max-width: 100%;
.p-title {
border-left-color: #007eff;
}
}
.files {
margin-bottom: 30px;
li {
display: flex;
align-items: center;
margin: 10px 0;
.l-title {
display: flex;
align-items: center;
margin-bottom: 12px;
font-size: 18px;
color: #333;
img {
margin-right: 5px;
}
}
.status {
padding: 0 16px;
margin-left: 20px;
line-height: 34px;
font-size: 14px;
color: #fff;
background-color: #52c41a;
border-radius: 4px;
cursor: pointer;
&.wait {
background-color: #faad14;
}
&.signing {
background-color: #007eff;
}
&.signed {
background-color: #52c41a;
}
&.finish {
background-color: #ccc;
}
}
.file-name {
margin-right: 10px;
font-size: 12px;
.title {
width: 67%;
margin: 0 auto;
font-size: 28px;
text-align: center;
color: #0b1d30;
}
}
.el-link.el-link--primary {
color: #007EFF !important;
&:after {
border-color: #007EFF;
.info .meta {
padding: 16px 0;
font-size: 12px;
color: #999;
text-align: center;
}
.texts {
margin-bottom: 30px;
font-size: 14px;
line-height: 1.6;
text-indent: 2em;
overflow: hidden;
/deep/img {
max-width: 100%;
}
}
.files {
margin-bottom: 30px;
li {
display: flex;
align-items: center;
margin: 10px 0;
}
.file-name {
margin-right: 10px;
font-size: 12px;
}
}
.el-link.el-link--primary {
color: #007eff !important;
&:after {
border-color: #007eff;
}
}
}
}
.progress{
.progress {
position: relative;
width: 95%;
padding: 50px 0;
margin: 40px auto 80px;
text-align: left;
&:before{
&:before {
content: '';
position: absolute;
top: 0;
left: 50%;
width: 2px;
height: 100%;
background-color: #E1E6F2;
background-color: #e1e6f2;
}
&:after {
content: '';
@ -325,27 +367,27 @@ export default {
top: -10px;
left: 430px;
border: 8px solid transparent;
border-bottom-color: #E1E6F2;
border-bottom-color: #e1e6f2;
}
.rocket {
position: absolute;
bottom: -50px;
left: 425px;
}
li{
li {
position: relative;
width: 400px;
margin-bottom: 42px;
.dot{
.dot {
position: absolute;
top: 12px;
left: 431px;
width: 15px;
height: 15px;
background-color: #DCDCDC;
background-color: #dcdcdc;
border-radius: 50%;
}
.name{
.name {
display: inline-block;
padding: 0 19px;
margin-bottom: 16px;
@ -354,27 +396,28 @@ export default {
font-size: 16px;
color: #fff;
border-radius: 20px;
background-color: #C4C4C4;
background-color: #c4c4c4;
}
.desc{
.desc {
position: relative;
color: #333;
font-size: 14px;
}
&.ing, &.done {
&.ing,
&.done {
.dot {
top: 8px;
background-color: #007EFF;
background-color: #007eff;
}
.name {
background-color: #007EFF;
background-color: #007eff;
}
}
&.ing {
.dot {
width: 27px;
height: 27px;
border: 6px solid #E2F1FB;
border: 6px solid #e2f1fb;
}
}
&:nth-child(odd) {
@ -395,16 +438,17 @@ export default {
border: 18px solid transparent;
border-top-width: 6px;
border-bottom-width: 6px;
border-left-color: #C4C4C4;
border-left-color: #c4c4c4;
}
}
.desc {
text-align: right;
}
&.ing, &.done {
&.ing,
&.done {
.name {
&:before {
border-left-color: #007EFF;
border-left-color: #007eff;
}
}
}
@ -430,7 +474,7 @@ export default {
border: 18px solid transparent;
border-top-width: 6px;
border-bottom-width: 6px;
border-right-color: #C4C4C4;
border-right-color: #c4c4c4;
}
}
.desc {
@ -444,91 +488,92 @@ export default {
left: auto;
right: -18px;
border: 9px solid transparent;
border-left-color: #E6E6E6;
border-left-color: #e6e6e6;
}
}
&.ing, &.done {
&.ing,
&.done {
.name {
&:after {
border-right-color: #007EFF;
border-right-color: #007eff;
}
}
}
}
&:last-child{
&:last-child {
margin-bottom: 0;
}
}
}
.notice-list {
text-align: left;
li {
padding: 16px;
margin-bottom: 12px;
transition: all 0.3s;
cursor: pointer;
border-radius: 6px;
background-color: #fff;
border-bottom: 1px dashed #ebebeb;
&:last-child {
border-bottom: 0;
text-align: left;
li {
padding: 16px;
margin-bottom: 12px;
transition: all 0.3s;
cursor: pointer;
border-radius: 6px;
background-color: #fff;
border-bottom: 1px dashed #ebebeb;
&:last-child {
border-bottom: 0;
}
}
}
h6 {
font-size: 20px;
font-weight: 500;
color: #0B1D30;
&:hover {
color: #007EFF;
h6 {
font-size: 20px;
font-weight: 500;
color: #0b1d30;
&:hover {
color: #007eff;
}
}
.meta {
margin: 10px 0;
font-size: 14px;
color: #666;
}
.des {
font-size: 14px;
color: #333;
line-height: 24px;
display: -webkit-box;
display: -moz-box;
-webkit-box-orient: vertical;
-moz-box-orient: vertical;
-webkit-line-clamp: 2;
-moz-line-clamp: 2;
overflow: hidden;
text-overflow: ellipsis;
}
}
.meta {
margin: 10px 0;
font-size: 14px;
color: #666;
}
.des {
font-size: 14px;
color: #333;
line-height: 24px;
display: -webkit-box;
display:-moz-box;
-webkit-box-orient: vertical;
-moz-box-orient: vertical;
-webkit-line-clamp: 2;
-moz-line-clamp: 2;
overflow: hidden;
text-overflow: ellipsis;
}
}
.empty{
display: flex;
justify-content: center;
align-items: center;
padding: 50px 0;
text-align: center;
img{
width: 471px;
}
p{
margin-top: 40px;
font-size: 18px;
color: rgba(0, 0, 0, 0.25);
}
.empty {
display: flex;
justify-content: center;
align-items: center;
padding: 50px 0;
text-align: center;
img {
width: 471px;
}
p {
margin-top: 40px;
font-size: 18px;
color: rgba(0, 0, 0, 0.25);
}
}
.rule-title {
margin-bottom: 10px;
font-size: 16px;
margin-bottom: 10px;
font-size: 16px;
}
.rule {
padding: 15px;
margin-bottom: 15px;
border: 1px solid #dfdfdf;
p {
font-size: 14px;
line-height: 30px;
color: #6e6e6e;
}
padding: 15px;
margin-bottom: 15px;
border: 1px solid #dfdfdf;
p {
font-size: 14px;
line-height: 30px;
color: #6e6e6e;
}
}
</style>

@ -37,20 +37,51 @@
<div class="des"
v-html="form.mall.productIntroduction"></div>
<div class="fields">
<div class="field"><img src="@/assets/img/product/1.png"
alt=""> 适用专业{{ form.goodsRes.professionalName }}</div>
<div class="field">
<img src="@/assets/img/product/1.png"
alt=""> 适用专业
<el-tooltip class="text"
effect="dark"
:visible-arrow="false"
:content="form.goodsRes.professionalName"
placement="bottom">
<div>
{{ form.goodsRes.professionalName }}
</div>
</el-tooltip>
</div>
<div v-if="form.mall.applicationScenario"
class="field"><span class="label"><img src="@/assets/img/product/2.png"
alt=""> 适用场景</span>{{ form.mall.applicationScenario }}</div>
class="field">
<img src="@/assets/img/product/2.png"
alt=""> 适用场景
<div class="text">{{ form.mall.applicationScenario }}</div>
</div>
<div v-if="form.mall.matchingCourse"
class="field"><span class="label"><img src="@/assets/img/product/3.png"
alt=""> 匹配课程</span>{{ form.mall.matchingCourse }}</div>
class="field">
<img src="@/assets/img/product/3.png"
alt=""> 匹配课程
<el-tooltip class="text"
effect="dark"
:visible-arrow="false"
:content="form.mall.matchingCourse"
placement="bottom">
<div class="text">
{{ form.mall.matchingCourse }}
</div>
</el-tooltip>
</div>
<div v-if="form.mall.courseHours"
class="field"><span class="label"><img src="@/assets/img/product/4.png"
alt=""> 预计课时</span>{{ form.mall.courseHours }}</div>
class="field">
<img src="@/assets/img/product/4.png"
alt=""> 预计课时
<div class="text">{{ form.mall.courseHours }}</div>
</div>
<div v-if="form.goodsRes.typeName"
class="field"><span class="label"><img src="@/assets/img/product/5.png"
alt=""> 产品类型</span>{{ form.goodsRes.typeName }}</div>
class="field">
<img src="@/assets/img/product/5.png"
alt=""> 产品类型
<div class="text">{{ form.goodsRes.typeName }}</div>
</div>
</div>
<button v-if="!form.goodsRes.logoOfOurSchool"
class="btn"
@ -391,11 +422,24 @@ export default {
@include mul-ellipsis(3);
}
.field {
display: inline-flex;
align-items: center;
margin: 0 20px 10px 0;
font-size: 14px;
color: #2e2d31;
&:last-child {
margin-right: 0;
}
.label {
color: #333;
}
.text {
max-width: 160px;
@include ellipsis;
}
img {
margin-right: 5px;
}
}
.fields {
display: flex;
@ -404,10 +448,6 @@ export default {
height: 60px;
margin: 10px 0 10px;
overflow: hidden;
.field {
margin-right: 40px;
margin-bottom: 10px;
}
}
.btn {
width: 119px;

@ -681,7 +681,6 @@ export default {
this.active = 4
const el = document.getElementById('comment' + this.commentId)
el && el.scrollIntoView(false)
await this.$post(`${this.api.noticeRead}?isRead=1&notifyId=${this.notifyId}`) //
this.commentId = ''
}
})
@ -951,6 +950,7 @@ export default {
util.cookies.set('curriculumName', escape(this.curriculumName))
util.cookies.set('systemId', id)
util.cookies.set('fromManager', 1)
util.cookies.set('isSubmit', '', -1)
// 8pythoncookiesystemId
location.href = process.env.NODE_ENV === 'development' ?
`http://${location.hostname}:8085/#/` :

File diff suppressed because it is too large Load Diff

@ -26,7 +26,7 @@ if (isPro) {
uploadURL = `http://121.37.12.51/`
host = "http://121.37.12.51/"; // 中台测试服
// host = 'https://www.occupationlab.com/' // 正式服
host = "http://192.168.31.152:9000/"; // 榕
// host = "http://192.168.31.152:9000/"; // 榕
// host = 'http://192.168.31.51:9000/'; // 赓
}

Loading…
Cancel
Save