用户列表页增加手机号绑定状态及筛选

This commit is contained in:
GoEdgeLab
2024-05-14 15:06:18 +08:00
parent 9a1b40887f
commit cbaff053ee
3 changed files with 31 additions and 11 deletions

View File

@@ -16,11 +16,13 @@ func (this *IndexAction) Init() {
}
func (this *IndexAction) RunGet(params struct {
Keyword string
Verifying bool
Keyword string
Verifying bool
MobileIsVerified int32 `default:"-1"`
}) {
this.Data["keyword"] = params.Keyword
this.Data["isVerifying"] = params.Verifying
this.Data["mobileIsVerified"] = params.MobileIsVerified
// 未审核的总数量
countVerifyingUsersResp, err := this.RPC().UserRPC().CountAllEnabledUsers(this.AdminContext(), &pb.CountAllEnabledUsersRequest{
@@ -34,8 +36,9 @@ func (this *IndexAction) RunGet(params struct {
// 当前匹配的数量
countResp, err := this.RPC().UserRPC().CountAllEnabledUsers(this.AdminContext(), &pb.CountAllEnabledUsersRequest{
Keyword: params.Keyword,
IsVerifying: params.Verifying,
Keyword: params.Keyword,
IsVerifying: params.Verifying,
MobileIsVerified: params.MobileIsVerified,
})
if err != nil {
this.ErrorPage(err)
@@ -46,10 +49,11 @@ func (this *IndexAction) RunGet(params struct {
this.Data["page"] = page.AsHTML()
usersResp, err := this.RPC().UserRPC().ListEnabledUsers(this.AdminContext(), &pb.ListEnabledUsersRequest{
Keyword: params.Keyword,
IsVerifying: params.Verifying,
Offset: page.Offset,
Size: page.Size,
Keyword: params.Keyword,
IsVerifying: params.Verifying,
MobileIsVerified: params.MobileIsVerified,
Offset: page.Offset,
Size: page.Size,
})
if err != nil {
this.ErrorPage(err)
@@ -86,6 +90,7 @@ func (this *IndexAction) RunGet(params struct {
"isVerified": user.IsVerified,
"isRejected": user.IsRejected,
"identityIsSubmitted": identityIsSubmitted,
"verifiedMobile": user.VerifiedMobile,
})
}
this.Data["users"] = userMaps

View File

@@ -16,10 +16,17 @@
<div class="ui field">
<input type="text" placeholder="用户名、全名、手机号..." name="keyword" v-model="keyword"/>
</div>
<div class="ui field" v-show="teaIsPlus">
<select class="ui dropdown" name="mobileIsVerified" v-model="mobileIsVerified">
<option value="-1">[手机号绑定状态]</option>
<option value="1">已绑定</option>
<option value="0">未绑定</option>
</select>
</div>
<div class="ui field">
<button type="submit" class="ui button">搜索</button>
&nbsp;
<a :href="'/users?verifying=' + (isVerifying ? 1 : 0)" v-if="keyword.length > 0">[清除条件]</a>
<a :href="'/users?verifying=' + (isVerifying ? 1 : 0)" v-if="keyword.length > 0 || mobileIsVerified != -1">[清除条件]</a>
</div>
</div>
</form>
@@ -31,9 +38,10 @@
<th>用户名</th>
<th>全名</th>
<th>关联集群</th>
<th>手机号</th>
<th>绑定手机号</th>
<th v-if="windowWidth > columnWidth1">联系手机号</th>
<th>注册时间</th>
<th class="center width10">状态</th>
<th class="center" style="width: 6em">状态</th>
<th class="two op">操作</th>
</tr>
</thead>
@@ -60,6 +68,10 @@
<span v-else class="disabled">-</span>
</td>
<td :class="{disabled:!user.isOn}">
<span v-if="user.verifiedMobile.length > 0">{{user.verifiedMobile}}</span>
<span v-else class="disabled">-</span>
</td>
<td :class="{disabled:!user.isOn}" v-if="windowWidth > columnWidth1">
<span v-if="user.mobile.length > 0"><keyword :v-word="keyword">{{user.mobile}}</keyword></span>
<span v-else class="disabled">-</span>
</td>

View File

@@ -1,4 +1,7 @@
Tea.context(function () {
this.windowWidth = window.innerWidth
this.columnWidth1 = 1000
this.createUser = function () {
teaweb.popup(Tea.url(".createPopup"), {
height: "30em",