123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <script src="../js/lib/jquery-1.9.1/jquery.min.js"></script>
- <script src="../js/lib/vue.js"></script>
- <script src="../js/config/base_config.js"></script>
- <script src="../js/lib/ajaxRedirect.js"></script>
- <link href="../ztree/css/zTreeStyle/zTreeStyle.css" rel="stylesheet" />
- <script src="../ztree/js/jquery.ztree.all.js"></script>
- <script src="../jqueryUI/jquery-ui.js"></script>
- <link href="../jqueryUI/jquery-ui.css" rel="stylesheet" />
- <link href="../css/css.css" rel="stylesheet" type="text/css">
- <title>Title</title>
- </head>
- <body>
- <div>
- <!--内容-->
- <div class="content">
- <!--筛选-->
- <ul class="recommendation-screen">
- <li>
- <input class="input01" type="text" id="selectName" placeholder="请输入关键字"/>
- <div class="button01">
- <button onclick="setlist();">查询</button>
- </div>
- </li>
- <li>
- <button onclick="toAdd()">添加</button>
- <button onclick="toAddFace()">添加图片</button>
- </li>
- </ul>
- <!--table表格-->
- <div class="table">
- <table>
- <thead>
- <tr>
- <!--<th>id</th>-->
- <th>名称</th>
- <th>faceSetToken</th>
- <th>操作</th>
- </tr>
- </thead>
- <tbody id="faceSetListTable">
- </tbody>
- </table>
- </div>
- <!--分页-->
- </div>
- </div>
- <div id="iFaceSetAdd" style="display: none;">
- <div class="" style="padding-bottom:0;">
- <div >
- <form id="iFaceSetAddForm">
- <input type="hidden" name="id" id="iFaceSetAddId">
- <table border="0" width="90%"><tr><td width="20%">
- <span >名称:</span>
- </td><td width="80%">
- <input style="border-radius: 5px;margin-bottom: 20px;margin-right: 10px;border: solid 1px #ccc;width: 148px;
- height: 32px; padding-left: 30px; line-height: 32px;"
- type="text" id="iFaceSetAddName" autocomplete="off" name="setName">
- </td></tr></table>
- </form>
- </div>
- </div>
- </div>
- <iframe name="hidden_frameFile" id="hidden_frameFile" style="display:none"></iframe>
- <div id="iFaceAdd" style="display: none;">
- <div class="" style="padding-bottom:0;">
- <div >
- <form id="iFaceAddForm" target="hidden_frameFile" method="post" enctype="multipart/form-data" >
- faceSetToken : <input name="setToken" id="iFaceAddsetToken">
- <table border="0" width="90%">
- <tr><td width="20%">
- <span > 图片:</span>
- </td><td width="80%">
- <input type="file" name="faceFile">
- </td></tr></table>
- </form>
- </div>
- </div>
- </div>
- <div id="iFaceSearch" style="display: none;">
- <div class="" style="padding-bottom:0;">
- <div >
- <form id="iFaceSearchForm" target="hidden_frameFile" method="post" enctype="multipart/form-data" >
- faceSetToken : <input name="setToken" id="iFaceSearchsetToken">
- <table border="0" width="90%">
- <tr><td width="20%">
- <span > 图片:</span>
- </td><td width="80%">
- <input type="file" name="faceFile">
- </td></tr></table>
- </form>
- </div>
- </div>
- </div>
- </body>
- <script type="text/javascript">
- $(document).ready(function(){
- setlist();
- $("#iFaceSetAdd").dialog({
- autoOpen:false,
- modal:true,
- closeable:false,
- bgiframe:true,
- height:250,
- width:800,
- closeOnEscape:false,
- draggable:false,
- resizable:false,
- title:"集合",
- open:function (event, ui) {
- $(".ui-dialog-titlebar-close").hide();
- },
- buttons:{
- "保存添加信息":function () {
- $.ajax({
- url:"/face/faceSetAdd" ,
- type:"POST",
- data:$("#iFaceSetAddForm").serialize(),
- dataType:"json",
- success:function (data) {
- if (data.status == 'SUCCESS') {
- alert("信息已经成功保存");
- $("#iFaceSetAdd").dialog("close");
- setlist();
- }
- },
- complete:function (XHR, TS) {
- $('.ui-dialog-buttonpane').find('button:contains("保存添加信息")').removeAttr("disabled");
- },
- error:function (XMLHttpRequest, textStatus, errorThrown) {
- alert(textStatus);
- }
- });
- },
- "关闭":function () {
- $(this).dialog("close");
- }
- }
- });
- $("#iFaceAdd").dialog({
- autoOpen:false,
- modal:true,
- closeable:false,
- bgiframe:true,
- height:250,
- width:800,
- closeOnEscape:false,
- draggable:false,
- resizable:false,
- title:"集合",
- open:function (event, ui) {
- $(".ui-dialog-titlebar-close").hide();
- },
- buttons:{
- "保存添加信息":function () {
- $("#iFaceAddForm").attr("action","/face/faceAdd");
- $('#iFaceAddForm').submit();
- },
- "关闭":function () {
- $(this).dialog("close");
- }
- }
- });
- $("#iFaceSearch").dialog({
- autoOpen:false,
- modal:true,
- closeable:false,
- bgiframe:true,
- height:250,
- width:800,
- closeOnEscape:false,
- draggable:false,
- resizable:false,
- title:"集合",
- open:function (event, ui) {
- $(".ui-dialog-titlebar-close").hide();
- },
- buttons:{
- "保存添加信息":function () {
- $("#iFaceSearchForm").attr("action","/face/faceSearch");
- $('#iFaceSearchForm').submit();
- },
- "关闭":function () {
- $(this).dialog("close");
- }
- }
- });
- });
- function showMessage(message){
- var obj=eval(message);
- console.log(obj);
- // alert(''+obj.status);
- // alert(obj.length);
- for(var i=0;i<obj.length;i++){
- alert('相似图片:'+obj[i].face_token+'相似度:'+obj[i].confidence+'%');
- }
- }
- function toAdd(){
- $("#iFaceSetAdd").dialog("open");
- }
- function toAddFace(){
- $("#iFaceAdd").dialog("open");
- }
- function setlist(){
- $("#faceSetListTable").html("");
- $.ajax( {
- url: "/face/faceSetList",
- dataType: 'json',
- type: 'post',
- data:{},
- success : function(data,textStatus) {
- console.log(data);
- if(data.status=="SUCCESS"){
- $.each(data.list, function (i, value) {
- $("#faceSetListTable").append('<tr><td>'+value.display_name+'</td><td>'+value.faceset_token+'</td>' +
- '<td><a href="#" onclick="faceSetDelete('+"'"+value.faceset_token+"'"+')">删除</a></td>' +
- '<td><a href="#" onclick="faceSetDetail('+"'"+value.faceset_token+"'"+')">详情</a></td>' +
- '<td><a href="#" onclick="faceSearch('+"'"+value.faceset_token+"'"+')">对比</a></td>' +
- '</tr>');
- });
- }
- },
- error : function() {
- alert("404");
- }
- });
- }
- function faceSetDelete(setToken){
- $.ajax({
- url: "/face/faceSetDelete",
- dataType: 'json',
- type: 'post',
- data:{"setToken":setToken},
- success : function(data,textStatus) {
- console.log(data);
- setlist();
- },
- error : function() {
- alert("404");
- }
- });
- }
- function faceSetDetail(setToken){
- $.ajax({
- url: "/face/faceSetInfo",
- dataType: 'json',
- type: 'post',
- data:{"setToken":setToken},
- success : function(data,textStatus) {
- console.log(data);
- alert(data.info.display_name);
- $.each(data.info.face_tokens, function (i, value) {
- alert(value)
- });
- },
- error : function() {
- alert("404");
- }
- });
- }
- function faceSearch(setToken){
- $("#iFaceSearchsetToken").val(setToken);
- $("#iFaceSearch").dialog("open");
- }
- </script>
- </html>
|