Commit 1464f6d0 authored by 赵啸非's avatar 赵啸非

修改前端菜单

parent c16365fd
......@@ -50,6 +50,7 @@ export default {
data() {
return {
fileContent:"",
id:null,
icons: [
'info', 'error', 'success', 'warning', 'question',
'tickets', 'document', 'goods', 'sold-out', 'news',
......@@ -102,6 +103,7 @@ export default {
this.urls.currUrl = this.pageInfo.addUrl;
this.getData();
if(row.id){
this.id=row.id
this.form.parentId=row.id
}
this.menuOptions = menuOptions;
......@@ -121,6 +123,9 @@ export default {
},
/**获取数据后弹框 */
afterRender(data) {
if(this.id){
this.form.parentId=this.id
}
this.open = true;
},
afterSubmit(data) {
......
......@@ -166,12 +166,16 @@ public class MenuServiceImpl extends AbstractCRUDServiceImpl<MenuDao, MenuEntity
MenuQuery query = new MenuQuery();
query.setParentId(entity.getParentId());
Comparator<Integer> comparator = Comparator.comparing(Integer::intValue);
Optional<Integer> maxOptional = this.find(query).stream().map(MenuEntity::getOrderId).filter(f->f!=9999).max(comparator);
Optional<Integer> maxOptional = this.find(query).stream().map(item->{
if(ObjectUtils.isEmpty(item.getOrderId())) return 1;
return item.getOrderId();
}).filter(f->f!=9999).max(comparator);
maxOptional.ifPresent(e -> {
e=e+1;
entity.setOrderId(e);
});
MenuEntity parentMenuEntity = this.get(entity.getParentId());
if (!ObjectUtils.isEmpty(parentMenuEntity) && SatusEnum.DISENABLE.getValue() == parentMenuEntity.getStatus()) {
throw new AppException("菜单信息停用,不允许新增");
......
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