surprise
2023-12-05 6ecef4176f6d9df60cd1a753a36e09cd96bce9b8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<template>
  <Popup
    ref="pop"
    :title="title"
    :left="left"
    :shadow="false"
    width="400px"
    @close="close(true)"
    showBtn="true"
    @yes="addData"
    @cancel="close(false)"
  >
    <el-form ref="form" :model="data" label-width="125px">
      <el-form-item label="项目名称:">
        <el-input v-model="data.name"></el-input>
      </el-form-item>
      <el-form-item label="编辑器版本:">
        <el-input v-model="data.SDKVesion" disabled></el-input>
      </el-form-item>
      <el-form-item label="SDK版本:">
        <el-input v-model="data.SDKVesion" disabled></el-input>
      </el-form-item>
      <el-form-item label="Cesium版本:">
        <el-input v-model="data.CesiumVesion" disabled></el-input>
      </el-form-item>
      <el-form-item label="初始定位:">
        <el-input v-model="flyTo" :title="flyToPosition">
          <i
            slot="suffix"
            class="el-input__icon el-icon-map-location"
            title="获取当前位置"
            @click="getPosition"
          ></i>
        </el-input>
      </el-form-item>
      <el-form-item label="绕飞时间:">
        <el-input-number :min="10" v-model="data.rotateFlyTime">
        </el-input-number>
      </el-form-item>
    </el-form>
  </Popup>
</template>
 
<script>
import Popup from "@tools/Popup";
import popupTools from "@map/layerTree/mixin/popupTools";
export default {
  name: "ProjectSeting",
  components: {
    Popup,
  },
  mixins: [popupTools],
  data() {
    return {
      title: "项目设置",
      left: undefined,
      data: {
        name: "",
        SDKVesion: "",
        CesiumVesion: "",
        rotateFlyTime: 30,
      },
    };
  },
  computed: {},
  mounted() {},
  methods: {
    // 关闭弹窗
    close(isCloseBtn) {
      // 重置data值
      Object.assign(this.$data, this.$options.data());
      !isCloseBtn && this.$refs.pop.close();
    },
    // 打开弹窗
    open() {
      this.data.name = document.title;
      this.data.CesiumVesion = Cesium.VERSION;
      this.data.SDKVesion = SmartEarth.VERSION;
      this.flyTo = this.$parent.viewCenter.join(",");
      this.data.rotateFlyTime =
        (this.$parent.mapStatus && this.$parent.mapStatus.rotateFlyTime) || 30;
 
      this.$refs.pop.open();
    },
    // 添加数据
    addData() {
      if (this.flyTo) {
        let flyTo = this.flyTo.split(",");
        this.$parent.setView(flyTo);
      }
      this.$parent.changeMapStatus({
        type: "rotateFlyTime",
        value: this.data.rotateFlyTime,
      });
      sgworld.rotateFlyTime = this.data.rotateFlyTime;
      document.title = this.data.name;
      sessionStorage.setItem("SmartEarthTitle", document.title);
 
      this.close();
    },
  },
};
</script>
 
<style scoped lang="less">
.el-form {
  margin-top: 20px;
  margin-right: 10px;
 
  /deep/ .el-form-item__label {
    color: #fff;
    font-size: 18px;
  }
}
</style>