Main.cshtml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  1. @using MySystem.Models;
  2. @{
  3. List<RightDic> menus = ViewBag.menus as List<RightDic>;
  4. List<RightDic> datalist = ViewBag.datalist as List<RightDic>;
  5. List<Dictionary<string, object>> statlist = ViewBag.statlist as List<Dictionary<string, object>>;
  6. string RightInfo = ViewBag.RightInfo as string;
  7. string Role = ViewBag.Role as string;
  8. string tables = "";
  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. </head>
  21. <body>
  22. <div class="layui-fluid">
  23. @if(Role != "13")
  24. {
  25. <div class="layui-row layui-col-space15">
  26. <div class="layui-col-md8">
  27. <div class="layui-row layui-col-space15">
  28. <div class="layui-col-md6">
  29. <div class="layui-card">
  30. <div class="layui-card-header">快捷方式</div>
  31. <div class="layui-card-body">
  32. <div class="layui-carousel layadmin-carousel layadmin-shortcut">
  33. <div carousel-item>
  34. <ul class="layui-row layui-col-space10">
  35. @foreach(RightDic sub in menus)
  36. {
  37. if (RightInfo.Contains("," + sub.Id + ","))
  38. {
  39. string url = sub.Url;
  40. if (url.Contains("?"))
  41. {
  42. url += "&right=" + sub.Id;
  43. }
  44. else
  45. {
  46. url += "?right=" + sub.Id;
  47. }
  48. <li class="layui-col-xs3">
  49. <a lay-href="@url">
  50. <i class="layui-icon @(string.IsNullOrEmpty(sub.Icon) ? "layui-icon-component" : sub.Icon)"></i>
  51. <cite>@sub.Name</cite>
  52. </a>
  53. </li>
  54. }
  55. }
  56. </ul>
  57. </div>
  58. </div>
  59. </div>
  60. </div>
  61. </div>
  62. <div class="layui-col-md6">
  63. <div class="layui-card">
  64. <div class="layui-card-header">统计</div>
  65. <div class="layui-card-body">
  66. <div class="layui-carousel layadmin-carousel layadmin-backlog">
  67. <div carousel-item>
  68. <ul class="layui-row layui-col-space10">
  69. @{int i=0;}
  70. @foreach(Dictionary<string, object> sub in statlist)
  71. {
  72. i += 1;
  73. if(i % 4 == 1 && i > 1)
  74. {
  75. @Html.Raw("</ul><ul class=\"layui-row layui-col-space10\">");
  76. }
  77. <li class="layui-col-xs6">
  78. <a href="javascript:;" class="layadmin-backlog-body">
  79. <h3>@sub["Name"]</h3>
  80. <p><cite>@sub["Count"]</cite></p>
  81. </a>
  82. </li>
  83. }
  84. </ul>
  85. </div>
  86. </div>
  87. </div>
  88. </div>
  89. </div>
  90. @if(datalist.Count > 0)
  91. {
  92. <div class="layui-col-md12">
  93. <div class="layui-card">
  94. <div class="layui-tab layui-tab-brief layadmin-latestData">
  95. <ul class="layui-tab-title">
  96. @{i=0;}
  97. @foreach(RightDic sub in datalist)
  98. {
  99. i += 1;
  100. <li class="@(i == 1 ? "layui-this" : "")">@sub.Name</li>
  101. }
  102. </ul>
  103. <div class="layui-tab-content">
  104. @{i=0;}
  105. @foreach(RightDic sub in datalist)
  106. {
  107. i += 1;
  108. string table = sub.Url.Split('/')[2];
  109. tables += "'" + table + "',";
  110. <div class="layui-tab-item @(i == 1 ? "layui-show" : "")">
  111. <table id="LAY-index-Search@(table)"></table>
  112. </div>
  113. }
  114. </div>
  115. </div>
  116. </div>
  117. </div>
  118. }
  119. </div>
  120. </div>
  121. <div class="layui-col-md4">
  122. <div class="layui-card">
  123. <div class="layui-card-header">版本信息</div>
  124. <div class="layui-card-body layui-text">
  125. <table class="layui-table">
  126. <colgroup>
  127. <col width="100">
  128. <col>
  129. </colgroup>
  130. <tbody>
  131. <tr>
  132. <td>当前版本</td>
  133. <td>
  134. <script type="text/html" template>
  135. v1.0
  136. </script>
  137. </td>
  138. </tr>
  139. <tr>
  140. <td>名称</td>
  141. <td>
  142. <script type="text/html" template>
  143. 客小爽管理平台
  144. </script>
  145. </td>
  146. </tr>
  147. <tr>
  148. <td>短信条数</td>
  149. <td>
  150. <script type="text/html" template>
  151. @ViewBag.SMSCount
  152. </script>
  153. </td>
  154. </tr>
  155. </tbody>
  156. </table>
  157. </div>
  158. </div>
  159. </div>
  160. <div class="layui-col-m12 layui-col-space15">
  161. <div class="layui-col-md6">
  162. <div class="layui-card">
  163. <div class="layui-card-header">
  164. 新增创客数
  165. </div>
  166. <div class="layui-card-body" id="users" style="width: 100%;height:400px;">
  167. </div>
  168. </div>
  169. </div>
  170. <div class="layui-col-md6">
  171. <div class="layui-card">
  172. <div class="layui-card-header">
  173. 新增商户数
  174. </div>
  175. <div class="layui-card-body" id="actives" style="width: 100%;height:400px;">
  176. </div>
  177. </div>
  178. </div>
  179. </div>
  180. <div class="layui-col-m12 layui-col-space15">
  181. <div class="layui-col-md6">
  182. <div class="layui-card">
  183. <div class="layui-card-header">
  184. 新增消费者数
  185. </div>
  186. <div class="layui-card-body" id="trades" style="width: 100%;height:400px;">
  187. </div>
  188. </div>
  189. </div>
  190. </div>
  191. </div>
  192. }
  193. </div>
  194. <script src="/layuiadmin/modules/Main_Admin.js"></script>
  195. <script src="../../layuiadmin/layui/layui.js?t=1"></script>
  196. <script src="../../admin/js/echart.min.js"></script>
  197. <script>
  198. layui.config({
  199. base: '../../layuiadmin/'
  200. }).extend({
  201. index: 'lib/index'
  202. }).use(['index', 'console', 'table'], function(){
  203. var $ = layui.$
  204. ,table = layui.table;
  205. var tables = [@(Html.Raw(tables.TrimEnd(',')))];
  206. //今日热搜
  207. for(var i = 0; i < tables.length; i++){
  208. table.render({
  209. elem: '#LAY-index-Search' + tables[i]
  210. , url: '/Admin/' + tables[i] + '/IndexData' //模拟接口
  211. , cols: eval(tables[i] + '_cols')
  212. , page: true
  213. , text: '对不起,加载出现异常!'
  214. , done: function (res, curr, count) {
  215. $(".layui-none").text("无数据");
  216. }
  217. , skin: 'line'
  218. });
  219. }
  220. });
  221. var myChart = echarts.init(document.getElementById('users'));
  222. function showEChart() {
  223. var option = {
  224. tooltip: {},
  225. xAxis: {
  226. type: 'category',
  227. data: ['11月19日', '11月20日', '11月21日', '11月22日', '11月23日', '11月24日', '11月25日']
  228. },
  229. yAxis: {
  230. type: 'value'
  231. },
  232. series: [
  233. {
  234. data: [150, 230, 224, 218, 135, 147, 260],
  235. type: 'line'
  236. }
  237. ]
  238. };
  239. myChart.setOption(option);
  240. }
  241. showEChart();
  242. var myChartHeight = echarts.init(document.getElementById('actives'));
  243. var optionHeight = {
  244. tooltip: {},
  245. xAxis: {
  246. type: 'category',
  247. data: ['11月19日', '11月20日', '11月21日', '11月22日', '11月23日', '11月24日', '11月25日']
  248. },
  249. yAxis: {
  250. type: 'value'
  251. },
  252. series: [
  253. {
  254. data: [820, 932, 901, 934, 1290, 1330, 1320],
  255. type: 'line',
  256. smooth: true
  257. }
  258. ]
  259. };
  260. myChartHeight.setOption(optionHeight);
  261. var myChartWeight = echarts.init(document.getElementById('trades'));
  262. var optionWeight = {
  263. tooltip: {},
  264. xAxis: {
  265. data: ["11月19日","11月20日","11月21日","11月22日","11月23日","11月24日","11月25日"]
  266. },
  267. yAxis: {},
  268. series: [{
  269. name: '新增创客数',
  270. type: 'bar',
  271. data: [50, 20, 36, 10, 10, 20, 66]
  272. }]
  273. };
  274. myChartWeight.setOption(optionWeight);
  275. </script>
  276. </body>
  277. </html>