Files
EdgeAdmin/web/public/js/components/admins/admin-selector.js
2021-04-05 20:48:13 +08:00

29 lines
831 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// TODO 支持关键词搜索
// TODO 改成弹窗选择
Vue.component("admin-selector", {
props: ["v-admin-id"],
mounted: function () {
let that = this
Tea.action("/admins/options")
.post()
.success(function (resp) {
that.admins = resp.data.admins
})
},
data: function () {
let adminId = this.vAdminId
if (adminId == null) {
adminId = 0
}
return {
admins: [],
adminId: adminId
}
},
template: `<div>
<select class="ui dropdown auto-width" name="adminId" v-model="adminId">
<option value="0">[选择系统用户]</option>
<option v-for="admin in admins" :value="admin.id">{{admin.name}}{{admin.username}}</option>
</select>
</div>`
})