This commit is contained in:
zyy 2020-12-22 17:08:19 +08:00
commit 8c245127e2
11 changed files with 70 additions and 30 deletions

View File

@ -98,3 +98,11 @@ export function createPost(data) {
data
});
}
// 修改留言板
export function updatePost(postId, data) {
return request({
url: `/api/learn/${postId}`,
method: 'put',
data
});
}

View File

@ -54,12 +54,6 @@ export default class Line2 extends Group {
}
}
getBoundingRect() {
if (this.segment) {
return this.segment.getBoundingRect().clone();
}
}
setState(model) {
if (!this.isShowShape) return;
this.setLineType(model.type);

View File

@ -116,7 +116,7 @@ export default {
},
title() {
if (this.operation == OperationEvent.Signal.humanControl.menu.operation) {
return '进路人工控';
return '进路人工控';
} else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) {
return '进路交自动控';
}

View File

@ -336,10 +336,13 @@ export default {
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
if (data.operation === OperationEvent.Signal.guide.menu.operation) {
switch (data.operation) {
case OperationEvent.Signal.guide.menu.operation:
this.$refs.routeGuide.doShow(data, data.selected, data.routesList);
} else if (data.operation === OperationEvent.Signal.humanTrainRoute.menu.operation) {
break;
case OperationEvent.Signal.humanTrainRoute.menu.operation:
this.$refs.routeControl.doShow(data, data.selected);
break;
}
}
});

View File

@ -85,7 +85,7 @@ export default {
cmdType: CMD.Stand.CMD_STAND_SET_RUN_TIME
},
{
label: '属性',
label: '显示站台信息',
handler: this.detail,
cmdType: CMD.Stand.CMD_STAND_VIEW_STATUS
}

View File

@ -187,7 +187,6 @@ export default {
this.menu = [...this.menuDirective];
}
}
},
doShow(point) {
this.clickEvent();

View File

@ -262,14 +262,15 @@ export default {
},
//
lock() {
switch (this.popClass) {
case 'chengdou-03__systerm':
this.sendCommandNext(menuOperate.Signal.lock).then(operate => {
this.$refs.password.doShow(operate);
});
break;
default: this.sendCommand(menuOperate.Signal.lock);
}
// switch (this.popClass) {
// case 'chengdou-03__systerm':
// this.sendCommandNext(menuOperate.Signal.lock).then(operate => {
// this.$refs.password.doShow(operate);
// });
// break;
// default: this.sendCommand(menuOperate.Signal.lock);
// }
this.sendCommand(menuOperate.Signal.lock);
},
//
unlock() {

View File

@ -58,7 +58,6 @@ export default {
},
getMapByCode() {
const project = getSessionStorage('project');
console.log(project, GetMapListByProjectList.includes(project));
return GetMapListByProjectList.includes(project);
}
},

View File

@ -1,6 +1,6 @@
<template>
<el-dialog
title="创建留言板"
:title="title"
:visible.sync="dialogVisible"
width="30%"
:before-close="handleClose"
@ -10,7 +10,7 @@
<el-input v-model="form.title" style="width: 200px;" />
</el-form-item>
<el-form-item label="归属项目:" prop="project">
<el-select v-model="form.project" placeholder="请选择">
<el-select v-model="form.project" :disabled="update" placeholder="请选择">
<el-option
v-for="item in projectOptionList"
:key="item.value"
@ -22,13 +22,14 @@
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="handleClose"> </el-button>
<el-button type="primary" @click="commit"> </el-button>
<el-button v-if="!update" type="primary" @click="commit"> </el-button>
<el-button v-if="update" type="primary" @click="updateCommit"> </el-button>
</span>
</el-dialog>
</template>
<script>
import { createPost } from '@/api/learn';
import { createPost, updatePost } from '@/api/learn';
export default {
name: 'Create',
props:{
@ -42,10 +43,13 @@ export default {
data() {
return {
dialogVisible: false,
postId: '',
form:{
title: '',
project: ''
},
title: '',
update: false,
rules: {
title: [
{ required: true, message: '请填写留言板名称', trigger: 'blur' }
@ -58,11 +62,35 @@ export default {
},
methods: {
handleClose() {
this.form = { title: '', project: '' };
this.$refs.form.resetFields();
this.dialogVisible = false;
},
doShow() {
doShow(data) {
this.dialogVisible = true;
this.postId = '';
this.update = false;
this.title = '创建留言板';
if (data) {
this.update = true;
this.title = '修改留言板';
this.form.title = data.title;
this.form.project = data.project;
this.postId = data.id;
}
},
updateCommit() {
this.$refs['form'].validate((valid) => {
if (valid) {
updatePost(this.postId, this.form).then(resp => {
this.$emit('reloadTable');
this.handleClose();
}).catch(() => {
this.$message.error('修改留言板失败!');
this.handleClose();
});
}
});
},
commit() {
this.$refs['form'].validate((valid) => {

View File

@ -9,6 +9,7 @@
import { queryPostPage } from '@/api/learn';
import { ProjectList} from '@/scripts/ProjectConfig';
import CreateDraft from './create';
export default {
name: 'Manage',
components:{
@ -60,6 +61,10 @@ export default {
{
name: '进入',
handleClick: this.handleEnter
},
{
name: '修改',
handleClick: this.handleUpdate
}
]
}
@ -104,6 +109,9 @@ export default {
}
});
window.open(routeData.href, '_blank', 'noopener noreferrer');
},
handleUpdate(index, row) {
this.$refs.createDraft.doShow(row);
}
}
};

View File

@ -26,15 +26,15 @@
<div class="trainExampleName">车站 颜色图例</div>
<div class="eachTrainExample">
<span class="smallExample" />
<span class="eachTrainExampleName">0 ~ 40</span>
<span class="eachTrainExampleName">0 ~ 400</span>
</div>
<div class="eachTrainExample">
<span class="mediumExample" />
<span class="eachTrainExampleName">40 ~ 80</span>
<span class="eachTrainExampleName">400 ~ 800</span>
</div>
<div class="eachTrainExample">
<span class="bigExample" />
<span class="eachTrainExampleName">80及以上</span>
<span class="eachTrainExampleName">800及以上</span>
</div>
</div>
<div class="trainExampleR">
@ -45,11 +45,11 @@
</div>
<div class="eachTrainExample">
<span class="mediumExample" />
<span class="eachTrainExampleName">100 ~ 200</span>
<span class="eachTrainExampleName">100 ~ 400</span>
</div>
<div class="eachTrainExample">
<span class="bigExample" />
<span class="eachTrainExampleName">200及以上</span>
<span class="eachTrainExampleName">1000及以上</span>
</div>
</div>
</div>