diff --git a/Hh.Mes.T4/CshtmlTemplate.cs b/Hh.Mes.T4/CshtmlTemplate.cs index 4a43a72..30e0be6 100644 --- a/Hh.Mes.T4/CshtmlTemplate.cs +++ b/Hh.Mes.T4/CshtmlTemplate.cs @@ -18,7 +18,7 @@ namespace Hh.Mes.T4 /// Class to produce the template output /// </summary> - #line 1 "E:\project\mes\海能\haiNeng\Hh.Mes.T4\CshtmlTemplate.tt" + #line 1 "E:\project\mes\IOT\Hh.Mes.T4\CshtmlTemplate.tt" [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")] public partial class CshtmlTemplate : CshtmlTemplateBase { @@ -31,7 +31,7 @@ namespace Hh.Mes.T4 this.Write("@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers\r\n@{\r\n ViewData[\"title\"] =" + " \""); - #line 8 "E:\project\mes\海能\haiNeng\Hh.Mes.T4\CshtmlTemplate.tt" + #line 8 "E:\project\mes\IOT\Hh.Mes.T4\CshtmlTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TitleName)); #line default @@ -59,25 +59,25 @@ namespace Hh.Mes.T4 <div class=""layui-row""> "); - #line 29 "E:\project\mes\海能\haiNeng\Hh.Mes.T4\CshtmlTemplate.tt" + #line 29 "E:\project\mes\IOT\Hh.Mes.T4\CshtmlTemplate.tt" foreach (var item in QueryColumns) #line default #line hidden - #line 30 "E:\project\mes\海能\haiNeng\Hh.Mes.T4\CshtmlTemplate.tt" + #line 30 "E:\project\mes\IOT\Hh.Mes.T4\CshtmlTemplate.tt" { #line default #line hidden - #line 31 "E:\project\mes\海能\haiNeng\Hh.Mes.T4\CshtmlTemplate.tt" + #line 31 "E:\project\mes\IOT\Hh.Mes.T4\CshtmlTemplate.tt" if(item.TypeName.Equals("DateTime", StringComparison.OrdinalIgnoreCase)) #line default #line hidden - #line 32 "E:\project\mes\海能\haiNeng\Hh.Mes.T4\CshtmlTemplate.tt" + #line 32 "E:\project\mes\IOT\Hh.Mes.T4\CshtmlTemplate.tt" { #line default @@ -85,7 +85,7 @@ namespace Hh.Mes.T4 this.Write(" <div class=\"layui-col-sm3\">\r\n " + "<label class=\"layui-form-label\">"); - #line 34 "E:\project\mes\海能\haiNeng\Hh.Mes.T4\CshtmlTemplate.tt" + #line 34 "E:\project\mes\IOT\Hh.Mes.T4\CshtmlTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(string.IsNullOrWhiteSpace(item.ColumnDescription) ? $"{item.ColumnName}" : $"{item.ColumnDescription}")); #line default @@ -93,7 +93,7 @@ namespace Hh.Mes.T4 this.Write("</label>\r\n <div class=\"layui-input-inline\">\r\n " + " <input name=\""); - #line 36 "E:\project\mes\海能\haiNeng\Hh.Mes.T4\CshtmlTemplate.tt" + #line 36 "E:\project\mes\IOT\Hh.Mes.T4\CshtmlTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(item.ColumnName)); #line default @@ -101,7 +101,7 @@ namespace Hh.Mes.T4 this.Write("\" type=\"text\" autocomplete=\"off\" class=\"layui-input layui-date\">\r\n " + " </div>\r\n </div>\r\n"); - #line 39 "E:\project\mes\海能\haiNeng\Hh.Mes.T4\CshtmlTemplate.tt" + #line 39 "E:\project\mes\IOT\Hh.Mes.T4\CshtmlTemplate.tt" }else if(item.TypeName.Equals("Int", StringComparison.OrdinalIgnoreCase)){ #line default @@ -109,7 +109,7 @@ namespace Hh.Mes.T4 this.Write(" <div class=\"layui-col-sm3\">\r\n " + "<label class=\"layui-form-label\">"); - #line 41 "E:\project\mes\海能\haiNeng\Hh.Mes.T4\CshtmlTemplate.tt" + #line 41 "E:\project\mes\IOT\Hh.Mes.T4\CshtmlTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(string.IsNullOrWhiteSpace(item.ColumnDescription) ? $"{item.ColumnName}" : $"{item.ColumnDescription}")); #line default @@ -117,7 +117,7 @@ namespace Hh.Mes.T4 this.Write("</label>\r\n <div class=\"layui-input-inline\">\r\n " + " <input name=\""); - #line 43 "E:\project\mes\海能\haiNeng\Hh.Mes.T4\CshtmlTemplate.tt" + #line 43 "E:\project\mes\IOT\Hh.Mes.T4\CshtmlTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(item.ColumnName)); #line default @@ -125,7 +125,7 @@ namespace Hh.Mes.T4 this.Write("\" type=\"number\" autocomplete=\"off\" class=\"layui-input\">\r\n " + " </div>\r\n </div>\r\n"); - #line 46 "E:\project\mes\海能\haiNeng\Hh.Mes.T4\CshtmlTemplate.tt" + #line 46 "E:\project\mes\IOT\Hh.Mes.T4\CshtmlTemplate.tt" }else{ #line default @@ -133,7 +133,7 @@ namespace Hh.Mes.T4 this.Write(" <div class=\"layui-col-sm3\">\r\n " + "<label class=\"layui-form-label\">"); - #line 48 "E:\project\mes\海能\haiNeng\Hh.Mes.T4\CshtmlTemplate.tt" + #line 48 "E:\project\mes\IOT\Hh.Mes.T4\CshtmlTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(string.IsNullOrWhiteSpace(item.ColumnDescription) ? $"{item.ColumnName}" : $"{item.ColumnDescription}")); #line default @@ -141,7 +141,7 @@ namespace Hh.Mes.T4 this.Write("</label>\r\n <div class=\"layui-input-inline\">\r\n " + " <input name=\""); - #line 50 "E:\project\mes\海能\haiNeng\Hh.Mes.T4\CshtmlTemplate.tt" + #line 50 "E:\project\mes\IOT\Hh.Mes.T4\CshtmlTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(item.ColumnName)); #line default @@ -149,7 +149,7 @@ namespace Hh.Mes.T4 this.Write("\" type=\"text\" autocomplete=\"off\" class=\"layui-input\">\r\n " + " </div>\r\n </div>\r\n"); - #line 53 "E:\project\mes\海能\haiNeng\Hh.Mes.T4\CshtmlTemplate.tt" + #line 53 "E:\project\mes\IOT\Hh.Mes.T4\CshtmlTemplate.tt" }} #line default @@ -168,25 +168,25 @@ namespace Hh.Mes.T4 <div class=""layui-row""> "); - #line 65 "E:\project\mes\海能\haiNeng\Hh.Mes.T4\CshtmlTemplate.tt" + #line 65 "E:\project\mes\IOT\Hh.Mes.T4\CshtmlTemplate.tt" foreach (var item in EditColumns) #line default #line hidden - #line 66 "E:\project\mes\海能\haiNeng\Hh.Mes.T4\CshtmlTemplate.tt" + #line 66 "E:\project\mes\IOT\Hh.Mes.T4\CshtmlTemplate.tt" { #line default #line hidden - #line 67 "E:\project\mes\海能\haiNeng\Hh.Mes.T4\CshtmlTemplate.tt" + #line 67 "E:\project\mes\IOT\Hh.Mes.T4\CshtmlTemplate.tt" if(item.TypeName.Equals("DateTime", StringComparison.OrdinalIgnoreCase)) #line default #line hidden - #line 68 "E:\project\mes\海能\haiNeng\Hh.Mes.T4\CshtmlTemplate.tt" + #line 68 "E:\project\mes\IOT\Hh.Mes.T4\CshtmlTemplate.tt" { #line default @@ -194,7 +194,7 @@ namespace Hh.Mes.T4 this.Write(" <div class=\"layui-col-sm6\">\r\n <label class=\"layui-form-label l" + "ayui-col-sm3\">"); - #line 70 "E:\project\mes\海能\haiNeng\Hh.Mes.T4\CshtmlTemplate.tt" + #line 70 "E:\project\mes\IOT\Hh.Mes.T4\CshtmlTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(string.IsNullOrWhiteSpace(item.ColumnDescription) ? $"{item.ColumnName}" : $"{item.ColumnDescription}")); #line default @@ -202,7 +202,7 @@ namespace Hh.Mes.T4 this.Write("<span class=\"lable-required\">*</span></label>\r\n <div class=\"layui-inpu" + "t-inline layui-col-sm6\">\r\n <input name=\""); - #line 72 "E:\project\mes\海能\haiNeng\Hh.Mes.T4\CshtmlTemplate.tt" + #line 72 "E:\project\mes\IOT\Hh.Mes.T4\CshtmlTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(item.ColumnName)); #line default @@ -210,7 +210,7 @@ namespace Hh.Mes.T4 this.Write("\" type=\"text\" lay-verify=\"required\" autocomplete=\"off\" class=\"layui-input layui-d" + "ate\">\r\n </div>\r\n </div>\r\n"); - #line 75 "E:\project\mes\海能\haiNeng\Hh.Mes.T4\CshtmlTemplate.tt" + #line 75 "E:\project\mes\IOT\Hh.Mes.T4\CshtmlTemplate.tt" }else if(item.TypeName.Equals("Int", StringComparison.OrdinalIgnoreCase)){ #line default @@ -218,7 +218,7 @@ namespace Hh.Mes.T4 this.Write(" <div class=\"layui-col-sm6\">\r\n <label class=\"layui-form-label l" + "ayui-col-sm3\">"); - #line 77 "E:\project\mes\海能\haiNeng\Hh.Mes.T4\CshtmlTemplate.tt" + #line 77 "E:\project\mes\IOT\Hh.Mes.T4\CshtmlTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(string.IsNullOrWhiteSpace(item.ColumnDescription) ? $"{item.ColumnName}" : $"{item.ColumnDescription}")); #line default @@ -226,7 +226,7 @@ namespace Hh.Mes.T4 this.Write("<span class=\"lable-required\">*</span></label>\r\n <div class=\"layui-inpu" + "t-inline layui-col-sm6\">\r\n <input name=\""); - #line 79 "E:\project\mes\海能\haiNeng\Hh.Mes.T4\CshtmlTemplate.tt" + #line 79 "E:\project\mes\IOT\Hh.Mes.T4\CshtmlTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(item.ColumnName)); #line default @@ -234,7 +234,7 @@ namespace Hh.Mes.T4 this.Write("\" type=\"number\" lay-verify=\"required\" autocomplete=\"off\" class=\"layui-input\">\r\n " + " </div>\r\n </div>\r\n"); - #line 82 "E:\project\mes\海能\haiNeng\Hh.Mes.T4\CshtmlTemplate.tt" + #line 82 "E:\project\mes\IOT\Hh.Mes.T4\CshtmlTemplate.tt" }else{ #line default @@ -242,7 +242,7 @@ namespace Hh.Mes.T4 this.Write(" <div class=\"layui-col-sm6\">\r\n <label class=\"layui-form-label l" + "ayui-col-sm3\">"); - #line 84 "E:\project\mes\海能\haiNeng\Hh.Mes.T4\CshtmlTemplate.tt" + #line 84 "E:\project\mes\IOT\Hh.Mes.T4\CshtmlTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(string.IsNullOrWhiteSpace(item.ColumnDescription) ? $"{item.ColumnName}" : $"{item.ColumnDescription}")); #line default @@ -250,7 +250,7 @@ namespace Hh.Mes.T4 this.Write("<span class=\"lable-required\">*</span></label>\r\n <div class=\"layui-inpu" + "t-inline layui-col-sm6\">\r\n <input type=\"text\" name=\""); - #line 86 "E:\project\mes\海能\haiNeng\Hh.Mes.T4\CshtmlTemplate.tt" + #line 86 "E:\project\mes\IOT\Hh.Mes.T4\CshtmlTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(item.ColumnName)); #line default @@ -258,7 +258,7 @@ namespace Hh.Mes.T4 this.Write("\" lay-verify=\"required\" autocomplete=\"off\" class=\"layui-input\">\r\n </di" + "v>\r\n </div>\r\n"); - #line 89 "E:\project\mes\海能\haiNeng\Hh.Mes.T4\CshtmlTemplate.tt" + #line 89 "E:\project\mes\IOT\Hh.Mes.T4\CshtmlTemplate.tt" }} #line default @@ -287,7 +287,7 @@ namespace Hh.Mes.T4 <a href=""javascript:;"" class=""layui-btn layui-btn-sm layui-btn-mini"" lay-event=""btnRefresh""><i class=""layui-icon""></i>刷新</a> {{ loadMenus("""); - #line 111 "E:\project\mes\海能\haiNeng\Hh.Mes.T4\CshtmlTemplate.tt" + #line 111 "E:\project\mes\IOT\Hh.Mes.T4\CshtmlTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(ControllerName)); #line default @@ -295,14 +295,14 @@ namespace Hh.Mes.T4 this.Write("\", 1) }}\r\n </div>\r\n</script>\r\n\r\n@section Scripts\r\n{\r\n <script type=\"text/ja" + "vascript\" src=\"/productjs/"); - #line 117 "E:\project\mes\海能\haiNeng\Hh.Mes.T4\CshtmlTemplate.tt" + #line 117 "E:\project\mes\IOT\Hh.Mes.T4\CshtmlTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(AreaName)); #line default #line hidden this.Write("/"); - #line 117 "E:\project\mes\海能\haiNeng\Hh.Mes.T4\CshtmlTemplate.tt" + #line 117 "E:\project\mes\IOT\Hh.Mes.T4\CshtmlTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(ControllerName)); #line default diff --git a/web/WebMvc/Areas/configure/Views/BaseProject/Index.cshtml b/web/WebMvc/Areas/configure/Views/BaseProject/Index.cshtml index 3170b81..572798d 100644 --- a/web/WebMvc/Areas/configure/Views/BaseProject/Index.cshtml +++ b/web/WebMvc/Areas/configure/Views/BaseProject/Index.cshtml @@ -106,24 +106,25 @@ <div class="layui-col-sm12"> <label class="layui-form-label layui-col-sm3">项目地址<span class="lable-required">*</span></label> <div class="layui-input-inline layui-col-sm9 div-flex"> - <input type="text" name="projectAddress" placeholder="请输入完整的地址,请不要频繁点击使用!" autocomplete="off" class="layui-input"> - <input type="button" id="btnGetPoint" style="margin-left: 2px" class="layui-btn" value="解析"> + <input type="text" name="projectAddress" placeholder="输入完整的地址(x省x市x)确保更正确,请不要频繁点击!" autocomplete="off" class="layui-input"> + <input type="button" id="btnGetPoint" style="margin-left: 2px" class="layui-btn" value="地址解析经纬度"> </div> </div> <div class="layui-col-sm6"> <label class="layui-form-label layui-col-sm3">经度<span class="lable-required">*</span></label> <div class="layui-input-inline layui-col-sm6"> - <input type="text" name="longitude" lay-verify="required" autocomplete="off" class="layui-input"> + <input type="number" name="longitude" lay-verify="required" autocomplete="off" maxlength="20" class="layui-input"> </div> </div> <div class="layui-col-sm6"> <label class="layui-form-label layui-col-sm3">纬度<span class="lable-required">*</span></label> <div class="layui-input-inline layui-col-sm6"> - <input type="text" name="latitude" lay-verify="required" autocomplete="off" class="layui-input"> + <input type="number" name="latitude" lay-verify="required" autocomplete="off" maxlength="20" class="layui-input"> </div> </div> - <div class="layui-form-item layui-form-text layui-col-sm10" style="margin-top:10px;"> - <label class="layui-form-label">经纬度辅助工具:<a class="sys-a" href="https://api.map.baidu.com/lbsapi/getpoint/" target="_blank">点击打开百度经纬度(结果可复制)</a></label> + <div class="layui-form-item layui-form-text layui-col-sm11 div-flex" style="margin-top:10px;"> + <label class="layui-form-label">拾取坐标系统辅助工具:<a class="sys-a" href="https://api.map.baidu.com/lbsapi/getpoint/" target="_blank">点击打开拾取坐标系统辅助(结果可复制)</a></label> + <button class="layui-btn" id="btnCopyLonLat">解析复制板反写填充经纬度值</button> </div> <div class="layui-form-item"> <!--表单验证按钮--> diff --git a/web/WebMvc/Views/Home/Index.cshtml b/web/WebMvc/Views/Home/Index.cshtml index f24e711..c687782 100644 --- a/web/WebMvc/Views/Home/Index.cshtml +++ b/web/WebMvc/Views/Home/Index.cshtml @@ -67,11 +67,11 @@ border: 1px solid #D2D2D2; } - .input-search:focus { - border-color: #66afe9 !important; - outline: 0; - box-shadow: inset 0 1px 1px rgb(0 0 0 / 8%), 0 0 8px rgb(102 175 233 / 60%); - } + .input-search:focus { + border-color: #66afe9 !important; + outline: 0; + box-shadow: inset 0 1px 1px rgb(0 0 0 / 8%), 0 0 8px rgb(102 175 233 / 60%); + } </style> </head> <body class="main_body HPlus"> @@ -85,28 +85,13 @@ <a href="javascript:;" class="hideMenu"><i class="layui-icon" style="margin-left:-45px;" data-icon=""></i></a> <!-- 顶部右侧菜单 --> <ul class="layui-nav top_menu"> - @*<li class="layui-nav-item"> - <a href="javascript:;" onclick="LogStatistics();">接口错误日志统计<span id="LogStatistics" class="" style=" right: 10px; top: 10px;"></span></a> - </li>*@ - @*<li class="layui-nav-item"> - <a href="javascript:;" onclick="UnfinishedOrderInfo(1);">工单信息<span id="RedDot" class="" style=" right: 10px; top: 10px;"></span></a> - </li>*@ - @*<li class="layui-nav-item"> - <a href="javascript:;"> - <cite>打卡管理</cite> - </a> - <dl class="layui-nav-child"> - <dd><a href="javascript:;" onclick="WorkAttendance();"><i class="layui-icon" data-icon=""></i><cite>打卡</cite></a></dd> - <dd><a href="javascript:;" onclick="WorkAttendanceLog();"><i class="layui-icon" data-icon=""></i><cite>打卡记录</cite></a></dd> - </dl> - </li>*@ <li class="layui-nav-item"> <a href="javascript:;"> <cite>设置</cite> </a> <dl class="layui-nav-child"> <dd><a href="javascript:;" class="changepwd"><i class="layui-icon" data-icon=""></i><cite>修改密码</cite></a></dd> - @*<dd><a href="javascript:;" class="lockcms"><i class="layui-icon" data-icon=""></i><cite>锁屏</cite></a></dd>*@ +@* <dd><a href="javascript:;" class="lockcms"><i class="layui-icon" data-icon=""></i><cite>锁屏</cite></a></dd>*@ </dl> </li> <li class="layui-nav-item "> @@ -120,9 +105,6 @@ </div> <!-- 左侧导航 --> <div class="layui-side layui-bg-black"> - @*<div> - <img src="~/images/company2.jpg" alt="数字化智能管理" style="height:120px;object-fit: cover;" /> - </div>*@ <div style="border-bottom:2px double gray;padding:5px; background-color: white; color: #000;"> <span id="loginInfo"></span> <span id="loginTime"></span> @@ -137,7 +119,6 @@ <!-- 右侧内容 --> <div class="layui-body layui-form"> - <div class="layui-tab layui-tab-card marg0" lay-filter="bodyTab" id="top_tabs_box"> <ul class="layui-tab-title top_tab" id="top_tabs"> <li class="layui-this" lay-id=""><i class="iconfont icon-computer"></i> <cite>项目地图</cite></li> @@ -164,7 +145,6 @@ </ul> <div class="layui-tab-content clildFrame"> <div class="layui-tab-item layui-show"> - @*<iframe src="/Home/Main"></iframe>*@ <iframe src="/Home/ProjectMap"></iframe> </div> </div> @@ -175,32 +155,6 @@ <p>@ViewBag.copyright</p> </div> </div> - <!-- 移动导航 --> - <div class="site-tree-mobile layui-hide"><i class="layui-icon"></i></div> - <div class="site-mobile-shade"></div> - - <!-- 考勤打卡 --> - <div id="clock" style="display: none;"> - <div class="layui-tab layui-tab-brief" style="margin-top:10px; width:320px" lay-filter="loginWebcam"> - <ul class="layui-tab-title"> - <li class="layui-this" lay-id="1">人脸识别</li> - <li lay-id="3">刷卡登入</li> - </ul> - <div class="layui-tab-content"> - <div class="layui-tab-item layui-show"> - <div id="webcam" style="margin: auto; margin-top: -32px;"></div> - <button class="layui-btn loginbtn" style="width: 105px;margin-top: -32px;" id="btnTakeSnapshot">拍照登入</button> - </div> - <div class="layui-tab-item"> - <form action="#"> - <input id="IdCard" name="IdCard" type="password" autocomplete="off" style="margin-top: 25px;" class="layui-input" placeholder="请输入卡号"> - </form> - </div> - </div> - </div> - <div id="ccvMessage" style="clear:both;color: #009688;margin-top: 430px;"></div> - <div id="loginMessage" style="clear:both;color: #009688;margin-top: 5px;"></div> - </div> <div class="LogTips" style="display:none"> <div class="inter-con"> @@ -275,9 +229,7 @@ <script type="text/javascript" src="/layui/layui.js"></script> <script type="text/javascript" src="/js/leftNav.js"></script> <script type="text/javascript" src="/js/index.js" asp-append-version="true"></script> - <script src="~/js/face/webcam.js"></script> - <script src="~/js/face/ccv.js"></script> - <script src="~/js/face/face.js"></script> + <script> @Html.Raw(ViewBag.EnumProjectStatus) diff --git a/web/WebMvc/Views/Home/ProjectMap.cshtml b/web/WebMvc/Views/Home/ProjectMap.cshtml index f9afd18..1b4872f 100644 --- a/web/WebMvc/Views/Home/ProjectMap.cshtml +++ b/web/WebMvc/Views/Home/ProjectMap.cshtml @@ -1,5 +1,6 @@ @section header { + <link href="~/css/iot/iconfont.css" rel="stylesheet" /> <style type="text/css"> body, html, #container { width: 100%; @@ -12,20 +13,95 @@ .BMap_bubble_title { font-weight: 900; } - + + .footer-list { + position:fixed; + bottom:10px; + z-index: 9999; + width: 99.9%; + height: 70px; + justify-content: space-evenly; + font-size: 18px; + } + + .footer-project, .footer-eq, .footer-onlineRate, .footer-tuoRate { + align-items: center; + justify-content: space-around; + width: 16%; + height: 100%; + border: 1px rgb(55, 149, 242) solid; + border-radius: 20px; + background-color: #eeeeee; + } + + .iconfont { + font-size: 42px; + } + + .sidebar-list { + position: fixed; + right: 10px; + top: 10%; + z-index: 9900; + max-height:250px; + overflow-y:auto; + font-size: 20px; + background-color: #eeeeee; + } + + .layui-nav { + z-index: 9999; + } + + .layui-nav-child a:hover { + border-bottom: 3px solid #42b983; + } </style> } - +<!--地图--> <div id="container" style="overflow: hidden; position: relative; background-image: url("https://webmap0.bdimg.com/image/api/bg.png"); text-align: left; touch-action: none;"></div> +<!--尾部统计--> +<div class="footer-list div-flex vueApp"> + <div class="footer-project div-flex"> + <div><span class="iconfont icon-xiangmu" style="color:rgb(146, 133, 235)"></span></div> + <div class=""><span style="color:blue">{{footer.projectCount}}个</span>/项目</div> + </div> + <div class="footer-eq div-flex"> + <div><span class="iconfont icon-shebei" style="color:rgb(146, 133, 235)"></span></div> + <div class=""><span style="color:blue">24台</span>/设备</div> + </div> + <div class="footer-onlineRate div-flex"> + <div><span class="iconfont icon-shebeizaixianshuai" style="color:rgb(146, 133, 235)"></span></div> + <div class=""><span style="color:blue">30.67%</span>/在线率</div> + </div> + <div class="footer-tuoRate div-flex"> + <div><span class="iconfont icon-xiaoshuai" style="color:rgb(146, 133, 235)"></span></div> + <div class=""><span style="color:blue">16.67%</span>/妥善率</div> + </div> +</div> + +<!--侧栏 layui-nav-itemed--> +<div class="sidebar-list"> + <ul class="layui-nav layui-nav-tree layui-bg-blue" lay-filter="test"> + <li class="layui-nav-item"> + <a href="javascript:;">项目列表</a> + <dl class="layui-nav-child sidebar-list-item"> + <dd><a href="javascript:;">选项2</a></dd> + </dl> + </li> + </ul> +</div> + @section Scripts { <script type="text/javascript" src="https://api.map.baidu.com/api?v=1.0&&type=webgl&ak=00A47SzVEEXHPZyUakGyW18XcQXbwzZh"> </script> + <script src="~/js/vuemin2.js"></script> <script src="~/basejs/systemmap.js"></script> - <script src="~/basejs/projectmap.js"></script> + } diff --git a/web/WebMvc/WebMvc.csproj b/web/WebMvc/WebMvc.csproj index 2a37b05..bf1289b 100644 --- a/web/WebMvc/WebMvc.csproj +++ b/web/WebMvc/WebMvc.csproj @@ -18,6 +18,7 @@ <ItemGroup> <Compile Remove="Areas\configure\Views\base_product_header\**" /> <Compile Remove="logs\**" /> + <Compile Remove="wwwroot\css\新文件夹\**" /> <Compile Remove="wwwroot\js\fullcalendar-4.4.0\新文件夹\**" /> <Compile Remove="wwwroot\js\tabletree\**" /> <Compile Remove="wwwroot\OfficeFiles\**" /> @@ -27,6 +28,7 @@ <Compile Remove="wwwroot\productjs\quality\**" /> <Content Remove="Areas\configure\Views\base_product_header\**" /> <Content Remove="logs\**" /> + <Content Remove="wwwroot\css\新文件夹\**" /> <Content Remove="wwwroot\js\fullcalendar-4.4.0\新文件夹\**" /> <Content Remove="wwwroot\js\tabletree\**" /> <Content Remove="wwwroot\OfficeFiles\**" /> @@ -36,6 +38,7 @@ <Content Remove="wwwroot\productjs\quality\**" /> <EmbeddedResource Remove="Areas\configure\Views\base_product_header\**" /> <EmbeddedResource Remove="logs\**" /> + <EmbeddedResource Remove="wwwroot\css\新文件夹\**" /> <EmbeddedResource Remove="wwwroot\js\fullcalendar-4.4.0\新文件夹\**" /> <EmbeddedResource Remove="wwwroot\js\tabletree\**" /> <EmbeddedResource Remove="wwwroot\OfficeFiles\**" /> @@ -45,6 +48,7 @@ <EmbeddedResource Remove="wwwroot\productjs\quality\**" /> <None Remove="Areas\configure\Views\base_product_header\**" /> <None Remove="logs\**" /> + <None Remove="wwwroot\css\新文件夹\**" /> <None Remove="wwwroot\js\fullcalendar-4.4.0\新文件夹\**" /> <None Remove="wwwroot\js\tabletree\**" /> <None Remove="wwwroot\OfficeFiles\**" /> diff --git a/web/WebMvc/wwwroot/baseJs/projectMap.js b/web/WebMvc/wwwroot/baseJs/projectMap.js index 4f43926..e7fcb44 100644 --- a/web/WebMvc/wwwroot/baseJs/projectMap.js +++ b/web/WebMvc/wwwroot/baseJs/projectMap.js @@ -1,6 +1,8 @@ let action = null; +let mapObj = null; var app = null; + layui.config({ base: "/js/", version: 1 @@ -14,7 +16,7 @@ layui.config({ sendDataWhere = null, areaName = "configure", controllerName = "BaseProject", - mapObj = null; + vueApp = null; action = { @@ -25,46 +27,107 @@ layui.config({ mapEle: "container", }, methods: { + /** + * 初始化地图 + */ initMap() { mapObj = mapApp(app.data.mapEle).initMap(); }, - - getProjectData() { + /** + * 获取项目数据 + */ + getProjectDataList() { var ajaxConfig = { - data: { pageRequest: null, entity: { flag:"projectMapList" } }, + data: { pageRequest: null, entity: { flag: "projectMapList" } }, url: `/configure/BaseProject/Load`, success: function (result) { if (sysU.successBefore(result)) return false; - app.methods.createMarkerInfo(result) + app.methods.createMarkerInfo(result); + app.methods.initVueDataValue(result); + app.methods.createSidebarList(result); } }; sysU.ajax(ajaxConfig); }, + /** + * 创建marker标注 + */ createMarkerInfo(json) { json.Result.forEach(item => { var content = `<h4 style = 'margin:0;'>${item.projectAddress}</h4> - 设备总数:${item.eqCount}、在线:<span style='color:blue;'>${item.eqOnLine}</span>、待机:${item.eqOff}、故障:<span style='color:red;'>${item.eqAlarm}</span> - <div style = 'display: flex;' > - <div><a style='text-decoration: underline;color: blue;' onclick='app.methods.mapMarkerClick(${JSON.stringify(item)})' href='#'>点击链接</a></div> - </div >` ;//定义大标题 写html语句标签 + 设备总数:${item.eqCount}、在线:<span style='color:blue;'>${item.eqOnLine}</span>、待机:${item.eqOff}、故障:<span style='color:red;'>${item.eqAlarm}</span> + <div style = 'display: flex;' > + <div><a style='text-decoration: underline;color: blue;' onclick='app.methods.mapMarkerClick(${JSON.stringify(item)})' href='#'>点击链接</a></div> + </div >` ;//定义大标题 写html语句标签 mapObj.createMarkerInfo(content, { - title: "项目名称:"+item.projectName, + title: "项目名称:" + item.projectName, longitude: item.longitude, - latitude: item.latitude + latitude: item.latitude, + id: item.id }); }) }, mapMarkerClick(item) { alert(JSON.stringify(item)) + }, + /** + * 创建右侧项目列表 + */ + createSidebarList(json) { + var sidebarList = []; + var index = 1; + json.Result.forEach(item => { + var content = `<dd><a onclick='app.methods.findLocateMarker(${item.id.toString()})' href="javascript:;">【${index++}】${item.projectName}</a></dd>`;//定义大标题 写html语句标签 + sidebarList.push(content) + }) + if (sidebarList.length > 0) { + $(".sidebar-list-item").empty().append(sidebarList.join(" ")) + } + }, + /** + * 查找Marker并打开对应的infoWindow信息框 + */ + findLocateMarker(markerId) { + mapObj.getLocateMarker(markerId); + }, + /** + * 初始化vue + */ + initVue: function () { + vueApp = new Vue({ + el: '.vueApp', + data: { + footer: { + projectCount: 0, + eqCount: 0, + eqOnlineRate: "", + eqTuoRate: "", + } + }, + methods: { + + } + }); + }, + /** + * vue 集合赋值 + */ + initVueDataValue: function (result) { + vueApp.footer.projectCount = result.Result.length; + vueApp.footer.eqCount = 12; + vueApp.footer.eqOnlineRate = "16.67%"; + vueApp.footer.eqTuoRate = "89.67%"; } }, registerEvent: function () { }, init: function () { + debugger app.methods.initMap(); - app.methods.getProjectData(); + app.methods.initVue(); + app.methods.getProjectDataList(); app.registerEvent(); } }; diff --git a/web/WebMvc/wwwroot/baseJs/systemMap.js b/web/WebMvc/wwwroot/baseJs/systemMap.js index 4f8fc6e..7647408 100644 --- a/web/WebMvc/wwwroot/baseJs/systemMap.js +++ b/web/WebMvc/wwwroot/baseJs/systemMap.js @@ -1,5 +1,8 @@ ;(function (window) { - var sysMapObj = null; + var sysMapObj = null, + sysInfoWindowAll = {}, + sysZoomNumber=12, + sysPointKey = "_point"; var mapApp = function (selector, lon = 113.34693, lat = 28.21849) { return new mapApp.fn.init(selector, lon, lat); @@ -16,19 +19,26 @@ return this.initMapMethod(); } - this.createMarkerInfo = function (message,obj) { + this.createMarkerInfo = function (message, obj) { return this.markerInfoMethod(message, obj) } + this.getSysMapObj = function () { + return sysMapObj; + } + + this.getLocateMarker = function (hhMarkerId) { + return this.getLocateMarkerMethod(hhMarkerId) + } }, - initMapMethod () { + initMapMethod() { if (document.querySelector("#" + this.selector).length == 0) { alert(`初始化方法元素节点${"#" + this.selector}不存在!`); return; } sysMapObj = new BMapGL.Map(this.selector); - sysMapObj.centerAndZoom(this.getPoint(), 12); //设置中心点 + sysMapObj.centerAndZoom(this.getPoint(), sysZoomNumber); //设置中心点 sysMapObj.enableScrollWheelZoom(true); // //开启鼠标滚轮缩放 var scaleCtrl = new BMapGL.ScaleControl(); // 添加比例尺控件 @@ -55,16 +65,24 @@ * obj { title: x, longitude: longitude, latitude:latitude } */ markerInfoMethod: function (message, obj) { - var point = this.getPoint(obj.longitude, obj.latitude) - var marker = new BMapGL.Marker(point); // 创建标注 + let point = this.getPoint(obj.longitude, obj.latitude), + marker = new BMapGL.Marker(point), // 创建标注 + markerId = obj.id.toString(); //自定义标注唯一ID + marker.hhId = markerId; sysMapObj.addOverlay(marker); // 将标注添加到地图中 + var opts = { - width: 300, // 信息窗口宽度 + width: 300, // 信息窗口宽度 height: 100, // 信息窗口高度 title: obj.title, // 信息窗口标题 } - var infoWindow = new BMapGL.InfoWindow(message, opts); // 创建信息窗口对象 + let infoWindow = new BMapGL.InfoWindow(message, opts); // 创建信息窗口对象 sysMapObj.openInfoWindow(infoWindow, point); //开启信息窗口 + + if (!sysInfoWindowAll[markerId]) { + sysInfoWindowAll[markerId] = infoWindow; + sysInfoWindowAll[markerId + sysPointKey] = point; + } marker.addEventListener("click", function () { sysMapObj.openInfoWindow(infoWindow, point); //开启信息窗口 }); @@ -97,6 +115,28 @@ alert("地址解析异常:", err); }) }, + + /** + * 查找Marker并打开对应的infoWindow信息框 + */ + getLocateMarkerMethod(markerId) { + var overlays = sysMapObj.getOverlays(); + for (var i = 0; i < overlays.length; i++) { + var overlay = overlays[i]; + if (overlay.hhId == markerId) { + var pos = overlay.getPosition(); + sysMapObj.panTo(pos); // 定位到 Marker + overlay.setAnimation(BMAP_ANIMATION_BOUNCE); // 添加动画效果 + let infoWindow = sysInfoWindowAll[markerId]; + if (infoWindow) { + sysMapObj.centerAndZoom(pos, sysZoomNumber); //设置中心点 + let point = sysInfoWindowAll[markerId + sysPointKey]; + sysMapObj.openInfoWindow(infoWindow, point); // 打开对应的 infoWindow + } + break; + } + } + } } mapApp.fn.init.prototype = mapApp.fn; diff --git a/web/WebMvc/wwwroot/css/iot/demo.css b/web/WebMvc/wwwroot/css/iot/demo.css new file mode 100644 index 0000000..a67054a --- /dev/null +++ b/web/WebMvc/wwwroot/css/iot/demo.css @@ -0,0 +1,539 @@ +/* Logo 字体 */ +@font-face { + font-family: "iconfont logo"; + src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834'); + src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834#iefix') format('embedded-opentype'), + url('https://at.alicdn.com/t/font_985780_km7mi63cihi.woff?t=1545807318834') format('woff'), + url('https://at.alicdn.com/t/font_985780_km7mi63cihi.ttf?t=1545807318834') format('truetype'), + url('https://at.alicdn.com/t/font_985780_km7mi63cihi.svg?t=1545807318834#iconfont') format('svg'); +} + +.logo { + font-family: "iconfont logo"; + font-size: 160px; + font-style: normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +/* tabs */ +.nav-tabs { + position: relative; +} + +.nav-tabs .nav-more { + position: absolute; + right: 0; + bottom: 0; + height: 42px; + line-height: 42px; + color: #666; +} + +#tabs { + border-bottom: 1px solid #eee; +} + +#tabs li { + cursor: pointer; + width: 100px; + height: 40px; + line-height: 40px; + text-align: center; + font-size: 16px; + border-bottom: 2px solid transparent; + position: relative; + z-index: 1; + margin-bottom: -1px; + color: #666; +} + + +#tabs .active { + border-bottom-color: #f00; + color: #222; +} + +.tab-container .content { + display: none; +} + +/* 页面布局 */ +.main { + padding: 30px 100px; + width: 960px; + margin: 0 auto; +} + +.main .logo { + color: #333; + text-align: left; + margin-bottom: 30px; + line-height: 1; + height: 110px; + margin-top: -50px; + overflow: hidden; + *zoom: 1; +} + +.main .logo a { + font-size: 160px; + color: #333; +} + +.helps { + margin-top: 40px; +} + +.helps pre { + padding: 20px; + margin: 10px 0; + border: solid 1px #e7e1cd; + background-color: #fffdef; + overflow: auto; +} + +.icon_lists { + width: 100% !important; + overflow: hidden; + *zoom: 1; +} + +.icon_lists li { + width: 100px; + margin-bottom: 10px; + margin-right: 20px; + text-align: center; + list-style: none !important; + cursor: default; +} + +.icon_lists li .code-name { + line-height: 1.2; +} + +.icon_lists .icon { + display: block; + height: 100px; + line-height: 100px; + font-size: 42px; + margin: 10px auto; + color: #333; + -webkit-transition: font-size 0.25s linear, width 0.25s linear; + -moz-transition: font-size 0.25s linear, width 0.25s linear; + transition: font-size 0.25s linear, width 0.25s linear; +} + +.icon_lists .icon:hover { + font-size: 100px; +} + +.icon_lists .svg-icon { + /* 通过设置 font-size 来改变图标大小 */ + width: 1em; + /* 图标和文字相邻时,垂直对齐 */ + vertical-align: -0.15em; + /* 通过设置 color 来改变 SVG 的颜色/fill */ + fill: currentColor; + /* path 和 stroke 溢出 viewBox 部分在 IE 下会显示 + normalize.css 中也包含这行 */ + overflow: hidden; +} + +.icon_lists li .name, +.icon_lists li .code-name { + color: #666; +} + +/* markdown 样式 */ +.markdown { + color: #666; + font-size: 14px; + line-height: 1.8; +} + +.highlight { + line-height: 1.5; +} + +.markdown img { + vertical-align: middle; + max-width: 100%; +} + +.markdown h1 { + color: #404040; + font-weight: 500; + line-height: 40px; + margin-bottom: 24px; +} + +.markdown h2, +.markdown h3, +.markdown h4, +.markdown h5, +.markdown h6 { + color: #404040; + margin: 1.6em 0 0.6em 0; + font-weight: 500; + clear: both; +} + +.markdown h1 { + font-size: 28px; +} + +.markdown h2 { + font-size: 22px; +} + +.markdown h3 { + font-size: 16px; +} + +.markdown h4 { + font-size: 14px; +} + +.markdown h5 { + font-size: 12px; +} + +.markdown h6 { + font-size: 12px; +} + +.markdown hr { + height: 1px; + border: 0; + background: #e9e9e9; + margin: 16px 0; + clear: both; +} + +.markdown p { + margin: 1em 0; +} + +.markdown>p, +.markdown>blockquote, +.markdown>.highlight, +.markdown>ol, +.markdown>ul { + width: 80%; +} + +.markdown ul>li { + list-style: circle; +} + +.markdown>ul li, +.markdown blockquote ul>li { + margin-left: 20px; + padding-left: 4px; +} + +.markdown>ul li p, +.markdown>ol li p { + margin: 0.6em 0; +} + +.markdown ol>li { + list-style: decimal; +} + +.markdown>ol li, +.markdown blockquote ol>li { + margin-left: 20px; + padding-left: 4px; +} + +.markdown code { + margin: 0 3px; + padding: 0 5px; + background: #eee; + border-radius: 3px; +} + +.markdown strong, +.markdown b { + font-weight: 600; +} + +.markdown>table { + border-collapse: collapse; + border-spacing: 0px; + empty-cells: show; + border: 1px solid #e9e9e9; + width: 95%; + margin-bottom: 24px; +} + +.markdown>table th { + white-space: nowrap; + color: #333; + font-weight: 600; +} + +.markdown>table th, +.markdown>table td { + border: 1px solid #e9e9e9; + padding: 8px 16px; + text-align: left; +} + +.markdown>table th { + background: #F7F7F7; +} + +.markdown blockquote { + font-size: 90%; + color: #999; + border-left: 4px solid #e9e9e9; + padding-left: 0.8em; + margin: 1em 0; +} + +.markdown blockquote p { + margin: 0; +} + +.markdown .anchor { + opacity: 0; + transition: opacity 0.3s ease; + margin-left: 8px; +} + +.markdown .waiting { + color: #ccc; +} + +.markdown h1:hover .anchor, +.markdown h2:hover .anchor, +.markdown h3:hover .anchor, +.markdown h4:hover .anchor, +.markdown h5:hover .anchor, +.markdown h6:hover .anchor { + opacity: 1; + display: inline-block; +} + +.markdown>br, +.markdown>p>br { + clear: both; +} + + +.hljs { + display: block; + background: white; + padding: 0.5em; + color: #333333; + overflow-x: auto; +} + +.hljs-comment, +.hljs-meta { + color: #969896; +} + +.hljs-string, +.hljs-variable, +.hljs-template-variable, +.hljs-strong, +.hljs-emphasis, +.hljs-quote { + color: #df5000; +} + +.hljs-keyword, +.hljs-selector-tag, +.hljs-type { + color: #a71d5d; +} + +.hljs-literal, +.hljs-symbol, +.hljs-bullet, +.hljs-attribute { + color: #0086b3; +} + +.hljs-section, +.hljs-name { + color: #63a35c; +} + +.hljs-tag { + color: #333333; +} + +.hljs-title, +.hljs-attr, +.hljs-selector-id, +.hljs-selector-class, +.hljs-selector-attr, +.hljs-selector-pseudo { + color: #795da3; +} + +.hljs-addition { + color: #55a532; + background-color: #eaffea; +} + +.hljs-deletion { + color: #bd2c00; + background-color: #ffecec; +} + +.hljs-link { + text-decoration: underline; +} + +/* 代码高亮 */ +/* PrismJS 1.15.0 +https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript */ +/** + * prism.js default theme for JavaScript, CSS and HTML + * Based on dabblet (http://dabblet.com) + * @author Lea Verou + */ +code[class*="language-"], +pre[class*="language-"] { + color: black; + background: none; + text-shadow: 0 1px white; + font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + word-wrap: normal; + line-height: 1.5; + + -moz-tab-size: 4; + -o-tab-size: 4; + tab-size: 4; + + -webkit-hyphens: none; + -moz-hyphens: none; + -ms-hyphens: none; + hyphens: none; +} + +pre[class*="language-"]::-moz-selection, +pre[class*="language-"] ::-moz-selection, +code[class*="language-"]::-moz-selection, +code[class*="language-"] ::-moz-selection { + text-shadow: none; + background: #b3d4fc; +} + +pre[class*="language-"]::selection, +pre[class*="language-"] ::selection, +code[class*="language-"]::selection, +code[class*="language-"] ::selection { + text-shadow: none; + background: #b3d4fc; +} + +@media print { + + code[class*="language-"], + pre[class*="language-"] { + text-shadow: none; + } +} + +/* Code blocks */ +pre[class*="language-"] { + padding: 1em; + margin: .5em 0; + overflow: auto; +} + +:not(pre)>code[class*="language-"], +pre[class*="language-"] { + background: #f5f2f0; +} + +/* Inline code */ +:not(pre)>code[class*="language-"] { + padding: .1em; + border-radius: .3em; + white-space: normal; +} + +.token.comment, +.token.prolog, +.token.doctype, +.token.cdata { + color: slategray; +} + +.token.punctuation { + color: #999; +} + +.namespace { + opacity: .7; +} + +.token.property, +.token.tag, +.token.boolean, +.token.number, +.token.constant, +.token.symbol, +.token.deleted { + color: #905; +} + +.token.selector, +.token.attr-name, +.token.string, +.token.char, +.token.builtin, +.token.inserted { + color: #690; +} + +.token.operator, +.token.entity, +.token.url, +.language-css .token.string, +.style .token.string { + color: #9a6e3a; + background: hsla(0, 0%, 100%, .5); +} + +.token.atrule, +.token.attr-value, +.token.keyword { + color: #07a; +} + +.token.function, +.token.class-name { + color: #DD4A68; +} + +.token.regex, +.token.important, +.token.variable { + color: #e90; +} + +.token.important, +.token.bold { + font-weight: bold; +} + +.token.italic { + font-style: italic; +} + +.token.entity { + cursor: help; +} diff --git a/web/WebMvc/wwwroot/css/iot/demo_index.html b/web/WebMvc/wwwroot/css/iot/demo_index.html new file mode 100644 index 0000000..90bbcdb --- /dev/null +++ b/web/WebMvc/wwwroot/css/iot/demo_index.html @@ -0,0 +1,280 @@ +<!DOCTYPE html> +<html> +<head> + <meta charset="utf-8"/> + <title>iconfont Demo</title> + <link rel="shortcut icon" href="//img.alicdn.com/imgextra/i4/O1CN01Z5paLz1O0zuCC7osS_!!6000000001644-55-tps-83-82.svg" type="image/x-icon"/> + <link rel="icon" type="image/svg+xml" href="//img.alicdn.com/imgextra/i4/O1CN01Z5paLz1O0zuCC7osS_!!6000000001644-55-tps-83-82.svg"/> + <link rel="stylesheet" href="https://g.alicdn.com/thx/cube/1.3.2/cube.min.css"> + <link rel="stylesheet" href="demo.css"> + <link rel="stylesheet" href="iconfont.css"> + <script src="iconfont.js"></script> + <!-- jQuery --> + <script src="https://a1.alicdn.com/oss/uploads/2018/12/26/7bfddb60-08e8-11e9-9b04-53e73bb6408b.js"></script> + <!-- 代码高亮 --> + <script src="https://a1.alicdn.com/oss/uploads/2018/12/26/a3f714d0-08e6-11e9-8a15-ebf944d7534c.js"></script> + <style> + .main .logo { + margin-top: 0; + height: auto; + } + + .main .logo a { + display: flex; + align-items: center; + } + + .main .logo .sub-title { + margin-left: 0.5em; + font-size: 22px; + color: #fff; + background: linear-gradient(-45deg, #3967FF, #B500FE); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + } + </style> +</head> +<body> + <div class="main"> + <h1 class="logo"><a href="https://www.iconfont.cn/" title="iconfont 首页" target="_blank"> + <img width="200" src="https://img.alicdn.com/imgextra/i3/O1CN01Mn65HV1FfSEzR6DKv_!!6000000000514-55-tps-228-59.svg"> + + </a></h1> + <div class="nav-tabs"> + <ul id="tabs" class="dib-box"> + <li class="dib active"><span>Unicode</span></li> + <li class="dib"><span>Font class</span></li> + <li class="dib"><span>Symbol</span></li> + </ul> + + <a href="https://www.iconfont.cn/manage/index?manage_type=myprojects&projectId=4427370" target="_blank" class="nav-more">查看项目</a> + + </div> + <div class="tab-container"> + <div class="content unicode" style="display: block;"> + <ul class="icon_lists dib-box"> + + <li class="dib"> + <span class="icon iconfont"></span> + <div class="name">效率</div> + <div class="code-name">&#xe663;</div> + </li> + + <li class="dib"> + <span class="icon iconfont"></span> + <div class="name">设备在线率</div> + <div class="code-name">&#xe742;</div> + </li> + + <li class="dib"> + <span class="icon iconfont"></span> + <div class="name">项目</div> + <div class="code-name">&#xe63d;</div> + </li> + + <li class="dib"> + <span class="icon iconfont"></span> + <div class="name">设备</div> + <div class="code-name">&#xe63c;</div> + </li> + + </ul> + <div class="article markdown"> + <h2 id="unicode-">Unicode 引用</h2> + <hr> + + <p>Unicode 是字体在网页端最原始的应用方式,特点是:</p> + <ul> + <li>支持按字体的方式去动态调整图标大小,颜色等等。</li> + <li>默认情况下不支持多色,直接添加多色图标会自动去色。</li> + </ul> + <blockquote> + <p>注意:新版 iconfont 支持两种方式引用多色图标:SVG symbol 引用方式和彩色字体图标模式。(使用彩色字体图标需要在「编辑项目」中开启「彩色」选项后并重新生成。)</p> + </blockquote> + <p>Unicode 使用步骤如下:</p> + <h3 id="-font-face">第一步:拷贝项目下面生成的 <code>@font-face</code></h3> +<pre><code class="language-css" +>@font-face { + font-family: 'iconfont'; + src: url('iconfont.woff2?t=1706586924308') format('woff2'), + url('iconfont.woff?t=1706586924308') format('woff'), + url('iconfont.ttf?t=1706586924308') format('truetype'); +} +</code></pre> + <h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3> +<pre><code class="language-css" +>.iconfont { + font-family: "iconfont" !important; + font-size: 16px; + font-style: normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} +</code></pre> + <h3 id="-">第三步:挑选相应图标并获取字体编码,应用于页面</h3> +<pre> +<code class="language-html" +><span class="iconfont">&#x33;</span> +</code></pre> + <blockquote> + <p>"iconfont" 是你项目下的 font-family。可以通过编辑项目查看,默认是 "iconfont"。</p> + </blockquote> + </div> + </div> + <div class="content font-class"> + <ul class="icon_lists dib-box"> + + <li class="dib"> + <span class="icon iconfont icon-xiaoshuai"></span> + <div class="name"> + 效率 + </div> + <div class="code-name">.icon-xiaoshuai + </div> + </li> + + <li class="dib"> + <span class="icon iconfont icon-shebeizaixianshuai"></span> + <div class="name"> + 设备在线率 + </div> + <div class="code-name">.icon-shebeizaixianshuai + </div> + </li> + + <li class="dib"> + <span class="icon iconfont icon-xiangmu"></span> + <div class="name"> + 项目 + </div> + <div class="code-name">.icon-xiangmu + </div> + </li> + + <li class="dib"> + <span class="icon iconfont icon-shebei"></span> + <div class="name"> + 设备 + </div> + <div class="code-name">.icon-shebei + </div> + </li> + + </ul> + <div class="article markdown"> + <h2 id="font-class-">font-class 引用</h2> + <hr> + + <p>font-class 是 Unicode 使用方式的一种变种,主要是解决 Unicode 书写不直观,语意不明确的问题。</p> + <p>与 Unicode 使用方式相比,具有如下特点:</p> + <ul> + <li>相比于 Unicode 语意明确,书写更直观。可以很容易分辨这个 icon 是什么。</li> + <li>因为使用 class 来定义图标,所以当要替换图标时,只需要修改 class 里面的 Unicode 引用。</li> + </ul> + <p>使用步骤如下:</p> + <h3 id="-fontclass-">第一步:引入项目下面生成的 fontclass 代码:</h3> +<pre><code class="language-html"><link rel="stylesheet" href="./iconfont.css"> +</code></pre> + <h3 id="-">第二步:挑选相应图标并获取类名,应用于页面:</h3> +<pre><code class="language-html"><span class="iconfont icon-xxx"></span> +</code></pre> + <blockquote> + <p>" + iconfont" 是你项目下的 font-family。可以通过编辑项目查看,默认是 "iconfont"。</p> + </blockquote> + </div> + </div> + <div class="content symbol"> + <ul class="icon_lists dib-box"> + + <li class="dib"> + <svg class="icon svg-icon" aria-hidden="true"> + <use xlink:href="#icon-xiaoshuai"></use> + </svg> + <div class="name">效率</div> + <div class="code-name">#icon-xiaoshuai</div> + </li> + + <li class="dib"> + <svg class="icon svg-icon" aria-hidden="true"> + <use xlink:href="#icon-shebeizaixianshuai"></use> + </svg> + <div class="name">设备在线率</div> + <div class="code-name">#icon-shebeizaixianshuai</div> + </li> + + <li class="dib"> + <svg class="icon svg-icon" aria-hidden="true"> + <use xlink:href="#icon-xiangmu"></use> + </svg> + <div class="name">项目</div> + <div class="code-name">#icon-xiangmu</div> + </li> + + <li class="dib"> + <svg class="icon svg-icon" aria-hidden="true"> + <use xlink:href="#icon-shebei"></use> + </svg> + <div class="name">设备</div> + <div class="code-name">#icon-shebei</div> + </li> + + </ul> + <div class="article markdown"> + <h2 id="symbol-">Symbol 引用</h2> + <hr> + + <p>这是一种全新的使用方式,应该说这才是未来的主流,也是平台目前推荐的用法。相关介绍可以参考这篇<a href="">文章</a> + 这种用法其实是做了一个 SVG 的集合,与另外两种相比具有如下特点:</p> + <ul> + <li>支持多色图标了,不再受单色限制。</li> + <li>通过一些技巧,支持像字体那样,通过 <code>font-size</code>, <code>color</code> 来调整样式。</li> + <li>兼容性较差,支持 IE9+,及现代浏览器。</li> + <li>浏览器渲染 SVG 的性能一般,还不如 png。</li> + </ul> + <p>使用步骤如下:</p> + <h3 id="-symbol-">第一步:引入项目下面生成的 symbol 代码:</h3> +<pre><code class="language-html"><script src="./iconfont.js"></script> +</code></pre> + <h3 id="-css-">第二步:加入通用 CSS 代码(引入一次就行):</h3> +<pre><code class="language-html"><style> +.icon { + width: 1em; + height: 1em; + vertical-align: -0.15em; + fill: currentColor; + overflow: hidden; +} +</style> +</code></pre> + <h3 id="-">第三步:挑选相应图标并获取类名,应用于页面:</h3> +<pre><code class="language-html"><svg class="icon" aria-hidden="true"> + <use xlink:href="#icon-xxx"></use> +</svg> +</code></pre> + </div> + </div> + + </div> + </div> + <script> + $(document).ready(function () { + $('.tab-container .content:first').show() + + $('#tabs li').click(function (e) { + var tabContent = $('.tab-container .content') + var index = $(this).index() + + if ($(this).hasClass('active')) { + return + } else { + $('#tabs li').removeClass('active') + $(this).addClass('active') + + tabContent.hide().eq(index).fadeIn() + } + }) + }) + </script> +</body> +</html> diff --git a/web/WebMvc/wwwroot/css/iot/iconfont.css b/web/WebMvc/wwwroot/css/iot/iconfont.css new file mode 100644 index 0000000..f837997 --- /dev/null +++ b/web/WebMvc/wwwroot/css/iot/iconfont.css @@ -0,0 +1,31 @@ +@font-face { + font-family: "iconfont"; /* Project id 4427370 */ + src: url('iconfont.woff2?t=1706586924308') format('woff2'), + url('iconfont.woff?t=1706586924308') format('woff'), + url('iconfont.ttf?t=1706586924308') format('truetype'); +} + +.iconfont { + font-family: "iconfont" !important; + font-size: 16px; + font-style: normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.icon-xiaoshuai:before { + content: "\e663"; +} + +.icon-shebeizaixianshuai:before { + content: "\e742"; +} + +.icon-xiangmu:before { + content: "\e63d"; +} + +.icon-shebei:before { + content: "\e63c"; +} + diff --git a/web/WebMvc/wwwroot/css/iot/iconfont.js b/web/WebMvc/wwwroot/css/iot/iconfont.js new file mode 100644 index 0000000..dc8fd95 --- /dev/null +++ b/web/WebMvc/wwwroot/css/iot/iconfont.js @@ -0,0 +1 @@ +window._iconfont_svg_string_4427370='<svg><symbol id="icon-xiaoshuai" viewBox="0 0 1024 1024"><path d="M65.3 64.2h10v896h-10z" fill="" ></path><path d="M960.958 949.558v10h-896v-10z" fill="" ></path><path d="M325.1 959.6H187V571h138v388.6z m-128.1-10h118V581H197v368.6zM581 959.6H443V378.8h138v580.8z m-128-10h118V388.8H453v560.8zM837.2 959.6h-138V186.8h138v772.8z m-128.1-10h118V196.8h-118v752.8z" fill="" ></path></symbol><symbol id="icon-shebeizaixianshuai" viewBox="0 0 1024 1024"><path d="M512 0A512 512 0 1 1 0 512 512 512 0 0 1 512 0z" fill="#9285EB" opacity=".5" ></path><path d="M505.008 512m-336 0a336 336 0 1 0 672 0 336 336 0 1 0-672 0Z" fill="#9285EB" ></path><path d="M529.92 519.296l-1.312-3.648a52.16 52.16 0 1 0-40.784-1.024l-24 201.6h87.408z" fill="#FFFFFF" ></path><path d="M655.488 525.936a159.072 159.072 0 1 0-221.152 82.592l4.16-34.944a126.672 126.672 0 1 1 181.536-47.648" fill="#FFFFFF" ></path><path d="M612.512 551.04a99.632 99.632 0 0 0-68.224 25.6l12.544 15.536a77.152 77.152 0 0 1 55.744-22.4 76.336 76.336 0 0 1 57.6 24.448l14.96-13.28a99.2 99.2 0 0 0-72.624-29.904z m-17.872 84.128l17.296 17.728 18.896-17.728a24.368 24.368 0 0 0-36.192 0z" fill="#FFFFFF" ></path><path d="M569.76 606.64l10.368 13.856a48.944 48.944 0 0 1 66.32-0.512l12.336-12.048a67.44 67.44 0 0 0-89.008-1.312z" fill="#FFFFFF" ></path></symbol><symbol id="icon-xiangmu" viewBox="0 0 1024 1024"><path d="M808.137329 63.045739H211.308429c-40.523333 0-73.495513 32.944534-73.495512 73.467867v749.346858c0 40.523333 32.971155 73.495513 73.495512 73.495512h596.8289c40.523333 0 73.482202-32.972179 73.482202-73.495512V136.513606c0-40.523333-32.958869-73.467868-73.482202-73.467867z m17.443934 822.814725c0 9.631689-7.825556 17.457245-17.443934 17.457244H211.308429c-9.631689 0-17.457245-7.825556-17.457244-17.457244V136.513606c0-9.604044 7.825556-17.4296 17.457244-17.429599h596.8289c9.618379 0 17.443934 7.825556 17.443934 17.429599v749.346858z" fill="#3E3A39" ></path><path d="M718.539172 266.895164H448.568256c-15.472955 0-28.018622 12.532356-28.018622 28.019646s12.545667 28.019646 28.018622 28.019645h269.970916c15.472955 0 28.018622-12.532356 28.018622-28.019645s-12.545667-28.019646-28.018622-28.019646zM718.539172 485.849969H448.568256c-15.472955 0-28.018622 12.532356-28.018622 28.018622 0 15.487289 12.545667 28.019646 28.018622 28.019646h269.970916c15.472955 0 28.018622-12.532356 28.018622-28.019646s-12.545667-28.018622-28.018622-28.018622zM718.539172 699.440639H448.568256c-15.472955 0-28.018622 12.532356-28.018622 28.019645s12.545667 28.018622 28.018622 28.018622h269.970916c15.472955 0 28.018622-12.532356 28.018622-28.018622 0-15.487289-12.545667-28.019646-28.018622-28.019645z" fill="#3E3A39" ></path><path d="M321.933095 294.921977m-46.177228 0a46.177228 46.177228 0 1 0 92.354457 0 46.177228 46.177228 0 1 0-92.354457 0Z" fill="#3E3A39" ></path><path d="M321.933095 513.881901m-46.177228 0a46.177228 46.177228 0 1 0 92.354457 0 46.177228 46.177228 0 1 0-92.354457 0Z" fill="#3E3A39" ></path><path d="M321.933095 727.468476m-46.177228 0a46.177228 46.177228 0 1 0 92.354457 0 46.177228 46.177228 0 1 0-92.354457 0Z" fill="#3E3A39" ></path></symbol><symbol id="icon-shebei" viewBox="0 0 1024 1024"><path d="M234.666667 554.666667h384c12.8 0 21.333333 8.533333 21.333333 21.333333s-8.533333 21.333333-21.333333 21.333333h-384c-12.8 0-21.333333-8.533333-21.333334-21.333333s8.533333-21.333333 21.333334-21.333333zM213.333333 448c0 12.8 8.533333 21.333333 21.333334 21.333333h256c12.8 0 21.333333-8.533333 21.333333-21.333333s-8.533333-21.333333-21.333333-21.333333h-256c-12.8 0-21.333333 8.533333-21.333334 21.333333zM938.666667 469.333333v85.333334h-42.666667v85.333333h-42.666667v42.666667c0 46.933333-38.4 85.333333-85.333333 85.333333h-170.666667v42.666667h106.666667c12.8 0 21.333333 8.533333 21.333333 21.333333s-8.533333 21.333333-21.333333 21.333333h-469.333333c-12.8 0-21.333333-8.533333-21.333334-21.333333s8.533333-21.333333 21.333334-21.333333H341.333333v-42.666667H170.666667c-46.933333 0-85.333333-38.4-85.333334-85.333333V341.333333c0-46.933333 38.4-85.333333 85.333334-85.333333h42.666666c0-46.933333 38.4-85.333333 85.333334-85.333333h85.333333c46.933333 0 85.333333 38.4 85.333333 85.333333h298.666667c46.933333 0 85.333333 38.4 85.333333 85.333333v42.666667h42.666667v85.333333h42.666667z m-170.666667-170.666666h-341.333333V256c0-25.6-17.066667-42.666667-42.666667-42.666667h-85.333333c-25.6 0-42.666667 17.066667-42.666667 42.666667v42.666667H170.666667c-25.6 0-42.666667 17.066667-42.666667 42.666666v341.333334c0 25.6 17.066667 42.666667 42.666667 42.666666h597.333333V298.666667z" fill="" ></path></symbol></svg>',function(i){var t=(t=document.getElementsByTagName("script"))[t.length-1],e=t.getAttribute("data-injectcss"),t=t.getAttribute("data-disable-injectsvg");if(!t){var a,n,h,c,l,o=function(t,e){e.parentNode.insertBefore(t,e)};if(e&&!i.__iconfont__svg__cssinject__){i.__iconfont__svg__cssinject__=!0;try{document.write("<style>.svgfont {display: inline-block;width: 1em;height: 1em;fill: currentColor;vertical-align: -0.1em;font-size:16px;}</style>")}catch(t){console&&console.log(t)}}a=function(){var t,e=document.createElement("div");e.innerHTML=i._iconfont_svg_string_4427370,(e=e.getElementsByTagName("svg")[0])&&(e.setAttribute("aria-hidden","true"),e.style.position="absolute",e.style.width=0,e.style.height=0,e.style.overflow="hidden",e=e,(t=document.body).firstChild?o(e,t.firstChild):t.appendChild(e))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(a,0):(n=function(){document.removeEventListener("DOMContentLoaded",n,!1),a()},document.addEventListener("DOMContentLoaded",n,!1)):document.attachEvent&&(h=a,c=i.document,l=!1,s(),c.onreadystatechange=function(){"complete"==c.readyState&&(c.onreadystatechange=null,d())})}function d(){l||(l=!0,h())}function s(){try{c.documentElement.doScroll("left")}catch(t){return void setTimeout(s,50)}d()}}(window); \ No newline at end of file diff --git a/web/WebMvc/wwwroot/css/iot/iconfont.json b/web/WebMvc/wwwroot/css/iot/iconfont.json new file mode 100644 index 0000000..fc50752 --- /dev/null +++ b/web/WebMvc/wwwroot/css/iot/iconfont.json @@ -0,0 +1,37 @@ +{ + "id": "4427370", + "name": "IOT", + "font_family": "iconfont", + "css_prefix_text": "icon-", + "description": "", + "glyphs": [ + { + "icon_id": "4722206", + "name": "效率", + "font_class": "xiaoshuai", + "unicode": "e663", + "unicode_decimal": 58979 + }, + { + "icon_id": "22105955", + "name": "设备在线率", + "font_class": "shebeizaixianshuai", + "unicode": "e742", + "unicode_decimal": 59202 + }, + { + "icon_id": "1263354", + "name": "项目", + "font_class": "xiangmu", + "unicode": "e63d", + "unicode_decimal": 58941 + }, + { + "icon_id": "3282374", + "name": "设备", + "font_class": "shebei", + "unicode": "e63c", + "unicode_decimal": 58940 + } + ] +} diff --git a/web/WebMvc/wwwroot/css/iot/iconfont.ttf b/web/WebMvc/wwwroot/css/iot/iconfont.ttf new file mode 100644 index 0000000..b0b85c7 --- /dev/null +++ b/web/WebMvc/wwwroot/css/iot/iconfont.ttf diff --git a/web/WebMvc/wwwroot/css/iot/iconfont.woff b/web/WebMvc/wwwroot/css/iot/iconfont.woff new file mode 100644 index 0000000..e140d19 --- /dev/null +++ b/web/WebMvc/wwwroot/css/iot/iconfont.woff diff --git a/web/WebMvc/wwwroot/css/iot/iconfont.woff2 b/web/WebMvc/wwwroot/css/iot/iconfont.woff2 new file mode 100644 index 0000000..92cda5c --- /dev/null +++ b/web/WebMvc/wwwroot/css/iot/iconfont.woff2 diff --git a/web/WebMvc/wwwroot/js/index.js b/web/WebMvc/wwwroot/js/index.js index cf4192f..07ad780 100644 --- a/web/WebMvc/wwwroot/js/index.js +++ b/web/WebMvc/wwwroot/js/index.js @@ -1,10 +1,5 @@ var $, tab, sysDic = { data: null, method: null }; -var IdCard = document.getElementById("IdCard"), - canvas = document.createElement("canvas"), - btnTakeSnapshot = document.getElementById("btnTakeSnapshot"), - isSendFlag = false, - tabIndex = 0, - WebcamObj = null; + var timeout = null; Date.prototype.format = function (format) { var o = @@ -48,12 +43,6 @@ function Cancellation() { }); } -function handle() { - if (IdCard.value == "") return; - var value = `username=''&password=''&webcam=&idcard=${IdCard.value}`; - login.LoginMethod(value); -} - layui.config({ base: "/js/" }).use(['bodyTab', 'form', 'element', 'layer', 'jquery'], function () { @@ -160,18 +149,6 @@ layui.config({ } }); - //手机设备的简单适配 - var treeMobile = $('.site-tree-mobile'), - shadeMobile = $('.site-mobile-shade'); - - treeMobile.on('click', function () { - $('body').addClass('site-mobile'); - }); - - shadeMobile.on('click', function () { - $('body').removeClass('site-mobile'); - }); - // 添加新窗口 $("body").on("click", ".layui-nav .layui-nav-item a", function () { var thisInfo = $(this), @@ -286,16 +263,6 @@ layui.config({ e.preventDefault(); //Skip default behavior of the enter key } }); - - element.on("tab(loginWebcam)", function (data) { - tabIndex = data.index; - if (data.index === 0) { - login.initWebCam(); - } else if (data.index === 1) { - IdCard.focus(); - login.cancalCloseVideo(); - } - }); }); var qp = { @@ -450,144 +417,3 @@ setInterval(() => { infoTips.LogTips(); }, 15000); - - -//考勤记录 300000 -function WorkAttendanceLog() { - layer.open({ - title: "考勤记录", - area: ["900px", "600px"], - type: 2, - content: "/WorkAttendance/Index" - }); -}; - -//考勤功能 -function WorkAttendance() { - layer.open({ - title: "考勤", - area: ["800px", "600px"], - type: 1, - content: $('#clock'), - success: function () { - login.initWebCam(); - login.initEvents(); - login.initWebcamLogin(); - - }, - cancel: function () { - // 右上角关闭事件的逻辑 - login.cancalCloseVideo(); - } - }); -}; - -var login = { - initWebCam: () => { - Webcam.set({ - width: 420, - height: 440, - image_format: "jpeg", - jpeg_quality: 90 - }); - Webcam.attach("#webcam"); - WebcamObj = true; - }, - - //销毁摄像头 - cancalCloseVideo: () => { - Webcam.reset("#webcam"); - Webcam.reset(); - }, - //登入方法 - LoginMethod: (bodyValue) => { - isSendFlag = true; - var index = 0; - if (tabIndex != 0) index = layer.load(); - - fetch("/WorkAttendance/Clock", { - method: "post", - headers: new Headers({ - "Content-Type": "application/x-www-form-urlencoded" - }), - body: bodyValue - }).then(function (res) { - return res.json(); - }).then(function (data) { - isSendFlag = false; - document.getElementById("IdCard").value = ""; - var src; - if (data.Code === 200) { - src = "/mp3/成功.mp3"; - - layer.msg(data.Result.account + "用户,考勤成功 ", { icon: 6, shade: 0.4, time: 1000 }); - document.getElementById("loginMessage").innerHTML = data.Message; - - } else { - src = "/mp3/失败.mp3"; - document.getElementById("loginMessage").innerHTML = data.Message; - } - var mp3 = new Audio(src); - mp3.play(); - layer.close(index); - }).catch(function (error) { - isSendFlag = false; - if (layer != null) document.getElementById("loginMessage").innerHTML = "登入失败"; - }); - }, - - //自动刷脸登入 - initWebcamLogin: () => { - setInterval(() => { - if (WebcamObj == null) return; - if (isSendFlag) { - console.log("请求中 "); - return; - }; - if (tabIndex != 0) return; - var v = document.querySelector('#webcam video'); - if (v == null) return; - var ctx = canvas.getContext('2d'); - var height = v.videoHeight; - var width = v.videoWidth; - if (height == 0 || width == 0) return; - canvas.height = height; - canvas.width = width; - ctx.drawImage(v, 0, 0, width, height); - - var comp = ccv.detect_objects({ - "canvas": ccv.grayscale(ccv.pre(canvas)), - "cascade": cascade, - "interval": 5, - "min_neighbors": 1 - }); - if (comp.length > 0) { - btnTakeSnapshot.click(); - } - document.getElementById("ccvMessage").innerHTML = "检测图片结果: " + (comp.length ? '有人脸' : "没人脸"); - }, 6000); - }, - - //注册事件 - initEvents: () => { - //刷卡登入 - if (timeout != null) timeout = null; - IdCard.addEventListener('input', debounce(handle, 1000)) - - //拍照 - btnTakeSnapshot.addEventListener("click", function () { - if (WebcamObj == null) { - alert("请等待摄像启动完成后再拍照登入"); - return; - } - Webcam.snap(function (data_uri) { - if (data_uri == null) { - alert("请等待摄像启动完成后再拍照登入"); - return; - } - var value = `username=''&password=''&webcam=${data_uri}&idcard=`; - login.LoginMethod(value); - }); - }); - } -} diff --git a/web/WebMvc/wwwroot/productjs/configure/BaseProject.js b/web/WebMvc/wwwroot/productjs/configure/BaseProject.js index e5d9490..16de9ad 100644 --- a/web/WebMvc/wwwroot/productjs/configure/BaseProject.js +++ b/web/WebMvc/wwwroot/productjs/configure/BaseProject.js @@ -163,6 +163,8 @@ layui.config({ btnGetPoint: $("#btnGetPoint"), txtProjectAddress: $("#modifyForm form input[name=projectAddress]"), + btnCopyLonLat: document.querySelector("#btnCopyLonLat"), + //下拉框配置 selectOption: { @@ -230,6 +232,26 @@ layui.config({ initFrom() { sysU.initSelecteByEnum(app.data.selectOption); + }, + initCopy() { + app.data.btnCopyLonLat.addEventListener("click", function (event) { + $("#modifyForm form input[name=longitude]").focus(); + // 获取剪贴板中的文本数据 + navigator.clipboard.readText() + .then(text => { + debugger + const pattern = /^\d+(\.\d+)?,\d+(\.\d+)?$/; + if (!pattern.test(text)) { + layer.alert('经纬度复制的值错误,正确的是格式【x,x】x是数字!', { icon: sysU.config.iconoError, shadeClose: true, title: sysU.config.titleOpen }); + return; + } + var tempValue = text.split(","); + form.val("modifyForm", { longitude: tempValue[0], latitude: tempValue[1] }); + }) + .catch(err => { + layer.alert('无法读取剪贴板数据:' + err, { icon: sysU.config.iconoError, shadeClose: true, title: sysU.config.titleError }); + }); + }); } }, registerEvent: function () { @@ -240,6 +262,7 @@ layui.config({ init: function () { app.methods.initTable(); app.methods.initFrom(); + app.methods.initCopy(); app.registerEvent(); } };