|
|
@@ -3,7 +3,7 @@
|
|
|
<div class="home">
|
|
|
<div id="mars3dContainer" class="mars3d-container"></div>
|
|
|
<div id="zoneControl" @click="showZoneSelect">
|
|
|
- <img src="data/layer.png" />
|
|
|
+ <img src="data/layer.png"/>
|
|
|
</div>
|
|
|
<div id="zoneSelect">
|
|
|
<div @click="cityZone">市</div>
|
|
|
@@ -28,9 +28,9 @@
|
|
|
<div class="search" @keyup.enter="mySearch">
|
|
|
<div class="searchBtn" @click="mySearch"></div>
|
|
|
<el-input
|
|
|
- placeholder="搜索村落名称..."
|
|
|
- suffix-icon="el-icon-search"
|
|
|
- v-model="name"
|
|
|
+ placeholder="搜索村落名称..."
|
|
|
+ suffix-icon="el-icon-search"
|
|
|
+ v-model="name"
|
|
|
>
|
|
|
</el-input>
|
|
|
</div>
|
|
|
@@ -65,10 +65,10 @@
|
|
|
<h3>详情统计</h3>
|
|
|
<div class="detailsNum">
|
|
|
<div
|
|
|
- class="row"
|
|
|
- @click.stop="toCun(item.id)"
|
|
|
- v-for="item in numData"
|
|
|
- :key="item.id"
|
|
|
+ class="row"
|
|
|
+ @click.stop="toCun(item.id)"
|
|
|
+ v-for="item in numData"
|
|
|
+ :key="item.id"
|
|
|
>
|
|
|
<div class="rowLeft">{{ item.name }}</div>
|
|
|
<div class="rowRight">
|
|
|
@@ -89,9 +89,9 @@
|
|
|
<div class="bs">{{ item.son.length }}</div>
|
|
|
</div>
|
|
|
<div
|
|
|
- @click="cutInd(item.id)"
|
|
|
- class="rr"
|
|
|
- :class="
|
|
|
+ @click="cutInd(item.id)"
|
|
|
+ class="rr"
|
|
|
+ :class="
|
|
|
item.id === mapDataInd
|
|
|
? 'el-icon-arrow-up'
|
|
|
: 'el-icon-arrow-down'
|
|
|
@@ -99,10 +99,10 @@
|
|
|
></div>
|
|
|
<div class="sonBox">
|
|
|
<div
|
|
|
- @click.stop="toCun(val.id)"
|
|
|
- :class="{ active: item.id === mapDataInd }"
|
|
|
- v-for="val in item.son"
|
|
|
- :key="val.id"
|
|
|
+ @click.stop="toCun(val.id)"
|
|
|
+ :class="{ active: item.id === mapDataInd }"
|
|
|
+ v-for="val in item.son"
|
|
|
+ :key="val.id"
|
|
|
>
|
|
|
· {{ val.name }}
|
|
|
</div>
|
|
|
@@ -110,18 +110,23 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
+ <div class="special_topic">
|
|
|
+ <img src="../assets/img/icon_q&a.png" alt="" @click="$router.push('/topic')"/>
|
|
|
+ <img src="../assets/img/icon_special_topic.png" alt=""/>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<!-- 加载中 -->
|
|
|
<div
|
|
|
- class="homeLoding"
|
|
|
- :class="{ homeLodingNone: isLoding }"
|
|
|
- v-loading="true"
|
|
|
+ class="homeLoading"
|
|
|
+ :class="{ homeLoadingNone: isLoding }"
|
|
|
+ v-loading="true"
|
|
|
></div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getStatistics, lookSaveApi } from "../utils/api";
|
|
|
+import {getStatistics, lookSaveApi} from "../utils/api";
|
|
|
// mapIns存储初始化的地图map实例,如果map实例放在vue的data中会导致帧率下降严重
|
|
|
var mapIns = null;
|
|
|
var zoneLayer = null;
|
|
|
@@ -155,41 +160,41 @@ export default {
|
|
|
id: 1000,
|
|
|
name: "蓬江区",
|
|
|
son: [
|
|
|
- { id: 3, name: "卢边村" },
|
|
|
- { id: 2, name: "良溪村" },
|
|
|
+ {id: 3, name: "卢边村"},
|
|
|
+ {id: 2, name: "良溪村"},
|
|
|
],
|
|
|
},
|
|
|
{
|
|
|
id: 5000,
|
|
|
name: "开平市",
|
|
|
son: [
|
|
|
- { id: 5, name: "仓前村" },
|
|
|
- { id: 9, name: "马降龙村" },
|
|
|
- { id: 8, name: "自力村" },
|
|
|
+ {id: 5, name: "仓前村"},
|
|
|
+ {id: 9, name: "马降龙村"},
|
|
|
+ {id: 8, name: "自力村"},
|
|
|
],
|
|
|
},
|
|
|
{
|
|
|
id: 6000,
|
|
|
name: "台山市",
|
|
|
son: [
|
|
|
- { id: 1, name: "东宁村" },
|
|
|
- { id: 10, name: "浮石村" },
|
|
|
- { id: 11, name: "浮月村" },
|
|
|
- { id: 12, name: "横江村" },
|
|
|
+ {id: 1, name: "东宁村"},
|
|
|
+ {id: 10, name: "浮石村"},
|
|
|
+ {id: 11, name: "浮月村"},
|
|
|
+ {id: 12, name: "横江村"},
|
|
|
],
|
|
|
},
|
|
|
{
|
|
|
id: 4000,
|
|
|
name: "鹤山市",
|
|
|
son: [
|
|
|
- { id: 4, name: "田心村" },
|
|
|
- { id: 6, name: "霄南村" },
|
|
|
+ {id: 4, name: "田心村"},
|
|
|
+ {id: 6, name: "霄南村"},
|
|
|
],
|
|
|
},
|
|
|
{
|
|
|
id: 7000,
|
|
|
name: "恩平市",
|
|
|
- son: [{ id: 7, name: "歇马村" }],
|
|
|
+ son: [{id: 7, name: "歇马村"}],
|
|
|
},
|
|
|
],
|
|
|
// 地图实例
|
|
|
@@ -293,7 +298,7 @@ export default {
|
|
|
// 初始化地图
|
|
|
async initMap() {
|
|
|
// 读取 config.json 配置文件
|
|
|
- const json = await mars3d.Util.fetchJson({ url: "config/config.json" });
|
|
|
+ const json = await mars3d.Util.fetchJson({url: "config/config.json"});
|
|
|
console.log("读取 config.json 配置文件完成", json); // 打印测试信息
|
|
|
// 创建三维地球场景
|
|
|
const mapOptions = json.map3d;
|
|
|
@@ -346,9 +351,9 @@ export default {
|
|
|
|
|
|
const graphic = new mars3d.graphic.DivGraphic({
|
|
|
position: new mars3d.LngLatPoint(
|
|
|
- acInfo.position[0],
|
|
|
- acInfo.position[1],
|
|
|
- 100
|
|
|
+ acInfo.position[0],
|
|
|
+ acInfo.position[1],
|
|
|
+ 100
|
|
|
),
|
|
|
style: {
|
|
|
html: `
|
|
|
@@ -364,10 +369,10 @@ export default {
|
|
|
verticalOrigin: mars3d.Cesium.VerticalOrigin.BOTTOM,
|
|
|
// distanceDisplayCondition: new mars3d.Cesium.DistanceDisplayCondition(0, 30000), // 按视距距离显示
|
|
|
scaleByDistance: new mars3d.Cesium.NearFarScalar(
|
|
|
- 1000,
|
|
|
- 1.5,
|
|
|
- 12000,
|
|
|
- 0.8
|
|
|
+ 1000,
|
|
|
+ 1.5,
|
|
|
+ 12000,
|
|
|
+ 0.8
|
|
|
),
|
|
|
clampToGround: true,
|
|
|
},
|
|
|
@@ -395,7 +400,7 @@ export default {
|
|
|
},
|
|
|
mySearch() {
|
|
|
console.log("点击了搜索", this.name);
|
|
|
- mapIns.flyToPoint(this.getFlyPos(this.name), { radius: 3000 });
|
|
|
+ mapIns.flyToPoint(this.getFlyPos(this.name), {radius: 3000});
|
|
|
},
|
|
|
// 跳转
|
|
|
async toCun(id) {
|
|
|
@@ -530,9 +535,9 @@ export default {
|
|
|
async created() {
|
|
|
// 移动端和pc端的切换
|
|
|
if (
|
|
|
- window.navigator.userAgent.match(
|
|
|
- /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
|
|
|
- )
|
|
|
+ window.navigator.userAgent.match(
|
|
|
+ /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
|
|
|
+ )
|
|
|
) {
|
|
|
// 移动端
|
|
|
if (window.location.href.includes("web")) {
|
|
|
@@ -552,43 +557,50 @@ export default {
|
|
|
mounted() {
|
|
|
// 初始化地图实例
|
|
|
this.initMap().then(
|
|
|
- (map) => {
|
|
|
- // 加载模型
|
|
|
- // this.loadModel();
|
|
|
- // 村名lable图层
|
|
|
- let graphicLayer = new mars3d.layer.GraphicLayer();
|
|
|
- // 行政边界图层
|
|
|
- zoneLayer = new mars3d.layer.GeoJsonLayer();
|
|
|
- // 绑定标注的点击事件
|
|
|
- graphicLayer.on("click", (e) => {
|
|
|
- const attr = e.graphic.attr || {};
|
|
|
- // console.log("name", attr.name);
|
|
|
- // console.log("id", attr.id);
|
|
|
- this.toCun(attr.id);
|
|
|
- });
|
|
|
- map.addLayer(graphicLayer);
|
|
|
-
|
|
|
- // 添加村名label
|
|
|
-
|
|
|
- this.villagePos.forEach((v) => {
|
|
|
- this.drawVillageLabel(graphicLayer, v.id);
|
|
|
- });
|
|
|
-
|
|
|
- // 加载区边界线
|
|
|
- this.loadZoneLayer(mapIns, "jmq", "#00ffff", 8);
|
|
|
- },
|
|
|
- (error) => {
|
|
|
- console.log("地图初始化失败", error);
|
|
|
- }
|
|
|
+ (map) => {
|
|
|
+ // 加载模型
|
|
|
+ // this.loadModel();
|
|
|
+ // 村名lable图层
|
|
|
+ let graphicLayer = new mars3d.layer.GraphicLayer();
|
|
|
+ // 行政边界图层
|
|
|
+ zoneLayer = new mars3d.layer.GeoJsonLayer();
|
|
|
+ // 绑定标注的点击事件
|
|
|
+ graphicLayer.on("click", (e) => {
|
|
|
+ const attr = e.graphic.attr || {};
|
|
|
+ // console.log("name", attr.name);
|
|
|
+ // console.log("id", attr.id);
|
|
|
+ this.toCun(attr.id);
|
|
|
+ });
|
|
|
+ map.addLayer(graphicLayer);
|
|
|
+
|
|
|
+ // 添加村名label
|
|
|
+
|
|
|
+ this.villagePos.forEach((v) => {
|
|
|
+ this.drawVillageLabel(graphicLayer, v.id);
|
|
|
+ });
|
|
|
+
|
|
|
+ // 加载区边界线
|
|
|
+ this.loadZoneLayer(mapIns, "jmq", "#00ffff", 8);
|
|
|
+ },
|
|
|
+ (error) => {
|
|
|
+ console.log("地图初始化失败", error);
|
|
|
+ }
|
|
|
);
|
|
|
},
|
|
|
- beforeCreate() {}, //生命周期 - 创建之前
|
|
|
- beforeMount() {}, //生命周期 - 挂载之前
|
|
|
- beforeUpdate() {}, //生命周期 - 更新之前
|
|
|
- updated() {}, //生命周期 - 更新之后
|
|
|
- beforeDestroy() {}, //生命周期 - 销毁之前
|
|
|
- destroyed() {}, //生命周期 - 销毁完成
|
|
|
- activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
|
|
|
+ beforeCreate() {
|
|
|
+ }, //生命周期 - 创建之前
|
|
|
+ beforeMount() {
|
|
|
+ }, //生命周期 - 挂载之前
|
|
|
+ beforeUpdate() {
|
|
|
+ }, //生命周期 - 更新之前
|
|
|
+ updated() {
|
|
|
+ }, //生命周期 - 更新之后
|
|
|
+ beforeDestroy() {
|
|
|
+ }, //生命周期 - 销毁之前
|
|
|
+ destroyed() {
|
|
|
+ }, //生命周期 - 销毁完成
|
|
|
+ activated() {
|
|
|
+ }, //如果页面有keep-alive缓存功能,这个函数会触发
|
|
|
};
|
|
|
</script>
|
|
|
<style lang="less" scoped>
|
|
|
@@ -599,7 +611,7 @@ export default {
|
|
|
background-size: cover;
|
|
|
overflow: hidden;
|
|
|
|
|
|
- .homeLoding {
|
|
|
+ .homeLoading {
|
|
|
position: absolute;
|
|
|
top: 0;
|
|
|
left: 0;
|
|
|
@@ -608,14 +620,17 @@ export default {
|
|
|
z-index: 9999;
|
|
|
background-color: #c2b697;
|
|
|
transition: all 0.5s;
|
|
|
- /deep/.el-loading-mask {
|
|
|
+
|
|
|
+ /deep/ .el-loading-mask {
|
|
|
background-color: transparent;
|
|
|
}
|
|
|
- /deep/.path {
|
|
|
+
|
|
|
+ /deep/ .path {
|
|
|
stroke: #412c0c !important;
|
|
|
}
|
|
|
}
|
|
|
- .homeLodingNone {
|
|
|
+
|
|
|
+ .homeLoadingNone {
|
|
|
opacity: 0;
|
|
|
pointer-events: none;
|
|
|
}
|
|
|
@@ -720,37 +735,38 @@ export default {
|
|
|
}
|
|
|
|
|
|
/*修改提示文字的颜色*/
|
|
|
- /deep/input::-webkit-input-placeholder {
|
|
|
+
|
|
|
+ /deep/ input::-webkit-input-placeholder {
|
|
|
/* WebKit browsers */
|
|
|
color: #c9a774;
|
|
|
}
|
|
|
|
|
|
- /deep/input:-moz-placeholder {
|
|
|
+ /deep/ input:-moz-placeholder {
|
|
|
/* Mozilla Firefox 4 to 18 */
|
|
|
color: #c9a774;
|
|
|
}
|
|
|
|
|
|
- /deep/input::-moz-placeholder {
|
|
|
+ /deep/ input::-moz-placeholder {
|
|
|
/* Mozilla Firefox 19+ */
|
|
|
color: #c9a774;
|
|
|
}
|
|
|
|
|
|
- /deep/input:-ms-input-placeholder {
|
|
|
+ /deep/ input:-ms-input-placeholder {
|
|
|
/* Internet Explorer 10+ */
|
|
|
color: #c9a774;
|
|
|
}
|
|
|
|
|
|
- /deep/.el-input__inner {
|
|
|
+ /deep/ .el-input__inner {
|
|
|
border-radius: 20px;
|
|
|
background-color: #efeee8;
|
|
|
color: #c9a774;
|
|
|
}
|
|
|
|
|
|
- /deep/.el-input__inner:focus {
|
|
|
+ /deep/ .el-input__inner:focus {
|
|
|
border-color: #c9a774;
|
|
|
}
|
|
|
|
|
|
- /deep/.el-input__suffix {
|
|
|
+ /deep/ .el-input__suffix {
|
|
|
color: #c9a774;
|
|
|
font-size: 20px;
|
|
|
}
|
|
|
@@ -947,6 +963,19 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ .special_topic {
|
|
|
+ position: absolute;
|
|
|
+ bottom: 40px;
|
|
|
+ left: -120px;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+
|
|
|
+ img {
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
.meanShow {
|
|
|
@@ -962,7 +991,7 @@ export default {
|
|
|
left: 0px;
|
|
|
}
|
|
|
|
|
|
-/deep/.lableContent {
|
|
|
+/deep/ .lableContent {
|
|
|
width: 170px;
|
|
|
height: 40px;
|
|
|
background: url(../assets/img/lable.png) no-repeat;
|
|
|
@@ -974,25 +1003,25 @@ export default {
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
|
|
|
-/deep/.lableContent:hover {
|
|
|
+/deep/ .lableContent:hover {
|
|
|
background: url(../assets/img/lableA.png) no-repeat;
|
|
|
}
|
|
|
|
|
|
-/deep/.lableContent:hover + .lableLine {
|
|
|
+/deep/ .lableContent:hover + .lableLine {
|
|
|
border: 1px solid rgb(192, 48, 55);
|
|
|
}
|
|
|
|
|
|
-/deep/.lableContent:hover .lableIconArea img {
|
|
|
+/deep/ .lableContent:hover .lableIconArea img {
|
|
|
content: url(../assets/img/lableIconA.png);
|
|
|
}
|
|
|
|
|
|
-/deep/.lableIconArea {
|
|
|
+/deep/ .lableIconArea {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
}
|
|
|
|
|
|
-/deep/.lableLine {
|
|
|
+/deep/ .lableLine {
|
|
|
width: 0px;
|
|
|
height: 80px;
|
|
|
margin-top: -10px;
|