| | |
| | | //初始化 |
| | | init() |
| | | |
| | | // change事件 |
| | | $('input[type=radio][name=value]').change(function () { |
| | | if (this.value == 'list') { |
| | | $('.evaluate-echarts').hide() |
| | | // $('.evaluate-box-top-left').css('visibility', 'visible') |
| | | $('.evaluate-table').show() |
| | | $('.flood-analysis-pagination').show() |
| | | } else { |
| | | $('.evaluate-table').hide() |
| | | // $('.evaluate-box-top-left').css('visibility', 'hidden') |
| | | $('.flood-analysis-pagination').hide() |
| | | recharts_z() |
| | | loadEcharts() |
| | | $('.evaluate-echarts').show() |
| | | } |
| | | }); |
| | | |
| | | //淹没图弹窗事件 |
| | | $('#create-flood-image').click(function () { |
| | | exportPicture() |
| | | }) |
| | | |
| | | $('#save-btn').click(function () { |
| | | confirmPopup() |
| | | }) |
| | | |
| | | $('#export-img').click(function () { |
| | | exportPicture() |
| | | }) |
| | | |
| | | //确认弹窗 |
| | | function confirmPopup() { |
| | | const self = this |
| | |
| | | verticalAlign: app.config.verticalAlign, |
| | | rotate: app.config.rotate, |
| | | formatter: '{c} {name|{a}}', |
| | | fontSize: 16, |
| | | fontSize: 13, |
| | | rich: { |
| | | name: {} |
| | | } |
| | |
| | | type: 'shadow' |
| | | } |
| | | }, |
| | | legend: {}, |
| | | legend: { |
| | | left: 'left', |
| | | width: "70%" |
| | | }, |
| | | xAxis: [ |
| | | { |
| | | type: 'value', |
| | |
| | | echartsOption && myChart.setOption(echartsOption, true); |
| | | } |
| | | |
| | | //控制echarts图的长宽 |
| | | function recharts_z() { |
| | | var width = $(window).width() * 0.45; |
| | | var height = ($(window).height() - 50) - 80; |
| | | var width = $(window).width(); |
| | | var height = $(window).height() - 400 |
| | | |
| | | $('#evaluate-echarts').empty(); |
| | | $('#evaluate-echarts').removeAttr("_echarts_instance_").empty(); |
| | |
| | | myChartPie.resize(resize); |
| | | } |
| | | |
| | | //获取参数 |
| | | //获取url携带参数 |
| | | function GetQueryString(name) { |
| | | var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); |
| | | var r = decodeURI(window.location.search).substr(1).match(reg); |
| | |
| | | a.dispatchEvent(event) |
| | | } |
| | | |
| | | //初始化 |
| | | function init() { |
| | | |
| | | $('#list').click(function () { |
| | | $('.evaluate-echarts').hide() |
| | | $('.evaluate-table').show() |
| | | $('.flood-analysis-pagination').show() |
| | | $('.list').addClass('choose-button') |
| | | $('.list').removeClass('unchoose-button') |
| | | $('.echarts').addClass('unchoose-button') |
| | | $('.echarts').removeClass('choose-button') |
| | | }) |
| | | |
| | | $('#echarts').click(function () { |
| | | $('.evaluate-table').hide() |
| | | $('.flood-analysis-pagination').hide() |
| | | recharts_z() |
| | | loadEcharts() |
| | | $('.evaluate-echarts').show() |
| | | |
| | | $('.echarts').addClass('choose-button') |
| | | $('.echarts').removeClass('unchoose-button') |
| | | $('.list').addClass('unchoose-button') |
| | | $('.list').removeClass('choose-button') |
| | | }) |
| | | |
| | | //淹没图弹窗事件 |
| | | $('#create-flood-image').click(function () { |
| | | exportPicture() |
| | | }) |
| | | |
| | | //保存按钮点击事件 |
| | | $('#save-btn').click(function () { |
| | | confirmPopup() |
| | | }) |
| | | |
| | | //导出按钮点击事件 |
| | | $('#export-img').click(function () { |
| | | exportPicture() |
| | | }) |
| | | |
| | | |
| | | //图片展示 |
| | | $('#show-img').prop('src', 'image/floodAnalysisEvaluate-2.png') |
| | | loadSumData() |
| | | $('.list').addClass('choose-button') |
| | | $('.list').removeClass('unchoose-button') |
| | | $('.echarts').addClass('unchoose-button') |
| | | $('.echarts').removeClass('choose-button') |
| | | loadPagination() |
| | | loadSumData() |
| | | } |
| | | |
| | | //加载表格 |
| | | function loadTable(listData) { |
| | | // $('#evaluate-tbody').remove() |
| | | var table = "" |
| | |
| | | $('#evaluate-tbody').html(table) |
| | | } |
| | | |
| | | //加载总和数据 |
| | | function loadSumData() { |
| | | var house = 0 |
| | | var people = 0 |
| | |
| | | money = floatAdd(money, evaluateData[i].value) |
| | | } |
| | | |
| | | $(".house").html(house + '户') |
| | | $(".people").html(people + '人') |
| | | $(".area").html(area + 'km²') |
| | | $(".money").html(money + '万元') |
| | | $('.description').html("该站位于" + hd.riverway + ",河段长" + hd.river_length + "m,预计会造成受灾户数" + house + "户,受灾人口" + people + "人,受灾面积" + area + "km²,房屋价值" + money + "万元") |
| | | let table = '<tr>' + |
| | | '<td><div>合计</div></td>' + |
| | | '<td><div>' + house + '</div></td>' + |
| | | '<td><div>' + people + '</div></td>' + |
| | | '<td><div>' + area + '</div></td>' + |
| | | '<td><div>' + money + '</div></td>' + |
| | | '</tr>' |
| | | |
| | | $('#evaluate-tbody').append(table) |
| | | |
| | | // $(".house").html(house + '户') |
| | | // $(".people").html(people + '人') |
| | | // $(".area").html(area + 'km²') |
| | | // $(".money").html(money + '万元') |
| | | |
| | | $('.description').html("  该站位于" + hd.riverway + ",靠近"+hd.stnm.trim()+"水文站,起始距为"+hd.gl_qdj+"m,河段长" + hd.river_length + "m,淹没面积" + house + "km²,淹没耕地面积" + people + "km²,影响" + area + "万人,淹没区GDP总计" + money + "亿元") |
| | | } |
| | | |
| | | //加载分页 |
| | | function loadPagination() { |
| | | if (evaluateData.length <= 0) return |
| | | var count = Math.ceil(evaluateData.length / 10); |