修改WBS基础库内容
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Look.aspx.cs" Inherits="FineUIPro.Web.AttachFile.Look" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="TabStrip1" runat="server" />
|
||||
<f:TabStrip ID="TabStrip1" IsFluid="true" ShowBorder="true" ActiveTabIndex="0"
|
||||
runat="server">
|
||||
<Tabs>
|
||||
<f:Tab ID="Tab1" EnableIFrame="true"
|
||||
Title="预览" runat="server">
|
||||
</f:Tab>
|
||||
</Tabs>
|
||||
</f:TabStrip>
|
||||
<f:Button ID="btnClose" EnablePostBack="false" ToolTip="关闭" hidden="true" Text="关闭" runat="server" Icon="SystemClose" Size="Medium">
|
||||
</f:Button>
|
||||
<iframe id="LookHtml" runat="server" width="700" height="600" name="LookHtml" hidden="hidden"></iframe>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,46 @@
|
||||
using BLL;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FineUIPro.Web.AttachFile
|
||||
{
|
||||
public partial class Look : PageBase
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
|
||||
|
||||
var url = Request.Params["fileUrl"];
|
||||
// var Baseurl = "https://view.officeapps.live.com/op/embed.aspx?src=";
|
||||
var Baseurl = "https://view.xdocin.com/view?src=";
|
||||
var Fileurl = Funs.SGGLUrl + url.Replace(Funs.RootPath, "");
|
||||
var newurl = "";
|
||||
var FiletExtension = Path.GetExtension(url);
|
||||
if (FiletExtension == ".docx" || FiletExtension == ".doc"|| FiletExtension == ".xls" || FiletExtension == ".xlsx")
|
||||
{
|
||||
newurl = Baseurl + Fileurl;
|
||||
}
|
||||
else if (FiletExtension == ".txt"|| FiletExtension== "pdf")
|
||||
{
|
||||
newurl = Fileurl;
|
||||
}
|
||||
else
|
||||
{
|
||||
newurl = Fileurl;
|
||||
}
|
||||
|
||||
this.LookHtml.Src = newurl;
|
||||
this.Tab1.IFrameUrl = newurl;
|
||||
//StreamReader fread = new StreamReader(url, System.Text.Encoding.GetEncoding("gb2312"));
|
||||
//string ss = fread.ReadToEnd();
|
||||
//Response.Write(ss);
|
||||
//fread.Close();
|
||||
//fread.Dispose();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.AttachFile
|
||||
{
|
||||
|
||||
|
||||
public partial class Look
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// TabStrip1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TabStrip TabStrip1;
|
||||
|
||||
/// <summary>
|
||||
/// Tab1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Tab Tab1;
|
||||
|
||||
/// <summary>
|
||||
/// btnClose 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnClose;
|
||||
|
||||
/// <summary>
|
||||
/// LookHtml 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlIframe LookHtml;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="webuploader.aspx.cs" Inherits="FineUIPro.Web.AttachFile.webuploader" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head runat="server">
|
||||
@@ -29,16 +28,17 @@
|
||||
<Toolbars>
|
||||
<f:Toolbar runat="server" ID="toolBar" Hidden="true" ToolbarAlign="Right">
|
||||
<Items>
|
||||
<f:Button ID="btnImageMagnify" runat="server" IconFont="Inbox" ToolTip="扫描文件" OnClick="btnImageMagnify_Click"></f:Button>
|
||||
<f:Button ID="btnImageMagnify" runat="server" IconFont="Inbox" Text="扫描"
|
||||
ToolTip="扫描文件" OnClick="btnImageMagnify_Click"></f:Button>
|
||||
<f:ToolbarFill runat="server">
|
||||
</f:ToolbarFill>
|
||||
<f:Button ID="btnSelectFiles" ToolTip="选择文件上传" IconFont="Upload" runat="server" EnablePostBack="false">
|
||||
<f:Button ID="btnSelectFiles" Text="上传" ToolTip="选择文件上传" IconFont="Upload" runat="server" EnablePostBack="false">
|
||||
</f:Button>
|
||||
<f:ToolbarSeparator runat="server"></f:ToolbarSeparator>
|
||||
<f:Button ID="btnDelete" ToolTip="删除选中文件" IconFont="Trash" runat="server" OnClick="btnDelete_Click">
|
||||
<f:Button ID="btnDelete" Text="删除" ToolTip="删除选中文件" IconFont="Trash" runat="server" OnClick="btnDelete_Click">
|
||||
</f:Button>
|
||||
<f:ToolbarSeparator ID="ToolbarSeparator2" runat="server"></f:ToolbarSeparator>
|
||||
<f:Button ID="btnSave" ToolTip="保存" IconFont="Save" runat="server" OnClick="btnSave_Click">
|
||||
<f:Button ID="btnSave" Text="保存" ToolTip="保存" IconFont="Save" runat="server" OnClick="btnSave_Click">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
@@ -48,7 +48,8 @@
|
||||
ExpandUnusedSpace="True" CommandName="Attach" EnableAjax="false" />
|
||||
<f:BoundField ColumnID="FileType" DataField="type" HeaderText="类型" Width="100px" />
|
||||
<f:RenderField ColumnID="FileSize" DataField="size" HeaderText="大小" Renderer="FileSize" Width="90px" />
|
||||
<f:BoundField ColumnID='FileStatus' DataField="status" NullDisplayText="已完成" HeaderText="状态" Width="90px" />
|
||||
<f:BoundField ColumnID='FileStatus' DataField="status" NullDisplayText="已完成" HeaderText="状态" Width="90px" />
|
||||
<f:LinkButtonField CommandName="Preview" Width="60px" Text="预览" />
|
||||
<f:LinkButtonField Width="60px" ConfirmText="你确定要删除这个文件吗?" ConfirmTarget="Parent" Text="删除"
|
||||
HeaderText="删除" CommandName="Delete" IconUrl="~/res/icon/delete.png" Hidden="true"/>
|
||||
</Columns>
|
||||
@@ -57,7 +58,7 @@
|
||||
注:本多附件上传支持的浏览器版本为:Chrome、Firefox、Safari、IE10+ 。
|
||||
<f:Window ID="Window1" Title="播放" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="false" runat="server" IsModal="true"
|
||||
Width="700px" Height="600px">
|
||||
Width="1024px" Height="650px">
|
||||
</f:Window>
|
||||
</form>
|
||||
<script src="res/webuploader/webuploader.nolog.js" type="text/javascript"></script>
|
||||
@@ -85,8 +86,8 @@
|
||||
formData: {
|
||||
owner: '<%= ParamStr%>'
|
||||
},
|
||||
// 单个文件大小限制(单位:byte),这里限制为 500M
|
||||
fileSingleSizeLimit: 500 * 1024 * 1024
|
||||
// 单个文件大小限制(单位:byte),这里限制为 800M
|
||||
fileSingleSizeLimit: 6000 * 1024 * 1024
|
||||
|
||||
});
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
using System;
|
||||
using BLL;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using BLL;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using WIA;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using WIA;
|
||||
|
||||
namespace FineUIPro.Web.AttachFile
|
||||
{
|
||||
@@ -240,6 +240,7 @@ namespace FineUIPro.Web.AttachFile
|
||||
/// <returns></returns>
|
||||
private JArray SourceData()
|
||||
{
|
||||
|
||||
if (Session[sessionName] == null && !string.IsNullOrEmpty(ToKeyId))
|
||||
{
|
||||
//Session[sessionName] = new JArray();
|
||||
@@ -334,7 +335,75 @@ namespace FineUIPro.Web.AttachFile
|
||||
DeleteRow(e.RowID);
|
||||
BindGrid();
|
||||
}
|
||||
if (e.CommandName == "Preview")
|
||||
{
|
||||
JArray source = GetSourceData();
|
||||
for (int i = 0, count = source.Count; i < count; i++)
|
||||
{
|
||||
JObject item = source[i] as JObject;
|
||||
if (item.Value<string>("id") == e.RowID)
|
||||
{
|
||||
try
|
||||
{
|
||||
string savedName = item.Value<string>("savedName");
|
||||
string folder = item.Value<string>("folder");
|
||||
string xnUrl = AttachPath + "\\" + savedName;
|
||||
if (!string.IsNullOrEmpty(folder))
|
||||
{
|
||||
xnUrl = folder + savedName;
|
||||
}
|
||||
|
||||
string url = Funs.RootPath + xnUrl;
|
||||
if (savedName.Contains("FileUpLoad"))
|
||||
{
|
||||
url = Funs.RootPath + savedName.Replace('/', '\\');
|
||||
}
|
||||
FileInfo info = new FileInfo(url);
|
||||
if (!info.Exists || string.IsNullOrEmpty(savedName))
|
||||
{
|
||||
url = Funs.RootPath + "Images//Null.jpg";
|
||||
info = new FileInfo(url);
|
||||
}
|
||||
var FiletExtension = Path.GetExtension(savedName);
|
||||
bool isSupportType = AttachFileService.IsSupportFileType(FiletExtension);
|
||||
if (isSupportType)
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../AttachFile/Look.aspx?fileUrl={0}", url, "查看 -")));
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("不支持预览", MessageBoxIcon.Warning);
|
||||
|
||||
}
|
||||
//if (FiletExtension == ".docx" || FiletExtension == ".pdf")
|
||||
//{
|
||||
// string httpUrl = BLL.AsposeWordHelper.WordToHtml(url);
|
||||
// PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../AttachFile/Look.aspx?fileUrl={0}", httpUrl, "查看 -")));
|
||||
|
||||
//}
|
||||
//else if (FiletExtension == ".txt")
|
||||
//{
|
||||
|
||||
// PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../AttachFile/Look.aspx?fileUrl={0}", url, "查看 -")));
|
||||
//}
|
||||
//else if (FiletExtension == ".xls")
|
||||
//{
|
||||
// string httpUrl = BLL.AsposeWordHelper.PriviewExcel(url);
|
||||
|
||||
// PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../AttachFile/Look.aspx?fileUrl={0}", httpUrl, "查看 -")));
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// ShowNotify("不支持预览", MessageBoxIcon.Warning);
|
||||
//}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (e.CommandName == "Attach")
|
||||
{
|
||||
JArray source = GetSourceData();
|
||||
@@ -393,7 +462,7 @@ namespace FineUIPro.Web.AttachFile
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user