| | |
| | | smxSelect: null, |
| | | //河段下拉列表 |
| | | hdDataList: [], |
| | | //水面线下拉列表 |
| | | smxDataList:[], |
| | | //洪水分析表格数据 |
| | | analysisTableList: [], |
| | | dgridSelectEvent:null, |
| | |
| | | waterlineSelectName: "http://192.168.0.207:82/blade-ycreal/waterline/selectName", |
| | | childpage: "http://192.168.0.207:82/blade-ycreal/water/childpage", |
| | | getCzByGlCodeByGlQdj: "http://192.168.0.207:82/blade-ycreal/waterline/getCzByGlCodeByGlQdj", |
| | | getHistoryList: "", |
| | | saveHistoryData: "", |
| | | getHistoryList: "http://192.168.0.103:82/blade-ycreal/inundationResult/list", |
| | | saveHistoryData: "http://192.168.0.103:82/blade-ycreal/inundationResult/save", |
| | | getCoordinatesMinQdj: "http://192.168.0.207:82/blade-ycreal/water/getCoordinatesMinQdj", |
| | | }, |
| | | evaluateData: [ |
| | |
| | | if (this.drawingPolyline) |
| | | this.map.entities.remove(this.drawingPolyline); |
| | | |
| | | if (this.waterEntity) |
| | | this.map.entities.remove(this.waterEntity) |
| | | |
| | | this.map.scene.globe.baseColor = Cesium.Color.WHITE; |
| | | |
| | | $('#hd-select option').remove() |
| | |
| | | }, |
| | | success: function (res) { |
| | | let data = res.data |
| | | self.smxDataList = data |
| | | self.smxSelect.find("option").remove();//添加新值 删除旧值 |
| | | if (data.length <= 0) { |
| | | $('#flood-tbody').html("") |
| | |
| | | success: function (res) { |
| | | if (res.code == 200) { |
| | | let data = res.data.records |
| | | self.deleteEntities(self.pointEntities) |
| | | // 水面线连线 |
| | | let cartesians = [] |
| | | for (let i = 0; i < data.length; i++) { |
| | | cartesians.push(new Cesium.Cartesian3.fromDegrees(data[i].lng, data[i].lat,data[i].sw)) |
| | | let temp = self.map.entities.add({ |
| | | position: Cesium.Cartesian3.fromDegrees(data[i].lng, data[i].lat,data[i].sw), |
| | | point: { |
| | | color: Cesium.Color.RED, |
| | | pixelSize: 11, |
| | | //防止地形遮挡住点 |
| | | disableDepthTestDistance: Number.POSITIVE_INFINITY, |
| | | heightReference: Cesium.HeightReference.CLAMP_TO_GROUND |
| | | }, |
| | | }); |
| | | // 清空使用 |
| | | self.pointEntities.push(temp) |
| | | |
| | | // if (data[i].location.length>12){ |
| | | // data[i].location = data[i].location.substring(0,12)+"..." |
| | | // } |
| | | |
| | | } |
| | | |
| | | // 先清空 后画线 |
| | | if (self.drawingPolyline) |
| | | self.map.entities.remove(self.drawingPolyline); |
| | | let lineOpts = { |
| | | polyline: { |
| | | positions: cartesians, |
| | | clampToGround: true, |
| | | width: 3, |
| | | color: "#279a9a" |
| | | } |
| | | }; |
| | | // 画线 |
| | | self.drawingPolyline = self.map.entities.add(lineOpts); |
| | | |
| | | self.createPointAndLine(data,self.pointEntities) |
| | | self.analysisTableList = data |
| | | self.getSub(self.currentHd.id, self.currentSmxcode) |
| | | } |
| | |
| | | }); |
| | | }, |
| | | |
| | | //创建点线 |
| | | createPointAndLine(data,pointEntities){ |
| | | this.deleteEntities(pointEntities) |
| | | // 水面线连线 |
| | | let cartesians = [] |
| | | for (let i = 0; i < data.length; i++) { |
| | | cartesians.push(new Cesium.Cartesian3.fromDegrees(data[i].lng, data[i].lat,data[i].sw)) |
| | | let temp = this.map.entities.add({ |
| | | position: Cesium.Cartesian3.fromDegrees(data[i].lng, data[i].lat,data[i].sw), |
| | | point: { |
| | | color: Cesium.Color.RED, |
| | | pixelSize: 11, |
| | | //防止地形遮挡住点 |
| | | disableDepthTestDistance: Number.POSITIVE_INFINITY, |
| | | heightReference: Cesium.HeightReference.CLAMP_TO_GROUND |
| | | }, |
| | | }); |
| | | // 清空使用 |
| | | pointEntities.push(temp) |
| | | } |
| | | |
| | | // 先清空 后画线 |
| | | if (this.drawingPolyline){ |
| | | this.map.entities.remove(this.drawingPolyline); |
| | | } |
| | | let lineOpts = { |
| | | polyline: { |
| | | positions: cartesians, |
| | | clampToGround: true, |
| | | width: 3, |
| | | color: "#279a9a" |
| | | } |
| | | }; |
| | | // 画线 |
| | | this.drawingPolyline = this.map.entities.add(lineOpts); |
| | | |
| | | }, |
| | | |
| | | //获取历史风险图数据列表 |
| | | getHistoryList() { |
| | | const self = this |
| | | // $.ajax({ |
| | | // url: self.url.getHistoryList, |
| | | // type: 'get', |
| | | // dataType: 'json', |
| | | // jsonp: 'callback', |
| | | // jsonpCallback: 'data', |
| | | // data: { |
| | | // name: "", |
| | | // }, |
| | | // success: function (res) { |
| | | // if (res.code == 200) { |
| | | // console.log(res) |
| | | // let data = res.data.records |
| | | // |
| | | // } |
| | | // } |
| | | // }); |
| | | let data = self.historyTableList |
| | | self.loadPagination(data,"history-pagination") |
| | | $.ajax({ |
| | | url: self.url.getHistoryList, |
| | | type: 'get', |
| | | dataType: 'json', |
| | | jsonp: 'callback', |
| | | jsonpCallback: 'data', |
| | | data: { |
| | | name: "", |
| | | pageSize:999999999, |
| | | }, |
| | | success: function (res) { |
| | | if (res.code == 200) { |
| | | let data = res.data.records |
| | | data.forEach(e=>{ |
| | | e.smxVal = JSON.parse(e.smxVal) |
| | | }) |
| | | self.historyTableList = data |
| | | self.loadPagination(data,"history-pagination") |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | /** |
| | |
| | | }, |
| | | |
| | | /** |
| | | * 加载历史风险表格 |
| | | * @param listData 需要加载的数据 |
| | | */ |
| | | loadHistoryTable(listData) { |
| | | var table = "" |
| | | listData.forEach(e => { |
| | | table += '<tr>' + |
| | | '<td><div><input type="radio" name="tableRadio" value=' + e.id + '></div></td>' + |
| | | '<td><div>' + e.name + '</div></td>' + |
| | | '</tr>' |
| | | }) |
| | | $('#flood-history-tbody').html(table) |
| | | }, |
| | | |
| | | /** |
| | | * 计算水位 |
| | | * @param waterline 水面线高度 |
| | | * @param number 差值 |
| | |
| | | let sw = this.floatAdd(Number(waterline), Number(sub)) |
| | | return sw |
| | | }, |
| | | |
| | | //预测水位计算 |
| | | getYcSub() { |
| | | const self = this |
| | |
| | | |
| | | self.loadPagination(self.analysisTableList, "analysis-pagination") |
| | | }, |
| | | |
| | | //实时水位计算 |
| | | getSub(hdid, smxcode) { |
| | | const self = this |
| | |
| | | saveHistoryData() { |
| | | const self = this |
| | | $.ajax({ |
| | | url: self.url.getCzByGlCodeByGlQdj, |
| | | url: self.url.saveHistoryData, |
| | | type: 'get', |
| | | dataType: 'json', |
| | | jsonp: 'callback', |
| | |
| | | //评估分析弹窗 |
| | | evaluatePopup() { |
| | | var self = this |
| | | let data = this.evaluateData |
| | | let dataStr = JSON.stringify(data) |
| | | let hdStr = JSON.stringify(this.currentHd) |
| | | let selectSmx = this.smxDataList.filter(e=>{ |
| | | return e.smxcode == this.currentSmxcode |
| | | }) |
| | | |
| | | let parentData = {} |
| | | |
| | | parentData.data = this.evaluateData |
| | | parentData.hd = this.currentHd |
| | | parentData.smx = selectSmx[0] |
| | | parentData.sw = $('#sw-input').val() |
| | | parentData.point = this.analysisTableList |
| | | // let data = this.evaluateData |
| | | // let dataStr = JSON.stringify(data) |
| | | // let hdStr = JSON.stringify(this.currentHd) |
| | | |
| | | // let smxStr = JSON.stringify(selectSmx[0]) |
| | | |
| | | var url = './corelib/common/popup/evaluateAnalysis.html' |
| | | var top = ($(window).height() - 600) / 2; |
| | |
| | | area: ['1500px', '700px'], |
| | | skin: 'floodAnalysis', |
| | | offset: 'auto', |
| | | content: url + "?data=" + encodeURIComponent(dataStr) + "&hd=" + encodeURIComponent(hdStr),//使用encodeURIComponent转码,避免中文字符乱码,避免url截取错误 |
| | | content: url + "?parentData=" + encodeURIComponent(JSON.stringify(parentData)),//使用encodeURIComponent转码,避免中文字符乱码,避免url截取错误 |
| | | id: "floodAnalysisLayer", |
| | | closeBtn: 1, |
| | | }); |
| | |
| | | this.dgridSelectEvent = grid.on("dgrid-select", function(evt){ |
| | | //获取行数据 |
| | | let data = evt.rows[0].data |
| | | console.log(data) |
| | | |
| | | if (data.smxVal.point.length>0){ |
| | | self.createPointAndLine(data.smxVal.point,self.pointEntities) |
| | | |
| | | self.map.camera.flyTo({ |
| | | destination: Cesium.Cartesian3.fromDegrees(data.lon, data.lat, 50000), |
| | | }); |
| | | |
| | | self.drawWater() |
| | | } |
| | | |
| | | }); |
| | | grid.renderArray(dataList); |
| | | }, |
| | | |
| | | // 洪水淹没效果 |
| | | drawWater() { |
| | | //地图定位 |