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

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

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

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

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

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

@ -188,7 +188,7 @@ export default {
modelName: this.keyword, modelName: this.keyword,
pageNum: this.page, pageNum: this.page,
pageSize: this.pageSize, pageSize: this.pageSize,
categoryId: curNode.id, categoryId: this.isSchool ? '' : curNode.id,
founder: this.isSchool ? 1 : 0 founder: this.isSchool ? 1 : 0
}) })
this.listData = data.records this.listData = data.records
@ -265,6 +265,12 @@ export default {
modelName: row.modelName, modelName: row.modelName,
systemId: this.systemId 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.$message.success('复制成功!')
this.copyVisible = false this.copyVisible = false
}, },

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

Loading…
Cancel
Save