Merge branch 'master' of 10.7.100.160:/job/safesite
This commit is contained in:
commit
a6e67b8106
|
@ -5,8 +5,9 @@ urlpatterns = [
|
||||||
path('', views.index),
|
path('', views.index),
|
||||||
path('add',views.add),
|
path('add',views.add),
|
||||||
path('addwj',views.addwj),
|
path('addwj',views.addwj),
|
||||||
path('detail',views.detail),
|
|
||||||
path('api',views.api),
|
path('api',views.api),
|
||||||
path('api/upload',views.upload),
|
path('selectDate',views.selectDate),#查询
|
||||||
|
path('api/upload',views.upload),#上传
|
||||||
path('eduvideoshow',views.showvideo),
|
path('eduvideoshow',views.showvideo),
|
||||||
|
path('html/edulessondetail/detail/<int:jyid>/', views.edulessondetail),#观看历史
|
||||||
]
|
]
|
||||||
|
|
|
@ -32,8 +32,9 @@ def add(req):
|
||||||
return render(req,'edulessonadd.html')
|
return render(req,'edulessonadd.html')
|
||||||
def addwj(req):
|
def addwj(req):
|
||||||
return render(req,'edulessonaddwj.html')
|
return render(req,'edulessonaddwj.html')
|
||||||
def detail(req):
|
#观看历史
|
||||||
return render(req,'edulessondetail.html')
|
def edulessondetail(req,jyid):
|
||||||
|
return render(req,'edulessondetail.html',{'jyid':jyid})
|
||||||
|
|
||||||
#上传视频,文件,返回地址和名称
|
#上传视频,文件,返回地址和名称
|
||||||
def upload(req):
|
def upload(req):
|
||||||
|
@ -47,19 +48,32 @@ def upload(req):
|
||||||
with open( filepath, 'wb') as f:
|
with open( filepath, 'wb') as f:
|
||||||
f.write(req.FILES['mf'].read())
|
f.write(req.FILES['mf'].read())
|
||||||
return JsonResponse({"code":1,"filename":file_name,"filepath":filepath})
|
return JsonResponse({"code":1,"filename":file_name,"filepath":filepath})
|
||||||
|
#查询
|
||||||
|
def selectDate(req):
|
||||||
|
a = req.GET.get('a')
|
||||||
|
userid = req.session['userid']
|
||||||
|
userobj = User.objects.get(userid=userid)
|
||||||
|
companyid = getcompany(userid)
|
||||||
|
a = Edulesson.objects.filter(usecomp=Partment.objects.get(partid=companyid),deletemark=1)
|
||||||
|
if req.GET.get('type',None):
|
||||||
|
a = a.filter(type=req.GET.get('type'))
|
||||||
|
total = a.count()
|
||||||
|
startnum,endnum=fenye(req)
|
||||||
|
a = a.order_by('-submittime')[startnum:endnum].values('id','num','title','user__name','desciption','submittime','type','cate__name','url','watchnum')
|
||||||
|
return HttpResponse(transjson(total,a),content_type="application/json")
|
||||||
def api(req):
|
def api(req):
|
||||||
a = req.GET.get('a')
|
a = req.GET.get('a')
|
||||||
|
#首页列表
|
||||||
if a=='listall':
|
if a=='listall':
|
||||||
userid = req.session['userid']
|
userid = req.session['userid']
|
||||||
companyid = getcompany(userid)
|
companyid = getcompany(userid)
|
||||||
startnum,endnum=fenye(req)
|
startnum,endnum=fenye(req)
|
||||||
a = Edulesson.objects.filter(usecomp=Partment.objects.get(partid=companyid),deletemark=1).order_by('id')#无deletemark
|
a = Edulesson.objects.filter(usecomp__partid__in= [1,Partment.objects.get(partid=companyid).partid] ,deletemark=1).order_by('id')#无deletemark
|
||||||
total = a.count()
|
total = a.count()
|
||||||
startnum,endnum=fenye(req)
|
startnum,endnum=fenye(req)
|
||||||
a = a[startnum:endnum].values('id','num','title','user__name','desciption','submittime','type','cate__name','url','watchnum')
|
a = a[startnum:endnum].values('id','num','title','user__name','desciption','submittime','type','cate__name','url','watchnum')
|
||||||
return HttpResponse(transjson(total,a),content_type="application/json")
|
return HttpResponse(transjson(total,a),content_type="application/json")
|
||||||
|
#视频
|
||||||
elif a=='add':
|
elif a=='add':
|
||||||
userid = req.session['userid']#用户ID
|
userid = req.session['userid']#用户ID
|
||||||
companyid = getcompany(userid)#公司ID
|
companyid = getcompany(userid)#公司ID
|
||||||
|
@ -80,6 +94,7 @@ def api(req):
|
||||||
|
|
||||||
obj.save()
|
obj.save()
|
||||||
return JsonResponse({"code":1})
|
return JsonResponse({"code":1})
|
||||||
|
#文件
|
||||||
elif a=='addwj':
|
elif a=='addwj':
|
||||||
userid = req.session['userid']#用户ID
|
userid = req.session['userid']#用户ID
|
||||||
companyid = getcompany(userid)#公司ID
|
companyid = getcompany(userid)#公司ID
|
||||||
|
@ -100,7 +115,7 @@ def api(req):
|
||||||
|
|
||||||
obj.save()
|
obj.save()
|
||||||
return JsonResponse({"code":1})
|
return JsonResponse({"code":1})
|
||||||
|
#删除
|
||||||
elif a == 'del':
|
elif a == 'del':
|
||||||
id =req.GET.get('id')
|
id =req.GET.get('id')
|
||||||
userid = req.session['userid']
|
userid = req.session['userid']
|
||||||
|
@ -111,6 +126,7 @@ def api(req):
|
||||||
return JsonResponse({"code":1})
|
return JsonResponse({"code":1})
|
||||||
else:
|
else:
|
||||||
return JsonResponse({"code":0})
|
return JsonResponse({"code":0})
|
||||||
|
#点击阅读
|
||||||
elif a=='readnumber':
|
elif a=='readnumber':
|
||||||
id =req.GET.get('id')
|
id =req.GET.get('id')
|
||||||
userid = req.session['userid']
|
userid = req.session['userid']
|
||||||
|
@ -122,65 +138,10 @@ def api(req):
|
||||||
obj.user=User.objects.get(userid=userid)
|
obj.user=User.objects.get(userid=userid)
|
||||||
obj.save()
|
obj.save()
|
||||||
return JsonResponse({"code":1,"url": a.url})
|
return JsonResponse({"code":1,"url": a.url})
|
||||||
|
#观看详情
|
||||||
elif a=='detail':
|
elif a=='detail':
|
||||||
userid = req.session['userid']
|
id =req.GET.get('eduid')
|
||||||
userobj = User.objects.get(userid=userid)
|
a = EdulessonWatch.objects.filter(edulesson=id).values('id','user__name','submittime')
|
||||||
companyid = getcompany(userid)
|
|
||||||
a = Edulesson.objects.filter(usecomp=Partment.objects.get(partid=companyid),deletemark=1)
|
|
||||||
total = a.count()
|
total = a.count()
|
||||||
a = a.values('id','title','user__name','submittime')
|
|
||||||
return HttpResponse(transjson(total,a),content_type="application/json")
|
return HttpResponse(transjson(total,a),content_type="application/json")
|
||||||
elif a=='detailw':
|
|
||||||
userid = req.session['userid']
|
|
||||||
userobj = User.objects.get(userid=userid)
|
|
||||||
id =req.GET.get('id')
|
|
||||||
companyid = getcompany(userid)
|
|
||||||
a = EdulessonWatch.objects.filter(edulesson=id).order_by('-submittime')
|
|
||||||
total = a.count()
|
|
||||||
a = a.values('id','user__name','submittime')
|
|
||||||
return HttpResponse(transjson(total,a),content_type="application/json")
|
|
||||||
elif a == '1':
|
|
||||||
userid = req.session['userid']
|
|
||||||
userobj = User.objects.get(userid=userid)
|
|
||||||
companyid = getcompany(userid)
|
|
||||||
a = Edulesson.objects.filter(usecomp=Partment.objects.get(partid=companyid),type=1,deletemark=1).order_by('-submittime')
|
|
||||||
total = a.count()
|
|
||||||
startnum,endnum=fenye(req)
|
|
||||||
a = a[startnum:endnum].values('id','num','title','user__name','desciption','submittime','type','cate__name','url','watchnum')
|
|
||||||
return HttpResponse(transjson(total,a),content_type="application/json")
|
|
||||||
elif a == '2':
|
|
||||||
userid = req.session['userid']
|
|
||||||
userobj = User.objects.get(userid=userid)
|
|
||||||
companyid = getcompany(userid)
|
|
||||||
a = Edulesson.objects.filter(usecomp=Partment.objects.get(partid=companyid),type=2,deletemark=1).order_by('-submittime')
|
|
||||||
total = a.count()
|
|
||||||
startnum,endnum=fenye(req)
|
|
||||||
a = a[startnum:endnum].values('id','num','title','user__name','desciption','submittime','type','cate__name','url','watchnum')
|
|
||||||
return HttpResponse(transjson(total,a),content_type="application/json")
|
|
||||||
elif a == '3':
|
|
||||||
userid = req.session['userid']
|
|
||||||
userobj = User.objects.get(userid=userid)
|
|
||||||
companyid = getcompany(userid)
|
|
||||||
a = Edulesson.objects.filter(usecomp=Partment.objects.get(partid=companyid),type=3,deletemark=1).order_by('-submittime')
|
|
||||||
total = a.count()
|
|
||||||
startnum,endnum=fenye(req)
|
|
||||||
a = a[startnum:endnum].values('id','num','title','user__name','desciption','submittime','type','cate__name','url','watchnum')
|
|
||||||
return HttpResponse(transjson(total,a),content_type="application/json")
|
|
||||||
elif a == '4':
|
|
||||||
userid = req.session['userid']
|
|
||||||
userobj = User.objects.get(userid=userid)
|
|
||||||
companyid = getcompany(userid)
|
|
||||||
a = Edulesson.objects.filter(usecomp=Partment.objects.get(partid=companyid),type=4,deletemark=1).order_by('-submittime')
|
|
||||||
total = a.count()
|
|
||||||
startnum,endnum=fenye(req)
|
|
||||||
a = a[startnum:endnum].values('id','num','title','user__name','desciption','submittime','type','cate__name','url','watchnum')
|
|
||||||
return HttpResponse(transjson(total,a),content_type="application/json")
|
|
||||||
elif a == 'all':
|
|
||||||
userid = req.session['userid']
|
|
||||||
userobj = User.objects.get(userid=userid)
|
|
||||||
companyid = getcompany(userid)
|
|
||||||
a = Edulesson.objects.filter(usecomp=Partment.objects.get(partid=companyid),deletemark=1).order_by('-submittime')
|
|
||||||
total = a.count()
|
|
||||||
startnum,endnum=fenye(req)
|
|
||||||
a = a[startnum:endnum].values('id','num','title','user__name','desciption','submittime','type','cate__name','url','watchnum')
|
|
||||||
return HttpResponse(transjson(total,a),content_type="application/json")
|
|
|
@ -305,7 +305,7 @@
|
||||||
filter: none;
|
filter: none;
|
||||||
}
|
}
|
||||||
.accordion .accordion-header-selected {
|
.accordion .accordion-header-selected {
|
||||||
background: #06c;
|
background: #749ec8;
|
||||||
}
|
}
|
||||||
.accordion .accordion-header-selected .panel-title {
|
.accordion .accordion-header-selected .panel-title {
|
||||||
color: white;
|
color: white;
|
||||||
|
@ -3408,24 +3408,10 @@
|
||||||
width: 138px;
|
width: 138px;
|
||||||
}
|
}
|
||||||
.sidemenu .accordion-header .panel-title {
|
.sidemenu .accordion-header .panel-title {
|
||||||
<<<<<<< HEAD
|
|
||||||
|
|
||||||
height: 30px;
|
|
||||||
line-height: 45px;
|
|
||||||
height: 40px;
|
height: 40px;
|
||||||
line-height: 30px;
|
line-height: 30px;
|
||||||
=======
|
|
||||||
<<<<<<< HEAD
|
|
||||||
height: 30px;
|
|
||||||
line-height: 45px;
|
|
||||||
color: #313030;
|
color: #313030;
|
||||||
=======
|
margin-left: 25px;
|
||||||
height: 40px;
|
|
||||||
line-height: 30px;
|
|
||||||
/*color: #313030;*/
|
|
||||||
>>>>>>> 4f67aca6509b38165cec90787005dbc762a66188
|
|
||||||
>>>>>>> 0ed848ff177ad9c427f58c714cb22f8012e2c913
|
|
||||||
margin-left: 12px;
|
|
||||||
}
|
}
|
||||||
.sidemenu .accordion-header:hover {
|
.sidemenu .accordion-header:hover {
|
||||||
background: #0066cc;
|
background: #0066cc;
|
||||||
|
|
|
@ -148,15 +148,15 @@ b{color:red;font-size:20px}
|
||||||
{
|
{
|
||||||
font-size: 18px;margin-bottom:5px;margin-top:5px;color:blue;
|
font-size: 18px;margin-bottom:5px;margin-top:5px;color:blue;
|
||||||
}
|
}
|
||||||
.l-btn-icon,.panel-icon,.menu-icon,.tabs-icon {
|
.l-btn-icon, .panel-icon, .menu-icon, .tabs-icon {
|
||||||
font-family:FontAwesome;
|
font-family: FontAwesome;
|
||||||
font-size:14px !important;
|
font-size: 14px !important;
|
||||||
line-height:normal !important;
|
line-height: normal !important;
|
||||||
text-rendering:auto;
|
text-rendering: auto;
|
||||||
-webkit-font-smoothing:antialiased;
|
-webkit-font-smoothing: antialiased;
|
||||||
-moz-osx-font-smoothing:grayscale;
|
-moz-osx-font-smoothing: grayscale;
|
||||||
color:#6699cc;
|
color: #167abf;
|
||||||
text-align:center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
.tabs-icon {
|
.tabs-icon {
|
||||||
font-size:16px !important;
|
font-size:16px !important;
|
||||||
|
|
|
@ -1,60 +1,30 @@
|
||||||
|
|
||||||
<div class="easyui-layout" style="width:100%;height:100%;">
|
<div title="作业" style="height:100%;">
|
||||||
<div id="content" data-options="region:'center'" style="padding:15px 15px;">
|
<table id="zytable" style="width:100%;height:100%"></table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<script type="text/javascript">
|
|
||||||
|
|
||||||
$.ajax({
|
|
||||||
type: "get",
|
|
||||||
url: "edu/api?a=detail",
|
|
||||||
dateType: "json",
|
|
||||||
success: function (data) {
|
|
||||||
|
|
||||||
json = eval(data.rows)
|
|
||||||
|
|
||||||
for (var i = 0; i < json.length; i++) {
|
|
||||||
|
|
||||||
var divHtml = '<div style="">文件名称:' + data.rows[i].title ;
|
|
||||||
|
|
||||||
$.ajax({
|
|
||||||
type: "get",
|
|
||||||
url: "edu/api?a=detailw",
|
|
||||||
data: { 'id': json[i].id },
|
|
||||||
dateType: "json",
|
|
||||||
async: false,
|
|
||||||
success: function (data) {
|
|
||||||
jsons = eval(data.rows)
|
|
||||||
divHtml += '<ul style="list-style-type:none">';
|
|
||||||
for (var j = 0; j < jsons.length; j++) {
|
|
||||||
divHtml += '<li style="line-height:30px;border: 1px solid red;"> 观看人:' + data.rows[j].user__name + ' |观看时间:' + data.rows[j].submittime + '</li>';
|
|
||||||
|
|
||||||
}
|
|
||||||
divHtml += '</ul>';
|
|
||||||
|
|
||||||
},
|
|
||||||
error: function () {
|
|
||||||
return false;
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
});
|
|
||||||
divHtml += '</div>'
|
|
||||||
$("#content").append(divHtml);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
},
|
|
||||||
error: function () {
|
|
||||||
return false;
|
|
||||||
},
|
|
||||||
async: false
|
|
||||||
});
|
|
||||||
|
|
||||||
</script>
|
var eduid = {{ jyid }};
|
||||||
|
var html;
|
||||||
|
|
||||||
|
$('#zytable').datagrid({
|
||||||
|
url: 'edu/api?a=detail&eduid=' + eduid,
|
||||||
|
rownumbers: true,
|
||||||
|
singleSelect: true,
|
||||||
|
striped: true,
|
||||||
|
fitColumns: true,
|
||||||
|
method: 'get',
|
||||||
|
pageSize: 20,
|
||||||
|
toolbar: '#zytablebar',
|
||||||
|
columns: [[
|
||||||
|
{ field: 'id', title: 'ID', hidden: true },
|
||||||
|
{ field: 'user__name', title: '观看人', width: 80 },
|
||||||
|
{ field: 'submittime', title: '观看时间', width: 80 }
|
||||||
|
]]
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
|
@ -6,7 +6,9 @@
|
||||||
<a id="deledu" class="easyui-linkbutton" onclick="deledu()" data-options="iconCls: 'fa-trash',plain:true">删除文件</a>
|
<a id="deledu" class="easyui-linkbutton" onclick="deledu()" data-options="iconCls: 'fa-trash',plain:true">删除文件</a>
|
||||||
|
|
||||||
<a id="tzdetail" onclick="tzdetail()" class="easyui-linkbutton" data-options="iconCls: 'fa-info-circle',plain:true">点击学习</a>
|
<a id="tzdetail" onclick="tzdetail()" class="easyui-linkbutton" data-options="iconCls: 'fa-info-circle',plain:true">点击学习</a>
|
||||||
<a id="edulook" class="easyui-linkbutton" onclick="javascript:opendg('观看历史','edu/detail')" data-options="iconCls: 'fa-plus',plain:true">观看历史</a>
|
<a id="edulook" class="easyui-linkbutton" onclick="jydetail()" data-options="iconCls: 'fa-plus',plain:true">观看历史</a>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div style="padding: 5px;float: left;width: 400px;">
|
<div style="padding: 5px;float: left;width: 400px;">
|
||||||
<label>查询</label>
|
<label>查询</label>
|
||||||
|
@ -57,7 +59,7 @@
|
||||||
editable: false,
|
editable: false,
|
||||||
onSelect: function (node) {
|
onSelect: function (node) {
|
||||||
if (node.value != 0) {
|
if (node.value != 0) {
|
||||||
$('#edutab').datagrid({ url: 'edu/api', queryParams: { a: node.value } });
|
$('#edutab').datagrid({ url: 'edu/selectDate', queryParams: { type: node.value } });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -139,5 +141,13 @@
|
||||||
$.messager.alert('提示', '请选择一行数据!');
|
$.messager.alert('提示', '请选择一行数据!');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
function jydetail() {
|
||||||
|
var row = $('#edutab').datagrid('getSelected');
|
||||||
|
if (row) {
|
||||||
|
var url = 'edu/html/edulessondetail/detail/' + row.id
|
||||||
|
|
||||||
|
opendg('观看详情', url)
|
||||||
|
}
|
||||||
|
else { $.messager.alert('提示', '请选择一行数据!'); }
|
||||||
|
}
|
||||||
</script>
|
</script>
|
Loading…
Reference in New Issue