From eefed96ad555a5f271a1d05048dea5cc5ecc2c9c Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Fri, 14 Feb 2020 18:05:13 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=BD=91=E7=AB=99=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=9C=B0=E7=90=86=E4=BD=8D=E7=BD=AE=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Bootstrap.Admin/Models/SettingsModel.cs | 14 +++++++++++ .../Views/Admin/Settings.cshtml | 23 +++++++++++++++++++ .../Bootstrap.Admin/wwwroot/js/settings.js | 7 ++++++ src/admin/Bootstrap.DataAccess/Dict.cs | 6 +++++ .../Bootstrap.DataAccess/Helper/DictHelper.cs | 6 +++++ 5 files changed, 56 insertions(+) diff --git a/src/admin/Bootstrap.Admin/Models/SettingsModel.cs b/src/admin/Bootstrap.Admin/Models/SettingsModel.cs index 0d0a5375..3e5d9327 100644 --- a/src/admin/Bootstrap.Admin/Models/SettingsModel.cs +++ b/src/admin/Bootstrap.Admin/Models/SettingsModel.cs @@ -19,6 +19,8 @@ namespace Bootstrap.Admin.Models Themes = DictHelper.RetrieveThemes(); AutoLockScreen = EnableAutoLockScreen; DefaultApp = DictHelper.RetrieveDefaultApp(); + IPLocators = DictHelper.RetireveLocators(); + IPLocatorSvr = DictHelper.RetrieveLocaleIPSvr(); } /// @@ -26,6 +28,18 @@ namespace Bootstrap.Admin.Models /// public IEnumerable Themes { get; } + /// + /// 获得 地理位置信息集合 + /// + /// + public IEnumerable IPLocators { get; } + + /// + /// 获得 数据库中配置的地理位置信息接口 + /// + /// + public string IPLocatorSvr { get; } + /// /// 获得 是否开启自动锁屏 /// diff --git a/src/admin/Bootstrap.Admin/Views/Admin/Settings.cshtml b/src/admin/Bootstrap.Admin/Views/Admin/Settings.cshtml index dca14ca3..680990f9 100644 --- a/src/admin/Bootstrap.Admin/Views/Admin/Settings.cshtml +++ b/src/admin/Bootstrap.Admin/Views/Admin/Settings.cshtml @@ -179,6 +179,29 @@ +
+
地址位置信息
+
+ +
+
+ + +
+
+ +
+
diff --git a/src/admin/Bootstrap.Admin/wwwroot/js/settings.js b/src/admin/Bootstrap.Admin/wwwroot/js/settings.js index ff253a2f..0bf4f310 100644 --- a/src/admin/Bootstrap.Admin/wwwroot/js/settings.js +++ b/src/admin/Bootstrap.Admin/wwwroot/js/settings.js @@ -92,6 +92,12 @@ $(function () { } }); break; + case 'saveIpLocator': + var iplocator = $iplocator.val(); + $.bc({ + url: Settings.url, data: [{ name: 'IP地理位置接口', code: iplocator, category: '网站设置' }], title: '保存地理位置服务设置', method: "post" + }); + break; } }); @@ -158,4 +164,5 @@ $(function () { }); var $css = $('#dictCssDefine').dropdown('val'); + var $iplocator = $('#iplocator').dropdown('val'); }); \ No newline at end of file diff --git a/src/admin/Bootstrap.DataAccess/Dict.cs b/src/admin/Bootstrap.DataAccess/Dict.cs index 1ff3eece..f8255dbd 100644 --- a/src/admin/Bootstrap.DataAccess/Dict.cs +++ b/src/admin/Bootstrap.DataAccess/Dict.cs @@ -296,5 +296,11 @@ namespace Bootstrap.DataAccess /// /// public bool RetrieveFixedTableHeader() => (DictHelper.RetrieveDicts().FirstOrDefault(d => d.Category == "网站设置" && d.Name == "固定表头" && d.Define == 0)?.Code ?? "1") == "1"; + + /// + /// 获得字典表地理位置配置信息集合 + /// + /// + public IEnumerable RetireveLocators() => DictHelper.RetrieveDicts().Where(d => d.Category == "地理位置"); } } diff --git a/src/admin/Bootstrap.DataAccess/Helper/DictHelper.cs b/src/admin/Bootstrap.DataAccess/Helper/DictHelper.cs index b6216c13..7e736799 100644 --- a/src/admin/Bootstrap.DataAccess/Helper/DictHelper.cs +++ b/src/admin/Bootstrap.DataAccess/Helper/DictHelper.cs @@ -281,5 +281,11 @@ namespace Bootstrap.DataAccess /// /// public static bool RetrieveFixedTableHeader() => DbContextManager.Create()?.RetrieveFixedTableHeader() ?? false; + + /// + /// 获得字典表地理位置配置信息集合 + /// + /// + public static IEnumerable RetireveLocators() => DbContextManager.Create()?.RetireveLocators() ?? new BootstrapDict[0]; } }