| | |
| | | <template> |
| | | <div |
| | | class="mapBox" |
| | | v-loading="loading" |
| | | :element-loading-text="loadingText" |
| | | element-loading-background="rgba(0, 0, 0, 0.8)" |
| | | > |
| | | <div class="mapBox"> |
| | | <div id="mapdiv"> |
| | | <div |
| | | class="menu_Top box_divm" |
| | |
| | | label-width="50px" |
| | | > |
| | | <el-form-item label="经度:"> |
| | | <el-input v-model="coordFrom.lon"></el-input> |
| | | <el-input |
| | | v-model="coordFrom.lon" |
| | | placeholder="请输入经度" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="纬度:"> |
| | | <el-input v-model="coordFrom.lat"></el-input> |
| | | <el-input |
| | | v-model="coordFrom.lat" |
| | | placeholder="请输入维度" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="高度:"> |
| | | <el-input v-model="coordFrom.height"></el-input> |
| | | <el-input |
| | | v-model="coordFrom.height" |
| | | placeholder="请输入高度" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button |
| | |
| | | <el-input |
| | | style="width: 160px" |
| | | v-model="comprehensive.name" |
| | | placeholder="请输入地名...." |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item> |
| | |
| | | <div |
| | | class="changeTerrain" |
| | | @click="changeTerrainLayer" |
| | | style=" position: absolute; |
| | | bottom: 84px; |
| | | right: 46px; |
| | | height: 30px; |
| | | width: 30px; |
| | | z-index: 101; |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | cursor: pointer; |
| | | border: 1px solid rgba(255, 255, 255, 0.5);" |
| | | > |
| | | <div |
| | | title="地形切换" |
| | |
| | | <div |
| | | @click="changeMenulayer" |
| | | class="changeLayer" |
| | | style=" position: absolute; |
| | | bottom: 116px; |
| | | right: 46px; |
| | | height: 30px; |
| | | width: 30px; |
| | | z-index: 101; |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | cursor: pointer; |
| | | border: 1px solid rgba(255, 255, 255, 0.5);" |
| | | > |
| | | <div |
| | | title="底图切换" |
| | |
| | | <div |
| | | @click="changeMapType" |
| | | class="changeMapType" |
| | | style=" position: absolute; |
| | | bottom: 52px; |
| | | right: 46px; |
| | | height: 30px; |
| | | width: 30px; |
| | | z-index: 101; |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | cursor: pointer; |
| | | border: 1px solid rgba(255, 255, 255, 0.5);" |
| | | > |
| | | <div |
| | | title="2/3维切换" |
| | |
| | | |
| | | </div> |
| | | </el-dialog> |
| | | <!-- <div--> |
| | | <!-- @click="changeMenulayer"--> |
| | | <!-- class="center CenDiv"--> |
| | | <!-- :class="{ center1: centerFlag }"--> |
| | | <!-- >--> |
| | | <!-- <div--> |
| | | <!-- id="cenBg"--> |
| | | <!-- v-bind:class="{ active: isActive, menuLayer: isMenuLayer }"--> |
| | | <!-- ></div>--> |
| | | <!-- </div>--> |
| | | <el-dialog |
| | | title="瓦片下载" |
| | | :append-to-body="false" |
| | |
| | | placeholder="确认密码..." |
| | | ></el-input> |
| | | </el-form-item> |
| | | |
| | | <el-form-item> |
| | | <el-button |
| | | type="primary" |
| | |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-dialog> |
| | | <!-- <div--> |
| | | <!-- @click="changeMenulayer"--> |
| | | <!-- class="center CenDiv"--> |
| | | <!-- :class="{ center1: centerFlag }"--> |
| | | <!-- >--> |
| | | <!-- <div--> |
| | | <!-- id="cenBg"--> |
| | | <!-- v-bind:class="{ active: isActive, menuLayer: isMenuLayer }"--> |
| | | <!-- ></div>--> |
| | | <!-- </div>--> |
| | | |
| | | </div> |
| | | <model-property ref='modelProperty'></model-property> |
| | | <iframe |
| | |
| | | select_Comprehensive_SelectWktById, |
| | | comprehensive_selectRoute, |
| | | dataLib_selectFiles, dataQuery_selectFields, dataQuery_selectDomains, |
| | | dataQuery_selectByPage, |
| | | comprehensive_selectPubById, comprehensive_selectModelByGuid, decr, |
| | | encr, inquiry_downloadTiles, sign_getPublicKey |
| | | dataQuery_selectByPage, sign_getPublicKey, inquiry_downloadTiles, |
| | | comprehensive_selectPubById, comprehensive_selectModelByGuid |
| | | } from '../api/api' |
| | | import { getToken } from '@/utils/auth' |
| | | |
| | |
| | | } |
| | | } |
| | | } |
| | | callback(); |
| | | } |
| | | }; |
| | | var checkAge = (rule, value, callback) => { |
| | | if (!value) { |
| | | return callback(new Error('数据名称不能为空')); |
| | | } |
| | | callback(); |
| | | |
| | | }; |
| | | var validatePass = (rule, value, callback) => { |
| | | if (value === '') { |
| | | callback(new Error('请输入密码')); |
| | | } else { |
| | | var passwordreg = |
| | | /^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\W!@#$%^&*`~()\\-_+=,.?;<>]+$)(?![a-z0-9]+$)(?![a-z\W!@#$%^&*`~()\\-_+=,.?;<>]+$)(?![0-9\W!@#$%^&*`~()\\-_+=,.?;<>]+$)[a-zA-Z0-9\W!@#$%^&*`~()\\-_+=,.?;<>]{12,20}$/ |
| | | |
| | | if (!passwordreg.test(value)) { |
| | | callback(new Error("密码必须由数字、字母、特殊字符组合,请输入13-20位")) |
| | | } |
| | | callback(); |
| | | } |
| | | }; |
| | | var validatePass2 = (rule, value, callback) => { |
| | | if (value === '') { |
| | | callback(new Error('请再次输入密码')); |
| | | } else if (value !== this.ruleForm.pass) { |
| | | callback(new Error('两次输入密码不一致!')); |
| | | } else { |
| | | callback(); |
| | | } |
| | | }; |
| | |
| | | message: "坐标点经纬度错误,坐标应在[116.xxx, 39.yyy]范围", |
| | | }, |
| | | ], |
| | | pass: [ |
| | | { validator: validatePass, trigger: 'blur' } |
| | | ], |
| | | checkPass: [ |
| | | { validator: validatePass2, trigger: 'blur' } |
| | | ], |
| | | title: [ |
| | | { validator: checkAge, trigger: 'blur' } |
| | | ] |
| | | }, |
| | | bufFrom: { |
| | | val: 50, |
| | | }, |
| | | coordFrom: { |
| | | lon: 116.3911, |
| | | lat: 39.9115, |
| | | height: 100000, |
| | | lon: "", |
| | | lat: "", |
| | | height: "", |
| | | }, |
| | | listData: { |
| | | name: null, |
| | |
| | | title: '' |
| | | }, |
| | | loadingText: '', |
| | | loading: false, |
| | | loading: false |
| | | }; |
| | | }, |
| | | mounted() { |
| | |
| | | } |
| | | }); |
| | | //模型捕捉 |
| | | this.catchmodel() |
| | | this.catchmodel(); |
| | | this.$bus.$on("titleDown", res => { |
| | | this.setDownLoadTitle(res); |
| | | }) |
| | | }); |
| | | |
| | | window.localStorage.setItem('slider_x', this.valueX); |
| | | window.localStorage.setItem('slider_y', this.valueY); |
| | | window.localStorage.setItem('slider_z', this.valueZ); |
| | |
| | | this.signGetPublicKey() |
| | | this.downTitleFlag = true; |
| | | this.downTitleData = res; |
| | | |
| | | }, |
| | | async signGetPublicKey() { |
| | | const res = await sign_getPublicKey() |
| | | if (res && res.code == 200) { |
| | | window.encrypt = new JSEncrypt() |
| | | encrypt.setPublicKey(res.result) |
| | | window.encrypt = new JSEncrypt(); |
| | | encrypt.setPublicKey(res.result); |
| | | } |
| | | }, |
| | | submitTitleDown(formName) { |
| | | this.$refs[formName].validate((valid) => { |
| | | if (valid) { |
| | | |
| | | this.downTitleData.title = this.ruleForm.title |
| | | // this.downTitleData.pwd = encr(this.ruleForm.pass) |
| | | this.downTitleData.pwd = encrypt.encrypt(this.ruleForm.pass) |
| | | this.getDownLoadTile(this.downTitleData); |
| | | this.cannelTitleDown(); |
| | | } else { |
| | | |
| | | console.log('error submit!!'); |
| | | return false; |
| | | } |
| | |
| | | window.pickedColor; |
| | | window.modeCatchHandler = new Cesium.ScreenSpaceEventHandler(Viewer.scene.canvas); |
| | | window.modeCatchHandler.setInputAction((event) => { |
| | | window.pickedFeature && (window.pickedFeature.color = window.pickedColor); |
| | | if (window.pickedColor) { window.pickedFeature && (window.pickedFeature.color = window.pickedColor); } |
| | | // window.pickedFeature && (window.pickedFeature.color = window.pickedColor); |
| | | window.pickedFeature = sgworld.Viewer.scene.pick(event.position); |
| | | if (Cesium.defined(window.pickedFeature)) { |
| | | if (window.pickedFeature.primitive instanceof Cesium.Cesium3DTileset) { |
| | | if (window.pickedFeature && window.pickedFeature.getProperty) { |
| | | if (window.pickedFeature) { |
| | | window.pickedColor = window.pickedFeature.color |
| | | window.pickedFeature.color = Cesium.Color.RED.withAlpha(0.3); |
| | | |
| | |
| | | }, Cesium.ScreenSpaceEventType.LEFT_CLICK) |
| | | }, |
| | | async setModelInfoData(result) { |
| | | var modelKey = 'id' |
| | | if (result.tileset.pubid > 0) { |
| | | const data = await comprehensive_selectPubById({ id: result.tileset.pubid }) |
| | | if (data.code != 200) { |
| | | return |
| | | } else { |
| | | var modelKey = 'id'; |
| | | var modelid; |
| | | if (result.tileset) { |
| | | if (result.tileset.pubid && parseInt(result.tileset.pubid) > 0) { |
| | | |
| | | modelKey = JSON.parse(data.result.json).modelid |
| | | const data = await comprehensive_selectPubById({ id: result.tileset.pubid }) |
| | | if (data.code != 200) { |
| | | return |
| | | } else { |
| | | |
| | | modelKey = JSON.parse(data.result.json).modelid |
| | | } |
| | | if (!modelKey) { |
| | | return this.$message('没有模型主键ID,无法查询数据'); |
| | | } |
| | | modelid = pickedFeature.getProperty(modelKey); |
| | | |
| | | } |
| | | if (!modelKey) { |
| | | return this.$message('没有模型主键ID,无法查询数据'); |
| | | } |
| | | } else { |
| | | modelid = '3dml' + result.primitive.id; |
| | | } |
| | | var that = this |
| | | |
| | | if (!modelid) { |
| | | modelid = "noAuto_" + pickedFeature.primitive.layerId; |
| | | } |
| | | var obj = { |
| | | layerid: pickedFeature.primitive.layerId, |
| | | modelid: pickedFeature.getProperty(modelKey) |
| | | modelid: modelid |
| | | } |
| | | |
| | | const data1 = await comprehensive_selectModelByGuid(obj); |
| | |
| | | } |
| | | |
| | | that.$store.state.catModelInfo = { |
| | | id: pickedFeature.getProperty(modelKey), |
| | | id: modelid, |
| | | name: name, |
| | | type: type, |
| | | bak: bak, |
| | |
| | | layerName: pickedFeature.primitive.id |
| | | }; |
| | | that.$refs && that.$refs.modelProperty && that.$refs.modelProperty.open(); |
| | | |
| | | }, |
| | | |
| | | |
| | | drawTerrainLevel() { |
| | | this.clearTerrainLevel() |
| | | var deep = parseFloat(this.terrainFrom.height) |
| | |
| | | |
| | | licenseServer: window.sceneConfig.licenseServer, |
| | | }); |
| | | |
| | | |
| | | window.Viewer = window.sgworld._Viewer; |
| | | |
| | | if (is_production) { |
| | |
| | | ); |
| | | } |
| | | |
| | | |
| | | |
| | | var option = { |
| | | url: window.sceneConfig.SGUrl, |
| | | layerName: window.sceneConfig.mptName, |
| | | requestVertexNormals: true, |
| | | }; |
| | | window.terrainLayer = sgworld.Creator.sfsterrainprovider("", option, "", true, ""); |
| | | |
| | | window.terrainFlag = 'MPT' |
| | | window.elevationTool = new SmartEarth.ElevationTool(window.sgworld); |
| | | elevationTool.setContourColor("#F1D487"); |
| | | |
| | | |
| | | }, |
| | | //dem切换 |
| | | changeTerrainLayer() { |
| | |
| | | window.terrainLayer = null; |
| | | |
| | | window.terrainLayer = new Cesium.CesiumTerrainProvider({ |
| | | url: LFData + '/3d/terrain/dem20230321' |
| | | // url: LFData + '/3d/terrain/dem20230321' |
| | | url: demLayer |
| | | }); |
| | | Viewer.terrainProvider = window.terrainLayer |
| | | Viewer.camera.flyTo({ |
| | |
| | | roll: 0.0 |
| | | } |
| | | }); |
| | | |
| | | } |
| | | this.terrainflag = !this.terrainflag |
| | | }, |
| | |
| | | }, |
| | | //定位 |
| | | setCoordLocal() { |
| | | var lon = parseFloat(this.coordFrom.lon); |
| | | var lat = parseFloat(this.coordFrom.lat); |
| | | var height = parseFloat(this.coordFrom.height); |
| | | if (!this.coordFrom.lon) { |
| | | return this.$message('请输入经度'); |
| | | } |
| | | if (!this.coordFrom.lat) { |
| | | return this.$message('请输入纬度'); |
| | | } |
| | | var lon = parseFloat(this.coordFrom.lon) |
| | | var lat = parseFloat(this.coordFrom.lat) |
| | | var height = parseFloat(this.coordFrom.height) == NaN ? parseFloat(this.coordFrom.height) : 100; |
| | | |
| | | var position = { |
| | | X: lon, |
| | | Y: lat, |
| | | Altitude: 2000, |
| | | Altitude: height, |
| | | }; |
| | | if (this.imagePoint != null) { |
| | | sgworld.Creator.DeleteObject(this.imagePoint); |
| | |
| | | } |
| | | |
| | | if (!data.result.length) { |
| | | this.$message.error("未查询到勘探信息数据"); |
| | | this.$message("未查询到勘探信息数据"); |
| | | return |
| | | } |
| | | this.showAttribute = !this.showAttribute; |
| | |
| | | // cursor: pointer; |
| | | //} |
| | | .changeTerrain { |
| | | position: absolute; |
| | | bottom: 84px; |
| | | right: 46px; |
| | | height: 30px; |
| | | width: 30px; |
| | | z-index: 101; |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | cursor: pointer; |
| | | border: 1px solid rgba(255, 255, 255, 0.5); |
| | | } |
| | | .changeLayer { |
| | | position: absolute; |
| | | bottom: 116px; |
| | | right: 46px; |
| | | height: 30px; |
| | | width: 30px; |
| | | z-index: 101; |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | cursor: pointer; |
| | | border: 1px solid rgba(255, 255, 255, 0.5); |
| | | } |
| | | .changeMapType { |
| | | position: absolute; |
| | | bottom: 52px; |
| | | right: 46px; |
| | | height: 30px; |
| | | width: 30px; |
| | | z-index: 101; |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | cursor: pointer; |
| | | border: 1px solid rgba(255, 255, 255, 0.5); |
| | | } |
| | | //.changeTerrain { |
| | | // position: absolute; |