删除 工程

功能
pull/3/head
rekoe 2016-03-24 18:26:36 +08:00
parent a48459a10f
commit 968c4ab2d8
3 changed files with 64 additions and 2 deletions

View File

@ -0,0 +1,37 @@
package com.rekoe.service;
import org.nutz.dao.Dao;
import org.nutz.ioc.loader.annotation.IocBean;
import com.rekoe.domain.ProjectConfig;
/**
* @author ²º¹³<br/>
* 2016324 4:48:45<br/>
* http://www.rekoe.com<br/>
* QQ:5382211
*/
@IocBean(args = { "refer:dao" }, create = "init")
public class ProjectConfigService extends BaseService<ProjectConfig> {
public ProjectConfigService(Dao dao) {
super(dao);
}
public ProjectConfig get() {
ProjectConfig conf = dao().fetch(getEntityClass());
return conf;
}
public boolean update(String repoPath, String domainPath) {
ProjectConfig conf = get();
conf.setDomainPath(domainPath);
conf.setRepositoryPath(repoPath);
dao().update(conf);
return true;
}
public void init() {
get();
}
}

View File

@ -30,9 +30,9 @@ function getTableForm() {
<@p.column title="描述" align="center">${user.des}</@p.column><#t/>
<@p.column title="设置用户组" align="center">设置用户组</@p.column><#t/>
<@p.column title="设置权限" align="center">设置权限</@p.column><#t/>
<@shiro.hasPermission name="svn.user:edit">
<@shiro.hasPermission name="svn.project:auth.manager">
<@p.column title="编辑" align="center">
<a href="delete.rk?id=${user.pj}" class="pn-opt">删除</a><#rt/>
<a href="javascript:void(0);" onclick="Cms.deleted('${user.pj}')" class="pn-opt">删除</a><#rt/>
</@p.column><#t/>
</@shiro.hasPermission>
</@p.table>

View File

@ -165,4 +165,29 @@ Cms.updateAll = function(url,back){
}
});
return false;
}
Cms.deleted = function(id){
$.dialog({
type: "warn",
content: '确定要删除此记录?',
ok: 'Ok',
cancel: 'Cancel',
onOk: function() {
$.ajax({
url: "delete.rk",
type: "POST",
data: {"id":id},
dataType: "json",
cache: false,
success: function(message) {
$.message(message);
if (message.type == "success")
{
window.location.href = back;
}
}
});
}
});
return false;
}