Merge branch 'test' of https://git.code.tencent.com/lian-cbtc/jl-client into test
This commit is contained in:
commit
b44e193bcf
@ -25,8 +25,8 @@ export function jl3dEditorLoader(mapid,scope){
|
|||||||
|
|
||||||
if(data.data ){
|
if(data.data ){
|
||||||
if(data.data.assets){
|
if(data.data.assets){
|
||||||
initData(editmapid,data.data.id);
|
// initData(editmapid,data.data.id);
|
||||||
// loadData(editmapid,data.data);
|
loadData(editmapid,data.data);
|
||||||
}else{
|
}else{
|
||||||
initData(editmapid,data.data.id);
|
initData(editmapid,data.data.id);
|
||||||
}
|
}
|
||||||
|
@ -45,6 +45,7 @@ export function StationStandList() {
|
|||||||
let stand= {
|
let stand= {
|
||||||
code : stationstanddata[j].code,
|
code : stationstanddata[j].code,
|
||||||
position : stationstanddata[j].position,
|
position : stationstanddata[j].position,
|
||||||
|
posy:stationstanddata[j].position.y,
|
||||||
name : stationstanddata[j].name,
|
name : stationstanddata[j].name,
|
||||||
right : stationstanddata[j].right,
|
right : stationstanddata[j].right,
|
||||||
section : stationstanddata[j].standTrackCode,
|
section : stationstanddata[j].standTrackCode,
|
||||||
@ -75,13 +76,14 @@ export function StationStandList() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(newstationstand.code != null){
|
if(newstationstand.code != null){
|
||||||
|
newstationstand.stands.sort(compare("posy"));
|
||||||
scope.list.push(newstationstand);
|
scope.list.push(newstationstand);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
console.log(scope.list);
|
||||||
resolve("loadedstation");
|
resolve("loadedstation");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -207,6 +209,13 @@ export function StationStandList() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
function compare(property){
|
||||||
|
return function(a,b){
|
||||||
|
var value1 = a[property];
|
||||||
|
var value2 = b[property];
|
||||||
|
return value1 - value2;
|
||||||
|
}
|
||||||
|
}
|
||||||
//canvas文字贴图方法
|
//canvas文字贴图方法
|
||||||
//PS:待提炼 增强功能
|
//PS:待提炼 增强功能
|
||||||
function getTextCanvas(text){
|
function getTextCanvas(text){
|
||||||
|
@ -1,124 +1,124 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-form ref="form" :rules="rules" :model="form" label-width="100px">
|
<el-form ref="form" :rules="rules" :model="form" label-width="100px">
|
||||||
<el-form-item :label="this.$t('ibp.alarmCode')" prop="code">
|
<el-form-item :label="this.$t('ibp.alarmCode')" prop="code">
|
||||||
<el-input :disabled="true" v-model="form.code">
|
<el-input v-model="form.code" :disabled="true">
|
||||||
<el-button slot="append" :disabled="isUpdate" type="primary" @click="generateCode">{{$t('ibp.generateCode')}}</el-button>
|
<el-button slot="append" :disabled="isUpdate" type="primary" @click="generateCode">{{ $t('ibp.generateCode') }}</el-button>
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="this.$t('ibp.alarmWidth')" prop="alarmWidth">
|
<el-form-item :label="this.$t('ibp.alarmWidth')" prop="alarmWidth">
|
||||||
<el-input-number v-model="form.alarmWidth" controls-position="right" :min="1"></el-input-number>
|
<el-input-number v-model="form.alarmWidth" controls-position="right" :min="1" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="this.$t('ibp.xCoordinate')">
|
<el-form-item :label="this.$t('ibp.xCoordinate')">
|
||||||
<el-input-number v-model="form.x" controls-position="right" :min="1"></el-input-number>
|
<el-input-number v-model="form.x" controls-position="right" :min="1" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="this.$t('ibp.yCoordinate')">
|
<el-form-item :label="this.$t('ibp.yCoordinate')">
|
||||||
<el-input-number v-model="form.y" controls-position="right" :min="1"></el-input-number>
|
<el-input-number v-model="form.y" controls-position="right" :min="1" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
|
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
|
||||||
<el-button v-show="showDeleteButton" @click="deleteDevice" type="danger">{{$t('global.delete')}}</el-button>
|
<el-button v-show="showDeleteButton" type="danger" @click="deleteDevice">{{ $t('global.delete') }}</el-button>
|
||||||
<el-button v-show="showDeleteButton" @click="initPage">{{$t('global.cancel')}}</el-button>
|
<el-button v-show="showDeleteButton" @click="initPage">{{ $t('global.cancel') }}</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: 'ButtonDraft',
|
name: 'ButtonDraft',
|
||||||
components: {
|
components: {
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
isUpdate: false,
|
isUpdate: false,
|
||||||
buttonText: this.$t('ibp.createNow'),
|
buttonText: this.$t('ibp.createNow'),
|
||||||
showDeleteButton: false,
|
showDeleteButton: false,
|
||||||
form: {
|
form: {
|
||||||
code: '',
|
code: '',
|
||||||
alarmWidth: '',
|
alarmWidth: '',
|
||||||
x: 10,
|
x: 10,
|
||||||
y: 10
|
y: 10
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
code: [
|
code: [
|
||||||
{ required: true, message: this.$t('rules.enterTheAlarmCode'), trigger: 'blur' },
|
{ required: true, message: this.$t('rules.enterTheAlarmCode'), trigger: 'blur' }
|
||||||
],
|
],
|
||||||
alarmWidth: [
|
alarmWidth: [
|
||||||
{ required: true, message: this.$t('rules.enterTheAlarmWidth'), trigger: 'blur' },
|
{ required: true, message: this.$t('rules.enterTheAlarmWidth'), trigger: 'blur' }
|
||||||
]
|
]
|
||||||
}
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
'$store.state.ibp.rightClickCount': function (val) {
|
|
||||||
const model = this.$store.getters['ibp/updateDeviceData'];
|
|
||||||
if (model._type === 'Alarm' ){
|
|
||||||
this.buttonText = this.$t('global.modify');
|
|
||||||
this.showDeleteButton = true;
|
|
||||||
this.isUpdate = true;
|
|
||||||
this.form.code = model.code;
|
|
||||||
this.form.alarmWidth = model.width;
|
|
||||||
this.form.x = model.point.x;
|
|
||||||
this.form.y = model.point.y;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
};
|
||||||
mounted() {
|
},
|
||||||
},
|
computed: {
|
||||||
methods: {
|
|
||||||
onSubmit(form) {
|
},
|
||||||
this.$refs[form].validate((valid) => {
|
watch: {
|
||||||
if (valid){
|
'$store.state.ibp.rightClickCount': function (val) {
|
||||||
const alarmModel = {
|
const model = this.$store.getters['ibp/updateDeviceData'];
|
||||||
point:{
|
if (model._type === 'Alarm' ) {
|
||||||
x: this.form.x,
|
this.buttonText = this.$t('global.modify');
|
||||||
y: this.form.y
|
this.showDeleteButton = true;
|
||||||
},
|
this.isUpdate = true;
|
||||||
code: this.form.code,
|
this.form.code = model.code;
|
||||||
_type: 'Alarm',
|
this.form.alarmWidth = model.width;
|
||||||
width: this.form .alarmWidth,
|
this.form.x = model.point.x;
|
||||||
};
|
this.form.y = model.point.y;
|
||||||
this.$emit('createAlarm', alarmModel);
|
|
||||||
this.initPage();
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
deleteDevice() {
|
|
||||||
const alarmModel = {
|
|
||||||
point:{
|
|
||||||
x: this.form.x,
|
|
||||||
y: this.form.y
|
|
||||||
},
|
|
||||||
code: this.form.code,
|
|
||||||
_type: 'Alarm',
|
|
||||||
width: this.form .alarmWidth,
|
|
||||||
};
|
|
||||||
this.$emit('deleteDataModel',alarmModel );
|
|
||||||
this.initPage();
|
|
||||||
},
|
|
||||||
initPage() {
|
|
||||||
this.isUpdate = false;
|
|
||||||
this.buttonText = this.$t('ibp.createNow');
|
|
||||||
this.showDeleteButton = false;
|
|
||||||
this.form = {
|
|
||||||
code: '',
|
|
||||||
alarmWidth: '',
|
|
||||||
x: 10,
|
|
||||||
y: 10
|
|
||||||
};
|
|
||||||
},
|
|
||||||
generateCode() {
|
|
||||||
const mydate = new Date();
|
|
||||||
this.form.code = "alarm_"+mydate.getDay()+ mydate.getHours()+ mydate.getMinutes()+mydate.getSeconds()+mydate.getMilliseconds()+ Math.round(Math.random() * 10000);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
},
|
||||||
|
mounted() {
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
onSubmit(form) {
|
||||||
|
this.$refs[form].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
const alarmModel = {
|
||||||
|
point:{
|
||||||
|
x: this.form.x,
|
||||||
|
y: this.form.y
|
||||||
|
},
|
||||||
|
code: this.form.code,
|
||||||
|
_type: 'Alarm',
|
||||||
|
width: this.form.alarmWidth
|
||||||
|
};
|
||||||
|
this.$emit('createData', alarmModel);
|
||||||
|
this.initPage();
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
deleteDevice() {
|
||||||
|
const alarmModel = {
|
||||||
|
point:{
|
||||||
|
x: this.form.x,
|
||||||
|
y: this.form.y
|
||||||
|
},
|
||||||
|
code: this.form.code,
|
||||||
|
_type: 'Alarm',
|
||||||
|
width: this.form.alarmWidth
|
||||||
|
};
|
||||||
|
this.$emit('deleteDataModel', alarmModel );
|
||||||
|
this.initPage();
|
||||||
|
},
|
||||||
|
initPage() {
|
||||||
|
this.isUpdate = false;
|
||||||
|
this.buttonText = this.$t('ibp.createNow');
|
||||||
|
this.showDeleteButton = false;
|
||||||
|
this.form = {
|
||||||
|
code: '',
|
||||||
|
alarmWidth: '',
|
||||||
|
x: 10,
|
||||||
|
y: 10
|
||||||
|
};
|
||||||
|
},
|
||||||
|
generateCode() {
|
||||||
|
const mydate = new Date();
|
||||||
|
this.form.code = 'alarm_' + mydate.getDay() + mydate.getHours() + mydate.getMinutes() + mydate.getSeconds() + mydate.getMilliseconds() + Math.round(Math.random() * 10000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
|
|
||||||
|
@ -1,146 +1,146 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-form ref="form" :rules="rules" :model="form" label-width="100px">
|
<el-form ref="form" :rules="rules" :model="form" label-width="100px">
|
||||||
<el-form-item :label="this.$t('ibp.escalatorFrameCode')" prop="code">
|
<el-form-item :label="this.$t('ibp.escalatorFrameCode')" prop="code">
|
||||||
<el-input :disabled="true" v-model="form.code" >
|
<el-input v-model="form.code" :disabled="true">
|
||||||
<el-button slot="append" :disabled="isUpdate" type="primary" @click="generateCode">{{$t('ibp.generateCode')}}</el-button>
|
<el-button slot="append" :disabled="isUpdate" type="primary" @click="generateCode">{{ $t('ibp.generateCode') }}</el-button>
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="this.$t('ibp.escalatorFrameWidth')" prop="appendageBoxWidth">
|
<el-form-item :label="this.$t('ibp.escalatorFrameWidth')" prop="appendageBoxWidth">
|
||||||
<el-input-number v-model="form.appendageBoxWidth" controls-position="right" :min="50"></el-input-number>
|
<el-input-number v-model="form.appendageBoxWidth" controls-position="right" :min="50" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="this.$t('ibp.escalatorFrameHeight')" prop="appendageBoxHeight">
|
<el-form-item :label="this.$t('ibp.escalatorFrameHeight')" prop="appendageBoxHeight">
|
||||||
<el-input-number v-model="form.appendageBoxHeight" controls-position="right" :min="75"></el-input-number>
|
<el-input-number v-model="form.appendageBoxHeight" controls-position="right" :min="75" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="this.$t('ibp.borderWidth')" prop="borderWidth">
|
<el-form-item :label="this.$t('ibp.borderWidth')" prop="borderWidth">
|
||||||
<el-input-number v-model="form.borderWidth" controls-position="right" :min="1"></el-input-number><span>  {{$t('ibp.recommendedSize')}}</span>
|
<el-input-number v-model="form.borderWidth" controls-position="right" :min="1" /><span> {{ $t('ibp.recommendedSize') }}</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="this.$t('ibp.xCoordinate')">
|
<el-form-item :label="this.$t('ibp.xCoordinate')">
|
||||||
<el-input-number v-model="form.x" controls-position="right" :min="1"></el-input-number>
|
<el-input-number v-model="form.x" controls-position="right" :min="1" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="this.$t('ibp.yCoordinate')">
|
<el-form-item :label="this.$t('ibp.yCoordinate')">
|
||||||
<el-input-number v-model="form.y" controls-position="right" :min="1"></el-input-number>
|
<el-input-number v-model="form.y" controls-position="right" :min="1" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
|
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
|
||||||
<el-button v-show="showDeleteButton" @click="deleteDevice" type="danger">{{$t('global.delete')}}</el-button>
|
<el-button v-show="showDeleteButton" type="danger" @click="deleteDevice">{{ $t('global.delete') }}</el-button>
|
||||||
<el-button v-show="showDeleteButton" @click="initPage">{{$t('global.cancel')}}</el-button>
|
<el-button v-show="showDeleteButton" @click="initPage">{{ $t('global.cancel') }}</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: 'AppendageBoxDraft',
|
name: 'AppendageBoxDraft',
|
||||||
components: {
|
components: {
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
isUpdate: false,
|
isUpdate: false,
|
||||||
buttonText: this.$t('ibp.createNow'),
|
buttonText: this.$t('ibp.createNow'),
|
||||||
showDeleteButton: false,
|
showDeleteButton: false,
|
||||||
form: {
|
form: {
|
||||||
code: '',
|
code: '',
|
||||||
appendageBoxWidth: '',
|
appendageBoxWidth: '',
|
||||||
appendageBoxHeight: '',
|
appendageBoxHeight: '',
|
||||||
x: 10,
|
x: 10,
|
||||||
y: 10,
|
y: 10,
|
||||||
borderWidth: 25
|
borderWidth: 25
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
code: [
|
code: [
|
||||||
{ required: true, message: this.$t('ibp.enterTheEscalatorFrameCode'), trigger: 'blur' },
|
{ required: true, message: this.$t('ibp.enterTheEscalatorFrameCode'), trigger: 'blur' }
|
||||||
],
|
],
|
||||||
appendageBoxWidth: [
|
appendageBoxWidth: [
|
||||||
{ required: true, message: this.$t('ibp.enterTheEscalatorFrameWidth'), trigger: 'blur' },
|
{ required: true, message: this.$t('ibp.enterTheEscalatorFrameWidth'), trigger: 'blur' }
|
||||||
],
|
],
|
||||||
appendageBoxHeight: [
|
appendageBoxHeight: [
|
||||||
{ required: true, message: this.$t('ibp.enterTheEscalatorFrameHeight'), trigger: 'blur' },
|
{ required: true, message: this.$t('ibp.enterTheEscalatorFrameHeight'), trigger: 'blur' }
|
||||||
],
|
],
|
||||||
borderWidth: [
|
borderWidth: [
|
||||||
{ required: true, message: this.$t('ibp.enterTheBorderWidth'), trigger: 'blur'},
|
{ required: true, message: this.$t('ibp.enterTheBorderWidth'), trigger: 'blur'}
|
||||||
]
|
]
|
||||||
}
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
'$store.state.ibp.rightClickCount': function (val) {
|
|
||||||
const model = this.$store.getters['ibp/updateDeviceData'];
|
|
||||||
if (model._type === 'AppendageBox' ){
|
|
||||||
this.buttonText = this.$t('global.modify');
|
|
||||||
this.showDeleteButton = true;
|
|
||||||
this.isUpdate = true;
|
|
||||||
this.form.code = model.code;
|
|
||||||
this.form.appendageBoxWidth = model.width;
|
|
||||||
this.form.appendageBoxHeight = model.height;
|
|
||||||
this.form.x = model.point.x;
|
|
||||||
this.form.y = model.point.y;
|
|
||||||
this.form.borderWidth = model.borderWidth
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
};
|
||||||
mounted() {
|
},
|
||||||
},
|
computed: {
|
||||||
methods: {
|
|
||||||
onSubmit(form) {
|
},
|
||||||
this.$refs[form].validate((valid) => {
|
watch: {
|
||||||
if (valid){
|
'$store.state.ibp.rightClickCount': function (val) {
|
||||||
const appendageBoxModel = {
|
const model = this.$store.getters['ibp/updateDeviceData'];
|
||||||
point: {
|
if (model._type === 'AppendageBox' ) {
|
||||||
x: this.form.x,
|
this.buttonText = this.$t('global.modify');
|
||||||
y: this.form.y
|
this.showDeleteButton = true;
|
||||||
},
|
this.isUpdate = true;
|
||||||
_type: 'AppendageBox',
|
this.form.code = model.code;
|
||||||
code: this.form.code,
|
this.form.appendageBoxWidth = model.width;
|
||||||
width: this.form .appendageBoxWidth,
|
this.form.appendageBoxHeight = model.height;
|
||||||
height: this.form.appendageBoxHeight,
|
this.form.x = model.point.x;
|
||||||
borderWidth: this.form.borderWidth
|
this.form.y = model.point.y;
|
||||||
};
|
this.form.borderWidth = model.borderWidth;
|
||||||
this.$emit('createAppendageBox', appendageBoxModel);
|
|
||||||
this.initPage();
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
deleteDevice() {
|
|
||||||
const appendageBoxModel = {
|
|
||||||
point: {
|
|
||||||
x: this.form.x,
|
|
||||||
y: this.form.y
|
|
||||||
},
|
|
||||||
_type: 'AppendageBox',
|
|
||||||
code: this.form.code,
|
|
||||||
width: this.form .appendageBoxWidth,
|
|
||||||
height: this.form.appendageBoxHeight,
|
|
||||||
borderWidth: this.form.borderWidth
|
|
||||||
};
|
|
||||||
this.$emit('deleteDataModel',appendageBoxModel );
|
|
||||||
this.initPage();
|
|
||||||
},
|
|
||||||
initPage() {
|
|
||||||
this.isUpdate = false;
|
|
||||||
this.buttonText = this.$t('ibp.createNow');
|
|
||||||
this.showDeleteButton = false;
|
|
||||||
this.form = {
|
|
||||||
code: '',
|
|
||||||
appendageBoxWidth: '',
|
|
||||||
appendageBoxHeight: '',
|
|
||||||
borderWidth: 25,
|
|
||||||
x: 10,
|
|
||||||
y: 10
|
|
||||||
};
|
|
||||||
},
|
|
||||||
generateCode() {
|
|
||||||
const mydate = new Date();
|
|
||||||
this.form.code = "aBox"+mydate.getDay()+ mydate.getHours()+ mydate.getMinutes()+mydate.getSeconds()+mydate.getMilliseconds()+ Math.round(Math.random() * 10000);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
},
|
||||||
|
mounted() {
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
onSubmit(form) {
|
||||||
|
this.$refs[form].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
const appendageBoxModel = {
|
||||||
|
point: {
|
||||||
|
x: this.form.x,
|
||||||
|
y: this.form.y
|
||||||
|
},
|
||||||
|
_type: 'AppendageBox',
|
||||||
|
code: this.form.code,
|
||||||
|
width: this.form.appendageBoxWidth,
|
||||||
|
height: this.form.appendageBoxHeight,
|
||||||
|
borderWidth: this.form.borderWidth
|
||||||
|
};
|
||||||
|
this.$emit('createData', appendageBoxModel);
|
||||||
|
this.initPage();
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
deleteDevice() {
|
||||||
|
const appendageBoxModel = {
|
||||||
|
point: {
|
||||||
|
x: this.form.x,
|
||||||
|
y: this.form.y
|
||||||
|
},
|
||||||
|
_type: 'AppendageBox',
|
||||||
|
code: this.form.code,
|
||||||
|
width: this.form.appendageBoxWidth,
|
||||||
|
height: this.form.appendageBoxHeight,
|
||||||
|
borderWidth: this.form.borderWidth
|
||||||
|
};
|
||||||
|
this.$emit('deleteDataModel', appendageBoxModel );
|
||||||
|
this.initPage();
|
||||||
|
},
|
||||||
|
initPage() {
|
||||||
|
this.isUpdate = false;
|
||||||
|
this.buttonText = this.$t('ibp.createNow');
|
||||||
|
this.showDeleteButton = false;
|
||||||
|
this.form = {
|
||||||
|
code: '',
|
||||||
|
appendageBoxWidth: '',
|
||||||
|
appendageBoxHeight: '',
|
||||||
|
borderWidth: 25,
|
||||||
|
x: 10,
|
||||||
|
y: 10
|
||||||
|
};
|
||||||
|
},
|
||||||
|
generateCode() {
|
||||||
|
const mydate = new Date();
|
||||||
|
this.form.code = 'aBox' + mydate.getDay() + mydate.getHours() + mydate.getMinutes() + mydate.getSeconds() + mydate.getMilliseconds() + Math.round(Math.random() * 10000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
|
|
||||||
|
@ -1,163 +1,163 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-form ref="form" :rules="rules" :model="form" label-width="100px">
|
<el-form ref="form" :rules="rules" :model="form" label-width="100px">
|
||||||
<el-form-item :label="this.$t('ibp.arrowCode')" prop="code">
|
<el-form-item :label="this.$t('ibp.arrowCode')" prop="code">
|
||||||
<el-input :disabled="true" v-model="form.code" >
|
<el-input v-model="form.code" :disabled="true">
|
||||||
<el-button slot="append" :disabled="isUpdate" type="primary" @click="generateCode">{{$t('ibp.generateCode')}}</el-button>
|
<el-button slot="append" :disabled="isUpdate" type="primary" @click="generateCode">{{ $t('ibp.generateCode') }}</el-button>
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="this.$t('ibp.arrowDirection')" prop="orientation">
|
<el-form-item :label="this.$t('ibp.arrowDirection')" prop="orientation">
|
||||||
<el-select v-model="form.orientation" :placeholder="this.$t('rules.selectTheDirectionOfTheArrow')">
|
<el-select v-model="form.orientation" :placeholder="this.$t('rules.selectTheDirectionOfTheArrow')">
|
||||||
<el-option :label="this.$t('ibp.up')" value="top"></el-option>
|
<el-option :label="this.$t('ibp.up')" value="top" />
|
||||||
<el-option :label="this.$t('ibp.down')" value="bottom"></el-option>
|
<el-option :label="this.$t('ibp.down')" value="bottom" />
|
||||||
<el-option :label="this.$t('ibp.left')" value="left"></el-option>
|
<el-option :label="this.$t('ibp.left')" value="left" />
|
||||||
<el-option :label="this.$t('ibp.right')" value="right"></el-option>
|
<el-option :label="this.$t('ibp.right')" value="right" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="this.$t('ibp.arrowLength')" prop="arrowLength">
|
<el-form-item :label="this.$t('ibp.arrowLength')" prop="arrowLength">
|
||||||
<el-input-number v-model="form.arrowLength" controls-position="right" :min="1"></el-input-number>
|
<el-input-number v-model="form.arrowLength" controls-position="right" :min="1" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="this.$t('ibp.arrowWidth')" prop="arrowLength">
|
<el-form-item :label="this.$t('ibp.arrowWidth')" prop="arrowLength">
|
||||||
<el-input-number v-model="form.arrowWidth" controls-position="right" :min="1"></el-input-number>
|
<el-input-number v-model="form.arrowWidth" controls-position="right" :min="1" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="this.$t('ibp.arrowColor')" prop="fillColor">
|
<el-form-item :label="this.$t('ibp.arrowColor')" prop="fillColor">
|
||||||
<el-color-picker v-model="form.fillColor"></el-color-picker>
|
<el-color-picker v-model="form.fillColor" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="this.$t('ibp.vertexXCoordinate')">
|
<el-form-item :label="this.$t('ibp.vertexXCoordinate')">
|
||||||
<el-input-number v-model="form.x" controls-position="right" :min="1"></el-input-number>
|
<el-input-number v-model="form.x" controls-position="right" :min="1" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="this.$t('ibp.vertexYCoordinate')">
|
<el-form-item :label="this.$t('ibp.vertexYCoordinate')">
|
||||||
<el-input-number v-model="form.y" controls-position="right" :min="1"></el-input-number>
|
<el-input-number v-model="form.y" controls-position="right" :min="1" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
|
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
|
||||||
<el-button v-show="showDeleteButton" @click="deleteDevice" type="danger">{{$t('global.delete')}}</el-button>
|
<el-button v-show="showDeleteButton" type="danger" @click="deleteDevice">{{ $t('global.delete') }}</el-button>
|
||||||
<el-button v-show="showDeleteButton" @click="initPage">{{$t('global.cancel')}}</el-button>
|
<el-button v-show="showDeleteButton" @click="initPage">{{ $t('global.cancel') }}</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: 'ArrowDraft',
|
name: 'ArrowDraft',
|
||||||
components: {
|
components: {
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
isUpdate: false,
|
isUpdate: false,
|
||||||
buttonText: this.$t('ibp.createNow'),
|
buttonText: this.$t('ibp.createNow'),
|
||||||
showDeleteButton: false,
|
showDeleteButton: false,
|
||||||
form: {
|
form: {
|
||||||
code: '',
|
code: '',
|
||||||
orientation: 'left',
|
orientation: 'left',
|
||||||
arrowWidth: '',
|
arrowWidth: '',
|
||||||
arrowLength: '',
|
arrowLength: '',
|
||||||
fillColor: '',
|
fillColor: '',
|
||||||
x: 10,
|
x: 10,
|
||||||
y: 10
|
y: 10
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
code: [
|
code: [
|
||||||
{ required: true, message: this.$t('rules.enterTheArrowCode'), trigger: 'blur' },
|
{ required: true, message: this.$t('rules.enterTheArrowCode'), trigger: 'blur' }
|
||||||
],
|
],
|
||||||
orientation: [
|
orientation: [
|
||||||
{ required: true, message: this.$t('rules.selectTheDirectionOfTheArrow'), trigger: 'change'}
|
{ required: true, message: this.$t('rules.selectTheDirectionOfTheArrow'), trigger: 'change'}
|
||||||
],
|
],
|
||||||
arrowLength: [
|
arrowLength: [
|
||||||
{ required: true, message: this.$t('rules.enterTheArrowLength'), trigger: 'blur' },
|
{ required: true, message: this.$t('rules.enterTheArrowLength'), trigger: 'blur' }
|
||||||
],
|
],
|
||||||
arrowWidth: [
|
arrowWidth: [
|
||||||
{ required: true, message: this.$t('rules.enterTheArrowWidth'), trigger: 'blur' },
|
{ required: true, message: this.$t('rules.enterTheArrowWidth'), trigger: 'blur' }
|
||||||
],
|
],
|
||||||
fillColor: [
|
fillColor: [
|
||||||
{ required: true, message: this.$t('rules.enterTheArrowColor'), trigger: 'blur' },
|
{ required: true, message: this.$t('rules.enterTheArrowColor'), trigger: 'blur' }
|
||||||
],
|
]
|
||||||
}
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
'$store.state.ibp.rightClickCount': function (val) {
|
|
||||||
const model = this.$store.getters['ibp/updateDeviceData'];
|
|
||||||
if (model._type === 'Arrow' ){
|
|
||||||
this.buttonText = this.$t('global.modify');
|
|
||||||
this.showDeleteButton = true;
|
|
||||||
this.isUpdate = true;
|
|
||||||
this.form.code = model.code;
|
|
||||||
this.form.orientation = model.orientation;
|
|
||||||
this.form.arrowLength = model.length;
|
|
||||||
this.form.arrowWidth = model.width;
|
|
||||||
this.form.fillColor = model.fill;
|
|
||||||
this.form.x = model.point.x;
|
|
||||||
this.form.y = model.point.y;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
};
|
||||||
mounted() {
|
},
|
||||||
},
|
computed: {
|
||||||
methods: {
|
|
||||||
onSubmit(form) {
|
|
||||||
this.$refs[form].validate((valid) => {
|
|
||||||
if (valid){
|
|
||||||
const arrowModel = {
|
|
||||||
point: {
|
|
||||||
x: this.form.x,
|
|
||||||
y: this.form.y
|
|
||||||
},
|
|
||||||
_type: 'Arrow',
|
|
||||||
code: this.form.code,
|
|
||||||
orientation: this.form.orientation,
|
|
||||||
fill: this.form.fillColor,
|
|
||||||
width: this.form .arrowWidth,
|
|
||||||
length: this.form.arrowLength,
|
|
||||||
};
|
|
||||||
this.$emit('createArrow', arrowModel);
|
|
||||||
this.initPage();
|
|
||||||
}else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
},
|
},
|
||||||
deleteDevice() {
|
watch: {
|
||||||
const arrowModel = {
|
'$store.state.ibp.rightClickCount': function (val) {
|
||||||
point: {
|
const model = this.$store.getters['ibp/updateDeviceData'];
|
||||||
x: this.form.x,
|
if (model._type === 'Arrow' ) {
|
||||||
y: this.form.y
|
this.buttonText = this.$t('global.modify');
|
||||||
},
|
this.showDeleteButton = true;
|
||||||
_type: 'Arrow',
|
this.isUpdate = true;
|
||||||
code: this.form.code,
|
this.form.code = model.code;
|
||||||
orientation: this.form.orientation,
|
this.form.orientation = model.orientation;
|
||||||
fill: this.form.fillColor,
|
this.form.arrowLength = model.length;
|
||||||
width: this.form .arrowWidth,
|
this.form.arrowWidth = model.width;
|
||||||
length: this.form.arrowLength,
|
this.form.fillColor = model.fill;
|
||||||
};
|
this.form.x = model.point.x;
|
||||||
this.$emit('deleteDataModel',arrowModel);
|
this.form.y = model.point.y;
|
||||||
this.initPage();
|
|
||||||
},
|
|
||||||
initPage() {
|
|
||||||
this.isUpdate = false;
|
|
||||||
this.buttonText = this.$t('ibp.createNow');
|
|
||||||
this.showDeleteButton = false;
|
|
||||||
this.form = {
|
|
||||||
code: '',
|
|
||||||
orientation: 'left',
|
|
||||||
arrowWidth: '',
|
|
||||||
arrowLength: '',
|
|
||||||
fillColor: '',
|
|
||||||
x: 10,
|
|
||||||
y: 10
|
|
||||||
};
|
|
||||||
},
|
|
||||||
generateCode() {
|
|
||||||
const mydate = new Date();
|
|
||||||
this.form.code = "arrow_"+mydate.getDay()+ mydate.getHours()+ mydate.getMinutes()+mydate.getSeconds()+mydate.getMilliseconds()+ Math.round(Math.random() * 10000);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
},
|
||||||
|
mounted() {
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
onSubmit(form) {
|
||||||
|
this.$refs[form].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
const arrowModel = {
|
||||||
|
point: {
|
||||||
|
x: this.form.x,
|
||||||
|
y: this.form.y
|
||||||
|
},
|
||||||
|
_type: 'Arrow',
|
||||||
|
code: this.form.code,
|
||||||
|
orientation: this.form.orientation,
|
||||||
|
fill: this.form.fillColor,
|
||||||
|
width: this.form.arrowWidth,
|
||||||
|
length: this.form.arrowLength
|
||||||
|
};
|
||||||
|
this.$emit('createData', arrowModel);
|
||||||
|
this.initPage();
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
},
|
||||||
|
deleteDevice() {
|
||||||
|
const arrowModel = {
|
||||||
|
point: {
|
||||||
|
x: this.form.x,
|
||||||
|
y: this.form.y
|
||||||
|
},
|
||||||
|
_type: 'Arrow',
|
||||||
|
code: this.form.code,
|
||||||
|
orientation: this.form.orientation,
|
||||||
|
fill: this.form.fillColor,
|
||||||
|
width: this.form.arrowWidth,
|
||||||
|
length: this.form.arrowLength
|
||||||
|
};
|
||||||
|
this.$emit('deleteDataModel', arrowModel);
|
||||||
|
this.initPage();
|
||||||
|
},
|
||||||
|
initPage() {
|
||||||
|
this.isUpdate = false;
|
||||||
|
this.buttonText = this.$t('ibp.createNow');
|
||||||
|
this.showDeleteButton = false;
|
||||||
|
this.form = {
|
||||||
|
code: '',
|
||||||
|
orientation: 'left',
|
||||||
|
arrowWidth: '',
|
||||||
|
arrowLength: '',
|
||||||
|
fillColor: '',
|
||||||
|
x: 10,
|
||||||
|
y: 10
|
||||||
|
};
|
||||||
|
},
|
||||||
|
generateCode() {
|
||||||
|
const mydate = new Date();
|
||||||
|
this.form.code = 'arrow_' + mydate.getDay() + mydate.getHours() + mydate.getMinutes() + mydate.getSeconds() + mydate.getMilliseconds() + Math.round(Math.random() * 10000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ export default {
|
|||||||
width: this.form.bgWidth,
|
width: this.form.bgWidth,
|
||||||
height: this.form.bgHeight
|
height: this.form.bgHeight
|
||||||
};
|
};
|
||||||
this.$emit('updateBg', bgModel);
|
this.$emit('createData', bgModel);
|
||||||
},
|
},
|
||||||
initPage() {
|
initPage() {
|
||||||
this.form.bgWidth = this.$store.state.ibp.ibpBgDevice.model ? this.$store.state.ibp.ibpBgDevice.model.width : 1;
|
this.form.bgWidth = this.$store.state.ibp.ibpBgDevice.model ? this.$store.state.ibp.ibpBgDevice.model.width : 1;
|
||||||
|
@ -118,7 +118,7 @@ export default {
|
|||||||
width: this.form.buttonWidth,
|
width: this.form.buttonWidth,
|
||||||
mean: this.from.mean
|
mean: this.from.mean
|
||||||
};
|
};
|
||||||
this.$emit('createButton', buttonModel);
|
this.$emit('createData', buttonModel);
|
||||||
this.initPage();
|
this.initPage();
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
@ -1,125 +1,125 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-form ref="form" :rules="rules" :model="form" label-width="100px">
|
<el-form ref="form" :rules="rules" :model="form" label-width="100px">
|
||||||
<el-form-item :label="this.$t('ibp.digitalClockCode')" prop="code">
|
<el-form-item :label="this.$t('ibp.digitalClockCode')" prop="code">
|
||||||
<el-input :disabled="true" v-model="form.code" >
|
<el-input v-model="form.code" :disabled="true">
|
||||||
<el-button slot="append" :disabled="isUpdate" type="primary" @click="generateCode">{{$t('ibp.generateCode')}}</el-button>
|
<el-button slot="append" :disabled="isUpdate" type="primary" @click="generateCode">{{ $t('ibp.generateCode') }}</el-button>
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="this.$t('ibp.digitalClockWidth')" prop="clockWidth">
|
<el-form-item :label="this.$t('ibp.digitalClockWidth')" prop="clockWidth">
|
||||||
<el-input-number v-model="form.clockWidth" controls-position="right" :min="1"></el-input-number>
|
<el-input-number v-model="form.clockWidth" controls-position="right" :min="1" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="this.$t('ibp.xCoordinate')">
|
<el-form-item :label="this.$t('ibp.xCoordinate')">
|
||||||
<el-input-number v-model="form.x" controls-position="right" :min="1"></el-input-number>
|
<el-input-number v-model="form.x" controls-position="right" :min="1" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="this.$t('ibp.yCoordinate')">
|
<el-form-item :label="this.$t('ibp.yCoordinate')">
|
||||||
<el-input-number v-model="form.y" controls-position="right" :min="1"></el-input-number>
|
<el-input-number v-model="form.y" controls-position="right" :min="1" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
|
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
|
||||||
<el-button v-show="showDeleteButton" @click="deleteDevice" type="danger">{{$t('global.delete')}}</el-button>
|
<el-button v-show="showDeleteButton" type="danger" @click="deleteDevice">{{ $t('global.delete') }}</el-button>
|
||||||
<el-button v-show="showDeleteButton" @click="initPage">{{$t('global.cancel')}}</el-button>
|
<el-button v-show="showDeleteButton" @click="initPage">{{ $t('global.cancel') }}</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: 'ClockDraft',
|
name: 'ClockDraft',
|
||||||
components: {
|
components: {
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
isUpdate: false,
|
isUpdate: false,
|
||||||
buttonText: this.$t('ibp.createNow'),
|
buttonText: this.$t('ibp.createNow'),
|
||||||
showDeleteButton: false,
|
showDeleteButton: false,
|
||||||
form: {
|
form: {
|
||||||
code: '',
|
code: '',
|
||||||
clockWidth: '',
|
clockWidth: '',
|
||||||
x: 10,
|
x: 10,
|
||||||
y: 10
|
y: 10
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
code: [
|
code: [
|
||||||
{ required: true, message: this.$t('rules.enterTheDigitalClockCode'), trigger: 'blur' },
|
{ required: true, message: this.$t('rules.enterTheDigitalClockCode'), trigger: 'blur' }
|
||||||
],
|
],
|
||||||
clockWidth: [
|
clockWidth: [
|
||||||
{ required: true, message: this.$t('rules.enterTheDigitalClockWidth'), trigger: 'blur' },
|
{ required: true, message: this.$t('rules.enterTheDigitalClockWidth'), trigger: 'blur' }
|
||||||
]
|
]
|
||||||
}
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
'$store.state.ibp.rightClickCount': function (val) {
|
|
||||||
const model = this.$store.getters['ibp/updateDeviceData'];
|
|
||||||
if (model._type === 'Clock' ){
|
|
||||||
this.buttonText = this.$t('global.modify');
|
|
||||||
this.showDeleteButton = true;
|
|
||||||
this.isUpdate = true;
|
|
||||||
this.form.code = model.code;
|
|
||||||
this.form.clockWidth = model.width;
|
|
||||||
this.form.x = model.point.x;
|
|
||||||
this.form.y = model.point.y;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
};
|
||||||
mounted() {
|
},
|
||||||
},
|
computed: {
|
||||||
methods: {
|
|
||||||
onSubmit(form) {
|
},
|
||||||
this.$refs[form].validate((valid) => {
|
watch: {
|
||||||
if (valid) {
|
'$store.state.ibp.rightClickCount': function (val) {
|
||||||
const clockModel = {
|
const model = this.$store.getters['ibp/updateDeviceData'];
|
||||||
point: {
|
if (model._type === 'Clock' ) {
|
||||||
x: this.form.x,
|
this.buttonText = this.$t('global.modify');
|
||||||
y: this.form.y
|
this.showDeleteButton = true;
|
||||||
},
|
this.isUpdate = true;
|
||||||
_type: 'Clock',
|
this.form.code = model.code;
|
||||||
code: this.form.code,
|
this.form.clockWidth = model.width;
|
||||||
width: this.form.clockWidth,
|
this.form.x = model.point.x;
|
||||||
};
|
this.form.y = model.point.y;
|
||||||
this.$emit('createClock', clockModel);
|
|
||||||
this.initPage();
|
|
||||||
}else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
deleteDevice() {
|
|
||||||
const clockModel = {
|
|
||||||
point: {
|
|
||||||
x: this.form.x,
|
|
||||||
y: this.form.y
|
|
||||||
},
|
|
||||||
_type: 'Clock',
|
|
||||||
code: this.form.code,
|
|
||||||
width: this.form.clockWidth,
|
|
||||||
};
|
|
||||||
this.$emit('deleteDataModel',clockModel );
|
|
||||||
this.initPage();
|
|
||||||
},
|
|
||||||
initPage() {
|
|
||||||
this.isUpdate = false;
|
|
||||||
this.buttonText = this.$t('ibp.createNow');
|
|
||||||
this.showDeleteButton = false;
|
|
||||||
this.form = {
|
|
||||||
code: '',
|
|
||||||
buttonColor: '',
|
|
||||||
buttonWidth: '',
|
|
||||||
x: 10,
|
|
||||||
y: 10
|
|
||||||
};
|
|
||||||
},
|
|
||||||
generateCode() {
|
|
||||||
const mydate = new Date();
|
|
||||||
this.form.code = "clock_"+mydate.getDay()+ mydate.getHours()+ mydate.getMinutes()+mydate.getSeconds()+mydate.getMilliseconds()+ Math.round(Math.random() * 10000);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
},
|
||||||
|
mounted() {
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
onSubmit(form) {
|
||||||
|
this.$refs[form].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
const clockModel = {
|
||||||
|
point: {
|
||||||
|
x: this.form.x,
|
||||||
|
y: this.form.y
|
||||||
|
},
|
||||||
|
_type: 'Clock',
|
||||||
|
code: this.form.code,
|
||||||
|
width: this.form.clockWidth
|
||||||
|
};
|
||||||
|
this.$emit('createData', clockModel);
|
||||||
|
this.initPage();
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
deleteDevice() {
|
||||||
|
const clockModel = {
|
||||||
|
point: {
|
||||||
|
x: this.form.x,
|
||||||
|
y: this.form.y
|
||||||
|
},
|
||||||
|
_type: 'Clock',
|
||||||
|
code: this.form.code,
|
||||||
|
width: this.form.clockWidth
|
||||||
|
};
|
||||||
|
this.$emit('deleteDataModel', clockModel );
|
||||||
|
this.initPage();
|
||||||
|
},
|
||||||
|
initPage() {
|
||||||
|
this.isUpdate = false;
|
||||||
|
this.buttonText = this.$t('ibp.createNow');
|
||||||
|
this.showDeleteButton = false;
|
||||||
|
this.form = {
|
||||||
|
code: '',
|
||||||
|
buttonColor: '',
|
||||||
|
buttonWidth: '',
|
||||||
|
x: 10,
|
||||||
|
y: 10
|
||||||
|
};
|
||||||
|
},
|
||||||
|
generateCode() {
|
||||||
|
const mydate = new Date();
|
||||||
|
this.form.code = 'clock_' + mydate.getDay() + mydate.getHours() + mydate.getMinutes() + mydate.getSeconds() + mydate.getMilliseconds() + Math.round(Math.random() * 10000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
|
|
||||||
|
@ -1,161 +1,161 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-form ref="form" :rules="rules" :model="form" label-width="120px">
|
<el-form ref="form" :rules="rules" :model="form" label-width="120px">
|
||||||
<el-form-item :label="this.$t('ibp.escalatorCode')" prop="code">
|
<el-form-item :label="this.$t('ibp.escalatorCode')" prop="code">
|
||||||
<el-input :disabled="true" v-model="form.code">
|
<el-input v-model="form.code" :disabled="true">
|
||||||
<el-button slot="append" :disabled="isUpdate" type="primary" @click="generateCode">{{$t('ibp.generateCode')}}</el-button>
|
<el-button slot="append" :disabled="isUpdate" type="primary" @click="generateCode">{{ $t('ibp.generateCode') }}</el-button>
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="this.$t('ibp.escalatorWidth')" prop="elevatorWidth">
|
<el-form-item :label="this.$t('ibp.escalatorWidth')" prop="elevatorWidth">
|
||||||
<el-input-number v-model="form.elevatorWidth" controls-position="right" :min="1"></el-input-number>
|
<el-input-number v-model="form.elevatorWidth" controls-position="right" :min="1" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="this.$t('ibp.escalatorHeight')" prop="elevatorHeight">
|
<el-form-item :label="this.$t('ibp.escalatorHeight')" prop="elevatorHeight">
|
||||||
<el-input-number v-model="form.elevatorHeight" controls-position="right" :min="1"></el-input-number>
|
<el-input-number v-model="form.elevatorHeight" controls-position="right" :min="1" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="this.$t('ibp.escalatorColor')" prop="elevatorColor">
|
<el-form-item :label="this.$t('ibp.escalatorColor')" prop="elevatorColor">
|
||||||
<el-color-picker v-model="form.elevatorColor"></el-color-picker>
|
<el-color-picker v-model="form.elevatorColor" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="this.$t('ibp.startingDirection')" prop="direction">
|
<el-form-item :label="this.$t('ibp.startingDirection')" prop="direction">
|
||||||
<el-select v-model="form.direction" placeholder="请选择启动方向">
|
<el-select v-model="form.direction" placeholder="请选择启动方向">
|
||||||
<el-option :label="this.$t('ibp.doNotStart')" value="none"></el-option>
|
<el-option :label="this.$t('ibp.doNotStart')" value="none" />
|
||||||
<el-option :label="this.$t('ibp.startUp')" value="top"></el-option>
|
<el-option :label="this.$t('ibp.startUp')" value="top" />
|
||||||
<el-option :label="this.$t('ibp.startDown')" value="bottom"></el-option>
|
<el-option :label="this.$t('ibp.startDown')" value="bottom" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="this.$t('ibp.xCoordinate')">
|
<el-form-item :label="this.$t('ibp.xCoordinate')">
|
||||||
<el-input-number v-model="form.x" controls-position="right" :min="1"></el-input-number>
|
<el-input-number v-model="form.x" controls-position="right" :min="1" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="this.$t('ibp.yCoordinate')">
|
<el-form-item :label="this.$t('ibp.yCoordinate')">
|
||||||
<el-input-number v-model="form.y" controls-position="right" :min="1"></el-input-number>
|
<el-input-number v-model="form.y" controls-position="right" :min="1" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
|
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
|
||||||
<el-button v-show="showDeleteButton" @click="deleteDevice" type="danger">{{$t('global.delete')}}</el-button>
|
<el-button v-show="showDeleteButton" type="danger" @click="deleteDevice">{{ $t('global.delete') }}</el-button>
|
||||||
<el-button v-show="showDeleteButton" @click="initPage">{{$t('global.cancel')}}</el-button>
|
<el-button v-show="showDeleteButton" @click="initPage">{{ $t('global.cancel') }}</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: 'ElevatorDraft',
|
name: 'ElevatorDraft',
|
||||||
components: {
|
components: {
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
isUpdate: false,
|
isUpdate: false,
|
||||||
buttonText: this.$t('ibp.createNow'),
|
buttonText: this.$t('ibp.createNow'),
|
||||||
showDeleteButton: false,
|
showDeleteButton: false,
|
||||||
form: {
|
form: {
|
||||||
code: '',
|
code: '',
|
||||||
elevatorWidth: '',
|
elevatorWidth: '',
|
||||||
elevatorHeight: '',
|
elevatorHeight: '',
|
||||||
elevatorColor:'',
|
elevatorColor:'',
|
||||||
direction:'none',
|
direction:'none',
|
||||||
x: 10,
|
x: 10,
|
||||||
y: 10
|
y: 10
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
code: [
|
code: [
|
||||||
{ required: true, message: this.$t('ibp.enterTheElevatorCode'), trigger: 'blur' },
|
{ required: true, message: this.$t('ibp.enterTheElevatorCode'), trigger: 'blur' }
|
||||||
],
|
],
|
||||||
elevatorWidth: [
|
elevatorWidth: [
|
||||||
{ required: true, message: this.$t('ibp.enterTheElevatorWidth'), trigger: 'blur' },
|
{ required: true, message: this.$t('ibp.enterTheElevatorWidth'), trigger: 'blur' }
|
||||||
],
|
],
|
||||||
elevatorHeight: [
|
elevatorHeight: [
|
||||||
{ required: true, message: this.$t('ibp.enterTheElevatorHeight'), trigger: 'blur' },
|
{ required: true, message: this.$t('ibp.enterTheElevatorHeight'), trigger: 'blur' }
|
||||||
],
|
],
|
||||||
elevatorColor: [
|
elevatorColor: [
|
||||||
{ required: true, message: this.$t('ibp.enterTheElevatorColor'), trigger: 'change' },
|
{ required: true, message: this.$t('ibp.enterTheElevatorColor'), trigger: 'change' }
|
||||||
],
|
],
|
||||||
direction: [
|
direction: [
|
||||||
{ required: true, message: this.$t('ibp.selectTheStartingDirection'), trigger: 'change' },
|
{ required: true, message: this.$t('ibp.selectTheStartingDirection'), trigger: 'change' }
|
||||||
],
|
]
|
||||||
}
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
'$store.state.ibp.rightClickCount': function (val) {
|
|
||||||
const model = this.$store.getters['ibp/updateDeviceData'];
|
|
||||||
if (model._type === 'Elevator' ){
|
|
||||||
this.buttonText = this.$t('global.modify');
|
|
||||||
this.showDeleteButton = true;
|
|
||||||
this.isUpdate = true;
|
|
||||||
this.form.code = model.code;
|
|
||||||
this.form.elevatorWidth = model.width;
|
|
||||||
this.form.elevatorHeight = model.height;
|
|
||||||
this.form.elevatorColor = model.fillColor;
|
|
||||||
this.form.direction = model.direction;
|
|
||||||
this.form.x = model.point.x;
|
|
||||||
this.form.y = model.point.y;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
};
|
||||||
mounted() {
|
},
|
||||||
},
|
computed: {
|
||||||
methods: {
|
|
||||||
onSubmit(form) {
|
|
||||||
this.$refs[form].validate((valid) => {
|
|
||||||
if (valid){
|
|
||||||
const elevatorModel = {
|
|
||||||
point: {
|
|
||||||
x: this.form.x,
|
|
||||||
y: this.form.y
|
|
||||||
},
|
|
||||||
_type: 'Elevator',
|
|
||||||
code: this.form.code,
|
|
||||||
width: this.form.elevatorWidth,
|
|
||||||
height: this.form.elevatorHeight,
|
|
||||||
fillColor: this.form.elevatorColor,
|
|
||||||
direction: this.form.direction,
|
|
||||||
};
|
|
||||||
this.$emit('createElevator', elevatorModel);
|
|
||||||
this.initPage();
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
},
|
},
|
||||||
deleteDevice() {
|
watch: {
|
||||||
const elevatorModel = {
|
'$store.state.ibp.rightClickCount': function (val) {
|
||||||
point: {
|
const model = this.$store.getters['ibp/updateDeviceData'];
|
||||||
x: this.form.x,
|
if (model._type === 'Elevator' ) {
|
||||||
y: this.form.y
|
this.buttonText = this.$t('global.modify');
|
||||||
},
|
this.showDeleteButton = true;
|
||||||
_type: 'Elevator',
|
this.isUpdate = true;
|
||||||
code: this.form.code,
|
this.form.code = model.code;
|
||||||
width: this.form.elevatorWidth,
|
this.form.elevatorWidth = model.width;
|
||||||
height: this.form.elevatorHeight,
|
this.form.elevatorHeight = model.height;
|
||||||
fillColor: this.form.elevatorColor,
|
this.form.elevatorColor = model.fillColor;
|
||||||
direction: this.form.direction,
|
this.form.direction = model.direction;
|
||||||
};
|
this.form.x = model.point.x;
|
||||||
this.$emit('deleteDataModel',elevatorModel );
|
this.form.y = model.point.y;
|
||||||
this.initPage();
|
|
||||||
},
|
|
||||||
initPage() {
|
|
||||||
this.isUpdate = false;
|
|
||||||
this.buttonText = this.$t('ibp.createNow');
|
|
||||||
this.showDeleteButton = false;
|
|
||||||
this.form = {
|
|
||||||
code: '',
|
|
||||||
elevatorWidth: '',
|
|
||||||
elevatorHeight: '',
|
|
||||||
elevatorColor:'',
|
|
||||||
direction:'none',
|
|
||||||
x: 10,
|
|
||||||
y: 10
|
|
||||||
};
|
|
||||||
},
|
|
||||||
generateCode() {
|
|
||||||
const mydate = new Date();
|
|
||||||
this.form.code = "elevator_"+mydate.getDay()+ mydate.getHours()+ mydate.getMinutes()+mydate.getSeconds()+mydate.getMilliseconds()+ Math.round(Math.random() * 10000);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
},
|
||||||
|
mounted() {
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
onSubmit(form) {
|
||||||
|
this.$refs[form].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
const elevatorModel = {
|
||||||
|
point: {
|
||||||
|
x: this.form.x,
|
||||||
|
y: this.form.y
|
||||||
|
},
|
||||||
|
_type: 'Elevator',
|
||||||
|
code: this.form.code,
|
||||||
|
width: this.form.elevatorWidth,
|
||||||
|
height: this.form.elevatorHeight,
|
||||||
|
fillColor: this.form.elevatorColor,
|
||||||
|
direction: this.form.direction
|
||||||
|
};
|
||||||
|
this.$emit('createData', elevatorModel);
|
||||||
|
this.initPage();
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
},
|
||||||
|
deleteDevice() {
|
||||||
|
const elevatorModel = {
|
||||||
|
point: {
|
||||||
|
x: this.form.x,
|
||||||
|
y: this.form.y
|
||||||
|
},
|
||||||
|
_type: 'Elevator',
|
||||||
|
code: this.form.code,
|
||||||
|
width: this.form.elevatorWidth,
|
||||||
|
height: this.form.elevatorHeight,
|
||||||
|
fillColor: this.form.elevatorColor,
|
||||||
|
direction: this.form.direction
|
||||||
|
};
|
||||||
|
this.$emit('deleteDataModel', elevatorModel );
|
||||||
|
this.initPage();
|
||||||
|
},
|
||||||
|
initPage() {
|
||||||
|
this.isUpdate = false;
|
||||||
|
this.buttonText = this.$t('ibp.createNow');
|
||||||
|
this.showDeleteButton = false;
|
||||||
|
this.form = {
|
||||||
|
code: '',
|
||||||
|
elevatorWidth: '',
|
||||||
|
elevatorHeight: '',
|
||||||
|
elevatorColor:'',
|
||||||
|
direction:'none',
|
||||||
|
x: 10,
|
||||||
|
y: 10
|
||||||
|
};
|
||||||
|
},
|
||||||
|
generateCode() {
|
||||||
|
const mydate = new Date();
|
||||||
|
this.form.code = 'elevator_' + mydate.getDay() + mydate.getHours() + mydate.getMinutes() + mydate.getSeconds() + mydate.getMilliseconds() + Math.round(Math.random() * 10000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
|
|
||||||
|
@ -129,7 +129,7 @@ export default {
|
|||||||
bottomText:this.form.bottomText,
|
bottomText:this.form.bottomText,
|
||||||
mean:this.form.mean
|
mean:this.form.mean
|
||||||
};
|
};
|
||||||
this.$emit('createKey', keyModel);
|
this.$emit('createData', keyModel);
|
||||||
this.initPage();
|
this.initPage();
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
@ -1,155 +1,155 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-form ref="form" :rules="rules" :model="form" label-width="120px">
|
<el-form ref="form" :rules="rules" :model="form" label-width="120px">
|
||||||
<el-form-item :label="this.$t('ibp.circularLampCode')" prop="code">
|
<el-form-item :label="this.$t('ibp.circularLampCode')" prop="code">
|
||||||
<el-input :disabled="true" v-model="form.code" >
|
<el-input v-model="form.code" :disabled="true">
|
||||||
<el-button slot="append" :disabled="isUpdate" type="primary" @click="generateCode">{{$t('ibp.generateCode')}}</el-button>
|
<el-button slot="append" :disabled="isUpdate" type="primary" @click="generateCode">{{ $t('ibp.generateCode') }}</el-button>
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="this.$t('ibp.circularLampRadius')" prop="r">
|
<el-form-item :label="this.$t('ibp.circularLampRadius')" prop="r">
|
||||||
<el-input-number v-model="form.r" controls-position="right" :min="1"></el-input-number>
|
<el-input-number v-model="form.r" controls-position="right" :min="1" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="this.$t('ibp.xCoordinate')">
|
<el-form-item :label="this.$t('ibp.xCoordinate')">
|
||||||
<el-input-number v-model="form.x" controls-position="right" :min="1"></el-input-number>
|
<el-input-number v-model="form.x" controls-position="right" :min="1" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="this.$t('ibp.yCoordinate')">
|
<el-form-item :label="this.$t('ibp.yCoordinate')">
|
||||||
<el-input-number v-model="form.y" controls-position="right" :min="1"></el-input-number>
|
<el-input-number v-model="form.y" controls-position="right" :min="1" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="表示状态">
|
<el-form-item label="表示状态">
|
||||||
<el-select v-model="form.mean" placeholder="请选择">
|
<el-select v-model="form.mean" placeholder="请选择">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in showMeanList"
|
v-for="item in showMeanList"
|
||||||
:key="item.value"
|
:key="item.value"
|
||||||
:label="item.label"
|
:label="item.label"
|
||||||
:value="item.value">
|
:value="item.value"
|
||||||
</el-option>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="关联设备">
|
<el-form-item label="关联设备">
|
||||||
<el-input v-model="form.linkDevice"></el-input>
|
<el-input v-model="form.linkDevice" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
|
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
|
||||||
<el-button v-show="showDeleteButton" @click="deleteDevice" type="danger">{{$t('global.delete')}}</el-button>
|
<el-button v-show="showDeleteButton" type="danger" @click="deleteDevice">{{ $t('global.delete') }}</el-button>
|
||||||
<el-button v-show="showDeleteButton" @click="initPage">{{$t('global.cancel')}}</el-button>
|
<el-button v-show="showDeleteButton" @click="initPage">{{ $t('global.cancel') }}</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: 'LampDraft',
|
name: 'LampDraft',
|
||||||
components: {
|
components: {
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
isUpdate: false,
|
isUpdate: false,
|
||||||
buttonText: this.$t('ibp.createNow'),
|
buttonText: this.$t('ibp.createNow'),
|
||||||
showDeleteButton: false,
|
showDeleteButton: false,
|
||||||
showMeanList: [
|
showMeanList: [
|
||||||
{label: '扣车', value: 'Show_Detain'},
|
{label: '扣车', value: 'Show_Detain'},
|
||||||
{label: '屏蔽门打开', value: 'Show_Open_Screen_Door'},
|
{label: '屏蔽门打开', value: 'Show_Open_Screen_Door'},
|
||||||
{label: '屏蔽门紧闭', value: 'Show_Close_Screen_Door'}
|
{label: '屏蔽门紧闭', value: 'Show_Close_Screen_Door'}
|
||||||
|
],
|
||||||
|
form: {
|
||||||
|
code: '',
|
||||||
|
r: '',
|
||||||
|
x: 10,
|
||||||
|
y: 10,
|
||||||
|
mean: '',
|
||||||
|
linkDevice: ''
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
code: [
|
||||||
|
{ required: true, message: '请输入按钮编号', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
form: {
|
r: [
|
||||||
code: '',
|
{ required: true, message: '请输入圆形灯半径', trigger: 'blur'}
|
||||||
r: '',
|
]
|
||||||
x: 10,
|
|
||||||
y: 10,
|
|
||||||
mean: '',
|
|
||||||
linkDevice: ''
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
code: [
|
|
||||||
{ required: true, message: '请输入按钮编号', trigger: 'blur' },
|
|
||||||
],
|
|
||||||
r: [
|
|
||||||
{ required: true, message: '请输入圆形灯半径', trigger: 'blur'}
|
|
||||||
],
|
|
||||||
}
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
'$store.state.ibp.rightClickCount': function (val) {
|
|
||||||
const model = this.$store.getters['ibp/updateDeviceData'];
|
|
||||||
if (model._type === 'CircularLamp' ){
|
|
||||||
this.buttonText = this.$t('global.modify');
|
|
||||||
this.showDeleteButton = true;
|
|
||||||
this.isUpdate = true;
|
|
||||||
this.form.code = model.code;
|
|
||||||
this.form.r = model.r;
|
|
||||||
this.form.x = model.point.x;
|
|
||||||
this.form.y = model.point.y;
|
|
||||||
this.form.mean = model.mean;
|
|
||||||
this.form.linkDevice = model.linkDevice;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
};
|
||||||
mounted() {
|
},
|
||||||
},
|
computed: {
|
||||||
methods: {
|
|
||||||
onSubmit(form) {
|
|
||||||
this.$refs[form].validate((valid) => {
|
|
||||||
if(valid){
|
|
||||||
const lampModel = {
|
|
||||||
point: {
|
|
||||||
x: this.form.x,
|
|
||||||
y: this.form.y
|
|
||||||
},
|
|
||||||
_type: 'CircularLamp',
|
|
||||||
code: this.form.code,
|
|
||||||
r: this.form.r,
|
|
||||||
mean: this.form.mean,
|
|
||||||
linkDevice: this.form.linkDevice,
|
|
||||||
fillColor: '#332C22'
|
|
||||||
};
|
|
||||||
this.$emit('createLamp', lampModel);
|
|
||||||
this.initPage();
|
|
||||||
}else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
},
|
},
|
||||||
deleteDevice() {
|
watch: {
|
||||||
const lampModel = {
|
'$store.state.ibp.rightClickCount': function (val) {
|
||||||
point: {
|
const model = this.$store.getters['ibp/updateDeviceData'];
|
||||||
x: this.form.x,
|
if (model._type === 'CircularLamp' ) {
|
||||||
y: this.form.y
|
this.buttonText = this.$t('global.modify');
|
||||||
},
|
this.showDeleteButton = true;
|
||||||
_type: 'CircularLamp',
|
this.isUpdate = true;
|
||||||
code: this.form.code,
|
this.form.code = model.code;
|
||||||
r: this.form.r,
|
this.form.r = model.r;
|
||||||
mean: this.form.mean,
|
this.form.x = model.point.x;
|
||||||
linkDevice: this.form.linkDevice,
|
this.form.y = model.point.y;
|
||||||
fillColor: '#332C22'
|
this.form.mean = model.mean;
|
||||||
};
|
this.form.linkDevice = model.linkDevice;
|
||||||
this.$emit('deleteDataModel',lampModel );
|
|
||||||
this.initPage();
|
|
||||||
},
|
|
||||||
initPage() {
|
|
||||||
this.isUpdate = false;
|
|
||||||
this.buttonText = this.$t('ibp.createNow');
|
|
||||||
this.showDeleteButton = false;
|
|
||||||
this.form = {
|
|
||||||
code: '',
|
|
||||||
r: '',
|
|
||||||
x: 10,
|
|
||||||
y: 10,
|
|
||||||
mean: '',
|
|
||||||
linkDevice: '',
|
|
||||||
};
|
|
||||||
},
|
|
||||||
generateCode() {
|
|
||||||
const mydate = new Date();
|
|
||||||
this.form.code = "lamp_"+mydate.getDay()+ mydate.getHours()+ mydate.getMinutes()+mydate.getSeconds()+mydate.getMilliseconds()+ Math.round(Math.random() * 10000);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
},
|
||||||
|
mounted() {
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
onSubmit(form) {
|
||||||
|
this.$refs[form].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
const lampModel = {
|
||||||
|
point: {
|
||||||
|
x: this.form.x,
|
||||||
|
y: this.form.y
|
||||||
|
},
|
||||||
|
_type: 'CircularLamp',
|
||||||
|
code: this.form.code,
|
||||||
|
r: this.form.r,
|
||||||
|
mean: this.form.mean,
|
||||||
|
linkDevice: this.form.linkDevice,
|
||||||
|
fillColor: '#332C22'
|
||||||
|
};
|
||||||
|
this.$emit('createData', lampModel);
|
||||||
|
this.initPage();
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
},
|
||||||
|
deleteDevice() {
|
||||||
|
const lampModel = {
|
||||||
|
point: {
|
||||||
|
x: this.form.x,
|
||||||
|
y: this.form.y
|
||||||
|
},
|
||||||
|
_type: 'CircularLamp',
|
||||||
|
code: this.form.code,
|
||||||
|
r: this.form.r,
|
||||||
|
mean: this.form.mean,
|
||||||
|
linkDevice: this.form.linkDevice,
|
||||||
|
fillColor: '#332C22'
|
||||||
|
};
|
||||||
|
this.$emit('deleteDataModel', lampModel );
|
||||||
|
this.initPage();
|
||||||
|
},
|
||||||
|
initPage() {
|
||||||
|
this.isUpdate = false;
|
||||||
|
this.buttonText = this.$t('ibp.createNow');
|
||||||
|
this.showDeleteButton = false;
|
||||||
|
this.form = {
|
||||||
|
code: '',
|
||||||
|
r: '',
|
||||||
|
x: 10,
|
||||||
|
y: 10,
|
||||||
|
mean: '',
|
||||||
|
linkDevice: ''
|
||||||
|
};
|
||||||
|
},
|
||||||
|
generateCode() {
|
||||||
|
const mydate = new Date();
|
||||||
|
this.form.code = 'lamp_' + mydate.getDay() + mydate.getHours() + mydate.getMinutes() + mydate.getSeconds() + mydate.getMilliseconds() + Math.round(Math.random() * 10000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
</style>
|
</style>
|
||||||
|
@ -1,156 +1,156 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-form ref="form" :rules="rules" :model="form" label-width="100px">
|
<el-form ref="form" :rules="rules" :model="form" label-width="100px">
|
||||||
<el-form-item label="线段编号" prop="code">
|
<el-form-item label="线段编号" prop="code">
|
||||||
<el-input :disabled="true" v-model="form.code" >
|
<el-input v-model="form.code" :disabled="true">
|
||||||
<el-button slot="append" :disabled="isUpdate" type="primary" @click="generateCode">生成编号</el-button>
|
<el-button slot="append" :disabled="isUpdate" type="primary" @click="generateCode">生成编号</el-button>
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="线段宽度" prop="lineWidth">
|
<el-form-item label="线段宽度" prop="lineWidth">
|
||||||
<el-input-number v-model="form.lineWidth" controls-position="right" :min="1" :max="50"></el-input-number>
|
<el-input-number v-model="form.lineWidth" controls-position="right" :min="1" :max="50" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="线段颜色" prop="fillColor">
|
<el-form-item label="线段颜色" prop="fillColor">
|
||||||
<el-color-picker v-model="form.fillColor"></el-color-picker>
|
<el-color-picker v-model="form.fillColor" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="起始X轴坐标">
|
<el-form-item label="起始X轴坐标">
|
||||||
<el-input-number v-model="form.x1" controls-position="right" :min="0"></el-input-number>
|
<el-input-number v-model="form.x1" controls-position="right" :min="0" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="起始Y轴坐标">
|
<el-form-item label="起始Y轴坐标">
|
||||||
<el-input-number v-model="form.y1" controls-position="right" :min="0"></el-input-number>
|
<el-input-number v-model="form.y1" controls-position="right" :min="0" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="终止X轴坐标">
|
<el-form-item label="终止X轴坐标">
|
||||||
<el-input-number v-model="form.x2" controls-position="right" :min="0"></el-input-number>
|
<el-input-number v-model="form.x2" controls-position="right" :min="0" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="终止Y轴坐标">
|
<el-form-item label="终止Y轴坐标">
|
||||||
<el-input-number v-model="form.y2" controls-position="right" :min="0"></el-input-number>
|
<el-input-number v-model="form.y2" controls-position="right" :min="0" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
|
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
|
||||||
<el-button v-show="showDeleteButton" @click="deleteDevice" type="danger">删除</el-button>
|
<el-button v-show="showDeleteButton" type="danger" @click="deleteDevice">删除</el-button>
|
||||||
<el-button v-show="showDeleteButton" @click="initPage">取消</el-button>
|
<el-button v-show="showDeleteButton" @click="initPage">取消</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: 'TextDraft',
|
name: 'TextDraft',
|
||||||
components: {
|
components: {
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
isUpdate: false,
|
isUpdate: false,
|
||||||
buttonText: '立即创建',
|
buttonText: '立即创建',
|
||||||
showDeleteButton: false,
|
showDeleteButton: false,
|
||||||
form: {
|
form: {
|
||||||
code: '',
|
code: '',
|
||||||
lineWidth: '',
|
lineWidth: '',
|
||||||
fillColor: '#000000',
|
fillColor: '#000000',
|
||||||
x1: 10,
|
x1: 10,
|
||||||
y1: 10,
|
y1: 10,
|
||||||
x2: 20,
|
x2: 20,
|
||||||
y2: 10
|
y2: 10
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
code: [
|
code: [
|
||||||
{ required: true, message: '请输入线段编号', trigger: 'blur' },
|
{ required: true, message: '请输入线段编号', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
lineWidth: [
|
lineWidth: [
|
||||||
{ required: true, message: '请输入线段宽度', trigger: 'blur' },
|
{ required: true, message: '请输入线段宽度', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
fillColor: [
|
fillColor: [
|
||||||
{ required: true, message: '请输入线段颜色', trigger: 'blur' },
|
{ required: true, message: '请输入线段颜色', trigger: 'blur' }
|
||||||
],
|
]
|
||||||
}
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
'$store.state.ibp.rightClickCount': function (val) {
|
|
||||||
const model = this.$store.getters['ibp/updateDeviceData'];
|
|
||||||
if (model._type === 'IbpLine' ){
|
|
||||||
this.buttonText = '修改';
|
|
||||||
this.showDeleteButton = true;
|
|
||||||
this.isUpdate = true;
|
|
||||||
this.form.code = model.code;
|
|
||||||
this.form.lineWidth = model.lineWidth;
|
|
||||||
this.form.fillColor = model.fillColor;
|
|
||||||
this.form.x1 = model.point1.x;
|
|
||||||
this.form.y1 = model.point1.y;
|
|
||||||
this.form.x2 = model.point2.x;
|
|
||||||
this.form.y2 = model.point2.y;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
};
|
||||||
mounted() {
|
},
|
||||||
},
|
computed: {
|
||||||
methods: {
|
|
||||||
onSubmit(form) {
|
|
||||||
this.$refs[form].validate((valid) =>{
|
|
||||||
if (valid){
|
|
||||||
const lineModel = {
|
|
||||||
point1: {
|
|
||||||
x: this.form.x1,
|
|
||||||
y: this.form.y1
|
|
||||||
},
|
|
||||||
point2: {
|
|
||||||
x: this.form.x2,
|
|
||||||
y: this.form.y2
|
|
||||||
},
|
|
||||||
code: this.form.code,
|
|
||||||
_type: 'IbpLine',
|
|
||||||
lineWidth: this.form.lineWidth,
|
|
||||||
fillColor: this.form.fillColor
|
|
||||||
};
|
|
||||||
this.$emit('createLine', lineModel);
|
|
||||||
this.initPage();
|
|
||||||
}else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
},
|
},
|
||||||
deleteDevice() {
|
watch: {
|
||||||
const lineModel = {
|
'$store.state.ibp.rightClickCount': function (val) {
|
||||||
point1: {
|
const model = this.$store.getters['ibp/updateDeviceData'];
|
||||||
x: this.form.x1,
|
if (model._type === 'IbpLine' ) {
|
||||||
y: this.form.y1
|
this.buttonText = '修改';
|
||||||
},
|
this.showDeleteButton = true;
|
||||||
point2: {
|
this.isUpdate = true;
|
||||||
x: this.form.x2,
|
this.form.code = model.code;
|
||||||
y: this.form.y2
|
this.form.lineWidth = model.lineWidth;
|
||||||
},
|
this.form.fillColor = model.fillColor;
|
||||||
code: this.form.code,
|
this.form.x1 = model.point1.x;
|
||||||
_type: 'IbpLine',
|
this.form.y1 = model.point1.y;
|
||||||
lineWidth: this.form.lineWidth,
|
this.form.x2 = model.point2.x;
|
||||||
fillColor: this.form.fillColor
|
this.form.y2 = model.point2.y;
|
||||||
};
|
|
||||||
this.$emit('deleteDataModel',lineModel );
|
|
||||||
this.initPage();
|
|
||||||
},
|
|
||||||
initPage() {
|
|
||||||
this.isUpdate = false;
|
|
||||||
this.buttonText = '立即创建';
|
|
||||||
this.showDeleteButton = false;
|
|
||||||
this.form = {
|
|
||||||
code: '',
|
|
||||||
lineWidth: '',
|
|
||||||
fillColor: '',
|
|
||||||
x1: 10,
|
|
||||||
y1: 10,
|
|
||||||
x2: 20,
|
|
||||||
y2: 10
|
|
||||||
};
|
|
||||||
},
|
|
||||||
generateCode() {
|
|
||||||
const mydate = new Date();
|
|
||||||
this.form.code = "line_"+mydate.getDay()+ mydate.getHours()+ mydate.getMinutes()+mydate.getSeconds()+mydate.getMilliseconds()+ Math.round(Math.random() * 10000);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
},
|
||||||
|
mounted() {
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
onSubmit(form) {
|
||||||
|
this.$refs[form].validate((valid) =>{
|
||||||
|
if (valid) {
|
||||||
|
const lineModel = {
|
||||||
|
point1: {
|
||||||
|
x: this.form.x1,
|
||||||
|
y: this.form.y1
|
||||||
|
},
|
||||||
|
point2: {
|
||||||
|
x: this.form.x2,
|
||||||
|
y: this.form.y2
|
||||||
|
},
|
||||||
|
code: this.form.code,
|
||||||
|
_type: 'IbpLine',
|
||||||
|
lineWidth: this.form.lineWidth,
|
||||||
|
fillColor: this.form.fillColor
|
||||||
|
};
|
||||||
|
this.$emit('createData', lineModel);
|
||||||
|
this.initPage();
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
},
|
||||||
|
deleteDevice() {
|
||||||
|
const lineModel = {
|
||||||
|
point1: {
|
||||||
|
x: this.form.x1,
|
||||||
|
y: this.form.y1
|
||||||
|
},
|
||||||
|
point2: {
|
||||||
|
x: this.form.x2,
|
||||||
|
y: this.form.y2
|
||||||
|
},
|
||||||
|
code: this.form.code,
|
||||||
|
_type: 'IbpLine',
|
||||||
|
lineWidth: this.form.lineWidth,
|
||||||
|
fillColor: this.form.fillColor
|
||||||
|
};
|
||||||
|
this.$emit('deleteDataModel', lineModel );
|
||||||
|
this.initPage();
|
||||||
|
},
|
||||||
|
initPage() {
|
||||||
|
this.isUpdate = false;
|
||||||
|
this.buttonText = '立即创建';
|
||||||
|
this.showDeleteButton = false;
|
||||||
|
this.form = {
|
||||||
|
code: '',
|
||||||
|
lineWidth: '',
|
||||||
|
fillColor: '',
|
||||||
|
x1: 10,
|
||||||
|
y1: 10,
|
||||||
|
x2: 20,
|
||||||
|
y2: 10
|
||||||
|
};
|
||||||
|
},
|
||||||
|
generateCode() {
|
||||||
|
const mydate = new Date();
|
||||||
|
this.form.code = 'line_' + mydate.getDay() + mydate.getHours() + mydate.getMinutes() + mydate.getSeconds() + mydate.getMilliseconds() + Math.round(Math.random() * 10000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
|
|
||||||
|
@ -1,141 +1,141 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-form ref="form" :rules="rules" :model="form" label-width="120px">
|
<el-form ref="form" :rules="rules" :model="form" label-width="120px">
|
||||||
<el-form-item label="旋转提示编号" prop="code">
|
<el-form-item label="旋转提示编号" prop="code">
|
||||||
<el-input :disabled="true" v-model="form.code">
|
<el-input v-model="form.code" :disabled="true">
|
||||||
<el-button slot="append" :disabled="isUpdate" type="primary" @click="generateCode">生成编号</el-button>
|
<el-button slot="append" :disabled="isUpdate" type="primary" @click="generateCode">生成编号</el-button>
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="旋转提示宽度" prop="rotateTipWidth">
|
<el-form-item label="旋转提示宽度" prop="rotateTipWidth">
|
||||||
<el-input-number v-model="form.rotateTipWidth" controls-position="right" :min="1"></el-input-number>
|
<el-input-number v-model="form.rotateTipWidth" controls-position="right" :min="1" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="X轴坐标">
|
<el-form-item label="X轴坐标">
|
||||||
<el-input-number v-model="form.x" controls-position="right" :min="1"></el-input-number>
|
<el-input-number v-model="form.x" controls-position="right" :min="1" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="Y轴坐标">
|
<el-form-item label="Y轴坐标">
|
||||||
<el-input-number v-model="form.y" controls-position="right" :min="1"></el-input-number>
|
<el-input-number v-model="form.y" controls-position="right" :min="1" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="提示颜色" prop="rotateTipColor">
|
<el-form-item label="提示颜色" prop="rotateTipColor">
|
||||||
<el-select v-model="form.rotateTipColor" placeholder="请选择提示颜色">
|
<el-select v-model="form.rotateTipColor" placeholder="请选择提示颜色">
|
||||||
<el-option label="红色" value="red"></el-option>
|
<el-option label="红色" value="red" />
|
||||||
<el-option label="黑色" value="black"></el-option>
|
<el-option label="黑色" value="black" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
|
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
|
||||||
<el-button v-show="showDeleteButton" @click="deleteDevice" type="danger">删除</el-button>
|
<el-button v-show="showDeleteButton" type="danger" @click="deleteDevice">删除</el-button>
|
||||||
<el-button v-show="showDeleteButton" @click="initPage">取消</el-button>
|
<el-button v-show="showDeleteButton" @click="initPage">取消</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: 'KeyDraft',
|
name: 'KeyDraft',
|
||||||
components: {
|
components: {
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
isUpdate: false,
|
isUpdate: false,
|
||||||
buttonText: '立即创建',
|
buttonText: '立即创建',
|
||||||
showDeleteButton: false,
|
showDeleteButton: false,
|
||||||
form: {
|
form: {
|
||||||
code: '',
|
code: '',
|
||||||
rotateTipWidth: '',
|
rotateTipWidth: '',
|
||||||
rotateTipColor: 'black',
|
rotateTipColor: 'black',
|
||||||
x: 10,
|
x: 10,
|
||||||
y: 10
|
y: 10
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
code: [
|
code: [
|
||||||
{ required: true, message: '请输入旋转提示编号', trigger: 'blur' },
|
{ required: true, message: '请输入旋转提示编号', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
rotateTipWidth: [
|
rotateTipWidth: [
|
||||||
{ required: true, message: '请输入旋转提示宽度', trigger: 'blur' },
|
{ required: true, message: '请输入旋转提示宽度', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
rotateTipColor: [
|
rotateTipColor: [
|
||||||
{ required: true, message: '请选择按钮颜色', trigger: 'change'}
|
{ required: true, message: '请选择按钮颜色', trigger: 'change'}
|
||||||
]
|
]
|
||||||
}
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
'$store.state.ibp.rightClickCount': function (val) {
|
|
||||||
const model = this.$store.getters['ibp/updateDeviceData'];
|
|
||||||
if (model._type === 'RotateTip' ){
|
|
||||||
this.buttonText = '修改';
|
|
||||||
this.showDeleteButton = true;
|
|
||||||
this.isUpdate = true;
|
|
||||||
this.form.code = model.code;
|
|
||||||
this.form.rotateTipWidth = model.width;
|
|
||||||
this.form.rotateTipColor = model.color?model.color:'black';
|
|
||||||
this.form.x = model.point.x;
|
|
||||||
this.form.y = model.point.y;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
};
|
||||||
mounted() {
|
},
|
||||||
},
|
computed: {
|
||||||
methods: {
|
|
||||||
onSubmit(form) {
|
|
||||||
this.$refs[form].validate((valid) => {
|
|
||||||
if(valid) {
|
|
||||||
const rotateTipModel = {
|
|
||||||
point: {
|
|
||||||
x: this.form.x,
|
|
||||||
y: this.form.y
|
|
||||||
},
|
|
||||||
draggable: true,
|
|
||||||
_type: 'RotateTip',
|
|
||||||
code: this.form.code,
|
|
||||||
width: this.form.rotateTipWidth,
|
|
||||||
color: this.form.rotateTipColor
|
|
||||||
};
|
|
||||||
this.$emit('createRotateTip', rotateTipModel);
|
|
||||||
this.initPage();
|
|
||||||
}else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
},
|
},
|
||||||
deleteDevice() {
|
watch: {
|
||||||
const rotateTipModel = {
|
'$store.state.ibp.rightClickCount': function (val) {
|
||||||
point: {
|
const model = this.$store.getters['ibp/updateDeviceData'];
|
||||||
x: this.form.x,
|
if (model._type === 'RotateTip' ) {
|
||||||
y: this.form.y
|
this.buttonText = '修改';
|
||||||
},
|
this.showDeleteButton = true;
|
||||||
draggable: true,
|
this.isUpdate = true;
|
||||||
_type: 'RotateTip',
|
this.form.code = model.code;
|
||||||
code: this.form.code,
|
this.form.rotateTipWidth = model.width;
|
||||||
width: this.form .rotateTipWidth,
|
this.form.rotateTipColor = model.color ? model.color : 'black';
|
||||||
color: this.form.rotateTipColor
|
this.form.x = model.point.x;
|
||||||
};
|
this.form.y = model.point.y;
|
||||||
this.$emit('deleteDataModel',rotateTipModel);
|
|
||||||
this.initPage();
|
|
||||||
},
|
|
||||||
initPage() {
|
|
||||||
this.isUpdate = false;
|
|
||||||
this.buttonText = '立即创建';
|
|
||||||
this.showDeleteButton = false;
|
|
||||||
this.form = {
|
|
||||||
code: '',
|
|
||||||
rotateTipWidth: '',
|
|
||||||
rotateTipColor: 'black',
|
|
||||||
x: 10,
|
|
||||||
y: 10
|
|
||||||
};
|
|
||||||
},
|
|
||||||
generateCode() {
|
|
||||||
const mydate = new Date();
|
|
||||||
this.form.code = "rTip_"+mydate.getDay()+ mydate.getHours()+ mydate.getMinutes()+mydate.getSeconds()+mydate.getMilliseconds()+ Math.round(Math.random() * 10000);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
},
|
||||||
|
mounted() {
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
onSubmit(form) {
|
||||||
|
this.$refs[form].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
const rotateTipModel = {
|
||||||
|
point: {
|
||||||
|
x: this.form.x,
|
||||||
|
y: this.form.y
|
||||||
|
},
|
||||||
|
draggable: true,
|
||||||
|
_type: 'RotateTip',
|
||||||
|
code: this.form.code,
|
||||||
|
width: this.form.rotateTipWidth,
|
||||||
|
color: this.form.rotateTipColor
|
||||||
|
};
|
||||||
|
this.$emit('createData', rotateTipModel);
|
||||||
|
this.initPage();
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
},
|
||||||
|
deleteDevice() {
|
||||||
|
const rotateTipModel = {
|
||||||
|
point: {
|
||||||
|
x: this.form.x,
|
||||||
|
y: this.form.y
|
||||||
|
},
|
||||||
|
draggable: true,
|
||||||
|
_type: 'RotateTip',
|
||||||
|
code: this.form.code,
|
||||||
|
width: this.form.rotateTipWidth,
|
||||||
|
color: this.form.rotateTipColor
|
||||||
|
};
|
||||||
|
this.$emit('deleteDataModel', rotateTipModel);
|
||||||
|
this.initPage();
|
||||||
|
},
|
||||||
|
initPage() {
|
||||||
|
this.isUpdate = false;
|
||||||
|
this.buttonText = '立即创建';
|
||||||
|
this.showDeleteButton = false;
|
||||||
|
this.form = {
|
||||||
|
code: '',
|
||||||
|
rotateTipWidth: '',
|
||||||
|
rotateTipColor: 'black',
|
||||||
|
x: 10,
|
||||||
|
y: 10
|
||||||
|
};
|
||||||
|
},
|
||||||
|
generateCode() {
|
||||||
|
const mydate = new Date();
|
||||||
|
this.form.code = 'rTip_' + mydate.getDay() + mydate.getHours() + mydate.getMinutes() + mydate.getSeconds() + mydate.getMilliseconds() + Math.round(Math.random() * 10000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
|
|
||||||
|
@ -1,128 +1,128 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-form ref="form" :rules="rules" :model="form" label-width="120px">
|
<el-form ref="form" :rules="rules" :model="form" label-width="120px">
|
||||||
<el-form-item label="端子编号" prop="code">
|
<el-form-item label="端子编号" prop="code">
|
||||||
<el-input :disabled="true" v-model="form.code">
|
<el-input v-model="form.code" :disabled="true">
|
||||||
<el-button slot="append" :disabled="isUpdate" type="primary" @click="generateCode">生成编号</el-button>
|
<el-button slot="append" :disabled="isUpdate" type="primary" @click="generateCode">生成编号</el-button>
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="端子宽度" prop="terminalWidth">
|
<el-form-item label="端子宽度" prop="terminalWidth">
|
||||||
<el-input-number v-model="form.terminalWidth" controls-position="right" :min="1"></el-input-number>
|
<el-input-number v-model="form.terminalWidth" controls-position="right" :min="1" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="X轴坐标">
|
<el-form-item label="X轴坐标">
|
||||||
<el-input-number v-model="form.x" controls-position="right" :min="1"></el-input-number>
|
<el-input-number v-model="form.x" controls-position="right" :min="1" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="Y轴坐标">
|
<el-form-item label="Y轴坐标">
|
||||||
<el-input-number v-model="form.y" controls-position="right" :min="1"></el-input-number>
|
<el-input-number v-model="form.y" controls-position="right" :min="1" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
|
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
|
||||||
<el-button v-show="showDeleteButton" @click="deleteDevice" type="danger">删除</el-button>
|
<el-button v-show="showDeleteButton" type="danger" @click="deleteDevice">删除</el-button>
|
||||||
<el-button v-show="showDeleteButton" @click="initPage">取消</el-button>
|
<el-button v-show="showDeleteButton" @click="initPage">取消</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: 'KeyDraft',
|
name: 'KeyDraft',
|
||||||
components: {
|
components: {
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
isUpdate: false,
|
isUpdate: false,
|
||||||
buttonText: '立即创建',
|
buttonText: '立即创建',
|
||||||
showDeleteButton: false,
|
showDeleteButton: false,
|
||||||
form: {
|
form: {
|
||||||
code: '',
|
code: '',
|
||||||
terminalWidth: '',
|
terminalWidth: '',
|
||||||
x: 10,
|
x: 10,
|
||||||
y: 10
|
y: 10
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
code: [
|
code: [
|
||||||
{ required: true, message: '请输入端子编号', trigger: 'blur' },
|
{ required: true, message: '请输入端子编号', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
terminalWidth: [
|
terminalWidth: [
|
||||||
{ required: true, message: '请输入端子宽度', trigger: 'blur' },
|
{ required: true, message: '请输入端子宽度', trigger: 'blur' }
|
||||||
],
|
]
|
||||||
}
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
'$store.state.ibp.rightClickCount': function (val) {
|
|
||||||
const model = this.$store.getters['ibp/updateDeviceData'];
|
|
||||||
if (model._type === 'TeleTerminal' ){
|
|
||||||
this.buttonText = '修改';
|
|
||||||
this.showDeleteButton = true;
|
|
||||||
this.isUpdate = true;
|
|
||||||
this.form.code = model.code;
|
|
||||||
this.form.terminalWidth = model.width;
|
|
||||||
this.form.terminalHeight = model.height;
|
|
||||||
this.form.x = model.point.x;
|
|
||||||
this.form.y = model.point.y;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
};
|
||||||
mounted() {
|
},
|
||||||
},
|
computed: {
|
||||||
methods: {
|
|
||||||
onSubmit(form) {
|
|
||||||
this.$refs[form].validate((valid) => {
|
|
||||||
if (valid){
|
|
||||||
const TerminalModel = {
|
|
||||||
point: {
|
|
||||||
x: this.form.x,
|
|
||||||
y: this.form.y
|
|
||||||
},
|
|
||||||
draggable: true,
|
|
||||||
_type: 'TeleTerminal',
|
|
||||||
code: this.form.code,
|
|
||||||
width: this.form.terminalWidth,
|
|
||||||
};
|
|
||||||
this.$emit('createTeleTerminal', TerminalModel);
|
|
||||||
this.initPage();
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
},
|
},
|
||||||
deleteDevice() {
|
watch: {
|
||||||
const TerminalModel = {
|
'$store.state.ibp.rightClickCount': function (val) {
|
||||||
point: {
|
const model = this.$store.getters['ibp/updateDeviceData'];
|
||||||
x: this.form.x,
|
if (model._type === 'TeleTerminal' ) {
|
||||||
y: this.form.y
|
this.buttonText = '修改';
|
||||||
},
|
this.showDeleteButton = true;
|
||||||
draggable: true,
|
this.isUpdate = true;
|
||||||
_type: 'TeleTerminal',
|
this.form.code = model.code;
|
||||||
code: this.form.code,
|
this.form.terminalWidth = model.width;
|
||||||
width: this.form .terminalWidth,
|
this.form.terminalHeight = model.height;
|
||||||
};
|
this.form.x = model.point.x;
|
||||||
this.$emit('deleteDataModel',TerminalModel);
|
this.form.y = model.point.y;
|
||||||
this.initPage();
|
|
||||||
},
|
|
||||||
initPage() {
|
|
||||||
this.isUpdate = false;
|
|
||||||
this.buttonText = '立即创建';
|
|
||||||
this.showDeleteButton = false;
|
|
||||||
this.form = {
|
|
||||||
code: '',
|
|
||||||
terminalWidth: '',
|
|
||||||
x: 10,
|
|
||||||
y: 10
|
|
||||||
};
|
|
||||||
},
|
|
||||||
generateCode() {
|
|
||||||
const mydate = new Date();
|
|
||||||
this.form.code = "terminal"+mydate.getDay()+ mydate.getHours()+ mydate.getMinutes()+mydate.getSeconds()+mydate.getMilliseconds()+ Math.round(Math.random() * 10000);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
},
|
||||||
|
mounted() {
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
onSubmit(form) {
|
||||||
|
this.$refs[form].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
const TerminalModel = {
|
||||||
|
point: {
|
||||||
|
x: this.form.x,
|
||||||
|
y: this.form.y
|
||||||
|
},
|
||||||
|
draggable: true,
|
||||||
|
_type: 'TeleTerminal',
|
||||||
|
code: this.form.code,
|
||||||
|
width: this.form.terminalWidth
|
||||||
|
};
|
||||||
|
this.$emit('createData', TerminalModel);
|
||||||
|
this.initPage();
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
},
|
||||||
|
deleteDevice() {
|
||||||
|
const TerminalModel = {
|
||||||
|
point: {
|
||||||
|
x: this.form.x,
|
||||||
|
y: this.form.y
|
||||||
|
},
|
||||||
|
draggable: true,
|
||||||
|
_type: 'TeleTerminal',
|
||||||
|
code: this.form.code,
|
||||||
|
width: this.form.terminalWidth
|
||||||
|
};
|
||||||
|
this.$emit('deleteDataModel', TerminalModel);
|
||||||
|
this.initPage();
|
||||||
|
},
|
||||||
|
initPage() {
|
||||||
|
this.isUpdate = false;
|
||||||
|
this.buttonText = '立即创建';
|
||||||
|
this.showDeleteButton = false;
|
||||||
|
this.form = {
|
||||||
|
code: '',
|
||||||
|
terminalWidth: '',
|
||||||
|
x: 10,
|
||||||
|
y: 10
|
||||||
|
};
|
||||||
|
},
|
||||||
|
generateCode() {
|
||||||
|
const mydate = new Date();
|
||||||
|
this.form.code = 'terminal' + mydate.getDay() + mydate.getHours() + mydate.getMinutes() + mydate.getSeconds() + mydate.getMilliseconds() + Math.round(Math.random() * 10000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
|
|
||||||
|
@ -10,13 +10,20 @@
|
|||||||
<el-input v-model="form.context" type="textarea" />
|
<el-input v-model="form.context" type="textarea" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="文字颜色" prop="textFill">
|
<el-form-item label="文字颜色" prop="textFill">
|
||||||
<el-input v-model="form.textFill" />
|
<el-color-picker v-model="form.textFill" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="文字大小" prop="fontSize">
|
<el-form-item label="文字大小" prop="fontSize">
|
||||||
<el-input-number v-model="form.fontSize" controls-position="right" :min="1" :max="100" />
|
<el-input-number v-model="form.fontSize" controls-position="right" :min="1" :max="100" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="文字粗细" prop="fontWeight">
|
<el-form-item label="文字粗细" prop="fontWeight">
|
||||||
<el-input-number v-model="form.fontWeight" controls-position="right" :min="1" />
|
<el-select v-model="form.fontWeight">
|
||||||
|
<el-option
|
||||||
|
v-for="item in fontWeightList"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="X轴坐标">
|
<el-form-item label="X轴坐标">
|
||||||
<el-input-number v-model="form.x" controls-position="right" :min="1" />
|
<el-input-number v-model="form.x" controls-position="right" :min="1" />
|
||||||
@ -24,24 +31,6 @@
|
|||||||
<el-form-item label="Y轴坐标">
|
<el-form-item label="Y轴坐标">
|
||||||
<el-input-number v-model="form.y" controls-position="right" :min="1" />
|
<el-input-number v-model="form.y" controls-position="right" :min="1" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!--<el-form-item label="文字背景">-->
|
|
||||||
<!--<el-switch v-model="form.hasRect" @change="handleChange"></el-switch>-->
|
|
||||||
<!--</el-form-item>-->
|
|
||||||
<!--<el-form-item v-show="form.hasRect" label="背景X轴坐标">-->
|
|
||||||
<!--<el-input-number v-model="form.xBg" controls-position="right" :min="0"></el-input-number>-->
|
|
||||||
<!--</el-form-item>-->
|
|
||||||
<!--<el-form-item v-show="form.hasRect" label="背景Y轴坐标">-->
|
|
||||||
<!--<el-input-number v-model="form.yBg" controls-position="right" :min="0"></el-input-number>-->
|
|
||||||
<!--</el-form-item>-->
|
|
||||||
<!--<el-form-item v-show="form.hasRect" label="背景宽度">-->
|
|
||||||
<!--<el-input-number v-model="form.bgWidth" controls-position="right" :min="1"></el-input-number>-->
|
|
||||||
<!--</el-form-item>-->
|
|
||||||
<!--<el-form-item v-show="form.hasRect" label="背景高度">-->
|
|
||||||
<!--<el-input-number v-model="form.bgHeight" controls-position="right" :min="1"></el-input-number>-->
|
|
||||||
<!--</el-form-item>-->
|
|
||||||
<!--<el-form-item v-show="form.hasRect" label="背景颜色" prop="elevatorColor">-->
|
|
||||||
<!--<el-color-picker v-model="form.textBackgroundColor"></el-color-picker>-->
|
|
||||||
<!--</el-form-item>-->
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
|
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
|
||||||
<el-button v-show="showDeleteButton" type="danger" @click="deleteDevice">删除</el-button>
|
<el-button v-show="showDeleteButton" type="danger" @click="deleteDevice">删除</el-button>
|
||||||
@ -61,6 +50,17 @@ export default {
|
|||||||
isUpdate: false,
|
isUpdate: false,
|
||||||
buttonText: '立即创建',
|
buttonText: '立即创建',
|
||||||
showDeleteButton: false,
|
showDeleteButton: false,
|
||||||
|
fontWeightList: [
|
||||||
|
{ label: '100', value: '100' },
|
||||||
|
{ label: '200', value: '200' },
|
||||||
|
{ label: '300', value: '300' },
|
||||||
|
{ label: '400', value: '400' },
|
||||||
|
{ label: '500', value: '500' },
|
||||||
|
{ label: '600', value: '600' },
|
||||||
|
{ label: '700', value: '700' },
|
||||||
|
{ label: '800', value: '800' },
|
||||||
|
{ label: '900', value: '900' }
|
||||||
|
],
|
||||||
form: {
|
form: {
|
||||||
code: '',
|
code: '',
|
||||||
context: '',
|
context: '',
|
||||||
@ -69,12 +69,6 @@ export default {
|
|||||||
fontWeight: '',
|
fontWeight: '',
|
||||||
x: 10,
|
x: 10,
|
||||||
y: 10
|
y: 10
|
||||||
// hasRect: false,
|
|
||||||
// xBg: 10,
|
|
||||||
// yBg: 10,
|
|
||||||
// bgWidth: 0,
|
|
||||||
// bgHeight: 0,
|
|
||||||
// textBackgroundColor: ''
|
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
code: [
|
code: [
|
||||||
@ -112,12 +106,6 @@ export default {
|
|||||||
this.form.fontWeight = model.fontWeight;
|
this.form.fontWeight = model.fontWeight;
|
||||||
this.form.x = model.point.x;
|
this.form.x = model.point.x;
|
||||||
this.form.y = model.point.y;
|
this.form.y = model.point.y;
|
||||||
// this.form.hasRect = model.hasRect;
|
|
||||||
// this.form.xBg = model.textRect ? model.textRect.x : 10;
|
|
||||||
// this.form.yBg = model.textRect ? model.textRect.y : 10;
|
|
||||||
// this.form.bgWidth = model.textRect ? model.textRect.width : 0;
|
|
||||||
// this.form.bgHeight = model.textRect ? model.textRect.height : 0;
|
|
||||||
// this.form.textBackgroundColor = model.textRect ? model.textRect.textBackgroundColor : '';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -139,17 +127,8 @@ export default {
|
|||||||
fontSize: this.form.fontSize,
|
fontSize: this.form.fontSize,
|
||||||
fontWeight: this.form.fontWeight,
|
fontWeight: this.form.fontWeight,
|
||||||
fontFamily: 'consolas'
|
fontFamily: 'consolas'
|
||||||
// hasRect: this.form.hasRect,
|
|
||||||
// textRect: this.form.hasRect ?
|
|
||||||
// {
|
|
||||||
// x: this.form.xBg,
|
|
||||||
// y: this.form.yBg,
|
|
||||||
// width: this.form.bgWidth,
|
|
||||||
// height: this.form.bgHeight
|
|
||||||
// }:'',
|
|
||||||
// textBackgroundColor: this.form.hasRect?this.form.textBackgroundColor: ''
|
|
||||||
};
|
};
|
||||||
this.$emit('createText', textModel);
|
this.$emit('createData', textModel);
|
||||||
this.initPage();
|
this.initPage();
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
@ -171,15 +150,6 @@ export default {
|
|||||||
fontSize: this.form.fontSize,
|
fontSize: this.form.fontSize,
|
||||||
fontWeight: this.form.fontWeight,
|
fontWeight: this.form.fontWeight,
|
||||||
fontFamily: 'consolas'
|
fontFamily: 'consolas'
|
||||||
// hasRect: this.form.hasRect,
|
|
||||||
// textRect: this.form.hasRect ?
|
|
||||||
// {
|
|
||||||
// x: this.form.xBg,
|
|
||||||
// y: this.form.yBg,
|
|
||||||
// width: this.form.bgWidth,
|
|
||||||
// height: this.form.bgHeight
|
|
||||||
// }:'',
|
|
||||||
// textBackgroundColor: this.form.hasRect?this.form.textBackgroundColor: ''
|
|
||||||
};
|
};
|
||||||
this.$emit('deleteDataModel', textModel);
|
this.$emit('deleteDataModel', textModel);
|
||||||
this.initPage();
|
this.initPage();
|
||||||
|
@ -1,172 +1,172 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-form ref="form" :rules="rules" :model="form" label-width="100px">
|
<el-form ref="form" :rules="rules" :model="form" label-width="100px">
|
||||||
<el-form-item label="矩形编号" prop="code">
|
<el-form-item label="矩形编号" prop="code">
|
||||||
<el-input :disabled="true" v-model="form.code" >
|
<el-input v-model="form.code" :disabled="true">
|
||||||
<el-button slot="append" :disabled="isUpdate" type="primary" @click="generateCode">生成编号</el-button>
|
<el-button slot="append" :disabled="isUpdate" type="primary" @click="generateCode">生成编号</el-button>
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="矩形宽度" prop="tipBoxWidth">
|
<el-form-item label="矩形宽度" prop="tipBoxWidth">
|
||||||
<el-input-number v-model="form.tipBoxWidth" controls-position="right" :min="1" ></el-input-number>
|
<el-input-number v-model="form.tipBoxWidth" controls-position="right" :min="1" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="矩形高度" prop="tipBoxHeight">
|
<el-form-item label="矩形高度" prop="tipBoxHeight">
|
||||||
<el-input-number v-model="form.tipBoxHeight" controls-position="right" :min="1" ></el-input-number>
|
<el-input-number v-model="form.tipBoxHeight" controls-position="right" :min="1" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="填充颜色" prop="fillColor">
|
<el-form-item label="填充颜色" prop="fillColor">
|
||||||
<el-color-picker v-model="form.fillColor"></el-color-picker>
|
<el-color-picker v-model="form.fillColor" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="填充透明颜色">
|
<el-form-item label="填充透明颜色">
|
||||||
<el-switch v-model="opacity"></el-switch>
|
<el-switch v-model="opacity" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="边框线宽" prop="lineWidth">
|
<el-form-item label="边框线宽" prop="lineWidth">
|
||||||
<el-input-number v-model="form.lineWidth" controls-position="right" :min="0" ></el-input-number>
|
<el-input-number v-model="form.lineWidth" controls-position="right" :min="0" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="边线颜色" prop="stroke">
|
<el-form-item label="边线颜色" prop="stroke">
|
||||||
<el-color-picker v-model="form.stroke"></el-color-picker>
|
<el-color-picker v-model="form.stroke" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="X轴坐标">
|
<el-form-item label="X轴坐标">
|
||||||
<el-input-number v-model="form.x" controls-position="right" :min="1"></el-input-number>
|
<el-input-number v-model="form.x" controls-position="right" :min="1" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="Y轴坐标">
|
<el-form-item label="Y轴坐标">
|
||||||
<el-input-number v-model="form.y" controls-position="right" :min="1"></el-input-number>
|
<el-input-number v-model="form.y" controls-position="right" :min="1" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
|
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
|
||||||
<el-button v-show="showDeleteButton" @click="deleteDevice" type="danger">删除</el-button>
|
<el-button v-show="showDeleteButton" type="danger" @click="deleteDevice">删除</el-button>
|
||||||
<el-button v-show="showDeleteButton" @click="initPage">取消</el-button>
|
<el-button v-show="showDeleteButton" @click="initPage">取消</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'TextDraft',
|
name: 'TextDraft',
|
||||||
components: {
|
components: {
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
isUpdate: false,
|
isUpdate: false,
|
||||||
buttonText: '立即创建',
|
buttonText: '立即创建',
|
||||||
showDeleteButton: false,
|
showDeleteButton: false,
|
||||||
opacity: false,
|
opacity: false,
|
||||||
form: {
|
form: {
|
||||||
code: '',
|
code: '',
|
||||||
tipBoxWidth: '',
|
tipBoxWidth: '',
|
||||||
tipBoxHeight: '',
|
tipBoxHeight: '',
|
||||||
fillColor: '#CE950F',
|
fillColor: '#CE950F',
|
||||||
x: 10,
|
x: 10,
|
||||||
y: 10,
|
y: 10,
|
||||||
lineWidth: 0,
|
lineWidth: 0,
|
||||||
stroke: ''
|
stroke: ''
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
code: [
|
code: [
|
||||||
{ required: true, message: '请输入提示框编号', trigger: 'blur' },
|
{ required: true, message: '请输入提示框编号', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
tipBoxWidth: [
|
tipBoxWidth: [
|
||||||
{ required: true, message: '请输入提示框宽度', trigger: 'blur' },
|
{ required: true, message: '请输入提示框宽度', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
tipBoxHeight: [
|
tipBoxHeight: [
|
||||||
{ required: true, message: '请输入提示框高度', trigger: 'blur' },
|
{ required: true, message: '请输入提示框高度', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
fillColor: [
|
fillColor: [
|
||||||
{ required: true, message: '请输入提示框颜色', trigger: 'blur' },
|
{ required: true, message: '请输入提示框颜色', trigger: 'blur' }
|
||||||
]
|
]
|
||||||
}
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
'$store.state.ibp.rightClickCount': function (val) {
|
|
||||||
const model = this.$store.getters['ibp/updateDeviceData'];
|
|
||||||
if (model._type === 'TipBox' ){
|
|
||||||
this.buttonText = '修改';
|
|
||||||
this.showDeleteButton = true;
|
|
||||||
this.isUpdate = true;
|
|
||||||
this.form.code = model.code;
|
|
||||||
this.form.tipBoxWidth = model.width;
|
|
||||||
this.form.tipBoxHeight = model.height;
|
|
||||||
this.form.fillColor = model.fillColor;
|
|
||||||
this.form.x = model.point.x;
|
|
||||||
this.form.y = model.point.y;
|
|
||||||
this.opacity = model.opacity;
|
|
||||||
this.form.lineWidth = model.lineWidth;
|
|
||||||
this.form.stroke = model.stroke;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
};
|
||||||
mounted() {
|
},
|
||||||
},
|
computed: {
|
||||||
methods: {
|
|
||||||
onSubmit(form) {
|
|
||||||
this.$refs[form].validate((valid) => {
|
|
||||||
if (valid) {
|
|
||||||
const tipBoxModel = {
|
|
||||||
point: {
|
|
||||||
x: this.form.x,
|
|
||||||
y: this.form.y
|
|
||||||
},
|
|
||||||
code: this.form.code,
|
|
||||||
_type: 'TipBox',
|
|
||||||
width: this.form.tipBoxWidth,
|
|
||||||
height: this.form.tipBoxHeight,
|
|
||||||
fillColor: this.form.fillColor,
|
|
||||||
opacity: this.opacity,
|
|
||||||
lineWidth: this.form.lineWidth,
|
|
||||||
stroke: this.form.stroke
|
|
||||||
};
|
|
||||||
this.$emit('createTipBox', tipBoxModel);
|
|
||||||
this.initPage();
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
},
|
},
|
||||||
deleteDevice() {
|
watch: {
|
||||||
const tipBoxModel = {
|
'$store.state.ibp.rightClickCount': function (val) {
|
||||||
point: {
|
const model = this.$store.getters['ibp/updateDeviceData'];
|
||||||
x: this.form.x,
|
if (model._type === 'TipBox' ) {
|
||||||
y: this.form.y
|
this.buttonText = '修改';
|
||||||
},
|
this.showDeleteButton = true;
|
||||||
code: this.form.code,
|
this.isUpdate = true;
|
||||||
_type: 'TipBox',
|
this.form.code = model.code;
|
||||||
width: this.form.tipBoxWidth,
|
this.form.tipBoxWidth = model.width;
|
||||||
height: this.form.tipBoxHeight,
|
this.form.tipBoxHeight = model.height;
|
||||||
fillColor: this.form.fillColor,
|
this.form.fillColor = model.fillColor;
|
||||||
opacity: this.opacity,
|
this.form.x = model.point.x;
|
||||||
lineWidth: this.form.lineWidth,
|
this.form.y = model.point.y;
|
||||||
stroke: this.form.stroke
|
this.opacity = model.opacity;
|
||||||
};
|
this.form.lineWidth = model.lineWidth;
|
||||||
this.$emit('deleteDataModel',tipBoxModel);
|
this.form.stroke = model.stroke;
|
||||||
this.initPage();
|
|
||||||
},
|
|
||||||
initPage() {
|
|
||||||
this.isUpdate = false;
|
|
||||||
this.buttonText = '立即创建';
|
|
||||||
this.showDeleteButton = false;
|
|
||||||
this.form = {
|
|
||||||
code: '',
|
|
||||||
tipBoxWidth: '',
|
|
||||||
tipBoxHeight: '',
|
|
||||||
fillColor: '',
|
|
||||||
x: 10,
|
|
||||||
y: 10,
|
|
||||||
opacity: false,
|
|
||||||
lineWidth: 0,
|
|
||||||
stroke: ''
|
|
||||||
};
|
|
||||||
},
|
|
||||||
generateCode() {
|
|
||||||
const mydate = new Date();
|
|
||||||
this.form.code = "tipBox_"+mydate.getDay()+ mydate.getHours()+ mydate.getMinutes()+mydate.getSeconds()+mydate.getMilliseconds()+ Math.round(Math.random() * 10000);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
},
|
||||||
|
mounted() {
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
onSubmit(form) {
|
||||||
|
this.$refs[form].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
const tipBoxModel = {
|
||||||
|
point: {
|
||||||
|
x: this.form.x,
|
||||||
|
y: this.form.y
|
||||||
|
},
|
||||||
|
code: this.form.code,
|
||||||
|
_type: 'TipBox',
|
||||||
|
width: this.form.tipBoxWidth,
|
||||||
|
height: this.form.tipBoxHeight,
|
||||||
|
fillColor: this.form.fillColor,
|
||||||
|
opacity: this.opacity,
|
||||||
|
lineWidth: this.form.lineWidth,
|
||||||
|
stroke: this.form.stroke
|
||||||
|
};
|
||||||
|
this.$emit('createData', tipBoxModel);
|
||||||
|
this.initPage();
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
},
|
||||||
|
deleteDevice() {
|
||||||
|
const tipBoxModel = {
|
||||||
|
point: {
|
||||||
|
x: this.form.x,
|
||||||
|
y: this.form.y
|
||||||
|
},
|
||||||
|
code: this.form.code,
|
||||||
|
_type: 'TipBox',
|
||||||
|
width: this.form.tipBoxWidth,
|
||||||
|
height: this.form.tipBoxHeight,
|
||||||
|
fillColor: this.form.fillColor,
|
||||||
|
opacity: this.opacity,
|
||||||
|
lineWidth: this.form.lineWidth,
|
||||||
|
stroke: this.form.stroke
|
||||||
|
};
|
||||||
|
this.$emit('deleteDataModel', tipBoxModel);
|
||||||
|
this.initPage();
|
||||||
|
},
|
||||||
|
initPage() {
|
||||||
|
this.isUpdate = false;
|
||||||
|
this.buttonText = '立即创建';
|
||||||
|
this.showDeleteButton = false;
|
||||||
|
this.form = {
|
||||||
|
code: '',
|
||||||
|
tipBoxWidth: '',
|
||||||
|
tipBoxHeight: '',
|
||||||
|
fillColor: '',
|
||||||
|
x: 10,
|
||||||
|
y: 10,
|
||||||
|
opacity: false,
|
||||||
|
lineWidth: 0,
|
||||||
|
stroke: ''
|
||||||
|
};
|
||||||
|
},
|
||||||
|
generateCode() {
|
||||||
|
const mydate = new Date();
|
||||||
|
this.form.code = 'tipBox_' + mydate.getDay() + mydate.getHours() + mydate.getMinutes() + mydate.getSeconds() + mydate.getMilliseconds() + Math.round(Math.random() * 10000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
@import "src/styles/mixin.scss";
|
@import "src/styles/mixin.scss";
|
||||||
|
@ -2,153 +2,28 @@
|
|||||||
<transition name="el-zoom-in-center">
|
<transition name="el-zoom-in-center">
|
||||||
<div class="map-control">
|
<div class="map-control">
|
||||||
<div class="clearfix">
|
<div class="clearfix">
|
||||||
<span style="padding-top: 5px;">{{ $t('ibp.stationName') }}</span>
|
<div style="float: left;padding-top: 17px;">
|
||||||
<el-select v-model="stationCode" :placeholder="this.$t('rules.selectStation')" style="padding-top: 5px;" @change="changeStationCode">
|
<span style="padding-top: 5px;">{{ $t('ibp.stationName') }}</span>
|
||||||
|
<span>{{ stationCode }}</span>
|
||||||
|
</div>
|
||||||
|
<!-- <el-select v-model="stationCode" :placeholder="this.$t('rules.selectStation')" style="padding-top: 5px;" @change="changeStationCode">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in stationOptions"
|
v-for="item in stationOptions"
|
||||||
:key="item.value"
|
:key="item.value"
|
||||||
:label="item.label"
|
:label="item.label"
|
||||||
:value="item.value"
|
:value="item.value"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select> -->
|
||||||
<el-button type="text" style="float: right; padding: 15px 0; margin-right: 5px;" @click="handleSave">{{ $t('ibp.save') }}</el-button>
|
<el-button type="text" style="float: right; padding: 15px 0; margin-right: 5px;" @click="handleSave">{{ $t('ibp.save') }}</el-button>
|
||||||
</div>
|
</div>
|
||||||
<el-tabs v-model="enabledTab" class="ibpEdit" type="card" @tab-click="handleTabClick">
|
<el-tabs v-model="enabledTab" class="ibpEdit" type="card" @tab-click="handleTabClick">
|
||||||
<el-tab-pane :label="this.$t('ibp.background')" name="Background">
|
<el-tab-pane v-for="(each, index) in tabList" :key="index" :label="each.label" :name="each.name">
|
||||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: height+'px' }">
|
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: height+'px' }">
|
||||||
<ibp-bg
|
<component
|
||||||
ref="background"
|
:is="each.menus"
|
||||||
|
:ref="each.name"
|
||||||
style="width:90%"
|
style="width:90%"
|
||||||
@updateBg="createDataModel"
|
@createData="createDataModel"
|
||||||
/>
|
|
||||||
</el-scrollbar>
|
|
||||||
</el-tab-pane>
|
|
||||||
<el-tab-pane :label="this.$t('ibp.line')" name="IbpLine">
|
|
||||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: height+'px' }">
|
|
||||||
<ibp-line
|
|
||||||
ref="ibpline"
|
|
||||||
style="width:90%"
|
|
||||||
@createLine="createDataModel"
|
|
||||||
@deleteDataModel="deleteDataModel"
|
|
||||||
/>
|
|
||||||
</el-scrollbar>
|
|
||||||
</el-tab-pane>
|
|
||||||
<el-tab-pane :label="this.$t('ibp.text')" name="IbpText">
|
|
||||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: height+'px' }">
|
|
||||||
<ibp-text
|
|
||||||
ref="ibptext"
|
|
||||||
style="width:90%"
|
|
||||||
@createText="createDataModel"
|
|
||||||
@deleteDataModel="deleteDataModel"
|
|
||||||
/>
|
|
||||||
</el-scrollbar>
|
|
||||||
</el-tab-pane>
|
|
||||||
<el-tab-pane :label="this.$t('ibp.rect')" name="TipBox">
|
|
||||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: height+'px' }">
|
|
||||||
<ibp-tip-box
|
|
||||||
ref="tipbox"
|
|
||||||
style="width:90%"
|
|
||||||
@createTipBox="createDataModel"
|
|
||||||
@deleteDataModel="deleteDataModel"
|
|
||||||
/>
|
|
||||||
</el-scrollbar>
|
|
||||||
</el-tab-pane>
|
|
||||||
<el-tab-pane :label="this.$t('ibp.button')" name="SquareButton">
|
|
||||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: height+'px' }">
|
|
||||||
<ibp-button
|
|
||||||
ref="squarebutton"
|
|
||||||
style="width:90%"
|
|
||||||
@createButton="createDataModel"
|
|
||||||
@deleteDataModel="deleteDataModel"
|
|
||||||
/>
|
|
||||||
</el-scrollbar>
|
|
||||||
</el-tab-pane>
|
|
||||||
<el-tab-pane :label="this.$t('ibp.circularLamp')" name="CircularLamp">
|
|
||||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: height+'px' }">
|
|
||||||
<ibp-lamp
|
|
||||||
ref="circularlamp"
|
|
||||||
style="width:90%"
|
|
||||||
@createLamp="createDataModel"
|
|
||||||
@deleteDataModel="deleteDataModel"
|
|
||||||
/>
|
|
||||||
</el-scrollbar>
|
|
||||||
</el-tab-pane>
|
|
||||||
<el-tab-pane :label="this.$t('ibp.arrow')" name="Arrow">
|
|
||||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: height+'px' }">
|
|
||||||
<ibp-arrow
|
|
||||||
ref="arrow"
|
|
||||||
style="width:90%"
|
|
||||||
@createArrow="createDataModel"
|
|
||||||
@deleteDataModel="deleteDataModel"
|
|
||||||
/>
|
|
||||||
</el-scrollbar>
|
|
||||||
</el-tab-pane>
|
|
||||||
<el-tab-pane :label="this.$t('ibp.escalatorFrame')" name="AppendageBox">
|
|
||||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: height+'px' }">
|
|
||||||
<ibp-appendage-box
|
|
||||||
ref="appendagebox"
|
|
||||||
style="width:90%"
|
|
||||||
@createAppendageBox="createDataModel"
|
|
||||||
@deleteDataModel="deleteDataModel"
|
|
||||||
/>
|
|
||||||
</el-scrollbar>
|
|
||||||
</el-tab-pane>
|
|
||||||
<el-tab-pane :label="this.$t('ibp.alarm')" name="Alarm">
|
|
||||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: height+'px' }">
|
|
||||||
<ibp-alarm
|
|
||||||
ref="alarm"
|
|
||||||
style="width:90%"
|
|
||||||
@createAlarm="createDataModel"
|
|
||||||
@deleteDataModel="deleteDataModel"
|
|
||||||
/>
|
|
||||||
</el-scrollbar>
|
|
||||||
</el-tab-pane>
|
|
||||||
<el-tab-pane :label="this.$t('ibp.telephoneTerminal')" name="TeleTerminal">
|
|
||||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: height+'px' }">
|
|
||||||
<ibp-telephone-terminal
|
|
||||||
ref="teleTerminal"
|
|
||||||
style="width:90%"
|
|
||||||
@createTeleTerminal="createDataModel"
|
|
||||||
@deleteDataModel="deleteDataModel"
|
|
||||||
/>
|
|
||||||
</el-scrollbar>
|
|
||||||
</el-tab-pane>
|
|
||||||
<el-tab-pane :label="this.$t('ibp.escalator')" name="Elevator">
|
|
||||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: height+'px' }">
|
|
||||||
<ibp-elevator
|
|
||||||
ref="elevator"
|
|
||||||
style="width:90%"
|
|
||||||
@createElevator="createDataModel"
|
|
||||||
@deleteDataModel="deleteDataModel"
|
|
||||||
/>
|
|
||||||
</el-scrollbar>
|
|
||||||
</el-tab-pane>
|
|
||||||
<el-tab-pane :label="this.$t('ibp.key')" name="Key">
|
|
||||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: height+'px' }">
|
|
||||||
<ibp-key
|
|
||||||
ref="key"
|
|
||||||
style="width:90%"
|
|
||||||
@createKey="createDataModel"
|
|
||||||
@deleteDataModel="deleteDataModel"
|
|
||||||
/>
|
|
||||||
</el-scrollbar>
|
|
||||||
</el-tab-pane>
|
|
||||||
<el-tab-pane :label="this.$t('ibp.digitalClock')" name="Clock">
|
|
||||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: height+'px' }">
|
|
||||||
<ibp-clock
|
|
||||||
ref="clock"
|
|
||||||
style="width:90%"
|
|
||||||
@createClock="createDataModel"
|
|
||||||
@deleteDataModel="deleteDataModel"
|
|
||||||
/>
|
|
||||||
</el-scrollbar>
|
|
||||||
</el-tab-pane>
|
|
||||||
<el-tab-pane :label="this.$t('ibp.rotateTip')" name="RotateTip">
|
|
||||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: height+'px' }">
|
|
||||||
<ibp-rotate-tip
|
|
||||||
ref="rotateTip"
|
|
||||||
style="width:90%"
|
|
||||||
@createRotateTip="createDataModel"
|
|
||||||
@deleteDataModel="deleteDataModel"
|
@deleteDataModel="deleteDataModel"
|
||||||
/>
|
/>
|
||||||
</el-scrollbar>
|
</el-scrollbar>
|
||||||
@ -200,32 +75,34 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
enabledTab: 'Background',
|
enabledTab: 'Background',
|
||||||
|
lazy: true,
|
||||||
|
tabList:[
|
||||||
|
{ label: this.$t('ibp.background'), name:'Background', menus: IbpBg },
|
||||||
|
{ label: this.$t('ibp.line'), name:'IbpLine', menus: IbpLine },
|
||||||
|
{ label: this.$t('ibp.text'), name:'IbpText', menus: IbpText },
|
||||||
|
{ label: this.$t('ibp.rect'), name:'TipBox', menus: IbpTipBox },
|
||||||
|
{ label: this.$t('ibp.button'), name:'SquareButton', menus: IbpButton },
|
||||||
|
{ label: this.$t('ibp.circularLamp'), name:'CircularLamp', menus: IbpLamp },
|
||||||
|
{ label: this.$t('ibp.arrow'), name:'Arrow', menus: IbpArrow },
|
||||||
|
{ label: this.$t('ibp.escalatorFrame'), name:'AppendageBox', menus: IbpAppendageBox },
|
||||||
|
{ label: this.$t('ibp.alarm'), name:'Alarm', menus: IbpAlarm },
|
||||||
|
{ label: this.$t('ibp.telephoneTerminal'), name:'TeleTerminal', menus: IbpTelephoneTerminal },
|
||||||
|
{ label: this.$t('ibp.escalator'), name:'Elevator', menus: IbpElevator },
|
||||||
|
{ label: this.$t('ibp.key'), name:'Key', menus: IbpKey },
|
||||||
|
{ label: this.$t('ibp.digitalClock'), name:'Clock', menus: IbpClock },
|
||||||
|
{ label: this.$t('ibp.rotateTip'), name:'RotateTip', menus: IbpRotateTip }
|
||||||
|
],
|
||||||
data: '',
|
data: '',
|
||||||
stationOptions:[],
|
stationOptions:[],
|
||||||
// stationOptions:[
|
|
||||||
// {
|
|
||||||
// value: 'Station_203_0.07533',
|
|
||||||
// // label: '通化门站'
|
|
||||||
// label: '车站一'
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// value: 'Station_207_0.62282',
|
|
||||||
// // label: '枣园站'
|
|
||||||
// label: '车站二'
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// value: 'Station_209_0.95175',
|
|
||||||
// label: '车站三'
|
|
||||||
// // label: '后卫寨站'
|
|
||||||
// }
|
|
||||||
// ],
|
|
||||||
// drawData: {},
|
|
||||||
// stationCode: '',
|
|
||||||
height: this.$store.state.app.height - 190
|
height: this.$store.state.app.height - 190
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed:{
|
computed:{
|
||||||
stationCode() {
|
stationCode() {
|
||||||
|
if (this.stationOptions.length) {
|
||||||
|
const obj = this.stationOptions.find(ele => ele.value == this.$route.query.stationCode);
|
||||||
|
return obj.label;
|
||||||
|
}
|
||||||
return this.$route.query.stationCode;
|
return this.$route.query.stationCode;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -254,9 +131,6 @@ export default {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log('error', error);
|
console.log('error', error);
|
||||||
}
|
}
|
||||||
},
|
|
||||||
beforeDestroy() {
|
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
createDataModel(model) {
|
createDataModel(model) {
|
||||||
@ -278,31 +152,35 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
setIbpShow(data) {
|
setIbpShow(data) {
|
||||||
this.$emit('set-ibp-show', data);
|
if (data) {
|
||||||
|
this.$emit('set-ibp-show', data);
|
||||||
|
}
|
||||||
this.handleTabClick();
|
this.handleTabClick();
|
||||||
},
|
},
|
||||||
setEmptyShow() {
|
setEmptyShow() {
|
||||||
this.$emit('set-empty-show');
|
this.$emit('set-empty-show');
|
||||||
},
|
},
|
||||||
changeStationCode(e) {
|
// changeStationCode(e) {
|
||||||
this.$emit('ibpChange', e);
|
// this.$emit('ibpChange', e);
|
||||||
this.handleTabClick();
|
// this.handleTabClick();
|
||||||
},
|
// },
|
||||||
handleTabClick() {
|
handleTabClick() {
|
||||||
this.$refs.ibpline.initPage();
|
this.$nextTick(() => {
|
||||||
this.$refs.ibptext.initPage();
|
this.$refs.IbpLine[0].initPage();
|
||||||
this.$refs.tipbox.initPage();
|
this.$refs.IbpText[0].initPage();
|
||||||
this.$refs.squarebutton.initPage();
|
this.$refs.TipBox[0].initPage();
|
||||||
this.$refs.circularlamp.initPage();
|
this.$refs.SquareButton[0].initPage();
|
||||||
this.$refs.arrow.initPage();
|
this.$refs.CircularLamp[0].initPage();
|
||||||
this.$refs.appendagebox.initPage();
|
this.$refs.Arrow[0].initPage();
|
||||||
this.$refs.alarm.initPage();
|
this.$refs.AppendageBox[0].initPage();
|
||||||
this.$refs.elevator.initPage();
|
this.$refs.Alarm[0].initPage();
|
||||||
this.$refs.key.initPage();
|
this.$refs.Elevator[0].initPage();
|
||||||
this.$refs.teleTerminal.initPage();
|
this.$refs.Key[0].initPage();
|
||||||
this.$refs.clock.initPage();
|
this.$refs.TeleTerminal[0].initPage();
|
||||||
this.$refs.rotateTip.initPage();
|
this.$refs.Clock[0].initPage();
|
||||||
this.$refs.background.initPage();
|
this.$refs.RotateTip[0].initPage();
|
||||||
|
this.$refs.Background[0].initPage();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -317,6 +195,7 @@ export default {
|
|||||||
.clearfix{
|
.clearfix{
|
||||||
height: 50px;
|
height: 50px;
|
||||||
padding: 0 22px;
|
padding: 0 22px;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
.ibpEdit{
|
.ibpEdit{
|
||||||
height: calc(100% - 50px);
|
height: calc(100% - 50px);
|
||||||
|
@ -167,6 +167,7 @@ export default {
|
|||||||
},
|
},
|
||||||
setIbp(data, oldData) {
|
setIbp(data, oldData) {
|
||||||
this.$ibp.setIbp(oldData, data);
|
this.$ibp.setIbp(oldData, data);
|
||||||
|
this.$store.dispatch('ibp/setIbpData', oldData);
|
||||||
},
|
},
|
||||||
handleBanOpenScreenDoorStatus() {
|
handleBanOpenScreenDoorStatus() {
|
||||||
this.$store.state.ibp.ibp['keyList'].forEach(item => {
|
this.$store.state.ibp.ibp['keyList'].forEach(item => {
|
||||||
|
@ -30,9 +30,12 @@
|
|||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="通知选择:" prop="noticeType">
|
<el-form-item label="通知选择:" prop="noticeType">
|
||||||
<el-radio-group v-model="messageModel.noticeType">
|
<el-checkbox-group v-model="messageModel.noticeType">
|
||||||
|
<el-checkbox v-for="(item, index) in regionList" :key="index" :label="item.value">{{ item.label }}</el-checkbox>
|
||||||
|
</el-checkbox-group>
|
||||||
|
<!-- <el-radio-group v-model="messageModel.noticeType">
|
||||||
<el-radio v-for="(item, index) in regionList" :key="index" :label="item.value">{{ item.label }}</el-radio>
|
<el-radio v-for="(item, index) in regionList" :key="index" :label="item.value">{{ item.label }}</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group> -->
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
@ -60,7 +63,7 @@ export default {
|
|||||||
type: '',
|
type: '',
|
||||||
subject: '',
|
subject: '',
|
||||||
content: '',
|
content: '',
|
||||||
noticeType: '01'
|
noticeType: []
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
type: [
|
type: [
|
||||||
@ -71,10 +74,10 @@ export default {
|
|||||||
],
|
],
|
||||||
content:[
|
content:[
|
||||||
{ required: true, message: this.$t('rules.enterTheNewsContent'), trigger: 'blur' }
|
{ required: true, message: this.$t('rules.enterTheNewsContent'), trigger: 'blur' }
|
||||||
],
|
|
||||||
noticeType: [
|
|
||||||
{ required: true, message: this.$t('rules.chooseNewsCanBeClosed'), trigger: 'change' }
|
|
||||||
]
|
]
|
||||||
|
// noticeType: [
|
||||||
|
// { required: true, message: this.$t('rules.chooseNewsCanBeClosed'), trigger: 'change' }
|
||||||
|
// ]
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user