update
This commit is contained in:
@@ -19,6 +19,7 @@ urlpatterns = [
|
||||
path('list', JsMindView.as_view()), # 查询思维导图
|
||||
path('delete', JsMindView.as_view()), # 删除思维导图
|
||||
path('share', JsMindShareView.as_view()), # 分享思维导图
|
||||
path('jp', to_share), # 跳转
|
||||
path('4cbcb74630898f41fd0a', JsMindShareView.as_view()), # 通过分享链接查看
|
||||
path(r'jsmind_op', JsMindLogView.as_view()), # 更新快照,get日志
|
||||
|
||||
|
||||
@@ -21,3 +21,10 @@ def to_detail(request):
|
||||
"""
|
||||
param = {'id': request.GET.get('id')}
|
||||
return render(request, "html/detail.html", param)
|
||||
|
||||
|
||||
def to_share(request):
|
||||
"""
|
||||
"""
|
||||
param = {'h': request.GET.get('h'), 'u': request.GET.get('u')}
|
||||
return render(request, "html/detail.html", param)
|
||||
|
||||
@@ -143,4 +143,4 @@ class JsMindShareView(LoginRequiredJSONMixin, APIView):
|
||||
return build_response(data={"u": uuid_str, "h": share_uuid_hash})
|
||||
|
||||
# 重复分享
|
||||
return build_response(code=DUPLICATE, data=share.share_uuid)
|
||||
return build_response(code=DUPLICATE, data={"u": share.share_uuid, "h": share.share_uuid_hash})
|
||||
|
||||
@@ -177,7 +177,9 @@
|
||||
dataType: "json",
|
||||
success: function (resp) {
|
||||
console.log(resp)
|
||||
console.log(`${window.location.protocol}//${window.location.host}/4cbcb74630898f41fd0a?u=${resp.data.u}&h=${resp.data.h}`)
|
||||
console.log()
|
||||
const url = `jp?u=${resp.data.u}&h=${resp.data.h}`
|
||||
window.open(url)
|
||||
},
|
||||
async: false
|
||||
});
|
||||
|
||||
+11
-3
@@ -44,9 +44,13 @@
|
||||
},
|
||||
loadMind: function () {
|
||||
// 打开已有脑图1、查询数据,组装option 2、实例化jm、show
|
||||
let id = {{ id }};
|
||||
const me = this
|
||||
$.get('list?id=' + id, function (resp) {
|
||||
let id = `{{ id }}`;
|
||||
let u = `{{ u }}`;
|
||||
let h = `{{ h }}`;
|
||||
const me = this;
|
||||
const from_share = id.length === 0;
|
||||
const url = from_share ? `4cbcb74630898f41fd0a?u=${u}&h=${h}` : 'list?id=' + id;
|
||||
$.get(url, function (resp) {
|
||||
// reset
|
||||
me.close_coop_timer_if_necessary()
|
||||
|
||||
@@ -59,6 +63,10 @@
|
||||
const data_format = resp_data.data_format
|
||||
const coop_mind_name = resp.data.coop_mind_name
|
||||
|
||||
if (from_share) {
|
||||
me.coop_mind_id = resp_data.id
|
||||
}
|
||||
|
||||
// node_tree 和 node_array 需要被转成对象,freemind 不需要
|
||||
snapshot_data = (data_format === 'node_tree' || data_format === 'node_array') ? JSON.parse(snapshot_data) : snapshot_data
|
||||
me.show_mind(coop_mind_name, data_format, snapshot_data)
|
||||
|
||||
Reference in New Issue
Block a user