Commit 6f816425 authored by 雍欢's avatar 雍欢

1、添加/编辑功能的时候通过easy-search来选择菜单url

parent 3e606e98
......@@ -13,11 +13,19 @@ import javax.persistence.Table;
@Table(name = "sa_oplink")
@Entity
public class Link extends AbstractEntity {
/**
* 地址
*/
private String url;
public Link() {
}
public Link(String url) {
this.url = url;
}
public String getUrl() {
return url;
}
......
......@@ -6,9 +6,14 @@ import com.huigou.uasp.bmp.opm.domain.model.resource.Link;
import com.huigou.uasp.client.CommonController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.mvc.method.RequestMappingInfo;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;
import java.util.Collections;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
/**
* @author yonghuan
......@@ -17,11 +22,22 @@ import java.util.List;
@Controller
public class LinkController extends CommonController {
@Autowired
private RequestMappingHandlerMapping handlerMapping;
@Autowired
private LinkApplication linkApplication;
public String syncLinks() {
List<Link> links = Collections.emptyList();
List<Link> links = new ArrayList<>(500);
Map<RequestMappingInfo, HandlerMethod> map = handlerMapping.getHandlerMethods();
Iterator<Map.Entry<RequestMappingInfo, HandlerMethod>> iter = map.entrySet().iterator();
Map.Entry<RequestMappingInfo, HandlerMethod> entry;
while (iter.hasNext()) {
entry = iter.next();
String url = entry.getKey().getPatternsCondition().getPatterns().iterator().next();
links.add(new Link(url));
}
linkApplication.syncLinks(links);
return success();
}
......
......@@ -499,7 +499,7 @@ public class CommonController extends ControllerBase {
* @param variables 参数
* @return
*/
public String outputAndProcUnitHandlerPDF(String template, String bizId, Map<String, Object> variables) {
protected String outputAndProcUnitHandlerPDF(String template, String bizId, Map<String, Object> variables) {
ProcUnitHandlerApplication application = SpringBeanFactory.getBean(this.getServletContext(), "procUnitHandlerApplication",
ProcUnitHandlerApplication.class);
if (application != null && bizId != null) {
......
......@@ -30,7 +30,7 @@ $(function () {
moveHandler: moveHandler,
buildPermission: {id: 'buildPermission', text: '生成权限', img: 'fa-cubes', click: buildPermission},
syncIcons: {id: 'syncIcons', text: '同步图标', img: 'fa-list-alt', click: syncIcons},
syncLinks: {id: 'syncLinks', text: '同步链接', img: 'fa-list-alt', click: syncLinks},
syncLinks: {id: 'syncLinks', text: '同步链接', img: 'fa-external-link', click: syncLinks},
};
var toolbarOptions = UICtrl.getDefaultToolbarOptions(toolbarparam);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment