Skip to content

Commit

Permalink
添加tip提示
Browse files Browse the repository at this point in the history
  • Loading branch information
NiccoloTang committed Dec 17, 2016
1 parent eeede15 commit 4d806dc
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 8 deletions.
6 changes: 6 additions & 0 deletions api/CrapApi.V7.4-2016-12-17.sql
@@ -0,0 +1,6 @@
ALTER TABLE `apidev`.`module`
ADD COLUMN `templateId` VARCHAR(50) NULL COMMENT '接口模板ID' AFTER `projectId`,
ADD INDEX `index_templateId` (`templateId` ASC);

ALTER TABLE `apidev`.`interface`
ADD COLUMN `isTemplate` BIT NOT NULL DEFAULT 0 COMMENT '是否是模板' AFTER `monitorEmails`;
2 changes: 2 additions & 0 deletions api/src/main/java/cn/crap/utils/HttpPostGet.java
Expand Up @@ -235,6 +235,8 @@ private static String gethPath(String path, Map<String, String> params) {
String key = (String) iterator.next();
path += key + "=" + params.get(key) + "&";
}
if(path.endsWith("&"))
path = path.substring(path.length()-1, path.length());
}
return path;
}
Expand Down
13 changes: 13 additions & 0 deletions api/src/main/webapp/resources/css/base.css
Expand Up @@ -11,6 +11,19 @@ body,h1,h2,h3,h4,h5,h6,hr,blockquote,dl,dt,dd,form,fieldset,legend,button,input,
word-wrap:break-word;
white-space: normal!important;
}
.tip-div{
text-align: center;
overflow: hidden;
padding: 5px 20px;
line-height: 22px;
border-radius: 5px;
background: rgba(0,0,0,0.6);
color: #fff;
position: fixed;
top:50%;
left:50%;
display:none;
}
.l-s-n{list-style:none;}
.o2{opacity:0.2}.o3{opacity:0.3}.o5{opacity:0.5}.o8{opacity:0.8}
.no-b-s{-webkit-box-shadow: none; box-shadow: none; border: 1px solid #DDD;}
Expand Down
1 change: 1 addition & 0 deletions api/src/main/webapp/resources/html/backHtml/index.html
Expand Up @@ -248,6 +248,7 @@
<i class="iconfont i-close CFFF fb f20" onclick="closeMyDialog('myDialog')">&#xe615;</i>
<i class="iconfont i-full CFFF fb f20" onclick="fullMyDialog('myDialog')">&#xe62e;</i>
</div>
<div class="tip-div" id="tip-div"></div>

<div id="float" class="folat">
<div class="sk-wave">
Expand Down
1 change: 0 additions & 1 deletion api/src/main/webapp/resources/html/frontHtml/index.html
Expand Up @@ -47,7 +47,6 @@
</div>
</div>
</div>

<!-- footer -->
<div ng-include="'resources/html/subTpl/footer.tpl.html'"></div>
<!-- End:footer -->
Expand Down
Expand Up @@ -81,7 +81,6 @@
<!-- End:main view -->
</div>
</div>

<!-- footer -->
<div ng-include="'resources/html/subTpl/footer.tpl.html'"></div>
<!-- End:footer -->
Expand Down
1 change: 1 addition & 0 deletions api/src/main/webapp/resources/html/subTpl/footer.tpl.html
Expand Up @@ -43,6 +43,7 @@
<div id="lookUpContent" class="look-up-content f12 tc">加载中....</div>
<i class="iconfont i-close" onclick="iClose('lookUp')">&#xe615;</i>
</div>
<div class="tip-div" id="tip-div"></div>
<div id="fade"></div>
<div id="passwordDiv" class="look-up shadow">
<div id="lookUpContent" class="look-up-content f12 tc p30 BGFFF">
Expand Down
4 changes: 2 additions & 2 deletions api/src/main/webapp/resources/js/app.js
Expand Up @@ -139,7 +139,7 @@ app.run(function($rootScope, $state, $stateParams, $http, $timeout,httpService)
if(callBack){
callBack();
}
iLoading = "PROPUPFLOAT";
iLoading = "TIPFLOAT";
if(myLoading){
iLoading = myLoading;
}
Expand Down Expand Up @@ -187,7 +187,7 @@ app.run(function($rootScope, $state, $stateParams, $http, $timeout,httpService)
* 发送请求工具方法
*/
$rootScope.sendRequest = function(url,myLoading){
var iLoading = "PROPUPFLOAT";
var iLoading = "FLOATTIP";
if(myLoading){
iLoading = myLoading;
}
Expand Down
21 changes: 17 additions & 4 deletions api/src/main/webapp/resources/js/core.js
Expand Up @@ -225,21 +225,31 @@ function closeTip(data,iLoading,tipTime){
if(tipTime==-1){//不关闭
tipMessage = '';
}
if(data.indexOf('[OK]')>=0){
if( data.replace('[OK]','')!='' )
tipMessage = data.replace('[OK]','') + tipMessage;
else
tipMessage = "操作成功!<br>" + tipMessage;
}
if(data.indexOf('[ERROR]')>=0){
tipMessage = data.replace('[ERROR]', '') + "<br>" + tipMessage;
}

if(iLoading.toUpperCase().indexOf('PROPUP') >= 0){
//返回结果有提示
if (data.indexOf('[ERROR]') < 0 && data.indexOf('[OK]')>=0 && data.replace('[OK]','')!=''){
$("#lookUpContent").html(succ1 + data.replace('[OK]','') + "<br>" + tipMessage +succ2);
if (data.indexOf('[OK]')>=0){
$("#lookUpContent").html(succ1 + tipMessage +succ2);
}
//返回结果没有提示
else if(data.indexOf('[ERROR]') < 0){
$("#lookUpContent").html(succ1+"操作成功!<br>"+tipMessage+succ2);
$("#lookUpContent").html(succ1+tipMessage+succ2);
}
else{
if(tipTime !=-1){
tipTime = 5;
tipMessage = tipTime+ "秒后自动关闭";
}
$("#lookUpContent").html(err1+data.replace('[ERROR]', '') + "<br>" + tipMessage +err2);
$("#lookUpContent").html(err1+tipMessage +err2);
}
showMessage('lookUp','false',false,tipTime);
}
Expand All @@ -249,6 +259,9 @@ function closeTip(data,iLoading,tipTime){
showMessage("float",'false',false,0);
}
}
if(iLoading.toUpperCase().indexOf('TIP') >= 0){
showMessage("tip-div",tipMessage,false,tipTime);
}
}
/** *********************页面提示信息显示方法************************* */
/**
Expand Down

0 comments on commit 4d806dc

Please sign in to comment.