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. 39
      src/pages/expSystem/backstage/model.vue
  4. 27
      src/pages/expSystem/backstage/modelType.vue
  5. 39
      src/pages/expSystem/backstage/sourceModel.vue
  6. 56
      src/pages/expSystem/backstage/sourceType.vue
  7. 610
      src/pages/match/add/index.vue
  8. 10
      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 => { }).then(res => {
this.notices = res.notificationList this.notices = res.notificationList
}).catch(res => { }); }).catch(res => { });
}, 1000) }, 5000)
} }
}, },
// //

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

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

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

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

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

@ -1,65 +1,113 @@
<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="hasPer"> :content="'创建赛事'"></el-page-header>
<div v-if="step === 1 || (id && !editing)" :class="['type-wrap', {pd: !id}]"> </div>
<div class="p-title">大赛发布类型</div> </el-card>
<el-form label-width="100px" label-suffix=":" size="small" :disabled="!editing && id != ''"> <div v-if="hasPer">
<el-form-item label="请选择类型"> <div v-if="step === 1 || (id && !editing)"
<el-radio v-for="(item, i) in releaseTypes" :key="i" v-model="releaseType" :label="item.id">{{ item.name }}</el-radio> :class="['type-wrap', {pd: !id}]">
</el-form-item> <div class="p-title">大赛发布类型</div>
</el-form> <el-form label-width="100px"
<el-button v-if="!editing && id" class="edit" type="primary" @click="editing = 1" v-auth="'/match/list:管理:大赛详情:编辑'">编辑</el-button> label-suffix=":"
</div> size="small"
<el-card v-if="step !== 4" shadow="hover" class="m-b-20" style="position: relative;margin-top: 20px"> :disabled="!editing && id != ''">
<ul :class="['steps', {pointer: !editing && id}]"> <el-form-item label="请选择类型">
<li :class="{active: step === 1,done: step > 1}" @click="toStep(1)"> <el-radio v-for="(item, i) in releaseTypes"
<span class="circle">1</span> :key="i"
<p class="text">大赛信息填写</p> v-model="releaseType"
</li> :label="item.id">{{ item.name }}</el-radio>
<template v-if="releaseType"> </el-form-item>
<li :class="{active: step === 2,done: step > 2}" @click="toStep(2)"> </el-form>
<span class="circle circle2">2</span> <el-button v-if="!editing && id"
<p class="text">赛程与规则设置</p> class="edit"
</li> type="primary"
<li :class="{active: step === 3,done: step > 3}" @click="toStep(3)"> @click="editing = 1"
<span class="circle circle3">3</span> v-auth="'/match/list:管理:大赛详情:编辑'">编辑</el-button>
<p class="text">比赛内容设置</p> </div>
</li> <el-card v-if="step !== 4"
</template> shadow="hover"
<li :class="{done: step > 3}"> class="m-b-20"
<span class="circle circle4">{{ releaseType ? 4 : 2 }}</span> style="position: relative;margin-top: 20px">
<p class="text">发布{{ !editing && id ? '成功' : '' }}</p> <ul :class="['steps', {pointer: !editing && id}]">
</li> <li :class="{active: step === 1,done: step > 1}"
</ul> @click="toStep(1)">
</el-card> <span class="circle">1</span>
</div> <p class="text">大赛信息填写</p>
<el-button v-else-if="!editing && id" class="edit" type="primary" @click="editing = 1" v-auth="'/match/list:管理:大赛详情:编辑'">编辑</el-button> </li>
<div class="page"> <template v-if="releaseType">
<div class="page-content"> <li :class="{active: step === 2,done: step > 2}"
<step1 v-show="step === 1" ref="step1" :editing.sync="editing" @next="next" /> @click="toStep(2)">
<step2 v-if="step === 2" ref="step2" :editing.sync="editing" :setupId.sync="setupId" @next="next" /> <span class="circle circle2">2</span>
<step3 v-if="step === 3" ref="step3" :editing.sync="editing" :setupId.sync="setupId" :competitionId.sync="competitionId" @next="next" /> <p class="text">赛程与规则设置</p>
<step4 v-if="step === 4" /> </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>
<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"
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> <div v-if="editing || !id"
<el-button v-if="step === 2 || step === 3" type="primary" @click="prev">上一步</el-button> class="m-r-10">
<el-button v-if="releaseType == 0" type="primary" @click="save(1)">发布</el-button> <el-button v-if="!publishStatus"
<el-button v-else type="primary" @click="save(id ? 1 : 0, 2)">保存并下一步</el-button> @click="save(0)">保存{{ releaseType ? '草稿' : '' }}</el-button>
</div> <el-button v-if="step === 2 || step === 3"
<el-button type="danger" @click="preview" v-auth="'/match/list:管理:大赛详情:预览'">预览</el-button> type="primary"
<el-button @click="cancel">{{ editing ? '取消' : '返回' }}</el-button> @click="prev">上一步</el-button>
</div> <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> </div>
<el-button type="danger"
@click="preview"
v-auth="'/match/list:管理:大赛详情:预览'">预览</el-button>
<el-button @click="cancel">{{ editing ? '取消' : '返回' }}</el-button>
</div> </div>
</div>
</div> </div>
</div>
</template> </template>
<script> <script>
@ -71,270 +119,266 @@ 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.match.cache, cache: this.$store.state.match.cache,
hasPer: false, hasPer: false,
releaseTypes: [ releaseTypes: [
{ {
id: 0, id: 0,
name: '仅发布信息' name: '仅发布信息'
}, },
{ {
id: 1, id: 1,
name: '设置完整比赛' name: '设置完整比赛'
} }
], ],
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
},
// ,
beforeRouteLeave (to, from, next) {
const { updateTime } = this.$refs['step' + this.step]
if (this.$refs['step' + this.step] && updateTime) {
this.$confirm(`您所更改的内容未更新,是否更新?`, '提示', {
type: 'warning'
}).then(() => {
this.save(this.step, to.path, next)
}).catch(() => {
next()
})
} else {
next()
}
},
mounted () {
this.getPer()
},
methods: {
//
resumeData () {
if (this.cache) {
this.step = 3
this.editing = true
this.showBtns = false
}
}, },
components: { // true
quill, getPer () {
step1, this.$get(this.api.getCustomerOrder).then(({ show }) => {
step2, this.hasPer = show
step3, show || this.$parent.hideArch()
step4 }).catch(err => { })
}, },
// , // loading
beforeRouteLeave(to, from, next) { showLoad () {
const { updateTime } = this.$refs['step' + this.step] this.loadIns = Loading.service()
if(updateTime){
this.$confirm(`您所更改的内容未更新,是否更新?`, '提示', {
type: 'warning'
}).then(() => {
this.save(this.step,to.path,next)
}).catch(() => {
next()
})
}else{
next()
}
}, },
mounted() { // loading
this.getPer() hideLoad () {
this.loadIns.close()
}, },
methods: { //
// save (status, next = 0, cb) {
resumeData() { console.log('status=>', status)
if (this.cache) { console.log('cb=>', cb)
this.step = 3 console.log('this.step=>', this.step)
this.editing = true this.$refs['step' + this.step].save(status, next, this.releaseType, cb)
this.showBtns = false },
} //
}, prev () {
// true //
getPer() { const { updateTime } = this.$refs['step' + this.step]
this.$get(this.api.getCustomerOrder).then(({ show }) => { if (this.$refs['step' + this.step] && updateTime) {
this.hasPer = show this.$confirm(`编辑的内容未保存,是否保存?`, '提示', {
show || this.$parent.hideArch() type: 'warning'
}).catch(err => {}) }).then(() => {
}, this.save(0, 1)
// loading }).catch(() => {
showLoad() {
this.loadIns = Loading.service()
},
// loading
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)
},
//
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,type) {
console.log('next==>',next)
console.log('setupId==>',setupId)
console.log('competitionId==>',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('add?id=' + competitionId)
this.id = competitionId
this.competitionId = competitionId
}
this.step++
} else if (next === 1) {
this.step-- this.step--
} else { })
console.log(99999999) } else {
if(typeof setupId === 'function') { this.step--
setupId() }
}else if(typeof type === 'function') { },
type() //
} next (next, setupId, competitionId, type) {
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('add?id=' + competitionId)
this.id = competitionId
this.competitionId = competitionId
} }
}, this.step++
// } else if (next === 1) {
toStep(i) { this.step--
if (this.id && !this.editing) this.step = i } else {
}, console.log(99999999)
// if (typeof setupId === 'function') {
preview() { setupId()
util.local.set('match', this.$refs.step1.form) } else if (typeof type === 'function') {
window.open(this.$router.resolve('/match/preview').href) type()
},
//
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.match.page}`)
} }
}, }
back() { },
//
toStep (i) {
if (this.id && !this.editing) this.step = i
},
//
preview () {
util.local.set('match', this.$refs.step1.form)
window.open(this.$router.resolve('/match/preview').href)
},
//
cancel () {
//
if (this.editing && this.$route.query.name) {
// //
const { updateTime } = this.$refs['step' + this.step] const { updateTime } = this.$refs['step' + this.step]
console.log("🚀 ~ file: index.vue:142 ~ back ~ updateTime", updateTime) if (this.step < 4 && this.$refs['step' + this.step] && 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.match.page}`) this.$router.push(`/match?page=${this.$store.state.match.page}`)
} }
},
back () {
//
const { updateTime } = this.$refs['step' + this.step]
if (this.step < 4 && this.$refs['step' + this.step] && updateTime) {
this.$confirm(`编辑的内容未保存,是否保存?`, '提示', {
type: 'warning'
}).then(() => {
this.save(0)
}).catch(() => {
this.backPage()
})
} else {
this.backPage()
}
},
backPage () {
this.$router.push(`/match?page=${this.$store.state.match.page}`)
} }
}
}; };
</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: 45px; 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: 45px;
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 {
display: flex; display: flex;
justify-content: center; justify-content: center;
text-align: center; text-align: center;
} }
</style> </style>

@ -617,11 +617,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.publishTime = '' this.publishTime = ''
this.sourceType = '' this.sourceType = ''
this.type = 0 this.type = 0

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

@ -27,7 +27,7 @@ if (isPro) {
host = "http://121.37.12.51/"; // 中台测试服 host = "http://121.37.12.51/"; // 中台测试服
// host = 'https://www.occupationlab.com/' // 正式服 // host = 'https://www.occupationlab.com/' // 正式服
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/'; // 赓
} }
const Setting = { const Setting = {

Loading…
Cancel
Save