diff --git a/app/common/controller/Backend.php b/app/common/controller/Backend.php index 7d78730d..cb86e18f 100644 --- a/app/common/controller/Backend.php +++ b/app/common/controller/Backend.php @@ -149,7 +149,13 @@ class Backend extends Api // 日期时间 if (isset($field['render']) && $field['render'] == 'datetime') { + if ($field['operator'] == 'RANGE' && is_array($field['val'])) { + $datetimeArr = array_filter(array_map("strtotime", $field['val'])); + $where[] = [$fieldName, str_replace('RANGE', 'BETWEEN', $field['operator']), $datetimeArr]; + continue; + } $where[] = [$fieldName, '=', strtotime($field['val'])]; + continue; } // 范围查询 @@ -166,9 +172,10 @@ class Backend extends Api $operator = $field['operator'] == 'RANGE' ? '>=' : '<'; $arr = $arr[0]; } else { - $operator = 'BETWEEN'; + $operator = str_replace('RANGE', 'BETWEEN', $field['operator']); } $where[] = [$fieldName, $operator, $arr]; + continue; } switch ($field['operator']) { diff --git a/web/src/components/table/comSearch/index.vue b/web/src/components/table/comSearch/index.vue index f6453084..107e4932 100644 --- a/web/src/components/table/comSearch/index.vue +++ b/web/src/components/table/comSearch/index.vue @@ -4,38 +4,68 @@
@@ -105,7 +135,11 @@ const onComSearch = () => { let val = '' let fieldDataTemp = fieldData.get(key) - if (fieldDataTemp.operator == 'RANGE' || fieldDataTemp.operator == 'NOT RANGE') { + if (fieldDataTemp.render == 'datetime' && (fieldDataTemp.operator == 'RANGE' || fieldDataTemp.operator == 'NOT RANGE')) { + if (state.form[key].length >= 2) { + val = state.form[key] + } + } else if (fieldDataTemp.operator == 'RANGE' || fieldDataTemp.operator == 'NOT RANGE') { if (!state.form[key + '-start'] && !state.form[key + '-end']) { continue } @@ -180,4 +214,10 @@ const onResetForm = () => { .pl-20 { padding-left: 20px; } +.w16 { + width: 16.5% !important; +} +.w83 { + width: 83.5% !important; +} diff --git a/web/src/views/backend/routine/attachment.vue b/web/src/views/backend/routine/attachment.vue index fcc61f53..6c13df1f 100644 --- a/web/src/views/backend/routine/attachment.vue +++ b/web/src/views/backend/routine/attachment.vue @@ -164,7 +164,7 @@ const table: { { label: '上传(引用)次数', prop: 'quote', align: 'center', width: 150, operator: 'RANGE', sortable: 'custom' }, { label: '原始名称', prop: 'name', align: 'center', 'show-overflow-tooltip': true, operator: 'LIKE', operatorPlaceholder: '模糊查询' }, { label: '存储方式', prop: 'storage', align: 'center', width: 100, operator: 'LIKE', operatorPlaceholder: '模糊查询' }, - { label: '最后上传时间', prop: 'lastuploadtime', align: 'center', render: 'datetime', width: 160, sortable: 'custom' }, + { label: '最后上传时间', prop: 'lastuploadtime', align: 'center', render: 'datetime', operator: 'RANGE', width: 160, sortable: 'custom' }, { label: '操作', align: 'center',