人脸识别修改调用脚本路径,页面增加查看时可新增

This commit is contained in:
zhanghongqing
2018-11-27 17:56:01 +08:00
parent 80e6bbb53d
commit 204a1d5c93
4 changed files with 33 additions and 9 deletions

View File

@@ -112,9 +112,10 @@ $(function(){
if(ifSubmit){
$("#srcFileInfo").val($("#srcFile").val());
var srcFacePath =$("#srcPath").val();
var faceFilePath =$("#faceFilePath").val();
var fd = new FormData($('#cfgFrom')[0]);
$.ajax({
url: "${ctx}/ntc/av/sample/faceToPicture",
url: "${ctx}/ntc/av/sample/faceToPicture?faceFilePath="+encodeURIComponent(faceFilePath),
type: "POST",
processData: false,
contentType: false,
@@ -126,12 +127,17 @@ $(function(){
},
success: function(data) {
top.$.jBox.closeTip();
$.jBox.close();
if(data.status==1){
$("#picPath").val(data.picFilePath);
$("#srcPath").val(data.srcPath);
$("#faceFilePath").val(data.faceFilePath);
$("#showPicture").removeClass("hidden");
var url = "${ctx}/ntc/av/sample/selectVedioPicture?picFilePath="+encodeURIComponent(data.picFilePath);
//openPicWindow(url);
if($.jBox.getBox().length>0){
openPicWindow(url);
}
}else{
top.$.jBox.tip(data.msg, "<spring:message code='info'/>");
return;
@@ -140,6 +146,7 @@ $(function(){
},
error:function(jqXHR, textStatus, errorThrown){
top.$.jBox.closeTip();
$.jBox.close();
//alert(jqXHR.responseText);
top.$.jBox(jqXHR.responseText,{
width: $(document).width()*0.9,
@@ -287,6 +294,7 @@ function sampleFileValidate(fileType,fileName){
if(!flag){
// ("文件名不合法");
$("#fileErrorNote").append("<label id='level-error' class='error'><spring:message code='file_in_wrong_format'/></label>");
$.jBox.close();
return false;
}
return true;
@@ -398,6 +406,7 @@ function sampleFileValidate(fileType,fileName){
<c:when test="${_cfg.functionId eq 632}">
<input id="srcFile" type="file" name="srcFile" style="width: 330px;display:none" multiple/>
<input id="srcPath" name="srcPath" type="hidden" style="width: 330px;"/>
<input id="faceFilePath" name="faceFilePath" type="hidden" value="${faceFilePath}"/>
<div class="input-group">
<input id="srcFileInfo" name="srcFileInfo" readonly="readonly" data-msg-required=""
placeholder="<spring:message code="select_file"/>" class="required form-control" style=" background-color:transparent"

View File

@@ -5,6 +5,11 @@
<title><spring:message code="${cfgName}"></spring:message></title>
<script>
$(document).ready(function() {
if($("#functionId",parent.document).val()==632){
$("#fileAdd").show();
}else{
$("#fileAdd").hide();
}
$("#submitButton").on('click',function(){
var selectPic = "";
$("div[name='checkPic']").each(function(){
@@ -47,7 +52,9 @@
})
});
function addFile(){
$("#srcFile" , parent.document).trigger("click");
}
</script>
<style type="text/css">
.selectImgDiv .item{width:150px;height:150px;border:solid thin #aaa;float:left;margin:10px;cursor:pointer;overflow:hidden}
@@ -87,7 +94,9 @@
<input type="hidden" id="picFilePath" name="picFilePath" value="${picFilePath }"/>
<div class="col-md-12">
<div class="pull-right">
<button type="button" id="submitButton" class="btn btn-warning" style="margin-right:10px">
<button type="button" id="fileReload" class="btn btn-default" style="margin-right:10px" onClick="window.location.reload()" value="111"><i class="fa fa-refresh"></i> <spring:message code="refresh"/></button>
<button type="button" id="fileAdd" onClick="addFile()" class="btn btn-primary" style="margin-right:10px"><i class="fa fa-plus"></i> <spring:message code="add"/></button>
<button type="button" id="submitButton" class="btn btn-warning" style="margin-right:10px">
<i class="fa fa-plus"></i>
<spring:message code="ok"></spring:message></button>
</div>