update
This commit is contained in:
@@ -24,6 +24,7 @@ urlpatterns = [
|
||||
path('s_d', JsMindShareView.as_view()), # 获得导图详情
|
||||
path('delete', JsMindView.as_view()), # 删除思维导图
|
||||
path('share', JsMindShareView.as_view()), # 分享思维导图,查询等
|
||||
path('star', JsMindStarView.as_view()), # 收藏思维导图
|
||||
|
||||
# ---------------------------------------------------
|
||||
path('register', MindUserView.as_view()), # 用户注册
|
||||
|
||||
@@ -2,12 +2,10 @@ CODE_SUCCESS = 0
|
||||
CODE_FAILED = -1
|
||||
DUPLICATE = 1
|
||||
|
||||
snapshot_json_data = """{
|
||||
SNAPSHOT_JSON_DATA = """{
|
||||
"id": "root",
|
||||
"topic": "MindMap",
|
||||
"children": [
|
||||
{
|
||||
"id": "easy",
|
||||
"children": [{"id": "easy",
|
||||
"topic": "Easy",
|
||||
"direction": "left",
|
||||
"expanded": false,
|
||||
@@ -43,6 +41,4 @@ snapshot_json_data = """{
|
||||
"id": "other",
|
||||
"topic": "多人协作",
|
||||
"direction": "right"
|
||||
}
|
||||
]
|
||||
}"""
|
||||
}]}"""
|
||||
|
||||
@@ -62,7 +62,7 @@ class JsMindView(LoginRequiredJSONMixin, ListAPIView):
|
||||
"""
|
||||
coop_mind_name = request.data.get('mind_name')
|
||||
user = request.user
|
||||
snapshot_data = snapshot_json_data
|
||||
snapshot_data = SNAPSHOT_JSON_DATA
|
||||
data_format = 'node_tree'
|
||||
mind = CooperationMind(coop_mind_name=coop_mind_name, client_uuid='', mind_log_id=-1, creator_user_id=user.id, snapshot_data=snapshot_data, data_format=data_format)
|
||||
mind.save()
|
||||
@@ -190,3 +190,12 @@ class JsMindShareView(LoginRequiredJSONMixin, ListAPIView):
|
||||
return build_response(code=CODE_FAILED, msg='用户未登录')
|
||||
res = CooperationMindShare.objects.filter(coop_mind_id=id, operator_user_id=user.id).delete()
|
||||
return build_response(msg="操作成功", data=res[0])
|
||||
|
||||
|
||||
class JsMindStarView(LoginRequiredJSONMixin, ListAPIView):
|
||||
"""
|
||||
收藏
|
||||
"""
|
||||
|
||||
def get(self, request, *args, **kwargs):
|
||||
pass
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
this.jm.coop.clear_timer()
|
||||
}
|
||||
},
|
||||
show_mind: function (name, data_format, data) {
|
||||
show_mind: function (name, data_format, data_resp) {
|
||||
// options
|
||||
const options = {
|
||||
container: 'jsmind_container',
|
||||
@@ -134,8 +134,8 @@
|
||||
// eslint-disable-next-line new-cap
|
||||
let jsMind = window.jsMind
|
||||
this.jm = new jsMind(options)
|
||||
if (data) {
|
||||
mind.data = data
|
||||
if (data_resp) {
|
||||
mind.data = data_resp
|
||||
}
|
||||
this.jm.show(mind)
|
||||
},
|
||||
@@ -156,7 +156,7 @@
|
||||
<!-- -->
|
||||
<div style="position: absolute;top: 0px;z-index: 1000;cursor: pointer;" onclick="xxObj.collapse_all()"><span data-feather="folder-minus"></span><span class="un_selected">折叠</span></div>
|
||||
<div style="position: absolute;top: 0px;left:80px;z-index: 1000;cursor: pointer;" onclick="xxObj.expand_all()"><span data-feather="folder-plus"></span><span class="un_selected">展开</span></div>
|
||||
<div style="position: absolute;top: 0px;left:160px;z-index: 1000;cursor: pointer;" onclick="xxObj.star()"><span data-feather="star"></span><span class="un_selected">收藏</span></div>
|
||||
<div style="position: absolute;top: 0px;left:160px;z-index: 1000;cursor: pointer;" onclick="xxObj.star()"><span data-feather="star"></span><span class="selected">收藏</span></div>
|
||||
<h3 id="h1" style="text-align: center;max-height: 40px;"></h3>
|
||||
<div id="jsmind_container"></div>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user