This commit is contained in:
joylink_cuiweidong 2020-12-30 16:10:13 +08:00
commit 1508578f74
6 changed files with 56 additions and 12 deletions

View File

@ -147,3 +147,11 @@ export function getSceneExport(id) {
});
}
/** 查询国赛剧本权限 */
export function queryCompetitionPracticalPermissions(params) {
return request({
url: `/api/v1/competitionPractical/query/permissions`,
method: 'get',
params
});
}

View File

@ -2,10 +2,10 @@ export function getBaseUrl() {
let BASE_API;
if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://api.joylink.club/jlcloud';
BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.8.107:9000'; // 袁琪
// BASE_API = 'http://192.168.8.129:9000'; // 旭强
// BASE_API = 'http://192.168.8.119:9000'; // 张赛
BASE_API = 'http://192.168.8.119:9000'; // 张赛
// BASE_API = 'http://192.168.8.110:9000'; // 杜康
// BASE_API = 'http://b29z135112.zicp.vip';
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康

View File

@ -1,8 +1,12 @@
<template>
<div>
<div :id="ibpId" v-loading="loading" :style="{ width: canvasWidth+'px', height: canvasHeight +'px',background:'#000' }" class="ibp-canvas" />
<el-button v-if="showBackButton" class="ibp-button" type="primary" @click="back">{{ $t('global.back') }}</el-button>
<el-button v-if="$route.query.noPreLogout" class="ibp-button" type="primary" @click="quit">退出</el-button>
<el-button-group class="ibp-button">
<el-button v-if="moreScreen" type="primary" @click="switchOffset">切换</el-button>
<el-button v-if="showBackButton" type="primary" @click="back">{{ $t('global.back') }}</el-button>
<el-button v-if="$route.query.noPreLogout" type="primary" @click="quit">退出</el-button>
</el-button-group>
<audio id="buzzer" controls loop="loop">
<source :src="buzzerAudio" type="audio/mpeg">
</audio>
@ -38,6 +42,7 @@ export default {
return {
width: this.$store.state.config.width,
height: this.$store.state.config.height,
moreScreen: false,
offsetX: 0,
dataZoom: {
offsetX: '0',
@ -101,8 +106,8 @@ export default {
}
this.initIbp();
if (this.$route.query.loadAll && this.$route.query.stationCode) {
await this.show(this.$route.query.stationCode);
await this.setMoveInit(true);
await this.show(this.$route.query.stationCode, 'left');
await this.setMoveInit(false);
this.showBackButton = false;
}
},
@ -182,7 +187,7 @@ export default {
}
const data = parser(ibpDatas, {width: this.canvasWidth, height: this.canvasHeight}); // ibp
this.initIbp(this.offsetX);
this.moreScreen = ibpDatas.background && ibpDatas.background.width > 1920;
this.setIbp(data, ibpDatas);
this.$store.dispatch('ibp/setIbpData', ibpDatas);
this.handleBanOpenScreenDoorStatus();
@ -195,7 +200,6 @@ export default {
});
}
} catch (error) {
console.log(error, '===');
this.loading = false;
this.$alert('当前ibp盘数据有问题请检查', '信息', {
confirmButtonText: '确定',
@ -313,6 +317,19 @@ export default {
audio.pause();
}
}
},
switchOffset() {
if (this.offsetX === 0) {
this.offsetX = 1920;
} else if (this.offsetX === 1920) {
this.offsetX = 0;
}
const options = {
scaleRate: this.canvasWidth / 1920,
offsetX: this.offsetX,
offsetY: 0
};
this.$ibp && this.$ibp.setOptions(options);
}
}
};

View File

@ -398,3 +398,14 @@ export default {
line-height: 80px;
}
</style>
<style>
.ql-size-small {
font-size: 0.75em;
}
.ql-size-large{
font-size: 1.5em;
}
.ql-size-huge{
font-size: 2.5em;
}
</style>

View File

@ -1,9 +1,10 @@
<template>
<div>
<el-dialog v-dialogDrag title="场景列表" :visible.sync="dialogVisible" width="920px" center>
<el-tabs v-model="activeName" type="card" style="height:650px">
<el-tabs v-model="activeName" type="card" style="height:550px">
<el-tab-pane label="主场景列表" name="first">
<el-table :data="mainSceneData" border :span-method="objectSpanMethod" height="600" stripe :cell-style="{padding: '8px 0'}">
<div v-if="!hasPermission" style="margin-bottom: 10px;color: #f00;width: 100%;text-align: center;">尊敬的用户,您好由于您暂无场景权限现仅提供场景1试用如需使用其他场景请通过左上角菜单=联系方式联系我们开放权限</div>
<el-table :data="mainSceneData" border :span-method="objectSpanMethod" height="465" stripe :cell-style="{padding: '8px 0'}">
<el-table-column type="index" width="50" label="序号" />
<el-table-column prop="type" width="200" label="类别" />
<el-table-column prop="scene" width="350" label="场景" />
@ -11,7 +12,7 @@
<template slot-scope="scope">
<div v-if="scope.row.result">
<template v-for="(each, index) in scope.row.result">
<el-button :key="index" type="primary" size="small" style="margin-right: 8px;margin-left: 0;margin-bottom: 5px" @click="handleLoad(each)">{{ each.name }}</el-button>
<el-button :key="index" type="primary" size="small" :disabled="!hasPermission && each.name !=='场景1'" style="margin-right: 8px;margin-left: 0;margin-bottom: 5px" @click="handleLoad(each)">{{ each.name }}</el-button>
</template>
</div>
</template>
@ -24,7 +25,7 @@
</template>
<script>
import { getDraftScriptByGroupNew } from '@/api/script';
import {loadCompetitionPracticalScene, getCompetitionPracticalScene} from '@/api/competition';
import {loadCompetitionPracticalScene, getCompetitionPracticalScene, queryCompetitionPracticalPermissions} from '@/api/competition';
import { EventBus } from '@/scripts/event-bus';
import ConstConfig from '@/scripts/ConstConfig';
@ -35,6 +36,7 @@ export default {
projectMapList:[],
dialogVisible: false,
selectMapId:'',
hasPermission: false,
form: {
type: ''
},
@ -59,6 +61,11 @@ export default {
};
},
mounted() {
queryCompetitionPracticalPermissions({mapId:this.$route.query.mapId}).then(res => {
this.hasPermission = !!res.data;
}).catch(() => {
this.$message.error('获取场景权限异常!');
});
getCompetitionPracticalScene({pageSize:100, pageNum:1}).then(res=>{
if (res.data.list && res.data.list.length > 0) {
const list = res.data.list.sort((a, b) => {

View File

@ -204,6 +204,7 @@ export default {
},
refreshRunPlanName(name) {
this.$refs.schedule.refreshRunPlanName(name);
this.$router.replace({ path: this.$route.path, query: { ...this.$route.query, planName: name }});
}
}
};