fixLog
yujialong 1 year ago
parent 2dd6c79475
commit 426dd83370
  1. 510
      src/views/match/add/index.vue
  2. 10
      src/views/match/manage/matchRank.vue
  3. 1
      src/views/order/AddOrder.vue
  4. 16
      src/views/serve/addModel.vue
  5. 92
      src/views/serve/backstage/index.vue
  6. 3
      src/views/serve/backstage/modelType.vue
  7. 8
      src/views/serve/backstage/sourceModel.vue
  8. 41
      src/views/serve/backstage/sourceType.vue

@ -1,63 +1,105 @@
<template>
<div>
<el-card v-if="!id" shadow="hover" class="m-b-20">
<div class="flex-between">
<el-page-header @back="back" :content="'创建赛事'"></el-page-header>
</div>
</el-card>
<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-item label="请选择类型">
<el-radio v-model="releaseType" :label="0">仅发布信息</el-radio>
<el-radio v-model="releaseType" :label="1">设置完整比赛</el-radio>
</el-form-item>
</el-form>
<el-button v-if="!editing && id" class="edit" type="primary" @click="editing = 1" v-auth="'/match:管理:大赛详情:编辑'">编辑</el-button>
</div>
<el-card v-if="step !== 4" shadow="hover" class="m-b-20" style="position: relative;margin-top: 20px">
<ul :class="['steps', {pointer: !editing && id && publishStatus}]">
<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)">
<span class="circle circle2">2</span>
<p class="text">赛程与规则设置</p>
</li>
<li :class="{active: step === 3,done: step > 3}" @click="toStep(3)">
<span class="circle circle3">3</span>
<p class="text">比赛内容设置</p>
</li>
</template>
<li :class="{done: step > 3}">
<span class="circle circle4">{{ releaseType ? 4 : 2 }}</span>
<p class="text">发布{{ !editing && id ? '成功' : '' }}</p>
</li>
</ul>
</el-card>
<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" />
<div>
<el-card v-if="!id"
shadow="hover"
class="m-b-20">
<div class="flex-between">
<el-page-header @back="back"
:content="'创建赛事'"></el-page-header>
</div>
</el-card>
<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-item label="请选择类型">
<el-radio v-model="releaseType"
:label="0">仅发布信息</el-radio>
<el-radio v-model="releaseType"
:label="1">设置完整比赛</el-radio>
</el-form-item>
</el-form>
<el-button v-if="!editing && id"
class="edit"
type="primary"
@click="editing = 1"
v-auth="'/match:管理:大赛详情:编辑'">编辑</el-button>
</div>
<el-card v-if="step !== 4"
shadow="hover"
class="m-b-20"
style="position: relative;margin-top: 20px">
<ul :class="['steps', {pointer: !editing && id && publishStatus}]">
<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)">
<span class="circle circle2">2</span>
<p class="text">赛程与规则设置</p>
</li>
<li :class="{active: step === 3,done: step > 3}"
@click="toStep(3)">
<span class="circle circle3">3</span>
<p class="text">比赛内容设置</p>
</li>
</template>
<li :class="{done: step > 3}">
<span class="circle circle4">{{ releaseType ? 4 : 2 }}</span>
<p class="text">发布{{ !editing && id ? '成功' : '' }}</p>
</li>
</ul>
</el-card>
<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"
ref="step4" />
<div v-if="step !== 4 && showBtns" class="btns">
<!-- 处于编辑状态(列表点编辑按钮进来默认是查看状态不可编辑点了编辑按钮才可编辑)或者新增才显示这几个按钮 -->
<template v-if="editing || !id">
<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 || (releaseType && step === 3)" type="primary" @click="save(1)">发布</el-button>
<el-button v-else type="primary" @click="save(id ? 1 : 0, 2)">保存并下一步</el-button>
</template>
<el-button type="danger" @click="preview" v-auth="'/match:管理:大赛详情:预览'">预览</el-button>
<el-button @click="cancel">{{ editing ? '取消' : '返回' }}</el-button>
</div>
</div>
<div v-if="step !== 4 && showBtns"
class="btns">
<!-- 处于编辑状态(列表点编辑按钮进来默认是查看状态不可编辑点了编辑按钮才可编辑)或者新增才显示这几个按钮 -->
<template v-if="editing || !id">
<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 || (releaseType && step === 3)"
type="primary"
@click="save(1)">发布</el-button>
<el-button v-else
type="primary"
@click="save(id ? 1 : 0, 2)">保存并下一步</el-button>
</template>
<el-button type="danger"
@click="preview"
v-auth="'/match:管理:大赛详情:预览'">预览</el-button>
<el-button @click="cancel">{{ editing ? '取消' : '返回' }}</el-button>
</div>
</div>
</div>
</div>
</template>
<script>
@ -69,221 +111,221 @@ import step3 from './step3'
import step4 from './step4'
import { Loading } from 'element-ui'
export default {
name: "add",
data() {
return {
id: this.$route.query.id || '',
cache: this.$store.state.competitionCache,
publishStatus: 0,
competitionId: this.$route.query.id || '',
step: 1,
submiting: false,
updateTime: 0,
setupId: '',
releaseType: 0,
editing: this.$route.query.id ? 0 : 1,
showBtns: true,
loadIns: null
};
name: "add",
data () {
return {
id: this.$route.query.id || '',
cache: this.$store.state.competitionCache,
publishStatus: 0,
competitionId: this.$route.query.id || '',
step: 1,
submiting: false,
updateTime: 0,
setupId: '',
releaseType: 0,
editing: this.$route.query.id ? 0 : 1,
showBtns: true,
loadIns: null
};
},
components: {
quill,
step1,
step2,
step3,
step4
},
mounted () {
},
methods: {
//
resumeData () {
if (this.cache) {
this.step = 3
this.editing = true
this.showBtns = false
}
},
components: {
quill,
step1,
step2,
step3,
step4
// loading
showLoad () {
this.loadIns = Loading.service()
},
mounted() {
// loading
hideLoad () {
this.loadIns.close()
},
methods: {
//
resumeData() {
if (this.cache) {
this.step = 3
this.editing = true
this.showBtns = false
}
},
// loading
showLoad() {
this.loadIns = Loading.service()
},
// loading
hideLoad() {
this.loadIns.close()
},
//
save(status, next = 0) {
this.$refs['step' + this.step].save(status, next, this.releaseType)
},
//
prev() {
//
const { updateTime } = this.$refs['step' + this.step]
if (updateTime) {
this.$confirm(`编辑的内容未保存,是否保存?`, '提示', {
type: 'warning'
}).then(() => {
this.save(0, 1)
}).catch(() => {
this.step--
})
} else {
this.step--
}
},
//
next(next, setupId, competitionId) {
if (!next) {
this.$router.push(`/match?page=${this.$store.state.matchPage}`)
} else if (next === 2) {
if (setupId) this.setupId = setupId
if (competitionId) {
this.$router.push('/addMatch?id=' + competitionId)
this.id = competitionId
this.competitionId = competitionId
}
this.step++
} else if (next === 1) {
//
save (status, next = 0) {
this.$refs['step' + this.step].save(status, next, this.releaseType)
},
//
prev () {
//
const { updateTime } = this.$refs['step' + this.step]
if (updateTime) {
this.$confirm(`编辑的内容未保存,是否保存?`, '提示', {
type: 'warning'
}).then(() => {
this.save(0, 1)
}).catch(() => {
this.step--
})
} else {
this.step--
}
},
//
next (next, setupId, competitionId) {
if (!next) {
this.$router.push(`/match?page=${this.$store.state.matchPage}`)
} else if (next === 2) {
if (setupId) this.setupId = setupId
if (competitionId) {
this.$router.push('/addMatch?id=' + competitionId)
this.id = competitionId
this.competitionId = competitionId
}
},
//
toStep(i) {
if (this.publishStatus && this.id && !this.editing) this.step = i
},
//
preview() {
util.local.set('match', this.$refs.step1.form)
window.open(this.$router.resolve('/matchPreview').href)
},
//
cancel() {
//
if (this.editing && this.$route.query.name) {
//
const { updateTime } = this.$refs['step' + this.step]
if (this.step < 4 && updateTime) {
this.$confirm(`编辑的内容未保存,是否保存?`, '提示', {
type: 'warning'
}).then(() => {
this.save(0, 3)
}).catch(() => {
this.editing = false
})
} else {
this.editing = false
}
} else {
this.$router.push(`/match?page=${this.$store.state.matchPage}&platformSource=${this.$store.state.platformSource}`)
}
},
back() {
this.step++
} else if (next === 1) {
this.step--
}
},
//
toStep (i) {
if (this.publishStatus && this.id && !this.editing) this.step = i
},
//
preview () {
util.local.set('match', this.$refs.step1.form)
window.open(this.$router.resolve('/matchPreview').href)
},
//
cancel () {
//
if (this.editing && this.$route.query.name) {
//
const { updateTime } = this.$refs['step' + this.step]
if (this.step < 4 && updateTime) {
this.$confirm(`编辑的内容未保存,是否保存?`, '提示', {
type: 'warning'
}).then(() => {
this.save(0)
this.save(0, 3)
}).catch(() => {
this.backPage()
this.editing = false
})
} else {
this.backPage()
this.editing = false
}
},
backPage() {
} else {
this.$router.push(`/match?page=${this.$store.state.matchPage}&platformSource=${this.$store.state.platformSource}`)
}
},
back () {
//
const { updateTime } = this.$refs['step' + this.step]
if (this.step < 4 && updateTime) {
this.$confirm(`编辑的内容未保存,是否保存?`, '提示', {
type: 'warning'
}).then(() => {
this.save(0)
}).catch(() => {
this.backPage()
})
} else {
this.backPage()
}
},
backPage () {
this.$router.push(`/match?page=${this.$store.state.matchPage}&platformSource=${this.$store.state.platformSource}`)
}
}
};
</script>
<style scoped lang="scss">
.type-wrap {
position: relative;
margin-top: 20px;
background: #fff;
&.pd {
padding: 15px;
}
position: relative;
margin-top: 20px;
background: #fff;
&.pd {
padding: 15px;
}
}
.edit {
position: absolute;
top: 30px;
right: 30px;
position: absolute;
top: 30px;
right: 30px;
}
.el-steps {
justify-content: center;
justify-content: center;
}
.steps {
display: flex;
justify-content: center;
&.pointer {
li {
cursor: pointer;
}
}
li {
position: relative;
margin-right: 100px;
text-align: center;
}
.circle {
display: inline-flex;
display: flex;
justify-content: center;
align-items: center;
width: 35px;
margin: 0 auto 10px;
line-height: 35px;
font-size: 18px;
color: #333;
background: #f9f9f9;
border: 5px solid #e1e1e1;
border-radius: 50%;
&:after {
content: '';
position: absolute;
left: 64px;
width: 146px;
height: 3px;
background: #e1e1e1;
&.pointer {
li {
cursor: pointer;
}
}
li {
position: relative;
margin-right: 100px;
text-align: center;
}
}
.active {
.circle {
color: #fff;
border-color: #459ffb;
background: #007EFF;
display: inline-flex;
justify-content: center;
align-items: center;
width: 35px;
margin: 0 auto 10px;
line-height: 35px;
font-size: 18px;
color: #333;
background: #f9f9f9;
border: 5px solid #e1e1e1;
border-radius: 50%;
&:after {
content: '';
position: absolute;
left: 64px;
width: 146px;
height: 3px;
background: #e1e1e1;
}
}
.text {
color: #007EFF;
.active {
.circle {
color: #fff;
border-color: #459ffb;
background: #007eff;
}
.text {
color: #007eff;
}
}
}
.done {
.circle {
color: #fff;
background: #9c86ff;
border-color: #bbacff;
&:after {
background: #bbacff;
}
.done {
.circle {
color: #fff;
background: #9c86ff;
border-color: #bbacff;
&:after {
background: #bbacff;
}
}
.text {
color: #9178ff;
}
}
.text {
color: #9178ff;
.circle2:after {
left: 71px;
width: 147px;
}
.circle4:after {
display: none;
}
}
.circle2:after {
left: 71px;
width: 147px;
}
.circle4:after {
display: none;
}
}
.btns {
text-align: center;
text-align: center;
}
</style>

@ -618,11 +618,11 @@ export default {
} else {
try {
//
if (this.timeId) {
await this.$post(`${this.api.cancelCompetitionStageRankingTime}?releaseId=${this.timeId}`)
} else {
await this.$post(`${this.api.cancelRanking}?competitionId=${this.id}&isOverallRanking=${this.active ? 0 : 1}&${this.active ? 'stageIds=' + this.active : query.join('&')}`)
}
// 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.sourceType = ''
this.type = 0
this.getData()

@ -2858,6 +2858,7 @@ export default {
},
//
submitShip () {
if (this.shipContent.length > 300) return this.$message.error('请填写300个字以内!')
this.curRow.shipContent = this.shipContent
this.shipVisible = false
},

@ -61,9 +61,9 @@ export default {
components: { codemirror },
data () {
return {
categoryId: Number(this.$route.query.categoryId),
id: Number(this.$route.query.id),
postStatus: Number(this.$route.query.postStatus),
categoryId: +this.$route.query.categoryId,
id: +this.$route.query.id,
postStatus: +this.$route.query.postStatus,
isSchool: this.$route.query.isSchool == 1 ? true : false, //
isDetail: Boolean(this.$route.query.show), //
isModel: Boolean(this.$route.query.model), //
@ -107,19 +107,21 @@ export default {
modelDemo
}
this.handleId(this.categoryList, categoryId)
console.log("🚀 ~ file: addModel.vue:112 ~ getData ~ codeKey:", this.categoryIdCus)
this.codeKey++
},
// id
handleId (list, id, parentId = []) {
list.map(e => {
for (const e of list) {
// idid
if (id === e.id) {
parentId.shift() // id
// parentId.shift() // id
this.categoryIdCus = [...parentId, e.id]
break
} else {
e.children && this.handleId(e.children, id, [...parentId, e.id])
}
})
}
},
//
getType () {
@ -140,7 +142,7 @@ export default {
if (this.id) {
this.getData()
} else {
this.handleId(data, this.categoryId)
this.handleId(data[0].children, this.categoryId)
}
}).catch(res => { })
},

@ -1,57 +1,65 @@
<template>
<div>
<el-card shadow="hover" class="mgb20">
<el-page-header :content="'系统后台 / '+ $route.query.name" @back="back"></el-page-header>
</el-card>
<div class="page" style="padding: 0">
<div class="tabs">
<a class="item" v-for="(item,index) in tabs" :key="index" :class="{active: index == active}" @click="tabChange(index)">{{ item }}</a>
</div>
<div>
<el-card shadow="hover"
class="mgb20">
<el-page-header :content="'系统后台 / '+ $route.query.name"
@back="back"></el-page-header>
</el-card>
<div class="page"
style="padding: 0">
<div class="tabs">
<a class="item"
v-for="(item,index) in tabs"
:key="index"
:class="{active: index == active}"
@click="tabChange(index)">{{ item }}</a>
</div>
<model v-if="active == 'model'"></model>
<sourceModel v-else-if="active == 'sourceModel'"></sourceModel>
</div>
<model v-if="active == 'model'"></model>
<sourceModel v-else-if="active == 'sourceModel'"></sourceModel>
</div>
</div>
</template>
<script>
import model from "./model";
import sourceModel from "./sourceModel";
export default {
data() {
return {
active: this.$route.query.type || 'model',
tabs: {
model: "模型列表管理",
sourceModel: "源模型管理"
}
};
},
computed: {
data () {
return {
active: this.$route.query.type || 'model',
tabs: {
model: "模型列表管理",
sourceModel: "源模型管理"
}
};
},
computed: {
},
components: {
model,
sourceModel
},
created() {},
methods: {
tabChange(index) {
this.active = index
this.$router.push({
path: 'backstage',
query: {
...this.$route.query,
page: 1,
type: index,
categoryId: ''
}
})
},
back() {
this.$router.push('/configure')
},
components: {
model,
sourceModel
},
created () { },
methods: {
tabChange (index) {
this.active = index
this.$router.push({
path: 'backstage',
query: {
...this.$route.query,
page: 1,
type: index,
categoryId: '',
school: 0
}
})
},
back () {
this.$router.push('/configure')
}
}
};
</script>

@ -10,7 +10,8 @@
<el-button type="text"
icon="el-icon-refresh"
@click="syncModel">同步原始模型列表</el-button>
<el-button type="text"
<el-button v-if="!orgList.length"
type="text"
@click="addType(0)">添加</el-button>
</div>
<org-tree v-if="orgList.length"

@ -188,7 +188,7 @@ export default {
modelName: this.keyword,
pageNum: this.page,
pageSize: this.pageSize,
categoryId: curNode.id,
categoryId: this.isSchool ? '' : curNode.id,
founder: this.isSchool ? 1 : 0
})
this.listData = data.records
@ -265,6 +265,12 @@ export default {
modelName: row.modelName,
systemId: this.systemId
})
//
const { tree } = this.$refs
tree.modelType = 0
tree.$refs.tree.setCurrentKey(ids[ids.length - 1])
this.isSchool = 0
this.getList()
this.$message.success('复制成功!')
this.copyVisible = false
},

@ -1,7 +1,19 @@
<template>
<div>
<div>
<el-tree :data="orgList"
<el-radio-group v-model="modelType"
@change="changeModelType">
<div style="margin-bottom: 10px">
<el-radio :label="0">内置模型</el-radio>
</div>
<div>
<el-radio :label="1">院校创建</el-radio>
</div>
</el-radio-group>
<el-divider></el-divider>
<el-tree v-show="!modelType"
:data="orgList"
ref="tree"
default-expand-all
node-key="id"
@ -30,8 +42,9 @@
</span>
</span>
</el-tree>
<div :class="['school-create', {active: schoolActive}]"
@click="schoolClick">院校创建</div>
<div v-show="modelType"
class="school-create active"
@click="schoolClick">全部</div>
</div>
<el-dialog :title="Form.id ? '编辑分类' : '新增分类'"
@ -63,6 +76,7 @@ export default {
data () {
return {
systemId: this.$route.query.systemId,
modelType: +this.$route.query.school,
orgList: [],
typeVisible: false,
Form: {
@ -76,7 +90,6 @@ export default {
{ required: true, message: "请输入分类名称", trigger: "blur" }
]
},
schoolActive: false
};
},
mounted () {
@ -87,12 +100,10 @@ export default {
getType () {
this.$post(this.api.sourceModelClassification + '?founder=0').then(({ data }) => {
this.orgList = data
this.$parent.categories = data
if (data.length) this.$parent.categories = data[0].children
data.length && this.$nextTick(() => {
const { categoryId, school } = this.$route.query
if (school == 1) {
this.schoolActive = +school
} else {
if (school == 0) {
this.$refs.tree.setCurrentKey(categoryId || data[0].id)
}
this.$router.push({
@ -107,9 +118,20 @@ export default {
})
}).catch(res => { })
},
//
changeModelType (val) {
this.$router.push({
path: 'backstage',
query: {
...this.$route.query,
categoryId: '',
school: val
}
}).catch(err => { })
this.$emit('initData', val)
},
//
getSingle () {
this.schoolActive = false
this.$router.push({
path: 'backstage',
query: {
@ -123,7 +145,6 @@ export default {
//
schoolClick () {
this.$refs.tree.setCurrentKey(null)
this.schoolActive = true
this.$router.push({
path: 'backstage',
query: {

Loading…
Cancel
Save