PingAnYeXianSZCG_Web 前端代码

AddRight.html 3.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <script src="../Script/Common/huayi.load.js"></script>
  6. <script src="../Script/Common/huayi.config.js"></script>
  7. <link href="../css/Table/table1.css" rel="stylesheet" />
  8. <link href="../css/init.css" rel="stylesheet" />
  9. <title></title>
  10. <style>
  11. table tr{
  12. margin-bottom: 20px;
  13. }
  14. table tr td{
  15. text-align: left;
  16. padding: 5px;
  17. }
  18. .Content{
  19. padding: 10px;
  20. }
  21. .btn{
  22. background: #1ab394;
  23. }
  24. .Btn_box{
  25. margin-top: 20px;
  26. color: #fff;
  27. }
  28. .inpBox select{
  29. width: 150px;
  30. padding: 3px 6px;
  31. }
  32. .F_Remark{
  33. width: 100%;
  34. }
  35. .tab{
  36. border-bottom: 1px solid #ccc;
  37. }
  38. </style>
  39. </head>
  40. <body>
  41. <div>
  42. <div class="Content">
  43. <div class="tab" >
  44. <table id="sqzx" style="width: 100%;" border="0" cellspacing="0" cellpadding="0">
  45. <tr>
  46. <th>指标标题:</th>
  47. <td>
  48. <div class="inpBox">
  49. <select name="">
  50. <option value=""></option>
  51. </select>
  52. </div>
  53. </td>
  54. <th>指标标题:</th>
  55. <td>
  56. <div class="inpBox">
  57. <select name="">
  58. <option value=""></option>
  59. </select>
  60. </div>
  61. </td>
  62. </tr>
  63. <tr>
  64. <th>指标描述:</th>
  65. <td colspan="5">
  66. <textarea name="" rows="3" cols="20" class="F_Remark"></textarea>
  67. </td>
  68. </tr>
  69. </table>
  70. </div>
  71. <div>
  72. <h3>试题选项</h3>
  73. <h3 style="font-size: 14px; text-align: right;"><i class="fa fa-plus size-14" id="Add"></i>添加选项</h3>
  74. <table id="tbr" style="width: 100%;">
  75. <thead>
  76. <tr>
  77. <th data-align="center" data-field="id" data-formatter="setCode">序号</th>
  78. <th data-align="center" data-field="F_CategoryName">选项</th>
  79. <th data-align="center" data-field="F_Title">操作</th>
  80. </tr>
  81. </thead>
  82. <tbody>
  83. </tbody>
  84. </table>
  85. </div>
  86. </div>
  87. </div>
  88. <script>
  89. var $tableLeft = $('#tbr');
  90. //销毁表格
  91. $tableLeft.bootstrapTable('destroy');
  92. //初始化表格,动态从服务器加载数据
  93. $tableLeft.bootstrapTable({
  94. method: "get", //使用get请求到服务器获取数据
  95. // url: huayi.config.callcenter_url + "IndexBase/GetList",
  96. // url: "//117.158.196.116:8878/IndexBase/GetList",
  97. striped: true, //表格显示条纹
  98. pagination: true, //启动分页
  99. pageSize: 5, //每页显示的记录数
  100. pageNumber: 1, //当前第几页
  101. pageList: [5, 20, 50, 100], //记录数可选列表
  102. search: false, //是否启用查询
  103. showColumns: false, //显示下拉框勾选要显示的列
  104. showRefresh: false, //显示刷新按钮
  105. sidePagination: "server", //表示服务端请求
  106. //设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
  107. //设置为limit可以获取limit, offset, search, sort, order
  108. queryParamsType: "undefined",
  109. queryParams: function queryParams(params) { //设置查询参数
  110. var param = {
  111. page: params.pageNumber,
  112. pagesize: params.pageSize,
  113. categoryid:Left_Cids,
  114. key: Keys
  115. };
  116. return param;
  117. },
  118. onLoadSuccess: function() { //加载成功时执行
  119. // layer.msg("加载成功");
  120. },
  121. onLoadError: function() { //加载失败时执行
  122. //layer.msg("加载数据失败", { time: 1500, icon: 2 });
  123. }
  124. });
  125. $("#Add").click(function () {
  126. var index = $tableLeft.bootstrapTable('getData').length;
  127. $tableLeft.bootstrapTable('insertRow', {
  128. index: index,
  129. row: {
  130. id: '',
  131. wareName: ''
  132. }
  133. });
  134. });
  135. </script>
  136. </body>
  137. </html>