提交 4301b95c authored 作者: 王利's avatar 王利

feat(index): 地图影像切换

上级 9b19953a
...@@ -5,5 +5,4 @@ ...@@ -5,5 +5,4 @@
</template> </template>
<style scoped lang="scss"> <style scoped lang="scss">
</style> </style>
...@@ -32,9 +32,6 @@ ...@@ -32,9 +32,6 @@
<div class="list-item" v-for="(item) in resourceData" :key="item.id"> <div class="list-item" v-for="(item) in resourceData" :key="item.id">
<lay-checkbox :name="item.id" skin="primary" v-model="item.status" value="" :label="item.name"></lay-checkbox> <lay-checkbox :name="item.id" skin="primary" v-model="item.status" value="" :label="item.name"></lay-checkbox>
</div> </div>
<!-- <div class="list-item">
<lay-checkbox name="like2" skin="primary" v-model="checked2" value="" label="属性属性描述描述"></lay-checkbox>
</div> -->
</div> </div>
</div> </div>
</div> </div>
...@@ -126,21 +123,16 @@ ...@@ -126,21 +123,16 @@
</div> </div>
<!-- 地图类型 --> <!-- 地图类型 -->
<div class="map-type"> <div class="map-type" @mouseenter="mapTypeIsExpand = true" @mouseleave="mapTypeIsExpand = false">
<ul class="list-box"> <ul class="list-box">
<li class="list-item"> <li class="list-item" :class="selectIndex == index ? 'active' : ''" v-for="(item, index) in mapTypeData" :key="index"
<img src="../../assets/img/dt.png" alt=""> @click="toSelectDt(index)"
<div class="top-check"> :style="mapTypeIsExpand ? `right:${(mapTypeData.length - index - 1) * 96}px` : `right:${(mapTypeData.length - index - 1) * 10}px`">
<lay-checkbox name="sc" skin="primary" v-model="openCollect" value="" label="显示收藏点"></lay-checkbox> <img :src="item.imgUrl" alt="">
</div>
<p class="detail-info">地图</p>
</li>
<li class="list-item">
<img src="../../assets/img/yx.png" alt="">
<div class="top-check"> <div class="top-check">
<lay-checkbox name="lw" skin="primary" v-model="openLw" value="" label="开启路网"></lay-checkbox> <lay-checkbox name="sc" skin="primary" v-model="item.isCheck" value="" :label="item.label"></lay-checkbox>
</div> </div>
<p class="detail-info">影像</p> <p class="detail-info">{{ item.title }}</p>
</li> </li>
</ul> </ul>
</div> </div>
...@@ -149,26 +141,39 @@ ...@@ -149,26 +141,39 @@
<script setup lang="ts"> <script setup lang="ts">
import { reactive, ref, toRefs } from "vue"; import { reactive, ref, toRefs } from "vue";
import { getList } from "../../api/module/main"; import { getList } from "../../api/module/main";
const imgUrl1 = new URL('../../assets/img/dt.png', import.meta.url).href
const imgUrl2 = new URL('../../assets/img/yx.png', import.meta.url).href
// 工具栏是否展开
const toolIsFold = ref(false); const toolIsFold = ref(false);
// 资源目录是否展开
const resourceIsFold = ref(false); const resourceIsFold = ref(false);
// 图例是否展开
const lengendIsFold = ref(false); const lengendIsFold = ref(false);
// 影像图
const openCollect = ref(false); const openCollect = ref(false);
const openLw = ref(false); const openLw = ref(false);
// 选择行政区
const regionData = ref(); const regionData = ref();
// 替换主要字段
const replaceFields = { const replaceFields = {
label: 'name', label: 'name',
value: 'code', value: 'code',
children: 'areaList' children: 'areaList'
} }
// 资源目录 interface 类型
interface resourceItemType { interface resourceItemType {
id: string; id: string;
name: string; name: string;
status: boolean status: boolean
} }
// 级联菜单 interface 子类型
interface cascaders { interface cascaders {
name: string; name: string;
code: string; code: string;
} }
// 级联菜单 interface 类型
interface cascadersItemType { interface cascadersItemType {
name: string; name: string;
code: string; code: string;
...@@ -197,7 +202,27 @@ getList('china').then((res: any) => { ...@@ -197,7 +202,27 @@ getList('china').then((res: any) => {
const villageSearch = function (val: string) { const villageSearch = function (val: string) {
console.log("当前值:" + val) console.log("当前值:" + val)
} }
// 地图类型
const mapTypeIsExpand = ref(false);
const mapTypeData = reactive([
{
imgUrl: imgUrl1,
label: "显示收藏点",
isCheck: false,
title: "地图"
},
{
imgUrl: imgUrl2,
label: "开启路网",
isCheck: false,
title: "影像"
}
])
// 地图默认选中第二个
let selectIndex = ref(1);
const toSelectDt = function (index: number) {
selectIndex.value = index;
}
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
...@@ -316,12 +341,13 @@ const villageSearch = function (val: string) { ...@@ -316,12 +341,13 @@ const villageSearch = function (val: string) {
.list-item { .list-item {
line-height: 30px; line-height: 30px;
::v-deep .layui-form-checkbox[lay-skin="primary"]:hover i {
:deep(.layui-form-checkbox[lay-skin="primary"]:hover) i {
border-color: #2c5f9e; border-color: #2c5f9e;
color: #fff; color: #fff;
} }
::v-deep .layui-form-checked[lay-skin="primary"] { :deep(.layui-form-checked[lay-skin="primary"]) {
& { & {
i { i {
border-color: #2c5f9e; border-color: #2c5f9e;
...@@ -529,7 +555,7 @@ const villageSearch = function (val: string) { ...@@ -529,7 +555,7 @@ const villageSearch = function (val: string) {
} }
.map-type { .map-type {
width: 86px; // width: 196px;
height: 60px; height: 60px;
position: absolute; position: absolute;
right: 10px; right: 10px;
...@@ -541,7 +567,19 @@ const villageSearch = function (val: string) { ...@@ -541,7 +567,19 @@ const villageSearch = function (val: string) {
display: inline-block; display: inline-block;
margin-left: 5px; margin-left: 5px;
position: absolute; position: absolute;
border: 1px solid #666; // border: 1px solid #666;
transition: all 0.3s ease;
box-shadow: 0 0 2px 0px #ccc;
box-sizing: border-box;
img {
width: 100%;
height: 100%;
}
&.active {
border: 1px solid #177de4;
}
.detail-info { .detail-info {
position: absolute; position: absolute;
...@@ -574,7 +612,7 @@ const villageSearch = function (val: string) { ...@@ -574,7 +612,7 @@ const villageSearch = function (val: string) {
padding-left: 5px; padding-left: 5px;
box-sizing: border-box; box-sizing: border-box;
::v-deep .layui-checkbox .layui-form-checkbox { :deep(.layui-checkbox) .layui-form-checkbox {
padding-left: 18px; padding-left: 18px;
height: 16px; height: 16px;
line-height: 16px; line-height: 16px;
...@@ -586,7 +624,8 @@ const villageSearch = function (val: string) { ...@@ -586,7 +624,8 @@ const villageSearch = function (val: string) {
} }
} }
::v-deep .layui-form-checkbox[lay-skin="primary"] { :deep(.layui-form-checkbox)[lay-skin="primary"] {
i { i {
height: 16px; height: 16px;
line-height: 16px; line-height: 16px;
...@@ -600,8 +639,7 @@ const villageSearch = function (val: string) { ...@@ -600,8 +639,7 @@ const villageSearch = function (val: string) {
} }
::v-deep .layui-form-checked[lay-skin="primary"] { :deep(.layui-form-checked)[lay-skin="primary"] {
& {
i { i {
border-color: #2c5f9e; border-color: #2c5f9e;
background-color: #2c5f9e; background-color: #2c5f9e;
...@@ -613,13 +651,7 @@ const villageSearch = function (val: string) { ...@@ -613,13 +651,7 @@ const villageSearch = function (val: string) {
} }
} }
} }
}
.list-box,
.list-item img {
width: 100%;
height: 100%;
}
} }
.cascaderClass { .cascaderClass {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论