update
This commit is contained in:
+3
-3
@@ -37,7 +37,7 @@ class CooperationMindLog(AbstractModel):
|
|||||||
"""
|
"""
|
||||||
操作日志表
|
操作日志表
|
||||||
"""
|
"""
|
||||||
coop_mind_id = models.BigIntegerField(verbose_name='脑图ID', null=False, blank=False)
|
coop_mind = models.ForeignKey(to="CooperationMind", to_field="id", verbose_name="脑图ID", on_delete=models.CASCADE)
|
||||||
log_uuid = models.CharField(verbose_name='操作UUID', max_length=64, null=False, blank=False)
|
log_uuid = models.CharField(verbose_name='操作UUID', max_length=64, null=False, blank=False)
|
||||||
log_content = models.CharField(verbose_name='操作内容', max_length=1024, null=False, blank=False)
|
log_content = models.CharField(verbose_name='操作内容', max_length=1024, null=False, blank=False)
|
||||||
operator_user_id = models.BigIntegerField(verbose_name='操作人', null=True)
|
operator_user_id = models.BigIntegerField(verbose_name='操作人', null=True)
|
||||||
@@ -59,7 +59,7 @@ class CooperationMindShare(AbstractModel):
|
|||||||
"""
|
"""
|
||||||
分享记录表
|
分享记录表
|
||||||
"""
|
"""
|
||||||
coop_mind_id = models.BigIntegerField(verbose_name='脑图ID', null=False, blank=False)
|
coop_mind = models.ForeignKey(to="CooperationMind", to_field="id", verbose_name="脑图ID", on_delete=models.CASCADE)
|
||||||
coop_mind_name = models.CharField(verbose_name='脑图名称', max_length=128, null=False, blank=False)
|
coop_mind_name = models.CharField(verbose_name='脑图名称', max_length=128, null=False, blank=False)
|
||||||
share_uuid = models.CharField(verbose_name='分享uuid', max_length=128, null=False, blank=False)
|
share_uuid = models.CharField(verbose_name='分享uuid', max_length=128, null=False, blank=False)
|
||||||
share_uuid_hash = models.BigIntegerField(verbose_name='分享uuid_hash', null=False, blank=False)
|
share_uuid_hash = models.BigIntegerField(verbose_name='分享uuid_hash', null=False, blank=False)
|
||||||
@@ -80,7 +80,7 @@ class CooperationMindStar(AbstractModel):
|
|||||||
收藏记录表
|
收藏记录表
|
||||||
"""
|
"""
|
||||||
user_id = models.BigIntegerField(verbose_name='收藏人', null=False)
|
user_id = models.BigIntegerField(verbose_name='收藏人', null=False)
|
||||||
coop_mind_id = models.BigIntegerField(verbose_name='脑图ID', null=False, blank=False)
|
coop_mind = models.ForeignKey(to="CooperationMind", to_field="id", verbose_name="脑图ID", on_delete=models.CASCADE)
|
||||||
coop_mind_name = models.CharField(verbose_name='脑图名称', max_length=128, null=False, blank=False)
|
coop_mind_name = models.CharField(verbose_name='脑图名称', max_length=128, null=False, blank=False)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ class JsMindView(LoginRequiredJSONMixin, ListAPIView):
|
|||||||
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' == src_page:
|
||||||
share = CooperationMindShare.objects.filter(coop_mind_id=OuterRef('id'))
|
share = CooperationMindShare.objects.filter(coop_mind_id=OuterRef('id'))
|
||||||
self.queryset = CooperationMind.objects.annotate(share_new=Exists(share), ).filter(share_new=1)
|
self.queryset = CooperationMind.objects.annotate(share_new=Exists(share), ).filter(share_new=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")
|
||||||
@@ -123,7 +123,7 @@ class JsMindShareView(LoginRequiredJSONMixin, ListAPIView):
|
|||||||
|
|
||||||
def get(self, request, *args, **kwargs):
|
def get(self, request, *args, **kwargs):
|
||||||
"""
|
"""
|
||||||
通过链接即uuid获得分享的导图,默认有uuid就能进入界面查看
|
通过链接即uuid、hash获得分享的导图详情
|
||||||
"""
|
"""
|
||||||
share_uuid_hash = request.GET.get('h')
|
share_uuid_hash = request.GET.get('h')
|
||||||
share_uuid = request.GET.get('u')
|
share_uuid = request.GET.get('u')
|
||||||
|
|||||||
@@ -112,7 +112,8 @@
|
|||||||
<a class="dropdown-item" href="javascript:void(0);" onclick="mind.del_mind(${item.id},'card_${uuid}')">删除</a>
|
<a class="dropdown-item" href="javascript:void(0);" onclick="mind.del_mind(${item.id},'card_${uuid}')">删除</a>
|
||||||
<a class="dropdown-item" href="javascript:void(0);" onclick="mind.share_mind(${item.id})">分享</a>`
|
<a class="dropdown-item" href="javascript:void(0);" onclick="mind.share_mind(${item.id})">分享</a>`
|
||||||
} else if (src_page === 'share') {
|
} else if (src_page === 'share') {
|
||||||
sub_btn = `<a class="dropdown-item" href="javascript:void(0);" onclick="mind.share_cancel(${item.id})">取消分享</a>`
|
sub_btn = `<a class="dropdown-item" href="javascript:void(0);" onclick="mind.share_cancel(${item.id})">取消分享</a>
|
||||||
|
<a class="dropdown-item" href="javascript:void(0);" onclick="">查看分享链接</a>`
|
||||||
}
|
}
|
||||||
|
|
||||||
const content = `<div class="card col-2" style="margin: 6px; margin-left: 20px;" id='card_${uuid}'>
|
const content = `<div class="card col-2" style="margin: 6px; margin-left: 20px;" id='card_${uuid}'>
|
||||||
@@ -139,9 +140,17 @@
|
|||||||
async: false
|
async: false
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
/**显示分享链接*/
|
||||||
|
show_share_url: function (u, h) {
|
||||||
|
const url = `s_2_d?u=${u}&h=${h}`
|
||||||
|
$('#share_mind_modal .modal-body').html(`分享成功,请复制以下链接进行分享:<div>${window.location.protocol}//${window.location.host}/${url}</div>`)
|
||||||
|
$('#share_mind_modal_a').click()
|
||||||
|
},
|
||||||
/**分页组件*/
|
/**分页组件*/
|
||||||
init_pagination: function (count, page_size) {
|
init_pagination: function (count, page_size) {
|
||||||
/**计算页数*/
|
/**计算页数*/
|
||||||
|
if (count <= 0) return
|
||||||
|
|
||||||
const all_page = (count <= page_size) ? 1 : (count % page_size > 0) ? Math.floor(count / page_size) + 1 : Math.floor(count / page_size)
|
const all_page = (count <= page_size) ? 1 : (count % page_size > 0) ? Math.floor(count / page_size) + 1 : Math.floor(count / page_size)
|
||||||
const container = $('#pagination_div')
|
const container = $('#pagination_div')
|
||||||
const navigation = $(`<nav aria-label="Page navigation example"></nav>`)
|
const navigation = $(`<nav aria-label="Page navigation example"></nav>`)
|
||||||
@@ -197,9 +206,7 @@
|
|||||||
data: {'id': mind_id},
|
data: {'id': mind_id},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
success: function (resp) {
|
success: function (resp) {
|
||||||
const url = `s_2_d?u=${resp.data.u}&h=${resp.data.h}`
|
me.show_share_url(`${resp.data.u}`, `${resp.data.h}`)
|
||||||
$('#share_mind_modal .modal-body').html(`分享成功,请复制以下链接进行分享:<div>${window.location.protocol}//${window.location.host}/${url}</div>`)
|
|
||||||
$('#share_mind_modal_a').click()
|
|
||||||
},
|
},
|
||||||
async: false
|
async: false
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user