若依开源1.1.1发布
This commit is contained in:
17
src/main/resources/static/ruoyi/system/dict/data/add.js
Normal file
17
src/main/resources/static/ruoyi/system/dict/data/add.js
Normal file
@ -0,0 +1,17 @@
|
||||
$("#form-dict-add").validate({
|
||||
rules:{
|
||||
dictLabel:{
|
||||
required:true,
|
||||
},
|
||||
dictValue:{
|
||||
required:true,
|
||||
},
|
||||
},
|
||||
submitHandler:function(form){
|
||||
add();
|
||||
}
|
||||
});
|
||||
|
||||
function add() {
|
||||
_ajax_save("/system/dict/data/save", $("#form-dict-add").serialize());
|
||||
}
|
91
src/main/resources/static/ruoyi/system/dict/data/data.js
Normal file
91
src/main/resources/static/ruoyi/system/dict/data/data.js
Normal file
@ -0,0 +1,91 @@
|
||||
var prefix = "/system/dict/data"
|
||||
|
||||
$(function() {
|
||||
var columns = [{
|
||||
checkbox: true
|
||||
},
|
||||
{
|
||||
field: 'dictCode',
|
||||
title: '字典编码'
|
||||
},
|
||||
{
|
||||
field: 'dictLabel',
|
||||
title: '字典标签'
|
||||
},
|
||||
{
|
||||
field: 'dictValue',
|
||||
title: '字典键值'
|
||||
},
|
||||
{
|
||||
field: 'dictSort',
|
||||
title: '字典排序'
|
||||
},
|
||||
{
|
||||
field: 'status',
|
||||
title: '操作状态',
|
||||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
if (value == 0) {
|
||||
return '<span class="label label-success">正常</span>';
|
||||
} else if (value == 1) {
|
||||
return '<span class="label label-danger">禁用</span>';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'remark',
|
||||
title: '备注'
|
||||
},
|
||||
{
|
||||
field: 'createTime',
|
||||
title: '创建时间'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
var actions = [];
|
||||
actions.push('<a class="btn btn-primary btn-sm ' + editFlag + '" href="#" title="编辑字典" mce_href="#" onclick="edit(\'' + row.dictCode + '\')"><i class="fa fa-edit"></i></a> ');
|
||||
actions.push('<a class="btn btn-warning btn-sm ' + removeFlag + '" href="#" title="删除" mce_href="#" onclick="remove(\'' + row.dictCode + '\')"><i class="fa fa-remove"></i></a>');
|
||||
return actions.join('');
|
||||
}
|
||||
}];
|
||||
var url = prefix + "/list?dictType=" + $("#dictType").val();
|
||||
$.initTable(columns, url);
|
||||
});
|
||||
|
||||
/*字典管理-新增*/
|
||||
function add() {
|
||||
var url = prefix + '/add/' + $("#dictType").val();
|
||||
layer_showAuto("新增字典类型", url);
|
||||
}
|
||||
|
||||
/*角色管理-修改*/
|
||||
function edit(dictCode) {
|
||||
var url = prefix + '/edit/' + dictCode;
|
||||
layer_showAuto("修改字典类型", url);
|
||||
}
|
||||
|
||||
/*字典列表-详细*/
|
||||
function detail(id) {
|
||||
createMenuItem(prefix + '/detail', "字典数据");
|
||||
}
|
||||
|
||||
//单条删除
|
||||
function remove(id) {
|
||||
$.modalConfirm("确定要删除选中字典数据吗?", function(r) {
|
||||
_ajax(prefix + "/remove/" + id, "", "post", r);
|
||||
})
|
||||
}
|
||||
|
||||
// 批量删除
|
||||
function batchRemove() {
|
||||
var rows = $.getSelections("dictCode");
|
||||
if (rows.length == 0) {
|
||||
$.modalMsg("请选择要删除的数据", "warning");
|
||||
return;
|
||||
}
|
||||
$.modalConfirm("确认要删除选中的" + rows.length + "条数据吗?", function(r) {
|
||||
_ajax(prefix + '/batchRemove', { "ids": rows }, "post", r);
|
||||
});
|
||||
}
|
17
src/main/resources/static/ruoyi/system/dict/data/edit.js
Normal file
17
src/main/resources/static/ruoyi/system/dict/data/edit.js
Normal file
@ -0,0 +1,17 @@
|
||||
$("#form-dict-edit").validate({
|
||||
rules:{
|
||||
dictLabel:{
|
||||
required:true,
|
||||
},
|
||||
dictValue:{
|
||||
required:true,
|
||||
},
|
||||
},
|
||||
submitHandler:function(form){
|
||||
update();
|
||||
}
|
||||
});
|
||||
|
||||
function update() {
|
||||
_ajax_save("/system/dict/data/save", $("#form-dict-edit").serialize());
|
||||
}
|
37
src/main/resources/static/ruoyi/system/dict/type/add.js
Normal file
37
src/main/resources/static/ruoyi/system/dict/type/add.js
Normal file
@ -0,0 +1,37 @@
|
||||
$("#form-dict-add").validate({
|
||||
rules:{
|
||||
dictName:{
|
||||
required:true,
|
||||
},
|
||||
dictType:{
|
||||
required:true,
|
||||
minlength: 5,
|
||||
remote: {
|
||||
url: "/system/dict/checkDictTypeUnique",
|
||||
type: "post",
|
||||
dataType: "text",
|
||||
data: {
|
||||
name : function() {
|
||||
return $.trim($("#dictType").val());
|
||||
}
|
||||
},
|
||||
dataFilter: function(data, type) {
|
||||
if (data == "0") return true;
|
||||
else return false;
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
messages: {
|
||||
"dictType": {
|
||||
remote: "该字典类型已经存在"
|
||||
}
|
||||
},
|
||||
submitHandler:function(form){
|
||||
add();
|
||||
}
|
||||
});
|
||||
|
||||
function add() {
|
||||
_ajax_save("/system/dict/save", $("#form-dict-add").serialize());
|
||||
}
|
40
src/main/resources/static/ruoyi/system/dict/type/edit.js
Normal file
40
src/main/resources/static/ruoyi/system/dict/type/edit.js
Normal file
@ -0,0 +1,40 @@
|
||||
$("#form-dict-edit").validate({
|
||||
rules:{
|
||||
dictName:{
|
||||
required:true,
|
||||
},
|
||||
dictType:{
|
||||
required:true,
|
||||
minlength: 5,
|
||||
remote: {
|
||||
url: "/system/dict/checkDictTypeUnique",
|
||||
type: "post",
|
||||
dataType: "text",
|
||||
data: {
|
||||
dictId : function() {
|
||||
return $.trim($("#dictId").val());
|
||||
},
|
||||
dictType : function() {
|
||||
return $.trim($("#dictType").val());
|
||||
}
|
||||
},
|
||||
dataFilter: function(data, type) {
|
||||
if (data == "0") return true;
|
||||
else return false;
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
messages: {
|
||||
"dictType": {
|
||||
remote: "该字典类型已经存在"
|
||||
}
|
||||
},
|
||||
submitHandler:function(form){
|
||||
update();
|
||||
}
|
||||
});
|
||||
|
||||
function update() {
|
||||
_ajax_save("/system/dict/save", $("#form-dict-edit").serialize());
|
||||
}
|
89
src/main/resources/static/ruoyi/system/dict/type/type.js
Normal file
89
src/main/resources/static/ruoyi/system/dict/type/type.js
Normal file
@ -0,0 +1,89 @@
|
||||
var prefix = "/system/dict"
|
||||
|
||||
$(function() {
|
||||
var columns = [{
|
||||
checkbox: true
|
||||
},
|
||||
{
|
||||
field: 'dictId',
|
||||
title: '字典主键'
|
||||
},
|
||||
{
|
||||
field: 'dictName',
|
||||
title: '字典名称'
|
||||
},
|
||||
{
|
||||
field: 'dictType',
|
||||
title: '字典类型'
|
||||
},
|
||||
{
|
||||
field: 'status',
|
||||
title: '操作状态',
|
||||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
if (value == 0) {
|
||||
return '<span class="label label-success">正常</span>';
|
||||
} else if (value == 1) {
|
||||
return '<span class="label label-danger">禁用</span>';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'remark',
|
||||
title: '备注'
|
||||
},
|
||||
{
|
||||
field: 'createTime',
|
||||
title: '创建时间'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
var actions = [];
|
||||
actions.push('<a class="btn btn-primary btn-sm ' + editFlag + '" href="#" title="编辑" mce_href="#" onclick="edit(\'' + row.dictId + '\')"><i class="fa fa-edit"></i></a> ');
|
||||
actions.push('<a class="btn btn-info btn-sm ' + listFlag + '" href="#" title="详细" onclick="detail(\'' + row.dictId + '\')"><i class="fa fa-list-ul"></i></a> ');
|
||||
actions.push('<a class="btn btn-warning btn-sm ' + removeFlag + '" href="#" title="删除" mce_href="#" onclick="remove(\'' + row.dictId + '\')"><i class="fa fa-remove"></i></a>');
|
||||
return actions.join('');
|
||||
}
|
||||
}];
|
||||
var url = prefix + "/list";
|
||||
$.initTable(columns, url);
|
||||
});
|
||||
|
||||
/*字典管理-新增*/
|
||||
function add() {
|
||||
var url = prefix + '/add';
|
||||
layer_showAuto("新增字典类型", url);
|
||||
}
|
||||
|
||||
/*角色管理-修改*/
|
||||
function edit(dictId) {
|
||||
var url = prefix + '/edit/' + dictId;
|
||||
layer_showAuto("修改字典类型", url);
|
||||
}
|
||||
|
||||
/*字典列表-详细*/
|
||||
function detail(dictId) {
|
||||
var url = prefix + '/detail/' + dictId;
|
||||
createMenuItem(url, "字典数据");
|
||||
}
|
||||
|
||||
//单条删除
|
||||
function remove(id) {
|
||||
$.modalConfirm("确定要删除选中字典吗?", function(r) {
|
||||
_ajax(prefix + "/remove/" + id, "", "post", r);
|
||||
})
|
||||
}
|
||||
|
||||
// 批量删除
|
||||
function batchRemove() {
|
||||
var rows = $.getSelections("dictId");
|
||||
if (rows.length == 0) {
|
||||
$.modalMsg("请选择要删除的数据", "warning");
|
||||
return;
|
||||
}
|
||||
$.modalConfirm("确认要删除选中的" + rows.length + "条数据吗?", function(r) {
|
||||
_ajax(prefix + '/batchRemove', { "ids": rows }, "post", r);
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user