This commit is contained in:
joylink_cuiweidong 2021-06-16 14:41:10 +08:00
commit 49d30f0e6d
8 changed files with 102 additions and 19 deletions

View File

@ -497,3 +497,11 @@ export function updateRunlevelDistance(mapId) {
});
}
// 更新模板运行图的信息
export function updateTemplateRunPlan (data) {
return request({
url: `/api/runPlan/template/update`,
method: 'put',
data
});
}

View File

@ -46,4 +46,14 @@ export default class alarm extends Group {
this.model.point.x+=dx;
this.model.point.y+=dy;
}
setStatus(state) {
// domid还是写在了alarm里面 待优化
const audioDom = document.querySelector('#buzzer');
if (state && state.on) {
audioDom.play()
} else if (state && !state.on) {
audioDom.pause()
}
}
}

View File

@ -76,7 +76,6 @@ export default class elevator extends Group {
}
}
setStatus(model) {
console.log('elevator--->', model);
if (model.direction=='none') {
this.elevatorArrowBottom.setStatus('off');
this.elevatorArrowTop.setStatus('off');

View File

@ -74,7 +74,6 @@ export default class elevatorArrow extends Group {
}
setStatus(data) {
console.log('elevatorArrow--->', data);
let imageBack;
switch (data) {
case 'on': {

View File

@ -2,11 +2,11 @@ export function getBaseUrl() {
let BASE_API;
if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud';
BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.8.107:9000'; // 袁琪
// BASE_API = 'http://192.168.3.83:9000'; // 旭强 有线
// BASE_API = 'http://192.168.8.114:9000'; // 旭强 无线
// BASE_API = 'http://192.168.3.120:9000'; // 张赛
BASE_API = 'http://192.168.3.120:9000'; // 张赛
// BASE_API = 'http://192.168.8.140:9000'; // 杜康
// BASE_API = 'http://b29z135112.zicp.vip';
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康

View File

@ -86,7 +86,6 @@ export default {
'$store.state.socket.simulationIbpStatus': function (val) {
if (val && val[this.stationCode]) {
this.statusMessage(val[this.stationCode]);
this.controlAudio(val[this.stationCode].jjtcBuzzer);
}
},
'$store.state.socket.simulationTimeSync': function (time) { // 仿
@ -175,7 +174,6 @@ export default {
getIbpInitialState(this.$route.query.group, this.stationCode).then(resp => {
if (resp.data) {
this.statusMessage(resp.data);
this.controlAudio(resp.data.jjtcBuzzer);
}
}).catch((e) => {
this.$message.error('获取IBP盘初始状态异常');
@ -330,16 +328,6 @@ export default {
clearSubscribe() {
clearSubscribe(`${displayTopic}\/${this.$route.query.group}`);
},
controlAudio(val) {
const audio = document.getElementById('buzzer');
if (audio !== null) {
if (val) {
audio.play();
} else if (val === false) {
audio.pause();
}
}
},
switchOffset() {
if (this.offsetX === 0) {
this.offsetX = 1920;

View File

@ -0,0 +1,58 @@
<template>
<el-dialog v-dialogDrag :title="title" :visible.sync="show" width="30%" :before-close="doClose">
<el-form ref="form" :model="formModel" :rules="rules" label-width="140px">
<el-form-item :label="$t('publish.runPlanName')" prop="name">
<el-input v-model="formModel.name" :placeholder="$t('publish.enterRunPlanName')" />
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="doClose">{{ $t('global.cancel') }}</el-button>
<el-button type="primary" @click="handleCofirm">{{ $t('global.confirm') }}</el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data() {
return {
show: false,
mapIdList: [],
formModel: {
id: 0,
name: ''
}
};
},
computed: {
title() {
return this.$t('publish.selectMap');
},
rules() {
return {
name: [
{ required: true, message: this.$t('publish.enterRunPlanName'), trigger: 'blur' }
]
};
}
},
methods: {
doShow(row) {
this.formModel.id = row.id;
this.formModel.name = row.name;
this.show = true;
},
doClose(done) {
this.show = false;
this.$refs.form.resetFields();
},
handleCofirm() {
this.$refs['form'].validate((valid) => {
if (valid) {
this.$emit('confirm', this.formModel);
}
});
}
}
};
</script>

View File

@ -2,20 +2,23 @@
<div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<copy-plan ref="copyPlan" @confirm="handleCopyRunPlan" />
<edit-plan ref="editPlan" @confirm="handleUpdateRunPlan" />
</div>
</template>
<script>
import { superAdmin } from '@/router/index';
import { getPublishMapListOnline } from '@/api/jmap/map';
import { runPlanTemplateList, deleteRunPlanTemplate, generateCommonRunPlanEveryDay, postRunPlanTemplate } from '@/api/runplan';
import { runPlanTemplateList, deleteRunPlanTemplate, generateCommonRunPlanEveryDay, postRunPlanTemplate, updateTemplateRunPlan } from '@/api/runplan';
import { UrlConfig } from '@/scripts/ConstDic';
import CopyPlan from './copyPlan.vue';
import EditPlan from './editPlan.vue';
export default {
name: 'RunPlanTemplate',
components: {
CopyPlan
CopyPlan,
EditPlan
},
data() {
return {
@ -65,7 +68,7 @@ export default {
{
type: 'button',
title: this.$t('global.operate'),
width: '550',
width: '580',
hide: () => { return !this.$store.state.user.roles.includes(superAdmin); },
buttons: [
{
@ -78,6 +81,11 @@ export default {
handleClick: this.handleCopyPlan,
type: ''
},
{
name: '编辑',
handleClick: this.handleEdit,
type: ''
},
{
name: this.$t('global.preview'),
handleClick: this.handleView,
@ -142,6 +150,9 @@ export default {
handleCopyPlan(index, row) {
this.$refs.copyPlan.doShow({row:row, mapList:this.mapIdList});
},
handleEdit(index, row) {
this.$refs.editPlan.doShow(row);
},
//
handleGenerateEveryDay(planId, mapId) {
this.$confirm(this.$t('publish.wellGenerateEveryRunPlan'), this.$t('global.tips'), {
@ -175,6 +186,16 @@ export default {
});
}).catch(() => { });
},
handleUpdateRunPlan(data) {
updateTemplateRunPlan(data).then(resp => {
this.reloadTable();
this.$refs.editPlan.doClose();
this.$message.success('编辑模板运行图成功!');
}).catch(e => {
this.reloadTable();
this.$message.error('编辑模板运行图失败:' + e.message);
});
},
//
handleView(index, row) {
const data = this.mapIdList.filter(elem=>{ return elem.id == row.mapId; })[0];