diff --git a/.env.development b/.env.development
index ce7df7a..1e907c5 100644
--- a/.env.development
+++ b/.env.development
@@ -10,7 +10,7 @@ VUE_APP_BASE_API = '/dev-api'
VUE_APP_ONLYOFFICE_URL = 'http://36.33.26.201:19840'
# 图片预览路径
-VUE_APP_FILE_URL = 'http://192.168.0.108:58089/smartCar/profile'
+VUE_APP_FILE_URL = 'http://192.168.0.108:8099/smartCar/profile'
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true
diff --git a/.env.production b/.env.production
index 3927137..8d7ad00 100644
--- a/.env.production
+++ b/.env.production
@@ -6,7 +6,7 @@ ENV = 'production'
VUE_APP_ENV = 'production'
VUE_APP_ONLYOFFICE_URL = 'http://36.33.26.201:19840'
# 图片预览路径
-VUE_APP_FILE_URL = 'http://192.168.0.108:58089/smartCar/profile'
+VUE_APP_FILE_URL = 'http://192.168.0.108:8099/smartCar/profile'
# 车辆道路监测系统/生产环境
VUE_APP_BASE_API = '/smart-car-api'
diff --git a/src/views/device/data-recognition/index.vue b/src/views/device/data-recognition/index.vue
index f43c303..a6c677b 100644
--- a/src/views/device/data-recognition/index.vue
+++ b/src/views/device/data-recognition/index.vue
@@ -37,18 +37,18 @@
数据列表
- 蓝色
- 绿色
+ 蓝色
+ 绿色
{{ data.carColor }}
- 油车
- 新能源
+ 油车
+ 新能源
其他
-
+
@@ -92,7 +92,7 @@ export default {
}
}
const defaultTime = getDefaultTimeRange()
-
+
return {
showSearch: true,
columnsList,
@@ -142,6 +142,16 @@ export default {
},
methods: {
+
+ getImageUrl(filePath) {
+ if (filePath) {
+ if (isExternal(filePath)) {
+ return filePath
+ } else {
+ return process.env.VUE_APP_FILE_URL + filePath
+ }
+ }
+ },
/** 初始化默认时间范围 */
initDefaultTimeRange() {
const now = new Date()
@@ -259,7 +269,7 @@ export default {
/** 导出操作 */
handleExport() {
const params = { ...this.queryParams }
-
+
// 导出时给开始时间添加 :00 秒,结束时间添加 :59 秒
if (params.startTime && params.startTime.length === 16) {
params.startTime = params.startTime + ':00'
@@ -267,17 +277,17 @@ export default {
if (params.endTime && params.endTime.length === 16) {
params.endTime = params.endTime + ':59'
}
-
+
// 将参数编码后作为URL参数传递
const paramsStr = encodeURIComponent(JSON.stringify(params))
const url = `${window.location.origin}${process.env.VUE_APP_ENV === 'production' ? '/smart-car' : ''}/device/data-recognition/export-progress?params=${paramsStr}`
-
+
// 计算窗口居中位置
const width = 750
const height = 500
const left = (window.screen.width - width) / 2
const top = (window.screen.height - height) / 2
-
+
// 打开新窗口(居中显示)
window.open(url, '_blank', `width=${width},height=${height},left=${left},top=${top},scrollbars=yes,resizable=yes`)
},
diff --git a/src/views/device/image-recognition/index.vue b/src/views/device/image-recognition/index.vue
index a0bedfe..5b4843d 100644
--- a/src/views/device/image-recognition/index.vue
+++ b/src/views/device/image-recognition/index.vue
@@ -34,7 +34,7 @@
-
@@ -91,7 +91,20 @@ export default {
computed: {
previewImageList() {
- return this.imageList.map(item => item.imageUrl).filter(url => url)
+ // 从 imageList 中获取所有图片URL
+ return this.imageList
+ .map(item => {
+ if (item.originalData && item.originalData.filePath) {
+ const filePath = item.originalData.filePath
+ if (isExternal(filePath)) {
+ return filePath
+ } else {
+ return process.env.VUE_APP_FILE_URL + filePath
+ }
+ }
+ return item.imageUrl
+ })
+ .filter(url => url)
},
},
@@ -102,6 +115,15 @@ export default {
},
methods: {
+ getImageUrl(filePath) {
+ if (filePath) {
+ if (isExternal(filePath)) {
+ return filePath
+ } else {
+ return process.env.VUE_APP_FILE_URL + filePath
+ }
+ }
+ },
/** 初始化默认时间范围 */
initDefaultTimeRange() {
const now = new Date()
@@ -183,7 +205,7 @@ export default {
// 映射接口返回的数据到前端使用的格式
const list = (res.rows || []).map(item => {
// 处理图片路径,默认使用 test_image
- // let imageUrl = this.test_image
+ let imageUrl = ''
if (item.filePath) {
if (isExternal(item.filePath)) {
imageUrl = item.filePath