From 2b1462e1e6f1b0ab1082d84395c4eec20a22c26f Mon Sep 17 00:00:00 2001 From: cwchen <1048842385@qq.com> Date: Wed, 24 Dec 2025 10:02:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=8D=E7=BD=AE=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/device/location.js | 2 +- src/components/TableModel2/index.vue | 2 +- src/views/device/image-recognition/config.js | 31 ---- src/views/device/location/config.js | 33 ++++- src/views/device/location/index.vue | 148 +------------------ 5 files changed, 40 insertions(+), 176 deletions(-) delete mode 100644 src/views/device/image-recognition/config.js diff --git a/src/api/device/location.js b/src/api/device/location.js index cff6414..cded273 100644 --- a/src/api/device/location.js +++ b/src/api/device/location.js @@ -3,7 +3,7 @@ import request from '@/utils/request' // 设备管理->位置管理->查询位置列表 export function locationListAPI(params) { return request({ - url: '/smartCar/device/location/getLocationList', + url: '/smartCar/data/location/getLocationList', method: 'GET', params }) diff --git a/src/components/TableModel2/index.vue b/src/components/TableModel2/index.vue index aa2895b..145ddec 100644 --- a/src/components/TableModel2/index.vue +++ b/src/components/TableModel2/index.vue @@ -232,7 +232,7 @@ export default { // 表格最大高度(像素),默认700px tableMaxHeight: { type: [Number, String], - default: 650, + default: 700, }, // 是否自动加载数据 默认自动加载 autoLoad: { diff --git a/src/views/device/image-recognition/config.js b/src/views/device/image-recognition/config.js deleted file mode 100644 index 69a512f..0000000 --- a/src/views/device/image-recognition/config.js +++ /dev/null @@ -1,31 +0,0 @@ -export const formLabel = [ - { - isShow: true, // 是否展示label - f_type: 'sel', - f_label: '车辆类型', - f_model: 'vehicleType', - f_width: '250px', - f_selList: [ - { label: '油车', value: '油车' }, - { label: '货车', value: '货车' }, - { label: '客车', value: '客车' }, - { label: '小车', value: '小车' }, - ], - }, - { - isShow: true, // 是否展示label - f_type: 'dateTimeRange', - f_label: '时间选择', - f_model: 'timeRange', - f_width: '400px', - dateType: ['startTime', 'endTime'], - valueFormat: 'yyyy-MM-dd HH:mm', - }, -] - -export const columnsList = [ - { t_props: 'imageUrl', t_label: '图像' }, - { t_props: 'location', t_label: '位置' }, - { t_props: 'detectTime', t_label: '检测时间' }, - { t_props: 'vehicleType', t_label: '车辆类型' }, -] \ No newline at end of file diff --git a/src/views/device/location/config.js b/src/views/device/location/config.js index dbb2b9e..7851e61 100644 --- a/src/views/device/location/config.js +++ b/src/views/device/location/config.js @@ -1,6 +1,33 @@ -export const formLabel = [] +export const formLabel = [ + { + isShow: false, // 是否展示label + f_type: 'dateTimeRange', + f_label: '时间选择', + f_model: 'timeRange', + f_width: '400px', + dateType: ['startTime', 'endTime'], + valueFormat: 'yyyy-MM-dd HH:mm', + // 默认时间设置,可以是数组 [startTime, endTime] 或函数返回数组 + // 函数形式:() => [startTime, endTime],支持动态计算 + defaultValue: () => { + // 默认设置为当天00:00到23:59 + const now = new Date() + const todayStart = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 0, 0) + const todayEnd = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59) + const formatTime = (date) => { + const year = date.getFullYear() + const month = String(date.getMonth() + 1).padStart(2, '0') + const day = String(date.getDate()).padStart(2, '0') + const hours = String(date.getHours()).padStart(2, '0') + const minutes = String(date.getMinutes()).padStart(2, '0') + return `${year}-${month}-${day} ${hours}:${minutes}` + } + return [formatTime(todayStart), formatTime(todayEnd)] + }, + }, +] export const columnsList = [ - { t_props: 'time', t_label: '时间' }, - { t_props: 'location', t_label: '地点' }, + { t_props: 'locationTime', t_label: '时间' }, + { t_props: 'locationName', t_label: '地点' }, ] \ No newline at end of file diff --git a/src/views/device/location/index.vue b/src/views/device/location/index.vue index 27d96fe..95812b2 100644 --- a/src/views/device/location/index.vue +++ b/src/views/device/location/index.vue @@ -1,25 +1,11 @@