第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定

畢設(shè)經(jīng)典-人事檔案管理系統(tǒng)(layer+SSM)-信息列表

標(biāo)簽:
SSM

结构

首先是一个静态页面,设置好表头,然后通过JS文件,调用接口,返回JSON串,最后显示到前端。

<div class="mt-20">
		<table class="table table-border table-bordered table-bg table-hover table-sort table-responsive">
			<thead>
				<tr class="text-c">
					<th width="40">ID</th>
					<th width="40">姓名</th>
					<th width="20">性别</th>
					<th width="120">身份证</th>
					<th width="80">手机号</th>
					<th width="40">婚否</th>
					<th width="60">部门</th>
					<th width="60">职位</th>
					<th width="20">权限</th>
					<th width="120">入职时间</th>
					<th width="120">操作</th>
				</tr>
			</thead>
			<tbody id="userinfo-list-table">
				
			</tbody>
		</table>
	</div>

JS 调用接口


$(function(){
	//项目工程名称
	var pjname='/hrsys';
	//
	var getUserInfoListAllUrl=pjname+'/adcusers/getuserslistall';
	//
	var userInfoListObj={};
	//
	var viewHTML='';
	//同步
	$.ajaxSetup({async: false});
	$.ajax({
		url : getUserInfoListAllUrl,
		type : 'GET',
		success : function(data) {
			userInfoListObj=data.userInfoList;
			var userGender='';
			var userIsMarried='';
			var counta=1;
			userInfoListObj.map(function(item,data){
				userGender=item.gender>0?'男':'女';
				userIsMarried=item.isMarried>0?'已婚':'未婚';
				var tmpHTML=returnTableViewString(item.id,item.name,userGender,item.idCard,userIsMarried,item.priority,item.phone,item.entryTime,item.jobDepartment.name,item.jobPosition.name,counta);
				viewHTML=viewHTML+tmpHTML;
				counta++;
			});
			$('#userinfo-list-table').html(viewHTML);
			$('#count-tableitems').html(data.userInfoListCount);
		}
	});
	
	//响应搜索按钮
	$('#search-submit').click(function(){
		searchOperation();
	});
	$('#search-input').keyup(function(event){
		if(event.keyCode ==13){
			searchOperation();
		  }
	});
	function searchOperation(){
		var inputString=$('#search-input').val();
		if(inputString==null||inputString==''){
			if(userInfoListObj!=null&&userInfoListObj!={}){
				var countb=1;
				userInfoListObj.map(function(item,data){
					userGender=item.gender>0?'男':'女';
					userIsMarried=item.isMarried>0?'已婚':'未婚';
					var tmpHTML=returnTableViewString(item.id,item.name,userGender,item.idCard,userIsMarried,item.priority,item.phone,item.entryTime,item.jobDepartment.name,item.jobPosition.name,countb);
					viewHTML=viewHTML+tmpHTML;
					countb++;
				});
				$('#userinfo-list-table').html(viewHTML);
				$('#count-tableitems').html(userInfoListObj.length);
			}
			
		}else{
			if(userInfoListObj!=null&&userInfoListObj!={}){
				var viewHTML1='';
				var count1=0;
				userInfoListObj.map(function(item,data){
					var userGender1='';
					var userIsMarried1='';
					var countc=1;
					if(item.name.indexOf(inputString)>-1){
						//用户模糊匹配
						userGender1=item.gender>0?'男':'女';
						userIsMarried1=item.isMarried>0?'已婚':'未婚';
						viewHTML1=viewHTML1+returnTableViewString(item.id,item.name,userGender1,item.idCard,userIsMarried1,item.priority,item.phone,item.entryTime,item.jobDepartment.name,item.jobPosition.name,countc);
						count1++;
					}else
					if(item.idCard.indexOf(inputString)>-1){
						//用户模糊匹配
						userGender1=item.gender>0?'男':'女';
						userIsMarried1=item.isMarried>0?'已婚':'未婚';
						viewHTML1=viewHTML1+returnTableViewString(item.id,item.name,userGender1,item.idCard,userIsMarried1,item.priority,item.phone,item.entryTime,item.jobDepartment.name,item.jobPosition.name,countc);
						count1++;
					}else
					if(item.jobDepartment.name.indexOf(inputString)>-1){
						//用户模糊匹配
						userGender1=item.gender>0?'男':'女';
						userIsMarried1=item.isMarried>0?'已婚':'未婚';
						viewHTML1=viewHTML1+returnTableViewString(item.id,item.name,userGender1,item.idCard,userIsMarried1,item.priority,item.phone,item.entryTime,item.jobDepartment.name,item.jobPosition.name,countc);
						count1++;
					}
					countc++;
				});
				$('#userinfo-list-table').html(viewHTML1);
				$('#count-tableitems').html(count1);
			}
		}
	}
	function returnTableViewString(userId,userName,userGender,userIdCard,userIsMarried,userPriority,userPhone,userEntryTime,userDepartment,userPosition,countNum){
		var result='<tr class="text-c"><td>'+countNum+
					'</td><td class="text-l"><u style="cursor:pointer"class="text-primary" onClick="" title="查看">'+userName+
					'</u></td><td>'+userGender+
					'</td><td>'+userIdCard+
					'</td><td>'+userPhone+
					'</td><td>'+userIsMarried+
					'</td><td>'+userDepartment+
					'</td><td>'+userPosition+
					'</td><td class="td-status"><span class="label label-success radius">'+userPriority+
					'</span></td><td>'+userEntryTime+'</td><td class="f-14 td-manage"><a style="text-decoration:none" target="_Blank" class="ml-5" href="javascript:;" onclick="member_add(\'编辑\',\'/hrsys/adcadmin/gotomodifyuserinfobyidpage?userId='+userId+'\',\'\',\'610\')" title="编辑"><i class="Hui-iconfont">&#xe6df;</i></a> <a style="text-decoration:none" class="ml-5" onclick="return confirm(\'请确认删除\');" href="/hrsys/adcadmin/deleteuserinfobyid?userId='+userId+'" title="删除"><i class="Hui-iconfont">&#xe6e2;</i></a></td></tr>';
		return result;
	}
})

接口函数

package com.advancedc.hrsys.web.users;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.advancedc.hrsys.entity.UserInfo;
import com.advancedc.hrsys.service.UserInfoService;



@Controller
@RequestMapping("/adcusers")
public class ShowUsersListController {
	@Autowired
	private UserInfoService userInfoService;
	
	@RequestMapping(value="/getuserslistall",method=RequestMethod.GET)
	@ResponseBody
	private Map<String,Object> getAboutAll(HttpServletRequest request){
		Map<String,Object> modelMap=new HashMap<String,Object>();
		List<UserInfo> userInfoList=userInfoService.getUserInfoAll();
		modelMap.put("userInfoList", userInfoList);
		modelMap.put("userInfoListCount", userInfoList.size());
		return modelMap;
	}
}

點擊查看更多內(nèi)容
TA 點贊

若覺得本文不錯,就分享一下吧!

評論

作者其他優(yōu)質(zhì)文章

正在加載中
JAVA開發(fā)工程師
手記
粉絲
31
獲贊與收藏
155

關(guān)注作者,訂閱最新文章

閱讀免費教程

  • 推薦
  • 評論
  • 收藏
  • 共同學(xué)習(xí),寫下你的評論
感謝您的支持,我會繼續(xù)努力的~
掃碼打賞,你說多少就多少
贊賞金額會直接到老師賬戶
支付方式
打開微信掃一掃,即可進(jìn)行掃碼打賞哦
今天注冊有機會得

100積分直接送

付費專欄免費學(xué)

大額優(yōu)惠券免費領(lǐng)

立即參與 放棄機會
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號

舉報

0/150
提交
取消