This commit is contained in:
fan 2022-07-05 09:08:35 +08:00
commit a5b4b096f2
7 changed files with 971 additions and 29 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

@ -24,7 +24,7 @@
<img :src="ctcBarIcon18" class="img-box" @click="handleRunplan"> <img :src="ctcBarIcon18" class="img-box" @click="handleRunplan">
</div> </div>
<div style="display: flex;padding: 2px;border-top: 2px solid #D1D1D1;margin-top: 3px"> <div style="display: flex;padding: 2px;border-top: 2px solid #D1D1D1;margin-top: 3px">
<div class="img-box" style="width: 100px;height: 25px;line-height: 21px;text-align: center;">调度命令</div> <div class="img-box" :class="{flicker: hasCommandMsg, redFlick: hasCommandMsg}" style="width: 100px;height: 25px;line-height: 21px;text-align: center;" @click="showCmdManage">调度命令</div>
<div style="width: 200px;height: 25px;border: 2px #D1D1D1 inset;line-height: 21px;text-align: center;margin-left: 5px;" /> <div style="width: 200px;height: 25px;border: 2px #D1D1D1 inset;line-height: 21px;text-align: center;margin-left: 5px;" />
<div id="stageRunplanOut" class="img-box" @click="stageRunplan">阶段计划</div> <div id="stageRunplanOut" class="img-box" @click="stageRunplan">阶段计划</div>
<div class="img-box" style="width: 100px;height: 25px;line-height: 21px;text-align: center;margin-left: 5px;">阶段记事</div> <div class="img-box" style="width: 100px;height: 25px;line-height: 21px;text-align: center;margin-left: 5px;">阶段记事</div>
@ -57,11 +57,13 @@
<menu-panel v-if="isCtc" ref="menuPanel" /> <menu-panel v-if="isCtc" ref="menuPanel" />
<stage-runplan v-if="isCtc" ref="stageRunplan" @closeFlash="closeStageFlash" @noticeInfo="noticeInfo" /> <stage-runplan v-if="isCtc" ref="stageRunplan" @closeFlash="closeStageFlash" @noticeInfo="noticeInfo" />
<notice-info v-if="isCtc" ref="noticeInfo" pop-class="chengdou-03__systerm" /> <notice-info v-if="isCtc" ref="noticeInfo" pop-class="chengdou-03__systerm" />
<cmdManage v-if="isCtc" ref="cmdManage" />
<signedCmd v-if="isCtc" ref="signedCmd" @signedCmdClose="signedCmdClose" @changeSignedStatus="changeSignedStatus" />
</div> </div>
</template> </template>
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters, mapState } from 'vuex';
import MenuSignal from './menuSignal'; import MenuSignal from './menuSignal';
import MenuButton from './menuButton'; import MenuButton from './menuButton';
import MenuStationStand from './menuStationStand'; import MenuStationStand from './menuStationStand';
@ -100,6 +102,8 @@ import CtcBarIcon15 from '@/assets/ctc_icon/pic15.png';
import CtcBarIcon16 from '@/assets/ctc_icon/pic16.png'; import CtcBarIcon16 from '@/assets/ctc_icon/pic16.png';
import CtcBarIcon17 from '@/assets/ctc_icon/pic17.png'; import CtcBarIcon17 from '@/assets/ctc_icon/pic17.png';
import CtcBarIcon18 from '@/assets/ctc_icon/pic18.png'; import CtcBarIcon18 from '@/assets/ctc_icon/pic18.png';
import cmdManage from '@/views/dispatcherStationManage/cmdManage.vue';
import signedCmd from '@/views/dispatcherStationManage/signedCmd.vue';
export default { export default {
name: 'Menus', name: 'Menus',
@ -121,7 +125,9 @@ export default {
NoticeInfo, NoticeInfo,
// DispatcherLoger, // DispatcherLoger,
BottomTable, BottomTable,
MenuPanel MenuPanel,
cmdManage,
signedCmd
}, },
props: { props: {
selected: { selected: {
@ -179,6 +185,16 @@ export default {
...mapGetters('config', [ ...mapGetters('config', [
'width' 'width'
]), ]),
...mapState('socket', [
'dispatchCommandMsg'
]),
hasCommandMsg() {
let status = false;
if (this.dispatchCommandMsg.body) {
status = true;
}
return status;
},
isShowBar() { isShowBar() {
return this.$store.state.training.prdType === '02' || this.$route.query.ctc; return this.$store.state.training.prdType === '02' || this.$route.query.ctc;
}, },
@ -230,6 +246,20 @@ export default {
window.onclick = function (e) {}; window.onclick = function (e) {};
}, },
methods: { methods: {
changeSignedStatus(info) {
this.isCtc && this.$refs.cmdManage.changeSignedStatus(info);
},
signedCmdClose() {
this.isCtc && this.$refs.cmdManage.doShow();
},
showCmdManage() {
if (!this.isCtc) { return; }
if (this.hasCommandMsg) {
this.$refs.signedCmd.doShow();
} else {
this.$refs.cmdManage.doShow();
}
},
getRailwaySimulationRunplanSend() { getRailwaySimulationRunplanSend() {
const stationCode = this.$store.state.training.roleDeviceCode; const stationCode = this.$store.state.training.roleDeviceCode;
const railwaySimulationRunplanSendMap = this.$store.state.socket.railwaySimulationRunplanSendMap; const railwaySimulationRunplanSendMap = this.$store.state.socket.railwaySimulationRunplanSendMap;
@ -276,7 +306,25 @@ export default {
} }
}; };
</script> </script>
<style lang="scss" scoped>
.redFlick {
background: red;
}
@keyframes fade {
from {
opacity: 1.0;
}
50% {
opacity: 0.2;
}
to {
opacity: 1.0;
}
}
.flicker {
animation: fade 600ms infinite;
}
</style>
<style> <style>
.menus .pop-menu { .menus .pop-menu {
background: #F0F0F0; background: #F0F0F0;

View File

@ -0,0 +1,113 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu" />
<set-fault ref="setFault" pop-class="datie-02__systerm" />
<notice-info ref="noticeInfo" pop-class="chengdou-03__systerm" />
</div>
</template>
<script>
import PopMenu from '@/components/PopMenu';
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import { mapGetters } from 'vuex';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
// import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { menuOperate, commitOperate } from '@/jmapNew/theme/components/utils/menuOperate';
export default {
name: 'SectionMenu',
components: {
PopMenu,
NoticeInfo,
SetFault
},
props: {
selected: {
type: Object,
default: () => {
return null;
}
}
},
data() {
return {
menu: [],
menuNormal: {
Local: [
]
},
menuForce: [
{
label: '区段故障解锁',
// handler: this.setStoppage,
handler: this.cancelStoppage,
// cmdType: CMD.Fault.CMD_SET_FAULT
cmdType: CMD.Fault.CMD_CANCEL_FAULT
}
]
};
},
computed: {
...mapGetters('training', [
'mode',
'operatemode'
]),
...mapGetters('menuOperation', [
'buttonOperation'
])
},
watch: {
'$store.state.menuOperation.menuCount': function (val) {
// console.log(this.buttonOperation, '***********');
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Section) && (!this.buttonOperation || this.$route.query.ctc)) {
this.doShow(this.$store.state.menuOperation.menuPosition);
} else {
this.doClose();
}
}
},
methods:{
initMenu() {
//
if (this.selected.type != '04') {
// this.menu = MenuContextHandler.covert(this.menuNormal);
this.menu = this.menuNormal.Local;
} else {
this.menu = [];
}
//
if (this.operatemode === OperateMode.FAULT && this.selected.type != '04') {
this.menu = this.menuForce;
}
},
doShow(point) {
this.initMenu();
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
this.$refs.popMenu.resetShowPosition(point);
}
},
doClose() {
if (this.$refs && this.$refs.popMenu) {
this.$refs.popMenu.close();
}
},
//
setStoppage() {
commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({valid, operate})=>{
if (valid) {
this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected);
}
});
},
//
cancelStoppage() {
commitOperate(menuOperate.Common.cancelFault, { code: this.selected.code }, 0).then(({valid, operate})=>{
if (valid) {
this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected);
}
});
}
}
};
</script>

View File

@ -265,6 +265,10 @@ function handle(state, data) {
}); });
state.railCtcStationManageRpChange++; state.railCtcStationManageRpChange++;
break; break;
// 调度命令信息
case 'SIMULATION_RAIL_CTC_DISPATCH_COMMAND':
state.dispatchCommandMsg = msg;
break;
// // 大铁项目 调度台 运行图信息 初始化消息 // // 大铁项目 调度台 运行图信息 初始化消息
// case 'SIMULATION_RAILWAY_RUN_PLAN_INIT': // case 'SIMULATION_RAILWAY_RUN_PLAN_INIT':
// state.railwaySimulationRpMsg = {}; // state.railwaySimulationRpMsg = {};
@ -440,6 +444,7 @@ const socket = {
simulationPlanChange:{}, // 运行图加线/抽线/变化推送消息 simulationPlanChange:{}, // 运行图加线/抽线/变化推送消息
loggedOutMsg: '', loggedOutMsg: '',
railCtcStatusMsg: {}, // 占线板信息 railCtcStatusMsg: {}, // 占线板信息
dispatchCommandMsg: {}, // 调度命令信息
railCtcRunplanInitMsg:{}, // 大铁项目 ctc 运行图初始化信息 railCtcRunplanInitMsg:{}, // 大铁项目 ctc 运行图初始化信息
railCtcRunplanChange:0, // 大铁项目 ctc 运行图信息变化 railCtcRunplanChange:0, // 大铁项目 ctc 运行图信息变化
railCtcStationManageRpMsg:{}, // 大铁项目 ctc 车务管理 端运行图信息 railCtcStationManageRpMsg:{}, // 大铁项目 ctc 车务管理 端运行图信息
@ -537,6 +542,9 @@ const socket = {
deleteRailwaySimulationRunplan: (state, stationCode) => { deleteRailwaySimulationRunplan: (state, stationCode) => {
delete state.railwaySimulationRunplanSendMap[stationCode]; delete state.railwaySimulationRunplanSendMap[stationCode];
state.railwaySimulationRunplanSendChange++; state.railwaySimulationRunplanSendChange++;
},
clearDispatchCommandMsg: (state, data) => {
state.dispatchCommandMsg = {};
} }
}, },

View File

@ -0,0 +1,337 @@
<template>
<el-dialog
v-dialogDrag
class="cmd-manage chengdou-03__systerm"
:title="title"
:visible.sync="show"
width="1000px"
:before-close="doClose"
:z-index="2010"
:modal="false"
:close-on-click-modal="false"
append-to-body
>
<div class="main">
<div class="left">
<div class="left-type">车站</div>
<div class="type-content">
<div class="content-item">
<img :src="shouxinImg" style="width: 58px; height: 58px">
<div>收令箱</div>
</div>
</div>
</div>
<div class="content-box">
<div class="box-top">
<div class="top-title">收令箱</div>
<div class="top-table">
<el-table :data="cmdTableData" style="width: 100%" height="160" highlight-current-row :row-class-name="tableRowClassName" @current-change="handleCurrentChange">
<el-table-column prop="title" label="标题" />
<el-table-column prop="number" label="号码" width="80" />
<el-table-column label="命令类型" width="100">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ typeObj[scope.row.type] || '' }}</span>
</template>
</el-table-column>
<el-table-column prop="sendTime" label="收令日期" width="160" />
<el-table-column prop="companyOfSender" label="发令单位" />
<el-table-column prop="senderName" label="发令人" />
<el-table-column label="签否">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ signedStatusObj[getSignInfo(scope.row.receiverInfos).signedStatus] || '' }}</span>
</template>
</el-table-column>
<el-table-column label="签收人">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ getSignedBy(getSignInfo(scope.row.receiverInfos)) || '' }}</span>
</template>
</el-table-column>
<el-table-column label="签收时间" width="160">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ getSignInfo(scope.row.receiverInfos).time || '' }}</span>
</template>
</el-table-column>
</el-table>
</div>
</div>
<div class="box-middle">
<div class="middle-left">
<el-input v-model="currentInfo.content" readonly type="textarea" rows="19" resize="none" placeholder="请输入内容" />
</div>
<div class="middle-right">
<div class="middle-right-top">
<el-table :data="getTableData" style="width: 100%" height="190">
<el-table-column type="index" label="序" width="50" />
<el-table-column prop="deviceName" label="受令单位" />
<el-table-column prop="copyers" label="抄知处所" />
</el-table>
</div>
<div class="middle-right-middle">
<span>阅读信息</span>
<el-checkbox v-model="needRead">需阅读</el-checkbox>
<el-checkbox v-model="stopRead">停止阅读</el-checkbox>
</div>
<div class="middle-right-bottom">
<el-table :data="tableData2" style="width: 100%" height="200">
<el-table-column type="index" label="序" width="50" />
<el-table-column prop="reader" label="阅读人" />
<el-table-column prop="readTime" label="阅读时间" />
</el-table>
</div>
</div>
</div>
</div>
</div>
<div class="bottom-btn">
<el-button :disabled="!commandId || currentHasSigned" @click="signCmd('REFUSE')">拒签</el-button>
<el-button :disabled="!commandId || currentHasSigned" @click="signCmd('SIGNED')">签收</el-button>
<el-button @click="doClose">关闭</el-button>
</div>
</el-dialog>
</template>
<script>
import { sendCommandNew } from '@/api/jmap/training';
import shouxinxiang from '@/assets/dispatcherStation/shouxinxiang.png';
import { mapState } from 'vuex';
import { parseTime } from '@/utils/index';
export default {
name:'CmdManage',
data() {
return {
shouxinImg: shouxinxiang,
cmdTableData: [],
tableData2: [],
needRead: false,
stopRead: false,
dialogShow: false,
currentInfo: {},
typeObj: {
NORMAL: '正常调度命令'
},
signedStatusObj: {
UNSIGNED: '未签收',
SIGNED: '签收',
REFUSE: '拒签'
}
};
},
computed: {
...mapState('training', [
'memberList', 'simulationUserList', 'initTime'
]),
...mapState('socket', [
'dispatchCommandMsg'
]),
show() {
return this.dialogShow;
},
group() {
return this.$route.query.group;
},
title() {
return '调度命令管理';
},
commandId() {
return this.currentInfo.id || '';
},
currentHasSigned() {
let hasSigned = false;
if (this.currentInfo.receiverInfos) {
const obj = this.getSignInfo(this.currentInfo.receiverInfos);
if (obj && obj.signedStatus != 'UNSIGNED') {
hasSigned = true;
}
}
return hasSigned;
},
getActiveUser() {
const userInfo = this.simulationUserList.find(item => {
return item.userId == this.$store.state.user.id;
});
const activeUser = userInfo || {};
return activeUser;
},
getTableData() {
const receiverList = Object.values(this.currentInfo.receiverInfos || {});
const mList = [];
receiverList.forEach(ii => {
const obj = this.memberList.find(item => {
return item.id == ii.receiverId;
});
if (obj) {
mList.push({
commandId: this.commandId,
...ii,
...obj
});
}
});
const list = [];
mList.forEach(item => {
const device = this.$store.getters['map/getDeviceByCode'](item.deviceCode);
const obj = {
...this.currentInfo,
...item,
deviceName: device ? device.name : ''
};
list.push(obj);
});
return list;
}
},
watch: {
dispatchCommandMsg(Obj) {
if (Obj.type == 'ADD') {
const list = Obj.body;
this.cmdTableData.push(list);
this.show && this.$store.commit('socket/clearDispatchCommandMsg');
}
}
},
beforeDestroy() {},
mounted() {
this.searchCmd();
},
methods:{
tableRowClassName({row, rowIndex}) {
const status = this.getSignInfo(row.receiverInfos).signedStatus;
if (status === 'SIGNED') {
return 'signed-row';
}
return 'unsigned-row';
},
doShow() {
this.dialogShow = true;
this.$store.commit('socket/clearDispatchCommandMsg');
},
doClose() {
this.dialogShow = false;
},
handleCurrentChange(obj) {
this.currentInfo = obj;
},
getSignInfo(info) {
const obj = info[this.getActiveUser.memberId] || {};
return obj;
},
getSignedBy(info) {
const signedInfo = this.simulationUserList.find(item => {
return item.memberId == info.signedBy;
});
let name = '';
if (signedInfo) {
name = signedInfo.nickName;
}
return name;
},
signCmd(status) {
if (!this.commandId) { return; }
const signInfo = { commandId: this.commandId, signedBy: this.getActiveUser.memberId, signedStatus: status };
const data = {
signInfo: signInfo
};
sendCommandNew(this.group, 'CTC_SIGN_DISPATCH_COMMAND', data).then((res) => {
console.log(res, '---res');
if (res.code == 200) {
this.changeSignedStatus(signInfo);
} else {
this.$messageBox(`${this.signedStatusObj[status]}调度命令失败:${res.message}`);
}
}).catch(error => {
this.$messageBox(`${this.signedStatusObj[status]}调度命令失败:${error.message}`);
});
},
changeSignedStatus(signInfo) {
const index = this.cmdTableData.findIndex(item => {
return item.id == signInfo.commandId;
});
if (index >= 0) {
const obj = this.cmdTableData[index];
const mId = signInfo.signedBy;
obj.receiverInfos[mId].signedBy = mId;
obj.receiverInfos[mId].signedStatus = signInfo.signedStatus;
obj.receiverInfos[mId].time = parseTime(this.initTime);
this.cmdTableData.splice(index, 1, obj);
}
},
searchCmd() {
sendCommandNew(this.group, 'CTC_QUERY_DISPATCH_COMMAND').then((res) => {
console.log(res, '---res');
if (res.code == 200) {
this.cmdTableData = res.data;
} else {
this.$messageBox('查询调度命令失败:' + res.message);
}
}).catch(error => {
this.$messageBox('查询调度命令失败:' + error.message);
});
}
}
};
</script>
<style lang="scss" scoped>
.main {
height: 100%;
display: flex;
.left {
display: flex;
flex-direction: column;
width: 150px;
flex: 1;
.left-type {
display: flex;
justify-content: center;
align-items: center;
font-weight: bold;
height: 30px;
border: 1px solid #A0A0A0;
}
.type-content {
background: #A0A0A0;
flex: 1;
.content-item {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
color: #fff;
&:hover {
cursor: pointer;
}
}
}
}
.content-box {
width: calc(100% - 150px);
padding-left: 10px;
.box-top {
.el-table {
/deep/ .signed-row {
color: red;
}
/deep/ .unsigned-row {
color: blue;
}
}
}
.box-middle {
padding-top: 10px;
display: flex;
.middle-left {
width: calc(100% - 290px);
}
.middle-right {
padding-left: 10px;
width: 290px;
}
}
}
}
.bottom-btn {
height: 40px;
display: flex;
justify-content: flex-end;
align-items: flex-end;
}
</style>

View File

@ -18,11 +18,9 @@
<el-tabs v-model="activeTab" type="border-card" @tab-click="tabClick"> <el-tabs v-model="activeTab" type="border-card" @tab-click="tabClick">
<el-tab-pane label="操作" name="operate"> <el-tab-pane label="操作" name="operate">
<div class="operate-box"> <div class="operate-box">
<div>数据库正常</div> <div class="create-cmd">
<div>缓存命令</div> <el-button type="primary" @click="createCmd">新建调度命令</el-button>
<div>接受命令</div> </div>
<div>发送命令</div>
<div>签收完成</div>
</div> </div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="查询" name="search"> <el-tab-pane label="查询" name="search">
@ -49,13 +47,20 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="发令时间"> <el-form-item label="发令时间">
<el-date-picker v-model="command.sendTime" type="datetime" placeholder="选择日期时间" style="width: 100%;" /> <el-date-picker v-model="command.sendTime" type="datetime" placeholder="选择日期时间" style="width: 100%;" value-format="yyyy-MM-dd HH:mm:ss" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="发令人"> <el-form-item label="发令人">
<el-input v-model="command.senderId" /> <el-select v-model="command.senderName" disabled placeholder="请选择" style="width: 100%;" @change="senderChange">
<el-option
v-for="item in memberDataList"
:key="item.id"
:label="item.labelName"
:value="item.labelName"
/>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@ -65,7 +70,7 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="授权时间"> <el-form-item label="授权时间">
<el-date-picker v-model="command.authorizationTime" type="datetime" placeholder="选择日期时间" style="width: 100%;" /> <el-date-picker v-model="command.authorizationTime" type="datetime" placeholder="选择日期时间" style="width: 100%;" value-format="yyyy-MM-dd HH:mm:ss" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@ -75,22 +80,43 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="定稿时间"> <el-form-item label="定稿时间">
<el-date-picker v-model="command.finalizationTime" type="datetime" placeholder="选择日期时间" style="width: 100%;" /> <el-date-picker v-model="command.finalizationTime" type="datetime" placeholder="选择日期时间" style="width: 100%;" value-format="yyyy-MM-dd HH:mm:ss" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="审核人"> <el-form-item label="审核人">
<el-input v-model="command.reviewerId" /> <el-select v-model="command.reviewerId" placeholder="请选择" style="width: 100%;">
<el-option
v-for="item in simulationUserList"
:key="item.memberId"
:label="item.nickName"
:value="item.memberId"
/>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="拟令人"> <el-form-item label="拟令人">
<el-input v-model="command.author" /> <el-select v-model="command.author" placeholder="请选择" style="width: 100%;">
<el-option
v-for="item in simulationUserList"
:key="item.memberId"
:label="item.nickName"
:value="item.memberId"
/>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="命令分类"> <el-form-item label="命令分类">
<el-input v-model="command.type" /> <el-select v-model="command.type" placeholder="请选择" style="width: 100%;">
<el-option
v-for="item in typeOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-form> </el-form>
@ -106,23 +132,28 @@
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
<div> <div>
<div class="title"> <div class="table-title">
<span>受令列表</span> <span>受令列表</span>
<el-checkbox v-model="tableChecked">全选</el-checkbox> <!-- <el-checkbox v-model="tableChecked">全选</el-checkbox> -->
</div> </div>
<div class="table"> <div class="table">
<el-table :data="tableData" style="width: 100%" height="200"> <el-table ref="table" :data="getTableData" border style="width: 100%" height="200" @selection-change="selectionChange">
<el-table-column type="selection" width="50" /> <el-table-column type="selection" width="50" />
<el-table-column prop="date" label="受令单位" width="180" /> <el-table-column prop="deviceName" label="受令单位" width="180" />
<el-table-column prop="name" label="抄送" width="180" /> <el-table-column prop="copyers" label="抄送" width="180" />
<el-table-column prop="address" label="签收状态" /> <el-table-column label="签收状态">
<el-table-column prop="address" label="签收人" /> <template slot-scope="scope">
<el-table-column prop="address" label="签收时间" /> <span style="margin-left: 10px">{{ scope.row.nickName ? signedStatusObj[scope.row.signedStatus] : '' }}</span>
</template>
</el-table-column>
<el-table-column prop="nickName" label="签收人" />
<el-table-column prop="signTime" label="签收时间" />
</el-table> </el-table>
</div> </div>
</div> </div>
<div class="midle-bottom"> <div class="midle-bottom">
<el-button type="primary">下达</el-button> <el-button type="primary" @click="sendCmd">下达</el-button>
<el-button type="primary" @click="doClose">关闭</el-button>
</div> </div>
</div> </div>
</el-col> </el-col>
@ -136,6 +167,8 @@
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import { sendCommandNew } from '@/api/jmap/training';
import { mapState } from 'vuex';
export default { export default {
name:'DispatcherCmd', name:'DispatcherCmd',
data() { data() {
@ -144,39 +177,134 @@ export default {
activeTab: 'operate', activeTab: 'operate',
cmdTab: 'cmd', cmdTab: 'cmd',
textTab: 'text', textTab: 'text',
typeOptions: [
{label: '正常调度命令', value: 'NORMAL'}
],
signedStatusObj: {
UNSIGNED: '未签收',
SIGNED: '签收',
REFUSE: '拒签'
},
command: { command: {
title: '', title: '',
number: '', number: '',
sendTime: '', sendTime: '',
senderId: '', senderId: '',
senderName: '',
companyOfSender: '', companyOfSender: '',
authorizationTime: '', authorizationTime: '',
authorizationStatus: '', authorizationStatus: '',
finalizationTime: '', finalizationTime: '',
reviewerId: '', reviewerId: '',
author: '', author: '',
receiverIds: '', receiverIds: [],
type: '', type: '',
content: '',
allSigned: '' allSigned: ''
}, },
cmdTextarea: '', cmdTextarea: '',
tableChecked: false, tableChecked: false,
tableData: [] memberDataList: []
}; };
}, },
computed: { computed: {
...mapState('training', [
'memberList', 'memberData', 'simulationUserList'
]),
show() { show() {
return this.dialogShow; return this.dialogShow;
}, },
group() {
return this.$route.query.group;
},
title() { title() {
return '调度命令管理系统'; return '调度命令管理系统';
},
mapSimulationUserList() {
const obj = {};
this.simulationUserList.forEach(item => {
obj[item.userId] = item;
});
return obj;
},
getTableData() {
const mList = this.memberList.filter(item => {
return item.type == 'STATION_SUPERVISOR';
});
const list = [];
mList.forEach(item => {
const device = this.$store.getters['map/getDeviceByCode'](item.deviceCode);
const useInfo = this.mapSimulationUserList[item.userId];
const obj = {
...item,
userId: item.userId + '',
deviceName: device ? device.name : '',
nickName: useInfo ? useInfo.nickName : '',
copyers: '',
signedStatus: 'UNSIGNED',
signTime: ''
};
list.push(obj);
});
return list;
} }
}, },
watch: {}, watch: {},
beforeDestroy() {}, beforeDestroy() {},
mounted() {}, mounted() {},
methods:{ methods:{
createCmd() {
this.$confirm('当前调度命令已经被编辑修改过了,你要放弃所有的修改吗?', '操作提示', {
confirmButtonText: '是',
cancelButtonText: '否'
}).then(() => {
this.initData();
}).catch(() => {
console.log('取消新建调度命令!');
});
},
initData() {
this.command = {
title: '',
number: '',
sendTime: '',
senderId: '',
senderName: this.command.senderName,
companyOfSender: '',
authorizationTime: '',
authorizationStatus: '',
finalizationTime: '',
reviewerId: '',
author: '',
receiverIds: [],
type: '',
content: '',
allSigned: ''
};
this.cmdTextarea = '';
this.$refs.table.clearSelection();
},
senderChange(memberId) {
const obj = this.mapSimulationUserList.find(item => {
return item.memberId == memberId;
});
if (obj) {
const device = this.$store.getters['map/getDeviceByCode'](obj.deviceCode);
this.command.companyOfSender = device ? device.name : '';
}
},
getSenderName() {
this.memberDataList = Object.values(this.memberData);
const activeUser = this.memberDataList.find(item => {
return item.userId == this.$store.state.user.id;
});
if (activeUser) {
// this.command.senderId = activeUser.id;
this.command.senderName = activeUser.labelName;
}
},
doShow() { doShow() {
this.getSenderName();
this.dialogShow = true; this.dialogShow = true;
}, },
doClose() { doClose() {
@ -184,6 +312,34 @@ export default {
}, },
tabClick() { tabClick() {
console.log('tabClick'); console.log('tabClick');
},
selectionChange(selection) {
const arr = [];
selection.forEach(item => {
arr.push(item.id);
});
this.command.receiverIds = arr;
console.log(this.simulationUserList, '----simulationUserList----');
},
sendCmd() {
this.command.content = this.cmdTextarea;
const data = {
command: this.command
};
sendCommandNew(this.group, 'CTC_SEND_DISPATCH_COMMAND', data).then((res) => {
console.log(res, '---res');
this.$message.success('发送调度命令成功!');
this.initData();
}).catch(error => {
this.$messageBox('发送调度命令失败:' + error.message);
});
},
searchCmd() {
sendCommandNew(this.group, 'CTC_QUERY_DISPATCH_COMMAND').then((res) => {
console.log(res, '---res----');
}).catch(error => {
this.$messageBox('查询调度命令失败:' + error.message);
});
} }
} }
@ -196,6 +352,9 @@ export default {
height: 100%; height: 100%;
.left { .left {
height: 100%; height: 100%;
.create-cmd {
text-align: end;
}
} }
/deep/ .el-tabs__item { /deep/ .el-tabs__item {
height: 30px !important; height: 30px !important;
@ -205,9 +364,11 @@ export default {
/deep/ .el-form-item { /deep/ .el-form-item {
margin-bottom: 0px; margin-bottom: 0px;
} }
.el-input {
/deep/ .el-input__icon { /deep/ .el-input__icon {
line-height: 22px; line-height: 22px;
} }
}
.midle-bottom { .midle-bottom {
height: 40px; height: 40px;
display: flex; display: flex;

View File

@ -0,0 +1,275 @@
<template>
<el-dialog
v-dialogDrag
class="cmd-manage chengdou-03__systerm"
:title="title"
:visible.sync="show"
width="1000px"
:before-close="doClose"
:z-index="2010"
:modal="false"
:close-on-click-modal="false"
append-to-body
>
<div class="main">
<div class="top">
<el-row>
<el-col :span="24">
<div>
<span>命令类型名称</span>
<span>{{ typeObj[signedData.type] }}</span>
</div>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<div>
<span>命令号码</span>
<span>{{ signedData.number }}</span>
</div>
</el-col>
<el-col :span="8">
<div>
<span>日期</span>
<span>{{ getParseTime(signedData.sendTime, '{y}-{m}-{d}') }}</span>
</div>
</el-col>
<el-col :span="8">
<div>
<span>发令时刻</span>
<span>{{ getParseTime(signedData.sendTime, '{h}:{i}:{s}') }}</span>
</div>
</el-col>
</el-row>
<el-row>
<el-col :span="9">
<div>
<span>发令单位</span>
<span>{{ signedData.companyOfSender }}</span>
</div>
</el-col>
<el-col :span="15">
<div>
<span>调度员姓名</span>
<span>{{ signedData.senderName }}</span>
</div>
</el-col>
</el-row>
</div>
<div class="content-box">
<div class="box-title">命令内容</div>
<div class="box-top">
<el-input v-model="signedData.content" readonly type="textarea" rows="9" resize="none" placeholder="请输入内容" />
</div>
<div class="box-table">
<el-table :data="getTableData" style="width: 100%" height="200">
<el-table-column type="index" label="序" width="50" />
<el-table-column prop="deviceName" label="受令单位" />
<el-table-column prop="copyers" label="抄知处所" />
</el-table>
</div>
<div class="box-bottom">
<div>
<el-checkbox v-model="needprint">签收后打印</el-checkbox>
<el-checkbox v-model="needRead">需他人阅读</el-checkbox>
</div>
<div class="bottom-signed">
<span>签收人姓名</span>
<el-input v-model="signedBy" readonly style="width: 150px" />
</div>
</div>
</div>
</div>
<div class="bottom-btn">
<el-button :disabled="!commandId || currentHasSigned" @click="signCmd('REFUSE')">拒签</el-button>
<el-button :disabled="!commandId || currentHasSigned" @click="signCmd('SIGNED')">签收</el-button>
<el-button @click="doClose">关闭</el-button>
</div>
</el-dialog>
</template>
<script>
import { sendCommandNew } from '@/api/jmap/training';
import { mapState } from 'vuex';
import { parseTime } from '@/utils/index';
export default {
name:'CmdManage',
data() {
return {
signedData: {},
needRead: false,
needprint: false,
dialogShow: false,
signedId: '',
signedBy: '',
typeObj: {
NORMAL: '正常调度命令'
},
signedStatusObj: {
UNSIGNED: '未签收',
SIGNED: '签收',
REFUSE: '拒签'
}
};
},
computed: {
...mapState('training', [
'memberList', 'simulationUserList', 'initTime'
]),
...mapState('socket', [
'dispatchCommandMsg'
]),
show() {
return this.dialogShow;
},
group() {
return this.$route.query.group;
},
title() {
return '调度命令管理';
},
commandId() {
return this.signedData.id || '';
},
currentHasSigned() {
let hasSigned = false;
if (this.signedData.receiverInfos) {
const obj = this.getSignInfo(this.signedData.receiverInfos);
if (obj && obj.signedStatus != 'UNSIGNED') {
hasSigned = true;
}
}
return hasSigned;
},
getActiveUser() {
const userInfo = this.simulationUserList.find(item => {
return item.userId == this.$store.state.user.id;
});
const activeUser = userInfo || {};
return activeUser;
},
getTableData() {
const receiverList = Object.values(this.signedData.receiverInfos || {});
const mList = [];
receiverList.forEach(ii => {
const obj = this.memberList.find(item => {
return item.id == ii.receiverId;
});
if (obj) {
mList.push({
commandId: this.commandId,
...ii,
...obj
});
}
});
const list = [];
mList.forEach(item => {
const device = this.$store.getters['map/getDeviceByCode'](item.deviceCode);
const obj = {
...this.signedData,
...item,
deviceName: device ? device.name : ''
};
list.push(obj);
});
return list;
}
},
watch: {},
beforeDestroy() {},
mounted() {},
methods:{
getParseTime(val, f) {
return val ? parseTime(val, f) : '';
},
getSenderName() {
this.signedBy = '';
this.signedId = '';
const activeUser = this.simulationUserList.find(item => {
return item.userId == this.$store.state.user.id;
});
if (activeUser) {
this.signedBy = activeUser.nickName;
this.signedId = activeUser.memberId;
}
},
doShow() {
this.getSenderName();
this.getSignedData();
this.dialogShow = true;
},
doClose() {
this.dialogShow = false;
this.$emit('signedCmdClose');
},
getSignedData() {
this.signedData = {};
if (this.dispatchCommandMsg.type == 'ADD') {
this.signedData = this.dispatchCommandMsg.body;
}
},
getSignInfo(info) {
const obj = info[this.getActiveUser.memberId] || {};
return obj;
},
getSignedBy(info) {
const signedInfo = this.simulationUserList.find(item => {
return item.memberId == info.signedBy;
});
let name = '';
if (signedInfo) {
name = signedInfo.nickName;
}
return name;
},
signCmd(status) {
if (!this.commandId) { return; }
const signInfo = { commandId: this.commandId, signedBy: this.signedId, signedStatus: status };
const data = {
signInfo: signInfo
};
sendCommandNew(this.group, 'CTC_SIGN_DISPATCH_COMMAND', data).then((res) => {
console.log(res, '---res');
this.$emit('changeSignedStatus', signInfo);
this.doClose();
}).catch(error => {
this.$messageBox('查询调度命令失败:' + error.message);
});
}
}
};
</script>
<style lang="scss" scoped>
.main {
height: 100%;
.top {
padding: 5px 10px;
border: 1px solid #ccc;
span {
font-size: 16px;
}
}
.content-box {
.box-title {
height: 40px;
line-height: 40px;
}
.box-bottom {
height: 50px;
display: flex;
justify-content: space-between;
align-items: center;
.bottom-signed {
display: flex;
}
}
}
}
.bottom-btn {
height: 40px;
display: flex;
justify-content: flex-end;
align-items: flex-end;
}
</style>