完成3d模型渲染,以及详情页

main
许宏杰 1 month ago
parent 268c003204
commit 09bb199ec2

@ -179,3 +179,5 @@ aside {
margin-bottom: 10px;
}
}

@ -65,6 +65,7 @@
:class="currentModelIndex == index ? 'activeBtn' : ''"
v-for="(item, index) in mapModel"
:key="index"
@click="changeModel(index)"
>
{{ item }}
</div>
@ -82,7 +83,130 @@
</div>
</div>
<el-dialog v-model="dialogVisible" title="Tips" width="500"> </el-dialog>
<!-- 点位详情 -->
<el-dialog
v-model="dialogVisible"
:title="info.pointName"
width="30%"
class="info-dialog"
>
<div class="info-box">
<div class="info-title">基本信息</div>
<div class="info-row">
<div class="row-lable">地址</div>
<div class="row-value">{{ info.address }}</div>
</div>
<div class="info-row">
<div class="row-lable">办公时间</div>
<div class="row-value">{{ info.officeHours }}</div>
</div>
<div class="info-row">
<div class="row-lable">联系电话</div>
<div class="row-value">{{ info.phone }}</div>
</div>
<div class="info-row">
<div class="row-lable">封面</div>
<div class="row-value">
<el-image
class="info-image"
fit="cover"
v-if="info.image"
:src="`${baseUrl}/api/yzt-data/file/image?name=${info.image}`"
:preview-src-list="[
`${baseUrl}/api/yzt-data/file/image?name=${info.image}`,
]"
>
<div slot="error" class="image-slot">
<i class="el-icon-picture-outline"></i>
<span>图片加载出错</span>
</div>
</el-image>
</div>
</div>
<div
class="info-title"
v-show="info.yewuList && info.yewuList.length > 0"
>
办理业务
</div>
<div
class="yewu-list"
v-for="(item, index) in info.yewuList"
:key="index"
>
<div class="yewu-title">{{ item.title }}</div>
<div
class="list-sub"
v-for="(subItem, subIndex) in item.list"
:key="subItem.id"
@click="handleInfoByyewu(subItem.id)"
>
<div class="file-icon"></div>
<div>{{ subIndex + 1 }}. {{ subItem.simpleName }}</div>
</div>
</div>
</div>
</el-dialog>
<!-- 业务详情 -->
<el-dialog
width="30%"
:title="businessInfo.businessName"
v-model="innerVisible"
class="info-dialog"
>
<div class="info-box">
<div class="info-row">
<div class="row-lable">业务名称</div>
<div class="row-value">{{ businessInfo.businessName }}</div>
</div>
<div class="info-row">
<div class="row-lable">业务简称</div>
<div class="row-value">{{ businessInfo.simpleName }}</div>
</div>
<div class="info-row">
<div class="row-lable">申办条件</div>
<div class="row-value">{{ businessInfo.businessInstructions }}</div>
</div>
<div class="info-row">
<div class="row-lable">申办要求</div>
<div class="row-value">{{ businessInfo.businessGuide }}</div>
</div>
<div class="info-row">
<div class="row-lable">相关材料</div>
<div class="row-value value-list">
<div v-for="(item, index) in businessInfo.formList" :key="item.id">
<div class="value-list-title">{{ item.name }}</div>
<div
class="value-list-subTitle"
@click="lookIamge(index)"
>
参考样本
</div>
</div>
</div>
</div>
<div class="info-row">
<div class="row-lable">法定时限</div>
<div class="row-value">{{ businessInfo.legaltime }}</div>
</div>
<div class="info-row">
<div class="row-lable">承诺时限</div>
<div class="row-value">{{ businessInfo.promisetime }}</div>
</div>
</div>
<el-image-viewer
v-if="showPreview"
:url-list="businessInfo.srcList"
show-progress
:initial-index="initialIndex"
@close="showPreview = false"
/>
</el-dialog>
</div>
</template>
@ -100,6 +224,7 @@ import {
getEnterpriseTree,
} from "@/api/mapApi";
import { ref, reactive, onMounted, onUnmounted } from "vue";
const baseUrl = import.meta.env.VITE_APP_BASE_API;
let options = reactive({
scene: {
center: {
@ -174,9 +299,14 @@ let mapLayer = reactive({});
let list = reactive([]);
let popupShow = ref(false);
let dictList = reactive([]);
let info = reactive({});
let businessInfo = reactive({});
const showPreview = ref(false)
let srcList = reactive([])
let initialIndex = ref(0)
const dialogVisible = ref(false);
const innerVisible = ref(false);
let currentIndex = ref(null);
let currentModelIndex = ref(0);
//
@ -199,6 +329,44 @@ onUnmounted(() => {
document.removeEventListener("click", handleOutsideClick);
});
/**
*
* @param index
*
*/
const lookIamge = (index) => {
initialIndex.value = index //
showPreview.value = true
// if (!exampleFile) return;
// const imageItem = document.getElementById(`businessImage` + index);
// console.log('sssddd',)
// imageItem.click();
};
/**
* 获取业务详情
* @param id
*/
const handleInfoByyewu = async (id) => {
const res = await getbusinessById({
id,
parent: info.parent,
});
res.data.srcList = []
if(res.data.formList.length>0){
res.data.srcList= res.data.formList.map(item=>{
return `${baseUrl}/api/yzt-data/file/otherImage?name=${item.exampleFile}&imgname=${item.name}`
})
}
businessInfo = res.data;
innerVisible.value = true;
};
/**
* 获取详情
* @param id
@ -309,13 +477,13 @@ const initMarker = (item, flyTo = false, markerLength = 0) => {
mapLayer.markerLayer.addGraphic(graphic);
mapLayer.markerLayer.enabledEvent = true; //
// //
// graphic.on(mars3d.EventType.click, async (event) => {
// const infoItem = event.target.attr;
// this.info = await this.getInfo(infoItem.id, infoItem.lonLat);
// this.queryParams.name = this.info.pointName;
// this.dialogVisible = true;
// });
//
graphic.on(mars3d.EventType.click, async (event) => {
const infoItem = event.target.attr;
info = await getInfo(infoItem.id, infoItem.lonLat);
queryParams.name = info.pointName;
dialogVisible.value = true;
});
if (markerLength > 0) {
graphic.openHighlight();
@ -388,6 +556,57 @@ const finishTree = () => {
drawer.value = false;
};
/**
* 二三维地图变化
* @param index
*/
const changeModel = (index) => {
if (currentModelIndex.value != index) {
currentModelIndex.value = index;
if (index == 1) {
if (mapLayer.tiles3dLayer == undefined) {
mapLayer.tiles3dLayer = new mars3d.layer.TilesetLayer({
name: "模型名称",
url: "http://localhost:9090/B3dmqlh06/tileset.json",
maximumScreenSpaceError: 16,
maxMemory: 1024, // (MB)
matrixMove: {
hasMiddle: false,
},
flyTo: true,
// cacheBytes: 1073741824, // 1024MB = 1024*1024*1024 ()
// maximumCacheOverflowBytes: 2147483648, // 2048MB = 2048*1024*1024 ()
// maximumMemoryUsage: 512, //cesium 1.107+50%
// skipLevelOfDetail: true, //Cesium1.5x 1 2LODfalse穿tilefalse
// loadSiblings: true, // true
// cullRequestsWhileMoving: true,
// cullRequestsWhileMovingMultiplier: 10, //
// preferLeaves: true, //falseCesiumtileskipLevelOfDetail=falseskipLevelOfDetail=true使preferLeaves=true
// progressiveResolutionHeightFraction: 0.5, // 0
// dynamicScreenSpaceError: true, // true
// preloadWhenHidden: true, //tileset.showfalse
});
map.addLayer(mapLayer.tiles3dLayer);
} else {
mapLayer.tiles3dLayer.show = true;
map.sceneOptionsmap({
center: {
lat: 31.967646,
lng: 120.847855,
alt: 1250,
heading: 6.6,
pitch: -18.8,
},
});
}
} else {
if (mapLayer.tiles3dLayer) {
mapLayer.tiles3dLayer.show = false;
}
}
}
};
const laoding3d = () => {
const tiles3dLayer = new mars3d.layer.TilesetLayer({
name: "模型名称",
@ -603,6 +822,97 @@ const getdictList = async () => {
background: #409eff !important;
}
::v-deep .info-dialog {
background: rgba(15, 42, 79, 1);
border: 1px solid #094edb;
.el-dialog__title,
.el-dialog__close {
color: #fff !important;
font-weight: bold;
font-size: 22px;
}
.info-title {
font-size: 16px;
color: #fff;
font-weight: 550;
margin-bottom: 15px;
}
.info-box {
max-height: 500px;
overflow-y: auto;
}
.info-row {
display: flex;
align-items: flex-start;
margin-bottom: 10px;
font-size: 14px;
color: #fff;
.row-lable {
width: 75px;
color: #9acfff;
}
.row-value {
flex: 1;
}
.value-list {
& > div {
padding: 10px 0;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid rgba(3, 91, 178, 0.5);
.value-list-title {
flex: 1;
}
.value-list-subTitle {
color: #094edb;
margin-left: 3px;
cursor: pointer;
}
}
}
}
::v-deep .image-slot {
height: 100%;
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: 20px;
border: 1px solid #094edb;
}
.yewu-list {
.yewu-title {
margin: 15px 0;
font-size: 15px;
color: #fff;
border-left: 5px solid #409eff;
padding-left: 10px;
}
.list-sub {
cursor: pointer;
display: flex;
align-items: center;
font-size: 14px;
color: #fff;
padding: 10px 0;
border-bottom: 1px solid rgba(3, 91, 178, 0.5);
}
.file-icon {
margin-right: 10px;
height: 20px;
width: 20px;
background: url("@/assets/images/file.png");
background-size: 100% 100%;
}
}
}
//
/* 设置滚动条整体样式 */
::-webkit-scrollbar {

Loading…
Cancel
Save