剧本创建修改查询接口调整

This commit is contained in:
joylink_cuiweidong 2019-08-12 11:31:43 +08:00
parent 914b5d4e0e
commit 47b2be3a8b
3 changed files with 27 additions and 24 deletions

View File

@ -352,7 +352,7 @@ export const asyncRouter = [
path: '/script',
components: Layout,
meta: {
roles: [admin, lessonCreater]
roles: [admin, lessonCreater, user]
},
children: [
{

View File

@ -9,7 +9,8 @@
</template>
<script>
import { getSkinStyleList } from '@/api/management/mapskin'
import { listPublishMap } from '@/api/jmap/map'
import { getQuestById} from '@/api/quest';
export default {
@ -17,12 +18,12 @@
data() {
return {
dialogVisible: false,
skinStyleList: [],
mapList: [],
taskStatusList: [],
disabled:null,
formModel: {
name: '',
skinCode: '01',
mapId: '',
description:''
},
isShow: false,
@ -38,7 +39,7 @@
labelWidth: '100px',
items: [
{ prop: 'name', label: '剧本名称', type: 'text', required: true},
{ prop: 'skinCode', label: '皮肤类型', type: 'select', required: true, options: this.skinStyleList,disabled:this.disabled},
{ prop: 'mapId', label: '地图类型', type: 'select', required: true, options: this.mapList,disabled:this.disabled},
{ prop: 'description', label: '剧本描述', type: 'textarea', required: true},
]
}
@ -49,8 +50,8 @@
name: [
{ required: true, message: '请输入剧本', trigger: 'blur' },
],
skinCode: [
{ required: true, message: '请选择皮肤类型', trigger: 'change' },
mapId: [
{ required: true, message: '请选择地图类型', trigger: 'change' },
],
description:[
{ required: true, message: '请输入剧本描述', trigger: 'blur' },
@ -67,16 +68,16 @@
},
methods: {
loadInitData() {
this.skinStyleList = [];
getSkinStyleList().then(response => {
this.skinStyleList = response.data.map(elem => { return { value: elem.code, label: elem.name } });
this.mapList = [];
listPublishMap().then(response => {
this.mapList = response.data.map(elem => { return { value: elem.id, label: elem.name } });
})
},
doShow(questid) {
if(questid)
{
getQuestById(questid).then(resp=>{
let data={'name':resp.data.name,'description':resp.data.description,'skinCode':resp.data.skinCode};
let data={'name':resp.data.name,'description':resp.data.description,'mapId':resp.data.mapId};
this.formModel=data;
this.formModel.id=questid;
this.disabled="disabled";

View File

@ -11,8 +11,9 @@
<script>
import { superAdmin } from '@/router';
import { listPublishMap } from '@/api/jmap/mapdraft';
import { getSkinStyleList } from '@/api/management/mapskin'
// import { listPublishMap } from '@/api/jmap/mapdraft';
import { listPublishMap } from '@/api/jmap/map';
// import { getSkinStyleList } from '@/api/management/mapskin'
import { runPlanTemplateList, deleteRunPlanTemplate, generateCommonRunPlanEveryDay } from '@/api/runplan';
import { UrlConfig } from '@/router/index';
import { getQuestPageList,createQuest,deleteQuest,updateQuest} from '@/api/quest';
@ -27,7 +28,7 @@
},
data() {
return {
skinCodeList: [],
mapList: [],
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
@ -36,9 +37,9 @@
labelWidth: '140px',
reset: true,
queryObject: {
skinCode: {
mapId: {
type: 'select',
label: '皮肤类型',
label: '地图类型',
config: {
data: []
}
@ -55,11 +56,11 @@
prop: 'name'
},
{
title: '皮肤类型',
prop: 'skinCode',
title: '地图类型',
prop: 'mapId',
type: 'tag',
columnValue: (row) => {
return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name'])
return this.$convertField(row.mapId, this.mapList, ['id', 'name'])
},
tagType: (row) => { return '' }
},
@ -71,7 +72,7 @@
type: 'button',
title: '操作',
width: '350',
hide: () => { return this.$store.state.user.roles.indexOf(superAdmin) < 0; },
// hide: () => { return this.$store.state.user.roles.indexOf(superAdmin) < 0; },
buttons: [
{
name: '录制',
@ -104,11 +105,12 @@
},
methods: {
loadInitData() {
this.skinCodeList = [];
getSkinStyleList().then(response => {
this.skinCodeList = response.data;
this.mapList = [];
listPublishMap().then(response => {
this.mapList = response.data;
// this.mapList = response.data.map(elem => { return { value: elem.id, label: elem.name } });
response.data.forEach(elem => {
this.queryForm.queryObject.skinCode.config.data.push({ value: elem.code, label: elem.name });
this.queryForm.queryObject.mapId.config.data.push({ value: elem.id, label: elem.name });
})
})
},