代码调整
This commit is contained in:
parent
85de91411e
commit
d8af8fb70a
@ -198,6 +198,8 @@ class JMap {
|
||||
this.$painter.add(oldShape);
|
||||
break;
|
||||
case orders.changeStatus:
|
||||
// model
|
||||
this.$painter.update(this.$stateHandle.update(this.$shapeFactory, []));
|
||||
debugger;
|
||||
break;
|
||||
case orders.ResetStatus:
|
||||
|
@ -69,15 +69,18 @@ export default {
|
||||
this.elementList = utils.deepClone(data.shapeList);
|
||||
},
|
||||
previewStatus(data) {
|
||||
this.resetDefaultStatus();
|
||||
// this.resetDefaultStatus();
|
||||
const that = this;
|
||||
const list = Object.values(data.covertStatusList);
|
||||
list.forEach(each=>{
|
||||
if (each.loop) {
|
||||
debugger;
|
||||
// ChangeStatus
|
||||
} else {
|
||||
const frameList = each.frameList;
|
||||
// this.$iscs.update([
|
||||
// { status: 's1', code: '100', type: 'Device' },
|
||||
// { status: 's2', code: '101', type: 'Device' }
|
||||
// ]);
|
||||
frameList.forEach(frame=>{
|
||||
const element = that.elementList.find(ele=>{ return ele.name == frame.name; });
|
||||
if (element) {
|
||||
@ -86,19 +89,21 @@ export default {
|
||||
const model = utils.deepClone(element);
|
||||
const style = elementStyle.style || {};
|
||||
// model.changeStyle =
|
||||
// if (style && JSON.stringify(style) != '{}') {
|
||||
// const keys = Object.keys(style);
|
||||
// keys.forEach(eachKey=>{
|
||||
// model.style[eachKey] = style[eachKey];
|
||||
// });
|
||||
// }
|
||||
if (style && JSON.stringify(style) != '{}') {
|
||||
const keys = Object.keys(style);
|
||||
keys.forEach(eachKey=>{
|
||||
model.style[eachKey] = style[eachKey];
|
||||
});
|
||||
}
|
||||
const shape = elementStyle.shape || {};
|
||||
// if (shape && JSON.stringify(shape) != '{}') {
|
||||
// const keys = Object.keys(shape);
|
||||
// keys.forEach(eachShape=>{
|
||||
// model.shape[eachShape] = style[eachShape];
|
||||
// });
|
||||
// }
|
||||
if (shape && JSON.stringify(shape) != '{}') {
|
||||
const keys = Object.keys(shape);
|
||||
keys.forEach(eachShape=>{
|
||||
model.shape[eachShape] = style[eachShape];
|
||||
});
|
||||
}
|
||||
// { status: 's1', code: '100', type: 'Device' },
|
||||
this.$refs.iscsCanvas.doAction([{model, action: {shapeType: shapeType.Element, order: orders.Update}}]);
|
||||
// this.$refs.iscsCanvas.doAction([{model, action: {shapeType: shapeType.Element, order: orders.ChangeStatus}}]);
|
||||
}
|
||||
}
|
||||
@ -109,6 +114,7 @@ export default {
|
||||
resetDefaultStatus() {
|
||||
this.elementList.forEach(element=>{
|
||||
const model = utils.deepClone(element);
|
||||
this.$refs.iscsCanvas.doAction([{model, action: {shapeType: shapeType.Element, order: orders.Update}}]);
|
||||
// this.$refs.iscsCanvas.doAction([{model, action: {shapeType: shapeType.Element, order: orders.ResetStatus}}]);
|
||||
});
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user