目录操作增加对当前用户密级的判断,且禁止操作超过自身密级的目录及数据

master
Guo XIn 1 year ago
parent 9692801e52
commit 029daa7cfd
  1. 9
      shandan-system/src/main/resources/static/js/business/directory/dirCommon.js

@ -142,7 +142,9 @@ function openDirectoryEditLayer(data, callback, view) {
} }
layui.dict.setData('dict-secret-level', data) layui.dict.setData('dict-secret-level', data)
$('div.dict-component').css({'margin-top': '5px', 'width': '380px', 'margin-left': '4px'}) $('div.dict-component').css({'margin-top': '5px', 'width': '380px', 'margin-left': '4px'})
if(view){
layui.dict.setReadonly();
}
// 目录成员管理事件 // 目录成员管理事件
$('#memberManageBtn').on('click', () => { $('#memberManageBtn').on('click', () => {
let formVal = form.val('directoryEditForm'); let formVal = form.val('directoryEditForm');
@ -164,6 +166,7 @@ function openDirectoryEditLayer(data, callback, view) {
applyChildCheckbox(isEdit); applyChildCheckbox(isEdit);
}, },
yes: function (index) { yes: function (index) {
if(view){return;}
saveDirectory(index, callback); saveDirectory(index, callback);
} }
}) })
@ -171,6 +174,10 @@ function openDirectoryEditLayer(data, callback, view) {
function saveDirectory(index, callback) { function saveDirectory(index, callback) {
form.on('submit(directoryEditForm)', function ({elem, field}) { form.on('submit(directoryEditForm)', function ({elem, field}) {
if(field.secretLevel > user.secretLevel){
layer.alert('禁止上传超过自身涉密等级的文件,您的涉密等级为【'+ DICT.getText('secret_level', user.secretLevel) +'】')
return;
}
// 转换数据类型 // 转换数据类型
field.basicDir = field.basicDir === '1'; field.basicDir = field.basicDir === '1';
// 如果是基础数据目录,则自动为提交状态 // 如果是基础数据目录,则自动为提交状态