产品配置搜索
Showing
2 changed files
with
12 additions
and
35 deletions
| ... | @@ -100,7 +100,6 @@ | ... | @@ -100,7 +100,6 @@ |
| 100 | return JSON.stringify(ret); | 100 | return JSON.stringify(ret); |
| 101 | }, | 101 | }, |
| 102 | data: function (data) { | 102 | data: function (data) { |
| 103 | |||
| 104 | data.pageSize = data.length; | 103 | data.pageSize = data.length; |
| 105 | data.currentPage = parseFloat(data.start / data.length) + 1; | 104 | data.currentPage = parseFloat(data.start / data.length) + 1; |
| 106 | return data; | 105 | return data; | ... | ... |
| ... | @@ -6,17 +6,18 @@ | ... | @@ -6,17 +6,18 @@ |
| 6 | <div class="row cl mb-20"> | 6 | <div class="row cl mb-20"> |
| 7 | <div class="col-xs-2"> | 7 | <div class="col-xs-2"> |
| 8 | <span class="select-box"> | 8 | <span class="select-box"> |
| 9 | <select class="select table_search" name="code" size="1" column="6"> | 9 | <select class="select" name="code" size="1" id="file"> |
| 10 | <option value="" selected>选择字段</option> | 10 | <option value="" selected>选择字段</option> |
| 11 | <option value="0">产品名称</option> | 11 | <option value="productName">产品名称</option> |
| 12 | <option value="1">还款方式</option> | 12 | <option value="repaymentMode">还款方式</option> |
| 13 | </select> | 13 | </select> |
| 14 | </span> | 14 | </span> |
| 15 | </div> | 15 | </div> |
| 16 | <div class="col-xs-2"> | 16 | <div class="col-xs-2"> |
| 17 | <input type="text" class="input-text" placeholder="" id="" name="keyword"> | 17 | <input type="text" class="input-text" placeholder="" id="keywork" name="keyword"> |
| 18 | </div> | 18 | </div> |
| 19 | <div> | 19 | <div> |
| 20 | <button class="btn btn-primary radius" type="button" onclick="$('#table').DataTable().draw()">搜索</button> | ||
| 20 | <input class="btn btn-warning radius" type="reset" value="重置"> | 21 | <input class="btn btn-warning radius" type="reset" value="重置"> |
| 21 | <button class="btn btn-primary radius" type="button" onclick="layer_show('添加', '<?= site_url('/config/add') ?>')">添加</button> | 22 | <button class="btn btn-primary radius" type="button" onclick="layer_show('添加', '<?= site_url('/config/add') ?>')">添加</button> |
| 22 | </div> | 23 | </div> |
| ... | @@ -26,7 +27,7 @@ | ... | @@ -26,7 +27,7 @@ |
| 26 | </form> | 27 | </form> |
| 27 | 28 | ||
| 28 | <div class="body mt-20"> | 29 | <div class="body mt-20"> |
| 29 | <table class="table table-border table-bordered table-bg" id="table"> | 30 | <table class="table table-border table-bordered table-bg" id="table" url="config/products"> |
| 30 | <thead class="text-c"> | 31 | <thead class="text-c"> |
| 31 | <tr> | 32 | <tr> |
| 32 | <th width="68px">操作</th> | 33 | <th width="68px">操作</th> |
| ... | @@ -50,35 +51,12 @@ | ... | @@ -50,35 +51,12 @@ |
| 50 | 51 | ||
| 51 | <script> | 52 | <script> |
| 52 | var table = $('#table').dataTable({ | 53 | var table = $('#table').dataTable({ |
| 53 | aaSorting: [[1, "desc"]], | 54 | fnServerParams: function (aoData) { |
| 54 | serverSide: true, | 55 | delete aoData.columns; |
| 55 | processing: true, | 56 | |
| 56 | bSort: false, | 57 | file = $('#file').val(); |
| 57 | searching: false,//是否显示搜索 | 58 | if(file) |
| 58 | iDisplayLength: 6, | 59 | aoData[file] = $('#keywork').val(); |
| 59 | bLengthChange: false, | ||
| 60 | ajax: { | ||
| 61 | url: apiBaseUrl + 'config/products', | ||
| 62 | dataFilter: function (json) { | ||
| 63 | var ret = {}, json = jQuery.parseJSON(json); | ||
| 64 | ret.data = json.data || []; | ||
| 65 | var draw = getUrlParam('draw'); | ||
| 66 | if (draw) { | ||
| 67 | ret.draw = draw; | ||
| 68 | } | ||
| 69 | ret.recordsTotal = 0; | ||
| 70 | ret.recordsFiltered = 0; | ||
| 71 | if (json.page) { | ||
| 72 | ret.recordsTotal = parseInt(json.page.totalNumber); | ||
| 73 | ret.recordsFiltered = parseInt(json.page.totalNumber); | ||
| 74 | } | ||
| 75 | return JSON.stringify(ret); | ||
| 76 | }, | ||
| 77 | data: function (data) { | ||
| 78 | data.pageSize = data.length; | ||
| 79 | data.currentPage = parseFloat(data.start / data.length) + 1; | ||
| 80 | return data; | ||
| 81 | } | ||
| 82 | }, | 60 | }, |
| 83 | columns: [ | 61 | columns: [ |
| 84 | { | 62 | { | ... | ... |
-
Please register or sign in to post a comment