mirror of https://gitee.com/karson/fastadmin.git
改进普通搜索插件——支持传入css样式
parent
78ff548544
commit
7003e5312a
|
|
@ -51,7 +51,7 @@
|
||||||
return Template(that.options.searchFormTemplate, {columns: pColumns, table: that});
|
return Template(that.options.searchFormTemplate, {columns: pColumns, table: that});
|
||||||
}
|
}
|
||||||
var htmlForm = [];
|
var htmlForm = [];
|
||||||
htmlForm.push(sprintf('<form class="form-horizontal form-commonsearch" novalidate method="post" action="%s" >', that.options.actionForm));
|
htmlForm.push(sprintf('<form class="%s" novalidate method="post" action="%s">', that.options.searchFormCss.form, that.options.actionForm));
|
||||||
htmlForm.push('<fieldset>');
|
htmlForm.push('<fieldset>');
|
||||||
if (that.options.titleForm.length > 0)
|
if (that.options.titleForm.length > 0)
|
||||||
htmlForm.push(sprintf("<legend>%s</legend>", that.options.titleForm));
|
htmlForm.push(sprintf("<legend>%s</legend>", that.options.titleForm));
|
||||||
|
|
@ -66,9 +66,9 @@
|
||||||
vObjCol.operate = that.options.renderDefault && operate ? operate : (typeof vObjCol.operate === 'undefined' ? '=' : vObjCol.operate);
|
vObjCol.operate = that.options.renderDefault && operate ? operate : (typeof vObjCol.operate === 'undefined' ? '=' : vObjCol.operate);
|
||||||
ColumnsForSearch.push(vObjCol);
|
ColumnsForSearch.push(vObjCol);
|
||||||
|
|
||||||
htmlForm.push('<div class="form-group col-xs-12 col-sm-6 col-md-4 col-lg-3">');
|
htmlForm.push(sprintf('<div class="%s">', that.options.searchFormCss.form_group));
|
||||||
htmlForm.push(sprintf('<label for="%s" class="control-label col-xs-4">%s</label>', vObjCol.field, vObjCol.title));
|
htmlForm.push(sprintf('<label for="%s" class="%s">%s</label>', vObjCol.field, that.options.searchFormCss.label, vObjCol.title));
|
||||||
htmlForm.push('<div class="col-xs-8">');
|
htmlForm.push(sprintf('<div class="%s">', that.options.searchFormCss.container));
|
||||||
|
|
||||||
vObjCol.operate = vObjCol.operate ? vObjCol.operate.toUpperCase() : '=';
|
vObjCol.operate = vObjCol.operate ? vObjCol.operate.toUpperCase() : '=';
|
||||||
htmlForm.push(sprintf('<input type="hidden" class="form-control operate" name="%s-operate" data-name="%s" value="%s" readonly>', vObjCol.field, vObjCol.field, vObjCol.operate));
|
htmlForm.push(sprintf('<input type="hidden" class="form-control operate" name="%s-operate" data-name="%s" value="%s" readonly>', vObjCol.field, vObjCol.field, vObjCol.operate));
|
||||||
|
|
@ -132,7 +132,8 @@
|
||||||
htmlForm.push('</div>');
|
htmlForm.push('</div>');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
htmlForm.push('<div class="form-group col-xs-12 col-sm-6 col-md-4 col-lg-3">');
|
htmlForm.push(sprintf('<div class="%s">', that.options.searchFormCss.form_group));
|
||||||
|
htmlForm.push(sprintf('<label class="%s"> </label>', that.options.searchFormCss.label_btn));
|
||||||
htmlForm.push(createFormBtn(that).join(''));
|
htmlForm.push(createFormBtn(that).join(''));
|
||||||
htmlForm.push('</div>');
|
htmlForm.push('</div>');
|
||||||
htmlForm.push('</div>');
|
htmlForm.push('</div>');
|
||||||
|
|
@ -146,7 +147,7 @@
|
||||||
var htmlBtn = [];
|
var htmlBtn = [];
|
||||||
var searchSubmit = that.options.formatCommonSubmitButton();
|
var searchSubmit = that.options.formatCommonSubmitButton();
|
||||||
var searchReset = that.options.formatCommonResetButton();
|
var searchReset = that.options.formatCommonResetButton();
|
||||||
htmlBtn.push('<div class="col-sm-8 col-xs-offset-4">');
|
htmlBtn.push(sprintf('<div class="%s">', that.options.searchFormCss.container));
|
||||||
htmlBtn.push(sprintf('<button type="submit" class="btn btn-success" formnovalidate>%s</button> ', searchSubmit));
|
htmlBtn.push(sprintf('<button type="submit" class="btn btn-success" formnovalidate>%s</button> ', searchSubmit));
|
||||||
htmlBtn.push(sprintf('<button type="reset" class="btn btn-default" >%s</button> ', searchReset));
|
htmlBtn.push(sprintf('<button type="reset" class="btn btn-default" >%s</button> ', searchReset));
|
||||||
htmlBtn.push('</div>');
|
htmlBtn.push('</div>');
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,13 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
|
||||||
import_url: '',
|
import_url: '',
|
||||||
multi_url: '',
|
multi_url: '',
|
||||||
dragsort_url: 'ajax/weigh',
|
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 列配置
|
// Bootstrap-table 列配置
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue