2023-04-19 合同台账修改
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using BLL;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FineUIPro.Web.AttachFile
|
||||
{
|
||||
@@ -12,7 +13,23 @@ namespace FineUIPro.Web.AttachFile
|
||||
this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
|
||||
|
||||
var url = Request.Params["fileUrl"];
|
||||
var newurl = Funs.SGGLUrl + url.Replace(Funs.RootPath, "");
|
||||
var Baseurl = "https://view.officeapps.live.com/op/embed.aspx?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"));
|
||||
|
||||
@@ -365,27 +365,37 @@ namespace FineUIPro.Web.AttachFile
|
||||
info = new FileInfo(url);
|
||||
}
|
||||
var FiletExtension = Path.GetExtension(savedName);
|
||||
if (FiletExtension == ".docx" || FiletExtension == ".pdf")
|
||||
bool isSupportType = AttachFileService.IsSupportFileType(FiletExtension);
|
||||
if (isSupportType)
|
||||
{
|
||||
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);
|
||||
|
||||
}
|
||||
//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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user