Index.cshtml 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. @{
  2. ViewBag.Title = "Index";
  3. Layout = "~/Views/Shared/_Index.cshtml";
  4. }
  5. <link href="~/Content/scripts/bootstrap/bootstrap.min.css" rel="stylesheet" />
  6. <script>
  7. $(function () {
  8. InitialPage();
  9. GetDeviceData();
  10. });
  11. //初始化页面
  12. function InitialPage() {
  13. //resize重设(表格、树形)宽高
  14. $(window).resize(function (e) {
  15. window.setTimeout(function () {
  16. $('#gridTable').setGridWidth(($('.gridPanel').width()));
  17. $("#gridTable").setGridHeight($(window).height() - 141);
  18. }, 200);
  19. e.stopPropagation();
  20. });
  21. }
  22. //获取设备实施信息
  23. function GetDeviceData() {
  24. var htmlData;
  25. $.ajax({
  26. url: '/SecondaryWaterSupply/Device/GetAllDeviceData',
  27. type: 'get',
  28. cache: false,
  29. async: false,
  30. success: function (data) {
  31. //console.log(data);
  32. htmlData = data;
  33. },
  34. error: function (a, b, c) {
  35. console.log(b);
  36. }
  37. });
  38. $("#dataContant").html(htmlData);
  39. }
  40. </script>
  41. <style>
  42. .subblock .content .title {
  43. padding-top: 15px;
  44. padding-bottom: 10px;
  45. border-bottom: solid #919191 2px;
  46. color: #666;
  47. font-size: 18px;
  48. text-align: center;
  49. }
  50. .gridPanel {
  51. background-color: white;
  52. border: 1px solid #ccc;
  53. }
  54. .rowStyle {
  55. line-height: 40px;
  56. background: rgba(245, 245, 245, 0.52);
  57. padding: 0px 15px;
  58. }
  59. .rowStyle a {
  60. text-decoration: none;
  61. font-size: 16px;
  62. padding: 0px;
  63. }
  64. .rowStyle label {
  65. font-size: 14px;
  66. padding: 0px;
  67. }
  68. .backColor {
  69. background-color: #E5F5FD;
  70. }
  71. .subblock {
  72. box-shadow: 10px 10px 5px #888888;
  73. }
  74. </style>
  75. <div class="titlePanel">
  76. <div class="toolbar">
  77. <div class="btn-group">
  78. <a id="lr-replace" class="btn btn-default" onclick="reload();"><i class="fa fa-refresh"></i>&nbsp;刷新</a>
  79. </div>
  80. </div>
  81. </div>
  82. <div class="gridPanel">
  83. <div class="row" id="dataContant">
  84. </div>
  85. </div>