|
@@ -16,18 +16,31 @@
|
|
|
<i v-show="level === 1"
|
|
|
class="iconfont icon-editor_list_add icon-add"
|
|
|
v-tooltip="'新增二级分组'"
|
|
|
- @click="onRequestForAddGroup"
|
|
|
+ @click.stop="onRequestForAddGroup"
|
|
|
>
|
|
|
</i>
|
|
|
<i
|
|
|
class="iconfont icon-editor_list_image icon-image"
|
|
|
- v-tooltip="'新增全景图或三维场景'"
|
|
|
+ v-tooltip="'新增全景图或三维场景'"
|
|
|
+ @click.stop="onRequestForAddScene"
|
|
|
+ v-show="
|
|
|
+ level === 2 ||
|
|
|
+ (
|
|
|
+ level === 1 &&
|
|
|
+ (
|
|
|
+ groupNode.children.length === 0 ||
|
|
|
+ (
|
|
|
+ groupNode.children.length === 1 && groupNode.children[0].name === '默认二级分组'
|
|
|
+ )
|
|
|
+ )
|
|
|
+ )
|
|
|
+ "
|
|
|
>
|
|
|
</i>
|
|
|
<i
|
|
|
class="iconfont icon-editor_list_edit icon-edit"
|
|
|
v-tooltip="'重命名'"
|
|
|
- @click="onClickForRename"
|
|
|
+ @click.stop="onClickForRename"
|
|
|
>
|
|
|
</i>
|
|
|
<i
|
|
@@ -95,16 +108,30 @@
|
|
|
/>
|
|
|
</template>
|
|
|
</div>
|
|
|
+
|
|
|
+ <div class="dialog" style="z-index: 2000" v-if="isShowSelectionWindow">
|
|
|
+ <MaterialSelectorForEditor
|
|
|
+ title="选择素材"
|
|
|
+ @cancle="isShowSelectionWindow = false"
|
|
|
+ @submit="onSubmitFromMaterialSelector"
|
|
|
+ :selectableType="['pano']"
|
|
|
+ :initialMaterialType="'pano'"
|
|
|
+ :isMultiSelection="true"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import SceneInGroupInEditor from "@/components/sceneInGroupInEditor.vue";
|
|
|
+import MaterialSelectorForEditor from "@/components/materialSelectorForEditor.vue";
|
|
|
+import { mapGetters } from "vuex";
|
|
|
|
|
|
export default {
|
|
|
name: 'SceneGroup',
|
|
|
components: {
|
|
|
SceneInGroupInEditor,
|
|
|
+ MaterialSelectorForEditor,
|
|
|
},
|
|
|
props: {
|
|
|
groupNode: {
|
|
@@ -122,9 +149,13 @@ export default {
|
|
|
isRenaming: false,
|
|
|
newName: '',
|
|
|
isConfirmingDeletion: false,
|
|
|
+ isShowSelectionWindow: false,
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
+ ...mapGetters({
|
|
|
+ info: "info",
|
|
|
+ }),
|
|
|
topBarPaddingLeft() {
|
|
|
return 12 + (this.level - 1) * 12 + 'px'
|
|
|
},
|
|
@@ -158,7 +189,9 @@ export default {
|
|
|
onRequestForAddGroup() {
|
|
|
this.$emit('addGroup', this.groupNode.id)
|
|
|
},
|
|
|
-
|
|
|
+ onRequestForAddScene() {
|
|
|
+ this.isShowSelectionWindow = true
|
|
|
+ },
|
|
|
onClickForRename() {
|
|
|
this.isRenaming = true
|
|
|
this.newName = this.groupNode.name
|
|
@@ -196,7 +229,53 @@ export default {
|
|
|
},
|
|
|
onInnerGroupConfirmDelete(...params) {
|
|
|
this.$emit('deleteGroup', ...params)
|
|
|
- }
|
|
|
+ },
|
|
|
+ onSubmitFromMaterialSelector(selected) {
|
|
|
+ let newScenes = null
|
|
|
+ // if (this.type == "scene") {
|
|
|
+ // newScenes = selected.map((item) => {
|
|
|
+ // return {
|
|
|
+ // icon: item.thumb,
|
|
|
+ // sceneCode: item.num,
|
|
|
+ // sceneTitle: item.sceneName,
|
|
|
+ // type: "4dkk",
|
|
|
+ // category:this.groupNode.id,
|
|
|
+ // id:'s_'+this.$randomWord(true,8,8)
|
|
|
+ // };
|
|
|
+ // });
|
|
|
+ // } else {
|
|
|
+ newScenes = selected.map((item) => {
|
|
|
+ return {
|
|
|
+ icon: item.icon,
|
|
|
+ sceneCode: item.sceneCode,
|
|
|
+ sceneTitle: item.name,
|
|
|
+ category: this.level === 1 ? this.groupNode.children[0].id : this.groupNode.id,
|
|
|
+ type: "pano",
|
|
|
+ id: 's_' + this.$randomWord(true, 8, 8)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // }
|
|
|
+
|
|
|
+ let allSuccess = true
|
|
|
+ newScenes.forEach((item, i) => {
|
|
|
+ let temp = this.info.scenes.find(sub => {
|
|
|
+ return sub.sceneCode == item.sceneCode
|
|
|
+ })
|
|
|
+ if (temp) {
|
|
|
+ setTimeout(() => {
|
|
|
+ this.$msg.message(`${item.type == '4dkk' ? '场景' : '全景图'}${item.sceneTitle}已存在,不可重复添加`)
|
|
|
+ }, i * 100)
|
|
|
+ allSuccess = false
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.info.scenes.push(item)
|
|
|
+ })
|
|
|
+
|
|
|
+ this.isShowSelectionWindow = false
|
|
|
+ if (allSuccess) {
|
|
|
+ this.$msg.success("操作成功")
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
mounted() {
|
|
|
this.$bus.on('scene-group-expanded', this.onOtherSceneGroupExpanded)
|