|
|
|
@ -10,11 +10,12 @@ |
|
|
|
|
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; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 加载数据资源列表 |
|
|
|
@ -32,12 +33,14 @@ function startRender() { |
|
|
|
|
permis.viewPermis = false; |
|
|
|
|
dirId = DIR_ROOT_ID |
|
|
|
|
} |
|
|
|
|
let reviewStatus = 'PASS'; |
|
|
|
|
metaListTable = listPage.init({ |
|
|
|
|
table: { |
|
|
|
|
permis: permis, |
|
|
|
|
id: 'dirMetadataTable', |
|
|
|
|
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'); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
@ -110,6 +119,50 @@ function startRender() { |
|
|
|
|
}).catch(() => showErrorMsg()); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
//驳回
|
|
|
|
|
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) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 加载并渲染目录树
|
|
|
|
|