2020-09-22 18:03:46 +08:00
|
|
|
<template>
|
|
|
|
<div style="overflow-y: scroll;height: calc(100% - 46px); width: 100%;">
|
|
|
|
<el-form ref="form" :rules="rules" :model="form" label-width="80px" style="width: 100%;padding: 10px 50px;">
|
2020-10-12 14:28:25 +08:00
|
|
|
<el-form-item label="图层:" prop="z2">
|
|
|
|
<el-input-number v-model="form.z2" controls-position="right" size="small" />
|
|
|
|
</el-form-item>
|
2020-09-22 18:03:46 +08:00
|
|
|
<el-form-item label="图片类型:" prop="type">
|
|
|
|
<el-select v-model="form.type" placeholder="请选择类型" size="small">
|
|
|
|
<el-option v-for="(item, index) in typeList" :key="index" :label="item.name" :value="item.value" />
|
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
2020-10-12 13:04:13 +08:00
|
|
|
<el-form-item label="旋转角度:" prop="rotation">
|
|
|
|
<el-input-number v-model="form.rotation" controls-position="right" size="small" />
|
|
|
|
</el-form-item>
|
2020-09-22 18:03:46 +08:00
|
|
|
<el-form-item label="宽度:" prop="width">
|
|
|
|
<el-input-number v-model="form.width" controls-position="right" :min="1" size="small" />
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="高度:" prop="height">
|
|
|
|
<el-input-number v-model="form.height" controls-position="right" :min="1" size="small" />
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="X轴坐标:">
|
|
|
|
<el-input-number v-model="form.x" controls-position="right" :min="1" size="small" />
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="Y轴坐标:">
|
|
|
|
<el-input-number v-model="form.y" controls-position="right" :min="1" size="small" />
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item>
|
|
|
|
<el-button type="primary" size="small" @click="onSubmit('form')">{{ buttonText }}</el-button>
|
|
|
|
<el-button v-show="showDeleteButton" size="small" type="danger" @click="deleteDevice">删除</el-button>
|
|
|
|
<el-button v-show="showDeleteButton" size="small" @click="initPage">取消</el-button>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import { mapGetters } from 'vuex';
|
|
|
|
import {getUID} from '@/iscs/utils/Uid';
|
|
|
|
export default {
|
|
|
|
name: 'IscsPicture',
|
|
|
|
components: {
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
isUpdate: false,
|
|
|
|
buttonText: '立即创建',
|
|
|
|
showDeleteButton: false,
|
|
|
|
form: {
|
|
|
|
code: '',
|
2020-10-12 14:28:25 +08:00
|
|
|
type: '',
|
|
|
|
z2: 0,
|
2020-09-22 18:03:46 +08:00
|
|
|
width: 50,
|
2020-10-12 13:04:13 +08:00
|
|
|
height: 50,
|
|
|
|
rotation: 0,
|
2020-09-22 18:03:46 +08:00
|
|
|
x: 10,
|
|
|
|
y: 10
|
|
|
|
},
|
|
|
|
typeList: [
|
2020-09-23 10:22:52 +08:00
|
|
|
{ name: '车头', value: 'psdLeft' },
|
2020-09-23 18:44:00 +08:00
|
|
|
{ name: '车尾', value: 'psdRight' },
|
2020-09-27 16:12:25 +08:00
|
|
|
{ name: '车厢', value: 'psdSystem' },
|
2020-10-10 14:03:21 +08:00
|
|
|
{ name: '人防门', value: 'envPersonDoor'},
|
|
|
|
{ name: '蓝色FIRE', value: 's'},
|
|
|
|
{ name: '红色FIRE', value: 'a'},
|
|
|
|
{ name: 'APF', value: 'APF'},
|
2020-10-10 18:39:56 +08:00
|
|
|
{ name: '手动阀', value: 'hand'},
|
|
|
|
{ name: '蓝色-阀门', value: 'fmBlue'},
|
|
|
|
{ name: '灰色-阀门', value: 'fmGray'},
|
|
|
|
{ name: '绿色-阀门', value: 'fmGreen'},
|
|
|
|
{ name: '空调', value: 'airCond'},
|
|
|
|
{ name: '多联空调', value: 'airCondMul'},
|
|
|
|
{ name: '管件', value: 'setting'},
|
|
|
|
{ name: '汽包', value: 'drum' },
|
|
|
|
{ name: '红色-左侧-鼓风机', value: 'blowerRedLeft'},
|
|
|
|
{ name: '灰色-左侧-鼓风机', value: 'blowerGrayLeft'},
|
|
|
|
{ name: '红色-右侧-鼓风机', value: 'blowerRedRight'},
|
|
|
|
{ name: '灰色-右侧-鼓风机', value: 'blowerGrayRight'},
|
2020-10-12 14:28:25 +08:00
|
|
|
{ name: '灰色-排风机', value: 'exhaustFanGray' },
|
|
|
|
{ name: '绿色-排风机', value: 'exhaustFanGreen' },
|
2020-10-10 18:39:56 +08:00
|
|
|
{ name: '冷水机', value: 'waterCooler'},
|
|
|
|
{ name: '顶部排风机', value: 'ventilationFan'},
|
2020-10-12 12:20:07 +08:00
|
|
|
{ name: '文字蓝色背景', value: 'textBgBluePoint'},
|
|
|
|
{ name: '扶梯', value: 'escalator'},
|
|
|
|
{ name: '扶梯-朝上指示', value: 'toUp'},
|
|
|
|
{ name: '扶梯-朝下执行', value: 'toDown'},
|
2020-10-12 14:28:25 +08:00
|
|
|
{ name: '电梯', value: 'lift' },
|
|
|
|
{ name: '蓝色-排水', value: 'dewateringBlue' },
|
|
|
|
{ name: '灰色-电梯', value: 'dewateringGray' },
|
|
|
|
{ name: '紫色-电梯', value: 'dewateringPurple' },
|
2020-09-27 16:12:25 +08:00
|
|
|
],
|
|
|
|
|
2020-09-22 18:03:46 +08:00
|
|
|
rules: {
|
|
|
|
strokeColor: [
|
|
|
|
{ required: true, message: '请选择边框颜色', trigger: 'change' }
|
|
|
|
],
|
|
|
|
fillColor: [
|
|
|
|
{ required: true, message: '请选择矩形填充颜色', trigger: 'change'}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
};
|
|
|
|
},
|
|
|
|
computed:{
|
|
|
|
...mapGetters('iscs', [
|
|
|
|
'iscs'
|
|
|
|
])
|
|
|
|
},
|
|
|
|
watch:{
|
|
|
|
'$store.state.iscs.rightClickCount': function (val) {
|
|
|
|
const model = this.$store.getters['iscs/updateDeviceData'];
|
|
|
|
if (model._type === 'IscsPicture' ) {
|
|
|
|
this.buttonText = '修改';
|
|
|
|
this.showDeleteButton = true;
|
|
|
|
this.isUpdate = true;
|
|
|
|
this.form.code = model.code;
|
|
|
|
this.form.type = model.type;
|
2020-10-12 14:28:25 +08:00
|
|
|
this.form.z2 = model.z2;
|
2020-10-10 18:39:56 +08:00
|
|
|
this.form.rotation = model.rotation;
|
2020-09-22 18:03:46 +08:00
|
|
|
this.form.width = model.width;
|
|
|
|
this.form.height = model.height;
|
|
|
|
this.form.x = model.point.x;
|
|
|
|
this.form.y = model.point.y;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
mounted() {},
|
|
|
|
methods: {
|
|
|
|
onSubmit(form) {
|
|
|
|
this.$refs[form].validate((valid) => {
|
|
|
|
if (valid) {
|
|
|
|
const rectModel = {
|
|
|
|
point: {
|
|
|
|
x: this.form.x,
|
|
|
|
y: this.form.y
|
|
|
|
},
|
2020-09-23 10:22:52 +08:00
|
|
|
code: this.isUpdate ? this.form.code : getUID('IscsPicture', this.iscs.iscsPictureList),
|
2020-09-22 18:03:46 +08:00
|
|
|
_type: 'IscsPicture',
|
|
|
|
type: this.form.type,
|
2020-10-12 14:28:25 +08:00
|
|
|
z2: this.form.z2,
|
2020-10-10 18:39:56 +08:00
|
|
|
rotation: this.form.rotation,
|
2020-09-22 18:03:46 +08:00
|
|
|
width: this.form.width,
|
|
|
|
height: this.form.height
|
|
|
|
};
|
|
|
|
this.$emit('createDataModel', rectModel);
|
|
|
|
this.initPage();
|
|
|
|
} else {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
},
|
|
|
|
deleteDevice() {
|
|
|
|
const rectModel = {
|
|
|
|
point: {
|
|
|
|
x: this.form.x,
|
|
|
|
y: this.form.y
|
|
|
|
},
|
|
|
|
code: this.form.code,
|
|
|
|
_type: 'IscsPicture',
|
|
|
|
type: this.form.type,
|
2020-10-12 14:28:25 +08:00
|
|
|
z2: this.form.z2,
|
2020-10-10 18:39:56 +08:00
|
|
|
rotation: this.form.rotation,
|
2020-09-22 18:03:46 +08:00
|
|
|
};
|
|
|
|
this.$emit('deleteDataModel', rectModel);
|
|
|
|
},
|
|
|
|
initPage() {
|
|
|
|
this.isUpdate = false;
|
|
|
|
this.buttonText = '立即创建';
|
|
|
|
this.showDeleteButton = false;
|
|
|
|
this.form = {
|
|
|
|
code: '',
|
|
|
|
type: '',
|
2020-10-12 14:28:25 +08:00
|
|
|
z2: 0,
|
2020-10-10 18:39:56 +08:00
|
|
|
rotation: 0,
|
2020-09-22 18:03:46 +08:00
|
|
|
width: 50,
|
|
|
|
height: 50,
|
|
|
|
x: 10,
|
|
|
|
y: 10
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
|
|
|
@import "src/styles/mixin.scss";
|
|
|
|
.button_box{
|
|
|
|
width: 100%;
|
|
|
|
background: #f0f0f0;
|
|
|
|
overflow: hidden;
|
|
|
|
}
|
|
|
|
</style>
|