Bladeren bron

多个上传文件预览功能

master
liangkun 3 jaren geleden
bovenliggende
commit
aec5800a9a
3 gewijzigde bestanden met toevoegingen van 23 en 5 verwijderingen
  1. +21
    -3
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_SystemModule/Views/Annexes/DownForm.js
  2. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/plugin/uploader/lr-uploader.js
  3. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Utility/ListContentIndex.js

+ 21
- 3
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_SystemModule/Views/Annexes/DownForm.js Bestand weergeven

@@ -10,13 +10,16 @@ var bootstrap = function ($, learun) {
var $item = $('<div class="lr-form-file-queue-item" id="lr_filequeue_' + item.F_Id + '" ></div>'); var $item = $('<div class="lr-form-file-queue-item" id="lr_filequeue_' + item.F_Id + '" ></div>');
$item.append('<div class="lr-file-image"><img src="' + top.$.rootUrl + '/Content/images/filetype/' + item.F_FileType + '.png"></div>'); $item.append('<div class="lr-file-image"><img src="' + top.$.rootUrl + '/Content/images/filetype/' + item.F_FileType + '.png"></div>');
$item.append('<span class="lr-file-name">' + item.F_FileName + '(' + learun.countFileSize(item.F_FileSize) + ')</span>'); $item.append('<span class="lr-file-name">' + item.F_FileName + '(' + learun.countFileSize(item.F_FileSize) + ')</span>');
$item.append('<div class="lr-tool-bar"><i class="fa fa-cloud-download" title="下载" data-value="' + item.F_Id + '" ></i></div>');

$item.append('<div class="lr-tool-bar"><i class="fa fa-cloud-download" title="下载" data-value="' + item.F_Id + '" ></i><i class="fa fa-eye" title="预览" data-value="' + item.F_Id + '" ></i></div>');
$item.find('.lr-tool-bar .fa-cloud-download').on('click', function () { $item.find('.lr-tool-bar .fa-cloud-download').on('click', function () {
var fileId = $(this).attr('data-value'); var fileId = $(this).attr('data-value');
DownFile(fileId); DownFile(fileId);
}); });

//预览
$item.find('.lr-tool-bar .fa-eye').on('click', function () {
var fileId = $(this).attr('data-value');
ViewFile(fileId);
});
$('#lr_form_file_queue_list').append($item); $('#lr_form_file_queue_list').append($item);
} }
}); });
@@ -28,6 +31,21 @@ var bootstrap = function ($, learun) {
learun.postFormSilence(top.$.rootUrl + '/EducationalAdministration/Sys_ReceiveFile/Read', { keyValue: RFileId }, function () {}); learun.postFormSilence(top.$.rootUrl + '/EducationalAdministration/Sys_ReceiveFile/Read', { keyValue: RFileId }, function () {});
} }
} }
//预览
var ViewFile = function (fileId) {
learun.layerForm({
id: 'PreviewForm',
title: '文件预览',
url: top.$.rootUrl + '/LR_SystemModule/Annexes/PreviewFile?fileId=' + fileId,
width: 1080,
height: 850,
btn: null
});
//公文查阅:已读
if (RFileId !== null && RFileId !== "") {
learun.postFormSilence(top.$.rootUrl + '/EducationalAdministration/Sys_ReceiveFile/Read', { keyValue: RFileId }, function () {});
}
}




$('#lr_form_file_queue').lrscroll(); $('#lr_form_file_queue').lrscroll();


+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/plugin/uploader/lr-uploader.js Bestand weergeven

@@ -19,7 +19,7 @@


var $btnGroup = $('<div class="lrUploader-btn-group"></div>'); var $btnGroup = $('<div class="lrUploader-btn-group"></div>');
var $uploadBtn = $('<a id="lrUploader_uploadBtn_' + dfop.id + '" class="btn btn-success lrUploader-input-btn">上传</a>'); var $uploadBtn = $('<a id="lrUploader_uploadBtn_' + dfop.id + '" class="btn btn-success lrUploader-input-btn">上传</a>');
var $downBtn = $('<a id="lrUploader_downBtn_' + dfop.id + '" class="btn btn-danger lrUploader-input-btn">下载</a>');
var $downBtn = $('<a id="lrUploader_downBtn_' + dfop.id + '" class="btn btn-danger lrUploader-input-btn">下载/预览</a>');
var $viewBtn = $('<a id="lrUploader_viewBtn_' + dfop.id + '" class="btn btn-primary lrUploader-input-btn">预览</a>'); var $viewBtn = $('<a id="lrUploader_viewBtn_' + dfop.id + '" class="btn btn-primary lrUploader-input-btn">预览</a>');


$self.append($wrap); $self.append($wrap);


+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Utility/ListContentIndex.js Bestand weergeven

@@ -11,7 +11,7 @@ var bootstrap = function ($, learun) {


var page = { var page = {
init: function () { init: function () {
$('#F_NewsImage').lrUploader({ isUpload:false});
$('#F_NewsImage').lrUploader({ isUpload: false, isView:false});
$('.warpper').lrscroll(); $('.warpper').lrscroll();
var item = top['dtlist' + id]; var item = top['dtlist' + id];
if(false){// (!!item) { if(false){// (!!item) {


Laden…
Annuleren
Opslaan