增加 替换背景的操作

This commit is contained in:
lVAL 2020-11-04 14:42:48 +08:00
parent ad572fdcc9
commit 872a71c7b5
7 changed files with 152 additions and 25 deletions

View File

@ -147,6 +147,30 @@ export function modifyScriptActionNew(group, data) {
}); });
} }
/** 开始替换 */
export function startReplaceBg(group) {
return request({
url: `/api/scriptSimulation/${group}/replace/start`,
method: 'put'
});
}
/** 确认替换 */
export function confirmReplaceBg(group) {
return request({
url: `/api/scriptSimulation/${group}/replace/confirm`,
method: 'put'
});
}
/** 放弃替换 */
export function cancelReplaceBg(group) {
return request({
url: `/api/scriptSimulation/${group}/replace/cancel`,
method: 'put'
});
}
/** 分页查询存在的仿真 */ /** 分页查询存在的仿真 */
export function getExistingSimulation(params) { export function getExistingSimulation(params) {
return request({ return request({

View File

@ -109,5 +109,10 @@ export default {
revokeScriptTip: 'This action will undo release script, whether to continue?', revokeScriptTip: 'This action will undo release script, whether to continue?',
inputScriptName: 'Please input script name', inputScriptName: 'Please input script name',
selectMap: 'Please select map', selectMap: 'Please select map',
inputScriptDescription: 'Please input script description' inputScriptDescription: 'Please input script description',
startReplaceBg: '替换背景',
confirmReplaceBg: '确认替换',
cancelReplaceBg: '放弃替换'
}; };

View File

@ -110,5 +110,9 @@ export default {
revokeScriptTip: '此操作将撤销发布剧本申请, 是否继续?', revokeScriptTip: '此操作将撤销发布剧本申请, 是否继续?',
inputScriptName: '请输入剧本名称', inputScriptName: '请输入剧本名称',
selectMap: '请选择地图', selectMap: '请选择地图',
inputScriptDescription: '请输入剧本描述' inputScriptDescription: '请输入剧本描述',
startReplaceBg: '替换背景',
confirmReplaceBg: '确认替换',
cancelReplaceBg: '放弃替换'
}; };

View File

@ -5,7 +5,7 @@ export function getBaseUrl() {
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.107:9000'; // 袁琪
// BASE_API = 'http://192.168.8.114:9000'; // 旭强 // BASE_API = 'http://192.168.8.114:9000'; // 旭强
// BASE_API = 'http://192.168.3.175:9000'; // 张赛 BASE_API = 'http://192.168.8.109:9000'; // 张赛
// BASE_API = 'http://192.168.8.110:9000'; // 杜康 // BASE_API = 'http://192.168.8.110:9000'; // 杜康
// BASE_API = 'http://b29z135112.zicp.vip'; // BASE_API = 'http://b29z135112.zicp.vip';
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康 // BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康

View File

@ -138,6 +138,7 @@
<chat-member-list ref="chatMemberList" :conversition-member-list="conversitionMemberList" :simulation-users="simulationUsers" /> <chat-member-list ref="chatMemberList" :conversition-member-list="conversitionMemberList" :simulation-users="simulationUsers" />
</div> </div>
</template> </template>
<div v-if="maskShow" class="mask"/>
</div> </div>
<audio id="teleRing" :src="teleRing" preload loop /> <audio id="teleRing" :src="teleRing" preload loop />
<chat-setting ref="chatSetting" :form="form" @setSetting="setSetting" /> <chat-setting ref="chatSetting" :form="form" @setSetting="setSetting" />
@ -166,7 +167,11 @@ export default {
userRole: { userRole: {
type: String, type: String,
required: true required: true
} },
isReplaceBg: {
type: Boolean,
default: false
}
}, },
data() { data() {
return { return {
@ -217,7 +222,10 @@ export default {
}, },
IsAnswering() { IsAnswering() {
return !(this.$route.path.includes('refereeJsxtDisplay')); return !(this.$route.path.includes('refereeJsxtDisplay'));
}, },
maskShow() {
return this.isReplaceBg;
},
userId() { userId() {
return this.$store.state.user.id; return this.$store.state.user.id;
}, },
@ -1309,6 +1317,28 @@ export default {
-webkit-animation: isInviting infinite 1s; /* Safari 和 Chrome */ -webkit-animation: isInviting infinite 1s; /* Safari 和 Chrome */
-o-animation: isInviting infinite 1s; /* Opera */ -o-animation: isInviting infinite 1s; /* Opera */
} }
.mask {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: #000;
opacity: 0.7;
z-index: 2000;
&::before{
content: '';
position: absolute;
top:0;
right:0;
bottom:0;
left:0;
background: #aaa;
filter: blur(20px);
}
}
#teleName{ #teleName{
background: #6BBE16; background: #6BBE16;
position: absolute; position: absolute;

View File

@ -2,9 +2,9 @@
<div> <div>
<div class="display-draft"> <div class="display-draft">
<el-button-group> <el-button-group>
<el-button v-if="!isScriptCommand" type="success" :disabled="isDisable || dataError" @click="selectBeginTime">{{ $t('scriptRecord.drivingByPlan') }}</el-button> <el-button v-if="!isScriptCommand||isReplaceBg" type="success" :disabled="isDisable||dataError" @click="selectBeginTime">{{ $t('scriptRecord.drivingByPlan') }}</el-button>
<el-button v-if="!isScriptCommand" type="danger" :disabled="dataError" @click="end">初始化</el-button> <el-button v-if="!isScriptCommand||isReplaceBg" type="danger" :disabled="dataError" @click="end">初始化</el-button>
<el-button type="primary" @click="back">{{ $t('scriptRecord.scriptBack') }}</el-button> <el-button v-if="!isReplaceBg" type="primary" @click="back">{{ $t('scriptRecord.scriptBack') }}</el-button>
</el-button-group> </el-button-group>
</div> </div>
<demon-menu <demon-menu
@ -34,12 +34,15 @@
:group="group" :group="group"
:offset-bottom="offsetBottom" :offset-bottom="offsetBottom"
:offset="offset" :offset="offset"
:isReplaceBg="isReplaceBg"
@resetChat="resetChat" @resetChat="resetChat"
@setReplace="setReplace"
/> />
<chat-box <chat-box
ref="chatbox" ref="chatbox"
:group="group" :group="group"
:user-role="userRole" :user-role="userRole"
:isReplaceBg="isReplaceBg"
/> />
</div> </div>
</template> </template>
@ -96,7 +99,8 @@ export default {
data() { data() {
return { return {
isDisable: false, isDisable: false,
isScriptCommand:false, isScriptCommand:false,
isReplaceBg: false,
userRole:'' userRole:''
}; };
}, },
@ -234,7 +238,10 @@ export default {
}, },
resetChat() { resetChat() {
// this.$refs.chatbox.resetCoversition(); // this.$refs.chatbox.resetCoversition();
} },
setReplace(isRp) {
this.isReplaceBg = isRp
}
} }
}; };
</script> </script>

View File

@ -1,5 +1,5 @@
<template> <template>
<div> <div style="position:relative">
<div class="scriptRecordNew" :style="{bottom:(offsetBottom-15)+'px'}"> <div class="scriptRecordNew" :style="{bottom:(offsetBottom-15)+'px'}">
<div v-show="isShow" class="scriptRecordNewIn"> <div v-show="isShow" class="scriptRecordNewIn">
<el-tabs type="card"> <el-tabs type="card">
@ -24,12 +24,13 @@
</div> </div>
</div> </div>
</div> </div>
<el-button-group class="button-group"> <el-button-group class="button-group" v-if="!isReplaceBg">
<el-button v-if="isPause" size="small" type="primary" :disabled="executeDisabled" @click="pauseScript">{{ $t('scriptRecord.drivingPause') }}</el-button> <el-button v-if="isPause" size="small" type="primary" :disabled="executeDisabled" @click="pauseScript">{{ $t('scriptRecord.drivingPause') }}</el-button>
<el-button v-else size="small" type="primary" :disabled="executeDisabled" @click="executePlayScript">恢复</el-button> <el-button v-else size="small" type="primary" :disabled="executeDisabled" @click="executePlayScript">恢复</el-button>
<el-button size="small" type="danger" :disabled="!backDisabled" @click="dumpScenesData">{{ $t('scriptRecord.resetScript') }}</el-button> <el-button size="small" type="danger" :disabled="!backDisabled" @click="dumpScenesData">{{ $t('scriptRecord.resetScript') }}</el-button>
<el-button size="small" type="primary" :disabled="backDisabled" @click="saveScenesStage">{{ $t('scriptRecord.saveBackground') }}</el-button> <el-button size="small" type="primary" v-if="backDisabled" @click="startReplaceBg">{{ $t('scriptRecord.startReplaceBg') }}</el-button>
<el-button size="small" type="success" :loading="isSavingScript" @click="saveScenesData">{{ $t('scriptRecord.saveData') }}</el-button> <el-button size="small" type="primary" v-else :disabled="backDisabled" @click="saveScenesStage">{{ $t('scriptRecord.saveBackground') }}</el-button>
<el-button size="small" type="success" :loading="isSavingScript" @click="saveScenesData">{{ $t('scriptRecord.saveData') }}</el-button>
</el-button-group> </el-button-group>
</div> </div>
<div class="scriptPanelRight"> <div class="scriptPanelRight">
@ -50,10 +51,15 @@
</div> </div>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</div> <div v-if="maskShow" class="mask"/>
<div class="scriptRecordNewTitle" @click="minisize"> <el-button-group v-if="isReplaceBg" class="button-group" style="padding: 0 0 10px 10px" >
<span class="titleStyle">{{ $t('scriptRecord.scriptRecordTitle') }}</span> <el-button size="small" type="primary" @click="confirmReplaceBg">{{ $t('scriptRecord.confirmReplaceBg') }}</el-button>
</div> <el-button size="small" type="info" @click="cancelReplaceBg">{{ $t('scriptRecord.cancelReplaceBg') }}</el-button>
</el-button-group>
</div>
<div class="scriptRecordNewTitle" @click="minisize">
<span class="titleStyle">{{ $t('scriptRecord.scriptRecordTitle') }}</span>
</div>
</div> </div>
<add-script-member ref="addScriptMember" @addScriptMember="addScriptMember" /> <add-script-member ref="addScriptMember" @addScriptMember="addScriptMember" />
</div> </div>
@ -68,7 +74,7 @@ import {covertMemberData} from '@/views/newMap/displayNew/utils';
import GetActionNew from './getAction'; import GetActionNew from './getAction';
import AllScriptRole from './allScriptRole'; import AllScriptRole from './allScriptRole';
import { getToken } from '@/utils/auth'; import { getToken } from '@/utils/auth';
import {executeScriptNew, dumpScriptDataNew, saveScriptDataNew, saveScriptScenesNew, updateMapLocationNew, simulationPause} from '@/api/simulation'; import {executeScriptNew, dumpScriptDataNew, saveScriptDataNew, saveScriptScenesNew, updateMapLocationNew, simulationPause, startReplaceBg, confirmReplaceBg, cancelReplaceBg} from '@/api/simulation';
export default { export default {
name:'TipScriptRecord', name:'TipScriptRecord',
components: { components: {
@ -88,7 +94,11 @@ export default {
offset:{ offset:{
type: Number, type: Number,
required: true required: true
} },
isReplaceBg: {
type: Boolean,
default: false
}
}, },
data() { data() {
return { return {
@ -123,7 +133,10 @@ export default {
}, },
orignalUserRoleId() { orignalUserRoleId() {
return this.$store.state.training.orignalUserRoleId; return this.$store.state.training.orignalUserRoleId;
} },
maskShow() {
return this.isReplaceBg;
}
}, },
watch:{ watch:{
'$store.state.map.mapViewLoadedCount': function (val) { '$store.state.map.mapViewLoadedCount': function (val) {
@ -518,7 +531,29 @@ export default {
); );
this.oldMember = Object.assign({}, role); this.oldMember = Object.assign({}, role);
this.$refs.allScriptRole.updateLoading(); this.$refs.allScriptRole.updateLoading();
} },
startReplaceBg() {
startReplaceBg(this.group).then(resp => {
this.$emit('setReplace', true);
}).catch(error => {
this.$messageBox(error.message);
})
},
confirmReplaceBg() {
confirmReplaceBg(this.group).then(resp => {
this.$message.success('替换成功');
this.$emit('setReplace', false);
}).catch(error => {
this.$messageBox(error.message);
})
},
cancelReplaceBg() {
cancelReplaceBg(this.group).then(resp => {
this.$emit('setReplace', false);
}).catch(error => {
this.$messageBox(error.message);
})
}
} }
}; };
</script> </script>
@ -529,6 +564,7 @@ export default {
.button-group{ .button-group{
position: absolute; position: absolute;
bottom: 0; bottom: 0;
z-index: 5;
} }
.eachScriptPanel{ .eachScriptPanel{
height: 300px; height: 300px;
@ -609,5 +645,26 @@ export default {
text-align: center; text-align: center;
display: inline-block; display: inline-block;
} }
.mask {
position: absolute;
top: 28px;
left: 0;
right: 0;
bottom: 0;
background: #000;
opacity: 0.5;
z-index: 2;
&::before {
content: '';
position: absolute;
top:0;
right:0;
bottom:0;
left:0;
background: #aaa;
filter: blur(20px);
}
}
</style> </style>