添加websocket(赛事、模型)

fixLog
yujialong 1 year ago
parent 426dd83370
commit f2dc1f8485
  1. 146
      src/components/Header.vue
  2. 4
      src/setting.js
  3. 1
      src/utils/api.js
  4. 888
      src/views/match/list/index.vue
  5. 752
      src/views/match/preview/index.vue
  6. 1
      src/views/order/AddOrder.vue
  7. 25
      src/views/serve/backstage/model.vue
  8. 32
      src/views/serve/backstage/sourceModel.vue
  9. 2
      src/views/shop/addProduct/index.vue

@ -1,56 +1,102 @@
<template> <template>
<div class="header flex-between"> <div class="header flex-between">
<div class="logo"> <div class="logo">
<img class="cursor" @click="goHome" src="../assets/img/logo.png"> <img class="cursor"
</div> @click="goHome"
<div class="header-right"> src="../assets/img/logo.png">
<div class="header-user-con"> </div>
<div class="user" @click="toPerson"> <div class="header-right">
<el-avatar :size="40" :src="$store.state.avatar"></el-avatar> <div class="header-user-con">
<span class="user-avator">{{userName}}</span> <div class="user"
</div> @click="toPerson">
<el-divider class="ml20" direction="vertical"></el-divider> <el-avatar :size="40"
<el-button type="text" class="ml20" @click="loginout">退出</el-button> :src="$store.state.avatar"></el-avatar>
</div> <span class="user-avator">{{userName}}</span>
</div> </div>
<el-divider class="ml20"
direction="vertical"></el-divider>
<el-button type="text"
class="ml20"
@click="loginout">退出</el-button>
</div>
</div> </div>
</div>
</template> </template>
<script> <script>
import Bus from '@/libs/bus'
export default { export default {
data() { data () {
return { return {
userName: '' userName: ''
}; };
},
mounted () {
this.getUserInfo()
},
methods: {
toPerson () {
if (this.$route.path.split('/').pop() !== 'person') {
this.$router.push('/person')
}
},
loginout () {
localStorage.removeItem('ms_username');
localStorage.removeItem('token');
sessionStorage.clear()
location.reload()
},
goHome () {
this.$router.push('/customer')
},
// 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
content == 1 && Bus.$emit('matchSocket')
content == 4 && Bus.$emit('modelSocket')
},
// socket
close () {
console.log("socket已经关闭");
}, },
mounted(){ initSocket ({ id, account }) {
this.userName || this.getUserInfo() // 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;
}, },
methods: {
getUserInfo(){
this.$get(this.api.queryUserInfoDetails).then(({ result }) => { getUserInfo () {
let userInfo = result.hrUserInfo this.$get(this.api.queryUserInfoDetails).then(({ result }) => {
if(userInfo.userAvatars) this.$store.commit('userAvatar',{avatar: userInfo.userAvatars}) this.initSocket(result.userAccount)
this.userName = userInfo.userName let userInfo = result.hrUserInfo
const { id } = result.userAccount if (userInfo.userAvatars) this.$store.commit('userAvatar', { avatar: userInfo.userAvatars })
id && this.$store.commit('SET_ACCOUNTID', id) this.userName = userInfo.userName
this.$store.commit('SET_USERNAME', this.userName) const { id } = result.userAccount
}).catch(err => {}) id && this.$store.commit('SET_ACCOUNTID', id)
}, this.$store.commit('SET_USERNAME', this.userName)
toPerson(){ }).catch(err => { })
if(this.$route.path.split('/').pop()!=='person'){
this.$router.push('/person')
}
},
loginout() {
localStorage.removeItem('ms_username');
localStorage.removeItem('token');
sessionStorage.clear()
location.reload()
},
goHome(){
this.$router.push('/customer')
}
}, },
},
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -68,7 +114,7 @@ export default {
height: 40px; height: 40px;
margin-left: 20px; margin-left: 20px;
} }
.header .logo img{ .header .logo img {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
@ -81,7 +127,7 @@ export default {
height: 70px; height: 70px;
align-items: center; align-items: center;
} }
.header-user-con .user{ .header-user-con .user {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
cursor: pointer; cursor: pointer;
@ -91,7 +137,7 @@ export default {
margin-left: 10px; margin-left: 10px;
font-size: 12px; font-size: 12px;
} }
.ml20{ .ml20 {
margin-left: 20px; margin-left: 20px;
} }
.user-avator img { .user-avator img {
@ -100,17 +146,17 @@ export default {
height: 40px; height: 40px;
border-radius: 50%; border-radius: 50%;
} }
/deep/.header-right .el-button--text{ /deep/.header-right .el-button--text {
color: #333; color: #333;
span { span {
font-size: 12px; font-size: 12px;
} }
} }
.header-right .el-divider--vertical{ .header-right .el-divider--vertical {
width: 2px; width: 2px;
height: 15px; height: 15px;
} }
.header-right .el-divider{ .header-right .el-divider {
background-color: #333; background-color: #333;
} }
</style> </style>

@ -11,8 +11,8 @@ if (isDev) {
jumpPath = 'http://192.168.31.125:8087/' // 本地调试-需要启动本地判分点系统 jumpPath = 'http://192.168.31.125:8087/' // 本地调试-需要启动本地判分点系统
host = 'http://121.37.12.51/' host = 'http://121.37.12.51/'
// host = 'https://huorantech.cn/' // host = 'https://huorantech.cn/'
host = 'http://192.168.31.152:9000/'// 榕 // host = 'http://192.168.31.152:9000/'// 榕
// host = 'http://192.168.31.53:9000/'// 赓 // host = 'http://192.168.31.51:9000/'// 赓
} else if (isPro) { } else if (isPro) {
jumpPath = 'https://www.huorantech.cn/judgmentPoint/' jumpPath = 'https://www.huorantech.cn/judgmentPoint/'
} }

@ -11,6 +11,7 @@ export default {
sendPhoneOrEmailCode: `users/users/userAccount/sendPhoneOrEmailCode`,// 手机验证码 sendPhoneOrEmailCode: `users/users/userAccount/sendPhoneOrEmailCode`,// 手机验证码
getUserRolesPermissionMenu: `users/users/user-role/getUserRolesPermissionMenu`, getUserRolesPermissionMenu: `users/users/user-role/getUserRolesPermissionMenu`,
deleteProfile : `users/users/userInfo/deleteProfile`, deleteProfile : `users/users/userInfo/deleteProfile`,
refreshPageNotification : `nakadai/message/refreshPageNotification`,
staffTemplate: `http://www.huorantech.cn/template/%E6%89%B9%E9%87%8F%E5%AF%BC%E5%85%A5%E5%91%98%E5%B7%A5%E6%A8%A1%E6%9D%BF.xlsx`, // 后台账号模板 staffTemplate: `http://www.huorantech.cn/template/%E6%89%B9%E9%87%8F%E5%AF%BC%E5%85%A5%E5%91%98%E5%B7%A5%E6%A8%A1%E6%9D%BF.xlsx`, // 后台账号模板

@ -1,425 +1,513 @@
<template> <template>
<div class="page"> <div class="page">
<h6 class="p-title">筛选</h6> <h6 class="p-title">筛选</h6>
<div class="tool mul"> <div class="tool mul">
<ul class="filter"> <ul class="filter">
<li> <li>
<label>创建时间</label> <label>创建时间</label>
<div class="single-choice"> <div class="single-choice">
<dl> <dl>
<dd> <dd>
<el-radio-group v-model="form.month" @change="changeType"> <el-radio-group v-model="form.month"
<el-radio v-for="(item,index) in dateList" :key="index" :label="item.id" border>{{ item.name }}</el-radio> @change="changeType">
</el-radio-group> <el-radio v-for="(item,index) in dateList"
</dd> :key="index"
</dl> :label="item.id"
</div> border>{{ item.name }}</el-radio>
</li> </el-radio-group>
<li> </dd>
<label>创建区间</label> </dl>
<el-date-picker v-model="date" align="right" unlink-panels type="daterange" start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" clearable></el-date-picker> </div>
</li> </li>
<li> <li>
<el-input placeholder="请输入竞赛名称/创建人" suffix-icon="el-icon-search" v-model="keyword" clearable></el-input> <label>创建区间</label>
</li> <el-date-picker v-model="date"
</ul> align="right"
</div> unlink-panels
<div class="tool mul"> type="daterange"
<ul class="filter"> start-placeholder="开始日期"
<li> end-placeholder="结束日期"
<label>大赛来源</label> format="yyyy-MM-dd"
<el-select v-model="form.platformSource" clearable @change="sourceChange"> value-format="yyyy-MM-dd"
<el-option v-for="(item, i) in sourceList" :key="i" :label="item.name" :value="item.id"></el-option> clearable></el-date-picker>
</el-select> </li>
</li> <li>
<li> <el-input placeholder="请输入竞赛名称/创建人"
<label>大赛范围</label> suffix-icon="el-icon-search"
<el-select v-model="form.competitionScope" clearable @change="initData"> v-model="keyword"
<el-option v-for="(item, i) in rangeList" :key="i" :label="item.name" :value="item.id"></el-option> clearable></el-input>
</el-select> </li>
</li> </ul>
</ul> </div>
<div> <div class="tool mul">
<el-button type="primary" round @click="add" v-auth>创建竞赛</el-button> <ul class="filter">
<el-button type="primary" round @click="delAllSelection" v-auth>批量删除</el-button> <li>
</div> <label>大赛来源</label>
</div> <el-select v-model="form.platformSource"
clearable
<el-table ref="table" :data="matchData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id"> @change="sourceChange">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column> <el-option v-for="(item, i) in sourceList"
<el-table-column type="index" width="60" label="序号" align="center"> :key="i"
<template slot-scope="scope"> :label="item.name"
{{ scope.$index + (page - 1) * pageSize + 1 }} :value="item.id"></el-option>
</template> </el-select>
</el-table-column> </li>
<el-table-column prop="competitionName" label="竞赛名称" align="center"></el-table-column> <li>
<el-table-column prop="founderName" label="创建人" align="center"></el-table-column> <label>大赛范围</label>
<el-table-column prop="name" label="大赛来源" width="120" align="center"> <el-select v-model="form.competitionScope"
<template slot-scope="scope"> clearable
{{ sourceList.find(e => e.id === scope.row.platformSource).name }} @change="initData">
</template> <el-option v-for="(item, i) in rangeList"
</el-table-column> :key="i"
<el-table-column prop="name" label="大赛范围" align="center"> :label="item.name"
<template slot-scope="scope"> :value="item.id"></el-option>
{{ rangeList.find(e => e.id === scope.row.competitionScope).name }} </el-select>
</template> </li>
</el-table-column> </ul>
<el-table-column prop="applicantNum" label="报名人数" align="center" width="100"></el-table-column> <div>
<el-table-column prop="status" label="状态" align="center" width="80"> <el-button type="primary"
<template slot-scope="scope"> round
{{ scope.row.publishStatus ? '已发布' : '未发布' }} @click="add"
</template> v-auth>创建竞赛</el-button>
</el-table-column> <el-button type="primary"
<el-table-column prop="time" label="竞赛时间" align="center" width="290"> round
<template slot-scope="scope"> @click="delAllSelection"
{{ scope.row.playStartTime }} ~ {{ scope.row.playEndTime }} v-auth>批量删除</el-button>
</template> </div>
</el-table-column> </div>
<el-table-column prop="createTime" label="创建时间" align="center" width="160"></el-table-column>
<el-table-column label="操作" align="center" width="260">
<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 type="text" @click="manage(scope.row)" v-auth>管理</el-button>
<el-button type="text" @click="delData(scope.row)" v-auth>删除</el-button>
<el-switch
v-if="scope.row.publishStatus"
v-auth="'/match:启用'"
v-model="scope.row.ztOpen"
:active-value="0"
:inactive-value="1"
style="margin: 0 10px 0 5px"
:active-text="scope.row.ztOpen ? '关' : '开'"
@change="switchOff($event,scope.row,scope.$index)"
></el-switch>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" :current-page="page">
</el-pagination>
</div>
<el-dialog title="修改当前阶段结束时间" :visible.sync="modifyVisible" width="900px" :close-on-click-modal="false"> <el-table ref="table"
<el-table :data="curRow.playingStages" class="table" ref="table" stripe header-align="center"> :data="matchData"
<el-table-column prop="stageName" label="阶段名称" min-width="100" align="center"></el-table-column> class="table"
<el-table-column label="竞赛起止时间" width="300" align="center"> stripe
<template slot-scope="scope"> header-align="center"
{{ scope.row.startTime + ' ~ ' + scope.row.endTime }} @selection-change="handleSelectionChange"
</template> row-key="id">
</el-table-column> <el-table-column type="selection"
<el-table-column label="结束时间调整为" align="center" width="280"> width="55"
<template slot-scope="scope"> align="center"
<el-date-picker :reserve-selection="true"></el-table-column>
popper-class="no-atTheMoment" <el-table-column type="index"
v-model="scope.row.newEndTime" width="60"
placeholder="请选择结束时间" label="序号"
type="datetime" align="center">
:picker-options="pickerOptions"> <template slot-scope="scope">
</el-date-picker> {{ scope.$index + (page - 1) * pageSize + 1 }}
</template> </template>
</el-table-column> </el-table-column>
</el-table> <el-table-column prop="competitionName"
<span slot="footer" class="dialog-footer"> label="竞赛名称"
<el-button size="small" @click="modifyVisible = false"> </el-button> align="center"></el-table-column>
<el-button size="small" type="primary" @click="modifySubmit"> </el-button> <el-table-column prop="founderName"
</span> label="创建人"
</el-dialog> align="center"></el-table-column>
<el-table-column prop="name"
label="大赛来源"
width="120"
align="center">
<template slot-scope="scope">
{{ sourceList.find(e => e.id === scope.row.platformSource).name }}
</template>
</el-table-column>
<el-table-column prop="name"
label="大赛范围"
align="center">
<template slot-scope="scope">
{{ rangeList.find(e => e.id === scope.row.competitionScope).name }}
</template>
</el-table-column>
<el-table-column prop="applicantNum"
label="报名人数"
align="center"
width="100"></el-table-column>
<el-table-column prop="status"
label="状态"
align="center"
width="80">
<template slot-scope="scope">
{{ scope.row.publishStatus ? '已发布' : '未发布' }}
</template>
</el-table-column>
<el-table-column prop="time"
label="竞赛时间"
align="center"
width="290">
<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 label="操作"
align="center"
width="260">
<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 type="text"
@click="manage(scope.row)"
v-auth>管理</el-button>
<el-button type="text"
@click="delData(scope.row)"
v-auth>删除</el-button>
<el-switch v-if="scope.row.publishStatus"
v-auth="'/match:启用'"
v-model="scope.row.ztOpen"
:active-value="0"
:inactive-value="1"
style="margin: 0 10px 0 5px"
:active-text="scope.row.ztOpen ? '关' : '开'"
@change="switchOff($event,scope.row,scope.$index)"></el-switch>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background
layout="total, prev, pager, next"
:total="total"
@current-change="handleCurrentChange"
:current-page="page">
</el-pagination>
</div> </div>
<el-dialog title="修改当前阶段结束时间"
:visible.sync="modifyVisible"
width="900px"
:close-on-click-modal="false">
<el-table :data="curRow.playingStages"
class="table"
ref="table"
stripe
header-align="center">
<el-table-column prop="stageName"
label="阶段名称"
min-width="100"
align="center"></el-table-column>
<el-table-column label="竞赛起止时间"
width="300"
align="center">
<template slot-scope="scope">
{{ scope.row.startTime + ' ~ ' + scope.row.endTime }}
</template>
</el-table-column>
<el-table-column label="结束时间调整为"
align="center"
width="280">
<template slot-scope="scope">
<el-date-picker popper-class="no-atTheMoment"
v-model="scope.row.newEndTime"
placeholder="请选择结束时间"
type="datetime"
:picker-options="pickerOptions">
</el-date-picker>
</template>
</el-table-column>
</el-table>
<span slot="footer"
class="dialog-footer">
<el-button size="small"
@click="modifyVisible = false"> </el-button>
<el-button size="small"
type="primary"
@click="modifySubmit"> </el-button>
</span>
</el-dialog>
</div>
</template> </template>
<script> <script>
import util from "@/libs/util"; import util from "@/libs/util";
import Setting from "@/setting"; import Setting from "@/setting";
import { Loading } from 'element-ui' import { Loading } from 'element-ui'
import Bus from '@/libs/bus'
export default { export default {
name: "match", name: "match",
data() { data () {
return { return {
timer: null, timer: null,
keyword: "", keyword: "",
sourceList: [ sourceList: [
{ {
id: "", id: "",
name: "不限" name: "不限"
},
{
id: 0,
name: "平台创建"
},
{
id: 1,
name: "院校创建"
}
],
rangeList: [
{
id: "",
name: "不限"
},
{
id: 1,
name: "全平台"
},
{
id: 2,
name: "指定区域"
},
{
id: 0,
name: "校内"
}
],
matchData: [],
form: {
month: "",
publishStatus: "",
startTime: "",
endTime: "",
platformSource: +this.$route.query.platformSource || 0, // (01)
competitionScope: '', // (0: 1: 2.)
},
multipleSelection: [],
dateList: [
{
id: "",
name: "不限"
},
{
id: 1,
name: "近一个月"
},
{
id: 3,
name: "近三个月"
},
{
id: 6,
name: "近六个月"
}
],
date: [],
page: +this.$route.query.page || 1,
pageSize: 10,
total: 0,
transferPublishStatus: [ "未发布", "已发布"],
modifyVisible: false,
curRow: {
playingStages: []
},
timer: null,
redisTimer: null,
pickerOptions: {
shortcuts: [{
text: '此刻',
onClick(picker) {
picker.$emit('pick', new Date(Date.now() + 5000))
}
}]
}
};
},
watch: {
"form.month": function(val) {
if (val) {
let unit = 24 * 60 * 60 * 1000;
this.date = [util.formatDate("yyyy-MM-dd", new Date(new Date().getTime() - unit * 30 * val)), util.formatDate("yyyy-MM-dd", new Date(new Date().getTime() + unit))];
} else {
this.date = [];
}
}, },
date: function(val) { {
if (val) { id: 0,
this.form.startTime = val[0]; name: "平台创建"
this.form.endTime = val[1];
} else {
this.form.startTime = "";
this.form.endTime = "";
}
this.initData();
}, },
keyword: function(val) { {
clearTimeout(this.searchTimer); id: 1,
this.searchTimer = setTimeout(() => { name: "院校创建"
this.initData();
}, 500);
} }
}, ],
mounted() { rangeList: [
this.getData() {
this.$once('hook:beforeDestroy', function() { id: "",
clearInterval(this.timer) name: "不限"
clearInterval(this.redisTimer)
})
},
methods: {
getList() {
// const load = Loading.service()
const { form } = this
this.$post(this.api.CompetitionPageConditionQueryByNakadai, {
pageNum: this.page,
pageSize: this.pageSize,
competitionScope: form.competitionScope === '' ? null : form.competitionScope,
endTime: form.endTime || null,
keyWord: this.keyword || null,
platformSource: form.platformSource === '' ? null : form.platformSource,
startTime: form.startTime || null,
}).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)
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()
if (!Setting.isDev) {
clearInterval(this.redisTimer)
this.redisTimer = setInterval(this.getRedis, 1000)
}
},
initData() {
this.page = 1;
this.getData();
}, },
// redis {
getRedis() { id: 1,
this.$post(this.api.getRedisCacheCompetition).then(({ data }) => { name: "全平台"
data && this.getList()
}).catch(res => {})
}, },
add() { {
this.$router.push("/addMatch"); id: 2,
name: "指定区域"
}, },
// {
editEndTime(row) { id: 0,
this.modifyVisible = true name: "校内"
row.newEndTime = '' }
this.curRow = row ],
matchData: [],
form: {
month: "",
publishStatus: "",
startTime: "",
endTime: "",
platformSource: +this.$route.query.platformSource || 0, // (01)
competitionScope: '', // (0: 1: 2.)
},
multipleSelection: [],
dateList: [
{
id: "",
name: "不限"
}, },
// {
modifySubmit() { id: 1,
const row = this.curRow name: "近一个月"
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) { id: 3,
this.$router.push(`/matchManage?id=${row.id}&name=${row.competitionName}`) name: "近三个月"
}, },
{
id: 6,
name: "近六个月"
}
],
date: [],
page: +this.$route.query.page || 1,
pageSize: 10,
total: 0,
transferPublishStatus: ["未发布", "已发布"],
modifyVisible: false,
curRow: {
playingStages: []
},
timer: null,
pickerOptions: {
shortcuts: [{
text: '此刻',
onClick (picker) {
picker.$emit('pick', new Date(Date.now() + 5000))
}
}]
}
};
},
watch: {
"form.month": function (val) {
if (val) {
let unit = 24 * 60 * 60 * 1000;
this.date = [util.formatDate("yyyy-MM-dd", new Date(new Date().getTime() - unit * 30 * val)), util.formatDate("yyyy-MM-dd", new Date(new Date().getTime() + unit))];
} else {
this.date = [];
}
},
date: function (val) {
if (val) {
this.form.startTime = val[0];
this.form.endTime = val[1];
} else {
this.form.startTime = "";
this.form.endTime = "";
}
this.initData();
},
keyword: function (val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.initData();
}, 500);
}
},
mounted () {
// websocket
Bus.$on('matchSocket', () => {
this.getData()
})
changeType() { this.getData()
this.$refs.table.clearSelection(); this.$once('hook:beforeDestroy', function () {
this.initData(); clearInterval(this.timer)
}, })
// },
sourceChange(val) { methods: {
this.$router.push({ getData () {
path: '/match', const { form } = this
query: { this.$post(this.api.CompetitionPageConditionQueryByNakadai, {
...this.$route.query, pageNum: this.page,
platformSource: val pageSize: this.pageSize,
} competitionScope: form.competitionScope === '' ? null : form.competitionScope,
}) endTime: form.endTime || null,
this.$store.commit('SET_M_SOURCE', val) keyWord: this.keyword || null,
this.initData() platformSource: form.platformSource === '' ? null : form.platformSource,
}, startTime: form.startTime || null,
delData(row) { }).then(({ data }) => {
this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", { // load.close()
type: "warning" const list = data.records
}) //
.then(() => { this.timer = setInterval(() => {
this.$post(`${this.api.batchDeleteCompetition}?competitionIds=${row.id}`).then(res => { const now = new Date()
util.successMsg("删除成功"); list.map(e => {
this.getData(); if (!e.playingStages) {
}).catch(res => { this.$set(e, 'playingStages', [])
});
})
.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 { } else {
this.$message.warning("请先选择赛事 !"); e.playingStages = []
} }
}, //
handleCurrentChange(val) { if (now >= new Date(e.playStartTime) && now <= new Date(e.playEndTime)) {
this.page = val; //
this.$router.push(`match?page=${val}`) 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)
this.matchData = list
this.total = data.total
this.$refs.table.clearSelection()
if (!this.matchData.length && this.total) {
this.page--
this.getData()
}
}).catch(res => { })
},
initData () {
this.page = 1;
this.getData();
},
// redis
getRedis () {
this.$post(this.api.getRedisCacheCompetition).then(({ data }) => {
data && this.getList()
}).catch(res => { })
},
add () {
this.$router.push("/addMatch");
},
//
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(`/matchManage?id=${row.id}&name=${row.competitionName}`)
},
changeType () {
this.$refs.table.clearSelection();
this.initData();
},
//
sourceChange (val) {
this.$router.push({
path: '/match',
query: {
...this.$route.query,
platformSource: val
}
})
this.$store.commit('SET_M_SOURCE', val)
this.initData()
},
delData (row) {
this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", {
type: "warning"
})
.then(() => {
this.$post(`${this.api.batchDeleteCompetition}?competitionIds=${row.id}`).then(res => {
util.successMsg("删除成功");
this.getData(); this.getData();
this.$store.commit('SET_M_PAGE', val) }).catch(res => {
}, });
transferTime(date, type) { })
if (date == "0000-00-00 00:00:00") return "---"; .catch(() => {
return date; });
}, },
switchOff(val, row) { handleSelectionChange (val) {
this.$post(this.api.disabledEventsCompetition, { this.multipleSelection = val;
competitionId: row.id, },
isOpen: val, //
type: 0 // (01) delAllSelection () {
}).then(res => { if (this.multipleSelection.length) {
util.successMsg(val == 1 ? '禁用成功' : '启用成功') this.$confirm("确定要删除吗?", "提示", {
}).catch(err => {}) 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(`match?page=${val}`)
this.getData();
this.$store.commit('SET_M_PAGE', val)
},
transferTime (date, type) {
if (date == "0000-00-00 00:00:00") return "---";
return date;
},
async switchOff (val, row) {
this.$post(this.api.disabledEventsCompetition, {
competitionId: row.id,
isOpen: val,
type: 0 // (01)
}).then(res => {
util.successMsg(val == 1 ? '禁用成功' : '启用成功')
}).catch(err => { })
await this.$post(`${this.api.refreshPageNotification}?content=1`)
},
}
}; };
</script> </script>
@ -432,7 +520,7 @@ export default {
} }
} }
@media(max-width: 1640px) { @media (max-width: 1640px) {
.page .page-content .tool .filter { .page .page-content .tool .filter {
flex-wrap: wrap; flex-wrap: wrap;
margin-bottom: -15px; margin-bottom: -15px;

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

@ -2590,6 +2590,7 @@ export default {
e.associatedProduct && productId.push(+e.associatedProduct); e.associatedProduct && productId.push(+e.associatedProduct);
let find = this[name].some(i => e.mallId === i.mallId);// id let find = this[name].some(i => e.mallId === i.mallId);// id
if (!find) { if (!find) {
//
this.$post(`${this.api.queryCitySettlementPrice}?mallId=${e.mallId}&provinceId=${this.form.provinceId}&cityId=${this.form.cityId}`).then(res => { this.$post(`${this.api.queryCitySettlementPrice}?mallId=${e.mallId}&provinceId=${this.form.provinceId}&cityId=${this.form.cityId}`).then(res => {
const mall = res.mallPrice const mall = res.mallPrice
if (mall) { if (mall) {

@ -107,6 +107,7 @@
<script> <script>
import org from "./modelType" import org from "./modelType"
import Setting from '@/setting' import Setting from '@/setting'
import Bus from '@/libs/bus'
export default { export default {
data () { data () {
return { return {
@ -122,7 +123,6 @@ export default {
modelLoading: false, modelLoading: false,
modelData: [], modelData: [],
submiting: false, submiting: false,
timer: null
}; };
}, },
components: { components: {
@ -137,12 +137,13 @@ export default {
} }
}, },
mounted () { mounted () {
this.$once('hook:beforeDestroy', function () { // websocket
clearInterval(this.timer) Bus.$on('modelSocket', () => {
this.getData()
}) })
}, },
methods: { methods: {
getList () { getData () {
const curNode = this.$refs.tree.$refs.tree.getCurrentNode() // const curNode = this.$refs.tree.$refs.tree.getCurrentNode() //
this.isTopLevel = !curNode.level this.isTopLevel = !curNode.level
// //
@ -170,22 +171,6 @@ export default {
}).catch(res => { }) }).catch(res => { })
} }
}, },
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('modelNakadai') !== data && this.getList() // redis
localStorage.setItem('modelNakadai', data)
}
}).catch(res => { })
},
initData () { initData () {
this.page = 1 this.page = 1
this.getData() this.getData()

@ -137,6 +137,7 @@
<script> <script>
import org from "./sourceType" import org from "./sourceType"
import Setting from '@/setting' import Setting from '@/setting'
import Bus from '@/libs/bus'
export default { export default {
data () { data () {
return { return {
@ -157,7 +158,6 @@ export default {
label: 'categoryName', label: 'categoryName',
value: 'id' value: 'id'
}, },
timer: null,
isSchool: 0, isSchool: 0,
categories: [] categories: []
}; };
@ -174,13 +174,14 @@ export default {
} }
}, },
mounted () { mounted () {
this.$once('hook:beforeDestroy', function () { // websocket
clearInterval(this.timer) Bus.$on('modelSocket', () => {
this.getData()
}) })
}, },
methods: { methods: {
// //
async getList () { async getData () {
const curNode = this.$refs.tree.$refs.tree.getCurrentNode() || {}// const curNode = this.$refs.tree.$refs.tree.getCurrentNode() || {}//
this.isTopLevel = !curNode.level this.isTopLevel = !curNode.level
// //
@ -194,22 +195,6 @@ export default {
this.listData = data.records this.listData = data.records
this.total = data.total this.total = 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('modelNakadai') !== data && this.getList() // redis
localStorage.setItem('modelNakadai', data)
}
}).catch(res => { })
},
// //
catetoryClick (school) { catetoryClick (school) {
this.isSchool = school this.isSchool = school
@ -301,7 +286,8 @@ export default {
this.$confirm(`确定要${off ? '启用' : '禁用'}吗?`, "提示", { this.$confirm(`确定要${off ? '启用' : '禁用'}吗?`, "提示", {
type: "warning" type: "warning"
}).then(() => { }).then(() => {
this.$post(this.api.disableModelDemo, list).then(res => { this.$post(this.api.disableModelDemo, list).then(async res => {
await this.$post(`${this.api.refreshPageNotification}?content=4`)
this.$message.success(`${off ? '启用' : '禁用'}成功`) this.$message.success(`${off ? '启用' : '禁用'}成功`)
this.getData() this.getData()
}).catch(res => { }) }).catch(res => { })
@ -311,7 +297,7 @@ export default {
} }
}, },
// //
switchOff (val, row, index) { async switchOff (val, row, index) {
this.$post(this.api.disableModelDemo, [{ this.$post(this.api.disableModelDemo, [{
isOpen: val, isOpen: val,
modelId: row.id, modelId: row.id,
@ -319,6 +305,8 @@ export default {
}]).then(res => { }]).then(res => {
this.$message.success(val ? '禁用成功' : '启用成功') this.$message.success(val ? '禁用成功' : '启用成功')
}).catch(res => { }) }).catch(res => { })
await this.$post(`${this.api.refreshPageNotification}?content=4`)
}, },
handleSelectionChange (val) { handleSelectionChange (val) {
this.multipleSelection = val this.multipleSelection = val

@ -1003,6 +1003,7 @@ export default {
mall.appletIcon = data.miniProgramPictureAddress mall.appletIcon = data.miniProgramPictureAddress
mall.productIntroduction = data.briefIntroduction mall.productIntroduction = data.briefIntroduction
mall.marketUnitPrice = data.marketPrice mall.marketUnitPrice = data.marketPrice
this.calcAllSettlement()
}).catch(err => { }) }).catch(err => { })
} else { } else {
form.classificationIds = active == 2 ? 5 : 3 form.classificationIds = active == 2 ? 5 : 3
@ -1015,6 +1016,7 @@ export default {
mall.marketUnitPrice = item.market mall.marketUnitPrice = item.market
form.mallPrices.find(e => e.settlementPriceType && e.area === 0).settlementPrice = item.settlementPrice form.mallPrices.find(e => e.settlementPriceType && e.area === 0).settlementPrice = item.settlementPrice
this.isData = true this.isData = true
this.calcAllSettlement()
} }
} }
} }

Loading…
Cancel
Save