|
@@ -159,24 +159,30 @@ watch(selectTagging, (a, b, onCleanup) => {
|
|
|
const clickHandler = async (ev: MouseEvent) => {
|
|
|
await nextTick()
|
|
|
await asyncTimeout()
|
|
|
- const positions = models.value
|
|
|
- .filter(model => {
|
|
|
- return model.loaded && getModelShowVariable(model).value
|
|
|
- })
|
|
|
- .map(model => {
|
|
|
- console.log(model)
|
|
|
- return sdk.getPositionByScreen({
|
|
|
- x: ev.clientX,
|
|
|
- y: ev.clientY
|
|
|
- }, model.id)
|
|
|
- })
|
|
|
- .filter(pos => pos)
|
|
|
-
|
|
|
- if (!positions.length) {
|
|
|
+ const position = sdk.getPositionByScreen({
|
|
|
+ x: ev.clientX,
|
|
|
+ y: ev.clientY
|
|
|
+ })
|
|
|
+ console.error(position)
|
|
|
+
|
|
|
+ // const positions = models.value
|
|
|
+ // .filter(model => {
|
|
|
+ // return model.loaded && getModelShowVariable(model).value
|
|
|
+ // })
|
|
|
+ // .map(model => {
|
|
|
+ // console.log(model)
|
|
|
+ // return sdk.getPositionByScreen({
|
|
|
+ // x: ev.clientX,
|
|
|
+ // y: ev.clientY
|
|
|
+ // }, model.id)
|
|
|
+ // })
|
|
|
+ // .filter(pos => pos)
|
|
|
+
|
|
|
+ if (!position) {
|
|
|
Message.error('当前位置无法添加')
|
|
|
} else if (selectTagging.value) {
|
|
|
const storePosition = createTaggingPosition({
|
|
|
- ...positions[0],
|
|
|
+ ...position,
|
|
|
taggingId: selectTagging.value.id
|
|
|
})
|
|
|
taggingPositions.value.push(storePosition)
|