diff --git a/shandan-control/src/main/resources/static/js/directory/reviewDirectory.js b/shandan-control/src/main/resources/static/js/directory/reviewDirectory.js index d855bf2..4879659 100644 --- a/shandan-control/src/main/resources/static/js/directory/reviewDirectory.js +++ b/shandan-control/src/main/resources/static/js/directory/reviewDirectory.js @@ -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) + }) + } // 加载并渲染目录树 diff --git a/shandan-control/src/main/resources/view/review/directoryReview.html b/shandan-control/src/main/resources/view/review/directoryReview.html index 01739f6..00f3d94 100644 --- a/shandan-control/src/main/resources/view/review/directoryReview.html +++ b/shandan-control/src/main/resources/view/review/directoryReview.html @@ -64,15 +64,26 @@
当前位置: