-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
32 changed files
with
1,716 additions
and
537 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import Vue from 'vue' | ||
import store from '@/store' | ||
|
||
/** 权限指令**/ | ||
|
||
Vue.directive('has', { | ||
bind: function (el, binding) { | ||
if (!Vue.prototype.$_has(binding.value)) { | ||
el.parentNode && el.parentNode.removeChild(el) || (el.style.display = 'none') | ||
} | ||
} | ||
}) | ||
|
||
// 权限检查方法 | ||
Vue.prototype.$_has = function (value) { | ||
// 获取用户按钮权限 | ||
let isExist = false | ||
const dynamicButtons = store.getters.buttons | ||
if (dynamicButtons === undefined || dynamicButtons === null || dynamicButtons.length < 1) { | ||
return isExist | ||
} | ||
dynamicButtons.forEach(button => { | ||
if (button.resources === value) { | ||
isExist = true | ||
return isExist | ||
} | ||
}) | ||
return isExist | ||
} |
114 changes: 114 additions & 0 deletions
114
src/main/java/com/zmr/wind/modules/sys/controller/ConfigController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
package com.zmr.wind.modules.sys.controller; | ||
|
||
import java.util.List; | ||
|
||
import org.apache.shiro.authz.annotation.RequiresPermissions; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.stereotype.Controller; | ||
import org.springframework.ui.ModelMap; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.ResponseBody; | ||
|
||
import com.zmr.wind.common.base.BaseController; | ||
import com.zmr.wind.common.page.TableDataInfo; | ||
import com.zmr.wind.core.annotation.Log; | ||
import com.zmr.wind.core.bean.R; | ||
import com.zmr.wind.core.enums.BusinessType; | ||
import com.zmr.wind.modules.sys.entity.Config; | ||
import com.zmr.wind.modules.sys.service.IConfigService; | ||
|
||
/** | ||
* 参数配置 信息操作处理 | ||
* | ||
* @author zmr | ||
* @date 2019-05-08 | ||
*/ | ||
@Controller | ||
@RequestMapping("/sys/config") | ||
public class ConfigController extends BaseController | ||
{ | ||
private String prefix = "sys/config"; | ||
|
||
@Autowired | ||
private IConfigService configService; | ||
|
||
@RequiresPermissions("sys:config:view") | ||
@GetMapping() | ||
public String config() | ||
{ | ||
return prefix + "/config"; | ||
} | ||
|
||
/** | ||
* 查询参数配置列表 | ||
*/ | ||
@RequiresPermissions("sys:config:list") | ||
@PostMapping("/list") | ||
@ResponseBody | ||
public TableDataInfo list(Config config) | ||
{ | ||
startPage(); | ||
List<Config> list = configService.findList(config); | ||
return getDataTable(list); | ||
} | ||
|
||
/** | ||
* 新增参数配置 | ||
*/ | ||
@GetMapping("/add") | ||
public String add() | ||
{ | ||
return prefix + "/add"; | ||
} | ||
|
||
/** | ||
* 新增保存参数配置 | ||
*/ | ||
@RequiresPermissions("sys:config:add") | ||
@Log(title = "参数配置", businessType = BusinessType.INSERT) | ||
@PostMapping("/add") | ||
@ResponseBody | ||
public R addSave(Config config) | ||
{ | ||
return toAjax(configService.save(config)); | ||
} | ||
|
||
/** | ||
* 修改参数配置 | ||
*/ | ||
@GetMapping("/edit/{configId}") | ||
public String edit(@PathVariable("configId") Integer configId, ModelMap mmap) | ||
{ | ||
Config config = configService.findById(configId); | ||
mmap.put("config", config); | ||
return prefix + "/edit"; | ||
} | ||
|
||
/** | ||
* 修改保存参数配置 | ||
*/ | ||
@RequiresPermissions("sys:config:edit") | ||
@Log(title = "参数配置", businessType = BusinessType.UPDATE) | ||
@PostMapping("/edit") | ||
@ResponseBody | ||
public R editSave(Config config) | ||
{ | ||
return toAjax(configService.update(config)); | ||
} | ||
|
||
/** | ||
* 删除参数配置 | ||
*/ | ||
@RequiresPermissions("sys:config:remove") | ||
@Log(title = "参数配置", businessType = BusinessType.DELETE) | ||
@PostMapping( "/remove") | ||
@ResponseBody | ||
public R remove(String ids) | ||
{ | ||
return toAjax(configService.deleteByIds(ids)); | ||
} | ||
|
||
} |
114 changes: 114 additions & 0 deletions
114
src/main/java/com/zmr/wind/modules/sys/controller/NoticeController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
package com.zmr.wind.modules.sys.controller; | ||
|
||
import java.util.List; | ||
|
||
import org.apache.shiro.authz.annotation.RequiresPermissions; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.stereotype.Controller; | ||
import org.springframework.ui.ModelMap; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.ResponseBody; | ||
|
||
import com.zmr.wind.common.base.BaseController; | ||
import com.zmr.wind.common.page.TableDataInfo; | ||
import com.zmr.wind.core.annotation.Log; | ||
import com.zmr.wind.core.bean.R; | ||
import com.zmr.wind.core.enums.BusinessType; | ||
import com.zmr.wind.modules.sys.entity.Notice; | ||
import com.zmr.wind.modules.sys.service.INoticeService; | ||
|
||
/** | ||
* 通知公告 信息操作处理 | ||
* | ||
* @author zmr | ||
* @date 2019-05-08 | ||
*/ | ||
@Controller | ||
@RequestMapping("/sys/notice") | ||
public class NoticeController extends BaseController | ||
{ | ||
private String prefix = "sys/notice"; | ||
|
||
@Autowired | ||
private INoticeService noticeService; | ||
|
||
@RequiresPermissions("sys:notice:view") | ||
@GetMapping() | ||
public String notice() | ||
{ | ||
return prefix + "/notice"; | ||
} | ||
|
||
/** | ||
* 查询通知公告列表 | ||
*/ | ||
@RequiresPermissions("sys:notice:list") | ||
@PostMapping("/list") | ||
@ResponseBody | ||
public TableDataInfo list(Notice notice) | ||
{ | ||
startPage(); | ||
List<Notice> list = noticeService.findList(notice); | ||
return getDataTable(list); | ||
} | ||
|
||
/** | ||
* 新增通知公告 | ||
*/ | ||
@GetMapping("/add") | ||
public String add() | ||
{ | ||
return prefix + "/add"; | ||
} | ||
|
||
/** | ||
* 新增保存通知公告 | ||
*/ | ||
@RequiresPermissions("sys:notice:add") | ||
@Log(title = "通知公告", businessType = BusinessType.INSERT) | ||
@PostMapping("/add") | ||
@ResponseBody | ||
public R addSave(Notice notice) | ||
{ | ||
return toAjax(noticeService.save(notice)); | ||
} | ||
|
||
/** | ||
* 修改通知公告 | ||
*/ | ||
@GetMapping("/edit/{noticeId}") | ||
public String edit(@PathVariable("noticeId") Integer noticeId, ModelMap mmap) | ||
{ | ||
Notice notice = noticeService.findById(noticeId); | ||
mmap.put("notice", notice); | ||
return prefix + "/edit"; | ||
} | ||
|
||
/** | ||
* 修改保存通知公告 | ||
*/ | ||
@RequiresPermissions("sys:notice:edit") | ||
@Log(title = "通知公告", businessType = BusinessType.UPDATE) | ||
@PostMapping("/edit") | ||
@ResponseBody | ||
public R editSave(Notice notice) | ||
{ | ||
return toAjax(noticeService.update(notice)); | ||
} | ||
|
||
/** | ||
* 删除通知公告 | ||
*/ | ||
@RequiresPermissions("sys:notice:remove") | ||
@Log(title = "通知公告", businessType = BusinessType.DELETE) | ||
@PostMapping( "/remove") | ||
@ResponseBody | ||
public R remove(String ids) | ||
{ | ||
return toAjax(noticeService.deleteByIds(ids)); | ||
} | ||
|
||
} |
Oops, something went wrong.