This commit is contained in:
zyy 2019-08-08 18:34:41 +08:00
commit a288a21456
24 changed files with 778 additions and 738 deletions

View File

@ -402,11 +402,6 @@ class Jlmap {
}
}
}
// 设置地图位置
setPosition(payload) {
this.$options && this.$options.update(payload);
}
}
export default Jlmap;

View File

@ -55,7 +55,6 @@ class Signal extends Group {
zlevel: this.zlevel,
z: this.z,
style: style,
index: i + 1,
drict: drict,
x: endPoint.x + i * drict * style.Signal.lamp.radiusR * 2,
y: endPoint.y,

View File

@ -185,7 +185,7 @@
// this.selection = selection;
// }
},
// SerializeCodeListWithSeparator(sep) {
// serializeCodeListWithSeparator(sep) {
// let codeList = [];
// if (this.selection && this.selection.length) {
// this.selection.forEach(elem => {

View File

@ -279,7 +279,7 @@
this.timer = null;
}
},
SerializeCodeListWithSeparator(sep) {
serializeCodeListWithSeparator(sep) {
let codeList = [];
if (this.selection && this.selection.length) {
this.selection.forEach(elem => {
@ -294,7 +294,7 @@
let operate = {
type: MapDeviceType.StationControl.type,
operation: '',
val: this.SerializeCodeListWithSeparator('::'),
val: this.serializeCodeListWithSeparator('::'),
selection: selection
}
@ -322,7 +322,7 @@
type: MapDeviceType.StationControl.type,
messages: ['确认将如下操作区域的控制模式由中控转为站控:'],
operation: OperationEvent.StationControl.requestStationControl.menu.operation,
val: this.SerializeCodeListWithSeparator('::'),
val: this.serializeCodeListWithSeparator('::'),
selection: this.selection
}
@ -349,7 +349,7 @@
type: MapDeviceType.StationControl.type,
messages: ['确认将如下操作区域的控制模式由中控转为站控:'],
operation: OperationEvent.StationControl.forcedStationControl.menu.operation,
val: this.SerializeCodeListWithSeparator('::'),
val: this.serializeCodeListWithSeparator('::'),
selection: this.selection
}
@ -376,7 +376,7 @@
type: MapDeviceType.StationControl.type,
messages: ['确认将如下操作区域的控制模式由站控转为中控:'],
operation: OperationEvent.StationControl.requestCentralControl.menu.operation,
val: this.SerializeCodeListWithSeparator('::'),
val: this.serializeCodeListWithSeparator('::'),
selection: this.selection
}

View File

@ -289,7 +289,6 @@
let operate = {
start: true,
send: true,
model: this.selected,
code: this.selected.code,
type: MapDeviceType.Signal.type,
label: MapDeviceType.Signal.label,

View File

@ -203,7 +203,7 @@
this.$store.dispatch('training/emitTipFresh');
this.$refs.multipleTable.setCurrentRow();
},
SerializeCodeListWithSeparator(sep) {
serializeCodeListWithSeparator(sep) {
let codeList = [];
if (this.selection && this.selection.length) {
this.selection.forEach(elem => {
@ -218,7 +218,7 @@
let operate = {
type: MapDeviceType.StationControl.type,
operation: OperationEvent.StationControl.controlResponse.choose.operation,
val: this.SerializeCodeListWithSeparator('::'),
val: this.serializeCodeListWithSeparator('::'),
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {

View File

@ -1,318 +1,342 @@
<template>
<div>
<el-dialog class="beijing-01__systerm route-hand-control" :title="title" :visible.sync="show" width="300px"
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
<el-row class="header">
<el-col :span="11"><span>集中站</span></el-col>
<el-col :span="11" :offset="2"><span>始端信号机</span></el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-input v-model="stationName" size="small" disabled></el-input>
</el-col>
<el-col :span="11" :offset="2">
<el-input v-model="signalName" size="small" disabled></el-input>
</el-col>
</el-row>
<div class="table">
<el-table ref="tempTable" :data="tempData" border style="width: 100%" size="mini" highlight-current-row
:height="140">
<el-table-column prop="name" label="选择" width="55" style="margin-left:50px; text-align: right;">
<template slot-scope="scope">
<el-checkbox v-model="scope.row.check" style="text-align: center; display: block;"
:disabled="scope.row.disabled"></el-checkbox>
</template>
</el-table-column>
<el-table-column prop="name" label="进路" :id="domIdChoose" style="margin-left:30px">
<template slot-scope="scope">
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{scope.row.name}}</span>
</template>
</el-table-column>
</el-table>
</div>
<el-row>
<el-col :span="22" :offset="1">
<el-checkbox v-model="allSelect" size="small" @change="allSelectChange">全选</el-checkbox>
</el-col>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :disabled="commitDisabled" :loading="loading"
@click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<confirm-control ref="confirmControl"></confirm-control>
<notice-info ref="noticeInfo"></notice-info>
</el-dialog>
</div>
<div>
<el-dialog
v-dialogDrag
class="beijing-01__systerm route-hand-control"
:title="title"
:visible.sync="show"
width="300px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row class="header">
<el-col :span="11"><span>集中站</span></el-col>
<el-col :span="11" :offset="2"><span>始端信号机</span></el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-input v-model="stationName" size="small" disabled />
</el-col>
<el-col :span="11" :offset="2">
<el-input v-model="signalName" size="small" disabled />
</el-col>
</el-row>
<div class="table">
<el-table
ref="tempTable"
:data="tempData"
border
style="width: 100%"
size="mini"
highlight-current-row
:height="140"
>
<el-table-column prop="name" label="选择" width="55" style="margin-left:50px; text-align: right;">
<template slot-scope="scope">
<el-checkbox
v-model="scope.row.check"
style="text-align: center; display: block;"
:disabled="scope.row.disabled"
/>
</template>
</el-table-column>
<el-table-column :id="domIdChoose" prop="name" label="进路" style="margin-left:30px">
<template slot-scope="scope">
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.name }}</span>
</template>
</el-table-column>
</el-table>
</div>
<el-row>
<el-col :span="22" :offset="1">
<el-checkbox v-model="allSelect" size="small" @change="allSelectChange">全选</el-checkbox>
</el-col>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button
:id="domIdConfirm"
type="primary"
:disabled="commitDisabled"
:loading="loading"
@click="commit"
>确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<confirm-control ref="confirmControl" />
<notice-info ref="noticeInfo" />
</el-dialog>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent, getDomIdByOperation } from '@/scripts/ConstDic';
import ConfirmControl from './childDialog/confirmControl';
import { mouseCancelState } from '../utils/menuItemStatus';
import NoticeInfo from './childDialog/childDialog/noticeInfo'
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent, getDomIdByOperation } from '@/scripts/ConstDic';
import ConfirmControl from './childDialog/confirmControl';
import { mouseCancelState } from '../utils/menuItemStatus';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default {
name: 'RouteHandControl',
components: {
ConfirmControl,
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
selected: null,
tempData: [],
operation: null,
selection: [],
stationName: '',
signalName: '',
allSelect: false,
}
},
computed: {
...mapGetters('map', [
'signalList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdChoose() {
if (this.dialogShow) {
if (this.operation == OperationEvent.Signal.humanControl.menu.operation) {
return OperationEvent.Signal.humanControl.choose.domId;
} else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) {
return OperationEvent.Signal.atsAutoControl.choose.domId;
}
}
},
domIdConfirm() {
return this.dialogShow ? getDomIdByOperation(this.operation) : '';
},
title() {
if (this.operation == OperationEvent.Signal.humanControl.menu.operation) {
return '进路交人工控';
} else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) {
return '进路交自动控';
}
},
commitDisabled() {
let disabled = true;
if (this.selection && this.selection.length) {
disabled = false;
}
export default {
name: 'RouteHandControl',
components: {
ConfirmControl,
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
selected: null,
tempData: [],
operation: null,
selection: [],
stationName: '',
signalName: '',
allSelect: false
};
},
computed: {
...mapGetters('map', [
'signalList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdChoose() {
if (this.dialogShow) {
if (this.operation == OperationEvent.Signal.humanControl.menu.operation) {
return OperationEvent.Signal.humanControl.choose.domId;
} else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) {
return OperationEvent.Signal.atsAutoControl.choose.domId;
}
}
},
domIdConfirm() {
return this.dialogShow ? getDomIdByOperation(this.operation) : '';
},
title() {
if (this.operation == OperationEvent.Signal.humanControl.menu.operation) {
return '进路交人工控';
} else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) {
return '进路交自动控';
}
},
commitDisabled() {
let disabled = true;
if (this.selection && this.selection.length) {
disabled = false;
}
return disabled;
}
},
watch: {
//
tempData: {
handler(val, oldVal) {
this.checkTableDataSelction(val);
},
deep: true
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
},
methods: {
doShow(operate, selected, tempData) {
this.selected = selected;
//
if (!this.dialogShow) {
this.signalName = '';
this.stationName = '';
if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) {
this.signalName = selected.name
let station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
if (station) {
this.stationName = station.name;
}
}
return disabled;
}
},
watch: {
//
tempData: {
handler(val, oldVal) {
this.checkTableDataSelction(val);
},
deep: true
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected, tempData) {
this.selected = selected;
//
if (!this.dialogShow) {
this.signalName = '';
this.stationName = '';
if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) {
this.signalName = selected.name;
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
if (station) {
this.stationName = station.name;
}
}
if (tempData && tempData.length > 0) {
tempData.forEach(elem => {
elem.check = false;
elem.disabled = false;
//
if (operate.operation === OperationEvent.Signal.humanControl.menu.operation &&
if (tempData && tempData.length > 0) {
tempData.forEach(elem => {
elem.check = false;
elem.disabled = false;
//
if (operate.operation === OperationEvent.Signal.humanControl.menu.operation &&
elem.controlType != '01') {
elem.disabled = true;
} if (operate.operation === OperationEvent.Signal.atsAutoControl.menu.operation &&
elem.disabled = true;
} if (operate.operation === OperationEvent.Signal.atsAutoControl.menu.operation &&
elem.controlType == '01') {
elem.disabled = true
}
})
}
elem.disabled = true;
}
});
}
this.tempData = tempData || [];
this.operation = operate.operation;
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$refs.tempTable.setCurrentRow();
this.$store.dispatch('training/emitTipFresh');
mouseCancelState(this.selected);
},
checkTableDataSelction(data) {
let selection = [];
if (data && data.length > 0) {
data.forEach(row => {
if (row.check && !row.disabled) {
selection.push(row);
}
})
}
this.tempData = tempData || [];
this.operation = operate.operation;
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$refs.tempTable.setCurrentRow();
this.$store.dispatch('training/emitTipFresh');
mouseCancelState(this.selected);
},
checkTableDataSelction(data) {
const selection = [];
if (data && data.length > 0) {
data.forEach(row => {
if (row.check && !row.disabled) {
selection.push(row);
}
});
}
if (JSON.stringify(selection) !== JSON.stringify(this.selection)) {
this.handleChooseChange(selection);
this.selection = selection;
}
let num = 0;
this.allSelect = false;
this.tempData.forEach(item => {
if (item.check) {
num++
if (num == this.tempData.length) {
this.allSelect = true;
}
}
})
},
allSelectChange() {
if (this.allSelect) {
this.tempData.forEach(item => {
if (!item.disabled) {
item.check = true;
}
})
} else {
this.tempData.forEach(item => {
if (!item.disabled) {
item.check = false;
}
})
}
},
SerializeCodeListWithSeparator(sep) {
let codeList = [];
if (this.selection && this.selection.length) {
this.selection.forEach(elem => {
codeList.push(elem.code);
})
}
return codeList.join(sep);
},
handleChooseChange(selection) {
this.selection = selection;
if (selection && selection.length) {
let operate = {
repeat: true,
type: MapDeviceType.Signal.type,
operation: '',
val: this.SerializeCodeListWithSeparator('::'),
selection: selection
}
if (JSON.stringify(selection) !== JSON.stringify(this.selection)) {
this.handleChooseChange(selection);
this.selection = selection;
}
let num = 0;
this.allSelect = false;
this.tempData.forEach(item => {
if (item.check) {
num++;
if (num == this.tempData.length) {
this.allSelect = true;
}
}
});
},
allSelectChange() {
if (this.allSelect) {
this.tempData.forEach(item => {
if (!item.disabled) {
item.check = true;
}
});
} else {
this.tempData.forEach(item => {
if (!item.disabled) {
item.check = false;
}
});
}
},
serializeCodeListWithSeparator(sep) {
const codeList = [];
if (this.selection && this.selection.length) {
this.selection.forEach(elem => {
codeList.push(elem.code);
});
}
return codeList.join(sep);
},
handleChooseChange(selection) {
this.selection = selection;
if (selection && selection.length) {
const operate = {
repeat: true,
type: MapDeviceType.Signal.type,
operation: '',
val: this.serializeCodeListWithSeparator('::'),
selection: selection
};
if (this.operation == OperationEvent.Signal.humanControl.menu.operation) {
/** 进路交人工控*/
operate.operation = OperationEvent.Signal.humanControl.choose.operation
} else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) {
/** 进路交自动控*/
operate.operation = OperationEvent.Signal.atsAutoControl.choose.operation
}
if (this.operation == OperationEvent.Signal.humanControl.menu.operation) {
/** 进路交人工控*/
operate.operation = OperationEvent.Signal.humanControl.choose.operation;
} else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) {
/** 进路交自动控*/
operate.operation = OperationEvent.Signal.atsAutoControl.choose.operation;
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
})
} else if (!selection) {
this.$messageBox(`请选择一条数据`);
}
},
commit() {
if (this.operation == OperationEvent.Signal.humanControl.menu.operation) {
/** 进路交人工控*/
this.humanControl();
} else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) {
/** 进路交自动控*/
this.atsAutoControl();
}
},
//
humanControl() {
let operate = {
send: true,
type: MapDeviceType.Signal.type,
operation: OperationEvent.Signal.humanControl.menu.operation,
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
} else if (!selection) {
this.$messageBox(`请选择一条数据`);
}
},
commit() {
if (this.operation == OperationEvent.Signal.humanControl.menu.operation) {
/** 进路交人工控*/
this.humanControl();
} else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) {
/** 进路交自动控*/
this.atsAutoControl();
}
},
//
humanControl() {
const operate = {
send: true,
type: MapDeviceType.Signal.type,
operation: OperationEvent.Signal.humanControl.menu.operation
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(error => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
},
//
atsAutoControl() {
let operate = {
send: true,
type: MapDeviceType.Signal.type,
operation: OperationEvent.Signal.atsAutoControl.menu.operation,
}
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(error => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
},
//
atsAutoControl() {
const operate = {
send: true,
type: MapDeviceType.Signal.type,
operation: OperationEvent.Signal.atsAutoControl.menu.operation
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(error => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
},
cancel() {
let operate = {
type: MapDeviceType.Signal.type,
operation: OperationEvent.Command.cancel.menu.operation,
}
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(error => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
},
cancel() {
const operate = {
type: MapDeviceType.Signal.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(error => {
this.doClose();
});
}
}
}
</script>
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(error => {
this.doClose();
});
}
}
};
</script>

View File

@ -74,7 +74,7 @@
return this.dialogShow ? OperationEvent.Train.addTrainId.menu.domId : '';
},
title() {
return '定义车组号'
return '平移车组号'
}
},
mounted() {
@ -169,4 +169,4 @@
padding: 0 5px;
background-color: #F0F0F0;
}
</style>
</style>

View File

@ -253,7 +253,6 @@ export default {
const operate = {
start: true,
send: true,
model: this.selected,
code: this.selected.code,
type: MapDeviceType.Signal.type,
label: MapDeviceType.Signal.label,

View File

@ -203,7 +203,7 @@
this.$store.dispatch('training/emitTipFresh');
this.$refs.multipleTable.setCurrentRow();
},
SerializeCodeListWithSeparator(sep) {
serializeCodeListWithSeparator(sep) {
let codeList = [];
if (this.selection && this.selection.length) {
this.selection.forEach(elem => {
@ -218,7 +218,7 @@
let operate = {
type: MapDeviceType.StationControl.type,
operation: OperationEvent.StationControl.controlResponse.choose.operation,
val: this.SerializeCodeListWithSeparator('::'),
val: this.serializeCodeListWithSeparator('::'),
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {

View File

@ -279,7 +279,7 @@
this.timer = null;
}
},
SerializeCodeListWithSeparator(sep) {
serializeCodeListWithSeparator(sep) {
let codeList = [];
if (this.selection && this.selection.length) {
this.selection.forEach(elem => {
@ -294,7 +294,7 @@
let operate = {
type: MapDeviceType.StationControl.type,
operation: '',
val: this.SerializeCodeListWithSeparator('::'),
val: this.serializeCodeListWithSeparator('::'),
selection: selection
}
@ -322,7 +322,7 @@
type: MapDeviceType.StationControl.type,
messages: ['确认将如下操作区域的控制模式由中控转为站控:'],
operation: OperationEvent.StationControl.requestStationControl.menu.operation,
val: this.SerializeCodeListWithSeparator('::'),
val: this.serializeCodeListWithSeparator('::'),
selection: this.selection
}
@ -349,7 +349,7 @@
type: MapDeviceType.StationControl.type,
messages: ['确认将如下操作区域的控制模式由中控转为站控:'],
operation: OperationEvent.StationControl.forcedStationControl.menu.operation,
val: this.SerializeCodeListWithSeparator('::'),
val: this.serializeCodeListWithSeparator('::'),
selection: this.selection
}
@ -376,7 +376,7 @@
type: MapDeviceType.StationControl.type,
messages: ['确认将如下操作区域的控制模式由站控转为中控:'],
operation: OperationEvent.StationControl.requestCentralControl.menu.operation,
val: this.SerializeCodeListWithSeparator('::'),
val: this.serializeCodeListWithSeparator('::'),
selection: this.selection
}

View File

@ -316,7 +316,6 @@
let operate = {
start: true,
send: true,
model: this.selected,
code: this.selected.code,
type: MapDeviceType.Signal.type,
label: MapDeviceType.Signal.label,

View File

@ -203,7 +203,7 @@
this.$store.dispatch('training/emitTipFresh');
this.$refs.multipleTable.setCurrentRow();
},
SerializeCodeListWithSeparator(sep) {
serializeCodeListWithSeparator(sep) {
let codeList = [];
if (this.selection && this.selection.length) {
this.selection.forEach(elem => {
@ -218,7 +218,7 @@
let operate = {
type: MapDeviceType.StationControl.type,
operation: OperationEvent.StationControl.controlResponse.choose.operation,
val: this.SerializeCodeListWithSeparator('::'),
val: this.serializeCodeListWithSeparator('::'),
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {

View File

@ -279,7 +279,7 @@
this.timer = null;
}
},
SerializeCodeListWithSeparator(sep) {
serializeCodeListWithSeparator(sep) {
let codeList = [];
if (this.selection && this.selection.length) {
this.selection.forEach(elem => {
@ -294,7 +294,7 @@
let operate = {
type: MapDeviceType.StationControl.type,
operation: '',
val: this.SerializeCodeListWithSeparator('::'),
val: this.serializeCodeListWithSeparator('::'),
selection: selection
}
@ -322,7 +322,7 @@
type: MapDeviceType.StationControl.type,
messages: ['确认将如下操作区域的控制模式由中控转为站控:'],
operation: OperationEvent.StationControl.requestStationControl.menu.operation,
val: this.SerializeCodeListWithSeparator('::'),
val: this.serializeCodeListWithSeparator('::'),
selection: this.selection
}
@ -349,7 +349,7 @@
type: MapDeviceType.StationControl.type,
messages: ['确认将如下操作区域的控制模式由中控转为站控:'],
operation: OperationEvent.StationControl.forcedStationControl.menu.operation,
val: this.SerializeCodeListWithSeparator('::'),
val: this.serializeCodeListWithSeparator('::'),
selection: this.selection
}
@ -376,7 +376,7 @@
type: MapDeviceType.StationControl.type,
messages: ['确认将如下操作区域的控制模式由站控转为中控:'],
operation: OperationEvent.StationControl.requestCentralControl.menu.operation,
val: this.SerializeCodeListWithSeparator('::'),
val: this.serializeCodeListWithSeparator('::'),
selection: this.selection
}

View File

@ -316,7 +316,6 @@
let operate = {
start: true,
send: true,
model: this.selected,
code: this.selected.code,
type: MapDeviceType.Signal.type,
label: MapDeviceType.Signal.label,

View File

@ -203,7 +203,7 @@
this.$store.dispatch('training/emitTipFresh');
this.$refs.multipleTable.setCurrentRow();
},
SerializeCodeListWithSeparator(sep) {
serializeCodeListWithSeparator(sep) {
let codeList = [];
if (this.selection && this.selection.length) {
this.selection.forEach(elem => {
@ -218,7 +218,7 @@
let operate = {
type: MapDeviceType.StationControl.type,
operation: OperationEvent.StationControl.controlResponse.choose.operation,
val: this.SerializeCodeListWithSeparator('::'),
val: this.serializeCodeListWithSeparator('::'),
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {

View File

@ -188,7 +188,7 @@
this.selection = selection;
}
},
SerializeCodeListWithSeparator(sep) {
serializeCodeListWithSeparator(sep) {
let codeList = [];
if (this.selection && this.selection.length) {
this.selection.forEach(elem => {
@ -204,7 +204,7 @@
repeat: true,
type: MapDeviceType.Signal.type,
operation: '',
val: this.SerializeCodeListWithSeparator('::'),
val: this.serializeCodeListWithSeparator('::'),
selection: selection
}

View File

@ -1,238 +1,262 @@
<template>
<el-dialog class="fuzhou-01__systerm route-setting" :title="title" :visible.sync="show" width="500px"
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
<el-row class="header">
<el-col :span="8"><span>车站名称</span></el-col>
<el-col :span="8" :offset="2"><span>始端信号机</span></el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-input v-model="stationName" size="small" disabled></el-input>
</el-col>
<el-col :span="8" :offset="2">
<el-input v-model="signalName" size="small" disabled></el-input>
</el-col>
</el-row>
<el-table ref="table" :data="tempData" border style="width: 100%; margin-top:10px" size="mini"
@row-click="clickEvent" height="120" highlight-current-row>
<el-table-column prop="name" label="进路" :id="domIdChoose" style="margin-left:30px">
</el-table-column>
<el-table-column prop="protectedSection" label="保护区段" :width="180">
<template slot-scope="scope">
<span>{{getProtectedSectionName(scope.row)}}</span>
</template>
</el-table-column>
<el-table-column prop="canSetting" label="状态" :width="100">
<template slot-scope="scope">
<span v-if="scope.row.canSetting">允许选排</span>
<span v-else>不允许选排</span>
</template>
</el-table-column>
</el-table>
<el-row justify="
center" class="button-group">
<el-col :span="8" :offset="4">
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="commitDisabled"
@click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<confirm-control ref="confirmControl"></confirm-control>
<notice-info ref="noticeInfo"></notice-info>
</el-dialog>
<el-dialog
v-dialogDrag
class="fuzhou-01__systerm route-setting"
:title="title"
:visible.sync="show"
width="500px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row class="header">
<el-col :span="8"><span>车站名称</span></el-col>
<el-col :span="8" :offset="2"><span>始端信号机</span></el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-input v-model="stationName" size="small" disabled />
</el-col>
<el-col :span="8" :offset="2">
<el-input v-model="signalName" size="small" disabled />
</el-col>
</el-row>
<el-table
ref="table"
:data="tempData"
border
style="width: 100%; margin-top:10px"
size="mini"
height="120"
highlight-current-row
@row-click="clickEvent"
>
<el-table-column :id="domIdChoose" prop="name" label="进路" style="margin-left:30px" />
<el-table-column prop="protectedSection" label="保护区段" :width="180">
<template slot-scope="scope">
<span>{{ getProtectedSectionName(scope.row) }}</span>
</template>
</el-table-column>
<el-table-column prop="canSetting" label="状态" :width="100">
<template slot-scope="scope">
<span v-if="scope.row.canSetting">允许选排</span>
<span v-else>不允许选排</span>
</template>
</el-table-column>
</el-table>
<el-row
justify="
center"
class="button-group"
>
<el-col :span="8" :offset="4">
<el-button
:id="domIdConfirm"
type="primary"
:loading="loading"
:disabled="commitDisabled"
@click="commit"
>确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<confirm-control ref="confirmControl" />
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import ConfirmControl from './childDialog/confirmControl';
import NoticeInfo from './childDialog/childDialog/noticeInfo'
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import ConfirmControl from './childDialog/confirmControl';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default {
name: 'RouteSelection',
components: {
ConfirmControl,
NoticeInfo
},
data() {
return {
tempData: [],
beforeSectionList: [],
dialogShow: false,
loading: false,
row: null,
operation: '',
display: true,
stationName: '',
signalName: '',
}
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdChoose() {
return this.dialogShow ? OperationEvent.Signal.arrangementRoute.choose.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Signal.arrangementRoute.menu.domId : ''
},
title() {
return '进路选排'
},
commitDisabled() {
let disabled = true;
if (this.row) {
disabled = !this.row.canSetting
}
return disabled;
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
},
methods: {
getProtectedSectionName(row) {
let name = '';
if (row &&
export default {
name: 'RouteSelection',
components: {
ConfirmControl,
NoticeInfo
},
data() {
return {
tempData: [],
beforeSectionList: [],
dialogShow: false,
loading: false,
row: null,
operation: '',
display: true,
stationName: '',
signalName: ''
};
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdChoose() {
return this.dialogShow ? OperationEvent.Signal.arrangementRoute.choose.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Signal.arrangementRoute.menu.domId : '';
},
title() {
return '进路选排';
},
commitDisabled() {
let disabled = true;
if (this.row) {
disabled = !this.row.canSetting;
}
return disabled;
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
getProtectedSectionName(row) {
let name = '';
if (row &&
row.overlapSectionList &&
row.overlapSectionList &&
row.overlapSectionList.length > 0) {
let protect = row.overlapSectionList[0];
name = `${protect.name}`;
if (protect.parentName) {
name = `${protect.parentName}${protect.name}`;
}
let station = this.$store.getters['map/getDeviceByCode'](protect.stationCode);
if (station) {
name = `${name}(${station.name})`
}
}
return name;
},
doShow(operate, selected, tempData) {
//
if (!this.dialogShow) {
this.signalName = '';
this.stationName = '';
if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) {
this.signalName = selected.name
let station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
if (station) {
this.stationName = station.name;
}
}
const protect = row.overlapSectionList[0];
name = `${protect.name}`;
if (protect.parentName) {
name = `${protect.parentName}${protect.name}`;
}
const station = this.$store.getters['map/getDeviceByCode'](protect.stationCode);
if (station) {
name = `${name}(${station.name})`;
}
}
return name;
},
doShow(operate, selected, tempData) {
//
if (!this.dialogShow) {
this.signalName = '';
this.stationName = '';
if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) {
this.signalName = selected.name;
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
if (station) {
this.stationName = station.name;
}
}
this.tempData = tempData || [];
this.operation = operate.operation;
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.restoreBeforeDevices();
this.$refs.table.setCurrentRow();
this.$store.dispatch('training/emitTipFresh');
},
restoreBeforeDevices() {
//
if (this.beforeSectionList && this.beforeSectionList.length) {
this.beforeSectionList.forEach(elem => {
elem.cutOff = false;
});
}
this.tempData = tempData || [];
this.operation = operate.operation;
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.restoreBeforeDevices();
this.$refs.table.setCurrentRow();
this.$store.dispatch('training/emitTipFresh');
},
restoreBeforeDevices() {
//
if (this.beforeSectionList && this.beforeSectionList.length) {
this.beforeSectionList.forEach(elem => {
elem.cutOff = false;
});
}
this.$store.dispatch('training/updateMapState', [... this.beforeSectionList]);
this.beforeSectionList = [];
},
clickEvent(row, event, column) {
this.row = row;
if (row) {
//
this.restoreBeforeDevices();
this.$store.dispatch('training/updateMapState', [... this.beforeSectionList]);
this.beforeSectionList = [];
},
clickEvent(row, event, column) {
this.row = row;
if (row) {
//
this.restoreBeforeDevices();
if (row.canSetting) {
//
if (row.containSectionList && row.containSectionList.length) {
//
row.containSectionList.forEach(elem => {
elem.cutOff = true;
});
}
if (row.canSetting) {
//
if (row.containSectionList && row.containSectionList.length) {
//
row.containSectionList.forEach(elem => {
elem.cutOff = true;
});
}
this.$store.dispatch('training/updateMapState', [...row.containSectionList]);
this.beforeSectionList = row.containSectionList || [];
this.$store.dispatch('training/updateMapState', [...row.containSectionList]);
this.beforeSectionList = row.containSectionList || [];
//
let operate = {
type: MapDeviceType.Signal.type,
operation: OperationEvent.Signal.arrangementRoute.choose.operation,
val: row.code
};
//
const operate = {
type: MapDeviceType.Signal.type,
operation: OperationEvent.Signal.arrangementRoute.choose.operation,
val: row.code
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
}
}
},
commit() {
if (this.row && this.row.canSetting) {
let names = '';
if (this.row.overlapSectionList && this.row.overlapSectionList.length > 0) {
names = names + this.row.overlapSectionList.map(elem => { return elem.name }).join('');
}
if (this.row.overlapSwitchList && this.row.overlapSwitchList.length > 0) {
names = names + this.row.overlapSwitchList.map(elem => { return elem.name }).join('');
}
let operate = {
type: MapDeviceType.Signal.type,
operation: OperationEvent.Signal.arrangementRoute.menu.operation,
messages: [`进路设置:${this.row.name}${names}(${this.row.stationName})`]
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
}
}
},
commit() {
if (this.row && this.row.canSetting) {
let names = '';
if (this.row.overlapSectionList && this.row.overlapSectionList.length > 0) {
names = names + this.row.overlapSectionList.map(elem => { return elem.name; }).join('');
}
if (this.row.overlapSwitchList && this.row.overlapSwitchList.length > 0) {
names = names + this.row.overlapSwitchList.map(elem => { return elem.name; }).join('');
}
const operate = {
type: MapDeviceType.Signal.type,
operation: OperationEvent.Signal.arrangementRoute.menu.operation,
messages: [`进路设置:${this.row.name}${names}(${this.row.stationName})`]
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.confirmControl.doShow(operate);
}
}).catch(error => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
}
},
cancel() {
let operate = {
type: MapDeviceType.Signal.type,
operation: OperationEvent.Command.cancel.menu.operation,
}
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.confirmControl.doShow(operate);
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
}
},
cancel() {
const operate = {
type: MapDeviceType.Signal.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(error => {
this.doClose();
});
}
}
}
</script>
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
};
</script>

View File

@ -53,7 +53,6 @@
import { getPublishTrainList } from '@/api/jmap/map';
import ConfirmTrain from './childDialog/confirmTrain';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import Vue from 'vue';
export default {
name: 'TrainControl',
@ -218,7 +217,7 @@
if (!this.dialogShow) {
this.operation = operate.operation;
}
let model = Vue.prototype.$jlmap.mapDevice[selected.code];
let model = this.$store.getters['map/getDeviceByCode'](selected.code);
this.formModel = {
groupNumber: model.groupNumber,
tripNumber: model.tripNumber,

View File

@ -311,7 +311,7 @@
{ type: "resp", timeout: "true", stationControlCode: elem.code }
);
},
SerializeCodeListWithSeparator(sep) {
serializeCodeListWithSeparator(sep) {
let codeList = [];
if (this.selection && this.selection.length) {
this.selection.forEach(elem => {
@ -326,7 +326,7 @@
let operate = {
type: MapDeviceType.StationControl.type,
operation: '',
val: this.SerializeCodeListWithSeparator('::'),
val: this.serializeCodeListWithSeparator('::'),
selection: selection
}
@ -354,7 +354,7 @@
type: MapDeviceType.StationControl.type,
messages: ['确认将如下操作区域的控制模式由中控转为站控:'],
operation: OperationEvent.StationControl.requestStationControl.menu.operation,
val: this.SerializeCodeListWithSeparator('::'),
val: this.serializeCodeListWithSeparator('::'),
selection: this.selection
}
@ -379,7 +379,7 @@
type: MapDeviceType.StationControl.type,
messages: ['确认将如下操作区域的控制模式由中控转为站控:'],
operation: OperationEvent.StationControl.forcedStationControl.menu.operation,
val: this.SerializeCodeListWithSeparator('::'),
val: this.serializeCodeListWithSeparator('::'),
selection: this.selection
}
@ -404,7 +404,7 @@
type: MapDeviceType.StationControl.type,
messages: ['确认将如下操作区域的控制模式由站控转为中控:'],
operation: OperationEvent.StationControl.requestCentralControl.menu.operation,
val: this.SerializeCodeListWithSeparator('::'),
val: this.serializeCodeListWithSeparator('::'),
selection: this.selection
}

View File

@ -191,15 +191,6 @@ export default {
]
};
},
watch: {
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Signal) && !this.buttonOperation) {
this.doShow(this.$store.state.menuOperation.menuPosition);
} else {
this.doClose();
}
}
},
computed: {
...mapGetters('training', [
'mode',
@ -209,6 +200,15 @@ export default {
'buttonOperation'
])
},
watch: {
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Signal) && !this.buttonOperation) {
this.doShow(this.$store.state.menuOperation.menuPosition);
} else {
this.doClose();
}
}
},
methods: {
clickEvent() {
const self = this;
@ -288,7 +288,6 @@ export default {
const operate = {
start: true,
send: true,
model: this.selected,
code: this.selected.code,
type: MapDeviceType.Signal.type,
label: MapDeviceType.Signal.label,

View File

@ -209,7 +209,7 @@
this.$store.dispatch('training/emitTipFresh');
this.$refs.multipleTable.setCurrentRow();
},
SerializeCodeListWithSeparator(sep) {
serializeCodeListWithSeparator(sep) {
let codeList = [];
if (this.selection && this.selection.length) {
this.selection.forEach(elem => {
@ -224,7 +224,7 @@
let operate = {
type: MapDeviceType.StationControl.type,
operation: OperationEvent.StationControl.controlResponse.choose.operation,
val: this.SerializeCodeListWithSeparator('::'),
val: this.serializeCodeListWithSeparator('::'),
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {

View File

@ -448,7 +448,7 @@ export default {
this.questId = parseInt(row.id);
if(res.data && res.data.mapLocation) {
let mapLocation={"offsetX":res.data.mapLocation.x,"offsetY":res.data.mapLocation.y,"scaleRate":res.data.mapLocation.scale};
Vue.prototype.$jlmap.setPosition(mapLocation)
Vue.prototype.$jlmap.setOptions(mapLocation)
}
}

View File

@ -1,166 +1,170 @@
<template>
<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">
<template v-if="displayType=='role'">
<role-condition-script :group="group" @getBehaviorList="getBehaviorList" />
</template>
<template v-if="displayType=='behavior'">
<div class="tab-pane-big">
<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 class="reminder-drag">
<div class="reminder-box" ref="drapBox">
<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">
<span>{{ title }}</span>
</p>
</div>
</template>
<template v-if="displayType=='action'">
<div class="tab-pane-big">
<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 class="tip-body-box" ref="dragBody">
<div class="tip-body">
<template v-if="displayType=='role'">
<role-condition-script :group="group" @getBehaviorList="getBehaviorList"></role-condition-script>
</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>
</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>
</div>
</template>
<el-button-group class="button-group">
<el-button type="primary" @click="saveMaplocation">更新定位</el-button>
<el-button type="primary" @click="saveScenesStage">保存背景</el-button>
<el-button type="success" @click="saveScenesData">保存数据</el-button>
<!-- <el-button type="danger" @click="dumpScenesData">重置剧本</el-button> -->
</el-button-group>
</div>
</div>
</template>
<el-button-group class="button-group">
<el-button type="primary" @click="saveMaplocation">更新定位</el-button>
<el-button type="primary" @click="saveScenesStage">保存背景</el-button>
<el-button type="success" @click="saveScenesData">保存数据</el-button>
<!-- <el-button type="danger" @click="dumpScenesData">重置剧本</el-button> -->
</el-button-group>
</div>
</div>
</div>
</div>
</template>
<script>
import GetBehavior from './scriptRecord/getBehavior';
import GetAction from './scriptRecord/getAction';
import RoleConditionScript from './scriptRecord/roleConditionScript';
import {saveScriptScenes, saveScriptData, dumpScriptData} from '@/api/simulation';
import Vue from 'vue';
import GetBehavior from './scriptRecord/getBehavior';
import GetAction from './scriptRecord/getAction';
import RoleConditionScript from './scriptRecord/roleConditionScript';
import { launchFullscreen, exitFullscreen } from '@/utils/screen';
import {saveScriptScenes, saveScriptData, dumpScriptData} from '@/api/simulation';
import {updateMapLocation} from '@/api/quest';
export default {
name: 'TipScriptRecord',
components: {
GetBehavior,
GetAction,
RoleConditionScript
},
props: {
group: {
type: String,
required: true
}
},
data() {
return {
title: '任务录制',
isShrink: false,
memberId: null,
behaviorId: null,
displayType: 'role',
mapLocation: {}
// isSaveStage: true,
};
},
watch: {
'$store.state.map.mapViewLoadedCount': function (val) {
// debugger;
//
// this.$parent.$parent.$refs['mapCanvas'].$refs['mapCommon'].$refs['jlmapVisual'].$jlmap.setOptions({type: 'zoom', scale:this.mapLocation.scale});
}
},
created() {
},
mounted() {
this.shrink();
},
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;
}
},
backToMember() {
this.displayType='role';
},
backToBehavior() {
this.displayType='behavior';
},
getActions(row) {
this.displayType='action';
this.behaviorId=row.id;
this.$store.dispatch('scriptRecord/updateBehaviorName', row.description);
},
saveScenesStage() {
saveScriptScenes(this.group).then(resp => {
// this.isSaveStage = false;
this.$message.success('保存背景成功');
}).catch(() => {
this.$messageBox('保存背景失败!');
});
},
saveScenesData() {
saveScriptData(this.group).then(resp => {
this.$message.success('保存数据成功');
}).catch(() => {
this.$messageBox('保存数据失败!');
});
},
dumpScenesData() {
this.$confirm('此操作将会清除已保存的录制数据, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
dumpScriptData(this.scriptId).then(resp => {
// this.isSaveStage = true;
this.$message.success('清除数据成功');
}).catch(() => {
this.$messageBox('清除数据失败!');
});
});
},
getBehaviorList(id) {
this.displayType='behavior';
this.memberId=id;
},
backToTop() {
var div = this.$refs['elScrollbar'].$refs['wrap'];
div.scrollTop=0;
},
backToActionTop() {
var div = this.$refs['elActionScrollbar'].$refs['wrap'];
div.scrollTop=0;
},
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;
// let data={scale:dataZoom.scaleRate,x:dataZoom.offsetX,y:dataZoom.offsetY};
// updateMapLocation(scriptId,data).then(response=>{
// this.$message.success('');
// }).catch(error => {
// this.$messageBox(`: ${error.message}`);
// });
}
}
};
export default {
name: 'TipScriptRecord',
props: {
group: {
type: String,
required: true
},
},
components: {
GetBehavior,
GetAction,
RoleConditionScript,
},
data() {
return {
title: '任务录制',
isShrink: false,
memberId:null,
behaviorId:null,
displayType:"role",
mapLocation:{},
// isSaveStage: true,
}
},
watch: {
'$store.state.map.mapViewLoadedCount': function (val) {
// debugger;
//
// this.$parent.$parent.$refs['mapCanvas'].$refs['mapCommon'].$refs['jlmapVisual'].$jlmap.setOptions({type: 'zoom', scale:this.mapLocation.scale});
}
},
created() {
},
mounted(){
this.shrink();
},
methods: {
jump(obj) {
},
shrink() {
let height = this.$refs.dragBody.offsetHeight + 40;
let 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;
}
},
backToMember(){
this.displayType="role";
},
backToBehavior(){
this.displayType="behavior";
},
getActions(row){
this.displayType="action";
this.behaviorId=row.id;
this.$store.dispatch('scriptRecord/updateBehaviorName',row.description);
},
saveScenesStage() {
saveScriptScenes(this.group).then(resp => {
// this.isSaveStage = false;
this.$message.success('保存背景成功');
}).catch(error => {
this.$messageBox('保存背景失败!');
})
},
saveScenesData() {
saveScriptData(this.group).then(resp => {
this.$message.success('保存数据成功');
}).catch(error => {
this.$messageBox(`保存数据失败!: ${error.message}`);
})
},
dumpScenesData() {
this.$confirm('此操作将会清除已保存的录制数据, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
dumpScriptData(this.scriptId).then(resp => {
// this.isSaveStage = true;
this.$message.success('清除数据成功');
}).catch(error => {
this.$messageBox('清除数据失败!');
})
}).catch(error => { })
},
getBehaviorList(id){
this.displayType="behavior";
this.memberId=id;
},
backToTop(){
var div = this.$refs['elScrollbar'].$refs['wrap'];
div.scrollTop=0;
},
backToActionTop(){
var div = this.$refs['elActionScrollbar'].$refs['wrap'];
div.scrollTop=0;
},
saveMaplocation()
{
let data=Vue.prototype.$jlmap.$options;
let scriptId=this.$route.query.scriptId;
let dataZoom={scale:data.scaleRate,x:data.offsetX,y:data.offsetY};
updateMapLocation(scriptId,dataZoom).then(response=>{
this.$message.success('更新定位成功');
}).catch(error => {
this.$messageBox(`更新定位失败: ${error.message}`);
});
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
@ -214,7 +218,7 @@ export default {
margin-left: 20px;
float:right;
}
}
.icon {
@ -235,4 +239,4 @@ export default {
}
}
}
</style>
</style>