赞
踩
博主介绍:✌全网粉丝10W+,前互联网大厂软件研发、集结硕博英豪成立工作室。专注于计算机相关专业毕业设计项目实战6年之久,选择我们就是选择放心、选择安心毕业✌感兴趣的可以先收藏起来,点赞、关注不迷路✌
毕业设计:2023-2024年计算机毕业设计1000套(建议收藏)
毕业设计:2023-2024年最新最全计算机专业毕业设计选题汇总
Python语言、Django框架、Echarts可视化、HTML
用户注册、管理员注册、用户界面、管理员界面、垃圾分类可视化
(1)垃圾分类可视化----图表展示
(2)垃圾回收点管理
(3)添加垃圾回收点
(4)投放垃圾记录
(5)注册登录界面
(6)后台数据管理
(7)垃圾类型管理
垃圾分类管理可视化系统是一个集成了多种现代技术,如Python语言、Django框架、Echarts可视化和HTML,旨在提升垃圾分类效率和用户体验的先进系统。以下是对该系统的详细介绍:
系统概述
该系统通过用户友好的界面,实现垃圾分类信息的可视化展示和高效管理。用户和管理员均可通过该系统完成垃圾分类、回收点管理、投放记录查看等一系列操作,极大地提高了垃圾分类的便捷性和管理效率。
功能模块
垃圾分类可视化(图表展示):利用Echarts可视化库,将垃圾分类信息以图表形式直观展示,帮助用户快速了解各类垃圾的分布和处理情况。
垃圾回收点管理:系统支持对垃圾回收点的添加、编辑和删除操作,确保回收点信息的准确性和实时性。
添加垃圾回收点:管理员可根据实际情况,在系统中添加新的垃圾回收点,并设置相关属性,如位置、容量等。
投放垃圾记录:系统实时记录用户投放垃圾的信息,包括投放时间、地点、垃圾类型等,为后续的垃圾分类和处理提供数据支持。
注册登录界面:提供用户和管理员的注册和登录功能,确保系统的安全性和用户信息的准确性。
后台数据管理:管理员可通过后台管理系统,查看和编辑用户信息、垃圾回收点信息、投放记录等,实现数据的全面管理。
垃圾类型管理:系统支持对垃圾类型的添加、编辑和删除操作,确保垃圾类型信息的准确性和完整性。
技术实现
该系统采用Python语言作为开发语言,利用Django框架搭建后端系统,实现数据的处理和存储。前端界面则采用HTML和Echarts可视化库进行开发,实现数据的可视化展示和用户交互。
总之,垃圾分类管理可视化系统是一个集现代化技术于一体的先进系统,通过直观的可视化展示和高效的数据管理,为垃圾分类工作提供了强大的支持。
# 分析所有的投放记录 def manage_analysis(request): if request.method == "GET": commons = Common.objects.all() # 把所有用户查询出来 records = Throw.objects.all() # 把所有用户的投放记录查询出来 record1 = Throw.objects.filter(dump_type="1") # 把所有用户投放可回收垃圾的记录查询出来 record2 = Throw.objects.filter(dump_type="2") # 把所有用户投放厨余垃圾的记录查询出来 record3 = Throw.objects.filter(dump_type="3") # 把所有用户投放有害垃圾的记录查询出来 record4 = Throw.objects.filter(dump_type="4") # 把所有用户投放其他垃圾的记录查询出来 data = analysis(records, record1, record2, record3, record4) return render(request, 'manager/manage_analysis.html', context={"commons": commons, "count": data[0], "counts": data[1], "type1": data[2], "Max": data[3], "type2": data[4], "Min": data[5], "num": 1, "name": global_mname}) else: # manager/search_record.html页面中通过post方式的“查询”按钮跳转到此处,即完成查询操作 commons = Common.objects.all() # 把所有用户查询出来 common_tel = request.POST.get("common_tel") dump_place = request.POST.get("dump_place") manage_year = request.POST.get("manage_year") manage_month = request.POST.get("manage_month") manage_time = manage_year + "-" + manage_month if common_tel or dump_place: # 两者中至少有一个不为空 if common_tel and dump_place: # 两者都不为空 if manage_year and manage_month: # 两者都不为空 records = Throw.objects.filter(common_tel=common_tel, dump_place=dump_place, throw_time__contains=manage_time) if records: record1 = Throw.objects.filter(common_tel=common_tel, dump_place=dump_place, throw_time__contains=manage_time, dump_type="1") record2 = Throw.objects.filter(common_tel=common_tel, dump_place=dump_place, throw_time__contains=manage_time, dump_type="2") record3 = Throw.objects.filter(common_tel=common_tel, dump_place=dump_place, throw_time__contains=manage_time, dump_type="3") record4 = Throw.objects.filter(common_tel=common_tel, dump_place=dump_place, throw_time__contains=manage_time, dump_type="4") data = analysis(records, record1, record2, record3, record4) return render(request, 'manager/manage_analysis.html', context={"commons": commons, "count": data[0], "counts": data[1], "type1": data[2], "Max": data[3], "type2": data[4], "Min": data[5], "common_tel": common_tel, "dump_place": dump_place, "name": global_cname, "num": 6, "time": manage_time}) else: records = Throw.objects.all() # 把所有用户的投放记录查询出来 record1 = Throw.objects.filter(dump_type="1") # 把所有用户投放可回收垃圾的记录查询出来 record2 = Throw.objects.filter(dump_type="2") # 把所有用户投放厨余垃圾的记录查询出来 record3 = Throw.objects.filter(dump_type="3") # 把所有用户投放有害垃圾的记录查询出来 record4 = Throw.objects.filter(dump_type="4") # 把所有用户投放其他垃圾的记录查询出来 data = analysis(records, record1, record2, record3, record4) return render(request, 'manager/manage_analysis.html', context={"commons": commons, "count": data[0], "counts": data[1], "type1": data[2], "Max": data[3], "type2": data[4], "Min": data[5], "name": global_cname, "num": 1, "status": 5}) else: records = Throw.objects.filter(common_tel=common_tel, dump_place=dump_place) if records: # 如果找到的结果集非空,则输出 record1 = Throw.objects.filter(common_tel=common_tel, dump_place=dump_place, dump_type="1") record2 = Throw.objects.filter(common_tel=common_tel, dump_place=dump_place, dump_type="2") record3 = Throw.objects.filter(common_tel=common_tel, dump_place=dump_place, dump_type="3") record4 = Throw.objects.filter(common_tel=common_tel, dump_place=dump_place, dump_type="4") data = analysis(records, record1, record2, record3, record4) return render(request, 'manager/manage_analysis.html', context={"commons": commons, "count": data[0], "counts": data[1], "type1": data[2], "Max": data[3], "type2": data[4], "Min": data[5], "num": 2, "common_tel": common_tel, "dump_place": dump_place, "name": global_mname}) else: # 若查询的结果集为0 records = Throw.objects.all() # 把所有用户的投放记录查询出来 record1 = Throw.objects.filter(dump_type="1") # 把所有用户投放可回收垃圾的记录查询出来 record2 = Throw.objects.filter(dump_type="2") # 把所有用户投放厨余垃圾的记录查询出来 record3 = Throw.objects.filter(dump_type="3") # 把所有用户投放有害垃圾的记录查询出来 record4 = Throw.objects.filter(dump_type="4") # 把所有用户投放其他垃圾的记录查询出来 data = analysis(records, record1, record2, record3, record4) return render(request, 'manager/manage_analysis.html', context={"commons": commons, "count": data[0], "counts": data[1], "type1": data[2], "Max": data[3], "type2": data[4], "Min": data[5], "num": 1, "name": global_mname, "status": 2}) else: # 两者中一个不为空 if common_tel: # 如果用户非空,则按用户查找 if manage_year and manage_month: # 两者都不为空 records = Throw.objects.filter(common_tel=common_tel, throw_time__contains=manage_time) if records: record1 = Throw.objects.filter(common_tel=common_tel, throw_time__contains=manage_time, dump_type="1") record2 = Throw.objects.filter(common_tel=common_tel, throw_time__contains=manage_time, dump_type="2") record3 = Throw.objects.filter(common_tel=common_tel, throw_time__contains=manage_time, dump_type="3") record4 = Throw.objects.filter(common_tel=common_tel, throw_time__contains=manage_time, dump_type="4") data = analysis(records, record1, record2, record3, record4) return render(request, 'manager/manage_analysis.html', context={"commons": commons, "count": data[0], "counts": data[1], "type1": data[2], "Max": data[3], "type2": data[4], "Min": data[5], "common_tel": common_tel, "name": global_cname, "num": 7, "time": manage_time}) else: records = Throw.objects.all() # 把所有用户的投放记录查询出来 record1 = Throw.objects.filter(dump_type="1") # 把所有用户投放可回收垃圾的记录查询出来 record2 = Throw.objects.filter(dump_type="2") # 把所有用户投放厨余垃圾的记录查询出来 record3 = Throw.objects.filter(dump_type="3") # 把所有用户投放有害垃圾的记录查询出来 record4 = Throw.objects.filter(dump_type="4") # 把所有用户投放其他垃圾的记录查询出来 data = analysis(records, record1, record2, record3, record4) return render(request, 'manager/manage_analysis.html', context={"commons": commons, "count": data[0], "counts": data[1], "type1": data[2], "Max": data[3], "type2": data[4], "Min": data[5], "name": global_cname, "num": 1, "status": 6}) else: records = Throw.objects.filter(common_tel=common_tel) if records: # 如果找到的结果集非空,则输出 record1 = Throw.objects.filter(common_tel=common_tel, dump_type="1") record2 = Throw.objects.filter(common_tel=common_tel, dump_type="2") record3 = Throw.objects.filter(common_tel=common_tel, dump_type="3") record4 = Throw.objects.filter(common_tel=common_tel, dump_type="4") data = analysis(records, record1, record2, record3, record4) return render(request, 'manager/manage_analysis.html', context={"commons": commons, "count": data[0], "counts": data[1], "type1": data[2], "Max": data[3], "type2": data[4], "Min": data[5], "num": 3, "common_tel": common_tel, "name": global_mname}) else: # 若查询的结果集为0,那么输出未找到该用户的投放记录! records = Throw.objects.all() # 把所有用户的投放记录查询出来 record1 = Throw.objects.filter(dump_type="1") # 把所有用户投放可回收垃圾的记录查询出来 record2 = Throw.objects.filter(dump_type="2") # 把所有用户投放厨余垃圾的记录查询出来 record3 = Throw.objects.filter(dump_type="3") # 把所有用户投放有害垃圾的记录查询出来 record4 = Throw.objects.filter(dump_type="4") # 把所有用户投放其他垃圾的记录查询出来 data = analysis(records, record1, record2, record3, record4) return render(request, 'manager/manage_analysis.html', context={"commons": commons, "count": data[0], "counts": data[1], "type1": data[2], "Max": data[3], "type2": data[4], "Min": data[5], "num": 1, "name": global_mname, "status": 0}) else: # 如果获取的垃圾回收点输入框内容不为空,则按垃圾回收点查找 if manage_year and manage_month: # 两者都不为空 records = Throw.objects.filter(dump_place=dump_place, throw_time__contains=manage_time) if records: record1 = Throw.objects.filter(dump_place=dump_place, throw_time__contains=manage_time, dump_type="1") record2 = Throw.objects.filter(dump_place=dump_place, throw_time__contains=manage_time, dump_type="2") record3 = Throw.objects.filter(dump_place=dump_place, throw_time__contains=manage_time, dump_type="3") record4 = Throw.objects.filter(dump_place=dump_place, throw_time__contains=manage_time, dump_type="4") data = analysis(records, record1, record2, record3, record4) return render(request, 'manager/manage_analysis.html', context={"commons": commons, "count": data[0], "counts": data[1], "type1": data[2], "Max": data[3], "type2": data[4], "Min": data[5], "dump_place": dump_place, "name": global_cname, "num": 8, "time": manage_time}) else: records = Throw.objects.all() # 把所有用户的投放记录查询出来 record1 = Throw.objects.filter(dump_type="1") # 把所有用户投放可回收垃圾的记录查询出来 record2 = Throw.objects.filter(dump_type="2") # 把所有用户投放厨余垃圾的记录查询出来 record3 = Throw.objects.filter(dump_type="3") # 把所有用户投放有害垃圾的记录查询出来 record4 = Throw.objects.filter(dump_type="4") # 把所有用户投放其他垃圾的记录查询出来 data = analysis(records, record1, record2, record3, record4) return render(request, 'manager/manage_analysis.html', context={"commons": commons, "count": data[0], "counts": data[1], "type1": data[2], "Max": data[3], "type2": data[4], "Min": data[5], "name": global_cname, "num": 1, "status": 7}) else: records = Throw.objects.filter(dump_place=dump_place) if records: # 如果找到的结果集非空,则输出 record1 = Throw.objects.filter(dump_place=dump_place, dump_type="1") record2 = Throw.objects.filter(dump_place=dump_place, dump_type="2") record3 = Throw.objects.filter(dump_place=dump_place, dump_type="3") record4 = Throw.objects.filter(dump_place=dump_place, dump_type="4") data = analysis(records, record1, record2, record3, record4) return render(request, 'manager/manage_analysis.html', context={"commons": commons, "count": data[0], "counts": data[1], "type1": data[2], "Max": data[3], "type2": data[4], "Min": data[5], "num": 4, "dump_place": dump_place, "name": global_mname}) else: # 若查询的结果集为0,那么输出未找到该垃圾回收点的投放记录! records = Throw.objects.all() # 把所有用户的投放记录查询出来 record1 = Throw.objects.filter(dump_type="1") # 把所有用户投放可回收垃圾的记录查询出来 record2 = Throw.objects.filter(dump_type="2") # 把所有用户投放厨余垃圾的记录查询出来 record3 = Throw.objects.filter(dump_type="3") # 把所有用户投放有害垃圾的记录查询出来 record4 = Throw.objects.filter(dump_type="4") # 把所有用户投放其他垃圾的记录查询出来 data = analysis(records, record1, record2, record3, record4) return render(request, 'manager/manage_analysis.html', context={"commons": commons, "count": data[0], "counts": data[1], "type1": data[2], "Max": data[3], "type2": data[4], "Min": data[5], "num": 1, "name": global_mname, "status": 1}) else: # 两者都为空 if manage_year and manage_month: # 两者都不为空 records = Throw.objects.filter(throw_time__contains=manage_time) if records: record1 = Throw.objects.filter(throw_time__contains=manage_time, dump_type="1") record2 = Throw.objects.filter(throw_time__contains=manage_time, dump_type="2") record3 = Throw.objects.filter(throw_time__contains=manage_time, dump_type="3") record4 = Throw.objects.filter(throw_time__contains=manage_time, dump_type="4") data = analysis(records, record1, record2, record3, record4) return render(request, 'manager/manage_analysis.html', context={"commons": commons, "count": data[0], "counts": data[1], "type1": data[2], "Max": data[3], "type2": data[4], "Min": data[5], "name": global_cname, "num": 5, "time": manage_time}) else: records = Throw.objects.all() # 把所有用户的投放记录查询出来 record1 = Throw.objects.filter(dump_type="1") # 把所有用户投放可回收垃圾的记录查询出来 record2 = Throw.objects.filter(dump_type="2") # 把所有用户投放厨余垃圾的记录查询出来 record3 = Throw.objects.filter(dump_type="3") # 把所有用户投放有害垃圾的记录查询出来 record4 = Throw.objects.filter(dump_type="4") # 把所有用户投放其他垃圾的记录查询出来 data = analysis(records, record1, record2, record3, record4) return render(request, 'manager/manage_analysis.html', context={"commons": commons, "count": data[0], "counts": data[1], "type1": data[2], "Max": data[3], "type2": data[4], "Min": data[5], "name": global_cname, "status": 4}) else: records = Throw.objects.all() # 把所有用户的投放记录查询出来 record1 = Throw.objects.filter(dump_type="1") # 把所有用户投放可回收垃圾的记录查询出来 record2 = Throw.objects.filter(dump_type="2") # 把所有用户投放厨余垃圾的记录查询出来 record3 = Throw.objects.filter(dump_type="3") # 把所有用户投放有害垃圾的记录查询出来 record4 = Throw.objects.filter(dump_type="4") # 把所有用户投放其他垃圾的记录查询出来 data = analysis(records, record1, record2, record3, record4) return render(request, 'manager/manage_analysis.html', context={"commons": commons, "count": data[0], "counts": data[1], "type1": data[2], "Max": data[3], "type2": data[4], "Min": data[5], "name": global_cname, "status": 3}) # 删除投放记录 def delete_record(request): if request.method == "GET": throw_id = request.GET.get("id") Throw.objects.filter(id=throw_id).delete() # 当点击删除按钮后,删除该投放记录 records = Throw.objects.all() # 把当前投放记录查询出来 return render(request, 'manager/search_record.html', context={"records": records, "status": 4, "name": global_mname}) # 修改管理员的密码 def change_manager_password(request): result = User.objects.filter(account=account).first() password = result.user_password if request.method == "GET": # 此部分是当每次点击侧边导航栏的“修改密码”选项时,显示该界面 return render(request, 'manager/change_manager_password.html', context={"password": password, "name": global_mname}) else: # 此部分是在change_manager_password.html页面中点击保存按钮时完成修改密码的操作 oldPassword = request.POST.get("oldPassword") newPassword = request.POST.get("newPassword") reNewPassword = request.POST.get("reNewPassword") # 以下是先判断输入的旧密码是否正确,并且两次输入的密码是否一致且都不为空 if password == oldPassword and newPassword == reNewPassword and newPassword and reNewPassword: User.objects.filter(account=account).update(user_password=newPassword) # 更新该用户的密码 password = newPassword return render(request, 'manager/change_manager_password.html', context={"password": password, "name": global_mname}) # 求最大最小值 def analysis(records, record1, record2, record3, record4): type1 = '' type2 = '' count = len(records) counts = [len(record1), len(record2), len(record3), len(record4)] Max = max(counts) Min = min(counts) types = ['可回收垃圾', '厨余垃圾', '有害垃圾', '其他垃圾'] for i, j in enumerate(counts): if j == Max: type1 = type1 + types[i] if j == Min: type2 = type2 + types[i] return count, counts, type1, Max, type2, Min # 给数据库中插数据 def write_data(): for i in range(1000): common_tel = random.choice( [16933245703, 13709279984, 15991876406, 17588247903, 13699840921, 18579351104, 15009149321, 17306243659, 13243960857, 15433259106, 13879632584, 16396570042, 15975065237]) common = Common.objects.filter(common_tel=common_tel).first() common_id = common.common_id integral = common.common_integral + 1 Common.objects.filter(common_tel=common_tel).update(common_integral=integral) shuts = ['yt001', 'yt002', 'yt003', 'yt004'] dump_id = np.random.choice(shuts, p=[0.24, 0.53, 0.07, 0.16]) # {[ 'BL001', 'BL002', 'BL003', 'BL004', 'BQ001', 'BQ002', 'BQ003', 'BQ004', 'ca001', 'ca002', 'ca003', 'ca004', # 'LH001', 'LH002', 'LH003', 'LH004', 'WY001', 'WY002', 'WY003', 'WY004', 'XC001', 'XC002', 'XC003', 'XC004', # 'yt001', 'yt002', 'yt003', 'yt004'])} dump = Dump.objects.filter(dump_id=dump_id).first() dump_place = dump.dump_place dump_type_id = dump.dump_type_id now_time = timeout() Throw.objects.create(common_id=common_id, common_tel=common_tel, dump_id=dump_id, dump_place=dump_place, dump_type_id=dump_type_id, throw_time=now_time) # 设置时间 def timeout(): a1 = (2020, 1, 1, 0, 0, 0, 0, 0, 0) # 设置开始日期时间元组(2021-01-01 00:00:00) a2 = (2024, 5, 25, 23, 59, 59, 0, 0, 0) # 设置结束日期时间元组(2021-05-25 23:59:59) start = time.mktime(a1) # 生成开始时间戳 end = time.mktime(a2) # 生成结束时间戳 t = random.randint(start, end) # 在开始和结束时间戳中随机取出一个 date_tuple = time.localtime(t) # 将时间戳生成时间元组 date = time.strftime("%Y-%m-%d %H:%M:%S", date_tuple) # 将时间元组转成格式化字符串(1976-05-21) return date
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。