# Conflicts:
#	src/iscs/constant/iscsData.js
This commit is contained in:
zyy 2020-02-05 17:21:50 +08:00
commit 694c0c441c
12 changed files with 56 additions and 93 deletions

View File

@ -14,6 +14,7 @@ export default class line extends Group {
} }
create() { create() {
const model = this.model; const model = this.model;
console.log(model);
this.grouper = new Group({ this.grouper = new Group({
id: model.code, id: model.code,
position: [model.point1.x, model.point1.y] position: [model.point1.x, model.point1.y]

View File

@ -88,6 +88,7 @@ export default {
}, },
methods: { methods: {
createDataModel(model) { createDataModel(model) {
console.log(model);
const newModel = deviceFactory(model._type, model); const newModel = deviceFactory(model._type, model);
this.$store.dispatch('iscs/updateIscsDevices', newModel.model); this.$store.dispatch('iscs/updateIscsDevices', newModel.model);
}, },

View File

@ -41,7 +41,7 @@ export default {
form: { form: {
code: '', code: '',
lineWidth: '', lineWidth: '',
fillColor: '#fff', fillColor: '#000000',
x1: 10, x1: 10,
y1: 10, y1: 10,
x2: 20, x2: 20,
@ -54,18 +54,6 @@ export default {
fillColor: [ fillColor: [
{ required: true, message: '请输入线段颜色', trigger: 'blur' } { required: true, message: '请输入线段颜色', trigger: 'blur' }
], ],
x1: [
{ required: true, message: '请输入数值', trigger: 'blur' }
],
y1: [
{ required: true, message: '请输入数值', trigger: 'blur' }
],
x2: [
{ required: true, message: '请输入数值', trigger: 'blur' }
],
y2: [
{ required: true, message: '请输入数值', trigger: 'blur' }
]
} }
}; };
}, },
@ -81,15 +69,13 @@ export default {
this.buttonText = '修改'; this.buttonText = '修改';
this.showDeleteButton = true; this.showDeleteButton = true;
this.isUpdate = true; this.isUpdate = true;
this.form = { this.form.code = model.code;
code: model.code, this.form.lineWidth = model.lineWidth;
lineWidth: model.lineWidth, this.form.fillColor = model.fillColor;
fillColor: model.fillColor, this.form.x1 = model.point1.x;
x1: model.point1.x, this.form.y1 = model.point1.y;
y1: model.point1.y, this.form.x1 = model.point2.x;
x2: model.point2.x, this.form.y2 = model.point2.y;
y2: model.point2.y
};
} }
} }
}, },
@ -112,9 +98,6 @@ export default {
lineWidth: this.form.lineWidth, lineWidth: this.form.lineWidth,
fillColor: this.form.fillColor fillColor: this.form.fillColor
}; };
if (this.isUpdate) {
this.deleteDevice();
}
this.$emit('createDataModel', lineModel); this.$emit('createDataModel', lineModel);
this.initPage(); this.initPage();
} else { } else {

View File

@ -75,16 +75,14 @@ export default {
this.buttonText = '修改'; this.buttonText = '修改';
this.showDeleteButton = true; this.showDeleteButton = true;
this.isUpdate = true; this.isUpdate = true;
this.form = { this.form.code = model.code;
code: model.code, this.form.fillColor = model.fillColor;
fillColor: model.fillColor, this.form.borderWidth = model.borderWidth;
borderWidth: model.borderWidth, this.form.strokeColor = model.strokeColor;
strokeColor: model.strokeColor, this.form.width = model.width;
width: model.width, this.form.height = model.height;
height: model.height, this.form.x = model.point.x;
x: model.point.x, this.form.y = model.point.y;
y: model.point.y
};
} }
} }
}, },
@ -106,9 +104,6 @@ export default {
width: this.form.width, width: this.form.width,
height: this.form.height height: this.form.height
}; };
if (this.isUpdate) {
this.deleteDevice();
}
this.$emit('createDataModel', rectModel); this.$emit('createDataModel', rectModel);
this.initPage(); this.initPage();
} else { } else {

View File

@ -80,15 +80,13 @@ export default {
this.buttonText = '修改'; this.buttonText = '修改';
this.showDeleteButton = true; this.showDeleteButton = true;
this.isUpdate = true; this.isUpdate = true;
this.form = { this.form.code = model.code;
code: model.code, this.form.context = model.context;
context: model.context, this.form.fontSize = model.fontSize;
textFill: model.textFill, this.form.fontWeight = model.fontWeight;
fontSize: model.fontSize, this.form.textFill = model.textFill;
fontWeight: model.fontWeight, this.form.x = model.point.x;
x: model.point.x, this.form.y = model.point.y;
y: model.point.y
};
} }
} }
}, },
@ -110,9 +108,6 @@ export default {
fontWeight: this.form.fontWeight, fontWeight: this.form.fontWeight,
fontFamily: 'consolas' fontFamily: 'consolas'
}; };
if (this.isUpdate) {
this.deleteDevice();
}
this.$emit('createDataModel', textModel); this.$emit('createDataModel', textModel);
this.initPage(); this.initPage();
} else { } else {

View File

@ -76,9 +76,6 @@ export default {
_type: 'FireHydranAlarmButton', _type: 'FireHydranAlarmButton',
width: this.addModel.width width: this.addModel.width
}; };
if (this.isUpdate) {
this.deleteDevice();
}
this.$emit('createDataModel', maButtonModel); this.$emit('createDataModel', maButtonModel);
this.initPage(); this.initPage();
} else { } else {

View File

@ -77,9 +77,6 @@ export default {
_type: 'GasFireControl', _type: 'GasFireControl',
width: this.addModel.width width: this.addModel.width
}; };
if (this.isUpdate) {
this.deleteDevice();
}
this.$emit('createDataModel', maButtonModel); this.$emit('createDataModel', maButtonModel);
this.initPage(); this.initPage();
} else { } else {

View File

@ -53,6 +53,7 @@
<el-tab-pane label="文字" name="IscsText"> <el-tab-pane label="文字" name="IscsText">
<iscs-text <iscs-text
ref="iscsText" ref="iscsText"
style="width: 90%;"
@createDataModel="createDataModel" @createDataModel="createDataModel"
@deleteDataModel="deleteDataModel"> @deleteDataModel="deleteDataModel">
</iscs-text> </iscs-text>
@ -60,6 +61,7 @@
<el-tab-pane label="线段" name="IscsLine"> <el-tab-pane label="线段" name="IscsLine">
<iscs-line <iscs-line
ref="iscsLine" ref="iscsLine"
style="width: 90%;"
@createDataModel="createDataModel" @createDataModel="createDataModel"
@deleteDataModel="deleteDataModel"> @deleteDataModel="deleteDataModel">
</iscs-line> </iscs-line>
@ -67,6 +69,7 @@
<el-tab-pane label="矩形" name="IscsRect"> <el-tab-pane label="矩形" name="IscsRect">
<iscs-rect <iscs-rect
ref="iscsRect" ref="iscsRect"
style="width: 90%;"
@createDataModel="createDataModel" @createDataModel="createDataModel"
@deleteDataModel="deleteDataModel"> @deleteDataModel="deleteDataModel">
</iscs-rect> </iscs-rect>

View File

@ -77,9 +77,6 @@ export default {
_type: 'ManualAlarmButton', _type: 'ManualAlarmButton',
width: this.addModel.width width: this.addModel.width
}; };
if (this.isUpdate) {
this.deleteDevice();
}
this.$emit('createDataModel', maButtonModel); this.$emit('createDataModel', maButtonModel);
this.initPage(); this.initPage();
} else { } else {

View File

@ -77,9 +77,6 @@ export default {
_type: 'SmokeDetector', _type: 'SmokeDetector',
width: this.addModel.width width: this.addModel.width
}; };
if (this.isUpdate) {
this.deleteDevice();
}
this.$emit('createDataModel', maButtonModel); this.$emit('createDataModel', maButtonModel);
this.initPage(); this.initPage();
} else { } else {

View File

@ -77,9 +77,6 @@ export default {
_type: 'TemperatureDetector', _type: 'TemperatureDetector',
width: this.addModel.width width: this.addModel.width
}; };
if (this.isUpdate) {
this.deleteDevice();
}
this.$emit('createDataModel', maButtonModel); this.$emit('createDataModel', maButtonModel);
this.initPage(); this.initPage();
} else { } else {