From b7f414d07f72451612939b099c845fc5881bbc0f Mon Sep 17 00:00:00 2001 From: zouap Date: Tue, 22 Feb 2022 16:00:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- public/home/search.js | 53 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 49 insertions(+), 4 deletions(-) diff --git a/public/home/search.js b/public/home/search.js index 795287aaa..7f00b5b94 100644 --- a/public/home/search.js +++ b/public/home/search.js @@ -73,15 +73,60 @@ function displayResult(tableName,page,jsonResult,onlyReturnNum,keyword){ } else if (tableName == "issue") { displayIssueResult(page,jsonResult,onlyReturnNum,keyword); } else if (tableName == "user") { - + displayUserResult(page,jsonResult,onlyReturnNum,keyword); } else if (tableName == "org") { - + displayOrgResult(page,jsonResult,onlyReturnNum,keyword); } else if (tableName == "dataset") { - + displayDataSetResult(page,jsonResult,onlyReturnNum,keyword); } else if (tableName == "pr") { - + displayPrResult(page,jsonResult,onlyReturnNum,keyword); } } + +function displayPrResult(page,jsonResult,onlyReturnNum,keyword){ + var data = jsonResult.Result; + var total = jsonResult.Total; + $('#pr_total').text(total); + if(!onlyReturnNum){ + $('#keyword_desc').text(keyword); + $('#obj_desc').text("合并请求"); + $('#child_total').text(total); + } +} + +function displayDataSetResult(page,jsonResult,onlyReturnNum,keyword){ + var data = jsonResult.Result; + var total = jsonResult.Total; + $('#dataset_total').text(total); + if(!onlyReturnNum){ + $('#keyword_desc').text(keyword); + $('#obj_desc').text("数据集"); + $('#child_total').text(total); + } +} + +function displayOrgResult(page,jsonResult,onlyReturnNum,keyword){ + var data = jsonResult.Result; + var total = jsonResult.Total; + $('#org_total').text(total); + if(!onlyReturnNum){ + $('#keyword_desc').text(keyword); + $('#obj_desc').text("组织"); + $('#child_total').text(total); + } +} + +function displayUserResult(page,jsonResult,onlyReturnNum,keyword){ + var data = jsonResult.Result; + var total = jsonResult.Total; + $('#user_total').text(total); + if(!onlyReturnNum){ + $('#keyword_desc').text(keyword); + $('#obj_desc').text("用户"); + $('#child_total').text(total); + } +} + function displayIssueResult(page,jsonResult,onlyReturnNum,keyword){ var data = jsonResult.Result; var total = jsonResult.Total;