iscs调整

This commit is contained in:
fan 2020-01-19 10:05:55 +08:00
parent d744d7a69e
commit 15ca63be84
12 changed files with 299 additions and 91 deletions

View File

@ -99,12 +99,6 @@ deviceRender[deviceType.BorderRadius] = {
z: 4
};
/** 空调机 */
deviceRender[deviceType.AirConditioner] = {
_type: deviceType.AirConditioner,
zlevel: 1,
z: 4
};
/** 轨道排风机 */
deviceRender[deviceType.OrbitalVentilator] = {
_type: deviceType.OrbitalVentilator,
@ -172,5 +166,4 @@ deviceRender[deviceType.VolumeControlDamper] = {
z: 4
};
export default deviceRender;

View File

@ -1,31 +1,30 @@
const deviceType = {
ManualAlarmButton: 'manualAlarmButton',
ManualAlarmButton: 'ManualAlarmButton',
Vidicon: 'Vidicon',
VidiconCloud: 'VidiconCloud',
CheckBox: 'CheckBox',
FrozenPump:'FrozenPump',
FireHydranAlarmButton: 'fireHydranAlarmButton',
GasFireControl: 'gasFireControl',
SmokeDetector: 'smokeDetector',
TemperatureDetector: 'temperatureDetector',
PlatformScreenDoor: 'platformScreenDoor',
FireHydranAlarmButton: 'FireHydranAlarmButton',
GasFireControl: 'GasFireControl',
SmokeDetector: 'SmokeDetector',
TemperatureDetector: 'TemperatureDetector',
PlatformScreenDoor: 'PlatformScreenDoor',
Ventilator:'Ventilator',
Chiller:'Chiller',
CoolTower:'CoolTower',
BorderRadius: 'borderRadius',
EndDoor: 'endDoor',
BorderRadius: 'BorderRadius',
EndDoor: 'EndDoor',
AirConditioner:'AirConditioner',
OrbitalVentilator:'OrbitalVentilator',
JetFan:'JetFan',
TunnelFan:'TunnelFan',
FireDamper:'FireDamper',
SmookProofFd:'SmookProofFd',
BrakeMachine: 'brakeMachine',
EntranceGuard: 'entranceGuard',
SemiAutomaticTicketMachine: 'semiAutomaticTicketMachine',
TicketMachine: 'ticketMachine',
AirConditioner: 'airConditioner',
VolumeControlDamper: 'volumeControlDamper'
BrakeMachine: 'BrakeMachine',
EntranceGuard: 'EntranceGuard',
SemiAutomaticTicketMachine: 'SemiAutomaticTicketMachine',
TicketMachine: 'TicketMachine',
VolumeControlDamper: 'VolumeControlDamper'
};
export default deviceType;

View File

@ -14,7 +14,6 @@ import Chiller from './bas/chiller';
import CoolTower from './bas/coolTower';
import EndDoor from './endDoor';
import BorderRadius from './borderRadius';
import AirConditioner from './bas/airConditioner';
import OrbitalVentilator from './bas/orbitalVentilator';
import JetFan from './bas/jetFan';
import TunnelFan from './bas/tunnelFan';

View File

@ -118,7 +118,9 @@ export function parser(data) {
zrUtil.each(data.semiAutomaticTicketMachineList || [], elem =>{
iscsDevice[elem.code] = deviceFactory(deviceType.SemiAutomaticTicketMachine, elem);
});
zrUtil.each(data.volumeControlDamperList || [], elem => {
iscsDevice[elem.code] = deviceFactory(deviceType.VolumeControlDamper, elem);
});
}
return iscsDevice;
@ -214,6 +216,9 @@ export function updateIscsData(device) {
case deviceType.SmookProofFd:
updateIscsListByDevice(iscsData, 'smookProofFdList', device);
break;
case deviceType.VolumeControlDamper:
updateIscsListByDevice(iscsData, 'volumeControlDamperList', device);
break;
}
store.dispatch('iscs/setIscsData', iscsData);

View File

@ -2,7 +2,7 @@
<div class="content_box">
<span>本产品基于长安玖琏</span><span v-if="!project.startsWith('design')">城市轨道交通实训云平台设计开发</span><span v-else>城市轨道交通设计云平台设计开发</span>
<br><span>实训平台网址</span><a target="_blank" href="https://joylink.club" style="color: #33F;text-decoration:underline;">https://joylink.club</a>
<br><span>设计平台网址</span><a target="_blank" href="https://joylink.club" style="color: #33F;text-decoration:underline;">https://joylink.club/design</a>
<br><span>设计平台网址</span><a target="_blank" href="https://joylink.club/design" style="color: #33F;text-decoration:underline;">https://joylink.club/design</a>
</div>
</template>

View File

@ -1,8 +1,8 @@
<template>
<div>
<el-form ref="form" :rule="rules" :model="addModel" label-width="100px">
<el-form-item v-if="addModel.code" label="按钮编号" prop="code">
<el-input v-model="addModel.code" />
<el-form-item v-if="isUpdate" label="按钮编号" prop="code">
<el-input v-model="addModel.code" :disabled="true" />
</el-form-item>
<el-form-item label="图形宽度" prop="width">
<el-input-number v-model="addModel.width" />
@ -23,8 +23,10 @@
</template>
<script>
import { mapGetters } from 'vuex';
import {getUID} from '@/iscs/utils/Uid';
export default {
name: 'PlatformScreenDoor',
name: 'EntranceGuard',
data() {
return {
addModel:{
@ -38,27 +40,44 @@ export default {
x: [{ required: true, message: '请输入设备图形的X轴坐标', trigger: 'blur' }],
y: [{ required: true, message: '请输入设备图形的Y轴坐标', trigger: 'blur' }]
},
isUpdate:false,
showDeleteButton: false,
buttonText: '立即创建'
};
},
computed:{
...mapGetters('iscs', [
'entranceGuardList'
])
},
watch:{
'$store.state.iscs.rightClickCount': function (val) {
const model = this.$store.getters['iscs/updateDeviceData'];
if (model._type === 'EntranceGuard' ) {
this.buttonText = '修改';
this.showDeleteButton = true;
this.isUpdate = true;
this.form.code = model.code;
this.form.width = model.width;
this.form.x = model.point.x;
this.form.y = model.point.y;
}
}
},
methods: {
onSubmit(form) {
if (!this.addModel.code) {
this.generateCode();
}
this.$refs[form].validate((valid) => {
if (valid) {
const maButtonModel = {
const newModel = {
point: {
x: this.addModel.x,
y: this.addModel.y
},
code: this.addModel.code,
_type: 'entranceGuard',
code: this.isUpdate ? this.form.code : getUID('EntranceGuard', this.entranceGuardList),
_type: 'EntranceGuard',
width: this.addModel.width
};
this.$emit('createDataModel', maButtonModel);
this.$emit('createDataModel', newModel);
this.initPage();
} else {
return false;
@ -66,16 +85,16 @@ export default {
});
},
deleteDevice() {
const maButtonModel = {
const newModel = {
point: {
x: this.addModel.x,
y: this.addModel.y
},
code: this.addModel.code,
_type: 'entranceGuard',
_type: 'EntranceGuard',
width: this.addModel.width
};
this.$emit('deleteDataModel', maButtonModel);
this.$emit('deleteDataModel', newModel);
this.initPage();
},
initPage() {
@ -88,10 +107,6 @@ export default {
x: 10,
y: 10
};
},
generateCode() {
const mydate = new Date();
this.addModel.code = 'entranceGuard_' + mydate.getDay() + mydate.getHours() + mydate.getMinutes() + mydate.getSeconds() + mydate.getMilliseconds() + Math.round(Math.random() * 10000);
}
}

View File

@ -1,8 +1,8 @@
<template>
<div>
<el-form ref="form" :rule="rules" :model="addModel" label-width="100px">
<el-form-item v-if="addModel.code" label="按钮编号" prop="code">
<el-input v-model="addModel.code" />
<el-form-item v-if="isUpdate" label="按钮编号" prop="code">
<el-input v-model="addModel.code" :disabled="true" />
</el-form-item>
<el-form-item label="图形宽度" prop="width">
<el-input-number v-model="addModel.width" />
@ -23,6 +23,8 @@
</template>
<script>
import { mapGetters } from 'vuex';
import {getUID} from '@/iscs/utils/Uid';
export default {
name: 'BrakeMachine',
data() {
@ -38,15 +40,32 @@ export default {
x: [{ required: true, message: '请输入设备图形的X轴坐标', trigger: 'blur' }],
y: [{ required: true, message: '请输入设备图形的Y轴坐标', trigger: 'blur' }]
},
isUpdate:false,
showDeleteButton: false,
buttonText: '立即创建'
};
},
computed:{
...mapGetters('iscs', [
'brakeMachineList'
])
},
watch:{
'$store.state.iscs.rightClickCount': function (val) {
const model = this.$store.getters['iscs/updateDeviceData'];
if (model._type === 'BrakeMachine' ) {
this.buttonText = '修改';
this.showDeleteButton = true;
this.isUpdate = true;
this.form.code = model.code;
this.form.width = model.width;
this.form.x = model.point.x;
this.form.y = model.point.y;
}
}
},
methods: {
onSubmit(form) {
if (!this.addModel.code) {
this.generateCode();
}
this.$refs[form].validate((valid) => {
if (valid) {
const maButtonModel = {
@ -54,8 +73,8 @@ export default {
x: this.addModel.x,
y: this.addModel.y
},
code: this.addModel.code,
_type: 'brakeMachine',
code: this.isUpdate ? this.form.code : getUID('BrakeMachine', this.brakeMachineList),
_type: 'BrakeMachine',
width: this.addModel.width
};
this.$emit('createDataModel', maButtonModel);
@ -72,7 +91,7 @@ export default {
y: this.addModel.y
},
code: this.addModel.code,
_type: 'brakeMachine',
_type: 'BrakeMachine',
width: this.addModel.width
};
this.$emit('deleteDataModel', maButtonModel);
@ -88,10 +107,6 @@ export default {
x: 10,
y: 10
};
},
generateCode() {
const mydate = new Date();
this.addModel.code = 'brakeMachine_' + mydate.getDay() + mydate.getHours() + mydate.getMinutes() + mydate.getSeconds() + mydate.getMilliseconds() + Math.round(Math.random() * 10000);
}
}

View File

@ -1,8 +1,8 @@
<template>
<div>
<el-form ref="form" :rule="rules" :model="addModel" label-width="100px">
<el-form-item v-if="addModel.code" label="按钮编号" prop="code">
<el-input v-model="addModel.code" />
<el-form-item v-if="isUpdate" label="按钮编号" prop="code">
<el-input v-model="addModel.code" :disabled="true" />
</el-form-item>
<el-form-item label="图形宽度" prop="width">
<el-input-number v-model="addModel.width" />
@ -23,6 +23,8 @@
</template>
<script>
import { mapGetters } from 'vuex';
import {getUID} from '@/iscs/utils/Uid';
export default {
name: 'SemiAutomaticTicketMachine',
data() {
@ -38,15 +40,32 @@ export default {
x: [{ required: true, message: '请输入设备图形的X轴坐标', trigger: 'blur' }],
y: [{ required: true, message: '请输入设备图形的Y轴坐标', trigger: 'blur' }]
},
isUpdate:false,
showDeleteButton: false,
buttonText: '立即创建'
};
},
computed:{
...mapGetters('iscs', [
'semiAutomaticTicketMachineList'
])
},
watch:{
'$store.state.iscs.rightClickCount': function (val) {
const model = this.$store.getters['iscs/updateDeviceData'];
if (model._type === 'SemiAutomaticTicketMachine' ) {
this.buttonText = '修改';
this.showDeleteButton = true;
this.isUpdate = true;
this.form.code = model.code;
this.form.width = model.width;
this.form.x = model.point.x;
this.form.y = model.point.y;
}
}
},
methods: {
onSubmit(form) {
if (!this.addModel.code) {
this.generateCode();
}
this.$refs[form].validate((valid) => {
if (valid) {
const maButtonModel = {
@ -54,8 +73,8 @@ export default {
x: this.addModel.x,
y: this.addModel.y
},
code: this.addModel.code,
_type: 'semiAutomaticTicketMachine',
code: this.isUpdate ? this.form.code : getUID('VolumeControlDamper', this.semiAutomaticTicketMachineList),
_type: 'SemiAutomaticTicketMachine',
width: this.addModel.width
};
this.$emit('createDataModel', maButtonModel);
@ -72,7 +91,7 @@ export default {
y: this.addModel.y
},
code: this.addModel.code,
_type: 'semiAutomaticTicketMachine',
_type: 'SemiAutomaticTicketMachine',
width: this.addModel.width
};
this.$emit('deleteDataModel', maButtonModel);
@ -88,10 +107,6 @@ export default {
x: 10,
y: 10
};
},
generateCode() {
const mydate = new Date();
this.addModel.code = 'semiAutomaticTicketMachine_' + mydate.getDay() + mydate.getHours() + mydate.getMinutes() + mydate.getSeconds() + mydate.getMilliseconds() + Math.round(Math.random() * 10000);
}
}

View File

@ -1,8 +1,8 @@
<template>
<div>
<el-form ref="form" :rule="rules" :model="addModel" label-width="100px">
<el-form-item v-if="addModel.code" label="按钮编号" prop="code">
<el-input v-model="addModel.code" />
<el-form-item v-if="isUpdate" label="按钮编号" prop="code">
<el-input v-model="addModel.code" :disabled="true" />
</el-form-item>
<el-form-item label="图形宽度" prop="width">
<el-input-number v-model="addModel.width" />
@ -23,6 +23,8 @@
</template>
<script>
import { mapGetters } from 'vuex';
import {getUID} from '@/iscs/utils/Uid';
export default {
name: 'TicketMachine',
data() {
@ -38,15 +40,32 @@ export default {
x: [{ required: true, message: '请输入设备图形的X轴坐标', trigger: 'blur' }],
y: [{ required: true, message: '请输入设备图形的Y轴坐标', trigger: 'blur' }]
},
isUpdate:false,
showDeleteButton: false,
buttonText: '立即创建'
};
},
computed:{
...mapGetters('iscs', [
'ticketMachineList'
])
},
watch:{
'$store.state.iscs.rightClickCount': function (val) {
const model = this.$store.getters['iscs/updateDeviceData'];
if (model._type === 'TicketMachine' ) {
this.buttonText = '修改';
this.showDeleteButton = true;
this.isUpdate = true;
this.form.code = model.code;
this.form.width = model.width;
this.form.x = model.point.x;
this.form.y = model.point.y;
}
}
},
methods: {
onSubmit(form) {
if (!this.addModel.code) {
this.generateCode();
}
this.$refs[form].validate((valid) => {
if (valid) {
const maButtonModel = {
@ -54,8 +73,8 @@ export default {
x: this.addModel.x,
y: this.addModel.y
},
code: this.addModel.code,
_type: 'ticketMachine',
code: this.isUpdate ? this.form.code : getUID('TicketMachine', this.ticketMachineList),
_type: 'TicketMachine',
width: this.addModel.width
};
this.$emit('createDataModel', maButtonModel);
@ -72,7 +91,7 @@ export default {
y: this.addModel.y
},
code: this.addModel.code,
_type: 'ticketMachine',
_type: 'TicketMachine',
width: this.addModel.width
};
this.$emit('deleteDataModel', maButtonModel);
@ -88,10 +107,6 @@ export default {
x: 10,
y: 10
};
},
generateCode() {
const mydate = new Date();
this.addModel.code = 'ticketMachine_' + mydate.getDay() + mydate.getHours() + mydate.getMinutes() + mydate.getSeconds() + mydate.getMilliseconds() + Math.round(Math.random() * 10000);
}
}

View File

@ -91,6 +91,14 @@
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
<el-tab-pane>
<volume-control-damper
ref="volumeControlDamper"
style="width: 90%"
@createDataModel="createDataModel"
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
</el-tabs>
</el-card>
</div>
@ -108,6 +116,7 @@ import JetFan from './jetFan';
import TunnelFan from './tunnelFan';
import FireDamper from './fireDamper';
import SmookProofFd from './smookProofFd';
import VolumeControlDamper from './volumeControlDamper';
export default {
name: 'IscsOperate',
@ -121,7 +130,8 @@ export default {
JetFan,
TunnelFan,
FireDamper,
SmookProofFd
SmookProofFd,
VolumeControlDamper
},
mixins: [
],

View File

@ -0,0 +1,128 @@
<template>
<div>
<el-form ref="form" :rules="rules" :model="form" label-width="100px">
<el-form-item v-if="isUpdate" label="编号" prop="code">
<el-input v-model="form.code" :disabled="true" />
</el-form-item>
<el-form-item label="图形宽度" prop="width">
<el-input-number v-model="form.width" :min="40" />
</el-form-item>
<el-form-item label="X轴坐标" prop="x">
<el-input-number v-model="form.x" controls-position="right" :min="1" />
</el-form-item>
<el-form-item label="Y轴坐标" prop="y">
<el-input-number v-model="form.y" controls-position="right" :min="1" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
<el-button v-show="showDeleteButton" type="danger" @click="deleteDevice">{{ $t('global.delete') }}</el-button>
<el-button v-show="showDeleteButton" @click="initPage">{{ $t('global.cancel') }}</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import {getUID} from '@/iscs/utils/Uid';
export default {
name:'VolumeControlDamper',
data() {
return {
isUpdate:false,
showDeleteButton: false,
buttonText: '立即创建',
form:{
code:'',
width: 40,
x: 10,
y: 10
},
rules: {
code: [
{ required: true, message:'请生成设备图形的编码', trigger: 'blur' }
],
width:[
{ required: true, message:'请输入设备图形宽度', trigger: 'blur' }
],
x: [
{ required: true, message: '请输入设备图形的X轴坐标', trigger: 'blur' }
],
y: [
{ required: true, message: '请输入设备图形的Y轴坐标', trigger: 'blur' }
]
}
};
},
computed:{
...mapGetters('iscs', [
'volumeControlDamperList'
])
},
watch:{
'$store.state.iscs.rightClickCount': function (val) {
const model = this.$store.getters['iscs/updateDeviceData'];
if (model._type === 'VolumeControlDamper' ) {
this.buttonText = '修改';
this.showDeleteButton = true;
this.isUpdate = true;
this.form.code = model.code;
this.form.width = model.width;
this.form.x = model.point.x;
this.form.y = model.point.y;
}
}
},
mounted() {
},
methods:{
onSubmit(form) {
this.$refs[form].validate((valid) => {
if (valid) {
const newModel = {
point: {
x: this.form.x,
y: this.form.y
},
_type: 'AirConditioner',
code: this.isUpdate ? this.form.code : getUID('VolumeControlDamper', this.volumeControlDamperList),
width: this.form.width,
color:'#00ff00'
};
this.$emit('createDataModel', newModel);
this.initPage();
} else {
return false;
}
});
},
initPage() {
this.isUpdate = false;
this.buttonText = '立即创建';
this.showDeleteButton = false;
this.form = {
code:'',
width: 40,
x: 10,
y: 10
};
this.$refs.form.resetFields();
},
deleteDevice() {
const newModel = {
point: {
x: this.form.x,
y: this.form.y
},
_type: 'VolumeControlDamper',
code: this.form.code,
width: this.form.width,
color:'#00ff00'
};
this.$emit('deleteDataModel', newModel );
this.initPage();
}
}
};
</script>

View File

@ -1,8 +1,8 @@
<template>
<div>
<el-form ref="form" :rule="rules" :model="addModel" label-width="100px">
<el-form-item v-if="addModel.code" label="按钮编号" prop="code">
<el-input v-model="addModel.code" />
<el-form-item v-if="isUpdate" label="按钮编号" prop="code">
<el-input v-model="addModel.code" :disabled="true" />
</el-form-item>
<el-form-item label="图形宽度" prop="width">
<el-input-number v-model="addModel.width" />
@ -21,8 +21,9 @@
</el-form>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import {getUID} from '@/iscs/utils/Uid';
export default {
name: 'FireHydranAlarmButton',
data() {
@ -38,15 +39,32 @@ export default {
x: [{ required: true, message: '请输入设备图形的X轴坐标', trigger: 'blur' }],
y: [{ required: true, message: '请输入设备图形的Y轴坐标', trigger: 'blur' }]
},
isUpdate: false,
showDeleteButton: false,
buttonText: '立即创建'
};
},
computed:{
...mapGetters('iscs', [
'fireHydranAlarmButtonList'
])
},
watch:{
'$store.state.iscs.rightClickCount': function (val) {
const model = this.$store.getters['iscs/updateDeviceData'];
if (model._type === 'FireHydranAlarmButton' ) {
this.buttonText = '修改';
this.showDeleteButton = true;
this.isUpdate = true;
this.form.code = model.code;
this.form.width = model.width;
this.form.x = model.point.x;
this.form.y = model.point.y;
}
}
},
methods: {
onSubmit(form) {
if (!this.addModel.code) {
this.generateCode();
}
this.$refs[form].validate((valid) => {
if (valid) {
const maButtonModel = {
@ -54,8 +72,8 @@ export default {
x: this.addModel.x,
y: this.addModel.y
},
code: this.addModel.code,
_type: 'fireHydranAlarmButton',
code: this.isUpdate ? this.form.code : getUID('VolumeControlDamper', this.fireHydranAlarmButtonList),
_type: 'FireHydranAlarmButton',
width: this.addModel.width
};
this.$emit('createDataModel', maButtonModel);
@ -72,7 +90,7 @@ export default {
y: this.addModel.y
},
code: this.addModel.code,
_type: 'fireHydranAlarmButton',
_type: 'FireHydranAlarmButton',
width: this.addModel.width
};
this.$emit('deleteDataModel', maButtonModel);
@ -88,10 +106,6 @@ export default {
x: 10,
y: 10
};
},
generateCode() {
const mydate = new Date();
this.addModel.code = 'fireHydranAlarmButton_' + mydate.getDay() + mydate.getHours() + mydate.getMinutes() + mydate.getSeconds() + mydate.getMilliseconds() + Math.round(Math.random() * 10000);
}
}