|
@@ -17,7 +17,7 @@
|
|
|
alt
|
|
|
/>
|
|
|
</li>
|
|
|
- </ul> -->
|
|
|
+ </ul>-->
|
|
|
<ul class="position">
|
|
|
<li v-for="(item,i) in msgList" :key="i">
|
|
|
<a-input
|
|
@@ -32,7 +32,7 @@
|
|
|
<img class="lock" :src="require(`./../../assets/images/t-lock.png`)" alt />
|
|
|
</li>
|
|
|
</ul>
|
|
|
- <attrSelect :type="attrType" :focusItemList="focusItemList"/>
|
|
|
+ <attrSelect :type="attrType" :focusItemList="focusItemList" />
|
|
|
</div>
|
|
|
</a-tab-pane>
|
|
|
<a-tab-pane key="2" tab="元素" force-render>
|
|
@@ -158,27 +158,49 @@ export default {
|
|
|
callback(key) {
|
|
|
console.log(key);
|
|
|
},
|
|
|
- onSearch() {},
|
|
|
+ onSearch() {}
|
|
|
},
|
|
|
watch: {
|
|
|
focusItemList: function(newVal) {
|
|
|
- this.attrType = newVal.itemType ? newVal.itemType : "choice"
|
|
|
- // this.msgList.forEach(item => {
|
|
|
- // if (item.name == "X") {
|
|
|
- // item.msg = newVal[0].minX;
|
|
|
- // // item.msg = newVal[0].mapToScene(0, 0).x;
|
|
|
- // }
|
|
|
- // if (item.name == "Y") {
|
|
|
- // item.msg = newVal[0].minY;
|
|
|
- // // item.msg = newVal[0].mapToScene(0, 0).y;
|
|
|
- // }
|
|
|
- // if (item.name == "Width") {
|
|
|
- // item.msg = newVal[0].boundingRect().width;
|
|
|
- // }
|
|
|
- // if (item.name == "Height") {
|
|
|
- // item.msg = newVal[0].boundingRect().height;
|
|
|
- // }
|
|
|
- // });
|
|
|
+ this.attrType = newVal.itemType;
|
|
|
+ if (newVal.itemList.length !== 1) {
|
|
|
+ this.msgList.forEach(item => {
|
|
|
+ if (item.name == "X") {
|
|
|
+ item.msg = 0;
|
|
|
+ }
|
|
|
+ if (item.name == "Y") {
|
|
|
+ item.msg = 0;
|
|
|
+ }
|
|
|
+ if (item.name == "Width") {
|
|
|
+ item.msg = 0;
|
|
|
+ }
|
|
|
+ if (item.name == "Height") {
|
|
|
+ item.msg = 0;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.msgList.forEach(item => {
|
|
|
+ const Item = newVal.itemList[0];
|
|
|
+ if (item.name == "X") {
|
|
|
+ item.msg = Item.mapToScene(
|
|
|
+ Item.pos.x + Item.boundingRect().x,
|
|
|
+ Item.pos.y + Item.boundingRect().y
|
|
|
+ ).x;
|
|
|
+ }
|
|
|
+ if (item.name == "Y") {
|
|
|
+ item.msg = Item.mapToScene(
|
|
|
+ Item.pos.x + Item.boundingRect().x,
|
|
|
+ Item.pos.y + Item.boundingRect().y
|
|
|
+ ).y;
|
|
|
+ }
|
|
|
+ if (item.name == "Width") {
|
|
|
+ item.msg = Item.boundingRect().width;
|
|
|
+ }
|
|
|
+ if (item.name == "Height") {
|
|
|
+ item.msg = Item.boundingRect().height;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
};
|