2020-07-30 22:41:35 +08:00
|
|
|
Tea.context(function () {
|
2021-05-23 21:12:52 +08:00
|
|
|
this.grantId = 0
|
|
|
|
|
this.keyword = ""
|
|
|
|
|
let allGrants = this.grants.$copy()
|
2020-07-30 22:41:35 +08:00
|
|
|
|
|
|
|
|
this.selectGrant = function (grant) {
|
2020-12-17 15:50:44 +08:00
|
|
|
NotifyPopup({
|
|
|
|
|
code: 200,
|
|
|
|
|
data: {
|
|
|
|
|
grant: grant
|
|
|
|
|
}
|
|
|
|
|
})
|
2021-05-23 21:12:52 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.$delay(function () {
|
|
|
|
|
let that = this
|
|
|
|
|
this.$watch("keyword", function (keyword) {
|
|
|
|
|
if (keyword.length > 0) {
|
|
|
|
|
that.grants = allGrants.$findAll(function (k, grant) {
|
|
|
|
|
return teaweb.match(grant.name, keyword)
|
|
|
|
|
|| teaweb.match(grant.description, keyword)
|
|
|
|
|
|| teaweb.match(grant.username, keyword)
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
that.grants = allGrants
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
})
|