update
This commit is contained in:
+20
-4
@@ -37,8 +37,11 @@
|
|||||||
// 当前页
|
// 当前页
|
||||||
this.current_page = 1
|
this.current_page = 1
|
||||||
// 每页条数
|
// 每页条数
|
||||||
this.limit = 50
|
this.limit = 10
|
||||||
|
// 总条数
|
||||||
|
this.count = 0
|
||||||
|
|
||||||
|
// 参数
|
||||||
this.options = options
|
this.options = options
|
||||||
this.opts = {"h": 'oo'}
|
this.opts = {"h": 'oo'}
|
||||||
}
|
}
|
||||||
@@ -75,6 +78,7 @@
|
|||||||
})
|
})
|
||||||
|
|
||||||
// 分页组件
|
// 分页组件
|
||||||
|
me.count = resp.count
|
||||||
me.auto_page_bar()
|
me.auto_page_bar()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -86,9 +90,19 @@
|
|||||||
const me = this
|
const me = this
|
||||||
//执行一个laypage实例
|
//执行一个laypage实例
|
||||||
laypage.render({
|
laypage.render({
|
||||||
elem: me.opts.page_bar_elem //注意,这里的 test1 是 ID,不用加 # 号
|
elem: me.opts.page_bar_elem //注意,这里的 test1 是 ID,不用加 # 号
|
||||||
, count: 50 //数据总数,从服务端得到
|
, curr: me.current_page
|
||||||
, limit: me.limit // 每页显示的条数。
|
, count: me.count //数据总数,从服务端得到
|
||||||
|
, limit: me.limit // 每页显示的条数。
|
||||||
|
, layout: ['count', 'prev', 'page', 'next', 'limit']
|
||||||
|
, jump: function (obj, first) {
|
||||||
|
//obj包含了当前分页的所有参数,比如:
|
||||||
|
me.current_page = obj.curr
|
||||||
|
me.limit = obj.limit
|
||||||
|
if (!first) {
|
||||||
|
me.fetch_data()
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 合并属性
|
// 合并属性
|
||||||
@@ -208,12 +222,14 @@
|
|||||||
$.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) {
|
||||||
layer.closeAll()
|
layer.closeAll()
|
||||||
view.fetch_data()
|
view.fetch_data()
|
||||||
|
console.log(resp)
|
||||||
})
|
})
|
||||||
// post end
|
// post end
|
||||||
} else {
|
} else {
|
||||||
layer.msg('请输入导图名称')
|
layer.msg('请输入导图名称')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user