|
|
@@ -91,8 +91,10 @@ function addOrUpdateConstant(url){
|
|
|
'valid':valid
|
|
|
};
|
|
|
addConstant_service(url, param, function(data) {
|
|
|
- alert(data);
|
|
|
queryConstant();
|
|
|
+ layer.msg(data, {
|
|
|
+ time: 2000//2s后自动关闭
|
|
|
+ });
|
|
|
$('#formModal').modal('toggle');
|
|
|
}, function(error) {
|
|
|
alert(error);
|
|
|
@@ -135,13 +137,20 @@ function updateConstant(){
|
|
|
}
|
|
|
|
|
|
function deleteConstant(id){
|
|
|
- if(confirm("确定删除记录?")){
|
|
|
+ //询问框
|
|
|
+ layer.confirm('确定删除记录?', {
|
|
|
+ btn: ['删除','取消'] //按钮
|
|
|
+ }, function(){
|
|
|
var param ={"id":id};
|
|
|
deleteConstant_service("/constant/delete/", param, function(data) {
|
|
|
- alert(data);
|
|
|
- queryConstant();
|
|
|
+ queryConstant();//重新加载表格数据
|
|
|
+ layer.msg(data, {
|
|
|
+ time: 2000//20s后自动关闭
|
|
|
+ });
|
|
|
}, function(error) {
|
|
|
alert(error);
|
|
|
});
|
|
|
- }
|
|
|
+ }, function(index){
|
|
|
+ layer.close(index);
|
|
|
+ });
|
|
|
}
|