Merge branch 'test' of https://git.code.tencent.com/lian-cbtc/jl-client into test
# Conflicts: # src/jmapNew/config/skinCode/nanjing_02.js # src/jmapNew/utils/parser.js
This commit is contained in:
commit
752b4e9a26
@ -71,7 +71,7 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
|
||||
if(data.type == "Train_Hmi_3D"){
|
||||
|
||||
//改变当前列车code
|
||||
// console.log(data);
|
||||
|
||||
if(data.body.groupNumber){
|
||||
changeNowTrain(data.body);
|
||||
updateDriveValue(data.body.groupNumber);
|
||||
|
@ -164,7 +164,7 @@ export function dataManager(scene,textUi,camera,routegroup) {
|
||||
for(let i=0;i<posx.length;i++){
|
||||
if(posx[i]<=119.390592){
|
||||
pointsTop.push(new THREE.Vector3( (posx[i] -originX)*double, 0, -(posz[i]-originY)*double));
|
||||
pointsDown.push(new THREE.Vector3( (posx[i] -originX+0.001)*double, 0, -(posz[i]-originY+0.001)*double));
|
||||
// pointsDown.push(new THREE.Vector3( (posx[i] -originX+0.001)*double, 0, -(posz[i]-originY+0.001)*double));
|
||||
}
|
||||
|
||||
}
|
||||
@ -175,6 +175,34 @@ export function dataManager(scene,textUi,camera,routegroup) {
|
||||
curveTop.closed = false;
|
||||
scope.topCurve = curveTop;
|
||||
|
||||
let pointsArray = [];
|
||||
let greenMaterial =new THREE.MeshBasicMaterial({color: 0xffff00,opacity: 0.75});
|
||||
for(var i = 0.00; i <= 1.00; i += 0.005){
|
||||
|
||||
var point = curveTop.getPointAt(i);
|
||||
|
||||
var tangent = curveTop.getTangent(i);
|
||||
var extension1 = new THREE.Vector3(tangent.x*2,0,tangent.z*2);
|
||||
var extension2 = new THREE.Vector3(extension1.x*2,0,extension1.y*2);
|
||||
|
||||
var tangentGeometry = new THREE.Geometry();
|
||||
tangentGeometry.vertices.push(tangent, extension1, extension2);
|
||||
var tangentLine = new THREE.Line(tangentGeometry,greenMaterial);
|
||||
tangentLine.position.set(point.x, point.y, point.z);
|
||||
|
||||
tangentLine.updateMatrixWorld(); // VERY IMPORTANT
|
||||
|
||||
var normal = tangentLine.clone();
|
||||
normal.rotateZ(Math.PI/2);
|
||||
|
||||
var normalLastVertex = normal.geometry.vertices[2].clone();
|
||||
normalLastVertex.applyMatrix4(normal.matrixWorld); //convert to world coords.
|
||||
|
||||
pointsDown.push(normalLastVertex); //for using them out of the loop
|
||||
|
||||
}
|
||||
|
||||
|
||||
var curveDown = new THREE.CatmullRomCurve3(pointsDown );
|
||||
curveDown.curveType = "chordal";
|
||||
curveDown.tension = 0.15;
|
||||
|
@ -70,6 +70,18 @@ export function DriverLoadNew(data,scope,netdata,mapdata,sectionlist,signallist,
|
||||
let signaldata = JSON.parse(netdata.signals);
|
||||
let standsdata = JSON.parse(netdata.stands);
|
||||
let psddata = data.psdList;
|
||||
|
||||
if(standsdata[0].inside == undefined){
|
||||
for(let i=0;i<standsdata.length;i++){
|
||||
for(let j=0;j<mapdata.stationStandList.length;j++){
|
||||
if(standsdata[i].code == mapdata.stationStandList[j].stationCode){
|
||||
standsdata[i].inside = mapdata.stationStandList[j].inside;
|
||||
j = mapdata.stationStandList.length;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
assetloader.setModelListOver(JSON.parse(netdata.assets).sceneAssetList,0,JSON.parse(netdata.assets).others);
|
||||
|
||||
assetloader.assetPromiseOver(sceneload)
|
||||
|
@ -135,7 +135,7 @@ export function StationStandListN() {
|
||||
}
|
||||
this.loadpromise = function(stationdata,standsdata,psddata,scene,assetloader,mixers,actionss,mode,otherStation){
|
||||
return new Promise(function(resolve, reject){
|
||||
|
||||
// console.log(standsdata);
|
||||
let stations = stationdata;
|
||||
let selectmesh1;
|
||||
let selectmesh2;
|
||||
@ -260,7 +260,8 @@ export function StationStandListN() {
|
||||
|
||||
newstationmesh.code = standsdata[i].code;
|
||||
newstationmesh.name = standsdata[i].code;
|
||||
|
||||
// console.log(newstationmesh.name);
|
||||
// console.log(standsdata[i].inside);
|
||||
newstationmesh.inside = standsdata[i].inside;
|
||||
newstationmesh.position.x = standsdata[i].position.x;
|
||||
newstationmesh.position.y = standsdata[i].position.y;
|
||||
@ -284,7 +285,7 @@ export function StationStandListN() {
|
||||
let mixer = new THREE.AnimationMixer( newstationmesh.getObjectByName('door'+num) );
|
||||
|
||||
for(let n=0;n<psddata.length;n++){
|
||||
|
||||
|
||||
if(psddata[n].standCode == standsdata[i].stands[j].code){
|
||||
|
||||
let key = psddata[n].code;
|
||||
|
@ -50,7 +50,7 @@ export function TrainListN() {
|
||||
scope.group.add(newmesh);
|
||||
scope.otherTrainmodels.push(newmesh);
|
||||
}
|
||||
scope.otherTrainList = {};
|
||||
scope.otherTrainList = [];
|
||||
for(let j=0,lenj = data.length;j<lenj;j++){
|
||||
this.otherTrainmodels[j].code = data[j].code;
|
||||
scope.otherTrainList[data[j].code] = this.otherTrainmodels[j];
|
||||
|
@ -26,7 +26,7 @@ class SkinCode extends defaultStyle {
|
||||
z: 10,
|
||||
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
|
||||
distance: 6, // 文字离区段距离
|
||||
fontSize: 8, // 字体大小
|
||||
fontSize: 11, // 字体大小
|
||||
fontWeight: 'normal', // 字体粗细
|
||||
fontColor: '#FFFFFF', // 字体颜色
|
||||
textAlign: 'center', // 水平对齐方式
|
||||
@ -847,22 +847,29 @@ class SkinCode extends defaultStyle {
|
||||
fontOffsetY: 24
|
||||
};
|
||||
|
||||
this[deviceType.Responder] = {
|
||||
block: {
|
||||
mapStyle: {
|
||||
FB: { fill: '#fff' },
|
||||
VB: { fill: '#666' },
|
||||
IB: { fill: '#666' }
|
||||
}
|
||||
},
|
||||
delta: {
|
||||
fill: '#fff'
|
||||
},
|
||||
text: {
|
||||
textFill: '#fff'
|
||||
}
|
||||
};
|
||||
// /** 岔心 */
|
||||
// this[deviceType.Cross] = {
|
||||
// centerSquare:{
|
||||
// defaultColor:'#fff'
|
||||
// }
|
||||
|
||||
// };
|
||||
|
||||
// this[deviceType.Responder] = {
|
||||
// block: {
|
||||
// mapStyle: {
|
||||
// FB: { fill: '#fff' },
|
||||
// VB: { fill: '#666' },
|
||||
// IB: { fill: '#666' }
|
||||
// }
|
||||
// },
|
||||
// delta: {
|
||||
// fill: '#fff'
|
||||
// },
|
||||
// text: {
|
||||
// textFill: '#fff'
|
||||
// }
|
||||
// };
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6,6 +6,21 @@ import Rect from 'zrender/src/graphic/shape/Rect';
|
||||
import Text from 'zrender/src/graphic/Text';
|
||||
import Polygon from 'zrender/src/graphic/shape/Polygon';
|
||||
|
||||
const defaultStyle = {
|
||||
block:{
|
||||
stroke: '#fff', mapStyle: {
|
||||
FB: { fill: '#fff' },
|
||||
VB: { fill: '#666' },
|
||||
IB: { fill: '#666' }
|
||||
}
|
||||
},
|
||||
text:{
|
||||
textFill: '#fff'
|
||||
},
|
||||
delta: {
|
||||
fill: '#fff'
|
||||
}
|
||||
};
|
||||
export default class Responder extends Group {
|
||||
constructor(model, style) {
|
||||
super();
|
||||
@ -24,18 +39,18 @@ export default class Responder extends Group {
|
||||
|
||||
create() {
|
||||
const model = this.model;
|
||||
const responderStyle = this.style.Responder;
|
||||
const responderStyle = this.style.Responder || defaultStyle;
|
||||
const blockX = model.position.x;
|
||||
const blockY = model.position.y;
|
||||
const blockWidth = responderStyle.block.width || 5;
|
||||
const blockHeight = responderStyle.block.height || 12;
|
||||
const blockStroke = responderStyle.block.stroke || '#000';
|
||||
const blockStyle = responderStyle.block.mapStyle[model.type] || { fill: '#000'};
|
||||
const blockStroke = responderStyle.block.stroke;
|
||||
const blockStyle = responderStyle.block.mapStyle[model.type] || { fill: '#fff'};
|
||||
const textX = model.position.x + model.textOffset.x;
|
||||
const textY = model.position.y + model.textOffset.y;
|
||||
const textName = `${model.type}-${model.name}`;
|
||||
const textFill = responderStyle.text.textFill || '#fff';
|
||||
const deltaFill = responderStyle.delta.fill || '#fff';
|
||||
const textFill = responderStyle.text.textFill;
|
||||
const deltaFill = responderStyle.delta.fill;
|
||||
const padding = 1.2;
|
||||
|
||||
this.block = new Rect({
|
||||
@ -118,8 +133,8 @@ export default class Responder extends Group {
|
||||
|
||||
setState(model) {
|
||||
if (!this.isShowShape) return;
|
||||
const responderStyle = this.style.Responder;
|
||||
const style = responderStyle.block.mapStyle[model.type] || { fill: '#000'};
|
||||
const responderStyle = this.style.Responder || defaultStyle;
|
||||
const style = responderStyle.block.mapStyle[model.type] || {fill: '#000'};
|
||||
this.block.setStyle(style);
|
||||
[this.delta1, this.delta2].forEach(el => {
|
||||
model.type == 'IB' ? el.show() : el.hide();
|
||||
|
@ -263,7 +263,6 @@ export function parser(data, skinCode, showConfig) {
|
||||
mapDevice[elem.code] = createDevice(deviceType.DirectionRod, elem, propConvert, showConfig);
|
||||
}, this);
|
||||
|
||||
if (!data.responderList) { data.responderList = []; }
|
||||
zrUtil.each(data.responderList || [], elem => {
|
||||
mapDevice[elem.code] = createDevice(deviceType.Responder, elem, propConvert, showConfig);
|
||||
}, this);
|
||||
|
@ -537,7 +537,7 @@ const map = {
|
||||
},
|
||||
responderList: (state) => {
|
||||
if (state.map) {
|
||||
return state.map.responderList;
|
||||
return state.map.responderList || [];
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ export default {
|
||||
isShow = true;
|
||||
}
|
||||
}
|
||||
return isShow;
|
||||
return this.$store.state.user.companyId || isShow;
|
||||
},
|
||||
isLocal() { // 是否为本地项目
|
||||
return process.env.VUE_APP_PRO === 'local';
|
||||
|
@ -99,7 +99,7 @@ export default {
|
||||
isShow = true;
|
||||
}
|
||||
}
|
||||
return isShow;
|
||||
return this.$store.state.user.companyId || isShow;
|
||||
},
|
||||
isLocal() { // 是否为本地项目
|
||||
return process.env.VUE_APP_PRO === 'local';
|
||||
|
@ -141,7 +141,7 @@ import axios from 'axios';
|
||||
methods: {
|
||||
changeTrainSelect(mode){
|
||||
if(mode == "isTraining"){
|
||||
this.isTraining = false;
|
||||
// this.isTraining = false;
|
||||
}
|
||||
},
|
||||
currentsel(selVal){
|
||||
|
@ -1,13 +1,13 @@
|
||||
<template>
|
||||
<el-tabs v-model="activeName" class="card">
|
||||
<el-tab-pane class="view-control" :label="$t('map.property')" name="first" :lazy="lazy">
|
||||
<responder-model ref="respModel" :field="field" :responder-type-list="responderTypeList" :centralized-station-list="centralizedStationList" v-on="$listeners" @hover="hover" />
|
||||
<responder-model ref="respModel" :field="field" :responder-type-list="responderTypeList" :centralized-station-list="centralizedStationList" v-on="$listeners" @hover="hover" @deviceChange="deviceChange" @deviceSelect="deviceSelect"/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
|
||||
<responder-create ref="respCreate" :field="field" :responder-type-list="responderTypeList" :centralized-station-list="centralizedStationList" v-on="$listeners" @hover="hover" />
|
||||
<responder-create ref="respCreate" :field="field" :responder-type-list="responderTypeList" :centralized-station-list="centralizedStationList" v-on="$listeners" @hover="hover" @deviceChange="deviceChange" @deviceSelect="deviceSelect"/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane class="view-control" label="批量创建" name="third" :lazy="lazy">
|
||||
<responder-batch ref="respBatch" :field="field" :responder-type-list="responderTypeList" :centralized-station-list="centralizedStationList" v-on="$listeners" @hover="hover" />
|
||||
<responder-batch ref="respBatch" :field="field" :responder-type-list="responderTypeList" :centralized-station-list="centralizedStationList" v-on="$listeners" @hover="hover" @deviceChange="deviceChange" @deviceSelect="deviceSelect"/>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</template>
|
||||
|
@ -446,11 +446,16 @@ export default {
|
||||
},
|
||||
changeStartSection(data) {
|
||||
const section = this.$store.getters['map/getDeviceByCode'](data);
|
||||
if (section.belongStation) {
|
||||
if (section &&
|
||||
section.belongStation) {
|
||||
this.addModel.startStationCode = section.belongStation;
|
||||
this.judgeAllowSelected();
|
||||
this.addStartSectionData(false);
|
||||
} else {
|
||||
this.addModel.parkSectionCodeList.shift();
|
||||
this.addModel.startStationCode = '';
|
||||
this.addModel.startSectionCode = '';
|
||||
}
|
||||
this.judgeAllowSelected();
|
||||
this.addStartSectionData(false);
|
||||
},
|
||||
changeEndStation() {
|
||||
this.judgeAllowSelected();
|
||||
@ -459,16 +464,17 @@ export default {
|
||||
changeEndSection(data) {
|
||||
if (data) {
|
||||
const section = this.$store.getters['map/getDeviceByCode'](data);
|
||||
if (section.belongStation) {
|
||||
if (section &&
|
||||
section.belongStation) {
|
||||
this.addModel.endStationCode = section.belongStation;
|
||||
}
|
||||
this.addModel.destinationCode = section.destinationCode || '';
|
||||
this.judgeAllowSelected();
|
||||
this.addEndSectionData(false);
|
||||
} else {
|
||||
this.addModel.parkSectionCodeList.pop();
|
||||
this.addModel.endStationCode = '';
|
||||
this.addModel.endSectionCode = '';
|
||||
this.addModel.parkSectionCodeList.pop();
|
||||
}
|
||||
},
|
||||
judgeAllowSelected() {
|
||||
@ -589,10 +595,18 @@ export default {
|
||||
}
|
||||
case 'top': {
|
||||
if (isStation) {
|
||||
list.splice(0, 1, data);
|
||||
if (list.find(el => { el.sectionCode == this.addModel.startSectionCode; })) {
|
||||
list.splice(0, 1, data);
|
||||
} else {
|
||||
list.unshift(data);
|
||||
}
|
||||
} else {
|
||||
if (index < 0) {
|
||||
list.splice(0, 1, data);
|
||||
if (list.find(el => { el.sectionCode == this.addModel.startSectionCode; })) {
|
||||
list.splice(0, 1, data);
|
||||
} else {
|
||||
list.unshift(data);
|
||||
}
|
||||
} else {
|
||||
if (index == list.length - 1 && list.length >= 2) {
|
||||
this.addModel.startSectionCode = list[0].sectionCode;
|
||||
@ -607,21 +621,18 @@ export default {
|
||||
}
|
||||
case 'bottom': {
|
||||
if (isStation) {
|
||||
if (list.length >= 2) {
|
||||
if (list.find(el => { el.sectionCode == this.addModel.endSectionCode; })) {
|
||||
list.splice(list.length - 1, 1, data);
|
||||
} else {
|
||||
if (index < 0) {
|
||||
list.push(data);
|
||||
}
|
||||
list.push(data);
|
||||
}
|
||||
} else {
|
||||
if (index < 0) {
|
||||
// debugger;
|
||||
// if (list.length >= 2) {
|
||||
// list.splice(list.length - 1, 1, data);
|
||||
// } else {
|
||||
list.push(data);
|
||||
// }
|
||||
if (list.find(el => { el.sectionCode == this.addModel.endSectionCode; })) {
|
||||
list.splice(list.length - 1, 1, data);
|
||||
} else {
|
||||
list.push(data);
|
||||
}
|
||||
} else {
|
||||
if (index == 0 && list.length >= 2) {
|
||||
this.addModel.endSectionCode = list[list.length - 1].sectionCode;
|
||||
|
@ -1,42 +1,42 @@
|
||||
<template>
|
||||
<div class="container">
|
||||
<template v-if="list.length" >
|
||||
<el-card class="el" v-for="(el,i) in list" :key="i" shadow="hover">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>{{el.name}}</span>
|
||||
</div>
|
||||
<div style="padding: 30px 80px">
|
||||
<slot :data="el" />
|
||||
</div>
|
||||
<div class="clearfix" style="text-align:right">
|
||||
<el-button type="text" @click.stop="onSelect(el)">编辑</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
<template v-else>
|
||||
<span>暂无数据</span>
|
||||
</template>
|
||||
</div>
|
||||
<div class="container">
|
||||
<template v-if="list.length">
|
||||
<el-card v-for="(el,i) in list" :key="i" class="el" shadow="hover">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>{{ el.name }}</span>
|
||||
</div>
|
||||
<div style="padding: 30px 80px">
|
||||
<slot :data="el" />
|
||||
</div>
|
||||
<div class="clearfix" style="text-align:right">
|
||||
<el-button type="text" @click.stop="onSelect(el)">编辑</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
<template v-else>
|
||||
<span>暂无数据</span>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
list: {
|
||||
type: Array,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onSelect(el) {
|
||||
this.$emit('select', el)
|
||||
}
|
||||
}
|
||||
}
|
||||
props: {
|
||||
list: {
|
||||
type: Array,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
onSelect(el) {
|
||||
this.$emit('select', el);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
@ -91,7 +91,7 @@ export default {
|
||||
isShow = true;
|
||||
}
|
||||
}
|
||||
return isShow;
|
||||
return this.$store.state.user.companyId || isShow;
|
||||
},
|
||||
project() {
|
||||
return getSessionStorage('project');
|
||||
|
Loading…
Reference in New Issue
Block a user