提交文件

This commit is contained in:
ival 2021-04-09 17:09:58 +08:00
parent 5c19aab68c
commit 6c2b475213
9 changed files with 33 additions and 35 deletions

View File

@ -1,16 +1,6 @@
import types from './types';
export default [
// {
// prop: 'name',
// label: '名称',
// type: types.String,
// rules:[
// { required: true, message:'请输入名称', trigger: 'blur' }
// ],
// value: '<名称>',
// description: '控制图形的前后顺序。'
// },
{
prop: 'z1',
label: '层级z1',

View File

@ -341,9 +341,6 @@ class JMap {
case events.Keyup:
this.$controller.on(events.Keyup, cb, context);
break;
// case events.BuildShape:
// this.$controller.on(events.BuildShape, cb, context);
// break;
}
}
}
@ -392,9 +389,6 @@ class JMap {
case events.Keyup:
this.$controller.off(events.Keyup, cb);
break;
// case events.BuildShape:
// this.$controller.off(events.BuildShape, cb);
// break;
}
}
}

View File

@ -27,7 +27,6 @@ export default {
},
methods: {
doBuilder(type) {
console.log(elementConst, type)
const form = formBuilder.buildForm(elementConst[type]);
const model = utils.deepClone(form.model);
model.code = utils.getUID(type);
@ -45,7 +44,7 @@ export default {
.builder {
background: #f1f1f1;
height: 100%;
width: 120px;
width: 130px;
position: absolute;
top: 0;
}

View File

@ -24,6 +24,7 @@ export default {
x: 0,
y: 0
},
clipboardList: [],
menus: [],
list: [
{
@ -40,6 +41,21 @@ export default {
disabledCb: selected => {
return selected.shapeType != shapeType.Compose;
}
},
{
label: '复制',
handler: this.doCopy,
disabledCb: selected => {
const storage = this.$iscs.getController().getStorage();
return storage.values().length <= 0;
}
},
{
label: '粘贴',
handler: this.doParse,
disabledCb: selected => {
return this.clipboardList.length;
}
}
]
};
@ -92,6 +108,10 @@ export default {
}
]);
}
},
doCopy(el) {
},
doParse(el) {
}
}
};

View File

@ -253,17 +253,12 @@ export default class SelectingHandle {
this.$painter.addToLayer(shapeLayer.Selecting)(this.selecting);
const selectingRect = this.selecting.getBoundingRect();
const keyStr = this.$controller.getKeyStr();
Object.values(this.$map.getMapShape()).forEach(el => {
if (el.model && !el.model.composeCode && this.checkSelectingRectContainShape(selectingRect, el)) {
this.setSelected(el);
}
});
// if (['Alt'].includes(keyStr)) {
// this.$controller.trigger(events.BuildShape, {...selectingRect, option: this.$map.getOption()});
// }
this.clear();
}

View File

@ -11,6 +11,5 @@ export default {
StateLoaded: 'stateLoaded',
ViewUpdate: 'viewUpdate',
StateUpdate: 'stateUpdate',
OptionUpdate: 'optionUpdate',
// BuildShape: 'buildShape'
OptionUpdate: 'optionUpdate'
}

View File

@ -233,10 +233,8 @@ export default {
},
//
onSelected(em) {
console.log(em);
},
onDblclick(em) {
console.log(em);
},
//
onContextMenu(em) {

View File

@ -86,13 +86,17 @@ export default {
const source = this.$iscs.getSource();
if (id && source) {
const elementList = source.elementList.map(el => {
return this.$iscs.getShapeByCode(el.code);
return this.$iscs.getShapeByCode(el.code).model;
});
const shapeList = elementList.map(el => el.model);
const rect = elementList.reduce(
(temp,el) => el&&temp? temp.union(el.getBoundingRect().clone()): el.getBoundingRect(), null);
const composeList = source.composeList.map(el => {
return this.$iscs.getShapeByCode(el.code).model;
});
const rect = elementList.reduce((temp,el) => {
const shape = this.$iscs.getShapeByCode(el.code);
return shape&&temp? temp.union(shape.getBoundingRect().clone()): shape.getBoundingRect()
}, null);
const position = rect? [(rect.x + rect.width)/2, (rect.y + rect.height)/2]: [0,0];
const model = { id, name, type, shapeList, position };
const model = { id, name, type, elementList, composeList, position };
Idb.delete('composeList', model.id);
Idb.write('composeList', model);
Idb.list('composeList').then(list => {

View File

@ -101,8 +101,8 @@ export default {
setTimeout(_ => {
Idb.select('composeList', this.$route.query.id).then(resp => {
this.$iscs.setMap([], {
elementList: resp.shapeList||[],
composeList: []
elementList: resp.elementList||[],
composeList: resp.composeList||[]
}, option);
}).catch(error => {
this.$iscs.setMap([], {
@ -137,7 +137,6 @@ export default {
},
//
onClick(em={}) {
console.log(em);
this.$emit('selected', em);
},
onReflect(em={}) {