|
@@ -1,56 +1,130 @@
|
|
|
<template>
|
|
|
<div class="view-setting" app-border dir-left>
|
|
|
<div class="title">
|
|
|
- {{$i18n.t('screen.init_screen')}}
|
|
|
- <i class="iconfont icon-help_i tool-tip-for-editor" v-tooltip="$i18n.t('screen.screen_tips')"/>
|
|
|
+ {{ $i18n.t("screen.init_screen") }}
|
|
|
+ <i
|
|
|
+ class="iconfont icon-help_i tool-tip-for-editor"
|
|
|
+ v-tooltip="$i18n.t('screen.screen_tips')"
|
|
|
+ />
|
|
|
</div>
|
|
|
<template v-if="currentScene.type !== '4dkk'">
|
|
|
- <img class="preview" v-if="initImg" :src="`${initImg}?${Math.random()}`" alt="">
|
|
|
- <img class="placeholder" v-else src="@/assets/images/pano-image-placeholder.png" alt="">
|
|
|
+ <img
|
|
|
+ class="preview"
|
|
|
+ v-if="initImg"
|
|
|
+ :src="`${initImg}?${Math.random()}`"
|
|
|
+ alt=""
|
|
|
+ />
|
|
|
+ <img
|
|
|
+ class="placeholder"
|
|
|
+ v-else
|
|
|
+ src="@/assets/images/pano-image-placeholder.png"
|
|
|
+ alt=""
|
|
|
+ />
|
|
|
+ <div class="item">
|
|
|
+ <div class="">垂直视角限制</div>
|
|
|
+ <slider v-model="vlookat" range show-stops :min="-90" :max="90">
|
|
|
+ </slider>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="col">
|
|
|
+ <span>应用到全部全景图</span>
|
|
|
+ <Switcher :value="applyToAll" @change="onSwitcherChange"></Switcher>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<div class="goto-4dkk-tip" v-if="currentScene.type === '4dkk'">
|
|
|
<div class="img-wrap">
|
|
|
- <img class="" src="@/assets/images/default/goto-4dage.png" alt="" draggable="false">
|
|
|
+ <img
|
|
|
+ class=""
|
|
|
+ src="@/assets/images/default/goto-4dage.png"
|
|
|
+ alt=""
|
|
|
+ draggable="false"
|
|
|
+ />
|
|
|
<div class="tip-text">
|
|
|
- {{$i18n.t('screen.goto_4dkk_edit_tips')}}
|
|
|
+ {{ $i18n.t("screen.goto_4dkk_edit_tips") }}
|
|
|
</div>
|
|
|
</div>
|
|
|
- <button class="ui-button submit" @click="onClickGo4dkk">{{$i18n.t('navigation.go_scene_editor')}}</button>
|
|
|
+ <button class="ui-button submit" @click="onClickGo4dkk">
|
|
|
+ {{ $i18n.t("navigation.go_scene_editor") }}
|
|
|
+ </button>
|
|
|
</div>
|
|
|
-
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
import { mapGetters } from "vuex";
|
|
|
-
|
|
|
+import { Slider } from "element-ui";
|
|
|
+import Switcher from "@/components/shared/Switcher";
|
|
|
export default {
|
|
|
+ components: {
|
|
|
+ Slider,
|
|
|
+ Switcher,
|
|
|
+ },
|
|
|
computed: {
|
|
|
...mapGetters({
|
|
|
currentScene: "scene/currentScene",
|
|
|
- })
|
|
|
+ }),
|
|
|
},
|
|
|
- data(){
|
|
|
+ data() {
|
|
|
return {
|
|
|
- initImg:''
|
|
|
- }
|
|
|
+ initImg: "",
|
|
|
+ vlookat: null,
|
|
|
+ applyToAll: false,
|
|
|
+ };
|
|
|
},
|
|
|
- methods:{
|
|
|
+ watch: {
|
|
|
+ "currentScene.initVisual": {
|
|
|
+ handler(val) {
|
|
|
+ const { vlookatmin, vlookatmax } = val;
|
|
|
+ if (vlookatmin && vlookatmax) {
|
|
|
+ this.vlookat = [vlookatmin, vlookatmax];
|
|
|
+ }
|
|
|
+ },
|
|
|
+ deep: true,
|
|
|
+ immediate: true,
|
|
|
+ },
|
|
|
+ vlookat: {
|
|
|
+ handler: function (val) {
|
|
|
+ this.handleVlootAt(val);
|
|
|
+ },
|
|
|
+ },
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
onClickGo4dkk() {
|
|
|
- window.open('/#/scene')
|
|
|
- }
|
|
|
+ window.open("/#/scene");
|
|
|
+ },
|
|
|
+ onSwitcherChange(value) {
|
|
|
+ this.applyToAll = value;
|
|
|
+ },
|
|
|
+ handleVlootAt(val) {
|
|
|
+ if (val) {
|
|
|
+ const min = Math.min(...val);
|
|
|
+ const max = Math.max(...val);
|
|
|
+ this.currentScene.initVisual.vlookatmin = min;
|
|
|
+ this.currentScene.initVisual.vlookatmax = max;
|
|
|
+ this.handleKrAction(min, max);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleKrAction(min, max) {
|
|
|
+ const kr = this.$getKrpano();
|
|
|
+ if (kr) {
|
|
|
+ kr.set("view.limitview", "lookat");
|
|
|
+ const mid = min + max;
|
|
|
+ kr.set("view.vlookat", mid);
|
|
|
+ kr.set("view.vlookatmin", String(min));
|
|
|
+ kr.set("view.vlookatmax", String(max));
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
- mounted(){
|
|
|
- this.$bus.on('initView', data => {
|
|
|
- this.initImg = data
|
|
|
- })
|
|
|
+ mounted() {
|
|
|
+ this.$bus.on("initView", (data) => {
|
|
|
+ this.initImg = data;
|
|
|
+ });
|
|
|
|
|
|
if (!this.initImg) {
|
|
|
- this.initImg = this.currentScene.icon
|
|
|
+ this.initImg = this.currentScene.icon;
|
|
|
}
|
|
|
-
|
|
|
- }
|
|
|
-}
|
|
|
+ },
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style lang="less" scoped>
|
|
@@ -79,6 +153,18 @@ export default {
|
|
|
height: 132px;
|
|
|
margin-bottom: 16px;
|
|
|
}
|
|
|
+ .item {
|
|
|
+ .el-slider {
|
|
|
+ padding: 0 5px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .col {
|
|
|
+ width: 100%;
|
|
|
+ margin: 15px 0;
|
|
|
+ display: inline-flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
|
|
|
.goto-4dkk-tip {
|
|
|
> .img-wrap {
|
|
@@ -104,4 +190,4 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|