Browse Source

支持编辑内容模版时预览结果

master
yashen 9 years ago
parent
commit
d13319a18a
5 changed files with 39 additions and 11 deletions
  1. +28
    -5
      B3WeChat.Web/Pages/B3WeChat/ContentTemplate_/ContentTemplateEdit.cs
  2. +5
    -0
      B3WeChat/BO/ContentTemplate.cs
  3. +0
    -5
      WebFolder/app/app.03d376cb.js
  4. +5
    -0
      WebFolder/app/app.137764cc.js
  5. +1
    -1
      WebFolder/app/index.html

+ 28
- 5
B3WeChat.Web/Pages/B3WeChat/ContentTemplate_/ContentTemplateEdit.cs View File

@ -8,26 +8,49 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI;
using System.Web.UI.WebControls;
using TSingSoft.WebControls2;
namespace BWP.Web.Pages.B3WeChat.ContentTemplate_
{
class ContentTemplateEdit : BaseInfoEditPage<ContentTemplate, IContentTemplateBL>
{
protected override void BuildBasePropertiesEditor(TitlePanel titlePanel, PageLayoutSection pageLayoutSection)
protected override void OnPreRender(EventArgs e)
{
base.OnPreRender(e);
var script = @"
function changed(){
window.frames['result'].postMessage([__DFContainer.getValue('TestData'),__DFContainer.getValue('Text')],'*');
}
$(function(){
setTimeout(changed,500);
});
";
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "init", script, true);
}
protected override void BuildBasePropertiesEditor(TitlePanel titlePanel, PageLayoutSection pageLayoutSection)
{
var layoutManager = new LayoutManager("", mDFInfo, mDFContainer);
layoutManager.Add("Text", InputCreator.CreateTextArea(480, 640));
layoutManager.Add("Text", InputCreator.CreateTextArea(480, 640))
.Attributes["onchange"] = "changed();";
layoutManager.Add("TestData", InputCreator.CreateTextArea(480, 640))
.Attributes["onchange"] = "changed();";
layoutManager.Add("ShowResult", new SimpleLabel("显示"), new LiteralControl(@"<iframe style='border:0px;width:370px;height:667px;zoom:69%' name='result' src='../../app/index.html?onlyShowTemplate=1'></iframe>"));
layoutManager["ShowResult"].NotAutoAddToContainer = true;
var config = new AutoLayoutConfig();
layoutManager.Config = config;
config.Add("Name");
config.Add("Remark");
config.Add("Text").ColSpan = 8;
config.Add("Remark").EndLine = true;
config.Add("Text").ColSpan = 3;
config.Add("TestData").ColSpan = 3;
config.Add("ShowResult");
config.SetAllLabelLayoutOptionWidth(Unit.Pixel(60));
pageLayoutSection.ApplyLayout(layoutManager, config, mPageLayoutManager, mDFInfo);
titlePanel.Controls.Add(layoutManager.CreateLayout());
}


+ 5
- 0
B3WeChat/BO/ContentTemplate.cs View File

@ -20,5 +20,10 @@ namespace BWP.B3WeChat.BO
[LogicName("内容")]
[DbColumn(DbType = SqlDbType.NText)]
public string Text { get; set; }
[LogicName("测试数据")]
[DbColumn(DbType = SqlDbType.NText)]
public string TestData { get; set; }
}
}

+ 0
- 5
WebFolder/app/app.03d376cb.js
File diff suppressed because it is too large
View File


+ 5
- 0
WebFolder/app/app.137764cc.js
File diff suppressed because it is too large
View File


+ 1
- 1
WebFolder/app/index.html View File

@ -22,7 +22,7 @@
<body ontouchstart>
<div class="container" id="container"></div>
<script src="app.03d376cb.js"></script>
<script src="app.137764cc.js"></script>
</body>
</html>

Loading…
Cancel
Save