update
This commit is contained in:
+27
-8
@@ -125,9 +125,19 @@
|
|||||||
view.init()
|
view.init()
|
||||||
view.fetch_data()
|
view.fetch_data()
|
||||||
|
|
||||||
|
|
||||||
// 绑定事件
|
// 绑定事件
|
||||||
$('#c_').click(function () {
|
$('#crt_out').click(function () {
|
||||||
const mind_name = $('#mind_name').val()
|
layer.open({
|
||||||
|
type: 1,
|
||||||
|
content: $('#layer_open'), //这里content是一个DOM,注意:最好该元素要存放在body最外层,否则可能被其它的相对元素所影响
|
||||||
|
area: ['400px', '200px']
|
||||||
|
});
|
||||||
|
})
|
||||||
|
|
||||||
|
// 调用后台创建脑图
|
||||||
|
$('#crt_inner').click(function () {
|
||||||
|
const mind_name = $('#mind_name_crt').val()
|
||||||
if (mind_name) {
|
if (mind_name) {
|
||||||
const snapshot_data = {
|
const snapshot_data = {
|
||||||
id: 'root',
|
id: 'root',
|
||||||
@@ -170,30 +180,31 @@
|
|||||||
topic: 'test node',
|
topic: 'test node',
|
||||||
direction: 'left',
|
direction: 'left',
|
||||||
children: [
|
children: [
|
||||||
{id: 'other1', topic: "I'm from local variable"},
|
{id: 'other1', topic: "多人协作"},
|
||||||
{id: 'other2', topic: 'I can do everything'}
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
//
|
||||||
$.post('create', {'mind_name': mind_name, 'snapshot_data': view.json2string(snapshot_data)}, function (resp) {
|
$.post('create', {'mind_name': mind_name, 'snapshot_data': view.json2string(snapshot_data)}, function (resp) {
|
||||||
console.log(resp)
|
layer.closeAll()
|
||||||
view.fetch_data()
|
view.fetch_data()
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
layer.msg('请输入导图名称')
|
layer.msg('请输入导图名称')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
//
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div style="margin-top: 5px;">
|
<div style="margin-top: 5px;">
|
||||||
<div class="layui-input-inline">
|
<div class="layui-input-inline">
|
||||||
<input name="mind_name" required lay-verify="required" autocomplete="off" class="layui-input" id="mind_name" value="pp">
|
<input autocomplete="off" class="layui-input" id="mind_name">
|
||||||
</div>
|
</div>
|
||||||
<button type="button" class="layui-btn" id="c_">创建导图</button>
|
|
||||||
<button type="button" class="layui-btn">搜索</button>
|
<button type="button" class="layui-btn">搜索</button>
|
||||||
|
<button type="button" class="layui-btn" id="crt_out">创建导图</button>
|
||||||
</div>
|
</div>
|
||||||
<table class="layui-table" id="layui-table">
|
<table class="layui-table" id="layui-table">
|
||||||
<colgroup>
|
<colgroup>
|
||||||
@@ -213,9 +224,17 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<div id="page_bar"></div>
|
<div id="page_bar"></div>
|
||||||
|
|
||||||
|
<!-- 弹出层 start-->
|
||||||
|
<div style="display: none;margin-left: 30px;margin-top: 20px;" id="layer_open">
|
||||||
|
<div class="layui-input-inline">
|
||||||
|
<div class="layui-input-inline"><input required autocomplete="off" class="layui-input" id="mind_name_crt" value="pp"></div>
|
||||||
|
</div>
|
||||||
|
<button type="button" class="layui-btn" id="crt_inner">创建</button>
|
||||||
|
</div>
|
||||||
|
<!-- 弹出层 end-->
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user