竞赛系统 实操列表代码调整

This commit is contained in:
joylink_cuiweidong 2020-05-27 11:20:14 +08:00
parent 60c90f24e8
commit 61b0d22d53
3 changed files with 24 additions and 8 deletions

View File

@ -19,13 +19,18 @@ export default {
default() {
return '';
}
},
raceList:{
type: Array,
default() {
return '';
}
}
},
data() {
return {
dialogVisible: false,
mapList: [],
taskStatusList: [],
isEdit:false,
formModel: {
name: '',
mapId: '',
@ -34,11 +39,19 @@ export default {
};
},
computed: {
raceInfoList() {
const racelist = [];
this.raceList.forEach(each=>{
racelist.push({label:each.name, value:each.id});
});
return racelist;
},
form() {
const form = {
labelWidth: '120px',
items: [
{ prop: 'name', label: '实操名称', type: 'text' },
{ prop:'raceId', label:'竞赛名称', type:'select', options:this.raceInfoList, disabled:this.isEdit},
{ prop: 'description', label: '实操描述', type: 'textarea' }
]
};
@ -53,6 +66,9 @@ export default {
description: [
{ validator: this.validateDescription, trigger: 'blur' },
{ validator: this.validateDescription, trigger: 'change' }
],
raceId:[
{ required: true, message: '请选择竞赛', trigger: 'change' }
]
};
return crules;
@ -82,12 +98,13 @@ export default {
this.formModel = data;
this.formModel.id = questid;
this.dialogVisible = true;
this.isEdit = true;
});
} else {
this.formModel.mapId = this.$route.params.mapId;
this.dialogVisible = true;
this.isEdit = false;
}
},
doCreate() {
const self = this;

View File

@ -1,8 +1,8 @@
<template>
<div>
<query-list-page ref="user" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<create-practice ref="createPractice" title="创建实操" @reloadTable="reloadTable" @create="handleConfirmCreate" />
<create-practice ref="modifyPractice" title="修改实操" @reloadTable="reloadTable" @create="handleConfirmModify" />
<create-practice ref="createPractice" :race-list="raceList" title="创建实操" @reloadTable="reloadTable" @create="handleConfirmCreate" />
<create-practice ref="modifyPractice" :race-list="raceList" title="修改实操" @reloadTable="reloadTable" @create="handleConfirmModify" />
</div>
</template>
<script>
@ -132,7 +132,8 @@ export default {
}).catch(() => { });
},
doRecord(index, row) {
practiceRecordNotify(row.id).then(resp => {
// row.id
practiceRecordNotify(83).then(resp => {
const query = { mapId: row.mapId, group: resp.data, scriptId: row.id, lang:row.lang, lineCode:this.$route.query.lineCode};
this.$router.push({ path: `${UrlConfig.practiceDisplayNew}/practice`, query });
launchFullscreen();

View File

@ -24,8 +24,6 @@ export default {
data() {
return {
dialogVisible: false,
mapList: [],
taskStatusList: [],
formModel: {
name: '',
mapId: '',