博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Datatable get请求传参应用
阅读量:5024 次
发布时间:2019-06-12

本文共 4878 字,大约阅读时间需要 16 分钟。

以关注页面为例:

html:

1 
2 3
4
5
6
7
8
10
11
12
13
16 17
26
27
28
29
30
41
42
43
44
47 48
63
64
65
66
67 68
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
id 任务名称 紧急程度    进度 创建人 责任人 参与人 状态 更新时间
99
100
101
102 103
View Code

js:

1 
View Code

后台falsk:

1 # 关注任务数据 2 @task_mgm.route('/taskDataFocus') 3 @sso_wrapper 4 def taskinfo_dataFocus_fun(): 5     try: 6         which = request.values.get('which') 7         advance = request.values.get('advance') 8         startTime = request.values.get('stime')  # 起时 9         endTime = request.values.get('etime')10         time_str = setTime()11         if startTime is None or startTime is '' or startTime == 'undefined':12             startTime = time_str.split("|")[0]13         if endTime is None or endTime is '' or endTime == 'undefined':14             endTime = time_str.split("|")[1]15 16         # 应该根据用户名或ID 的到自己的任务  现在先暂时应任务ID17         if which == "undefined" and advance == "undefined":18             tasks = Task.query.filter(19                 and_(Task.isDelete != 1, Task.ifFocus == 1, Task.endTime >= startTime, Task.endTime <= endTime,20                      )).order_by(Task.updateTime.desc()).all()21         elif which == "create_mine":22             tasks = Task.query.filter(23                 and_(Task.isDelete != 1, Task.ifFocus == 1, Task.createPeople == g.name24                      )).order_by(Task.updateTime.desc()).all()25         elif which == "res_mine":26             tasks = Task.query.filter(27                 and_(Task.isDelete != 1, Task.ifFocus == 1, Task.resPeople == g.name28                      )).order_by(Task.updateTime.desc()).all()29         elif which == "exe_mine":30             tasks = Task.query.filter(31                 and_(Task.isDelete != 1, Task.ifFocus == 1, Task.exePeople == g.name32                      )).order_by(Task.updateTime.desc()).all()33         elif advance == "advance_0":34             tasks = Task.query.filter(35                 and_(Task.isDelete != 1, Task.ifFocus == 1, Task.advanceId == 036                      )).order_by(Task.updateTime.desc()).all()37         elif advance == "advance_2":38             tasks = Task.query.filter(39                 and_(Task.isDelete != 1, Task.ifFocus == 1, Task.advanceId == 140                      )).order_by(Task.updateTime.desc()).all()41         elif advance == "advance_4":42             tasks = Task.query.filter(43                 and_(Task.isDelete != 1, Task.ifFocus == 1, Task.advanceId == 244                      )).order_by(Task.updateTime.desc()).all()45         elif advance == "advance_6":46             tasks = Task.query.filter(47                 and_(Task.isDelete != 1, Task.ifFocus == 1, Task.advanceId == 348                      )).order_by(Task.updateTime.desc()).all()49         elif advance == "advance_8":50             tasks = Task.query.filter(51                 and_(Task.isDelete != 1, Task.ifFocus == 1, Task.advanceId == 452                      )).order_by(Task.updateTime.desc()).all()53         elif advance == "advance_10":54             tasks = Task.query.filter(55                 and_(Task.isDelete != 1, Task.ifFocus == 1, Task.advanceId == 556                      )).order_by(Task.updateTime.desc()).all()57 58         data = sql3json(tasks, ["id", "endState", "taskName", "advanceId", "urgentId", "createPeople", "resPeople", "exePeople", "ifFocus", "updateTime"])59         return data60     except Exception as e:61         logging.error(e)
View Code

 

转载于:https://www.cnblogs.com/We612/p/10255627.html

你可能感兴趣的文章
[Grunt] External Config
查看>>
模板与泛型编程——模板实参推断
查看>>
WordPress FunCaptcha插件跨站脚本漏洞
查看>>
Linux C++调试利器-gdb
查看>>
【sql server复制】不重新初始化快照的情况下新增表/存储过程/函数等
查看>>
(转)国外漂亮表格连接地址
查看>>
[bzoj1483]梦幻布丁
查看>>
web端创建地图
查看>>
解决Eclipse中文乱码
查看>>
[c/c++] programming之路(27)、union共用体
查看>>
Sybase IQ数据库索引
查看>>
ASP.NET WebService
查看>>
一个TokenUtils程序,亲测可用
查看>>
KVO 崩溃问题
查看>>
洛谷T47092 作业_简单状压动归
查看>>
在jsp页面如果运行时路径错误解决方法
查看>>
Jquery弹出层插件Thickbox使用心得
查看>>
jQuery Ajax 实例 全解析
查看>>
JS的解析与执行过程—全局预处理阶段之全局词法环境对象
查看>>
Django忘记管理员账号和密码的解决办法
查看>>