From 779f5d63efb87b114072b617ed8598034c199eed Mon Sep 17 00:00:00 2001 From: PPPSCN <35696959@qq.com> Date: Sat, 16 Feb 2019 17:49:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=E6=99=AE=E9=80=9A=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E6=8F=92=E4=BB=B6=E2=80=94=E2=80=94=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E4=BC=A0=E5=85=A5css=E6=A0=B7=E5=BC=8F=E3=80=81=E5=BB=B6?= =?UTF-8?q?=E6=97=B6=E9=9A=90=E8=97=8F=E9=81=BF=E5=85=8D=E5=AE=BD=E5=BA=A6?= =?UTF-8?q?=E4=B8=8D=E6=AD=A3=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/css/backend.css | 11 ++++++-- .../assets/js/bootstrap-table-commonsearch.js | 27 ++++++++++++------- public/assets/js/require-table.js | 7 +++++ 3 files changed, 34 insertions(+), 11 deletions(-) diff --git a/public/assets/css/backend.css b/public/assets/css/backend.css index 5c9a6903..924a01a0 100644 --- a/public/assets/css/backend.css +++ b/public/assets/css/backend.css @@ -113,9 +113,16 @@ html.ios-fix body { table.table-template { overflow: hidden; } -.sp_container .msg-box { +.pp_container { + border: none; + margin: 0; + padding: 0; + position: relative; + vertical-align: middle; +} +.sp_container .msg-box,.pp_container .msg-box { position: absolute; - right: 0; + left: 0; top: 0; } .toast-top-right-index { diff --git a/public/assets/js/bootstrap-table-commonsearch.js b/public/assets/js/bootstrap-table-commonsearch.js index c99acb04..700ead01 100644 --- a/public/assets/js/bootstrap-table-commonsearch.js +++ b/public/assets/js/bootstrap-table-commonsearch.js @@ -6,6 +6,9 @@ * * @author: Karson * @update 2018-04-05 + * + * @author: pppscn <35696959@qq.com> + * @update 2019-02-16 */ !function ($) { @@ -18,12 +21,17 @@ var initCommonSearch = function (pColumns, that) { var vFormCommon = createFormCommon(pColumns, that); - var vModal = sprintf("
", that.options.searchFormVisible ? "" : "hidden"); + var vModal = "
"; vModal += vFormCommon; vModal += "
"; that.$container.prepend($(vModal)); that.$commonsearch = $(".commonsearch-table", that.$container); var form = $("form.form-commonsearch", that.$commonsearch); + if(!that.options.searchFormVisible){ + setTimeout(function () { + that.$commonsearch.addClass('hidden'); + },100); + } require(['form'], function (Form) { Form.api.bindevent(form); @@ -51,7 +59,7 @@ return Template(that.options.searchFormTemplate, {columns: pColumns, table: that}); } var htmlForm = []; - htmlForm.push(sprintf('
', that.options.actionForm)); + htmlForm.push(sprintf('', that.options.searchFormCss.form, that.options.actionForm)); htmlForm.push('
'); if (that.options.titleForm.length > 0) htmlForm.push(sprintf("%s", that.options.titleForm)); @@ -66,9 +74,9 @@ vObjCol.operate = that.options.renderDefault && operate ? operate : (typeof vObjCol.operate === 'undefined' ? '=' : vObjCol.operate); ColumnsForSearch.push(vObjCol); - htmlForm.push('
'); - htmlForm.push(sprintf('', vObjCol.field, vObjCol.title)); - htmlForm.push('
'); + htmlForm.push(sprintf('
', that.options.searchFormCss.form_group)); + htmlForm.push(sprintf('', vObjCol.field, that.options.searchFormCss.label, vObjCol.title)); + htmlForm.push(sprintf('
', that.options.searchFormCss.container)); vObjCol.operate = vObjCol.operate ? vObjCol.operate.toUpperCase() : '='; htmlForm.push(sprintf('', vObjCol.field, vObjCol.field, vObjCol.operate)); @@ -120,7 +128,8 @@ htmlForm.push('
'); } } - htmlForm.push('
'); + htmlForm.push(sprintf('
', that.options.searchFormCss.form_group)); + htmlForm.push(sprintf('', that.options.searchFormCss.label_btn)); htmlForm.push(createFormBtn(that).join('')); htmlForm.push('
'); htmlForm.push('
'); @@ -134,7 +143,7 @@ var htmlBtn = []; var searchSubmit = that.options.formatCommonSubmitButton(); var searchReset = that.options.formatCommonResetButton(); - htmlBtn.push('
'); + htmlBtn.push(sprintf('
', that.options.searchFormCss.container)); htmlBtn.push(sprintf(' ', searchSubmit)); htmlBtn.push(sprintf(' ', searchReset)); htmlBtn.push('
'); @@ -380,8 +389,8 @@ [value, item, i], value); if (!($.inArray(key, that.header.fields) !== -1 && - (typeof value === 'string' || typeof value === 'number') && - (value + '').toLowerCase().indexOf(fval) !== -1)) { + (typeof value === 'string' || typeof value === 'number') && + (value + '').toLowerCase().indexOf(fval) !== -1)) { return false; } } diff --git a/public/assets/js/require-table.js b/public/assets/js/require-table.js index c4630558..d865c3bf 100644 --- a/public/assets/js/require-table.js +++ b/public/assets/js/require-table.js @@ -44,6 +44,13 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table import_url: '', multi_url: '', dragsort_url: 'ajax/weigh', + }, + searchFormCss: { + form: 'form-commonsearch', + form_group: 'form-group col-xs-12 col-sm-6 col-md-4 col-lg-3', + label: 'control-label', + label_btn: 'control-label hidden-xs', + container: 'pp_container', } }, // Bootstrap-table 列配置