|
@@ -3,44 +3,38 @@
|
|
v-if="custom.currentModel && active && custom.showMode === 'fuse'"
|
|
v-if="custom.currentModel && active && custom.showMode === 'fuse'"
|
|
class="merge-layout"
|
|
class="merge-layout"
|
|
>
|
|
>
|
|
|
|
+ <div class="actions-group">
|
|
|
|
+ <Actions :items="actionItems" v-model:current="currentItem" />
|
|
|
|
+ <Actions class="merge-action" :items="othActions" />
|
|
|
|
+ </div>
|
|
<ui-group>
|
|
<ui-group>
|
|
- <template #header>
|
|
|
|
- <Actions class="edit-header" :items="actionItems" v-model:current="currentItem" />
|
|
|
|
- </template>
|
|
|
|
<ui-group-option label="等比缩放">
|
|
<ui-group-option label="等比缩放">
|
|
<template #icon>
|
|
<template #icon>
|
|
- <a
|
|
|
|
|
|
+ <ui-icon
|
|
class="set-prop"
|
|
class="set-prop"
|
|
|
|
+ ctrl
|
|
:class="{ disabled: isOld || currentItem }"
|
|
:class="{ disabled: isOld || currentItem }"
|
|
@click="router.push({
|
|
@click="router.push({
|
|
name: RoutesName.proportion,
|
|
name: RoutesName.proportion,
|
|
params: { id: custom.currentModel!.id, save: '1' },
|
|
params: { id: custom.currentModel!.id, save: '1' },
|
|
})"
|
|
})"
|
|
- >设置比例</a
|
|
|
|
- >
|
|
|
|
|
|
+ type="close"
|
|
|
|
+ tip="设置比例"
|
|
|
|
+ />
|
|
</template>
|
|
</template>
|
|
<ui-input
|
|
<ui-input
|
|
- type="range"
|
|
|
|
|
|
+ type="number"
|
|
|
|
+ class="scale-input"
|
|
v-model="custom.currentModel.scale"
|
|
v-model="custom.currentModel.scale"
|
|
v-bind="modelRange.scaleRange"
|
|
v-bind="modelRange.scaleRange"
|
|
:ctrl="false"
|
|
:ctrl="false"
|
|
width="100%"
|
|
width="100%"
|
|
>
|
|
>
|
|
|
|
+ <template #preIcon>1:1</template>
|
|
<template #icon>%</template>
|
|
<template #icon>%</template>
|
|
</ui-input>
|
|
</ui-input>
|
|
</ui-group-option>
|
|
</ui-group-option>
|
|
- <!-- <ui-group-option label="离地高度">
|
|
|
|
- <ui-input
|
|
|
|
- type="range"
|
|
|
|
- v-model="custom.currentModel.bottom"
|
|
|
|
- v-bind="modelRange.bottomRange"
|
|
|
|
- :ctrl="false"
|
|
|
|
- width="100%"
|
|
|
|
- >
|
|
|
|
- <template #icon>m</template>
|
|
|
|
- </ui-input>
|
|
|
|
- </ui-group-option> -->
|
|
|
|
- <ui-group-option label="模型不透明度">
|
|
|
|
|
|
+ <ui-group-option label="不透明度">
|
|
<ui-input
|
|
<ui-input
|
|
type="range"
|
|
type="range"
|
|
v-model="custom.currentModel.opacity"
|
|
v-model="custom.currentModel.opacity"
|
|
@@ -51,20 +45,6 @@
|
|
<template #icon>%</template>
|
|
<template #icon>%</template>
|
|
</ui-input>
|
|
</ui-input>
|
|
</ui-group-option>
|
|
</ui-group-option>
|
|
- <ui-group-option>
|
|
|
|
- <!-- :disabled="currentItem" -->
|
|
|
|
- <ui-button
|
|
|
|
- :class="{ disabled: isOld }"
|
|
|
|
- @click="router.push({
|
|
|
|
- name: RoutesName.registration,
|
|
|
|
- params: {id: custom.currentModel!.id, save: '1' }
|
|
|
|
- })"
|
|
|
|
- >配准</ui-button
|
|
|
|
- >
|
|
|
|
- </ui-group-option>
|
|
|
|
- <ui-group-option>
|
|
|
|
- <ui-button @click="reset">恢复默认</ui-button>
|
|
|
|
- </ui-group-option>
|
|
|
|
</ui-group>
|
|
</ui-group>
|
|
</RightPano>
|
|
</RightPano>
|
|
</template>
|
|
</template>
|
|
@@ -82,12 +62,15 @@ import {
|
|
modelsChangeStoreStack,
|
|
modelsChangeStoreStack,
|
|
showRightPanoStack,
|
|
showRightPanoStack,
|
|
} from "@/env";
|
|
} from "@/env";
|
|
-import { ref, nextTick, watchEffect, computed, watch } from "vue";
|
|
|
|
|
|
+import { ref, nextTick, watchEffect, computed, watch, reactive } from "vue";
|
|
import { Dialog } from "bill/expose-common";
|
|
import { Dialog } from "bill/expose-common";
|
|
|
|
|
|
-import Actions from "@/components/actions/index.vue";
|
|
|
|
|
|
+import Actions from "@/components/actions-merge/index.vue";
|
|
|
|
|
|
import type { ActionsProps, ActionsItem } from "@/components/actions/index.vue";
|
|
import type { ActionsProps, ActionsItem } from "@/components/actions/index.vue";
|
|
|
|
+import { listener } from "@/components/drawing/hook";
|
|
|
|
+import { getOffset } from "@/utils/event";
|
|
|
|
+import { useRMenus } from "@/components/right-menu";
|
|
|
|
|
|
const active = useActive();
|
|
const active = useActive();
|
|
const actionItems: ActionsProps["items"] = [
|
|
const actionItems: ActionsProps["items"] = [
|
|
@@ -109,8 +92,39 @@ const actionItems: ActionsProps["items"] = [
|
|
};
|
|
};
|
|
},
|
|
},
|
|
},
|
|
},
|
|
|
|
+ {
|
|
|
|
+ icon: "flip",
|
|
|
|
+ text: "缩放",
|
|
|
|
+ action: () => {
|
|
|
|
+ getSceneModel(custom.currentModel)?.enterScaleMode();
|
|
|
|
+ return () => {
|
|
|
|
+ getSceneModel(custom.currentModel)?.leaveTransform();
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+ },
|
|
];
|
|
];
|
|
|
|
|
|
|
|
+const othActions = reactive([
|
|
|
|
+ {
|
|
|
|
+ icon: "move",
|
|
|
|
+ text: "配准",
|
|
|
|
+ disabled: isOld,
|
|
|
|
+ action: () => {
|
|
|
|
+ router.push({
|
|
|
|
+ name: RoutesName.registration,
|
|
|
|
+ params: { id: custom.currentModel!.id, save: "1" },
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ icon: "flip",
|
|
|
|
+ text: "恢复默认",
|
|
|
|
+ action: () => {
|
|
|
|
+ reset();
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+]);
|
|
|
|
+
|
|
const currentItem = ref<ActionsItem | null>(null);
|
|
const currentItem = ref<ActionsItem | null>(null);
|
|
watchEffect(() => {
|
|
watchEffect(() => {
|
|
if (!custom.currentModel) {
|
|
if (!custom.currentModel) {
|
|
@@ -121,7 +135,6 @@ watchEffect(() => {
|
|
watch(
|
|
watch(
|
|
() => custom.currentModel,
|
|
() => custom.currentModel,
|
|
() => {
|
|
() => {
|
|
- console.log("???");
|
|
|
|
currentItem.value = null;
|
|
currentItem.value = null;
|
|
}
|
|
}
|
|
);
|
|
);
|
|
@@ -147,6 +160,25 @@ useViewStack(() =>
|
|
showLeftPanoStack.push(ref(true)),
|
|
showLeftPanoStack.push(ref(true)),
|
|
showRightPanoStack.push(computed(() => !!custom.currentModel)),
|
|
showRightPanoStack.push(computed(() => !!custom.currentModel)),
|
|
modelsChangeStoreStack.push(ref(true)),
|
|
modelsChangeStoreStack.push(ref(true)),
|
|
|
|
+ listener(
|
|
|
|
+ document.querySelector("#layout-app") as HTMLElement,
|
|
|
|
+ "contextmenu",
|
|
|
|
+ (ev) => {
|
|
|
|
+ const pixel = getOffset(ev);
|
|
|
|
+ const pos = sdk.getPositionByScreen(pixel);
|
|
|
|
+ if (custom.currentModel && pos && custom.currentModel.id !== pos.modelId) {
|
|
|
|
+ useRMenus(pixel, [
|
|
|
|
+ {
|
|
|
|
+ label: "移动到这里",
|
|
|
|
+ icon: "close",
|
|
|
|
+ handler() {
|
|
|
|
+ custom.currentModel!.position = pos.worldPos;
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ ]);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ ),
|
|
() => (currentItem.value = null),
|
|
() => (currentItem.value = null),
|
|
])
|
|
])
|
|
);
|
|
);
|
|
@@ -167,8 +199,49 @@ useViewStack(() => {
|
|
});
|
|
});
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
+<style lang="scss" scoped>
|
|
|
|
+.actions-group {
|
|
|
|
+ position: absolute;
|
|
|
|
+ bottom: 100%;
|
|
|
|
+ left: 0;
|
|
|
|
+ width: 100%;
|
|
|
|
+ margin-bottom: 10px;
|
|
|
|
+ gap: 10px;
|
|
|
|
+ display: flex;
|
|
|
|
+}
|
|
|
|
+.model-header {
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: space-between;
|
|
|
|
+ align-items: center;
|
|
|
|
+ margin-bottom: 10px;
|
|
|
|
+
|
|
|
|
+ p {
|
|
|
|
+ font-size: 14px;
|
|
|
|
+ color: #fff;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.model-desc {
|
|
|
|
+ color: rgba(255, 255, 255, 0.6);
|
|
|
|
+ line-height: 18px;
|
|
|
|
+ font-size: 12px;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.model-action {
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ > * {
|
|
|
|
+ margin-left: 20px;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+</style>
|
|
|
|
+
|
|
<style lang="scss">
|
|
<style lang="scss">
|
|
.merge-layout {
|
|
.merge-layout {
|
|
|
|
+ position: relative;
|
|
|
|
+ overflow: initial !important;
|
|
|
|
+ top: calc(var(--editor-head-height) + var(--header-top) + 70px) !important;
|
|
|
|
+
|
|
.ui-input .text.suffix input {
|
|
.ui-input .text.suffix input {
|
|
padding-left: 5px;
|
|
padding-left: 5px;
|
|
padding-right: 15px;
|
|
padding-right: 15px;
|
|
@@ -181,4 +254,9 @@ useViewStack(() => {
|
|
.set-prop {
|
|
.set-prop {
|
|
cursor: pointer;
|
|
cursor: pointer;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+.scale-input input {
|
|
|
|
+ text-align: right;
|
|
|
|
+ padding-right: 20px !important;
|
|
|
|
+}
|
|
</style>
|
|
</style>
|