| | |
| | | hdDataList: [], |
| | | //洪水分析表格数据 |
| | | analysisTableList: [], |
| | | //历史风险图表格数据 |
| | | historyTableList:[], |
| | | //当前选中的河段 |
| | | currentHdId: "", |
| | | //当前选中的水面线 |
| | | currentSmxcode: "", |
| | | //收起框打开状态 |
| | | isOpen:true, |
| | | //api接口 |
| | | url: { |
| | | riverwaySelectName: "http://192.168.0.200:82/blade-ycreal/riverway/selectName?name=%E6%B0%B4", |
| | | waterlineSelectName: "http://192.168.0.200:82/blade-ycreal/waterline/selectName", |
| | | childpage: "http://192.168.0.200:82/blade-ycreal/water/childpage", |
| | | getCzByGlCodeByGlQdj: "http://192.168.0.200:82/blade-ycreal/waterline/getCzByGlCodeByGlQdj" |
| | | getCzByGlCodeByGlQdj: "http://192.168.0.200:82/blade-ycreal/waterline/getCzByGlCodeByGlQdj", |
| | | getHistoryList:"", |
| | | }, |
| | | startup: function startup() { |
| | | var self = this |
| | | this.bindHtmlElement() |
| | | //收起展开按钮点击事件 |
| | | $(".fold-btn").click(function(){ |
| | | if (self.isOpen){ |
| | | $(this).addClass('close') |
| | |
| | | } |
| | | }) |
| | | |
| | | //实时、预测改变事件 |
| | | $('input[type=radio][name=middleRadio]').change(function () { |
| | | if (this.value == "realtime") { |
| | | self.divSwInput.css('visibility', 'hidden') |
| | |
| | | } |
| | | }) |
| | | |
| | | //历史风险图表格单选框改变事件 |
| | | $('input[type=radio][name=tableRadio]').change(function () { |
| | | console.log(this.value) |
| | | }) |
| | | |
| | | //洪水淹没分析按钮点击事件 |
| | | this.analysisBtn.click(function () { |
| | | self.analysisBtn.addClass('choose-button') |
| | | self.analysisBtn.removeClass('unchoose-button') |
| | |
| | | self.divFloodAnalysis.show() |
| | | }) |
| | | |
| | | //历史风险图按钮点击事件 |
| | | this.historyBtn.click(function () { |
| | | self.historyBtn.addClass('choose-button') |
| | | self.historyBtn.removeClass('unchoose-button') |
| | |
| | | self.divFloodHistory.show() |
| | | }) |
| | | |
| | | |
| | | //河段输入框聚焦、失焦、值改变事件 |
| | | //河段输入框聚焦、失焦、输入事件 |
| | | $('#hd-input').focus(function () { |
| | | $("#hd-select").show() |
| | | }) |
| | | |
| | | $('#hd-input').blur(function () { |
| | | //隐藏域触发改变事件需要手动触发 |
| | | $("#hd-select").val().change() |
| | | $("#hd-select").hide() |
| | | }) |
| | | |
| | | $('#hd-input').on("input", function () { |
| | | var searchString = $('#hd-input').val() |
| | | var filterArray = self.hdDataList.filter(e => { |
| | |
| | | }) |
| | | }) |
| | | |
| | | //河段选择框改变事件 |
| | | this.hdSelect.change(function () { |
| | | $("#hd-input").val($(this).find("option:selected").text()); |
| | | var selected = JSON.parse($(this).val()) |
| | |
| | | self.hdSelect.hide() |
| | | }) |
| | | |
| | | //水面线选择框改变事件 |
| | | this.smxSelect.change(function () { |
| | | var selected = $(this).val() |
| | | self.getPointData(selected) |
| | | }) |
| | | |
| | | //水位输入框按下回车事件 |
| | | $('#sw-input').keypress(function (event) { |
| | | if (event.which == 13) { |
| | | let sw = $('#sw-input').val() |
| | |
| | | }) |
| | | self.loadPagination(self.analysisTableList, "analysis-pagination") |
| | | } |
| | | }) |
| | | |
| | | $('#search-button').click(function () { |
| | | let searchName = $('#search-name').val() |
| | | |
| | | let filterArray = self.historyTableList.filter(e=>{ |
| | | return e.name.indexOf(searchName) != -1 |
| | | }) |
| | | self.loadPagination(filterArray,"flood-analysis-pagination") |
| | | }) |
| | | |
| | | }, |
| | |
| | | this.map.camera.setView({ |
| | | destination: Cesium.Cartesian3.fromDegrees(116.016905, 25.884684, 10000), |
| | | }); |
| | | |
| | | $(this).addClass('open') |
| | | $(this).removeClass('close') |
| | | $('.content').show() |
| | | this.isOpen = true |
| | | }, |
| | | |
| | | onClose: function onClose() { |
| | |
| | | this.divFloodAnalysis.show() |
| | | $("input[type=radio][name=middleRadio][value='realtime']").prop('checked', 'checked') |
| | | this.hdSelect.hide() |
| | | $('.fold-btn').addClass('open') |
| | | $('.fold-btn').removeClass('close') |
| | | $('.content').show() |
| | | this.isOpen = true |
| | | |
| | | this.analysisBtn.addClass('choose-button') |
| | | this.analysisBtn.removeClass('unchoose-button') |
| | |
| | | }); |
| | | }, |
| | | |
| | | //获取历史风险图数据列表 |
| | | 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) { |
| | | let data = res.data.records |
| | | |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | /** |
| | | * 加载分页器 |
| | | * @param tableData 需要加载的所有数据 |
| | |
| | | * @param tableElementId tbody id |
| | | */ |
| | | loadPagination(tableData, pageElementId) { |
| | | if (tableData.length <= 0) { |
| | | if (tableData.length <= 0 && pageElementId =="analysis-pagination") { |
| | | $('#analysis-pagination').hide() |
| | | } |
| | | |
| | | if (tableData.length <= 0 && pageElementId =="history-pagination") { |
| | | $('#history-pagination').hide() |
| | | } |
| | | var count = Math.ceil(tableData.length / 10); |
| | | var self = this |
| | |
| | | break; |
| | | } |
| | | } |
| | | self.loadAnalysisTable(listdata) |
| | | |
| | | pageElementId == "analysis-pagination" ? self.loadAnalysisTable(listdata) :self.loadHistoryTable(listdata) |
| | | |
| | | } |
| | | }); |
| | | |
| | |
| | | startData.push(tableData[i]); |
| | | } |
| | | } |
| | | self.loadAnalysisTable(startData) |
| | | pageElementId == "analysis-pagination" ? self.loadAnalysisTable(startData) :self.loadHistoryTable(startData) |
| | | }, |
| | | |
| | | /** |
| | | * 加载表格 |
| | | * 加载淹没分析表格 |
| | | * @param listData 需要加载的数据 |
| | | * @param elementId 需要加载的表格的tbody id |
| | | */ |
| | | loadAnalysisTable(listData, elementId) { |
| | | loadAnalysisTable(listData) { |
| | | var table = "" |
| | | listData.forEach(e => { |
| | | table += '<tr>' + |
| | |
| | | '</tr>' |
| | | }) |
| | | $('#flood-tbody').html(table) |
| | | }, |
| | | |
| | | /** |
| | | * 加载历史风险表格 |
| | | * @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) |
| | | }, |
| | | |
| | | /** |
| | |
| | | m = Math.pow(10, Math.max(r1, r2)); |
| | | return (arg1 * m + arg2 * m) / m; |
| | | } |
| | | |
| | | |
| | | }); |
| | | }); |