This commit is contained in:
aqu415
2022-02-13 13:53:39 +08:00
parent a7a6efc18b
commit f3b356ac5c
+18 -2
View File
@@ -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()
}) })
}, },
@@ -87,8 +91,18 @@
//执行一个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
, count: me.count //数据总数,从服务端得到
, limit: me.limit // 每页显示的条数。 , 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>