This commit is contained in:
fan 2020-04-22 14:32:00 +08:00
commit c3ca6de6d8
6 changed files with 38 additions and 23 deletions

View File

@ -140,10 +140,10 @@ export function JLmapDriving(dom,data,mapId,storemod,translation,routegroup,proj
// controls3.getObject().rotation.x = Math.PI/2; // controls3.getObject().rotation.x = Math.PI/2;
scene.add(controls3.getObject()); scene.add(controls3.getObject());
let cameracctv = new THREE.PerspectiveCamera(60, dom.clientWidth/dom.clientHeight, 1, 40); let cameracctv = new THREE.PerspectiveCamera(50, dom.clientWidth/dom.clientHeight, 1, 10);
cameracctv.position.set( 2, -1,27 ); cameracctv.position.set( 0, -1,30 );
cameracctv.rotation.y = Math.PI/2; // cameracctv.rotation.y = Math.PI/2;
camera.add(cameracctv); camera.add(cameracctv);

View File

@ -53,6 +53,8 @@ export function JLmap3d(dom, data,skinCode,storemod,routegroup,project) {
let camera = SetCamera(dom); let camera = SetCamera(dom);
//定义场景(渲染容器) //定义场景(渲染容器)
let scene = SetScene(project); let scene = SetScene(project);
let scenesimulation = new THREE.Group();
scene.add(scenesimulation);
//定义镜头操作 //定义镜头操作
let controls = new THREE.OrbitControls(camera); let controls = new THREE.OrbitControls(camera);
controls.maxPolarAngle = Math.PI/2; controls.maxPolarAngle = Math.PI/2;
@ -110,14 +112,14 @@ export function JLmap3d(dom, data,skinCode,storemod,routegroup,project) {
scope.jsonwebwork = new Worker("../../static/workertest/jsonworker.js"); scope.jsonwebwork = new Worker("../../static/workertest/jsonworker.js");
scope.Subscribe = new Jlmap3dSubscribe(scope,routegroup,scope.jsonwebwork); scope.Subscribe = new Jlmap3dSubscribe(scope,routegroup,scope.jsonwebwork);
scope.Subscribe.socketon(scope.Subscribe.topic); scope.Subscribe.socketon(scope.Subscribe.topic);
SimulationLoad(mapnetdata,scope,netdata.data,mapdata,camera,controls,scene,storemod); SimulationLoad(mapnetdata,scope,netdata.data,mapdata,camera,controls,scenesimulation,storemod);
}else{ }else{
scope.datatype = "new"; scope.datatype = "new";
scope.jsonwebworknew = new Worker("../../static/workertest/jsonworkernew.js"); scope.jsonwebworknew = new Worker("../../static/workertest/jsonworkernew.js");
scope.Subscribe = new Jlmap3dSubscribeNew(scope,routegroup,scope.jsonwebworknew); scope.Subscribe = new Jlmap3dSubscribeNew(scope,routegroup,scope.jsonwebworknew);
scope.Subscribe.socketon(scope.Subscribe.topic); scope.Subscribe.socketon(scope.Subscribe.topic);
SimulationLoadNew(mapnetdata,scope,netdata.data,mapdata,camera,controls,scene,storemod); SimulationLoadNew(mapnetdata,scope,netdata.data,mapdata,camera,controls,scenesimulation,storemod);
} }
}); });
@ -187,12 +189,12 @@ export function JLmap3d(dom, data,skinCode,storemod,routegroup,project) {
scope.webwork.onmessage = function (event) { scope.webwork.onmessage = function (event) {
//更新列车位置 //更新列车位置
// if(scope.datatype == "new"){ if(scope.datatype == "new"){
//
// UpdateTrainNew(camera,trainlisttest); UpdateTrainNew(camera,trainlisttest);
// }else{ }else{
// UpdateTrain(camera,trainlisttest); UpdateTrain(camera,trainlisttest);
// } }
if(camerarail.moveswitch == true){ if(camerarail.moveswitch == true){
// console.log(camerarail.progress); // console.log(camerarail.progress);

View File

@ -6,6 +6,7 @@ import { MessageBox } from 'element-ui';
import { getToken } from '@/utils/auth'; import { getToken } from '@/utils/auth';
import { getBaseUrl } from '@/utils/baseUrl'; import { getBaseUrl } from '@/utils/baseUrl';
import { EventBus } from '@/scripts/event-bus'; import { EventBus } from '@/scripts/event-bus';
import Vue from 'vue';
const BASE_API = getBaseUrl(); const BASE_API = getBaseUrl();
@ -61,8 +62,15 @@ service.interceptors.response.use(
}); });
}); });
}); });
} } else {
Vue.prototype.$alert('<strong>服务异常: <i style="color: red;">' + res.message + '</i></strong>', '请求结果', {
confirmButtonText: '确定',
dangerouslyUseHTMLString: true,
closeOnClickModal: false
}).then(() => {
return Promise.reject(res); return Promise.reject(res);
});
}
} else { } else {
return response.data; return response.data;
} }

View File

@ -229,7 +229,7 @@ export default {
deleteObj() { deleteObj() {
this.doClose(); this.doClose();
const _that = this; const _that = this;
this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), { this.$confirm('是否确认删除 “' + this.editModel.name + '" ' + ' ', this.$t('tip.hint'), {
confirmButtonText: this.$t('map.confirm'), confirmButtonText: this.$t('map.confirm'),
cancelButtonText: this.$t('map.cancel'), cancelButtonText: this.$t('map.cancel'),
type: 'warning' type: 'warning'

View File

@ -227,9 +227,11 @@ export default {
} else { } else {
importRunPlan({ mapId: that.$route.params.mapId || '02', runPlanList: jsonData }).then(response => { importRunPlan({ mapId: that.$route.params.mapId || '02', runPlanList: jsonData }).then(response => {
that.loadingDig.close(); that.loadingDig.close();
if (response && response.code == 200) {
that.$message.success(that.$t('tip.importOperationGraphSuccessfully')); that.$message.success(that.$t('tip.importOperationGraphSuccessfully'));
that.$emit('refresh'); that.$emit('refresh');
// this.$emit('dispatchDialog', { name: 'openRunPlan', params: {type: 'add'} }); // this.$emit('dispatchDialog', { name: 'openRunPlan', params: {type: 'add'} });
}
}).catch(error => { }).catch(error => {
that.loadingDig.close(); that.loadingDig.close();
that.$message.warning(`${that.$t('tip.importRunGraphFailed')} ${error.message}`); that.$message.warning(`${that.$t('tip.importRunGraphFailed')} ${error.message}`);

View File

@ -311,14 +311,17 @@ export default {
}); });
}); });
}, },
async handleSimulationCheck(index, row) { handleSimulationCheck(index, row) {
const res = await simulationCheck(row.id); simulationCheck(row.id).then(res=>{
if (!res.data.length) { if (!res.data.length) {
this.$message.success(this.$t('publish.simulationDataIsValidated')); this.$message.success(this.$t('publish.simulationDataIsValidated'));
return; return;
} }
this.tableToExcel(res.data); this.tableToExcel(res.data);
this.$messageBox(this.$t('tip.dataValidationFailed')); this.$messageBox(this.$t('tip.dataValidationFailed'));
}).catch(error=>{
this.$messageBox(this.$t('tip.dataValidationFailed') + error.message);
});
}, },
tableToExcel(data) { tableToExcel(data) {
const filterVal = ['index']; const filterVal = ['index'];