初始化项目
This commit is contained in:
14
UI/Views/Shared/Error.cshtml
Normal file
14
UI/Views/Shared/Error.cshtml
Normal file
@@ -0,0 +1,14 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
<title>错误</title>
|
||||
</head>
|
||||
<body>
|
||||
<hgroup>
|
||||
<h1>错误。</h1>
|
||||
<h2>处理你的请求时出错。</h2>
|
||||
</hgroup>
|
||||
</body>
|
||||
</html>
|
||||
1
UI/Views/Shared/_Layout.cshtml
Normal file
1
UI/Views/Shared/_Layout.cshtml
Normal file
@@ -0,0 +1 @@
|
||||
@RenderBody()
|
||||
832
UI/Views/Shared/_LayoutDefaule.cshtml
Normal file
832
UI/Views/Shared/_LayoutDefaule.cshtml
Normal file
@@ -0,0 +1,832 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
<title>@ViewBag.Title</title>
|
||||
<!-- ???? Google ????: Source Sans Pro -->
|
||||
<!--<link rel="stylesheet" href="/Lib/dist/css/google.css?family=Source+Sans+Pro:300,400,400i,700&display=fallback">-->
|
||||
<!-- Font Awesome -->
|
||||
<link rel="stylesheet" href="/Lib/plugins/fontawesome-free/css/all.min.css">
|
||||
<!-- ??????? -->
|
||||
<!--<link rel="stylesheet" href="/Lib/dist/css/adminlte.min.css">-->
|
||||
<!-- jQuery -->
|
||||
<!--<script src="/Lib/plugins/jquery/jquery.min.js"></script>-->
|
||||
<!-- Bootstrap 4 -->
|
||||
<!--<script src="/Lib/plugins/bootstrap/js/bootstrap.bundle.min.js"></script>-->
|
||||
<!-- SweetAlert2 -->
|
||||
<!--<script src="/Lib/plugins/sweetalert2/sweetalert2.min.js"></script>-->
|
||||
<!-- Toastr -->
|
||||
<!--<link rel="stylesheet" href="/Lib/plugins/toastr/toastr.min.css">-->
|
||||
<!-- SweetAlert2 -->
|
||||
<!--<link rel="stylesheet" href="/Lib/plugins/sweetalert2-theme-bootstrap-4/bootstrap-4.min.css">-->
|
||||
<!-- Toastr -->
|
||||
<!--<link rel="stylesheet" href="/Lib/plugins/toastr/toastr.min.css">-->
|
||||
<!-- bs-custom-file-input -->
|
||||
<!--<script src="/Lib/plugins/bs-custom-file-input/bs-custom-file-input.min.js"></script>-->
|
||||
<!-- AdminLTE App -->
|
||||
<!--<script src="/Lib/dist/js/adminlte.min.js"></script>
|
||||
<script src="/Lib/plugins/datatables/jquery.dataTables.min.js"></script>
|
||||
<script src="/Lib/plugins/datatables-bs4/js/dataTables.bootstrap4.min.js"></script>-->
|
||||
@Styles.Render("~/Lib/plugins/pluginscss")
|
||||
@Styles.Render("~/Lib/dist/css/distcss")
|
||||
@Scripts.Render("~/bundles/clientfeaturesscripts")
|
||||
@RenderSection("scripts", required: false)
|
||||
<style>
|
||||
* {
|
||||
font-size: 14px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body class="hold-transition sidebar-mini layout-fixed">
|
||||
<!-- Site wrapper -->
|
||||
<div class="wrapper">
|
||||
<!-- 导航栏 -->
|
||||
<nav class="main-header navbar navbar-expand navbar-white navbar-light">
|
||||
<!-- 左侧导航栏链接 -->
|
||||
<ul class="navbar-nav">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" style="padding: 0 5px;display:initial;" data-widget="pushmenu" href="#" role="button"><i class="fas fa-bars"></i></a>
|
||||
<a class="nav-link" style="padding: 0 5px; display: initial; " href="/" role="button">首页</a>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="navbar-nav ml-auto">
|
||||
<!-- Navbar Search -->
|
||||
|
||||
<li class="nav-item" style="color:#999c9e;">
|
||||
<a href="javascript:window.history.back();">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-reply-fill" viewBox="0 0 16 16">
|
||||
<path d="M5.921 11.9 1.353 8.62a.719.719 0 0 1 0-1.238L5.921 4.1A.716.716 0 0 1 7 4.719V6c1.5 0 6 0 7 8-2.5-4.5-7-4-7-4v1.281c0 .56-.606.898-1.079.62z"></path>
|
||||
</svg>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item" style="color:#999c9e;">
|
||||
<a class="nav-link" href="#" role="button">欢迎您,<strong>@ViewBag.Umodel.Uid</strong></a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<span class="nav-link">
|
||||
@*<button onclick="Clear(this)" class="btn btn-info btn-xs" id="global_refreshall_button">
|
||||
@if (Services.Manager.GlobalTest.isInProcessing)
|
||||
{
|
||||
<span>同步中...</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span>同步数据</span>
|
||||
}
|
||||
</button>*@
|
||||
<button onclick="ClearAllCache(this)" class="btn btn-info btn-xs">清楚缓存</button>
|
||||
<button onclick="ClearAll(this)" class="btn btn-info btn-xs">同步数据</button>
|
||||
</span>
|
||||
<span>现在时间:
|
||||
@*最近更新时间:*@
|
||||
</span>
|
||||
<br />
|
||||
<span id="global_refreshall_button_time">
|
||||
|
||||
@DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
|
||||
@*@Services.Manager.SyncAllFromOutterDB.GlobalSyncLockTest.lastStartTime*@
|
||||
</span>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/Login/Logout">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-box-arrow-in-right" viewBox="0 0 16 16">
|
||||
<path fill-rule="evenodd" d="M6 3.5a.5.5 0 0 1 .5-.5h8a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5h-8a.5.5 0 0 1-.5-.5v-2a.5.5 0 0 0-1 0v2A1.5 1.5 0 0 0 6.5 14h8a1.5 1.5 0 0 0 1.5-1.5v-9A1.5 1.5 0 0 0 14.5 2h-8A1.5 1.5 0 0 0 5 3.5v2a.5.5 0 0 0 1 0v-2z"></path>
|
||||
<path fill-rule="evenodd" d="M11.854 8.354a.5.5 0 0 0 0-.708l-3-3a.5.5 0 1 0-.708.708L10.293 7.5H1.5a.5.5 0 0 0 0 1h8.793l-2.147 2.146a.5.5 0 0 0 .708.708l3-3z"></path>
|
||||
</svg>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<!-- /.navbar -->
|
||||
<!-- 主侧边栏容器 -->
|
||||
<aside class="main-sidebar sidebar-dark-primary elevation-4">
|
||||
<!-- 品牌 Logo -->
|
||||
<a href="#" class="link-black text-center">
|
||||
<img src="~/Lib/dist/img/logo.png" alt="AdminLTE Logo" style="max-width:80%;margin:0 10%" class="img-circle elevation-3">
|
||||
<p class="brand-text font-weight-light text-white" style="margin:10px 0 0 0 ;">宝来威权限管理系统</p>
|
||||
</a>
|
||||
<!-- Sidebar -->
|
||||
<div class="sidebar">
|
||||
<!-- Sidebar user (optional) -->
|
||||
<div class="user-panel mt-3 pb-3 mb-3 d-flex">
|
||||
<div class="image">
|
||||
<img data-src="/ImgServer/FileImage?url=@ViewBag.Umodel.HeadImg&&ftp=11" src="/Lib/dist/img/more.jpg" class="img-circle elevation-2" alt="用户头像">
|
||||
</div>
|
||||
<div class="info">
|
||||
<a href="#" class="d-block">@ViewBag.Umodel.Uid</a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- SidebarSearch Form -->
|
||||
<div class="form-inline">
|
||||
<div class="input-group" data-widget="sidebar-search">
|
||||
<input class="form-control form-control-sidebar" type="search" placeholder="搜索" aria-label="Search">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-sidebar">
|
||||
<i class="fas fa-search fa-fw"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 侧边栏菜单 -->
|
||||
<nav class="mt-2">
|
||||
<ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">
|
||||
<!-- 使用 .nav-icon 类添加图标,
|
||||
或使用 font-awesome 或其他任何图标字体库 -->
|
||||
<li class='nav-item '>
|
||||
<a href="/home/index" class="nav-link @(ViewBag.Select == 0 ? "active":"")">
|
||||
<i class="nav-icon fas fa-user"></i>
|
||||
<p>
|
||||
用户管理
|
||||
<span class="badge badge-info right">@ViewBag.Usersum</span>
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item @(ViewBag.Select == 1 ? "menu-open ":"")">
|
||||
<a class="nav-link">
|
||||
<i class="nav-icon fas fa-users"></i>
|
||||
<p>
|
||||
用户组管理
|
||||
<span class="badge badge-info right">@ViewBag.Orgs.Count</span>
|
||||
</p>
|
||||
</a>
|
||||
<ul class="nav nav-treeview">
|
||||
@foreach (var item in ViewBag.Orgs)
|
||||
{
|
||||
<li class="nav-item">
|
||||
<a href="/Org/Index/@item.Id" class="nav-link @(item.Id == ViewBag.SelectOrg ? "active" : "")">
|
||||
<span style="padding-left:15px" class="left badge">@item.Id</span>
|
||||
<p>@item.OrganizationName</p>
|
||||
if(item.IsDefault == 1)
|
||||
{
|
||||
<span class="right badge badge-danger">默</span>
|
||||
}
|
||||
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
<li>
|
||||
<a onclick="AddOrg()" class="nav-link">
|
||||
<span style="padding-left:15px;opacity:0" class="left badge"></span>
|
||||
<p style="padding-left:15px;">添加用户组</p>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-item @(ViewBag.Select == 2 ? "menu-open ":"")">
|
||||
<a class="nav-link">
|
||||
<i class="nav-icon fas fa-copy"></i>
|
||||
<p>
|
||||
应用管理
|
||||
<span class="badge badge-info right">@ViewBag.Apps.Count</span>
|
||||
</p>
|
||||
</a>
|
||||
<ul class="nav nav-treeview">
|
||||
@foreach (var item in ViewBag.Apps)
|
||||
{
|
||||
<li class="nav-item">
|
||||
<a href="/App/Index/@item.Id" class="nav-link @(item.Id == ViewBag.SelectApp ? "active":"") @(item.IsValid==1?"text-gray":"")">
|
||||
<span style="padding-left:15px" class="left badge">@item.Id</span>
|
||||
<p class=""> @item.AppName</p>
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
<li>
|
||||
<a onclick="AddApp()" class="nav-link">
|
||||
<p style="padding-left:15px;">添加应用</p>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-item @(ViewBag.Select == 3 ? "menu-open ":"")">
|
||||
<a class="nav-link">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-building" viewBox="0 0 16 16">
|
||||
<path fill-rule="evenodd" d="M14.763.075A.5.5 0 0 1 15 .5v15a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5V14h-1v1.5a.5.5 0 0 1-.5.5h-9a.5.5 0 0 1-.5-.5V10a.5.5 0 0 1 .342-.474L6 7.64V4.5a.5.5 0 0 1 .276-.447l8-4a.5.5 0 0 1 .487.022zM6 8.694 1 10.36V15h5V8.694zM7 15h2v-1.5a.5.5 0 0 1 .5-.5h2a.5.5 0 0 1 .5.5V15h2V1.309l-7 3.5V15z"></path>
|
||||
<path d="M2 11h1v1H2v-1zm2 0h1v1H4v-1zm-2 2h1v1H2v-1zm2 0h1v1H4v-1zm4-4h1v1H8V9zm2 0h1v1h-1V9zm-2 2h1v1H8v-1zm2 0h1v1h-1v-1zm2-2h1v1h-1V9zm0 2h1v1h-1v-1zM8 7h1v1H8V7zm2 0h1v1h-1V7zm2 0h1v1h-1V7zM8 5h1v1H8V5zm2 0h1v1h-1V5zm2 0h1v1h-1V5zm0-2h1v1h-1V3z"></path>
|
||||
</svg>
|
||||
<p>
|
||||
酒店组管理
|
||||
@for (int i = 0, j = 0; i < ViewBag.HoteldGroupsinfo.Count; i++)
|
||||
{
|
||||
j += ViewBag.HoteldGroupsinfo[i].Message ;
|
||||
if (i == ViewBag.HoteldGroupsinfo.Count - 1)
|
||||
{
|
||||
<span class="right badge badge-info">@j</span>
|
||||
}
|
||||
}
|
||||
</p>
|
||||
</a>
|
||||
<ul class="nav nav-treeview">
|
||||
@foreach (var item in ViewBag.HoteldGroups)
|
||||
{
|
||||
<li class="nav-item">
|
||||
<a href="/Hotel/Index/@item.Id" class="nav-link @(item.Id == ViewBag.SelHoteldGroup ? "active":"")">
|
||||
<span style="padding-left:15px" class="left badge">@item.Id</span>
|
||||
<p>@item.Name</p>
|
||||
@foreach (var items in ViewBag.HoteldGroupsinfo)
|
||||
{
|
||||
if (items.Status == item.Id)
|
||||
{
|
||||
<span class="right badge badge-info">@items.Message</span>
|
||||
}
|
||||
}
|
||||
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
</li>
|
||||
<li class='nav-item '>
|
||||
<a href="/log/Index" class="nav-link @(ViewBag.Select == 4 ? "active":"")">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-tools" viewBox="0 0 16 16">
|
||||
<path d="M1 0 0 1l2.2 3.081a1 1 0 0 0 .815.419h.07a1 1 0 0 1 .708.293l2.675 2.675-2.617 2.654A3.003 3.003 0 0 0 0 13a3 3 0 1 0 5.878-.851l2.654-2.617.968.968-.305.914a1 1 0 0 0 .242 1.023l3.356 3.356a1 1 0 0 0 1.414 0l1.586-1.586a1 1 0 0 0 0-1.414l-3.356-3.356a1 1 0 0 0-1.023-.242L10.5 9.5l-.96-.96 2.68-2.643A3.005 3.005 0 0 0 16 3c0-.269-.035-.53-.102-.777l-2.14 2.141L12 4l-.364-1.757L13.777.102a3 3 0 0 0-3.675 3.68L7.462 6.46 4.793 3.793a1 1 0 0 1-.293-.707v-.071a1 1 0 0 0-.419-.814L1 0zm9.646 10.646a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1-.708.708l-3-3a.5.5 0 0 1 0-.708zM3 11l.471.242.529.026.287.445.445.287.026.529L5 13l-.242.471-.026.529-.445.287-.287.445-.529.026L3 15l-.471-.242L2 14.732l-.287-.445L1.268 14l-.026-.529L1 13l.242-.471.026-.529.445-.287.287-.445.529-.026L3 11z"></path>
|
||||
</svg>
|
||||
<p>
|
||||
日志
|
||||
<span class="right badge badge-info">@ViewBag.logsum</span>
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<!-- /.sidebar-menu -->
|
||||
</div>
|
||||
<!-- /.sidebar -->
|
||||
</aside>
|
||||
<!-- Content Wrapper. 包含页面内容 -->
|
||||
<div class="content-wrapper">
|
||||
<section class="content" style="padding:0;">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-md-10">
|
||||
@RenderBody()
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<!-- /.content-wrapper -->
|
||||
<footer class="main-footer">
|
||||
<div class="float-right d-none d-sm-block">
|
||||
<b>版本</b> 1.0
|
||||
</div>
|
||||
<strong>Copyright © 2021 <a href="/">宝来威</a>.</strong> 保留所有权利。
|
||||
</footer>
|
||||
<!-- Control Sidebar -->
|
||||
<aside class="control-sidebar control-sidebar-dark">
|
||||
<!-- 控制侧边栏内容在这里 -->
|
||||
</aside>
|
||||
<!-- /.control-sidebar -->
|
||||
</div>
|
||||
<button data-toggle="modal" data-target="#modal-Addoeg" id="addOrgsbtn" style="display:none;"></button>
|
||||
<div class="modal fade" id="modal-Addoeg">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content ">
|
||||
<div class="modal-header" style="padding-top: 0; padding-bottom: 0;">
|
||||
<h5 class="modal-title" id="modal-title">添加用户组</h5>
|
||||
<button type="button" class="close " data-dismiss="modal" aria-label="Close" id="Addorgclosebtn">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body" style="padding-top: 0; padding-bottom: 0;">
|
||||
<div class="input-group input-group-sm " style="margin:5px 0px;">
|
||||
<span class="input-group-append">
|
||||
<button type="button" class="btn btn-flat text-red">名称</button>
|
||||
</span>
|
||||
<input type="text" onblur="CheckOrg(this)" placeholder="请输入名字" class="form-control" style="border:none;" id="orgname" />
|
||||
</div>
|
||||
<div class="input-group input-group-sm appshow " style="margin:5px 0px;">
|
||||
<span class="input-group-append">
|
||||
<button type="button" class="btn btn-flat ">类型</button>
|
||||
</span>
|
||||
<select class="form-control AppType">
|
||||
<option value="0">web应用</option>
|
||||
<option value="0">桌面程序</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-group input-group-sm appshow" style="margin:5px 0px;">
|
||||
<span class="input-group-append">
|
||||
<button type="button" class="btn btn-flat ">版本</button>
|
||||
</span>
|
||||
<input type="text" placeholder="1.0" class="form-control Version " style="border:none;" />
|
||||
</div>
|
||||
<div class="input-group input-group-sm" style="margin:5px 0px;">
|
||||
<span class="input-group-append">
|
||||
<button type="button" class="btn btn-flat ">发行日期</button>
|
||||
</span>
|
||||
<input type="text" placeholder="@DateTime.Now.ToString("yyyy-MM-d")" class="form-control ReleaseDate" style="border:none;" />
|
||||
</div>
|
||||
<div class="input-group input-group-sm" style="margin:5px 0px;">
|
||||
<span class="input-group-append">
|
||||
<button type="button" class="btn btn-flat">描述</button>
|
||||
</span>
|
||||
<input type="text" placeholder="描述" class="form-control " style="border:none;" id="Desc" />
|
||||
</div>
|
||||
<div class="input-group input-group-sm appshow" style="margin:5px 0px;">
|
||||
<span class="input-group-append">
|
||||
<button type="button" class="btn btn-flat">网址</button>
|
||||
</span>
|
||||
<input type="text" placeholder="网址" class="form-control WebSite" style="border:none;" />
|
||||
</div>
|
||||
<div class="input-group input-group-sm appshow" style="margin:5px 0px;">
|
||||
<span class="input-group-append">
|
||||
<button type="button" class="btn btn-flat">图标</button>
|
||||
</span>
|
||||
<div class="custom-file">
|
||||
<input type="file" onchange="uploadimgicon()" class=" custom-file-input" accept="image/*" id="exampleInputFile">
|
||||
<label class="custom-file-label" for="exampleInputFile"></label>
|
||||
</div>
|
||||
<div class="input-group-append">
|
||||
<span class="input-group-text bg-success" id="btnup" onclick="uploadimgicon(1)">上传</span>
|
||||
</div>
|
||||
</div>
|
||||
<div style=" height: 85px; overflow: hidden;">
|
||||
<img class="image" style="width: 85px;padding:2px;display:none;" id="imagesapp" src="" data-src="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer justify-content-between" style="padding-top: 0; padding-bottom: 0;">
|
||||
<button type="button" class="btn btn-danger btn-xs" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-success btn-xs" id="ResAddorgbtn" disabled onclick="ResAddorg()">确定添加</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
let appicon = "";
|
||||
//app图标检测
|
||||
function uploadimgicon(type) {
|
||||
let files = $("#exampleInputFile").prop("files");
|
||||
if (files.length <= 0)
|
||||
return;
|
||||
$("#exampleInputFile").closest(".input-group").find("label").html(files[0].name);
|
||||
let img = new FileReader();
|
||||
img.readAsDataURL(files[0])
|
||||
img.onload = function () {
|
||||
let imgdata = this.result
|
||||
$("#imagesapp").attr('src', imgdata).show()
|
||||
}
|
||||
uploadicon(type);
|
||||
}
|
||||
//app图标上传
|
||||
function uploadicon(type) {
|
||||
if (type != 1)
|
||||
return;
|
||||
let file = $('#exampleInputFile')[0].files[0];
|
||||
let name = $("#exampleInputFile").attr('data-old');
|
||||
if (!file) {
|
||||
error('无文件!')
|
||||
return;
|
||||
}
|
||||
if (name == file.name) {
|
||||
error('文件已上传!')
|
||||
return;
|
||||
}
|
||||
|
||||
if ((file.size/1024) > (1024 * 1)) {
|
||||
error("图片大小不得超过4M");
|
||||
return;
|
||||
}
|
||||
//let blob = dataURLtoFile(imgBase, 'image/jpeg');
|
||||
var formData = new FormData() //创建一个forData
|
||||
formData.append('img', file) //把file添加进去 name命名为img
|
||||
$.ajax({
|
||||
url: "/ImgServer/UpdateIcon",
|
||||
data: formData,
|
||||
type: "POST",
|
||||
async: false,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
success: function (data) {
|
||||
//成功\
|
||||
if (data == "") {
|
||||
error("上传失败!");
|
||||
return;
|
||||
}
|
||||
$("#exampleInputFile").attr('data-old', file.name);
|
||||
success("上传成功!")
|
||||
appicon = data;
|
||||
setTimeout(() => {
|
||||
$("#imagesapp").attr('src', "/ImgServer/FileImage?ftp=app&&url=" + data).show()
|
||||
},100);
|
||||
},
|
||||
error: function () {
|
||||
error("上传失败!");
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
$(
|
||||
function () {
|
||||
BaseDataInit()
|
||||
}
|
||||
);
|
||||
function BaseDataInit() {
|
||||
BaseData = JSON.parse($("#BaseData").val());
|
||||
BaseDataGroups = JSON.parse($("#BaseDataGroups").val());
|
||||
let resdata = resback(BaseDataGroups, BaseData)
|
||||
$("#BaseDataGroups").remove()
|
||||
$("#BaseData").remove()
|
||||
$("#rightcard").html("");
|
||||
$("#rightcard").html(resdata);
|
||||
}
|
||||
//酒店组数据
|
||||
let BaseDataGroups = [];
|
||||
//酒店数据
|
||||
let BaseData = [];
|
||||
//酒店选择
|
||||
let checkData = [];
|
||||
let timer;
|
||||
function ChecK(data, Group, that) {
|
||||
debugger
|
||||
//父亲 节点的单选按钮
|
||||
let biggroup = $(that).closest(".nav").closest(".card").children(".card-header").find(".form-check-input");
|
||||
//获取兄弟级别组
|
||||
let checklist = $(that).closest(".nav").children(".nav-item").children(".card").children(".card-header").find(".form-check-input");
|
||||
let okchecked = 0;
|
||||
//验证兄弟组
|
||||
for (var i = 0; i < checklist.length; i++) {
|
||||
if (!$(checklist[i]).prop("checked")) {
|
||||
okchecked++;
|
||||
};
|
||||
}
|
||||
if (okchecked == 0) {
|
||||
//$(biggroup).children(".card-header").find(".form-check-input").prop("checked", true)
|
||||
//获取兄弟级别 酒店
|
||||
checklist = $(that).closest(".nav").children(".nav-item").children(".nav-link").find(".form-check-input")
|
||||
for (var i = 0; i < checklist.length; i++) {
|
||||
if (!$(checklist[i]).prop("checked")) {
|
||||
okchecked++;
|
||||
};
|
||||
}
|
||||
}
|
||||
if (data != '0' && Group == '0') {
|
||||
if ($(that).prop("checked")) {
|
||||
debugger
|
||||
if (checkData.indexOf(data) < 0)
|
||||
checkData.push(data);
|
||||
if (okchecked == 0) {
|
||||
//如何兄弟酒店和酒店组都选中就全勾选父元素
|
||||
$(biggroup).prop("checked", true)
|
||||
$(biggroup).change();
|
||||
}
|
||||
}
|
||||
else {
|
||||
checkData.splice(jQuery.inArray(data, checkData), 1);
|
||||
$(biggroup).prop("checked", false)
|
||||
$(biggroup).change();
|
||||
}
|
||||
}
|
||||
function fincinput() {
|
||||
checkData = [];
|
||||
let s = $("#rightcard").find(".nav-link").children(".form-check").children(".form-check-input");
|
||||
for (var i = 0; i < s.length; i++) {
|
||||
let id = $(s.get(i)).attr("data-id");
|
||||
if ($(s.get(i)).prop("checked")) {
|
||||
if (checkData.indexOf(id) < 0) {
|
||||
checkData.push(id)
|
||||
}
|
||||
else {
|
||||
checkData.splice(checkData.indexOf(id), 1)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($(that).prop("checked")) {
|
||||
if ((data == '0' && Group != '0')) {
|
||||
////本身还有他的子都会选中
|
||||
$(that).closest(".card").find(".form-check-input").prop("checked", $(that).prop("checked"));
|
||||
}
|
||||
if (okchecked == 0) {
|
||||
//如何兄弟酒店和酒店组都选中就全勾选父元素
|
||||
$(biggroup).prop("checked", true)
|
||||
$(biggroup).change();
|
||||
}
|
||||
}
|
||||
else {
|
||||
$(biggroup).prop("checked", $(that).prop("checked"));
|
||||
$(biggroup).change();
|
||||
//判断是模拟事件还是真实点击事件
|
||||
if ($(that).attr("data-on")==1) {
|
||||
//真实点击事件
|
||||
$(that).closest(".card").find(".form-check-input").prop("checked", $(that).prop("checked"));
|
||||
}
|
||||
}
|
||||
$(that).attr("data-on", "0")
|
||||
clearTimeout(timer);
|
||||
timer = null;
|
||||
timer = setTimeout(
|
||||
function () {
|
||||
fincinput()
|
||||
Add(aau ? null : aau, checkData);
|
||||
},500
|
||||
)
|
||||
}
|
||||
function Clickdataon(that) {
|
||||
$(that).attr("data-on", "1");
|
||||
}
|
||||
function resback(BaseDataGroups, BaseData, id = 1) {
|
||||
let res = $("#rightcard").html();
|
||||
let resli = '';
|
||||
let li = `<li class="nav-item" style="padding:10.5px 17.5px;">
|
||||
<a href="#" class="nav-link">
|
||||
<div class="form-check">
|
||||
<input {{disabled}} data-id ="{{data-id}}" onchange = "ChecK('{{id}}',0,this)" class="form-check-input" type="checkbox">
|
||||
<label class="form-check-label">{{Name}}</label>
|
||||
</div>
|
||||
</a>
|
||||
</li>`;
|
||||
BaseDataGroups.forEach(
|
||||
x => {
|
||||
if (x.Id != id) { return; }
|
||||
res = res.replace("{{card-title}}", x.Name).replace("{{id}}", x.Id);
|
||||
BaseData.forEach(
|
||||
y => {
|
||||
if (y[0].GroupId == x.Id) {
|
||||
y.forEach(
|
||||
z => {
|
||||
if (z.IsApprove == 0)
|
||||
resli += li.replace("{{Name}}", z.Name).replace("{{id}}", x.Id).replace('{{disabled}}', 'disabled').replace("{{data-id}}", z.Id);
|
||||
else
|
||||
resli += li.replace("{{Name}}", z.Name).replace("{{id}}", x.Id).replace("{{data-id}}", z.Id);
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
)
|
||||
BaseDataGroups.forEach(
|
||||
a => {
|
||||
if (a.ParentId == x.Id) {
|
||||
resli += li.replace(`<a href="#" class="nav-link">
|
||||
<div class="form-check">
|
||||
<input {{disabled}} data-id ="{{data-id}}" onchange = "ChecK('{{id}}',0,this)" class="form-check-input" type="checkbox">
|
||||
<label class="form-check-label">{{Name}}</label>
|
||||
</div>
|
||||
</a>`, resback(BaseDataGroups, BaseData, a.Id));
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
}
|
||||
)
|
||||
return res.replace("{{Li}}", resli)
|
||||
}
|
||||
//指定酒店选中
|
||||
function selfincinput(check) {
|
||||
//checkData = [];
|
||||
let s = $("#rightcard").find(".nav-link").children(".form-check").children(".form-check-input");
|
||||
for (var i = 0; i < s.length; i++) {
|
||||
let id = $(s.get(i)).attr("data-id");
|
||||
if (check.indexOf(Number.parseInt(id)) >= 0) {
|
||||
$(s.get(i)).prop("checked", true);
|
||||
if (checkData.indexOf(Number.parseInt(id)) < 0) {
|
||||
checkData.push(Number.parseInt(id))
|
||||
}
|
||||
//else {
|
||||
// checkData.splice(checkData.indexOf(Number.parseInt(id)), 1)
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
//清除redis缓存
|
||||
function Clear(that) {
|
||||
$(that).removeClass("btn-info");
|
||||
$(that).addClass("btn-danger");
|
||||
$(that).html('<span>同步中...</span>');
|
||||
$.post("/Api/Clear", (X) => {
|
||||
if (X.Status != 200)
|
||||
error(X.Message)
|
||||
else
|
||||
success("同步成功!");
|
||||
$(that).removeClass("btn-danger");
|
||||
$(that).addClass("btn-info");
|
||||
$(that).html('<span>同步数据</span>');
|
||||
});
|
||||
}
|
||||
//同步并清除redis缓存
|
||||
function ClearAll(that) {
|
||||
$(that).removeClass("btn-info");
|
||||
$(that).addClass("btn-danger");
|
||||
$(that).html('<span>同步中...</span>');
|
||||
$.post("/OuterSyncApi/SyncData", { Pwd:"fs%sd"}, (X) => {
|
||||
if (X.Status == true)
|
||||
error(X.Message)
|
||||
else
|
||||
success("同步成功!");
|
||||
$(that).removeClass("btn-danger");
|
||||
$(that).addClass("btn-info");
|
||||
$(that).html('<span>同步数据</span>');
|
||||
});
|
||||
}
|
||||
//清除redis缓存
|
||||
function ClearAllCache(that) {
|
||||
$(that).removeClass("btn-info");
|
||||
$(that).addClass("btn-danger");
|
||||
$(that).html('<span>清除...</span>');
|
||||
$.post("/Api/ClearCache", (X) => {
|
||||
if (X.Status != 200)
|
||||
error(X.Message)
|
||||
else
|
||||
success("同步成功!");
|
||||
$(that).removeClass("btn-danger");
|
||||
$(that).addClass("btn-info");
|
||||
$(that).html('<span>清楚缓存</span>');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
//添加用户组
|
||||
function AddOrg() {
|
||||
$("#modal-title").html("添加用户组");
|
||||
$(".appshow").hide();
|
||||
$("#addOrgsbtn").click();
|
||||
}
|
||||
function AddApp() {
|
||||
$("#modal-title").html("添加应用");
|
||||
$(".appshow").show();
|
||||
$("#addOrgsbtn").click();
|
||||
}
|
||||
let orgnameok = 0;
|
||||
function ResAddorg() {
|
||||
let types = 0
|
||||
let str = $("#modal-title").html();
|
||||
if (str != "添加用户组")
|
||||
types = 1;
|
||||
let ok = 0;
|
||||
if (orgnameok == 100)
|
||||
error("名字不可用");
|
||||
else
|
||||
if (orgnameok == 0)
|
||||
info("正检测,...")
|
||||
else
|
||||
ok = 200;
|
||||
if (ok != 200)
|
||||
return;
|
||||
$.post("/Api/AddOrgApp", {
|
||||
appicon: appicon,
|
||||
Name: $("#orgname").val(),
|
||||
Desc: $("#Desc").val(),
|
||||
Type: types,
|
||||
Version: $('.Version').val(),
|
||||
ReleaseDate: $('.ReleaseDate').val(),
|
||||
AppType: $('.AppType').val(),
|
||||
WebSite: $('.WebSite').val()
|
||||
}, res => {
|
||||
if (res.Status == 200 && res.Data > 0) {
|
||||
$("#orgname").val("");
|
||||
$("#Desc").val("")
|
||||
if (types == 0)
|
||||
location.href = "/Org/Index/" + res.Data;
|
||||
else
|
||||
location.href = "/App/Index/" + res.Data;
|
||||
}
|
||||
else {
|
||||
error(res.Message);
|
||||
}
|
||||
})
|
||||
$("#Addorgclosebtn").click();
|
||||
}
|
||||
function CheckOrg(that) {
|
||||
if ($(that).val() == "")
|
||||
return;
|
||||
orgnameok = 0;
|
||||
$("#ResAddorgbtn").attr("disabled", "disabled");
|
||||
let types = 0
|
||||
let str = $("#modal-title").html();
|
||||
if (str != "添加用户组")
|
||||
types = 1;
|
||||
$.post("/Api/CheckOrgApp", { Name: $(that).val(), Type: types }, res => {
|
||||
if (res.Status == 200) {
|
||||
orgnameok = 200
|
||||
$("#ResAddorgbtn").removeAttr("disabled")
|
||||
}
|
||||
else {
|
||||
orgnameok = 100;
|
||||
error("名字重复");
|
||||
}
|
||||
})
|
||||
}
|
||||
//消息
|
||||
var Toast = Swal.mixin({
|
||||
toast: true,
|
||||
position: 'center',
|
||||
showConfirmButton: false,
|
||||
timer: 1500
|
||||
});
|
||||
function error(text) {
|
||||
fire('error', text);
|
||||
}
|
||||
function question(text) {
|
||||
fire('question', text);
|
||||
}
|
||||
function warning(text) {
|
||||
fire('warning', text);
|
||||
}
|
||||
function success(text) {
|
||||
fire('success', text);
|
||||
}
|
||||
function info(text) {
|
||||
fire('info', text);
|
||||
}
|
||||
function fire(icons, text) {
|
||||
Toast.fire({
|
||||
icon: icons,
|
||||
title: text
|
||||
})
|
||||
}
|
||||
//时间戳方式
|
||||
function Gotimestamp(time, sfm = false) {
|
||||
time = time.toUpperCase()
|
||||
if (time.indexOf("T") >= 0 && time.indexOf("/DATE(")<0) {
|
||||
return time.split("T")[0];
|
||||
}
|
||||
time = Number(time.replace("/DATE(", "").replace(")/", ""));
|
||||
var now = new Date(time),
|
||||
y = now.getFullYear(),
|
||||
m = now.getMonth() + 1,
|
||||
d = now.getDate();
|
||||
let h = now.getHours(); // 获取当前小时数(0-23)
|
||||
let mm = now.getMinutes(); // 获取当前分钟数(0-59)
|
||||
let s = now.getSeconds();// 获取当前秒数(0-59)
|
||||
let res = "" + y + "-" + (m < 10 ? "0" + m : m) + "-" + (d < 10 ? "0" + d : d);
|
||||
if (sfm) {
|
||||
return res + " " + (h < 10 ? "0" + h : h) + ":" + (mm < 10 ? "0" + mm : mm) + ":" + (s < 10 ? "0" + s : s)
|
||||
}
|
||||
return res
|
||||
//+ " " + now.toTimeString().substr(0, 8);
|
||||
}
|
||||
let p;
|
||||
function AddColor(that) {
|
||||
//p = $(that).find("button");
|
||||
//$(p).click(function (event) {
|
||||
//event.stopPropagation(); // 阻止事件冒泡
|
||||
//});
|
||||
//$(p[0]).click();
|
||||
that = $(that).closest(".card-header");
|
||||
if ($(that).hasClass("text-blue"))
|
||||
$(that).removeClass("text-blue");
|
||||
else
|
||||
$(that).addClass("text-blue");
|
||||
}
|
||||
|
||||
|
||||
//周期性刷新按钮状态
|
||||
function refreshSyncButtonState() {
|
||||
let domRef = $("#global_refreshall_button");
|
||||
let domTimeRef = $("#global_refreshall_button_time");
|
||||
$.post("/Api/GetRunSyncState", (X) => {
|
||||
console.log(X);
|
||||
if (X.isBusying == true) {
|
||||
domRef.html('<span>同步中...</span>');
|
||||
domRef.removeClass("btn-info");
|
||||
domRef.addClass("btn-danger");
|
||||
}
|
||||
else {
|
||||
domRef.html('<span>同步数据</span>');
|
||||
domRef.removeClass("btn-danger");
|
||||
domRef.addClass("btn-info");
|
||||
}
|
||||
domTimeRef.html(X.strLastTm);
|
||||
|
||||
});
|
||||
};
|
||||
//window.setInterval(refreshSyncButtonState, 10 * 1000);
|
||||
|
||||
</script>
|
||||
@*用户组用户权限设置生效*@
|
||||
|
||||
<aside class="control-sidebar control-sidebar-light" style="overflow-y: scroll;" id="rightcard">
|
||||
<!-- 控制侧边栏内容在这里 -->
|
||||
<div class="card collapsed-card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" data-on="0" onclick="Clickdataon(this)" onchange="ChecK(0, '{{id}}', this)" type="checkbox">
|
||||
<label class="form-check-label">{{card-title}}</label>
|
||||
</div>
|
||||
</h3>
|
||||
<div class="card-tools">
|
||||
<button type="button" class="btn btn-tool" onclick="AddColor(this)" data-card-widget="collapse">
|
||||
<i class=" fas fa-plus "></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body p-0">
|
||||
<ul class="nav nav-pills flex-column">
|
||||
{{Li}}
|
||||
</ul>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
</div>
|
||||
</aside>
|
||||
<input value="@ViewBag.BaseDataGroups" type="hidden" id="BaseDataGroups" />
|
||||
<input value="@ViewBag.BaseData" type="hidden" id="BaseData" />
|
||||
<script src="~/Scripts/loadImage.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
66
UI/Views/Shared/_LayoutLoginfo.cshtml
Normal file
66
UI/Views/Shared/_LayoutLoginfo.cshtml
Normal file
@@ -0,0 +1,66 @@
|
||||
<!DOCTYPE html>
|
||||
<html style="height: 100%; width: 100%;overflow-y:scroll;">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
<title>@ViewBag.Title</title>
|
||||
<!-- Toastr -->
|
||||
<link rel="stylesheet" href="/Lib/plugins/toastr/toastr.min.css">
|
||||
<!-- <20><><EFBFBD><EFBFBD> Google <20><><EFBFBD><EFBFBD>: Source Sans Pro -->
|
||||
<link rel="stylesheet" href="/Lib/dist/css/google.css?family=Source+Sans+Pro:300,400,400i,700&display=fallback">
|
||||
<!-- Font Awesome -->
|
||||
<link rel="stylesheet" href="/Lib/plugins/fontawesome-free/css/all.min.css">
|
||||
<!-- SweetAlert2 -->
|
||||
<script src="/Lib/plugins/sweetalert2/sweetalert2.min.js"></script>
|
||||
<!-- <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ -->
|
||||
<link rel="stylesheet" href="/Lib/dist/css/adminlte.min.css">
|
||||
<!-- Toastr -->
|
||||
<link rel="stylesheet" href="/Lib/plugins/toastr/toastr.min.css">
|
||||
<!-- jQuery -->
|
||||
<script src="/Lib/plugins/jquery/jquery.min.js"></script>
|
||||
<!-- Bootstrap 4 -->
|
||||
<script src="/Lib/plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
|
||||
<!-- bs-custom-file-input -->
|
||||
<script src="/Lib/plugins/bs-custom-file-input/bs-custom-file-input.min.js"></script>
|
||||
<!-- AdminLTE App -->
|
||||
<script src="/Lib/dist/js/adminlte.min.js"></script>
|
||||
<!-- SweetAlert2 -->
|
||||
<link rel="stylesheet" href="/Lib/plugins/sweetalert2-theme-bootstrap-4/bootstrap-4.min.css">
|
||||
<!-- Toastr -->
|
||||
<link rel="stylesheet" href="/Lib/plugins/toastr/toastr.min.css">
|
||||
</head>
|
||||
<body style="height:100%;width:100%">
|
||||
@RenderBody()
|
||||
<script>
|
||||
//消息
|
||||
var Toast = Swal.mixin({
|
||||
toast: true,
|
||||
position: 'center',
|
||||
showConfirmButton: false,
|
||||
timer: 3000
|
||||
});
|
||||
function error(text) {
|
||||
fire('error', text);
|
||||
}
|
||||
function question(text) {
|
||||
fire('question', text);
|
||||
}
|
||||
function warning(text) {
|
||||
fire('warning', text);
|
||||
}
|
||||
function success(text) {
|
||||
fire('success', text);
|
||||
}
|
||||
function info(text) {
|
||||
fire('info', text);
|
||||
}
|
||||
function fire(icons, text) {
|
||||
Toast.fire({
|
||||
icon: icons,
|
||||
title: text
|
||||
})
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user