回收站查询
This commit is contained in:
@@ -16,6 +16,7 @@ urlpatterns = [
|
|||||||
path('s_2_d', share_to_detail), # 从分享链接跳转详细界面
|
path('s_2_d', share_to_detail), # 从分享链接跳转详细界面
|
||||||
path('2_share', to_share), # 到分享界面
|
path('2_share', to_share), # 到分享界面
|
||||||
path('2_star', to_star), # 到收藏界面
|
path('2_star', to_star), # 到收藏界面
|
||||||
|
path('2_recycle', to_recycle), # 回收站
|
||||||
path(r'jsmind_op', JsMindLogView.as_view()), # 更新快照,get日志操作
|
path(r'jsmind_op', JsMindLogView.as_view()), # 更新快照,get日志操作
|
||||||
|
|
||||||
# ---------------------------------------------------
|
# ---------------------------------------------------
|
||||||
|
|||||||
@@ -25,6 +25,14 @@ def to_star(request):
|
|||||||
return render(request, "html/dashboard.html", param)
|
return render(request, "html/dashboard.html", param)
|
||||||
|
|
||||||
|
|
||||||
|
def to_recycle(request):
|
||||||
|
"""
|
||||||
|
回收站
|
||||||
|
"""
|
||||||
|
param = {"page": "recycle"}
|
||||||
|
return render(request, "html/dashboard.html", param)
|
||||||
|
|
||||||
|
|
||||||
def to_detail(request):
|
def to_detail(request):
|
||||||
"""
|
"""
|
||||||
详情页面
|
详情页面
|
||||||
|
|||||||
@@ -30,9 +30,9 @@ class JsMindView(LoginRequiredJSONMixin, ListAPIView):
|
|||||||
"""
|
"""
|
||||||
pk = request.GET.get('id')
|
pk = request.GET.get('id')
|
||||||
# 页面源
|
# 页面源
|
||||||
src_page = request.GET.get('s_p')
|
page_tag = request.GET.get('s_p')
|
||||||
user = request.user
|
user = request.user
|
||||||
if src_page is None or user.id is None:
|
if page_tag is None or user.id is None:
|
||||||
return build_response(code=CODE_FAILED, msg="参数错误")
|
return build_response(code=CODE_FAILED, msg="参数错误")
|
||||||
|
|
||||||
print('list current user: %s' % user)
|
print('list current user: %s' % user)
|
||||||
@@ -46,14 +46,20 @@ class JsMindView(LoginRequiredJSONMixin, ListAPIView):
|
|||||||
return build_response(data=serializer.data)
|
return build_response(data=serializer.data)
|
||||||
|
|
||||||
# 查询列表
|
# 查询列表
|
||||||
if 'b9b101e' == src_page:
|
if 'b9b101e' == page_tag:
|
||||||
|
# 我的文件
|
||||||
self.queryset = CooperationMind.objects.filter(creator_user_id=user.id, deleted=0).values('id', 'coop_mind_name', "client_uuid", "data_format")
|
self.queryset = CooperationMind.objects.filter(creator_user_id=user.id, deleted=0).values('id', 'coop_mind_name', "client_uuid", "data_format")
|
||||||
elif 'share' == src_page:
|
elif 'share' == page_tag:
|
||||||
|
# 我的分享
|
||||||
share = CooperationMindShare.objects.filter(coop_mind_id=OuterRef('id'), operator_user_id=user.id)
|
share = CooperationMindShare.objects.filter(coop_mind_id=OuterRef('id'), operator_user_id=user.id)
|
||||||
self.queryset = CooperationMind.objects.annotate(share_col=Exists(share), ).filter(share_col=1, deleted=0).values('id', 'coop_mind_name', "client_uuid", "data_format")
|
self.queryset = CooperationMind.objects.annotate(share_col=Exists(share), ).filter(share_col=1, deleted=0).values('id', 'coop_mind_name', "client_uuid", "data_format")
|
||||||
elif 'star' == src_page:
|
elif 'star' == page_tag:
|
||||||
|
# 我的收藏
|
||||||
star = CooperationMindStar.objects.filter(coop_mind_id=OuterRef('id'), operator_user_id=user.id)
|
star = CooperationMindStar.objects.filter(coop_mind_id=OuterRef('id'), operator_user_id=user.id)
|
||||||
self.queryset = CooperationMind.objects.annotate(star_col=Exists(star), ).filter(star_col=1, deleted=0).values('id', 'coop_mind_name', "client_uuid", "data_format")
|
self.queryset = CooperationMind.objects.annotate(star_col=Exists(star), ).filter(star_col=1, deleted=0).values('id', 'coop_mind_name', "client_uuid", "data_format")
|
||||||
|
elif 'recycle' == page_tag:
|
||||||
|
# 回收站
|
||||||
|
self.queryset = CooperationMind.objects.filter(creator_user_id=user.id, deleted=1).values('id', 'coop_mind_name', "client_uuid", "data_format")
|
||||||
else:
|
else:
|
||||||
# 不返回数据
|
# 不返回数据
|
||||||
self.queryset = CooperationMind.objects.filter(creator_user_id=-100).values('id', 'coop_mind_name', "client_uuid", "data_format")
|
self.queryset = CooperationMind.objects.filter(creator_user_id=-100).values('id', 'coop_mind_name', "client_uuid", "data_format")
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
this.uuid = (new Date().getTime().toString(16) + Math.random().toString(16).substr(2)).substr(2, 16)
|
this.uuid = (new Date().getTime().toString(16) + Math.random().toString(16).substr(2)).substr(2, 16)
|
||||||
this.current_page_num = 1
|
this.current_page_num = 1
|
||||||
this.default_page_size = 15
|
this.default_page_size = 15
|
||||||
this.title_map = new Map([["main", "全部文件"], ["share", "我的分享"], ["star", "我的收藏"]]);// k-v 的形式
|
this.title_map = new Map([["main", "我的文件"], ["share", "我的分享"], ["star", "我的收藏"], ["recycle", "回收站"]]);// k-v 的形式
|
||||||
}
|
}
|
||||||
|
|
||||||
DefaultView.prototype = {
|
DefaultView.prototype = {
|
||||||
@@ -503,7 +503,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="javascript:void(0);">
|
<a class="nav-link" href="/2_recycle">
|
||||||
<span data-feather="trash-2"></span>
|
<span data-feather="trash-2"></span>
|
||||||
回收站
|
回收站
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
Reference in New Issue
Block a user