Index.cshtml 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486
  1. @using MySystem.BsModels;
  2. @{
  3. List<RightDic> RightList = ViewBag.RightList as List<RightDic>;
  4. List<RightDic> menus = ViewBag.menus as List<RightDic>;
  5. string RightInfo = ViewBag.RightInfo as string;
  6. string SysUserName = ViewBag.SysUserName as string;
  7. string MyTaskCount = ViewBag.MyTaskCount as string;
  8. string Role = ViewBag.Role as string;
  9. }
  10. <!DOCTYPE html>
  11. <html>
  12. <head>
  13. <meta charset="utf-8">
  14. <title>创业帮后台管理系统</title>
  15. <meta name="renderer" content="webkit">
  16. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  17. <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  18. <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
  19. <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
  20. <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
  21. <script>/^http(s*):\/\//.test(location.href) || alert('请先部署到服务器下再访问');</script>
  22. <style>
  23. .layui-form-select dl dd{
  24. color: #000 !important;
  25. }
  26. </style>
  27. </head>
  28. <body class="layui-layout-body">
  29. <div id="LAY_app">
  30. <div class="layui-layout layui-layout-admin">
  31. <div class="layui-header">
  32. <!-- 头部区域 -->
  33. <ul class="layui-nav layui-layout-left">
  34. <li class="layui-nav-item layadmin-flexible" lay-unselect>
  35. <a href="javascript:;" layadmin-event="flexible" title="侧边伸缩">
  36. <i class="layui-icon layui-icon-shrink-right" id="LAY_app_flexible"></i>
  37. </a>
  38. </li>
  39. <li class="layui-nav-item layui-hide-xs" lay-unselect>
  40. <a href="/" target="_blank" title="前台">
  41. <i class="layui-icon layui-icon-website"></i>
  42. </a>
  43. </li>
  44. <li class="layui-nav-item" lay-unselect>
  45. <a href="javascript:;" layadmin-event="refresh" title="刷新">
  46. <i class="layui-icon layui-icon-refresh-3"></i>
  47. </a>
  48. </li>
  49. <li class="layui-nav-item" lay-unselect>
  50. <div class="layui-form" style="padding-top: 5px;">
  51. <select name="menusearch" lay-search lay-filter="SearchMenu">
  52. <option value="">搜索快捷菜单</option>
  53. @foreach(RightDic sub in menus)
  54. {
  55. if (RightInfo.Contains("," + sub.Id + ","))
  56. {
  57. string url = sub.Url;
  58. if (url.Contains("?"))
  59. {
  60. url += "&right=" + sub.Id;
  61. }
  62. else
  63. {
  64. url += "?right=" + sub.Id;
  65. }
  66. <option value="@(url)#@(sub.Name)">@sub.Name</option>
  67. }
  68. }
  69. </select>
  70. </div>
  71. </li>
  72. </ul>
  73. <ul class="layui-nav layui-layout-left">
  74. </ul>
  75. <ul class="layui-nav layui-layout-right" lay-filter="layadmin-layout-right">
  76. @*<li class="layui-nav-item" lay-unselect>
  77. <a id="TaskFlowBtn" lay-href="/Admin/TaskFlowDistribute/Index" lay-text="待处理任务">
  78. <i class="layui-icon layui-icon-notice"></i>
  79. @if(MyTaskCount != "0")
  80. {
  81. <span class="layui-badge-dot"></span>
  82. }
  83. </a>
  84. </li>
  85. <li class="layui-nav-item layui-hide-xs" lay-unselect>
  86. <a href="javascript:;" layadmin-event="theme">
  87. <i class="layui-icon layui-icon-theme"></i>
  88. </a>
  89. </li>
  90. <li class="layui-nav-item layui-hide-xs" lay-unselect>
  91. <a href="javascript:;" layadmin-event="note">
  92. <i class="layui-icon layui-icon-note"></i>
  93. </a>
  94. </li>*@
  95. <li class="layui-nav-item layui-hide-xs" lay-unselect>
  96. <a href="javascript:;" layadmin-event="fullscreen">
  97. <i class="layui-icon layui-icon-screen-full"></i>
  98. </a>
  99. </li>
  100. <li class="layui-nav-item" lay-unselect>
  101. <a href="javascript:;">
  102. <cite>@ViewBag.SysRealName</cite>
  103. </a>
  104. <dl class="layui-nav-child">
  105. <dd><a lay-href="/Admin/Home/AdminInfo">个人资料</a></dd>
  106. <dd><a lay-href="/Admin/Home/LoginPassword">修改密码</a></dd>
  107. <hr>
  108. <dd style="text-align: center;"><a onclick="quit()">退出</a></dd>
  109. </dl>
  110. </li>
  111. <li class="layui-nav-item layui-hide-xs" lay-unselect>
  112. <a href="javascript:;" layadmin-event="about"><i class="layui-icon layui-icon-more-vertical"></i></a>
  113. </li>
  114. <li class="layui-nav-item layui-show-xs-inline-block layui-hide-sm" lay-unselect>
  115. <a href="javascript:;" layadmin-event="more"><i class="layui-icon layui-icon-more-vertical"></i></a>
  116. </li>
  117. </ul>
  118. </div>
  119. <!-- 侧边菜单 -->
  120. <div class="layui-side layui-side-menu">
  121. <div class="layui-side-scroll">
  122. <div class="layui-logo" lay-href="/Admin/Home/Main">
  123. <span>创业帮</span>
  124. </div>
  125. <ul class="layui-nav layui-nav-tree" lay-shrink="all" id="LAY-system-side-menu" lay-filter="layadmin-system-side-menu">
  126. <li data-name="get" class="layui-nav-item layui-nav-itemed layui-this">
  127. <a href="javascript:;" lay-href="/Admin/Home/Main" lay-tips="控制台" lay-direction="2">
  128. <i class="layui-icon layui-icon-auz"></i>
  129. <cite>控制台</cite>
  130. </a>
  131. </li>
  132. @foreach (RightDic sub1 in RightList.Where(m => m.RightLevel == 1).OrderByDescending(m => m.Sort).ThenBy(m => m.Id).ToList())
  133. {
  134. if (RightInfo.Contains("," + sub1.Id + ","))
  135. {
  136. string IdString = sub1.Id + "_";
  137. List<RightDic> children1 = RightList.Where(m => m.RightLevel == 2 && m.Id.StartsWith(IdString)).OrderByDescending(m => m.Sort).ThenBy(m => m.Id).ToList();
  138. <li data-name="component" class="layui-nav-item">
  139. @if (children1.Count > 0)
  140. {
  141. <a href="javascript:;" lay-tips="@sub1.Name" title="@sub1.Name" lay-direction="2">
  142. <i class="layui-icon @(string.IsNullOrEmpty(sub1.Icon) ? "layui-icon-component" : sub1.Icon)"></i>
  143. <cite>@sub1.Name</cite>
  144. </a>
  145. <dl class="layui-nav-child">
  146. @foreach (RightDic sub2 in children1)
  147. {
  148. if (RightInfo.Contains("," + sub2.Id + ","))
  149. {
  150. IdString = sub2.Id + "_";
  151. List<RightDic> children2 = RightList.Where(m => m.RightLevel == 3 && m.Id.StartsWith(IdString)).OrderByDescending(m => m.Sort).ThenBy(m => m.Id).ToList();
  152. <dd data-name="grid">
  153. @if (children2.Count > 0)
  154. {
  155. <a href="javascript:;" title="@sub2.Name">@sub2.Name</a>
  156. <dl class="layui-nav-child">
  157. @foreach (RightDic sub3 in children2)
  158. {
  159. if (RightInfo.Contains("," + sub3.Id + ","))
  160. {
  161. string url = sub3.Url;
  162. if (url.Contains("?"))
  163. {
  164. url += "&right=" + sub3.Id;
  165. }
  166. else
  167. {
  168. url += "?right=" + sub3.Id;
  169. }
  170. <dd data-name="list"><a lay-href="@url" title="@sub3.Name">@sub3.Name</a></dd>
  171. }
  172. }
  173. </dl>
  174. }
  175. else
  176. {
  177. string url = sub2.Url;
  178. if (url.Contains("?"))
  179. {
  180. url += "&right=" + sub2.Id;
  181. }
  182. else
  183. {
  184. url += "?right=" + sub2.Id;
  185. }
  186. <a lay-href="@url" title="@sub2.Name">@sub2.Name</a>
  187. }
  188. </dd>
  189. }
  190. }
  191. </dl>
  192. }
  193. else
  194. {
  195. string url = sub1.Url;
  196. if (url.Contains("?"))
  197. {
  198. url += "&right=" + sub1.Id;
  199. }
  200. else
  201. {
  202. url += "?right=" + sub1.Id;
  203. }
  204. <a href="javascript:;" lay-href="@url" title="@sub1.Name" lay-tips="@sub1.Name" lay-direction="2">
  205. <i class="layui-icon layui-icon-component"></i>
  206. <cite>@sub1.Name</cite>
  207. </a>
  208. }
  209. </li>
  210. }
  211. }
  212. @if (SysUserName == "admin" || SysUserName == "root")
  213. {
  214. <li data-name="component" class="layui-nav-item">
  215. <a href="javascript:;" lay-tips="开发" lay-direction="2">
  216. <i class="layui-icon layui-icon-component"></i>
  217. <cite>开发</cite>
  218. </a>
  219. <dl class="layui-nav-child">
  220. <dd data-name="grid">
  221. <a lay-href="/Admin/RightDic/Index">后台菜单</a>
  222. </dd>
  223. <dd data-name="grid">
  224. <a lay-href="/Admin/RightDicNew/Index">新后台菜单</a>
  225. </dd>
  226. <dd data-name="grid">
  227. <a lay-href="/Admin/UploadParams/Index">上传配置</a>
  228. </dd>
  229. @if(SysUserName == "admin")
  230. {
  231. <dd data-name="grid">
  232. <a lay-href="/Admin/OperateRightList/Index">操作权限库</a>
  233. </dd>
  234. <dd data-name="grid">
  235. <a lay-href="/Admin/PageUpdateInfo/Index">页面管理</a>
  236. </dd>
  237. <dd data-name="grid">
  238. <a lay-href="/Admin/FileUpdateInfo/Index">静态资源管理</a>
  239. </dd>
  240. <dd data-name="grid">
  241. <a lay-href="/Admin/AppBottomNavs/Index">APP底部导航</a>
  242. </dd>
  243. <dd data-name="grid">
  244. <a lay-href="/Admin/AppVersion/Index">APP版本管理</a>
  245. </dd>
  246. <dd data-name="grid">
  247. <a lay-href="/Admin/SystemSet/Edit">站内设置</a>
  248. </dd>
  249. <dd data-name="grid">
  250. <a lay-href="/Admin/PublicAccountSet/Edit">第三方配置</a>
  251. </dd>
  252. <dd data-name="grid">
  253. <a lay-href="/Admin/TimedTasks/Index">任务管理</a>
  254. </dd>
  255. <dd data-name="grid">
  256. <a lay-href="/Admin/ProfitObjects/Index">分润配置</a>
  257. </dd>
  258. <dd data-name="grid">
  259. <a lay-href="/Admin/SysTools/SeeSpLog">查看日志</a>
  260. </dd>
  261. <dd data-name="grid">
  262. <a lay-href="/Admin/SysTools/RelationForUser">关联上下级</a>
  263. </dd>
  264. <dd data-name="grid">
  265. <a lay-href="/Admin/SysTools/MakeCoupons">生成机具兑换码</a>
  266. </dd>
  267. <dd data-name="grid">
  268. <a lay-href="/Admin/SysTools/LisFee">立刷费率</a>
  269. </dd>
  270. <dd data-name="grid">
  271. <a lay-href="/Admin/SysTools/CheckMachine2">机具补录</a>
  272. </dd>
  273. }
  274. </dl>
  275. </li>
  276. }
  277. @if (Role == "13")
  278. {
  279. <li data-name="component" class="layui-nav-item">
  280. <a href="javascript:;" lay-tips="前端工具" lay-direction="2">
  281. <i class="layui-icon layui-icon-component"></i>
  282. <cite>前端工具</cite>
  283. </a>
  284. <dl class="layui-nav-child">
  285. <dd data-name="grid">
  286. <a lay-href="/Admin/RightDicNew/Index">新后台菜单</a>
  287. </dd>
  288. <dd data-name="grid">
  289. <a lay-href="/Admin/PageUpdateInfo/Index">页面管理</a>
  290. </dd>
  291. <dd data-name="grid">
  292. <a lay-href="/Admin/FileUpdateInfo/Index">静态资源管理</a>
  293. </dd>
  294. <dd data-name="grid">
  295. <a lay-href="/Admin/AppBottomNavs/Index">APP底部导航</a>
  296. </dd>
  297. <dd data-name="grid">
  298. <a lay-href="/Admin/AppVersion/Index">APP版本管理</a>
  299. </dd>
  300. </dl>
  301. </li>
  302. }
  303. </ul>
  304. </div>
  305. </div>
  306. <!-- 页面标签 -->
  307. <div class="layadmin-pagetabs" id="LAY_app_tabs">
  308. <div class="layui-icon layadmin-tabs-control layui-icon-prev" layadmin-event="leftPage"></div>
  309. <div class="layui-icon layadmin-tabs-control layui-icon-next" layadmin-event="rightPage"></div>
  310. <div class="layui-icon layadmin-tabs-control layui-icon-down">
  311. <ul class="layui-nav layadmin-tabs-select" lay-filter="layadmin-pagetabs-nav">
  312. <li class="layui-nav-item" lay-unselect>
  313. <a href="javascript:;"></a>
  314. <dl class="layui-nav-child layui-anim-fadein">
  315. <dd layadmin-event="closeThisTabs"><a href="javascript:;">关闭当前标签页</a></dd>
  316. <dd layadmin-event="closeOtherTabs"><a href="javascript:;">关闭其它标签页</a></dd>
  317. <dd layadmin-event="closeAllTabs"><a href="javascript:;">关闭全部标签页</a></dd>
  318. </dl>
  319. </li>
  320. </ul>
  321. </div>
  322. <div class="layui-tab" lay-unauto lay-allowClose="true" lay-filter="layadmin-layout-tabs">
  323. <ul class="layui-tab-title" id="LAY_app_tabsheader">
  324. <li lay-id="/Admin/Home/Main" lay-attr="/Admin/Home/Main" class="layui-this"><i class="layui-icon layui-icon-home"></i></li>
  325. </ul>
  326. </div>
  327. </div>
  328. <!-- 主体内容 -->
  329. <div class="layui-body" id="LAY_app_body">
  330. <div class="layadmin-tabsbody-item layui-show">
  331. <iframe src="/Admin/Home/Main" frameborder="0" class="layadmin-iframe"></iframe>
  332. </div>
  333. </div>
  334. <!-- 辅助元素,一般用于移动设备下遮罩 -->
  335. <div class="layadmin-body-shade" layadmin-event="shade"></div>
  336. </div>
  337. </div>
  338. <script src="/layuiadmin/layui/layui.js"></script>
  339. <script>
  340. //任务流程提醒弹窗
  341. function taskRing() {
  342. var index = layer.open({
  343. type: 1
  344. ,offset: 'rb'
  345. ,content: '<div style="padding: 20px 100px;">您有新的任务需要处理</div>'
  346. ,btn: ['去处理', '稍等']
  347. ,btnAlign: 'c' //按钮居中
  348. ,shade: 0 //不显示遮罩
  349. ,yes: function(){
  350. layer.close(index);
  351. document.getElementById("TaskFlowBtn").click();
  352. }
  353. });
  354. }
  355. var $;
  356. layui.config({
  357. base: '/layuiadmin/' //静态资源所在路径
  358. }).extend({
  359. index: 'lib/index' //主入口模块
  360. }).use(['index', 'form'], function () {
  361. $ = layui.$;
  362. var form = layui.form;
  363. form.on('select(SearchMenu)', function (data) {
  364. if(data.value && data.value != '') {
  365. var data = data.value.split('#');
  366. addTab(data[1], data[0]);
  367. }
  368. });
  369. });
  370. //添加选项卡
  371. function addTab(name, url) {
  372. layui.index.openTabsPage(url, name);
  373. }
  374. function showPwd() {
  375. layer.open({
  376. type: 2
  377. , title: '修改登录密码'
  378. , content: '/Admin/Home/LoginPassword'
  379. , maxmin: true
  380. , area: ['400px', '350px']
  381. , btn: ['确定', '取消']
  382. , yes: function (index, layero) {
  383. var iframeWindow = window['layui-layer-iframe' + index]
  384. , submitID = 'LAY-list-front-submit'
  385. , submit = layero.find('iframe').contents().find('#' + submitID);
  386. //监听提交
  387. iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
  388. var field = data.field; //获取提交的字段
  389. var userdata = "";
  390. for (var prop in field) {
  391. userdata += prop + "=" + encodeURIComponent(field[prop]) + "&";
  392. }
  393. $.ajax({
  394. type: "POST",
  395. url: "/Admin/Home/LoginPasswordPost?r=" + Math.random(1),
  396. data: userdata,
  397. dataType: "text",
  398. success: function (data) {
  399. if (data == "success") {
  400. layer.msg("修改成功", { time: 2000 }, function () {
  401. layer.close(index); //关闭弹层
  402. });
  403. } else {
  404. layer.msg(data);
  405. }
  406. }
  407. });
  408. });
  409. submit.trigger('click');
  410. }
  411. , success: function (layero, index) {
  412. }
  413. });
  414. }
  415. function showInfo() {
  416. layer.open({
  417. type: 2
  418. , title: '个人资料'
  419. , content: '/Admin/Home/AdminInfo'
  420. , maxmin: true
  421. , area: ['400px', '350px']
  422. , btn: ['确定', '取消']
  423. , yes: function (index, layero) {
  424. var iframeWindow = window['layui-layer-iframe' + index]
  425. , submitID = 'LAY-list-front-submit'
  426. , submit = layero.find('iframe').contents().find('#' + submitID);
  427. //监听提交
  428. iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
  429. var field = data.field; //获取提交的字段
  430. console.log(field);
  431. var userdata = "";
  432. for (var prop in field) {
  433. userdata += prop + "=" + encodeURIComponent(field[prop]) + "&";
  434. }
  435. $.ajax({
  436. type: "POST",
  437. url: "/Admin/Home/AdminInfoPost?r=" + Math.random(1),
  438. data: userdata,
  439. dataType: "text",
  440. success: function (data) {
  441. if (data == "success") {
  442. layer.msg("修改成功", { time: 2000 }, function () {
  443. layer.close(index); //关闭弹层
  444. });
  445. } else {
  446. layer.msg(data);
  447. }
  448. }
  449. });
  450. });
  451. submit.trigger('click');
  452. }
  453. , success: function (layero, index) {
  454. }
  455. });
  456. }
  457. function quit() {
  458. layer.confirm('确定要退出吗?', {
  459. btn: ['确定', '取消']
  460. }, function () {
  461. window.location.href = "/Admin/Home/Quit";
  462. });
  463. }</script>
  464. </body>
  465. </html>