diff --git a/safesite/edu/urls.py b/safesite/edu/urls.py index 241ae9e1..3bf19db2 100644 --- a/safesite/edu/urls.py +++ b/safesite/edu/urls.py @@ -2,12 +2,12 @@ from django.urls import path from . import views urlpatterns = [ - path('', views.index), - path('add',views.add), path('addwj',views.addwj), path('api',views.api), path('selectDate',views.selectDate),#查询 path('api/upload',views.upload),#上传 path('eduvideoshow',views.showvideo), path('html/edulessondetail/detail//', views.edulessondetail),#观看历史 + path('file/edit//',views.edulessonedit), + path('', views.index), ] diff --git a/safesite/edu/views.py b/safesite/edu/views.py index 241ee8e6..848efed1 100644 --- a/safesite/edu/views.py +++ b/safesite/edu/views.py @@ -36,6 +36,8 @@ def addwj(req): def edulessondetail(req,jyid): return render(req,'edulessondetail.html',{'jyid':jyid}) +def edulessonedit(req,id): + return render(req,'edulessonedit.html',{'id':id}) #上传视频,文件,返回地址和名称 def upload(req): username = User.objects.get(userid=req.session['userid']).username diff --git a/safesite/static/safesite/mystatic/js/util.js b/safesite/static/safesite/mystatic/js/util.js index 0714c6d0..f415e7f0 100644 --- a/safesite/static/safesite/mystatic/js/util.js +++ b/safesite/static/safesite/mystatic/js/util.js @@ -194,12 +194,22 @@ function convert(rows, x) { for (var i = 0; i < rows.length; i++) { var row = rows[i]; if (!exists(rows, row.parentId)) { - nodes.push({ + let node = { id: row.id, text: row.name, state: x, pic: row.pic - }); + } + if(row.name=='默认分类'){ + node = { + id: row.id, + text: row.name, + state: 'closed', + pic: row.pic + } + } + + nodes.push(node); } } diff --git a/safesite/templates/edulessonaddwj.html b/safesite/templates/edulessonaddwj.html index c256c85f..aec9942d 100644 --- a/safesite/templates/edulessonaddwj.html +++ b/safesite/templates/edulessonaddwj.html @@ -182,6 +182,17 @@ diff --git a/safesite/templates/edulessonindex.html b/safesite/templates/edulessonindex.html index 0e603f14..ec8e37d7 100644 --- a/safesite/templates/edulessonindex.html +++ b/safesite/templates/edulessonindex.html @@ -15,12 +15,15 @@
{% load myfilter %} - {% if request|has_permission:'b_edu_addvideo' %} + {% if request|has_permission:'b_edu_addfile' %} - 上传文件 + 上传资料 {% endif %} + {% if request|has_permission:'b_edu_del' %} 删除文件 {% endif %} @@ -165,4 +168,15 @@ } else { $.messager.alert('提示', '请选择一行数据!'); } } + function editedu(){ + var row = $('#edutab').datagrid('getSelected'); + if (row) { + var url = 'edu/file/edit/' + row.id + opendg('编辑资料',url) + + } + else { + $.messager.alert('提示', '请选择一行数据!'); + } + } \ No newline at end of file