This commit is contained in:
joylink_cuiweidong 2021-06-21 13:24:56 +08:00
commit 1879398d92
13 changed files with 297 additions and 149 deletions

View File

@ -29,10 +29,10 @@ export function sendSimulationCommand(group, memberId, type, data) {
});
}
/** 获取仿真成员列表 */
export function getMemberListCommon(group,role) {
export function getMemberListCommon(group, role) {
if(!role){
role = "";
if (!role) {
role = '';
}
return request({
url: `/common/simulation/${group}/members?role=${role}`,
@ -96,3 +96,18 @@ export function simulationStart(group) {
method: 'put'
});
}
/** 获取存在的仿真列表 */
export function getExistSimulationList(params) {
return request({
url: `/common/simulation/list`,
method: 'get',
params
});
}
/** 获取仿真用户信息 */
export function getSimulationUserInfo(id) {
return request({
url: `/common/simulation/${id}/users`,
method: 'get'
});
}

View File

@ -163,22 +163,22 @@ export function cancelReplaceBg(group) {
});
}
/** 分页查询存在的仿真 */
export function getExistingSimulation(params) {
return request({
url: `/manage/simulation/exists`,
method: 'get',
params
});
}
/** 删除存在的仿真 */
export function deleteExistingSimulation(group) {
return request({
url: `/manage/simulation/${group}`,
method: 'delete'
});
}
// /** 分页查询存在的仿真 */
// export function getExistingSimulation(params) {
// return request({
// url: `/manage/simulation/exists`,
// method: 'get',
// params
// });
// }
//
// /** 删除存在的仿真 */
// export function deleteExistingSimulation(group) {
// return request({
// url: `/manage/simulation/${group}`,
// method: 'delete'
// });
// }
/** 获取任务录制的所有动作(新版)*/
export function getScriptAllAction(group) {

View File

@ -377,8 +377,10 @@ export default {
query(queryData) {
this.queryData = queryData;
// this.pageIndex = 1;
this.queryData[this.currentpagerConfig.pageSize] = this.pageSize;
this.queryData[this.currentpagerConfig.pageIndex] = this.pageIndex;
if (!this.queryList.paginationHiden) {
this.queryData[this.currentpagerConfig.pageSize] = this.pageSize;
this.queryData[this.currentpagerConfig.pageIndex] = this.pageIndex;
}
// this.queryList.reload();
this.choose = null;
this.commitQuery();
@ -512,6 +514,7 @@ export default {
self.enableQuery();
return;
}
delete this.queryData.undefined;
if (this.queryList.query instanceof Function) {
this.queryList.query(this.queryData).then(response => {
self.enableQuery();
@ -519,7 +522,7 @@ export default {
this.queryList.afterQuery(response.data);
}
const resultData = response.data;
this.$set(this.queryList, 'data', resultData.list);
this.$set(this.queryList, 'data', this.queryList.paginationHiden ? resultData : resultData.list);
this.$set(this.queryList, 'total', resultData.total);
if (resultData.pageNum) {
this.pageIndex = resultData.pageNum;

View File

@ -49,11 +49,13 @@ export default class alarm extends Group {
setStatus(state) {
// domid还是写在了alarm里面 待优化
const audioDom = document.querySelector('#buzzer');
if (state && state.on) {
audioDom.play().catch(e=>{throw e})
} else if (state && !state.on) {
audioDom.pause()
const audioDom = document.querySelector(`#buzzer_${this.model.code}`);
if (audioDom) {
if (state && state.on) {
audioDom.play().catch(e=>{throw e})
} else if (state && !state.on) {
audioDom.pause()
}
}
}
}

View File

@ -30,7 +30,8 @@ export const MapDeviceType = {
export const deviceFaultType = {
Section: [
{label: '计轴故障', value: 'FAULT'},
{label: '通信车占用', value: 'CBTC_OCCUPIED_FAULT'}
{label: '通信车占用', value: 'CBTC_OCCUPIED_FAULT'},
{label: 'ARB', value: 'ARB'}
// {label: '计轴干扰', value: 'DISTURBANCE'}
],
Signal: [
@ -68,7 +69,8 @@ export const deviceFaultType = {
export const deviceFaultMap = {
Section: {
FAULT: '计轴故障',
CBTC_OCCUPIED_FAULT: '通信车占用'
CBTC_OCCUPIED_FAULT: '通信车占用',
ARB: 'ARB'
},
Signal: {
MAIN_FILAMENT_BROKEN: '熔断'

View File

@ -891,15 +891,16 @@ const map = {
updateStationStand: (state, status) => {
const holdIndex = state.holdStandList.indexOf(status.code);
const jumpIndex = state.jumpStandList.indexOf(status.code);
if ((status.stationHoldTrain || status.centerHoldTrain) && holdIndex < 0) {
state.holdStandList.push(status.code);
} else if (!(status.stationHoldTrain && status.centerHoldTrain) && holdIndex > -1) {
const device = state.mapDevice[status.code];
if ((device.stationHoldTrain || device.centerHoldTrain) && holdIndex < 0) {
state.holdStandList.push(device.code);
} else if (!(device.stationHoldTrain || device.centerHoldTrain) && holdIndex > -1) {
state.holdStandList.splice(holdIndex, 1);
}
state.holdStatus = state.holdStandList.length > 0;
if ((status.assignSkip || status.allSkip) && jumpIndex < 0) {
state.jumpStandList.push(status.code);
} else if (!(status.assignSkip && status.allSkip) && jumpIndex > -1) {
if ((device.assignSkip || device.allSkip) && jumpIndex < 0) {
state.jumpStandList.push(device.code);
} else if (!(device.assignSkip || device.allSkip) && jumpIndex > -1) {
state.jumpStandList.splice(jumpIndex, 1);
}
state.jumpStatus = state.jumpStandList.length > 0;

View File

@ -71,17 +71,20 @@ export default {
const point = {};
point.x = e.clientX;
point.y = e.clientY;
const stationList = [];
if (this.$store.state.map.holdStandList.length) {
this.menu = [];
this.$store.state.map.holdStandList.forEach(item => {
const stand = this.$store.getters['map/getDeviceByCode'](item);
const station = this.$store.getters['map/getDeviceByCode'](stand.stationCode);
this.menu.push({
label: station.name,
code: station.code,
handler: this.setCenter
});
if (stationList.indexOf(station.code) === -1) {
stationList.push(station.code);
this.menu.push({
label: station.name,
code: station.code,
handler: this.setCenter
});
}
});
if (this.$refs && this.$refs.popMenu) {
this.$refs.popMenu.resetShowPosition(point);
@ -94,14 +97,18 @@ export default {
point.y = e.clientY;
if (this.$store.state.map.jumpStandList.length) {
this.menu = [];
const stationList = [];
this.$store.state.map.jumpStandList.forEach(item => {
const stand = this.$store.getters['map/getDeviceByCode'](item);
const station = this.$store.getters['map/getDeviceByCode'](stand.stationCode);
this.menu.push({
label: station.name,
code: station.code,
handler: this.setCenter
});
if (stationList.indexOf(station.code) === -1) {
stationList.push(station.code);
this.menu.push({
label: station.name,
code: station.code,
handler: this.setCenter
});
}
});
if (this.$refs && this.$refs.popMenu) {
this.$refs.popMenu.resetShowPosition(point);

View File

@ -15,6 +15,16 @@
<el-form-item :label="this.$t('ibp.yCoordinate')">
<el-input-number v-model="form.y" controls-position="right" :min="1" />
</el-form-item>
<el-form-item label="方向">
<el-select v-model="form.direction" placeholder="请选择">
<el-option
v-for="(item, i) in directions"
:key="i"
:label="item.name"
:value="item.value"
></el-option>
</el-select>
</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>
@ -38,7 +48,8 @@ export default {
code: '',
alarmWidth: '',
x: 10,
y: 10
y: 10,
direction: null,
},
rules: {
code: [
@ -47,7 +58,12 @@ export default {
alarmWidth: [
{ required: true, message: this.$t('rules.enterTheAlarmWidth'), trigger: 'blur' }
]
}
},
directions: [
{ name: '全部', value: null},
{ name: '上行', value: true},
{ name: '下行', value: false},
],
};
},
computed: {
@ -64,6 +80,7 @@ export default {
this.form.alarmWidth = model.width;
this.form.x = model.point.x;
this.form.y = model.point.y;
this.form.direction = model.direction
}
}
},
@ -80,7 +97,8 @@ export default {
},
code: this.form.code,
_type: 'Alarm',
width: this.form.alarmWidth
width: this.form.alarmWidth,
direction: this.form.direction
};
this.$emit('createData', alarmModel);
this.initPage();
@ -97,7 +115,8 @@ export default {
},
code: this.form.code,
_type: 'Alarm',
width: this.form.alarmWidth
width: this.form.alarmWidth,
direction: this.form.direction
};
this.$emit('deleteDataModel', alarmModel );
this.initPage();
@ -110,7 +129,8 @@ export default {
code: '',
alarmWidth: '',
x: 10,
y: 10
y: 10,
direction: null
};
},
generateCode() {

View File

@ -44,6 +44,16 @@
/>
</el-select>
</el-form-item>
<el-form-item v-if="needDirectionItem" label="方向">
<el-select v-model="form.direction" placeholder="请选择">
<el-option
v-for="(item, i) in directions"
:key="i"
:label="item.name"
:value="item.value"
></el-option>
</el-select>
</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>
@ -65,19 +75,17 @@ export default {
buttonText: this.$t('ibp.createNow'),
showDeleteButton: false,
operateMeanList: [
{ label: '上行扣车', value: 'SXKC' },
{ label: '下行扣车', value: 'XXKC' },
{ label: '上行终止扣车', value: 'SXZZKC' },
{ label: '下行终止扣车', value: 'XXZZKC' },
{ label: '扣车', value: 'KC' },
{ label: '终止扣车', value: 'ZZKC' },
{ label: '紧急停车', value: 'JJTC' },
{ label: '取消紧急停车', value: 'QXJJTC' },
{ label: '报警切除', value: 'BJQC' },
{ label: '下行屏蔽门开门', value: 'XXKM' },
{ label: '上行屏蔽门开门', value: 'SXKM' },
{ label: '屏蔽门开门', value: 'KM' },
{ label: '计轴复位', value: 'AXLE_RESET' },
{ label: '计轴预复位', value: 'AXLE_PRE_RESET' },
{ label: '计轴预复零', value: 'PRERESET_Z' },
],
operateWithoutDirections: ['AXLE_RESET', 'AXLE_PRE_RESET', 'PRERESET_Z'],
form: {
code: '',
buttonColor: 'red',
@ -85,7 +93,8 @@ export default {
x: 10,
y: 10,
sectionCode: '',
mean: ''
mean: '',
direction: null,
},
rules: {
code: [
@ -99,13 +108,20 @@ export default {
],
sectionCode: [
{ required: true, message: '请选择关联区段', trigger: 'blur' }
]
],
},
sectionList: []
sectionList: [],
directions: [
{ name: '全部', value: null},
{ name: '上行', value: true},
{ name: '下行', value: false},
],
};
},
computed: {
needDirectionItem() {
return !this.operateWithoutDirections.includes(this.form.mean);
}
},
watch: {
'$store.state.ibp.rightClickCount': function (val) {
@ -121,6 +137,7 @@ export default {
this.form.y = model.point.y;
this.form.mean = model.mean;
this.form.sectionCode = model.sectionCode;
this.form.direction = model.direction;
}
}
},
@ -128,7 +145,7 @@ export default {
if (this.$route.query.stationCode) {
getSectionListByCenStationCode(this.$route.query.mapId, this.$route.query.stationCode).then(resp => {
this.sectionList = resp.data;
console.log(resp.data);
// console.log(resp.data);
}).catch(() => {
this.$message.error('获取区段列表失败!');
});
@ -142,9 +159,6 @@ export default {
}
},
methods: {
// consoleChange() {
// console.log(this.form.mean === 'PRERESET', this.form.mean );
// },
onSubmit(form) {
this.$refs[form].validate((valid) => {
if (valid) {
@ -159,7 +173,8 @@ export default {
status: 'off',
width: this.form.buttonWidth,
mean: this.form.mean,
sectionCode: this.form.sectionCode
sectionCode: this.form.sectionCode,
direction: this.form.direction,
};
this.$emit('createData', buttonModel);
this.initPage();
@ -180,7 +195,8 @@ export default {
status: 'off',
width: this.form.buttonWidth,
mean: this.form.mean,
sectionCode: this.form.sectionCode
sectionCode: this.form.sectionCode,
direction: this.form.direction,
};
this.$emit('deleteDataModel', buttonModel );
this.initPage();
@ -196,7 +212,8 @@ export default {
x: 10,
y: 10,
mean: '',
sectionCode: ''
sectionCode: '',
direction: null,
};
},
generateCode() {

View File

@ -25,6 +25,16 @@
/>
</el-select>
</el-form-item>
<el-form-item label="方向">
<el-select v-model="form.direction" placeholder="请选择">
<el-option
v-for="(item, i) in directions"
:key="i"
:label="item.name"
:value="item.value"
></el-option>
</el-select>
</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>
@ -45,20 +55,18 @@ export default {
buttonText: this.$t('ibp.createNow'),
showDeleteButton: false,
showMeanList: [
{label: '下行扣车', value: 'xxkcLight'},
{label: '上行扣车', value: 'sxkcLight'},
{label: '下行关门灯', value: 'xxgmLight'},
{label: '下行开门灯', value: 'xxkmLight'},
{label: '上行关门灯', value: 'sxgmLight'},
{label: '上行开门灯', value: 'sxkmLight'},
{label: '紧急停车灯', value: 'jjtcLight'}
{label: '扣车灯', value: 'kcLight'},
{label: '关门灯', value: 'gmLight'},
{label: '开门灯', value: 'kmLight'},
{label: '紧急停车灯', value: 'jjtcLight'},
],
form: {
code: '',
r: '',
x: 10,
y: 10,
mean: ''
mean: '',
direction: null
},
rules: {
code: [
@ -67,7 +75,12 @@ export default {
r: [
{ required: true, message: '请输入圆形灯半径', trigger: 'blur'}
]
}
},
directions: [
{ name: '全部', value: null},
{ name: '上行', value: true},
{ name: '下行', value: false},
],
};
},
computed: {
@ -85,6 +98,7 @@ export default {
this.form.x = model.point.x;
this.form.y = model.point.y;
this.form.mean = model.mean;
this.form.direction = model.direction
}
}
},
@ -103,6 +117,7 @@ export default {
code: this.form.code,
r: this.form.r,
mean: this.form.mean,
direction: this.form.direction,
fillColor: '#332C22'
};
this.$emit('createData', lampModel);
@ -123,6 +138,7 @@ export default {
code: this.form.code,
r: this.form.r,
mean: this.form.mean,
direction: this.form.direction,
fillColor: '#332C22'
};
this.$emit('deleteDataModel', lampModel );
@ -137,7 +153,8 @@ export default {
r: '',
x: 10,
y: 10,
mean: ''
mean: '',
direction: null
};
},
generateCode() {

View File

@ -7,9 +7,11 @@
<el-button v-if="$route.query.noPreLogout" type="primary" @click="quit">退出</el-button>
</el-button-group>
<audio id="buzzer" controls loop="loop">
<template v-for="alarm in alarmList" >
<audio :key="alarm.code" :id="`buzzer_${alarm.code}`" controls loop="loop">
<source :src="buzzerAudio" type="audio/mpeg">
</audio>
</audio>
</template>
</div>
</template>
@ -64,7 +66,8 @@ export default {
stationCode: '',
banUpOpenScreenDoor: false,
banDownOpenScreenDoor: false,
buzzerAudio:BuzzerAudio
buzzerAudio:BuzzerAudio,
alarmList: []
};
},
computed: {
@ -193,7 +196,8 @@ export default {
this.setIbp(data, ibpDatas);
this.$store.dispatch('ibp/setIbpData', ibpDatas);
this.handleBanOpenScreenDoorStatus();
this.preResetBtn = this.$ibp.$painter.ibpInstanceLevel.SquareButton.children().find(e=>e.model.mean === IbpOperation.PRERESET_Z.event);
this.preResetBtn = this.$ibp.$painter.ibpInstanceLevel.SquareButton.children().find(e=>e.model.mean === IbpOperation.PRERESET_Z.event); //
this.alarmList = this.$ibp.$painter.ibpInstanceLevel.Alarm.children().map(e=>e.model);
} else {
//
this.loading = false;

View File

@ -1,15 +1,19 @@
<template>
<div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<QueryListPage ref="queryListPage" :query-form="queryForm" :query-list="queryList" />
<view-member ref="viewMember" />
</div>
</template>
<script>
import ConstConfig from '@/scripts/ConstConfig';
import Cookies from 'js-cookie';
import { getExistingSimulation, deleteExistingSimulation } from '@/api/simulation';
import ViewMember from './viewMember';
// import { getExistingSimulation, deleteExistingSimulation } from '@/api/simulation';
import { getExistSimulationList, destroySimulation } from '@/api/rtSimulation';
export default {
name: 'SimulationManage',
components: {
ViewMember
},
data() {
return {
@ -44,66 +48,53 @@ export default {
},
simulationTypeList: [{label: '仿真', value: 'SIMULATION'}, {label: '课程', value: 'LESSON'}, {label: '考试', value: 'EXAM'}, {label: '剧本编制', value: 'SCRIPT_MAKING'}],
queryList: {
query: getExistingSimulation,
query: getExistSimulationList,
selectCheckShow: false,
paginationHiden: true,
indexShow: true,
columns: [
// {
// title: this.$t('system.userName'),
// prop: 'creator.name'
// },
{
title: this.$t('system.userName'),
prop: 'creator.name'
title: '仿真ID',
prop: 'id'
},
{
title: '仿真状态',
prop: 'state',
type: 'tag',
columnValue: (row) => {
if (row.state === 1) { return '仿真开始'; } else if (row.state === 0) { return '仿真暂停'; } else if (row.state === 4) { return '仿真错误'; } else { return '未知状态'; }
},
tagType: (row) => {
return 'success';
}
},
{
title: '仿真倍速',
prop: 'speed'
},
// {
// title: '',
// prop: 'type',
// type: 'tag',
// columnValue: (row) => { return this.$convertField(row.type, this.simulationTypeList, ['value', 'label']); },
// tagType: (row) => { return ''; }
//
// },
{
title: this.$t('system.mapName'),
prop: 'map.name'
},
{
title: 'Group',
prop: 'group'
},
{
title: this.$t('system.isError'),
prop: 'error',
prop: 'map.name',
type: 'tag',
columnValue: (row) => { return this.$ConstSelect.translate(row.error, 'Whether'); },
columnValue: (row) => {
return `${row.map.name}( ${row.map.id}- ${row.map.version})`;
},
tagType: (row) => {
switch (row.error) {
case true: return 'success';
case false: return 'danger';
}
return 'success';
}
},
{
title: this.$t('system.isSuspend'),
prop: 'pause',
type: 'tag',
columnValue: (row) => { return this.$ConstSelect.translate(row.pause, 'Whether'); },
tagType: (row) => {
switch (row.pause) {
case true: return 'success';
case false: return 'danger';
}
}
},
{
title: this.$t('system.isDrivingAsplanned'),
prop: 'planRunning',
type: 'tag',
columnValue: (row) => { return this.$ConstSelect.translate(row.planRunning, 'Whether'); },
tagType: (row) => {
switch (row.runAsPlan) {
case true: return 'success';
case false: return 'danger';
}
}
},
{
title: '类型',
prop: 'type',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.type, this.simulationTypeList, ['value', 'label']); },
tagType: (row) => { return ''; }
},
{
title: this.$t('system.prdType'),
prop: 'prodType',
@ -112,16 +103,21 @@ export default {
tagType: (row) => { return ''; }
},
{
title: this.$t('system.simulationGroupId'),
prop: 'onlineUserIdList',
type: 'basicText',
columnValue: (row) => { return this.listJoiningTogether(row.onlineUserIdList); }
},
// {
// title: this.$t('system.simulationGroupId'),
// prop: 'userList',
// type: 'basicText',
// columnValue: (row) => { return this.listJoiningTogether(row.userList); }
// },
{
type: 'button',
title: this.$t('global.operate'),
buttons: [
{
name: '仿真用户信息',
handleClick: this.viewMember,
type: ''
},
{
name: this.$t('system.destory'),
handleClick: this.handleDelete,
@ -146,15 +142,18 @@ export default {
this.queryForm.queryObject.prdType.config.data = this.prdTypeList;
},
methods: {
listJoiningTogether(sessionList) {
let sessionId = '';
if (sessionList && sessionList.length > 0) {
sessionList.forEach((item) => {
sessionId = sessionId + item + ',';
});
sessionId = sessionId.substring(0, sessionId.length - 1);
}
return sessionId;
// listJoiningTogether(sessionList) {
// let sessionId = '';
// if (sessionList && sessionList.length > 0) {
// sessionList.forEach((item) => {
// sessionId = sessionId + item.name + '(' + item.id + ')' + ',';
// });
// sessionId = sessionId.substring(0, sessionId.length - 1);
// }
// return sessionId;
// },
viewMember(index, row) {
this.$refs.viewMember.doShow(row.id);
},
handleDelete(index, row) {
this.$confirm(this.$t('system.wellDelUserSimulation'), this.$t('global.tips'), {
@ -162,7 +161,7 @@ export default {
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
deleteExistingSimulation(row.group).then(response => {
destroySimulation(row.id).then(response => {
this.$message.success(this.$t('system.deleteSuccess'));
this.reloadTable();
}).catch(() => {

View File

@ -0,0 +1,61 @@
<template>
<el-dialog v-dialogDrag title="仿真用户列表" :visible.sync="dialogVisible" width="80%" :before-close="handleClose" center :close-on-click-modal="false">
<el-table
:data="tableData"
border
style="width: 100%"
>
<el-table-column prop="id" label="用户Id" width="100" />
<el-table-column prop="name" label="用户名" width="100" />
<el-table-column prop="creator" label="仿真创建者" width="100">
<template slot-scope="scope">
<span>{{ scope.row.creator? '是':'否' }}</span>
</template>
</el-table-column>
<el-table-column prop="wsSubscribeMap" label="订阅路径">
<template slot-scope="scope">
<template v-for="(item, key) in scope.row.wsSubscribeMap">
<div :key="key">{{ key + ':' }}
<template v-for="(elem, i) in item">
<el-tag :key="key+i">{{ elem }}</el-tag>
</template>
</div>
</template>
</template>
</el-table-column>
</el-table>
</el-dialog>
</template>
<script>
import { getSimulationUserInfo } from '@/api/rtSimulation';
export default {
name: 'DictionaryEdit',
data() {
return {
dialogVisible: false,
tableData: [],
title:'',
isAdd:false
};
},
computed: {
},
methods: {
doShow(id) {
getSimulationUserInfo(id).then(resp => {
this.dialogVisible = true;
this.tableData = resp.data;
}).catch(error => {
this.$message.error('获取仿真用户列表失表:' + error.message);
});
},
handleClose() {
this.dialogVisible = false;
}
}
};
</script>