提交 7d1c9be0 编写于 作者: d-u-a's avatar d-u-a

update: unicloud-db组件增加属性startwith limitlevel

上级 e3d175fe
...@@ -53,6 +53,14 @@ export default { ...@@ -53,6 +53,14 @@ export default {
type: String, type: String,
default: '' default: ''
}, },
orderby: {
type: String,
default: ''
},
where: {
type: [String, Object],
default: ''
},
pageData: { pageData: {
type: String, type: String,
default: 'add' default: 'add'
...@@ -77,13 +85,13 @@ export default { ...@@ -77,13 +85,13 @@ export default {
type: [Boolean, String], type: [Boolean, String],
default: false default: false
}, },
orderby: { startwith: {
type: String, type: String,
default: '' default: ''
}, },
where: { limitlevel: {
type: [String, Object], type: Number,
default: '' default: 10
}, },
manual: { manual: {
type: Boolean, type: Boolean,
...@@ -113,7 +121,7 @@ export default { ...@@ -113,7 +121,7 @@ export default {
}) })
return al return al
}, (newValue, oldValue) => { }, (newValue, oldValue) => {
this.paginationInternal.pageSize = this.pageSize this.paginationInternal.size = this.pageSize
let needReset = false let needReset = false
for (let i = 2; i < newValue.length; i++) { for (let i = 2; i < newValue.length; i++) {
...@@ -380,10 +388,17 @@ export default { ...@@ -380,10 +388,17 @@ export default {
current, current,
size size
} = this.paginationInternal } = this.paginationInternal
db = db.skip(size * (current - 1)).limit(size).get({ const getOptions = {}
getCount: this.getcount, if (this.getcount) {
getTree: this.gettree getOptions.getCount = this.getcount
}) }
if (this.gettree) {
getOptions.getTree = {
limitLevel: this.limitlevel,
startWith: this.startwith
}
}
db = db.skip(size * (current - 1)).limit(size).get(getOptions)
return db return db
}, },
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册