Pārlūkot izejas kodu

Merge remote-tracking branch 'origin/V1' into V1

xiao547607 5 gadi atpakaļ
vecāks
revīzija
85624354cc

+ 8 - 1
common/src/main/java/com/jpsoft/smart/modules/lapi/request/LapiRequest.java

@@ -58,7 +58,14 @@ public class LapiRequest {
         sysLog.setPointcut(deviceNo);
         sysLog.setUrl(uri);
 
-        BlockingQueue<String> queue = lapiChannel.getReceivePacketQueue(uri);
+        String shortUri = uri;
+
+        if (uri.indexOf("?")>0)
+        {
+            shortUri = uri.substring(0,uri.lastIndexOf("?"));
+        }
+
+        BlockingQueue<String> queue = lapiChannel.getReceivePacketQueue(shortUri);
 
         String body = "";
 

+ 122 - 44
web/src/main/java/com/jpsoft/smart/modules/devOps/controller/DevOpsController.java

@@ -1,5 +1,6 @@
 package com.jpsoft.smart.modules.devOps.controller;
 
+import com.alibaba.fastjson.JSONObject;
 import com.github.pagehelper.Page;
 import com.jpsoft.smart.modules.base.entity.CompanyInfo;
 import com.jpsoft.smart.modules.base.entity.DeviceInfo;
@@ -12,8 +13,11 @@ import com.jpsoft.smart.modules.base.service.PersonInfoService;
 import com.jpsoft.smart.modules.common.dto.MessageResult;
 import com.jpsoft.smart.modules.common.dto.Sort;
 import com.jpsoft.smart.modules.common.utils.PojoUtils;
+import com.jpsoft.smart.modules.constant.LApiConstant;
+import com.jpsoft.smart.modules.lapi.request.LapiRequest;
 import com.jpsoft.smart.modules.lapi.service.ILapiService;
 import com.jpsoft.smart.modules.lapi.vo.LapiMsgResult;
+import io.netty.handler.codec.http.HttpMethod;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
@@ -22,7 +26,9 @@ import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.amqp.rabbit.core.RabbitTemplate;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.context.properties.bind.DefaultValue;
 import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -50,6 +56,9 @@ public class DevOpsController {
     @Autowired
     private ILapiService lapiService;
 
+    @Autowired
+    private LapiRequest lapiRequest;
+
     @Autowired
     RabbitTemplate rabbitTemplate;
 
@@ -68,6 +77,25 @@ public class DevOpsController {
         return "listOfDevice";
     }
 
+    @GetMapping("listOfPeopleLib")
+    public String listOfPeopleLibPage(String schoolId, String deviceId, Model model){
+        CompanyInfo school = companyInfoService.get(schoolId);
+        model.addAttribute("school",school);
+
+        DeviceInfo deviceInfo = deviceInfoService.get(deviceId);
+        model.addAttribute("device",deviceInfo);
+
+        return "listOfPeopleLib";
+    }
+
+    @GetMapping("listOfPeople")
+    public String listOfPeoplePage(String deviceId,Model model){
+        DeviceInfo deviceInfo = deviceInfoService.get(deviceId);
+        model.addAttribute("device",deviceInfo);
+
+        return "listOfPeople";
+    }
+
     @ResponseBody
     @ApiOperation(value="获取设备列表")
     @PostMapping("listOfDevice")
@@ -128,56 +156,106 @@ public class DevOpsController {
     }
 
     @ResponseBody
-    @ApiOperation(value="人员与设备绑定")
-    @PostMapping("add")
+    @ApiOperation(value="查询人员库")
+    @GetMapping("queryPeopleLib")
+    public MessageResult<JSONObject> queryPeopleLib(String deviceNo){
+        MessageResult<JSONObject> msgResult = new MessageResult<>();
+
+        try {
+            JSONObject jsonObject = lapiRequest.send(deviceNo,LApiConstant.GETFACEDB, HttpMethod.GET, null);
+            msgResult.setData(jsonObject);
+            msgResult.setResult(true);
+        }
+        catch(Exception ex){
+            log.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ResponseBody
+    @ApiOperation(value="查询人员")
+    @PostMapping("queryPeople")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name="deviceNo",value = "设备编号",required = true,paramType = "form"),
+            @ApiImplicitParam(name="libId",value = "人员库编号",required = true,paramType = "form"),
+            @ApiImplicitParam(name="qryType",value = "查询类型(27:人员编号,55:人员姓名,58:证件号,无查询条件则获取所有人员信息)",paramType = "form"),
+            @ApiImplicitParam(name="qryData",value = "查询内容",paramType = "form"),
+            @ApiImplicitParam(name="offset",value = "偏移量",paramType = "form"),
+            @ApiImplicitParam(name="limit",value = "每页条数",paramType = "form")
+    })
+    public MessageResult<JSONObject> queryPeople(String deviceNo, String libId,
+                                                 @DefaultValue(value = "27") String qryType,
+                                                 String qryData,
+                                                 @DefaultValue(value = "0") int offset,
+                                                 @DefaultValue(value = "5") int limit){
+        MessageResult<JSONObject> msgResult = new MessageResult<>();
+
+        try {
+            HashMap map = new HashMap();
+            map.put("Limit", limit);
+            map.put("Offset", offset);
+            List queryInfos = new ArrayList();
+
+            if(StringUtils.isNotEmpty(qryData)) {
+                HashMap queryInfo = new HashMap();
+                queryInfo.put("QryType", qryType);
+                queryInfo.put("QryCondition", 0);
+                queryInfo.put("QryData", qryData);
+                queryInfos.add(queryInfo);
+            }
+
+            if (queryInfos.size()>0) {
+                map.put("QueryInfos", queryInfos);
+                map.put("Num", queryInfos.size());
+            }
+
+            JSONObject jsonObject = lapiRequest.send(deviceNo, LApiConstant.ADDPERSON + libId + "/People/Info", HttpMethod.POST, map);
+
+            msgResult.setData(jsonObject);
+            msgResult.setResult(true);
+        }
+        catch(Exception ex){
+            log.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ResponseBody
+    @ApiOperation(value="删除设备中的人员")
+    @PostMapping("deletePeople")
     @ApiImplicitParams({
-            @ApiImplicitParam(name="token",value = "令牌",required = true,paramType = "form"),
-            @ApiImplicitParam(name="name",value = "姓名",required = true,paramType = "form"),
-            @ApiImplicitParam(name="faceImageUrl",value = "照片地址",required = true,paramType = "form"),
-            @ApiImplicitParam(name = "companyId",value = "学校id", required = true,paramType = "query"),
-            @ApiImplicitParam(name = "devices",value = "设备ID(多个设备)", required = true, paramType = "query")
+            @ApiImplicitParam(name="deviceNo",value = "设备编号",required = true,paramType = "form"),
+            @ApiImplicitParam(name="libId",value = "人员库编号",required = true,paramType = "form"),
+            @ApiImplicitParam(name="personId",value = "人员编号",required = true,paramType = "form")
     })
-    public MessageResult<Integer> add(String token, String name , String faceImageUrl, String companyId, String devices) {
-        MessageResult<Integer> msgResult = new MessageResult<>();
-
-        PersonDeviceRelation person = new PersonDeviceRelation();
-        //产生人员表
-
-        PersonInfo personInfo = new PersonInfo();
-        personInfo.setCompanyId(companyId);
-        personInfo.setName(name);
-        personInfo.setPhone(null);
-        personInfo.setFaceEnabled(true);
-        personInfo.setFaceImageUrl(faceImageUrl);
-        personInfo.setPopedom("1");
-        personInfo.setDelFlag(false);
-        personInfo.setCreateBy("-1");
-        personInfo.setCreateTime(new Date());
-
-        //插入后,会将自增id写到id属性中
-        int affectCount = personInfoService.insert(personInfo);
-
-        //todo 关联设备
-        String[] deviceIds = devices.split(",");
-        for(String deviceId : deviceIds){
-            PersonDeviceRelation personDeviceRelation = new PersonDeviceRelation();
-            personDeviceRelation.setId(UUID.randomUUID().toString());
-            personDeviceRelation.setDeviceId(deviceId);
-            personDeviceRelation.setPersonId(personInfo.getId());
-            personDeviceRelation.setDelFlag(false);
-            personDeviceRelation.setCreateBy("-1");
-            personDeviceRelation.setCreateTime(new Date());
-            personDeviceRelationService.insert(personDeviceRelation);
+    public MessageResult<JSONObject> deletePeople(String deviceNo, String libId, String personId){
+        MessageResult<JSONObject> msgResult = new MessageResult<>();
+
+        try {
+            Date now = new Date();
+
+            JSONObject jsonObject = lapiRequest.send(deviceNo,
+                    LApiConstant.DELETEPERSON + libId + "/People/" + personId + "?LastChange=" + now.getTime(),
+                    HttpMethod.DELETE, null);
+
+            msgResult.setData(jsonObject);
+            msgResult.setResult(true);
         }
+        catch(Exception ex){
+            log.error(ex.getMessage(),ex);
 
-        if(affectCount>0) {
-            //todo 加入到导入图片队列中
-            rabbitTemplate.convertAndSend("schoolImportImageExchange", "schoolImportImage", personInfo.getId());
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
         }
 
-        msgResult.setResult(true);
-        msgResult.setMessage("设备绑定成功!");
-        msgResult.setCode(200);
         return msgResult;
     }
 }

+ 637 - 0
web/src/main/resources/static/css/example.css

@@ -0,0 +1,637 @@
+body,html {
+	height: 100%;
+	-webkit-tap-highlight-color: transparent
+}
+
+body {
+	font-family: -apple-system-font,Helvetica Neue,Helvetica,sans-serif
+}
+
+ul {
+	list-style: none
+}
+
+.page,body {
+	background-color: rgb(237, 237, 237);
+}
+
+.page {
+	position: absolute;
+	top: 0;
+	right: 0;
+	bottom: 0;
+	left: 0;
+	overflow-y: auto;
+	-webkit-overflow-scrolling: touch;
+	box-sizing: border-box;
+	opacity: 0;
+	z-index: 1
+}
+
+.page.js_show {
+	opacity: 1
+}
+
+.page.actionsheet,.page.article,.page.dialog,.page.form,.page.loadmore,.page.msg,.page.msg_success,.page.msg_text,.page.msg_text_primary,.page.msg_warn,.page.picker,.page.progress,.page.toast,.page.top-tips {
+	background-color: var(--weui-BG-2)
+}
+
+.link {
+	color: var(--weui-LINK)
+}
+
+.container {
+	position: absolute;
+	top: 0;
+	right: 0;
+	bottom: 0;
+	left: 0;
+	overflow: hidden;
+	color: var(--weui-FG-0);
+	display:flex;
+	flex-direction:column;
+}
+
+.flex-row{
+    display:flex;
+    flex-direction:row;
+    justify-content: center;
+    align-items: center;
+}
+
+.right-corner{
+    position:absolute;right:10px;top:10px;
+}
+
+.page__hd {
+	padding: 10px
+}
+
+.page__bd_spacing {
+	padding: 0 16px
+}
+
+.page__ft {
+	padding-top: 40px;
+	padding-bottom: 10px;
+	padding-bottom: calc(10px + constant(safe-area-inset-bottom));
+	padding-bottom: calc(10px + env(safe-area-inset-bottom));
+	text-align: center
+}
+
+.page__ft img {
+	height: 19px
+}
+
+body[data-weui-theme=dark] .page__ft img {
+	-webkit-filter: invert(100) hue-rotate(180deg);
+	filter: invert(100) hue-rotate(180deg)
+}
+
+@media (prefers-color-scheme:dark) {
+	body:not([data-weui-theme=light]) .page__ft img {
+		-webkit-filter: invert(100) hue-rotate(180deg);
+		filter: invert(100) hue-rotate(180deg)
+	}
+}
+
+.page__ft.j_bottom {
+	position: absolute;
+	bottom: 0;
+	left: 0;
+	right: 0
+}
+
+.page__title {
+	text-align: left;
+	font-size: 20px;
+	font-weight: 400
+}
+
+.page__desc {
+	margin-top: 4px;
+	color: var(--weui-FG-1);
+	text-align: left;
+	font-size: 14px
+}
+
+.page.footer .page__ft,.page.gallery .page__ft,.page.navbar .page__ft,.page.tabbar .page__ft,.page[class*=form_] .page__ft,.page[class*=msg_] .page__ft {
+	display: none
+}
+
+.weui-cell_example:before {
+	left: 52px
+}
+
+.page.home .page__intro-icon {
+	margin-top: -.2em;
+	margin-left: 5px;
+	width: 16px;
+	height: 16px;
+	vertical-align: middle
+}
+
+.page.home .page__title {
+	font-size: 0;
+	margin-bottom: 15px
+}
+
+body[data-weui-theme=dark] .page.home .page__title {
+	-webkit-filter: invert(100) hue-rotate(180deg);
+	filter: invert(100) hue-rotate(180deg)
+}
+
+@media (prefers-color-scheme:dark) {
+	body:not([data-weui-theme=light]) .page.home .page__title {
+		-webkit-filter: invert(100) hue-rotate(180deg);
+		filter: invert(100) hue-rotate(180deg)
+	}
+}
+
+.page.home .page__bd img {
+	width: 30px;
+	height: 30px
+}
+
+body[data-weui-theme=dark] .page.home .page__bd img {
+	-webkit-filter: invert(100) hue-rotate(180deg);
+	filter: invert(100) hue-rotate(180deg)
+}
+
+@media (prefers-color-scheme:dark) {
+	body:not([data-weui-theme=light]) .page.home .page__bd img {
+		-webkit-filter: invert(100) hue-rotate(180deg);
+		filter: invert(100) hue-rotate(180deg)
+	}
+}
+
+.page.home .page__bd li {
+	margin: 8px 0;
+	background-color: var(--weui-BG-2);
+	overflow: hidden;
+	border-radius: 2px;
+	cursor: pointer
+}
+
+.page.home .page__bd li.js_show .weui-flex {
+	opacity: .5
+}
+
+.page.home .page__bd li.js_show .page__category {
+	height: auto
+}
+
+.page.home .page__bd li.js_show .page__category-content {
+	opacity: 1;
+	-webkit-transform: translateY(0);
+	transform: translateY(0)
+}
+
+.page.home .page__bd li:first-child {
+	margin-top: 0
+}
+
+.page.home .page__category {
+	height: 0;
+	overflow: hidden
+}
+
+.page.home .page__category-content {
+	opacity: 0;
+	-webkit-transform: translateY(-50%);
+	transform: translateY(-50%);
+	-webkit-transition: .3s;
+	transition: .3s
+}
+
+.page.home .weui-flex {
+	padding: 20px;
+	-webkit-box-align: center;
+	-webkit-align-items: center;
+	align-items: center;
+	-webkit-transition: .3s;
+	transition: .3s
+}
+
+.page.home .weui-cells {
+	margin-top: 0
+}
+
+.page.home .weui-cells:after,.page.home .weui-cells:before {
+	display: none
+}
+
+.page.home .weui-cell {
+	padding-left: 20px;
+	padding-right: 20px
+}
+
+.page.home .weui-cell:before {
+	left: 20px;
+	right: 20px
+}
+
+.page.form .page__bd {
+	padding-bottom: 30px
+}
+
+.page.form .weui-label {
+	width: 3.1em
+}
+
+.page.form_page .weui-label {
+	width: 4.1em
+}
+
+.page.form_select .weui-cells__group_form .weui-cell_select-before .weui-select {
+	width: 3.1em
+}[class*=" form_"].page,[class^=form_].page {
+	padding: 0
+}
+
+.page.form_input_status .weui-label,.page.form_select .weui-label,.page.form_select_primary .weui-label,.page.form_vcode .weui-label {
+	width: 3.1em
+}
+
+.page.button {
+	background-color: var(--weui-BG-0)
+}
+
+.page.button .weui-btn_mini {
+	vertical-align: middle
+}
+
+.page.button .page__bd {
+	padding: 0
+}
+
+.page.button .button-sp-area {
+	margin: 15px auto;
+	padding: 15px;
+	text-align: center
+}
+
+.page.button .button-sp-area.cell {
+	padding: 15px 0
+}
+
+.page.cell .page__bd {
+	padding-bottom: 30px
+}
+
+.page.dialog .page__bd {
+	padding: 0 15px
+}
+
+.page.panel .page__bd {
+	padding-bottom: 20px
+}
+
+.page.icons,.page.icons-svg {
+	text-align: center
+}
+
+.page.icons-svg .page__bd,.page.icons .page__bd {
+	padding: 0 40px;
+	text-align: left
+}
+
+.page.icons-svg .icon-box,.page.icons .icon-box {
+	margin-bottom: 25px;
+	display: -webkit-box;
+	display: -webkit-flex;
+	display: flex;
+	-webkit-box-align: center;
+	-webkit-align-items: center;
+	align-items: center
+}
+
+.page.icons-svg .icon-box i,.page.icons .icon-box i {
+	margin-right: 18px
+}
+
+.page.icons-svg .icon-box__ctn,.page.icons .icon-box__ctn {
+	-webkit-flex-shrink: 100;
+	flex-shrink: 100
+}
+
+.page.icons-svg .icon-box__title,.page.icons .icon-box__title {
+	font-weight: 400
+}
+
+.page.icons-svg .icon-box__desc,.page.icons .icon-box__desc {
+	margin-top: 6px;
+	font-size: 12px;
+	color: #888
+}
+
+.page.icons-svg .icon_sp_area,.page.icons .icon_sp_area {
+	margin-top: 10px;
+	text-align: left
+}
+
+.page.icons-svg .icon_sp_area i:before,.page.icons .icon_sp_area i:before {
+	margin-bottom: 5px
+}
+
+.page.flex .placeholder {
+	margin: 5px;
+	padding: 0 10px;
+	background-color: var(--weui-BG-1);
+	height: 2.3em;
+	line-height: 2.3em;
+	text-align: center;
+	color: var(--weui-FG-1)
+}
+
+.page.layers {
+	overflow-x: hidden;
+	-webkit-perspective: 1000px;
+	perspective: 1000px
+}
+
+@media only screen and (max-width:320px) {
+	.page.layers .page__hd {
+		padding-left: 20px;
+		padding-right: 20px
+	}
+}
+
+.page.layers .page__bd {
+	position: relative
+}
+
+.page.layers .page__desc {
+	min-height: 4.8em
+}
+
+.page.layers .layers__layer {
+	position: absolute;
+	left: 50%;
+	width: 150px;
+	height: 266px;
+	margin-left: -75px;
+	box-sizing: border-box;
+	-webkit-transition: .5s;
+	transition: .5s;
+	background: url(images/layers/transparent.gif) no-repeat 50%;
+	background-size: contain;
+	font-size: 14px;
+	color: var(--weui-WHITE)
+}
+
+.page.layers .layers__layer span {
+	position: absolute;
+	bottom: 5px;
+	left: 0;
+	right: 0;
+	text-align: center;
+	-webkit-transition: .5s;
+	transition: .5s
+}
+
+.page.layers .layers__layer:last-child span {
+	color: #aaa
+}
+
+.page.layers .layers__layer.j_hide {
+	opacity: 0
+}
+
+.page.layers .layers__layer.j_pic span {
+	color: transparent
+}
+
+@media only screen and (min-width:375px) and (min-height:603px) {
+	.page.layers .layers__layer {
+		width: 180px;
+		height: 320px;
+		margin-left: -90px
+	}
+}
+
+@media only screen and (min-width:414px) and (min-height:640px) {
+	.page.layers .layers__layer {
+		width: 200px;
+		height: 355px;
+		margin-left: -100px
+	}
+}
+
+.page.layers .layers__layer_popout {
+	border: 1px solid hsla(0,0%,80%,.5);
+	z-index: 4
+}
+
+.page.layers .layers__layer_popout.j_transform {
+	-webkit-transform: translateX(15px) rotateX(45deg) rotate(10deg) skew(-15deg) translateZ(120px);
+	transform: translateX(15px) rotateX(45deg) rotate(10deg) skew(-15deg) translateZ(120px)
+}
+
+@media only screen and (max-width:320px) {
+	.page.layers .layers__layer_popout.j_transform {
+		-webkit-transform: translateX(15px) rotateX(45deg) rotate(10deg) skew(-15deg) translateZ(140px);
+		transform: translateX(15px) rotateX(45deg) rotate(10deg) skew(-15deg) translateZ(140px)
+	}
+}
+
+.page.layers .layers__layer_popout.j_pic {
+	border-color: transparent;
+	background-image: url(images/layers/popout.png)
+}
+
+.page.layers .layers__layer_mask {
+	background-color: rgba(0,0,0,.5);
+	z-index: 3
+}
+
+.page.layers .layers__layer_mask.j_transform {
+	-webkit-transform: translateX(15px) rotateX(45deg) rotate(10deg) skew(-15deg) translateZ(40px);
+	transform: translateX(15px) rotateX(45deg) rotate(10deg) skew(-15deg) translateZ(40px)
+}
+
+@media only screen and (max-width:320px) {
+	.page.layers .layers__layer_mask.j_transform {
+		-webkit-transform: translateX(15px) rotateX(45deg) rotate(10deg) skew(-15deg) translateZ(80px);
+		transform: translateX(15px) rotateX(45deg) rotate(10deg) skew(-15deg) translateZ(80px)
+	}
+}
+
+.page.layers .layers__layer_navigation {
+	background-color: rgba(40,187,102,.5);
+	z-index: 2
+}
+
+.page.layers .layers__layer_navigation.j_transform {
+	-webkit-transform: translateX(15px) rotateX(45deg) rotate(10deg) skew(-15deg) translateZ(-40px);
+	transform: translateX(15px) rotateX(45deg) rotate(10deg) skew(-15deg) translateZ(-40px)
+}
+
+@media only screen and (max-width:320px) {
+	.page.layers .layers__layer_navigation.j_transform {
+		-webkit-transform: translateX(15px) rotateX(45deg) rotate(10deg) skew(-15deg) translateZ(20px);
+		transform: translateX(15px) rotateX(45deg) rotate(10deg) skew(-15deg) translateZ(20px)
+	}
+}
+
+.page.layers .layers__layer_navigation.j_pic {
+	background-color: transparent;
+	background-image: url(images/layers/navigation.png)
+}
+
+.page.layers .layers__layer_content {
+	background-color: var(--weui-BG-2);
+	z-index: 1
+}
+
+.page.layers .layers__layer_content.j_transform {
+	-webkit-transform: translateX(15px) rotateX(45deg) rotate(10deg) skew(-15deg) translateZ(-120px);
+	transform: translateX(15px) rotateX(45deg) rotate(10deg) skew(-15deg) translateZ(-120px)
+}
+
+@media only screen and (max-width:320px) {
+	.page.layers .layers__layer_content.j_transform {
+		-webkit-transform: translateX(15px) rotateX(45deg) rotate(10deg) skew(-15deg) translateZ(-40px);
+		transform: translateX(15px) rotateX(45deg) rotate(10deg) skew(-15deg) translateZ(-40px)
+	}
+}
+
+.page.layers .layers__layer_content.j_pic {
+	background-image: url(images/layers/content.png)
+}
+
+.page.searchbar .searchbar-result {
+	display: none;
+	margin-top: 0;
+	font-size: 14px
+}
+
+.page.searchbar .searchbar-result .weui-cell__bd {
+	padding: 2px 0 2px 20px;
+	color: var(--weui-FG-1)
+}
+
+.page.gallery {
+	overflow: hidden
+}
+
+.weui-half-screen-dialog {
+	-webkit-transition: -webkit-transform .3s;
+	transition: -webkit-transform .3s;
+	transition: transform .3s;
+	transition: transform .3s,-webkit-transform .3s;
+	-webkit-transform: translateY(100%);
+	transform: translateY(100%)
+}
+
+.weui-half-screen-dialog_show {
+	-webkit-transform: translateY(0);
+	transform: translateY(0)
+}
+
+@-webkit-keyframes a {
+	0% {
+		-webkit-transform: translate3d(100%,0,0);
+		transform: translate3d(100%,0,0);
+		opacity: 0
+	}
+
+	to {
+		-webkit-transform: translateZ(0);
+		transform: translateZ(0);
+		opacity: 1
+	}
+}
+
+@keyframes a {
+	0% {
+		-webkit-transform: translate3d(100%,0,0);
+		transform: translate3d(100%,0,0);
+		opacity: 0
+	}
+
+	to {
+		-webkit-transform: translateZ(0);
+		transform: translateZ(0);
+		opacity: 1
+	}
+}
+
+@-webkit-keyframes b {
+	0% {
+		-webkit-transform: translateZ(0);
+		transform: translateZ(0);
+		opacity: 1
+	}
+
+	to {
+		-webkit-transform: translate3d(100%,0,0);
+		transform: translate3d(100%,0,0);
+		opacity: 0
+	}
+}
+
+@keyframes b {
+	0% {
+		-webkit-transform: translateZ(0);
+		transform: translateZ(0);
+		opacity: 1
+	}
+
+	to {
+		-webkit-transform: translate3d(100%,0,0);
+		transform: translate3d(100%,0,0);
+		opacity: 0
+	}
+}
+
+.page.slideIn {
+	-webkit-animation: a .2s forwards;
+	animation: a .2s forwards
+}
+
+.page.slideOut {
+	-webkit-animation: b .2s forwards;
+	animation: b .2s forwards
+}
+
+@supports (top:constant(safe-area-inset-top)) {
+	.page {
+		padding: constant(safe-area-inset-top) constant(safe-area-inset-right) constant(safe-area-inset-bottom) constant(safe-area-inset-left)
+	}
+
+	.page.navbar,.page.tabbar {
+		padding-left: 0;
+		padding-right: 0
+	}
+
+	.weui-tab__panel {
+		padding-left: constant(safe-area-inset-left);
+		padding-right: constant(safe-area-inset-right)
+	}
+}
+
+@supports (top:env(safe-area-inset-top)) {
+	.page {
+		padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)
+	}
+
+	.page.article,.page.msg_success,.page.msg_text,.page.msg_text_primary,.page.msg_warn,.page.navbar,.page.tabbar {
+		padding: 0
+	}
+}
+
+.ball{
+    border-radius:10px;
+    width:20px;
+    height:20px;
+    margin-right:10px;
+}
+
+.green {
+    background-color:lightgreen;
+}
+
+.gray{
+    background-color:gray;
+}

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 5 - 0
web/src/main/resources/static/js/weui.min.js


+ 4 - 2
web/src/main/resources/templates/listOfDevice.html

@@ -60,7 +60,7 @@
         <div style="flex:1;overflow:auto;">
             <div class="weui-cells__title"><h3>设备列表</h3></div>
             <div class="weui-cells" v-for="(device,index) in devices">
-                <div class="weui-cell">
+                <div class="weui-cell weui-cell_access" @click="gotoPeopleLibList(device)">
                     <div class="weui-cell__hd">
                         <div class="ball" :class="{green: device.isOnline, gray: !device.isOnline}"></div>
                     </div>
@@ -68,7 +68,6 @@
                         <p v-html="((pageIndex-1) * pageSize + index+1) + '.' + device.aliasName"></p>
                     </div>
                     <div class="weui-cell__ft">
-                        <button v-show="device.isOnline" class="weui-btn weui-btn_mini weui-btn_primary" @click="remoteOpened(device)">开门</button>
                     </div>
                 </div>
             </div>
@@ -118,6 +117,9 @@
 
                     this.pageSearch();
                 },
+                gotoPeopleLibList(device){
+                    window.location.href = path + "/devOps/listOfPeopleLib?deviceId=" + device.id;
+                },
                 nextPage() {
                     if(this.pageIndex<this.totalPage){
                         this.pageIndex++;

+ 158 - 0
web/src/main/resources/templates/listOfPeople.html

@@ -0,0 +1,158 @@
+<!DOCTYPE html>
+<html xmlns:th="http://www.thymeleaf.org">
+    <head>
+        <meta charset="UTF-8">
+        <title>人员列表</title>
+        <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0,viewport-fit=cover">
+        <link rel="stylesheet" th:href="@{/static/css/weui.css}" href="../static/css/weui.css">
+        <link rel="stylesheet" th:href="@{/static/css/example.css}" href="../static/css/example.css">
+    </head>
+    <body>
+        <div class="container" id="app" style="display:flex;flex-direction:column;">
+            <div class="page__hd">
+                <h1 class="page__title" th:text="${device.aliasName}"></h1>
+                <p class="page__desc">人员列表</p>
+                <div class="right-corner">
+                    <a class="weui-btn weui-btn_mini weui-btn_default" @click="gotoPeopleLibList()">返回</a>
+                </div>
+            </div>
+            <div>
+                <div class="weui-cells__group weui-cells__group_form">
+                    <div class="weui-cells weui-cells_form">
+                        <div class="weui-cell weui-cell_active">
+                            <div class="weui-cell__bd">
+                                <input class="weui-input" placeholder="查询编号" v-model="personId">
+                            </div>
+                            <div class="weui-cell__ft">
+                                <a class="weui-btn weui-btn_mini weui-btn_primary" @click="pageSearch()">
+                                    <i class="weui-loading" v-show="loading"></i>查询
+                                </a>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+            </div>
+            <div class="weui-cells" style="flex:1;overflow:auto;">
+                <a class="weui-cell"  v-for="(person,index) in list">
+                    <div class="weui-cell__hd" style="width:60px;">
+                        <div style="border-radius:50%;width:48px;height:48px;overflow:hidden;">
+                            <img :src="'data:image/png;base64,' + person.ImageList[0].Data" style="object-fit:cover;" width="48" height="48"/>
+                        </div>
+                    </div>
+                    <div class="weui-cell__bd">
+                        <p v-html="(offset + index + 1) + '.' + person.PersonName"></p>
+                    </div>
+                    <div class="weui-cell__ft">
+                        <button class="weui-btn weui-btn_mini weui-btn_primary" @click="deletePeople(person)">删除</button>
+                    </div>
+                </a>
+            </div>
+            <div v-if="total>0" class="flex-row">
+                <a class="weui-btn weui-btn_mini weui-btn_default" @click="first()">首页</a>
+                <a class="weui-btn weui-btn_mini weui-btn_default" @click="prev()">上一页</a>
+                <a class="weui-btn weui-btn_mini weui-btn_default" @click="next()">下一页</a>
+                <a class="weui-btn weui-btn_mini weui-btn_default" @click="last()">末页</a>
+                <span style="flex:1;align:right;">共有:{{total}}条</span>
+            </div>
+        </div>
+        <script th:src="@{/static/js/jquery.min.js}" src="../static/js/jquery.min.js"></script>
+        <script th:src="@{/static/js/jquery.cookie.min.js}" src="../static/js/jquery.cookie.min.js"></script>
+        <script th:src="@{/static/js/vue.js}" src="../static/js/vue.js"></script>
+        <script th:src="@{/static/js/weui.min.js}" src="../static/js/weui.min.js"></script>
+        <script type="text/javascript" th:inline="javascript">
+            var path = [[${#httpServletRequest.contextPath}]];
+            var device = [[${device}]];
+            var libId = [[${param.libId}]][0];
+        </script>
+        <script type="text/javascript">
+            var vm = new Vue({
+                el:"#app",
+                data : {
+                    list: [],
+                    className: "",
+                    token:$.cookie('devOpsToken'),
+                    loading: false,
+                    personId: "",
+                    total: 0,
+                    offset: 0,
+                    limit: 5
+                },
+                methods: {
+                    gotoPeopleLibList(){
+                        window.location.href = path + "/devOps/listOfPeopleLib?deviceId=" + device.id;
+                    },
+                    pageSearch() {
+                        var self = this;
+                        self.loading = true;
+
+                        $.post(path + "/devOps/queryPeople",{
+                            deviceNo : device.deviceNo,
+                            libId : libId,
+                            qryType: "27",
+                            offset: this.offset,
+                            limit: this.limit,
+                            qryData: this.personId
+                        },
+                        function(rs){
+                            self.loading = false;
+
+                            if(rs.result){
+                                self.list = rs.data.Response.Data.PersonList.PersonInfoList;
+                                self.total = rs.data.Response.Data.Total;
+                            }else{
+                                alert(rs.message);
+                            }
+                        }, "json");
+                    },
+                    delayAlert(msg) {
+                        setTimeout(function(){
+                            weui.alert(msg);
+                        },500);
+                    },
+                    deletePeople(person) {
+                        var self = this;
+
+                        weui.confirm('是否确定删除' + person.PersonName + '?', function(){
+                            $.post(path + "/devOps/deletePeople",{
+                                deviceNo: device.deviceNo,
+                                libId: libId,
+                                personId : person.PersonID
+                            },
+                            function(rs){
+                                if(rs.result){
+                                    self.delayAlert(rs.message);
+                                    self.pageSearch();
+                                }else{
+                                    self.delayAlert(rs.message);
+                                }
+                            },"json");
+                        }, null);
+                    },
+                    first() {
+                        this.offset = 0;
+                        this.pageSearch();
+                    },
+                    prev() {
+                        if(this.offset>0){
+                            this.offset -= this.limit;
+                            this.pageSearch();
+                        }
+                    },
+                    next() {
+                        if(this.offset + this.limit<this.total){
+                            this.offset += this.limit;
+                            this.pageSearch();
+                        }
+                    },
+                    last() {
+                        this.offset = this.total - this.limit;
+                        this.pageSearch();
+                    },
+                },
+                mounted: function() {
+                    this.pageSearch();
+                }
+            });
+        </script>
+    </body>
+</html>

+ 117 - 0
web/src/main/resources/templates/listOfPeopleLib.html

@@ -0,0 +1,117 @@
+<!DOCTYPE html>
+<html xmlns:th="http://www.thymeleaf.org">
+    <head>
+        <meta charset="UTF-8">
+        <title>人员库列表</title>
+        <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0,viewport-fit=cover">
+        <link rel="stylesheet" th:href="@{/static/css/weui.css}" href="../static/css/weui.css">
+        <link rel="stylesheet" th:href="@{/static/css/example.css}" href="../static/css/example.css">
+    </head>
+    <body>
+        <div class="container" id="app" style="display:flex;flex-direction:column;">
+            <div class="page__hd">
+                <h1 class="page__title" th:text="${device.aliasName}"></h1>
+                <p class="page__desc">照片库列表</p>
+                <div class="right-corner">
+                    <a class="weui-btn weui-btn_mini weui-btn_default" @click="gotoDeviceList()">返回</a>
+                </div>
+            </div>
+            <div>
+                <button class="weui-btn weui-btn_mini weui-btn_primary" @click="remoteOpened()">远程开门</button>
+                <button class="weui-btn weui-btn_mini weui-btn_warn" @click="remoteReboot()">重启设备</button>
+            </div>
+            <div class="weui-cells" style="flex:1;overflow:auto;">
+                <a class="weui-cell  weui-cell_access" @click="gotoPeopleList(item)"  v-for="(item,index) in list">
+                    <div class="weui-cell__bd">
+                        <p v-html="item.Name"></p>
+                    </div>
+                    <div class="weui-cell__ft"></div>
+                </a>
+            </div>
+        </div>
+        <script th:src="@{/static/js/jquery.min.js}" src="../static/js/jquery.min.js"></script>
+        <script th:src="@{/static/js/jquery.cookie.min.js}" src="../static/js/jquery.cookie.min.js"></script>
+        <script th:src="@{/static/js/vue.js}" src="../static/js/vue.js"></script>
+        <script th:src="@{/static/js/weui.min.js}" src="../static/js/weui.min.js"></script>
+        <script type="text/javascript" th:inline="javascript">
+            var path = [[${#httpServletRequest.contextPath}]];
+            var device = [[${device}]];
+        </script>
+        <script type="text/javascript">
+            var vm = new Vue({
+                el:"#app",
+                data : {
+                    list: [],
+                    className: "",
+                    token:$.cookie('devOpsToken'),
+                    loading: false
+                },
+                methods: {
+                    gotoDeviceList() {
+                        window.location.href = path + "/devOps/listOfDevice";
+                    },
+                    gotoPeopleList(lib){
+                        window.location.href = path + "/devOps/listOfPeople?deviceId=" + device.id + "&libId=" + lib.ID;
+                    },
+                    pageSearch() {
+                        var self = this;
+                        self.loading = true;
+
+                        $.get(path + "/devOps/queryPeopleLib",{
+                            deviceNo : device.deviceNo
+                        },
+                        function(rs){
+                            self.loading = false;
+
+                            if(rs.result){
+                                self.list = rs.data.Response.Data.LibList;
+                            }else{
+                                alert(rs.message);
+                            }
+                        }, "json");
+                    },
+                    delayAlert(msg) {
+                        setTimeout(function(){
+                            weui.alert(msg);
+                        },500);
+                    },
+                    remoteOpened(){
+                        var self = this;
+
+                        weui.confirm('是否确定打开' + device.aliasName +'?', function(){
+                            $.post(path + "/devOps/remoteOpened",{
+                                deviceId : device.id
+                            },
+                            function(rs){
+                                if(rs.result){
+                                    self.delayAlert(rs.message);
+                                }else{
+                                    self.delayAlert(rs.message);
+                                }
+                            },"json");
+                        }, null);
+                    },
+                    remoteReboot() {
+                        var self = this;
+
+                        weui.confirm('是否确定重启' + device.aliasName + '?', function(){
+                            $.post(path + "/base/deviceInfo/reboot",{
+                                deviceId : device.id
+                            },
+                            function(rs){
+                                if(rs.result){
+                                    self.delayAlert(rs.message);
+                                }else{
+                                    self.delayAlert(rs.message);
+                                }
+                            },"json");
+                        }, null);
+                    }
+                },
+                mounted: function() {
+                    this.pageSearch();
+                }
+            });
+        </script>
+    </body>
+</html>

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels