Branch_d40a2540
yujialong 1 year ago
parent 7b74f1a498
commit 4def1d805f
  1. 2
      src/layouts/header/index.vue
  2. 5
      src/pages/expSystem/backstage/index.vue
  3. 35
      src/pages/expSystem/backstage/model.vue
  4. 25
      src/pages/expSystem/backstage/modelType.vue
  5. 23
      src/pages/expSystem/backstage/sourceModel.vue
  6. 56
      src/pages/expSystem/backstage/sourceType.vue
  7. 156
      src/pages/match/add/index.vue
  8. 8
      src/pages/match/manage/matchRank.vue
  9. 5
      src/pages/station/preview/index.vue
  10. 2
      src/setting.js

@ -128,7 +128,7 @@ export default {
}).then(res => {
this.notices = res.notificationList
}).catch(res => { });
}, 1000)
}, 5000)
}
},
//

@ -34,7 +34,7 @@ export default {
systemId: this.$route.query.systemId,
active: this.$route.query.type || 'model',
tabs: {
model: "模型列表管理",
model: "本校模型列表管理",
sourceModel: "源模型管理",
compiler: '编译器管理'
},
@ -72,7 +72,8 @@ export default {
...this.$route.query,
page: 1,
type: index,
categoryId: ''
categoryId: '',
isSystem: 0
}
})
},

@ -56,7 +56,7 @@
<el-table-column label="状态"
align="center">
<template slot-scope="scope">
{{ scope.row.isClose ? '禁用' : '启用' }}
{{ scope.row.isOpen ? '禁用' : '启用' }}
</template>
</el-table-column>
<el-table-column label="操作"
@ -96,14 +96,14 @@
node-key="id"
:props="{children: 'children', label: 'categoryName', isLeaf: 'leaf'}">
</el-tree>
<el-tree v-if="systemModels.length"
<!-- <el-tree v-if="systemModels.length"
:data="systemModels"
ref="systemModel"
default-expand-all
show-checkbox
node-key="id"
:props="{children: 'children', label: 'categoryName', isLeaf: 'leaf'}">
</el-tree>
</el-tree> -->
<div class="none"
v-else>暂无可导入的模型</div>
@ -162,7 +162,7 @@ export default {
this.isTopLevel = !curNode.level
//
if (this.isTopLevel) {
this.$post(this.api.teacherModelList, {
this.$post(this.api.getAllModelList, {
founder: 1,
modelName: this.keyword,
pageNum: this.page,
@ -212,6 +212,15 @@ export default {
if (this.isTopLevel) return this.$message.error('请选择子分类进入导入模型')
this.modelVisible = true
this.modelLoading = true
//
const res = await this.$post(this.api.getAllModelList, {
founder: 1,
pageNum: 1,
pageSize: 10000,
systemId: this.systemId,
isOpen: 0
})
const modelList = res.data.records
//
//
@ -236,8 +245,10 @@ export default {
const modelChildren = []
// copyIdid
records.map(n => {
if (!modelList.find(e => e.copyId === n.id)) {
n.categoryName = n.modelName
modelChildren.push(n)
}
})
// disabled
if (modelChildren.length) {
@ -256,14 +267,14 @@ export default {
addType(data)
//
const res = await this.$post(`${this.api.builtInClassificationByNakadai}?systemId=${this.systemId}`)
addType(res.data, 1)
// const res = await this.$post(`${this.api.builtInClassificationByNakadai}?systemId=${this.systemId}`)
// addType(res.data, 1)
Promise.all(promises).then(_ => {
data = this.handleType(data)
const systemData = this.handleType(res.data)
// const systemData = this.handleType(res.data)
this.schoolModels = (data.length && data[0].children && data[0].children.length) ? data : []
this.systemModels = (systemData.length && systemData[0].children && systemData[0].children.length) ? systemData : []
// this.systemModels = (systemData.length && systemData[0].children && systemData[0].children.length) ? systemData : []
this.modelLoading = false
}).catch(res => { })
},
@ -281,7 +292,7 @@ export default {
//
show (row) {
this.$router.push(`/addModel?categoryId=${this.$refs.tree.$refs.tree.getCurrentKey()}&id=${row.id}&show=1&model=1`)
this.$router.push(`addModel?categoryId=${this.$refs.tree.$refs.tree.getCurrentKey()}&id=${row.id}&show=1&model=1&founder=1`)
},
//
del (row) {
@ -330,9 +341,9 @@ export default {
if (this.submiting) return false
const data = []
const { systemId } = this
const { schoolModel, systemModel } = this.$refs
if (schoolModel || systemModel) {
const list = [...schoolModel.getCheckedNodes(), ...systemModel.getCheckedNodes()] //
const { schoolModel } = this.$refs
if (schoolModel) {
const list = schoolModel.getCheckedNodes() //
const categoryId = this.$refs.tree.$refs.tree.getCurrentKey() //
if (!list.length) return this.$message.error('请选择模型')
this.submiting = true

@ -13,6 +13,7 @@
icon="el-icon-refresh"
@click="syncModel">同步原始模型列表</el-button>
<el-button v-auth="'/expSystem/list:进入:模型列表管理:新增分类'"
v-if="!orgList.length"
type="text"
@click="addType(0)">添加</el-button>
</div>
@ -167,19 +168,19 @@ export default {
* 然后接口会返回全部这个分类的id然后把本校分类及模型全部加到全部这个分类下
*/
const { id } = await this.$post(`${this.api.synchronizationMdelByOccupationlab}?systemId=${this.systemId}`)
const { data } = await this.$post(this.api.sourceModelClassification + '?founder=1') //
this.handleCatetory(data[0].children, id)
Promise.all(this.promises).then(() => {
this.getType()
this.$router.push({
path: 'backstage',
query: {
...this.$route.query,
categoryId: ''
}
})
}).catch(e => { })
// const { data } = await this.$post(this.api.sourceModelClassification + '?founder=1') //
// this.handleCatetory(data[0].children, id)
// Promise.all(this.promises).then(() => {
// this.getType()
// this.$router.push({
// path: 'backstage',
// query: {
// ...this.$route.query,
// categoryId: ''
// }
// })
// }).catch(e => { })
},
//
handleCatetory (list, parentId) {

@ -17,7 +17,8 @@
clearable></el-input>
</li>
</ul>
<div v-if="!isSystem">
<div>
<template v-if="!isSystem">
<el-button v-auth="'/expSystem/list:进入:源模型管理:新增模型'"
type="primary"
round
@ -26,6 +27,7 @@
type="primary"
round
@click="batchDel">批量删除</el-button>
</template>
<el-button v-auth="'/expSystem/list:进入:源模型管理:批量禁用'"
type="primary"
round
@ -161,7 +163,7 @@ export default {
methods: {
//
async getList () {
const curNode = this.$refs.tree.$refs[this.isSystem ? 'systemTree' : 'tree'].getCurrentNode() || {}//
const curNode = this.$refs.tree.$refs.tree.getCurrentNode() || {}//
this.isTopLevel = !curNode.level
let res
const data = {
@ -172,6 +174,7 @@ 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) {
//
@ -237,7 +240,7 @@ export default {
},
//
show (row) {
this.$router.push(`addModel?categoryId=${this.$refs.tree.$refs.tree.getCurrentKey()}&id=${row.id}&show=1&founder=${this.isSystem ? 0 : 1}`)
this.$router.push(`addModel?categoryId=${this.$refs.tree.$refs.tree.getCurrentKey()}&id=${!row.founder ? row.copyId : row.id}&show=1&founder=${row.founder}`)
},
//
edit (row) {
@ -273,27 +276,33 @@ export default {
this.$refs.table.clearSelection()
this.$message.success(`${off ? '启用' : '禁用'}成功`)
this.getData()
}).catch(res => { })
}).catch(res => {
this.getList()
})
}).catch(() => { })
} else {
this.$message.error("请先选择模型 !")
}
},
//
switchOff (val, row,) {
switchOff (val, row) {
this.$post(this.api.disableModelDemo, [{
isOpen: val,
modelId: row.id,
type: 1
}]).then(res => {
this.$message.success(val ? '禁用成功' : '启用成功')
}).catch(res => { })
}).catch(res => {
this.getList()
})
},
//
switchOffSystem (val, row) {
this.$post(this.api[val ? 'demoHiddenClose' : 'demoHiddenOpen'], [row.id]).then(res => {
this.$message.success(val ? '禁用成功' : '启用成功')
}).catch(res => { })
}).catch(res => {
this.getList()
})
},
handleSelectionChange (val) {
this.multipleSelection = val

@ -1,6 +1,17 @@
<template>
<div>
<div>
<el-radio-group v-model="modelType"
@change="changeModelType">
<div class="m-b-10">
<el-radio :label="0">本校模型</el-radio>
</div>
<div>
<el-radio :label="1">内置模型</el-radio>
</div>
</el-radio-group>
<el-divider></el-divider>
<el-tree :data="orgList"
ref="tree"
default-expand-all
@ -12,7 +23,7 @@
<span class="custom-tree-node"
slot-scope="{ node, data }">
<span style="display: inline-block; margin-right: 20px">{{ node.label }}</span>
<span>
<span v-if="!modelType">
<el-button v-auth="'/expSystem/list:进入:源模型管理:编辑分类'"
v-if="node.level > 1"
type="text"
@ -33,16 +44,6 @@
</span>
</span>
</el-tree>
<el-tree :data="orgListSystem"
default-expand-all
ref="systemTree"
node-key="id"
highlight-current
:expand-on-click-node="false"
@node-click="nodeSystemClick"
:props="{children: 'children', label: 'categoryName', isLeaf: 'leaf'}">
</el-tree>
</div>
<el-dialog :title="Form.id ? '编辑分类' : '新增分类'"
@ -75,6 +76,7 @@ export default {
data () {
return {
systemId: this.$route.query.systemId,
modelType: +this.$route.query.isSystem,
orgList: [],
orgListSystem: [],
typeVisible: false,
@ -100,39 +102,49 @@ export default {
methods: {
async getType () {
const { categoryId, isSystem } = this.$route.query
//
const { data } = await this.$post(this.api.sourceModelClassification + '?founder=1')
// /
const { data } = this.modelType ?
await this.$post(`${this.api.builtInClassificationByNakadai}?systemId=${this.systemId}`) :
await this.$post(this.api.sourceModelClassification + '?founder=1')
this.orgList = data
//
const res = await this.$post(`${this.api.builtInClassificationByNakadai}?systemId=${this.systemId}`)
this.orgListSystem = res.data
this.$nextTick(() => {
this.$refs[isSystem == 1 ? 'systemTree' : 'tree'].setCurrentKey(categoryId || data[0].id)
this.$refs.tree.setCurrentKey(categoryId || data[0].id)
this.$router.push({
path: 'backstage',
query: {
...this.$route.query,
categoryId: this.$refs[isSystem == 1 ? 'systemTree' : 'tree'].getCurrentKey(),
categoryId: this.$refs.tree.getCurrentKey(),
isSystem
}
}).catch(err => { })
this.$emit('initData', +isSystem)
})
},
//
changeModelType (val) {
this.$router.push({
path: 'backstage',
query: {
...this.$route.query,
categoryId: '',
isSystem: val
}
}).catch(err => { })
this.$parent.isSystem = val
this.getType()
},
//
nodeClick () {
this.$refs.systemTree.setCurrentKey(null)
this.$router.push({
path: 'backstage',
query: {
...this.$route.query,
categoryId: this.$refs.tree.getCurrentKey(),
isSystem: 0
isSystem: this.modelType
}
}).catch(err => { })
this.$emit('initData')
this.$emit('initData', this.modelType)
},
//
nodeSystemClick () {

@ -1,32 +1,52 @@
<template>
<div>
<el-card v-if="!id" shadow="hover" class="m-b-20">
<el-card v-if="!id"
shadow="hover"
class="m-b-20">
<div class="flex-between">
<el-page-header @back="back" :content="'创建赛事'"></el-page-header>
<el-page-header @back="back"
:content="'创建赛事'"></el-page-header>
</div>
</el-card>
<div v-if="hasPer">
<div v-if="step === 1 || (id && !editing)" :class="['type-wrap', {pd: !id}]">
<div v-if="step === 1 || (id && !editing)"
:class="['type-wrap', {pd: !id}]">
<div class="p-title">大赛发布类型</div>
<el-form label-width="100px" label-suffix=":" size="small" :disabled="!editing && id != ''">
<el-form label-width="100px"
label-suffix=":"
size="small"
:disabled="!editing && id != ''">
<el-form-item label="请选择类型">
<el-radio v-for="(item, i) in releaseTypes" :key="i" v-model="releaseType" :label="item.id">{{ item.name }}</el-radio>
<el-radio v-for="(item, i) in releaseTypes"
:key="i"
v-model="releaseType"
:label="item.id">{{ item.name }}</el-radio>
</el-form-item>
</el-form>
<el-button v-if="!editing && id" class="edit" type="primary" @click="editing = 1" v-auth="'/match/list:管理:大赛详情:编辑'">编辑</el-button>
<el-button v-if="!editing && id"
class="edit"
type="primary"
@click="editing = 1"
v-auth="'/match/list:管理:大赛详情:编辑'">编辑</el-button>
</div>
<el-card v-if="step !== 4" shadow="hover" class="m-b-20" style="position: relative;margin-top: 20px">
<el-card v-if="step !== 4"
shadow="hover"
class="m-b-20"
style="position: relative;margin-top: 20px">
<ul :class="['steps', {pointer: !editing && id}]">
<li :class="{active: step === 1,done: step > 1}" @click="toStep(1)">
<li :class="{active: step === 1,done: step > 1}"
@click="toStep(1)">
<span class="circle">1</span>
<p class="text">大赛信息填写</p>
</li>
<template v-if="releaseType">
<li :class="{active: step === 2,done: step > 2}" @click="toStep(2)">
<li :class="{active: step === 2,done: step > 2}"
@click="toStep(2)">
<span class="circle circle2">2</span>
<p class="text">赛程与规则设置</p>
</li>
<li :class="{active: step === 3,done: step > 3}" @click="toStep(3)">
<li :class="{active: step === 3,done: step > 3}"
@click="toStep(3)">
<span class="circle circle3">3</span>
<p class="text">比赛内容设置</p>
</li>
@ -38,23 +58,51 @@
</ul>
</el-card>
</div>
<el-button v-else-if="!editing && id" class="edit" type="primary" @click="editing = 1" v-auth="'/match/list:管理:大赛详情:编辑'">编辑</el-button>
<el-button v-else-if="!editing && id"
class="edit"
type="primary"
@click="editing = 1"
v-auth="'/match/list:管理:大赛详情:编辑'">编辑</el-button>
<div class="page">
<div class="page-content">
<step1 v-show="step === 1" ref="step1" :editing.sync="editing" @next="next" />
<step2 v-if="step === 2" ref="step2" :editing.sync="editing" :setupId.sync="setupId" @next="next" />
<step3 v-if="step === 3" ref="step3" :editing.sync="editing" :setupId.sync="setupId" :competitionId.sync="competitionId" @next="next" />
<step4 v-if="step === 4" />
<step1 v-show="step === 1"
ref="step1"
:editing.sync="editing"
@next="next" />
<step2 v-if="step === 2"
ref="step2"
:editing.sync="editing"
:setupId.sync="setupId"
@next="next" />
<step3 v-if="step === 3"
ref="step3"
:editing.sync="editing"
:setupId.sync="setupId"
:competitionId.sync="competitionId"
@next="next" />
<step4 v-if="step === 4"
ref="step4" />
<div v-if="step !== 4 && showBtns" class="btns">
<div v-if="step !== 4 && showBtns"
class="btns">
<!-- 处于编辑状态(列表点编辑按钮进来默认是查看状态不可编辑点了编辑按钮才可编辑)或者新增才显示这几个按钮 -->
<div v-if="editing || !id" class="m-r-10">
<el-button v-if="!publishStatus" @click="save(0)">保存{{ releaseType ? '草稿' : '' }}</el-button>
<el-button v-if="step === 2 || step === 3" type="primary" @click="prev">上一步</el-button>
<el-button v-if="releaseType == 0" type="primary" @click="save(1)">发布</el-button>
<el-button v-else type="primary" @click="save(id ? 1 : 0, 2)">保存并下一步</el-button>
<div v-if="editing || !id"
class="m-r-10">
<el-button v-if="!publishStatus"
@click="save(0)">保存{{ releaseType ? '草稿' : '' }}</el-button>
<el-button v-if="step === 2 || step === 3"
type="primary"
@click="prev">上一步</el-button>
<el-button v-if="releaseType == 0"
type="primary"
@click="save(1)">发布</el-button>
<el-button v-else
type="primary"
@click="save(id ? 1 : 0, 2)">保存并下一步</el-button>
</div>
<el-button type="danger" @click="preview" v-auth="'/match/list:管理:大赛详情:预览'">预览</el-button>
<el-button type="danger"
@click="preview"
v-auth="'/match/list:管理:大赛详情:预览'">预览</el-button>
<el-button @click="cancel">{{ editing ? '取消' : '返回' }}</el-button>
</div>
</div>
@ -72,7 +120,7 @@ import step4 from './step4'
import { Loading } from 'element-ui'
export default {
name: "add",
data() {
data () {
return {
id: this.$route.query.id || '',
cache: this.$store.state.match.cache,
@ -107,26 +155,26 @@ export default {
step4
},
// ,
beforeRouteLeave(to, from, next) {
beforeRouteLeave (to, from, next) {
const { updateTime } = this.$refs['step' + this.step]
if(updateTime){
if (this.$refs['step' + this.step] && updateTime) {
this.$confirm(`您所更改的内容未更新,是否更新?`, '提示', {
type: 'warning'
}).then(() => {
this.save(this.step,to.path,next)
this.save(this.step, to.path, next)
}).catch(() => {
next()
})
}else{
} else {
next()
}
},
mounted() {
mounted () {
this.getPer()
},
methods: {
//
resumeData() {
resumeData () {
if (this.cache) {
this.step = 3
this.editing = true
@ -134,32 +182,32 @@ export default {
}
},
// true
getPer() {
getPer () {
this.$get(this.api.getCustomerOrder).then(({ show }) => {
this.hasPer = show
show || this.$parent.hideArch()
}).catch(err => {})
}).catch(err => { })
},
// loading
showLoad() {
showLoad () {
this.loadIns = Loading.service()
},
// loading
hideLoad() {
hideLoad () {
this.loadIns.close()
},
//
save(status, next = 0,cb) {
console.log('status=>',status)
console.log('cb=>',cb)
console.log('this.step=>',this.step)
this.$refs['step' + this.step].save(status, next, this.releaseType,cb)
save (status, next = 0, cb) {
console.log('status=>', status)
console.log('cb=>', cb)
console.log('this.step=>', this.step)
this.$refs['step' + this.step].save(status, next, this.releaseType, cb)
},
//
prev() {
prev () {
//
const { updateTime } = this.$refs['step' + this.step]
if (updateTime) {
if (this.$refs['step' + this.step] && updateTime) {
this.$confirm(`编辑的内容未保存,是否保存?`, '提示', {
type: 'warning'
}).then(() => {
@ -172,10 +220,7 @@ export default {
}
},
//
next(next, setupId, competitionId,type) {
console.log('next==>',next)
console.log('setupId==>',setupId)
console.log('competitionId==>',competitionId)
next (next, setupId, competitionId, type) {
if (!next) {
this.$router.push(`/match?page=${this.$store.state.matchPage}`)
} else if (next === 2) {
@ -190,29 +235,29 @@ export default {
this.step--
} else {
console.log(99999999)
if(typeof setupId === 'function') {
if (typeof setupId === 'function') {
setupId()
}else if(typeof type === 'function') {
} else if (typeof type === 'function') {
type()
}
}
},
//
toStep(i) {
toStep (i) {
if (this.id && !this.editing) this.step = i
},
//
preview() {
preview () {
util.local.set('match', this.$refs.step1.form)
window.open(this.$router.resolve('/match/preview').href)
},
//
cancel() {
cancel () {
//
if (this.editing && this.$route.query.name) {
//
const { updateTime } = this.$refs['step' + this.step]
if (this.step < 4 && updateTime) {
if (this.step < 4 && this.$refs['step' + this.step] && updateTime) {
this.$confirm(`编辑的内容未保存,是否保存?`, '提示', {
type: 'warning'
}).then(() => {
@ -227,11 +272,10 @@ export default {
this.$router.push(`/match?page=${this.$store.state.match.page}`)
}
},
back() {
back () {
//
const { updateTime } = this.$refs['step' + this.step]
console.log("🚀 ~ file: index.vue:142 ~ back ~ updateTime", updateTime)
if (this.step < 4 && updateTime) {
if (this.step < 4 && this.$refs['step' + this.step] && updateTime) {
this.$confirm(`编辑的内容未保存,是否保存?`, '提示', {
type: 'warning'
}).then(() => {
@ -243,7 +287,7 @@ export default {
this.backPage()
}
},
backPage() {
backPage () {
this.$router.push(`/match?page=${this.$store.state.match.page}`)
}
}
@ -305,10 +349,10 @@ export default {
.circle {
color: #fff;
border-color: #459ffb;
background: #007EFF;
background: #007eff;
}
.text {
color: #007EFF;
color: #007eff;
}
}
.done {

@ -617,11 +617,11 @@ export default {
} else {
try {
//
if (this.timeId) {
await this.$post(`${this.api.cancelCompetitionStageRankingTime}?releaseId=${this.timeId}`)
} else {
// if (this.timeId) {
await this.$post(`${this.api.cancelCompetitionStageRankingTime}?competitionId=${this.id}&releaseId=${this.timeId}&isOverallRanking=${this.active ? 0 : 1}&stageId=${this.active || this.stageId}`)
// } else {
await this.$post(`${this.api.cancelRanking}?competitionId=${this.id}&isOverallRanking=${this.active ? 0 : 1}&${this.active ? 'stageIds=' + this.active : query.join('&')}`)
}
// }
this.publishTime = ''
this.sourceType = ''
this.type = 0

@ -585,7 +585,7 @@ export default {
const section = this.section === undefined ? 0 : +this.section
const clist = this.chapterList[chapter]
if (this.chapterList.length && clist.subsectionList && clist.subsectionList.length && !this.commentId) {
// this.preview(clist.subsectionList[section], clist.name, 1);
this.preview(clist.subsectionList[section], clist.name, 1);
}
},
//
@ -728,7 +728,8 @@ export default {
// pid: reply ? reply.commentId : row ? row.commentId : 0,
pid: row ? row.commentId : 0,
replyAccountId: reply ? reply.createAccountId : row.createAccountId || '',
status: row ? 2 : 1
status: row ? 2 : 1,
replyCommentId: reply ? reply.commentId : row ? row.commentId : ''
}).then(res => {
this.comment = ''
this.curReplyId = row ? row.commentId : ''

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

Loading…
Cancel
Save