mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-01 15:32:48 +08:00
新增time_limit查询;新增number_limit查询;新增同一个字段多个搜索项;
This commit is contained in:
@@ -174,20 +174,19 @@ class AdminController extends BaseController
|
||||
|
||||
$message = array_merge($this->validateMessage, $message);
|
||||
|
||||
if(is_null($batch)){
|
||||
if (is_null($batch)) {
|
||||
$batch = $this->batchValidate;
|
||||
}
|
||||
|
||||
if ($this->validateRule instanceof Validate) {
|
||||
$this->validateRule->message($message);
|
||||
|
||||
// 是否批量验证
|
||||
// 是否批量验证
|
||||
if ($batch) {
|
||||
$this->validateRule->batch(true);
|
||||
}
|
||||
|
||||
$this->validateRule->failException(true)->check($data);
|
||||
|
||||
} else if (is_array($this->validateRule)) {
|
||||
parent::validate($data, $this->validateRule, $message, $batch);
|
||||
} else {
|
||||
@@ -226,6 +225,13 @@ class AdminController extends BaseController
|
||||
continue;
|
||||
}
|
||||
$op = isset($ops[$key]) && !empty($ops[$key]) ? $ops[$key] : '%*%';
|
||||
|
||||
if (strpos($key, '[') === 0) {
|
||||
$key = str_replace('[', '', $key);
|
||||
|
||||
$key = explode(']', $key)[0];
|
||||
}
|
||||
|
||||
if ($this->relationSearch && count(explode('.', $key)) == 1) {
|
||||
$key = "{$tableName}.{$key}";
|
||||
}
|
||||
@@ -242,6 +248,18 @@ class AdminController extends BaseController
|
||||
case '%*':
|
||||
$where[] = [$key, 'LIKE', "%{$val}"];
|
||||
break;
|
||||
case 'min':
|
||||
$where[] = [$key, '>=', $val];
|
||||
break;
|
||||
case 'max':
|
||||
$where[] = [$key, '<=', $val];
|
||||
break;
|
||||
case 'min_date':
|
||||
$where[] = [$key, '>=', strtotime($val)];
|
||||
break;
|
||||
case 'max_date':
|
||||
$where[] = [$key, '<=', strtotime($val)];
|
||||
break;
|
||||
case 'range':
|
||||
[$beginTime, $endTime] = explode(' - ', $val);
|
||||
$where[] = [$key, '>=', strtotime($beginTime)];
|
||||
|
||||
@@ -2,31 +2,32 @@
|
||||
@import url("../../plugs/font-awesome-4.7.0/css/font-awesome.min.css");
|
||||
@import url("../css/iconfont.css");
|
||||
|
||||
html, body {
|
||||
height: 100%;
|
||||
html,
|
||||
body {
|
||||
height : 100%;
|
||||
background: #f2f2f2;
|
||||
}
|
||||
|
||||
.layuimini-container {
|
||||
min-height: 250px;
|
||||
padding: 15px;
|
||||
margin-right: auto;
|
||||
margin-left: auto;
|
||||
padding-left: 15px;
|
||||
min-height : 250px;
|
||||
padding : 15px;
|
||||
margin-right : auto;
|
||||
margin-left : auto;
|
||||
padding-left : 15px;
|
||||
padding-right: 15px;
|
||||
}
|
||||
|
||||
.layuimini-main {
|
||||
position: relative;
|
||||
padding: 15px 15px;
|
||||
position : relative;
|
||||
padding : 15px 15px;
|
||||
background-color: #ffffff;
|
||||
border: 1px solid #f2f2f2;
|
||||
border-radius: 5px;
|
||||
border : 1px solid #f2f2f2;
|
||||
border-radius : 5px;
|
||||
}
|
||||
|
||||
.layuimini-form .layui-form-item {
|
||||
position: relative;
|
||||
padding: 0 60px 0 0;
|
||||
position : relative;
|
||||
padding : 0 60px 0 0;
|
||||
line-height: 24px;
|
||||
}
|
||||
|
||||
@@ -40,29 +41,29 @@ html, body {
|
||||
|
||||
.easy-bg-white {
|
||||
background-color: #ffffff;
|
||||
height: auto;
|
||||
height : auto;
|
||||
}
|
||||
|
||||
.hr-line {
|
||||
color: #fff;
|
||||
height: 1px;
|
||||
margin: 30px 0;
|
||||
color : #fff;
|
||||
height : 1px;
|
||||
margin : 30px 0;
|
||||
background-color: #fff;
|
||||
border-top: 1px dashed #e7eaec;
|
||||
border-top : 1px dashed #e7eaec;
|
||||
}
|
||||
|
||||
/**重写layui表格自适应*/
|
||||
.layuimini-container .layui-table-cell {
|
||||
height: 100%;
|
||||
height : 100%;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
/**数据表格-搜索表单样式*/
|
||||
.layuimini-container .table-search-fieldset {
|
||||
margin: 0;
|
||||
border: 1px solid #e6e6e6;
|
||||
margin : 0;
|
||||
border : 1px solid #e6e6e6;
|
||||
padding: 10px 20px 5px 20px;
|
||||
color: #6b6b6b;
|
||||
color : #6b6b6b;
|
||||
}
|
||||
|
||||
.layuimini-container .table-search-fieldset input::-webkit-input-placeholder {
|
||||
@@ -83,30 +84,31 @@ html, body {
|
||||
}
|
||||
|
||||
/**必填红点 */
|
||||
.layuimini-form > .layui-form-item .required:after {
|
||||
content: '*';
|
||||
color: red;
|
||||
position: absolute;
|
||||
.layuimini-form>.layui-form-item .required:after {
|
||||
content : '*';
|
||||
color : red;
|
||||
position : absolute;
|
||||
margin-left: 4px;
|
||||
font-weight: bold;
|
||||
line-height: 1.8em;
|
||||
top: 6px;
|
||||
right: 5px;
|
||||
top : 6px;
|
||||
right : 5px;
|
||||
}
|
||||
|
||||
/*.layuimini-form>.layui-form-item>.layui-form-label {width:120px !important;}*/
|
||||
/*.layuimini-form>.layui-form-item>.layui-input-block {margin-left:150px !important;}*/
|
||||
.layuimini-form > .layui-form-item > .layui-input-block tip, .layuimini-form > .layui-form-item > .layui-inline tip {
|
||||
display: inline-block;
|
||||
margin-top: 10px;
|
||||
.layuimini-form>.layui-form-item>.layui-input-block tip,
|
||||
.layuimini-form>.layui-form-item>.layui-inline tip {
|
||||
display : inline-block;
|
||||
margin-top : 10px;
|
||||
line-height: 15px;
|
||||
font-size: 10px;
|
||||
color: #a29c9c;
|
||||
font-size : 10px;
|
||||
color : #a29c9c;
|
||||
}
|
||||
|
||||
/** 按钮背景色 */
|
||||
.layuimini-container .layuimini-btn-primary {
|
||||
color: #fff;
|
||||
color : #fff;
|
||||
background-color: #2c3e50;
|
||||
}
|
||||
|
||||
@@ -120,34 +122,34 @@ html, body {
|
||||
}
|
||||
|
||||
.layuimini-upload .layuimini-upload-btn {
|
||||
display: inline-block;
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
display : inline-block;
|
||||
position : absolute;
|
||||
right : 0px;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.layuimini-upload-show {
|
||||
margin-top: 10px;
|
||||
margin-top : 10px;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.layuimini-upload-show li {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
padding: 5px 0 5px 0;
|
||||
padding-left: 10px;
|
||||
position : relative;
|
||||
display : inline-block;
|
||||
padding : 5px 0 5px 0;
|
||||
padding-left : 10px;
|
||||
padding-right: 10px;
|
||||
border: 1px solid #e2e2e2;
|
||||
border : 1px solid #e2e2e2;
|
||||
}
|
||||
|
||||
.layuimini-upload-show a img {
|
||||
height: 80px;
|
||||
height : 80px;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.layuimini-upload-show .uploads-delete-tip {
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
position : absolute;
|
||||
right : 10px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
@@ -160,18 +162,18 @@ html, body {
|
||||
}
|
||||
|
||||
.badge {
|
||||
display: inline-block;
|
||||
min-width: 10px;
|
||||
padding: 3px 7px;
|
||||
font-size: 11px;
|
||||
font-weight: bold;
|
||||
color: #fff;
|
||||
line-height: 1;
|
||||
vertical-align: middle;
|
||||
white-space: nowrap;
|
||||
text-align: center;
|
||||
display : inline-block;
|
||||
min-width : 10px;
|
||||
padding : 3px 7px;
|
||||
font-size : 11px;
|
||||
font-weight : bold;
|
||||
color : #fff;
|
||||
line-height : 1;
|
||||
vertical-align : middle;
|
||||
white-space : nowrap;
|
||||
text-align : center;
|
||||
background-color: #777777;
|
||||
border-radius: 10px;
|
||||
border-radius : 10px;
|
||||
}
|
||||
|
||||
/**vue隐藏样式*/
|
||||
@@ -182,18 +184,18 @@ html, body {
|
||||
/**表格url样式*/
|
||||
.layuimini-table-url {
|
||||
background-color: #1497f3;
|
||||
color: #ffffff;
|
||||
border-radius: 3px;
|
||||
size: 8px !important;
|
||||
padding: 2px
|
||||
color : #ffffff;
|
||||
border-radius : 3px;
|
||||
size : 8px !important;
|
||||
padding : 2px
|
||||
}
|
||||
|
||||
.layuimini-table-url:hover {
|
||||
background-color: #1497f3;
|
||||
color: #ffffff;
|
||||
border-radius: 3px;
|
||||
size: 8px !important;
|
||||
padding: 2px
|
||||
color : #ffffff;
|
||||
border-radius : 3px;
|
||||
size : 8px !important;
|
||||
padding : 2px
|
||||
}
|
||||
|
||||
/**后台权限隐藏*/
|
||||
@@ -205,21 +207,21 @@ html, body {
|
||||
|
||||
.layui-input-block {
|
||||
margin-left: 130px;
|
||||
min-height: 36px
|
||||
min-height : 36px
|
||||
}
|
||||
|
||||
/**
|
||||
table样式
|
||||
*/
|
||||
.layuimini-container .layui-laypage .layui-laypage-curr .layui-laypage-em {
|
||||
border-radius: 30px !important;
|
||||
border-radius : 30px !important;
|
||||
background-color: #1e9fff !important;
|
||||
}
|
||||
|
||||
.layuimini-container .layui-table-tool {
|
||||
background-color: #ffffff;
|
||||
border-bottom: none !important;
|
||||
padding-bottom: 15px !important;
|
||||
border-bottom : none !important;
|
||||
padding-bottom : 15px !important;
|
||||
}
|
||||
|
||||
.layuimini-container .layui-table-view {
|
||||
@@ -232,28 +234,29 @@ table样式
|
||||
border-color: #e6e6e6;
|
||||
}
|
||||
|
||||
.layuimini-container .layui-table-page, .layui-table-total {
|
||||
.layuimini-container .layui-table-page,
|
||||
.layui-table-total {
|
||||
border-width: 0px 0 0;
|
||||
}
|
||||
|
||||
.layuimini-container .layui-table-box .layui-table-header th {
|
||||
font-weight: bold !important;
|
||||
color: #565656 !important;
|
||||
color : #565656 !important;
|
||||
}
|
||||
|
||||
/**
|
||||
搜索
|
||||
*/
|
||||
.form-search .layui-btn {
|
||||
height: 32px;
|
||||
height : 32px;
|
||||
line-height: 28px;
|
||||
font-size: 12px;
|
||||
padding: 0 10px;
|
||||
font-size : 12px;
|
||||
padding : 0 10px;
|
||||
}
|
||||
|
||||
.form-search .layui-form-label {
|
||||
padding: 0 8px;
|
||||
height: 32px;
|
||||
padding : 0 8px;
|
||||
height : 32px;
|
||||
line-height: 30px;
|
||||
}
|
||||
|
||||
@@ -263,14 +266,15 @@ table样式
|
||||
|
||||
.form-search .layui-input-inline input,
|
||||
.form-search .layui-input-inline select {
|
||||
width: 100%;
|
||||
height: 32px;
|
||||
padding: 2px 8px;
|
||||
width : 100%;
|
||||
height : 32px;
|
||||
padding : 2px 8px;
|
||||
line-height: 1em;
|
||||
font-size : 12px;
|
||||
}
|
||||
|
||||
.form-search .layui-form-select dl {
|
||||
top: 31px;
|
||||
top : 31px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
@@ -279,26 +283,26 @@ table样式
|
||||
按钮
|
||||
*/
|
||||
.layuimini-container .layui-btn-success {
|
||||
color: #fff;
|
||||
color : #fff;
|
||||
background-color: #4bb368;
|
||||
border-color: #4bb368;
|
||||
border-color : #4bb368;
|
||||
}
|
||||
|
||||
.layuimini-container .layui-btn-danger {
|
||||
color: #fff;
|
||||
color : #fff;
|
||||
background-color: #f56c6c;
|
||||
border-color: #f56c6c;
|
||||
border-color : #f56c6c;
|
||||
}
|
||||
|
||||
.layuimini-container .layui-table-tool .layui-btn + .layui-btn {
|
||||
.layuimini-container .layui-table-tool .layui-btn+.layui-btn {
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
.layuimini-container .layui-table-tool .layui-inline[lay-event] {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
width : 30px;
|
||||
height : 30px;
|
||||
line-height: 30px;
|
||||
padding: 0px;
|
||||
padding : 0px;
|
||||
}
|
||||
|
||||
.layuimini-container .layui-table-tool .layui-inline .layui-icon {
|
||||
@@ -317,7 +321,7 @@ table样式
|
||||
开关
|
||||
*/
|
||||
.layuimini-container .layui-form-switch {
|
||||
border: 1px solid #f56d6d;
|
||||
border : 1px solid #f56d6d;
|
||||
background-color: #f56d6d;
|
||||
}
|
||||
|
||||
@@ -330,7 +334,7 @@ table样式
|
||||
}
|
||||
|
||||
.layuimini-container .layui-form-onswitch {
|
||||
border-color: #1f9fff;
|
||||
border-color : #1f9fff;
|
||||
background-color: #1f9fff;
|
||||
}
|
||||
|
||||
@@ -345,24 +349,24 @@ table样式
|
||||
弹出层样式
|
||||
*/
|
||||
.layui-layer-easy .layui-layer-title {
|
||||
background: #2c3e50 !important;
|
||||
color: #fff !important;
|
||||
background : #2c3e50 !important;
|
||||
color : #fff !important;
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.layui-layer-easy .layui-layer-title ~ .layui-layer-setwin {
|
||||
top: 0px;
|
||||
.layui-layer-easy .layui-layer-title~.layui-layer-setwin {
|
||||
top : 0px;
|
||||
height: 42px;
|
||||
}
|
||||
|
||||
.layui-layer-easy .layui-layer-title ~ .layui-layer-setwin > a {
|
||||
height: 42px;
|
||||
.layui-layer-easy .layui-layer-title~.layui-layer-setwin>a {
|
||||
height : 42px;
|
||||
line-height: 42px;
|
||||
display: inline-block;
|
||||
display : inline-block;
|
||||
}
|
||||
|
||||
.layui-layer-easy.layui-layer-border {
|
||||
border: none !important;
|
||||
border : none !important;
|
||||
box-shadow: 1px 1px 50px rgba(0, 0, 0, 0.3) !important;
|
||||
}
|
||||
|
||||
@@ -372,65 +376,65 @@ table样式
|
||||
|
||||
.layui-layer-easy .layui-layer-moves {
|
||||
-webkit-box-sizing: content-box;
|
||||
-moz-box-sizing: content-box;
|
||||
box-sizing: content-box;
|
||||
-moz-box-sizing : content-box;
|
||||
box-sizing : content-box;
|
||||
}
|
||||
|
||||
.layui-layer-easy .layui-layer-btn {
|
||||
text-align: center !important;
|
||||
padding: 10px !important;
|
||||
padding : 10px !important;
|
||||
background: #ecf0f1;
|
||||
overflow: hidden;
|
||||
overflow : hidden;
|
||||
}
|
||||
|
||||
.layui-layer-easy .layui-layer-btn a {
|
||||
background-color: #95a5a6;
|
||||
border-color: #95a5a6;
|
||||
color: #fff !important;
|
||||
height: 31px;
|
||||
margin-top: 0;
|
||||
border: 1px solid transparent;
|
||||
border-color : #95a5a6;
|
||||
color : #fff !important;
|
||||
height : 31px;
|
||||
margin-top : 0;
|
||||
border : 1px solid transparent;
|
||||
}
|
||||
|
||||
.layui-layer-easy .layui-layer-btn .layui-layer-btn0 {
|
||||
background-color: #1E9FFF;
|
||||
border-color: #1E9FFF;
|
||||
border-color : #1E9FFF;
|
||||
}
|
||||
|
||||
.layui-layer-easy .layui-layer-footer {
|
||||
padding: 8px 20px;
|
||||
padding : 8px 20px;
|
||||
background-color: #ecf0f1;
|
||||
height: auto;
|
||||
text-align: inherit !important;
|
||||
height : auto;
|
||||
text-align : inherit !important;
|
||||
}
|
||||
|
||||
.layui-layer-easy .layui-layer-setwin > a {
|
||||
.layui-layer-easy .layui-layer-setwin>a {
|
||||
background: none !important;
|
||||
}
|
||||
|
||||
.layui-layer-easy .layui-layer-setwin > a cite {
|
||||
.layui-layer-easy .layui-layer-setwin>a cite {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.layui-layer-easy .layui-layer-setwin > a:after {
|
||||
content: "\e625";
|
||||
font-family: iconfont;
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
.layui-layer-easy .layui-layer-setwin>a:after {
|
||||
content : "\e625";
|
||||
font-family : iconfont;
|
||||
font-style : normal;
|
||||
font-weight : normal;
|
||||
text-decoration: inherit;
|
||||
position: absolute;
|
||||
font-size: 18px;
|
||||
color: #fff;
|
||||
margin: 0;
|
||||
z-index: 1;
|
||||
position : absolute;
|
||||
font-size : 18px;
|
||||
color : #fff;
|
||||
margin : 0;
|
||||
z-index : 1;
|
||||
}
|
||||
|
||||
.layui-layer-easy .layui-layer-setwin > a:hover {
|
||||
.layui-layer-easy .layui-layer-setwin>a:hover {
|
||||
text-decoration: none !important;
|
||||
background: none !important;
|
||||
background : none !important;
|
||||
}
|
||||
|
||||
.layui-layer-easy .layui-layer-setwin > a:focus {
|
||||
.layui-layer-easy .layui-layer-setwin>a:focus {
|
||||
text-decoration: none !important;
|
||||
}
|
||||
|
||||
@@ -465,8 +469,8 @@ table样式
|
||||
.layui-layer-easy .layui-layer-setwin .layui-layer-close2,
|
||||
.layui-layer-easy .layui-layer-setwin .layui-layer-close2:hover {
|
||||
background: url('../libs/layer/dist/theme/default/icon.png') no-repeat -149px -31px !important;
|
||||
top: -30px;
|
||||
right: -30px;
|
||||
top : -30px;
|
||||
right : -30px;
|
||||
}
|
||||
|
||||
.layui-layer-easy .layui-layer-setwin .layui-layer-close2:after,
|
||||
@@ -487,20 +491,20 @@ table样式
|
||||
}
|
||||
|
||||
.layui-layer-easy-tab .layui-layer-content .layui-layer-tabmain {
|
||||
margin: 0;
|
||||
margin : 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 1024px) {
|
||||
.layuimini-form .layui-form-item {
|
||||
position: relative;
|
||||
padding: 0 30px 0 0;
|
||||
position : relative;
|
||||
padding : 0 30px 0 0;
|
||||
line-height: 24px;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 768px) {
|
||||
.easyadmin-export-btn{
|
||||
.easyadmin-export-btn {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
@@ -513,23 +517,23 @@ table样式
|
||||
}
|
||||
|
||||
.line-limit-length {
|
||||
width: 200px;
|
||||
overflow: hidden;
|
||||
width : 200px;
|
||||
overflow : hidden;
|
||||
text-overflow: ellipsis;
|
||||
background: goldenrod;
|
||||
white-space: nowrap;
|
||||
background : goldenrod;
|
||||
white-space : nowrap;
|
||||
}
|
||||
|
||||
.data-item{
|
||||
display: none;
|
||||
.data-item {
|
||||
display : none;
|
||||
line-height: 28px;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 450px) {
|
||||
.data-item{
|
||||
.data-item {
|
||||
display: block;
|
||||
}
|
||||
|
||||
|
||||
.layui-form-item .layui-form-label {
|
||||
float : unset;
|
||||
text-align: left;
|
||||
@@ -602,12 +606,20 @@ table样式
|
||||
border: none;
|
||||
}
|
||||
|
||||
.layui-table-header{
|
||||
.layui-table-header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.search-hide-item{
|
||||
.search-hide-item {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.form-item-time-limit .layui-input-inline {
|
||||
display: flex;
|
||||
width : 274px;
|
||||
}
|
||||
.form-item-number-limit .layui-input-inline {
|
||||
display: flex;
|
||||
}
|
||||
@@ -21,7 +21,9 @@ define(["jquery", "easy-admin"], function ($, ea) {
|
||||
limit: 50,
|
||||
cols: [[
|
||||
{ type: 'checkbox' },
|
||||
{ field: 'id', title: 'id' },
|
||||
{ field: 'id', title: 'id', search: 'number_limit' },
|
||||
{ field: 'id', title: 'id模糊匹配', trueHide: true, fieldAlias: '[id]like' },
|
||||
{ field: 'id', title: '最大id', trueHide: true, fieldAlias: '[id]max', searchOp: 'max' },
|
||||
{
|
||||
field: 'uid', title: 'uid', minWidth: 120,
|
||||
},
|
||||
@@ -36,11 +38,9 @@ define(["jquery", "easy-admin"], function ($, ea) {
|
||||
|
||||
var className = 'log-group log-group-' + (currentUidIndex % 2)
|
||||
return '<div class="' + className + '">' + data.content + '</div>'
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
{ field: 'create_time', title: 'create_time', minWidth: 160 },
|
||||
{ field: 'create_time', title: '记录时间', minWidth: 160, search: 'time_limit' },
|
||||
{ field: 'app_name', title: 'app_name' },
|
||||
{ field: 'controller_name', title: 'controller_name', },
|
||||
{ field: 'action_name', title: 'action_name' },
|
||||
|
||||
@@ -288,6 +288,14 @@ define(["jquery", "tableSelect", "ckeditor"], function ($, tableSelect, undefine
|
||||
// 判断是否有操作列表权限
|
||||
options.cols = admin.table.renderOperat(options.cols, options.elem);
|
||||
|
||||
|
||||
|
||||
// 判断是否有操作列表权限
|
||||
options.cols = admin.table.renderTrueHide(options.cols, options.elem);
|
||||
|
||||
|
||||
|
||||
|
||||
// 初始化表格
|
||||
var newTable = table.render(options);
|
||||
|
||||
@@ -363,6 +371,15 @@ define(["jquery", "tableSelect", "ckeditor"], function ($, tableSelect, undefine
|
||||
d.searchOp = d.searchOp || '%*%';
|
||||
d.timeType = d.timeType || 'datetime';
|
||||
|
||||
d.elemIdName = d.fieldAlias;
|
||||
|
||||
if (typeof d.fieldAlias == 'string' && d.fieldAlias.indexOf('[') == 0) {
|
||||
|
||||
var fieldPlusArr = d.fieldAlias.replace('[').split(']');
|
||||
|
||||
d.elemIdName = fieldPlusArr.join('-')
|
||||
}
|
||||
|
||||
if (d.defaultSearchValue.length > 0) {
|
||||
if (d.searchValue.length == 0) {
|
||||
d.searchValue = d.defaultSearchValue;
|
||||
@@ -385,7 +402,7 @@ define(["jquery", "tableSelect", "ckeditor"], function ($, tableSelect, undefine
|
||||
formHtml += '\t<div class="layui-form-item layui-inline ' + formSearchHideClass + ' ">\n' +
|
||||
'<label class="layui-form-label">' + d.title + '</label>\n' +
|
||||
'<div class="layui-input-inline">\n' +
|
||||
'<input id="c-' + d.fieldAlias + '" name="' + d.fieldAlias + '" data-search-op="' + d.searchOp + '" value="' + d.searchValue + '" placeholder="' + d.searchTip + '" class="layui-input">\n' +
|
||||
'<input id="c-' + d.elemIdName + '" name="' + d.fieldAlias + '" data-search-op="' + d.searchOp + '" value="' + d.searchValue + '" placeholder="' + d.searchTip + '" class="layui-input">\n' +
|
||||
'</div>\n' +
|
||||
'</div>';
|
||||
break;
|
||||
@@ -403,7 +420,7 @@ define(["jquery", "tableSelect", "ckeditor"], function ($, tableSelect, undefine
|
||||
formHtml += '\t<div class="layui-form-item layui-inline ' + formSearchHideClass + ' ">\n' +
|
||||
'<label class="layui-form-label">' + d.title + '</label>\n' +
|
||||
'<div class="layui-input-inline">\n' +
|
||||
'<select class="layui-select" id="c-' + d.fieldAlias + '" name="' + d.fieldAlias + '" data-search-op="' + d.searchOp + '" >\n' +
|
||||
'<select class="layui-select" id="c-' + d.elemIdName + '" name="' + d.fieldAlias + '" data-search-op="' + d.searchOp + '" >\n' +
|
||||
'<option value="">- 全部 -</option> \n' +
|
||||
selectHtml +
|
||||
'</select>\n' +
|
||||
@@ -415,7 +432,7 @@ define(["jquery", "tableSelect", "ckeditor"], function ($, tableSelect, undefine
|
||||
formHtml += '\t<div class="layui-form-item layui-inline ' + formSearchHideClass + ' ">\n' +
|
||||
'<label class="layui-form-label">' + d.title + '</label>\n' +
|
||||
'<div class="layui-input-inline">\n' +
|
||||
'<input id="c-' + d.fieldAlias + '" name="' + d.fieldAlias + '" data-search-op="' + d.searchOp + '" value="' + d.searchValue + '" placeholder="' + d.searchTip + '" class="layui-input">\n' +
|
||||
'<input id="c-' + d.elemIdName + '" name="' + d.fieldAlias + '" data-search-op="' + d.searchOp + '" value="' + d.searchValue + '" placeholder="' + d.searchTip + '" class="layui-input">\n' +
|
||||
'</div>\n' +
|
||||
'</div>';
|
||||
break;
|
||||
@@ -424,7 +441,27 @@ define(["jquery", "tableSelect", "ckeditor"], function ($, tableSelect, undefine
|
||||
formHtml += '\t<div class="layui-form-item layui-inline ' + formSearchHideClass + ' ">\n' +
|
||||
'<label class="layui-form-label">' + d.title + '</label>\n' +
|
||||
'<div class="layui-input-inline">\n' +
|
||||
'<input id="c-' + d.fieldAlias + '" name="' + d.fieldAlias + '" data-search-op="' + d.searchOp + '" value="' + d.searchValue + '" placeholder="' + d.searchTip + '" class="layui-input">\n' +
|
||||
'<input id="c-' + d.elemIdName + '" name="' + d.fieldAlias + '" data-search-op="' + d.searchOp + '" value="' + d.searchValue + '" placeholder="' + d.searchTip + '" class="layui-input">\n' +
|
||||
'</div>\n' +
|
||||
'</div>';
|
||||
break;
|
||||
case 'time_limit':
|
||||
d.searchOp = '=';
|
||||
formHtml += '\t<div class="layui-form-item form-item-time-limit layui-inline ' + formSearchHideClass + ' ">\n' +
|
||||
'<label class="layui-form-label">' + d.title + '</label>\n' +
|
||||
'<div class="layui-input-inline">\n' +
|
||||
'<input id="c-' + d.elemIdName + '-min_date" name="[' + d.fieldAlias + ']min_date" data-search-op="min_date" value="' + d.searchValue + '" placeholder="' + d.searchTip + '最小值" class="layui-input">\n' +
|
||||
'<input id="c-' + d.elemIdName + '-max_date" name="[' + d.fieldAlias + ']max_date" data-search-op="max_date" value="' + d.searchValue + '" placeholder="' + d.searchTip + '最大值" class="layui-input">\n' +
|
||||
'</div>\n' +
|
||||
'</div>';
|
||||
break;
|
||||
case 'number_limit':
|
||||
d.searchOp = '=';
|
||||
formHtml += '\t<div class="layui-form-item form-item-number-limit layui-inline ' + formSearchHideClass + ' ">\n' +
|
||||
'<label class="layui-form-label">' + d.title + '</label>\n' +
|
||||
'<div class="layui-input-inline">\n' +
|
||||
'<input id="c-' + d.elemIdName + '-min" name="[' + d.fieldAlias + ']min" data-search-op="min" type="text" value="' + d.searchValue + '" placeholder="' + d.searchTip + '最小值" class="layui-input">\n' +
|
||||
'<input id="c-' + d.elemIdName + '-max" name="[' + d.fieldAlias + ']max" data-search-op="max" type="text" value="' + d.searchValue + '" placeholder="' + d.searchTip + '最大值" class="layui-input">\n' +
|
||||
'</div>\n' +
|
||||
'</div>';
|
||||
break;
|
||||
@@ -456,6 +493,10 @@ define(["jquery", "tableSelect", "ckeditor"], function ($, tableSelect, undefine
|
||||
if (ncV.search === 'time') {
|
||||
laydate.render({ type: ncV.timeType, elem: '[name="' + ncV.fieldAlias + '"]' });
|
||||
}
|
||||
if (ncV.search === 'time_limit') {
|
||||
laydate.render({ type: ncV.timeType, elem: '[name="[' + ncV.fieldAlias + ']min_date"]' });
|
||||
laydate.render({ type: ncV.timeType, elem: '[name="[' + ncV.fieldAlias + ']max_date"]' });
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -509,9 +550,27 @@ define(["jquery", "tableSelect", "ckeditor"], function ($, tableSelect, undefine
|
||||
data[dk].pop()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return data;
|
||||
},
|
||||
renderTrueHide(data, elem) {
|
||||
var newData = [];
|
||||
for (dk in data) {
|
||||
var newCol = [];
|
||||
var col = data[dk];
|
||||
|
||||
col.forEach(colItem => {
|
||||
if (!colItem.trueHide) {
|
||||
newCol.push(colItem)
|
||||
}
|
||||
});
|
||||
|
||||
newData.push(newCol)
|
||||
}
|
||||
|
||||
return newData;
|
||||
},
|
||||
buildToolbarHtml: function (toolbar, tableId) {
|
||||
var html = '';
|
||||
toolbar.class = toolbar.class || '';
|
||||
@@ -864,7 +923,16 @@ define(["jquery", "tableSelect", "ckeditor"], function ($, tableSelect, undefine
|
||||
$.each(dataField, function (key, val) {
|
||||
if (val !== '') {
|
||||
formatFilter[key] = val;
|
||||
var op = $('#c-' + key).attr('data-search-op');
|
||||
|
||||
var elemId = key;
|
||||
|
||||
if (key.indexOf('[') == 0) {
|
||||
var keyArr = key.replace('[', '').split(']');
|
||||
|
||||
elemId = keyArr[0] + '-' + keyArr[1];
|
||||
}
|
||||
|
||||
var op = $('#c-' + elemId).attr('data-search-op');
|
||||
op = op || '%*%';
|
||||
formatOp[key] = op;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user