修改代码格式

This commit is contained in:
zyy 2019-08-08 16:47:34 +08:00
parent a250833772
commit 6c5469ec90
16 changed files with 2235 additions and 2202 deletions

View File

@ -63,7 +63,8 @@ export default {
},
props: {
selected: {
type: Object
type: Object,
required: true
}
},
computed: {

View File

@ -99,7 +99,6 @@
<script>
import { mapGetters } from 'vuex';
import { TrainingMode, OperationEvent } from '@/scripts/ConstDic';
// import { OperateMode, checkOperationIsCurrentOperate } from '@/scripts/ConstDic';
import { menuBarConvert, SystemType } from './utils/menuItemStatus';
import StationControl from './menuDialog/stationControl';
import DetainTrainContorl from './menuDialog/detainTrainContorl';
@ -133,7 +132,8 @@ export default {
},
props: {
selected: {
type: Object
type: Object,
required: true
}
},
data() {

View File

@ -1,7 +1,10 @@
<template>
<div class="menu" style="height: 45px;" :style="{left: point.x+'px', top: point.y+'px' }" v-if="isShowBtn">
<button :style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
:id='Signal.arrangementRoute.button.domId' @click="buttonDown(Signal.arrangementRoute.button.operation)">
<div v-if="isShowBtn" class="menu" style="height: 45px;" :style="{left: point.x+'px', top: point.y+'px' }">
<button
:id="Signal.arrangementRoute.button.domId"
:style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
@click="buttonDown(Signal.arrangementRoute.button.operation)"
>
<span style="color: black">
<center>
<b></b>
@ -13,8 +16,11 @@
</center>
</span>
</button>
<button :style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
:id="Signal.cancelTrainRoute.button.domId" @click="buttonDown(Signal.cancelTrainRoute.button.operation)">
<button
:id="Signal.cancelTrainRoute.button.domId"
:style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
@click="buttonDown(Signal.cancelTrainRoute.button.operation)"
>
<span style="color: black">
<center>
<b></b>
@ -25,8 +31,11 @@
</center>
</span>
</button>
<button :style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
:id="Signal.humanTrainRoute.button.domId" @click="buttonDown(Signal.humanTrainRoute.button.operation)">
<button
:id="Signal.humanTrainRoute.button.domId"
:style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
@click="buttonDown(Signal.humanTrainRoute.button.operation)"
>
<span style="color: red">
<center>
<b></b>
@ -37,8 +46,11 @@
</center>
</span>
</button>
<button :style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
:id="Signal.reopenSignal.button.domId" @click="buttonDown(Signal.reopenSignal.button.operation)">
<button
:id="Signal.reopenSignal.button.domId"
:style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
@click="buttonDown(Signal.reopenSignal.button.operation)"
>
<span style="color: black">
<center>
<b></b>
@ -50,8 +62,11 @@
</center>
</span>
</button>
<button :style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
:id="Signal.guide.button.domId" @click="buttonDown(Signal.guide.button.operation)">
<button
:id="Signal.guide.button.domId"
:style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
@click="buttonDown(Signal.guide.button.operation)"
>
<span style="color: black">
<center>
<b></b>
@ -63,8 +78,11 @@
</center>
</span>
</button>
<button :style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}" id="mbm_06"
@click="buttonDown('mbm_06')">
<button
id="mbm_06"
:style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
@click="buttonDown('mbm_06')"
>
<span style="color: red">
<center>
<b></b>
@ -76,8 +94,11 @@
</center>
</span>
</button>
<button :style="{display: 'block', float: 'left', width: width+'px',backgroundColor:buttonUpColor}"
:id="Switch.locate.button.domId" @click="buttonDown(Switch.locate.button.operation)">
<button
:id="Switch.locate.button.domId"
:style="{display: 'block', float: 'left', width: width+'px',backgroundColor:buttonUpColor}"
@click="buttonDown(Switch.locate.button.operation)"
>
<span style="color: black">
<center>
<b></b>
@ -89,8 +110,11 @@
</center>
</span>
</button>
<button :style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
:id="Switch.reverse.button.domId" @click="buttonDown(Switch.reverse.button.operation)">
<button
:id="Switch.reverse.button.domId"
:style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
@click="buttonDown(Switch.reverse.button.operation)"
>
<span style="color: black">
<center>
<b></b>
@ -102,8 +126,11 @@
</center>
</span>
</button>
<button :style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
:id="Switch.lock.button.domId" @click="buttonDown(Switch.lock.button.operation)">
<button
:id="Switch.lock.button.domId"
:style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
@click="buttonDown(Switch.lock.button.operation)"
>
<span style="color: black">
<center>
<b></b>
@ -115,8 +142,11 @@
</center>
</span>
</button>
<button :style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
:id="Switch.unlock.button.domId" @click="buttonDown(Switch.unlock.button.operation)">
<button
:id="Switch.unlock.button.domId"
:style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
@click="buttonDown(Switch.unlock.button.operation)"
>
<span style="color: red">
<center>
<b></b>
@ -128,8 +158,11 @@
</center>
</span>
</button>
<button :style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
:id="Signal.setAutoInterlock.button.domId" @click="buttonDown(Signal.setAutoInterlock.button.operation)">
<button
:id="Signal.setAutoInterlock.button.domId"
:style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
@click="buttonDown(Signal.setAutoInterlock.button.operation)"
>
<span style="color: black">
<center>
<b></b>
@ -141,8 +174,11 @@
</center>
</span>
</button>
<button :style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
:id="Section.fault.button.domId" @click="buttonDown(Section.fault.button.operation)">
<button
:id="Section.fault.button.domId"
:style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
@click="buttonDown(Section.fault.button.operation)"
>
<span style="color: black">
<center>
<b></b>
@ -153,8 +189,11 @@
</center>
</span>
</button>
<button :style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
:id="Section.axlePreReset.button.domId" @click="buttonDown(Section.axlePreReset.button.operation)">
<button
:id="Section.axlePreReset.button.domId"
:style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
@click="buttonDown(Section.axlePreReset.button.operation)"
>
<span style="color: black">
<center>
<b></b>
@ -166,8 +205,11 @@
</center>
</span>
</button>
<button :style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}" id="mbm_11"
@click="buttonDown('mbm_11')">
<button
id="mbm_11"
:style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
@click="buttonDown('mbm_11')"
>
<span style="color: black">
<center>
<b style="color:deepskyblue"></b>
@ -179,8 +221,11 @@
</center>
</span>
</button>
<button :style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}" id="mbm_12"
@click="buttonDown('mbm_12')">
<button
id="mbm_12"
:style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
@click="buttonDown('mbm_12')"
>
<span style="color: black">
<center>
<b></b>
@ -196,15 +241,13 @@
</template>
<script>
import { MapDeviceType, OperationEvent, getDomIdByOperation } from '@/scripts/ConstDic';
import { getDomOffset } from '@/utils/index';
import OperateHandler from '@/scripts/plugin/trainingOperateHandler';
import { MapDeviceType, OperationEvent, getDomIdByOperation } from '@/scripts/ConstDic';
import OperateHandler from '@/scripts/plugin/trainingOperateHandler';
export default {
export default {
name: 'MapButtonMenu',
data() {
return {
__type: 'mbm',
point: {
x: -1000,
y: -1000
@ -215,8 +258,8 @@
buttonUpColor: '#DCDCDC',
width: 58,
tempData: null,
offset: {},
}
offset: {}
};
},
computed: {
Switch() {
@ -241,7 +284,7 @@
},
'$store.state.menuOperation.selectedCount': function (val) {
this.selectedChange();
},
}
},
mounted() {
this.resetPosition();
@ -249,19 +292,19 @@
methods: {
resetPosition() {
this.$nextTick(() => {
let canvasOffset = this.$store.state.config.canvasOffset;
const canvasOffset = this.$store.state.config.canvasOffset;
this.point = {
x: canvasOffset.x + 20,
y: canvasOffset.y + this.$store.state.config.height - 65
}
};
this.$store.dispatch('training/tipReload');
})
});
},
updateButtonShow(val, old) {
if (old) {
//
let domId = getDomIdByOperation(old);
let dom = document.getElementById(domId);
const domId = getDomIdByOperation(old);
const dom = document.getElementById(domId);
if (dom) {
dom.disabled = false;
dom.style.backgroundColor = this.buttonUpColor;
@ -269,8 +312,8 @@
}
if (val) {
//
let domId = getDomIdByOperation(val);
let dom = document.getElementById(domId);
const domId = getDomIdByOperation(val);
const dom = document.getElementById(domId);
if (dom) {
dom.disabled = true;
dom.style.backgroundColor = this.buttonDownColor;
@ -278,10 +321,10 @@
}
},
buttonDown(operation) {
let operate = {
const operate = {
type: 'mbm',
operation: operation
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/setButtonOperation', operation); //
@ -293,17 +336,17 @@
selectedChange() {
//
if (this.$store.state.menuOperation.buttonOperation) {
let model = this.$store.state.menuOperation.selected;
const model = this.$store.state.menuOperation.selected;
if (model) {
let deviceType = MapDeviceType[model._type];
let operate = {
const deviceType = MapDeviceType[model._type];
const operate = {
send: true,
model: model,
code: model.code,
type: deviceType.type,
operation: this.$store.state.menuOperation.buttonOperation,
tempData: this.tempData
}
};
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
if (valid) {
@ -319,7 +362,7 @@
}
}
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
$bg: #fff;

View File

@ -6,12 +6,10 @@
<script>
import PopMenu from '@/components/PopMenu';
// import OperateHandler from '@/scripts/plugin/trainingOperateHandler';
import { mapGetters } from 'vuex';
import { DeviceMenu } from '@/scripts/ConstDic';
import { exitFullscreen } from '@/utils/screen';
import { runDiagramQuit } from '@/api/simulation';
// import { screenTopic, clearSubscribe } from '@/utils/stomp';
import { EventBus } from '@/scripts/event-bus';
export default {
@ -56,7 +54,7 @@ export default {
watch: {
'$store.state.menuOperation.buttonOperation': function (val, old) {
if (!this.isScreen && this.menu && this.menu.length > 1) {
this.menu[0].disabled = (this.menu[0] && val) ? true : true;
this.menu[0].disabled = true;
this.menu[1].disabled = !((this.menu[1] && val));
}
},

View File

@ -1,28 +1,28 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu"></pop-menu>
<cancel-all-limit ref="cancelAllLimit"></cancel-all-limit>
<pop-menu ref="popMenu" :menu="menu" />
<cancel-all-limit ref="cancelAllLimit" />
</div>
</template>
<script>
import PopMenu from '@/components/PopMenu';
import CancelAllLimit from './dialog/cancelAllLimit';
import { mapGetters } from 'vuex';
import { TrainingMode, OperateMode } from '@/scripts/ConstDic';
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
import { MenuDisabledState, menuConvert, menuFiltration } from './utils/menuItemStatus';
import { mouseCancelState } from './utils/menuItemStatus';
import PopMenu from '@/components/PopMenu';
import CancelAllLimit from './dialog/cancelAllLimit';
import { mapGetters } from 'vuex';
import { OperateMode } from '@/scripts/ConstDic';
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
import { MenuDisabledState } from './utils/menuItemStatus';
export default {
export default {
name: 'MenuLimit',
components: {
PopMenu,
CancelAllLimit,
CancelAllLimit
},
props: {
selected: {
type: Object
type: Object,
required: true
}
},
data() {
@ -50,17 +50,8 @@
auth: { station: false, center: true }
}
]
},
}
},
watch: {
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.LimitControl) && !this.buttonOperation) {
this.doShow(this.$store.state.menuOperation.menuPosition);
} else {
this.doClose();
}
}
};
},
computed: {
...mapGetters('training', [
@ -71,17 +62,26 @@
'buttonOperation'
])
},
methods: {
clickEvent() {
let self = this;
window.onclick = function (e) {
self.doClose();
watch: {
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.LimitControl) && !this.buttonOperation) {
this.doShow(this.$store.state.menuOperation.menuPosition);
} else {
this.doClose();
}
}
},
methods: {
clickEvent() {
const self = this;
window.onclick = function (e) {
self.doClose();
};
},
initMenu() {
//
//
if (this.operatemode === OperateMode.ADMIN) {
this.menu = [...this.menu]
this.menu = [...this.menu];
}
},
doShow(point) {
@ -96,9 +96,9 @@
this.$refs.popMenu.close();
}
},
//
//
cancelSpeed() {
let operate = {
const operate = {
start: true,
send: true,
code: this.selected.code,
@ -112,7 +112,7 @@
this.$refs.cancelAllLimit.doShow(operate, this.selected);
}
});
},
}
}
};
</script>

View File

@ -1,32 +1,32 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu"></pop-menu>
<section-control ref="sectionControl"></section-control>
<section-cmd-control ref="sectionCmdControl"></section-cmd-control>
<speed-limit-control ref="speedLimitControl"></speed-limit-control>
<speed-cmd-control ref="speedCmdControl"></speed-cmd-control>
<train-create ref="trainCreate"></train-create>
<alxe-effective ref="alxeEffective"></alxe-effective>
<notice-info ref="noticeInfo"></notice-info>
<pop-menu ref="popMenu" :menu="menu" />
<section-control ref="sectionControl" />
<section-cmd-control ref="sectionCmdControl" />
<speed-limit-control ref="speedLimitControl" />
<speed-cmd-control ref="speedCmdControl" />
<train-create ref="trainCreate" />
<alxe-effective ref="alxeEffective" />
<notice-info ref="noticeInfo" />
</div>
</template>
<script>
import PopMenu from '@/components/PopMenu';
import SectionControl from './dialog/sectionControl';
import SectionCmdControl from './dialog/sectionCmdControl';
import SpeedCmdControl from './dialog/speedCmdControl';
import SpeedLimitControl from './dialog/speedLimitControl';
import TrainCreate from './dialog/trainCreate';
import AlxeEffective from './dialog/alxeEffective';
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo'
import { mapGetters } from 'vuex';
import { TrainingMode, OperateMode } from '@/scripts/ConstDic';
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
import { MenuDisabledState, menuConvert, menuFiltration } from './utils/menuItemStatus';
import { mouseCancelState } from './utils/menuItemStatus';
import PopMenu from '@/components/PopMenu';
import SectionControl from './dialog/sectionControl';
import SectionCmdControl from './dialog/sectionCmdControl';
import SpeedCmdControl from './dialog/speedCmdControl';
import SpeedLimitControl from './dialog/speedLimitControl';
import TrainCreate from './dialog/trainCreate';
import AlxeEffective from './dialog/alxeEffective';
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
import { mapGetters } from 'vuex';
import { OperateMode } from '@/scripts/ConstDic';
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
import { MenuDisabledState, menuConvert, menuFiltration } from './utils/menuItemStatus';
import { mouseCancelState } from './utils/menuItemStatus';
export default {
export default {
name: 'SectionMenu',
components: {
PopMenu,
@ -40,7 +40,8 @@
},
props: {
selected: {
type: Object
type: Object,
required: true
}
},
data() {
@ -130,7 +131,7 @@
handler: this.undeveloped,
disabledCallback: MenuDisabledState.Section.setSpeed,
auth: { station: false, center: true }
},
}
]
},
menuTrain: [
@ -138,7 +139,7 @@
label: '新建列车',
handler: this.newTrain,
disabledCallback: MenuDisabledState.Section.newTrain
},
}
],
menuForce: [
{
@ -147,7 +148,7 @@
disabledCallback: MenuDisabledState.Section.alxeFailure
}
]
}
};
},
watch: {
'$store.state.menuOperation.menuCount': function (val) {
@ -169,21 +170,21 @@
},
methods: {
clickEvent() {
let self = this;
const self = this;
window.onclick = function (e) {
self.doClose();
}
};
},
initMenu() {
//
//
this.menu = menuFiltration(this.menuNormal);
if (this.operatemode === OperateMode.ADMIN) {
this.menu = [...this.menu, ...this.menuForce, ...this.menuTrain]
this.menu = [...this.menu, ...this.menuForce, ...this.menuTrain];
}
//
//
if (this.operatemode === OperateMode.FAULT) {
this.menu = this.menuForce
this.menu = this.menuForce;
}
this.menu = menuConvert(this.menu);
@ -200,9 +201,9 @@
this.$refs.popMenu.close();
}
},
//
//
alxeFailure() {
let operate = {
const operate = {
start: true,
send: true,
code: this.selected.code,
@ -218,13 +219,13 @@
} else {
this.$refs.noticeInfo.doShow(operate);
}
}).catch(error => {
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
})
});
},
//
//
fault() {
let operate = {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Section.type,
@ -247,9 +248,9 @@
}
});
},
//
//
split() {
let operate = {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Section.type,
@ -264,7 +265,7 @@
});
},
alxeEffective() {
let operate = {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Section.type,
@ -278,9 +279,9 @@
}
});
},
//
//
active() {
let operate = {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Section.type,
@ -294,9 +295,9 @@
}
});
},
//
//
axlePreReset() {
let operate = {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Section.type,
@ -310,9 +311,9 @@
}
});
},
//
//
lock() {
let operate = {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Section.type,
@ -326,9 +327,9 @@
}
});
},
//
//
unlock() {
let operate = {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Section.type,
@ -342,7 +343,7 @@
}
});
},
//
//
setSpeed() {
// let operate = {
// start: true,
@ -357,7 +358,7 @@
// this.$refs.speedCmdControl.doShow(operate, this.selected);
// }
// });
let operate = {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Section.type,
@ -371,7 +372,7 @@
}
});
},
//
//
// cancelSpeed() {
// let operate = {
// start: true,
@ -389,9 +390,9 @@
// }
// });
// },
//
//
newTrain() {
let operate = {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Section.type,
@ -403,8 +404,8 @@
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainCreate.doShow(operate, this.selected);
}
})
}
});
}
}
};
</script>

View File

@ -1,32 +1,32 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu"></pop-menu>
<route-selection ref="routeSelection"></route-selection>
<route-lock ref="routeLock"></route-lock>
<route-control ref="routeControl"></route-control>
<route-cmd-control ref="routeCmdControl"></route-cmd-control>
<route-hand-control ref="routeHandControl"></route-hand-control>
<route-detail ref="routeDetail"></route-detail>
<notice-info ref="noticeInfo"></notice-info>
<pop-menu ref="popMenu" :menu="menu" />
<route-selection ref="routeSelection" />
<route-lock ref="routeLock" />
<route-control ref="routeControl" />
<route-cmd-control ref="routeCmdControl" />
<route-hand-control ref="routeHandControl" />
<route-detail ref="routeDetail" />
<notice-info ref="noticeInfo" />
</div>
</template>
<script>
import PopMenu from '@/components/PopMenu';
import RouteControl from './dialog/routeControl';
import RouteSelection from './dialog/routeSelection';
import RouteLock from './dialog/routeLock';
import RouteCmdControl from './dialog/routeCmdControl';
import RouteHandControl from './dialog/routeHandControl';
import RouteDetail from './dialog/routeDetail';
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo'
import { mapGetters } from 'vuex';
import { TrainingMode, OperateMode } from '@/scripts/ConstDic';
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
import { MenuDisabledState, menuConvert, menuFiltration } from './utils/menuItemStatus';
import { mouseCancelState } from './utils/menuItemStatus';
import PopMenu from '@/components/PopMenu';
import RouteControl from './dialog/routeControl';
import RouteSelection from './dialog/routeSelection';
import RouteLock from './dialog/routeLock';
import RouteCmdControl from './dialog/routeCmdControl';
import RouteHandControl from './dialog/routeHandControl';
import RouteDetail from './dialog/routeDetail';
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
import { mapGetters } from 'vuex';
import { OperateMode } from '@/scripts/ConstDic';
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
import { MenuDisabledState, menuConvert, menuFiltration } from './utils/menuItemStatus';
import { mouseCancelState } from './utils/menuItemStatus';
export default {
export default {
name: 'SignalMenu',
components: {
PopMenu,
@ -40,7 +40,8 @@
},
props: {
selected: {
type: Object
type: Object,
required: true
}
},
data() {
@ -52,19 +53,19 @@
label: '排列进路',
handler: this.arrangementRoute,
disabledCallback: MenuDisabledState.Signal.arrangementRoute,
auth: { station: false, center: true },
auth: { station: false, center: true }
},
{
label: '取消进路',
handler: this.cancelTrainRoute,
disabledCallback: MenuDisabledState.Signal.cancelTrainRoute,
auth: { station: false, center: true },
auth: { station: false, center: true }
},
{
label: '信号重开',
handler: this.reopenSignal,
disabledCallback: MenuDisabledState.Signal.reopenSignal,
auth: { station: false, center: true },
auth: { station: false, center: true }
},
{
type: 'separator'
@ -73,19 +74,19 @@
label: '进路交人工控',
handler: this.humanControl,
disabledCallback: MenuDisabledState.Signal.humanControl,
auth: { station: false, center: true },
auth: { station: false, center: true }
},
{
label: '进路交自动控',
handler: this.atsAutoControl,
disabledCallback: MenuDisabledState.Signal.atsAutoControl,
auth: { station: false, center: true },
auth: { station: false, center: true }
},
{
label: '查询进路控制状态',
handler: this.detail,
disabledCallback: MenuDisabledState.Signal.detail,
auth: { station: true, center: true },
auth: { station: true, center: true }
}
],
central: [
@ -93,19 +94,19 @@
label: '排列进路',
handler: this.arrangementRoute,
disabledCallback: MenuDisabledState.Signal.arrangementRoute,
auth: { station: false, center: true },
auth: { station: false, center: true }
},
{
label: '取消进路',
handler: this.cancelTrainRoute,
disabledCallback: MenuDisabledState.Signal.cancelTrainRoute,
auth: { station: false, center: true },
auth: { station: false, center: true }
},
{
label: '信号重开',
handler: this.reopenSignal,
disabledCallback: MenuDisabledState.Signal.reopenSignal,
auth: { station: false, center: true },
auth: { station: false, center: true }
},
{
type: 'separator'
@ -114,27 +115,27 @@
label: '进路交人工控',
handler: this.humanControl,
disabledCallback: MenuDisabledState.Signal.humanControl,
auth: { station: false, center: true },
auth: { station: false, center: true }
},
{
label: '进路交自动控',
handler: this.atsAutoControl,
disabledCallback: MenuDisabledState.Signal.atsAutoControl,
auth: { station: false, center: true },
auth: { station: false, center: true }
},
{
label: '查询进路控制状态',
handler: this.detail,
disabledCallback: MenuDisabledState.Signal.detail,
auth: { station: true, center: true },
auth: { station: true, center: true }
}
],
]
},
menuForce: [
{
label: '信号关灯',
handler: this.signalClose,
disabledCallback: '',
disabledCallback: ''
},
{
label: '设置故障',
@ -147,7 +148,7 @@
disabledCallback: MenuDisabledState.Signal.cancelStoppage
}
]
}
};
},
watch: {
'$store.state.menuOperation.menuCount': function (val) {
@ -169,21 +170,21 @@
},
methods: {
clickEvent() {
let self = this;
const self = this;
window.onclick = function (e) {
self.doClose();
}
};
},
initMenu() {
//
//
this.menu = menuFiltration(this.menuNormal);
if (this.operatemode === OperateMode.ADMIN) {
this.menu = [...this.menu, ...this.menuForce]
this.menu = [...this.menu, ...this.menuForce];
}
//
//
if (this.operatemode === OperateMode.FAULT) {
this.menu = this.menuForce
this.menu = this.menuForce;
}
this.menu = menuConvert(this.menu);
@ -201,9 +202,9 @@
this.$refs.popMenu.close();
}
},
//
//
setStoppage() {
let operate = {
const operate = {
start: true,
send: true,
code: this.selected.code,
@ -219,13 +220,13 @@
} else {
this.$refs.noticeInfo.doShow(operate);
}
}).catch(error => {
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
})
});
},
//
//
cancelStoppage() {
let operate = {
const operate = {
start: true,
send: true,
code: this.selected.code,
@ -241,13 +242,13 @@
} else {
this.$refs.noticeInfo.doShow(operate);
}
}).catch(error => {
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
})
});
},
//
arrangementRoute() {
let operate = {
const operate = {
start: true,
send: true,
model: this.selected,
@ -255,7 +256,7 @@
type: MapDeviceType.Signal.type,
label: MapDeviceType.Signal.label,
operation: OperationEvent.Signal.arrangementRoute.menu.operation
}
};
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
@ -266,13 +267,13 @@
}
this.$refs.routeSelection.doShow(operate.operation, this.selected, tempData);
}
}).catch(error => {
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
})
});
},
//
//
cancelTrainRoute() {
let operate = {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Signal.type,
@ -286,9 +287,9 @@
}
});
},
//
//
lock() {
let operate = {
const operate = {
start: true,
send: true,
code: this.selected.code,
@ -302,13 +303,13 @@
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.routeLock.doShow(operate.operation, this.selected);
}
}).catch(error => {
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
})
});
},
//
//
unlock() {
let operate = {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Signal.type,
@ -322,9 +323,9 @@
}
});
},
//
//
reopenSignal() {
let operate = {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Signal.type,
@ -338,9 +339,9 @@
}
});
},
//
//
guide() {
let operate = {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Signal.type,
@ -354,9 +355,9 @@
}
});
},
//
//
setAutoInterlock() {
let operate = {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Signal.type,
@ -370,9 +371,9 @@
}
});
},
//
//
cancelAutoInterlock() {
let operate = {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Signal.type,
@ -386,9 +387,9 @@
}
});
},
//
//
setAutoTrigger() {
let operate = {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Signal.type,
@ -402,9 +403,9 @@
}
});
},
//
//
cancelAutoTrigger() {
let operate = {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Signal.type,
@ -418,9 +419,9 @@
}
});
},
//
//
signalClose() {
let operate = {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Signal.type,
@ -434,9 +435,9 @@
}
});
},
//
//
humanControl() {
let operate = {
const operate = {
start: true,
send: true,
code: this.selected.code,
@ -455,9 +456,9 @@
}
});
},
//
//
atsAutoControl() {
let operate = {
const operate = {
start: true,
send: true,
code: this.selected.code,
@ -476,9 +477,9 @@
}
});
},
//
//
detail() {
let operate = {
const operate = {
start: true,
send: true,
code: this.selected.code,
@ -494,5 +495,5 @@
});
}
}
}
};
</script>

View File

@ -31,7 +31,8 @@ export default {
},
props: {
selected: {
type: Object
type: Object,
required: true
}
},
data() {

View File

@ -5,10 +5,7 @@
<script>
import PopMenu from '@/components/PopMenu';
import { mapGetters } from 'vuex';
// import { TrainingMode, OperateMode } from '@/scripts/ConstDic';
import { DeviceMenu } from '@/scripts/ConstDic';
// import { MenuDisabledState, menuConvert } from './utils/menuItemStatus';
// import { mouseCancelState } from './utils/menuItemStatus';
export default {
name: 'StationControlMenu',
@ -17,7 +14,8 @@ export default {
},
props: {
selected: {
type: Object
type: Object,
required: true
}
},
data() {

View File

@ -43,7 +43,8 @@ export default {
},
props: {
selected: {
type: Object
type: Object,
required: true
}
},
data() {

View File

@ -1,32 +1,32 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu"></pop-menu>
<section-control ref="sectionControl"></section-control>
<switch-control ref="switchControl"></switch-control>
<switch-cmd-control ref="switchCmdControl"></switch-cmd-control>
<speed-cmd-control ref="speedCmdControl"></speed-cmd-control>
<speed-limit-control ref="speedLimitControl"></speed-limit-control>
<alxe-effective ref="alxeEffective"></alxe-effective>
<notice-info ref="noticeInfo"></notice-info>
<pop-menu ref="popMenu" :menu="menu" />
<section-control ref="sectionControl" />
<switch-control ref="switchControl" />
<switch-cmd-control ref="switchCmdControl" />
<speed-cmd-control ref="speedCmdControl" />
<speed-limit-control ref="speedLimitControl" />
<alxe-effective ref="alxeEffective" />
<notice-info ref="noticeInfo" />
</div>
</template>
<script>
import PopMenu from '@/components/PopMenu';
import SectionControl from './dialog/sectionControl';
import SwitchControl from './dialog/switchControl';
import SwitchCmdControl from './dialog/switchCmdControl';
import SpeedCmdControl from './dialog/speedCmdControl';
import SpeedLimitControl from './dialog/speedLimitControl';
import AlxeEffective from './dialog/alxeEffective';
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo'
import { mapGetters } from 'vuex';
import { TrainingMode, OperateMode } from '@/scripts/ConstDic';
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
import { MenuDisabledState, menuConvert, menuFiltration } from './utils/menuItemStatus';
import { mouseCancelState } from './utils/menuItemStatus';
import PopMenu from '@/components/PopMenu';
import SectionControl from './dialog/sectionControl';
import SwitchControl from './dialog/switchControl';
import SwitchCmdControl from './dialog/switchCmdControl';
import SpeedCmdControl from './dialog/speedCmdControl';
import SpeedLimitControl from './dialog/speedLimitControl';
import AlxeEffective from './dialog/alxeEffective';
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
import { mapGetters } from 'vuex';
import { OperateMode } from '@/scripts/ConstDic';
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
import { MenuDisabledState, menuConvert, menuFiltration } from './utils/menuItemStatus';
import { mouseCancelState } from './utils/menuItemStatus';
export default {
export default {
name: 'SwitchMenu',
components: {
PopMenu,
@ -40,7 +40,8 @@
},
props: {
selected: {
type: Object
type: Object,
required: true
}
},
data() {
@ -59,7 +60,7 @@
handler: this.active,
disabledCallback: MenuDisabledState.Switch.active,
auth: { station: true, center: true }
},
}
],
central: [
{
@ -121,7 +122,7 @@
}
}
]
}
};
},
watch: {
'$store.state.menuOperation.menuCount': function (val) {
@ -143,21 +144,21 @@
},
methods: {
clickEvent() {
let self = this;
const self = this;
window.onclick = function (e) {
self.doClose();
}
};
},
initMenu() {
//
//
this.menu = menuFiltration(this.menuNormal);
if (this.operatemode === OperateMode.ADMIN) {
this.menu = [...this.menu, ...this.menuForce]
this.menu = [...this.menu, ...this.menuForce];
}
//
//
if (this.operatemode === OperateMode.FAULT) {
this.menu = this.menuForce
this.menu = this.menuForce;
}
this.menu = menuConvert(this.menu);
@ -174,9 +175,9 @@
this.$refs.popMenu.close();
}
},
//
//
setStoppage() {
let operate = {
const operate = {
start: true,
send: true,
code: this.selected.code,
@ -192,13 +193,13 @@
} else {
this.$refs.noticeInfo.doShow(operate);
}
}).catch(error => {
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
})
});
},
//
//
cancelStoppage() {
let operate = {
const operate = {
start: true,
send: true,
code: this.selected.code,
@ -214,13 +215,13 @@
} else {
this.$refs.noticeInfo.doShow(operate);
}
}).catch(error => {
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
})
});
},
//
//
lock() {
let operate = {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Switch.type,
@ -234,9 +235,9 @@
}
});
},
//
//
unlock() {
let operate = {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Switch.type,
@ -250,9 +251,9 @@
}
});
},
//
//
block() {
let operate = {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Switch.type,
@ -266,9 +267,9 @@
}
});
},
//
//
unblock() {
let operate = {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Switch.type,
@ -282,9 +283,9 @@
}
});
},
//
//
switchTurnoutForce() {
let operate = {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Switch.type,
@ -298,9 +299,9 @@
}
});
},
//
//
switchTurnout() {
let operate = {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Switch.type,
@ -317,9 +318,9 @@
});
}
},
//
//
fault() {
let operate = {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Switch.type,
@ -333,9 +334,9 @@
}
});
},
//
//
cancelSpeed() {
let operate = {
const operate = {
start: true,
send: true,
code: this.selected.code,
@ -345,16 +346,16 @@
};
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
if (valid) {
let tempData = response.data;
const tempData = response.data;
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.speedCmdControl.doShow(operate, this.selected, tempData);
}
});
},
//
//
split() {
let operate = {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Switch.type,
@ -368,9 +369,9 @@
}
});
},
//
//
active() {
let operate = {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Switch.type,
@ -384,9 +385,9 @@
}
});
},
//
//
axlePreReset() {
let operate = {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Switch.type,
@ -400,9 +401,9 @@
}
});
},
//
//
setSpeed() {
let operate = {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Switch.type,
@ -416,9 +417,9 @@
}
});
},
//
//
alxeEffective() {
let operate = {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Switch.type,
@ -439,7 +440,7 @@
callback: action => {
}
});
},
}
}
};
</script>

View File

@ -1,33 +1,30 @@
<template>
<div id="menuTool">
<div class="nav">
<div class="tool" v-for="(item,index) in tools" :key="index">
<img :src="item.src" :alt="item.title" />
<div v-for="(item,index) in tools" :key="index" class="tool">
<img :src="item.src" :alt="item.title">
</div>
<img class="logo" :src="logoImg" />
<system-time class="time" v-if="isShowSystemTime" :time="time" :zoom="2" :width="180" :height="48" :fine="2" :top="6"></system-time>
<img class="logo" :src="logoImg">
<system-time v-if="isShowSystemTime" class="time" :time="time" :zoom="2" :width="180" :height="48" :fine="2" :top="6" />
</div>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, TrainingMode, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
import { OperateMode } from '@/scripts/ConstDic';
import { prefixIntrger } from '@/utils/date';
import SystemTime from '@/views/components/systemTime/index';
import logo_ from '@/assets/logo_.png';
import { prefixIntrger } from '@/utils/date';
import SystemTime from '@/views/components/systemTime/index';
import logo_ from '@/assets/logo_.png';
export default {
export default {
name: 'MenuTool',
props: {
selected: {
type: Object
}
},
components: {
SystemTime
},
props: {
selected: {
type: Object,
required: true
}
},
data() {
return {
logoImg: logo_,
@ -37,100 +34,100 @@
title: '服务器1',
operate: '',
src: logo_,
click: this.undeveloped,
click: this.undeveloped
},
{
title: '服务器2',
operate: '',
src: '',
click: this.undeveloped,
click: this.undeveloped
},
{
title: '前置机1',
operate: '',
src: '',
click: this.undeveloped,
click: this.undeveloped
},
{
title: '前置机2',
operate: '',
src: '',
click: this.undeveloped,
click: this.undeveloped
},
{
title: '主调',
operate: '',
src: '',
click: this.undeveloped,
click: this.undeveloped
},
{
title: '调度台1',
operate: '',
src: '',
click: this.undeveloped,
click: this.undeveloped
},
{
title: '调度台2',
operate: '',
src: '',
click: this.undeveloped,
click: this.undeveloped
},
{
title: '调度台3',
operate: '',
src: '',
click: this.undeveloped,
click: this.undeveloped
},
{
title: '大屏',
operate: '',
src: '',
click: this.undeveloped,
click: this.undeveloped
},
{
title: '维护工作站',
operate: '',
src: '',
click: this.undeveloped,
click: this.undeveloped
},
{
title: '运行图显示人工站',
operate: '',
src: '',
click: this.undeveloped,
click: this.undeveloped
},
{
title: '跳停',
operate: '',
src: '',
click: this.undeveloped,
click: this.undeveloped
},
{
title: '扣车',
operate: '',
src: '',
click: this.undeveloped,
click: this.undeveloped
},
{
title: '列车报警',
operate: '',
src: logo_,
click: this.undeveloped,
click: this.undeveloped
}
]
}
},
watch: {
'$store.state.training.initTime': function (initTime) {
let date = new Date(initTime);
this.time = `${prefixIntrger(date.getHours(), 2)}:${prefixIntrger(date.getMinutes(), 2)}${prefixIntrger(date.getSeconds(), 2)}`
}
};
},
computed: {
isShowSystemTime() {
return this.$route.params.mode == 'demon' || this.$route.params.mode === 'dp' || !this.$route.params.mode;
}
},
watch: {
'$store.state.training.initTime': function (initTime) {
const date = new Date(initTime);
this.time = `${prefixIntrger(date.getHours(), 2)}:${prefixIntrger(date.getMinutes(), 2)}${prefixIntrger(date.getSeconds(), 2)}`;
}
},
mounted() {
this.initTools();
},
@ -139,10 +136,10 @@
this.tools = [];
}
}
}
};
</script>
<style scoped rel="stylesheet/scss" lang="scss" scoped>
<style scoped rel="stylesheet/scss" lang="scss">
@import "src/styles/mixin.scss";
$top: 30px;
$width: 50px;
@ -186,7 +183,6 @@
}
}
.time {
position: relative;
float: right;

View File

@ -55,7 +55,8 @@ export default {
},
props: {
selected: {
type: Object
type: Object,
required: true
}
},
data() {

View File

@ -1,31 +1,24 @@
<template>
<div id="statusBar"></div>
<div id="statusBar" />
</template>
<script>
export default {
export default {
name: 'StatusBar',
props: {
selected: {
type: Object
type: Object,
required: true
}
},
data() {
return {
}
};
},
mounted() {
}
}
};
</script>
<style>
#statusBar {
z-index: 2000;
position: absolute;
height: $height;
line-height: $height;
border-radius: 0px !important;
top: 0px;
left: 0px;
}
</style>

View File

@ -1,50 +1,52 @@
<template>
<div v-show="show" class="progressShade" :style="{background: background}">
<el-progress class="progressBar"
<el-progress
class="progressBar"
:type="type"
:show-text="showText"
:text-inside="textInside"
:stroke-width="strokeWidth"
:percentage="percentage"
:color="color"
:status="status" ></el-progress>
:status="status"
/>
</div>
</template>
<script>
import { requestAnimationFrame, cancelRequestAnimFrame } from '@/jmap/utils/animation';
import { requestAnimationFrame, cancelRequestAnimFrame } from '@/jmap/utils/animation';
export default {
export default {
name: 'ProgressBar',
props: {
type: {
type: String,
default() {
return 'line'
return 'line';
}
},
showText: {
type: Boolean,
default() {
return true
return true;
}
},
textInside: {
type: Boolean,
default() {
return false
return false;
}
},
strokeWidth: {
type: Number,
default() {
return 5
return 5;
}
},
background: {
type: String,
default() {
return 'rgba(0, 0, 0, 0.8)'
return 'rgba(0, 0, 0, 0.8)';
}
}
},
@ -55,25 +57,25 @@
show: true,
percentage: 0,
fps: 30,
then: null,
}
then: null
};
},
mounted() {
this.percentage = this.randomNum();
},
methods: {
randomNum() {
return Math.ceil(Math.random() * 5) + 50
return Math.ceil(Math.random() * 5) + 50;
},
run() {
let now = +Date.now();
let delta = now - this.then || +Date.now();
let interval = 1000 / this.fps;
const now = +Date.now();
const delta = now - this.then || +Date.now();
const interval = 1000 / this.fps;
if (delta > interval) {
this.then = now - (delta % interval);
if (this.percentage < 90) {
this.percentage = this.percentage + 5
this.percentage = this.percentage + 5;
} else {
cancelRequestAnimFrame(this.run);
}
@ -101,7 +103,7 @@
},
progressAt(num) {
if (num > 0 && num < 100 && num > this.percentage) {
this.percentage = num
this.percentage = num;
}
},
success() {
@ -118,7 +120,7 @@
}, 1000 / this.fps);
}
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";

View File

@ -1,29 +1,29 @@
<template>
<div class="reminder-drag">
<div class="reminder-box" ref="drapBox">
<div ref="drapBox" class="reminder-box">
<div class="tip-title">
<i class="icon el-icon-minus" @click="shrink" v-show="isShrink"></i>
<i class="icon el-icon-plus" @click="shrink" v-show="!isShrink"></i>
<p style="color: #fff;" v-if="isShrink">
<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 class="tip-body-box" ref="dragBody">
<div ref="dragBody" class="tip-body-box">
<div class="tip-body">
<template v-if="displayType=='role'">
<role-condition-script :group="group" @getBehaviorList="getBehaviorList"></role-condition-script>
<role-condition-script :group="group" @getBehaviorList="getBehaviorList" />
</template>
<template v-if="displayType=='behavior'">
<div class="tab-pane-big">
<el-scrollbar wrapClass="scrollbar-wrapper" ref="elScrollbar">
<get-behavior ref="getBehavior" :group="group" :memberId="memberId" @backToMember="backToMember" @getActions="getActions" @backToTop="backToTop"></get-behavior>
<el-scrollbar ref="elScrollbar" wrap-class="scrollbar-wrapper">
<get-behavior ref="getBehavior" :group="group" :member-id="memberId" @backToMember="backToMember" @getActions="getActions" @backToTop="backToTop" />
</el-scrollbar>
</div>
</template>
<template v-if="displayType=='action'">
<div class="tab-pane-big">
<el-scrollbar wrapClass="scrollbar-wrapper" ref="elActionScrollbar">
<get-action ref="getAction" :group="group" :memberId="memberId" :behaviorId="behaviorId" @backToBehavior="backToBehavior" @backToTop="backToActionTop"></get-action>
<el-scrollbar ref="elActionScrollbar" wrap-class="scrollbar-wrapper">
<get-action ref="getAction" :group="group" :member-id="memberId" :behavior-id="behaviorId" @backToBehavior="backToBehavior" @backToTop="backToActionTop" />
</el-scrollbar>
</div>
</template>
@ -39,37 +39,34 @@
</div>
</template>
<script>
import GetBehavior from './scriptRecord/getBehavior';
import GetAction from './scriptRecord/getAction';
import RoleConditionScript from './scriptRecord/roleConditionScript';
import GetBehavior from './scriptRecord/getBehavior';
import GetAction from './scriptRecord/getAction';
import RoleConditionScript from './scriptRecord/roleConditionScript';
import {saveScriptScenes, saveScriptData, dumpScriptData} from '@/api/simulation';
import { launchFullscreen, exitFullscreen } from '@/utils/screen';
import {saveScriptScenes, saveScriptData, dumpScriptData} from '@/api/simulation';
import {updateMapLocation} from '@/api/quest';
export default {
export default {
name: 'TipScriptRecord',
components: {
GetBehavior,
GetAction,
RoleConditionScript
},
props: {
group: {
type: String,
required: true
},
},
components: {
GetBehavior,
GetAction,
RoleConditionScript,
}
},
data() {
return {
title: '任务录制',
isShrink: false,
memberId:null,
behaviorId:null,
displayType:"role",
mapLocation:{},
memberId: null,
behaviorId: null,
displayType: 'role',
mapLocation: {}
// isSaveStage: true,
}
};
},
watch: {
'$store.state.map.mapViewLoadedCount': function (val) {
@ -80,15 +77,15 @@
},
created() {
},
mounted(){
mounted() {
this.shrink();
},
methods: {
jump(obj) {
},
shrink() {
let height = this.$refs.dragBody.offsetHeight + 40;
let top = this.$refs.drapBox.style.top;
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 = '';
@ -99,31 +96,31 @@
this.isShrink = true;
}
},
backToMember(){
this.displayType="role";
backToMember() {
this.displayType='role';
},
backToBehavior(){
this.displayType="behavior";
backToBehavior() {
this.displayType='behavior';
},
getActions(row){
this.displayType="action";
getActions(row) {
this.displayType='action';
this.behaviorId=row.id;
this.$store.dispatch('scriptRecord/updateBehaviorName',row.description);
this.$store.dispatch('scriptRecord/updateBehaviorName', row.description);
},
saveScenesStage() {
saveScriptScenes(this.group).then(resp => {
// this.isSaveStage = false;
this.$message.success('保存背景成功');
}).catch(error => {
}).catch(() => {
this.$messageBox('保存背景失败!');
})
});
},
saveScenesData() {
saveScriptData(this.group).then(resp => {
this.$message.success('保存数据成功');
}).catch(error => {
}).catch(() => {
this.$messageBox('保存数据失败!');
})
});
},
dumpScenesData() {
this.$confirm('此操作将会清除已保存的录制数据, 是否继续?', '提示', {
@ -134,25 +131,24 @@
dumpScriptData(this.scriptId).then(resp => {
// this.isSaveStage = true;
this.$message.success('清除数据成功');
}).catch(error => {
}).catch(() => {
this.$messageBox('清除数据失败!');
})
}).catch(error => { })
});
});
},
getBehaviorList(id){
this.displayType="behavior";
getBehaviorList(id) {
this.displayType='behavior';
this.memberId=id;
},
backToTop(){
backToTop() {
var div = this.$refs['elScrollbar'].$refs['wrap'];
div.scrollTop=0;
},
backToActionTop(){
backToActionTop() {
var div = this.$refs['elActionScrollbar'].$refs['wrap'];
div.scrollTop=0;
},
saveMaplocation()
{
saveMaplocation() {
// this.$parent.$parent.$refs['mapCanvas'].$refs['mapCommon'].$refs['jlmapVisual'].$jlmap.$options
// let dataZoom = this.$store.state.map.dataZoom;
// let scriptId=this.$route.query.scriptId;
@ -164,7 +160,7 @@
// });
}
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";