diff --git a/public/assets/js/backend/page.js b/public/assets/js/backend/page.js index 5d40235c..ebee2b6b 100644 --- a/public/assets/js/backend/page.js +++ b/public/assets/js/backend/page.js @@ -25,15 +25,16 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin {field: 'state', checkbox: true}, {field: 'id', title: __('Id'), operate: false}, {field: 'category_id', title: __('Category_id'), operate: '='}, - {field: 'title', title: __('Title'), operate: 'LIKE %...%'}, - {field: 'keywords', title: __('Keywords'), operate: 'LIKE %...%'}, + {field: 'title', title: __('Title'), operate: 'LIKE %...%', placeholder: '标题,模糊搜索', style: 'width:200px'}, + {field: 'keywords', title: __('Keywords'), operate: 'LIKE %...%', placeholder: '关键字,模糊搜索'}, {field: 'flag', title: __('Flag'), formatter: Table.api.formatter.flag, operate: false}, {field: 'image', title: __('Image'), formatter: Table.api.formatter.image, operate: false}, {field: 'icon', title: __('Icon'), formatter: Table.api.formatter.icon, operate: false}, {field: 'views', title: __('Views'), operate: false}, {field: 'comments', title: __('Comments'), operate: false}, {field: 'weigh', title: __('Weigh'), operate: false}, - {field: 'status', title: __('Status'), formatter: Table.api.formatter.status}, + {field: 'status', title: __('Status'), formatter: Table.api.formatter.status, searchList: {'normal': '正常', 'hidden': '隐藏'}, style: 'min-width:100px;'}, + {field: 'createtime', title: __('Create Time'), formatter: Table.api.formatter.datetime, operate: 'BETWEEN', type: 'datetime', addclass: 'datetimepicker', data: 'data-date-format="YYYY-MM-DD"'}, {field: 'operate', title: __('Operate'), events: Table.api.events.operate, formatter: Table.api.formatter.operate} ] ], diff --git a/public/assets/js/bootstrap-table-commonsearch.js b/public/assets/js/bootstrap-table-commonsearch.js index acce4a06..1f03d75c 100644 --- a/public/assets/js/bootstrap-table-commonsearch.js +++ b/public/assets/js/bootstrap-table-commonsearch.js @@ -30,6 +30,30 @@ }); } + //绑定日期时间元素事件 + var form = $("#" + that.options.idForm); + if ($(".datetimepicker", form).size() > 0) { + require(['bootstrap-datetimepicker'], function () { + $('.datetimepicker', form).parent().css('position', 'relative'); + $('.datetimepicker', form).datetimepicker({ + //format: 'YYYY-MM-DD', + icons: { + time: 'fa fa-clock-o', + date: 'fa fa-calendar', + up: 'fa fa-chevron-up', + down: 'fa fa-chevron-down', + previous: 'fa fa-chevron-left', + next: 'fa fa-chevron-right', + today: 'fa fa-history', + clear: 'fa fa-trash', + close: 'fa fa-remove' + }, + showTodayButton: true, + showClose: true + }); + }); + } + // 提交搜索 $("#btnSubmitCommon" + "_" + that.options.idTable).click(function (event) { that.onColumnCommonSearch(); @@ -69,6 +93,7 @@ } //htmlForm.push('