diff --git a/src/StaffManagement/Controllers/Web/HomeController.cs b/src/StaffManagement/Controllers/Web/HomeController.cs
index 6521f31..ea81e96 100644
--- a/src/StaffManagement/Controllers/Web/HomeController.cs
+++ b/src/StaffManagement/Controllers/Web/HomeController.cs
@@ -22,6 +22,10 @@ namespace StaffManagement.Controllers.Web
return View();
}
+ public IActionResult Building() {
+ return PartialView();
+ }
+
[ResponseCache(Duration = 0,Location = ResponseCacheLocation.None,NoStore = true)]
public IActionResult Error() {
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
diff --git a/src/StaffManagement/Extensions/FalconHtmlTagHelpers.cs b/src/StaffManagement/Extensions/FalconHtmlTagHelpers.cs
new file mode 100644
index 0000000..cf8c142
--- /dev/null
+++ b/src/StaffManagement/Extensions/FalconHtmlTagHelpers.cs
@@ -0,0 +1,72 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using Falcon.Extend;
+using Microsoft.AspNetCore.Razor.TagHelpers;
+
+namespace StaffManagement.Extensions
+{
+ ///
+ /// ajax请求
+ ///
+ [HtmlTargetElement("a",Attributes = "fajax")]
+ [HtmlTargetElement("form",Attributes = "fajax")]
+ public class AjaxLinkTagHelpers:TagHelper
+ {
+ ///
+ /// 实现ajax请求。设置为要更新的元素id并以#开头,其他则success后调用js方法。
+ ///
+ [HtmlAttributeName("fajax")]
+ public string Fajax { get; set; }
+ ///
+ /// 更新模式。默认为空,可选BEFORE、AFTER或REPLACE-WITH
+ ///
+ [HtmlAttributeName("fajax-model")]
+ public string Model { get; set; } = "";
+ ///
+ /// 开始ajax调用之前执行
+ ///
+ [HtmlAttributeName("fajax-begin")]
+ public string OnBegin { get; set; } = "";
+ ///
+ /// 调用ajax之后执行
+ ///
+ [HtmlAttributeName("fajax-complete")]
+ public string OnComplete { get; set; } = "";
+ ///
+ /// 调用失败执行
+ ///
+ [HtmlAttributeName("fajax-failure")]
+ public string OnFailure { get; set; } = "";
+
+ public override void Process(TagHelperContext context,TagHelperOutput output) {
+ base.Process(context,output);
+
+ if(this.Fajax.IsNullOrEmpty()) {
+ return;
+ }
+
+ output.Attributes.SetAttribute("data-ajax","true");
+
+ var fc = Fajax.Substring(0,1);
+ if("#".Contains(fc)) {
+ output.Attributes.SetAttribute("data-ajax-update",this.Fajax);
+ } else {
+ output.Attributes.SetAttribute("data-ajax-success",this.Fajax);
+ }
+ if(this.Model.IsNotNullOrEmpty()) {
+ output.Attributes.SetAttribute("data-ajax-mode",this.Model);
+ }
+ if(this.OnBegin.IsNotNullOrEmpty()) {
+ output.Attributes.SetAttribute("data-ajax-begin",this.OnBegin);
+ }
+ if(this.OnComplete.IsNotNullOrEmpty()) {
+ output.Attributes.SetAttribute("data-ajax-complete",this.OnComplete);
+ }
+ if(this.OnFailure.IsNotNullOrEmpty()) {
+ output.Attributes.SetAttribute("data-ajax-failure",this.OnFailure);
+ }
+ }
+ }
+}
diff --git a/src/StaffManagement/Views/Home/Building.cshtml b/src/StaffManagement/Views/Home/Building.cshtml
new file mode 100644
index 0000000..d9432d7
--- /dev/null
+++ b/src/StaffManagement/Views/Home/Building.cshtml
@@ -0,0 +1,5 @@
+
+
+
+
正在开发!
+
\ No newline at end of file
diff --git a/src/StaffManagement/Views/Shared/_Layout.cshtml b/src/StaffManagement/Views/Shared/_Layout.cshtml
index e969c4b..9657a43 100644
--- a/src/StaffManagement/Views/Shared/_Layout.cshtml
+++ b/src/StaffManagement/Views/Shared/_Layout.cshtml
@@ -19,10 +19,31 @@
@@ -30,7 +51,7 @@
-
+
@RenderBody()
@@ -43,6 +64,8 @@
- @RenderSection("Scripts", required: false)
+
+
+ @RenderSection("Scripts",required: false)