Index.cshtml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. @{
  2. Layout = "~/Views/Shared/Main.cshtml";
  3. }
  4. <div class="layui-form">
  5. <div class="layui-col-md3" >
  6. <div class="layui-inline">
  7. <div class="layui-form-text">查询</div>
  8. <input id="search" name="search" class="layui-text" />
  9. </div>
  10. </div>
  11. </div>
  12. <div id="demo" class="layui-table"></div>
  13. <script>
  14. layui.use('table', function () {
  15. var table = layui.table;
  16. table.render({
  17. var datatable=table.render({
  18. elem: '#demo'
  19. ,url: '/Point/DriverData' //数据接口
  20. ,page: true //开启分页
  21. data: {},
  22. toolbar:'defaultToolbar',
  23. cols: [[
  24. { title: 'APIName', fixed: 'API名称',type:'numbers' },
  25. { field: 'Content', title: 'API备注', align: 'center' },
  26. { field: 'DelayTime', title: '超时时间', align: 'center' },
  27. { field: 'APIType', title: 'API类型', align: 'center' },
  28. { field: 'APIMethod', title: 'API方法', align: 'center' },
  29. { field: 'Params', title: '点位数', align: 'center' },
  30. { field: 'APIKey', title: '操作', align: 'center' template:"" }
  31. ]]
  32. })
  33. })
  34. window.tablereload = function () {
  35. table.reload('demo', {
  36. //where: { // 传递数据异步请求时携带的字段
  37. // aaa: '111',
  38. // bbb: '222'
  39. // //…
  40. //},
  41. //height: 1000 // 重设高度
  42. });
  43. }
  44. //$.post("/index/select", function (myg) {//印证有没有获取数据
  45. // console.log(myg);
  46. //})
  47. </script>