|
|
|
@ -14,6 +14,11 @@ function startRender() { |
|
|
|
|
let dirTree, metaListTable, fileUploadLayerWin, tempNode; |
|
|
|
|
|
|
|
|
|
let addMetadataLayerWin; |
|
|
|
|
/** |
|
|
|
|
* 打开关联数据表弹出层 |
|
|
|
|
* @param directory |
|
|
|
|
* @param callback |
|
|
|
|
*/ |
|
|
|
|
const openAddMetadataLayer = function (directory, callback) { |
|
|
|
|
if (directory.reviewStatus === ReviewStatus.PASS || directory.reviewStatus === ReviewStatus.SUBMITTED) { |
|
|
|
|
addDataConfirm(open); |
|
|
|
@ -21,6 +26,9 @@ function startRender() { |
|
|
|
|
open(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 弹出选择数据表窗口 |
|
|
|
|
*/ |
|
|
|
|
function open() { |
|
|
|
|
layer.open({ |
|
|
|
|
id: 'addMetadataLayer', |
|
|
|
@ -41,9 +49,11 @@ function startRender() { |
|
|
|
|
}, function (res) { |
|
|
|
|
if (res.flag) { |
|
|
|
|
layer.msg('保存成功'); |
|
|
|
|
layer.close(index); |
|
|
|
|
refreshDirectoryNode(tempNode, res.data); |
|
|
|
|
callback && callback(); |
|
|
|
|
refreshPermis().then(()=>{ |
|
|
|
|
layer.close(index); |
|
|
|
|
refreshDirectoryNode(tempNode, res.data); |
|
|
|
|
callback && callback(); |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
layer.msg('保存失败') |
|
|
|
|
} |
|
|
|
@ -182,9 +192,11 @@ function startRender() { |
|
|
|
|
function removeData() { |
|
|
|
|
Util.send(`/business/directory/delete/${obj.directoryId}`, {}, 'delete').then(res => { |
|
|
|
|
if (res.flag) { |
|
|
|
|
showOkMsg('删除成功') |
|
|
|
|
metaListTable.reloadTable(); |
|
|
|
|
//refreshDirectoryNode(tempNode, res.data);
|
|
|
|
|
showOkMsg('删除成功'); |
|
|
|
|
refreshPermis().then(()=>{ |
|
|
|
|
metaListTable.reloadTable(); |
|
|
|
|
//refreshDirectoryNode(tempNode, res.data);
|
|
|
|
|
}) |
|
|
|
|
} else { |
|
|
|
|
showErrorMsg(res.msg); |
|
|
|
|
} |
|
|
|
@ -195,11 +207,11 @@ function startRender() { |
|
|
|
|
|
|
|
|
|
upload(basicData, `${ctx}/sys/file/layer/dir?directoryId=${basicData.id}&secretLevel=${basicData.secretLevel}`, function (res) { |
|
|
|
|
if (res.success) { |
|
|
|
|
refreshDirectoryNode(tempNode, basicData); |
|
|
|
|
metaListTable.reloadTable(); |
|
|
|
|
/*if (res.data) { |
|
|
|
|
Util.get(`/business/directory/get/${res.data.entityId}`).then(res => refreshDirectoryNode(tempNode, res.data)) |
|
|
|
|
}*/ |
|
|
|
|
refreshPermis().then(() => { |
|
|
|
|
refreshDirectoryNode(tempNode, basicData); |
|
|
|
|
metaListTable.reloadTable(); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
@ -215,6 +227,40 @@ function startRender() { |
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
function upload(basicData, url, callback) { |
|
|
|
|
if (basicData.id === 'ROOT' && !USER_ROLES.includes('ROLE_SA')){ |
|
|
|
|
layer.msg('没有权限'); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (basicData.reviewStatus == ReviewStatus.PASS || basicData.reviewStatus == ReviewStatus.SUBMITTED) { |
|
|
|
|
addDataConfirm(open); |
|
|
|
|
} else { |
|
|
|
|
open(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function open() { |
|
|
|
|
let height = $(document).height(); |
|
|
|
|
height = height < 1000 ? height : height * 0.8; |
|
|
|
|
layer.open({ |
|
|
|
|
id: 'fileUploadLayer', |
|
|
|
|
title: '上传文件', |
|
|
|
|
type: 2, |
|
|
|
|
area: ['900px', height + 'px'], |
|
|
|
|
maxmin: true, |
|
|
|
|
btn: false, |
|
|
|
|
content: url, |
|
|
|
|
success: function (layero, index) { |
|
|
|
|
fileUploadLayerWin = window[layero.find('iframe')[0]['name']]; |
|
|
|
|
fileUploadLayerWin.layerOkCallback = callback; |
|
|
|
|
fileUploadLayerWin.layerCancelCallback = function () { |
|
|
|
|
layer.close(index); |
|
|
|
|
metaListTable.reloadTable() |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 查看按钮监听
|
|
|
|
|
metaListTable.addTableRowEvent('details', function (obj) { |
|
|
|
|
if (obj.resourceType === 'file') { |
|
|
|
@ -281,39 +327,6 @@ function startRender() { |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function upload(basicData, url, callback) { |
|
|
|
|
if (basicData.id === 'ROOT' && !USER_ROLES.includes('ROLE_SA')){ |
|
|
|
|
layer.msg('没有权限'); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (basicData.reviewStatus == ReviewStatus.PASS || basicData.reviewStatus == ReviewStatus.SUBMITTED) { |
|
|
|
|
addDataConfirm(open); |
|
|
|
|
} else { |
|
|
|
|
open(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function open() { |
|
|
|
|
let height = $(document).height(); |
|
|
|
|
height = height < 1000 ? height : height * 0.8; |
|
|
|
|
layer.open({ |
|
|
|
|
id: 'fileUploadLayer', |
|
|
|
|
title: '上传文件', |
|
|
|
|
type: 2, |
|
|
|
|
area: ['900px', height + 'px'], |
|
|
|
|
maxmin: true, |
|
|
|
|
btn: false, |
|
|
|
|
content: url, |
|
|
|
|
success: function (layero, index) { |
|
|
|
|
fileUploadLayerWin = window[layero.find('iframe')[0]['name']]; |
|
|
|
|
fileUploadLayerWin.layerOkCallback = callback; |
|
|
|
|
fileUploadLayerWin.layerCancelCallback = function () { |
|
|
|
|
layer.close(index); |
|
|
|
|
metaListTable.reloadTable() |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 加载并渲染目录树
|
|
|
|
|
let currentNode, currentParentNode, tempOwner, tempOwnerType; |
|
|
|
|