剧本编制页面布局调整
This commit is contained in:
parent
7f907cc6ba
commit
2cf92690ec
@ -1,5 +1,4 @@
|
||||
<template>
|
||||
<<<<<<< HEAD
|
||||
<div class="reminder-drag">
|
||||
<div class="reminder-box" ref="drapBox" :style="{height:'100%'}">
|
||||
<div class="actionPane">
|
||||
@ -14,34 +13,6 @@
|
||||
<el-button type="success" @click="saveScenesData" :loading="isSavingScript" >{{$t('scriptRecord.saveData')}}</el-button>
|
||||
<!-- 暂停 -->
|
||||
</el-button-group>
|
||||
=======
|
||||
<div class="reminder-drag">
|
||||
<div ref="drapBox" class="reminder-box">
|
||||
<div class="tip-title">
|
||||
<i v-show="isShrink" class="icon el-icon-minus" @click="shrink" />
|
||||
<i v-show="!isShrink" class="icon el-icon-plus" @click="shrink" />
|
||||
<p v-if="isShrink" style="color: #fff;">
|
||||
<span>{{ title }}</span>
|
||||
</p>
|
||||
</div>
|
||||
<div ref="dragBody" class="tip-body-box">
|
||||
<div class="tip-body">
|
||||
<div>
|
||||
<get-action ref="getAction" :group="group" />
|
||||
</div>
|
||||
<!-- <el-button-group class="button-group1"> -->
|
||||
|
||||
<!-- </el-button-group> -->
|
||||
<el-button-group class="button-group">
|
||||
<el-button v-if="isPause" type="primary" :disabled="executeDisabled" @click="pauseScript">暂停</el-button>
|
||||
<el-button v-else type="primary" :disabled="executeDisabled" @click="executePlayScript">恢复并执行</el-button>
|
||||
<el-button type="primary" @click="saveMaplocation">{{ $t('scriptRecord.saveMaplocation') }}</el-button>
|
||||
<el-button type="danger" @click="dumpScenesData">重置剧本</el-button>
|
||||
<el-button type="primary" @click="saveScenesStage">{{ $t('scriptRecord.saveBackground') }}</el-button>
|
||||
<el-button type="success" :loading="isSavingScript" @click="saveScenesData">{{ $t('scriptRecord.saveData') }}</el-button>
|
||||
<!-- 暂停 -->
|
||||
</el-button-group>
|
||||
>>>>>>> e376b141cf53d9c5950d603ff5d56ba5bf5a610e
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -52,7 +23,6 @@ import Vue from 'vue';
|
||||
import GetAction from './scriptRecord/getAction';
|
||||
import {saveScriptScenes, saveScriptData, dumpScriptData, updateMapLocation, scriptPause, executeScript} from '@/api/simulation';
|
||||
|
||||
<<<<<<< HEAD
|
||||
export default {
|
||||
name: 'TipScriptRecord',
|
||||
props: {
|
||||
@ -200,149 +170,6 @@ import {saveScriptScenes, saveScriptData, dumpScriptData, updateMapLocation, scr
|
||||
}
|
||||
}
|
||||
}
|
||||
=======
|
||||
export default {
|
||||
name: 'TipScriptRecord',
|
||||
components: {
|
||||
GetAction
|
||||
},
|
||||
props: {
|
||||
group: {
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
// this.$t('scriptRecord.scriptTitle')
|
||||
data() {
|
||||
return {
|
||||
title: '剧本编制',
|
||||
isShrink: false,
|
||||
mapLocation: {},
|
||||
autoSaveScript: null,
|
||||
isSavingScript: false,
|
||||
isPause: false,
|
||||
executeDisabled: false
|
||||
// isSaveStage: true,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
},
|
||||
mounted() {
|
||||
this.initAutoSaveScript();
|
||||
this.shrink();
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.clearAutoSave();
|
||||
},
|
||||
methods: {
|
||||
jump(obj) {
|
||||
},
|
||||
shrink() {
|
||||
const height = this.$refs.dragBody.offsetHeight + 40;
|
||||
const top = this.$refs.drapBox.style.top;
|
||||
if (this.isShrink) {
|
||||
this.$refs.drapBox.style.height = '40px';
|
||||
this.$refs.drapBox.style.top = '';
|
||||
this.isShrink = false;
|
||||
} else {
|
||||
this.$refs.drapBox.style.height = height + 'px';
|
||||
this.$refs.drapBox.style.top = top;
|
||||
this.isShrink = true;
|
||||
}
|
||||
},
|
||||
setIsParse(isPause) {
|
||||
this.isPause=isPause;
|
||||
},
|
||||
setDisabled(data) {
|
||||
this.executeDisabled=!data;
|
||||
},
|
||||
initAutoSaveScript() {
|
||||
const timeout = 1000 * 20;
|
||||
this.clearAutoSave(this.autoSaveScript);
|
||||
this.autoSaveScript = setInterval(this.saveScenesData, timeout);
|
||||
},
|
||||
clearAutoSave() {
|
||||
if (this.autoSaveScript) {
|
||||
clearInterval(this.autoSaveScript);
|
||||
this.autoSaveScript = null;
|
||||
}
|
||||
},
|
||||
pauseScript() {
|
||||
scriptPause(this.group).then(resp => {
|
||||
// this.isSaveStage = false;
|
||||
this.$store.dispatch('scriptRecord/updateSimulationPause', true);
|
||||
// this.$message.success('暂停成功');
|
||||
}).catch(() => {
|
||||
this.$messageBox('暂停失败!');
|
||||
});
|
||||
},
|
||||
executePlayScript() {
|
||||
executeScript(this.group).then(resp => {
|
||||
// this.isSaveStage = false;
|
||||
this.$store.dispatch('scriptRecord/updateSimulationPause', false);
|
||||
// this.$message.success('暂停成功');
|
||||
}).catch(() => {
|
||||
this.$messageBox('恢复失败!');
|
||||
});
|
||||
},
|
||||
saveScenesStage() {
|
||||
saveScriptScenes(this.group).then(resp => {
|
||||
// this.isSaveStage = false;
|
||||
this.$message.success('保存背景成功');
|
||||
}).catch(() => {
|
||||
this.$messageBox('保存背景失败!');
|
||||
});
|
||||
},
|
||||
saveScenesData() {
|
||||
this.isSavingScript=true;
|
||||
saveScriptData(this.group).then(resp => {
|
||||
this.$message.success('保存数据成功');
|
||||
this.isSavingScript=false;
|
||||
this.initAutoSaveScript();
|
||||
}).catch(error => {
|
||||
this.$messageBox(`保存数据失败!: ${error.message}`);
|
||||
this.isSavingScript=false;
|
||||
if (error.code === 40004 || error.code === 40005 || error.code === 40003) {
|
||||
this.clearAutoSave();
|
||||
} else {
|
||||
this.initAutoSaveScript();
|
||||
}
|
||||
});
|
||||
},
|
||||
dumpScenesData() {
|
||||
this.clearAutoSave();
|
||||
const group=this.group;
|
||||
this.$confirm('此操作将会清除已保存的编制数据, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
dumpScriptData(group).then(resp => {
|
||||
// this.isSaveStage = true;
|
||||
this.$parent.resetBeginTime();
|
||||
this.$refs['getAction'].loadInitData();
|
||||
this.initAutoSaveScript();
|
||||
this.$message.success('清除数据成功');
|
||||
}).catch(() => {
|
||||
this.$messageBox('清除数据失败!');
|
||||
});
|
||||
}).catch(() => {
|
||||
this.initAutoSaveScript();
|
||||
});
|
||||
},
|
||||
saveMaplocation() {
|
||||
const data=Vue.prototype.$jlmap.$options;
|
||||
const group=this.$route.query.group;
|
||||
const dataZoom={scale: data.scaleRate, x: data.offsetX, y: data.offsetY};
|
||||
updateMapLocation(group, dataZoom).then(response=>{
|
||||
this.$message.success('更新定位成功');
|
||||
}).catch(error => {
|
||||
this.$messageBox(`更新定位失败: ${error.message}`);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
>>>>>>> e376b141cf53d9c5950d603ff5d56ba5bf5a610e
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
Loading…
Reference in New Issue
Block a user