diff --git a/static/html/list.html b/static/html/list.html
index 27e52e6..0d5fef4 100644
--- a/static/html/list.html
+++ b/static/html/list.html
@@ -51,8 +51,8 @@
fetch_data: function () {
const me = this
const get_param = {'page': this.current_page, 'page_size': this.limit}
- if (this.get_coop_mind_name()) {
- get_param.coop_mind_name = this.get_coop_mind_name()
+ if (this.get_search_coop_mind_name()) {
+ get_param.coop_mind_name = this.get_search_coop_mind_name()
}
$.get('list', get_param, function (resp) {
// 清空数据
@@ -78,7 +78,7 @@
me.auto_page_bar()
})
},
- get_coop_mind_name: function () {
+ get_search_coop_mind_name: function () {
return $('#mind_name').val()
},
// 显示分页组件
@@ -126,17 +126,35 @@
view.fetch_data()
- // 绑定事件
+ // 搜索
+ $('#search').click(function () {
+ view.fetch_data()
+ })
+ // 清空
+ $('#clear').click(function () {
+ $('#mind_name').val('')
+ view.fetch_data()
+ })
+ // 创建
$('#crt_out').click(function () {
+ const content_html = `
`
layer.open({
type: 1,
- content: $('#layer_open'), //这里content是一个DOM,注意:最好该元素要存放在body最外层,否则可能被其它的相对元素所影响
+ content: content_html, //这里content是一个DOM,注意:最好该元素要存放在body最外层,否则可能被其它的相对元素所影响
area: ['400px', '200px']
});
+
+ // 调用后台创建脑图
+ $('#crt_inner').click(crt_inner)
+ //
})
- // 调用后台创建脑图
- $('#crt_inner').click(function () {
+ function crt_inner() {
const mind_name = $('#mind_name_crt').val()
if (mind_name) {
const snapshot_data = {
@@ -158,8 +176,8 @@
{
id: 'open',
topic: 'Open Source',
- direction: 'right',
- expanded: true,
+ direction: 'left',
+ expanded: false,
children: [
{id: 'open1', topic: 'on GitHub'},
{id: 'open2', topic: 'BSD License'}
@@ -169,6 +187,7 @@
id: 'powerful',
topic: 'Powerful',
direction: 'right',
+ expanded: false,
children: [
{id: 'powerful1', topic: 'Base on Javascript'},
{id: 'powerful2', topic: 'Base on HTML5'},
@@ -185,15 +204,16 @@
}
]
}
- //
+ // post start
$.post('create', {'mind_name': mind_name, 'snapshot_data': view.json2string(snapshot_data)}, function (resp) {
layer.closeAll()
view.fetch_data()
})
+ // post end
} else {
layer.msg('请输入导图名称')
}
- })
+ }
//
})
@@ -203,7 +223,8 @@
-
+
+
-
-
-
-