增加代码

This commit is contained in:
ival 2021-04-09 17:54:01 +08:00
parent 18a51e7c26
commit fce6f58eb0

View File

@ -31,7 +31,7 @@ export default {
{ {
label: '组合', label: '组合',
handler: this.doBinding, handler: this.doBinding,
disabledCb: selected => { disabledCb: e => {
const storage = this.$iscs.getController().getStorage(); const storage = this.$iscs.getController().getStorage();
return storage.values().length <= 1; return storage.values().length <= 1;
} }
@ -39,14 +39,14 @@ export default {
{ {
label: '解组', label: '解组',
handler: this.unBinding, handler: this.unBinding,
disabledCb: selected => { disabledCb: e => {
return selected.shapeType != shapeType.Compose; return this.selected.shapeType != shapeType.Compose;
} }
}, },
{ {
label: '复制', label: '复制',
handler: this.doCopy, handler: this.doCopy,
disabledCb: selected => { disabledCb: e => {
const storage = this.$iscs.getController().getStorage(); const storage = this.$iscs.getController().getStorage();
return !storage.values().length; return !storage.values().length;
} }
@ -56,7 +56,7 @@ export default {
{ {
label: '粘贴', label: '粘贴',
handler: this.doParse, handler: this.doParse,
disabledCb: selected => { disabledCb: e => {
return !this.clipboardList.length; return !this.clipboardList.length;
} }
} }
@ -67,7 +67,8 @@ export default {
methods: { methods: {
doShow(point, code) { doShow(point, code) {
const list = code ? this.menusMap.Normal: this.menusMap.None; const list = code ? this.menusMap.Normal: this.menusMap.None;
this.menus = list.map(el => { el.disabled = el.disabledCb(this.selected); return el} ); this.selected= this.$iscs.getShapeByCode(code);
this.menus = list.map(el => { el.disabled = el.disabledCb({}); return el} );
if (this.menus && if (this.menus &&
this.menus.length) { this.menus.length) {
this.position = {...point} this.position = {...point}