添加websocket(赛事、模型)

fixLog
yujialong 1 year ago
parent 426dd83370
commit f2dc1f8485
  1. 80
      src/components/Header.vue
  2. 4
      src/setting.js
  3. 1
      src/utils/api.js
  4. 198
      src/views/match/list/index.vue
  5. 148
      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,21 +1,29 @@
<template>
<div class="header flex-between">
<div class="logo">
<img class="cursor" @click="goHome" src="../assets/img/logo.png">
<img class="cursor"
@click="goHome"
src="../assets/img/logo.png">
</div>
<div class="header-right">
<div class="header-user-con">
<div class="user" @click="toPerson">
<el-avatar :size="40" :src="$store.state.avatar"></el-avatar>
<div class="user"
@click="toPerson">
<el-avatar :size="40"
:src="$store.state.avatar"></el-avatar>
<span class="user-avator">{{userName}}</span>
</div>
<el-divider class="ml20" direction="vertical"></el-divider>
<el-button type="text" class="ml20" @click="loginout">退出</el-button>
<el-divider class="ml20"
direction="vertical"></el-divider>
<el-button type="text"
class="ml20"
@click="loginout">退出</el-button>
</div>
</div>
</div>
</template>
<script>
import Bus from '@/libs/bus'
export default {
data () {
return {
@ -23,19 +31,9 @@ export default {
};
},
mounted () {
this.userName || this.getUserInfo()
this.getUserInfo()
},
methods: {
getUserInfo(){
this.$get(this.api.queryUserInfoDetails).then(({ result }) => {
let userInfo = result.hrUserInfo
if(userInfo.userAvatars) this.$store.commit('userAvatar',{avatar: userInfo.userAvatars})
this.userName = userInfo.userName
const { id } = result.userAccount
id && this.$store.commit('SET_ACCOUNTID', id)
this.$store.commit('SET_USERNAME', this.userName)
}).catch(err => {})
},
toPerson () {
if (this.$route.path.split('/').pop() !== 'person') {
this.$router.push('/person')
@ -49,7 +47,55 @@ export default {
},
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已经关闭");
},
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;
},
getUserInfo () {
this.$get(this.api.queryUserInfoDetails).then(({ result }) => {
this.initSocket(result.userAccount)
let userInfo = result.hrUserInfo
if (userInfo.userAvatars) this.$store.commit('userAvatar', { avatar: userInfo.userAvatars })
this.userName = userInfo.userName
const { id } = result.userAccount
id && this.$store.commit('SET_ACCOUNTID', id)
this.$store.commit('SET_USERNAME', this.userName)
}).catch(err => { })
},
},
};
</script>

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

@ -11,6 +11,7 @@ export default {
sendPhoneOrEmailCode: `users/users/userAccount/sendPhoneOrEmailCode`,// 手机验证码
getUserRolesPermissionMenu: `users/users/user-role/getUserRolesPermissionMenu`,
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`, // 后台账号模板

@ -8,8 +8,12 @@
<div class="single-choice">
<dl>
<dd>
<el-radio-group v-model="form.month" @change="changeType">
<el-radio v-for="(item,index) in dateList" :key="index" :label="item.id" border>{{ item.name }}</el-radio>
<el-radio-group v-model="form.month"
@change="changeType">
<el-radio v-for="(item,index) in dateList"
:key="index"
:label="item.id"
border>{{ item.name }}</el-radio>
</el-radio-group>
</dd>
</dl>
@ -17,10 +21,21 @@
</li>
<li>
<label>创建区间</label>
<el-date-picker v-model="date" align="right" unlink-panels type="daterange" start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" clearable></el-date-picker>
<el-date-picker v-model="date"
align="right"
unlink-panels
type="daterange"
start-placeholder="开始日期"
end-placeholder="结束日期"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
clearable></el-date-picker>
</li>
<li>
<el-input placeholder="请输入竞赛名称/创建人" suffix-icon="el-icon-search" v-model="keyword" clearable></el-input>
<el-input placeholder="请输入竞赛名称/创建人"
suffix-icon="el-icon-search"
v-model="keyword"
clearable></el-input>
</li>
</ul>
</div>
@ -28,89 +43,162 @@
<ul class="filter">
<li>
<label>大赛来源</label>
<el-select v-model="form.platformSource" clearable @change="sourceChange">
<el-option v-for="(item, i) in sourceList" :key="i" :label="item.name" :value="item.id"></el-option>
<el-select v-model="form.platformSource"
clearable
@change="sourceChange">
<el-option v-for="(item, i) in sourceList"
:key="i"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</li>
<li>
<label>大赛范围</label>
<el-select v-model="form.competitionScope" clearable @change="initData">
<el-option v-for="(item, i) in rangeList" :key="i" :label="item.name" :value="item.id"></el-option>
<el-select v-model="form.competitionScope"
clearable
@change="initData">
<el-option v-for="(item, i) in rangeList"
:key="i"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</li>
</ul>
<div>
<el-button type="primary" round @click="add" v-auth>创建竞赛</el-button>
<el-button type="primary" round @click="delAllSelection" v-auth>批量删除</el-button>
<el-button type="primary"
round
@click="add"
v-auth>创建竞赛</el-button>
<el-button type="primary"
round
@click="delAllSelection"
v-auth>批量删除</el-button>
</div>
</div>
<el-table ref="table" :data="matchData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="60" label="序号" align="center">
<el-table ref="table"
:data="matchData"
class="table"
stripe
header-align="center"
@selection-change="handleSelectionChange"
row-key="id">
<el-table-column type="selection"
width="55"
align="center"
:reserve-selection="true"></el-table-column>
<el-table-column type="index"
width="60"
label="序号"
align="center">
<template slot-scope="scope">
{{ scope.$index + (page - 1) * pageSize + 1 }}
</template>
</el-table-column>
<el-table-column prop="competitionName" label="竞赛名称" align="center"></el-table-column>
<el-table-column prop="founderName" label="创建人" align="center"></el-table-column>
<el-table-column prop="name" label="大赛来源" width="120" align="center">
<el-table-column prop="competitionName"
label="竞赛名称"
align="center"></el-table-column>
<el-table-column prop="founderName"
label="创建人"
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">
<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">
<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">
<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">
<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"
<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>
@change="switchOff($event,scope.row,scope.$index)"></el-switch>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" :current-page="page">
<el-pagination background
layout="total, prev, pager, next"
:total="total"
@current-change="handleCurrentChange"
:current-page="page">
</el-pagination>
</div>
<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">
<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">
<el-table-column label="结束时间调整为"
align="center"
width="280">
<template slot-scope="scope">
<el-date-picker
popper-class="no-atTheMoment"
<el-date-picker popper-class="no-atTheMoment"
v-model="scope.row.newEndTime"
placeholder="请选择结束时间"
type="datetime"
@ -119,9 +207,13 @@
</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 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>
@ -131,6 +223,7 @@
import util from "@/libs/util";
import Setting from "@/setting";
import { Loading } from 'element-ui'
import Bus from '@/libs/bus'
export default {
name: "match",
data () {
@ -207,7 +300,6 @@ export default {
playingStages: []
},
timer: null,
redisTimer: null,
pickerOptions: {
shortcuts: [{
text: '此刻',
@ -245,15 +337,18 @@ export default {
}
},
mounted () {
// websocket
Bus.$on('matchSocket', () => {
this.getData()
})
this.getData()
this.$once('hook:beforeDestroy', function () {
clearInterval(this.timer)
clearInterval(this.redisTimer)
})
},
methods: {
getList() {
// const load = Loading.service()
getData () {
const { form } = this
this.$post(this.api.CompetitionPageConditionQueryByNakadai, {
pageNum: this.page,
@ -296,16 +391,7 @@ export default {
this.page--
this.getData()
}
}).catch(res => {
// load.close()
})
},
getData() {
this.getList()
if (!Setting.isDev) {
clearInterval(this.redisTimer)
this.redisTimer = setInterval(this.getRedis, 1000)
}
}).catch(res => { })
},
initData () {
this.page = 1;
@ -410,7 +496,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,
@ -418,6 +504,8 @@ export default {
}).then(res => {
util.successMsg(val == 1 ? '禁用成功' : '启用成功')
}).catch(err => { })
await this.$post(`${this.api.refreshPageNotification}?content=1`)
},
}
};

@ -1,12 +1,19 @@
<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="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>
<breadcrumb ref="breadcrumb"
:data="'全部赛事/' + form.name"
route="match"></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 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>
@ -15,31 +22,46 @@
<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>
<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 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="">
<img src="@/assets/img/none.png"
alt="">
<p>暂无数据</p>
</div>
</div>
</template>
<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"
alt=""> 赛程规则与内容</div>
<h6 class="rule-title">{{ form.competitionStage.length }}个竞赛阶段同一个团队每个成员只能参加一个阶段赛项</h6>
<div v-for="(rule, i) in form.competitionStage" :key="i" class="rule">
<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>
@ -57,7 +79,8 @@
<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">
<div v-if="form.rule === 1"
class="flex">
<p>晋级规则</p>
<div>
<p v-if="rule.peopleLimit">本阶段成绩排名前{{ rule.peopleLimit }}可晋级下一阶段比赛</p>
@ -69,37 +92,52 @@
</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')">
<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="">
<img class="rocket"
src="@/assets/img/rocket.png"
alt="">
</ul>
<template v-else>
<div class="empty">
<div>
<img src="@/assets/img/none.png" alt="">
<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)">
<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>
<div class="des"
v-html="item.announcementText"></div>
</li>
</ul>
<template v-else>
<div class="empty">
<div>
<img src="@/assets/img/none.png" alt="">
<img src="@/assets/img/none.png"
alt="">
<p>暂无通知公告</p>
</div>
</div>
@ -200,7 +238,7 @@ export default {
<style lang="scss" scoped>
.match {
padding-bottom: 20px;
background-color: #F3F6FA;
background-color: #f3f6fa;
.banner {
width: 100%;
height: 350px;
@ -220,15 +258,16 @@ export default {
box-sizing: border-box;
}
/deep/.el-tabs {
.el-tabs__item.is-active, .el-tabs__item:hover {
color: #007EFF;
.el-tabs__item.is-active,
.el-tabs__item:hover {
color: #007eff;
}
.el-tabs__active-bar {
background-color: #007EFF;
background-color: #007eff;
}
}
.p-title {
border-left-color: #007EFF;
border-left-color: #007eff;
}
.l-title {
display: flex;
@ -246,17 +285,17 @@ export default {
line-height: 34px;
font-size: 14px;
color: #fff;
background-color: #52C41A;
background-color: #52c41a;
border-radius: 4px;
cursor: pointer;
&.wait {
background-color: #FAAD14;
background-color: #faad14;
}
&.signing {
background-color: #007EFF;
background-color: #007eff;
}
&.signed {
background-color: #52C41A;
background-color: #52c41a;
}
&.finish {
background-color: #ccc;
@ -267,7 +306,7 @@ export default {
margin: 0 auto;
font-size: 28px;
text-align: center;
color: #0B1D30;
color: #0b1d30;
}
.info .meta {
padding: 16px 0;
@ -298,9 +337,9 @@ export default {
}
}
.el-link.el-link--primary {
color: #007EFF !important;
color: #007eff !important;
&:after {
border-color: #007EFF;
border-color: #007eff;
}
}
}
@ -317,7 +356,7 @@ export default {
left: 50%;
width: 2px;
height: 100%;
background-color: #E1E6F2;
background-color: #e1e6f2;
}
&:after {
content: '';
@ -325,7 +364,7 @@ export default {
top: -10px;
left: 430px;
border: 8px solid transparent;
border-bottom-color: #E1E6F2;
border-bottom-color: #e1e6f2;
}
.rocket {
position: absolute;
@ -342,7 +381,7 @@ export default {
left: 431px;
width: 15px;
height: 15px;
background-color: #DCDCDC;
background-color: #dcdcdc;
border-radius: 50%;
}
.name {
@ -354,27 +393,28 @@ export default {
font-size: 16px;
color: #fff;
border-radius: 20px;
background-color: #C4C4C4;
background-color: #c4c4c4;
}
.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 +435,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 +471,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,14 +485,15 @@ 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;
}
}
}
@ -478,9 +520,9 @@ export default {
h6 {
font-size: 20px;
font-weight: 500;
color: #0B1D30;
color: #0b1d30;
&:hover {
color: #007EFF;
color: #007eff;
}
}
.meta {

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

@ -107,6 +107,7 @@
<script>
import org from "./modelType"
import Setting from '@/setting'
import Bus from '@/libs/bus'
export default {
data () {
return {
@ -122,7 +123,6 @@ export default {
modelLoading: false,
modelData: [],
submiting: false,
timer: null
};
},
components: {
@ -137,12 +137,13 @@ 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() //
this.isTopLevel = !curNode.level
//
@ -170,22 +171,6 @@ export default {
}).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 () {
this.page = 1
this.getData()

@ -137,6 +137,7 @@
<script>
import org from "./sourceType"
import Setting from '@/setting'
import Bus from '@/libs/bus'
export default {
data () {
return {
@ -157,7 +158,6 @@ export default {
label: 'categoryName',
value: 'id'
},
timer: null,
isSchool: 0,
categories: []
};
@ -174,13 +174,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
//
@ -194,22 +195,6 @@ export default {
this.listData = data.records
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) {
this.isSchool = school
@ -301,7 +286,8 @@ export default {
this.$confirm(`确定要${off ? '启用' : '禁用'}吗?`, "提示", {
type: "warning"
}).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.getData()
}).catch(res => { })
@ -311,7 +297,7 @@ export default {
}
},
//
switchOff (val, row, index) {
async switchOff (val, row, index) {
this.$post(this.api.disableModelDemo, [{
isOpen: val,
modelId: row.id,
@ -319,6 +305,8 @@ export default {
}]).then(res => {
this.$message.success(val ? '禁用成功' : '启用成功')
}).catch(res => { })
await this.$post(`${this.api.refreshPageNotification}?content=4`)
},
handleSelectionChange (val) {
this.multipleSelection = val

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

Loading…
Cancel
Save