from flask import Blueprint,request,jsonify,redirect
from common.lib.Helper import ops_render,getCurrentDate,iPagination
from common.lib.UrlManager import UrlManager
from application import app,db
from common.model.bulletin_lost.news import News
from common.model.bulletin_lost.lost import Lost
from sqlalchemy import or_
route_index = Blueprint('index_page',__name__)
@route_index.route("/")
def index():
resp_data = {}
query = News.query
query.count()#这个就是取得总的页数
req = request.values
page = int(req['p']) if ('p' in req and req['p']) else 1
if 'mix_kw' in req:
rule = or_(News.title.ilike("%{0}%".format(req['mix_kw'])), News.id.ilike("%{0}%".format(req['mix_kw'])))
query = query.filter(rule)
if 'status' in req and int(req['status']) > -1:
query = query.filter(News.status == int(req['status']))
page_params = {
'total': query.count(),
'page_size':app.config['PAGE_SIZE'],
'page': page,
'display':app.config['PAGE_DISPLAY'],
'url': request.full_path.replace( "&p={}".format(page),"" )
}
pages = iPagination( page_params )
offset = ( page - 1 ) * app.config['PAGE_SIZE']
limit = app.config['PAGE_SIZE'] * page
list = query.order_by(News.id.asc()).all()[ offset:limit ]
resp_data['list'] = list
resp_data['pages']=pages
resp_data['current']='bulletin'
resp_data['search_con'] = req
resp_data['status_mapping'] = app.config['STATUS_MAPPING']
return ops_render("index/index.html",resp_data)
@route_index.route("/lost")
def lost():
resp_data = {}
query = Lost.query
query.count() # 这个就是取得总的页数
req = request.values
page = int(req['p']) if ('p' in req and req['p']) else 1
if 'mix_kw' in req:
rule = or_(Lost.title.ilike("%{0}%".format(req['mix_kw'])), Lost.id.ilike("%{0}%".format(req['mix_kw'])))
query = query.filter(rule)
if 'status' in req and int(req['status']) > -1:
query = query.filter(Lost.cat == int(req['status']))
if 'lost' in req and int(req['lost']) > -1:
query = query.filter(Lost.status == int(req['lost']))
page_params = {
'total': query.count(),
'page_size': app.config['PAGE_SIZE'],
'page': page,
'display': app.config['PAGE_DISPLAY'],
'url': request.full_path.replace("&p={}".format(page), "")
}
pages = iPagination(page_params)
offset = (page - 1) * app.config['PAGE_SIZE']
limit = app.config['PAGE_SIZE'] * page
list = query.order_by(Lost.id.asc()).all()[offset:limit]
resp_data['list'] = list
resp_data['pages'] = pages
resp_data['current'] = 'lost'
resp_data['search_con'] = req
resp_data['lost_mapping'] = app.config['LOST_MAPPING']
resp_data['status_mapping'] = app.config['STATUS_MAPPING']
return ops_render("index/lost.html",resp_data)
@route_index.route("/new_set",methods=["GET","POST"])
def new_set():
if request.method == "GET":
resp={}
resp['lib_location']=app.config['LIB_LOCATION']
return ops_render("index/new_set.html",resp)
resp = {'code': 200, 'msg': '操作成功', 'data': {}}
req = request.values
title = req['title'] if 'title' in req else ''
location = req['location'] if 'location' in req else ''
content = req['content'] if 'content' in req else ''
# 参数有效性的再次判断的 之前判断了title字数不能小于2,地点名不能少于5个字和content不能为空,这里就暂时鸡肋地随便判断下
if title is None or len(title) > 20:
resp['code'] = -1
resp['msg'] = "请输入规范的标题名~~"
return jsonify(resp)
if location is None or len(location) > 15:
resp['code'] = -1
resp['msg'] = "请输入规范的校区图书馆名~~"
return jsonify(resp)
bulletin=News()
bulletin.title= title
bulletin.content=content
bulletin.location= location
bulletin.created_time=getCurrentDate()
# 数据库提交
db.session.add(bulletin)
db.session.commit()
return jsonify(resp)
@route_index.route("/info")
def info():
resp_data = {}
req = request.args
id = int(req.get("id", 0))
reback_url = UrlManager.buildUrl("/")
if id < 1:
return redirect(reback_url)
info = News.query.filter_by(id=id).first()
if not info:
return redirect(reback_url)
# news_info = News.query.filter(News.id == id).order_by(News.id.asc()).all()
resp_data['info'] = info
#resp_data['news_info'] = news_info
return ops_render("index/info.html", resp_data)
@route_index.route("/lost_info")
def lost_info():
resp_data = {}
req = request.args
id = int(req.get("id", 0))
reback_url = UrlManager.buildUrl("/lost")
if id < 1:
return redirect(reback_url)
info = Lost.query.filter_by(id=id).first()
if not info:
return redirect(reback_url)
# news_info = News.query.filter(News.id == id).order_by(News.id.asc()).all()
resp_data['info'] = info
#resp_data['news_info'] = news_info
return ops_render("index/lost_info.html", resp_data)
@route_index.route("/set",methods=["GET","POST"])
def set():
if request.method == "GET":
resp_data = {}
req = request.args
id = req['id'] if 'id' in req else ''
reback_url = UrlManager.buildUrl("/")
info = News.query.filter_by(id=id).first()
if not info:
return redirect(reback_url)
# news_info = News.query.filter(News.id == id).order_by(News.id.asc()).all()
resp_data['info'] = info
resp_data['lib_location'] = app.config['LIB_LOCATION']
return ops_render("index/set.html",resp_data)
resp = {'code': 200, 'msg': '操作成功', 'data': {}}
req = request.values
id = int(req['id']) if 'id' in req else 0
title = req['title'] if 'title' in req else ''
location = req['location'] if 'location' in req else ''
content = req['content'] if 'content' in req else ''
# 参数有效性的再次判断的 之前判断了title字数不能小于2,地点名不能少于5个字和content不能为空,这里就暂时鸡肋地随便判断下
if title is None or len(title) > 20:
resp['code'] = -1
resp['msg'] = "请输入规范的标题名~~"
return jsonify(resp)
if location is None or len(location) > 15:
resp['code'] = -1
resp['msg'] = "请输入规范的校区图书馆名~~"
return jsonify(resp)
bulletin_info = News.query.filter_by(id=id).first()
bulletin_info.title = title
bulletin_info.content = content
bulletin_info.location = location
bulletin_info.created_time = getCurrentDate()
# 数据库提交
db.session.add(bulletin_info)
db.session.commit()
return jsonify(resp)
@route_index.route("/ops",methods = [ "POST" ])
def ops():
resp = {'code': 200, 'msg': '操作成功~~', 'data': {}}
req = request.values
id = int(req['id']) if 'id' in req else 0
act = req['act'] if 'act' in req else ''
if not id :
resp['code'] = -1
resp['msg'] = "请选择要操作的对象~~"
return jsonify(resp)
if act not in [ 'remove','recover' ] :
resp['code'] = -1
resp['msg'] = "操作有误,请重试~~"
return jsonify(resp)
news_info = News.query.filter_by(id=id).first()
if not news_info:
resp['code'] = -1
resp['msg'] = "指定对象不存在~~"
return jsonify(resp)
if act == "remove":
news_info.status = 0
elif act == "recover":
news_info.status = 1
news_info.created_time = getCurrentDate()
db.session.add(news_
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
随着微信在移动手机用户中的不断普及与功能的持续更新,小程序逐渐出现在人们的视野之中,它无需下载就能使用,在一定程度上更加方便了人们对于基于互联网的服务的使用,很多手机端的应用程序也相继推出了相应的小程序,以此吸引用户。 然而目前图书馆的信息化水平较低,仅凭一套落后的图书馆管理系统无法为读者们提供信息时代最便利的服务,因此我们希望引入一个针对读者的微信小程序端和针对管理员的网站端。其中,小程序端整合图书馆最核心的图书借阅及搜索功能,并加入好书推荐、图书交换、新书速递等功能,以期促进爱书、读书的良好氛围形成,此外,还包括讲座预告、失物招领、校园地图导航、学术交流、读者来稿等功能,以提供相关的服务。网站端则包括账号登录、馆内信息、馆内动态、馆内书籍、借阅管理、来稿反馈、统计管理等7个模块,便于管理员的工作。 目标 通过引入图书馆综合应用信息系统,方便读者对于图书的搜索、借阅,加强读者之间在读书上的交流,并为其提供讲座预告与预约、失物招领、校园地图导航等服务,并方便管理员对于书籍状态及讲座信息的管理,让信息技术为读者和管理员带来生活中真实可感的便利。 小程序+pyhton+sqlserver
资源推荐
资源详情
资源评论
收起资源包目录
图书馆综合应用信息系统小程序带python后台 (841个子文件)
style.css 155KB
bootstrap.min.css 118KB
bootstrap.min.css 118KB
ueditor.css 44KB
ueditor.min.css 34KB
font-awesome.css 28KB
font-awesome.min.css 23KB
video-js.css 21KB
image.css 19KB
jquery.datetimepicker.min.css 16KB
select2.min.css 16KB
video.css 15KB
attachment.css 15KB
layer.css 14KB
video-js.min.css 11KB
shCoreDefault.css 7KB
layer.css 5KB
scrawl.css 4KB
codemirror.css 3KB
charts.css 3KB
background.css 2KB
emotion.css 2KB
dialogbase.css 2KB
music.css 2KB
edittable.css 1KB
template.css 1KB
jquery.tagsinput.min.css 770B
webuploader.css 515B
help.css 395B
iframe.css 42B
dongtai_custom.css 0B
fontawesome-webfont.eot 59KB
vjs.eot 3KB
wface.gif 49KB
jxface2.gif 40KB
yface.gif 28KB
bface.gif 27KB
icons.gif 20KB
file-icons.gif 20KB
file-icons.gif 20KB
tface.gif 19KB
fface.gif 18KB
cface.gif 8KB
loading-0.gif 6KB
icons-all.gif 4KB
loading-2.gif 2KB
videologo.gif 2KB
loading.gif 2KB
cancelbutton.gif 1KB
button-bg.gif 1KB
lock.gif 1KB
alignicon.gif 1KB
word.gif 1019B
icon_doc.gif 1012B
icon_psd.gif 1009B
icon_rar.gif 1007B
icon_xls.gif 1005B
icon_ppt.gif 1001B
icon_mv.gif 1001B
icon_pdf.gif 996B
icon_mp3.gif 986B
icon_txt.gif 970B
icon_jpg.gif 950B
icon_exe.gif 949B
icon_chm.gif 923B
loading.gif 734B
loading-1.gif 701B
icons.gif 453B
icons.gif 453B
icons.gif 453B
success.gif 445B
success.gif 445B
success.gif 445B
cursor_v.gif 370B
cursor_h.gif 253B
anchor.gif 184B
highlighted.gif 111B
unhighlighted.gif 111B
bg.gif 84B
pagebreak.gif 54B
spacer.gif 43B
0.gif 43B
.gitignore 159B
new_set.html 7KB
wordimage.html 6KB
map.html 6KB
layout_main.html 6KB
emotion.html 6KB
image.html 6KB
index.html 5KB
show.html 5KB
charts.html 5KB
link.html 4KB
info.html 4KB
insertframe.html 4KB
searchreplace.html 4KB
video.html 4KB
gmap.html 4KB
scrawl.html 4KB
info.html 4KB
共 841 条
- 1
- 2
- 3
- 4
- 5
- 6
- 9
资源评论
- 本本纲目2023-07-25这个小程序界面简洁明了,操作起来很容易上手。
- 嗨了伐得了2023-07-25虽然有一些小问题需要改进,但总体来说,这个小程序是一项不可多得的实用工具。
- 金山文档2023-07-25用这个小程序借书真是快速又便捷,省去了排队时间。
- 刘璐璐璐璐璐2023-07-25这个小程序真的很方便,帮我在图书馆找书再也不用翻遍书架了。
- 我就是月下2023-07-25后台的Python开发确实有助于提高系统的效率和稳定性。
成都定制通软件
- 粉丝: 1
- 资源: 27
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- tensorflow-gpu-2.6.0-cp38-cp38-manylinux2010-x86-64.whl
- mmexport1715960553858.png
- tensorflow-gpu-2.6.0-cp37-cp37m-manylinux2010-x86-64.whl
- 通过 .NET 应用程序中的源代码查找 SQL 注入
- 电子设计竞赛2007年B题 无线识别装置.doc
- Wox全局搜索工具,一款win下的全局搜索软件
- 使用高级集群管理 (ACM) 模板来管理用户、组和命名空间
- 电子设计竞赛2007年A题 音频信号分析仪.doc
- burpsuite安装详细教程
- Bk1_Ch2_01.ipynb
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功