{field: 'xieche_time', title: __('Xieche_time'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
{field: 'addtime', title: __('Addtime'), operate:false},
{field: 'gai_yunfei', title: __('Gai_yunfei'), operate:'BETWEEN'},
visible: false;
data-params='{"custom[is_del]":"0"}'
在 js 中设置
$(".btn-edit,.btn-add,.btn-editone").data("area", ["100%", "100%"]);
operate: 'LIKE %...%', placeholder: '关键字,模糊搜索'
//禁用默认搜索
search: false,
//启用普通表单搜索
commonSearch: true,
//可以控制是否默认显示搜索单表,false则隐藏,默认为false
searchFormVisible: false,
$searchFields = ['chehao','id'];
list($where, $sort, $order, $offset, $limit) = $this->buildparams($searchFields);
if (isset($filter['aa.bb']) && $filter['aa.bb'] == 0) {
$op = $this->request->get("op");
$op = json_decode($op, true);
$op['aa.bb'] = 'IS NULL';
$this->request->get(["op" => json_encode($op)]);
}
# model
public function bb()
{
return $this->hasOne('bb', 'id', 'bb_id', [], 'LEFT')->field('id')->setEagerlyType(0);
}
# controller
$this->relationSearch = true;
$list = $this->model
->with("bb")
->where($where)
->order($sort, $order)
->select();
var table = $("#table");
// table.on('common-search.bs.table', function (event, table, params, query) {
// //这里可以对params值进行修改,从而影响搜索条件
// });
//在普通搜索渲染后
table.on("post-common-search.bs.table", function(event, table) {
$("input[name='shifa_id']")
.addClass("selectpage")
.data("source", "kuangdian/index");
$("input[name='xie_addr_id']")
.addClass("selectpage")
.data("source", "xiehuodian/index");
$("input[name='xianlu']")
.addClass("selectpage")
.data("source", "xianlu/index");
$("input[name='depart_id']")
.addClass("selectpage")
.data("source", "depart/index")
.attr("data-field", "depart_name");
Form.events.cxselect($("form", table.$commonsearch));
Form.events.selectpage($("form", table.$commonsearch));
});
{field: 'from_id', title: '数据来源', searchList: {"0":'调度结算',"1":'无磅单数据',"2": '司机宝导入', "3": '货速运导入'}, operate: 'FIND_IN_SET', formatter: Table.api.formatter.normal,visible:false},
$(".btn-qiyong").on("click", function(e) {
var url = $(this).data("url");
var temp = table.bootstrapTable("getSelections");
var arr = [];
$.each(temp, function(i, v) {
arr.push(v.USERID);
});
Layer.confirm(
"确定吗?",
{
icon: 3,
title: "提示"
},
function(index) {
Fast.api.ajax(
{
type: "POST",
url: url,
data: { ids: arr, dis: 0 }
},
function(data, ret) {
$(".btn-refresh").click();
}
);
}
);
});
{
field: 'DISABLE', title: __('Disable'), align: 'left', formatter: function (value, row, index) {
// console.log(row);return;
var str = '';
if (row.DISABLE == 0){
str = '<div class="tdtitle">启用</div>';;
}
if (row.DISABLE == 1){
str = '<div class="tdtitle" style="color: red;">已禁用</div>';;
}
return str;
// return '<div class="tdtitle"><a href="' + row.url + '">' + value + '</a></div>';
}
},
字符应该按字母算吧,ab 是 2 个字符,汉字最少 2 个汉子。
这个问题怎么调整解决
修改 user.php
$rule = [ 'username' => 'require|length:3,30', 'password' => 'require|length:6,30', 'email' => 'require|email', 'mobile' => 'regex:/^1\d{10}$/', 'captcha' => 'require|captcha', '__token__' => 'token', ];
<style>
.fixed-table-container tbody .selected .bg-table-td-selected {
background-color: #31b0d5;
}
</style>
onClickRow: function(row, $element, field) {
$(".bg-table-td-selected").removeClass("bg-table-td-selected");
$($element)
.find("td")
.addClass("bg-table-td-selected");
},
onCheck: function(row, $element) {
$($element)
.parents("tr")
.find("td")
.addClass("bg-table-td-selected");
},
onUncheck: function(row, $element) {
$($element)
.parents("tr")
.find("td")
.removeClass("bg-table-td-selected");
}
参考:
发表评论 登录: