diff --git a/lib/zin/wg/deliverable/js/v1.js b/lib/zin/wg/deliverable/js/v1.js index 565f2abcc5..2eb78d9b6f 100644 --- a/lib/zin/wg/deliverable/js/v1.js +++ b/lib/zin/wg/deliverable/js/v1.js @@ -5,18 +5,18 @@ window.getDeliverableFileActions = function(file, deliverable) { let actions = []; - if(canDownload && typeof file.id != 'undefined') actions[0] = {icon: 'download', key: 'download', url: $.createLink('file', 'download', 'id=' + file.id), target: '_blank'}; - - if(!onlyShow) - { - actions[1] = {icon: 'edit', key: 'rename'}; - if(!isTemplate) actions[2] = {icon: 'trash', key: 'delete'}; - } - /* 可以预览的文件。 */ if(['txt', 'jpg', 'jpeg', 'gif', 'png', 'bmp', 'mp4'].includes(file.extension) && canDownload && typeof file.id != 'undefined') { - actions[3] = {icon: 'eye', key: 'view', url: $.createLink('file', 'download', `fileID=${file.id}&mouse=left`), 'data-toggle' : 'modal', 'data-size' : 'lg'}; + actions[0] = {icon: 'eye', key: 'view', url: $.createLink('file', 'download', `fileID=${file.id}&mouse=left`), 'data-toggle' : 'modal', 'data-size' : 'lg'}; + } + + if(canDownload && typeof file.id != 'undefined') actions[1] = {icon: 'download', key: 'download', url: $.createLink('file', 'download', 'id=' + file.id), target: '_blank'}; + + if(!onlyShow) + { + actions[2] = {icon: 'edit', key: 'rename'}; + if(!isTemplate) actions[3] = {icon: 'trash', key: 'delete'}; } return actions;