This commit is contained in:
lVAL 2020-11-18 15:42:13 +08:00
commit fd5467a741
380 changed files with 11130 additions and 12577 deletions

View File

@ -7,6 +7,8 @@ NODE_ENV = 'development'
# VUE_APP_BASE_API = 'http://192.168.3.4:9000'
VUE_APP_BASE_API = 'http://192.168.3.6:9000'
VUE_APP_VOICE_API = 'https://test.joylink.club/jlcloud/'
# VUE_APP_VOICE_API = 'http://192.168.8.110:9008'
# vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
# to control whether the babel-plugin-dynamic-import-node plugin is enabled.

View File

@ -11,7 +11,6 @@ pipeline {
nodejs 'nodejs-10'
}
steps {
sh 'npm update'
sh 'npm install'
sh 'npm run build'
}

View File

@ -11,7 +11,6 @@ pipeline {
nodejs 'nodejs-10'
}
steps {
sh 'npm update'
sh 'npm install'
sh 'npm run test'
}

View File

@ -29,6 +29,7 @@
"path-to-regexp": "2.4.0",
"qrcode.vue": "^1.6.2",
"qs": "^6.9.3",
"quill-image-extend-module": "^1.1.2",
"recordrtc": "^5.5.9",
"script-loader": "^0.7.2",
"sessionstorage": "^0.1.0",

View File

@ -236,3 +236,10 @@ export function getNewMapDataByMapId(mapId) {
method: 'get'
});
}
/** 发布地图根据id生成子系统及权限 */
export function generateAncillaryData(mapId) {
return request({
url: `/api/map/${mapId}/function/generate`,
method: 'post'
});
}

84
src/api/learn.js Normal file
View File

@ -0,0 +1,84 @@
import request from '@/utils/request';
// 根据postId帖子ID分页查询留言列表
export function queryMessagePagingByPostId(postId, params) {
return request({
url: `/api/learn/${postId}/message/pagedQuery/postId`,
method: 'get',
params: params
});
}
// 根据项目分页查询留言列表
export function queryMessagePagingByProjectCode(projectCode, params) {
return request({
url: `/api/learn/${projectCode}/message/pagedQuery/project`,
method: 'get',
params: params
});
}
// 回复帖子
export function answerPost(data) {
return request({
url: `/api/learn/message/create`,
method: 'post',
data: data
});
}
// 评论留言
export function commentLevelMessage(messageId, data) {
return request({
url: `/api/learn/${messageId}/comment`,
method: 'post',
data: data
});
}
// 评论 留言的评论
export function commentComents(messageId, commentId, data) {
return request({
url: `/api/learn/${messageId}/${commentId}/comment`,
method: 'post',
data: data
});
}
// 管理员删除留言
export function deleteMessageByAdmin(messageId) {
return request({
url: `/api/learn/${messageId}/deleteMessage/admin`,
method: 'delete'
});
}
// 用户自己删除留言
export function deleteMessageBySelf(messageId) {
return request({
url: `/api/learn/${messageId}/deleteMessage/user`,
method: 'delete'
});
}
// 查询留言的评论列表
export function queryMessageCommentList(messageId) {
return request({
url: `/api/learn/${messageId}/list`,
method: 'get'
});
}
// 删除评论回复管理员
export function deleteCommentByAdmin(commentId) {
return request({
url: `/api/learn/${commentId}/deleteComment/admin`,
method: 'delete'
});
}
// 删除评论回复用户
export function deleteCommentBySelf(commentId) {
return request({
url: `/api/learn/${commentId}/deleteComment/user`,
method: 'delete'
});
}
// 根据项目获取项目关联的帖子
export function getPostByProjectCode(projectCode) {
return request({
url: `/api/learn/${projectCode}/post`,
method: 'get'
});
}

BIN
src/assets/bg_board.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 125 KiB

BIN
src/assets/delete.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
src/assets/like.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
src/assets/reply.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
src/assets/unlike.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

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

View File

@ -4,7 +4,8 @@
ref="editor"
v-model="content"
:options="options"
:style="{height: height+'px', 'margin-bottom': '80px'}"
style="background-color: #fff"
:style="{height: height+'px', 'margin-bottom': marginBottom+'px'}"
@change="onChange"
@blur="onBlur"
@focus="onFocus"
@ -13,9 +14,10 @@
</template>
<script>
import { quillEditor } from 'vue-quill-editor';
import { quillEditor, Quill } from 'vue-quill-editor';
import 'quill/dist/quill.snow.css';
import { ImageExtend, QuillWatch} from 'quill-image-extend-module';
Quill.register('modules/ImageExtend', ImageExtend);
export default {
components: {
quillEditor
@ -32,12 +34,69 @@ export default {
placeholder: {
type: String,
default: ''
},
marginBottom: {
type: Number,
default: 80
},
unloadImg: {
type: Boolean,
default: false
},
noHandleP: {
type: Boolean,
defalut: false
}
},
data() {
return {
content: '',
options: {
content: ''
};
},
computed: {
editor() {
return this.$refs.editor.quill;
},
options() {
const that = this;
return this.unloadImg ? {
modules: {
ImageExtend: {
loading: true,
name: 'file',
size: 3,
action: `https://test.joylink.club/jlfile/api/upload/PICTURE?appId=00001&appSecret=joylink00001`,
response: (res) => {
return `https://test.joylink.club/oss/joylink${res.data}`;
},
error: () => { that.$message.error('图片上传失败,请检查网络状态'); },
sizeError: () => { that.$message.error('图片上传失败图片大小限制3MB'); } //
},
toolbar: {
container: [
['bold', 'italic', 'underline', 'strike'],
[],
[],
[{'list': 'ordered'}, {'list': 'bullet'}],
[{'script': 'sub'}, {'script': 'super'}],
[{'indent': '-1'}, {'indent': '+1'}],
[{'direction': 'rtl'}],
[{'size': ['small', 'large', 'huge']}],
[{'color': [], 'background': []}],
[{'font': []}],
[{'align': []}],
['clean'],
['image']
],
handlers: {
'image': function () {
QuillWatch.emit(this.quill.id);
}
}
}
},
placeholder: '请输入'
} : {
modules: {
toolbar: [
['bold', 'italic', 'underline', 'strike'],
@ -54,12 +113,7 @@ export default {
['clean']
]
}
}
};
},
computed: {
editor() {
return this.$refs.editor.quill;
};
},
titleConfig () {
return {
@ -91,11 +145,13 @@ export default {
watch: {
'value': function(val) {
this.$nextTick(() => {
if (val != this.$escapeHTML(this.content)) {
if (val != this.$escapeHTML(this.content) && !this.noHandleP) {
this.editor.enable(false);
this.content = val;
this.editor.enable(true);
this.editor.blur();
} else if (this.noHandleP) {
this.content = val;
}
});
}
@ -105,11 +161,18 @@ export default {
},
methods: {
onChange(e) {
this.$emit('input', this.$escapeHTML(this.content));
if (!this.noHandleP) {
this.$emit('input', this.$escapeHTML(this.content));
} else {
this.$emit('input', this.content);
}
},
onBlur(e) {
},
onFocus(e) {
},
getFocus() {
this.$refs.editor.quill.focus();
}
}
};

View File

@ -55,6 +55,8 @@ export default {
threeDimensionalView: 'Three-Dimensional View',
threeDimensionalStation: 'Three-Dimensional Station',
passengerflow: 'CCTV View',
trafficplantext:'Passer Planing',
traffictraintext:'Trunk View',
maintainer: 'Maintainer View',
deviceView: 'DeviceView',
taskOperateSuccess: 'Task Operate success',

View File

@ -55,6 +55,8 @@ export default {
threeDimensionalView: '数字沙盘',
threeDimensionalStation: '三维车站',
passengerflow: 'cctv视图',
trafficplantext:'车站视角',
traffictraintext:'车厢视角',
maintainer: '设备故障视图',
deviceView: '设备视图',
taskOperateSuccess: '任务操作成功',

View File

@ -9,7 +9,7 @@ export default {
mobilePhoneNumberOrEmail: '手机号/邮箱',
password: '密码',
autoLogin: '自动登录',
perfectInformation: '请在琏课堂小程序助手,完善个人信息,设置登录密码,手机号或邮箱。',
perfectInformation: '请在玖琏科技小程序,完善个人信息,设置登录密码,手机号或邮箱。',
unableToLogin: '无法登录?',
login: '登录',
enterTheCorrectUserName: '请输入正确的用户名',

View File

@ -40,7 +40,7 @@ export let driverListConfig = [
url:''
},
{
assetname:"站台",
assetname:"特殊站台",
id:'',
packageName:'',
deviceType:'',
@ -98,7 +98,7 @@ export let sceneListConfig = [
url:''
},
{
assetname:"站台",
assetname:"特殊站台",
id:'',
packageName:'',
deviceType:'',

View File

@ -93,9 +93,9 @@ export function getmodels(data) {
assets.push(assetwaicestation);
let assetstation3 = {
assetname:"站台",
assetname:"特殊站台",
id:"6",
packageName:"沙盘驾驶站台",
packageName:"沙盘驾驶特殊站台",
deviceType:"SimulationStation",
type:"stationThree",
url:JL3D_LOCAL_STATIC+"/MODEL/station/station3.FBX"

View File

@ -38,8 +38,8 @@ export function PasserRender(mapmode) {
freeViewRender.initRender(renderer,dom,scene,camerass);
//
scope.state = "4views";
scope.nowrender = fourViewRender;
scope.state = "freeview";
scope.nowrender = freeViewRender;
}
this.changeRenderMode = function(mode){

View File

@ -0,0 +1,249 @@
import StompClient from '@/utils/sock';
import { getBaseUrl } from '@/utils/baseUrl'
import { getToken } from '@/utils/auth';
import store from '@/store/index_APP_TARGET';
// 定于仿真socket接口
export function PassflowConnect(deviceaction,toptrain,downtrain,routegroup,passerStation,passerAi,jl3d) {
const scope = this;
this.teststomp = new StompClient();
let start = true;
let topic = '/user/queue/simulation/jl3d/'+routegroup;
let header = {'X-Token': getToken() };
let topswitch = false;
let downswitch = false;
socketon(topic);
function socketon(topic) {
try {
scope.teststomp.subscribe(topic, callback, header);
} catch (error) {
console.error('websocket订阅失败');
}
};
this.socketoff = function(topic) {
scope.teststomp.unsubscribe(topic);
};
// 仿真socket接口回调函数
function callback(Response) {
const data = JSON.parse(Response.body);
/** 站台客流当前人数信息 */
if(data.type == "STAND_PFI"){
let newStandData = data.body;
let count = 0;
for(let j=0;j<passerStation.stationlist.length;j++){
count = 0;
for(let i=0;i<newStandData.length;i++){
if(passerStation.stationlist[j].topstand == newStandData[i].standCode){
passerStation.stationlist[j].topspeed = newStandData[i].to;
passerStation.stationlist[j].toppassers = newStandData[i].num;
count++;
}
if(passerStation.stationlist[j].downstand == newStandData[i].standCode){
passerStation.stationlist[j].downspeed = newStandData[i].to;
passerStation.stationlist[j].downpassers = newStandData[i].num;
count++;
}
if(count == 2){
i = newStandData.length;
}
}
}
jl3d.updateNowStationData();
if(start){
start = false;
jl3d.initTrafficStart();
}
// jl3d.allStationData = data.body;
}
if(data.type == "TRAIN_PFI_BL"){
if(toptrain.nowcode == data.body.code && topswitch == true){
console.log(data);
//根据上下车人数创建人
jl3d.updateNowLeaveData("top",data.body.out);
}
if(downtrain.nowcode == data.body.code && downswitch == true){
console.log(data);
//根据上下车人数创建人
jl3d.updateNowLeaveData("down",data.body.out);
}
}
if(data.type == "DeviceCtrl_3D"){
if(data.body.type == "PSD"){
if(data.body.code == passerStation.nowStation.toppsd){
if(data.body.open == 0){
passerAi.passerout("top","end");
deviceaction.top.action.reset();
deviceaction.top.action.time =deviceaction.top.action._clip.duration;
deviceaction.top.action.timeScale = -1;
deviceaction.top.action.play();
}else{
passerAi.passerout("top","start")
deviceaction.top.action.reset();
deviceaction.top.action.time = 0;
deviceaction.top.action.timeScale = 1;
deviceaction.top.action.play();
}
}
if(data.body.code == passerStation.nowStation.downpsd){
if(data.body.open == 0){
deviceaction.down.action.reset();
deviceaction.down.action.time = deviceaction.down.action._clip.duration;
deviceaction.down.action.timeScale = -1;
deviceaction.down.action.play();
passerAi.passerout("down","end");
}else{
deviceaction.down.action.reset();
deviceaction.down.action.time = 0;
deviceaction.down.action.timeScale = 1;
deviceaction.down.action.play();
passerAi.passerout("down","start");
}
}
}
if(data.body.type == "TRAIN_DOOR"){
if(toptrain.nowcode == data.body.code){
if(data.body.open == "0"){
closetraindoor(toptrain,data.body.doorCode,"top");
}else{
opentraindoor(toptrain,data.body.doorCode,"top");
}
}
if(downtrain.nowcode == data.body.code){
// console.log(data.body);
if(data.body.open == "0"){
closetraindoor(downtrain,data.body.doorCode,"down");
}else{
opentraindoor(downtrain,data.body.doorCode,"down");
}
}
}
}
if(data.type == "TrainRun_3D"){
for(let i=0,leni = data.body.length;i<leni;i++){
if(data.body[i].section == passerStation.nowStation.topsection){
if(toptrain.nowcode != data.body[i].code){
toptrain.nowcode = data.body[i].code;
topswitch = true;
}
toptrain.position.copy(toptrain.curve.getPointAt(data.body[i].offset));
}else{
if(downtrain.nowcode == data.body[i].code){
topswitch = false
toptrain.position.x -= 1;
}
}
if(data.body[i].section == passerStation.nowStation.downsection){
if(downtrain.nowcode != data.body[i].code){
downtrain.nowcode = data.body[i].code;
downswitch = true;
}
downtrain.position.copy(downtrain.curve.getPointAt(data.body[i].offset));
}else{
if(downtrain.nowcode == data.body[i].code){
downswitch = false;
downtrain.position.x += 1;
}
}
}
}
if(data.type == 'Simulation_Over') {
store.dispatch('LogOut').then(() => {
location.reload();
});
}
}
let actions;
function opentraindoor(train,doorcode,direct){
// console.log(train);
if(direct == "top"){
// if(doorcode == "1"){
// actions = train.action.down;
// }
//
// if(doorcode == "2"){
actions = train.action.top;
// }
}else{
// if(doorcode == "1"){
actions = train.action.top;
// }
//
// if(doorcode == "2"){
// actions = train.action.down;
// }
}
for(let an=actions.length-1;an>=0;an--){
actions[an].reset();
actions[an].time = 0;
actions[an].timeScale = 1;
actions[an].play();
}
}
function closetraindoor(train,doorcode,direct){
if(direct == "top"){
// if(doorcode == "1"){
// actions = train.action.down;
// }
// if(doorcode == "2"){
actions = train.action.top;
// }
toptrain.nowcode = null;
}else{
// if(doorcode == "1"){
actions = train.action.top;
// }
// if(doorcode == "2"){
// actions = train.action.down;
// }
downtrain.nowcode = null;
}
for(let an=actions.length-1;an>=0;an--){
actions[an].reset();
actions[an].time = actions[an]._clip.duration;
actions[an].timeScale = -1;
actions[an].play();
}
}
}

View File

@ -0,0 +1,166 @@
import StompClient from '@/utils/sock';
import { getBaseUrl } from '@/utils/baseUrl'
import { getToken } from '@/utils/auth';
import store from '@/store/index_APP_TARGET';
// 定于仿真socket接口
export function TrainConnect(trafficTrain,deviceaction,toptrain,routegroup,passerAi) {
const scope = this;
this.teststomp = new StompClient();
let topic = '/user/queue/simulation/jl3d/'+routegroup;
let header = {'X-Token': getToken() };
socketon(topic);
function socketon(topic) {
try {
scope.teststomp.subscribe(topic, callback, header);
} catch (error) {
console.error('websocket订阅失败');
}
};
this.socketoff = function(topic) {
scope.teststomp.unsubscribe(topic);
};
// 仿真socket接口回调函数
function callback(Response) {
const data = JSON.parse(Response.body);
if(data.type == "TrainRun_3D"){
trafficTrain.runList = data.body;
// console.log(data);
}
if(data.type == "BeAbout2Arrive_3D"){
if(toptrain.nowcode == data.body.groupNumber){
// console.log(data);
}
}
if(data.type == "TRAIN_PFI_BL"){
trafficTrain.updateTrainData(data.body);
// if(toptrain.nowcode == data.body.code){
// console.log(data);
// //根据上下车人数创建人
// jl3d.updateNowLeaveData("top",data.body.out);
// }
// if(downtrain.nowcode == data.body.code){
// console.log(data);
// //根据上下车人数创建人
// jl3d.updateNowLeaveData("down",data.body.out);
// }
}
if(data.type == "TRAIN_PFI_NUM"){
trafficTrain.trainList = [];
// trafficTrain.trainList = data.body;
for(let i=0;i<data.body.length;i++){
let train = {
code:data.body[i].code,
num:data.body[i].num,
doorCode:1,
open:0,
text:"",
};
train.text = data.body[i].code+"(现有乘客"+data.body[i].num+"人)";
trafficTrain.trainList[train.code] = train;
}
}
if(data.type == "DeviceCtrl_3D"){
if(data.body.type == "TRAIN_DOOR"){
for(let i=0;i<trafficTrain.trainList.length;i++){
if(trafficTrain.trainList[i].code == data.body.code){
trafficTrain.trainList[i].open = data.body.open;
trafficTrain.trainList[i].doorCode = data.body.doorCode;
i = trafficTrain.trainList.length;
}
}
if(toptrain.nowcode == data.body.code){
trafficTrain.updatePasserMove(data.body);
if(data.body.open == "0"){
closetraindoor(toptrain,data.body.doorCode,"top");
}else{
opentraindoor(toptrain,data.body.doorCode,"top");
}
}
}
}
if(data.type == 'Simulation_Over') {
store.dispatch('LogOut').then(() => {
location.reload();
});
}
}
let actions;
function opentraindoor(train,doorcode,direct){
if(direct == "top"){
if(doorcode == "1"){
actions = train.action.down;
}
if(doorcode == "2"){
actions = train.action.top;
}
}else{
if(doorcode == "1"){
actions = train.action.top;
}
if(doorcode == "2"){
actions = train.action.down;
}
}
for(let an=actions.length-1;an>=0;an--){
actions[an].reset();
actions[an].time = 0;
actions[an].timeScale = 1;
actions[an].play();
}
}
function closetraindoor(train,doorcode,direct){
if(direct == "top"){
if(doorcode == "1"){
actions = train.action.down;
}
if(doorcode == "2"){
actions = train.action.top;
}
}else{
if(doorcode == "1"){
actions = train.action.top;
}
if(doorcode == "2"){
actions = train.action.down;
}
}
for(let an=actions.length-1;an>=0;an--){
actions[an].reset();
actions[an].time = actions[an]._clip.duration;
actions[an].timeScale = -1;
actions[an].play();
}
}
}

View File

@ -0,0 +1,439 @@
import { Staticmodel } from '@/jlmap3d/jl3dtrafficplan/loader/stationconfig.js';
//静态资源文件路劲
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
//loader
import { FBXLoader } from '@/jlmap3d/main/loaders/FBXLoader';
//轨道视角控制
import { OrbitControls } from '@/jlmap3d/main/control/OrbitControls';
//模型管理器
import { ModelManager } from '@/jlmap3d/jl3dtrafficplan/loader/loader.js';
//骨骼动画模型辅助工具
import { SkeletonUtils } from '@/jlmap3d/main/utils/SkeletonUtils.js';
//获取信息接口
import { getPublishMapVersion, getPublishMapDetail,getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata';
//cctv站台对象
import { PasserStation } from '@/jlmap3d/jl3dtrafficplan/model/passerstation.js';
//cctv检票机对象
import { PasserCheckDoor } from '@/jlmap3d/jl3dtrafficplan/model/passercheckdoor.js';
//cctv列车对象
import { PasserTrain } from '@/jlmap3d/jl3dtrafficplan/model/passertrain.js';
//cctv行人对象
import { PasserHuman } from '@/jlmap3d/jl3dtrafficplan/model/passerhuman.js';
//cctv渲染器
import { PasserRender } from '@/jlmap3d/jl3dpassflow/passerrender/passerrender.js';
//cctv行人ai
import { PasserAi } from '@/jlmap3d/jl3dtrafficplan/passerai/passerai.js';
//行人寻路相关工具
import { ZoneManager } from '@/jlmap3d/jl3dtrafficplan/model/zonemanager.js';
import { PathFinder } from '@/jlmap3d/jl3dtrafficplan/passerai/pathfinder.js';
//cctv通信工具
import { PassflowConnect } from '@/jlmap3d/jl3dtrafficplan/connect/stationconnect.js';
import StompClient from '@/utils/sock';
import store from '@/store/index_APP_TARGET';
// import { Loading } from 'element-ui';
import {Stats} from '@/jlmap3d/main/lib/stats.min.js';
//动画播放相关
let clock = new THREE.Clock();
let delta;
let scene,camerass,renderer;
let aiswitch = 0;
//动画组
let mixers = [];
//车站摄像机模型
let monitor;
//寻路相关对象
let passerZone = new ZoneManager();
let pathFinder = new PathFinder();
let path;
//设备动画action组
let deviceaction = [];
//控制帧率的webworker线程
let passerWebWork = new Worker(JL3D_LOCAL_STATIC+"/workertest/trafficplan/trafficstation.js");
//老版本临时ai控制
let olddataai = false;
export function Jl3dTrafficPlan(dom,skinCode,routegroup,viewMap) {
// let stats = new Stats();
// dom.appendChild( stats.dom );
let scope = this;
this.dom = dom;
this.nowcode = null;
this.animateswitch = false;
this.signallights = [];
this.mixers = [];
this.showmodel = null;
this.allStationData = [];
this.humanWaitTop = 0;
this.humanWaitDown = 0;
this.humanInSpeed = 0;
this.humanOutSpeed = 0;
let waitForCreatIn = [];
let waitForCreatOutTop = [];
let waitForCreatOutDown = [];
//定义相机
camerass = new THREE.PerspectiveCamera(70, dom.offsetWidth / dom.offsetHeight, 0.01, 1000);
camerass.position.set(0, 80, 40);
camerass.aspect = dom.offsetWidth / dom.offsetHeight;
camerass.updateProjectionMatrix();
//定义场景(渲染容器)
scene = new THREE.Scene();
scene.background = new THREE.Color(0xa0a0a0);
let passerRender = new PasserRender(viewMap);
passerRender.initView(dom,scene,camerass);
//定义全局光
let ambientLight = new THREE.AmbientLight(0xffffff, 1.3);
scene.add(ambientLight);
let controls = new THREE.OrbitControls(camerass, dom);
controls.maxPolarAngle = Math.PI / 2;
controls.minPolarangle = Math.PI / 5;
controls.maxDistance = 800;
controls.screenSpacePanning = true;
controls.update();
this.selectmodel = null;
// let mouse = new THREE.Vector2();
let raycaster = new THREE.Raycaster();
//进站运动中乘客
let humanlist = new THREE.Group();
//上行等待上车乘客
let topWaitPassers = new THREE.Group();
//下行等待上车乘客
let downWaitPassers = new THREE.Group();
//出站乘客
let outStationPassers = new THREE.Group();
let passerHuman = new PasserHuman();
let passerAi = new PasserAi(passerZone,pathFinder);
this.anime = null;
this.modelmanager = new ModelManager();
// let loadingInstance = Loading.service({ fullscreen: true });
let stationlist = [];
let socktest = null;
let passerStation = new PasserStation();
let passerCheckDoor = new PasserCheckDoor();
let passerTrain = new PasserTrain();
// document.addEventListener( "mousedown", onselect, false );
getPublish3dMapDetail(skinCode).then(netdata3d => {
passerStation.loadMaterial(netdata3d);
this.modelmanager.loadpromise(Staticmodel, scope.mixers,"2").then(function (data) {
// console.log(scope.modelmanager.station.mesh.getObjectByName("top"));
// let testtop = scope.modelmanager.station.mesh.getObjectByName("down");
// for(let i=0;i<testtop.children.length;i++){
// console.log(testtop.children[i].matrixWorld.elements[12]);
// console.log(testtop.children[i].matrixWorld.elements);
// }
// console.log(scope.modelmanager.station.mesh.getObjectByName("down"));
passerStation.initStationAnimation(scope.modelmanager.station.mesh,mixers,deviceaction,scene);
passerCheckDoor.initCheckDoorInAnimation(scope.modelmanager.zhajiin.mesh,mixers,deviceaction,scene);
passerCheckDoor.initCheckDoorOutAnimation(scope.modelmanager.zhajiout.mesh,mixers,deviceaction,scene);
passerTrain.initTrain(scope.modelmanager.train.mesh,mixers,deviceaction,scene);
scene.add(scope.modelmanager.section.mesh);
monitor = scope.modelmanager.monitor.mesh;
scene.add(monitor);
getPublishMapDetail(skinCode).then(netdata => {
scope.switchviews('freeview');
passerHuman.initHumans(scope.modelmanager.man1.mesh,scope.modelmanager.man2.mesh);
scene.add(humanlist);
scene.add(topWaitPassers);
scene.add(downWaitPassers);
scene.add(outStationPassers);
passerStation.initStationList(netdata.data.stationList,netdata.data.stationStandList,netdata.data.psdList);
socktest = new PassflowConnect(deviceaction,passerTrain.toptrain,passerTrain.downtrain,routegroup,passerStation,passerAi,scope);
store.dispatch('app/animationsClose');
let checkobject = setInterval(function(){
clearInterval(checkobject);
//进站控制
startWorker();
passerWebWork.postMessage(["on"]);
},1000);
});
animate();
})
});
this.initTrafficStart = function(){
scope.humanWaitTop = passerStation.nowStation.toppassers;
scope.humanWaitDown = passerStation.nowStation.downpassers;
scope.humanInSpeed = 0;
scope.humanOutSpeed = 0;
passerHuman.speed = scope.humanInSpeed;
passerAi.initPasser(humanlist,topWaitPassers,downWaitPassers,passerHuman,scope);
updatePasserData(humanlist.children.length,topWaitPassers.children.length,downWaitPassers.children.length,outStationPassers.children.length,passerHuman.speed);
}
this.changestation = function(stationname){
passerStation.changestation(stationname);
scope.humanWaitTop = passerStation.nowStation.toppassers;
scope.humanWaitDown = passerStation.nowStation.downpassers;
passerHuman.speed = passerStation.nowStation.topspeed + passerStation.nowStation.downspeed;
updatePasserData(humanlist.children.length,topWaitPassers.children.length,downWaitPassers.children.length,outStationPassers.children.length,passerHuman.speed);
scope.resetscene();
}
this.updateNowStationData = function(){
for(let i=0;i<passerStation.nowStation.topspeed;i++){
let newIn = {
overGoal:"top",
};
waitForCreatIn.push(newIn);
}
for(let i=0;i<passerStation.nowStation.downspeed;i++){
let newIn = {
overGoal:"down",
};
waitForCreatIn.push(newIn);
}
scope.humanInSpeed = passerStation.nowStation.topspeed+passerStation.nowStation.downspeed;
passerHuman.speed = scope.humanInSpeed;
passerWebWork.postMessage(["changespeed",scope.humanInSpeed/30]);
}
this.updateNowLeaveData = function(direct,outNum){
if(direct == "top"){
waitForCreatOutTop = getnum(outNum,17);
console.log(waitForCreatOutTop);
for(let i=0;i<waitForCreatOutTop.length;i++){
for(let j=0;j<waitForCreatOutTop[i];j++){
setTimeout(function(){
passerHuman.newHumanCreate(outStationPassers,passerZone.list["standtop"].doorpoints[i],5,"top",i);
}, Math.random()*1000*j);
}
}
}else{
waitForCreatOutDown = getnum(outNum,17);
for(let i=0;i<waitForCreatOutDown.length;i++){
for(let j=0;j<waitForCreatOutDown[i];j++){
setTimeout(function(){
passerHuman.newHumanCreate(outStationPassers,passerZone.list["standdown"].doorpoints[j],5,"down",j);
}, Math.random()*1000*i);
}
}
}
}
this.resetscene = function(){
aiswitch = 1;
passerAi.toppasserin = false;
passerAi.downpasserin = false;
//下车控制开关
passerAi.toppasseron = false;
passerAi.downpasseron = false;
passerTrain.toptrain.nowcode = null;
passerTrain.downtrain.nowcode = null;
// humanlist = new THREE.Group();
for(let j=0; j<humanlist.children.length;j++){
humanlist.remove(humanlist.children[j]);
j--;
// j--;
}
for(let j=0; j<topWaitPassers.children.length;j++){
topWaitPassers.remove(topWaitPassers.children[j]);
j--;
// j--;
}
for(let j=0; j<downWaitPassers.children.length;j++){
downWaitPassers.remove(downWaitPassers.children[j]);
j--;
// j--;
}
for(let j=0; j<outStationPassers.children.length;j++){
outStationPassers.remove(outStationPassers.children[j]);
j--;
// j--;
}
passerTrain.toptrain.position.y = -20000;
passerTrain.downtrain.position.y = -20000;
deviceaction.down.action.reset();
deviceaction.down.action.time = deviceaction.down.action._clip.duration;
deviceaction.down.action.timeScale = -1;
deviceaction.down.action.play();
deviceaction.top.action.reset();
deviceaction.top.action.time = deviceaction.down.action._clip.duration;
deviceaction.top.action.timeScale = -1;
deviceaction.top.action.play();
for(let an=passerTrain.toptrain.action.top.length-1;an>=0;an--){
passerTrain.toptrain.action.top[an].reset();
passerTrain.toptrain.action.top[an].time = passerTrain.toptrain.action.top[an]._clip.duration;
passerTrain.toptrain.action.top[an].timeScale = -1;
passerTrain.toptrain.action.top[an].play();
}
for(let an=passerTrain.toptrain.action.down.length-1;an>=0;an--){
passerTrain.toptrain.action.down[an].reset();
passerTrain.toptrain.action.down[an].time = passerTrain.toptrain.action.down[an]._clip.duration;
passerTrain.toptrain.action.down[an].timeScale = -1;
passerTrain.toptrain.action.down[an].play();
}
// for(let an=actions.length-1;an>=0;an--){
// actions[an].reset();
// actions[an].time = actions[an]._clip.duration;
// actions[an].timeScale = -1;
// actions[an].play();
// }
setTimeout(function(){
passerAi.initPasser(humanlist,topWaitPassers,downWaitPassers,passerHuman,scope);
aiswitch = 0;
}, 2000);
}
function startWorker(){
let updateaianimate = setInterval(
function(){
// console.log("?");
if(aiswitch == 0){
updatePasserData(humanlist.children.length,topWaitPassers.children.length,downWaitPassers.children.length,outStationPassers.children.length,passerHuman.speed);
passerHuman.moveAnimateUpdate(humanlist,topWaitPassers,downWaitPassers,outStationPassers,passerHuman);
passerAi.aiUpdate(humanlist,topWaitPassers,downWaitPassers,outStationPassers,passerHuman,passerCheckDoor,deviceaction);
// passerZone.zoneActionCheck(humanlist,passerHuman,passerCheckDoor,deviceaction);
delta = clock.getDelta();
for(let i=mixers.length-1;i>=0;i--){
if(mixers[i]._actions[0].isRunning()){
mixers[i].update( delta );
}
}
for(let i=topWaitPassers.children.length-1;i>=0;i--){
if(topWaitPassers.children[i].mixer._actions[0].isRunning()){
topWaitPassers.children[i].mixer.update( delta );
}
}
for(let i=downWaitPassers.children.length-1;i>=0;i--){
if(downWaitPassers.children[i].mixer._actions[0].isRunning()){
downWaitPassers.children[i].mixer.update( delta );
}
}
for(let i=outStationPassers.children.length-1;i>=0;i--){
if(outStationPassers.children[i].mixer._actions[0].isRunning()){
outStationPassers.children[i].mixer.update( delta );
}
}
for(let i=humanlist.children.length-1;i>=0;i--){
if(humanlist.children[i].mixer._actions[0].isRunning()){
humanlist.children[i].mixer.update( delta );
}
}
}
}
, 100);
passerWebWork.onmessage = function (event) {
if(aiswitch == 0){
// console.log(humanlist.children.length);
this.allStationData = [];
if(waitForCreatIn.length>0){
let direct = Math.floor(Math.random()*(3-1+1))+1;
//1--top
//2-- down
if(direct == 1){
passerHuman.newHumanCreate(humanlist,passerZone.getzoneposition("enter1"),0,waitForCreatIn[0].overGoal);
}else{
passerHuman.newHumanCreate(humanlist,passerZone.getzoneposition("enter2"),0,waitForCreatIn[0].overGoal);
}
waitForCreatIn.shift();
}
}
};
}
//
// function onselect(event){
// if(event.button == '0'){
//
// //定义光线
// let raycaster = new THREE.Raycaster();
// //定义平面鼠标点击坐标
// let mouse = new THREE.Vector2();
// mouse.x = (event.clientX / scope.dom.offsetWidth) * 2 - 1;
// mouse.y = -(event.clientY / scope.dom.offsetHeight) * 2 + 1;
//
// raycaster.setFromCamera( mouse, camerass );
//
// let intersects = raycaster.intersectObject(scope.modelmanager.station.mesh,true);
// console.log(intersects[0].point);
// }
// }
//循环渲染函数
function animate() {
passerRender.update();
// if(passerRender.state == "freeview"){
controls.update();
// }
// delta = clock.getDelta();
requestAnimationFrame(animate);
}
window.onresize = function () {
passerRender.reSize(scope.dom.offsetWidth,scope.dom.offsetHeight);
}
this.switchviews = function(viewmode){
passerRender.changeRenderMode(viewmode);
}
function getnum(num,pnum){
let re = [];
let base = Math.floor(num/pnum);
let reset = num%pnum;
for(let i=0;i<pnum;i++){
let nownum = base+(i<reset?1:0);
re.push(nownum);
}
return re;
}
}

View File

@ -0,0 +1,404 @@
import { Staticmodel } from '@/jlmap3d/jl3dtrafficplan/loader/trainconfig.js';
//静态资源文件路劲
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
//loader
import { FBXLoader } from '@/jlmap3d/main/loaders/FBXLoader';
//轨道视角控制
import { OrbitControls } from '@/jlmap3d/main/control/OrbitControls';
//模型管理器
import { ModelManager } from '@/jlmap3d/jl3dtrafficplan/loader/loader.js';
//骨骼动画模型辅助工具
import { SkeletonUtils } from '@/jlmap3d/main/utils/SkeletonUtils.js';
//获取信息接口
import { getPublishMapVersion, getPublishMapDetail,getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata';
//cctv列车对象
import { PasserTrain } from '@/jlmap3d/jl3dtrafficplan/model/passertrain.js';
//cctv行人对象
import { PasserHuman } from '@/jlmap3d/jl3dtrafficplan/model/traintrunk/passertrunkhuman.js';
//cctv渲染器
import { PasserRender } from '@/jlmap3d/jl3dpassflow/passerrender/passerrender.js';
//cctv行人ai
import { PasserAi } from '@/jlmap3d/jl3dpassflow/passerai/passerai.js';
//行人寻路相关工具
import { ZoneManager } from '@/jlmap3d/jl3dtrafficplan/model/zonemanager.js';
import { PathFinder } from '@/jlmap3d/jl3dpassflow/passerai/pathfinder.js';
//cctv通信工具
import { TrainConnect } from '@/jlmap3d/jl3dtrafficplan/connect/trainconnect.js';
import StompClient from '@/utils/sock';
import store from '@/store/index_APP_TARGET';
// import { Loading } from 'element-ui';
import {Stats} from '@/jlmap3d/main/lib/stats.min.js';
//动画播放相关
let clock = new THREE.Clock();
let delta;
let scene,camerass,renderer;
let aiswitch = 0;
//动画组
let mixers = [];
//寻路相关对象
let passerZone = new ZoneManager();
let pathFinder = new PathFinder();
let path;
//设备动画action组
let deviceaction = [];
//控制帧率的webworker线程
let passerWebWork = new Worker(JL3D_LOCAL_STATIC+"/workertest/passsimulation/station.js");
//老版本临时ai控制
let olddataai = false;
export function Jl3dTrafficTrain(dom,skinCode,routegroup,viewMap) {
// let stats = new Stats();
// dom.appendChild( stats.dom );
let scope = this;
this.dom = dom;
this.nowcode = null;
this.animateswitch = false;
this.signallights = [];
this.mixers = [];
this.showmodel = null;
this.nowTrainCode = "";
this.nowTrunk = {
code:null,
index:null,
numList:[
]
};
this.trainList = [];
this.humanWaitIn = [];
this.humanWaitOut = [];
this.humanInSpeed = 0;
this.humanOutSpeed = 0;
this.runList = [];
//定义相机
camerass = new THREE.PerspectiveCamera(70, dom.offsetWidth / dom.offsetHeight, 0.01, 1000);
camerass.position.set(0, 80, 40);
camerass.aspect = dom.offsetWidth / dom.offsetHeight;
camerass.updateProjectionMatrix();
//定义场景(渲染容器)
scene = new THREE.Scene();
scene.background = new THREE.Color(0xa0a0a0);
let passerRender = new PasserRender(viewMap);
passerRender.initView(dom,scene,camerass);
//定义全局光
let ambientLight = new THREE.AmbientLight(0xffffff, 1.3);
scene.add(ambientLight);
let controls = new THREE.OrbitControls(camerass, dom);
controls.maxPolarAngle = Math.PI / 2;
controls.minPolarangle = Math.PI / 5;
controls.maxDistance = 800;
controls.screenSpacePanning = true;
camerass.position.x = 4.78;
camerass.position.y = 5.076;
camerass.position.z = -0.016;
controls.target = new THREE.Vector3(camerass.position.x+0.5,camerass.position.y-0.1,camerass.position.z);
controls.update();
controls.enabled = false;
this.selectmodel = null;
// let mouse = new THREE.Vector2();
let raycaster = new THREE.Raycaster();
let humanlist = new THREE.Group();
let passerHuman = new PasserHuman();
let passerAi = new PasserAi(passerZone,pathFinder);
this.anime = null;
this.modelmanager = new ModelManager();
// let loadingInstance = Loading.service({ fullscreen: true });
this.nowstation = null;
let stationlist = [];
let socktest = null;
let passerTrain = new PasserTrain();
this.modelmanager.loadpromise(Staticmodel, scope.mixers,"2").then(function (data) {
// console.log(data);
passerTrain.initTrain(scope.modelmanager.train.mesh,mixers,deviceaction,scene);
passerTrain.toptrain.position.x = 0;
passerTrain.toptrain.position.y = 0;
passerTrain.toptrain.position.z = 0;
// passerTrain.downtrain.position.z = 40;
getPublishMapDetail(skinCode).then(netdata => {
scope.switchviews('freeview');
passerHuman.initHumans(scope.modelmanager.man1.mesh,scope.modelmanager.man2.mesh);
scene.add(humanlist);
socktest = new TrainConnect(scope,deviceaction,passerTrain.toptrain,routegroup,passerAi);
store.dispatch('app/animationsClose');
let checkobject = setInterval(function(){
clearInterval(checkobject);
//进站控制
startWorker();
passerWebWork.postMessage("on");
animate();
},1000);
});
})
this.resetscene = function(){
// humanlist = new THREE.Group();
for(let j=0; j<humanlist.children.length;j++){
humanlist.remove(humanlist.children[j]);
j--;
// j--;
}
for(let an=passerTrain.toptrain.action.top.length-1;an>=0;an--){
passerTrain.toptrain.action.top[an].reset();
passerTrain.toptrain.action.top[an].time = passerTrain.toptrain.action.top[an]._clip.duration;
passerTrain.toptrain.action.top[an].timeScale = -1;
passerTrain.toptrain.action.top[an].play();
}
setTimeout(function(){
passerHuman.setNowTrunkPasser(humanlist);
aiswitch = 0;
}, 2000);
}
function startWorker(){
passerHuman.setNowTrunkPasser(humanlist,0,0);
let updateaianimate = setInterval(
function(){
// console.log("?");
if(aiswitch == 0){
passerHuman.moveAnimateUpdate(humanlist,passerHuman);
// passerAi.aiUpdate(humanlist,passerHuman,passerCheckDoor,deviceaction);
delta = clock.getDelta();
// console.log(mixers);
for(let i=mixers.length-1;i>=0;i--){
if(mixers[i]._actions[0].isRunning()){
// console.log(mixers[i]);
mixers[i].update( delta );
}
}
for(let i=humanlist.children.length-1;i>=0;i--){
if(humanlist.children[i].mixer._actions[0].isRunning()){
humanlist.children[i].mixer.update( delta );
}
}
}
}
, 100);
}
//循环渲染函数
function animate() {
passerRender.update();
if(passerRender.state == "freeview"){
controls.update();
}
// delta = clock.getDelta();
requestAnimationFrame(animate);
}
window.onresize = function () {
passerRender.reSize(scope.dom.offsetWidth,scope.dom.offsetHeight);
}
this.switchcamera = function(trunkNum){
passerHuman.nowTrunk = trunkNum;
passerHuman.resetPasser(humanlist);
passerHuman.setNowTrunkPasser(humanlist,scope.nowTrunk.numList[trunkNum].num,trunkNum);
switch (trunkNum) {
case '0':
camerass.position.x = 4.78;
camerass.position.y = 5.076;
camerass.position.z = -0.016;
controls.target = new THREE.Vector3(camerass.position.x+0.5,camerass.position.y-0.1,camerass.position.z);
controls.update();
break;
case '1':
camerass.position.x = 26.00;
camerass.position.y = 5.076;
camerass.position.z = -0.016;
controls.target = new THREE.Vector3(camerass.position.x+0.5,camerass.position.y-0.1,camerass.position.z);
controls.update();
break;
case '2':
camerass.position.x = 48.71;
camerass.position.y = 5.076;
camerass.position.z = -0.016;
controls.target = new THREE.Vector3(camerass.position.x+0.5,camerass.position.y-0.1,camerass.position.z);
controls.update();
break;
case '3':
camerass.position.x = 70.01;
camerass.position.y = 5.076;
camerass.position.z = -0.016;
controls.target = new THREE.Vector3(camerass.position.x+0.5,camerass.position.y-0.1,camerass.position.z);
controls.update();
break;
case '4':
camerass.position.x = 92.06;
camerass.position.y = 5.076;
camerass.position.z = -0.016;
controls.target = new THREE.Vector3(camerass.position.x+0.5,camerass.position.y-0.1,camerass.position.z);
controls.update();
break;
case '5':
camerass.position.x = 107.30;
camerass.position.y = 5.076;
camerass.position.z = -0.016;
controls.target = new THREE.Vector3(camerass.position.x+0.5,camerass.position.y-0.1,camerass.position.z);
controls.update();
break;
default:
}
}
this.getTrainList = function(){
return scope.trainList;
}
this.getRunList = function(){
return scope.runList;
}
let nowLeaveDoor = null;
this.updatePasserMove = function(doorData){
nowLeaveDoor = doorData.doorCode;
// console.log(doorData);
}
this.updateTrainData = function(newData){
if(scope.trainList.length > 0){
for(let i=0;i<scope.trainList.length;i++){
if(newData.code == scope.trainList[i].code){
scope.trainList[i].num = scope.trainList[i].num + newData.in - newData.out;
if(passerTrain.toptrain.nowcode == newData.code){
scope.humanWaitIn = getnum(newData.in,6);
scope.humanWaitOut = getnum(newData.out,6);
// console.log(scope.humanWaitIn);
// console.log(scope.humanWaitOut);
// console.log(nowLeaveDoor);
// console.log("------------------");
passerHuman.initTrainRail(humanlist,scope.humanWaitIn,scope.humanWaitOut,nowLeaveDoor);
let trainDataList = getnum(scope.trainList[i].num,6);
// nowTrunk.code = newCode;
scope.nowTrunk.numList = trainDataList;
updateTrainNum(trainDataList);
}
i = scope.trainList.length;
}
}
}
}
this.updateNowTrainCode = function(newCode){
passerTrain.toptrain.nowcode = newCode;
scope.nowTrainCode = newCode;
// console.log(scope.trainList);
for(let k in scope.trainList){
if(scope.trainList[k].code == newCode){
let trainDataList = getnum(scope.trainList[k].num,6);
scope.nowTrunk.code = newCode;
scope.nowTrunk.numList = trainDataList;
// console.log(scope.trainList[i]);
for(let an=passerTrain.toptrain.action.top.length-1;an>=0;an--){
passerTrain.toptrain.action.top[an].reset();
passerTrain.toptrain.action.top[an].time = 0;
passerTrain.toptrain.action.top[an].timeScale = -1;
passerTrain.toptrain.action.top[an].play();
}
for(let an=passerTrain.toptrain.action.top.length-1;an>=0;an--){
passerTrain.toptrain.action.down[an].reset();
passerTrain.toptrain.action.down[an].time = 0;
passerTrain.toptrain.action.down[an].timeScale = -1;
passerTrain.toptrain.action.down[an].play();
}
if(scope.trainList[k].open != "0"){
if(scope.trainList[k].doorCode == "1"){
for(let an=passerTrain.toptrain.action.top.length-1;an>=0;an--){
passerTrain.toptrain.action.top[an].reset();
passerTrain.toptrain.action.top[an].time = passerTrain.toptrain.action.top[an]._clip.duration;
passerTrain.toptrain.action.top[an].timeScale = 1;
passerTrain.toptrain.action.top[an].play();
}
}else{
for(let an=passerTrain.toptrain.action.top.length-1;an>=0;an--){
passerTrain.toptrain.action.down[an].reset();
passerTrain.toptrain.action.down[an].time = passerTrain.toptrain.action.top[an]._clip.duration;
passerTrain.toptrain.action.down[an].timeScale = 1;
passerTrain.toptrain.action.down[an].play();
}
}
}
updateTrainNum(trainDataList);
break;
// i = scope.trainList.length;
}
}
}
this.switchviews = function(viewmode){
passerRender.changeRenderMode(viewmode);
}
function getnum(num,pnum){
let re = [];
let base = Math.floor(num/pnum);
let reset = num%pnum;
for(let i=0;i<pnum;i++){
let nownum = base+(i<reset?1:0);
let newtraindata = {
num:nownum,
percent:parseInt(nownum/220*100)+"%",
}
re.push(newtraindata);
}
return re;
}
}

View File

@ -0,0 +1,159 @@
import { BASE_ASSET_API } from '@/api/jlmap3d/assets3d.js';
import store from '@/store/index_APP_TARGET';
//模型管理器
let mode = "0";
export function ModelManager(){
let scope = this;
this.man1 = {
code:null,
locateType:"01",
mesh:null,
action:null
};
this.man2 = {
code:null,
locateType:"01",
mesh:null,
action:null
};
this.station = {
code:null,
screenDoorOpenStatus:"01",
animations:null,
mesh:null,
action:null
};
this.zhajiin = {
code:null,
screenDoorOpenStatus:"01",
animations:null,
mesh:null,
action:null
};
this.zhajiout = {
code:null,
screenDoorOpenStatus:"01",
animations:null,
mesh:null,
action:null
};
this.monitor = {
code:null,
screenDoorOpenStatus:"01",
animations:null,
mesh:null,
action:null
};
this.train = {
code:null,
screenDoorOpenStatus:"01",
animations:null,
mesh:null,
action:null
};
this.section = {
code:null,
screenDoorOpenStatus:"01",
animations:null,
mesh:null,
action:null
};
//读取模型
this.loadpromise = function (data,mixers,loadmode){
mode = loadmode;
let initlist = [];
for(let i=0,leni=data.length;i<leni;i++){
if(data[i].type == "man1" || data[i].type == "cctvMan1"){
initlist.push(fbxpromise(data[i],mixers,scope.man1));
}
if(data[i].type == "man2" || data[i].type == "cctvMan2"){
initlist.push(fbxpromise(data[i],mixers,scope.man2));
}
if(data[i].type == "cctvStation"){
initlist.push(fbxpromise(data[i],mixers,scope.station));
}
if(data[i].type == "cctvGateIn"){
initlist.push(fbxpromise(data[i],mixers,scope.zhajiin));
}
if(data[i].type == "cctvGateOut"){
initlist.push(fbxpromise(data[i],mixers,scope.zhajiout));
}
if(data[i].type == "cctvMonitor"){
initlist.push(fbxpromise(data[i],mixers,scope.monitor));
}
if(data[i].type == "cctvTrain"){
initlist.push(fbxpromise(data[i],mixers,scope.train));
}
if(data[i].type == "cctvSection"){
initlist.push(fbxpromise(data[i],mixers,scope.section));
}
}
//promise按顺序加载
return new Promise(function(resolve, reject){
Promise.all(initlist).then((result) => {
console.log("success");
store.dispatch('app/animationsClose');
resolve("success"); //['成功了', 'success']
}).catch((error) => {
//console.log(error);
});
});
}
}
//fbx模型加载
function fbxpromise(asset,mixers,model){
return new Promise(function(resolve, reject){
var loader = new THREE.FBXLoader();
if( mode == "2"){
loader.load( asset.url, function ( object ) {
model.mesh = object;
resolve(asset.deviceType);
} );
}else{
loader.load( BASE_ASSET_API+asset.url, function ( object ) {
//列车模型子物体重新排序
if(asset.type == "cctvTrain"){
// let mixer = new THREE.AnimationMixer( object );
let realtrain = new THREE.Group();
for(let j=6;j>0;j--){
let name = "c"+j;
for(let i=0;i<object.children.length;i++){
if(object.children[i].name == name){
object.children[i].position.x = object.children[i].position.x;
//object.children[i].position.y = j*10;
realtrain.add(object.children[i]);
i--;
}
}
}
model.mesh = realtrain;
model.mesh.animations = object.animations[0].tracks;
//
}else{
model.mesh = object;
}
resolve(asset.deviceType);
} );
}
});
}

View File

@ -0,0 +1,56 @@
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
var Staticmodel = [
{
id: "1",
name: "人物1",
deviceType: "man1",
type: "man1",
url: "/cbtc/static/MODEL/passflow/man1.FBX"
},{
id: "2",
name: "人物2",
deviceType: "man2",
type: "man2",
url: "/cbtc/static/MODEL/passflow/man2.FBX"
},{
id: "3",
name: "车站",
deviceType: "cctvStation",
type: "cctvStation",
url: "/cbtc/static/trafficplan/station.FBX"
},{
id: "4",
name: "闸机",
deviceType: "cctvGateIn",
type: "cctvGateIn",
url: "/cbtc/static/MODEL/passflow/zhajiin.FBX"
},{
id: "5",
name: "闸机",
deviceType: "cctvGateOut",
type: "cctvGateOut",
url: "/cbtc/static/MODEL/passflow/zhajiout.FBX"
},{
id: "6",
name: "摄像机",
deviceType: "cctvMonitor",
type: "cctvMonitor",
url: "/cbtc/static/MODEL/passflow/monitor.FBX"
},{
id: "7",
name: "列车",
deviceType: "cctvTrain",
type: "cctvTrain",
url: "/cbtc/static/trafficplan/train.FBX"
},{
id: "8",
name: "区段",
deviceType: "cctvSection",
type: "cctvSection",
url: "/cbtc/static/MODEL/passflow/section.FBX"
}
];
export { Staticmodel }

View File

@ -0,0 +1,27 @@
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
var Staticmodel = [
{
id: "1",
name: "人物1",
deviceType: "man1",
type: "man1",
url: "/cbtc/static/trafficplan/man1.FBX"
},
{
id: "2",
name: "人物2",
deviceType: "man2",
type: "man2",
url: "/cbtc/static/trafficplan/man2.FBX"
},
{
id: "7",
name: "列车",
deviceType: "train",
type: "cctvTrain",
url: "/cbtc/static/trafficplan/train.FBX"
},
];
export { Staticmodel }

View File

@ -0,0 +1,230 @@
export function PasserCheckDoor(data) {
var scope = this;
//入口闸机组
this.zhajiin = [];
//出口闸机组
this.zhajiout = [];
//定义闸机状态
for(let i=0;i<5;i++){
let zhaji = {
id:"in0"+(i+1),
status:0,
waiting:0
}
scope.zhajiin.push(zhaji);
}
for(let i=0;i<5;i++){
let zhaji = {
id:"out0"+(i+1),
status:0,
waiting:0
}
scope.zhajiout.push(zhaji);
}
//初始化闸机动画
this.initCheckDoorInAnimation = function(object,mixers ,deviceaction ,scene){
let mixer = new THREE.AnimationMixer( object );
let newclip = object.animations[ 0 ];
let newzhaji = object;
for(let i=0;i<newzhaji.children.length;i++){
if(newzhaji.children[i].name == "in01"){
newzhaji.children[i].animations = [];
newzhaji.children[i].animations.push(newclip.clone());
let mixer = new THREE.AnimationMixer( newzhaji.children[i] );
let action =mixer.clipAction( newzhaji.children[i].animations[0]);
action.setLoop(THREE.LoopOnce);
action.clampWhenFinished = true;
mixers.push(mixer);
let device = {
action:action,
mixer:mixer,
};
deviceaction[object.children[i].name] = device;
}
if(newzhaji.children[i].name == "in02"){
newzhaji.children[i].animations = [];
newzhaji.children[i].animations.push(newclip.clone());
let mixer = new THREE.AnimationMixer( newzhaji.children[i] );
let action =mixer.clipAction( newzhaji.children[i].animations[0]);
action.setLoop(THREE.LoopOnce);
action.clampWhenFinished = true;
mixers.push(mixer);
let device = {
action:action,
mixer:mixer,
};
deviceaction[object.children[i].name] = device;
}
if(newzhaji.children[i].name == "in03"){
newzhaji.children[i].animations = [];
newzhaji.children[i].animations.push(newclip.clone());
let mixer = new THREE.AnimationMixer( newzhaji.children[i] );
let action =mixer.clipAction( newzhaji.children[i].animations[0]);
action.setLoop(THREE.LoopOnce);
action.clampWhenFinished = true;
mixers.push(mixer);
let device = {
action:action,
mixer:mixer,
};
deviceaction[object.children[i].name] = device;
}
if(newzhaji.children[i].name == "in04"){
newzhaji.children[i].animations = [];
newzhaji.children[i].animations.push(newclip.clone());
let mixer = new THREE.AnimationMixer( newzhaji.children[i] );
let action =mixer.clipAction( newzhaji.children[i].animations[0]);
action.setLoop(THREE.LoopOnce);
action.clampWhenFinished = true;
mixers.push(mixer);
let device = {
action:action,
mixer:mixer,
};
deviceaction[object.children[i].name] = device;
}
if(newzhaji.children[i].name == "in05"){
newzhaji.children[i].animations = [];
newzhaji.children[i].animations.push(newclip.clone());
let mixer = new THREE.AnimationMixer( newzhaji.children[i] );
let action =mixer.clipAction( newzhaji.children[i].animations[0]);
action.setLoop(THREE.LoopOnce);
action.clampWhenFinished = true;
mixers.push(mixer);
let device = {
action:action,
mixer:mixer,
};
deviceaction[object.children[i].name] = device;
}
}
scene.add(newzhaji);
}
//初始化闸机动画
this.initCheckDoorOutAnimation = function(object,mixers ,deviceaction ,scene){
let mixer = new THREE.AnimationMixer( object );
let newclip = object.animations[ 0 ];
let newzhaji = object;
for(let i=0;i<newzhaji.children.length;i++){
if(newzhaji.children[i].name == "out01"){
newzhaji.children[i].animations = [];
newzhaji.children[i].animations.push(newclip.clone());
let mixer = new THREE.AnimationMixer( newzhaji.children[i] );
let action =mixer.clipAction( newzhaji.children[i].animations[0]);
action.setLoop(THREE.LoopOnce);
action.clampWhenFinished = true;
mixers.push(mixer);
let device = {
action:action,
mixer:mixer,
};
deviceaction[object.children[i].name] = device;
}
if(newzhaji.children[i].name == "out02"){
newzhaji.children[i].animations = [];
newzhaji.children[i].animations.push(newclip.clone());
let mixer = new THREE.AnimationMixer( newzhaji.children[i] );
let action =mixer.clipAction( newzhaji.children[i].animations[0]);
action.setLoop(THREE.LoopOnce);
action.clampWhenFinished = true;
mixers.push(mixer);
let device = {
action:action,
mixer:mixer,
};
deviceaction[object.children[i].name] = device;
}
if(newzhaji.children[i].name == "out03"){
newzhaji.children[i].animations = [];
newzhaji.children[i].animations.push(newclip.clone());
let mixer = new THREE.AnimationMixer( newzhaji.children[i] );
let action =mixer.clipAction( newzhaji.children[i].animations[0]);
action.setLoop(THREE.LoopOnce);
action.clampWhenFinished = true;
mixers.push(mixer);
let device = {
action:action,
mixer:mixer,
};
deviceaction[object.children[i].name] = device;
}
if(newzhaji.children[i].name == "out04"){
newzhaji.children[i].animations = [];
newzhaji.children[i].animations.push(newclip.clone());
let mixer = new THREE.AnimationMixer( newzhaji.children[i] );
let action =mixer.clipAction( newzhaji.children[i].animations[0]);
action.setLoop(THREE.LoopOnce);
action.clampWhenFinished = true;
mixers.push(mixer);
let device = {
action:action,
mixer:mixer,
};
deviceaction[object.children[i].name] = device;
}
if(newzhaji.children[i].name == "out05"){
newzhaji.children[i].animations = [];
newzhaji.children[i].animations.push(newclip.clone());
let mixer = new THREE.AnimationMixer( newzhaji.children[i] );
let action =mixer.clipAction( newzhaji.children[i].animations[0]);
action.setLoop(THREE.LoopOnce);
action.clampWhenFinished = true;
mixers.push(mixer);
let device = {
action:action,
mixer:mixer,
};
deviceaction[object.children[i].name] = device;
}
}
scene.add(newzhaji);
}
//闸机动画控制
this.checkDoorControl = function(type,door,deviceaction){
let devicenum = door;
if(type == "in"){
let checkDoorId = scope.zhajiin[devicenum].id;
deviceaction[checkDoorId].action.reset();
deviceaction[checkDoorId].action.time = 0;
deviceaction[checkDoorId].action.timeScale = 1;
deviceaction[checkDoorId].action.play();
}else if(type == "out"){
let checkDoorId = scope.zhajiout[devicenum].id;
deviceaction[checkDoorId].action.reset();
deviceaction[checkDoorId].action.time = 0;
deviceaction[checkDoorId].action.timeScale = 1;
deviceaction[checkDoorId].action.play();
}
}
}

View File

@ -0,0 +1,298 @@
export function PasserHuman() {
let scope = this;
//初始人物模型和动画
let originhuman1 = null;
let originhuman2 = null;
let originanima1 = null;
let originanima2 = null;
//初始化人物模型动画
this.initHumans = function(object1,object2,mixers,deviceaction,scene){
originhuman1 = object1;
originhuman1.progress = 1;
// scene.add(originhuman1);
originhuman2 = object2;
let mixer1 = new THREE.AnimationMixer( originhuman1 );
let mixer2 = new THREE.AnimationMixer( originhuman2 );
originanima1 = originhuman1.animations[ 0 ];
originanima2 = originhuman2.animations[ 0 ];
originhuman1.remove(originhuman1.children[2]);
}
//创建新的进站乘客
this.newInHuman= function(humanlist,position){
if(scope.humanWaitIn.length != 0){
let newhuman;
createHumanModel(newhuman,humanlist,position,scope.humanWaitIn[0].stage,scope.humanWaitIn[0].direct,scope.humanWaitIn[0].door);
scope.humanWaitIn.shift();
}
}
//创建新的出站乘客
this.newOutHuman = function(humanlist,position){
if(scope.humanWaitOut.length != 0){
let newhuman;
createHumanModel(newhuman,humanlist,position,scope.humanWaitOut[0].stage,scope.humanWaitOut[0].direct,scope.humanWaitOut[0].door);
scope.humanWaitOut.shift();
}
}
//创建新的乘客
this.newHumanCreate = function(humanlist,position,stage,direct,door,overGoal){
let newhuman;
createHumanModel(newhuman,humanlist,position,stage,direct,door,overGoal);
}
function createHumanModel(newhuman,humanlist,position,stage,direct,door,overGoal){
let mantype = Math.floor(Math.random()*(3-1+1))+1;
if(mantype == 1){
newhuman = THREE.SkeletonUtils.clone( originhuman1 );
newhuman.animations = [];
newhuman.animations.push(originanima1.clone());
}else{
newhuman = THREE.SkeletonUtils.clone( originhuman2 );
newhuman.animations = [];
newhuman.animations.push(originanima2.clone());
}
let mixer = new THREE.AnimationMixer( newhuman );
newhuman.position.copy(position);
if(overGoal){
newhuman.overGoal = overGoal;
}
if(newhuman.direct == "top"){
newhuman.rotation.y = Math.PI;
}
newhuman.status = 0;
newhuman.stage = stage;
if(direct){
if(direct == "top"){
newhuman.rotation.y = Math.PI;
}
newhuman.direct = direct;
}else{
newhuman.direct = null;
}
newhuman.doorstatus = null;
if(door){
newhuman.door = door;
}else{
newhuman.door = null;
}
newhuman.action = mixer.clipAction( newhuman.animations[ 0 ] );
newhuman.mixer = mixer;
newhuman.runrail = null;
newhuman.speed = 0;
newhuman.mixer = mixer;
humanlist.add(newhuman);
}
//定义新模型走路动画
this.initMoveAnimate = function(model,name,points,index){
model.status = 1;
let curve = new THREE.CatmullRomCurve3(points);
curve.curvrtype = "catmullrom";
// curve.getLength();
// curve动画轨迹
// progress动画进度
// enable当前动画开关
// speed动画速度
// console.log(curve);
model.action.play();
model.progress = 0;
model.runrail = curve;
model.speed = 0.2/curve.getLength();
}
//更新人物列表中人物的动画
this.moveAnimateUpdate = function(humanlist,topWaitPassers,downWaitPassers,outStationPassers,passerHuman){
for(let i=0;i<outStationPassers.children.length;i++){
if(outStationPassers.children[i].status == 1){
if(outStationPassers.children[i].progress>=1){
outStationPassers.children[i].progress = 1;
outStationPassers.children[i].action.stop();
outStationPassers.children[i].status = 0;
if(outStationPassers.children[i].stage == 8){
passerHuman.uncache(outStationPassers.children[i]);
outStationPassers.remove(outStationPassers.children[i]);
i--;
}else if(outStationPassers.children[i].stage == 7){
outStationPassers.children[i].stage = 8;
}
else if(outStationPassers.children[i].stage == 5){
outStationPassers.children[i].stage = 7;
}
}else{
//根据动画进度获取动画轨迹上点
// console.log(i);
// console.log(humanlist.children[i].runrail);
// console.log(humanlist.children[i].progress);
let point = outStationPassers.children[i].runrail.getPointAt(outStationPassers.children[i].progress);
//更新模型坐标
outStationPassers.children[i].position.x = point.x;
outStationPassers.children[i].position.y = point.y;
outStationPassers.children[i].position.z = point.z;
if((outStationPassers.children[i].progress+0.001)<1){
let tangent = outStationPassers.children[i].runrail.getPointAt(outStationPassers.children[i].progress+0.001);
outStationPassers.children[i].lookAt(new THREE.Vector3(tangent.x,outStationPassers.children[i].position.y,tangent.z));
}
outStationPassers.children[i].progress += outStationPassers.children[i].speed;
point = null;
}
}
}
for(let i=0;i<topWaitPassers.children.length;i++){
if(topWaitPassers.children[i].status == 1){
if(topWaitPassers.children[i].progress>=1){
topWaitPassers.children[i].progress = 1;
topWaitPassers.children[i].action.stop();
topWaitPassers.children[i].status = 0;
if(topWaitPassers.children[i].stage == 4){
passerHuman.uncache(topWaitPassers.children[i]);
topWaitPassers.remove(topWaitPassers.children[i]);
i--;
}
}else{
//根据动画进度获取动画轨迹上点
// console.log(i);
// console.log(humanlist.children[i].runrail);
// console.log(humanlist.children[i].progress);
let point = topWaitPassers.children[i].runrail.getPointAt(topWaitPassers.children[i].progress);
//更新模型坐标
topWaitPassers.children[i].position.x = point.x;
topWaitPassers.children[i].position.y = point.y;
topWaitPassers.children[i].position.z = point.z;
if((topWaitPassers.children[i].progress+0.001)<1){
let tangent = topWaitPassers.children[i].runrail.getPointAt(topWaitPassers.children[i].progress+0.001);
topWaitPassers.children[i].lookAt(new THREE.Vector3(tangent.x,topWaitPassers.children[i].position.y,tangent.z));
}
topWaitPassers.children[i].progress += topWaitPassers.children[i].speed;
point = null;
}
}
}
for(let i=0;i<downWaitPassers.children.length;i++){
if(downWaitPassers.children[i].status == 1){
if(downWaitPassers.children[i].progress>=1){
downWaitPassers.children[i].progress = 1;
downWaitPassers.children[i].action.stop();
downWaitPassers.children[i].status = 0;
if(downWaitPassers.children[i].stage == 4){
passerHuman.uncache(downWaitPassers.children[i]);
downWaitPassers.remove(downWaitPassers.children[i]);
i--;
}
}else{
//根据动画进度获取动画轨迹上点
// console.log(i);
// console.log(humanlist.children[i].runrail);
// console.log(humanlist.children[i].progress);
let point = downWaitPassers.children[i].runrail.getPointAt(downWaitPassers.children[i].progress);
//更新模型坐标
downWaitPassers.children[i].position.x = point.x;
downWaitPassers.children[i].position.y = point.y;
downWaitPassers.children[i].position.z = point.z;
if((downWaitPassers.children[i].progress+0.001)<1){
let tangent = downWaitPassers.children[i].runrail.getPointAt(downWaitPassers.children[i].progress+0.001);
downWaitPassers.children[i].lookAt(new THREE.Vector3(tangent.x,downWaitPassers.children[i].position.y,tangent.z));
}
downWaitPassers.children[i].progress += downWaitPassers.children[i].speed;
point = null;
}
}
}
for(let i=0;i<humanlist.children.length;i++){
if(humanlist.children[i].status == 1){
if(humanlist.children[i].progress>=1){
//更新模型坐标
if(humanlist.children[i].status == 1){
humanlist.children[i].progress = 1;
humanlist.children[i].action.stop();
humanlist.children[i].status = 0;
if(humanlist.children[i].stage == 3){
humanlist.children[i].stage = 4;
if(humanlist.children[i].direct == "top"){
topWaitPassers.add(humanlist.children[i]);
i--;
}else if(humanlist.children[i].direct == "down"){
downWaitPassers.add(humanlist.children[i]);
i--;
}
}else if(humanlist.children[i].stage == 2){
humanlist.children[i].stage = 3;
}else if(humanlist.children[i].stage == 1){
humanlist.children[i].stage = 2;
}else if(humanlist.children[i].stage == 0){
// // console.log(humans[i].doors);
// zhajiin[humanlist.children[i].doors].waiting = 0;
humanlist.children[i].stage = 1;
}
}
}else{
//根据动画进度获取动画轨迹上点
// console.log(i);
// console.log(humanlist.children[i].runrail);
// console.log(humanlist.children[i].progress);
let point = humanlist.children[i].runrail.getPointAt(humanlist.children[i].progress);
//更新模型坐标
humanlist.children[i].position.x = point.x;
humanlist.children[i].position.y = point.y;
humanlist.children[i].position.z = point.z;
if((humanlist.children[i].progress+0.001)<1){
let tangent = humanlist.children[i].runrail.getPointAt(humanlist.children[i].progress+0.001);
humanlist.children[i].lookAt(new THREE.Vector3(tangent.x,humanlist.children[i].position.y,tangent.z));
}
humanlist.children[i].progress += humanlist.children[i].speed;
point = null;
}
}
}
}
//离开车站释放缓存
this.uncache = function(uncachemodel){
if(uncachemodel){
uncachemodel.mixer.uncacheAction();
uncachemodel.traverse( function ( child ) {
if ( child.isMesh ) {
child.geometry.dispose();
child.material.dispose();
}
} );
}
}
}

View File

@ -0,0 +1,186 @@
import {Materialload} from '@/jlmap3d/main/loaders/Materialload.js';
export function PasserStation() {
var scope = this;
this.stationMesh = null;
this.stationleft = [];
this.stationright = [];
//替换材质组(站台的)
this.stationtexture = [];
this.stationlist = [];
this.nowStation = "";
for(let i=0;i<22;i++){
let sl = {
id:"left"+i,
status:0,
waiting:0
}
scope.stationleft.push(sl);
}
for(let i=0;i<22;i++){
let sr = {
id:"right"+i,
status:0,
waiting:0
}
scope.stationright.push(sr);
}
//初始化车站模型动画
this.initStationAnimation = function( object,mixers ,deviceaction ,scene){
let mixer = new THREE.AnimationMixer( object ,mixers ,deviceaction ,scene);
let newclip = object.animations[ 0 ];
for(let j=0;j<object.children.length;j++){
if(object.children[j].name == "top"){
// let geometry = new THREE.BoxBufferGeometry( 50, 50, 50 );
// let material = new THREE.MeshBasicMaterial( {color: 0x00ff00} );
// let cube = new THREE.Mesh( geometry, material );
// cube.position.copy(object.children[j].position);
// scene.add( cube );
object.children[j].animations = [];
object.children[j].animations.push(newclip.clone());
let mixer = new THREE.AnimationMixer( object.children[j] );
let action =mixer.clipAction( object.children[j].animations[0])
action.setLoop(THREE.LoopOnce);
action.clampWhenFinished = true;
// action.play();
mixers.push(mixer);
let device = {
action:action,
mixer:mixer,
};
deviceaction[object.children[j].name] = device;
}
if(object.children[j].name == "down"){
object.children[j].animations = [];
object.children[j].animations.push(newclip.clone());
let mixer = new THREE.AnimationMixer( object.children[j] );
let action =mixer.clipAction( object.children[j].animations[0])
// action.play();
action.setLoop(THREE.LoopOnce);
action.clampWhenFinished = true;
mixers.push(mixer);
let device = {
action:action,
mixer:mixer,
};
deviceaction[object.children[j].name] = device;
}
}
object.traverse( function ( child ) {
if ( child.isMesh ) {
child.renderOrder = 9;
}
} );
scope.stationMesh = object;
// console.log(deviceaction);
scene.add(object);
}
//初始化车站名称数据
this.initStationList = function(stationdata,standdata,psddata){
let list = [];
if(psddata){
for(let i=0,leni = standdata.length;i<leni;i++){
for(let j=0,lenj = psddata.length;j<lenj;j++){
if(standdata[i].code == psddata[j].standCode){
standdata[i].name = psddata[j].code;
}
}
}
for(let i=0,leni = stationdata.length;i<leni;i++){
if(stationdata[i].depot == false){
list[stationdata[i].name] = [];
for(let j=0,lenj = standdata.length;j<lenj;j++){
if(standdata[j].stationCode == stationdata[i].code){
list[stationdata[i].name].push(standdata[j]);
}
}
}
}
for(let k in list){
if(list[k].length>0){
let stationobject = {
code : list[k][0].stationCode,
name : k,
topspeed:0,
downspeed:0,
toppassers:0,
downpassers:0,
toppsd:null,
downpsd:null,
topsection:null,
downsection:null,
topstand:null,
downstand:null
};
if(list[k][0].position.y<list[k][1].position.y){
stationobject.toppsd = list[k][0].name;
stationobject.downpsd = list[k][1].name;
stationobject.topsection = list[k][0].standTrackCode;
stationobject.downsection = list[k][1].standTrackCode;
stationobject.topstand = list[k][0].code;
stationobject.downstand = list[k][1].code;
}else{
stationobject.toppsd = list[k][1].name;
stationobject.downpsd = list[k][0].name;
stationobject.topsection = list[k][1].standTrackCode;
stationobject.downsection = list[k][0].standTrackCode;
stationobject.topstand = list[k][1].code;
stationobject.downstand = list[k][0].code;
}
scope.stationlist.push(stationobject);
}
}
scope.nowStation = scope.stationlist[0];
if(scope.stationtexture["stationlist"]){
scope.stationMesh.getObjectByName("zhantailiebiao").material.map =scope.stationtexture["stationlist"];
scope.stationMesh.getObjectByName("zhantailiebiao").material.map.needsUpdate = true;
if(scope.stationMesh.getObjectByName("menkuangyanse")){
scope.stationMesh.getObjectByName("menkuangyanse").material.map =scope.stationtexture["pingbimen"];
scope.stationMesh.getObjectByName("menkuangyanse").material.map.needsUpdate = true;
}
scope.stationMesh.getObjectByName("zhantaiming").material.map = scope.stationtexture[scope.nowStation.code];
scope.stationMesh.getObjectByName("zhantaiming").material.map.needsUpdate = true;
}
updatestationlist(scope.stationlist);
}else{
olddataai = true;
}
}
//加载线路车站名贴图
this.loadMaterial = function(netdata3d){
Materialload(scope,JSON.parse(netdata3d.data.assets).stationTextureList[0]);
}
//更换场景车站
this.changestation = function(stationname){
for(let i=0,leni=scope.stationlist.length;i<leni;i++){
if(scope.stationlist[i].name == stationname){
scope.nowStation = scope.stationlist[i];
if(scope.stationtexture["stationlist"]){
scope.stationMesh.getObjectByName("zhantaiming").material.map = scope.stationtexture[scope.nowStation.code];
scope.stationMesh.getObjectByName("zhantaiming").material.map.needsUpdate = true;
}
i=leni;
}
}
}
}

View File

@ -0,0 +1,134 @@
export function PasserTrain() {
let scope = this;
this.toptrain = null;
this.downtrain = null;
this.dataList = [];
//初始化列车模型动画
this.initTrain = function(object,mixers,deviceaction,scene){
let ntracks1,ntracks2,tclip,fclip;
if(object.animations){
tclip = new THREE.AnimationClip("three",2,object.animations[0].tracks);
// ntracks1 = object.animations.slice(16,27);
//
// tclip = new THREE.AnimationClip("three",2,ntracks1);
// ntracks2 = object.animations.slice(0,15);
// fclip = new THREE.AnimationClip("four",2,ntracks2);
}
object.traverse( function ( child ) {
if ( child.isMesh ) {
child.renderOrder = 8;
}
} );
let newTrain = object.clone(true);
newTrain.nowcode = null;
scope.toptrain = newTrain;
scope.toptrain.action = {
top:[],
down:[]
};
let points1 = [];
points1.push(new THREE.Vector3(-71,0.06,-6.3));
points1.push(new THREE.Vector3(60.73,0.06,-6.3));
scope.toptrain.curve = new THREE.CatmullRomCurve3(points1);
scope.downtrain = object.clone(true);
scope.downtrain.nowcode = null;
scope.downtrain.action = {
top:[],
down:[]
};
let points2 = [];
points2.push(new THREE.Vector3(-71,0.06,28.68));
points2.push(new THREE.Vector3(60.73,0.06,28.68));
scope.downtrain.curve = new THREE.CatmullRomCurve3(points2);
// console.log(scope.toptrain);
inittrainanimation(scope.toptrain,tclip,fclip,mixers);
inittrainanimation(scope.downtrain,tclip,fclip,mixers);
scope.toptrain.position.z = -20;
scope.toptrain.position.y = -20000;
scope.toptrain.rotation.y = Math.PI;
scope.downtrain.position.z = 40;
scope.downtrain.position.y = -20000;
scene.add(scope.toptrain);
scene.add(scope.downtrain);
}
//初始化车门动画
function inittrainanimation(train,tclip,fclip,mixers){
for(let j=0;j<train.children.length;j++){
// if(train.children[j].name == "c1" || train.children[j].name == "c6"){
// console.log(train.children[j].children);
for(let n=0,lenn = train.children[j].children.length;n<lenn;n++){
if(train.children[j].children[n].name == "top"){
train.children[j].children[n].animations = [];
train.children[j].children[n].animations.push(tclip.clone());
let mixer = new THREE.AnimationMixer( train.children[j].children[n] );
let action = mixer.clipAction( train.children[j].children[n].animations[ 0 ] );
action.setLoop(THREE.LoopOnce);
action.clampWhenFinished = true;
train.action.top.push(action);
mixers.push(mixer);
}
if(train.children[j].children[n].name == "down"){
train.children[j].children[n].animations = [];
train.children[j].children[n].animations.push(tclip.clone());
let mixer = new THREE.AnimationMixer( train.children[j].children[n] );
let action = mixer.clipAction( train.children[j].children[n].animations[ 0 ] );
action.setLoop(THREE.LoopOnce);
action.clampWhenFinished = true;
train.action.down.push(action);
mixers.push(mixer);
}
}
// }else{
// for(let n=0,lenn = train.children[j].children.length;n<lenn;n++){
// if(train.children[j].children[n].name == "top"){
// train.children[j].children[n].animations = [];
// train.children[j].children[n].animations.push(fclip.clone());
// let mixer = new THREE.AnimationMixer( train.children[j].children[n] );
// mixers.push(mixer);
// let action = mixer.clipAction( train.children[j].children[n].animations[ 0 ] );
// action.setLoop(THREE.LoopOnce);
// action.clampWhenFinished = true;
// train.action.top.push(action);
// mixers.push(mixer);
// }
// if(train.children[j].children[n].name == "down"){
// train.children[j].children[n].animations = [];
// train.children[j].children[n].animations.push(fclip.clone());
// let mixer = new THREE.AnimationMixer( train.children[j].children[n] );
// mixers.push(mixer);
// let action = mixer.clipAction( train.children[j].children[n].animations[ 0 ] );
// action.setLoop(THREE.LoopOnce);
// action.clampWhenFinished = true;
// train.action.down.push(action);
// mixers.push(mixer);
// }
// }
// }
}
}
}

View File

@ -0,0 +1,298 @@
import { PasserTrunkManager } from '@/jlmap3d/jl3dtrafficplan/model/traintrunk/passertrunkmanager.js';
export function PasserHuman() {
let scope = this;
let trunkManager = new PasserTrunkManager();
let waitGroup = new THREE.Group();
this.nowTrunk = "";
this.speed = "0";
//初始人物模型和动画
let originhuman1 = null;
let originhuman2 = null;
let originanima1 = null;
let originanima2 = null;
//初始化人物模型动画
this.initHumans = function(object1,object2,mixers,deviceaction,scene){
originhuman1 = object1;
originhuman1.progress = 1;
// scene.add(originhuman1);
originhuman2 = object2;
let mixer1 = new THREE.AnimationMixer( originhuman1 );
let mixer2 = new THREE.AnimationMixer( originhuman2 );
originanima1 = originhuman1.animations[ 0 ];
originanima2 = originhuman2.animations[ 0 ];
originhuman1.remove(originhuman1.children[2]);
for(let i=0;i<220;i++){
let newhuman;
createHumanModel(newhuman,waitGroup,mixers,new THREE.Vector3(0,0,0));
}
// console.log(waitGroup);
}
//创建新的进站乘客
// this.newInHuman= function(humanlist,position){
// if(scope.humanWaitIn.length != 0){
// let newhuman;
// createHumanModel(newhuman,humanlist,position,scope.humanWaitIn[0].stage,scope.humanWaitIn[0].direct,scope.humanWaitIn[0].door);
// scope.humanWaitIn.shift();
// }
// }
// //创建新的出站乘客
// this.newOutHuman = function(humanlist,position){
// if(scope.humanWaitOut.length != 0){
// let newhuman;
// createHumanModel(newhuman,humanlist,position,scope.humanWaitOut[0].stage,scope.humanWaitOut[0].direct,scope.humanWaitOut[0].door);
// scope.humanWaitOut.shift();
// }
//
// }
//创建新的乘客
// this.newHumanCreate = function(humanlist,position,stage,direct,door){
// let newhuman;
// createHumanModel(newhuman,humanlist,position,stage,direct,door);
// }
function createHumanModel(newhuman,humanlist,mixers,position,stage,direct,door){
let mantype = Math.floor(Math.random()*(3-1+1))+1;
if(mantype == 1){
newhuman = THREE.SkeletonUtils.clone( originhuman1 );
newhuman.animations = [];
newhuman.animations.push(originanima1.clone());
}else{
newhuman = THREE.SkeletonUtils.clone( originhuman2 );
newhuman.animations = [];
newhuman.animations.push(originanima2.clone());
}
let mixer = new THREE.AnimationMixer( newhuman );
newhuman.position.copy(position);
newhuman.status = 0;
newhuman.stage = stage;
if(direct){
if(direct == "top"){
newhuman.rotation.y = Math.PI;
}
newhuman.direct = direct;
}else{
newhuman.direct = null;
}
newhuman.doorstatus = null;
if(door){
newhuman.door = door;
}else{
newhuman.door = null;
}
newhuman.progress = 1;
newhuman.action = mixer.clipAction( newhuman.animations[ 0 ] );
newhuman.mixer = mixer;
newhuman.runrail = null;
newhuman.speed = 0;
newhuman.mixer = mixer;
humanlist.add(newhuman);
}
//定义新模型走路动画
this.initMoveAnimate = function(model,name,points,index){
model.status = 1;
let curve = new THREE.CatmullRomCurve3(points);
curve.curvrtype = "catmullrom";
// curve.getLength();
// curve动画轨迹
// progress动画进度
// enable当前动画开关
// speed动画速度
// console.log(curve);
model.action.play();
model.progress = 0;
model.runrail = curve;
model.speed = 0.2/curve.getLength();
}
//更新人物列表中人物的动画
this.moveAnimateUpdate = function(humanlist,passerHuman){
for(let i=0;i<humanlist.children.length;i++){
if(humanlist.children[i].progress>=1){
//更新模型坐标
humanlist.children[i].progress = 1;
humanlist.children[i].action.stop();
if(humanlist.children[i].status == 1){
waitGroup.add(humanlist.children[i]);
}
}else{
//根据动画进度获取动画轨迹上点
// console.log(i);
// console.log(humanlist.children[i].runrail);
// console.log(humanlist.children[i].progress);
let point = humanlist.children[i].runrail.getPointAt(humanlist.children[i].progress);
//更新模型坐标
humanlist.children[i].position.x = point.x;
humanlist.children[i].position.y = point.y;
humanlist.children[i].position.z = point.z;
if((humanlist.children[i].progress+0.001)<1){
let tangent = humanlist.children[i].runrail.getPointAt(humanlist.children[i].progress+0.001);
humanlist.children[i].lookAt(new THREE.Vector3(tangent.x,humanlist.children[i].position.y,tangent.z));
}
humanlist.children[i].progress += humanlist.children[i].speed;
point = null;
}
}
}
this.resetPasser = function(humanlist){
let passerlength = humanlist.children.length;
for(let i=0;i<passerlength;i++){
waitGroup.add(humanlist.children[0]);
}
}
this.initTrainRail = function(humanlist,inNum,leaveNum,direct){
// console.log(inNum[scope.nowTrunk]);
let inPasser = getnum(inNum[scope.nowTrunk].num,3);
let outPasser = getnum(leaveNum[scope.nowTrunk].num,3);
// console.log(inPasser);
// console.log(outPasser);
// let outPassers = inNum[scope.nowTrunk].num;
for(let i=0;i<inPasser.length;i++){
for(let j=0;j<inPasser[i];j++){
setTimeout(function(){
scope.createInPasser(humanlist,direct);
}, Math.random()*1000*i);
}
}
let created = 0;
for(let i=0;i<outPasser.length;i++){
for(let j=0;j<outPasser[i];j++){
// setTimeout(function(){
scope.createOutPasser(humanlist,created,direct);
// }, Math.random()*1000*i);
created++;
}
}
}
this.createInPasser = function(humanlist,direct){
waitGroup.children[0].progress = 0;
waitGroup.children[0].status = 0;
waitGroup.children[0].action.play();
let points = [];
let point1 = trunkManager.getDoorRandomPos(scope.nowTrunk,direct);
let overpoint = trunkManager.getTrunkRandomPos(scope.nowTrunk);
waitGroup.children[0].position.copy(point1);
points.push(point1);
if(direct == 1){
points.push(new THREE.Vector3(point1.x,point1.y,point1.z+0.5));
}else{
points.push(new THREE.Vector3(point1.x,point1.y,point1.z-0.5));
}
points.push(overpoint);
let curve = new THREE.CatmullRomCurve3(points);
waitGroup.children[0].runrail = curve;
waitGroup.children[0].speed = 0.2/curve.getLength();
humanlist.add(waitGroup.children[0]);
}
this.createOutPasser = function(humanlist,created,direct){
humanlist.children[created].progress = 0;
humanlist.children[created].status = 1;
humanlist.children[created].action.play();
let points = [];
let point1 = new THREE.Vector3(humanlist.children[created].position.x,humanlist.children[created].position.y,humanlist.children[created].position.z);
let overpoint = trunkManager.getDoorRandomPos(scope.nowTrunk,direct);
points.push(point1);
if(direct == 1){
points.push(new THREE.Vector3(point1.x,point1.y,point1.z+0.5));
}else{
points.push(new THREE.Vector3(point1.x,point1.y,point1.z-0.5));
}
points.push(overpoint);
let curve = new THREE.CatmullRomCurve3(points);
humanlist.children[created].runrail = curve;
humanlist.children[created].speed = 0.2/curve.getLength();
}
this.setNowTrunkPasser = function(humanlist,num,trunknum){
// let array = getnum(num,6);
// console.log(array);
if(num){
// for(let i=0;i<array.length;i++){
for(let j=0;j<num;j++){
let pos = trunkManager.getTrunkRandomPos(trunknum);
waitGroup.children[0].zone = trunkManager.trunk[trunknum].name;
waitGroup.children[0].position.x = pos.x;
waitGroup.children[0].position.y = pos.y;
waitGroup.children[0].position.z = pos.z;
if(pos.z<0){
waitGroup.children[0].rotation.y = Math.PI;
}else{
waitGroup.children[0].rotation.y = 0;
}
humanlist.add(waitGroup.children[0]);
}
// }
}
}
//计算距离
//let dx = Math.abs(point1.x - point2.x);
//let dy = Math.abs(point1.y - point2.y);
  //let distance = Math.sqrt(Math.pow(dx,2)+Math.pow(dy,2));
//寻找最小距离
// var x = 9 ,y = 12 , c = 50;
// var max = x > y ? (x > c ? x : c) : (y > c ? y : c);
// var min = x < y ? (x < c ? x : c) : (y < c ? y : c);
function getnum(num,pnum){
let re = [];
let base = Math.floor(num/pnum);
let reset = num%pnum;
for(let i=0;i<pnum;i++){
let nownum = base+(i<reset?1:0);
re.push(nownum);
}
return re;
}
//离开车站释放缓存
this.uncache = function(uncachemodel){
if(uncachemodel){
uncachemodel.mixer.uncacheAction();
uncachemodel.traverse( function ( child ) {
if ( child.isMesh ) {
child.geometry.dispose();
child.material.dispose();
}
} );
}
}
}

View File

@ -0,0 +1,126 @@
export function PasserTrunkManager(data) {
var scope = this;
this.trunk = [
{
name:"trunk1",
position:new THREE.Vector3(11.6,1.22,0),
leftdoor:[
new THREE.Vector3(7.12,1.22,-1.6),
new THREE.Vector3(11.6,1.22,-1.6),
new THREE.Vector3(16,1.22,-1.6)
],
rightdoor:[
new THREE.Vector3(7.12,1.22,1.6),
new THREE.Vector3(11.6,1.22,1.6),
new THREE.Vector3(16,1.22,1.6)
],
},
{
name:"trunk2",
position:new THREE.Vector3(33,1.22,0),
leftdoor:[
new THREE.Vector3(28.4,1.22,-1.6),
new THREE.Vector3(33,1.22,-1.6),
new THREE.Vector3(37,1.22,-1.6),
],
rightdoor:[
new THREE.Vector3(28.4,1.22,1.6),
new THREE.Vector3(33,1.22,1.6),
new THREE.Vector3(37,1.22,1.6),
],
},
{
name:"trunk3",
position:new THREE.Vector3(54,1.22,0),
leftdoor:[
new THREE.Vector3(50,1.22,-1.6),
new THREE.Vector3(54,1.22,-1.6),
new THREE.Vector3(58,1.22,-1.6),
],
rightdoor:[
new THREE.Vector3(50,1.22,1.6),
new THREE.Vector3(54,1.22,1.6),
new THREE.Vector3(58,1.22,1.6)
],
},
{
name:"trunk4",
position:new THREE.Vector3(75.7,1.22,0),
leftdoor:[
new THREE.Vector3(71,1.22,-1.6),
new THREE.Vector3(75,1.22,-1.6),
new THREE.Vector3(79,1.22,-1.6)
],
rightdoor:[
new THREE.Vector3(71,1.22,1.6),
new THREE.Vector3(75,1.22,1.6),
new THREE.Vector3(79,1.22,1.6)
],
},
{
name:"trunk5",
position:new THREE.Vector3(97.1,1.22,0),
leftdoor:[
new THREE.Vector3(93,1.22,-1.6),
new THREE.Vector3(97,1.22,-1.6),
new THREE.Vector3(101,1.22,-1.6),
],
rightdoor:[
new THREE.Vector3(93,1.22,1.6),
new THREE.Vector3(97,1.22,1.6),
new THREE.Vector3(101,1.22,1.6)
],
},
{
name:"trunk6",
position:new THREE.Vector3(118.5,1.22,0),
leftdoor:[
new THREE.Vector3(114.5,1.22,-1.6),
new THREE.Vector3(118.5,1.22,-1.6),
new THREE.Vector3(122.5,1.22,-1.6),
],
rightdoor:[
new THREE.Vector3(114.5,1.22,1.6),
new THREE.Vector3(118.5,1.22,1.6),
new THREE.Vector3(122.5,1.22,1.6),
],
}
];
var rand = (min,max) => Math.round(Math.random()*(max-min))+min;
this.getDoorRandomPos = function(trunkNum,direct){
let newPos = null;
let doorNum = rand(0,2);
if(direct == "1"){
newPos = scope.trunk[trunkNum].leftdoor[doorNum];
}else if(direct == "2"){
newPos = scope.trunk[trunkNum].rightdoor[doorNum];
}
return newPos;
}
this.getTrunkRandomPos = function(index){
let newPos = new THREE.Vector3(
scope.trunk[index].position.x+RandomNum(-11,11),
1.22,
scope.trunk[index].position.z+RandomNum(-1.28,1.28));
return newPos;
}
function RandomNum(Min, Max) {
var Range = Max - Min;
var Rand = Math.random();
var num = Min + Rand * Range; //四舍五入
return num;
}
}

View File

@ -0,0 +1,331 @@
import { ZoneModel } from '@/jlmap3d/jl3dpassflow/model/zonemodel.js';
//进站区域1
let enter1 = {
code : '001',
name : "enter1",
type : "normal",
stage : "0",
randompoint : new THREE.Vector3(26.6,9.8,-2.7),
railpoints : [
new THREE.Vector3(34,9.8,-6),
new THREE.Vector3(32,9.8,-6)
]
};
//进站区域2
let enter2 = {
code : '002',
name : "enter2",
type : "normal",
stage : "0",
randompoint : new THREE.Vector3(27,9.8,16),
railpoints : [
new THREE.Vector3(34,9.8,31.5),
new THREE.Vector3(32,9.8,31.5)
]
};
//安检区域
let security = {
code : '003',
name : "security",
type : "device",
stage : "1",
randompoint : new THREE.Vector3(8.8,9.8,18),
railpoints : [
new THREE.Vector3(20.5,9.8,18),
new THREE.Vector3(21,9.8,21)
]
};
//进方向闸机区域
let entergate = {
code : '004',
name : "entergate",
type : "device",
stage : "2",
randompoint : new THREE.Vector3(2.3,9.8,13),
railpoints : [
new THREE.Vector3(6.3,9.8,18.1),
new THREE.Vector3(4.8,9.8,18.1),
new THREE.Vector3(3.4,9.8,18.1),
new THREE.Vector3(2.1,9.8,18.1),
new THREE.Vector3(0.7,9.8,18.1)
]
};
//站台上车区域
let standtop = {
code : '005',
name : "standtop",
type : "stand",
stage : "3",
randompoint : new THREE.Vector3(-64,1.77,0.38),
doorpoints:[
new THREE.Vector3(-62.1,1.77,-4.38),
new THREE.Vector3(-57.54,1.77,-4.38),
new THREE.Vector3(-53.1,1.77,-4.38),
new THREE.Vector3(-42.5,1.77,-4.38),
new THREE.Vector3(-37.6,1.77,-4.38),
new THREE.Vector3(-33.6,1.77,-4.38),
new THREE.Vector3(-20.8,1.77,-4.38),
new THREE.Vector3(-16.6,1.77,-4.38),
new THREE.Vector3(-12,1.77,-4.38),
new THREE.Vector3(0.5,1.77,-4.38),
new THREE.Vector3(4.8,1.77,-4.38),
new THREE.Vector3(9.27,1.77,-4.38),
new THREE.Vector3(21.6,1.77,-4.38),
new THREE.Vector3(26.2,1.77,-4.38),
new THREE.Vector3(30.48,1.77,-4.38),
new THREE.Vector3(43.2,1.77,-4.38),
new THREE.Vector3(47.5,1.77,-4.38),
new THREE.Vector3(51.9,1.77,-4.38)
],
// new THREE.Vector3(-62.84,1.77,-4.38),
// new THREE.Vector3(-58.11,1.77,-4.38),
// new THREE.Vector3(-53.47,1.77,-4.38),
// new THREE.Vector3(-45.45,1.77,-4.38),
// new THREE.Vector3(-41.1,1.77,-4.38),
// new THREE.Vector3(-36.33,1.77,-4.38),
// new THREE.Vector3(-31.5,1.77,-4.38),
// new THREE.Vector3(-23.65,1.77,-4.38),
// new THREE.Vector3(-18.98,1.77,-4.38),
// new THREE.Vector3(-14.46,1.77,-4.38),
// new THREE.Vector3(-10,1.77,-4.38),
// new THREE.Vector3(-2.2,1.77,-4.38),
// new THREE.Vector3(2.49,1.77,-4.38),
// new THREE.Vector3(7.17,1.77,-4.38),
// new THREE.Vector3(11.8,1.77,-4.38),
// new THREE.Vector3(19.41,1.77,-4.38),
// new THREE.Vector3(24.09,1.77,-4.38),
// new THREE.Vector3(28.72,1.77,-4.38),
// new THREE.Vector3(33.46,1.77,-4.38),
// new THREE.Vector3(41.24,1.77,-4.38),
// new THREE.Vector3(45.82,1.77,-4.38),
// new THREE.Vector3(50.69,1.77,-4.38)
railpoints : [
new THREE.Vector3(53.1,1.77,-1.8),
new THREE.Vector3(-63.5,1.77,-1.8)
]
};
//站台下车区域
let standdown = {
code : '006',
name : "standdown",
type : "stand",
stage : "3",
randompoint : new THREE.Vector3(-64,1.77,21),
doorpoints:[
new THREE.Vector3(-62.1,1.77,27),
new THREE.Vector3(-57.54,1.77,27),
new THREE.Vector3(-53.1,1.77,27),
new THREE.Vector3(-42.5,1.77,27),
new THREE.Vector3(-37.6,1.77,27),
new THREE.Vector3(-33.6,1.77,27),
new THREE.Vector3(-20.8,1.77,27),
new THREE.Vector3(-16.6,1.77,27),
new THREE.Vector3(-12,1.77,27),
new THREE.Vector3(0.5,1.77,27),
new THREE.Vector3(4.8,1.77,27),
new THREE.Vector3(9.27,1.77,27),
new THREE.Vector3(21.6,1.77,27),
new THREE.Vector3(26.2,1.77,27),
new THREE.Vector3(30.48,1.77,27),
new THREE.Vector3(43.2,1.77,27),
new THREE.Vector3(47.5,1.77,27),
new THREE.Vector3(51.9,1.77,27)
],
// new THREE.Vector3(-62.84,1.77,27),
// new THREE.Vector3(-58.11,1.77,27),
// new THREE.Vector3(-53.47,1.77,27),
// new THREE.Vector3(-45.45,1.77,27),
// new THREE.Vector3(-41.1,1.77,27),
// new THREE.Vector3(-36.33,1.77,27),
// new THREE.Vector3(-31.5,1.77,27),
// new THREE.Vector3(-23.65,1.77,27),
// new THREE.Vector3(-18.98,1.77,27),
// new THREE.Vector3(-14.46,1.77,27),
// new THREE.Vector3(-10,1.77,27),
// new THREE.Vector3(-2.2,1.77,27),
// new THREE.Vector3(2.49,1.77,27),
// new THREE.Vector3(7.17,1.77,27),
// new THREE.Vector3(11.8,1.77,27),
// new THREE.Vector3(19.41,1.77,27),
// new THREE.Vector3(24.09,1.77,27),
// new THREE.Vector3(28.72,1.77,27),
// new THREE.Vector3(33.46,1.77,27),
// new THREE.Vector3(41.24,1.77,27),
// new THREE.Vector3(45.82,1.77,27),
// new THREE.Vector3(50.69,1.77,27)
railpoints : [
new THREE.Vector3(53.1,1.77,24),
new THREE.Vector3(-64,1.77,24)
]
};
//4是刚下车状态
//出方向闸机区域
let exitgate = {
code : '007',
name : "exitgate",
type : "device",
stage : "5",
randompoint : new THREE.Vector3(-16,9.8,-0.4),
railpoints : [
new THREE.Vector3(18,9.8,-0.27),
new THREE.Vector3(18,9.8,1.18),
new THREE.Vector3(18,9.8,2.64),
new THREE.Vector3(18,9.8,4.1),
new THREE.Vector3(18,9.8,5.4)
]
};
//出站台区域1
let exit1 = {
code : '008',
name : "exit1",
type : "normal",
stage : "6",
randompoint : new THREE.Vector3(),
railpoints : [
new THREE.Vector3(28.2,9.8,-7),
new THREE.Vector3(30.5,9.8,-7.4)
]
};
//出站台区域2
let exit2 = {
code : '009',
name : "exit2",
type : "normal",
stage : "6",
randompoint : new THREE.Vector3(),
railpoints : [
new THREE.Vector3(28.3,9.8,28),
new THREE.Vector3(30.2,9.8,28)
]
};
let enternum = 0;
let exitnum = 0;
//区域管理器
export function ZoneManager() {
var scope = this;
this.name = "test";
this.list = [];
initzone();
//初始化区域对象
function initzone(){
scope.list[enter1.name] = new ZoneModel(enter1);
scope.list[enter2.name] = new ZoneModel(enter2);
scope.list[security.name] = new ZoneModel(security);
scope.list[entergate.name] = new ZoneModel(entergate);
scope.list[standtop.name] = new ZoneModel(standtop);
scope.list[standdown.name] = new ZoneModel(standdown);
scope.list[exitgate.name] = new ZoneModel(exitgate);
scope.list[exit1.name] = new ZoneModel(exit1);
scope.list[exit2.name] = new ZoneModel(exit2);
}
//获取区域范围内点
this.getinitposition = function(name){
// console.log(scope.list[name]);
let randompoint = new THREE.Vector3(0,scope.list[name].randompoint.y,0);
// console.log(randompoint);
if(name == "enter1"){
randompoint.x = scope.list[name].randompoint.x + Math.random()*8;
randompoint.z = scope.list[name].randompoint.z + Math.random()*8;
}
if(name == "enter2"){
randompoint.x = scope.list[name].randompoint.x + Math.random()*8;
randompoint.z = scope.list[name].randompoint.z + Math.random()*8;
}
if(name == "security"){
randompoint.x = scope.list[name].randompoint.x + Math.random()*10;
randompoint.z = scope.list[name].randompoint.z + Math.random()*2;
}
if(name == "entergate"){
randompoint.x = scope.list[name].randompoint.x + Math.random()*5;
randompoint.z = scope.list[name].randompoint.z - Math.random()*2;
}
if(name == "standtop"){
randompoint.x = scope.list[name].randompoint.x + Math.random()*100;
randompoint.z = scope.list[name].randompoint.z + Math.random();
}
if(name == "standdown"){
randompoint.x = scope.list[name].randompoint.x + Math.random()*100;
randompoint.z = scope.list[name].randompoint.z ;
}
if(name == "exitgate"){
randompoint.x = scope.list[name].randompoint.x + Math.random()*30;
randompoint.z = scope.list[name].randompoint.z + Math.random()*5;
}
// let random = Math.random();
return randompoint;
}
this.getstandposition = function(name){
let n = Math.round(Math.random()*17);
if(n>=1){
n=n;
}else{
n=0;
}
let randompoint = new THREE.Vector3(0,scope.list[name].doorpoints[n].y,0);
if(name == "standtop"){
randompoint.x = scope.list[name].doorpoints[n].x + Math.random()*3;
randompoint.z = scope.list[name].doorpoints[n].z +4+Math.random()*5;
}
if(name == "standdown"){
randompoint.x = scope.list[name].doorpoints[n].x + Math.random()*3;
randompoint.z = scope.list[name].doorpoints[n].z -4-Math.random()*5;
}
let standdata = {
door:n,
point:randompoint
};
return standdata;
}
this.getgateposition = function(name){
let randompoint = new THREE.Vector3(0,0,0);
let standdata = {
door:null,
point:null
};
if(name == "entergate"){
randompoint.x = scope.list[name].railpoints[enternum].x ;
randompoint.y = scope.list[name].railpoints[enternum].y ;
randompoint.z = scope.list[name].railpoints[enternum].z ;
standdata.door = 4-enternum;
enternum += 1;
if(enternum>4){
enternum = 0;
}
}
if(name == "exitgate"){
randompoint.x = scope.list[name].railpoints[exitnum].x ;
randompoint.y = scope.list[name].railpoints[exitnum].y ;
randompoint.z = scope.list[name].railpoints[exitnum].z ;
standdata.door = 4-exitnum;
exitnum += 1;
if(exitnum>4){
exitnum = 0;
}
}
standdata.point = randompoint;
return standdata;
}
this.getzoneposition = function(name){
// let random = Math.random();
let position = scope.list[name].railline.getPointAt(Math.random());
return position;
}
this.zoneActionCheck = function(){
}
}

View File

@ -0,0 +1,20 @@
export function ZoneModel(data) {
var scope = this;
//code
this.code = data.code;
//命名
this.name = data.name;
this.type = data.type;
this.stage = data.stage;
this.status = 0;
this.randompoint = data.randompoint;
//轨迹点
this.railpoints = data.railpoints;
this.railline = new THREE.CatmullRomCurve3(data.railpoints);
if(data.doorpoints){
this.doorpoints = data.doorpoints;
}else{
this.doorpoints = null;
}
}

View File

@ -0,0 +1,267 @@
export function PasserAi(zone,finder) {
let scope = this;
//下车控制开关
this.toppasseron = false;
this.downpasseron = false;
//上车控制开关
this.toppasserin = false;
this.downpasserin = false;
let passerZone = zone;
let pathFinder = finder;
let path;
let playerPosition = new THREE.Vector3( -3.5, 0.5, 5.5 );
let targetPosition = new THREE.Vector3();
//生成下车出站人物
this.passerout = function(direct,mode){
// console.log(direct);
if(direct == "top"){
// console.log("toppasser");
if(mode == "start"){
scope.toppasseron = true;
scope.toppasserin = true;
}
if(mode == "end"){
scope.toppasseron = false
scope.toppasserin = false;
}
// scope.toppasseron = true;
// setTimeout(function(){
// scope.toppasseron = false
// scope.toppasserin = true;
//
// setTimeout(function(){
// scope.toppasserin = false;
// }, 20000);
// }, 5000);
}
if(direct == "down"){
if(mode == "start"){
scope.downpasseron = true;
scope.downpasserin = true;
}
if(mode == "end"){
scope.downpasseron = false;
scope.downpasserin = false;
}
// console.log("downpasser");
// scope.downpasseron = true;
// setTimeout(function(){
// scope.downpasseron = false;
// scope.downpasserin = true;
// setTimeout(function(){
// scope.downpasserin = false;
// }, 20000);
// }, 5000);
}
}
//初始化加载人物
this.initPasser = function(humanlist,topWaitPassers,downWaitPassers,passerHuman,jl3d){
for(let i=0;i<jl3d.humanWaitTop;i++){
let standdata = passerZone.getstandposition("standtop");
passerHuman.newHumanCreate(topWaitPassers,standdata.point,4,"top",standdata.door);
}
for(let i=0;i<jl3d.humanWaitDown;i++){
let standdata = passerZone.getstandposition("standdown");
passerHuman.newHumanCreate(downWaitPassers,standdata.point,4,"down",standdata.door);
}
}
//人物站台阶段更新
this.aiUpdate = function(humanlist,topWaitPassers,downWaitPassers,outStationPassers,passerHuman,passerCheckDoor,deviceaction){
for(let i=0;i<outStationPassers.children.length;i++){
if(outStationPassers.children[i].status == 0){
//stage = 5 下车
if(outStationPassers.children[i].stage == 5){
let points = [];
points.push(new THREE.Vector3(outStationPassers.children[i].position.x,outStationPassers.children[i].position.y,outStationPassers.children[i].position.z));
if(outStationPassers.children[i].direct == "top"){
points.push(new THREE.Vector3(outStationPassers.children[i].position.x,outStationPassers.children[i].position.y,outStationPassers.children[i].position.z+5));
}
if(outStationPassers.children[i].direct == "down"){
points.push(new THREE.Vector3(outStationPassers.children[i].position.x,outStationPassers.children[i].position.y,outStationPassers.children[i].position.z-5));
}
targetPosition = passerZone.getgateposition("exitgate");
path = pathFinder.find(points[1],targetPosition.point);
outStationPassers.children[i].door = targetPosition.door;
for(let i=0;i<path.length;i++){
points.push(new THREE.Vector3(path[i].x,path[i].y,path[i].z));
}
passerHuman.initMoveAnimate(outStationPassers.children[i],i,points,i);
}
//stage = 7 出闸机
if(outStationPassers.children[i].stage == 7){
let points = [];
points.push(new THREE.Vector3(outStationPassers.children[i].position.x,outStationPassers.children[i].position.y,outStationPassers.children[i].position.z));
points.push(new THREE.Vector3(outStationPassers.children[i].position.x+5,outStationPassers.children[i].position.y,outStationPassers.children[i].position.z));
passerCheckDoor.checkDoorControl("out",outStationPassers.children[i].door,deviceaction)
passerHuman.initMoveAnimate(outStationPassers.children[i],i,points,i);
}
//stage = 8 出站
if(outStationPassers.children[i].stage == 8){
let direct = Math.floor(Math.random()*(3-1+1))+1;
let points = [];
points.push(new THREE.Vector3(outStationPassers.children[i].position.x,outStationPassers.children[i].position.y,outStationPassers.children[i].position.z));
//1--top
//2-- down
if(direct == 1){
targetPosition = passerZone.getzoneposition("exit1");
path = pathFinder.find(points[0],targetPosition);
}else{
targetPosition = passerZone.getzoneposition("exit2");
path = pathFinder.find(points[0],targetPosition);
}
for(let i=0;i<path.length;i++){
points.push(new THREE.Vector3(path[i].x,path[i].y,path[i].z));
}
passerHuman.initMoveAnimate(outStationPassers.children[i],i,points,i);
}
}
}
for(let i=0;i<topWaitPassers.children.length;i++){
if(topWaitPassers.children[i].status == 0){
//stage = 4 上车
if(topWaitPassers.children[i].stage == 4){
if(scope.toppasserin && topWaitPassers.children[i].direct == "top"){
let points = [];
points.push(new THREE.Vector3(topWaitPassers.children[i].position.x,topWaitPassers.children[i].position.y,topWaitPassers.children[i].position.z));
points.push(passerZone.list["standtop"].doorpoints[topWaitPassers.children[i].door]);
if(points[1] == undefined){
}else{
passerHuman.initMoveAnimate(topWaitPassers.children[i],i,points,i);
}
}
}
}
}
for(let i=0;i<downWaitPassers.children.length;i++){
if(downWaitPassers.children[i].status == 0){
//stage = 4 上车
if(downWaitPassers.children[i].stage == 4){
if(scope.downpasserin && downWaitPassers.children[i].direct == "down"){
let points = [];
points.push(new THREE.Vector3(downWaitPassers.children[i].position.x,downWaitPassers.children[i].position.y,downWaitPassers.children[i].position.z));
points.push(passerZone.list["standdown"].doorpoints[downWaitPassers.children[i].door]);
if(points[1] == undefined){
}else{
passerHuman.initMoveAnimate(downWaitPassers.children[i],i,points,i);
}
}
}
}
}
for(let i=0;i<humanlist.children.length;i++){
// console.log(humans[i]);
if(humanlist.children[i].status == 0){
//stage = 0 进入车站
if(humanlist.children[i].stage == 0){
let points = [];
points.push(new THREE.Vector3(humanlist.children[i].position.x,humanlist.children[i].position.y,humanlist.children[i].position.z));
targetPosition = passerZone.getzoneposition("security");
path = pathFinder.find(points[0],targetPosition);
for(let i=0;i<path.length;i++){
points.push(new THREE.Vector3(path[i].x,path[i].y,path[i].z));
}
passerHuman.initMoveAnimate(humanlist.children[i],i,points,i);
// console.log(path);
}
//stage = 1 前往进站闸机
if(humanlist.children[i].stage == 1){
let points = [];
points.push(new THREE.Vector3(humanlist.children[i].position.x,humanlist.children[i].position.y,humanlist.children[i].position.z));
targetPosition = passerZone.getgateposition("entergate");
path = pathFinder.find(points[0],targetPosition.point);
humanlist.children[i].door = targetPosition.door;
for(let i=0;i<path.length;i++){
points.push(new THREE.Vector3(path[i].x,path[i].y,path[i].z));
}
passerHuman.initMoveAnimate(humanlist.children[i],i,points,i);
}
//stage = 2 过闸机
if(humanlist.children[i].stage == 2){
let points = [];
points.push(new THREE.Vector3(humanlist.children[i].position.x,humanlist.children[i].position.y,humanlist.children[i].position.z));
points.push(new THREE.Vector3(humanlist.children[i].position.x,humanlist.children[i].position.y,humanlist.children[i].position.z-5));
passerCheckDoor.checkDoorControl("in",humanlist.children[i].door,deviceaction)
passerHuman.initMoveAnimate(humanlist.children[i],i,points,i);
}
//stage = 3 前往站台
if(humanlist.children[i].stage == 3){
let direct = Math.floor(Math.random()*(2))+1;
// console.log(direct);
let points = [];
points.push(new THREE.Vector3(humanlist.children[i].position.x,humanlist.children[i].position.y,humanlist.children[i].position.z));
// points.push(new THREE.Vector3(11.81,9.8,13.11));
//1--top
//2-- down
if(humanlist.children[i].overGoal == "top"){
targetPosition = passerZone.getstandposition("standtop");
path = pathFinder.find(points[0],targetPosition.point);
humanlist.children[i].direct = "top";
}else{
targetPosition = passerZone.getstandposition("standdown");
path = pathFinder.find(points[0],targetPosition.point);
humanlist.children[i].direct = "down";
}
if(path != null){
if(path[0].y<9.84){
points.push(new THREE.Vector3(11.81,9.8,13.11));
points.push(new THREE.Vector3(29.5,1.77,13.16));
}
for(let i=0;i<path.length;i++){
points.push(new THREE.Vector3(path[i].x,path[i].y,path[i].z));
}
humanlist.children[i].door = targetPosition.door;
passerHuman.initMoveAnimate(humanlist.children[i],i,points,i);
}else{
humanlist.children[i].position.x += 0.05;
}
}
}
}
}
}

View File

@ -0,0 +1,69 @@
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
import { Pathfinding } from '@/jlmap3d/utils/pathfinder/Pathfinding.js';
import { OBJLoader } from '@/jlmap3d/main/loaders/OBJLoader';
export function PathFinder(){
let scope = this;
this.navmesh = null;
const ZONE = 'level';
const SPEED = 10;
const OFFSET = 0.2;
THREE.Pathfinding = Pathfinding;
let groupID,path,level;
let playerPosition = new THREE.Vector3( -3.5, 0.5, 5.5 );
let pathFinder = new THREE.Pathfinding();
let loaderObj = new THREE.OBJLoader();
// load a resource
loaderObj.load(
// resource URL
JL3D_LOCAL_STATIC+'/jl3d/path/path.obj',
// called when resource is loaded
function ( object ) {
// console.time('createZone()');
const zone = THREE.Pathfinding.createZone(object.children[0].geometry);
// console.timeEnd('createZone()');
pathFinder.setZoneData( ZONE, zone );
const navWireframe = new THREE.Mesh(object.children[0].geometry, new THREE.MeshBasicMaterial({
color: 0x808080,
wireframe: true
}));
navWireframe.position.y = OFFSET / 2;
// scene.add(navWireframe);
scope.navmesh = object;
groupID = pathFinder.getGroup( ZONE, playerPosition );
},
// called when loading is in progresses
function ( xhr ) {
console.log( ( xhr.loaded / xhr.total * 100 ) + '% loaded' );
},
// called when loading has errors
function ( error ) {
console.log( 'An error happened' );
}
);
this.find = function(startPoint,targetPosition){
groupID = pathFinder.getGroup( ZONE, startPoint );
let resultPath = pathFinder.findPath( startPoint, targetPosition, ZONE, groupID );
return resultPath;
}
}

View File

@ -43,7 +43,7 @@ let waicestation = {
}
let station3 = {
id:"10000",
name:"站台",
name:"特殊站台",
deviceType:"station3",
type:"num4",
picUrl:"",

View File

@ -179,12 +179,35 @@ export function StationStandListN() {
}
} );
//新车门动画获取待定
// let allClear = 0;
// for(let j=0;j<standsdata.length;j++){
//
// allClear = 0;
// for(let i=0;i<psddata.length;i++){
//
// for(let n=0;n<standsdata[j].stands.length;n++){
// if(psddata[i].standCode == standsdata[j].stands[n].code){
// allClear++;
// standsdata[j].stands[n].position = psddata[i].position;
// }
// }
//
// if(allClear == standsdata[j].stands.length){
// standsdata[j].stands.sort(compare);
// i = psddata.length;
// }
// }
// }
//
//
// console.log(standsdata);
// console.log(psddata);
for(let i=0;i<standsdata.length;i++){
let newstationstand = new StationStandModel(standsdata[i]);
// console.log(standsdata[i]);
if(standsdata[i].code != "Station96090"){
console.log("3");
newstationstand.code = standsdata[i].code;
newstationstand.name = standsdata[i].name;
newstationstand.type = "station";
@ -236,6 +259,7 @@ export function StationStandListN() {
let mixer = new THREE.AnimationMixer( newstationmesh.children[j] );
for(let n=0;n<psddata.length;n++){
for(let m=0;m<newstationstand.stands.length;m++){
@ -305,118 +329,115 @@ export function StationStandListN() {
}
}
}else{
newstationstand.code = standsdata[i].code;
newstationstand.name = standsdata[i].name;
newstationstand.type = "station";
newstationstand.num = i;
newstationstand.stand = [];
// newstationstand.direction1.code = standsdata[i].direction1.code;
// newstationstand.direction1.name = standsdata[i].direction1.name;
// newstationstand.direction1.screenDoorOpenStatus = "01";
//
// newstationstand.direction2.code = standsdata[i].direction2.code;
// newstationstand.direction2.name = standsdata[i].direction2.name;
// newstationstand.direction2.screenDoorOpenStatus = "01";
let newstationmesh = null;
newstationmesh = selectmesh3.clone(true);
newstationmesh.code = standsdata[i].code;
newstationmesh.name = standsdata[i].code;
newstationmesh.position.x = standsdata[i].position.x;
newstationmesh.position.y = standsdata[i].position.y;
newstationmesh.position.z = standsdata[i].position.z;
// newstationmesh.rotation.x = standsdata[i].rotation._x;
// newstationmesh.rotation.y = standsdata[i].rotation._y;
// newstationmesh.rotation.z = standsdata[i].rotation._z;
newstationstand.mesh = newstationmesh;
scope.group.add(newstationmesh);
//
scope.list[standsdata[i].code] = newstationstand;
//
let newclip =null;
newclip = selectmesh3.animations[ 0 ];
for(let j=0;j<newstationmesh.children.length;j++){
newstationstand.code = standsdata[i].code;
newstationstand.name = standsdata[i].name;
newstationstand.type = "station";
newstationstand.num = i;
newstationstand.stand = [];
// newstationstand.direction1.code = standsdata[i].direction1.code;
// newstationstand.direction1.name = standsdata[i].direction1.name;
// newstationstand.direction1.screenDoorOpenStatus = "01";
//
// newstationstand.direction2.code = standsdata[i].direction2.code;
// newstationstand.direction2.name = standsdata[i].direction2.name;
// newstationstand.direction2.screenDoorOpenStatus = "01";
let newstationmesh = null;
newstationmesh = selectmesh3.clone(true);
newstationmesh.code = standsdata[i].code;
newstationmesh.name = standsdata[i].code;
newstationmesh.position.x = standsdata[i].position.x;
newstationmesh.position.y = standsdata[i].position.y;
newstationmesh.position.z = standsdata[i].position.z;
// newstationmesh.rotation.x = standsdata[i].rotation._x;
// newstationmesh.rotation.y = standsdata[i].rotation._y;
// newstationmesh.rotation.z = standsdata[i].rotation._z;
newstationstand.mesh = newstationmesh;
scope.group.add(newstationmesh);
//
scope.list[standsdata[i].code] = newstationstand;
//
let newclip =null;
newclip = selectmesh3.animations[ 0 ];
for(let j=0;j<newstationmesh.children.length;j++){
if(newstationmesh.children[j].name == "top"){
newstationmesh.children[j].animations = [];
newstationmesh.children[j].animations.push(newclip.clone());
if(newstationmesh.children[j].name == "top"){
newstationmesh.children[j].animations = [];
newstationmesh.children[j].animations.push(newclip.clone());
let mixer = new THREE.AnimationMixer( newstationmesh.children[j] );
for(let n=0;n<psddata.length;n++){
for(let n=0;n<psddata.length;n++){
for(let m=0;m<newstationstand.stands.length;m++){
console.log("====================");
console.log(newstationstand.stands[m]);
console.log(psddata[n]);
if(psddata[n].standCode == newstationstand.stands[m].code && newstationstand.stands[m].right == false){
let key = psddata[n].code;
actionss[key] = {
status:"01",
action:mixer.clipAction( newstationmesh.children[j].animations[0])
};
actionss[key].action.setLoop(THREE.LoopOnce);
actionss[key].action.clampWhenFinished = true;
//actionss[key].play();
mixers.push(mixer);
n = psddata.length;
m = newstationstand.stands.length;
}
let mixer = new THREE.AnimationMixer( newstationmesh.children[j] );
for(let n=0;n<psddata.length;n++){
for(let m=0;m<newstationstand.stands.length;m++){
console.log("====================");
console.log(newstationstand.stands[m]);
console.log(psddata[n]);
if(psddata[n].standCode == newstationstand.stands[m].code && newstationstand.stands[m].right == false){
let key = psddata[n].code;
actionss[key] = {
status:"01",
action:mixer.clipAction( newstationmesh.children[j].animations[0])
};
actionss[key].action.setLoop(THREE.LoopOnce);
actionss[key].action.clampWhenFinished = true;
//actionss[key].play();
mixers.push(mixer);
n = psddata.length;
m = newstationstand.stands.length;
}
}
}
}
if(newstationmesh.children[j].name == "down"){
newstationmesh.children[j].animations = [];
newstationmesh.children[j].animations.push(newclip.clone());
let mixer = new THREE.AnimationMixer( newstationmesh.children[j] );
for(let n=0;n<psddata.length;n++){
for(let n=0;n<psddata.length;n++){
for(let m=0;m<newstationstand.stands.length;m++){
console.log("====================");
console.log(newstationstand.stands[m]);
console.log(psddata[n]);
if(psddata[n].standCode == newstationstand.stands[m].code && newstationstand.stands[m].right == true){
let key = psddata[n].code;
actionss[key] = {
status:"01",
action:mixer.clipAction( newstationmesh.children[j].animations[0])
};
actionss[key].action.setLoop(THREE.LoopOnce);
actionss[key].action.clampWhenFinished = true;
//actionss[key].play();
mixers.push(mixer);
n = psddata.length;
m = newstationstand.stands.length;
}
}
}
}
}
}
if(newstationmesh.children[j].name == "down"){
newstationmesh.children[j].animations = [];
newstationmesh.children[j].animations.push(newclip.clone());
let mixer = new THREE.AnimationMixer( newstationmesh.children[j] );
for(let n=0;n<psddata.length;n++){
for(let m=0;m<newstationstand.stands.length;m++){
console.log("====================");
console.log(newstationstand.stands[m]);
console.log(psddata[n]);
if(psddata[n].standCode == newstationstand.stands[m].code && newstationstand.stands[m].right == true){
let key = psddata[n].code;
actionss[key] = {
status:"01",
action:mixer.clipAction( newstationmesh.children[j].animations[0])
};
actionss[key].action.setLoop(THREE.LoopOnce);
actionss[key].action.clampWhenFinished = true;
//actionss[key].play();
mixers.push(mixer);
n = psddata.length;
m = newstationstand.stands.length;
}
}
if(mode){
if(mode == "02"){
let textgeometry = new THREE.PlaneBufferGeometry( 65, 90, 1 );
let textt = new THREE.CanvasTexture(getTextCanvas(standsdata[i]));
let textmaterial = new THREE.MeshBasicMaterial( { side: THREE.DoubleSide,map:textt ,transparent: true} );
let textplane = new THREE.Mesh( textgeometry, textmaterial );
textplane.name = standsdata[i].code;
textplane.position.y = 70;
textplane.rotation.x = Math.PI/2;
textplane.position.z = 50;
scope.textlist.push(textplane);
newstationmesh.add(textplane);
textgeometry.dispose();
textmaterial.dispose();
textt.dispose();
}
}
}
if(mode){
if(mode == "02"){
let textgeometry = new THREE.PlaneBufferGeometry( 65, 90, 1 );
let textt = new THREE.CanvasTexture(getTextCanvas(standsdata[i]));
let textmaterial = new THREE.MeshBasicMaterial( { side: THREE.DoubleSide,map:textt ,transparent: true} );
let textplane = new THREE.Mesh( textgeometry, textmaterial );
textplane.name = standsdata[i].code;
textplane.position.y = 70;
textplane.rotation.x = Math.PI/2;
textplane.position.z = 50;
scope.textlist.push(textplane);
newstationmesh.add(textplane);
textgeometry.dispose();
textmaterial.dispose();
textt.dispose();
}
}
}
}
// scene.add(scope.textlist);
@ -428,6 +449,17 @@ export function StationStandListN() {
}
}
var compare = function (obj1, obj2) {
var val1 = obj1.position.y;
var val2 = obj2.position.y;
if (val1 < val2) {
return -1;
} else if (val1 > val2) {
return 1;
} else {
return 0;
}
}
//canvas文字贴图方法
//PS:待提炼 增强功能
var stationcanvas = new Image();

View File

@ -383,9 +383,16 @@ class SkinCode extends defaultStyle {
};
this[deviceType.Station] = {
// text: {
// show: true // 公里标名称显示
// },
// 北京线车站元素 车站名称
elemnetType:['stationText'],
stationText:{
z:0,
fontWeight:'normal', // 字体粗细
textPadding:[0, 0], // 字体边距
borderColor:'', // 字体边框颜色
textBorderWidth:0 // 字体边框宽度
},
kmPostShow: true, // 公里标显示
kilometerPosition: 'down', // 公里标位置
fontWeight: 'bold', // 文字错细
@ -688,7 +695,6 @@ class SkinCode extends defaultStyle {
haveArrowText: true, // 是否需创建arrowText对象
textOffset: 4, // 字体偏移(用以控制字体据车头的距离)
trainWidthMoreText: 8, // 计算列车长度时--列车长比text多出尺寸
displayPosition: 'margin', // 非同通信车在物理区段(有逻辑区段)上显示的位置 margin:行驶方向边缘车次窗 center: 中间位置车次窗
trainTip:true // 鼠标悬停列车状态信息框是否显示
},
trainStatusStyle: {

View File

@ -335,9 +335,16 @@ class SkinCode extends defaultStyle {
}
};
this[deviceType.Station] = {
// text: {
// show: true // 公里标名称显示
// },
// 成都一号线车站元素 车站名称
elemnetType:['stationText'],
stationText:{
z:0,
fontWeight:'normal', // 字体粗细
textPadding:[0, 0], // 字体边距
borderColor:'', // 字体边框颜色
textBorderWidth:0 // 字体边框宽度
},
kmPostShow: false, // 公里标显示
kilometerPosition: 'up', // 公里标朝向
text: {
@ -612,7 +619,6 @@ class SkinCode extends defaultStyle {
haveArrowText: true, // 是否需创建arrowText对象
textOffset: 4, // 字体偏移(用以控制字体据车头的距离)
trainWidthMoreText: 8, // 计算列车长度时--列车长比text多出尺寸
displayPosition: 'margin', // 非同通信车在物理区段(有逻辑区段)上显示的位置 margin:行驶方向边缘车次窗 center: 中间位置车次窗
trainTip:true // 鼠标悬停列车状态信息框是否显示
},
trainStatusStyle: {

View File

@ -332,9 +332,16 @@ class SkinCode extends defaultStyle {
};
this[deviceType.Station] = {
// text: {
// show: true // 公里标名称显示
// },
// 成都三号线车站元素 车站名称
elemnetType:['stationText'],
stationText:{
z:0,
fontWeight:'normal', // 字体粗细
textPadding:[0, 0], // 字体边距
borderColor:'', // 字体边框颜色
textBorderWidth:0 // 字体边框宽度
},
kmPostShow: false, // 公里标显示
kilometerPosition: 'up', // 公里标朝向
text: {
@ -798,7 +805,6 @@ class SkinCode extends defaultStyle {
haveArrowText: true, // 是否需创建arrowText对象
textOffset: 4, // 字体偏移(用以控制字体据车头的距离)
trainWidthMoreText: 8, // 计算列车长度时--列车长比text多出尺寸
displayPosition: 'margin', // 非同通信车在物理区段(有逻辑区段)上显示的位置 margin:行驶方向边缘车次窗 center: 中间位置车次窗
trainTip:true // 鼠标悬停列车状态信息框是否显示
},
trainStatusStyle: {

View File

@ -342,9 +342,16 @@ class SkinCode extends defaultStyle {
}
};
this[deviceType.Station] = {
// text: {
// show: true // 公里标名称显示
// },
// 佛山有轨电车 车站元素 车站名称
elemnetType:['stationText'],
stationText:{
z:0,
fontWeight:'normal', // 字体粗细
textPadding:[0, 0], // 字体边距
borderColor:'', // 字体边框颜色
textBorderWidth:0 // 字体边框宽度
},
kmPostShow: true, // 公里标显示
kilometerPosition: 'up', // 公里标朝向
text: {
@ -649,7 +656,6 @@ class SkinCode extends defaultStyle {
haveArrowText: true, // 是否需创建arrowText对象
textOffset: 1, // 字体偏移(用以控制字体据车头的距离)
trainWidthMoreText: 2, // 计算列车长度时--列车长比text多出尺寸
displayPosition: 'margin', // 非同通信车在物理区段(有逻辑区段)上显示的位置 margin:行驶方向边缘车次窗 center: 中间位置车次窗
trainTip:true // 鼠标悬停列车状态信息框是否显示
},
trainStatusStyle: {

View File

@ -338,9 +338,16 @@ class SkinCode extends defaultStyle {
}
};
this[deviceType.Station] = {
// text: {
// show: true // 公里标名称显示
// },
// 福州一号线 车站元素 车站名称
elemnetType:['stationText'],
stationText:{
z:0,
fontWeight:'normal', // 字体粗细
textPadding:[0, 0], // 字体边距
borderColor:'', // 字体边框颜色
textBorderWidth:0 // 字体边框宽度
},
kmPostShow: true, // 公里标显示
kilometerPosition: 'up', // 公里标朝向
text: {
@ -648,7 +655,6 @@ class SkinCode extends defaultStyle {
haveArrowText: true, // 是否需创建arrowText对象
textOffset: 1, // 字体偏移(用以控制字体据车头的距离)
trainWidthMoreText: 2, // 计算列车长度时--列车长比text多出尺寸
displayPosition: 'margin', // 非同通信车在物理区段(有逻辑区段)上显示的位置 margin:行驶方向边缘车次窗 center: 中间位置车次窗
trainTip:true // 鼠标悬停列车状态信息框是否显示
},
trainStatusStyle: {

View File

@ -374,9 +374,16 @@ class SkinCode extends defaultStyle {
}
};
this[deviceType.Station] = {
// text: {
// show: true // 公里标名称显示
// },
// 哈尔滨一号线 车站元素 车站名称
elemnetType:['stationText'],
stationText:{
z:0,
fontWeight:'normal', // 字体粗细
textPadding:[2, 6], // 字体边距
borderColor:'', // 字体边框颜色
textBorderWidth:1 // 字体边框宽度
},
kmPostShow: true, // 公里标显示
kilometerPosition: 'up', // 公里标朝向
text: {
@ -722,7 +729,6 @@ class SkinCode extends defaultStyle {
haveArrowText: true, // 是否需创建arrowText对象
textOffset: 1, // 字体偏移(用以控制字体据车头的距离)
trainWidthMoreText: 2, // 计算列车长度时--列车长比text多出尺寸
displayPosition: 'margin', // 非同通信车在物理区段(有逻辑区段)上显示的位置 margin:行驶方向边缘车次窗 center: 中间位置车次窗,
trainTip:true // 鼠标悬停列车状态信息框是否显示
},
trainStatusStyle: {

View File

@ -192,9 +192,16 @@ class SkinCode extends defaultStyle {
};
this[deviceType.Station] = {
// text: {
// show: true // 公里标名称显示
// },
// 宁波一号线 车站元素 车站名称
elemnetType:['stationText'],
stationText:{
z:0,
fontWeight:'normal', // 字体粗细
textPadding:[0, 0], // 字体边距
borderColor:'', // 字体边框颜色
textBorderWidth:0 // 字体边框宽度
},
kmPostShow: false, // 公里标显示
kilometerPosition: 'up', // 公里标朝向
text: {
@ -681,7 +688,6 @@ class SkinCode extends defaultStyle {
textOffset: 4, // 字体偏移(用以控制字体据车头的距离)
trainWidthMoreText: 8, // 计算列车长度时--列车长比text多出尺寸
trainHeadColorChangeMode: 1, // 1:driveMode + runlevel
displayPosition: 'margin', // 非同通信车在物理区段(有逻辑区段)上显示的位置 margin:行驶方向边缘车次窗 center: 中间位置车次窗
trainTip:false // 鼠标悬停列车状态信息框是否显示
},
mouseOverStyle:{

View File

@ -231,9 +231,16 @@ class SkinCode extends defaultStyle {
};
this[deviceType.Station] = {
// text: {
// show: true // 公里标名称显示
// },
// 宁波三号线 车站元素 车站名称
elemnetType:['stationText'],
stationText:{
z:0,
fontWeight:'normal', // 字体粗细
textPadding:[0, 0], // 字体边距
borderColor:'', // 字体边框颜色
textBorderWidth:0 // 字体边框宽度
},
kmPostShow: false, // 公里标显示
kilometerPosition: 'up', // 公里标朝向
text: {
@ -741,7 +748,6 @@ class SkinCode extends defaultStyle {
textOffset: 4, // 字体偏移(用以控制字体据车头的距离)
trainWidthMoreText: 8, // 计算列车长度时--列车长比text多出尺寸
trainHeadColorChangeMode: 1, // 1:driveMode + runlevel
displayPosition: 'margin', // 非同通信车在物理区段(有逻辑区段)上显示的位置 margin:行驶方向边缘车次窗 center: 中间位置车次窗
trainTip:false // 鼠标悬停列车状态信息框是否显示
},
mouseOverStyle:{

View File

@ -413,9 +413,16 @@ class SkinCode extends defaultStyle {
};
this[deviceType.Station] = {
// text: {
// show: true // 公里标名称显示
// },
// 竞赛线路 车站元素 车站名称
elemnetType:['stationText'],
stationText:{
z:0,
fontWeight:'normal', // 字体粗细
textPadding:[0, 0], // 字体边距
borderColor:'', // 字体边框颜色
textBorderWidth:0 // 字体边框宽度
},
kmPostShow: true, // 公里标显示
kilometerPosition: 'down', // 公里标位置
fontWeight: 'bold', // 文字错细
@ -722,7 +729,6 @@ class SkinCode extends defaultStyle {
haveArrowText: true, // 是否需创建arrowText对象
textOffset: 4, // 字体偏移(用以控制字体据车头的距离)
trainWidthMoreText: 8, // 计算列车长度时--列车长比text多出尺寸
displayPosition: 'margin', // 非同通信车在物理区段(有逻辑区段)上显示的位置 margin:行驶方向边缘车次窗 center: 中间位置车次窗
trainTip:true // 鼠标悬停列车状态信息框是否显示
},
trainStatusStyle: {

View File

@ -355,9 +355,16 @@ class SkinCode extends defaultStyle {
}
};
this[deviceType.Station] = {
// text: {
// show: true // 公里标名称显示
// },
// 西安一号线 车站元素 车站名称
elemnetType:['stationText'],
stationText:{
z:0,
fontWeight:'normal', // 字体粗细
textPadding:[0, 0], // 字体边距
borderColor:'', // 字体边框颜色
textBorderWidth:0 // 字体边框宽度
},
kmPostShow: true, // 公里标显示
kilometerPosition: 'up', // 公里标朝向
text: {
@ -713,7 +720,6 @@ class SkinCode extends defaultStyle {
haveArrowText: true, // 是否需创建arrowText对象
textOffset: 1, // 字体偏移(用以控制字体据车头的距离)
trainWidthMoreText: 2, // 计算列车长度时--列车长比text多出尺寸
displayPosition: 'margin', // 非同通信车在物理区段(有逻辑区段)上显示的位置 margin:行驶方向边缘车次窗 center: 中间位置车次窗
trainTip:true // 鼠标悬停列车状态信息框是否显示
},
trainStatusStyle: {

View File

@ -382,9 +382,16 @@ class SkinCode extends defaultStyle {
}
};
this[deviceType.Station] = {
// text: {
// show: true // 公里标名称显示
// },
// 西安二号线 车站元素 车站名称
elemnetType:['stationText'],
stationText:{
z:0,
fontWeight:'normal', // 字体粗细
textPadding:[0, 0], // 字体边距
borderColor:'', // 字体边框颜色
textBorderWidth:0 // 字体边框宽度
},
kmPostShow: false, // 公里标显示
kilometerPosition: 'up', // 公里标朝向
text: {
@ -793,7 +800,6 @@ class SkinCode extends defaultStyle {
haveArrowText: true, // 是否需创建arrowText对象
textOffset: 4, // 字体偏移(用以控制字体据车头的距离)
trainWidthMoreText: 8, // 计算列车长度时--列车长比text多出尺寸
displayPosition: 'margin', // 非同通信车在物理区段(有逻辑区段)上显示的位置 margin:行驶方向边缘车次窗 center: 中间位置车次窗
trainTip:true // 鼠标悬停列车状态信息框是否显示
},
trainStatusStyle: {

View File

@ -87,41 +87,40 @@ class Painter {
}
}
checkIntersect(device) {
var intersect = false;
var befor = device.instance;
var train = shapefactory(device, this.$jmap);
checkTrainOverlap(device) { // 检查重叠列车
const trainWindowCode = device.trainWindowCode;
const overlapTrainList = [device.code];
this.mapInstanceLevel[deviceType.Train].eachChild(elem => {
if (elem !== befor && elem.getBoundingRect().intersect(train.getBoundingRect())) {
intersect = true;
return;
if (elem.model.code !== device.code && elem.model.trainWindowCode === trainWindowCode) {
overlapTrainList.push(elem.model.code);
}
});
if (overlapTrainList.length > 1) {
this.sortOverLapTrain(overlapTrainList);
}
return overlapTrainList;
}
sortOverLapTrain(overlapTrainList) { // 对重叠列车按照区段上的位置进行排序
overlapTrainList.sort((a, b) => {
const trainA = this.$jmap.getDeviceByCode(a);
const trainB = this.$jmap.getDeviceByCode(b);
if (trainA.right) {
return trainA.offsetp - trainB.offsetp;
} else {
return trainB.offsetp - trainA.offsetp;
}
});
return intersect;
}
/**
* 更新列车
* @param {*} device
*/
updateTrain(device) {
var oldTrainWindowModel = null;
var instance = device.instance;
var curModel = device;
let displayPosition = 'margin';
if (instance) {
oldTrainWindowModel = device.trainWindowModel;
displayPosition = instance.style.Train.common.displayPosition;
}
const curModel = device;
if (curModel.sectionCode) {
curModel.sectionModel = this.$jmap.getDeviceByCode(curModel.sectionCode);
if (curModel.sectionModel.trainWindowCode) {
curModel.trainWindowCode = curModel.sectionModel.trainWindowCode;
} else if (displayPosition === 'center' && curModel.sectionModel.logicSectionCodeList && curModel.sectionModel.logicSectionCodeList.length) {
const sec = this.$jmap.getDeviceByCode(curModel.sectionModel.logicSectionCodeList[Math.floor(curModel.sectionModel.logicSectionCodeList.length / 2)]);
curModel.trainWindowCode = sec.trainWindowCode;
} else if (curModel.right && curModel.sectionModel.logicSectionCodeList && curModel.sectionModel.logicSectionCodeList.length) {
const sec = this.$jmap.getDeviceByCode(curModel.sectionModel.logicSectionCodeList[curModel.sectionModel.logicSectionCodeList.length - 1]);
curModel.trainWindowCode = sec.trainWindowCode;
@ -134,13 +133,13 @@ class Painter {
if (curModel.trainWindowCode) {
curModel.trainWindowModel = this.$jmap.getDeviceByCode(curModel.trainWindowCode);
}
if (instance && oldTrainWindowModel && this.checkIntersect(device)) {
device.trainWindowModel = oldTrainWindowModel;
}
instance && this.mapInstanceLevel[deviceType.Train].remove(instance);
this.add(device);
const overlapTrainList = this.checkTrainOverlap(device);
overlapTrainList.forEach((item, index) => {
const trainDevice = this.$jmap.getDeviceByCode(item);
trainDevice.overLapIndex = index;
trainDevice.instance && this.mapInstanceLevel[deviceType.Train].remove(trainDevice.instance);
this.add(trainDevice);
});
if (this.screenFlag) {
this.$transformHandleScreen.transformView(device.instance);
@ -233,7 +232,6 @@ class Painter {
y: transPoint[1]
};
}
}
}

View File

@ -0,0 +1,75 @@
import Group from 'zrender/src/container/Group';
import Text from 'zrender/src/graphic/Text';
class EStationText extends Group {
constructor(model) {
super();
this.model = model;
this.create();
}
create() {
const model = this.model.modelData;
const style = this.model.style;
// 车站名称
this.stationName = new Text({
zlevel: this.model.zlevel,
z: this.model.z,
silent: !model.visible || false,
style: {
x: model.position.x,
y: model.position.y,
fontWeight: style.Station.stationText.fontWeight,
fontSize: isNaN(Number(model.nameFont)) ? 20 : Number(model.nameFont),
fontFamily: style.fontFamily,
text: model.number ? model.number + model.name : model.name,
textAlign: 'middle',
textFill: model.nameFontColor,
textVerticalAlign: 'top',
textPadding:style.Station.stationText.textPadding,
textBorderColor:style.Station.stationText.borderColor || model.nameFontColor,
textBorderWidth:style.Station.stationText.textBorderWidth
}
});
this.add(this.stationName);
if (model.subheadDisplay) { // 副标题
this.subheadText = new Text({
zlevel: this.model.zlevel,
z: this.model.z,
silent: !model.visible || false,
style: {
x: model.subheadPosition.x,
y: model.subheadPosition.y,
fontWeight: model.fontWeight,
fontSize: model.subheadFont || 18,
fontFamily: style.fontFamily,
text: model.subhead,
textAlign: 'middle',
textVerticalAlign: 'top',
textFill: model.subheadFontColor,
textPadding:style.Station.stationText.textPadding,
textBorderColor:style.Station.stationText.borderColor || model.nameFontColor,
textBorderWidth:style.Station.stationText.textBorderWidth
}
});
this.add(this.subheadText);
}
}
recover() {
}
setState() {
}
setColor(color) {
const style = this.model.style;
if (style.Station.StationControl.disPlayNone) {
this.stationName.setStyle('textFill', color);
this.subheadText && this.subheadText.setStyle('textFill', color);
}
}
}
export default EStationText;

View File

@ -11,6 +11,10 @@ import { arrow } from '../utils/ShapePoints';
import Rect from 'zrender/src/graphic/shape/Rect';
import Text from 'zrender/src/graphic/Text';
import store from '@/store/index_APP_TARGET';
import EStationText from './EStationText';
import {traverseLineElements, traverseStatusElements} from '../utils/ShapeStatusCovert';
import Vue from 'vue';
export default class Station extends Group {
@ -28,37 +32,21 @@ export default class Station extends Group {
this.createControlMode();
this.setState(model);
this.checkIsDrawMap();
this.setVisible(model.visible);
}
create() {
const model = this.model;
const style = this.style;
// 公里标名称是否显示
this.stationText = new ETextName({
zlevel: this.zlevel,
z: this.z,
x: model.position.x,
y: model.position.y,
fontWeight: style.Station.text.fontWeight,
fontSize: isNaN(Number(model.nameFont)) ? 20 : Number(model.nameFont),
fontFamily: style.fontFamily,
silent: !model.visible,
text: model.number ? model.number + model.name : model.name,
textAlign: 'middle',
textVerticalAlign: 'top',
textFill: model.nameFontColor
});
this.add(this.stationText);
if (style.Station.text.borderShow) { // 哈尔滨线路单独显示
this.stationText.attr({
style: {
textPadding: style.Station.text.textPadding || [2, 6],
textBorderColor: style.Station.text.borderColor || model.nameFontColor,
textBorderWidth: style.Station.text.textBorderWidth || 1
}
});
}
// // 站台所有的绘图元素
const elementTypeList = {
'stationText':EStationText // 车站名称 (普通站台样式)
};
// 遍历当前线路下的绘图元素 组合模式
traverseLineElements(style.Station, elementTypeList, model, style, this);
const path = window.location.href;
if (style.Station.kmPostShow || path.includes('/map/draw')) { // 公里标是否显示
let direction = 1;
@ -88,37 +76,13 @@ export default class Station extends Group {
this.add(this.mileageText);
model.kmPostShow ? this.mileageText.show() : this.mileageText.hide();
}
if (model.subheadDisplay) { // 副标题
this.subheadText = new ETextName({
zlevel: this.zlevel,
z: this.z,
x: model.subheadPosition.x,
y: model.subheadPosition.y,
fontWeight: model.fontWeight,
fontSize: model.subheadFont || 18,
fontFamily: style.fontFamily,
text: model.subhead,
silent: !model.visible,
textAlign: 'middle',
textVerticalAlign: 'top',
textFill: model.subheadFontColor
});
this.add(this.subheadText);
if (style.Station.text.borderShow) {
this.subheadText.attr({
style: {
textPadding: [2, 6],
textBorderColor: model.nameFontColor,
textBorderWidth: 1
}
});
}
}
if (!model.visible) { // 隐藏车站
this.subheadText && this.subheadText.setStyle('textFill', 'rgba(0,0,0,0)');
this.mileageText && this.mileageText.setStyle('textFill', 'rgba(0,0,0,0)');
this.stationText && this.stationText.setStyle('textFill', 'rgba(0,0,0,0)');
}
// if (!model.visible) { // 隐藏车站
// // this.subheadText && this.subheadText.setStyle('textFill', 'rgba(0,0,0,0)');
// // this.mileageText && this.mileageText.setStyle('textFill', 'rgba(0,0,0,0)');
// // this.stationText && this.stationText.setStyle('textFill', 'rgba(0,0,0,0)');
// this.eachChild(elem => { elem.hide(); });
// }
}
createTurnBack() { // 创建按图折返
const model = this.model;
@ -361,12 +325,13 @@ export default class Station extends Group {
this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.grayColor);
this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.greenColor);
this.centerControl && this.centerControl.setTextColor(this.style.Station.StationControl.lamp.greenColor); // 文字颜色
if (this.style.Station.StationControl.disPlayNone) {
this.stationText && this.stationText.setStyle('textFill', '#1fdc1f');
if (this.model.subheadDisplay) { // 副标题
this.subheadText && this.subheadText.setStyle('textFill', '#1fdc1f');
}
}
this.stationText.setColor('#1fdc1f');
// if (this.style.Station.StationControl.disPlayNone) {
// this.stationText && this.stationText.setStyle('textFill', '#1fdc1f');
// if (this.model.subheadDisplay) { // 副标题
// this.subheadText && this.subheadText.setStyle('textFill', '#1fdc1f');
// }
// }
}
handleLocal() { // 站控
@ -375,12 +340,13 @@ export default class Station extends Group {
this.substationControl && this.substationControl.setTextColor(this.style.Station.StationControl.lamp.yellowColor); // 文字颜色
this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.grayColor);
this.substationArrowsControl && this.substationArrowsControl.setColor(this.style.Station.StationControl.lamp.greenColor);
if (this.style.Station.StationControl.disPlayNone) {
this.stationText && this.stationText.setStyle('textFill', '#fff');
if (this.model.subheadDisplay) { // 副标题
this.subheadText && this.subheadText.setStyle('textFill', '#fff');
}
}
// if (this.style.Station.StationControl.disPlayNone) {
// this.stationText && this.stationText.setStyle('textFill', '#fff');
// if (this.model.subheadDisplay) { // 副标题
// this.subheadText && this.subheadText.setStyle('textFill', '#fff');
// }
// }
this.stationText.setColor('#fff');
}
handleEmergency() { // 紧急站控
@ -389,23 +355,32 @@ export default class Station extends Group {
this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.grayColor);
this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.grayColor);
this.emergencyArrowsControl && this.emergencyArrowsControl.setColor(this.style.Station.StationControl.lamp.greenColor);
if (this.style.Station.StationControl.disPlayNone) {
this.stationText && this.stationText.setStyle('textFill', '#fff');
if (this.model.subheadDisplay) { // 副标题
this.subheadText && this.subheadText.setStyle('textFill', '#fff');
}
}
// if (this.style.Station.StationControl.disPlayNone) {
// this.stationText && this.stationText.setStyle('textFill', '#fff');
// if (this.model.subheadDisplay) { // 副标题
// this.subheadText && this.subheadText.setStyle('textFill', '#fff');
// }
// }
this.stationText.setColor('#fff');
}
handleNone() { // 空
if (this.style.Station.StationControl.disPlayNone) { // 没有控制时显示 黄色
this.stationText && this.stationText.setStyle('textFill', '#FFFF00');
if (this.model.subheadDisplay) { // 副标题
this.subheadText && this.subheadText.setStyle('textFill', '#FFFF00');
}
}
// if (this.style.Station.StationControl.disPlayNone) { // 没有控制时显示 黄色
// this.stationText && this.stationText.setStyle('textFill', '#FFFF00');
// if (this.model.subheadDisplay) { // 副标题
// this.subheadText && this.subheadText.setStyle('textFill', '#FFFF00');
// }
// }
this.stationText.setColor('#FFFF00');
}
// /** 恢复初始状态*/
// recover() {
// const currentTypeList = this.style.Station.elemnetType;
// currentTypeList.forEach(element => {
// this[element].recover();
// });
// }
recover() {
this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.grayColor);
this.emergencyControl && this.emergencyControl.setTextColor(this.style.Station.StationControl.text.fontColor);
@ -433,6 +408,18 @@ export default class Station extends Group {
}
}
// setState(model) {
// if (!this.isShowShape) return;
// // // 新版地图使用新版状态变更方式
// this.recover();
// // 更新状态
// const currentTypeList = this.style.Station.elemnetType;
// currentTypeList.forEach(element => {
// this[element].setState(model);
// });
// }
getShapeTipPoint(opts) {
let rect;
if (opts.subDeviceType === 'button') {
@ -448,13 +435,14 @@ export default class Station extends Group {
getBoundingRect() {
const rect = this.stationText.getBoundingRect().clone();
if (this.model.subheadDisplay) {
const subheadText = this.subheadText.getBoundingRect().clone();
rect.union(subheadText);
return rect;
} else {
return rect;
}
// if (this.model.subheadDisplay) {
// const subheadText = this.subheadText.getBoundingRect().clone();
// rect.union(subheadText);
// return rect;
// } else {
// return rect;
// }
return rect;
}
drawSelected(selected) {
@ -489,4 +477,12 @@ export default class Station extends Group {
this.isShowShape = false;
}
}
setVisible(visible) {
if (visible) {
this.eachChild(elem => { elem.show(); });
} else {
this.eachChild(elem => { elem.hide(); });
}
}
}

View File

@ -63,6 +63,7 @@ class StationStand extends Group {
// 加载皮肤控制的元素
const model = this.model;
const style = this.style;
// // 站台所有的绘图元素
const elementTypeList = {
'solidStand':ESolidStand, // 矩形实心站台 (普通站台样式)

View File

@ -46,10 +46,10 @@ export default class Train extends Group {
};
if (model.right) {
this.point.x = this.point.x - style.Train.trainHead.trainConntWidth * this.newScale - style.Train.common.trainWidth / 2;
this.point.y = this.point.y - style.Train.common.trainHeight / 2;
this.point.y = this.point.y - style.Train.common.trainHeight / 2 + model.overLapIndex * (style.Train.common.trainHeight + 5);
} else {
this.point.x = this.point.x + style.Train.trainHead.trainConntWidth * this.newScale - style.Train.common.trainWidth / 2;
this.point.y = this.point.y + model.trainWindowModel.height - style.Train.common.trainHeight / 2;
this.point.y = this.point.y + model.trainWindowModel.height - style.Train.common.trainHeight / 2 - model.overLapIndex * (style.Train.common.trainHeight + 5);
}
} else {
this.point = model.position;

View File

@ -111,7 +111,7 @@
<script>
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { mouseCancelState } from '@/jmapNew/theme/components/utils/menuItemStatus';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import PopupAlarm from './childDialog/popupAlarm';
@ -425,7 +425,7 @@ export default {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}

View File

@ -1,59 +1,69 @@
<template>
<el-dialog class="beijing-01__systerm confirm-control-speed" :title="title" :visible.sync="show" width="340px"
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" append-to-body v-dialogDrag>
<div style="height: 60px; padding-left: 20px">
<span style="font-size: 18px">{{message}}</span>
</div>
<el-row justify="center" class="button-group">
<el-col :span="11">
<el-button type="primary" :id="confirmId" @click="confirm">确定</el-button>
</el-col>
<el-col :span="11" :offset="2">
<el-button @click="doClose"> </el-button>
</el-col>
</el-row>
</el-dialog>
<el-dialog
v-dialogDrag
class="beijing-01__systerm confirm-control-speed"
:title="title"
:visible.sync="show"
width="340px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
append-to-body
>
<div style="height: 60px; padding-left: 20px">
<span style="font-size: 18px">{{ message }}</span>
</div>
<el-row justify="center" class="button-group">
<el-col :span="11">
<el-button :id="confirmId" type="primary" @click="confirm">确定</el-button>
</el-col>
<el-col :span="11" :offset="2">
<el-button @click="doClose"> </el-button>
</el-col>
</el-row>
</el-dialog>
</template>
<script>
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
export default {
name: 'ConfirmTip',
data() {
return {
dialogShow: false,
message: '',
confirmId: '',
}
export default {
name: 'ConfirmTip',
data() {
return {
dialogShow: false,
message: '',
confirmId: ''
};
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
title() {
if (this.dialogShow) {
return "提示";
}
title() {
if (this.dialogShow) {
return '提示';
}
},
mounted() {
return '';
}
},
mounted() {
},
methods: {
doShow(operate) {
this.message = operate.message;
this.dialogShow = true;
this.confirmId = operate.confirmId;
},
methods: {
doShow(operate) {
this.message = operate.message;
this.dialogShow = true;
this.confirmId = operate.confirmId;
},
confirm() {
this.$emit('close');
},
doClose() {
this.dialogShow = false;
}
confirm() {
this.$emit('close');
},
doClose() {
this.dialogShow = false;
}
}
};
</script>
<style scoped>
@ -65,4 +75,4 @@
display: block;
margin: 0 auto;
}
</style>
</style>

View File

@ -29,7 +29,7 @@
</template>
<script>
import { OperationEvent } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
export default {
@ -141,7 +141,7 @@ export default {
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
@ -158,7 +158,7 @@ export default {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}

View File

@ -1,85 +1,94 @@
<template>
<el-dialog class="beijing-01__systerm popup-alarm" :title="title" :visible.sync="show" width="500px"
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" append-to-body v-dialogDrag>
<el-row>
<el-col :offset="2">
<span v-for="message in messages">{{message}}</span><br>
</el-col>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="8">
<el-button :id="domIdSure" type="primary" @click="commit">确定</el-button>
</el-col>
</el-row>
</span>
</el-dialog>
<el-dialog
v-dialogDrag
class="beijing-01__systerm popup-alarm"
:title="title"
:visible.sync="show"
width="500px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
append-to-body
>
<el-row>
<el-col :offset="2">
<span v-for="(message, index) in messages" :key="index">{{ message }}</span><br>
</el-col>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="8">
<el-button :id="domIdSure" type="primary" @click="commit">确定</el-button>
</el-col>
</el-row>
</el-dialog>
</template>
<script>
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
export default {
name: 'Popup-Alarm',
data() {
return {
dialogShow: false,
messages: [],
operate: null,
operation: '',
}
export default {
name: 'PopupAlarm',
data() {
return {
dialogShow: false,
messages: [],
operate: null,
operation: ''
};
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
title() {
return '弹出式告警';
},
domIdSure() {
return this.dialogShow ? OperationEvent.Command.close.alarm.domId : '';
}
title() {
return '弹出式告警';
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
},
methods: {
doShow(operate, messages) {
this.operate = operate || {};
this.operation = operate.operation;
this.dialogShow = true;
this.messages = messages || [];
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.dialogShow = false;
domIdSure() {
return this.dialogShow ? OperationEvent.Command.close.alarm.domId : '';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, messages) {
this.operate = operate || {};
this.operation = operate.operation;
this.dialogShow = true;
this.messages = messages || [];
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
},
commit() {
if (this.operation == OperationEvent.Section.alxeEffective.menu.operation) {
//
this.alxeEffective();
}
},
alxeEffective() {
let operate = {
type: this.operate.type,
operation: OperationEvent.Command.close.alarm.operation,
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.doClose();
}
})
});
},
doClose() {
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
commit() {
if (this.operation == OperationEvent.Section.alxeEffective.menu.operation) {
//
this.alxeEffective();
}
},
alxeEffective() {
const operate = {
type: this.operate.type,
operation: OperationEvent.Command.close.alarm.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.doClose();
}
});
}
}
};
</script>
<style>
@ -87,4 +96,4 @@
padding-bottom: 40px !important;
border: 1px solid lightgray;
}
</style>
</style>

View File

@ -158,7 +158,7 @@ export default {
};
this.strategy = row.value;
this.isConfirm = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}

View File

@ -18,7 +18,7 @@
style="background: #f0f0f0;"
>
<div slot-scope="{ node, data }" style="height: 24px; width: 100%;">
<div v-if="data.level == 1" style="line-height: 26px;">{{ data.name }}</div>
<div v-if="data.level == 1" style="line-height: 26px;">{{ node.name }}</div>
<div v-if="data.level == 2" style="background: lightgray; overflow: hidden; height: 100%;">
<div
style="width: 46%;float: left; height: 24px; line-height: 24px; padding-left: 5px; border-right: 1px solid #f0f0f0;"
@ -64,7 +64,8 @@
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { MapDeviceType } from '@/scripts/cmdPlugin/Config';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { mouseCancelState } from '@/jmapNew/theme/components/utils/menuItemStatus';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
@ -262,7 +263,7 @@ export default {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}

View File

@ -77,7 +77,8 @@
</div>
</template>
<script>
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { MapDeviceType } from '@/scripts/cmdPlugin/Config';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { mouseCancelState } from '@/jmapNew/theme/components/utils/menuItemStatus';
import { now } from '@/utils/date';
@ -257,7 +258,7 @@ export default {
this.setMessage('请点击“确认1”按钮确认命令');
this.writeRecord({ order: ++this.order, date: now(), context: '点击下达命令', result: '' });
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.setButtonEnable({ step: 1 });
@ -284,7 +285,7 @@ export default {
this.setMessage('请点击“确认2”按钮确认命令');
this.writeRecord({ order: ++this.order, date: now(), context: '点击确认1', result: '' });
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.timeCountCommand = -1;
@ -314,7 +315,7 @@ export default {
this.setMessage('');
this.writeRecord({ order: ++this.order, date: now(), context: '点击确认2', result: '' });
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.timeCountCommand = -1;
this.timeCountConfirm = -1;
this.setButtonEnable({ step: -1 });
@ -345,7 +346,7 @@ export default {
}
this.writeRecord({ order: ++this.order, date: now(), context: '点击终止', result: '' });
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.setButtonEnable({ step: 0 });
@ -363,7 +364,7 @@ export default {
operation: OperationEvent.Command.close.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}

View File

@ -27,7 +27,8 @@
</template>
<script>
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { MapDeviceType } from '@/scripts/cmdPlugin/Config';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { mouseCancelState } from '@/jmapNew/theme/components/utils/menuItemStatus';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
@ -91,7 +92,7 @@ export default {
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
@ -108,7 +109,7 @@ export default {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}

View File

@ -39,7 +39,8 @@
</template>
<script>
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { MapDeviceType } from '@/scripts/cmdPlugin/Config';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { mouseCancelState } from '@/jmapNew/theme/components/utils/menuItemStatus';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
@ -110,7 +111,7 @@ export default {
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
@ -127,7 +128,7 @@ export default {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}

View File

@ -44,7 +44,8 @@
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { MapDeviceType } from '@/scripts/cmdPlugin/Config';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { mouseCancelState } from '@/jmapNew/theme/components/utils/menuItemStatus';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
@ -124,7 +125,7 @@ export default {
val: this.addModel.tripNumber
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
@ -139,7 +140,7 @@ export default {
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
@ -156,7 +157,7 @@ export default {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}

View File

@ -30,7 +30,8 @@
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { MapDeviceType } from '@/scripts/cmdPlugin/Config';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
// import { getPublishMapTrainNos } from '@/api/runplan';
import { mouseCancelState } from '@/jmapNew/theme/components/utils/menuItemStatus';
import ConfirmControl from './childDialog/confirmControl';
@ -120,7 +121,7 @@ export default {
val: this.addModel.groupNumber
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
@ -137,7 +138,7 @@ export default {
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
@ -158,7 +159,7 @@ export default {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}

View File

@ -41,7 +41,8 @@
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { MapDeviceType } from '@/scripts/cmdPlugin/Config';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
export default {
name: 'TrainMove',
@ -126,7 +127,7 @@ export default {
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
@ -146,7 +147,7 @@ export default {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}

View File

@ -44,7 +44,8 @@
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { MapDeviceType } from '@/scripts/cmdPlugin/Config';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { mouseCancelState } from '@/jmapNew/theme/components/utils/menuItemStatus';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
@ -124,7 +125,7 @@ export default {
val: this.addModel.groupNumber
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
@ -139,7 +140,7 @@ export default {
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
@ -156,7 +157,7 @@ export default {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}

View File

@ -40,7 +40,8 @@
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { MapDeviceType } from '@/scripts/cmdPlugin/Config';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { mouseCancelState } from '@/jmapNew/theme/components/utils/menuItemStatus';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
@ -118,7 +119,7 @@ export default {
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
@ -135,7 +136,7 @@ export default {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}

View File

@ -44,7 +44,8 @@
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { MapDeviceType } from '@/scripts/cmdPlugin/Config';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { mouseCancelState } from '@/jmapNew/theme/components/utils/menuItemStatus';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
@ -124,7 +125,7 @@ export default {
val: this.addModel.groupNumber
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
@ -139,7 +140,7 @@ export default {
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
@ -156,7 +157,7 @@ export default {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}

View File

@ -49,7 +49,8 @@
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { MapDeviceType } from '@/scripts/cmdPlugin/Config';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
export default {
name: 'TrainMove',
@ -134,7 +135,7 @@ export default {
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
@ -154,7 +155,7 @@ export default {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}

View File

@ -44,7 +44,8 @@
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { MapDeviceType } from '@/scripts/cmdPlugin/Config';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { mouseCancelState } from '@/jmapNew/theme/components/utils/menuItemStatus';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
@ -124,7 +125,7 @@ export default {
val: this.addModel.groupNumber
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
@ -139,7 +140,7 @@ export default {
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
@ -156,7 +157,7 @@ export default {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}

View File

@ -37,7 +37,8 @@
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { MapDeviceType } from '@/scripts/cmdPlugin/Config';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { mouseCancelState } from '@/jmapNew/theme/components/utils/menuItemStatus';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
@ -106,7 +107,7 @@ export default {
val: this.addModel.tripNumber
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
@ -121,7 +122,7 @@ export default {
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
@ -138,7 +139,7 @@ export default {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}

View File

@ -30,7 +30,8 @@
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { MapDeviceType } from '@/scripts/cmdPlugin/Config';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { mouseCancelState } from '@/jmapNew/theme/components/utils/menuItemStatus';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
@ -108,7 +109,7 @@ export default {
val: this.addModel.tripNumber
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
@ -123,7 +124,7 @@ export default {
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
@ -140,7 +141,7 @@ export default {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}

View File

@ -99,7 +99,8 @@
</template>
<script>
import { mapGetters } from 'vuex';
import { TrainingMode, OperationEvent } from '@/scripts/ConstDic';
import { TrainingMode } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import StationControl from './menuDialog/stationControl';
import DetainTrainContorl from './menuDialog/detainTrainContorl';
import DetainTrainContorlUpDown from './menuDialog/detainTrainContorlUpDown';

View File

@ -1,154 +1,164 @@
<template>
<el-dialog class="beijing-01__systerm user-add" :title="title" :visible.sync="show" width="420px"
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" append-to-body v-dialogDrag>
<div style="padding: 15px 40px; border: 1px double lightgray; margin: 20px 10px; ">
<el-form size="small" label-width="90px" :model="model" label-position="left" :rules="rules" ref="form">
<el-form-item label="工号:" prop="jobNumber">
<el-input v-model="model.jobNumber"></el-input>
</el-form-item>
<el-form-item label="用户名:" prop="userName">
<el-input v-model="model.userName"></el-input>
</el-form-item>
<el-form-item label="密码:" prop="password">
<el-input type="password" v-model="model.password"></el-input>
</el-form-item>
<el-form-item label="确认密码:" prop="confirm">
<el-input type="password" v-model="model.confirm"></el-input>
</el-form-item>
<el-dialog
v-dialogDrag
class="beijing-01__systerm user-add"
:title="title"
:visible.sync="show"
width="420px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
append-to-body
>
<div style="padding: 15px 40px; border: 1px double lightgray; margin: 20px 10px; ">
<el-form ref="form" size="small" label-width="90px" :model="model" label-position="left" :rules="rules">
<el-form-item label="工号:" prop="jobNumber">
<el-input v-model="model.jobNumber" />
</el-form-item>
<el-form-item label="用户名:" prop="userName">
<el-input v-model="model.userName" />
</el-form-item>
<el-form-item label="密码:" prop="password">
<el-input v-model="model.password" type="password" />
</el-form-item>
<el-form-item label="确认密码:" prop="confirm">
<el-input v-model="model.confirm" type="password" />
</el-form-item>
</el-form>
</div>
<el-row justify="center" class="button-group">
<el-col :span="8" :offset="6">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="0">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
</el-dialog>
</el-form>
</div>
<el-row justify="center" class="button-group">
<el-col :span="8" :offset="6">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="0">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
export default {
name: 'UserAdd',
components: {
},
data() {
return {
operate: {},
operation: null,
dialogShow: false,
loading: false,
model: {
type: 'ADD',
jobNumber: '',
userName: '',
password: '',
confirm: '',
},
rules: {
jobNumber: [
{ required: true, message: '请输入工号', trigger: 'blur' }
],
userName: [
{ required: true, message: '请输入用户名', trigger: 'blur' }
],
password: [
{ required: true, message: '请输入密码', trigger: 'change' }
],
confirm: [
{ required: true, message: '请再次输入密码', trigger: 'change' }
],
},
export default {
name: 'UserAdd',
components: {
},
data() {
return {
operate: {},
operation: null,
dialogShow: false,
loading: false,
model: {
type: 'ADD',
jobNumber: '',
userName: '',
password: '',
confirm: ''
},
rules: {
jobNumber: [
{ required: true, message: '请输入工号', trigger: 'blur' }
],
userName: [
{ required: true, message: '请输入用户名', trigger: 'blur' }
],
password: [
{ required: true, message: '请输入密码', trigger: 'change' }
],
confirm: [
{ required: true, message: '请再次输入密码', trigger: 'change' }
]
}
};
},
computed: {
...mapGetters('map', [
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
computed: {
...mapGetters('map', [
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Command.close.confirm.domId : '';
},
title() {
return '增加用户'
}
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
domIdConfirm() {
return this.dialogShow ? OperationEvent.Command.close.confirm.domId : '';
},
methods: {
doShow(operate) {
//
if (!this.dialogShow) {
this.loading = false;
this.operate = operate || {};
this.operation = operate.operation;
this.$nextTick(() => {
this.$refs.form.resetFields();
});
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
title() {
return '增加用户';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate) {
//
if (!this.dialogShow) {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
commit() {
this.$refs['form'].validate((valid) => {
if (valid) {
let operate = {
type: this.operate.type,
operation: OperationEvent.Command.close.confirm.operation,
}
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
if (this.model.password === this.model.confirm) {
this.doClose();
this.$emit('operateUser', this.model);
} else {
this.$messageBox('二次输入密码不一致');
}
}
})
} else {
return false;
}
this.operate = operate || {};
this.operation = operate.operation;
this.$nextTick(() => {
this.$refs.form.resetFields();
});
},
cancel() {
let operate = {
type: this.operate.type,
operation: OperationEvent.Command.cancel.menu.operation,
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(error => { this.doClose(); this.model });
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
commit() {
this.$refs['form'].validate((valid) => {
if (valid) {
const operate = {
type: this.operate.type,
operation: OperationEvent.Command.close.confirm.operation
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
if (this.model.password === this.model.confirm) {
this.doClose();
this.$emit('operateUser', this.model);
} else {
this.$messageBox('二次输入密码不一致');
}
}
});
} else {
return false;
}
});
},
cancel() {
const operate = {
type: this.operate.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => { this.doClose(); this.model; });
}
}
};
</script>
<style scoped>
.beijing-01__systerm .el-dialog .base-label {
@ -159,4 +169,4 @@
padding: 0 5px;
background-color: #F0F0F0;
}
</style>
</style>

View File

@ -1,126 +1,134 @@
<template>
<el-dialog class="beijing-01__systerm user-delete" :title="title" :visible.sync="show" width="260px"
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" append-to-body v-dialogDrag>
<div style="padding-left: 10px; padding-bottom: 10px">
<i class="el-icon-info"></i>
<template v-for="message in messages">
<span>{{message}}</span>
</template>
</div>
<el-row justify="center" class="button-group">
<el-col :span="8" :offset="3">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="2">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
</el-dialog>
<el-dialog
v-dialogDrag
class="beijing-01__systerm user-delete"
:title="title"
:visible.sync="show"
width="260px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
append-to-body
>
<div style="padding-left: 10px; padding-bottom: 10px">
<i class="el-icon-info" />
<span v-for="(message, index) in messages" :key="index">{{ message }}</span>
</div>
<el-row justify="center" class="button-group">
<el-col :span="8" :offset="3">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="2">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
export default {
name: 'UserDelete',
components: {
},
data() {
return {
operate: {},
messages: [],
model: {
type: 'DELETE',
jobNumber: '',
userName: '',
},
operation: null,
dialogShow: false,
loading: false,
}
},
computed: {
...mapGetters('map', [
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
export default {
name: 'UserDelete',
components: {
},
data() {
return {
operate: {},
messages: [],
model: {
type: 'DELETE',
jobNumber: '',
userName: ''
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Command.close.confirm.domId : '';
},
title() {
return '删除用户'
}
operation: null,
dialogShow: false,
loading: false
};
},
computed: {
...mapGetters('map', [
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
methods: {
doShow(operate, selected) {
//
if (!this.dialogShow) {
this.loading = false;
this.operate = operate || {};
this.operation = operate.operation;
this.messages = operate.messages;
this.model.userName = '';
this.model.jobNumber = '';
if (selected) {
this.model.userName = selected.userName;
this.model.jobNumber = selected.jobNumber;
}
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
domIdConfirm() {
return this.dialogShow ? OperationEvent.Command.close.confirm.domId : '';
},
title() {
return '删除用户';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected) {
//
if (!this.dialogShow) {
this.loading = false;
this.dialogShow = false;
this.operate = operate || {};
this.operation = operate.operation;
this.messages = operate.messages;
this.model.userName = '';
this.model.jobNumber = '';
if (selected) {
this.model.userName = selected.userName;
this.model.jobNumber = selected.jobNumber;
}
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
},
commit() {
if (this.model.userName && this.model.jobNumber) {
let operate = {
type: this.operate.type,
operation: OperationEvent.Command.close.confirm.operation,
}
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
this.$emit('operateUser', this.model);
}
})
} else {
this.$messageBox('选择的用户名或工号为空');
}
},
cancel() {
let operate = {
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
commit() {
if (this.model.userName && this.model.jobNumber) {
const operate = {
type: this.operate.type,
operation: OperationEvent.Command.cancel.menu.operation,
}
operation: OperationEvent.Command.close.confirm.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
this.$emit('operateUser', this.model);
}
}).catch(error => { this.doClose(); });
});
} else {
this.$messageBox('选择的用户名或工号为空');
}
},
cancel() {
const operate = {
type: this.operate.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => { this.doClose(); });
}
}
};
</script>
<style scoped>
.beijing-01__systerm .el-dialog .base-label {
@ -131,4 +139,4 @@
padding: 0 5px;
background-color: #F0F0F0;
}
</style>
</style>

View File

@ -1,170 +1,181 @@
<template>
<el-dialog class="beijing-01__systerm user-edit" :title="title" :visible.sync="show" width="420px"
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" append-to-body v-dialogDrag>
<div style="padding: 15px 40px; border: 1px double lightgray; margin: 20px 10px; ">
<el-form size="small" label-width="90px" :model="model" label-position="left" :rules="rules" ref="form">
<el-form-item label="工号:" prop="jobNumber">
<el-input v-model="model.jobNumber" disabled></el-input>
</el-form-item>
<el-form-item label="用户名:" prop="userName">
<el-input v-model="model.userName" disabled></el-input>
</el-form-item>
<el-form-item label="原始密码:" prop="oldPassword">
<el-input type="oldPassword" v-model="model.oldPassword"></el-input>
</el-form-item>
<el-form-item label="密码:" prop="password">
<el-input type="password" v-model="model.password"></el-input>
</el-form-item>
<el-form-item label="确认密码:" prop="confirm">
<el-input type="password" v-model="model.confirm"></el-input>
</el-form-item>
<el-dialog
v-dialogDrag
class="beijing-01__systerm user-edit"
:title="title"
:visible.sync="show"
width="420px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
append-to-body
>
<div style="padding: 15px 40px; border: 1px double lightgray; margin: 20px 10px; ">
<el-form ref="form" size="small" label-width="90px" :model="model" label-position="left" :rules="rules">
<el-form-item label="工号:" prop="jobNumber">
<el-input v-model="model.jobNumber" disabled />
</el-form-item>
<el-form-item label="用户名:" prop="userName">
<el-input v-model="model.userName" disabled />
</el-form-item>
<el-form-item label="原始密码:" prop="oldPassword">
<el-input v-model="model.oldPassword" type="oldPassword" />
</el-form-item>
<el-form-item label="密码:" prop="password">
<el-input v-model="model.password" type="password" />
</el-form-item>
<el-form-item label="确认密码:" prop="confirm">
<el-input v-model="model.confirm" type="password" />
</el-form-item>
</el-form>
</div>
<el-row justify="center" class="button-group">
<el-col :span="8" :offset="6">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="0">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
</el-dialog>
</el-form>
</div>
<el-row justify="center" class="button-group">
<el-col :span="8" :offset="6">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="0">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
export default {
name: 'UserEdit',
components: {
},
data() {
return {
operate: {},
selected: {},
operation: null,
dialogShow: false,
loading: false,
model: {
type: 'EDIT',
jobNumber: '',
userName: '',
oldPassword: '',
password: '',
confirm: '',
},
rules: {
jobNumber: [
{ required: true, message: '请输入工号', trigger: 'blur' }
],
userName: [
{ required: true, message: '请输入用户名', trigger: 'blur' }
],
oldPassword: [
{ required: true, message: '请输入原始密码', trigger: 'change' }
],
password: [
{ required: true, message: '请输入新密码', trigger: 'change' }
],
confirm: [
{ required: true, message: '请再次输入新密码', trigger: 'change' }
],
},
export default {
name: 'UserEdit',
components: {
},
data() {
return {
operate: {},
selected: {},
operation: null,
dialogShow: false,
loading: false,
model: {
type: 'EDIT',
jobNumber: '',
userName: '',
oldPassword: '',
password: '',
confirm: ''
},
rules: {
jobNumber: [
{ required: true, message: '请输入工号', trigger: 'blur' }
],
userName: [
{ required: true, message: '请输入用户名', trigger: 'blur' }
],
oldPassword: [
{ required: true, message: '请输入原始密码', trigger: 'change' }
],
password: [
{ required: true, message: '请输入新密码', trigger: 'change' }
],
confirm: [
{ required: true, message: '请再次输入新密码', trigger: 'change' }
]
}
};
},
computed: {
...mapGetters('map', [
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
computed: {
...mapGetters('map', [
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Command.close.confirm.domId : '';
},
title() {
return '用户编辑页面'
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Command.close.confirm.domId : '';
},
title() {
return '用户编辑页面';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected) {
//
if (!this.dialogShow) {
this.loading = false;
this.operate = operate || {};
this.operation = operate.operation;
this.$nextTick(() => {
this.$refs.form.resetFields();
this.selected = selected;
if (selected) {
this.model.jobNumber = selected.jobNumber;
this.model.userName = selected.userName;
}
});
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
methods: {
doShow(operate, selected) {
//
if (!this.dialogShow) {
this.loading = false;
this.operate = operate || {};
this.operation = operate.operation;
this.$nextTick(() => {
this.$refs.form.resetFields();
this.selected = selected;
if (selected) {
this.model.jobNumber = selected.jobNumber;
this.model.userName = selected.userName;
commit() {
this.$refs['form'].validate((valid) => {
if (valid) {
const operate = {
type: this.operate.type,
operation: OperationEvent.Command.close.confirm.operation
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
if (this.selected.password !== this.model.oldPassword) {
this.$messageBox('原始密码错误');
} else if (this.model.password !== this.model.confirm) {
this.$messageBox('二次输入的密码错误');
} else if (this.model.oldPassword === this.model.password) {
this.$messageBox('老密码和新密相同');
} else {
this.doClose();
this.$emit('operateUser', this.model);
}
}
});
} else {
return false;
}
});
},
cancel() {
const operate = {
type: this.operate.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
commit() {
this.$refs['form'].validate((valid) => {
if (valid) {
let operate = {
type: this.operate.type,
operation: OperationEvent.Command.close.confirm.operation,
}
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid)
if (this.selected.password !== this.model.oldPassword) {
this.$messageBox('原始密码错误');
} else if (this.model.password !== this.model.confirm) {
this.$messageBox('二次输入的密码错误');
} else if (this.model.oldPassword === this.model.password) {
this.$messageBox('老密码和新密相同');
} else {
this.doClose();
this.$emit('operateUser', this.model);
}
})
} else {
return false;
}
});
},
cancel() {
let operate = {
type: this.operate.type,
operation: OperationEvent.Command.cancel.menu.operation,
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(error => { this.doClose(); });
}
}).catch(() => { this.doClose(); });
}
}
};
</script>
<style scoped>
.beijing-01__systerm .el-dialog .base-label {
@ -175,4 +186,4 @@
padding: 0 5px;
background-color: #F0F0F0;
}
</style>
</style>

View File

@ -27,7 +27,8 @@
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { MapDeviceType } from '@/scripts/cmdPlugin/Config';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
export default {
@ -113,7 +114,7 @@ export default {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
@ -141,7 +142,7 @@ export default {
messages: ['确认设置全线扣车!']
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} else {
@ -165,7 +166,7 @@ export default {
messages: ['确认取消全线扣车!']
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} else {

View File

@ -27,7 +27,8 @@
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { MapDeviceType } from '@/scripts/cmdPlugin/Config';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
export default {
@ -113,7 +114,7 @@ export default {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
@ -141,7 +142,7 @@ export default {
messages: ['确认取消全线上行扣车!']
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} else {
@ -165,7 +166,7 @@ export default {
messages: ['确认取消全线下行扣车!']
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} else {

View File

@ -1,123 +1,133 @@
<template>
<el-dialog class="beijing-01__systerm manage-user" :title="title" :visible.sync="show" width="600px" :before-close="doClose"
:zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
<div style="height: 70px;">
<div style="position: relative; left: 10px;">
</div>
<div style="position: relative; left: 80px;">
<div style="width:100%">
<span style="padding-left: 60px">ControlMonitor 1.3.5.0</span>
<el-button style="position: absolute; right: 95px;" :id="domIdConfirm" type="primary"
:loading="loading" @click="commit">确定</el-button>
</div>
<div style="width:100%; padding-top: 20px">
<span> 版权所有C2010-2011 北京玖琏科技有限公司</span>
</div>
</div>
<el-dialog
v-dialogDrag
class="beijing-01__systerm manage-user"
:title="title"
:visible.sync="show"
width="600px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<div style="height: 70px;">
<div style="position: relative; left: 10px;" />
<div style="position: relative; left: 80px;">
<div style="width:100%">
<span style="padding-left: 60px">ControlMonitor 1.3.5.0</span>
<el-button
:id="domIdConfirm"
style="position: absolute; right: 95px;"
type="primary"
:loading="loading"
@click="commit"
>确定</el-button>
</div>
<div style="padding: 10px; margin: 5px; ">
<el-table :data="tableData" style="width: 100%;" height="400">
<el-table-column prop="moduleName" label="模块名称" width="180">
</el-table-column>
<el-table-column prop="version" label="版本" width="180">
</el-table-column>
<el-table-column prop="updateDate" label="修改日期">
</el-table-column>
</el-table>
<div style="width:100%; padding-top: 20px">
<span> 版权所有C2010-2011 北京玖琏科技有限公司</span>
</div>
</el-dialog>
</div>
</div>
<div style="padding: 10px; margin: 5px; ">
<el-table :data="tableData" style="width: 100%;" height="400">
<el-table-column prop="moduleName" label="模块名称" width="180" />
<el-table-column prop="version" label="版本" width="180" />
<el-table-column prop="updateDate" label="修改日期" />
</el-table>
</div>
</el-dialog>
</template>
<script>
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
export default {
name: 'ManageUser',
data() {
return {
tableData: [
{
moduleName: '主程序版本:',
version: '123',
updateDate: '123'
}
],
operate: {},
operation: null,
dialogShow: false,
loading: false,
selected: null,
}
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Command.close.menu.domId : '';
},
title() {
return '关于ControlMonitor'
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
},
methods: {
doShow(operate) {
//
if (!this.dialogShow) {
this.loading = false;
this.operate = operate || {};
this.operation = operate.operation;
export default {
name: 'ManageUser',
data() {
return {
tableData: [
{
moduleName: '主程序版本:',
version: '123',
updateDate: '123'
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
],
operate: {},
operation: null,
dialogShow: false,
loading: false,
selected: null
};
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Command.close.menu.domId : '';
},
title() {
return '关于ControlMonitor';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate) {
//
if (!this.dialogShow) {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
commit() {
let operate = {
type: this.operate.type,
operation: OperationEvent.Command.close.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();
})
},
cancel() {
let operate = {
type: this.operate.type,
operation: OperationEvent.Command.cancel.menu.operation,
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(error => { this.doClose(); });
this.operate = operate || {};
this.operation = operate.operation;
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
commit() {
const operate = {
type: this.operate.type,
operation: OperationEvent.Command.close.menu.operation
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
});
},
cancel() {
const operate = {
type: this.operate.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => { this.doClose(); });
}
}
};
</script>
<style scoped>
.beijing-01__systerm .el-dialog .base-label {
@ -128,4 +138,4 @@
padding: 0 5px;
background-color: #F0F0F0;
}
</style>
</style>

View File

@ -1,282 +1,300 @@
<template>
<el-dialog class="beijing-01__systerm manage-user" :title="title" :visible.sync="show" width="420px"
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
<div style="padding: 5px 5px; border: 1px double lightgray; margin: 20px 0px; ">
<span class="base-label">用户列表</span>
<el-row>
<el-col :span="18">
<el-table ref="multipleTable" :data="tableData" border row-key="code" style="width: 100%"
height="450" center size="mini" highlight-current-row @row-click="chooseUser">
<el-table-column prop="jobNumber" label="工号" width="120">
<template slot-scope="scope">
<span>{{scope.row.jobNumber}}</span>
</template>
</el-table-column>
<el-table-column prop="userName" label="用户名">
<template slot-scope="scope">
<span>{{scope.row.userName}}</span>
</template>
</el-table-column>
<el-table-column width="20">
</el-table-column>
</el-table>
</el-col>
<el-col :span="4">
<el-button style="margin-top: 140px; margin-left: 10px;" :id="domIdFreshUser" @click="freshUser">刷新
</el-button>
<el-button style="margin-top: 30px; margin-left: 10px;" :id="domIdAddUser" @click="addUser">增加
</el-button>
<el-button style="margin-top: 30px; margin-left: 10px;" :id="domIdEditUser" @click="editUser">修改
</el-button>
<el-button style="margin-top: 30px; margin-left: 10px;" :id="domIdDelUser" @click="delUser">删除
</el-button>
</el-col>
</el-row>
</div>
<el-row justify="center" class="button-group">
<el-col :span="8" :offset="6">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="0">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<user-add ref="userAdd" @operateUser="operateUser"></user-add>
<user-edit ref="userEdit" @operateUser="operateUser"></user-edit>
<user-delete ref="userDelete" @operateUser="operateUser"></user-delete>
</el-dialog>
<el-dialog
v-dialogDrag
class="beijing-01__systerm manage-user"
:title="title"
:visible.sync="show"
width="420px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<div style="padding: 5px 5px; border: 1px double lightgray; margin: 20px 0px; ">
<span class="base-label">用户列表</span>
<el-row>
<el-col :span="18">
<el-table
ref="multipleTable"
:data="tableData"
border
row-key="code"
style="width: 100%"
height="450"
center
size="mini"
highlight-current-row
@row-click="chooseUser"
>
<el-table-column prop="jobNumber" label="工号" width="120">
<template slot-scope="scope">
<span>{{ scope.row.jobNumber }}</span>
</template>
</el-table-column>
<el-table-column prop="userName" label="用户名">
<template slot-scope="scope">
<span>{{ scope.row.userName }}</span>
</template>
</el-table-column>
<el-table-column width="20" />
</el-table>
</el-col>
<el-col :span="4">
<el-button :id="domIdFreshUser" style="margin-top: 140px; margin-left: 10px;" @click="freshUser">刷新
</el-button>
<el-button :id="domIdAddUser" style="margin-top: 30px; margin-left: 10px;" @click="addUser">增加
</el-button>
<el-button :id="domIdEditUser" style="margin-top: 30px; margin-left: 10px;" @click="editUser">修改
</el-button>
<el-button :id="domIdDelUser" style="margin-top: 30px; margin-left: 10px;" @click="delUser">删除
</el-button>
</el-col>
</el-row>
</div>
<el-row justify="center" class="button-group">
<el-col :span="8" :offset="6">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="0">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<user-add ref="userAdd" @operateUser="operateUser" />
<user-edit ref="userEdit" @operateUser="operateUser" />
<user-delete ref="userDelete" @operateUser="operateUser" />
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import UserAdd from './childDialog/userAdd';
import UserEdit from './childDialog/userEdit';
import UserDelete from './childDialog/userDelete';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { mapGetters } from 'vuex';
import UserAdd from './childDialog/userAdd';
import UserEdit from './childDialog/userEdit';
import UserDelete from './childDialog/userDelete';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
export default {
name: 'ManageUser',
components: {
UserAdd,
UserEdit,
UserDelete
export default {
name: 'ManageUser',
components: {
UserAdd,
UserEdit,
UserDelete
},
data() {
return {
tableData: [],
operate: {},
operation: null,
dialogShow: false,
loading: false,
selected: null
};
},
computed: {
...mapGetters('map', [
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
data() {
return {
tableData: [],
operate: {},
operation: null,
dialogShow: false,
loading: false,
selected: null,
}
domIdAddUser() {
return this.dialogShow ? OperationEvent.Command.manage.addUser.domId : '';
},
computed: {
...mapGetters('map', [
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdAddUser() {
return this.dialogShow ? OperationEvent.Command.manage.addUser.domId : '';
},
domIdEditUser() {
return this.dialogShow ? OperationEvent.Command.manage.editUser.domId : '';
},
domIdDelUser() {
return this.dialogShow ? OperationEvent.Command.manage.delUser.domId : '';
},
domIdFreshUser() {
return this.dialogShow ? OperationEvent.Command.manage.freshUser.domId : '';
},
domIdChooseUser() {
return this.dialogShow ? OperationEvent.Command.manage.chooseUser.domId : '';
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Command.close.menu.domId : '';
},
title() {
return '用户管理'
}
domIdEditUser() {
return this.dialogShow ? OperationEvent.Command.manage.editUser.domId : '';
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
domIdDelUser() {
return this.dialogShow ? OperationEvent.Command.manage.delUser.domId : '';
},
methods: {
doShow(operate) {
//
if (!this.dialogShow) {
this.loading = false;
this.operate = operate || {};
this.operation = operate.operation;
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
domIdFreshUser() {
return this.dialogShow ? OperationEvent.Command.manage.freshUser.domId : '';
},
domIdChooseUser() {
return this.dialogShow ? OperationEvent.Command.manage.chooseUser.domId : '';
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Command.close.menu.domId : '';
},
title() {
return '用户管理';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate) {
//
if (!this.dialogShow) {
this.loading = false;
this.dialogShow = false;
this.operate = operate || {};
this.operation = operate.operation;
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
},
//
addUser() {
let operate = {
type: this.operate.type,
operation: OperationEvent.Command.manage.addUser.operation,
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
//
addUser() {
const operate = {
type: this.operate.type,
operation: OperationEvent.Command.manage.addUser.operation
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.$refs.userAdd.doShow(operate);
}
}).catch(() => {
this.loading = false;
});
},
//
editUser() {
if (this.selected) {
const operate = {
type: this.operate.type,
operation: OperationEvent.Command.manage.editUser.operation
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.$refs.userAdd.doShow(operate);
this.$refs.userEdit.doShow(operate, this.selected);
}
}).catch(error => {
}).catch(() => {
this.loading = false;
})
},
//
editUser() {
if (this.selected) {
let operate = {
type: this.operate.type,
operation: OperationEvent.Command.manage.editUser.operation,
}
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.$refs.userEdit.doShow(operate, this.selected);
}
}).catch(error => {
this.loading = false;
})
} else {
this.$messageBox('请先选择用户');
}
},
//
delUser() {
if (this.selected) {
let operate = {
type: this.operate.type,
operation: OperationEvent.Command.manage.delUser.operation,
messages: [`你确定删除用户${this.selected.userName}吗?`]
}
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.$refs.userDelete.doShow(operate, this.selected);
}
}).catch(error => {
this.loading = false;
})
} else {
this.$messageBox('请先选择用户');
}
},
//
freshUser() {
let operate = {
});
} else {
this.$messageBox('请先选择用户');
}
},
//
delUser() {
if (this.selected) {
const operate = {
type: this.operate.type,
operation: OperationEvent.Command.manage.freshUser.operation,
}
operation: OperationEvent.Command.manage.delUser.operation,
messages: [`你确定删除用户${this.selected.userName}吗?`]
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
}).catch(error => {
this.loading = false;
})
},
//
chooseUser(row) {
let operate = {
type: this.operate.type,
operation: OperationEvent.Command.manage.chooseUser.operation,
}
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
this.selected = row;
}).catch(error => {
this.loading = false;
})
},
commit() {
let operate = {
type: this.operate.type,
operation: OperationEvent.Command.close.menu.operation,
}
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
this.$refs.userDelete.doShow(operate, this.selected);
}
}).catch(error => {
}).catch(() => {
this.loading = false;
});
} else {
this.$messageBox('请先选择用户');
}
},
//
freshUser() {
const operate = {
type: this.operate.type,
operation: OperationEvent.Command.manage.freshUser.operation
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
}).catch(() => {
this.loading = false;
});
},
//
chooseUser(row) {
const operate = {
type: this.operate.type,
operation: OperationEvent.Command.manage.chooseUser.operation
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
this.selected = row;
}).catch(() => {
this.loading = false;
});
},
commit() {
const operate = {
type: this.operate.type,
operation: OperationEvent.Command.close.menu.operation
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
})
},
cancel() {
let operate = {
type: this.operate.type,
operation: OperationEvent.Command.cancel.menu.operation,
}
}).catch(() => {
this.loading = false;
this.doClose();
});
},
cancel() {
const operate = {
type: this.operate.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(error => { this.doClose(); });
},
//
operateUser(data) {
if (data && data.type === 'ADD') {
let index = this.tableData.indexOf(this.tableData.find(elem => { return elem.jobNumber === data.jobNumber }));
if (index < 0) {
this.tableData.push({
jobNumber: data.jobNumber,
userName: data.userName,
password: data.password
});
} else {
this.$messageBox('添加失败,存在相同工号的用户');
}
} else if (data && data.type === 'EDIT') {
let index = this.tableData.indexOf(this.tableData.find(elem => { return elem.jobNumber === data.jobNumber }));
if (index >= 0) {
this.tableData[index].password = data.password;
this.tableData[index].userName = data.userName;
} else {
this.$messageBox('修改失败');
}
} else if (data && data.type === 'DELETE') {
let index = this.tableData.indexOf(this.tableData.find(elem => { return elem.jobNumber === data.jobNumber }));
if (index >= 0) {
this.tableData.splice(index, 1);
} else {
this.$messageBox('删除失败');
}
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => { this.doClose(); });
},
//
operateUser(data) {
if (data && data.type === 'ADD') {
const index = this.tableData.indexOf(this.tableData.find(elem => { return elem.jobNumber === data.jobNumber; }));
if (index < 0) {
this.tableData.push({
jobNumber: data.jobNumber,
userName: data.userName,
password: data.password
});
} else {
this.$messageBox('添加失败,存在相同工号的用户');
}
} else if (data && data.type === 'EDIT') {
const index = this.tableData.indexOf(this.tableData.find(elem => { return elem.jobNumber === data.jobNumber; }));
if (index >= 0) {
this.tableData[index].password = data.password;
this.tableData[index].userName = data.userName;
} else {
this.$messageBox('修改失败');
}
} else if (data && data.type === 'DELETE') {
const index = this.tableData.indexOf(this.tableData.find(elem => { return elem.jobNumber === data.jobNumber; }));
if (index >= 0) {
this.tableData.splice(index, 1);
} else {
this.$messageBox('删除失败');
}
}
}
}
};
</script>
<style scoped>
.beijing-01__systerm .el-dialog .base-label {
@ -287,4 +305,4 @@
padding: 0 5px;
background-color: #F0F0F0;
}
</style>
</style>

View File

@ -131,7 +131,7 @@ export default {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}

View File

@ -1,154 +1,167 @@
<template>
<el-dialog class="beijing-01__systerm stand-stop-time" :title="title" :visible.sync="show" width="320px"
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
<el-form size="small" label-width="100px" :model="addModel" :rules="rules" ref="form">
<div style="padding: 10px 15px; border: 1px double lightgray; margin: 20px 0px; height: 120px;">
<span class="base-label">添加位置</span>
<div style="position: relative; top:-10px;">
<el-form-item prop="stationStandCode">
<span slot="label">&emsp;&emsp;&emsp;:</span>
<el-select v-model="addModel.stationStandCode" filterable placeholder="请选择">
<el-option v-for="item in stationStandList" :key="item.code" :label="item.name"
:value="item.code">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="前车车次号:" prop="trainNumberLimber">
<el-input v-model="addModel.trainNumberLimber"></el-input>
</el-form-item>
</div>
</div>
<el-form-item label="添加车次号:" label-width="115px" prop="groupNumber">
<el-input v-model="addModel.groupNumber"></el-input>
</el-form-item>
</el-form>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :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>
</el-dialog>
<el-dialog
v-dialogDrag
class="beijing-01__systerm stand-stop-time"
:title="title"
:visible.sync="show"
width="320px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-form ref="form" size="small" label-width="100px" :model="addModel" :rules="rules">
<div style="padding: 10px 15px; border: 1px double lightgray; margin: 20px 0px; height: 120px;">
<span class="base-label">添加位置</span>
<div style="position: relative; top:-10px;">
<el-form-item prop="stationStandCode">
<span slot="label">&emsp;&emsp;&emsp;:</span>
<el-select v-model="addModel.stationStandCode" filterable placeholder="请选择">
<el-option
v-for="item in stationStandList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item label="前车车次号:" prop="trainNumberLimber">
<el-input v-model="addModel.trainNumberLimber" />
</el-form-item>
</div>
</div>
<el-form-item label="添加车次号:" label-width="115px" prop="groupNumber">
<el-input v-model="addModel.groupNumber" />
</el-form-item>
</el-form>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :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>
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { mapGetters } from 'vuex';
import { MapDeviceType } from '@/scripts/cmdPlugin/Config';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
export default {
name: 'TrainAdd',
components: {
},
data() {
return {
trainNoList: [],
addModel: {
groupNumber: '',
stationStandCode: '',
trainNumberLimber: '',
},
export default {
name: 'TrainAdd',
components: {
},
data() {
return {
trainNoList: [],
addModel: {
groupNumber: '',
stationStandCode: '',
trainNumberLimber: ''
},
rules: {
groupNumber: [
{ required: true, message: '请输入车次号', trigger: 'blur' }
],
// trainNumberLimber: [
// { required: true, message: '', trigger: 'blur' }
// ],
stationStandCode: [
{ required: true, message: '请选择终端', trigger: 'change' }
],
},
operation: null,
dialogShow: false,
loading: false,
}
},
computed: {
...mapGetters('map', [
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
rules: {
groupNumber: [
{ required: true, message: '请输入车次号', trigger: 'blur' }
],
// trainNumberLimber: [
// { required: true, message: '', trigger: 'blur' }
// ],
stationStandCode: [
{ required: true, message: '请选择终端', trigger: 'change' }
]
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Command.planTrain.addPlanTrain.domId : '';
},
title() {
return '添加计划车'
}
operation: null,
dialogShow: false,
loading: false
};
},
computed: {
...mapGetters('map', [
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
methods: {
doShow(operate) {
this.operate = operate || {};
this.operation = operate.operation;
domIdConfirm() {
return this.dialogShow ? OperationEvent.Command.planTrain.addPlanTrain.domId : '';
},
title() {
return '添加计划车';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate) {
this.operate = operate || {};
this.operation = operate.operation;
//
if (!this.dialogShow) {
this.loading = false;
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
//
if (!this.dialogShow) {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
commit() {
this.$refs['form'].validate((valid) => {
if (valid) {
let operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.planTrain.addPlanTrain.operation,
}
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
} else {
// this.$refs.noticeInfo.doShow(operate);
}
}).catch(error => {
this.loading = false;
this.doClose();
// this.$refs.noticeInfo.doShow(operate);
})
} else {
return false;
}
});
},
cancel() {
let operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation,
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(error => { this.doClose(); });
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
commit() {
this.$refs['form'].validate((valid) => {
if (valid) {
const operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.planTrain.addPlanTrain.operation
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
} else {
// this.$refs.noticeInfo.doShow(operate);
}
}).catch(() => {
this.loading = false;
this.doClose();
// this.$refs.noticeInfo.doShow(operate);
});
} else {
return false;
}
});
},
cancel() {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => { this.doClose(); });
}
}
};
</script>
<style scoped>
.beijing-01__systerm .el-dialog .base-label {
@ -159,4 +172,4 @@
padding: 0 5px;
background-color: #F0F0F0;
}
</style>
</style>

View File

@ -1,141 +1,149 @@
<template>
<el-dialog class="beijing-01__systerm stand-stop-time" :title="title" :visible.sync="show" width="320px"
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
<el-form size="small" label-width="100px" :model="addModel" :rules="rules" ref="form">
<el-form-item prop="stationStandCode">
<span slot="label">&emsp;&emsp;:</span>
<el-select v-model="addModel.stationStandCode" filterable placeholder="请选择">
<el-option v-for="item in stationStandList" :key="item.code" :label="item.name" :value="item.code">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="车 次 号:" prop="groupNumber">
<el-input v-model="addModel.groupNumber"></el-input>
</el-form-item>
</el-form>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :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>
</el-dialog>
<el-dialog
v-dialogDrag
class="beijing-01__systerm stand-stop-time"
:title="title"
:visible.sync="show"
width="320px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-form ref="form" size="small" label-width="100px" :model="addModel" :rules="rules">
<el-form-item prop="stationStandCode">
<span slot="label">&emsp;&emsp;:</span>
<el-select v-model="addModel.stationStandCode" filterable placeholder="请选择">
<el-option v-for="item in stationStandList" :key="item.code" :label="item.name" :value="item.code" />
</el-select>
</el-form-item>
<el-form-item label="车 次 号:" prop="groupNumber">
<el-input v-model="addModel.groupNumber" />
</el-form-item>
</el-form>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :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>
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { mapGetters } from 'vuex';
import { MapDeviceType } from '@/scripts/cmdPlugin/Config';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
export default {
name: 'TrainAdd',
components: {
},
data() {
return {
trainNoList: [],
addModel: {
groupNumber: '',
stationStandCode: '',
},
export default {
name: 'TrainAdd',
components: {
},
data() {
return {
trainNoList: [],
addModel: {
groupNumber: '',
stationStandCode: ''
},
rules: {
groupNumber: [
{ required: true, message: '请输入车次号', trigger: 'blur' }
],
stationStandCode: [
{ required: true, message: '请选择终端', trigger: 'change' }
],
},
operation: null,
dialogShow: false,
loading: false,
}
},
computed: {
...mapGetters('map', [
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
rules: {
groupNumber: [
{ required: true, message: '请输入车次号', trigger: 'blur' }
],
stationStandCode: [
{ required: true, message: '请选择终端', trigger: 'change' }
]
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Command.planTrain.delPlanTrain.domId : '';
},
title() {
return '删除计划车'
}
operation: null,
dialogShow: false,
loading: false
};
},
computed: {
...mapGetters('map', [
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
methods: {
doShow(operate) {
this.operate = operate || {};
this.operation = operate.operation;
domIdConfirm() {
return this.dialogShow ? OperationEvent.Command.planTrain.delPlanTrain.domId : '';
},
title() {
return '删除计划车';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate) {
this.operate = operate || {};
this.operation = operate.operation;
//
if (!this.dialogShow) {
this.loading = false;
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
//
if (!this.dialogShow) {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
commit() {
this.$refs['form'].validate((valid) => {
if (valid) {
let operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.planTrain.delPlanTrain.operation,
}
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
} else {
// this.$refs.noticeInfo.doShow(operate);
}
}).catch(error => {
this.loading = false;
this.doClose();
// this.$refs.noticeInfo.doShow(operate);
})
} else {
return false;
}
});
},
cancel() {
let operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation,
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(error => { this.doClose(); });
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
commit() {
this.$refs['form'].validate((valid) => {
if (valid) {
const operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.planTrain.delPlanTrain.operation
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
} else {
// this.$refs.noticeInfo.doShow(operate);
}
}).catch(() => {
this.loading = false;
this.doClose();
});
} else {
return false;
}
});
},
cancel() {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => { this.doClose(); });
}
}
};
</script>
<style scoped>
.beijing-01__systerm .el-dialog .base-label {
@ -146,4 +154,4 @@
padding: 0 5px;
background-color: #F0F0F0;
}
</style>
</style>

View File

@ -1,152 +1,165 @@
<template>
<el-dialog class="beijing-01__systerm stand-stop-time" :title="title" :visible.sync="show" width="320px"
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
<el-form size="small" label-width="100px" :model="addModel" :rules="rules" ref="form">
<el-form-item label="车 次 号:" label-width="115px" prop="groupNumber">
<el-input v-model="addModel.groupNumber"></el-input>
</el-form-item>
<div style="padding: 10px 15px; border: 1px double lightgray; margin: 20px 0px; height: 120px;">
<span class="base-label">目的</span>
<div style="position: relative; top:-10px;">
<el-form-item prop="stationStandCode">
<span slot="label">&emsp;&emsp;:</span>
<el-select v-model="addModel.stationStandCode" filterable placeholder="请选择">
<el-option v-for="item in stationStandList" :key="item.code" :label="item.name"
:value="item.code">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="车 次 号:" prop="trainNumberLimber">
<el-input v-model="addModel.trainNumberLimber"></el-input>
</el-form-item>
</div>
</div>
</el-form>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :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>
</el-dialog>
<el-dialog
v-dialogDrag
class="beijing-01__systerm stand-stop-time"
:title="title"
:visible.sync="show"
width="320px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-form ref="form" size="small" label-width="100px" :model="addModel" :rules="rules">
<el-form-item label="车 次 号:" label-width="115px" prop="groupNumber">
<el-input v-model="addModel.groupNumber" />
</el-form-item>
<div style="padding: 10px 15px; border: 1px double lightgray; margin: 20px 0px; height: 120px;">
<span class="base-label">目的</span>
<div style="position: relative; top:-10px;">
<el-form-item prop="stationStandCode">
<span slot="label">&emsp;&emsp;:</span>
<el-select v-model="addModel.stationStandCode" filterable placeholder="请选择">
<el-option
v-for="item in stationStandList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item label="车 次 号:" prop="trainNumberLimber">
<el-input v-model="addModel.trainNumberLimber" />
</el-form-item>
</div>
</div>
</el-form>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :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>
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { mapGetters } from 'vuex';
import { MapDeviceType } from '@/scripts/cmdPlugin/Config';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
export default {
name: 'TrainTranstalet',
components: {
},
data() {
return {
trainNoList: [],
addModel: {
groupNumber: '',
stationStandCode: '',
trainNumberLimber: '',
},
export default {
name: 'TrainTranstalet',
components: {
},
data() {
return {
trainNoList: [],
addModel: {
groupNumber: '',
stationStandCode: '',
trainNumberLimber: ''
},
rules: {
groupNumber: [
{ required: true, message: '请输入车次号', trigger: 'blur' }
],
trainNumberLimber: [
{ required: true, message: '请输入前车车次号', trigger: 'blur' }
],
stationStandCode: [
{ required: true, message: '请选择终端', trigger: 'change' }
],
},
operation: null,
dialogShow: false,
loading: false,
}
},
computed: {
...mapGetters('map', [
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
rules: {
groupNumber: [
{ required: true, message: '请输入车次号', trigger: 'blur' }
],
trainNumberLimber: [
{ required: true, message: '请输入前车车次号', trigger: 'blur' }
],
stationStandCode: [
{ required: true, message: '请选择终端', trigger: 'change' }
]
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Command.planTrain.translatPlanTrain.domId : '';
},
title() {
return '平移计划车'
}
operation: null,
dialogShow: false,
loading: false
};
},
computed: {
...mapGetters('map', [
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
methods: {
doShow(operate) {
this.operate = operate || {};
this.operation = operate.operation;
domIdConfirm() {
return this.dialogShow ? OperationEvent.Command.planTrain.translatPlanTrain.domId : '';
},
title() {
return '平移计划车';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate) {
this.operate = operate || {};
this.operation = operate.operation;
//
if (!this.dialogShow) {
this.loading = false;
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
//
if (!this.dialogShow) {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
commit() {
this.$refs['form'].validate((valid) => {
if (valid) {
let operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.planTrain.translatPlanTrain.operation,
}
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
} else {
// this.$refs.noticeInfo.doShow(operate);
}
}).catch(error => {
this.loading = false;
this.doClose();
// this.$refs.noticeInfo.doShow(operate);
})
} else {
return false;
}
});
},
cancel() {
let operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation,
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(error => { this.doClose(); });
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
commit() {
this.$refs['form'].validate((valid) => {
if (valid) {
const operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.planTrain.translatPlanTrain.operation
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
} else {
// this.$refs.noticeInfo.doShow(operate);
}
}).catch(() => {
this.loading = false;
this.doClose();
// this.$refs.noticeInfo.doShow(operate);
});
} else {
return false;
}
});
},
cancel() {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => { this.doClose(); });
}
}
</script>
};
</script>

View File

@ -193,7 +193,7 @@ export default {
code: this.selected.code,
operation: OperationEvent.Station.setAutoTrigger.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
@ -209,7 +209,7 @@ export default {
code: this.selected.code,
operation: OperationEvent.Station.cancelAutoTrigger.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
@ -224,7 +224,7 @@ export default {
code: this.selected.code,
operation: OperationEvent.Station.powerUnLock.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.stationCmdControl.doShow(operate, this.selected);
@ -238,7 +238,7 @@ export default {
code: this.selected.code,
operation: OperationEvent.Station.execKeyOperationTest.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.stationCmdControl.doShow(operate, this.selected);
@ -252,7 +252,7 @@ export default {
code: this.selected.code,
operation: OperationEvent.Station.humanControlALL.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.stationHumanControlAll.doShow(operate, this.selected);
@ -266,7 +266,7 @@ export default {
code: this.selected.code,
operation: OperationEvent.Station.atsAutoControlALL.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.stationSetRouteControlAll.doShow(operate, this.selected);

View File

@ -249,22 +249,6 @@ export default {
}
});
},
//
// cancelDetainTrainForce() {
// const operate = {
// start: true,
// code: this.selected.code,
// type: MapDeviceType.StationStand.type,
// label: MapDeviceType.StationStand.label,
// operation: OperationEvent.StationStand.cancelDetainTrainForce.menu.operation
// };
// this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
// if (valid) {
// this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
// this.$refs.standControl.doShow(operate, this.selected);
// }
// });
// },
//
setJumpStop() {
commitOperate(menuOperate.StationStand.setJumpStop, {standCode:this.selected.code}, 0).then(({ valid, operate })=>{

View File

@ -393,7 +393,7 @@ export default {
code: this.selected.code,
operation: OperationEvent.Train.limitSpeed.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} else {
@ -418,7 +418,7 @@ export default {
code: this.selected.code,
operation: OperationEvent.Train.addTrainId.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainDefine.doShow(operate, this.selected);
@ -432,7 +432,7 @@ export default {
code: this.selected.code,
operation: OperationEvent.Train.delTrainId.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainDelete.doShow(operate, this.selected);
@ -446,7 +446,7 @@ export default {
code: this.selected.code,
operation: OperationEvent.Train.moveTrainId.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainMove.doShow(operate, this.selected);
@ -460,7 +460,7 @@ export default {
code: this.selected.code,
operation: OperationEvent.Train.editTrainId.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainEdit.doShow(operate, this.selected);
@ -474,7 +474,7 @@ export default {
code: this.selected.code,
operation: OperationEvent.Train.editTrainId.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainSetPlan.doShow(operate, this.selected);
@ -488,7 +488,7 @@ export default {
code: this.selected.code,
operation: OperationEvent.Train.moveEventlyTrainId.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainMoveEvently.doShow(operate, this.selected);
@ -502,7 +502,7 @@ export default {
code: this.selected.code,
operation: OperationEvent.Train.deletePlanTrainId.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainDeletePlan.doShow(operate, this.selected);
@ -516,7 +516,7 @@ export default {
code: this.selected.code,
operation: OperationEvent.Train.editTrainId.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainSetHead.doShow(operate, this.selected);
@ -530,7 +530,7 @@ export default {
code: this.selected.code,
operation: OperationEvent.Train.editTrainId.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainSetWork.doShow(operate, this.selected);
@ -544,7 +544,7 @@ export default {
code: this.selected.code,
operation: OperationEvent.Train.editTrainId.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainFlag.doShow(operate, this.selected);
@ -558,7 +558,7 @@ export default {
code: this.selected.code,
operation: OperationEvent.Train.editTrainId.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainFlag.doShow(operate, this.selected);

View File

@ -83,7 +83,7 @@
<script>
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
export default {
name: 'AlarmDetail',
@ -179,7 +179,7 @@ export default {
operation: OperationEvent.Command.close.alarm.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
if (valid) {
this.doClose();
@ -191,7 +191,7 @@ export default {
type: this.operate.type,
operation: OperationEvent.Command.close.alarm.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
if (valid) {
this.doClose();

View File

@ -18,7 +18,7 @@
</template>
<script>
import { OperationEvent } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
export default {
name: 'CmdNotice',
data() {

View File

@ -11,7 +11,6 @@ import PopMenu from '@/components/PopMenu';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import CancelMouseState from '@/mixin/CancelMouseState';
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';

View File

@ -1,188 +1,205 @@
<template>
<el-dialog class="chengdou-03__systerm stand-stop-time" :title="title" :visible.sync="show" width="640px"
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
<el-form size="small" label-width="80px" :model="addModel" :rules="rules" ref="form">
<div style="overflow: hidden;">
<div
style="width: 48%; float: left; padding: 10px 15px; border: 1px double lightgray; margin: 20px 0px; height: 177px; margin-right: 4%;">
<span class="base-label">源车次窗</span>
<div style="position: relative; top:-10px;">
<el-form-item label="车 组 号:" prop="trainNumberSource">
<el-input v-model="addModel.trainNumberSource"></el-input>
</el-form-item>
<el-form-item prop="stationStandSource">
<span slot="label">&emsp; :</span>
<el-select v-model="addModel.stationStandSource" filterable placeholder="请选择">
<el-option v-for="item in stationStandList" :key="item.code" :label="item.name"
:value="item.code">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="车 次 窗:" prop="trainSource">
<el-input v-model="addModel.trainSource"></el-input>
</el-form-item>
</div>
</div>
<div
style="width: 48%; float: left; padding: 10px 15px; border: 1px double lightgray; margin: 20px 0px; height: 177px;">
<span class="base-label">目的车次窗</span>
<div style="position: relative; top:-10px;">
<el-form-item label="车 组 号:" prop="trainNumberGoal">
<el-input v-model="addModel.trainNumberGoal"></el-input>
</el-form-item>
<el-form-item prop="stationStandGoal">
<span slot="label">&emsp; :</span>
<el-select v-model="addModel.stationStandGoal" filterable placeholder="请选择">
<el-option v-for="item in stationStandList" :key="item.code" :label="item.name"
:value="item.code">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="车 次 窗:" prop="trainGoal">
<el-input v-model="addModel.trainGoal"></el-input>
</el-form-item>
</div>
</div>
</div>
</el-form>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :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>
</el-dialog>
<el-dialog
v-dialogDrag
class="chengdou-03__systerm stand-stop-time"
:title="title"
:visible.sync="show"
width="640px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-form ref="form" size="small" label-width="80px" :model="addModel" :rules="rules">
<div style="overflow: hidden;">
<div
style="width: 48%; float: left; padding: 10px 15px; border: 1px double lightgray; margin: 20px 0px; height: 177px; margin-right: 4%;"
>
<span class="base-label">源车次窗</span>
<div style="position: relative; top:-10px;">
<el-form-item label="车 组 号:" prop="trainNumberSource">
<el-input v-model="addModel.trainNumberSource" />
</el-form-item>
<el-form-item prop="stationStandSource">
<span slot="label">&emsp; :</span>
<el-select v-model="addModel.stationStandSource" filterable placeholder="请选择">
<el-option
v-for="item in stationStandList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item label="车 次 窗:" prop="trainSource">
<el-input v-model="addModel.trainSource" />
</el-form-item>
</div>
</div>
<div
style="width: 48%; float: left; padding: 10px 15px; border: 1px double lightgray; margin: 20px 0px; height: 177px;"
>
<span class="base-label">目的车次窗</span>
<div style="position: relative; top:-10px;">
<el-form-item label="车 组 号:" prop="trainNumberGoal">
<el-input v-model="addModel.trainNumberGoal" />
</el-form-item>
<el-form-item prop="stationStandGoal">
<span slot="label">&emsp; :</span>
<el-select v-model="addModel.stationStandGoal" filterable placeholder="请选择">
<el-option
v-for="item in stationStandList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item label="车 次 窗:" prop="trainGoal">
<el-input v-model="addModel.trainGoal" />
</el-form-item>
</div>
</div>
</div>
</el-form>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :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>
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import CancelMouseState from '@/mixin/CancelMouseState';
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import CancelMouseState from '@/mixin/CancelMouseState';
export default {
name: 'TrainSwitch',
mixins: [
CancelMouseState
],
data() {
return {
trainNoList: [],
selected: null,
addModel: {
trainNumberSource: '',
trainSource: '',
stationStandSource: '',
trainGoal: '',
stationStandGoal: '',
trainNumberGoal: '',
},
export default {
name: 'TrainSwitch',
mixins: [
CancelMouseState
],
data() {
return {
trainNoList: [],
selected: null,
addModel: {
trainNumberSource: '',
trainSource: '',
stationStandSource: '',
trainGoal: '',
stationStandGoal: '',
trainNumberGoal: ''
},
rules: {
trainNumberSource: [
{ required: true, message: '请输入车组号', trigger: 'blur' }
],
trainSource: [
{ required: true, message: '请输入车次号', trigger: 'blur' }
],
stationStandSource: [
{ required: true, message: '请选择车站', trigger: 'change' }
],
trainNumberGoal: [
{ required: true, message: '请输入车组号', trigger: 'blur' }
],
trainGoal: [
{ required: true, message: '请输入车次号', trigger: 'blur' }
],
stationStandGoal: [
{ required: true, message: '请选择车站', trigger: 'change' }
]
},
dialogShow: false,
loading: false
};
},
computed: {
...mapGetters('map', [
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.moveTrainId.menu.domId : '';
},
title() {
return '移动列车识别号';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected) {
this.selected = selected;
//
if (!this.dialogShow) {
rules: {
trainNumberSource: [
{ required: true, message: '请输入车组号', trigger: 'blur' }
],
trainSource: [
{ required: true, message: '请输入车次号', trigger: 'blur' }
],
stationStandSource: [
{ required: true, message: '请选择车站', trigger: 'change' }
],
trainNumberGoal: [
{ required: true, message: '请输入车组号', trigger: 'blur' }
],
trainGoal: [
{ required: true, message: '请输入车次号', trigger: 'blur' }
],
stationStandGoal: [
{ required: true, message: '请选择车站', trigger: 'change' }
],
},
dialogShow: false,
loading: false,
}
},
computed: {
...mapGetters('map', [
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.moveTrainId.menu.domId : '';
},
title() {
return '移动列车识别号'
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
},
methods: {
doShow(operate, selected) {
this.selected = selected;
//
if (!this.dialogShow) {
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
this.mouseCancelState(this.selected);
},
commit() {
this.$refs['form'].validate((valid) => {
if (valid) {
let operate = {
send: true,
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
this.mouseCancelState(this.selected);
},
commit() {
this.$refs['form'].validate((valid) => {
if (valid) {
const operate = {
send: true,
operation: OperationEvent.Train.moveTrainId.menu.operation,
}
operation: OperationEvent.Train.moveTrainId.menu.operation
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(error => {
this.loading = false;
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
// this.$refs.noticeInfo.doShow(operate);
})
} else {
return false;
}
});
},
cancel() {
let operate = {
operation: OperationEvent.Command.cancel.menu.operation,
}
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
}
}).catch(error => {
this.loading = false;
this.doClose();
}
}).catch(error => { this.doClose(); });
}
// this.$refs.noticeInfo.doShow(operate);
});
} else {
return false;
}
});
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(error => { this.doClose(); });
}
}
};
</script>
<style scoped>
.chengdou-03__systerm .el-dialog .base-label {

View File

@ -1,246 +1,264 @@
<template>
<el-dialog class="chengdou-03__systerm stand-stop-time" :title="title" :visible.sync="show" width="800px"
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
<el-row>
<el-col :span="14">
<div class="card-box">
<span class="tip-label">请求</span>
<el-row style="margin: 5px">
<el-col :span="6" class="item-label">线路选择</el-col>
<el-col :span="6">
<el-select v-model="data.path">
<el-option v-for="item in pathList" :key="item.value" :label="item.name"
:value="item.value">
</el-option>
</el-select>
</el-col>
<el-col :span="6" class="item-label">限制速度</el-col>
<el-col :span="6">
<el-select v-model="data.speed">
<el-option v-for="item in speedList" :key="item.value" :label="item.name"
:value="item.value">
</el-option>
</el-select>
</el-col>
</el-row>
<el-row>
<el-col :span="6" class="item-label">起始公里标</el-col>
<el-col :span="6">
<el-input v-model="data.begKmPost"></el-input>
</el-col>
<el-col :span="6" class="item-label">结束公里标</el-col>
<el-col :span="6">
<el-input v-model="data.endKmPost"></el-input>
</el-col>
</el-row>
<el-row>
<el-col :span="6" class="item-label">限速区段长度</el-col>
<el-col :span="6">
<el-input v-model="data.length"></el-input>
</el-col>
<el-col :span="3">
<el-button>查看</el-button>
</el-col>
<el-col :span="3">
<el-button>请求</el-button>
</el-col>
</el-row>
</div>
<div class="card-box">
<span class="tip-label">执行</span>
<el-row style="margin: 5px">
<el-col :span="6" class="item-label">线路选择</el-col>
<el-col :span="6">
<el-select v-model="form.path">
<el-option v-for="item in pathList" :key="item.value" :label="item.name"
:value="item.value">
</el-option>
</el-select>
</el-col>
<el-col :span="6" class="item-label">限制速度</el-col>
<el-col :span="6">
<el-select v-model="form.speed">
<el-option v-for="item in speedList" :key="item.value" :label="item.name"
:value="item.value">
</el-option>
</el-select>
</el-col>
</el-row>
<el-row>
<el-col :span="6" class="item-label">起始公里标</el-col>
<el-col :span="6">
<el-input v-model="form.begKmPost"></el-input>
</el-col>
<el-col :span="6" class="item-label">结束公里标</el-col>
<el-col :span="6">
<el-input v-model="form.endKmPost"></el-input>
</el-col>
</el-row>
<el-row>
<el-col :span="6" class="item-label">限速区段长度</el-col>
<el-col :span="6">
<el-input v-model="form.length"></el-input>
</el-col>
<el-col :span="3">
<el-button>查看</el-button>
</el-col>
<el-col :span="3">
<el-button>请求</el-button>
</el-col>
</el-row>
</div>
<div class="card-box">
<span class="tip-label">操作提示</span>
11111113
</div>
<el-dialog
v-dialogDrag
class="chengdou-03__systerm stand-stop-time"
:title="title"
:visible.sync="show"
width="800px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row>
<el-col :span="14">
<div class="card-box">
<span class="tip-label">请求</span>
<el-row style="margin: 5px">
<el-col :span="6" class="item-label">线路选择</el-col>
<el-col :span="6">
<el-select v-model="data.path">
<el-option
v-for="item in pathList"
:key="item.value"
:label="item.name"
:value="item.value"
/>
</el-select>
</el-col>
<el-col :span="9" :offset="1">
<div class="card-box">
<span class="tip-label">设备列表</span>
<el-table class="card-table" :data="deviceData" border style="width: 100%" height="300">
<el-table-column prop="stationName" label="站名">
</el-table-column>
<el-table-column prop="deviceCode" label="设备号">
</el-table-column>
<el-table-column prop="deviceName" label="设备名">
</el-table-column>
</el-table>
</div>
<el-col :span="6" class="item-label">限制速度</el-col>
<el-col :span="6">
<el-select v-model="data.speed">
<el-option
v-for="item in speedList"
:key="item.value"
:label="item.name"
:value="item.value"
/>
</el-select>
</el-col>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-row>
<el-row>
<el-col :span="6" class="item-label">起始公里标</el-col>
<el-col :span="6">
<el-input v-model="data.begKmPost" />
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
<el-col :span="6" class="item-label">结束公里标</el-col>
<el-col :span="6">
<el-input v-model="data.endKmPost" />
</el-col>
</el-row>
</el-dialog>
</el-row>
<el-row>
<el-col :span="6" class="item-label">限速区段长度</el-col>
<el-col :span="6">
<el-input v-model="data.length" />
</el-col>
<el-col :span="3">
<el-button>查看</el-button>
</el-col>
<el-col :span="3">
<el-button>请求</el-button>
</el-col>
</el-row>
</div>
<div class="card-box">
<span class="tip-label">执行</span>
<el-row style="margin: 5px">
<el-col :span="6" class="item-label">线路选择</el-col>
<el-col :span="6">
<el-select v-model="form.path">
<el-option
v-for="item in pathList"
:key="item.value"
:label="item.name"
:value="item.value"
/>
</el-select>
</el-col>
<el-col :span="6" class="item-label">限制速度</el-col>
<el-col :span="6">
<el-select v-model="form.speed">
<el-option
v-for="item in speedList"
:key="item.value"
:label="item.name"
:value="item.value"
/>
</el-select>
</el-col>
</el-row>
<el-row>
<el-col :span="6" class="item-label">起始公里标</el-col>
<el-col :span="6">
<el-input v-model="form.begKmPost" />
</el-col>
<el-col :span="6" class="item-label">结束公里标</el-col>
<el-col :span="6">
<el-input v-model="form.endKmPost" />
</el-col>
</el-row>
<el-row>
<el-col :span="6" class="item-label">限速区段长度</el-col>
<el-col :span="6">
<el-input v-model="form.length" />
</el-col>
<el-col :span="3">
<el-button>查看</el-button>
</el-col>
<el-col :span="3">
<el-button>请求</el-button>
</el-col>
</el-row>
</div>
<div class="card-box">
<span class="tip-label">操作提示</span>
11111113
</div>
</el-col>
<el-col :span="9" :offset="1">
<div class="card-box">
<span class="tip-label">设备列表</span>
<el-table class="card-table" :data="deviceData" border style="width: 100%" height="300">
<el-table-column prop="stationName" label="站名" />
<el-table-column prop="deviceCode" label="设备号" />
<el-table-column prop="deviceName" label="设备名" />
</el-table>
</div>
</el-col>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :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>
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
export default {
name: 'TrainAdd',
components: {
},
data() {
return {
operation: null,
dialogShow: false,
loading: false,
data: {
path: '',
speed: '',
begKmPost: '',
endKmPost: '',
length: '',
},
form: {
path: '',
speed: '',
begKmPost: '',
endKmPost: '',
length: '',
},
pathList: [
{ name: '上行站线', value: '01' },
{ name: '下行站线', value: '02' }
],
speedList: [
{ name: '10Km/h', value: '10' },
{ name: '15Km/h', value: '15' },
{ name: '20Km/h', value: '20' },
{ name: '25Km/h', value: '25' },
],
deviceData: []
}
},
computed: {
...mapGetters('map', [
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
export default {
name: 'TrainAdd',
components: {
},
data() {
return {
operation: null,
dialogShow: false,
loading: false,
data: {
path: '',
speed: '',
begKmPost: '',
endKmPost: '',
length: ''
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
form: {
path: '',
speed: '',
begKmPost: '',
endKmPost: '',
length: ''
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Command.planTrain.addPlanTrain.domId : '';
},
title() {
return '设置临时限速'
}
pathList: [
{ name: '上行站线', value: '01' },
{ name: '下行站线', value: '02' }
],
speedList: [
{ name: '10Km/h', value: '10' },
{ name: '15Km/h', value: '15' },
{ name: '20Km/h', value: '20' },
{ name: '25Km/h', value: '25' }
],
deviceData: []
};
},
computed: {
...mapGetters('map', [
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
methods: {
doShow(operate) {
this.operate = operate || {};
this.operation = operate.operation;
domIdConfirm() {
return this.dialogShow ? OperationEvent.Command.planTrain.addPlanTrain.domId : '';
},
title() {
return '设置临时限速';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate) {
this.operate = operate || {};
this.operation = operate.operation;
if (!this.dialogShow) {
this.loading = false;
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
if (!this.dialogShow) {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
commit() {
this.$refs['form'].validate((valid) => {
if (valid) {
let operate = {
send: true,
operation: OperationEvent.Command.planTrain.addPlanTrain.operation,
}
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
} else {
// this.$refs.noticeInfo.doShow(operate);
}
}).catch(error => {
this.loading = false;
this.doClose();
// this.$refs.noticeInfo.doShow(operate);
})
} else {
return false;
}
});
},
cancel() {
let operate = {
operation: OperationEvent.Command.cancel.menu.operation,
}
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(error => { this.doClose(); });
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
commit() {
this.$refs['form'].validate((valid) => {
if (valid) {
const operate = {
send: true,
operation: OperationEvent.Command.planTrain.addPlanTrain.operation
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
} else {
// this.$refs.noticeInfo.doShow(operate);
}
}).catch(error => {
this.loading = false;
this.doClose();
// this.$refs.noticeInfo.doShow(operate);
});
} else {
return false;
}
});
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(error => { this.doClose(); });
}
}
};
</script>
<style scoped>
.chengdou-03__systerm .el-dialog .base-label {

View File

@ -66,7 +66,6 @@
<script>
import { mapGetters } from 'vuex';
import { TrainingMode } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import TwoConfirmation from './childDialog/twoConfirmation';
@ -114,16 +113,19 @@ export default {
if (this.dialogShow) {
return OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.forcedStationControl);
}
return '';
},
isRequest() {
if (this.dialogShow) {
return OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestStationControl);
}
return '';
},
isConter() {
if (this.dialogShow) {
return OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl);
}
return '';
},
domIdChoose() {
if (this.dialogShow) {
@ -135,6 +137,7 @@ export default {
return OperationEvent.StationControl.requestCentralControl.choose.domId;
}
}
return '';
},
domIdConter() {
return this.dialogShow ? OperationEvent.StationControl.requestCentralControl.menu.domId : '';
@ -358,7 +361,7 @@ export default {
} else {
this.disabledSure = false;
}
}).catch((error) => {
}).catch(() => {
this.disabledSure = false;
this.disabledClose = false;
});

View File

@ -159,7 +159,7 @@ export default {
const deviceList = [];
//
let nameShow = this.nameLevels.indexOf(1) !== -1;
let nameShow = this.nameLevels.includes(1);
const signalList = this.$store.getters['map/signalList'];
if (signalList && signalList.length > 0) {
signalList.forEach(elem => {
@ -168,11 +168,11 @@ export default {
}
//
nameShow = this.nameLevels.indexOf(3) !== -1;
nameShow = this.nameLevels.includes(3);
//
nameShow = this.nameLevels.indexOf(7) !== -1; //
const switchSectionNameShow = this.nameLevels.indexOf(9) !== -1; //
nameShow = this.nameLevels.includes(7); //
const switchSectionNameShow = this.nameLevels.includes(9); //
const switchList = this.$store.getters['map/switchList'];
if (switchList && switchList.length > 0) {
switchList.forEach(elem => {
@ -181,7 +181,7 @@ export default {
}
//
const indicatorShow = this.nameLevels.indexOf(8) !== -1;
const indicatorShow = this.nameLevels.includes(8);
const control = this.$store.getters['map/stationControlList'];
if (control && control.length > 0) {
control.forEach(elem => {
@ -204,28 +204,28 @@ export default {
nameShow = false;
} else if (elem.type === '01') {
//
nameShow = this.nameLevels.indexOf(11) !== -1;
nameShow = this.nameLevels.includes(11);
} else if (elem.type === '02') {
//
nameShow = this.nameLevels.indexOf(5) !== -1;
nameShow = this.nameLevels.includes(5);
} else if (elem.type === '04') {
//
nameShow = this.nameLevels.indexOf(9) !== -1;
nameShow = this.nameLevels.includes(9);
}
//
if (elem.standTrack) {
standTrackNameShow = this.nameLevels.indexOf(2) !== -1;
standTrackNameShow = this.nameLevels.includes(2);
}
//
if (elem.reentryTrack) {
reentryTrackNameShow = this.nameLevels.indexOf(4) !== -1;
reentryTrackNameShow = this.nameLevels.includes(4);
}
//
if (elem.transferTrack) {
transferTrackNameShow = this.nameLevels.indexOf(6) !== -1;
transferTrackNameShow = this.nameLevels.includes(6);
}
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { nameShow, standTrackNameShow, reentryTrackNameShow, transferTrackNameShow }));
@ -233,7 +233,7 @@ export default {
}
//
const destCodeShow = this.nameLevels.indexOf(10) !== -1;
const destCodeShow = this.nameLevels.includes(10);
const stopPointList = this.$store.getters['map/stopPointList'];
if (stopPointList && stopPointList.length > 0) {
stopPointList.forEach(elem => {
@ -242,7 +242,7 @@ export default {
}
//
const kmPostShow = this.nameLevels.indexOf(12) !== -1;
const kmPostShow = this.nameLevels.includes(12);
const stationList = this.$store.getters['map/stationList'];
if (stationList && stationList.length > 0) {
stationList.forEach(elem => {

View File

@ -19,9 +19,6 @@
</div>
</template>
<script>
// import { mapGetters } from 'vuex';
// import { TrainingMode, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
// import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'
import { prefixIntrger } from '@/utils/date';
import SystemTime from '@/views/components/systemTime/index';
import logo_ from '@/assets/logo_.png';

View File

@ -30,7 +30,7 @@
</template>
<script>
import { OperationEvent } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from './noticeInfo';
import { commitOperate } from '../../utils/menuOperate';
import CMD from '@/scripts/cmdPlugin/CommandEnum';

View File

@ -27,7 +27,6 @@
</template>
<script>
// import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
export default {
name: 'ConfirmTip',

View File

@ -26,7 +26,7 @@
</template>
<script>
import { OperationEvent } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
export default {
name: 'NoticeInfo',

View File

@ -28,7 +28,6 @@
</template>
<script>
// import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
export default {
name: '',

Some files were not shown because too many files have changed in this diff Show More