若依3.2

This commit is contained in:
RuoYi
2019-01-16 14:56:27 +08:00
parent 04f2607398
commit 57fa243747
36 changed files with 1750 additions and 6685 deletions

View File

@@ -47,8 +47,38 @@
$('.summernote').summernote({
height : '220px',
lang : 'zh-CN'
lang : 'zh-CN',
callbacks: {
onImageUpload: function (files) {
sendFile(files[0], this);
}
}
});
// 上传文件
function sendFile(file, obj) {
var data = new FormData();
data.append("file", file);
$.ajax({
type: "POST",
url: ctx + "common/upload",
data: data,
cache: false,
contentType: false,
processData: false,
dataType: 'json',
success: function(result) {
if (result.code == web_status.SUCCESS) {
$(obj).summernote('editor.insertImage', result.url, result.fileName);
} else {
$.modal.alertError(result.msg);
}
},
error: function(error) {
$.modal.alertWarning("图片上传失败。");
}
});
}
$("#form-notice-add").validate({
rules:{

View File

@@ -48,13 +48,43 @@
$(function() {
$('.summernote').summernote({
height : '220px',
lang : 'zh-CN'
height : '220px',
lang : 'zh-CN',
callbacks: {
onImageUpload: function (files) {
sendFile(files[0], this);
}
}
});
var content = $("#noticeContent").val();
$('#editor').summernote('code', content);
});
// 上传文件
function sendFile(file, obj) {
var data = new FormData();
data.append("file", file);
$.ajax({
type: "POST",
url: ctx + "common/upload",
data: data,
cache: false,
contentType: false,
processData: false,
dataType: 'json',
success: function(result) {
if (result.code == web_status.SUCCESS) {
$(obj).summernote('editor.insertImage', result.url, result.fileName);
} else {
$.modal.alertError(result.msg);
}
},
error: function(error) {
$.modal.alertWarning("图片上传失败。");
}
});
}
$("#form-notice-edit").validate({
rules:{
noticeTitle:{

View File

@@ -100,12 +100,12 @@
sortable: true
},
{
field: 'status',
title: '状态',
align: 'center',
formatter: function(value, row, index) {
return $.table.selectDictLabel(datas, value);
}
visible: editFlag == 'hidden' ? false : true,
title: '角色状态',
align: 'center',
formatter: function (value, row, index) {
return statusTools(row);
}
},
{
field: 'createTime',
@@ -127,11 +127,34 @@
$.table.init(options);
});
/*角色管理-分配数据权限*/
/* 角色管理-分配数据权限 */
function rule(roleId) {
var url = prefix + '/rule/' + roleId;
$.modal.open("分配数据权限", url);
}
/* 角色状态显示 */
function statusTools(row) {
if (row.status == 1) {
return '<i class=\"fa fa-toggle-off text-info fa-2x\" onclick="enable(\'' + row.roleId + '\')"></i> ';
} else {
return '<i class=\"fa fa-toggle-on text-info fa-2x\" onclick="disable(\'' + row.roleId + '\')"></i> ';
}
}
/* 角色管理-停用 */
function disable(roleId) {
$.modal.confirm("确认要停用角色吗?", function() {
$.operate.post(prefix + "/changeStatus", { "roleId": roleId, "status": 1 });
})
}
/* 角色管理启用 */
function enable(roleId) {
$.modal.confirm("确认要启用角色吗?", function() {
$.operate.post(prefix + "/changeStatus", { "roleId": roleId, "status": 0 });
})
}
</script>
</body>
</html>

View File

@@ -151,12 +151,12 @@
title: '手机'
},
{
field: 'status',
title: '状态',
align: 'center',
formatter: function(value, row, index) {
return $.table.selectDictLabel(datas, value);
}
visible: editFlag == 'hidden' ? false : true,
title: '用户状态',
align: 'center',
formatter: function (value, row, index) {
return statusTools(row);
}
},
{
field: 'createTime',
@@ -211,17 +211,40 @@
queryDeptTree();
});
/*用户管理-部门*/
/* 用户管理-部门 */
function dept() {
var url = ctx + "system/dept";
createMenuItem(url, "部门管理");
}
/*用户管理-重置密码*/
/* 用户管理-重置密码 */
function resetPwd(userId) {
var url = prefix + '/resetPwd/' + userId;
$.modal.open("重置密码", url, '800', '300');
}
/* 用户状态显示 */
function statusTools(row) {
if (row.status == 1) {
return '<i class=\"fa fa-toggle-off text-info fa-2x\" onclick="enable(\'' + row.userId + '\')"></i> ';
} else {
return '<i class=\"fa fa-toggle-on text-info fa-2x\" onclick="disable(\'' + row.userId + '\')"></i> ';
}
}
/* 用户管理-停用 */
function disable(userId) {
$.modal.confirm("确认要停用用户吗?", function() {
$.operate.post(prefix + "/changeStatus", { "userId": userId, "status": 1 });
})
}
/* 用户管理启用 */
function enable(userId) {
$.modal.confirm("确认要启用用户吗?", function() {
$.operate.post(prefix + "/changeStatus", { "userId": userId, "status": 0 });
})
}
</script>
</body>
<form id="importForm" enctype="multipart/form-data" class="mt20 mb10" style="display: none;">