| | |
| | | |
| | | |
| | | |
| | | //分页查询元数据 => 根据实体名查询表名 |
| | | //数据发布 => 根据实体名查询表名 |
| | | export function publish_selectMetasByPage(params) { |
| | | return request.get('/publish/selectMetasByPage', { params: params }); |
| | | } |
| | | |
| | | |
| | | |
| | | //数据发布 => 分页查询 |
| | | export function publish_selectByPage(params) { |
| | | return request.get('/publish/selectByPageAndCount', { params: params }); |
| | | } |
| | | //数据发布 => 删除多条 |
| | | export function publish_deletes(params) { |
| | | return request.get('/publish/deletes', { params: params }); |
| | | } |
| | | |
| | |
| | | methods: { |
| | | init3DMap() { |
| | | //地图初始化 |
| | | window.sg = new SmartEarth.SGWorld("mapdiv", { |
| | | window.sgworld = new SmartEarth.SGWorld("mapdiv", { |
| | | url: SmartEarthRootUrl + "Workers/image/earth.jpg", |
| | | licenseServer: window.sceneConfig.licenseServer, |
| | | }); |
| | | |
| | | window.Viewer = window.sg._Viewer; |
| | | window.Viewer = window.sgworld._Viewer; |
| | | |
| | | // Viewer.camera.flyTo({ |
| | | // destination: Cesium.Cartesian3.fromDegrees(110, 33, 8000000), |
| | |
| | | //显示fps |
| | | Viewer.scene.debugShowFramesPerSecond = false; |
| | | //导航控件 |
| | | window.sg.navControl("nav", false); |
| | | window.sgworld.navControl("nav", false); |
| | | //比例尺 |
| | | window.sg.navControl("scale", false); |
| | | window.sgworld.navControl("scale", false); |
| | | //开启深度检测 |
| | | // sg.Analysis.depthTestAgainstTerrain(true) |
| | | Viewer.scene.globe.depthTestAgainstTerrain = true; |
| | | |
| | | var option = { |
| | | url: window.sceneConfig.SGUrl, |
| | | layerName: window.sceneConfig.mptName, |
| | | requestVertexNormals: true, |
| | | }; |
| | | sg.Creator.sfsterrainprovider("", option, "", true, ""); |
| | | |
| | | window.elevationTool = new SmartEarth.ElevationTool(window.sg); |
| | | elevationTool.setContourColor("#F1D487"); |
| | | // window.elevationTool = new SmartEarth.ElevationTool(window.sg); |
| | | // elevationTool.setContourColor("#F1D487"); |
| | | |
| | | if (this.$store.state.previewLayer) { |
| | | var res = this.$store.state.previewLayer; |
| | | if (res.layer.indexOf('.png')) { |
| | | console.log(res.layer) |
| | | |
| | | if (res.url.indexOf('.png') != -1) { |
| | | var wkt = this.$wkt.parse(res.geom); |
| | | var height = this.getHeight(wkt.coordinates[2]) |
| | | console.log(wkt) |
| | | window.BaseMapLayer = Viewer.imageryLayers.addImageryProvider( |
| | | new Cesium.UrlTemplateImageryProvider({ |
| | | url: res.layer, |
| | | url: res.url, |
| | | maximumLevel: 18 |
| | | }) |
| | | |
| | | ); |
| | | debugger |
| | | Viewer.camera.flyTo({ |
| | | destination: Cesium.Cartesian3.fromDegrees(wkt.coordinates[1], wkt.coordinates[0], height), |
| | | }); |
| | | } else if (res.url.indexOf('.json') != -1) { |
| | | var tileset = Viewer.scene.primitives.add( |
| | | new Cesium.Cesium3DTileset({ |
| | | url: res.url, //192.168.20.106,to4 |
| | | maximumScreenSpaceError: 64, // 最大屏幕空间错误:16 |
| | | maximumMemoryUsage: 768, // 最大内存:512 |
| | | dynamicScreenSpaceError: true, // 减少离相机较远的屏幕空间错误:false |
| | | skipLevelOfDetail: true, // 在遍历时候跳过详情:false |
| | | }) |
| | | ); |
| | | tileset.readyPromise.then((tileset) => { |
| | | tileset.id = res.cnName; |
| | | tileset.layerId = res.id; |
| | | this.tileSet(tileset, 50) |
| | | Viewer.flyTo(tileset); |
| | | }); |
| | | } else { |
| | | |
| | | Viewer.imageryLayers.removeAll(); |
| | | var url = res.url.split(';') |
| | | console.log(url) |
| | | |
| | | sgworld.Creator.createImageryProvider('mpt影像', "wms", { |
| | | url: url[0], |
| | | layers: url[1] |
| | | }, "0", undefined, true, ""); |
| | | |
| | | } |
| | | } |
| | | }, |
| | | tileSet(tileset, height) { |
| | | //3dtile模型的边界球体 |
| | | var boundingSphere = tileset.boundingSphere; |
| | | //迪卡尔空间直角坐标=>地理坐标(弧度制) |
| | | var cartographic_original = Cesium.Cartographic.fromCartesian(boundingSphere.center); |
| | | //地理坐标(弧度制)=>迪卡尔空间直角坐标 |
| | | var Cartesian3_original = Cesium.Cartesian3.fromRadians(cartographic_original.longitude, cartographic_original.latitude, cartographic_original.height); |
| | | var Cartesian3_offset = Cesium.Cartesian3.fromRadians(cartographic_original.longitude, cartographic_original.latitude, height); |
| | | //获得地面和offset的转换 |
| | | var translation = Cesium.Cartesian3.subtract(Cartesian3_offset, Cartesian3_original, new Cesium.Cartesian3()); |
| | | //修改模型矩阵 |
| | | tileset.modelMatrix = Cesium.Matrix4.fromTranslation(translation); |
| | | }, |
| | | getHeight(level) { |
| | | if (level > 0 && level < 23) { |
| | | return this.levelArray[level] |
| | |
| | | class="demo-form-inline" |
| | | > |
| | | <!-- 单位 --> |
| | | <el-form-item> |
| | | <el-form-item v-if="active == 'first'"> |
| | | <el-select |
| | | size="small" |
| | | v-model="formInline.depid" |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | <!-- 目录 --> |
| | | <el-form-item> |
| | | <el-form-item v-if="active == 'first'"> |
| | | <el-select |
| | | size="small" |
| | | v-model="formInline.dirid" |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | <!-- 版本 --> |
| | | <el-form-item> |
| | | <el-form-item v-if="active == 'first'"> |
| | | <el-select |
| | | size="small" |
| | | v-model="formInline.verid" |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | <!-- 类型 --> |
| | | <el-form-item> |
| | | <el-form-item v-if="active == 'first'"> |
| | | <el-select |
| | | size="small" |
| | | v-model="formInline.type" |
| | |
| | | size="small" |
| | | icon="el-icon-s-promotion" |
| | | >{{$t('common.publish')}}</el-button> |
| | | <!-- 刪除 --> |
| | | <el-button |
| | | type="danger" |
| | | size="small" |
| | | icon="el-icon-delete" |
| | | @click="setPageDelete" |
| | | >{{$t('common.delete')}}</el-button> |
| | | <!-- 重置 --> |
| | | <el-button |
| | | type="info" |
| | |
| | | align="center" |
| | | /> |
| | | <el-table-column |
| | | v-if="active == 'first'" |
| | | prop="sizes" |
| | | :label="$t('dataManage.vmobj.size')" |
| | | :formatter="stateFormatSizes" |
| | |
| | | align="center" |
| | | /> |
| | | <el-table-column |
| | | prop="layer" |
| | | prop="url" |
| | | :label="$t('common.publishAddress')" |
| | | align="center" |
| | | /> |
| | | <el-table-column |
| | | v-if="active == 'first'" |
| | | prop="uname" |
| | | :label="$t('common.releaseTime')" |
| | | :label="$t('common.rublisher')" |
| | | align="center" |
| | | :key="Math.random()" |
| | | /> |
| | | <el-table-column |
| | | v-if="active != 'first'" |
| | | prop="createName" |
| | | :label="$t('common.rublisher')" |
| | | align="center" |
| | | :key="Math.random()" |
| | | /> |
| | | <el-table-column |
| | | prop="createTime" |
| | | :label="$t('common.rublisher')" |
| | | :formatter="formatData" |
| | | :label="$t('common.releaseTime')" |
| | | align="center" |
| | | /> |
| | | |
| | | <el-table-column |
| | | min-width="150" |
| | | :label="$t('common.operate')" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | v-if="scope.row.layer" |
| | | v-if="scope.row.url" |
| | | size="small" |
| | | type="success" |
| | | plain |
| | | @click="setPreviewLayer(scope.row)" |
| | | >{{$t('common.preview')}} |
| | | |
| | | </el-button> |
| | | <el-button |
| | | v-if="scope.row.url" |
| | | size="small" |
| | | type="warning" |
| | | plain |
| | | @click="setPreviewLayer(scope.row)" |
| | | >{{$t('common.preview')}} |
| | | |
| | | </el-button> |
| | | <el-button |
| | | v-if="scope.row.url" |
| | | size="small" |
| | | type="info" |
| | | plain |
| | | @click="setPreviewLayer(scope.row)" |
| | | >{{$t('common.preview')}} |
| | |
| | | @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange" |
| | | :current-page="listData.pageIndex" |
| | | :page-sizes="[100, 200, 500, 1000]" |
| | | :page-sizes="showPageSize" |
| | | :page-size="listData.pageSize" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :total="listData.count" |
| | |
| | | <script> |
| | | import mapview from '../../components/preview_map.vue' |
| | | import MyBread from "../../components/MyBread.vue" |
| | | import { selectdepTab, selectdirTab, meta_selectVerByDirid, publish_selectMetasByPage } from '../../api/api.js' |
| | | import { |
| | | selectdepTab, |
| | | selectdirTab, |
| | | meta_selectVerByDirid, |
| | | publish_selectMetasByPage, |
| | | publish_selectByPage, |
| | | publish_deletes |
| | | } from '../../api/api.js' |
| | | |
| | | export default { |
| | | components: { MyBread, mapview }, |
| | |
| | | }, |
| | | dialogVisible: false, |
| | | showMapView: false, |
| | | showPageSize: [], |
| | | |
| | | } |
| | | }, |
| | | methods: { |
| | | async setPageDelete() { |
| | | if (this.multipleSelection.length == 0) { |
| | | return this.$message.error("请选择要删除的数据") |
| | | } else { |
| | | var std = []; |
| | | for (var i in this.multipleSelection) { |
| | | std.push(this.multipleSelection[i].id); |
| | | } |
| | | const data = await publish_deletes(std); |
| | | if (data.code != 200) { |
| | | this.$message.error("单位列表获取失败") |
| | | return |
| | | } else { |
| | | this.$message({ |
| | | message: '删除成功', |
| | | type: 'success' |
| | | }); |
| | | this.getTableData(); |
| | | } |
| | | } |
| | | |
| | | }, |
| | | //预览弹窗打开 |
| | | setPreviewLayer(res) { |
| | | this.$store.state.previewLayer = res; |
| | | this.dialogVisible = true; |
| | | this.showMapView = true; |
| | | |
| | | }, |
| | | |
| | | //预览弹窗关闭 |
| | | handleClose() { |
| | | this.dialogVisible = false; |
| | | this.showMapView = false; |
| | | |
| | | |
| | | }, |
| | | // 获取多选选中的对象 |
| | |
| | | name: "", |
| | | type: "" |
| | | } |
| | | if (this.active == "first") { |
| | | this.listData = { |
| | | pageIndex: 1, |
| | | pageSize: 100, |
| | | count: 0 |
| | | } |
| | | this.showPageSize = [100, 200, 500, 1000] |
| | | } else { |
| | | this.listData = { |
| | | pageIndex: 1, |
| | | pageSize: 10, |
| | | count: 0 |
| | | } |
| | | this.showPageSize = [10, 20, 50, 100] |
| | | } |
| | | |
| | | this.formInline.type = this.typeOption[0].value; |
| | | this.getDepTreeList(); |
| | | this.getDirTreeList(); |
| | |
| | | }, |
| | | //获取Table表格数据 |
| | | async getTableData() { |
| | | this.tableData = []; |
| | | this.listData.count = 0; |
| | | if (this.active == "first") { |
| | | |
| | | this.listData.depcode = this.formInline.depid; |
| | | this.listData.dircode = this.formInline.dirid; |
| | | this.listData.name = this.formInline.name; |
| | |
| | | if (data.code != 200) { |
| | | |
| | | } |
| | | if (data.result) { |
| | | |
| | | |
| | | var that = this |
| | | |
| | | var val = data.result.filter((res) => { |
| | | if (res.createTime) { |
| | | res.createTime = that.format(res.createTime); |
| | | } |
| | | if (res.layer) { |
| | | res.layer = res.layer.replace("{host}", iisHost); |
| | | |
| | | if (res.url) { |
| | | res.url = res.url.replace("{host}", iisHost); |
| | | } |
| | | return res |
| | | }) |
| | | this.tableData = val; |
| | | this.listData.count = data.count; |
| | | } |
| | | } |
| | | else { |
| | | if (this.formInline.name) { |
| | | this.listData.name = this.formInline.name |
| | | } |
| | | |
| | | const data = await publish_selectByPage(this.listData); |
| | | debugger |
| | | if (data.result) { |
| | | var that = this |
| | | var val = data.result.filter((res) => { |
| | | if (res.createTime) { |
| | | res.createTime = that.format(res.createTime); |
| | | } |
| | | |
| | | if (res.url) { |
| | | res.url = res.url.replace("{host}", iisHost); |
| | | } |
| | | return res |
| | | }) |
| | | this.tableData = val; |
| | | this.listData.count = data.count; |
| | | } |
| | | } |
| | | }, |
| | | //格式化时间 |
| | | format(shijianchuo) { |