mirror of
				https://github.com/TeaOSLab/EdgeAdmin.git
				synced 2025-11-04 05:00:25 +08:00 
			
		
		
		
	用户列表页增加手机号绑定状态及筛选
This commit is contained in:
		@@ -18,9 +18,11 @@ func (this *IndexAction) Init() {
 | 
				
			|||||||
func (this *IndexAction) RunGet(params struct {
 | 
					func (this *IndexAction) RunGet(params struct {
 | 
				
			||||||
	Keyword          string
 | 
						Keyword          string
 | 
				
			||||||
	Verifying        bool
 | 
						Verifying        bool
 | 
				
			||||||
 | 
						MobileIsVerified int32 `default:"-1"`
 | 
				
			||||||
}) {
 | 
					}) {
 | 
				
			||||||
	this.Data["keyword"] = params.Keyword
 | 
						this.Data["keyword"] = params.Keyword
 | 
				
			||||||
	this.Data["isVerifying"] = params.Verifying
 | 
						this.Data["isVerifying"] = params.Verifying
 | 
				
			||||||
 | 
						this.Data["mobileIsVerified"] = params.MobileIsVerified
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// 未审核的总数量
 | 
						// 未审核的总数量
 | 
				
			||||||
	countVerifyingUsersResp, err := this.RPC().UserRPC().CountAllEnabledUsers(this.AdminContext(), &pb.CountAllEnabledUsersRequest{
 | 
						countVerifyingUsersResp, err := this.RPC().UserRPC().CountAllEnabledUsers(this.AdminContext(), &pb.CountAllEnabledUsersRequest{
 | 
				
			||||||
@@ -36,6 +38,7 @@ func (this *IndexAction) RunGet(params struct {
 | 
				
			|||||||
	countResp, err := this.RPC().UserRPC().CountAllEnabledUsers(this.AdminContext(), &pb.CountAllEnabledUsersRequest{
 | 
						countResp, err := this.RPC().UserRPC().CountAllEnabledUsers(this.AdminContext(), &pb.CountAllEnabledUsersRequest{
 | 
				
			||||||
		Keyword:          params.Keyword,
 | 
							Keyword:          params.Keyword,
 | 
				
			||||||
		IsVerifying:      params.Verifying,
 | 
							IsVerifying:      params.Verifying,
 | 
				
			||||||
 | 
							MobileIsVerified: params.MobileIsVerified,
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		this.ErrorPage(err)
 | 
							this.ErrorPage(err)
 | 
				
			||||||
@@ -48,6 +51,7 @@ func (this *IndexAction) RunGet(params struct {
 | 
				
			|||||||
	usersResp, err := this.RPC().UserRPC().ListEnabledUsers(this.AdminContext(), &pb.ListEnabledUsersRequest{
 | 
						usersResp, err := this.RPC().UserRPC().ListEnabledUsers(this.AdminContext(), &pb.ListEnabledUsersRequest{
 | 
				
			||||||
		Keyword:          params.Keyword,
 | 
							Keyword:          params.Keyword,
 | 
				
			||||||
		IsVerifying:      params.Verifying,
 | 
							IsVerifying:      params.Verifying,
 | 
				
			||||||
 | 
							MobileIsVerified: params.MobileIsVerified,
 | 
				
			||||||
		Offset:           page.Offset,
 | 
							Offset:           page.Offset,
 | 
				
			||||||
		Size:             page.Size,
 | 
							Size:             page.Size,
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
@@ -86,6 +90,7 @@ func (this *IndexAction) RunGet(params struct {
 | 
				
			|||||||
			"isVerified":          user.IsVerified,
 | 
								"isVerified":          user.IsVerified,
 | 
				
			||||||
			"isRejected":          user.IsRejected,
 | 
								"isRejected":          user.IsRejected,
 | 
				
			||||||
			"identityIsSubmitted": identityIsSubmitted,
 | 
								"identityIsSubmitted": identityIsSubmitted,
 | 
				
			||||||
 | 
								"verifiedMobile":      user.VerifiedMobile,
 | 
				
			||||||
		})
 | 
							})
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	this.Data["users"] = userMaps
 | 
						this.Data["users"] = userMaps
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -16,10 +16,17 @@
 | 
				
			|||||||
        <div class="ui field">
 | 
					        <div class="ui field">
 | 
				
			||||||
            <input type="text" placeholder="用户名、全名、手机号..." name="keyword" v-model="keyword"/>
 | 
					            <input type="text" placeholder="用户名、全名、手机号..." name="keyword" v-model="keyword"/>
 | 
				
			||||||
        </div>
 | 
					        </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">
 | 
					        <div class="ui field">
 | 
				
			||||||
            <button type="submit" class="ui button">搜索</button>
 | 
					            <button type="submit" class="ui button">搜索</button>
 | 
				
			||||||
             
 | 
					             
 | 
				
			||||||
            <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>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
</form>
 | 
					</form>
 | 
				
			||||||
@@ -31,9 +38,10 @@
 | 
				
			|||||||
			<th>用户名</th>
 | 
								<th>用户名</th>
 | 
				
			||||||
			<th>全名</th>
 | 
								<th>全名</th>
 | 
				
			||||||
            <th>关联集群</th>
 | 
					            <th>关联集群</th>
 | 
				
			||||||
			<th>手机号</th>
 | 
					            <th>绑定手机号</th>
 | 
				
			||||||
 | 
								<th v-if="windowWidth > columnWidth1">联系手机号</th>
 | 
				
			||||||
			<th>注册时间</th>
 | 
								<th>注册时间</th>
 | 
				
			||||||
			<th class="center width10">状态</th>
 | 
								<th class="center" style="width: 6em">状态</th>
 | 
				
			||||||
			<th class="two op">操作</th>
 | 
								<th class="two op">操作</th>
 | 
				
			||||||
		</tr>
 | 
							</tr>
 | 
				
			||||||
	</thead>
 | 
						</thead>
 | 
				
			||||||
@@ -60,6 +68,10 @@
 | 
				
			|||||||
            <span v-else class="disabled">-</span>
 | 
					            <span v-else class="disabled">-</span>
 | 
				
			||||||
        </td>
 | 
					        </td>
 | 
				
			||||||
        <td :class="{disabled:!user.isOn}">
 | 
					        <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-if="user.mobile.length > 0"><keyword :v-word="keyword">{{user.mobile}}</keyword></span>
 | 
				
			||||||
            <span v-else class="disabled">-</span>
 | 
					            <span v-else class="disabled">-</span>
 | 
				
			||||||
        </td>
 | 
					        </td>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,4 +1,7 @@
 | 
				
			|||||||
Tea.context(function () {
 | 
					Tea.context(function () {
 | 
				
			||||||
 | 
						this.windowWidth = window.innerWidth
 | 
				
			||||||
 | 
						this.columnWidth1 = 1000
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	this.createUser = function () {
 | 
						this.createUser = function () {
 | 
				
			||||||
		teaweb.popup(Tea.url(".createPopup"), {
 | 
							teaweb.popup(Tea.url(".createPopup"), {
 | 
				
			||||||
			height: "30em",
 | 
								height: "30em",
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user