This commit is contained in:
fan 2020-06-03 09:13:45 +08:00
commit 186fe3e35a
24 changed files with 531 additions and 97 deletions

View File

@ -248,4 +248,16 @@ deviceRender[deviceType.LightingGroup] = {
zlevel: 1,
z: 5
};
/** 平衡电动阀 */
deviceRender[deviceType.BalancedElectric] = {
_type: deviceType.BalancedElectric,
zlevel: 1,
z: 5
};
/** 电动蝶阀 */
deviceRender[deviceType.ElectricButterflyValve] = {
_type: deviceType.ElectricButterflyValve,
zlevel: 1,
z: 5
};
export default deviceRender;

View File

@ -37,7 +37,9 @@ const deviceType = {
ArcStatus: 'ArcStatus',
IscsButton: 'IscsButton',
StateTable: 'StateTable',
LightingGroup: 'LightingGroup'
LightingGroup: 'LightingGroup',
BalancedElectric: 'BalancedElectric',
ElectricButterflyValve: 'ElectricButterflyValve'
};
export default deviceType;

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,30 @@
import Group from 'zrender/src/container/Group';
import createPathSvg from '../components/pathsvg';
export default class airConditioner extends Group {
constructor(device) {
super();
this.model = device.model;
this.zlevel = device.model.zlevel;
this.z = device.model.z;
this._type = device.model._type;
this.code = device.model.code;
this.create();
}
create() {
this.grouper = new Group({
id: this.model.code,
position: [this.model.point.x, this.model.point.y]
});
this.path = createPathSvg(this.model);
this.grouper.add(this.path);
if (this.model.rotate) {
this.grouper.rotation = -Math.PI / 180 * Number(this.model.rotate);
}
this.add(this.grouper);
}
setModel(dx, dy) {
this.model.point.x += dx;
this.model.point.y += dy;
}
}

View File

@ -0,0 +1,30 @@
import Group from 'zrender/src/container/Group';
import createPathSvg from '../components/pathsvg';
export default class airConditioner extends Group {
constructor(device) {
super();
this.model = device.model;
this.zlevel = device.model.zlevel;
this.z = device.model.z;
this._type = device.model._type;
this.code = device.model.code;
this.create();
}
create() {
this.grouper = new Group({
id: this.model.code,
position: [this.model.point.x, this.model.point.y]
});
this.path = createPathSvg(this.model);
this.grouper.add(this.path);
if (this.model.rotate) {
this.grouper.rotation = -Math.PI / 180 * Number(this.model.rotate);
}
this.add(this.grouper);
}
setModel(dx, dy) {
this.model.point.x += dx;
this.model.point.y += dy;
}
}

View File

@ -48,6 +48,9 @@ export default class frozenPump extends Group {
});
this.grouper.add(this.circleOutside);
this.grouper.add(this.triangle);
if (this.model.rotate) {
this.grouper.rotation = -Math.PI / 180 * Number(this.model.rotate);
}
this.add(this.grouper);
}
setModel(dx, dy) {

View File

@ -59,7 +59,15 @@ const map = {
SingleStaircase: {
width: 58,
path: 'M0,32V24H5V8H0V0H58V8H51V24h7v8H0Zm8-8h3V8H8V24ZM55,5V3H3V5H55ZM14,8V24h2V8H14Zm5,0V24h3V8H19Zm6,0V24h2V8H25Zm5,0V24h2V8H30Zm5,0V24h2V8H35Zm5,0V24h3V8H40Zm6,0V24h2V8H46Zm9,19H3v2H55V27Z'
}
},
BalancedElectric: {
width: 73,
path: 'M77,24V61L63,55V71H55V52L40.476,45.165,30,50V71H22V53L4,61V24L37,40.923V34.835C28.523,33.828,22,27.8,22,20.5,22,12.492,29.835,6,39.5,6S57,12.492,57,20.5c0,7.3-6.523,13.328-15,14.335v7.113ZM50.8,22H47l-4,3-4-3H30l3-5h5l4,2,3-1h5.534C48.973,14.409,43.6,10.881,38,11c-6.646.141-11,5.858-11,10s4.516,9.141,13,9C47.178,29.88,50.075,25.771,50.8,22Z'
},
ElectricButterflyValve: {
width: 39,
path: 'M38,24V44H1V24H18.237L18,21s-6.5.6-9-8C7.705,8.542,10.288,2,20,2S31.849,8.083,31,13c-1.586,9.183-9,8-9,8v3H38Zm-3,4.077L24,34a4.361,4.361,0,0,1-3,5c-3.052,1.215-7,0-7,0L9,41H35V28.077ZM25.872,17.466A6.259,6.259,0,0,0,29,12a18.6,18.6,0,0,0-1-4L25,5H16L12.511,7.279C10.464,8.908,11.044,14.092,11,10.9a10.963,10.963,0,0,0,2.23,5.284L14,7h2l3.181,6.95L23,7h2Zm-1.924.915L23.261,10.13,19.91,17H18l-2.341-5.907L15.1,17.8A8.481,8.481,0,0,0,20,19C17.855,19.073,20.85,19.478,23.948,18.38ZM4,27V39.556L12,36a6.888,6.888,0,0,1,3-7c4.261-2.736,8,1,8,1l6-3H4Z'
}
};
export default function createPathSvg(model) {

View File

@ -25,6 +25,7 @@ import SemiAutomaticTicketMachine from './semiAutomaticTicketMachine';
import TicketMachine from './ticketMachine';
import AirConditioner from './bas/airConditioner';
import VolumeControlDamper from './bas/volumeControlDamper';
import BalancedElectric from './bas/balancedElectric';
import IscsText from './text';
import IscsLine from './line';
import IscsRect from './rect';
@ -38,6 +39,7 @@ import IscsButton from './button';
import SmookExhaustFd from './bas/smookExhaustFd';
import StateTable from './stateTable';
import LightingGroup from './lighting';
import ElectricButterflyValve from './bas/electricButterflyValve';
const iscsShape = {};
iscsShape[deviceType.ManualAlarmButton] = ManualAlarmButton;
@ -80,6 +82,8 @@ iscsShape[deviceType.ArcStatus] = ArcStatus;
iscsShape[deviceType.IscsButton] = IscsButton;
iscsShape[deviceType.StateTable] = StateTable;
iscsShape[deviceType.LightingGroup] = LightingGroup;
iscsShape[deviceType.BalancedElectric] = BalancedElectric;
iscsShape[deviceType.ElectricButterflyValve] = ElectricButterflyValve;
function shapefactory(device, iscs) {
const type = device.model._type;

View File

@ -160,6 +160,12 @@ export function parser(data) {
zrUtil.each( data.lightingGroupList || [], elem=> {
iscsDevice[elem.code] = deviceFactory(deviceType.LightingGroup, elem);
});
zrUtil.each(data.balancedElectricList || [], elem => {
iscsDevice[elem.code] = deviceFactory(deviceType.BalancedElectric, elem);
});
zrUtil.each(data.electricButterflyValveList || [], elem => {
iscsDevice[elem.code] = deviceFactory(deviceType.ElectricButterflyValve, elem);
});
}
return iscsDevice;
@ -299,6 +305,12 @@ export function updateIscsData(state, device) {
case deviceType.LightingGroup:
updateIscsListByDevice(state, 'lightingGroupList', device);
break;
case deviceType.BalancedElectric:
updateIscsListByDevice(state, 'balancedElectricList', device);
break;
case deviceType.ElectricButterflyValve:
updateIscsListByDevice(state, 'electricButterflyValveList', device);
break;
}
// store.dispatch('iscs/setIscsData', state.iscs);
}

View File

@ -419,9 +419,7 @@ class Jlmap {
} else {
if (elem.deviceType === 'TRAIN') {
store.dispatch('map/updateTrainState', elem);
if (index >= list.length - 1) {
store.dispatch('map/setTrainListUpdate');
}
store.dispatch('map/setActiveTrainList', elem);
} else if (elem.deviceType === 'STAND') {
store.dispatch('map/updateStationStand', elem);
}

View File

@ -588,10 +588,15 @@ class Signal extends Group {
model.redOpen && !model.yellowOpen && !model.greenOpen && this.close(model.logicLight); // 信号关闭
model.greenOpen && !model.redOpen && !model.yellowOpen && this.openPositive(model.logicLight); // 信号正向开放
model.yellowOpen && !model.redOpen && !model.greenOpen && this.openLateral(model.logicLight); // 信号侧向开放
/** 进路交人工控或自动控 */
!model.atsControl && this.setArtificialRouteClose();
// 联锁自动进路通过
model.fleetMode && this.setAutoRouteOpen();
// 联锁自动触发
if (model.ciControl) {
this.setAutoTriggerOpen();
} else {
!model.atsControl && this.setArtificialRouteClose(); /** 进路交人工控或自动控 */
}
// 设置点灯类型 必须在最后设置不能放前面 logicLight 0 物理点灯 1 逻辑点灯
if (model.logicLight) {
this.logicalLight(); // 设置逻辑点灯

View File

@ -205,7 +205,8 @@ const map = {
updateCount: 0, // 绘图快捷修改标识
mousemove: 0, // 实训战场图移动标识
version: '', // 地图版本,
trainListUpdate:0, // 列车列表更新标识,
activeTrainList:{}, // 当前按计划行车的列车列表,
activeTrainListUpdate:0, // 当前按计划行车的列车列表更新标识
runPlanStatus:false, // 是否正处于按计划行车
showCentralizedStationCode: '', // 现地分集中站显示(集中站code)
showCentralizedStationNum: 0, // 现地分集中站显示判断
@ -719,8 +720,13 @@ const map = {
}
});
},
setTrainListUpdate:(state) => {
state.trainListUpdate++;
setActiveTrainList:(state, data) => {
state.activeTrainList[data.code] = data;
state.activeTrainListUpdate++;
},
resetActiveTrainList:(state, data) => {
state.activeTrainList = {};
state.activeTrainListUpdate = 0;
},
setDeleteCount: (state) => {
state.deleteCount++;
@ -973,8 +979,11 @@ const map = {
setDeleteCount: ({ commit }) => {
commit('setDeleteCount');
},
setTrainListUpdate: ({ commit }) => {
commit('setTrainListUpdate');
setActiveTrainList: ({ commit }, data) => {
commit('setActiveTrainList', data);
},
resetActiveTrainList: ({ commit }) => {
commit('resetActiveTrainList');
},
setUpdateCount: ({ commit }) => {
commit('setUpdateCount');

View File

@ -0,0 +1,134 @@
<template>
<div>
<el-form ref="form" :rules="rules" :model="form" label-width="100px">
<el-form-item v-if="isUpdate" label="编号" prop="code">
<el-input v-model="form.code" :disabled="true" />
</el-form-item>
<el-form-item label="图形宽度" prop="width">
<el-input-number v-model="form.width" :min="10" />
</el-form-item>
<el-form-item label="旋转角度" prop="rotate">
<el-input-number v-model="form.rotate" />
</el-form-item>
<el-form-item label="X轴坐标" prop="x">
<el-input-number v-model="form.x" controls-position="right" :min="1" />
</el-form-item>
<el-form-item label="Y轴坐标" prop="y">
<el-input-number v-model="form.y" controls-position="right" :min="1" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
<el-button v-show="showDeleteButton" type="danger" @click="deleteDevice">{{ $t('global.delete') }}</el-button>
<el-button v-show="showDeleteButton" @click="initPage">{{ $t('global.cancel') }}</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import {getUID} from '@/iscs/utils/Uid';
export default {
name:'AirConditioner',
data() {
return {
isUpdate:false,
showDeleteButton: false,
buttonText: '立即创建',
form:{
code:'',
width: 20,
rotate: 0,
x: 10,
y: 10
},
rules: {
code: [
{ required: true, message:'请生成设备图形的编码', trigger: 'blur' }
],
width:[
{ required: true, message:'请输入设备图形宽度', trigger: 'blur' }
],
x: [
{ required: true, message: '请输入设备图形的X轴坐标', trigger: 'blur' }
],
y: [
{ required: true, message: '请输入设备图形的Y轴坐标', trigger: 'blur' }
]
}
};
},
computed:{
...mapGetters('iscs', [
'iscs'
])
},
watch:{
'$store.state.iscs.rightClickCount': function (val) {
const model = this.$store.getters['iscs/updateDeviceData'];
if (model._type === 'BalancedElectric' ) {
this.buttonText = '修改';
this.showDeleteButton = true;
this.isUpdate = true;
this.form.code = model.code;
this.form.width = model.width;
this.form.rotate = model.rotate || 0;
this.form.x = model.point.x;
this.form.y = model.point.y;
}
}
},
mounted() {
},
methods:{
onSubmit(form) {
this.$refs[form].validate((valid) => {
if (valid) {
const model = {
point: {
x: this.form.x,
y: this.form.y
},
_type: 'BalancedElectric',
code: this.isUpdate ? this.form.code : getUID('BalancedElectric', this.iscs.balancedElectricList || []),
width: this.form.width,
rotate: this.form.rotate,
color:'#00ff00'
};
this.$emit('createDataModel', model);
this.initPage();
} else {
return false;
}
});
},
initPage() {
this.isUpdate = false;
this.buttonText = '立即创建';
this.showDeleteButton = false;
this.form = {
code:'',
width: 20,
x: 10,
y: 10
};
this.$refs.form.resetFields();
},
deleteDevice() {
const airConditionerModel = {
point: {
x: this.form.x,
y: this.form.y
},
_type: 'BalancedElectric',
code: this.form.code,
width: this.form.width,
color:'#00ff00'
};
this.$emit('deleteDataModel', airConditionerModel );
this.initPage();
}
}
};
</script>

View File

@ -0,0 +1,134 @@
<template>
<div>
<el-form ref="form" :rules="rules" :model="form" label-width="100px">
<el-form-item v-if="isUpdate" label="编号" prop="code">
<el-input v-model="form.code" :disabled="true" />
</el-form-item>
<el-form-item label="图形宽度" prop="width">
<el-input-number v-model="form.width" :min="10" />
</el-form-item>
<el-form-item label="旋转角度" prop="rotate">
<el-input-number v-model="form.rotate" />
</el-form-item>
<el-form-item label="X轴坐标" prop="x">
<el-input-number v-model="form.x" controls-position="right" :min="1" />
</el-form-item>
<el-form-item label="Y轴坐标" prop="y">
<el-input-number v-model="form.y" controls-position="right" :min="1" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
<el-button v-show="showDeleteButton" type="danger" @click="deleteDevice">{{ $t('global.delete') }}</el-button>
<el-button v-show="showDeleteButton" @click="initPage">{{ $t('global.cancel') }}</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import {getUID} from '@/iscs/utils/Uid';
export default {
name:'AirConditioner',
data() {
return {
isUpdate:false,
showDeleteButton: false,
buttonText: '立即创建',
form:{
code:'',
width: 20,
rotate: 0,
x: 10,
y: 10
},
rules: {
code: [
{ required: true, message:'请生成设备图形的编码', trigger: 'blur' }
],
width:[
{ required: true, message:'请输入设备图形宽度', trigger: 'blur' }
],
x: [
{ required: true, message: '请输入设备图形的X轴坐标', trigger: 'blur' }
],
y: [
{ required: true, message: '请输入设备图形的Y轴坐标', trigger: 'blur' }
]
}
};
},
computed:{
...mapGetters('iscs', [
'iscs'
])
},
watch:{
'$store.state.iscs.rightClickCount': function (val) {
const model = this.$store.getters['iscs/updateDeviceData'];
if (model._type === 'ElectricButterflyValve' ) {
this.buttonText = '修改';
this.showDeleteButton = true;
this.isUpdate = true;
this.form.code = model.code;
this.form.width = model.width;
this.form.rotate = model.rotate || 0;
this.form.x = model.point.x;
this.form.y = model.point.y;
}
}
},
mounted() {
},
methods:{
onSubmit(form) {
this.$refs[form].validate((valid) => {
if (valid) {
const model = {
point: {
x: this.form.x,
y: this.form.y
},
_type: 'ElectricButterflyValve',
code: this.isUpdate ? this.form.code : getUID('ElectricButterflyValve', this.iscs.electricButterflyValveList || []),
width: this.form.width,
rotate: this.form.rotate,
color:'#00ff00'
};
this.$emit('createDataModel', model);
this.initPage();
} else {
return false;
}
});
},
initPage() {
this.isUpdate = false;
this.buttonText = '立即创建';
this.showDeleteButton = false;
this.form = {
code:'',
width: 20,
x: 10,
y: 10
};
this.$refs.form.resetFields();
},
deleteDevice() {
const airConditionerModel = {
point: {
x: this.form.x,
y: this.form.y
},
_type: 'ElectricButterflyValve',
code: this.form.code,
width: this.form.width,
color:'#00ff00'
};
this.$emit('deleteDataModel', airConditionerModel );
this.initPage();
}
}
};
</script>

View File

@ -13,6 +13,9 @@
<el-form-item label="图形宽度" prop="width">
<el-input-number v-model="form.width" :min="10" />
</el-form-item>
<el-form-item label="旋转角度" prop="rotate">
<el-input-number v-model="form.rotate" />
</el-form-item>
<el-form-item label="X轴坐标" prop="x">
<el-input-number v-model="form.x" controls-position="right" :min="1" />
</el-form-item>
@ -41,6 +44,7 @@ export default {
code:'',
type:'',
width: 25,
rotate: 0,
x: 10,
y: 10
},
@ -77,7 +81,8 @@ export default {
this.isUpdate = true;
this.form.code = model.code;
this.form.width = model.width;
this.form.pumpType = model.pumpType;
this.form.type = model.pumpType;
this.form.rotate = model.rotate || 0;
this.form.x = model.point.x;
this.form.y = model.point.y;
}
@ -99,7 +104,8 @@ export default {
code: this.isUpdate ? this.form.code : getUID('FrozenPump', this.iscs.frozenPumpList),
width: this.form.width,
color:'#00ff00',
pumpType:this.form.type
rotate: this.form.rotate,
pumpType: this.form.type
};
this.$emit('createFrozenPump', frozenPumpModel);
this.initPage();

View File

@ -107,6 +107,23 @@
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
<el-tab-pane label="平衡电动阀" name="BalancedElectric">
<balanced-electric
ref="balancedElectric"
style="width: 90%"
@createDataModel="createDataModel"
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
<el-tab-pane label="电动蝶阀" name="ElectricButterflyValve">
<electric-butterfly-valve
ref="electricButterflyValve"
style="width: 90%"
@createDataModel="createDataModel"
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
<el-tab-pane label="照明组" name="LightingGroup">
<lighting-group
ref="lightingGroup"
@ -171,6 +188,8 @@ import IscsText from '../iscsCommonElem/text';
import IscsRect from '../iscsCommonElem/rect';
import SmookExhaustFd from './smookExhaustFd';
import LightingGroup from './lightingGroup';
import BalancedElectric from './balancedElectric';
import ElectricButterflyValve from './electricButterflyValve';
export default {
name: 'IscsOperate',
@ -191,7 +210,9 @@ export default {
IscsText,
IscsRect,
IscsLine,
LightingGroup
LightingGroup,
BalancedElectric,
ElectricButterflyValve
},
mixins: [
],

View File

@ -145,7 +145,7 @@ export default {
y: this.selected.point.y + 10
};
const type1 = this.selected._type.charAt(0).toLowerCase() + this.selected._type.slice(1); // .toLowerCase()
this.copyModel.code = getUID(this.selected._type, this.iscs[type1 + 'List']);
this.copyModel.code = getUID(this.selected._type, this.iscs[type1 + 'List'] || []);
} break;
case 'Ctrl_V':
this.copyModel.code && this.createDataModel(this.copyModel);

View File

@ -69,30 +69,25 @@ export default {
}
},
watch:{
'$store.state.map.trainListUpdate': function (val) {
'$store.state.map.activeTrainListUpdate': function (val) {
const trainList = Object.values(this.$store.state.map.activeTrainList);
if (this.lineCode == '10' || this.lineCode == '11') {
this.topTrainList = this.$store.state.map.map.trainList.filter((train)=>{
return train.serviceNumber != '' && train.serviceNumber != undefined && !train.right;
this.topTrainList = trainList.filter((train)=>{
return train.serviceNumber != '' && train.serviceNumber != undefined && !train.right && train.sectionCode;
});
this.bottomTrainList = this.$store.state.map.map.trainList.filter((train)=>{
return train.serviceNumber != '' && train.serviceNumber != undefined && train.right;
this.bottomTrainList = trainList.filter((train)=>{
return train.serviceNumber != '' && train.serviceNumber != undefined && train.right && train.sectionCode;
});
} else {
this.trainList = this.$store.state.map.map.trainList.filter((train)=>{
return train.serviceNumber != '' && train.serviceNumber != undefined;
this.trainList = trainList.filter((train)=>{
return train.serviceNumber != '' && train.serviceNumber != undefined && train.sectionCode;
});
}
},
'$store.state.map.runPlanStatus': function (val) {
if (!val) {
if (this.lineCode == '10' || this.lineCode == '11') {
this.topTrainList = [];
this.bottomTrainList = [];
} else {
this.trainList = [];
}
this.$store.dispatch('map/resetActiveTrainList');
}
}
},

View File

@ -4,7 +4,7 @@
<div v-show="!minimize" class="chat-box">
<chat-member-list ref="chatMemberList" :group="group" :current-coversition="currentCoversition" />
<div class="chat-box-main">
<chat-coversition-list ref="chatCoversitionList" :group="group" @showAddCoverition="showAddCoverition" @hideAddCoversition="hideAddCoversition" @setCurrentCoversition="setCurrentCoversition" @setHeadTitle="setHeadTitle" />
<chat-coversition-list ref="chatCoversitionList" :group="group" :user-role="userRole" @showAddCoverition="showAddCoverition" @hideAddCoversition="hideAddCoversition" @setCurrentCoversition="setCurrentCoversition" @setHeadTitle="setHeadTitle" />
<div class="chat-window">
<div class="chat-box-header">
<div class="chat-box-header-title">{{ headerTitle }}</div>
@ -30,7 +30,7 @@
</div>
<div class="chat-box-footer">
<div class="chat-box-footer-tool" />
<div class="chat-box-footer-send" @click="startRecording()">发送语音</div>
<div v-if="currentCoversition.all||isButtonShow" class="chat-box-footer-send" @click="startRecording()">发送语音</div>
</div>
</div>
</div>
@ -95,6 +95,9 @@ export default {
computed:{
isShow() {
return this.userRole != 'ADMIN' && this.userRole != 'AUDIENCE' && !this.isHasCoversition;
},
isButtonShow() {
return this.userRole != 'ADMIN' && this.userRole != 'AUDIENCE' && this.isHasCoversition;
}
},
mounted() {
@ -118,8 +121,12 @@ export default {
this.$refs.chatCoversitionList.initPage(false);
},
setCurrentCoversition(coversition) {
this.currentCoversition = coversition;
this.headerTitle = coversition.name;
if (coversition) {
this.currentCoversition = coversition;
this.headerTitle = coversition.name;
} else {
this.headerTitle = '';
}
if (this.recordSending) {
this.cancleRecording();
}

View File

@ -94,20 +94,22 @@ export default {
},
methods:{
inintData() {
getSimulationContextListNew(this.$route.query.group, this.coversition.id).then(res=>{
const userId = this.$store.state.user.id;
const coversitionList = res.data.map(coversition=>{
coversition.self = false;
if (coversition.member.userId == userId) {
coversition.self = true;
}
coversition.src = coversition.isAudio ? `/jlcloud/audio/${coversition.audioPath}` : '';
coversition.targetUser = coversition.targetMember ? coversition.targetMember : 'All';
return coversition;
if (this.coversition) {
getSimulationContextListNew(this.$route.query.group, this.coversition.id).then(res=>{
const userId = this.$store.state.user.id;
const coversitionList = res.data.map(coversition=>{
coversition.self = false;
if (coversition.member.userId == userId) {
coversition.self = true;
}
coversition.src = coversition.isAudio ? `/audio/${coversition.audioPath}` : '';
coversition.targetUser = coversition.targetMember ? coversition.targetMember : 'All';
return coversition;
});
this.chatContentList = coversitionList;
this.scrollTop();
});
this.chatContentList = coversitionList;
this.scrollTop();
});
}
// const coversitionListAll = Object.assign({}, this.$store.state.socket.coversitionList);
// const coversitionList = coversitionListAll[this.coversition.id] || [];
// // console.log('inintData---coversitionList' + JSON.stringify(this.$store.state.socket.coversitionList[this.coversition.id]));

View File

@ -9,7 +9,7 @@
@click="changeCoversition(coversition)"
>
<div class="coversitionName">{{ coversition.name }}</div>
<div v-if="!coversition.all" class="el-icon-close closeConversition" @click="closeCoversition(coversition.id)" />
<!-- <div v-if="!coversition.all" class="el-icon-close closeConversition" @click="closeCoversition(coversition.id)" /> -->
</div>
</div>
</div>
@ -22,6 +22,10 @@ export default {
group: {
type: String,
required: true
},
userRole: {
type: String,
required: true
}
},
data() {
@ -30,21 +34,40 @@ export default {
currentCoversition:{}
};
},
watch:{
'userRole':function(val) {
this.initPage(true);
}
},
mounted() {
this.initPage(true);
// this.initPage(true);
},
methods:{
initPage(status) {
getSimulationConversationListNew(this.$route.query.group).then(resp=>{
if (resp.data) {
const data = resp.data;
this.coversitionList = data;
if (resp.data.length >= 2) {
this.$emit('hideAddCoversition');
if (this.userRole == 'ADMIN' || this.userRole == 'AUDIENCE') {
this.coversitionList = data;
} else {
this.coversitionList = data.filter(coversition=>{ return coversition.all == false; });
if (this.coversitionList.length >= 1) {
this.$emit('hideAddCoversition');
}
}
if (resp.data && resp.data.length && resp.data.length > 0 && status) {
this.currentCoversition = data[0];
this.$emit('setCurrentCoversition', resp.data[0]);
if (this.userRole == 'ADMIN' || this.userRole == 'AUDIENCE') {
this.currentCoversition = data[0];
this.$emit('setCurrentCoversition', resp.data[0]);
} else {
if (this.coversitionList.length >= 1) {
this.currentCoversition = data[0];
this.$emit('setCurrentCoversition', resp.data[0]);
} else {
this.currentCoversition = null;
this.$emit('setCurrentCoversition', this.currentCoversition);
}
}
} else if (resp.data && resp.data.length && resp.data.length > 0 && !status) {
const coversition = data.filter(coversition=>{ return coversition.all == false; });
this.currentCoversition = coversition[0];

View File

@ -59,27 +59,29 @@ export default {
methods:{
getSimulationMembers() {
this.memberList = [];
getSimulationChatMemberNew(this.$route.query.group, this.currentCoversition.id).then(resp => {
let lastData = JSON.stringify(resp.data);
const roleTypeList = ConstConfig.ConstSelect.roleTypeNew;
roleTypeList.forEach(function(element) {
const rolename = element.value;
if (Cookies.get('user_lang') == 'en') {
lastData = lastData.replace(new RegExp(rolename, 'g'), element.enLabel);
} else {
lastData = lastData.replace(new RegExp(rolename, 'g'), element.label);
}
if (this.currentCoversition) {
getSimulationChatMemberNew(this.$route.query.group, this.currentCoversition.id).then(resp => {
let lastData = JSON.stringify(resp.data);
const roleTypeList = ConstConfig.ConstSelect.roleTypeNew;
roleTypeList.forEach(function(element) {
const rolename = element.value;
if (Cookies.get('user_lang') == 'en') {
lastData = lastData.replace(new RegExp(rolename, 'g'), element.enLabel);
} else {
lastData = lastData.replace(new RegExp(rolename, 'g'), element.label);
}
});
lastData = JSON.parse(lastData);
lastData = lastData.filter(memberIn=>{ return memberIn.role != '观众'; });
lastData.map(member=>{
const deviceName = member.deviceName ? '-' + member.deviceName : '';
const memberName = member.name ? '-' + member.name : '';
member.memberName = member.role + deviceName + memberName;
return member;
});
this.memberList = lastData;
});
lastData = JSON.parse(lastData);
lastData = lastData.filter(memberIn=>{ return memberIn.role != '观众'; });
lastData.map(member=>{
const deviceName = member.deviceName ? '-' + member.deviceName : '';
const memberName = member.name ? '-' + member.name : '';
member.memberName = member.role + deviceName + memberName;
return member;
});
this.memberList = lastData;
});
}
}
}
};

View File

@ -69,30 +69,25 @@ export default {
}
},
watch:{
'$store.state.map.trainListUpdate': function (val) {
'$store.state.map.activeTrainListUpdate': function (val) {
const trainList = Object.values(this.$store.state.map.activeTrainList);
if (this.lineCode == '10' || this.lineCode == '11') {
this.topTrainList = this.$store.state.map.map.trainList.filter((train)=>{
return train.serviceNumber != '' && train.serviceNumber != undefined && !train.right;
this.topTrainList = trainList.filter((train)=>{
return train.serviceNumber != '' && train.serviceNumber != undefined && !train.right && train.sectionCode;
});
this.bottomTrainList = this.$store.state.map.map.trainList.filter((train)=>{
return train.serviceNumber != '' && train.serviceNumber != undefined && train.right;
this.bottomTrainList = trainList.filter((train)=>{
return train.serviceNumber != '' && train.serviceNumber != undefined && train.right && train.sectionCode;
});
} else {
this.trainList = this.$store.state.map.map.trainList.filter((train)=>{
return train.serviceNumber != '' && train.serviceNumber != undefined;
this.trainList = trainList.filter((train)=>{
return train.serviceNumber != '' && train.serviceNumber != undefined && train.sectionCode;
});
}
},
'$store.state.map.runPlanStatus': function (val) {
if (!val) {
if (this.lineCode == '10' || this.lineCode == '11') {
this.topTrainList = [];
this.bottomTrainList = [];
} else {
this.trainList = [];
}
this.$store.dispatch('map/resetActiveTrainList');
}
}
},
@ -114,11 +109,13 @@ export default {
this.$emit('setCenter', code);
},
covert(data) {
let min = (Math.abs(data) - Math.abs(data) % 60) / 60;
let seconds = Math.abs(data) % 60;
const hours = Math.floor(data / 3600);
let min = Math.floor((data % 3600) / 60);
let seconds = (data % 3600) % 60;
min = min > 9 ? min : '0' + min;
seconds = seconds > 9 ? seconds : '0' + seconds;
return data == 0 ? '00:00' : (data > 0 ? min + ':' + seconds + 'E' : min + ':' + seconds + 'L');
const time = hours + ':' + min + ':' + seconds;
return data == 0 ? '00:00:00' : (data > 0 ? time + 'E' : time + 'L');
}
}
};

View File

@ -27,9 +27,9 @@ export default {
expression:''
},
expressionList:[
{label:'等于',value:'eq'},
{label:'不等于', value:'neq'},
]
{label:'等于', value:'eq'},
{label:'不等于', value:'neq'}
]
};
},
computed: {
@ -38,7 +38,7 @@ export default {
labelWidth: '100px',
items: [
{ prop: 'name', label: '参数名', type: 'text' },
{ prop: 'expression', label:'操作符', type: 'select',options:this.expressionList},
{ prop: 'expression', label:'操作符', type: 'select', options:this.expressionList},
{ prop: 'value', label: '参数值', type: 'text' }
]
};
@ -90,7 +90,7 @@ export default {
return {
name: this.formModel.name,
value: this.formModel.value,
expression:this.formModel.expression,
expression:this.formModel.expression
};
},
create() {