This commit is contained in:
fan 2021-01-11 17:52:12 +08:00
commit c8150bfa32
16 changed files with 260 additions and 39 deletions

View File

@ -569,6 +569,12 @@ export default {
signalSectionSuccessful: 'Signal close section created successfully!', signalSectionSuccessful: 'Signal close section created successfully!',
signalSectionUpdateSucceeded: 'Update signal close to section successful!', signalSectionUpdateSucceeded: 'Update signal close to section successful!',
crossCoding:'Cross code',
crossName:'Cross name',
relateSwitchList:'Related switchList',
cross:'cross',
generateCross:'generate cross',
belongsSection: 'Belongs section:', belongsSection: 'Belongs section:',
coordinateMode: 'Coordinate mode', coordinateMode: 'Coordinate mode',
sectionAssociationMode: 'Section association mode', sectionAssociationMode: 'Section association mode',

View File

@ -25,6 +25,10 @@ export default {
linkSelectName: 'Enter the Link name', linkSelectName: 'Enter the Link name',
linkSelectDisplayLength: 'Please enter the actual length of the Link', linkSelectDisplayLength: 'Please enter the actual length of the Link',
pleaseSelectCross:'Please select cross',
pleaseInputCrossName:'Please input cross name',
pleaseSelectSwitch:'Please select switch',
lengthShow: 'According to the length of the:', lengthShow: 'According to the length of the:',
lengthFact: 'The real length:', lengthFact: 'The real length:',
color: 'color:', color: 'color:',

View File

@ -563,6 +563,12 @@ export default {
interlockingBlocks: '联锁区段', interlockingBlocks: '联锁区段',
alwaysRed: '是否总是显示红灯', alwaysRed: '是否总是显示红灯',
crossCoding:'岔心编号',
crossName:'岔心名称',
relateSwitchList:'关联道岔',
cross:'岔心',
generateCross:'一键生成岔心',
belongsSection: '所属区段:', belongsSection: '所属区段:',
coordinateMode: '坐标方式', coordinateMode: '坐标方式',
sectionAssociationMode: '区段关联方式', sectionAssociationMode: '区段关联方式',

View File

@ -24,6 +24,10 @@ export default {
linkSelectName: '请输入Link名称', linkSelectName: '请输入Link名称',
linkSelectDisplayLength: '请输入Link实际长度', linkSelectDisplayLength: '请输入Link实际长度',
pleaseSelectCross:'请选择岔心',
pleaseInputCrossName:'请输入岔心名称',
pleaseSelectSwitch:'请选择道岔',
lengthShow: '显示长度:', lengthShow: '显示长度:',
lengthFact: '真实长度:', lengthFact: '真实长度:',
color: '颜色:', color: '颜色:',

View File

@ -161,7 +161,7 @@ export function JLmapDriving(dom,data,mapId,storemod,translation,routegroup,proj
driverWebWorker = new Worker(JL3D_LOCAL_STATIC+"/workertest/driverWebWorker.js"); driverWebWorker = new Worker(JL3D_LOCAL_STATIC+"/workertest/driverWebWorker.js");
scope.Subscribe = new Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,driverWebWorker,stats); scope.Subscribe = new Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,driverWebWorker,stats);
datanew(); // datanew();
DriverLoadNew(mapnetdata,scope,netdata.data,mapdata,sectionlist,signallist,switchlist,stationstandlist,trainlisttest,rails,camera,controls3,scene,mixers); DriverLoadNew(mapnetdata,scope,netdata.data,mapdata,sectionlist,signallist,switchlist,stationstandlist,trainlisttest,rails,camera,controls3,scene,mixers);
var timer = setInterval(function() { var timer = setInterval(function() {

View File

@ -71,7 +71,7 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
if(data.type == "Train_Hmi_3D"){ if(data.type == "Train_Hmi_3D"){
//改变当前列车code //改变当前列车code
// console.log(data);
if(data.body.groupNumber){ if(data.body.groupNumber){
changeNowTrain(data.body); changeNowTrain(data.body);
updateDriveValue(data.body.groupNumber); updateDriveValue(data.body.groupNumber);

View File

@ -16,7 +16,7 @@ import {Stats} from '@/jlmap3d/main/lib/stats.min.js';
export function Jl3dSandBoxTest(dom,textUi,skinCode,routegroup,token) { export function Jl3dSandBoxTest(dom,textUi,skinCode,routegroup,token) {
let scope = this; let scope = this;
textUi.updataData("sss");
var camera, scene, renderer,controls, light; var camera, scene, renderer,controls, light;
camera = new THREE.PerspectiveCamera( 45, window.innerWidth / window.innerHeight, 0.001, 50000 ); camera = new THREE.PerspectiveCamera( 45, window.innerWidth / window.innerHeight, 0.001, 50000 );
@ -44,7 +44,7 @@ export function Jl3dSandBoxTest(dom,textUi,skinCode,routegroup,token) {
let manager = new dataManager(scene,camera,routegroup); let manager = new dataManager(scene,textUi,camera,routegroup);
manager.init(skinCode); manager.init(skinCode);

View File

@ -16,7 +16,7 @@ import { sandBoxConnect } from '@/jlmap3d/jl3dtrafficplan/sandbox/sandboxconnect
import { textUi } from '@/jlmap3d/jl3dtrafficplan/sandbox/textUi'; import { textUi } from '@/jlmap3d/jl3dtrafficplan/sandbox/textUi';
export function dataManager(scene,camera,routegroup) { export function dataManager(scene,textUi,camera,routegroup) {
let scope = this; let scope = this;
let section = new sectionModel(scene); let section = new sectionModel(scene);
@ -29,19 +29,19 @@ export function dataManager(scene,camera,routegroup) {
console.log(routegroup); console.log(routegroup);
this.nowConnect = ''; this.nowConnect = '';
var detaildiv = document.createElement("div"); // var detaildiv = document.createElement("div");
detaildiv.style.width = "128px"; // detaildiv.style.width = "128px";
detaildiv.id = "detail"; // detaildiv.id = "detail";
detaildiv.style.backgroundColor = "#ccc" // detaildiv.style.backgroundColor = "#ccc"
detaildiv.style.height = "256px"; // detaildiv.style.height = "256px";
detaildiv.style.border = "1px solid #f00"; // detaildiv.style.border = "1px solid #f00";
detaildiv.style.position = "absolute"; // detaildiv.style.position = "absolute";
detaildiv.style.top = "0px"; // detaildiv.style.top = "0px";
detaildiv.style.zIndex = 10; // detaildiv.style.zIndex = 10;
detaildiv.style.display = "none"; // detaildiv.style.display = "none";
document.body.appendChild(detaildiv); // document.body.appendChild(detaildiv);
let text = new textUi(scene); // let text = new textUi(scene);
text.init(); // text.init();
let modelmanager = new ModelManager(); let modelmanager = new ModelManager();
Materialload(scope); Materialload(scope);
@ -89,15 +89,18 @@ export function dataManager(scene,camera,routegroup) {
intersect = intersects[ 0 ]; intersect = intersects[ 0 ];
console.log(intersect.object.position); console.log(intersect.object.position);
console.log(text.textplane.position); // console.log(text.textplane.position);
console.log(intersect.object.name); console.log(intersect.object.name);
console.log(intersect.object.groupNumber); console.log(intersect.object.groupNumber);
detaildiv.style.display = ""; let uiPos = {
detaildiv.style.left = event.clientX-64 + "px"; x:event.clientX,
detaildiv.style.top = event.clientY-270 + "px"; y:event.clientY,
} else { };
detaildiv.style.display = "none"; textUi.updataUi("",uiPos);
} else {
// detaildiv.style.display = "none";
textUi.updataUi("none");
} }

View File

@ -3,7 +3,7 @@
<div style="position: absolute;right:50%;top:50%;z-index:10;background: #EBEBEB;" v-show="tuoguanbutton" @click="tuoguan">{{ tuoguanbuttonmsg }}</div> <div style="position: absolute;right:50%;top:50%;z-index:10;background: #EBEBEB;" v-show="tuoguanbutton" @click="tuoguan">{{ tuoguanbuttonmsg }}</div>
<div style="position: absolute;right:50%;top:60%;z-index:10;background: #EBEBEB;"> <div style="position: absolute;right:50%;top:60%;z-index:10;background: #EBEBEB;" v-show="isTraining" >
<el-select v-model="value" :placeholder="initMsg" @change="currentsel" @visible-change="clickselect" > <el-select v-model="value" :placeholder="initMsg" @change="currentsel" @visible-change="clickselect" >
<el-option <el-option
v-for="item in options" v-for="item in options"
@ -78,6 +78,7 @@ import axios from 'axios';
data() { data() {
return { return {
isTraining:true,
localStatic:JL3D_LOCAL_STATIC, localStatic:JL3D_LOCAL_STATIC,
options: [], options: [],
initMsg:"请选择列车", initMsg:"请选择列车",
@ -121,6 +122,7 @@ import axios from 'axios';
async mounted() { async mounted() {
if(this.$route.query.group){ if(this.$route.query.group){
getSimulationInfoNew(this.$route.query.group).then(netdata => { getSimulationInfoNew(this.$route.query.group).then(netdata => {
if(netdata.data.type == "SCRIPT_MAKING"){ if(netdata.data.type == "SCRIPT_MAKING"){
this.tuoguanbutton = true; this.tuoguanbutton = true;
} }
@ -137,6 +139,11 @@ import axios from 'axios';
beforeDestroy() { beforeDestroy() {
}, },
methods: { methods: {
changeTrainSelect(mode){
if(mode == "isTraining"){
this.isTraining = false;
}
},
currentsel(selVal){ currentsel(selVal){
let oldgroupnum = this.groupnum; let oldgroupnum = this.groupnum;
this.groupnum = selVal; this.groupnum = selVal;
@ -276,7 +283,7 @@ import axios from 'axios';
} }
}, },
updateDriveValue(newvalue){ updateDriveValue(newvalue){
if(newvalue != this.value){ if(newvalue != this.value){
this.value = newvalue; this.value = newvalue;
} }

View File

@ -86,7 +86,7 @@
<div id="sg" class="panebutton" style="bottom:6%;left:3%;" @click="sgclink"> <div id="sg" class="panebutton" style="bottom:6%;left:3%;" @click="sgclink">
<img class="buttonimg" :src="sgimg" /> <img class="buttonimg" :src="sgimg" />
<div class="buttontext">{{ $t('jlmap3d.electricGongSheng') }}</div> <div class="buttontext">{{ $t('jlmap3d.electricGongSheng') }}</div>
</div> </div>
<!-- 受电弓降 --> <!-- 受电弓降 -->
<div id="jg" class="panebutton" style="bottom:6%;left:17%;" @click="jgclick"> <div id="jg" class="panebutton" style="bottom:6%;left:17%;" @click="jgclick">
<img class="buttonimg" :src="jgimg" /> <img class="buttonimg" :src="jgimg" />

View File

@ -90,7 +90,7 @@ export default {
backmsg:this.$t('global.back'), backmsg:this.$t('global.back'),
// trainnum: '', // trainnum: '',
// stoptimes: '', // stoptimes: '',
dcontrolshow: false, dcontrolshow: true,
msgshow:false, msgshow:false,
controlmsg:"不能选择其它列车", controlmsg:"不能选择其它列车",
@ -177,7 +177,7 @@ export default {
}, },
mounted() { mounted() {
this.mmishow = true; this.mmishow = true;
window.datanew = this.datanew; // window.datanew = this.datanew;
window.updatestatus = this.updatestatus; window.updatestatus = this.updatestatus;
if(this.$route.query.type == "DRIVE"){ if(this.$route.query.type == "DRIVE"){
@ -207,7 +207,7 @@ export default {
// // this.jlmap3d = null; // // this.jlmap3d = null;
// } // }
// }, // },
show: function (skinCode,group,zindex) { show: function (skinCode,group,zindex,isTraining) {
// console.log("show"); // console.log("show");
// console.log(skinCode); // console.log(skinCode);
// console.log(this.jlmap3d); // console.log(this.jlmap3d);
@ -221,8 +221,10 @@ export default {
// this.jlmap3d.restart(); // this.jlmap3d.restart();
this.jlmap3d.eventon(); this.jlmap3d.eventon();
this.jlmap3d.animateon(); this.jlmap3d.animateon();
} }
if(isTraining){
this.$refs.dcontrol.changeTrainSelect(isTraining);
}
}, },
init: function (skinCode,group) { init: function (skinCode,group) {
const mapdata = this.$store.getters['map/map']; const mapdata = this.$store.getters['map/map'];

View File

@ -1,6 +1,11 @@
<template> <template>
<div class="textui" <div class="textui"
:style="{'background-image': 'url('+localStatic+'/texture/showmsg.png)'}"> :style="{
'background-image': 'url('+localStatic+'/texture/showmsg.png)',
'top': uiTop,
'left': uiLeft,
'display': uiDisplay,
}">
</div> </div>
@ -18,6 +23,9 @@ export default {
data() { data() {
return { return {
localStatic:JL3D_LOCAL_STATIC, localStatic:JL3D_LOCAL_STATIC,
uiDisplay:'none',
uiTop:'0px',
uiLeft:'0px',
} }
}, },
beforeDestroy() { beforeDestroy() {
@ -31,8 +39,13 @@ export default {
}, },
methods: { methods: {
updataData: function (data) { updataUi: function (display,pos) {
console.log(data); this.uiDisplay = display;
if(pos){
this.uiTop = (pos.y-210)+'px';
this.uiLeft = (pos.x-75) +'px';
}
} }
} }
} }
@ -42,8 +55,7 @@ export default {
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
.textui{ .textui{
position: absolute; position: absolute;
top:0;
left:0;
width:150px; width:150px;
height:300px; height:300px;
z-index: 11; z-index: 11;

View File

@ -482,7 +482,7 @@ export default {
if (this.$store.state.training.prdType == '04') { if (this.$store.state.training.prdType == '04') {
this.panelShow = false; this.panelShow = false;
this.drivingShow = true; this.drivingShow = true;
this.$refs.Jl3dDrive.show(this.mapId, this.group, 34); this.$refs.Jl3dDrive.show(this.mapId, this.group, 34,"isTraining");
} else { } else {
const routeData = this.$router.resolve({ const routeData = this.$router.resolve({
path:'/jlmap3d/sandbox', path:'/jlmap3d/sandbox',

View File

@ -74,6 +74,7 @@
:placeholder="item.placeholder" :placeholder="item.placeholder"
:disabled="item.disabled" :disabled="item.disabled"
:clearable="item.clearable" :clearable="item.clearable"
@change="((val)=>{deviceChange(val, item)})"
> >
<el-option <el-option
v-for="option in item.options" v-for="option in item.options"

View File

@ -0,0 +1,173 @@
<template>
<el-tabs v-model="activeName" class="card">
<el-tab-pane class="view-control" :label="$t('map.property')" name="first" :lazy="lazy">
<operate-property
ref="dataform"
:form="form"
:edit-model="editModel"
:rules="rules"
type="Line"
@updateMapModel="updateMapModel"
@clearDeviceSelect="clearDeviceSelect"
/>
</el-tab-pane>
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
<create-operate
ref="createForm"
:create-form="createForm"
:add-model="addModel"
:create-rules="rules"
@create="create"
/>
</el-tab-pane>
<el-tab-pane class="view-control" :label="$t('map.batchOperation')" name="third" :lazy="lazy">
<div class="view-content" style="text-align:center;">
<el-button type="primary" size="big" style="margin-top:10px" @click="generateCross">{{ $t('map.generateCross') }}</el-button>
</div>
</el-tab-pane>
</el-tabs>
</template>
<script>
import ConstConfig from '@/scripts/ConstConfig';
import Cookies from 'js-cookie';
import { mapGetters } from 'vuex';
import { getUID } from '@/jmapNew/utils/Uid';
import OperateProperty from './components/operateProperty';
import { deepAssign } from '@/utils/index';
import CreateOperate from './components/createOperate';
export default {
name:'CrossDraft',
components: {
OperateProperty,
CreateOperate
},
props: {
selected: {
type: Object,
default: function () {
return null;
}
}
},
data() {
return {
activeName: 'first',
lazy: true,
field: '',
crossList:[],
editModel: {
code: '',
name: '',
relateSwitchList: []
},
addModel:{
name: '',
relateSwitchList: []
},
rules: {
code: [
{ required: true, message: this.$t('rules.pleaseSelectCross'), trigger: 'change' }
],
name: [
{ required: true, message: this.$t('rules.pleaseInputCrossName'), trigger: 'blur' }
],
relateSwitchList:[
{ required: true, message: this.$t('rules.pleaseSelectSwitch'), trigger: 'change' }
]
}
};
},
computed: {
...mapGetters('map', [
'switchList'
// 'crossList'
]),
form() {
const form = {
labelWidth: '120px',
items: {
draw: {
name: this.$t('map.drawData'),
item: [
{ prop: 'code', label: this.$t('map.crossCoding'), type: 'select', optionLabel: 'code', optionValue: 'code',
options: this.crossList, deviceChange: this.deviceChange },
{ prop: 'name', label: this.$t('map.crossName'), type: 'input' },
{ prop: 'relateSwitchList', label: this.$t('map.relateSwitchList'), type: 'multiSelect', optionLabel: 'name&&code',
optionValue: 'code', options: this.switchList, disabled:true }
]
}
}
};
return form;
},
createForm() {
const form = {
labelWidth: '120px',
items:{
all:{
name:'',
item: [
{ prop: 'name', label: this.$t('map.crossName'), type: 'input' },
{ prop: 'relateSwitchList', label:this.$t('map.relateSwitchList'), type: 'multiSelectHover',
optionLabel: 'name&&code', optionValue: 'code', options: this.switchList, hover: this.hover,
buttonType: 'relatedSwitch', buttonShowType: this.relatedSwitchButtonShow, deviceChange: this.changeSwitch }
]
}
}
};
return form;
},
relatedSwitchButtonShow() {
return this.field === 'relatedSwitch';
}
},
methods:{
hover(field) {
this.field = field == this.field ? '' : field;
if (this.field) {
this.$emit('deviceSelect', 'Cross');
} else {
this.$emit('deviceSelect', '');
}
},
updateMapModel(data) {
this.$emit('updateMapModel', data);
},
clearDeviceSelect() {
this.$emit('deviceSelect', '');
},
create() {
},
generateCross() {
},
changeSwitch(switchList) {
const result = this.judgeRelateSwitch();
if (!result) { this.addModel.relateSwitchList.pop(); }
},
deviceSelect(selected) {
if (selected && selected._type.toUpperCase() === 'Station'.toUpperCase() && this.field != 'relatedSwitch') {
} else if (selected && selected._type.toUpperCase() === 'Switch'.toUpperCase() && this.field == 'relatedSwitch') {
this.activeName = 'second';
if (!this.addModel.relateSwitchList.includes(selected.code)) {
this.judgeRelateSwitch() && this.addModel.relateSwitchList.push(selected.code);
}
}
},
judgeRelateSwitch() {
if (this.addModel.relateSwitchList.length >= 4) {
this.$message.error('关联的道岔不能超过4个');
return false;
}
return true;
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.card {
height: 100%;
}
</style>

View File

@ -66,6 +66,7 @@ import Arrow from './arrow';
import SplitScreen from './splitScreen'; import SplitScreen from './splitScreen';
import FloodGate from './floodGate'; import FloodGate from './floodGate';
import DirectionRod from './directionRod'; import DirectionRod from './directionRod';
import Cross from './cross';
import { EventBus } from '@/scripts/event-bus'; import { EventBus } from '@/scripts/event-bus';
export default { export default {
@ -95,7 +96,8 @@ export default {
Arrow, Arrow,
SplitScreen, SplitScreen,
FloodGate, FloodGate,
DirectionRod DirectionRod,
Cross
}, },
props: { props: {
selected: { selected: {
@ -135,7 +137,8 @@ export default {
{label: '站间分隔', name:'SplitStation', menus:SplitStation}, {label: '站间分隔', name:'SplitStation', menus:SplitStation},
{label: '箭头', name:'Arrow', menus:Arrow}, {label: '箭头', name:'Arrow', menus:Arrow},
{label: '防淹门', name: 'FloodGate', menus: FloodGate}, {label: '防淹门', name: 'FloodGate', menus: FloodGate},
{label: '方向杆', name: 'DirectionRod', menus: DirectionRod} {label: '方向杆', name: 'DirectionRod', menus: DirectionRod},
{label: this.$t('map.cross'), name: 'Cross', menus: Cross}
], ],
selectDevice:'', selectDevice:'',
enabledTab: 'Section', enabledTab: 'Section',