This commit is contained in:
fan 2020-05-14 17:37:56 +08:00
commit e5852949da
4 changed files with 41 additions and 36 deletions

View File

@ -10,6 +10,15 @@ export function getScriptPageListOnline(params) {
}); });
} }
/** 分页查找上线的剧本(新版)*/
export function getScriptPageListOnlineNew(params) {
return request({
url: `/api/scirpt/v1/paging/online`,
method: 'get',
params: params
});
}
/** 通过ID查询发布的剧本的详细信息 */ /** 通过ID查询发布的剧本的详细信息 */
export function getScriptById(id) { export function getScriptById(id) {
return request({ return request({
@ -17,6 +26,15 @@ export function getScriptById(id) {
method: 'get' method: 'get'
}); });
} }
/** 通过ID查询发布的剧本的详细信息(新版) */
export function getScriptByIdNew(id) {
return request({
url: `/api/scirpt/v1/${id}/detail`,
method: 'get'
});
}
/** 通过group查询未发布剧本的详细信息 */ /** 通过group查询未发布剧本的详细信息 */
export function getDraftScriptByGroup(group) { export function getDraftScriptByGroup(group) {
return request({ return request({

View File

@ -67,7 +67,7 @@ export default {
}, },
data() { data() {
return { return {
minimize:false, minimize:true,
recordSending:false, recordSending:false,
currentCoversition:{}, currentCoversition:{},
seconds:0, seconds:0,

View File

@ -51,7 +51,7 @@
</template> </template>
<script> <script>
import { getScriptPageListOnline, getScriptById, getDraftScriptByGroup, getDraftScriptByGroupNew } from '@/api/script'; import {getScriptPageListOnlineNew, getScriptByIdNew, getDraftScriptByGroupNew } from '@/api/script';
// //
export default { export default {
@ -148,15 +148,14 @@ export default {
}, },
listQuest(params) { listQuest(params) {
params['mapId'] = this.$route.query.mapId; params['mapId'] = this.$route.query.mapId;
return getScriptPageListOnline(params); return getScriptPageListOnlineNew(params);
}, },
async loadInitData() { async loadInitData() {
}, },
async handleLoad(index, row) { async handleLoad(index, row) {
this.row = row; this.row = row;
if (row.drawWay) { const res = this.$route.fullPath.includes('design/displayNew/demon') ? await getDraftScriptByGroupNew(row.group) : await getScriptByIdNew(row.id);
const res = this.$route.fullPath.includes('design/displayNew/demon') ? await getDraftScriptByGroupNew(row.group) : await getScriptById(row.id);
let newMemberList = []; let newMemberList = [];
if (res.code == 200) { if (res.code == 200) {
if (res.data.playerList && res.data.playerList.length > 0) { if (res.data.playerList && res.data.playerList.length > 0) {
@ -168,21 +167,6 @@ export default {
this.memberList = newMemberList || []; this.memberList = newMemberList || [];
this.memberList.unshift({ id: '', name: this.$t('display.script.none'), role: 'no' }); this.memberList.unshift({ id: '', name: this.$t('display.script.none'), role: 'no' });
} }
} else {
const res = this.$route.fullPath.includes('design/display/demon') ? await getDraftScriptByGroup(row.group) : await getScriptById(row.id);
let newMemberList = [];
if (res.code == 200) {
if (res.data.playerVOList && res.data.playerVOList.length > 0) {
newMemberList = res.data.playerVOList.filter(item => item.hasPlay === true);
}
if (res.data.mapLocation) {
this.mapLocation = res.data.mapLocation;
}
this.memberList = newMemberList || [];
this.memberList.unshift({ id: '', name: this.$t('display.script.none'), role: 'no' });
}
}
this.roleShow = true; this.roleShow = true;
}, },

View File

@ -99,7 +99,7 @@ import Scheduling from './demon/scheduling';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { getTrainingStepsDetailNew, getTrainingDetailNew } from '@/api/jmap/training'; import { getTrainingStepsDetailNew, getTrainingDetailNew } from '@/api/jmap/training';
import { setGoodsTryUse } from '@/api/management/goods'; import { setGoodsTryUse } from '@/api/management/goods';
import { clearSimulation, loadScript, loadScriptNew, getSimulationInfoNew } from '@/api/simulation'; import { clearSimulation, loadScriptNew, getSimulationInfoNew, scriptExecuteNew } from '@/api/simulation';
import { OperateMode, TrainingMode } from '@/scripts/ConstDic'; import { OperateMode, TrainingMode } from '@/scripts/ConstDic';
import { checkLoginLine } from '@/api/login'; import { checkLoginLine } from '@/api/login';
import { loadNewMapDataByGroup } from '@/utils/loaddata'; import { loadNewMapDataByGroup } from '@/utils/loaddata';
@ -481,14 +481,17 @@ export default {
// //
async selectQuest(row, id, mapLocation, roleName) { async selectQuest(row, id, mapLocation, roleName) {
try { try {
// const res = await loadScript(row.id, id, this.group); const res = await loadScriptNew(row.id, id, this.group);
const res = this.$route.query.drawWay == 'true' ? await loadScriptNew(row.id, id, this.group) : await loadScript(row.id, id, this.group);
if (res && res.code == 200) { if (res && res.code == 200) {
this.questId = parseInt(row.id); this.questId = parseInt(row.id);
if (mapLocation) { if (mapLocation) {
const newMapLocation = {'offsetX': mapLocation.x, 'offsetY': mapLocation.y, 'scaleRate': mapLocation.scale}; const newMapLocation = {'offsetX': mapLocation.x, 'offsetY': mapLocation.y, 'scaleRate': mapLocation.scale};
Vue.prototype.$jlmap.setOptions(newMapLocation); Vue.prototype.$jlmap.setOptions(newMapLocation);
} }
scriptExecuteNew(this.group).then(data=>{
}).catch(error=>{
console.log(error);
});
} }
if (this.$refs.menuDemon) { if (this.$refs.menuDemon) {
await this.$refs.menuDemon.initLoadPage(); await this.$refs.menuDemon.initLoadPage();