目录整编增加批量删除功能

master
xiong_cl 8 months ago
parent dbd03a4fb0
commit 82f1832891
  1. 35
      shandan-bianmu/src/main/resources/static/js/business/directory/directory.js
  2. 4
      shandan-bianmu/src/main/resources/view/business/directory/directory.html

@ -201,6 +201,41 @@ function startRender() {
}).catch(() => showErrorMsg()); }).catch(() => showErrorMsg());
} }
}) })
/**
* 目录整编增加批量删除功能
* @param ids
* add 2024/04/11 xiongcl
*/
metaListTable.addTableRowEvent('batchMoveLink', function (obj) {
var table = layui.table, checkStatus = table.checkStatus('dirMetadataTable'),
datas = checkStatus.data || [];
if(datas.length<=0){
showErrorMsg("请至少选择一条数据!");
return false;
}
if (basicData.reviewStatus === ReviewStatus.PASS) {
addDataConfirm(removeData)
} else {
layer.confirm('是否确定移除该数据?', {}, function (index) {
layer.close(index);
removeData();
})
}
function removeData() {
const ids = datas.map(data => data.directoryId);
Util.send(`/business/directory/batch/delete/${ids.join(',')}`, {}, 'delete').then(res => {
if (res.flag) {
showOkMsg('删除成功');
refreshPermis().then(() => {
metaListTable.reloadTable();
})
} else {
showErrorMsg(res.msg);
}
}).catch(() => showErrorMsg());
}
})
metaListTable.addTableRowEvent('addFile', function () { metaListTable.addTableRowEvent('addFile', function () {
upload(basicData, `${ctx}/sys/file/layer/dir?directoryId=${basicData.id}&secretLevel=${basicData.secretLevel}`, function (res) { upload(basicData, `${ctx}/sys/file/layer/dir?directoryId=${basicData.id}&secretLevel=${basicData.secretLevel}`, function (res) {

@ -79,6 +79,7 @@
{{# {{#
if(d.permis){ if(d.permis){
var disabled = !d.permis.uploadPermis, mvDisabled=!d.permis.movePermis, title="没有权限"; var disabled = !d.permis.uploadPermis, mvDisabled=!d.permis.movePermis, title="没有权限";
var brmDisabled = !d.permis.removePermis, viewDisabled=!d.permis.viewPermis, title="没有权限";
}} }}
<!--<button class="layui-btn layui-btn-sm {{disabled ? 'layui-disabled' : ''}}" <!--<button class="layui-btn layui-btn-sm {{disabled ? 'layui-disabled' : ''}}"
title="{{disabled ? title : ''}}" title="{{disabled ? title : ''}}"
@ -96,6 +97,9 @@
<button class="layui-btn layui-btn-sm {{mvDisabled ? 'layui-disabled' : ''}}" <button class="layui-btn layui-btn-sm {{mvDisabled ? 'layui-disabled' : ''}}"
title="{{mvDisabled ? title : ''}}" title="{{mvDisabled ? title : ''}}"
lay-event="moveLink{{mvDisabled ? 'disabled' : ''}}">移动</button> lay-event="moveLink{{mvDisabled ? 'disabled' : ''}}">移动</button>
<button class="layui-btn layui-btn-sm {{brmDisabled ? 'layui-disabled' : ''}}"
title="{{brmDisabled ? title : ''}}"
lay-event="batchMoveLink{{brmDisabled ? 'disabled' : ''}}">移除</button>
{{# {{#
} }
}} }}