H5智能卡片用法:金蝶云作为多个系统的门户
结合https://wenku.my7c.com/article/370947757785104128?productLineId=1&isKnowledge=2 使用,如我的是待办事项的内容需要将第三方系统的待办集成到金蝶云首页(H5版),注册表单构建插件(https://wenku.my7c.com/article/310494768097159424?productLineId=1&isKnowledge=2)与注册表单插件,如不知道代码中字段标识可以参考“Html5智能待办消息卡片”。
public class xxxxx: H5SmartBaseCardPlugIn
{
private JSONObject GetBtnData()
{
JSONObject jSONObject = new JSONObject();
jSONObject["key"] = "0";
jSONObject["title"] = "需要处理的任务.";
jSONObject["author"] = ResManager.LoadKDString("发送人:","2052");
jSONObject["createtime"] = ResManager.LoadKDString("发送时间:", "2052", "2", new object[0]) + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
string fContent = "测试机";
jSONObject["content"] = fContent;
return jSONObject;
}
public override void AfterBindData(EventArgs e)
{
base.AfterBindData(e);
try
{
Control control = this.View.GetControl("FTitle");//待办任标识
if (this.View.ClientType == ClientType.Html)
{
control.InvokeControlMethod("setInlineStyleValue", new object[]
{
"height:21px"
});
}
control.SetCustomPropertyValue("StyleKey", "kd-smartcard-title");
if (!string.IsNullOrWhiteSpace(control.Text))
{
control.SetToolTip(control.Text);
}
}
catch (Exception)
{
}
try
{
Control control3 = this.View.GetControl("FLinkMore");
control3.SetCustomPropertyValue("StyleKey", "kd-smartcard-getmore");
}
catch (Exception)
{
}
if (this.View.ClientType != ClientType.Html)
{
this.View.GetControl("FLine").SetCustomPropertyValue("BackColor", "#FFE6E6E6");//分割线
}
JSONArray jSONArray = new JSONArray();
JSONObject jSONObject = new JSONObject();
jSONArray.Add(GetBtnData());
jSONObject["items"] = jSONArray;
ViewUtils.FireClientCustomEvents(this.View, "asyncGetData", "asyncGetData", 1, jSONObject);
this.View.GetControl("FAGENCYTASKCONTENT").SetCustomPropertyValue("Data", jSONObject);//流式布局标识
if (jSONArray.Count == 0)
{
JSONObject jSONObject2 = new JSONObject();
jSONObject2["text"] = ResManager.LoadKDString("很抱歉,暂时没有相关数据", "2052");
jSONObject2["visible"] = true;
this.View.GetControl("FAGENCYTASKCONTENT").SetCustomPropertyValue("NodataTipsVisible", jSONObject2);
}
}
public override void NaviOperAction(NaviOperActionArgs e)
{
string actionKey;
string isd= e.SelectItemId;
if (e.Key.EqualsIgnoreCase("FAgencyTaskContent") && (actionKey = e.ActionKey) != null && actionKey == "Click")
{
JSONObject webobj = new JSONObject();//打开外部网页
Dictionary<string, string> headers = new Dictionary<string, string>();
webobj["url"] = "https://wenku.my7c.com/article/310494768097159424?productLineId=1&isKnowledge=2";
webobj["Headers"] = headers;
this.View.AddAction("openUrlWindow", webobj);
}
base.NaviOperAction(e);
}
}
效果:Web版
H5智能卡片用法:金蝶云作为多个系统的门户
本文2024-09-16 18:35:24发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-23135.html