使用的layui的一些
<button type="button" class="layui-btn layui-btn-md" lay-submit="create" lay-filter="create"、id="create">
创建
</button>
<button type="button" class="layui-btn layui-btn-md" lay-submit="add" lay-filter="add" id="add">
新增
</button>
<button type="button" class="layui-btn layui-btn-md" lay-submit="show" lay-filter="show" id="show">
获取
</button>
<button type="button" class="layui-btn layui-btn-md" lay-submit="update" lay-filter="update" id="update">
更改
</button>
打开数据库
$(document).on('click', "#create", function() {
console.log("点击了打开")
indexedDB.createDB("zxdManage", '1', 'userInfo', 'cmId', ['contact', 'logisticCompanyId'])
});
新增数据
var info=[]
for (var i in info) {
indexedDB.addDB('userInfo', info[i])
}
获取数据(模糊查询)
$(document).on('click', "#show", function() {
var comp = [4, 32, 43]
indexedDB.forEachDB("userInfo", '0371667260', 'logisticCompanyId', comp, function(list) {
console.log(list)
})
});
更新数据
$(document).on('click', "#update", function() {
var i = {}
indexedDB.updateData("userInfo", i)
});