赣州市洪水风险预警系统三维版本
guoshilong
2023-02-10 4fc86b8e29c96e5f53a0566450c23e1f06b7682f
洪水淹没-河段api 去掉url后的参数
4 files modified
2 files added
131 ■■■■■ changed files
corelib/common/popup/css/style.css 27 ●●●●● patch | view | raw | blame | history
corelib/common/popup/js/saveConfirm.js 17 ●●●●● patch | view | raw | blame | history
corelib/common/popup/saveConfirm.html 25 ●●●●● patch | view | raw | blame | history
widgets/FloodAnalysis/Widget.html 1 ●●●● patch | view | raw | blame | history
widgets/FloodAnalysis/Widget.js 54 ●●●●● patch | view | raw | blame | history
widgets/FloodAnalysis/css/style.css 7 ●●●● patch | view | raw | blame | history
corelib/common/popup/css/style.css
@@ -976,3 +976,30 @@
    width: 96%;
    text-align: right;
}
/**确认保存弹出框**/
.confirm-popup{
margin-top: 5%;
}
.confirm-popup>div{
    text-align: center;
}
.confirm-top{
    font-size: 30px;
}
.confirm-bottom{
    margin-top: 8%;
}
.save-name-input{
    height: 26px;
    width: 215px;
}
.confirm-button{
    width: 80px;
    height: 32px;
}
corelib/common/popup/js/saveConfirm.js
New file
@@ -0,0 +1,17 @@
console.log(this)
$(function () {
    $('#confirm-button').click(function () {
        let saveName = $('#save-name').val()
        if (saveName == "") return
        var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
        parent.layer.close(index);
    })
});
corelib/common/popup/saveConfirm.html
New file
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>保存</title>
    <link rel="stylesheet" href="./css/style.css">
    <link rel="stylesheet" href="">
</head>
<body>
<div class="confirm-popup">
    <div class="confirm-top">
        <label for="save-name">名称:</label>
        <input id="save-name" class="save-name-input" type="text" name="word" autocomplete="off"
               maxlength="256" placeholder="请输入名称"/>
    </div>
    <div class="confirm-bottom">
        <input id="confirm-button" class="confirm-button" type="button" value="保  存"/>
    </div>
</div>
<script src="../../../libs/jquery/jquery-3.3.1.min.js"></script>
<script src="js/saveConfirm.js"></script>
</body>
</html>
widgets/FloodAnalysis/Widget.html
@@ -70,6 +70,7 @@
                    <input id="search-name" class="search-name-input" type="text" name="word" autocomplete="off"
                           maxlength="256" placeholder="请输入筛选名称"/>
                    <input id="search-button" class="search-button" type="button" value="查  询"/>
                    <input id="save-button" class="save-button" type="button" value="保  存"/>
                </div>
                <div class="table-box">
                    <table>
widgets/FloodAnalysis/Widget.js
@@ -25,7 +25,11 @@
        //洪水分析表格数据
        analysisTableList: [],
        //历史风险图表格数据
        historyTableList:[],
        historyTableList:[
            {name:"5年洪水淹没图"},
            {name:"10年洪水淹没图"},
            {name:"15年洪水淹没图"},
        ],
        //当前选中的河段
        currentHdId: "",
        //当前选中的水面线
@@ -34,11 +38,12 @@
        isOpen:true,
        //api接口
        url: {
            riverwaySelectName: "http://192.168.0.200:82/blade-ycreal/riverway/selectName?name=%E6%B0%B4",
            riverwaySelectName: "http://192.168.0.200:82/blade-ycreal/riverway/selectName",
            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",
            getHistoryList:"",
            saveHistoryData:"",
        },
        startup: function startup() {
            var self = this
@@ -139,6 +144,7 @@
                }
            })
            //搜索按钮点击事件
            $('#search-button').click(function () {
                let searchName = $('#search-name').val()
@@ -146,6 +152,29 @@
                    return e.name.indexOf(searchName) != -1
                })
                self.loadPagination(filterArray,"flood-analysis-pagination")
            })
            console.log(this)
            $('#save-button').click(function () {
                    let url = './corelib/common/popup/saveConfirm.html'
                    var top = ($(window).height()-300) / 2 -124;
                    var left = ($(window).width() -500) / 2;
                    layer.open({
                        title:'保存',
                        type: 2,
                        maxmin: false, //开启最大化最小化按钮
                        area: ['500px', '200px'],
                        skin: 'saveConfirm',
                        offset: [top, left],
                        content: url,
                        id: "saveConfirmLayer",
                        closeBtn: 1,
                        //把父页面数据传递给子弹窗并渲染
                        success: function(layero, index) {
                        }
                    })
            })
        },
@@ -358,6 +387,7 @@
        //获取历史风险图数据列表
        getHistoryList(){
            console.log("调用了!!!")
            const self = this
            $.ajax({
                url: self.url.getHistoryList,
@@ -455,7 +485,7 @@
            var table = ""
            listData.forEach(e => {
                table += '<tr>' +
                    '<td>div><input type="radio" name="tableRadio" value='+e.id+'></div></td>' +
                    '<td><div><input type="radio" name="tableRadio" value='+e.id+'></div></td>' +
                    '<td><div>' + e.name + '</div></td>' +
                    '</tr>'
            })
@@ -503,6 +533,24 @@
            });
        },
        //保存历史风险图
        saveHistoryData(){
            const self = this
            $.ajax({
                url: self.url.getCzByGlCodeByGlQdj,
                type: 'get',
                dataType: 'json',
                jsonp: 'callback',
                jsonpCallback: 'data',
                data: {},
                success: function (res) {
                    if (res.code == 200){
                        self.getHistoryList()
                    }
                }
            });
        },
        //防止出现两个小数相加出现很多0的情况
        floatAdd(arg1, arg2) {
            var r1, r2, m;
widgets/FloodAnalysis/css/style.css
@@ -78,7 +78,7 @@
    color: #1f81e0;
}
.search-button {
.search-button,.save-button {
    width: 66px;
    line-height: 0px;
    height: 30px;
@@ -87,6 +87,11 @@
    cursor: pointer;
}
.search-button:hover,.save-button:hover{
    background-color: #1388ff;
    color: white;
}
.flood-middle .select-box select, .flood-middle .select-box input, .search-name-input {
    height: 30px;
    width: 260px;