今天任务:每个小模块加单独的帮助文档,所有平台通用..
晚点贴方案和代码
RE:
功能已实现
1.建表管理上传的帮助文档和模块间的管理关系
help: 关键字段 pagecode,pagename ,oldname,newname,url
pagecode:与模块code一致,以便取
pagename:模块名
oldname:上传时的文件名
newname:上传后给文件的新名称, 约定为模块code.doc
url :上传存放的路径。
1. 对表help的增删改查
3. 支持上传doc帮助文档,并在上传完后将doc转化为html ,便于挂到网站上预览
doc转html需要Aspose.Words.dll
code:
//将doc转成html
string htmlurl = pshelp.Url + pagecode + ".html";
Aspose.Words.Document d = new Aspose.Words.Document(newFile);
d.Save(htmlurl, SaveFormat.Html);
4.页面挂帮助文档,根据相应的模块code即可找到对应的html显示即可
this.topbar.add(new Ext.Button({
iconCls: "Ps-Helpicon",
text: "帮助",
handler: this.WinHelp,
scope: this
}));
// 帮助
WinHelp : function() {
new PshelpHtmlView({
Projectcode: "P686",
Pagecode: "JXDnhandlewaysView",
Pagename:"处理方式"
}).show();
},
Ext.namespace("MainSys");
PshelpHtmlView = Ext.extend(Swext.window.SwWindow, {
topbar: null,
constructor: function(a) {
Ext.applyIf(this, a);
PshelpHtmlView.superclass.constructor.call(this, {
id: "PshelpHtmlView",
iconCls: "btn-help",
title: this.Pagename + "帮助",
region: "center",
items: this.formPanel,
modal: true,
plain: true,
height: 500,
border: false,
width: 800,
minWidth: 800, // 窗口最小宽度值,默认情况下根据调整好的宽度
minHeight: 500, // 窗口最小高度值,默认情况下根据调整好的高度
maximizable: true,
bodyStyle: "padding:5px;",
html: '<iframe height = "100%" width = "100%" scrolling ="auto" src="' + __ctxPath + '/help/' + this.Projectcode + '/' + this.Pagecode + '/' + this.Pagecode + '.html" frameborder="0"></iframe>'
});
}
});