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

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', path: '/script',
components: Layout, components: Layout,
meta: { meta: {
roles: [admin, lessonCreater] roles: [admin, lessonCreater, user]
}, },
children: [ children: [
{ {

View File

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

View File

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