mirror of https://gitee.com/stylefeng/guns
parent
da1a60f216
commit
df8afb97f6
|
@ -0,0 +1,71 @@
|
|||
package cn.stylefeng.guns.modular.dict;
|
||||
|
||||
|
||||
import cn.stylefeng.roses.kernel.dict.modular.pojo.request.DictTypeRequest;
|
||||
import cn.stylefeng.roses.kernel.dict.modular.service.DictTypeService;
|
||||
import cn.stylefeng.roses.kernel.resource.api.annotation.ApiResource;
|
||||
import cn.stylefeng.roses.kernel.resource.api.annotation.GetResource;
|
||||
import cn.stylefeng.roses.kernel.rule.pojo.response.ResponseData;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
/**
|
||||
* 字典类型视图控制器
|
||||
*
|
||||
* @Author: huangyao
|
||||
* @Date: 2021/1/6 20:53
|
||||
**/
|
||||
@Controller
|
||||
@Slf4j
|
||||
@ApiResource(name = "字典类型管理相关的界面渲染", path = "dictType")
|
||||
public class DictTypeViewController {
|
||||
|
||||
private String PREFIX = "/modular/system/dictType";
|
||||
|
||||
@Autowired
|
||||
private DictTypeService dictTypeService;
|
||||
|
||||
/**
|
||||
* 字典类型管理-字典类型-视图
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
* @author huangyao
|
||||
* @date 2021/1/6 21:08
|
||||
*/
|
||||
@GetResource(name = "字典类型管理-字典类型-视图", path = "", requiredPermission = false, requiredLogin = false)
|
||||
public String indexView() {
|
||||
return PREFIX + "/dictType.html";
|
||||
}
|
||||
|
||||
/**
|
||||
* 字典类型管理-添加-视图
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
* @author huangyao
|
||||
* @date 2021/1/6 21:25
|
||||
*/
|
||||
@GetResource(name = "字典类型管理-添加-视图", path = "/addView", requiredPermission = false, requiredLogin = false)
|
||||
public String addView() {
|
||||
return PREFIX + "/dictType_add.html";
|
||||
}
|
||||
|
||||
/**
|
||||
* 字典类型管理-编辑-视图
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
* @author huangyao
|
||||
* @date 2021/1/6 21:26
|
||||
*/
|
||||
@GetResource(name = "字典类型管理-编辑-视图", path = "/editView", requiredPermission = false, requiredLogin = false)
|
||||
public String editView() {
|
||||
return PREFIX + "/dictType_edit.html";
|
||||
}
|
||||
|
||||
// public ResponseData list(DictTypeRequest dictTypeRequest) {
|
||||
// return ResponseData.;
|
||||
// }
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package cn.stylefeng.guns.modular.dict;
|
||||
|
||||
import cn.stylefeng.roses.kernel.resource.api.annotation.ApiResource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
/**
|
||||
* 字典视图控制器
|
||||
*
|
||||
* @Author: huangyao
|
||||
* @Date: 2021/1/6 20:52
|
||||
**/
|
||||
@Controller
|
||||
@Slf4j
|
||||
@ApiResource(name = "字典管理相关的界面渲染", path = "dictType")
|
||||
public class DictViewController {
|
||||
|
||||
private String PREFIX = "/modular/system/dict";
|
||||
}
|
|
@ -1,8 +1,8 @@
|
|||
layui.use(['table', 'ax', 'func'], function () {
|
||||
layui.use(['table', 'func'], function () {
|
||||
var $ = layui.$;
|
||||
var table = layui.table;
|
||||
var $ax = layui.ax;
|
||||
var func = layui.func;
|
||||
var HttpRequest = layui.HttpRequest;
|
||||
|
||||
/**
|
||||
* 字典类型表管理
|
||||
|
@ -74,7 +74,7 @@ layui.use(['table', 'ax', 'func'], function () {
|
|||
func.open({
|
||||
height: 630,
|
||||
title: '添加字典类型',
|
||||
content: Feng.ctxPath + '/dictType/add',
|
||||
content: Feng.ctxPath + '/dictType/addView',
|
||||
tableId: DictType.tableId
|
||||
});
|
||||
};
|
||||
|
@ -88,7 +88,7 @@ layui.use(['table', 'ax', 'func'], function () {
|
|||
func.open({
|
||||
height: 630,
|
||||
title: '修改字典类型',
|
||||
content: Feng.ctxPath + '/dictType/edit?dictTypeId=' + data.dictTypeId,
|
||||
content: Feng.ctxPath + '/dictType/editView?dictTypeId=' + data.dictTypeId,
|
||||
tableId: DictType.tableId
|
||||
});
|
||||
};
|
||||
|
@ -106,14 +106,14 @@ layui.use(['table', 'ax', 'func'], function () {
|
|||
}
|
||||
|
||||
var operation = function () {
|
||||
var ajax = new $ax(Feng.ctxPath + "/dictType/delete", function (data) {
|
||||
Feng.success("删除成功!");
|
||||
table.reload(DictType.tableId);
|
||||
}, function (data) {
|
||||
Feng.error("删除失败!" + data.responseJSON.message + "!");
|
||||
});
|
||||
ajax.set("dictTypeId", data.dictTypeId);
|
||||
ajax.start();
|
||||
// var ajax = new $ax(Feng.ctxPath + "/dictType/delete", function (data) {
|
||||
// Feng.success("删除成功!");
|
||||
// table.reload(DictType.tableId);
|
||||
// }, function (data) {
|
||||
// Feng.error("删除失败!" + data.responseJSON.message + "!");
|
||||
// });
|
||||
// ajax.set("dictTypeId", data.dictTypeId);
|
||||
// ajax.start();
|
||||
};
|
||||
|
||||
Feng.confirm("是否删除?", operation);
|
||||
|
@ -122,7 +122,7 @@ layui.use(['table', 'ax', 'func'], function () {
|
|||
// 渲染表格
|
||||
var tableResult = table.render({
|
||||
elem: '#' + DictType.tableId,
|
||||
url: Feng.ctxPath + '/dictType/list',
|
||||
url: Feng.ctxPath + '/dictType/getDictTypePageList',
|
||||
page: true,
|
||||
height: "full-98",
|
||||
cellMinWidth: 100,
|
||||
|
|
|
@ -15,30 +15,25 @@ var DictTypeInfoDlg = {
|
|||
}
|
||||
};
|
||||
|
||||
layui.use(['form', 'ax', 'admin'], function () {
|
||||
layui.use(['form', 'admin', 'HttpRequest'], function () {
|
||||
var $ = layui.jquery;
|
||||
var $ax = layui.ax;
|
||||
var form = layui.form;
|
||||
var admin = layui.admin;
|
||||
var HttpRequest = layui.HttpRequest;
|
||||
|
||||
//表单提交事件
|
||||
form.on('submit(btnSubmit)', function (data) {
|
||||
var ajax = new $ax(Feng.ctxPath + "/dictType/addItem", function (data) {
|
||||
Feng.success("添加成功!");
|
||||
|
||||
//传给上个页面,刷新table用
|
||||
admin.putTempData('formOk', true);
|
||||
|
||||
//关掉对话框
|
||||
var request = new HttpRequest(Feng.ctxPath + "/dictType/addDictType", 'post', function (data) {
|
||||
admin.closeThisDialog();
|
||||
|
||||
Feng.success("添加成功!");
|
||||
admin.putTempData('formOk', true);
|
||||
}, function (data) {
|
||||
Feng.error("添加失败!" + data.responseJSON.message)
|
||||
admin.closeThisDialog();
|
||||
Feng.error("添加失败!" + data.message);
|
||||
});
|
||||
ajax.set(data.field);
|
||||
ajax.start();
|
||||
|
||||
return false;
|
||||
request.set(data.field);
|
||||
request.start(true);
|
||||
});
|
||||
|
||||
});
|
|
@ -30,9 +30,7 @@
|
|||
</div>
|
||||
<div class="layui-inline">
|
||||
<button id="btnSearch" class="layui-btn icon-btn"><i class="layui-icon"></i>搜索</button>
|
||||
@if(shiro.hasPermission("/dictType/addItem")){
|
||||
<button id="btnAdd" class="layui-btn icon-btn"><i class="layui-icon"></i>添加类型</button>
|
||||
@}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -44,12 +42,8 @@
|
|||
</div>
|
||||
|
||||
<script type="text/html" id="tableBar">
|
||||
@if(shiro.hasPermission("/dictType/editItem")){
|
||||
<a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="edit">修改</a>
|
||||
@}
|
||||
@if(shiro.hasPermission("/dictType/delete")){
|
||||
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="delete">删除</a>
|
||||
@}
|
||||
<a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="edit">修改</a>
|
||||
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="delete">删除</a>
|
||||
</script>
|
||||
|
||||
@}
|
|
@ -10,33 +10,33 @@
|
|||
<div class="layui-inline layui-col-md12">
|
||||
<label class="layui-form-label">名称<span style="color: red;">*</span></label>
|
||||
<div class="layui-input-block">
|
||||
<input id="name" name="name" placeholder="请输入字典类型名称,例如:状态标识" type="text" class="layui-input" lay-verify="required" required/>
|
||||
<input id="dictTypeName" name="dictTypeName" placeholder="请输入字典类型名称,例如:状态标识" type="text" class="layui-input" lay-verify="required" required/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline layui-col-md12">
|
||||
<label class="layui-form-label">类型编码<span style="color: red;">*</span></label>
|
||||
<div class="layui-input-block">
|
||||
<input id="code" name="code" placeholder="请输入字典类型编码,例如:STATUS" type="text" class="layui-input" lay-verify="required" required/>
|
||||
<input id="dictTypeCode" name="dictTypeCode" placeholder="请输入字典类型编码,例如:STATUS" type="text" class="layui-input" lay-verify="required" required/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline layui-col-md12">
|
||||
<label class="layui-form-label">系统字典<span style="color: red;">*</span></label>
|
||||
<div class="layui-input-block">
|
||||
<input type="radio" name="systemFlag" value="Y" title="是">
|
||||
<input type="radio" name="systemFlag" value="N" title="否" checked="">
|
||||
<input type="radio" name="dictTypeClass" value="1" title="业务类型">
|
||||
<input type="radio" name="dictTypeClass" value="2" title="系统类型" checked="">
|
||||
</div>
|
||||
<div class="layui-form-mid layui-word-aux">系统字典与代码中枚举关联,添加后不可修改</div>
|
||||
</div>
|
||||
<div class="layui-inline layui-col-md12">
|
||||
<label class="layui-form-label">排序</label>
|
||||
<div class="layui-input-block">
|
||||
<input id="sort" name="sort" placeholder="请输入字典排序" type="text" class="layui-input">
|
||||
<input id="dictTypeSort" name="dictTypeSort" placeholder="请输入字典排序" type="text" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline layui-col-md12">
|
||||
<label class="layui-form-label">字典描述</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea id="description" name="description" placeholder="请输入字典描述" class="layui-textarea"></textarea>
|
||||
<textarea id="dictTypeDesc" name="dictTypeDesc" placeholder="请输入字典描述" class="layui-textarea"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue