<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>
|