从安装软件到flask框架搭建可视化大屏(二)——创建一个flask页面,搭建可视化大屏,零基础也可以学会
附录:所有文件的完整代码
models.py
# models/models.py
from flask_sqlalchemy import SQLAlchemydb = SQLAlchemy()class User(db.Model):__tablename__ = 'user' # 显式指定表名为 'user'id = db.Column(db.Integer, primary_key=True)username = db.Column(db.String(150), unique=True, nullable=False)password = db.Column(db.String(150), nullable=False)def __repr__(self):return f'<User {self.username}>'
forms.py
from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, SubmitField
from wtforms.validators import DataRequired, Length, EqualTo, Regexpclass LoginForm(FlaskForm):username = StringField('用户名', validators=[DataRequired(), Length(min=4, max=25)],render_kw={"placeholder": "请输入用户名"})password = PasswordField('密码', validators=[DataRequired(), Length(min=6, max=80)],render_kw={"placeholder": "请输入密码"})submit = SubmitField('登录')class RegisterForm(FlaskForm):username = StringField('用户名', validators=[DataRequired(), Length(min=4, max=25)],render_kw={"placeholder": "请输入用户名"})password = PasswordField('密码', validators=[DataRequired(),Length(min=6),Regexp('^(?=.*[a-z])(?=.*[A-Z])(?=.*\W).+$',message='密码至少包含一个大写字母,一个小写字母和一个特殊字符')],render_kw={"placeholder": "请输入密码"})confirm = PasswordField('确认密码', validators=[EqualTo('password')],render_kw={"placeholder": "请再次输入密码"})submit = SubmitField('确认')
views.py
# views/views.pyfrom flask import Blueprint, render_template, redirect, url_for, flash, request, session
from forms.forms import LoginForm, RegisterForm
from models.models import db, Userviews_bp = Blueprint('views', __name__)@views_bp.route('/login', methods=['GET', 'POST'])
def login():form = LoginForm()if form.validate_on_submit():username = form.username.datapassword = form.password.datauser = User.query.filter_by(username=username).first()# TODO: Implement password hashingif user and user.password == password:flash('登录成功!', 'success')# 设置用户会话session['username'] = user.usernamereturn redirect(url_for('views.index')) # 登录后跳转到 index.htmlelse:flash('无效的用户名或密码', 'danger')return render_template('login.html', form=form)@views_bp.route('/register', methods=['GET', 'POST'])
def register():form = RegisterForm()if form.validate_on_submit():username = form.username.datapassword = form.password.dataif User.query.filter_by(username=username).first():flash('用户名已存在', 'danger')return redirect(url_for('views.register'))user = User(username=username, password=password)db.session.add(user)try:db.session.commit()flash('注册成功,请登录', 'success')return redirect(url_for('views.login'))except Exception as e:db.session.rollback()flash('注册失败,请重试', 'danger')print(f"注册错误: {e}")else:# 捕捉密码格式验证失败的情况if form.password.errors:flash('注册失败,请重新输入密码', 'danger')return render_template('register.html', form=form)@views_bp.route('/visual_dashboard')
def visual_dashboard():# 检查用户是否已登录if 'username' not in session:flash('请先登录', 'danger')return redirect(url_for('views.login'))return render_template('visual_dashboard.html', title='可视化大屏')@views_bp.route('/')
def index():# 检查用户是否已登录if 'username' not in session:flash('请先登录', 'danger')return redirect(url_for('views.login'))return render_template('index.html')@views_bp.route('/logout')
def logout():session.pop('username', None)flash('已登出', 'success')return redirect(url_for('views.login'))@views_bp.route('/quota')
def quota():return render_template('quota.html')@views_bp.route('/trend')
def trend():return render_template('trend.html')@views_bp.route('/chronic')
def chronic():return render_template('chronic.html')@views_bp.route('/go_to_quota')
def go_to_quota():return redirect(url_for('views.quota'))@views_bp.route('/go_to_trend')
def go_to_trend():return redirect(url_for('views.trend'))@views_bp.route('/go_to_chronic')
def go_to_chronic():return redirect(url_for('views.chronic'))
app.py
# app.pyfrom flask import Flask, render_template, redirect, url_for, flash
from config import Config
from models.models import db, User
from forms.forms import LoginForm, RegisterForm
from views.views import views_bpdef create_app():app = Flask(__name__)app.config.from_object(Config)db.init_app(app)with app.app_context():db.create_all()# 创建默认用户(如果不存在)if not User.query.filter_by(username='admin').first():user = User(username='admin', password='password') # TODO: Implement password hashingdb.session.add(user)db.session.commit()# 注册蓝图app.register_blueprint(views_bp)# 定义根路径路由,重定向到登录页面@app.route('/')def index():return redirect(url_for('views.login'))# 其他路由保持不变@app.route('/quota')def quota():return render_template('quota.html')@app.route('/trend')def trend():return render_template('trend.html')@app.route('/chronic')def chronic():return render_template('chronic.html')@app.route('/go_to_quota')def go_to_quota():return redirect(url_for('views.quota'))@app.route('/go_to_trend')def go_to_trend():return redirect(url_for('views.trend'))@app.route('/go_to_chronic')def go_to_chronic():return redirect(url_for('views.chronic'))return appapp = create_app()if __name__ == '__main__':app.run(debug=True)
config.py
import osclass Config:SECRET_KEY = os.environ.get('SECRET_KEY') or 'you-will-never-guess'SQLALCHEMY_DATABASE_URI = 'mysql+mysqlconnector://root:mysql@localhost:3306/demologin'SQLALCHEMY_TRACK_MODIFICATIONS = False
base.html
<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>{% block title %}可视化系统{% endblock %}</title><link rel="stylesheet" href="{{ url_for('static', filename='css/styles.css') }}">
</head>
<body>{% block body %}<div class="login-background"><div class="login-container">{% with messages = get_flashed_messages(with_categories=true) %}{% if messages %}{% for category, message in messages %}<div class="alert alert-{{ category }}">{{ message }}</div>{% endfor %}{% endif %}{% endwith %}{% block content %}{% endblock %}</div><img src="https://sso.xyafu.edu.cn/sso/img/text.png" alt="标语" class="slogan"><img src="https://www.xyafu.edu.cn/images/logo.png" alt="Logo" class="logo"></div>{% endblock %}<script src="{{ url_for('static', filename='js/scripts.js') }}"></script>
</body>
</html>
chronic.html
<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>数据可视化demo</title><link href="../static/css/common.css" rel="stylesheet"><link href="../static/css/bootstrap.min.css" rel="stylesheet"><link href="../static/css/bootstrap-table.css" rel="stylesheet"><link href="../static/css/pagination.css" rel="stylesheet"><script src="../static/js/Plugin/jquery-3.3.1.min.js"></script><script src="../static/js/Plugin/echarts.min.js"></script><script src="../static/js/Plugin/jquery.pagination.min.js"></script><script src="../static/js/common.js"></script><script src="../static/js/chronic.js"></script>
</head>
<body>
<!--顶部-->
<header class="header left"><div class="left nav"><ul><li class="nav_active"><i class="nav_1"></i><a href="{{ url_for('index') }}">采集概况</a></li><li><i class="nav_2"></i><a href="{{ url_for('quota') }}">指标分析</a></li><li><i class="nav_3"></i><a href="{{ url_for('trend') }}">趋势分析</a></li><li><i class="nav_4"></i><a href="{{ url_for('chronic') }}">慢病病人列表</a></li></ul></div><div class="header_center left" style="position:relative"><h2><strong>大数据展示</strong></h2></div><div class="right nav text_right"><ul></ul></div></header>
<!--内容部分-->
<div class="con left" style="width: 98%;margin-left: 1%;margin-bottom: 25px;"><input type="text" placeholder="请输入姓名身份证" style="width: 180px;height: 28px;border-radius: 3px;text-indent: 1em;border: 1px solid#4b8df8;color: #fff;" /><button class="btn btn-primary btn-sm" style="margin-left:20px"><span class="glyphicon glyphicon-search"></span>查询</button><div class="div_any_child"><div class="table_p" style="height: 96%;margin-top: 20px;"><table><thead><tr><th>序号</th><th>姓名</th><th>慢病</th><th>操作</th></tr></thead><tbody><tr><td>1</td><td>萝卜1</td><td>高血压</td><td><button class="btn btn-primary btn-sm">查看</button></td></tr><tr><td>2</td><td>萝卜2</td><td>糖尿病</td><td><button class="btn btn-primary btn-sm">查看</button></td></tr><tr><td>3</td><td>萝卜3</td><td>高血压</td><td><button class="btn btn-primary btn-sm">查看</button></td></tr><tr><td>4</td><td>萝卜4</td><td>糖尿病</td><td><button class="btn btn-primary btn-sm">查看</button></td></tr><tr><td>5</td><td>萝卜5</td><td>高血压</td><td><button class="btn btn-primary btn-sm">查看</button></td></tr><tr><td>6</td><td>萝卜6</td><td>糖尿病</td><td><button class="btn btn-primary btn-sm">查看</button></td></tr><tr><td>7</td><td>萝卜7</td><td>高血压</td><td><button class="btn btn-primary btn-sm">查看</button></td></tr><tr><td>8</td><td>萝卜8</td><td>糖尿病</td><td><button class="btn btn-primary btn-sm">查看</button></td></tr><tr><td>9</td><td>萝卜9</td><td>高血压</td><td><button class="btn btn-primary btn-sm">查看</button></td></tr><tr><td>10</td><td>萝卜0</td><td>糖尿病</td><td><button class="btn btn-primary btn-sm">查看</button></td></tr></tbody></table></div><div class="box"><div id="pagination" class="page fl"></div></div></div></div>
</div>
</body>
</html>
index.html
<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>数据可视化大屏</title><link href="../static/css/common.css" rel="stylesheet"><script src="../static/js/Plugin/jquery-3.3.1.min.js"></script><script src="https://www.jq22.com/jquery/echarts-4.2.1.min.js"></script><script src="../static/js/Plugin/bmap.min.js"></script><script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=5ieMMexWmzB9jivTq6oCRX9j&callback"></script><script src="../static/js/common.js"></script><script src="../static/js/index.js"></script><script src="../static/js/Plugin/laydate/laydate.js"></script>
</head>
<body>
<!--顶部-->
<header class="header left"><div class="left nav"><ul><li class="nav_active"><i class="nav_1"></i><a href="{{ url_for('index') }}">采集概况</a></li><li><i class="nav_2"></i><a href="{{ url_for('quota') }}">指标分析</a></li><li><i class="nav_3"></i><a href="{{ url_for('trend') }}">趋势分析</a></li><li><i class="nav_4"></i><a href="{{ url_for('chronic') }}">慢病病人列表</a></li></ul></div><div class="header_center left" style="position:relative"><h2><strong>大数据展示</strong></h2></div><div class="right nav text_right"><ul></ul></div></header>
<!--内容部分-->
<div class="con left"><!--数据总概--><div class="con_div"><div class="con_div_text left"><div class="con_div_text01 left"><img src="../static/img/info_1.png" class="left text01_img"/><div class="left text01_div"><p>总采集数据量(G)</p><p>1235</p></div></div><div class="con_div_text01 right"><img src="../static/img/info_2.png" class="left text01_img"/><div class="left text01_div"><p>当月采集数据量(G)</p><p>235</p></div></div></div><div class="con_div_text left"><div class="con_div_text01 left"><img src="../static/img/info_3.png" class="left text01_img"/><div class="left text01_div"><p>总门诊数(人)</p><p class="sky">12356</p></div></div><div class="con_div_text01 right"><img src="../static/img/info_4.png" class="left text01_img"/><div class="left text01_div"><p>当月门诊数(人)</p><p class="sky">12356</p></div></div></div><div class="con_div_text left"><div class="con_div_text01 left"><img src="../static/img/info_5.png" class="left text01_img"/><div class="left text01_div"><p>总住院数(人)</p><p class="org">12356</p></div></div><div class="con_div_text01 right"><img src="../static/img/info_6.png" class="left text01_img"/><div class="left text01_div"><p>当月住院数(人)</p><p class="org">12356</p></div></div></div></div><!--统计分析图--><div class="div_any"><div class="left div_any01"><div class="div_any_child"><div class="div_any_title"><img src="../static/img/title_1.png">各医院采集数据量</div><p id="pieChart1" class="p_chart"></p></div><div class="div_any_child"><div class="div_any_title"><img src="../static/img/title_2.png">各医院门诊住院费用</div><p id="histogramChart" class="p_chart"></p></div></div><div class="div_any02 left "><div class="div_any_child div_height"><div class="div_any_title any_title_width"><img src="../static/img/title_0.png">信阳市地图 </div><div id="mapChart" style="width:97.5%;height:95%;display: inline-block;padding-left: 1.25%;padding-top:2.2%"></div></div></div><div class="right div_any01"><div class="div_any_child"><div class="div_any_title"><img src=../static/img/title_3.png">数据采集条数(当日)</div><p id="lineChart" class="p_chart"></p></div><div class="div_any_child"><div class="div_any_title"><img src="../static/img/title_4.png">就诊人数(当日)</div><p id="lineChart2" class="p_chart"></p></div></div></div><div id="el-dialog" class=""><div class="xc_layer"></div><div class="popBox" id="printView"><div class="ttBox"><span class="tt" id="reportTitle">第一医院</span><img src="../static/img/close.png" style="width: 30px;float: right;cursor: pointer;" title="关闭弹窗" class="close"/></div><div class="txtBox" id="el-dialog_body"><div style="height:100%;width: 98%;margin-left: 1%;"><div class="left div_any01" style="width: 64%;"><div class="div_any_child"><div class="div_any_title"><div type="text" class="demo-input" id="date1" style="display: inline-block;cursor: pointer;margin-right: 16px;"></div><img src="../static/img/title_4.png">门诊住院人次</div><p id="lineChart3" class="p_chart"></p></div><div class="div_any_child"><div class="div_any_title"><div type="text" class="demo-input" id="date2" style="display: inline-block;cursor: pointer;margin-right: 16px;"></div><img src="../static/img/title_7.png">医疗费用</div><p id="lineChart4" class="p_chart"></p></div></div><div class="left div_any01" style="width: 32%;"><div class="div_any_child"><div class="div_any_title"><div type="text" class="demo-input" id="date3" style="display: inline-block;cursor: pointer;margin-right: 16px;"></div><img src="../static/img/title_18.png">病人年龄段分布</div><p id="pieChart2" class="p_chart"></p></div><div class="div_any_child"><div class="div_any_title"><div type="text" class="demo-input" id="date4" style="display: inline-block;cursor: pointer;margin-right: 16px;"></div><img src="../static/img/title_20.png">医疗费用组成</div><p id="pieChart3" class="p_chart"></p></div></div></div></div></div></div><div id="allmap"></div>
</div>
</body>
</html>
login.html
{% extends "base.html" %}
{% block content %}
<h2>登录</h2>
<form method="POST">{{ form.hidden_tag() }}<p>{{ form.username(size=32) }}</p><p>{{ form.password(size=32) }}</p><p>{{ form.submit() }}</p>
</form>
<p>没有账号? <a href="{{ url_for('views.register') }}">注册</a></p>
{% endblock %}
NCDindex.html
<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>慢病展示</title><link href="../static/css/common.css" rel="static/cssheet"><script src="../static/js/Plugin/jquery-3.3.1.min.js"></script><script src="https://www.jq22.com/jquery/echarts-4.2.1.min.js"></script><script src="../static/js/Plugin/bmap.min.js"></script><script src="http://api.map.baidu.com/api?v=2.0&ak=LelFSt6BfykGf8m3PB5zr8LaXAG2cMg6"></script><script src="../static/js/common.js"></script><script src="../static/js/NCDindex.js"></script>
</head>
<body>
<!--顶部-->
<header class="header left"><div class="left nav"><ul><li class="nav_active"><i class="nav_1"></i><a href="index.html">慢病概况</a> </li><li><i class="nav_2"></i><a href="quota.html">指标分析</a> </li><li><i class="nav_3"></i><a href="trend.html">服务预警</a> </li></ul></div><div class="header_center left"><h2><strong>慢病展示</strong></h2></div><div class="right nav text_right"><ul></ul></div></header>
<!--内容部分-->
<div class="con left"><!--数据总概--><div class="con_div"><div class="con_div_text left"><div class="con_div_text01 left"><img src="../static/img/info_1.png" class="left text01_img"/><div class="left text01_div"><p>慢病总人次(人)</p><p>1235</p></div></div><div class="con_div_text01 right"><img src="../static/img/info_2.png" class="left text01_img"/><div class="left text01_div"><p>当月就诊人次(人)</p><p>235</p></div></div></div><div class="con_div_text left"><div class="con_div_text01 left"><img src="../static/img/info_3.png" class="left text01_img"/><div class="left text01_div"><p>总门诊数(人)</p><p class="sky">12356</p></div></div><div class="con_div_text01 right"><img src="../static/img/info_4.png" class="left text01_img"/><div class="left text01_div"><p>当月门诊数(人)</p><p class="sky">12356</p></div></div></div><div class="con_div_text left"><div class="con_div_text01 left"><img src="../static/img/info_5.png" class="left text01_img"/><div class="left text01_div"><p>总住院数(人)</p><p class="org">12356</p></div></div><div class="con_div_text01 right"><img src="../static/img/info_6.png" class="left text01_img"/><div class="left text01_div"><p>当月住院数(人)</p><p class="org">12356</p></div></div></div></div><!--统计分析图--><div class="div_any"><div class="left div_any01"><div class="div_any_child"><div class="div_any_title"><img src="../static/img/title_1.png">慢病分布人次</div><p id="pieChart" class="p_chart"></p></div><div class="div_any_child"><div class="div_any_title"><img src="../static/img/title_2.png">各医院门诊住院费用</div><p id="histogramChart" class="p_chart"></p></div></div><div class="div_any02 left "><div class="div_any_child div_height"><div class="div_any_title any_title_width"><img src="../static/img/title_0.png">厦门市地图 </div><div id="mapChart" style="width:97.5%;height:95%;display: inline-block;padding-left: 1.25%;padding-top:2.2%"></div></div></div><div class="right div_any01"><div class="div_any_child"><div class="div_any_title"><img src="../static/img/title_3.png">数据采集条数(当日)</div><p id="lineChart" class="p_chart"></p></div><div class="div_any_child"><div class="div_any_title"><img src="../static/img/title_4.png">就诊人数(当日)</div><p id="lineChart2" class="p_chart"></p></div></div></div></div>
</body>
</html>
quota.html
<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>数据可视化大屏</title><link href="../static/css/common.css" rel="stylesheet"><script src="../static/js/Plugin/jquery-3.3.1.min.js"></script><script src="https://www.jq22.com/jquery/echarts-4.2.1.min.js"></script><script src="../static/js/Plugin/bmap.min.js"></script><script src="../static/js/common.js"></script><script src="../static/js/quota.js"></script>
</head>
<body>
<!--顶部-->
<header class="header left"><div class="left nav"><ul><li class="nav_active"><i class="nav_1"></i><a href="{{ url_for('index') }}">采集概况</a></li><li><i class="nav_2"></i><a href="{{ url_for('quota') }}">指标分析</a></li><li><i class="nav_3"></i><a href="{{ url_for('trend') }}">趋势分析</a></li><li><i class="nav_4"></i><a href="{{ url_for('chronic') }}">慢病病人列表</a></li></ul></div>><div class="header_center left" style="position:relative"><h2><strong>大数据展示</strong></h2></div><div class="right nav text_right"><ul></ul></div></header>
<!--内容部分-->
<div class="con left"><!--数据总概--><div class="con_div"><div class="con_div_text left"><div class="con_div_text01 left"><img src="../static/img/info_7.png" class="left text01_img"/><div class="left text01_div"><p>全年医疗费用(万元)</p><p>1235</p></div></div><div class="con_div_text01 right"><img src="../static/img/info_8.png" class="left text01_img"/><div class="left text01_div"><p>当月医疗费用(万元)</p><p>235</p></div></div></div><div class="con_div_text left"><div class="con_div_text01 left"><img src="../static/img/info_9.png" class="left text01_img"/><div class="left text01_div"><p>全年体检人数(人)</p><p class="sky">12356</p></div></div><div class="con_div_text01 right"><img src="../static/img/info_10.png" class="left text01_img"/><div class="left text01_div"><p>当月体检人数(人)</p><p class="sky">12356</p></div></div></div><div class="con_div_text left"><div class="con_div_text01 left"><img src="../static/img/info_11.png" class="left text01_img"/><div class="left text01_div"><p>西药占比</p><p class="org">92%</p></div></div><div class="con_div_text01 right"><img src="../static/img/info_12.png" class="left text01_img"/><div class="left text01_div"><p>中药占比</p><p class="org">8%</p></div></div></div></div><!--统计分析图--><div class="div_any"><div class="left div_any01"><div class="div_any_child"><div class="div_any_title"><img src="../static/img/title_5.png">各医院门诊人次(人)</div><p id="histogramChart1" class="p_chart"></p></div><div class="div_any_child"><div class="div_any_title"><img src="../static/img/title_6.png">各医院住院人次(人)</div><p id="histogramChart2" class="p_chart"></p></div></div><div class="left div_any01"><div class="div_any_child"><div class="div_any_title"><img src="../static/img/title_7.png">各医院医疗费用(元)</div><p id="lineChart1" class="p_chart"></p></div><div class="div_any_child"><div class="div_any_title"><img src="../static/img/title_8.png">各医院体检人次(人)</div><p id="lineChart2" class="p_chart"></p></div></div><div class="left div_any01"><div class="div_any_child"><div class="div_any_title"><img src="../static/img/title_9.png">药占比(%)</div><p id="histogramChart3" class="p_chart"></p></div><div class="div_any_child"><div class="div_any_title"><img src="../static/img/title_10.png">平均住院天数(天)</div><p id="histogramChart4" class="p_chart"></p></div></div><div class="left div_any01"><div class="div_any_child"><div class="div_any_title"><img src="../static/img/title_11.png">手术工作量(台)</div><p id="pieChart1" class="p_chart"></p></div><div class="div_any_child"><div class="div_any_title"><img src="../static/img/title_12.png">床位数量分布(床)</div><p id="pieChart2" class="p_chart"></p></div></div></div></div>
</body>
</html>
register.html
{% extends "base.html" %}
{% block content %}
<h2>注册</h2>
<form method="POST">{{ form.hidden_tag() }}<p>{{ form.username(size=32) }}</p><p>{{ form.password(size=32) }}</p><p>{{ form.confirm(size=32) }}</p><p>{{ form.submit() }}</p>
</form>
<p>已有账号? <a href="{{ url_for('views.login') }}">登录</a></p>
{% endblock %}
res.html
<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>Title</title>
</head><body><!-- res.html --><div class="cont-parent"><div class="cont"><div class="form sign-in"><h2>Time to feel like home,</h2><form action="/register" method="post"><label><span>用户名</span><input type="text" name="username" placeholder="Username" required/></label><label><span>密码</span><input type="password" name="password" placeholder="Password" required/></label><button type="submit" class="submit">注册</button></form><button type="button" class="fb-btn">Join with <span>facebook</span></button></div><div class="sub-cont"><div class="img"><div class="img__text m--up"><h2>已经有账号了?</h2><p>那就去<a href="/">登录</a>吧!</p></div></div></div></div></body>
</html>
trend.html
<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>数据可视化大屏</title><link href="../static/css/common.css" rel="stylesheet"><script src="../static/js/Plugin/jquery-3.3.1.min.js"></script><script src="https://www.jq22.com/jquery/echarts-4.2.1.min.js"></script><script src="../static/js/common.js"></script><script src="../static/js/trend.js"></script>
</head>
<body>
<!--顶部-->
<header class="header left"><div class="left nav"><ul><li class="nav_active"><i class="nav_1"></i><a href="{{ url_for('index') }}">采集概况</a></li><li><i class="nav_2"></i><a href="{{ url_for('quota') }}">指标分析</a></li><li><i class="nav_3"></i><a href="{{ url_for('trend') }}">趋势分析</a></li><li><i class="nav_4"></i><a href="{{ url_for('chronic') }}">慢病病人列表</a></li></ul></div><div class="header_center left" style="position:relative"><h2><strong>大数据展示</strong></h2></div><div class="right nav text_right"><ul></ul></div></header>
<!--内容部分-->
<div class="con left" style="width:50%;"><!--统计分析图--><div class="div_any"><div class="left div_any01" style="width:100%;"><div class="div_any_child" style="width:98%;position:relative;height: 420px;"><div class="div_any_title"><img src="../static/img/title_13.png">主要传染病</div><div id="histogramChart1" style="width: 45%;display: inline-block;height: 400px;margin-top: 15px;"></div><div id="lineChart1" style="width: 52%;height: 66%;display: inline-block;"></div><div style="width: 50%;height: 20%;display: inline-block;color:red;position: absolute;right: 2%;top: 8%;"><div style="display: inline-block;width:33%;text-align:center;"><div style="color:#fff;font-size: 18px;line-height: 32px;">病例报告数</div><div style="color:#87cefa;font-size: 30px;line-height: 42px;">2354</div></div><div style="display: inline-block;width:33%;text-align:center;"><div style="color:#fff;font-size: 18px;line-height: 32px;">死亡数</div><div style="color:red;font-size: 30px;line-height: 42px;">26</div></div><div style="display: inline-block;width:33%;text-align:center;"><div style="color:#fff;font-size: 18px;line-height: 32px;">同比发病数趋势</div><div style="color:#ff7f50;font-size: 30px;line-height: 42px;">5.36%</div></div></div></div></div><div class="left div_any01" style="width:48%;"><div class="div_any_child" style="height: 420px;"><div class="div_any_title"><img src="../static/img/title_14.png">主要症状</div><p id="histogramChart2" class="p_chart" style="height: 400px;"></p></div></div><div class="left div_table_box" style="width: 48%;"><div class="div_any_child" style="height: 420px;"><div class="div_any_title"><img src="../static/img/title_16.png">预警信息</div><div class="table_p"><table><thead><tr><th>序号</th><th>内容</th><th>发布时间</th></tr></thead><tbody><tr><td>1</td><td>9月21日感染性腹泻发病:123人次</td><td>2018-11-05</td></tr><tr><td>2</td><td>9月20日流行性感冒:57人次</td><td>2018-11-03</td></tr><tr><td>3</td><td>9月19日:手足口病发病同比增长220%</td><td>2018-11-01</td></tr><tr><td>4</td><td>9月18日登革热死亡:2人</td><td>2018-10-29</td></tr><tr><td>5</td><td>9月17日流行性感冒:157人次</td><td>2018-10-27</td></tr><tr><td>6</td><td>9月15日全区传染病发病人数较低</td><td>2018-10-25</td></tr><tr><td>7</td><td>9月14日流行性感冒:157人次</td><td>2018-10-23</td></tr><tr><td>8</td><td>9月13日全区传染病发病人数较低</td><td>2018-10-21</td></tr><tr><td>9</td><td>9月12日流行性感冒:157人次</td><td>2018-10-20</td></tr></tbody></table></div></div></div></div></div>
</div>
<div class="con right" style="width:50%;"><div class="div_any"><div class="left div_any01" style="width:100%;"><div class="div_any_child" style="width:98%;position:relative;height: 420px;"><div class="div_any_title"><img src="../static/img/title_17.png">主要疾病排行</div><div id="histogramChart3" style="width: 45%;display: inline-block;height: 400px;margin-top: 15px;"></div><div id="lineChart2" style="width: 52%;height: 90%;display: inline-block;"></div></div></div><div class="left div_any01" style="width:48%;"><div class="div_any_child" style="height: 420px;"><div class="div_any_title"><img src="../static/img/title_18.png">年龄分布</div><p id="pieChart1" class="p_chart" style="height: 400px;"></p></div></div><div class="right div_any01" style="width:48%;"><div class="div_any_child" style="height: 420px;"><div class="div_any_title"><img src="../static/img/title_19.png">性别分布</div><p id="pieChart2" class="p_chart" style="height: 400px;"></p></div></div></div>
</div>
</body>
</html>
chronic.js
// 人口增长率与国内生产总值
var lineYear = [2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022];(function () {var myChart = echarts.init(document.querySelector(".line .chart"));var lineOneData = [3.2, 3.4, 3.5, 3.7, 4.02, 4.19, 4.34, 4.56, 4.80,4.98];var lineThreeData = [9.7, 10.1, 10.5, 10.8, 11.4, 11.9, 12.6, 13.5, 14.2, 14.9];var lineTwoData = [136072, 136782, 137462, 138271, 139008, 139538, 140005, 141212, 141260, 141175];option = {tooltip: {trigger: "axis",axisPointer: {// 坐标轴指示器,坐标轴触发有效type: "shadow", // 默认为直线,可选为:'line' | 'shadow'},},grid: {left: "0",right: "4%",bottom: "0%",top: "14%",containLabel: true,},legend: {data: ["全国人口数量(万人)","人口老龄化(%)","养老保险(%)"],right: 1,top: 0,textStyle: {color: "#fff",},},xAxis: {type: "category",data: lineYear,axisLine: {lineStyle: {color: "rgba(255,255,255,0.1)",},},axisLabel: {interval: 0,textStyle: {color: "rgba(255,255,255,.8)",fontSize: transformFontSize(12)},},},yAxis: [{type: "value",axisLine: {show: false,},splitLine: {show: true,lineStyle: {color: "rgba(255,255,255,0.1)",},},axisLabel: {color: "rgba(255,255,255,.8)",fontSize: transformFontSize(12),},},{type: "value",position: "right",axisLine: {show: false,},splitLine: {show: true,lineStyle: {color: "rgba(255,255,255,0.1)",},},axisLabel: {color: "rgba(255,255,255,.8)",fontSize: transformFontSize(12),},formatter: function (value) {return value + '%'}},],series: [{name: "养老保险(%)",type: "line",yAxisIndex: 1,showAllSymbol: true,symbol: "circle",symbolSize: 10,lineStyle: {normal: {color: "#6c50f3",shadowColor: "rgba(0, 0, 0, .3)",shadowBlur: 0,shadowOffsetY: 5,shadowOffsetX: 5,},},itemStyle: {color: "#f65ed0",borderColor: "#f65ed0",borderWidth: 3,shadowColor: "rgba(0, 0, 0, .3)",shadowBlur: 0,shadowOffsetY: 2,shadowOffsetX: 2,},areaStyle: {color: new echarts.graphic.LinearGradient(10,0,0,1,[{offset: 0,color: "rgba(108,80,243,0.3)",},{offset: 1,color: "rgba(108,80,243,0)",},],false),shadowColor: "rgba(108,80,243, 0.9)",shadowBlur: 20,},data: lineOneData,},{name: "人口老龄化(%)",type: "line",yAxisIndex: 1,showAllSymbol: true,symbol: "circle",symbolSize: 10,lineStyle: {normal: {color: "#6c50f3",shadowColor: "rgba(0, 0, 0, .3)",shadowBlur: 0,shadowOffsetY: 5,shadowOffsetX: 5,},},itemStyle: {color: "#6c50f3",borderColor: "#fff",borderWidth: 3,shadowColor: "rgba(0, 0, 0, .3)",shadowBlur: 0,shadowOffsetY: 2,shadowOffsetX: 2,},areaStyle: {color: new echarts.graphic.LinearGradient(10,0,0,1,[{offset: 0,color: "rgba(108,80,243,0.3)",},{offset: 1,color: "rgba(108,80,243,0)",},],false),shadowColor: "rgba(108,80,243, 0.9)",shadowBlur: 20,},data: lineThreeData,},{name: "全国人口数量(万人)",type: "bar",barWidth: "20%",itemStyle: {normal: {color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{offset: 0,color: "#248ff7",},{offset: 1,color: "#6851f1",},]),barBorderRadius: 11,},},data: lineTwoData,},],};// 使用刚指定的配置项和数据显示图表。myChart.setOption(option);window.addEventListener("resize", function () {myChart.resize();});
})();(function () {// 1. 实例化对象var myChart = echarts.init(document.querySelector(".pie .chart"));var barData1 = [12127.3, 7121.2, 327.7, 21127.1, 217.0, 217.5, 5878.1, 548.4,8548.6, 1218.9]var barData2 = [13220, 14491, 15712, 17111, 18322, 19853, 21559, 21210, 24100, 25124]var barData3 = [31.2, 31.0, 30.6, 30.1, 29.3, 28.4, 28.2, 30.2, 29.8, 30.2]yData = [10010078, 484018, 360104, 31018, 10105];option = {tooltip: {trigger: "axis",axisPointer: {// 坐标轴指示器,坐标轴触发有效type: "shadow", // 默认为直线,可选为:'line' | 'shadow'},},grid: {left: "0",right: "4%",bottom: "0%",top: "14%",containLabel: true,},legend: {data: ["劳动力(万人)","消费(万元)","投资(%)"],right: 1,top: 0,textStyle: {color: "#fff",},},xAxis: {type: "category",data: lineYear,axisLine: {lineStyle: {color: "rgba(255,255,255,0.1)",},},axisLabel: {interval: 0,textStyle: {color: "rgba(255,255,255,.8)",fontSize: transformFontSize(12)},},},yAxis: [{type: "value",axisLine: {show: false,},splitLine: {show: true,lineStyle: {color: "rgba(255,255,255,0.1)",},},axisLabel: {color: "rgba(255,255,255,.8)",fontSize: transformFontSize(12),},},{type: "value",position: "right",axisLine: {show: false,},splitLine: {show: true,lineStyle: {color: "rgba(255,255,255,0.1)",},},axisLabel: {color: "rgba(255,255,255,.8)",fontSize: transformFontSize(12),},formatter: function (value) {return value + '%'}},],series: [{name: "消费(万元)",type: "line",yAxisIndex: 1,showAllSymbol: true,symbol: "circle",symbolSize: 10,lineStyle: {normal: {color: "#6c50f3",shadowColor: "rgba(0, 0, 0, .3)",shadowBlur: 0,shadowOffsetY: 5,shadowOffsetX: 5,},},itemStyle: {color: "#f65ed0",borderColor: "#f65ed0",borderWidth: 3,shadowColor: "rgba(0, 0, 0, .3)",shadowBlur: 0,shadowOffsetY: 2,shadowOffsetX: 2,},areaStyle: {color: new echarts.graphic.LinearGradient(10,0,0,1,[{offset: 0,color: "rgba(108,80,243,0.3)",},{offset: 1,color: "rgba(108,80,243,0)",},],false),shadowColor: "rgba(108,80,243, 0.9)",shadowBlur: 20,},data: barData1,},{name: "投资(%)",type: "line",yAxisIndex: 1,showAllSymbol: true,symbol: "circle",symbolSize: 10,lineStyle: {normal: {color: "#6c50f3",shadowColor: "rgba(0, 0, 0, .3)",shadowBlur: 0,shadowOffsetY: 5,shadowOffsetX: 5,},},itemStyle: {color: "#6c50f3",borderColor: "#fff",borderWidth: 3,shadowColor: "rgba(0, 0, 0, .3)",shadowBlur: 0,shadowOffsetY: 2,shadowOffsetX: 2,},areaStyle: {color: new echarts.graphic.LinearGradient(10,0,0,1,[{offset: 0,color: "rgba(108,80,243,0.3)",},{offset: 1,color: "rgba(108,80,243,0)",},],false),shadowColor: "rgba(108,80,243, 0.9)",shadowBlur: 20,},data: barData3,},{name: "劳动力(万人)",type: "bar",barWidth: "20%",itemStyle: {normal: {color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{offset: 0,color: "#248ff7",},{offset: 1,color: "#6851f1",},]),barBorderRadius: 11,},},data: barData2,},],};// 3. 配置项和数据给我们的实例化对象myChart.setOption(option);// 4. 当我们浏览器缩放的时候,图表也等比例缩放window.addEventListener("resize", function () {// 让我们的图表调用 resize这个方法myChart.resize();});
})();// 折线图定制
(function () {var myChart = echarts.init(document.getElementById('echart5'));const scatterOption = ( option = {legend: {orient: 'vertical',itemWidth: 10,itemHeight: 10,textStyle:{color:'rgba(255,255,255,.5)'},top:'20%',right:30,data:['城镇人口','乡村人口']},color: ['#10d8ec','#82e321'],tooltip : {trigger: 'item',formatter: "{b} : {c} ({d}%)"},calculable : true,series: [{name: 'Access From',type: 'pie',radius: '50%',data: [{ value: 92071, name: '城镇人口' },{ value: 49104, name: '乡村人口' },],emphasis: {itemStyle: {shadowBlur: 10,shadowOffsetX: 0,shadowColor: 'rgba(0, 0, 0, 0.5)'}}}]});const barOption = ( option = {legend: {orient: 'vertical',itemWidth: 10,itemHeight: 10,textStyle:{color:'rgba(255,255,255,.5)'},top:'20%',right:30,data:['男性人数','女性人数']},color: ['#5ae755','#f68fb8'],tooltip : {trigger: 'item',formatter: "{b} : {c} ({d}%)"},calculable : true,series: [{name: 'Access From',type: 'pie',radius: '50%',data: [{ value: 72206, name: '男性人数' },{ value: 68969, name: '女性人数' },],emphasis: {itemStyle: {shadowBlur: 10,shadowOffsetX: 0,shadowColor: 'rgba(0, 0, 0, 0.5)'}}}]});let currentOption = scatterOption;myChart.setOption(scatterOption);setInterval(function () {currentOption = currentOption === scatterOption ? barOption : scatterOption;myChart.setOption(currentOption, true);}, 3000);window.addEventListener("resize", function () {myChart.resize();});
})();(function () {var speed = 50;var list = document.getElementById('list');var list2 = document.getElementById('list2');var rule = document.getElementById('rule');list2.innerHTML = list.innerHTML;function Marquee() {if (list2.offsetTop - rule.scrollTop <= 0)rule.scrollTop -= list.offsetHeight;else {rule.scrollTop++;}}var MyMar = setInterval(Marquee, speed);rule.addEventListener('mouseover', function () {clearInterval(MyMar)});rule.addEventListener('mouseout', function () {MyMar = setInterval(Marquee, speed)});
})();function transformFontSize(px) {let clientWidth = window.innerWidth || document.body.clientWidthif (!clientWidth) {return 0}let fontSize = clientWidth / 1920return px * fontSize
}
common.js
function callResourceAdapter(type, url, requestContent, successCallback, failCallback) {if (requestContent == null){requestContent = {};}if (type == null){type = 'POST';}function invocationSuccess(result) {var resultJson = result;if(resultJson.msgCode == '800'){if (successCallback && typeof(successCallback) == "function") {successCallback(resultJson.rows,resultJson.map,resultJson.vo,resultJson.msg);}}if(resultJson.msgCode == '801'){showToast(resultJson.msg);}if(resultJson.msgCode == '900'){var message = '系统错误,请联系管理员';if(resultJson.msg){message = resultJson.msg;}showToast(message);if (failCallback && typeof(failCallback) == "function") {failCallback();}}}function invocationFailure(error) {showToast('无法连接至服务器,请稍后再试');if (failCallback && typeof(failCallback) == "function") {failCallback();}}$.ajax({type: type,url: serverUrl+url,data: JSON.stringify(requestContent),crossDomain:true,contentType: "application/json; charset=utf-8",// dataType: "json",timeout:120000,statusCode:{404: function() {showToast('服务器无响应,请稍后再试')},422: function() {showToast('应用程序请求对象错误,请稍后再试')},403: function() {showToast('无访问权限')},400: function() {showToast('应用程序请求无效,请稍后再试')},},success: function (data, textStatus, jqXHR) {switch (jqXHR.status) {case 200:invocationSuccess(data);break;default:break;}},error: function (jqXHR, textStatus,errorThrown) {invocationFailure(jqXHR);}})}function showToast(text,timeout) {$(".yui-toast-mask").remove();var html = ['<div class="yui-toast-mask">','<div class="yui-toast">','<div class="yui-toast-text">'+text+'</div>','</div>','</div>',];var dom = $(html.join(''));$("body").append(dom);if(timeout&&typeof(timeout)=='number'){setTimeout(function () {dom.remove();},timeout);}$(".yui-toast-mask").click(function () {dom.remove();});}function hideToast() {$(".yui-toast-mask").remove();}function loaderShow() {var loadPage = $('<div class="loading" style="top:30%;left:50%;position: absolute;background: transparent;text-align: center;">' +'<img src="../images/loading.gif" />' +'</div>');$("#content").append(loadPage);}function loaderHide() {$(".loading").remove();}function getLocationDom() {var that = this;var html = "<div id='breadcrumb'>";$.each(LOCATION,function(index,data){if(index==0){html += '<a href="javascript:void(0)" class="tip-bottom"><i class="fa fa-home"></i>'+data+'</a>';return ;}if(index==LOCATION.length-1){html += '<a class="current">'+data+'</a>';return ;}html += "<a href='javascript:void(0)'>"+data+"</a>";});html += "</div>";$("#content-header").html(html);}function getNav(successCallback) {var postNav = [];postNav.push('<li class="submenu" data-for= "home">','<a href="javascript:void(0)"><span>首页</span></a>');postNav.push('<li class="submenu" data-for= "analysis">','<a href="javascript:void(0)"><span>指标统计</span></a>');postNav.push('<li class="submenu" data-for= "trend">','<a href="javascript:void(0)"><span>趋势排名</span></a>');$("#sidebar ul").html(postNav.join(''));if (successCallback&&typeof(successCallback) == 'function'){successCallback();}}function bindNav(navId) {var HEIGHT = $("body").height()-100;$("#content").height(HEIGHT);$(".container-fluid").slimScroll({height: HEIGHT+'px', //容器高度,默认250pxsize: '5px', //滚动条宽度,默认7pxrailColor: '#000000', //滚动条背景轨迹颜色,默认#333333railOpacity: 0.3, //滚动条背景轨迹透明度,默认0.2wheelStep: 10, //滚动条滚动值,默认20disableFadeOut: false //是否禁用鼠标在内容处一定时间不动隐藏滚动条,当设置alwaysVisible为true时该参数无效,默认false});$("#"+navId).delegate("li[data-for='home']","click",function(){window.location.href="home.html"}).delegate("li[data-for='analysis']","click",function(){window.location.href="analysis.html"}).delegate("li[data-for='trend']","click",function(){window.location.href="trend.html"})}function last_year_month() {var list = [];var date = getFormatDate(new Date());var year = date.split("-")[0];var mouth = date.split("-")[1];for (var i=0;i<12;i++){var objM = mouth-i;var objY = year;if(objM<=0){objM = objM+12;objY = year -1;}if(objM<10){objM = "0"+objM;}var obj = objY +"-"+objM;list.push(obj)}return list;}function getFormatDate(date){var year = date.getFullYear();var month = date.getMonth()+1;var day = date.getDate();if(month<10){month = '0'+month.toString();}month = month.toString();if(day<10){day = '0'+day.toString();}day = day.toString();return year+'-'+month+'-'+day;
}function last_month_day() {var list = [];var date = getFormatDate(new Date());var year = date.split("-")[0];var mouth = date.split("-")[1];var day = date.split("-")[2]-1;for (var i=0;i<30;i++){var objM = mouth;var objD = day-i;if(objD<=0){objD = objD+30;objM = mouth -1;objM = "0"+objM}var obj = year+"-"+objM +"-"+objD;list.push(obj)}return list;
}function getFormatMonth(date){var year = date.getFullYear();var month = date.getMonth()+1;var day = date.getDate();if(month<10){month = '0'+month.toString();}month = month.toString();if(day<10){day = '0'+day.toString();}day = day.toString();return year+'-'+month;
}//分页
function paging(totalPage,currentPage) {$("#pagination").pagination({currentPage: currentPage,totalPage: totalPage,isShow: true,count: 8,homePageText: "首页",endPageText: "尾页",prevPageText: "上一页",nextPageText: "下一页",callback: function(current) {$("#current").text(current)}});
}
flexible.js
(function flexible(window, document) {var docEl = document.documentElement;var dpr = window.devicePixelRatio || 1;// adjust body font sizefunction setBodyFontSize() {if (document.body) {document.body.style.fontSize = 12 * dpr + "px";} else {document.addEventListener("DOMContentLoaded", setBodyFontSize);}}setBodyFontSize();// set 1rem = viewWidth / 10function setRemUnit() {var rem = docEl.clientWidth / 24;docEl.style.fontSize = rem + "px";}setRemUnit();// reset rem unit on page resizewindow.addEventListener("resize", setRemUnit);window.addEventListener("pageshow", function(e) {if (e.persisted) {setRemUnit();}});// detect 0.5px supportsif (dpr >= 2) {var fakeBody = document.createElement("body");var testElement = document.createElement("div");testElement.style.border = ".5px solid transparent";fakeBody.appendChild(testElement);docEl.appendChild(fakeBody);if (testElement.offsetHeight === 1) {docEl.classList.add("hairlines");}docEl.removeChild(fakeBody);}
})(window, document);
index.js
var symptomName = last_month_day();$(function(){init();init2();$("#el-dialog").addClass("hide");$(".close").click(function(event) {$("#el-dialog").addClass("hide");});var date = new Date();var numble = date.getDate();var today = getFormatMonth(new Date());$("#date1").html(today);$("#date2").html(today);$("#date3").html(today);$("#date4").html(today);lay('.demo-input').each(function(){laydate.render({type: 'month',elem: this,trigger: 'click',theme: '#95d7fb',calendar: true,showBottom: true,done: function () {console.log( $("#startDate").val())}})});})function init(){//地图var mapChart = echarts.init(document.getElementById('mapChart'));mapChart.setOption({bmap: {center: [114.040,32.080],zoom: 12,roam: true,},tooltip : {trigger: 'item',formatter:function(params, ticket, callback){return params.value[2]}},series: [{type: 'scatter',coordinateSystem: 'bmap',data: [[114.040,32.080, '信阳市'] ,[114.13,32.15, '信阳人民医院'] ,[114.07,32.13, '信阳市中心医院浉河院区'],[114.05,32.13, '信阳一五四医院'],[114.05,32.12, '信阳市第三人民医院'],]}]});mapChart.on('click', function (params) {$("#el-dialog").removeClass('hide');$("#reportTitle").html(params.value[2]);});var bmap = mapChart.getModel().getComponent('bmap').getBMap()bmap.addControl(new BMap.MapTypeControl({mapTypes: [BMAP_NORMAL_MAP,BMAP_SATELLITE_MAP ]}));bmap.setMapStyle({style:'midnight'})var pieChart1 = echarts.init(document.getElementById('pieChart1'));pieChart1.setOption({color:["#87cefa","#ff7f50","#32cd32","#da70d6",],legend: {y : '260',x : 'center',textStyle : {color : '#ffffff',},data : ['信阳第一医院','信阳中山医院','信阳中医院','信阳第五医院',],},tooltip : {trigger: 'item',formatter: "{a}<br/>{b}<br/>{c}G ({d}%)"},calculable : false,series : [{name:'采集数据量',type:'pie',radius : ['40%', '70%'],center : ['50%', '45%'],itemStyle : {normal : {label : {show : false},labelLine : {show : false}},emphasis : {label : {show : true,position : 'center',textStyle : {fontSize : '20',fontWeight : 'bold'}}}},data:[{value:335, name:'信阳第一医院'},{value:310, name:'信阳中山医院'},{value:234, name:'信阳中医院'},{value:135, name:'信阳第五医院'}]}]});var lineChart = echarts.init(document.getElementById('lineChart'));lineChart.setOption({color:["#87cefa","#ff7f50","#32cd32","#da70d6",],legend: {y : '260',x : 'center',textStyle : {color : '#ffffff',},data : ['信阳第一医院','信阳中山医院','信阳中医院','信阳第五医院',],},calculable : false,tooltip : {trigger: 'item',formatter: "{a}<br/>{b}<br/>{c}条"},yAxis: [{type: 'value',axisLine : {onZero: false},axisLine:{lineStyle:{color: '#034c6a'},},axisLabel: {textStyle: {color: '#fff'},formatter: function (value) {return value + "k条"},},splitLine:{lineStyle:{width:0,type:'solid'}}}],xAxis: [{type: 'category',data : ['8:00','10:00','12:00','14:00','16:00','18:00','20:00','22:00'],axisLine:{lineStyle:{color: '#034c6a'},},splitLine: {"show": false},axisLabel: {textStyle: {color: '#fff'},formatter: function (value) {return value + ""},},splitLine:{lineStyle:{width:0,type:'solid'}},}],grid:{left: '5%',right: '5%',bottom: '20%',containLabel: true},series : [{name:'信阳第一医院',type:'line',smooth:true,itemStyle: {normal: {lineStyle: {shadowColor : 'rgba(0,0,0,0.4)'}}},data:[15, 0, 20, 45, 22.1, 25, 70, 55, 76]},{name:'信阳中山医院',type:'line',smooth:true,itemStyle: {normal: {lineStyle: {shadowColor : 'rgba(0,0,0,0.4)'}}},data:[25, 10, 30, 55, 32.1, 35, 80, 65, 76]},{name:'信阳中医院',type:'line',smooth:true,itemStyle: {normal: {lineStyle: {shadowColor : 'rgba(0,0,0,0.4)'}}},data:[35, 20, 40, 65, 42.1, 45, 90, 75, 96]},{name:'信阳第五医院',type:'line',smooth:true,itemStyle: {normal: {lineStyle: {shadowColor : 'rgba(0,0,0,0.4)'}}},data:[45, 30, 50, 75, 52.1, 55, 100, 85, 106]}]});var histogramChart = echarts.init(document.getElementById('histogramChart'));histogramChart.setOption({color:["#87cefa","#ff7f50","#32cd32","#da70d6",],legend: {y : '250',x : 'center',data:['信阳第一医院', '信阳中山医院','信阳中医院','信阳第五医院'],textStyle : {color : '#ffffff',}},calculable :false,grid:{left: '5%',right: '5%',bottom: '20%',containLabel: true},tooltip : {trigger: 'axis',axisPointer : {type : 'shadow'}},xAxis : [{type : 'value',axisLabel: {show: true,textStyle: {color: '#fff'}},splitLine:{lineStyle:{color:['#f2f2f2'],width:0,type:'solid'}}}],yAxis : [{type : 'category',data:['门诊人数(人)', '住院人次(人)','人均费用(元)'],axisLabel: {show: true,textStyle: {color: '#fff'}},splitLine:{lineStyle:{width:0,type:'solid'}}}],series : [{name:'信阳第一医院',type:'bar',stack: '总量',itemStyle : { normal: {label : {show: true, position: 'insideRight'}}},data:[320, 302, 301]},{name:'信阳中山医院',type:'bar',stack: '总量',itemStyle : { normal: {label : {show: true, position: 'insideRight'}}},data:[120, 132, 101]},{name:'信阳中医院',type:'bar',stack: '总量',itemStyle : { normal: {label : {show: true, position: 'insideRight'}}},data:[220, 182, 191]},{name:'信阳第五医院',type:'bar',stack: '总量',itemStyle : { normal: {label : {show: true, position: 'insideRight'}}},data:[150, 212, 201]}]});var lineChart2 = echarts.init(document.getElementById('lineChart2'));lineChart2.setOption({color:["#87cefa","#ff7f50","#32cd32","#da70d6",],legend: {y : '260',x : 'center',textStyle : {color : '#ffffff',},data : ['信阳第一医院','信阳中山医院','信阳中医院','信阳第五医院',],},calculable : false,tooltip : {trigger: 'item',formatter: "{a}<br/>{b}<br/>{c}条"},yAxis: [{type: 'value',axisLine : {onZero: false},axisLine:{lineStyle:{color: '#034c6a'},},axisLabel: {textStyle: {color: '#fff'},formatter: function (value) {return value + "k条"},},splitLine:{lineStyle:{width:0,type:'solid'}}}],xAxis: [{type: 'category',data : ['8:00','10:00','12:00','14:00','16:00','18:00'],axisLine:{lineStyle:{color: '#034c6a'},},splitLine: {"show": false},axisLabel: {textStyle: {color: '#fff'},formatter: function (value) {return value + ""},},splitLine:{lineStyle:{width:0,type:'solid'}},}],grid:{left: '5%',right: '5%',bottom: '20%',containLabel: true},series : [{name:'信阳第一医院',type:'line',smooth:true,itemStyle: {normal: {lineStyle: {shadowColor : 'rgba(0,0,0,0.4)'}}},data:[15, 0, 20, 45, 22.1, 25,].reverse()},{name:'信阳中山医院',type:'line',smooth:true,itemStyle: {normal: {lineStyle: {shadowColor : 'rgba(0,0,0,0.4)'}}},data:[25, 10, 30, 55, 32.1, 35, ].reverse()},{name:'信阳中医院',type:'line',smooth:true,itemStyle: {normal: {lineStyle: {shadowColor : 'rgba(0,0,0,0.4)'}}},data:[35, 20, 40, 65, 42.1, 45, ].reverse()},{name:'信阳第五医院',type:'line',smooth:true,itemStyle: {normal: {lineStyle: {shadowColor : 'rgba(0,0,0,0.4)'}}},data:[45, 30, 50, 75, 52.1, 55, 6].reverse()}]});}function init2(){var lineChart3 = echarts.init(document.getElementById('lineChart3'));lineChart3.setOption({color:["#87cefa","#ff7f50",],legend: {y : 'top',x : 'center',textStyle : {color : '#ffffff',},data : ['门诊人次','住院人次'],},calculable : false,tooltip : {trigger: 'item',formatter: "{a}<br/>{b}<br/>{c}人"},dataZoom: {show: true,realtime : true,start: 0,end: 18,height: 20,backgroundColor: '#f8f8f8',dataBackgroundColor: '#e4e4e4',fillerColor: '#87cefa',handleColor: '#87cefa',},yAxis: [{type: 'value',axisLine : {onZero: false},axisLine:{lineStyle:{color: '#034c6a'},},axisLabel: {textStyle: {color: '#fff'},formatter: function (value) {return value + "人"},},splitLine:{lineStyle:{width:0,type:'solid'}}}],xAxis: [{type: 'category',data : symptomName,boundaryGap : false,axisLine:{lineStyle:{color: '#034c6a'},},splitLine: {"show": false},axisLabel: {textStyle: {color: '#fff'},formatter: function (value) {return value + ""},},splitLine:{lineStyle:{width:0,type:'solid'}},}],grid:{left: '5%',right: '5%',bottom: '20%',containLabel: true},series : [{name:'门诊费用',type:'line',smooth:true,itemStyle: {normal: {lineStyle: {shadowColor : 'rgba(0,0,0,0.4)'}}},data:[1150, 180, 2100, 2415, 1212.1, 3125,1510, 810, 2100, 2415, 1122.1, 3215,1510, 801, 2001, 2245, 1232.1, 3245,1520, 830, 2200, 2145, 1223.1, 3225,150, 80, 200, 245, 122.1, 325]},{name:'住院费用',type:'line',smooth:true,itemStyle: {normal: {lineStyle: {shadowColor : 'rgba(0,0,0,0.4)'}}},data:[2500, 1000, 3000, 5005, 3200.1, 3005, 2500, 1000, 3000, 5005, 3200.1, 3005,2500, 1000, 3000, 5005, 3200.1, 3005,2500, 1000, 3000, 5005, 3200.1, 3005, 2500, 1000, 3000, 5005, 3200.1, 3005,2500, 1000, 3000, 5005, 3200.1, 3005,]},]});var lineChart4 = echarts.init(document.getElementById('lineChart4'));lineChart4.setOption({color:["#87cefa","#ff7f50",],calculable : false,tooltip : {trigger: 'item',formatter: "{a}<br/>{b}<br/>{c}元"},dataZoom: {show: true,realtime : true,start: 0,end: 18,height: 20,backgroundColor: '#f8f8f8',dataBackgroundColor: '#e4e4e4',fillerColor: '#87cefa',handleColor: '#87cefa',},yAxis: [{type: 'value',axisLine : {onZero: false},axisLine:{lineStyle:{color: '#034c6a'},},axisLabel: {textStyle: {color: '#fff'},formatter: function (value) {return value + "元"},},splitLine:{lineStyle:{width:0,type:'solid'}}}],xAxis: [{type: 'category',data : symptomName,boundaryGap : false,axisLine:{lineStyle:{color: '#034c6a'},},splitLine: {"show": false},axisLabel: {textStyle: {color: '#fff'},formatter: function (value) {return value + ""},},splitLine:{lineStyle:{width:0,type:'solid'}},}],grid:{left: '5%',right: '5%',bottom: '20%',containLabel: true},series : [{name:'医疗费用',type:'line',smooth:true,itemStyle: {normal: {lineStyle: {shadowColor : 'rgba(0,0,0,0.4)'}}},data:[1500, 800, 1200, 2450, 1122.1, 1325,1150, 180, 1200, 1245, 1122.1, 1325,150, 180, 1200, 2145, 1212.1, 3215,1510, 180, 2100, 2415, 122.1, 325,150, 80, 200, 245, 122.1, 325].reverse()},]});//年龄分布var pieChart2 = echarts.init(document.getElementById('pieChart2'));pieChart2.setOption({color:["#32cd32","#ff7f50","#87cefa","#FD6C88","#4b5cc4","#faff72"],tooltip : {trigger: 'item',formatter: "{a}<br/>{b}<br/>{c}人"},calculable : true,series : [{name:'发病人数',type:'pie',radius : [30, 110],center : ['50%', '50%'],roseType : 'area',x: '50%',sort : 'ascending',data:[{value:10, name:'婴儿(1-3岁)'},{value:5, name:'少儿(4-10岁)'},{value:15, name:'少年(10-18岁)'},{value:25, name:'青年(18-45岁)'},{value:125, name:'中年(45-60岁)'},{value:175, name:'老年(60岁以上)'},]}]})//医疗费用组成var pieChart3 = echarts.init(document.getElementById('pieChart3'));pieChart3.setOption({color:["#32cd32","#ff7f50","#87cefa","#FD6C88","#4b5cc4","#faff72"],tooltip : {trigger: 'item',formatter: "{a}<br/>{b}<br/>{c}元"},calculable : true,series : [{name:'发病人数',type:'pie',radius : [30, 110],center : ['50%', '50%'],roseType : 'area',x: '50%',sort : 'ascending',data:[{value:10, name:'诊察费用'},{value:500, name:'检查费用'},{value:150, name:'检验费用'},{value:250, name:'西药费用'},{value:125, name:'中药费用'},{value:1750, name:'手术费用'},]}]})
}
myMap.js
(function () {// 1. 实例化对象var myChart = echarts.init(document.querySelector(".map .chart"));// 2. 指定配置和数据// 2. 指定配置和数据var geoCoordMap = {台湾: [121.5135, 25.0308],黑龙江: [127.9688, 45.368],内蒙古: [110.3467, 41.4899],吉林: [125.8154, 44.2584],北京市: [116.4551, 40.2539],辽宁: [123.1238, 42.1216],河北: [114.4995, 38.1006],天津: [117.4219, 39.4189],山西: [112.3352, 37.9413],陕西: [109.1162, 34.2004],甘肃: [103.5901, 36.3043],宁夏: [106.3586, 38.1775],青海: [101.4038, 36.8207],新疆: [87.9236, 43.5883],西藏: [91.11, 29.97],四川: [103.9526, 30.7617],重庆: [108.384366, 30.439702],山东: [117.1582, 36.8701],河南: [113.4668, 34.6234],江苏: [118.8062, 31.9208],安徽: [117.29, 32.0581],湖北: [114.3896, 30.6628],浙江: [119.5313, 29.8773],福建: [119.4543, 25.9222],江西: [116.0046, 28.6633],湖南: [113.0823, 28.2568],贵州: [106.6992, 26.7682],云南: [102.9199, 25.4663],广东: [113.12244, 23.009505],广西: [108.479, 23.1152],海南: [110.3893, 19.8516],上海: [121.4648, 31.2891],};var MapData = [[{ name: "北京市" }, { name: "上海", value: 35089, value1: 19084, value2: 16005 }],[{ name: "天津" }, { name: "海南", value: 22642, value1: 11367, value2: 11275 }],[{ name: "天津" }, { name: "上海", value: 22642, value1: 11367, value2: 11275 }],[{ name: "河北" }, { name: "上海", value: 125526, value1: 70281, value2: 55245 }],[{ name: "山西" }, { name: "上海", value: 118384, value1: 67058, value2: 51326 }],[{ name: "内蒙古" }, { name: "上海", value: 47163, value1: 23820, value2: 23343 }],[{ name: "辽宁" }, { name: "江苏", value: 122922, value1: 59869, value2: 63053 }],[{ name: "吉林" }, { name: "上海", value: 105841, value1: 51627, value2: 54214 }],[{ name: "黑龙江" }, { name: "上海", value: 165644, value1: 79481, value2: 86163 }],[{ name: "江苏" }, { name: "上海", value: 1798258, value1: 1009157, value2: 789101 }],[{ name: "浙江" }, { name: "安徽", value: 515614, value1: 264405, value2: 251209 }],[{ name: "安徽" }, { name: "上海", value: 2426484, value1: 1337217, value2: 1089267 }],[{ name: "福建" }, { name: "河南", value: 294823, value1: 161641, value2: 133182 }],[{ name: "江西" }, { name: "河南", value: 502200, value1: 276599, value2: 225601 }],[{ name: "山东" }, { name: "上海", value: 501181, value1: 293389, value2: 207792 }],[{ name: "河南" }, { name: "山东", value: 1342950, value1: 800170, value2: 542780 }],[{ name: "湖北" }, { name: "上海", value: 417652, value1: 220363, value2: 197289 }],[{ name: "湖南" }, { name: "重庆", value: 237535, value1: 121332, value2: 116203 }],[{ name: "广东" }, { name: "上海", value: 122677, value1: 67666, value2: 55011 }],[{ name: "广西" }, { name: "广东", value: 84654, value1: 43041, value2: 41613 }],[{ name: "海南" }, { name: "上海", value: 18140, value1: 9090, value2: 9050 }],[{ name: "重庆" }, { name: "上海", value: 189139, value1: 101670, value2: 87469 }],[{ name: "四川" }, { name: "新疆", value: 517464, value1: 276427, value2: 241037 }],[{ name: "贵州" }, { name: "上海", value: 188738, value1: 104324, value2: 84414 }],[{ name: "云南" }, { name: "上海", value: 139168, value1: 78497, value2: 60671 }],[{ name: "西藏" }, { name: "云南", value: 2649, value1: 990, value2: 1659 }],[{ name: "陕西" }, { name: "西藏", value: 185178, value1: 105779, value2: 79399 }],[{ name: "甘肃" }, { name: "上海", value: 178139, value1: 99794, value2: 78345 }],[{ name: "青海" }, { name: "甘肃", value: 12732, value1: 6473, value2: 6259 }],[{ name: "宁夏" }, { name: "上海", value: 16861, value1: 9046, value2: 7815 }],[{ name: "新疆" }, { name: "上海", value: 44205, value1: 19434, value2: 24771 }],[{ name: "新疆" }, { name: "宁夏", value: 44205, value1: 19434, value2: 24771 }],]var planePath ="path://M1705.06,1318.313v-89.254l-319.9-221.799l0.073-208.063c0.521-84.662-26.629-121.796-63.961-121.491c-37.332-0.305-64.482,36.829-63.961,121.491l0.073,208.063l-319.9,221.799v89.254l330.343-157.288l12.238,241.308l-134.449,92.931l0.531,42.034l175.125-42.917l175.125,42.917l0.531-42.034l-134.449-92.931l12.238-241.308L1705.06,1318.313z";//var planePath = 'arrow';var convertData = function (data) {var fromCoord = geoCoordMap[data[0].name];var toCoord = geoCoordMap[data[1].name];return [{fromName: data[0].name,toName: data[1].name,coords: [fromCoord, toCoord],value: data[1].value,value1: data[1].value1,value2: data[1].value2,}];};var series = [];MapData.forEach(function (item, i) {series.push({name: item[0].name,type: "lines",zlevel: 1,effect: {show: true,period: 6,trailLength: 0.7,color: "red", //arrow箭头的颜色symbolSize: 3},lineStyle: {normal: {color: "#fff",width: 0,curveness: 0.2}},data: convertData(item)},{name: item[0].name,type: "lines",zlevel: 2,symbol: ["none", "arrow"],symbolSize: 10,effect: {show: true,period: 6,trailLength: 0,symbol: planePath,symbolSize: 15},lineStyle: {normal: {color: "#fff",width: 1,opacity: 0.6,curveness: 0.2}},data: convertData(item)},{name: item[0].name,type: "effectScatter",coordinateSystem: "geo",zlevel: 2,rippleEffect: {brushType: "stroke"},label: {normal: {show: true,position: "right",formatter: "{b}"}},symbolSize: 10,itemStyle: {normal: {color: "#fff"},emphasis: {areaColor: "#2B91B7"}},data: [{ name: item[0].name, value: geoCoordMap[item[0].name], code: item[1].value, code1: item[1].value1, code2: item[1].value2 }]});});var option = {tooltip: {trigger: "item",formatter: function (params, ticket, callback) {if (params.seriesType == "effectScatter") {return params.data.name + ":" + params.data.code + '人' + '<br />' + '男:' + params.data.code1 + '<br />' + '女:' + params.data.code2;} else if (params.seriesType == "lines") {return (params.data.fromName +" > " +params.data.toName +":" +params.data.value + '人' + '<br />' + '男:' + params.data.value1 + '<br />' + '女:' + params.data.value2);} else {return params.name;}}},geo: {map: "china",label: {emphasis: {show: true,color: "#fff"}},roam: false,// 放大我们的地图zoom: 1.1,itemStyle: {normal: {areaColor: "rgba(43, 196, 243, 0.42)",borderColor: "rgba(43, 196, 243, 1)",borderWidth: 1},emphasis: {areaColor: "#2B91B7"}}},series: series};myChart.setOption(option);window.addEventListener("resize", function () {myChart.resize();});
})();
NCDindex.js
var symptomName = last_month_day();$(function(){init();})
function init(){//地图var mapChart = echarts.init(document.getElementById('mapChart'));mapChart.setOption({bmap: {center: [118.096435,24.485408],zoom: 12,roam: true,},tooltip : {trigger: 'item',formatter:function(params, ticket, callback){return params.value[2]}},series: [{type: 'scatter',coordinateSystem: 'bmap',data: [[118.096435, 24.485408, '信阳市'] ,[118.094564, 24.457358, '信阳第一医院'] ,[118.104103, 24.477761, '信阳中山医院'],[118.14748, 24.506295, '信阳中医院'],[118.254841, 24.665349, '信阳第五医院'],]}]});mapChart.on('click', function (params) {console.log(params.value[2])// $("#hospitalName").html(params.value[2]);// if(params.value[2] == '信阳市'){// $("#Data").html(100);// $("#Outpatient").html(20000);// $("#Hospitalization").html(3000);// }// if(params.value[2] == '信阳第一医院'){// $("#Data").html(40);// $("#Outpatient").html(8000);// $("#Hospitalization").html(1200);// }// if(params.value[2] == '信阳中山医院'){// $("#Data").html(30);// $("#Outpatient").html(6000);// $("#Hospitalization").html(900);// }// if(params.value[2] == '信阳中医院'){// $("#Data").html(20);// $("#Outpatient").html(4000);// $("#Hospitalization").html(600);// }// if(params.value[2] == '信阳第五医院'){// $("#Data").html(10);// $("#Outpatient").html(2000);// $("#Hospitalization").html(300);// }});var bmap = mapChart.getModel().getComponent('bmap').getBMap()bmap.addControl(new BMap.MapTypeControl({mapTypes: [BMAP_NORMAL_MAP,BMAP_SATELLITE_MAP ]}));bmap.setMapStyle({style:'midnight'})var pieChart = echarts.init(document.getElementById('pieChart'));pieChart.setOption({color:["#87cefa","#ff7f50","#32cd32","#da70d6","#FD6C88"],legend: {y : '260',x : 'center',textStyle : {color : '#ffffff',},data : ['高血压','糖尿病','脑卒中','慢阻肺','慢性肾病'],},tooltip : {trigger: 'item',formatter: "{a}<br/>{b}<br/>{c}G ({d}%)"},calculable : false,series : [{name:'采集数据量',type:'pie',radius : ['40%', '70%'],center : ['50%', '45%'],itemStyle : {normal : {label : {show : false},labelLine : {show : false}},emphasis : {label : {show : true,position : 'center',textStyle : {fontSize : '20',fontWeight : 'bold'}}}},data:[{value:335, name:'高血压'},{value:310, name:'糖尿病'},{value:234, name:'脑卒中'},{value:135, name:'慢阻肺'},{value:235, name:'慢性肾病'}]}]});var lineChart = echarts.init(document.getElementById('lineChart'));lineChart.setOption({color:["#87cefa","#ff7f50","#32cd32","#da70d6",],legend: {y : '260',x : 'center',textStyle : {color : '#ffffff',},data : ['信阳第一医院','信阳中山医院','信阳中医院','信阳第五医院',],},calculable : false,tooltip : {trigger: 'item',formatter: "{a}<br/>{b}<br/>{c}条"},yAxis: [{type: 'value',axisLine : {onZero: false},axisLine:{lineStyle:{color: '#034c6a'},},axisLabel: {textStyle: {color: '#fff'},formatter: function (value) {return value + "k条"},},splitLine:{lineStyle:{width:0,type:'solid'}}}],xAxis: [{type: 'category',data : ['8:00','10:00','12:00','14:00','16:00','18:00','20:00','22:00'],axisLine:{lineStyle:{color: '#034c6a'},},splitLine: {"show": false},axisLabel: {textStyle: {color: '#fff'},formatter: function (value) {return value + ""},},splitLine:{lineStyle:{width:0,type:'solid'}},}],grid:{left: '5%',right: '5%',bottom: '20%',containLabel: true},series : [{name:'信阳第一医院',type:'line',smooth:true,itemStyle: {normal: {lineStyle: {shadowColor : 'rgba(0,0,0,0.4)'}}},data:[15, 0, 20, 45, 22.1, 25, 70, 55, 76]},{name:'信阳中山医院',type:'line',smooth:true,itemStyle: {normal: {lineStyle: {shadowColor : 'rgba(0,0,0,0.4)'}}},data:[25, 10, 30, 55, 32.1, 35, 80, 65, 76]},{name:'信阳中医院',type:'line',smooth:true,itemStyle: {normal: {lineStyle: {shadowColor : 'rgba(0,0,0,0.4)'}}},data:[35, 20, 40, 65, 42.1, 45, 90, 75, 96]},{name:'信阳第五医院',type:'line',smooth:true,itemStyle: {normal: {lineStyle: {shadowColor : 'rgba(0,0,0,0.4)'}}},data:[45, 30, 50, 75, 52.1, 55, 100, 85, 106]}]});var histogramChart = echarts.init(document.getElementById('histogramChart'));histogramChart.setOption({color:["#87cefa","#ff7f50","#32cd32","#da70d6",],legend: {y : '250',x : 'center',data:['信阳第一医院', '信阳中山医院','信阳中医院','信阳第五医院'],textStyle : {color : '#ffffff',}},calculable :false,grid:{left: '5%',right: '5%',bottom: '20%',containLabel: true},tooltip : {trigger: 'axis',axisPointer : {type : 'shadow'}},xAxis : [{type : 'value',axisLabel: {show: true,textStyle: {color: '#fff'}},splitLine:{lineStyle:{color:['#f2f2f2'],width:0,type:'solid'}}}],yAxis : [{type : 'category',data:['门诊人数(人)', '住院人次(人)','人均费用(元)'],axisLabel: {show: true,textStyle: {color: '#fff'}},splitLine:{lineStyle:{width:0,type:'solid'}}}],series : [{name:'信阳第一医院',type:'bar',stack: '总量',itemStyle : { normal: {label : {show: true, position: 'insideRight'}}},data:[320, 302, 301]},{name:'信阳中山医院',type:'bar',stack: '总量',itemStyle : { normal: {label : {show: true, position: 'insideRight'}}},data:[120, 132, 101]},{name:'信阳中医院',type:'bar',stack: '总量',itemStyle : { normal: {label : {show: true, position: 'insideRight'}}},data:[220, 182, 191]},{name:'信阳第五医院',type:'bar',stack: '总量',itemStyle : { normal: {label : {show: true, position: 'insideRight'}}},data:[150, 212, 201]}]});var lineChart2 = echarts.init(document.getElementById('lineChart2'));lineChart2.setOption({color:["#87cefa","#ff7f50","#32cd32","#da70d6",],legend: {y : '260',x : 'center',textStyle : {color : '#ffffff',},data : ['信阳第一医院','信阳中山医院','信阳中医院','信阳第五医院',],},calculable : false,tooltip : {trigger: 'item',formatter: "{a}<br/>{b}<br/>{c}条"},yAxis: [{type: 'value',axisLine : {onZero: false},axisLine:{lineStyle:{color: '#034c6a'},},axisLabel: {textStyle: {color: '#fff'},formatter: function (value) {return value + "条"},},splitLine:{lineStyle:{width:0,type:'solid'}}}],xAxis: [{type: 'category',data : ['8:00','10:00','12:00','14:00','16:00','18:00'],axisLine:{lineStyle:{color: '#034c6a'},},splitLine: {"show": false},axisLabel: {textStyle: {color: '#fff'},formatter: function (value) {return value + ""},},splitLine:{lineStyle:{width:0,type:'solid'}},}],grid:{left: '5%',right: '5%',bottom: '20%',containLabel: true},series : [{name:'信阳第一医院',type:'line',smooth:true,itemStyle: {normal: {lineStyle: {shadowColor : 'rgba(0,0,0,0.4)'}}},data:[15, 0, 20, 45, 22.1, 25,].reverse()},{name:'信阳中山医院',type:'line',smooth:true,itemStyle: {normal: {lineStyle: {shadowColor : 'rgba(0,0,0,0.4)'}}},data:[25, 10, 30, 55, 32.1, 35, ].reverse()},{name:'信阳中医院',type:'line',smooth:true,itemStyle: {normal: {lineStyle: {shadowColor : 'rgba(0,0,0,0.4)'}}},data:[35, 20, 40, 65, 42.1, 45, ].reverse()},{name:'信阳第五医院',type:'line',smooth:true,itemStyle: {normal: {lineStyle: {shadowColor : 'rgba(0,0,0,0.4)'}}},data:[45, 30, 50, 75, 52.1, 55, 6].reverse()}]});}
quota.js
$(function(){init();})
function init(){var myColor = ['#1089E7', '#F57474', '#56D0E3', '#F8B448', '#8B78F6'];//各医院门诊人次var histogramChart1 = echarts.init(document.getElementById('histogramChart1'));histogramChart1.setOption({grid: {top: '20%',left: '32%'},xAxis: {show: false},yAxis: [{show: true,data: ['信阳第一医院','信阳中山医院','信阳中医院','信阳第五医院',],inverse: true,axisLine: {show: false},splitLine: {show: false},axisTick: {show: false},axisLabel: {color: '#fff',formatter: (value, index) => {return [`{lg|${index+1}} ` + '{title|' + value + '} '].join('\n')},rich: {lg: {backgroundColor: '#339911',color: '#fff',borderRadius: 15,// padding: 5,align: 'center',width: 15,height: 15},}},}, {show: true,inverse: true,data: [4000, 3000, 2000, 1000],axisLabel: {textStyle: {fontSize: 12,color: '#fff',},},axisLine: {show: false},splitLine: {show: false},axisTick: {show: false},}],series: [{name: '条',type: 'bar',yAxisIndex: 0,data: [40, 30, 20, 10],barWidth: 10,itemStyle: {normal: {barBorderRadius: 20,color: function(params) {var num = myColor.length;return myColor[params.dataIndex % num]},}},label: {normal: {show: true,position: 'inside',formatter: '{c}%'}},}, {name: '框',type: 'bar',yAxisIndex: 1,barGap: '-100%',data: [100, 100, 100, 100],barWidth: 15,itemStyle: {normal: {color: 'none',borderColor: '#00c1de',borderWidth: 3,barBorderRadius: 15,}}}, ]})//各医院住院人次var histogramChart2 = echarts.init(document.getElementById('histogramChart2'));histogramChart2.setOption({grid: {top: '20%',left: '32%'},xAxis: {show: false},yAxis: [{show: true,data: ['信阳第一医院','信阳中山医院','信阳中医院','信阳第五医院',],inverse: true,axisLine: {show: false},splitLine: {show: false},axisTick: {show: false},axisLabel: {color: '#fff',formatter: (value, index) => {return [`{lg|${index+1}} ` + '{title|' + value + '} '].join('\n')},rich: {lg: {backgroundColor: '#339911',color: '#fff',borderRadius: 15,// padding: 5,align: 'center',width: 15,height: 15},}},}, {show: true,inverse: true,data: [2200, 2400, 2600, 2800],axisLabel: {textStyle: {fontSize: 12,color: '#fff',},},axisLine: {show: false},splitLine: {show: false},axisTick: {show: false},}],series: [{name: '条',type: 'bar',yAxisIndex: 0,data: [22, 24, 26, 28],barWidth: 10,itemStyle: {normal: {barBorderRadius: 20,color: function(params) {var num = myColor.length;return myColor[params.dataIndex % num]},}},label: {normal: {show: true,position: 'inside',formatter: '{c}%'}},}, {name: '框',type: 'bar',yAxisIndex: 1,barGap: '-100%',data: [100, 100, 100, 100],barWidth: 15,itemStyle: {normal: {color: 'none',borderColor: '#00c1de',borderWidth: 3,barBorderRadius: 15,}}}, ]})//手术工作量var pieChart1 = echarts.init(document.getElementById('pieChart1'));pieChart1.setOption({color:["#87cefa","#ff7f50","#32cd32","#da70d6",],tooltip : {trigger: 'item',formatter: "{a}<br/>{b}<br/>{c}台"},calculable : true,series : [{name:'手术工作量',type:'pie',radius : [30, 110],center : ['50%', '50%'],roseType : 'area',x: '50%',max: 40,sort : 'ascending',data:[{value:10, name:'信阳第一医院'},{value:5, name:'信阳中山医院'},{value:15, name:'信阳中医院'},{value:25, name:'信阳第五医院'},]}]})//医疗费用var lineChart1 = echarts.init(document.getElementById('lineChart1'));lineChart1.setOption( {color:["#87cefa","#ff7f50","#32cd32","#da70d6",],tooltip : {trigger: 'item',formatter: "{a}<br/>{b}<br/>{c}元"},legend: {data:['信阳第一医院','信阳中山医院','信阳中医院','信阳第五医院',],y: 'bottom',x:'center',textStyle:{color:'#fff',fontSize:12}},grid:{left: '5%',right: '5%',bottom: '10%',containLabel: true},calculable : true,xAxis : [{type : 'category',boundaryGap : false,data : ['周一','周二','周三','周四','周五','周六','周日'],axisLine:{lineStyle:{color: '#87cefa'},},axisLabel : {interval:0,rotate:40,textStyle: {color: '#fff',fontSize:13}}}],yAxis : [{type : 'value',axisLine:{lineStyle:{color: '#87cefa'},},splitLine: {"show": false},axisLabel: {textStyle: {color: '#fff'},formatter: function (value) {return value + "元"},},}],series : [{name:'信阳第一医院',type:'line',smooth:true,itemStyle: {normal: {areaStyle: {type: 'default'}}},data:[10, 12, 21, 54, 260, 830, 710]},{name:'信阳中山医院',type:'line',smooth:true,itemStyle: {normal: {areaStyle: {type: 'default'}}},data:[30, 182, 434, 791, 390, 30, 10]},{name:'信阳中医院',type:'line',smooth:true,itemStyle: {normal: {areaStyle: {type: 'default'}}},data:[1320, 1132, 601, 234, 120, 90, 20]},{name:'信阳第五医院',type:'line',smooth:true,itemStyle: {normal: {areaStyle: {type: 'default'}}},data:[320, 132, 61, 34, 20, 9, 2]}]})//体检人次var lineChart2 = echarts.init(document.getElementById('lineChart2'));lineChart2.setOption( {color:["#87cefa","#ff7f50","#32cd32","#da70d6",],tooltip : {trigger: 'item',formatter: "{a}<br/>{b}<br/>{c}人"},legend: {data:['信阳第一医院','信阳中山医院','信阳中医院','信阳第五医院',],y: 'bottom',x:'center',textStyle:{color:'#fff',fontSize:12}},grid:{left: '5%',right: '5%',bottom: '10%',containLabel: true},calculable : true,xAxis : [{type : 'category',boundaryGap : false,data : ['周一','周二','周三','周四','周五','周六','周日'],axisLine:{lineStyle:{color: '#87cefa'},},axisLabel : {interval:0,rotate:40,textStyle: {color: '#fff',fontSize:13}}}],yAxis : [{type : 'value',axisLine:{lineStyle:{color: '#87cefa'},},splitLine: {"show": false},axisLabel: {textStyle: {color: '#fff'},formatter: function (value) {return value + "人"},},}],series : [{name:'信阳第一医院',type:'line',smooth:true,itemStyle: {normal: {areaStyle: {type: 'default'}}},data:[120, 122, 221, 524, 460, 530, 610]},{name:'信阳中山医院',type:'line',smooth:true,itemStyle: {normal: {areaStyle: {type: 'default'}}},data:[130, 682, 534, 691, 490, 130, 110]},{name:'信阳中医院',type:'line',smooth:true,itemStyle: {normal: {areaStyle: {type: 'default'}}},data:[320, 132, 161, 134, 112, 190, 120]},{name:'信阳第五医院',type:'line',smooth:true,itemStyle: {normal: {areaStyle: {type: 'default'}}},data:[320, 132, 461, 34, 202, 93, 222]}]})//床位数量分布var pieChart2 = echarts.init(document.getElementById('pieChart2'));pieChart2.setOption({color:["#87cefa","#ff7f50","#32cd32","#da70d6",],tooltip : {trigger: 'item',formatter: "{a}<br/>{b}<br/>{c}床"},calculable : true,series : [{name:'床位数量分布',type:'pie',radius : [30, 110],center : ['45%', '50%'],roseType : 'area',x: '50%',max: 40,sort : 'ascending',data:[{value:700, name:'信阳第一医院'},{value:500, name:'信阳中山医院'},{value:105, name:'信阳中医院'},{value:250, name:'信阳第五医院'},]}]})//药占比var histogramChart3 = echarts.init(document.getElementById('histogramChart3'));histogramChart3.setOption( {color:['#87cefa'],grid:{left: '5%',right: '5%',bottom: '5%',containLabel: true},tooltip : {trigger: 'item',formatter: "{a}<br/>{b}<br/>{c}%"},calculable : true,xAxis : [{type : 'category',data : ['信阳第一医院','信阳中山医院','信阳中医院','信阳第五医院',],axisLine:{lineStyle:{color: '#87cefa'},},axisLabel : {interval:0,rotate:40,textStyle: {color: '#fff',fontSize:13}}}],yAxis : [{type : 'value',axisLine:{lineStyle:{color: '#87cefa'},},splitLine: {"show": false},axisLabel: {textStyle: {color: '#fff'},formatter: function (value) {return value + "%"},},}],series : [{name:'药占比',type:'bar',barWidth:30,data:[60,80,70,50],},]});//平均住院天数var histogramChart4 = echarts.init(document.getElementById('histogramChart4'));histogramChart4.setOption( {color:['#87cefa'],grid:{left: '5%',right: '5%',bottom: '5%',containLabel: true},tooltip : {trigger: 'item',formatter: "{a}<br/>{b}<br/>{c}天"},calculable : true,xAxis : [{type : 'category',data : ['信阳第一医院','信阳中山医院','信阳中医院','信阳第五医院',],axisLine:{lineStyle:{color: '#87cefa'},},axisLabel : {interval:0,rotate:40,textStyle: {color: '#fff',fontSize:13}}}],yAxis : [{type : 'value',axisLine:{lineStyle:{color: '#87cefa'},},splitLine: {"show": false},axisLabel: {textStyle: {color: '#fff'},formatter: function (value) {return value + "天"},},}],series : [{name:'平均住院天数',type:'bar',barWidth:30,data:[6,8,7,5],},]});}
scripts.js
document.addEventListener('DOMContentLoaded', function() {// 获取 Flash 消息的容器var flashMessages = document.getElementById('flash-messages');// 检查 Flash 消息是否存在if (flashMessages) {// 设置一个 3 秒后执行的定时器setTimeout(function() {// 隐藏 Flash 消息flashMessages.style.display = 'none';}, 3000); // 3000 毫秒 = 3 秒}
});
trend.js
var symptomName = last_year_month();$(function(){init();})function init(){var myColor = ['#1089E7', '#F57474', '#56D0E3', '#F8B448', '#8B78F6'];//主要传染病var histogramChart1 = echarts.init(document.getElementById('histogramChart1'));histogramChart1.setOption({color:['#5bc0de'],grid:{left: '5%',right: '5%',bottom: '5%',containLabel: true},tooltip : {trigger: 'item',formatter: "{a}<br/>{b}<br/>{c}人"},calculable : true,xAxis : [{type : 'category',data : ['感染性腹泻','流行性感冒','登革热','手足口病','水痘','流行性眼腺炎','猩红热','甲型病毒性肝炎','疟疾'],axisLine:{lineStyle:{color: '#5bc0de'},},axisLabel : {interval:0,rotate:40,textStyle: {color: '#fff'}}}],yAxis : [{type : 'value',axisLine:{lineStyle:{color: '#5bc0de'},},splitLine: {"show": false},axisLabel: {textStyle: {color: '#fff'},formatter: function (value) {return value + ""},},}],series : [{name:'主要传染病',type:'bar',barWidth : 20,data:[2210,1085,926,669,634,452,412,312,156],},]})//主要症状var histogramChart2 = echarts.init(document.getElementById('histogramChart2'));histogramChart2.setOption({color:['#FD6C88'],grid:{left: '5%',right: '5%',bottom: '10%',containLabel: true},tooltip : {trigger: 'item',formatter: "{a}<br/>{b}<br/>{c}人"},calculable : true,yAxis : [{type : 'category',data : ['腹痛、腹胀、腹泻','恶心、呕吐、食欲不振','肌肉酸痛、乏力','持续高烧','头痛、眼眶痛、肌肉疼','皮疹、水泡','呼吸浅促','发热、咳嗽、流口水'],axisLine:{lineStyle:{color: '#FD6C88'},},axisLabel : {textStyle: {color: '#fff'}}}],xAxis : [{type : 'value',axisLine:{lineStyle:{color: '#FD6C88'},},splitLine: {"show": false},axisLabel: {textStyle: {color: '#fff'},formatter: function (value) {return value + ""},},}],series : [{name:'主要症状',type:'bar',barWidth : 20,data:[1750,1416,1136,819,704,413,251,175],},]})//传染病发病趋势var lineChart1 = echarts.init(document.getElementById('lineChart1'));lineChart1.setOption({title: {text: '传染病趋势',textStyle:{fontSize:16,color:'#ff7f50'},},color:["#ff7f50"],grid:{left: '15%',right: '5%',bottom: '15%',},tooltip : {trigger: 'item',formatter: "{a}<br/>{b}<br/>{c}人"},calculable : true,yAxis: [{type: 'value',axisLine:{lineStyle:{color: '#ff7f50'},},splitLine: {"show": false},axisLabel: {textStyle: {color: '#fff'},formatter: function (value) {return value + ""},},}],xAxis: [{type: 'category',data : symptomName,boundaryGap : false,axisLine:{lineStyle:{color: '#ff7f50'},},splitLine: {"show": false},axisLabel: {// interval:0,// rotate:40,textStyle: {color: '#fff'},formatter: function (value) {return value + ""},},}],series : [{name:'传染病人数',type:'line',smooth:true,itemStyle: {normal: {areaStyle: {type: 'default'}}},data:[120, 132, 101, 134, 90, 230, 210,120, 132, 101, 134, 90]},]})//主要疾病排行var histogramChart3 = echarts.init(document.getElementById('histogramChart3'));histogramChart3.setOption({grid: {top: '12%',left: '30%'},xAxis: {show: false},yAxis: [{show: true,data: ['抑郁症','高血压','痔疮','肺癌','子宫肌瘤 ','乙肝','水痘','肺结核'],inverse: true,axisLine: {show: false},splitLine: {show: false},axisTick: {show: false},axisLabel: {color: '#fff',formatter: (value, index) => {return [`{lg|${index+1}} ` + '{title|' + value + '} '].join('\n')},rich: {lg: {backgroundColor: '#339911',color: '#fff',borderRadius: 15,// padding: 5,align: 'center',width: 15,height: 15},}},}, {show: true,inverse: true,data: [2000, 1800, 1200, 1100,900,900,800,700],axisLabel: {textStyle: {fontSize: 12,color: '#fff',},},axisLine: {show: false},splitLine: {show: false},axisTick: {show: false},}],series: [{name: '条',type: 'bar',yAxisIndex: 0,data: [20,18,12,11,9,9,8,7],barWidth: 10,itemStyle: {normal: {barBorderRadius: 20,color: function(params) {var num = myColor.length;return myColor[params.dataIndex % num]},}},label: {normal: {show: true,position: 'inside',formatter: '{c}%'}},}, {name: '框',type: 'bar',yAxisIndex: 1,barGap: '-100%',data: [100, 100, 100, 100,100, 100, 100, 100],barWidth: 15,itemStyle: {normal: {color: 'none',borderColor: '#00c1de',borderWidth: 1,barBorderRadius: 15,}}}, ]})//疾病发病趋势var lineChart2 = echarts.init(document.getElementById('lineChart2'));lineChart2.setOption({title: {text: '疾病发病趋势',textStyle:{fontSize:16,color:'#32cd32'},x:"center"},color:["#32cd32"],grid:{left: '15%',right: '5%',bottom: '25%',},tooltip : {trigger: 'item',formatter: "{a}<br/>{b}<br/>{c}人"},calculable : true,yAxis: [{type: 'value',axisLine:{lineStyle:{color: '#32cd32'},},splitLine: {"show": false},axisLabel: {textStyle: {color: '#fff'},formatter: function (value) {return value + ""},},}],xAxis: [{type: 'category',data : symptomName,boundaryGap : false,axisLine:{lineStyle:{color: '#32cd32'},},splitLine: {"show": false},axisLabel: {// interval:0,// rotate:40,textStyle: {color: '#fff'},formatter: function (value) {return value + ""},},}],series : [{name:'疾病发病人数',type:'line',smooth:true,itemStyle: {normal: {areaStyle: {type: 'default'}}},data:[520, 232,701, 434, 190, 230, 210,120, 132, 101, 134, 890]},]})//年龄分布var pieChart1 = echarts.init(document.getElementById('pieChart1'));pieChart1.setOption({color:["#32cd32","#ff7f50","#87cefa","#FD6C88","#4b5cc4","#faff72"],tooltip : {trigger: 'item',formatter: "{a}<br/>{b}<br/>{c}人"},calculable : true,series : [{name:'发病人数',type:'pie',radius : [30, 110],center : ['50%', '50%'],roseType : 'area',x: '50%',sort : 'ascending',data:[{value:10, name:'婴儿(1-3岁)'},{value:5, name:'少儿(4-10岁)'},{value:15, name:'少年(10-18岁)'},{value:25, name:'青年(18-45岁)'},{value:125, name:'中年(45-60岁)'},{value:175, name:'老年(60岁以上)'},]}]})//性别分布var labelFromatter = {normal : {label : {position : 'center',formatter : function (params){console.log(params)if(params.name == "女性"){return "女性"+":"+(params.percent + '%')}else{return "男性"+":"+(params.percent + '%')}},},labelLine : {show : false}},};var pieChart2 = echarts.init(document.getElementById('pieChart2'));pieChart2.setOption({color: ['#87cefa','#FD6C88'],tooltip : {trigger: 'item',formatter: "{b}({c})<br/>{d}%"},series : [{type : 'pie',center : ['50%', '50%'],radius : [55, 95],x: '0%', // for funnelitemStyle : labelFromatter,data : [{name:'男性', value:158},{name:'女性', value:142},]},],})}
效果展示
注册信息会生成到对应的数据库中
完整代码连接
https://download.csdn.net/download/weixin_66547608/90392925https://download.csdn.net/download/weixin_66547608/90392925https://download.csdn.net/download/weixin_66547608/90392925
从安装软件到flask框架搭建可视化大屏(一)——创建一个flask页面,零基础也可以学会-CSDN博客https://blog.csdn.net/weixin_66547608/article/details/145669546?sharetype=blogdetail&sharerId=145669546&sharerefer=PC&sharesource=weixin_66547608&spm=1011.2480.3001.8118
相关文章:
从安装软件到flask框架搭建可视化大屏(二)——创建一个flask页面,搭建可视化大屏,零基础也可以学会
附录:所有文件的完整代码 models.py # models/models.py from flask_sqlalchemy import SQLAlchemydb SQLAlchemy()class User(db.Model):__tablename__ user # 显式指定表名为 userid db.Column(db.Integer, primary_keyTrue)username db.Column(db.String(…...
Python编程中,async/await/asyncio分别是干啥的?
在Python异步编程中,async、await和asyncio是三个核心概念。它们共同构成了Python处理高并发I/O密集型任务的解决方案。本文将通过代码实例解析它们的作用和用法。 一、异步编程基础 1.1 同步 vs 异步 同步编程:代码按顺序执行,遇到I/O操作(如网络请求、文件读写)时会阻塞…...
vue非组件的初学笔记
1.创建Vue实例,初始化渲染的核心 准备容器引包创建Vue实例new Vue() el用来指定控制的盒子data提供数据 2.插值表达式 作用利用表达式插值,将数据渲染到页面中 格式{{表达式}} 注意点 表达式的数据要在data中存在表达式是可计算结果的语句插值表达式…...
4.3 学习UVM中的“run_phase“,将其应用到具体案例分为几步?
文章目录 前言1. run_phase 的作用与执行特点2. 关键组件的 run_phase 实现2.1 Driver 的 run_phase:驱动事务2.2 Monitor 的 run_phase:捕获事务2.3 Scoreboard 的 run_phase:数据比对 3. 同步与 Objection 管理3.1 控制仿真结束3.2 多组件协…...
[Python人工智能] 五十.PyTorch入门 (5)快速搭建神经网络及模型保存
从本专栏开始,作者正式研究Python深度学习、神经网络及人工智能相关知识。前文讲解PyTorch构建分类神经网络。这篇文章将介绍如何利用PyTorch快速构建神经网络,之前的代码比较复杂,通过自定义Net类实现,本文通过Torch函数定义神经网络。前面我们的Python人工智能主要以Tens…...
【C语言】有序数组的平方
文章目录 给你一个按非递减顺序排序的整数数组 nums,返回每个数字的平方组成的新数组,要求也按非递减顺序排序。 #include<stdio.h>/*** brief 计算一个整数数组的平方,并按非递减顺序存放结果* * 该函数接受一个整数数组arr和其长度le…...
osgearth视点坐标及鼠标交点坐标的信息显示(七)
核心函数如下: void COSGObject::addViewPointLabel() {//mRoot->addChild(osgEarth::Util::Controls::ControlCanvas::get(mViewer));//放开这句,球就卡住了。 为什么,shitosgEarth::Util::Controls::ControlCanvas* canvas = osgEarth::Util::Controls::ControlCanvas…...
【096】基于51单片机红外线人数统计系统【Proteus仿真+Keil程序+报告+原理图】
☆、设计硬件组成:51单片机最小系统LCD1602液晶显示两路E18-D80NK红外线传感器DS1302时钟芯片AT24C02存储芯片蜂鸣器LED灯按键设置。 1、设计采用STC89C52、AT89C52、AT89S52作为主控芯片; 2、采用DS1302时钟芯片实现对日期和时间的计时,并…...
【ENSP】链路聚合的两种模式
【ENSP】链路聚合的两种模式 1、背景介绍2、链路聚合的使用场景3、配置过程1、手工模式Eth-Trunk配置2、静态LACP模式Eth-Trunk 4、总结 1、背景介绍 随着网络规模的不断扩大,人们对骨干链路的带宽吞吐量和可靠性提出了越来越高的要求。在传统方案中,为…...
机器学习_17 K近邻算法知识点总结
K近邻算法(K-Nearest Neighbors,KNN)是一种简单而直观的机器学习算法,广泛应用于分类和回归任务。它通过寻找训练集中与新样本最接近的K个样本(近邻)来进行预测。今天,我们就来深入探讨K近邻算法…...
Web 后端 请求与响应
一 请求响应 1. 请求(Request) 客户端向服务器发送的HTTP请求,通常包含以下内容: 请求行:HTTP方法(GET/POST等)、请求的URL、协议版本。 请求头(Headers):…...
网络工程师 (44)ARP协议
前言 ARP协议,即地址解析协议(Address Resolution Protocol),是一种网络协议,主要用于将网络层的IPv4地址(逻辑地址)解析为链路层的物理地址(通常是MAC地址)。 一、基本概…...
使用verilog 实现 cordic 算法 ----- 旋转模式
1-设计流程 ● 了解cordic 算法原理,公式,模式,伸缩因子,旋转方向等,推荐以下链接视频了解 cordic 算法。哔哩哔哩-cordic算法原理讲解 ● 用matlab 或者 c 实现一遍算法 ● 在FPGA中用 verilog 实现,注意…...
搜狗浏览器卸载教程
需求背景 今天发现geek居然无法卸载搜狗浏览器,作为一个老司机,这是不允许的。如果你使用geek或者windows的卸载,或者直接在它的安装包的Uninstall.exe中卸载,他走到100%就一直不动了。那玩意是假的。 卸载教程 结束 -----华丽的…...
ES7 (ES2016) 新特性
目录 Array.prototype.includes()指数运算符与 ES6 的对比实际应用场景最佳实践 Array.includes() 基本语法 array.includes(searchElement[, fromIndex])特点 返回布尔值可以检测 NaN支持可选的 fromIndex 参数比 indexOf() 更语义化 使用示例 const numbers [1, 2, 3…...
设计模式13:职责链模式
系列总链接:《大话设计模式》学习记录_net 大话设计-CSDN博客 1.概述 职责链模式(Chain of Responsibility Pattern)是一种行为设计模式,它允许将请求沿着处理者链传递,直到有一个处理者能够处理该请求。这种模式通过…...
MongoDB between ... and ... 操作
个人博客地址:MongoDB between ... and ... 操作 | 一张假钞的真实世界 MongoDB中类似SQL的between and操作可以采用如下语法: db.collection.find( { field: { $gt: value1, $lt: value2 } } );...
Ubuntu 下 nginx-1.24.0 源码分析 - ngx_alloc函数
ngx_alloc 声明在 src\os\unix\ngx_alloc.h 中: void *ngx_alloc(size_t size, ngx_log_t *log); 定义在 src\os\unix\ngx_alloc.c 中: void * ngx_alloc(size_t size, ngx_log_t *log) {void *p;p malloc(size);if (p NULL) {ngx_log_error(NGX_LOG_…...
总结:Helm 命令详解
文章目录 1. Helm 概述2. Helm 的安装与配置2.1 安装 Helm2.2 验证安装 3、Helm 的常用命令3.1 查看帮助3.2 查看 Chart 列表3.3 安装 Chart3.4 卸载 Chart3.5 升级 Chart3.6 回滚 Chart3.7 查看 Chart 详细信息3.8 查看 Chart 的模板3.9 查看 Chart 的值3.10 管理仓库 4. Helm…...
通俗诠释 DeepSeek-V3 模型的 “671B” ,“37B”与 “128K”,用生活比喻帮你理解模型的秘密!
欢迎来到涛涛聊AI。 在DeepSeek-V3模型的参数描述中,你可能会看到类似“671B 37B 128K”这样的标记。这些字母和数字的组合看起来像密码,但其实它们揭示了模型的“大脑容量”和“工作方式”。我们用日常生活的比喻来解释: 一、数字含义&…...
【鸿蒙ArcTS】TypeScript学习记录:函数类型声明与箭头函数
普通函数 function add(x: number, y: number): number {return x y; } 完整未省略版本 const add: (x: number, y: number) > void//函数类型(x: number, y: number): void > {//函数定义console.log("object"); };函数类型: type trigFunc…...
基于 Python 和 Django 的北极星招聘数据可视化系统(附源码,部署)
博主介绍:✌程序员徐师兄、7年大厂程序员经历。全网粉丝12w、csdn博客专家、掘金/华为云/阿里云/InfoQ等平台优质作者、专注于Java技术领域和毕业项目实战✌ 🍅文末获取源码联系🍅 👇🏻 精彩专栏推荐订阅👇…...
机器学习_18 K均值聚类知识点总结
K均值聚类(K-means Clustering)是一种经典的无监督学习算法,广泛应用于数据分组、模式识别和降维等领域。它通过将数据划分为K个簇,使得簇内相似度高而簇间相似度低。今天,我们就来深入探讨K均值聚类的原理、实现和应用…...
LTE参数
RSRP(Reference Singnal Received Power,参考信号接收功率) 是终端接收到的小区公共参考信号(CRS)功率值,数值为测量带宽内单个RE功率的线性平均值,反映的是本小区有用信号的强度。 SINR(SignaltoInterference&Noise Ratio,…...
Word写论文常用操作的参考文章
1.插入多个引用文献:word中交叉引用多篇参考文献格式[1-2]操作以及显示错误问题 更改左域名,输入 \#"[0" 更改右域名,输入 \#"0]" 2.插入题注:word 中添加图片题注、目录、内部链接 3.插入公式编号&#x…...
kubectl exec 实现的原理
kubectl exec 是 Kubernetes 提供的一个命令,它允许你在指定的 Pod 中执行命令,类似于在容器中打开一个终端会话。这个功能对于调试、监控和管理容器化应用非常有用。kubectl exec 的实现涉及到多个 Kubernetes 组件和机制,包括 API Server、…...
apache artemis安装
安装apache artemis https://xxzkid.github.io/2025/apache-artemis-install...
驱动开发、移植(最后的说法有误,以后会修正)
一、任务明确:把创龙MX8的驱动 按照我们的要求 然后移植到 我们的板子 1.Linux系统启动卡制作, sd卡 先按照 《用户手册—3-2-Linux系统启动卡制作及系统固化》 把创龙的Linux系统刷进去。 2. 把TLIMX8-EVM的板子过一遍 把刚刚烧好系统的sd卡插入 创…...
算法12-贪心算法
一、贪心算法概念 贪心算法(Greedy Algorithm)是一种在每一步选择中都采取当前状态下最优的选择,从而希望导致全局最优解的算法。贪心算法的核心思想是“局部最优,全局最优”,即通过一系列局部最优选择,最…...
Docker容器化 | 超简单部署 FireCrawl
灵感来源 【RAG实战】Docker容器化 🔥 FireCrawl | 基于docker-compose.yaml一键运行的网页解析API 参考仓库地址 建议给大佬点点star,这么简单的教程非常实用 测试环境 ubuntu 24.04 可能要安装的依赖 sudo apt install docker-buildx拉取FireCra…...
从入门到精通:Postman 实用指南
Postman 是一款超棒的 API 开发工具,能用来测试、调试和管理 API,大大提升开发效率。下面就给大家详细讲讲它的安装、使用方法,再分享些实用技巧。 一、安装 Postman 你能在 Postman 官网(https://www.postman.com )下…...
yolo11s rknn无法detect的bugfix - step by step
1.缘起 上周四下班时,发现在宿主机环境工作良好的既有的pytorch模型,在通过.pt->.onnx->.rknn的转换后无法正常工作。周五下班时,怀疑疑点在两处: 版本匹配问题通道和参数传递问题。 周六,周日,周…...
把 CSV 文件摄入到 Elasticsearch 中 - CSVES
在我们之前的很多文章里,我有讲到这个话题。在今天的文章中,我们就提重谈。我们使用一种新的方法来实现。这是一个基于 golang 的开源项目。项目的源码在 https://github.com/githubesson/csves/。由于这个原始的代码并不支持 basic security 及带有安全…...
尚硅谷爬虫note008
一、handler处理器 定制更高级的请求头 # _*_ coding : utf-8 _*_ # Time : 2025/2/17 08:55 # Author : 20250206-里奥 # File : demo01_urllib_handler处理器的基本使用 # Project : PythonPro17-21# 导入 import urllib.request from cgitb import handler# 需求ÿ…...
MongoDB数据导出工具mongoexport
个人博客地址:MongoDB数据导出工具mongoexport | 一张假钞的真实世界 导出示例: $ mongoexport --host 192.168.72.60 --db realtime_statistic_backup --collection all_play_stats_summary --fields "_id.timestamp,total_uv" --type csv …...
机器学习数学基础:29.t检验
t检验学习笔记 一、t检验的定义和用途 t检验是统计学中常用的假设检验方法,主要用于判断样本均值与总体均值间,或两个样本均值间是否存在显著差异。 在实际中应用广泛,例如在医学领域可用于比较两种药物的疗效;在教育领域&…...
Lineageos 22.1(Android 15) 编译隐藏API的 android.jar
一、前言 有时候会我们开发系统应用需要一些系统的方法或者属性之类的,但是被隐藏导致无法正常显示,因为SDK提供的android.jar被隐藏了,所以只能看到sourcecode,实际上编译是会报错的,比如: 一般这种无法是两种,直接添加一个类,同包名同类名,或者依赖framework.jar,可以骗过…...
floodfill算法系列一>扫雷游戏
目录 题目思路:代码设计:代码呈现: 题目思路: 代码设计: 代码呈现: class Solution {int m,n;int[] dx {0,0,-1,1,-1,-1,1,1};int[] dy {-1,1,0,0,-1,1,-1,1};public char[][] updateBoard(char[][] boa…...
2011年下半年软件设计师考试上午题真题的详细知识点分类整理(附真题及答案解析)
以下是针对2011年下半年软件设计师考试上午题真题的详细知识点分类整理,涵盖所有题目涉及的核心知识点,供考生背诵记忆: 1. 数据结构与算法 树与图: 树的性质:树的节点数、深度、叶子节点数之间的关系。二叉树遍历&am…...
算法基础 -- Fenwick树的实现原理
线段树与Fenwick树详解及C语言实现 线段树简介 线段树(Segment Tree)是一种二叉树结构,主要用于在数组修改的同时,快速进行区间查询。常见应用包括区间求和、区间最小值、区间最大值等。 线段树的特点 时间复杂度:…...
萌新学 Python 之集合 set
集合 set:使用一对大括号,元素写在大括号之间,使用逗号分隔 集合中的元素只能是不可变的数据类型,不能是列表、字典和集合 set1 {1, 2, 3} set2 {1, a, (1, 2, 3)} print(type(set1), type(set2)) # <class set> <c…...
(4)ENVI-guide的设置
1 General Settings 打开ENVI-guide,设置你的模拟时间,模拟名称以及输出文件所在位置 注意,选择多核心和单核运行的方式是 1)如果只有一个模拟,并且需要尽快输出,并且运行文件的电脑可以暂时不需要进行其他…...
Golang学习笔记_32——适配器模式
Golang学习笔记_29——抽象工厂模式 Golang学习笔记_30——建造者模式 Golang学习笔记_31——原型模式 文章目录 一、核心概念二、模式结构三、模式特点四、实现方式对比五、适用场景六、与其他模式的对比1. 与装饰器模式2. 与外观模式3. 与创建型模式(工厂/原型&am…...
python知识和项目经验
一些功能的实现 从.py文件中获取函数对象和参数 的字典 在给定的Python脚本中,通过模块导入和反射机制,如何动态获取包含模型函数的模块中的函数及其默认参数,并构建一个字典以便后续使用? 解决方案 test.py # test.py impor…...
【自学笔记】版本控制与持续集成基础知识点总览-持续更新
提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档 文章目录 版本控制与持续集成基础知识点总览版本控制(Version Control)1. 版本控制简介2. 常用版本控制系统3. Git基础4. Git进阶 持续集成࿰…...
云平台结合DeepSeek的AI模型优化实践:技术突破与应用革新
目录 前言 一、技术架构:算力与算法的协同基石 1. 蓝耘平台的核心优势 2. DeepSeek的模型创新 二、应用场景:垂直领域的智能化落地 1. 商业领域:智能推荐与客服 2. 工业领域:质检与流程优化 3. 智慧城市与医…...
DockerFile优化镜像体积
title: DockerFile优化镜像体积 date: 2025-02-15 15:22:40 tags: DockerFile优化镜像体积DockerFile优化镜像体积 DockerFile优化镜像体积前文回顾:一、细数优化镜像体积的思路与方式二、优化Dockfile文件编辑 Dockerfile2文件三、构建镜像四、运行镜像五、查看运行效果原文 …...
WeMos D1+PIR+Android 的小场景制作
最近在做一个有趣的小场景功能,其实已经有成熟产品,但是考虑到没法实现场景扩展,所以自己开始动手做。 场景描述:玄关人体感应,有人进门,致欢迎词,有人离开,致欢送词。 硬件设备&a…...
实现pytorch注意力机制-one demo
主要组成部分: 1. 定义注意力层: 定义一个Attention_Layer类,接受两个参数:hidden_dim(隐藏层维度)和is_bi_rnn(是否是双向RNN)。 2. 定义前向传播: 定义了注意力层的…...
使用循环队列来接收串口信息--以stm32f103为例
一、引言 在stm32中,一般采用的是通过数组来接收串口信息,但是由于受到数组大小的限制,易出现数据覆盖或者数据溢出问题。针对上述问题,采用循环队列的方式来接收串口信息,循环队列可以动态管理缓冲区并且当队列满时&a…...