|
@@ -1,60 +1,72 @@
|
|
<template>
|
|
<template>
|
|
- <LeftPano>
|
|
|
|
- <List
|
|
|
|
- title="数据列表"
|
|
|
|
- key="id"
|
|
|
|
- :data="modelList"
|
|
|
|
- @change-select="item => modelChangeSelect(item.raw)"
|
|
|
|
- >
|
|
|
|
- <template #action>
|
|
|
|
- <ui-icon type="add" ctrl/>
|
|
|
|
|
|
+ <RightPano v-if="currentModel">
|
|
|
|
+ <ui-group>
|
|
|
|
+ <template #header>
|
|
|
|
+ <Actions class="edit-header" :items="actionItems" />
|
|
</template>
|
|
</template>
|
|
- <template #atom="{ item }">
|
|
|
|
- <ModelSign :model="item.raw" @delete="modelDelete(item.raw)" />
|
|
|
|
- </template>
|
|
|
|
- </List>
|
|
|
|
- </LeftPano>
|
|
|
|
- <RightPano v-if="selectModel">
|
|
|
|
- <ModelEdit :model="selectModel" />
|
|
|
|
|
|
+ <ui-group-option label="等比缩放">
|
|
|
|
+ <template #icon>
|
|
|
|
+ <a href="">设置比例</a>
|
|
|
|
+ </template>
|
|
|
|
+ <ui-input type="range" v-model="currentModel.scale" v-bind="scaleOption" width="100%" />
|
|
|
|
+ </ui-group-option>
|
|
|
|
+ <ui-group-option label="离地高度">
|
|
|
|
+ <ui-input type="range" v-model="currentModel.bottom" v-bind="bottomOption" width="100%"/>
|
|
|
|
+ </ui-group-option>
|
|
|
|
+ <ui-group-option label="模型不透明度">
|
|
|
|
+ <ui-input type="range" v-model="currentModel.opacity" v-bind="opacityOption" width="100%" />
|
|
|
|
+ </ui-group-option>
|
|
|
|
+ <ui-group-option>
|
|
|
|
+ <ui-button>配准</ui-button>
|
|
|
|
+ </ui-group-option>
|
|
|
|
+ <ui-group-option>
|
|
|
|
+ <ui-button>恢复默认</ui-button>
|
|
|
|
+ </ui-group-option>
|
|
|
|
+ </ui-group>
|
|
</RightPano>
|
|
</RightPano>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
-import { computed, ref, toRaw } from 'vue'
|
|
|
|
-import { LeftPano, RightPano } from '@/layout'
|
|
|
|
-import { models } from '@/store'
|
|
|
|
|
|
+import { RightPano } from '@/layout'
|
|
|
|
+import { currentModel } from '@/store'
|
|
|
|
+import Actions from '@/components/actions/index.vue'
|
|
import { getSceneModel } from '@/sdk'
|
|
import { getSceneModel } from '@/sdk'
|
|
-import List from '@/components/list/index.vue'
|
|
|
|
-import ModelSign from './sign.vue'
|
|
|
|
-import ModelEdit from './edit.vue'
|
|
|
|
-
|
|
|
|
-import type { Model } from '@/store'
|
|
|
|
|
|
+import { useViewStack } from '@/hook'
|
|
|
|
+import { showLeftCtrlPanoStack, showLeftPanoStack } from '@/env'
|
|
|
|
+import { ref } from 'vue'
|
|
|
|
|
|
-const selectModel = ref<Model | null>(null)
|
|
|
|
-const modelList = computed(() =>
|
|
|
|
- models.value.map(model => ({
|
|
|
|
- raw: model,
|
|
|
|
- select: selectModel.value === model
|
|
|
|
- }))
|
|
|
|
-)
|
|
|
|
|
|
+import type { ActionsProps } from '@/components/actions/index.vue'
|
|
|
|
|
|
-const modelChangeSelect = (model: Model) => {
|
|
|
|
- if (selectModel.value) {
|
|
|
|
- getSceneModel(selectModel.value)?.changeSelect(false)
|
|
|
|
- }
|
|
|
|
- if (toRaw(selectModel.value) !== toRaw(model)) {
|
|
|
|
- getSceneModel(model)?.changeSelect(true)
|
|
|
|
- selectModel.value = model
|
|
|
|
- } else {
|
|
|
|
- selectModel.value = null
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
|
|
+const opacityOption = { min: 0.01, max: 1, step: 0.01, }
|
|
|
|
+const bottomOption = { min: 1, max: 100, step: 1, }
|
|
|
|
+const scaleOption = { min: 0.01, max: 1, step: 0.01, }
|
|
|
|
+const actionItems: ActionsProps['items'] = [
|
|
|
|
+ {
|
|
|
|
+ icon: 'move',
|
|
|
|
+ text: '移动',
|
|
|
|
+ action: () => {
|
|
|
|
+ getSceneModel(currentModel.value)?.enterMoveMode()
|
|
|
|
+ return () => getSceneModel(currentModel.value)?.leaveMoveMode()
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ icon: 'flip',
|
|
|
|
+ text: '旋转',
|
|
|
|
+ action: () => {
|
|
|
|
+ getSceneModel(currentModel.value)?.enterRotateMode()
|
|
|
|
+ return () => getSceneModel(currentModel.value)?.leaveRotateMode()
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+]
|
|
|
|
|
|
-const modelDelete = (model: Model) => {
|
|
|
|
- const index = models.value.indexOf(model)
|
|
|
|
- if (~index) {
|
|
|
|
- models.value.splice(index, 1)
|
|
|
|
|
|
+useViewStack(() => {
|
|
|
|
+ const pops = [
|
|
|
|
+ showLeftCtrlPanoStack.push(ref(false)),
|
|
|
|
+ showLeftPanoStack.push(ref(true))
|
|
|
|
+ ]
|
|
|
|
+ return () => {
|
|
|
|
+ pops.forEach(pop => pop())
|
|
}
|
|
}
|
|
-}
|
|
|
|
|
|
+})
|
|
|
|
|
|
</script>
|
|
</script>
|