增加系统通知流程

This commit is contained in:
zyy 2020-09-09 11:25:31 +08:00
parent 83b1d16773
commit 85f4a5e1b0
7 changed files with 204 additions and 47 deletions

View File

@ -70,6 +70,7 @@ export default {
runGraphReleaseApplication: 'Run graph release application',
subsystemGeneration: 'Subsystem generation',
newsBulletin: 'New bulletin',
notificationBulletin: 'Systematic notification',
commandDictionary: 'Command dictionary',
configLine: 'Line management',
deviceManage: 'Device management',

View File

@ -71,6 +71,7 @@ export default {
runGraphReleaseApplication: '运行图发布申请',
subsystemGeneration: '子系统生成',
newsBulletin: '消息公告',
notificationBulletin: '系统通知',
commandDictionary: '指令字典',
configLine: '线路管理',
deviceManage: '设备管理',

View File

@ -44,6 +44,7 @@ const News = () => import('@/views/system/news/index');
const CommandDictionary = () => import('@/views/system/commandDictionary/index');
const CommandDictionaryDetail = () => import('@/views/system/commandDictionary/edit');
const configLine = () => import('@/views/system/configLine/index');
const Notification = () => import('@/views/system/notification/index');
const IscsSystem = () => import('@/views/iscs/iscsSystem/index');
const IscsDraw = () => import('@/views/iscs/iscsDraw/index');
@ -813,6 +814,13 @@ export const asyncRouter = [
i18n: 'router.newsBulletin'
}
},
{ // 系统通知
path: 'notification',
component: Notification,
meta: {
i18n: 'router.notificationBulletin'
}
},
{ // 命令管理
path: 'commands',
component: CommandDictionary,

View File

@ -86,6 +86,12 @@ function loadDictionary() {
_LimitOperation: [],
_SystemInform: [], // 通知类型
systemInform: function () {
return queryData('system_inform', this, '_SystemInform');
},
regionTypeList: function () {
return queryData('region_type_list', this, '_RegionTypeList');
},

View File

@ -2,13 +2,13 @@
<div style="height: 100%;overflow-y:auto;">
<el-collapse v-model="activeName" accordion style="margin-left: 20px">
<el-collapse-item title="左右停车点偏移" name="1">
<el-form ref="oprt" :model="form" label-width="200px" size="mini">
<el-form-item :label="$t('map.leftStopPointOffsetFromStart')" prop="leftDistance">
<el-form label-width="200px" size="mini">
<!-- <el-form-item :label="$t('map.leftStopPointOffsetFromStart')" prop="leftDistance">
<el-input-number v-model="form.leftDistance" :min="0" />
</el-form-item>
<el-form-item :label="$t('map.rightStopPointOffsetFromTerminal')" prop="rightDistance">
<el-input-number v-model="form.rightDistance" :min="0" />
</el-form-item>
</el-form-item> -->
<el-form-item>
<el-button-group>
<el-button type="primary" size="small" @click="batchSettings">{{ $t('global.set') }}</el-button>
@ -124,10 +124,10 @@ export default {
data() {
return {
activeName: '',
form: {
leftDistance: 0,
rightDistance: 0
},
// form: {
// leftDistance: 0,
// rightDistance: 0
// },
formModel: {
modelList: [],
trainPosType: ''
@ -168,7 +168,8 @@ export default {
'sectionList',
'stationList',
'switchList',
'stationStandList'
'stationStandList',
'trainModelList'
])
},
methods:{
@ -178,25 +179,25 @@ export default {
batchSettings() {
this.tipInfoList = [];
const models = [];
if (this.form.leftDistance || this.form.rightDistance) {
this.sectionList.forEach(section => {
if (section.transferTrack || section.reentryTrack || section.standTrack) {
if (section.lengthFact < this.form.leftDistance || section.lengthFact < this.form.rightDistance ) {
this.tipInfoList.push(`${section.name}[${section.code}]${this.$t('map.failedToSetParkingPointOffset')}`);
} else {
const model = deepAssign({}, section);
model.leftStopPointOffset = this.form.leftDistance;
model.rightStopPointOffset = model.lengthFact - this.form.rightDistance;
models.push(model);
}
this.sectionList.forEach(section => {
if (section.transferTrack || section.reentryTrack || section.standTrack) {
const trainModel = this.trainModelList[0];
if (section.lengthFact < trainModel.length ) {
this.tipInfoList.push(`${section.name}[${section.code}]${this.$t('map.failedToSetParkingPointOffset')}`);
} else {
const model = deepAssign({}, section);
const difference = (section.lengthFact - trainModel.length) / 2;
model.leftStopPointOffset = Math.floor(difference);
model.rightStopPointOffset = model.leftStopPointOffset + trainModel.length;
models.push(model);
}
});
this.$emit('updateMapModel', models);
if (this.tipInfoList.length) {
this.$emit('tipInfoHandle', this.tipInfoList);
} else {
this.$message.success(this.$t('tip.stopPointOffsetTip'));
}
});
this.$emit('updateMapModel', models);
if (this.tipInfoList.length) {
this.$emit('tipInfoHandle', this.tipInfoList);
} else {
this.$message.success(this.$t('tip.stopPointOffsetTip'));
}
},
setPositionType() {

View File

@ -221,20 +221,20 @@ export default {
callback();
}
};
var validateLeftStopPointOffset = (rule, value, callback) => {
if (value != this.editModel.rightStopPointOffset) {
callback();
} else {
callback(new Error('不能与右侧停车点一致'));
}
};
var validateRightStopPointOffset = (rule, value, callback) => {
if (value != this.editModel.leftStopPointOffset) {
callback();
} else {
callback(new Error('不能与左侧停车点一致'));
}
};
// var validateLeftStopPointOffset = (rule, value, callback) => {
// if (value != this.editModel.rightStopPointOffset) {
// callback();
// } else {
// callback(new Error(''));
// }
// };
// var validateRightStopPointOffset = (rule, value, callback) => {
// if (value != this.editModel.leftStopPointOffset) {
// callback();
// } else {
// callback(new Error(''));
// }
// };
const rules = {
code: [
{ required: true, message: this.$t('rules.selectEquipment'), trigger: 'change' }
@ -245,14 +245,14 @@ export default {
type: [
{ required: true, message: this.$t('rules.pleaseEnterSectionType'), trigger: 'blur' }
],
leftStopPointOffset: [
{ required: true, message: this.$t('rules.pleaseEnterLeftStopPointOffset'), trigger: 'blur' },
{ validator: validateLeftStopPointOffset, trigger: 'blur' }
],
rightStopPointOffset: [
{ required: true, message: this.$t('rules.rightStopPointOffset'), trigger: 'blur' },
{ validator: validateRightStopPointOffset, trigger: 'blur' }
],
// leftStopPointOffset: [
// { required: true, message: this.$t('rules.pleaseEnterLeftStopPointOffset'), trigger: 'blur' },
// { validator: validateLeftStopPointOffset, trigger: 'blur' }
// ],
// rightStopPointOffset: [
// { required: true, message: this.$t('rules.rightStopPointOffset'), trigger: 'blur' },
// { validator: validateRightStopPointOffset, trigger: 'blur' }
// ],
'destinationCodePoint.x': [
{ required: true, message: this.$t('rules.destinationCodePointX'), trigger: 'blur' }
],

View File

@ -0,0 +1,140 @@
<template>
<div class="card-box">
<el-steps class="steps" :active="display">
<el-step title="系统通知" icon="el-icon-edit-outline" />
<el-step title="" icon="el-icon-upload" />
</el-steps>
<div class="joylink-card forms">
<div style="height: 100%; padding-top: 40px; overflow-y: auto; position: relative;">
<el-form ref="form" :model="messageModel" :rules="rules" label-width="200px">
<el-form-item label="内容主题:" prop="title">
<el-input v-model="messageModel.title" style="width: 450px" /></el-form-item>
<el-form-item label="内容:" prop="content">
<el-input v-model="messageModel.content" style="width: 450px" type="textarea" :autosize="{ minRows: 2, maxRows: 6}" />
</el-form-item>
<el-form-item label="通知选择:" prop="showClose">
<el-radio-group v-model="messageModel.showClose">
<el-radio v-for="(item, index) in regionList" :key="index" :label="item.value">{{ item.label }}</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
</div>
</div>
<div class="draft">
<el-button type="primary" @click="pushNotification">{{ $t('system.push') }}</el-button>
</div>
</div>
</template>
<script>
import { pushMessage } from '@/api/pushMessage';
export default {
name: 'News',
data() {
return {
display: 1,
regionList: [],
messageModel: {
title: '',
content: '',
showClose: '02'
},
rules: {
title: [
{ required: true, message: this.$t('rules.enterTheNewsTitle'), trigger: 'blur'}
],
content:[
{ required: true, message: this.$t('rules.enterTheNewsContent'), trigger: 'blur' }
],
showClose: [
{ required: true, message: this.$t('rules.chooseNewsCanBeClosed'), trigger: 'change' }
]
}
};
},
mounted() {
this.regionList = [];
this.$Dictionary.systemInform().then(list => {
this.regionList = list.map(elem => { return { value: elem.code, label: elem.name }; });
});
},
methods: {
pushNotification() {
this.$refs['form'].validate((valid) => {
if (valid) {
pushMessage(this.messageModel).then(resp => {
this.$message.success('推送成功');
}).catch(() => {
this.$messageBox('推送失败');
});
} else {
return false;
}
});
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.card-box {
padding-top: 20px;
height: 100%;
margin: 0 auto;
}
.steps {
width: 980px;
margin: 0 auto;
/deep/ {
.el-step__icon.is-icon {
width: 95px;
}
}
}
.online_box {
position: absolute;
left: 20px;
top: 18px;
}
.forms {
width: 800px;
margin: 0 auto;
margin-top: 10px;
height: calc(100% - 150px);
/deep/ {
.el-select {
float: left;
width: calc(600px);
}
.el-textarea {
float: left;
width: calc(600px);
}
.el-form-item__content>.el-input {
float: left;
width: calc(600px);
}
.el-input-number {
float: left;
width: calc(250px);
}
}
}
.draft {
width: 300px;
text-align: center;
margin: 20px auto;
}
</style>