带有天气预报的高大上web报表制作分享
我用FineReport开发了挺多报表,但集成天气预报这样提高交互和人性化的还是第一次,所以跟大家分享下。
这个报表是综合的门店销售管理分析面板,可以查询业绩分析、店员销售分析,店铺排行分析(可以看出是个连锁店),VIP生日提醒。怎么具体制作模板,业内人士一看即明,无需多讲,就重点说下怎么集成天气吧。
先上图:
方法是加一段JS代码,具体如下:
var weather=function(){
var tmp=0;
var SWther={w:[{}],add:{}};
var SWther={};
this.getWeather=function(city,type){
//city=utf8ToGBK(city);
/*
$.getScript("http://php.weather.sina.com.cn/iframe/index/w_cl.php?code=js&day=2&city="+city+"&dfc=3",function(){if(type=='js'){echo(city);}});
**/
$.ajax({
dataType:'script',
scriptCharset:'gb2312',////////
url:"http://php.weather.sina.com.cn/iframe/index/w_cl.php?code=js&day=2&city="+city+"&dfc=3",
success:function(){
if(type=='js'){echo(city);}
}
})
}
function dis_img(weather){
var style_img="image/s_13.png";
if(weather.indexOf("多云")!==-1||weather.indexOf("晴")!==-1){style_img="image/s_1.png";}
else if(weather.indexOf("多云")!==-1&&weather.indexOf("阴")!==-1){style_img="image/s_2.png";}
else if(weather.indexOf("阴")!==-1&&weather.indexOf("雨")!==-1){style_img="image/s_3.png";}
else if(weather.indexOf("晴")!==-1&&weather.indexOf("雨")!==-1){style_img="image/s_12.png";}
else if(weather.indexOf("晴")!==-1&&weather.indexOf("雾")!==-1){style_img="image/s_12.png";}
else if(weather.indexOf("晴")!==-1){style_img="image/s_13.png";}
else if(weather.indexOf("多云")!==-1){style_img="image/s_2.png";}
else if(weather.indexOf("阵雨")!==-1){style_img="image/s_3.png";}
else if(weather.indexOf("小雨")!==-1){style_img="image/s_3.png";}
else if(weather.indexOf("中雨")!==-1){style_img="image/s_4.png";}
else if(weather.indexOf("大雨")!==-1){style_img="image/s_5.png";}
else if(weather.indexOf("暴雨")!==-1){style_img="image/s_5.png";}
else if(weather.indexOf("冰雹")!==-1){style_img="image/s_6.png";}
else if(weather.indexOf("雷阵雨")!==-1){style_img="image/s_7.png";}
else if(weather.indexOf("小雪")!==-1){style_img="image/s_8.png";}
else if(weather.indexOf("中雪")!==-1){style_img="image/s_9.png";}
else if(weather.indexOf("大雪")!==-1){style_img="image/s_10.png";}
else if(weather.indexOf("暴雪")!==-1){style_img="image/s_10.png";}
else if(weather.indexOf("扬沙")!==-1){style_img="image/s_11.png";}
else if(weather.indexOf("沙尘")!==-1){style_img="image/s_11.png";}
else if(weather.indexOf("雾")!==-1){style_img="image/s_12.png";}
else{style_img="image/s_2.png";}
return style_img;};
function echo(city){
$('#city').html(city);
$('#weather').html(window.SWther.w[city][0].s1);
$('#temperature').html(window.SWther.w[city][0].t1+'°');
$('#wind').html(window.SWther.w[city][0].p1);
$('#direction').html(window.SWther.w[city][0].d1);
var T_weather_img=dis_img(window.SWther.w[city][0].s1);
$('#T_weather_img').html("<img src='"+T_weather_img+"' title='"+window.SWther.w[city][0].s1+"' alt='"+window.SWther.w[city][0].s1+"' /><br><span id=\"T_weather\"></span>");
//$('#T_temperature').html(window.SWther.w[city][0].t1+'~'+window.SWther.w[city][0].t2+'°');
$('#T_temperature').html(window.SWther.w[city][0].t1);
$('#T_weather').html(window.SWther.w[city][0].s1);
$('#T_wind').html(window.SWther.w[city][0].p1);
$('#T_direction').html(window.SWther.w[city][0].d1);
$('#M_weather').html(window.SWther.w[city][1].s1);
var M_weather_img=dis_img(window.SWther.w[city][1].s1);
$('#M_weather_img').html("<img src='"+M_weather_img+"' title='"+window.SWther.w[city][1].s1+"' alt='"+window.SWther.w[city][1].s1+"' />");
$('#M_temperature').html(window.SWther.w[city][1].t1+'~'+window.SWther.w[city][1].t2+'°');
$('#M_wind').html(window.SWther.w[city][1].p1);
$('#M_direction').html(window.SWther.w[city][1].d1);
$('#L_weather').html(window.SWther.w[city][2].s1);
var L_weather_img=dis_img(window.SWther.w[city][2].s1);
$('#L_weather_img').html("<img src='"+L_weather_img+"' title='"+window.SWther.w[city][2].s1+"' alt='"+window.SWther.w[city][2].s1+"' />");
$('#L_temperature').html(window.SWther.w[city][2].t1+'~'+window.SWther.w[city][2].t2+'°');
$('#L_wind').html(window.SWther.w[city][2].p1);$('#L_direction').html(window.SWther.w[city][2].d1);
}
}
//weather结束了
function jintian(){
weather_.getWeather(city,'js');
};
如此,大功告成!
带有天气预报的高大上web报表制作分享的更多相关文章
- 汽车4S店经验指标完成情况报表制作分享
集团公司一般为了加强下属的经营管理,以及项经营指标完情况,需要制定一些报表.我们平时也经常遇到这种情况,而这些报表要包括什么内容呢?该怎么制作呢?用什么制作呢?今天小编就以4s店为例,分享给大家一个报 ...
- 第二篇:Power BI数据可视化之基于Web数据的报表制作(经典级示例)
前言 报表制作流程的第一步显然是从各个数据源导入数据,Power BI能从很多种数据源导入数据:如Excel,CSV,XML,以及各类数据库(SQL Server,Oracle,My SQL等),两大 ...
- 价值5000元的web报表分享
价值5000元的web报表分享 与一个朋友聊天,发现他最近做了一个很棒的报表,用他的话来讲,起码值5000RMB,我拿来与大家分享下,共同进步. 用朋友A的话,就是他最近接到公司财务部长大人的需求,需 ...
- 如何创建带有大纲和书签的交互式web报表
交互式报表允许用户与之交互.例如,报表可以包含超链接.书签和大纲.通过点击大纲部分的标题,你可以将书签导航到报表中的所需位置.这样的报表经常用在产品目录中.(查看更多web报表教程) 让我们为Web创 ...
- 《奥威Power-BI智能分析报表制作方法》精彩回顾
年的最后一个月,一年又快过去.工作和学习都不能耽误,本周三奥威公开课又如约与大家见面咯!不知老师教的图文报表在课后你们都有练习吗?趁热打铁,我们现在再次来温习一下吧. 本期分享的内容:<奥威Po ...
- Fastreport生成WEB报表
开发WEB应用系统通常都会遇到报表打印问题.简单应用可利用IE的页面打印功能,利用HTML标签控制格式来实现.但复杂的业务型应用系统,报表不仅是组成应用的 重要部分,还常常是相当复杂的.现在很多应用系 ...
- 挖到一款免费好用的web报表插件
最近公司项目需要用到报表,公司领导要求我来调研下报表工具.开始的时候了解了目前市场上功能强大,占有率高的两款报表工具,帆软报表和润乾报表,这两款报表工具功能比较强大,覆盖的行业较广,基本能满足所有的报 ...
- 设计与开发一款简单易用的Web报表工具(支持常用关系数据及hadoop、hbase等)
EasyReport是一个简单易用的Web报表工具(支持Hadoop,HBase及各种关系型数据库),它的主要功能是把SQL语句查询出的行列结构转换成HTML表格(Table),并支持表格的跨行(Ro ...
- 推荐6款常用的Java开源报表制作工具
JasperReports是一个基于Java的开源报表工具,它可以在Java环境下像其它IDE报表工具一样来制作报表.JasperReports 支持PDF.HTML.XLS.CSV和XML文件输出格 ...
随机推荐
- (转载)Windows常见性能计数器(较好的说明)
转载地址:http://blog.csdn.net/dfbrt56/article/details/3341591 Windows常见性能计数器 性能计数器(counter)是描述服务器或操作系统性能 ...
- Rotating Image Slider - 图片旋转切换特效
非常炫的图片旋转滑动特效,相信会给你留下深刻印象.滑动图像时,我们会稍稍旋转它们并延缓各元素的滑动.滑块的不寻常的形状是由一些预先放置的元素和使用边框创建.另外支持自动播放选项,鼠标滚轮的功能. 在线 ...
- 实例之HTML标签属性
鼠标放在图片上会显示说明文字的代码 <img src="图片地址" width=620 height=138 border=0 title="说明文字" ...
- .net c# 视频剪切抓取缩略图
public string Cut(string ffmpegPath, string videoPath, string savePath, string imgSize, int sleepTim ...
- 实验9:Problem G: 克隆人来了!
想要输出""的话: cout<<"A person whose name is \""<<name<<" ...
- [javascript svg fill stroke stroke-width circle 属性讲解] svg fill stroke stroke-width circle 属性 绘制圆形及引入方式讲解
<!DOCTYPE html> <html lang='zh-cn'> <head> <title>Insert you title</title ...
- Day Tips:Search CPU 100%
Powershell:Set-SPEnterpriseSearchService -PerformanceLevel Reduced Specifies the relativ ...
- Activity源码简要分析总结
Activity源码简要分析总结 摘自参考书籍,只列一下结论: 1. Activity的顶层View是DecorView,而我们在onCreate()方法中通过setContentView()设置的V ...
- Android-Using DDMS
原文:http://developer.android.com/tools/debugging/ddms.html#how-ddms-works Android提供了一个debug工具叫做:DDMS, ...
- iOS 设备标识
//UUID NSLog(@"-=-=-=-=-=-=-=-==-=-==qqqqqqqqqqqqqqqqqqqqqqq:::::::::::%@", [[NSUUID UU ...