ibp编辑 - 紧急停车按钮和报警器区分上下行

This commit is contained in:
yuan 2021-06-17 13:51:54 +08:00
parent 0879173066
commit ecea32ad9c
3 changed files with 52 additions and 15 deletions

View File

@ -6,7 +6,7 @@ export function getBaseUrl() {
// 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

@ -15,6 +15,16 @@
<el-form-item :label="this.$t('ibp.yCoordinate')">
<el-input-number v-model="form.y" controls-position="right" :min="1" />
</el-form-item>
<el-form-item label="方向">
<el-select v-model="form.direction" placeholder="请选择">
<el-option
v-for="(item, i) in directions"
:key="{i}"
:label="item.name"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
<el-button v-show="showDeleteButton" type="danger" @click="deleteDevice">{{ $t('global.delete') }}</el-button>
@ -38,7 +48,8 @@ export default {
code: '',
alarmWidth: '',
x: 10,
y: 10
y: 10,
direction: '',
},
rules: {
code: [
@ -47,7 +58,12 @@ export default {
alarmWidth: [
{ required: true, message: this.$t('rules.enterTheAlarmWidth'), trigger: 'blur' }
]
}
},
directions: [
{ name: '全部', value: null},
{ name: '上行', value: true},
{ name: '下行', value: false},
],
};
},
computed: {
@ -64,6 +80,7 @@ export default {
this.form.alarmWidth = model.width;
this.form.x = model.point.x;
this.form.y = model.point.y;
this.form.direction = model.direction
}
}
},
@ -80,7 +97,8 @@ export default {
},
code: this.form.code,
_type: 'Alarm',
width: this.form.alarmWidth
width: this.form.alarmWidth,
direction: this.form.direction
};
this.$emit('createData', alarmModel);
this.initPage();
@ -97,7 +115,8 @@ export default {
},
code: this.form.code,
_type: 'Alarm',
width: this.form.alarmWidth
width: this.form.alarmWidth,
direction: this.form.direction
};
this.$emit('deleteDataModel', alarmModel );
this.initPage();
@ -110,7 +129,8 @@ export default {
code: '',
alarmWidth: '',
x: 10,
y: 10
y: 10,
direction: ''
};
},
generateCode() {

View File

@ -44,6 +44,16 @@
/>
</el-select>
</el-form-item>
<el-form-item v-if="['JJTC', 'QXJJTC', 'BJQC'].includes(form.mean)" label="方向">
<el-select v-model="form.direction" placeholder="请选择">
<el-option
v-for="(item, i) in directions"
:key="{i}"
:label="item.name"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
<el-button v-show="showDeleteButton" type="danger" @click="deleteDevice">{{ $t('global.delete') }}</el-button>
@ -85,7 +95,8 @@ export default {
x: 10,
y: 10,
sectionCode: '',
mean: ''
mean: '',
direction: ''
},
rules: {
code: [
@ -99,9 +110,14 @@ export default {
],
sectionCode: [
{ required: true, message: '请选择关联区段', trigger: 'blur' }
]
],
},
sectionList: []
sectionList: [],
directions: [
{ name: '全部', value: null},
{ name: '上行', value: true},
{ name: '下行', value: false},
],
};
},
computed: {
@ -121,6 +137,7 @@ export default {
this.form.y = model.point.y;
this.form.mean = model.mean;
this.form.sectionCode = model.sectionCode;
this.form.direction = model.direction;
}
}
},
@ -142,9 +159,6 @@ export default {
}
},
methods: {
// consoleChange() {
// console.log(this.form.mean === 'PRERESET', this.form.mean );
// },
onSubmit(form) {
this.$refs[form].validate((valid) => {
if (valid) {
@ -159,7 +173,8 @@ export default {
status: 'off',
width: this.form.buttonWidth,
mean: this.form.mean,
sectionCode: this.form.sectionCode
sectionCode: this.form.sectionCode,
direction: this.form.direction,
};
this.$emit('createData', buttonModel);
this.initPage();
@ -180,7 +195,8 @@ export default {
status: 'off',
width: this.form.buttonWidth,
mean: this.form.mean,
sectionCode: this.form.sectionCode
sectionCode: this.form.sectionCode,
direction: this.form.direction,
};
this.$emit('deleteDataModel', buttonModel );
this.initPage();
@ -196,7 +212,8 @@ export default {
x: 10,
y: 10,
mean: '',
sectionCode: ''
sectionCode: '',
direction: '',
};
},
generateCode() {