rt-sim-training-client/src/views/dispatcherStationManage/dispatchCmd.vue

371 lines
13 KiB
Vue
Raw Normal View History

2022-06-28 11:29:38 +08:00
<template>
<el-dialog
v-dialogDrag
class="dispatcher-cmd chengdou-03__systerm"
:title="title"
:visible.sync="show"
2022-06-29 10:36:57 +08:00
width="1300px"
2022-06-28 11:29:38 +08:00
:before-close="doClose"
:z-index="2010"
:modal="false"
:close-on-click-modal="false"
append-to-body
>
<div class="main">
<el-row style="height: 100%;">
<el-col :span="6" style="height: 100%;">
<div class="left">
2022-06-29 10:36:57 +08:00
<el-tabs v-model="activeTab" type="border-card" @tab-click="tabClick">
2022-06-28 11:29:38 +08:00
<el-tab-pane label="操作" name="operate">
<div class="operate-box">
2022-06-30 18:13:23 +08:00
<div class="create-cmd">
<el-button type="primary" @click="initData">新建调度命令</el-button>
</div>
2022-06-28 11:29:38 +08:00
</div>
</el-tab-pane>
<el-tab-pane label="查询" name="search">
<div class="search-box">
<div>查询</div>
</div>
</el-tab-pane>
</el-tabs>
</div>
</el-col>
<el-col :span="12">
<div class="middle">
2022-06-29 10:36:57 +08:00
<el-tabs v-model="cmdTab" type="border-card">
2022-06-28 11:29:38 +08:00
<el-tab-pane label="调度命令" name="cmd">
2022-06-29 10:36:57 +08:00
<el-form ref="form" :model="command" label-width="80px">
<el-form-item label="命令标题">
<el-input v-model="command.title" />
</el-form-item>
<el-row>
<el-col :span="12">
<el-form-item label="命令号">
<el-input v-model="command.number" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="发令时间">
2022-06-30 18:13:23 +08:00
<el-date-picker v-model="command.sendTime" type="datetime" placeholder="选择日期时间" style="width: 100%;" value-format="yyyy-MM-dd HH:mm:ss" />
2022-06-29 10:36:57 +08:00
</el-form-item>
</el-col>
</el-row>
<el-col :span="12">
<el-form-item label="发令人">
2022-07-01 13:58:44 +08:00
<el-select v-model="command.senderName" disabled placeholder="请选择" style="width: 100%;" @change="senderChange">
2022-06-30 18:13:23 +08:00
<el-option
2022-07-01 13:58:44 +08:00
v-for="item in memberDataList"
:key="item.id"
:label="item.labelName"
:value="item.labelName"
2022-06-30 18:13:23 +08:00
/>
</el-select>
2022-06-29 10:36:57 +08:00
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="发令单位">
<el-input v-model="command.companyOfSender" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="授权时间">
2022-06-30 18:13:23 +08:00
<el-date-picker v-model="command.authorizationTime" type="datetime" placeholder="选择日期时间" style="width: 100%;" value-format="yyyy-MM-dd HH:mm:ss" />
2022-06-29 10:36:57 +08:00
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="授权状态">
<el-input v-model="command.authorizationStatus" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="定稿时间">
2022-06-30 18:13:23 +08:00
<el-date-picker v-model="command.finalizationTime" type="datetime" placeholder="选择日期时间" style="width: 100%;" value-format="yyyy-MM-dd HH:mm:ss" />
2022-06-29 10:36:57 +08:00
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="审核人">
2022-06-30 18:13:23 +08:00
<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>
2022-06-29 10:36:57 +08:00
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="拟令人">
2022-06-30 18:13:23 +08:00
<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>
2022-06-29 10:36:57 +08:00
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="命令分类">
2022-06-30 18:13:23 +08:00
<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>
2022-06-29 10:36:57 +08:00
</el-form-item>
</el-col>
</el-form>
2022-06-28 11:29:38 +08:00
</el-tab-pane>
</el-tabs>
2022-06-29 10:36:57 +08:00
<el-tabs v-model="textTab" type="border-card">
2022-06-28 11:29:38 +08:00
<el-tab-pane label="命令正文" name="text">
<div class="cmd-box">
2022-06-29 10:36:57 +08:00
<div>
<el-input v-model="cmdTextarea" type="textarea" :rows="6" placeholder="请输入内容" />
</div>
2022-06-28 11:29:38 +08:00
</div>
</el-tab-pane>
</el-tabs>
<div>
2022-06-30 18:13:23 +08:00
<div class="table-title">
2022-06-29 10:36:57 +08:00
<span>受令列表</span>
2022-06-30 18:13:23 +08:00
<!-- <el-checkbox v-model="tableChecked">全选</el-checkbox> -->
2022-06-29 10:36:57 +08:00
</div>
<div class="table">
2022-06-30 18:13:23 +08:00
<el-table ref="table" :data="getTableData" border style="width: 100%" height="200" @selection-change="selectionChange">
2022-06-29 10:36:57 +08:00
<el-table-column type="selection" width="50" />
2022-06-30 18:13:23 +08:00
<el-table-column prop="deviceName" label="受令单位" width="180" />
<el-table-column prop="copyers" label="抄送" width="180" />
<el-table-column prop="signStatus" label="签收状态" />
<el-table-column prop="signedBy" label="签收人" />
<el-table-column prop="signTime" label="签收时间" />
2022-06-29 10:36:57 +08:00
</el-table>
</div>
</div>
<div class="midle-bottom">
2022-06-30 18:13:23 +08:00
<el-button type="primary" @click="sendCmd">下达</el-button>
<el-button type="primary" @click="doClose">关闭</el-button>
2022-06-28 11:29:38 +08:00
</div>
</div>
</el-col>
<el-col :span="6">
<div class="right">
常用词汇
</div>
</el-col>
</el-row>
</div>
</el-dialog>
</template>
<script>
2022-06-30 18:13:23 +08:00
import { sendCommandNew } from '@/api/jmap/training';
import { mapState } from 'vuex';
2022-06-28 11:29:38 +08:00
export default {
name:'DispatcherCmd',
data() {
return {
dialogShow: false,
activeTab: 'operate',
cmdTab: 'cmd',
2022-06-29 10:36:57 +08:00
textTab: 'text',
2022-06-30 18:13:23 +08:00
typeOptions: [
{label: '正常调度命令', value: 'NORMAL'}
],
2022-06-29 10:36:57 +08:00
command: {
title: '',
number: '',
sendTime: '',
senderId: '',
2022-07-01 13:58:44 +08:00
senderName: '',
2022-06-29 10:36:57 +08:00
companyOfSender: '',
authorizationTime: '',
authorizationStatus: '',
finalizationTime: '',
reviewerId: '',
author: '',
2022-06-30 18:13:23 +08:00
receiverIds: [],
2022-06-29 10:36:57 +08:00
type: '',
2022-06-30 18:13:23 +08:00
content: '',
2022-06-29 10:36:57 +08:00
allSigned: ''
},
cmdTextarea: '',
2022-07-01 13:58:44 +08:00
tableChecked: false,
memberDataList: []
2022-06-28 11:29:38 +08:00
};
},
computed: {
2022-06-30 18:13:23 +08:00
...mapState('training', [
2022-07-01 13:58:44 +08:00
'memberList', 'memberData', 'simulationUserList'
2022-06-30 18:13:23 +08:00
]),
2022-06-28 11:29:38 +08:00
show() {
return this.dialogShow;
},
2022-06-30 18:13:23 +08:00
group() {
return this.$route.query.group;
},
2022-06-28 11:29:38 +08:00
title() {
return '调度命令管理系统';
2022-06-30 18:13:23 +08:00
},
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: '',
signStatus: false,
signer: '',
signTime: ''
};
list.push(obj);
});
return list;
}
},
2022-07-01 13:58:44 +08:00
watch: {},
2022-06-28 11:29:38 +08:00
beforeDestroy() {},
2022-07-01 13:58:44 +08:00
mounted() {},
2022-06-28 11:29:38 +08:00
methods:{
2022-06-30 18:13:23 +08:00
initData() {
this.command = {
title: '',
number: '',
sendTime: '',
2022-07-01 13:58:44 +08:00
senderId: '',
senderName: this.command.senderName,
2022-06-30 18:13:23 +08:00
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 : '';
}
},
2022-07-01 13:58:44 +08:00
getSenderName() {
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;
}
},
2022-06-28 11:29:38 +08:00
doShow() {
2022-07-01 13:58:44 +08:00
this.memberDataList = Object.values(this.memberData);
this.getSenderName();
2022-06-28 11:29:38 +08:00
this.dialogShow = true;
},
doClose() {
this.dialogShow = false;
},
tabClick() {
console.log('tabClick');
2022-06-30 18:13:23 +08:00
},
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');
2022-07-01 13:58:44 +08:00
this.$message.success('发送调度命令成功!');
2022-06-30 18:13:23 +08:00
this.initData();
}).catch(error => {
this.$messageBox('发送调度命令失败:' + error.message);
});
},
searchCmd() {
sendCommandNew(this.group, 'CTC_QUERY_DISPATCH_COMMAND').then((res) => {
2022-07-01 13:58:44 +08:00
console.log(res, '---res----');
2022-06-30 18:13:23 +08:00
}).catch(error => {
2022-07-01 13:58:44 +08:00
this.$messageBox('查询调度命令失败:' + error.message);
2022-06-30 18:13:23 +08:00
});
2022-06-28 11:29:38 +08:00
}
}
};
</script>
<style lang="scss" scoped>
// .dispatcher-cmd{
// }
.main {
height: 100%;
.left {
height: 100%;
2022-06-30 18:13:23 +08:00
.create-cmd {
text-align: end;
}
2022-06-28 11:29:38 +08:00
}
2022-06-29 10:36:57 +08:00
/deep/ .el-tabs__item {
height: 30px !important;
line-height: 30px !important;
}
.middle {
/deep/ .el-form-item {
margin-bottom: 0px;
}
2022-06-30 18:13:23 +08:00
.el-input {
/deep/ .el-input__icon {
line-height: 22px;
}
2022-06-29 10:36:57 +08:00
}
.midle-bottom {
height: 40px;
display: flex;
justify-content: center;
align-items: center;
}
}
}
</style>
<style>
.dispatcher-cmd .el-dialog .el-dialog__body {
padding: 5px !important;
}
.dispatcher-cmd .el-dialog {
margin-top: 8vh !important;
2022-06-28 11:29:38 +08:00
}
</style>