g
This commit is contained in:
+14
-7
@@ -41,21 +41,28 @@
|
||||
const me = this
|
||||
$.get('list?id=' + id, function (resp) {
|
||||
// reset
|
||||
me.destroy_coop_timer_if_necessary()
|
||||
me.close_coop_timer_if_necessary()
|
||||
|
||||
// show
|
||||
let data = resp.data.snapshot_data
|
||||
let snapshot_data = resp.data.snapshot_data
|
||||
me.coop_mind_id = id
|
||||
me.coop_mind_log_id = resp.data.log_id
|
||||
me.show_mind(resp.data.coop_mind_name, JSON.parse(data))
|
||||
|
||||
const resp_data = resp.data
|
||||
me.coop_mind_log_id = resp_data.log_id
|
||||
const data_format = resp_data.data_format
|
||||
|
||||
// node_tree 和 node_array 需要被转成对象,freemind 不需要
|
||||
snapshot_data = data_format === 'node_tree' || data_format === 'node_array' ? JSON.parse(snapshot_data) : snapshot_data
|
||||
me.show_mind(resp.data.coop_mind_name, data_format, snapshot_data)
|
||||
})
|
||||
},
|
||||
// 清除定时任务等
|
||||
destroy_coop_timer_if_necessary() {
|
||||
close_coop_timer_if_necessary() {
|
||||
if (this.jm && this.jm.coop) {
|
||||
this.jm.coop.clear_timer()
|
||||
}
|
||||
},
|
||||
show_mind: function (name, data) {
|
||||
show_mind: function (name, data_format, data) {
|
||||
// options
|
||||
const options = {
|
||||
container: 'jsmind_container',
|
||||
@@ -87,7 +94,7 @@
|
||||
/* 元数据,定义思维导图的名称、作者、版本等信息 */
|
||||
meta: {name: name, author: 'cy20081118148@163.com', version: '0.2'},
|
||||
/* 数据格式声明 */
|
||||
format: 'node_tree',
|
||||
format: data_format,
|
||||
/* 数据内容 */
|
||||
data: {id: 'root', topic: 'jsMind'}
|
||||
}
|
||||
|
||||
@@ -72,6 +72,7 @@
|
||||
<td>
|
||||
<i class="layui-icon layui-icon-edit" style="font-size: 15px; color: #1E9FFF;cursor: pointer;" onclick="window.open('detail?id=${item.id}')">编辑</i>
|
||||
<i class="layui-icon layui-icon-share" style="font-size: 15px; color: #1E9FFF;cursor: pointer;margin-left: 10px;">复制分享</i>
|
||||
<i class="layui-icon layui-icon-delete" style="font-size: 15px; color: #1E9FFF;cursor: pointer;margin-left: 10px;">删除</i>
|
||||
</td>
|
||||
</tr>`
|
||||
$('#layui-table tbody').append(tr)
|
||||
@@ -216,7 +217,7 @@
|
||||
]
|
||||
}
|
||||
// post start
|
||||
$.post('create', {'mind_name': mind_name, 'snapshot_data': view.json2string(snapshot_data)}, function (resp) {
|
||||
$.post('create', {'mind_name': mind_name, 'data_format': 'node_tree', 'snapshot_data': view.json2string(snapshot_data)}, function (resp) {
|
||||
layer.closeAll()
|
||||
view.fetch_data()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user