在数据管控系统中目录审核页面添加文件批量驳回功能

master
xiong_cl 8 months ago
parent 7b2742fc95
commit e30087346a
  1. 57
      shandan-control/src/main/resources/static/js/directory/reviewDirectory.js
  2. 15
      shandan-control/src/main/resources/view/review/directoryReview.html

@ -11,10 +11,11 @@
const dirCache = new Map();
function startRender() {
layui.use(['ReviewComponent'], function () {
layui.use(['ReviewComponent','form'], function () {
const ReviewComponent = layui.ReviewComponent;
// 目录树
let dirTree, metaListTable, tempNode;
let reviewForm = layui.form;
/**
* 加载数据资源列表
*/
@ -31,13 +32,15 @@ function startRender() {
permis.viewPermis = false;
dirId = DIR_ROOT_ID
}
let reviewStatus = 'PASS';
metaListTable = listPage.init({
table: {
permis: permis,
id: 'dirMetadataTable',
//reviewStatusC: directory.basicData.reviewStatus,
toolbar: '#tableToolBar',
searchFieldNames: 'metadataName',
searchFieldNames: 'resourceName',
where: {reviewStatus: reviewStatus},
url: `${ctx}/business/metadata/list/directory?directoryId=${dirId}&allChild=true`,
height: 'full-110',
method: 'get',
@ -56,6 +59,7 @@ function startRender() {
};
},
cols: [[
{type: 'checkbox', fixed: 'left'},
{field: 'id', title: 'ID', hide: true},
{field: 'resourceName', title: '数据名称', width: 300},
{field: 'directoryPath', title: '所属目录'},
@ -76,6 +80,11 @@ function startRender() {
align: 'center'
}
]],
done: function (res) {
console.log(reviewStatus)
reviewForm.val('tableToolForm', {reviewStatus: reviewStatus})
reviewForm.render('radio', 'tableToolForm');
}
},
});
@ -87,6 +96,50 @@ function startRender() {
openMaxLayerWithURL(`${ctx}/business/metadata/details/${obj.id}`)
}
})
//驳回
metaListTable.addTableRowEvent('batchReview', function (obj) {
var table = layui.table, checkStatus = table.checkStatus('dirMetadataTable'),
datas = checkStatus.data || [];
console.log(datas);
if(datas.length<=0){
showErrorMsg("请至少选择一条数据!");
return false;
}
layer.confirm('是否确定驳回该数据?', {}, function (index) {
layer.close(index);
reviewData();
})
function reviewData() {
const ids = datas.map(data => data.directoryId);
let param = {
ids: ids.join(','),
status: ReviewStatus.REJECTED,
opinion: '',
sendNotice: true,
};
$.post(`${ctx}/business/review/directory/file/change`, param, function (res) {
if (res.flag) {
showOkMsg('驳回成功');
refreshPermis().then(() => {
metaListTable.reloadTable();
})
} else {
layer.msg('驳回失败' + res.msg);
}
});
}
})
reviewForm.on('radio(statusRadio)', function (data) {
reviewStatus = data.value;
let options = {
table: {
where: {reviewStatus}
}
}
metaListTable.reloadTable(options)
})
}
// 加载并渲染目录树

@ -64,15 +64,26 @@
<div class="current-position">当前位置:<label id="currentPosition"></label></div>
<table class="layui-hide" id="dirMetadataTable" lay-filter="dirMetadataTable"></table>
<script type="text/html" id="tableToolBar">
<div class="layui-btn-container">
<div class="layui-btn-container layui-form" lay-filter="tableToolForm">
<div class="layui-layout-left" style="top:10px; left: 20px">
<input type="text" id="searchKeyInput" name="searchKeyInput"
autocomplete="off"
placeholder="请输入关键字查询" class="layui-input layui-btn-sm">
<button class="layui-btn layui-btn-sm" lay-event="query">查询</button>
<div class="layui-inline">
<label class="layui-form-label">审核状态</label>
<div class="layui-input-inline">
<input type="radio" name="reviewStatus" value="PASS" title="已提交"
lay-filter="statusRadio">
<input type="radio" name="reviewStatus" value="REJECTED" title="已驳回"
lay-filter="statusRadio">
</div>
</div>
</div>
<div class="layui-layout-right" style="padding-right: 20px; top:10px">
<button class="layui-btn layui-btn-sm" id="reviewBtn"
title="驳回"
lay-event="batchReview">驳回</button>
</div>
</div>
</script>