zoukankan      html  css  js  c++  java
  • 大二下学期第一次结对作业(第二阶段)

    昨日将网页进了进本的分块,今日主要对各个区块中填入了数据进行测试。

    主要是对css的综合运用,对样式的调整。并将前端与后端数据库连接,将测试数据换成了正确数据。

    但是地图下砖还是之前项目的中国地图下砖,由于要实现图表联动所以要对地图进行修改,暂且放中国地图测试效果。

     主要完成世界疫情,中国疫情,中国地图下砖,世界确诊人数top5数据的填充。

    function get_c1_data() {
                $.ajax({
                    url:"/c1",
                    success:function(data){
                        $("#main_confirm").text(data.confirm);
                        $("#main_dead").text(data.dead);
                        $("#main_heal").text(data.heal);
                        $("#main_now").text(data.confirm-data.dead-data.heal);
                    },
                    error:function (xhr,type,errorThrown){
    
                    }
                })
            }
            function get_world_c1_data() {
                $.ajax({
                    url:"/world_c1",
                    success:function(data){
                        $("#world_confirm").text(data.confirm);
                        $("#world_dead").text(data.dead);
                        $("#world_heal").text(data.heal);
                        $("#world_now").text(data.nowConfirm);
                    },
                    error:function (xhr,type,errorThrown){
    
                    }
                })
            }
            function get_world_bar_data(){
                $.ajax({
                    url: "/world_bar",
                    success: function (data) {
                        bar_option.xAxis[0].data=data.name;
                        bar_option.series[0].data=data.value;
                        bar.setOption(bar_option);
                    },
                    error: function (xhr, type, errorThrown) {
                    }
                })
            }
    @app.route('/world_c1')
    def get_world_c1_data():
        data=utils.get_world_c1_data()
        print("世界统计:")
        print(data)
        return jsonify({"confirm":data[0],"heal":data[1],"dead":data[2],"nowConfirm":data[3]})
    @app.route("/world_bar")
    def get_world_bar_data():
        data = utils.get_world_bar_data()
        list=[]
        name=[]
        value=[]
        for a,b, in data:
            list.append({"name":a,"value":b})
            name.append(a)
            value.append(b)
        print("世界确诊TOP8")
        print(list)
        return jsonify({"name":name,"value":value})
    def get_world_c1_data():
        """
    
        :return: 大屏主数据
        """
        sql="select sum(confirm),"
            "sum(heal), "
            "sum(dead), "
            "sum(nowConfirm) "
            "from world "
            "where update_time=(select update_time from world order by update_time desc limit 1)"
        res=query(sql)
        return res[0]
    def get_world_bar_data():
        sql='select country,confirm from world where update_time=(select update_time from world ' 
              'order by update_time desc limit 1) order by confirm desc limit 8'
        res=query(sql)
        return res
  • 相关阅读:
    为 WordPress 标签添加 rel="nofollow" 属性
    Discuz X3.2 SEO设置 title 不支持空格的解决方法
    LANMP 如何禁止访问 .htaccess 文件
    Discuz 哪些文件和文件夹需要777权限
    WordPress 模板常用函数
    CSS控制 table 的 cellpadding,cellspacing
    从 Typecho 自定义字段的调用代码看去
    Linux 服务器如何修改 DNS
    Linux 服务器如何禁止 ping 以及开启 ping
    Asp.Net 加载不同项目程序集
  • 原文地址:https://www.cnblogs.com/fengchuiguobanxia/p/14584571.html
Copyright © 2011-2022 走看看