无集团共享分类不显示;tree无限重复bug
This commit is contained in:
parent
9a4a71b152
commit
1c597970ff
|
@ -248,6 +248,12 @@ function convert(rows, x) {
|
|||
}
|
||||
}
|
||||
}
|
||||
for (var i = 0; i < nodes.length; i++) {
|
||||
var row = nodes[i];
|
||||
if(!row.children){
|
||||
row.state = 'open'
|
||||
}
|
||||
}
|
||||
return nodes;
|
||||
}
|
||||
//关闭dialog-dd
|
||||
|
|
|
@ -6577,11 +6577,12 @@ def apiquestioncat(req):
|
|||
elif a == 'tree3':
|
||||
groups = g_models.Groupmember.objects.filter(member__partid=companyid).values_list('group__id', flat=True)
|
||||
companys = g_models.Groupmember.objects.filter(group__id__in=groups).values_list('member__partid', flat=True).distinct()
|
||||
list_items = []
|
||||
for i in companys:
|
||||
list_item = (Questioncat.objects.filter(usecomp=i, deletemark=1)).annotate(
|
||||
parentId=F('parent__id')).values('id', 'parentId', 'name')
|
||||
list_items.extend(list_item)
|
||||
if companys:
|
||||
pass
|
||||
else:
|
||||
companys = Partment.objects.filter(partid=companyid).values_list('partid', flat=True)
|
||||
list_items = (Questioncat.objects.filter(usecomp__in=companys, deletemark=1)).annotate(
|
||||
parentId=F('parent__id')).values('id', 'parentId', 'name')
|
||||
return HttpResponse(json.dumps(list(list_items)), content_type="application/json")
|
||||
elif a == 'tree':
|
||||
list_items = (Questioncat.objects.filter(usecomp__partid=1, deletemark=1) | Questioncat.objects.filter(
|
||||
|
|
Loading…
Reference in New Issue