diff --git a/package.json b/package.json index 7b32d4d..84c75ec 100644 --- a/package.json +++ b/package.json @@ -24,10 +24,14 @@ "js-cookie": "2.2.0", "jsencrypt": "^3.0.0-rc.1", "leaflet": "^1.8.0", + "leaflet-rotatedmarker": "^0.2.0", + "leaflet.pm": "^2.2.0", "mockjs": "1.0.1-beta3", + "node-sass": "^6.0.1", "normalize.css": "7.0.0", "npm": "^6.11.3", "nprogress": "0.2.0", + "sass-loader": "^7.0.1", "v-charts": "^1.19.0", "vue": "2.5.17", "vue-amap": "^0.5.9", diff --git a/package.json b/package.json index 7b32d4d..84c75ec 100644 --- a/package.json +++ b/package.json @@ -24,10 +24,14 @@ "js-cookie": "2.2.0", "jsencrypt": "^3.0.0-rc.1", "leaflet": "^1.8.0", + "leaflet-rotatedmarker": "^0.2.0", + "leaflet.pm": "^2.2.0", "mockjs": "1.0.1-beta3", + "node-sass": "^6.0.1", "normalize.css": "7.0.0", "npm": "^6.11.3", "nprogress": "0.2.0", + "sass-loader": "^7.0.1", "v-charts": "^1.19.0", "vue": "2.5.17", "vue-amap": "^0.5.9", diff --git a/src/api/overview.js b/src/api/overview.js index 18f6446..e22debf 100644 --- a/src/api/overview.js +++ b/src/api/overview.js @@ -43,46 +43,44 @@ // 车辆 // 车辆定位列表 -export function getOverviewList(params) { +export function getOverviewList(url, data) { return request({ - url: 'busCarPosition/listPage', + url: url + '/listPage', + method: 'post', + data + }) +} +export function getOverviewAllList(url, data) { + return request({ + url: url + '/list', + method: 'post', + data + }) +} +export function offlineCount(url, params) { + return request({ + url: url + '/offlineCount', method: 'get', params }) } -export function getOverviewAllList(params) { +export function track(url, params) { return request({ - url: 'busCarPosition/list', + url: url + '/track', method: 'get', params }) } -export function offlineCount(params) { +export function trail(url, params) { return request({ - url: 'busCarPosition/offlineCount', + url: url + '/trace', method: 'get', params }) } -export function track(id) { +export function speedLine(url, params) { return request({ - url: 'busCarPosition/track', - method: 'get', - params: { - carId: id - } - }) -} -export function trail(params) { - return request({ - url: 'busCarPosition/trace', - method: 'get', - params - }) -} -export function speedLine(params) { - return request({ - url: 'busCarPosition/speedLine', + url: url + '/speedLine', method: 'get', params }) diff --git a/package.json b/package.json index 7b32d4d..84c75ec 100644 --- a/package.json +++ b/package.json @@ -24,10 +24,14 @@ "js-cookie": "2.2.0", "jsencrypt": "^3.0.0-rc.1", "leaflet": "^1.8.0", + "leaflet-rotatedmarker": "^0.2.0", + "leaflet.pm": "^2.2.0", "mockjs": "1.0.1-beta3", + "node-sass": "^6.0.1", "normalize.css": "7.0.0", "npm": "^6.11.3", "nprogress": "0.2.0", + "sass-loader": "^7.0.1", "v-charts": "^1.19.0", "vue": "2.5.17", "vue-amap": "^0.5.9", diff --git a/src/api/overview.js b/src/api/overview.js index 18f6446..e22debf 100644 --- a/src/api/overview.js +++ b/src/api/overview.js @@ -43,46 +43,44 @@ // 车辆 // 车辆定位列表 -export function getOverviewList(params) { +export function getOverviewList(url, data) { return request({ - url: 'busCarPosition/listPage', + url: url + '/listPage', + method: 'post', + data + }) +} +export function getOverviewAllList(url, data) { + return request({ + url: url + '/list', + method: 'post', + data + }) +} +export function offlineCount(url, params) { + return request({ + url: url + '/offlineCount', method: 'get', params }) } -export function getOverviewAllList(params) { +export function track(url, params) { return request({ - url: 'busCarPosition/list', + url: url + '/track', method: 'get', params }) } -export function offlineCount(params) { +export function trail(url, params) { return request({ - url: 'busCarPosition/offlineCount', + url: url + '/trace', method: 'get', params }) } -export function track(id) { +export function speedLine(url, params) { return request({ - url: 'busCarPosition/track', - method: 'get', - params: { - carId: id - } - }) -} -export function trail(params) { - return request({ - url: 'busCarPosition/trace', - method: 'get', - params - }) -} -export function speedLine(params) { - return request({ - url: 'busCarPosition/speedLine', + url: url + '/speedLine', method: 'get', params }) diff --git a/src/assets/global_images/bag-map.png b/src/assets/global_images/bag-map.png new file mode 100644 index 0000000..e3b85cc --- /dev/null +++ b/src/assets/global_images/bag-map.png Binary files differ diff --git a/package.json b/package.json index 7b32d4d..84c75ec 100644 --- a/package.json +++ b/package.json @@ -24,10 +24,14 @@ "js-cookie": "2.2.0", "jsencrypt": "^3.0.0-rc.1", "leaflet": "^1.8.0", + "leaflet-rotatedmarker": "^0.2.0", + "leaflet.pm": "^2.2.0", "mockjs": "1.0.1-beta3", + "node-sass": "^6.0.1", "normalize.css": "7.0.0", "npm": "^6.11.3", "nprogress": "0.2.0", + "sass-loader": "^7.0.1", "v-charts": "^1.19.0", "vue": "2.5.17", "vue-amap": "^0.5.9", diff --git a/src/api/overview.js b/src/api/overview.js index 18f6446..e22debf 100644 --- a/src/api/overview.js +++ b/src/api/overview.js @@ -43,46 +43,44 @@ // 车辆 // 车辆定位列表 -export function getOverviewList(params) { +export function getOverviewList(url, data) { return request({ - url: 'busCarPosition/listPage', + url: url + '/listPage', + method: 'post', + data + }) +} +export function getOverviewAllList(url, data) { + return request({ + url: url + '/list', + method: 'post', + data + }) +} +export function offlineCount(url, params) { + return request({ + url: url + '/offlineCount', method: 'get', params }) } -export function getOverviewAllList(params) { +export function track(url, params) { return request({ - url: 'busCarPosition/list', + url: url + '/track', method: 'get', params }) } -export function offlineCount(params) { +export function trail(url, params) { return request({ - url: 'busCarPosition/offlineCount', + url: url + '/trace', method: 'get', params }) } -export function track(id) { +export function speedLine(url, params) { return request({ - url: 'busCarPosition/track', - method: 'get', - params: { - carId: id - } - }) -} -export function trail(params) { - return request({ - url: 'busCarPosition/trace', - method: 'get', - params - }) -} -export function speedLine(params) { - return request({ - url: 'busCarPosition/speedLine', + url: url + '/speedLine', method: 'get', params }) diff --git a/src/assets/global_images/bag-map.png b/src/assets/global_images/bag-map.png new file mode 100644 index 0000000..e3b85cc --- /dev/null +++ b/src/assets/global_images/bag-map.png Binary files differ diff --git a/src/assets/global_images/bag.png b/src/assets/global_images/bag.png new file mode 100644 index 0000000..200b865 --- /dev/null +++ b/src/assets/global_images/bag.png Binary files differ diff --git a/package.json b/package.json index 7b32d4d..84c75ec 100644 --- a/package.json +++ b/package.json @@ -24,10 +24,14 @@ "js-cookie": "2.2.0", "jsencrypt": "^3.0.0-rc.1", "leaflet": "^1.8.0", + "leaflet-rotatedmarker": "^0.2.0", + "leaflet.pm": "^2.2.0", "mockjs": "1.0.1-beta3", + "node-sass": "^6.0.1", "normalize.css": "7.0.0", "npm": "^6.11.3", "nprogress": "0.2.0", + "sass-loader": "^7.0.1", "v-charts": "^1.19.0", "vue": "2.5.17", "vue-amap": "^0.5.9", diff --git a/src/api/overview.js b/src/api/overview.js index 18f6446..e22debf 100644 --- a/src/api/overview.js +++ b/src/api/overview.js @@ -43,46 +43,44 @@ // 车辆 // 车辆定位列表 -export function getOverviewList(params) { +export function getOverviewList(url, data) { return request({ - url: 'busCarPosition/listPage', + url: url + '/listPage', + method: 'post', + data + }) +} +export function getOverviewAllList(url, data) { + return request({ + url: url + '/list', + method: 'post', + data + }) +} +export function offlineCount(url, params) { + return request({ + url: url + '/offlineCount', method: 'get', params }) } -export function getOverviewAllList(params) { +export function track(url, params) { return request({ - url: 'busCarPosition/list', + url: url + '/track', method: 'get', params }) } -export function offlineCount(params) { +export function trail(url, params) { return request({ - url: 'busCarPosition/offlineCount', + url: url + '/trace', method: 'get', params }) } -export function track(id) { +export function speedLine(url, params) { return request({ - url: 'busCarPosition/track', - method: 'get', - params: { - carId: id - } - }) -} -export function trail(params) { - return request({ - url: 'busCarPosition/trace', - method: 'get', - params - }) -} -export function speedLine(params) { - return request({ - url: 'busCarPosition/speedLine', + url: url + '/speedLine', method: 'get', params }) diff --git a/src/assets/global_images/bag-map.png b/src/assets/global_images/bag-map.png new file mode 100644 index 0000000..e3b85cc --- /dev/null +++ b/src/assets/global_images/bag-map.png Binary files differ diff --git a/src/assets/global_images/bag.png b/src/assets/global_images/bag.png new file mode 100644 index 0000000..200b865 --- /dev/null +++ b/src/assets/global_images/bag.png Binary files differ diff --git a/src/assets/global_images/car-alarm.png b/src/assets/global_images/car-alarm.png index 4128ec9..a19e6e4 100644 --- a/src/assets/global_images/car-alarm.png +++ b/src/assets/global_images/car-alarm.png Binary files differ diff --git a/package.json b/package.json index 7b32d4d..84c75ec 100644 --- a/package.json +++ b/package.json @@ -24,10 +24,14 @@ "js-cookie": "2.2.0", "jsencrypt": "^3.0.0-rc.1", "leaflet": "^1.8.0", + "leaflet-rotatedmarker": "^0.2.0", + "leaflet.pm": "^2.2.0", "mockjs": "1.0.1-beta3", + "node-sass": "^6.0.1", "normalize.css": "7.0.0", "npm": "^6.11.3", "nprogress": "0.2.0", + "sass-loader": "^7.0.1", "v-charts": "^1.19.0", "vue": "2.5.17", "vue-amap": "^0.5.9", diff --git a/src/api/overview.js b/src/api/overview.js index 18f6446..e22debf 100644 --- a/src/api/overview.js +++ b/src/api/overview.js @@ -43,46 +43,44 @@ // 车辆 // 车辆定位列表 -export function getOverviewList(params) { +export function getOverviewList(url, data) { return request({ - url: 'busCarPosition/listPage', + url: url + '/listPage', + method: 'post', + data + }) +} +export function getOverviewAllList(url, data) { + return request({ + url: url + '/list', + method: 'post', + data + }) +} +export function offlineCount(url, params) { + return request({ + url: url + '/offlineCount', method: 'get', params }) } -export function getOverviewAllList(params) { +export function track(url, params) { return request({ - url: 'busCarPosition/list', + url: url + '/track', method: 'get', params }) } -export function offlineCount(params) { +export function trail(url, params) { return request({ - url: 'busCarPosition/offlineCount', + url: url + '/trace', method: 'get', params }) } -export function track(id) { +export function speedLine(url, params) { return request({ - url: 'busCarPosition/track', - method: 'get', - params: { - carId: id - } - }) -} -export function trail(params) { - return request({ - url: 'busCarPosition/trace', - method: 'get', - params - }) -} -export function speedLine(params) { - return request({ - url: 'busCarPosition/speedLine', + url: url + '/speedLine', method: 'get', params }) diff --git a/src/assets/global_images/bag-map.png b/src/assets/global_images/bag-map.png new file mode 100644 index 0000000..e3b85cc --- /dev/null +++ b/src/assets/global_images/bag-map.png Binary files differ diff --git a/src/assets/global_images/bag.png b/src/assets/global_images/bag.png new file mode 100644 index 0000000..200b865 --- /dev/null +++ b/src/assets/global_images/bag.png Binary files differ diff --git a/src/assets/global_images/car-alarm.png b/src/assets/global_images/car-alarm.png index 4128ec9..a19e6e4 100644 --- a/src/assets/global_images/car-alarm.png +++ b/src/assets/global_images/car-alarm.png Binary files differ diff --git a/src/assets/global_images/car-alarm1.png b/src/assets/global_images/car-alarm1.png new file mode 100644 index 0000000..4128ec9 --- /dev/null +++ b/src/assets/global_images/car-alarm1.png Binary files differ diff --git a/package.json b/package.json index 7b32d4d..84c75ec 100644 --- a/package.json +++ b/package.json @@ -24,10 +24,14 @@ "js-cookie": "2.2.0", "jsencrypt": "^3.0.0-rc.1", "leaflet": "^1.8.0", + "leaflet-rotatedmarker": "^0.2.0", + "leaflet.pm": "^2.2.0", "mockjs": "1.0.1-beta3", + "node-sass": "^6.0.1", "normalize.css": "7.0.0", "npm": "^6.11.3", "nprogress": "0.2.0", + "sass-loader": "^7.0.1", "v-charts": "^1.19.0", "vue": "2.5.17", "vue-amap": "^0.5.9", diff --git a/src/api/overview.js b/src/api/overview.js index 18f6446..e22debf 100644 --- a/src/api/overview.js +++ b/src/api/overview.js @@ -43,46 +43,44 @@ // 车辆 // 车辆定位列表 -export function getOverviewList(params) { +export function getOverviewList(url, data) { return request({ - url: 'busCarPosition/listPage', + url: url + '/listPage', + method: 'post', + data + }) +} +export function getOverviewAllList(url, data) { + return request({ + url: url + '/list', + method: 'post', + data + }) +} +export function offlineCount(url, params) { + return request({ + url: url + '/offlineCount', method: 'get', params }) } -export function getOverviewAllList(params) { +export function track(url, params) { return request({ - url: 'busCarPosition/list', + url: url + '/track', method: 'get', params }) } -export function offlineCount(params) { +export function trail(url, params) { return request({ - url: 'busCarPosition/offlineCount', + url: url + '/trace', method: 'get', params }) } -export function track(id) { +export function speedLine(url, params) { return request({ - url: 'busCarPosition/track', - method: 'get', - params: { - carId: id - } - }) -} -export function trail(params) { - return request({ - url: 'busCarPosition/trace', - method: 'get', - params - }) -} -export function speedLine(params) { - return request({ - url: 'busCarPosition/speedLine', + url: url + '/speedLine', method: 'get', params }) diff --git a/src/assets/global_images/bag-map.png b/src/assets/global_images/bag-map.png new file mode 100644 index 0000000..e3b85cc --- /dev/null +++ b/src/assets/global_images/bag-map.png Binary files differ diff --git a/src/assets/global_images/bag.png b/src/assets/global_images/bag.png new file mode 100644 index 0000000..200b865 --- /dev/null +++ b/src/assets/global_images/bag.png Binary files differ diff --git a/src/assets/global_images/car-alarm.png b/src/assets/global_images/car-alarm.png index 4128ec9..a19e6e4 100644 --- a/src/assets/global_images/car-alarm.png +++ b/src/assets/global_images/car-alarm.png Binary files differ diff --git a/src/assets/global_images/car-alarm1.png b/src/assets/global_images/car-alarm1.png new file mode 100644 index 0000000..4128ec9 --- /dev/null +++ b/src/assets/global_images/car-alarm1.png Binary files differ diff --git a/src/assets/global_images/car-offline.png b/src/assets/global_images/car-offline.png index 6a6fc19..a19e6e4 100644 --- a/src/assets/global_images/car-offline.png +++ b/src/assets/global_images/car-offline.png Binary files differ diff --git a/package.json b/package.json index 7b32d4d..84c75ec 100644 --- a/package.json +++ b/package.json @@ -24,10 +24,14 @@ "js-cookie": "2.2.0", "jsencrypt": "^3.0.0-rc.1", "leaflet": "^1.8.0", + "leaflet-rotatedmarker": "^0.2.0", + "leaflet.pm": "^2.2.0", "mockjs": "1.0.1-beta3", + "node-sass": "^6.0.1", "normalize.css": "7.0.0", "npm": "^6.11.3", "nprogress": "0.2.0", + "sass-loader": "^7.0.1", "v-charts": "^1.19.0", "vue": "2.5.17", "vue-amap": "^0.5.9", diff --git a/src/api/overview.js b/src/api/overview.js index 18f6446..e22debf 100644 --- a/src/api/overview.js +++ b/src/api/overview.js @@ -43,46 +43,44 @@ // 车辆 // 车辆定位列表 -export function getOverviewList(params) { +export function getOverviewList(url, data) { return request({ - url: 'busCarPosition/listPage', + url: url + '/listPage', + method: 'post', + data + }) +} +export function getOverviewAllList(url, data) { + return request({ + url: url + '/list', + method: 'post', + data + }) +} +export function offlineCount(url, params) { + return request({ + url: url + '/offlineCount', method: 'get', params }) } -export function getOverviewAllList(params) { +export function track(url, params) { return request({ - url: 'busCarPosition/list', + url: url + '/track', method: 'get', params }) } -export function offlineCount(params) { +export function trail(url, params) { return request({ - url: 'busCarPosition/offlineCount', + url: url + '/trace', method: 'get', params }) } -export function track(id) { +export function speedLine(url, params) { return request({ - url: 'busCarPosition/track', - method: 'get', - params: { - carId: id - } - }) -} -export function trail(params) { - return request({ - url: 'busCarPosition/trace', - method: 'get', - params - }) -} -export function speedLine(params) { - return request({ - url: 'busCarPosition/speedLine', + url: url + '/speedLine', method: 'get', params }) diff --git a/src/assets/global_images/bag-map.png b/src/assets/global_images/bag-map.png new file mode 100644 index 0000000..e3b85cc --- /dev/null +++ b/src/assets/global_images/bag-map.png Binary files differ diff --git a/src/assets/global_images/bag.png b/src/assets/global_images/bag.png new file mode 100644 index 0000000..200b865 --- /dev/null +++ b/src/assets/global_images/bag.png Binary files differ diff --git a/src/assets/global_images/car-alarm.png b/src/assets/global_images/car-alarm.png index 4128ec9..a19e6e4 100644 --- a/src/assets/global_images/car-alarm.png +++ b/src/assets/global_images/car-alarm.png Binary files differ diff --git a/src/assets/global_images/car-alarm1.png b/src/assets/global_images/car-alarm1.png new file mode 100644 index 0000000..4128ec9 --- /dev/null +++ b/src/assets/global_images/car-alarm1.png Binary files differ diff --git a/src/assets/global_images/car-offline.png b/src/assets/global_images/car-offline.png index 6a6fc19..a19e6e4 100644 --- a/src/assets/global_images/car-offline.png +++ b/src/assets/global_images/car-offline.png Binary files differ diff --git a/src/assets/global_images/car-offline1.png b/src/assets/global_images/car-offline1.png new file mode 100644 index 0000000..6a6fc19 --- /dev/null +++ b/src/assets/global_images/car-offline1.png Binary files differ diff --git a/package.json b/package.json index 7b32d4d..84c75ec 100644 --- a/package.json +++ b/package.json @@ -24,10 +24,14 @@ "js-cookie": "2.2.0", "jsencrypt": "^3.0.0-rc.1", "leaflet": "^1.8.0", + "leaflet-rotatedmarker": "^0.2.0", + "leaflet.pm": "^2.2.0", "mockjs": "1.0.1-beta3", + "node-sass": "^6.0.1", "normalize.css": "7.0.0", "npm": "^6.11.3", "nprogress": "0.2.0", + "sass-loader": "^7.0.1", "v-charts": "^1.19.0", "vue": "2.5.17", "vue-amap": "^0.5.9", diff --git a/src/api/overview.js b/src/api/overview.js index 18f6446..e22debf 100644 --- a/src/api/overview.js +++ b/src/api/overview.js @@ -43,46 +43,44 @@ // 车辆 // 车辆定位列表 -export function getOverviewList(params) { +export function getOverviewList(url, data) { return request({ - url: 'busCarPosition/listPage', + url: url + '/listPage', + method: 'post', + data + }) +} +export function getOverviewAllList(url, data) { + return request({ + url: url + '/list', + method: 'post', + data + }) +} +export function offlineCount(url, params) { + return request({ + url: url + '/offlineCount', method: 'get', params }) } -export function getOverviewAllList(params) { +export function track(url, params) { return request({ - url: 'busCarPosition/list', + url: url + '/track', method: 'get', params }) } -export function offlineCount(params) { +export function trail(url, params) { return request({ - url: 'busCarPosition/offlineCount', + url: url + '/trace', method: 'get', params }) } -export function track(id) { +export function speedLine(url, params) { return request({ - url: 'busCarPosition/track', - method: 'get', - params: { - carId: id - } - }) -} -export function trail(params) { - return request({ - url: 'busCarPosition/trace', - method: 'get', - params - }) -} -export function speedLine(params) { - return request({ - url: 'busCarPosition/speedLine', + url: url + '/speedLine', method: 'get', params }) diff --git a/src/assets/global_images/bag-map.png b/src/assets/global_images/bag-map.png new file mode 100644 index 0000000..e3b85cc --- /dev/null +++ b/src/assets/global_images/bag-map.png Binary files differ diff --git a/src/assets/global_images/bag.png b/src/assets/global_images/bag.png new file mode 100644 index 0000000..200b865 --- /dev/null +++ b/src/assets/global_images/bag.png Binary files differ diff --git a/src/assets/global_images/car-alarm.png b/src/assets/global_images/car-alarm.png index 4128ec9..a19e6e4 100644 --- a/src/assets/global_images/car-alarm.png +++ b/src/assets/global_images/car-alarm.png Binary files differ diff --git a/src/assets/global_images/car-alarm1.png b/src/assets/global_images/car-alarm1.png new file mode 100644 index 0000000..4128ec9 --- /dev/null +++ b/src/assets/global_images/car-alarm1.png Binary files differ diff --git a/src/assets/global_images/car-offline.png b/src/assets/global_images/car-offline.png index 6a6fc19..a19e6e4 100644 --- a/src/assets/global_images/car-offline.png +++ b/src/assets/global_images/car-offline.png Binary files differ diff --git a/src/assets/global_images/car-offline1.png b/src/assets/global_images/car-offline1.png new file mode 100644 index 0000000..6a6fc19 --- /dev/null +++ b/src/assets/global_images/car-offline1.png Binary files differ diff --git a/src/assets/global_images/car-online.png b/src/assets/global_images/car-online.png index c79e4f7..a19e6e4 100644 --- a/src/assets/global_images/car-online.png +++ b/src/assets/global_images/car-online.png Binary files differ diff --git a/package.json b/package.json index 7b32d4d..84c75ec 100644 --- a/package.json +++ b/package.json @@ -24,10 +24,14 @@ "js-cookie": "2.2.0", "jsencrypt": "^3.0.0-rc.1", "leaflet": "^1.8.0", + "leaflet-rotatedmarker": "^0.2.0", + "leaflet.pm": "^2.2.0", "mockjs": "1.0.1-beta3", + "node-sass": "^6.0.1", "normalize.css": "7.0.0", "npm": "^6.11.3", "nprogress": "0.2.0", + "sass-loader": "^7.0.1", "v-charts": "^1.19.0", "vue": "2.5.17", "vue-amap": "^0.5.9", diff --git a/src/api/overview.js b/src/api/overview.js index 18f6446..e22debf 100644 --- a/src/api/overview.js +++ b/src/api/overview.js @@ -43,46 +43,44 @@ // 车辆 // 车辆定位列表 -export function getOverviewList(params) { +export function getOverviewList(url, data) { return request({ - url: 'busCarPosition/listPage', + url: url + '/listPage', + method: 'post', + data + }) +} +export function getOverviewAllList(url, data) { + return request({ + url: url + '/list', + method: 'post', + data + }) +} +export function offlineCount(url, params) { + return request({ + url: url + '/offlineCount', method: 'get', params }) } -export function getOverviewAllList(params) { +export function track(url, params) { return request({ - url: 'busCarPosition/list', + url: url + '/track', method: 'get', params }) } -export function offlineCount(params) { +export function trail(url, params) { return request({ - url: 'busCarPosition/offlineCount', + url: url + '/trace', method: 'get', params }) } -export function track(id) { +export function speedLine(url, params) { return request({ - url: 'busCarPosition/track', - method: 'get', - params: { - carId: id - } - }) -} -export function trail(params) { - return request({ - url: 'busCarPosition/trace', - method: 'get', - params - }) -} -export function speedLine(params) { - return request({ - url: 'busCarPosition/speedLine', + url: url + '/speedLine', method: 'get', params }) diff --git a/src/assets/global_images/bag-map.png b/src/assets/global_images/bag-map.png new file mode 100644 index 0000000..e3b85cc --- /dev/null +++ b/src/assets/global_images/bag-map.png Binary files differ diff --git a/src/assets/global_images/bag.png b/src/assets/global_images/bag.png new file mode 100644 index 0000000..200b865 --- /dev/null +++ b/src/assets/global_images/bag.png Binary files differ diff --git a/src/assets/global_images/car-alarm.png b/src/assets/global_images/car-alarm.png index 4128ec9..a19e6e4 100644 --- a/src/assets/global_images/car-alarm.png +++ b/src/assets/global_images/car-alarm.png Binary files differ diff --git a/src/assets/global_images/car-alarm1.png b/src/assets/global_images/car-alarm1.png new file mode 100644 index 0000000..4128ec9 --- /dev/null +++ b/src/assets/global_images/car-alarm1.png Binary files differ diff --git a/src/assets/global_images/car-offline.png b/src/assets/global_images/car-offline.png index 6a6fc19..a19e6e4 100644 --- a/src/assets/global_images/car-offline.png +++ b/src/assets/global_images/car-offline.png Binary files differ diff --git a/src/assets/global_images/car-offline1.png b/src/assets/global_images/car-offline1.png new file mode 100644 index 0000000..6a6fc19 --- /dev/null +++ b/src/assets/global_images/car-offline1.png Binary files differ diff --git a/src/assets/global_images/car-online.png b/src/assets/global_images/car-online.png index c79e4f7..a19e6e4 100644 --- a/src/assets/global_images/car-online.png +++ b/src/assets/global_images/car-online.png Binary files differ diff --git a/src/assets/global_images/car-online1.png b/src/assets/global_images/car-online1.png new file mode 100644 index 0000000..c79e4f7 --- /dev/null +++ b/src/assets/global_images/car-online1.png Binary files differ diff --git a/package.json b/package.json index 7b32d4d..84c75ec 100644 --- a/package.json +++ b/package.json @@ -24,10 +24,14 @@ "js-cookie": "2.2.0", "jsencrypt": "^3.0.0-rc.1", "leaflet": "^1.8.0", + "leaflet-rotatedmarker": "^0.2.0", + "leaflet.pm": "^2.2.0", "mockjs": "1.0.1-beta3", + "node-sass": "^6.0.1", "normalize.css": "7.0.0", "npm": "^6.11.3", "nprogress": "0.2.0", + "sass-loader": "^7.0.1", "v-charts": "^1.19.0", "vue": "2.5.17", "vue-amap": "^0.5.9", diff --git a/src/api/overview.js b/src/api/overview.js index 18f6446..e22debf 100644 --- a/src/api/overview.js +++ b/src/api/overview.js @@ -43,46 +43,44 @@ // 车辆 // 车辆定位列表 -export function getOverviewList(params) { +export function getOverviewList(url, data) { return request({ - url: 'busCarPosition/listPage', + url: url + '/listPage', + method: 'post', + data + }) +} +export function getOverviewAllList(url, data) { + return request({ + url: url + '/list', + method: 'post', + data + }) +} +export function offlineCount(url, params) { + return request({ + url: url + '/offlineCount', method: 'get', params }) } -export function getOverviewAllList(params) { +export function track(url, params) { return request({ - url: 'busCarPosition/list', + url: url + '/track', method: 'get', params }) } -export function offlineCount(params) { +export function trail(url, params) { return request({ - url: 'busCarPosition/offlineCount', + url: url + '/trace', method: 'get', params }) } -export function track(id) { +export function speedLine(url, params) { return request({ - url: 'busCarPosition/track', - method: 'get', - params: { - carId: id - } - }) -} -export function trail(params) { - return request({ - url: 'busCarPosition/trace', - method: 'get', - params - }) -} -export function speedLine(params) { - return request({ - url: 'busCarPosition/speedLine', + url: url + '/speedLine', method: 'get', params }) diff --git a/src/assets/global_images/bag-map.png b/src/assets/global_images/bag-map.png new file mode 100644 index 0000000..e3b85cc --- /dev/null +++ b/src/assets/global_images/bag-map.png Binary files differ diff --git a/src/assets/global_images/bag.png b/src/assets/global_images/bag.png new file mode 100644 index 0000000..200b865 --- /dev/null +++ b/src/assets/global_images/bag.png Binary files differ diff --git a/src/assets/global_images/car-alarm.png b/src/assets/global_images/car-alarm.png index 4128ec9..a19e6e4 100644 --- a/src/assets/global_images/car-alarm.png +++ b/src/assets/global_images/car-alarm.png Binary files differ diff --git a/src/assets/global_images/car-alarm1.png b/src/assets/global_images/car-alarm1.png new file mode 100644 index 0000000..4128ec9 --- /dev/null +++ b/src/assets/global_images/car-alarm1.png Binary files differ diff --git a/src/assets/global_images/car-offline.png b/src/assets/global_images/car-offline.png index 6a6fc19..a19e6e4 100644 --- a/src/assets/global_images/car-offline.png +++ b/src/assets/global_images/car-offline.png Binary files differ diff --git a/src/assets/global_images/car-offline1.png b/src/assets/global_images/car-offline1.png new file mode 100644 index 0000000..6a6fc19 --- /dev/null +++ b/src/assets/global_images/car-offline1.png Binary files differ diff --git a/src/assets/global_images/car-online.png b/src/assets/global_images/car-online.png index c79e4f7..a19e6e4 100644 --- a/src/assets/global_images/car-online.png +++ b/src/assets/global_images/car-online.png Binary files differ diff --git a/src/assets/global_images/car-online1.png b/src/assets/global_images/car-online1.png new file mode 100644 index 0000000..c79e4f7 --- /dev/null +++ b/src/assets/global_images/car-online1.png Binary files differ diff --git a/src/assets/global_images/car-stop.png b/src/assets/global_images/car-stop.png index 77b125d..a19e6e4 100644 --- a/src/assets/global_images/car-stop.png +++ b/src/assets/global_images/car-stop.png Binary files differ diff --git a/package.json b/package.json index 7b32d4d..84c75ec 100644 --- a/package.json +++ b/package.json @@ -24,10 +24,14 @@ "js-cookie": "2.2.0", "jsencrypt": "^3.0.0-rc.1", "leaflet": "^1.8.0", + "leaflet-rotatedmarker": "^0.2.0", + "leaflet.pm": "^2.2.0", "mockjs": "1.0.1-beta3", + "node-sass": "^6.0.1", "normalize.css": "7.0.0", "npm": "^6.11.3", "nprogress": "0.2.0", + "sass-loader": "^7.0.1", "v-charts": "^1.19.0", "vue": "2.5.17", "vue-amap": "^0.5.9", diff --git a/src/api/overview.js b/src/api/overview.js index 18f6446..e22debf 100644 --- a/src/api/overview.js +++ b/src/api/overview.js @@ -43,46 +43,44 @@ // 车辆 // 车辆定位列表 -export function getOverviewList(params) { +export function getOverviewList(url, data) { return request({ - url: 'busCarPosition/listPage', + url: url + '/listPage', + method: 'post', + data + }) +} +export function getOverviewAllList(url, data) { + return request({ + url: url + '/list', + method: 'post', + data + }) +} +export function offlineCount(url, params) { + return request({ + url: url + '/offlineCount', method: 'get', params }) } -export function getOverviewAllList(params) { +export function track(url, params) { return request({ - url: 'busCarPosition/list', + url: url + '/track', method: 'get', params }) } -export function offlineCount(params) { +export function trail(url, params) { return request({ - url: 'busCarPosition/offlineCount', + url: url + '/trace', method: 'get', params }) } -export function track(id) { +export function speedLine(url, params) { return request({ - url: 'busCarPosition/track', - method: 'get', - params: { - carId: id - } - }) -} -export function trail(params) { - return request({ - url: 'busCarPosition/trace', - method: 'get', - params - }) -} -export function speedLine(params) { - return request({ - url: 'busCarPosition/speedLine', + url: url + '/speedLine', method: 'get', params }) diff --git a/src/assets/global_images/bag-map.png b/src/assets/global_images/bag-map.png new file mode 100644 index 0000000..e3b85cc --- /dev/null +++ b/src/assets/global_images/bag-map.png Binary files differ diff --git a/src/assets/global_images/bag.png b/src/assets/global_images/bag.png new file mode 100644 index 0000000..200b865 --- /dev/null +++ b/src/assets/global_images/bag.png Binary files differ diff --git a/src/assets/global_images/car-alarm.png b/src/assets/global_images/car-alarm.png index 4128ec9..a19e6e4 100644 --- a/src/assets/global_images/car-alarm.png +++ b/src/assets/global_images/car-alarm.png Binary files differ diff --git a/src/assets/global_images/car-alarm1.png b/src/assets/global_images/car-alarm1.png new file mode 100644 index 0000000..4128ec9 --- /dev/null +++ b/src/assets/global_images/car-alarm1.png Binary files differ diff --git a/src/assets/global_images/car-offline.png b/src/assets/global_images/car-offline.png index 6a6fc19..a19e6e4 100644 --- a/src/assets/global_images/car-offline.png +++ b/src/assets/global_images/car-offline.png Binary files differ diff --git a/src/assets/global_images/car-offline1.png b/src/assets/global_images/car-offline1.png new file mode 100644 index 0000000..6a6fc19 --- /dev/null +++ b/src/assets/global_images/car-offline1.png Binary files differ diff --git a/src/assets/global_images/car-online.png b/src/assets/global_images/car-online.png index c79e4f7..a19e6e4 100644 --- a/src/assets/global_images/car-online.png +++ b/src/assets/global_images/car-online.png Binary files differ diff --git a/src/assets/global_images/car-online1.png b/src/assets/global_images/car-online1.png new file mode 100644 index 0000000..c79e4f7 --- /dev/null +++ b/src/assets/global_images/car-online1.png Binary files differ diff --git a/src/assets/global_images/car-stop.png b/src/assets/global_images/car-stop.png index 77b125d..a19e6e4 100644 --- a/src/assets/global_images/car-stop.png +++ b/src/assets/global_images/car-stop.png Binary files differ diff --git a/src/assets/global_images/car-stop1.png b/src/assets/global_images/car-stop1.png new file mode 100644 index 0000000..77b125d --- /dev/null +++ b/src/assets/global_images/car-stop1.png Binary files differ diff --git a/package.json b/package.json index 7b32d4d..84c75ec 100644 --- a/package.json +++ b/package.json @@ -24,10 +24,14 @@ "js-cookie": "2.2.0", "jsencrypt": "^3.0.0-rc.1", "leaflet": "^1.8.0", + "leaflet-rotatedmarker": "^0.2.0", + "leaflet.pm": "^2.2.0", "mockjs": "1.0.1-beta3", + "node-sass": "^6.0.1", "normalize.css": "7.0.0", "npm": "^6.11.3", "nprogress": "0.2.0", + "sass-loader": "^7.0.1", "v-charts": "^1.19.0", "vue": "2.5.17", "vue-amap": "^0.5.9", diff --git a/src/api/overview.js b/src/api/overview.js index 18f6446..e22debf 100644 --- a/src/api/overview.js +++ b/src/api/overview.js @@ -43,46 +43,44 @@ // 车辆 // 车辆定位列表 -export function getOverviewList(params) { +export function getOverviewList(url, data) { return request({ - url: 'busCarPosition/listPage', + url: url + '/listPage', + method: 'post', + data + }) +} +export function getOverviewAllList(url, data) { + return request({ + url: url + '/list', + method: 'post', + data + }) +} +export function offlineCount(url, params) { + return request({ + url: url + '/offlineCount', method: 'get', params }) } -export function getOverviewAllList(params) { +export function track(url, params) { return request({ - url: 'busCarPosition/list', + url: url + '/track', method: 'get', params }) } -export function offlineCount(params) { +export function trail(url, params) { return request({ - url: 'busCarPosition/offlineCount', + url: url + '/trace', method: 'get', params }) } -export function track(id) { +export function speedLine(url, params) { return request({ - url: 'busCarPosition/track', - method: 'get', - params: { - carId: id - } - }) -} -export function trail(params) { - return request({ - url: 'busCarPosition/trace', - method: 'get', - params - }) -} -export function speedLine(params) { - return request({ - url: 'busCarPosition/speedLine', + url: url + '/speedLine', method: 'get', params }) diff --git a/src/assets/global_images/bag-map.png b/src/assets/global_images/bag-map.png new file mode 100644 index 0000000..e3b85cc --- /dev/null +++ b/src/assets/global_images/bag-map.png Binary files differ diff --git a/src/assets/global_images/bag.png b/src/assets/global_images/bag.png new file mode 100644 index 0000000..200b865 --- /dev/null +++ b/src/assets/global_images/bag.png Binary files differ diff --git a/src/assets/global_images/car-alarm.png b/src/assets/global_images/car-alarm.png index 4128ec9..a19e6e4 100644 --- a/src/assets/global_images/car-alarm.png +++ b/src/assets/global_images/car-alarm.png Binary files differ diff --git a/src/assets/global_images/car-alarm1.png b/src/assets/global_images/car-alarm1.png new file mode 100644 index 0000000..4128ec9 --- /dev/null +++ b/src/assets/global_images/car-alarm1.png Binary files differ diff --git a/src/assets/global_images/car-offline.png b/src/assets/global_images/car-offline.png index 6a6fc19..a19e6e4 100644 --- a/src/assets/global_images/car-offline.png +++ b/src/assets/global_images/car-offline.png Binary files differ diff --git a/src/assets/global_images/car-offline1.png b/src/assets/global_images/car-offline1.png new file mode 100644 index 0000000..6a6fc19 --- /dev/null +++ b/src/assets/global_images/car-offline1.png Binary files differ diff --git a/src/assets/global_images/car-online.png b/src/assets/global_images/car-online.png index c79e4f7..a19e6e4 100644 --- a/src/assets/global_images/car-online.png +++ b/src/assets/global_images/car-online.png Binary files differ diff --git a/src/assets/global_images/car-online1.png b/src/assets/global_images/car-online1.png new file mode 100644 index 0000000..c79e4f7 --- /dev/null +++ b/src/assets/global_images/car-online1.png Binary files differ diff --git a/src/assets/global_images/car-stop.png b/src/assets/global_images/car-stop.png index 77b125d..a19e6e4 100644 --- a/src/assets/global_images/car-stop.png +++ b/src/assets/global_images/car-stop.png Binary files differ diff --git a/src/assets/global_images/car-stop1.png b/src/assets/global_images/car-stop1.png new file mode 100644 index 0000000..77b125d --- /dev/null +++ b/src/assets/global_images/car-stop1.png Binary files differ diff --git a/src/router/index.js b/src/router/index.js index 808ada2..6b348f4 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -60,14 +60,14 @@ name: 'Track', hidden: true, component: () => import('@/views/car/track'), - meta: { title: '消防车实时位置追踪', icon: 'function' } + meta: { title: '实时位置追踪', icon: 'function' } }, { path: '/trail', name: 'Trail', hidden: true, component: () => import('@/views/car/trail'), - meta: { title: '消防车历史轨迹', icon: 'function' } + meta: { title: '历史轨迹', icon: 'function' } } ] } diff --git a/package.json b/package.json index 7b32d4d..84c75ec 100644 --- a/package.json +++ b/package.json @@ -24,10 +24,14 @@ "js-cookie": "2.2.0", "jsencrypt": "^3.0.0-rc.1", "leaflet": "^1.8.0", + "leaflet-rotatedmarker": "^0.2.0", + "leaflet.pm": "^2.2.0", "mockjs": "1.0.1-beta3", + "node-sass": "^6.0.1", "normalize.css": "7.0.0", "npm": "^6.11.3", "nprogress": "0.2.0", + "sass-loader": "^7.0.1", "v-charts": "^1.19.0", "vue": "2.5.17", "vue-amap": "^0.5.9", diff --git a/src/api/overview.js b/src/api/overview.js index 18f6446..e22debf 100644 --- a/src/api/overview.js +++ b/src/api/overview.js @@ -43,46 +43,44 @@ // 车辆 // 车辆定位列表 -export function getOverviewList(params) { +export function getOverviewList(url, data) { return request({ - url: 'busCarPosition/listPage', + url: url + '/listPage', + method: 'post', + data + }) +} +export function getOverviewAllList(url, data) { + return request({ + url: url + '/list', + method: 'post', + data + }) +} +export function offlineCount(url, params) { + return request({ + url: url + '/offlineCount', method: 'get', params }) } -export function getOverviewAllList(params) { +export function track(url, params) { return request({ - url: 'busCarPosition/list', + url: url + '/track', method: 'get', params }) } -export function offlineCount(params) { +export function trail(url, params) { return request({ - url: 'busCarPosition/offlineCount', + url: url + '/trace', method: 'get', params }) } -export function track(id) { +export function speedLine(url, params) { return request({ - url: 'busCarPosition/track', - method: 'get', - params: { - carId: id - } - }) -} -export function trail(params) { - return request({ - url: 'busCarPosition/trace', - method: 'get', - params - }) -} -export function speedLine(params) { - return request({ - url: 'busCarPosition/speedLine', + url: url + '/speedLine', method: 'get', params }) diff --git a/src/assets/global_images/bag-map.png b/src/assets/global_images/bag-map.png new file mode 100644 index 0000000..e3b85cc --- /dev/null +++ b/src/assets/global_images/bag-map.png Binary files differ diff --git a/src/assets/global_images/bag.png b/src/assets/global_images/bag.png new file mode 100644 index 0000000..200b865 --- /dev/null +++ b/src/assets/global_images/bag.png Binary files differ diff --git a/src/assets/global_images/car-alarm.png b/src/assets/global_images/car-alarm.png index 4128ec9..a19e6e4 100644 --- a/src/assets/global_images/car-alarm.png +++ b/src/assets/global_images/car-alarm.png Binary files differ diff --git a/src/assets/global_images/car-alarm1.png b/src/assets/global_images/car-alarm1.png new file mode 100644 index 0000000..4128ec9 --- /dev/null +++ b/src/assets/global_images/car-alarm1.png Binary files differ diff --git a/src/assets/global_images/car-offline.png b/src/assets/global_images/car-offline.png index 6a6fc19..a19e6e4 100644 --- a/src/assets/global_images/car-offline.png +++ b/src/assets/global_images/car-offline.png Binary files differ diff --git a/src/assets/global_images/car-offline1.png b/src/assets/global_images/car-offline1.png new file mode 100644 index 0000000..6a6fc19 --- /dev/null +++ b/src/assets/global_images/car-offline1.png Binary files differ diff --git a/src/assets/global_images/car-online.png b/src/assets/global_images/car-online.png index c79e4f7..a19e6e4 100644 --- a/src/assets/global_images/car-online.png +++ b/src/assets/global_images/car-online.png Binary files differ diff --git a/src/assets/global_images/car-online1.png b/src/assets/global_images/car-online1.png new file mode 100644 index 0000000..c79e4f7 --- /dev/null +++ b/src/assets/global_images/car-online1.png Binary files differ diff --git a/src/assets/global_images/car-stop.png b/src/assets/global_images/car-stop.png index 77b125d..a19e6e4 100644 --- a/src/assets/global_images/car-stop.png +++ b/src/assets/global_images/car-stop.png Binary files differ diff --git a/src/assets/global_images/car-stop1.png b/src/assets/global_images/car-stop1.png new file mode 100644 index 0000000..77b125d --- /dev/null +++ b/src/assets/global_images/car-stop1.png Binary files differ diff --git a/src/router/index.js b/src/router/index.js index 808ada2..6b348f4 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -60,14 +60,14 @@ name: 'Track', hidden: true, component: () => import('@/views/car/track'), - meta: { title: '消防车实时位置追踪', icon: 'function' } + meta: { title: '实时位置追踪', icon: 'function' } }, { path: '/trail', name: 'Trail', hidden: true, component: () => import('@/views/car/trail'), - meta: { title: '消防车历史轨迹', icon: 'function' } + meta: { title: '历史轨迹', icon: 'function' } } ] } diff --git a/src/views/car/listoverview.vue b/src/views/car/listoverview.vue index ea8528e..1ad2606 100644 --- a/src/views/car/listoverview.vue +++ b/src/views/car/listoverview.vue @@ -1,7 +1,7 @@ + + +
-
+
@@ -101,6 +108,10 @@
灭火器
+ + +
背负式
+
@@ -131,6 +142,7 @@ listQuery: { description: '', wellType: '', + backpackCode: '', carCode: '', carType: '', deptId: '', @@ -158,6 +170,25 @@ width: 70 } ], + '背负式': [ + { + text: '背包描述', + value: 'description', + align: 'center' + }, + { + text: '背包编号', + value: 'backpackCode', + align: 'center', + width: 90 + }, + { + text: '状态', + value: 'status', + align: 'center', + width: 70 + } + ], '井盖': [ { text: '井盖编号', @@ -180,7 +211,7 @@ text: '消防栓编号', value: 'wellCode', align: 'center' - }, + }, { text: '消防栓名称', value: 'wellName', @@ -198,7 +229,7 @@ text: '灭火器编号', value: 'wellCode', align: 'center' - }, + }, { text: '灭火器名称', value: 'wellName', @@ -261,6 +292,7 @@ this.$router.push({ name: 'Track', query: { + type: this.bottombtn, id: id } }) @@ -269,8 +301,9 @@ this.$router.push({ name: 'Trail', query: { + type: this.bottombtn, id: id, - name: row.carCode + '-' + row.carTypeName + name: this.bottombtn === '消防车' ? row.carCode + '-' + row.carTypeName : row.backpackCode + '-背负式' } }) }, @@ -335,44 +368,43 @@ } } }, - fetchData(isNowPage = true) { - this.listLoading = true - this.list = [] - if (this.bottombtn === '消防车') { - offlineCount(this.listQuery).then(response => { - this.online = response.data.online - this.offline = response.data.offline - }) - this.sec = Number(this.refresh) - if (!isNowPage) { - this.listQuery.offset = 1 - } - getOverviewList(this.listQuery).then(response => { - this.list = response.data.rows - this.total = parseInt(response.data.total) - this.listLoading = false - }) - getOverviewAllList(this.listQuery).then(response => { - this.alllist = response.data - if (this.pointlayer !== null) this.map.removeLayer(this.pointlayer) - this.pointlayer = new L.layerGroup().addTo(this.map) - var list = [] - for (i = 0; i < this.alllist.length; i++) { - if (Number(this.alllist[i].lat) === 0 && Number(this.alllist[i].lng) === 0) { - continue - } - var item = [Number(this.alllist[i].lat), Number(this.alllist[i].lng)] - list.push(item) + initCar(isNowPage = true, url) { + offlineCount(url, this.listQuery).then(response => { + this.online = response.data.online + this.offline = response.data.offline + }) + this.sec = Number(this.refresh) + if (!isNowPage) { + this.listQuery.offset = 1 + } + getOverviewList(url, this.listQuery).then(response => { + this.list = response.data.rows + this.total = response.data.total + this.listLoading = false + }) + getOverviewAllList(url, this.listQuery).then(response => { + this.alllist = response.data + if (this.pointlayer !== null) this.map.removeLayer(this.pointlayer) + this.pointlayer = new L.layerGroup().addTo(this.map) + var list = [] + for (i = 0; i < this.alllist.length; i++) { + if (Number(this.alllist[i].lat) === 0 && Number(this.alllist[i].lng) === 0) { + continue } - // if (list.length !== 0) { - // this.setZoom(list) - // } - var Icon - for (var i = 0; i < this.alllist.length; i++) { - if (i === 0 && !this.initlocation) { - this.map.setView({ lat: this.alllist[0].lat, lng: this.alllist[0].lng }, 16) - this.initlocation = true - } + var item = [Number(this.alllist[i].lat), Number(this.alllist[i].lng)] + list.push(item) + } + if (list.length !== 0) { + // this.setZoom(list) + this.map.setView({ lat: this.alllist[0].lat, lng: this.alllist[0].lng }, 10) + } + var Icon + for (var i = 0; i < this.alllist.length; i++) { + if (i === 0 && !this.initlocation) { + this.map.setView({ lat: this.alllist[0].lat, lng: this.alllist[0].lng }, 16) + this.initlocation = true + } + if (this.bottombtn === '消防车') { if (this.alllist[i].status === '离线') { Icon = L.icon({ iconUrl: require('../../assets/global_images/car-offline.png'), // 灰 @@ -399,22 +431,35 @@ iconSize: [40, 40] }) } - var myIcon = L.divIcon({ - html: '
' + this.alllist[i].description + '
', - className: '', - iconSize: [100, 15] + } else { + Icon = L.icon({ + iconUrl: require('../../assets/global_images/bag-map.png'), // 灰 + iconSize: [30, 30] }) - L.marker([this.alllist[i].lat, this.alllist[i].lng], { icon: myIcon }).addTo(this.pointlayer) - const { carId, description, carTypeName, deptName, status, lng, lat, upTime, speed, liquidValue } = this.alllist[i] - var btndetail = 'btndetail' + carId - var btntrack = 'btntrack' + carId - var btntrail = 'btntrail' + carId - var str = `
车辆位置概要信息
+ } + var myIcon = L.divIcon({ + html: '
' + this.alllist[i].description + '
', + className: '', + iconSize: [100, 15] + }) + L.marker([this.alllist[i].lat, this.alllist[i].lng], { icon: myIcon }).addTo(this.pointlayer) + const { carId, backpackId, description, carTypeName, deptName, status, lng, lat, upTime, speed, liquidValue } = this.alllist[i] + var btndetail, btntrack, btntrail + if (this.bottombtn === '消防车') { + btndetail = 'btndetail' + carId + btntrack = 'btntrack' + carId + btntrail = 'btntrail' + carId + } else { + btndetail = 'btndetail' + backpackId + btntrack = 'btntrack' + backpackId + btntrail = 'btntrail' + backpackId + } + //
${carTypeName}
+ var str = `
${this.bottombtn}位置概要信息
${description}
-
${carTypeName}
${deptName}
${status}
-
${lng} , ${lat}
+
${Number(lng).toFixed(6)} , ${Number(lat).toFixed(6)}
${upTime}
${speed} (km/h)
${liquidValue}
@@ -422,34 +467,42 @@
` - var popup = L.popup().setContent(str) - var marker = L.marker([this.alllist[i].lat, this.alllist[i].lng], { - icon: Icon, - slug: this.alllist[i], - rotationAngle: this.alllist[i].direction, - zIndexOffset: 100000 - }).addTo(this.pointlayer).bindPopup(popup) + var popup = L.popup().setContent(str) + var marker = L.marker([this.alllist[i].lat, this.alllist[i].lng], { + icon: Icon, + slug: this.alllist[i], + rotationAngle: this.alllist[i].direction, + zIndexOffset: 100000 + }).addTo(this.pointlayer).bindPopup(popup) - var that = this - marker.on('click', function(e) { - var carId = e.sourceTarget.options.slug.carId - var btndetail = 'btndetail' + carId - var btntrack = 'btntrack' + carId - var btntrail = 'btntrail' + carId - console.log('按钮:', document.getElementById(btndetail)) - // document.getElementById(btndetail).onclick = function() { - // console.log('carId:', e.sourceTarget.options.slug.carId) - // that.detail(e.sourceTarget.options.slug.carId) - // } - document.getElementById(btntrack).onclick = function() { - that.track(e.sourceTarget.options.slug.carId) - } - document.getElementById(btntrail).onclick = function() { - that.trail(e.sourceTarget.options.slug.carId, e.sourceTarget.options.slug) - } - }) - } - }) + var that = this + marker.on('click', function(e) { + var carId = that.bottombtn === '消防车' ? e.sourceTarget.options.slug.carId : e.sourceTarget.options.slug.backpackId + var btndetail = 'btndetail' + carId + var btntrack = 'btntrack' + carId + var btntrail = 'btntrail' + carId + // console.log('按钮:', document.getElementById(btndetail)) + // document.getElementById(btndetail).onclick = function() { + // console.log('carId:', e.sourceTarget.options.slug.carId) + // that.detail(e.sourceTarget.options.slug.carId) + // } + document.getElementById(btntrack).onclick = function() { + that.track(carId) + } + document.getElementById(btntrail).onclick = function() { + that.trail(carId, e.sourceTarget.options.slug) + } + }) + } + }) + }, + fetchData(isNowPage = true) { + this.listLoading = true + this.list = [] + if (this.bottombtn === '消防车') { + this.initCar(isNowPage, 'busCarPosition') + } else if (this.bottombtn === '背负式') { + this.initCar(isNowPage, 'backpackPosition') } else { this.inittable(this.bottombtn) } diff --git a/package.json b/package.json index 7b32d4d..84c75ec 100644 --- a/package.json +++ b/package.json @@ -24,10 +24,14 @@ "js-cookie": "2.2.0", "jsencrypt": "^3.0.0-rc.1", "leaflet": "^1.8.0", + "leaflet-rotatedmarker": "^0.2.0", + "leaflet.pm": "^2.2.0", "mockjs": "1.0.1-beta3", + "node-sass": "^6.0.1", "normalize.css": "7.0.0", "npm": "^6.11.3", "nprogress": "0.2.0", + "sass-loader": "^7.0.1", "v-charts": "^1.19.0", "vue": "2.5.17", "vue-amap": "^0.5.9", diff --git a/src/api/overview.js b/src/api/overview.js index 18f6446..e22debf 100644 --- a/src/api/overview.js +++ b/src/api/overview.js @@ -43,46 +43,44 @@ // 车辆 // 车辆定位列表 -export function getOverviewList(params) { +export function getOverviewList(url, data) { return request({ - url: 'busCarPosition/listPage', + url: url + '/listPage', + method: 'post', + data + }) +} +export function getOverviewAllList(url, data) { + return request({ + url: url + '/list', + method: 'post', + data + }) +} +export function offlineCount(url, params) { + return request({ + url: url + '/offlineCount', method: 'get', params }) } -export function getOverviewAllList(params) { +export function track(url, params) { return request({ - url: 'busCarPosition/list', + url: url + '/track', method: 'get', params }) } -export function offlineCount(params) { +export function trail(url, params) { return request({ - url: 'busCarPosition/offlineCount', + url: url + '/trace', method: 'get', params }) } -export function track(id) { +export function speedLine(url, params) { return request({ - url: 'busCarPosition/track', - method: 'get', - params: { - carId: id - } - }) -} -export function trail(params) { - return request({ - url: 'busCarPosition/trace', - method: 'get', - params - }) -} -export function speedLine(params) { - return request({ - url: 'busCarPosition/speedLine', + url: url + '/speedLine', method: 'get', params }) diff --git a/src/assets/global_images/bag-map.png b/src/assets/global_images/bag-map.png new file mode 100644 index 0000000..e3b85cc --- /dev/null +++ b/src/assets/global_images/bag-map.png Binary files differ diff --git a/src/assets/global_images/bag.png b/src/assets/global_images/bag.png new file mode 100644 index 0000000..200b865 --- /dev/null +++ b/src/assets/global_images/bag.png Binary files differ diff --git a/src/assets/global_images/car-alarm.png b/src/assets/global_images/car-alarm.png index 4128ec9..a19e6e4 100644 --- a/src/assets/global_images/car-alarm.png +++ b/src/assets/global_images/car-alarm.png Binary files differ diff --git a/src/assets/global_images/car-alarm1.png b/src/assets/global_images/car-alarm1.png new file mode 100644 index 0000000..4128ec9 --- /dev/null +++ b/src/assets/global_images/car-alarm1.png Binary files differ diff --git a/src/assets/global_images/car-offline.png b/src/assets/global_images/car-offline.png index 6a6fc19..a19e6e4 100644 --- a/src/assets/global_images/car-offline.png +++ b/src/assets/global_images/car-offline.png Binary files differ diff --git a/src/assets/global_images/car-offline1.png b/src/assets/global_images/car-offline1.png new file mode 100644 index 0000000..6a6fc19 --- /dev/null +++ b/src/assets/global_images/car-offline1.png Binary files differ diff --git a/src/assets/global_images/car-online.png b/src/assets/global_images/car-online.png index c79e4f7..a19e6e4 100644 --- a/src/assets/global_images/car-online.png +++ b/src/assets/global_images/car-online.png Binary files differ diff --git a/src/assets/global_images/car-online1.png b/src/assets/global_images/car-online1.png new file mode 100644 index 0000000..c79e4f7 --- /dev/null +++ b/src/assets/global_images/car-online1.png Binary files differ diff --git a/src/assets/global_images/car-stop.png b/src/assets/global_images/car-stop.png index 77b125d..a19e6e4 100644 --- a/src/assets/global_images/car-stop.png +++ b/src/assets/global_images/car-stop.png Binary files differ diff --git a/src/assets/global_images/car-stop1.png b/src/assets/global_images/car-stop1.png new file mode 100644 index 0000000..77b125d --- /dev/null +++ b/src/assets/global_images/car-stop1.png Binary files differ diff --git a/src/router/index.js b/src/router/index.js index 808ada2..6b348f4 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -60,14 +60,14 @@ name: 'Track', hidden: true, component: () => import('@/views/car/track'), - meta: { title: '消防车实时位置追踪', icon: 'function' } + meta: { title: '实时位置追踪', icon: 'function' } }, { path: '/trail', name: 'Trail', hidden: true, component: () => import('@/views/car/trail'), - meta: { title: '消防车历史轨迹', icon: 'function' } + meta: { title: '历史轨迹', icon: 'function' } } ] } diff --git a/src/views/car/listoverview.vue b/src/views/car/listoverview.vue index ea8528e..1ad2606 100644 --- a/src/views/car/listoverview.vue +++ b/src/views/car/listoverview.vue @@ -1,7 +1,7 @@ + + +
-
+
@@ -101,6 +108,10 @@
灭火器
+ + +
背负式
+
@@ -131,6 +142,7 @@ listQuery: { description: '', wellType: '', + backpackCode: '', carCode: '', carType: '', deptId: '', @@ -158,6 +170,25 @@ width: 70 } ], + '背负式': [ + { + text: '背包描述', + value: 'description', + align: 'center' + }, + { + text: '背包编号', + value: 'backpackCode', + align: 'center', + width: 90 + }, + { + text: '状态', + value: 'status', + align: 'center', + width: 70 + } + ], '井盖': [ { text: '井盖编号', @@ -180,7 +211,7 @@ text: '消防栓编号', value: 'wellCode', align: 'center' - }, + }, { text: '消防栓名称', value: 'wellName', @@ -198,7 +229,7 @@ text: '灭火器编号', value: 'wellCode', align: 'center' - }, + }, { text: '灭火器名称', value: 'wellName', @@ -261,6 +292,7 @@ this.$router.push({ name: 'Track', query: { + type: this.bottombtn, id: id } }) @@ -269,8 +301,9 @@ this.$router.push({ name: 'Trail', query: { + type: this.bottombtn, id: id, - name: row.carCode + '-' + row.carTypeName + name: this.bottombtn === '消防车' ? row.carCode + '-' + row.carTypeName : row.backpackCode + '-背负式' } }) }, @@ -335,44 +368,43 @@ } } }, - fetchData(isNowPage = true) { - this.listLoading = true - this.list = [] - if (this.bottombtn === '消防车') { - offlineCount(this.listQuery).then(response => { - this.online = response.data.online - this.offline = response.data.offline - }) - this.sec = Number(this.refresh) - if (!isNowPage) { - this.listQuery.offset = 1 - } - getOverviewList(this.listQuery).then(response => { - this.list = response.data.rows - this.total = parseInt(response.data.total) - this.listLoading = false - }) - getOverviewAllList(this.listQuery).then(response => { - this.alllist = response.data - if (this.pointlayer !== null) this.map.removeLayer(this.pointlayer) - this.pointlayer = new L.layerGroup().addTo(this.map) - var list = [] - for (i = 0; i < this.alllist.length; i++) { - if (Number(this.alllist[i].lat) === 0 && Number(this.alllist[i].lng) === 0) { - continue - } - var item = [Number(this.alllist[i].lat), Number(this.alllist[i].lng)] - list.push(item) + initCar(isNowPage = true, url) { + offlineCount(url, this.listQuery).then(response => { + this.online = response.data.online + this.offline = response.data.offline + }) + this.sec = Number(this.refresh) + if (!isNowPage) { + this.listQuery.offset = 1 + } + getOverviewList(url, this.listQuery).then(response => { + this.list = response.data.rows + this.total = response.data.total + this.listLoading = false + }) + getOverviewAllList(url, this.listQuery).then(response => { + this.alllist = response.data + if (this.pointlayer !== null) this.map.removeLayer(this.pointlayer) + this.pointlayer = new L.layerGroup().addTo(this.map) + var list = [] + for (i = 0; i < this.alllist.length; i++) { + if (Number(this.alllist[i].lat) === 0 && Number(this.alllist[i].lng) === 0) { + continue } - // if (list.length !== 0) { - // this.setZoom(list) - // } - var Icon - for (var i = 0; i < this.alllist.length; i++) { - if (i === 0 && !this.initlocation) { - this.map.setView({ lat: this.alllist[0].lat, lng: this.alllist[0].lng }, 16) - this.initlocation = true - } + var item = [Number(this.alllist[i].lat), Number(this.alllist[i].lng)] + list.push(item) + } + if (list.length !== 0) { + // this.setZoom(list) + this.map.setView({ lat: this.alllist[0].lat, lng: this.alllist[0].lng }, 10) + } + var Icon + for (var i = 0; i < this.alllist.length; i++) { + if (i === 0 && !this.initlocation) { + this.map.setView({ lat: this.alllist[0].lat, lng: this.alllist[0].lng }, 16) + this.initlocation = true + } + if (this.bottombtn === '消防车') { if (this.alllist[i].status === '离线') { Icon = L.icon({ iconUrl: require('../../assets/global_images/car-offline.png'), // 灰 @@ -399,22 +431,35 @@ iconSize: [40, 40] }) } - var myIcon = L.divIcon({ - html: '
' + this.alllist[i].description + '
', - className: '', - iconSize: [100, 15] + } else { + Icon = L.icon({ + iconUrl: require('../../assets/global_images/bag-map.png'), // 灰 + iconSize: [30, 30] }) - L.marker([this.alllist[i].lat, this.alllist[i].lng], { icon: myIcon }).addTo(this.pointlayer) - const { carId, description, carTypeName, deptName, status, lng, lat, upTime, speed, liquidValue } = this.alllist[i] - var btndetail = 'btndetail' + carId - var btntrack = 'btntrack' + carId - var btntrail = 'btntrail' + carId - var str = `
车辆位置概要信息
+ } + var myIcon = L.divIcon({ + html: '
' + this.alllist[i].description + '
', + className: '', + iconSize: [100, 15] + }) + L.marker([this.alllist[i].lat, this.alllist[i].lng], { icon: myIcon }).addTo(this.pointlayer) + const { carId, backpackId, description, carTypeName, deptName, status, lng, lat, upTime, speed, liquidValue } = this.alllist[i] + var btndetail, btntrack, btntrail + if (this.bottombtn === '消防车') { + btndetail = 'btndetail' + carId + btntrack = 'btntrack' + carId + btntrail = 'btntrail' + carId + } else { + btndetail = 'btndetail' + backpackId + btntrack = 'btntrack' + backpackId + btntrail = 'btntrail' + backpackId + } + //
${carTypeName}
+ var str = `
${this.bottombtn}位置概要信息
${description}
-
${carTypeName}
${deptName}
${status}
-
${lng} , ${lat}
+
${Number(lng).toFixed(6)} , ${Number(lat).toFixed(6)}
${upTime}
${speed} (km/h)
${liquidValue}
@@ -422,34 +467,42 @@
` - var popup = L.popup().setContent(str) - var marker = L.marker([this.alllist[i].lat, this.alllist[i].lng], { - icon: Icon, - slug: this.alllist[i], - rotationAngle: this.alllist[i].direction, - zIndexOffset: 100000 - }).addTo(this.pointlayer).bindPopup(popup) + var popup = L.popup().setContent(str) + var marker = L.marker([this.alllist[i].lat, this.alllist[i].lng], { + icon: Icon, + slug: this.alllist[i], + rotationAngle: this.alllist[i].direction, + zIndexOffset: 100000 + }).addTo(this.pointlayer).bindPopup(popup) - var that = this - marker.on('click', function(e) { - var carId = e.sourceTarget.options.slug.carId - var btndetail = 'btndetail' + carId - var btntrack = 'btntrack' + carId - var btntrail = 'btntrail' + carId - console.log('按钮:', document.getElementById(btndetail)) - // document.getElementById(btndetail).onclick = function() { - // console.log('carId:', e.sourceTarget.options.slug.carId) - // that.detail(e.sourceTarget.options.slug.carId) - // } - document.getElementById(btntrack).onclick = function() { - that.track(e.sourceTarget.options.slug.carId) - } - document.getElementById(btntrail).onclick = function() { - that.trail(e.sourceTarget.options.slug.carId, e.sourceTarget.options.slug) - } - }) - } - }) + var that = this + marker.on('click', function(e) { + var carId = that.bottombtn === '消防车' ? e.sourceTarget.options.slug.carId : e.sourceTarget.options.slug.backpackId + var btndetail = 'btndetail' + carId + var btntrack = 'btntrack' + carId + var btntrail = 'btntrail' + carId + // console.log('按钮:', document.getElementById(btndetail)) + // document.getElementById(btndetail).onclick = function() { + // console.log('carId:', e.sourceTarget.options.slug.carId) + // that.detail(e.sourceTarget.options.slug.carId) + // } + document.getElementById(btntrack).onclick = function() { + that.track(carId) + } + document.getElementById(btntrail).onclick = function() { + that.trail(carId, e.sourceTarget.options.slug) + } + }) + } + }) + }, + fetchData(isNowPage = true) { + this.listLoading = true + this.list = [] + if (this.bottombtn === '消防车') { + this.initCar(isNowPage, 'busCarPosition') + } else if (this.bottombtn === '背负式') { + this.initCar(isNowPage, 'backpackPosition') } else { this.inittable(this.bottombtn) } diff --git a/src/views/car/track.vue b/src/views/car/track.vue index 2c1b425..b34964b 100644 --- a/src/views/car/track.vue +++ b/src/views/car/track.vue @@ -38,6 +38,7 @@ refresh: '10', showtable: true, id: '', + type: '', marker: null, label: null, baselayer: [], @@ -60,6 +61,7 @@ mounted() { if (this.$route.query) { this.id = this.$route.query.id + this.type = this.$route.query.type } this.initMap() this.fetchData() @@ -69,7 +71,9 @@ }, methods: { initMap() { - track(this.id).then(response => { + const url = this.type === '消防车' ? 'busCarPosition' : 'backpackPosition' + const params = this.type === '消防车' ? { carId: this.id } : { backpackId: this.id } + track(url, params).then(response => { var data = response.data var map if (data.lat !== '') { @@ -95,9 +99,8 @@ } this.map = map // data上需要挂载 window.map = map - var url = 'http://webrd0{s}.is.autonavi.com/appmaptile?x={x}&y={y}&z={z}&lang=zh_cn&size=1&scale=1&style=8' this.baselayer.push( - L.tileLayer(url, { + L.tileLayer('http://webrd0{s}.is.autonavi.com/appmaptile?x={x}&y={y}&z={z}&lang=zh_cn&size=1&scale=1&style=8', { subdomains: '1234' }).addTo(map)) }) @@ -106,7 +109,9 @@ this.sec = Number(this.refresh) }, fetchData() { - track(this.id).then(response => { + const url = this.type === '消防车' ? 'busCarPosition' : 'backpackPosition' + const params = this.type === '消防车' ? { carId: this.id } : { backpackId: this.id } + track(url, params).then(response => { var data = response.data if (this.marker != null) { this.marker.remove() @@ -115,35 +120,42 @@ var Icon if (data.status === '') { return - } else if (data.status === '离线') { + } else if (this.type === '消防车') { + if (data.status === '离线') { + Icon = L.icon({ + iconUrl: require('../../assets/global_images/car-offline.png'), + iconSize: [40, 40] + }) + } else if (data.status === '超时') { + Icon = L.icon({ + iconUrl: require('../../assets/global_images/car-timeout.png'), + iconSize: [40, 40] + }) + } else if (data.status === '停车') { + Icon = L.icon({ + iconUrl: require('../../assets/global_images/car-stop.png'), + iconSize: [40, 40] + }) + } else if (data.status === '行驶') { + Icon = L.icon({ + iconUrl: require('../../assets/global_images/car-online.png'), + iconSize: [40, 40] + }) + } else if (data.status === '报警') { + Icon = L.icon({ + iconUrl: require('../../assets/global_images/car-alarm.png'), + iconSize: [40, 40] + }) + } + } else { Icon = L.icon({ - iconUrl: require('../../assets/global_images/car-offline.png'), - iconSize: [40, 40] - }) - } else if (data.status === '超时') { - Icon = L.icon({ - iconUrl: require('../../assets/global_images/car-timeout.png'), - iconSize: [40, 40] - }) - } else if (data.status === '停车') { - Icon = L.icon({ - iconUrl: require('../../assets/global_images/car-stop.png'), - iconSize: [40, 40] - }) - } else if (data.status === '行驶') { - Icon = L.icon({ - iconUrl: require('../../assets/global_images/car-online.png'), - iconSize: [40, 40] - }) - } else if (data.status === '报警') { - Icon = L.icon({ - iconUrl: require('../../assets/global_images/car-alarm.png'), - iconSize: [40, 40] + iconUrl: require('../../assets/global_images/bag-map.png'), // 灰 + iconSize: [30, 30] }) } var str = '
车辆位置概要信息
' + '
' + data.description + '
' + - '
' + data.carTypeName + '
' + + // '
' + data.carTypeName + '
' + '
' + data.deptName + '
' + '
' + data.status + '
' + '
' + data.lng + ' , ' + data.lat + '
' + diff --git a/package.json b/package.json index 7b32d4d..84c75ec 100644 --- a/package.json +++ b/package.json @@ -24,10 +24,14 @@ "js-cookie": "2.2.0", "jsencrypt": "^3.0.0-rc.1", "leaflet": "^1.8.0", + "leaflet-rotatedmarker": "^0.2.0", + "leaflet.pm": "^2.2.0", "mockjs": "1.0.1-beta3", + "node-sass": "^6.0.1", "normalize.css": "7.0.0", "npm": "^6.11.3", "nprogress": "0.2.0", + "sass-loader": "^7.0.1", "v-charts": "^1.19.0", "vue": "2.5.17", "vue-amap": "^0.5.9", diff --git a/src/api/overview.js b/src/api/overview.js index 18f6446..e22debf 100644 --- a/src/api/overview.js +++ b/src/api/overview.js @@ -43,46 +43,44 @@ // 车辆 // 车辆定位列表 -export function getOverviewList(params) { +export function getOverviewList(url, data) { return request({ - url: 'busCarPosition/listPage', + url: url + '/listPage', + method: 'post', + data + }) +} +export function getOverviewAllList(url, data) { + return request({ + url: url + '/list', + method: 'post', + data + }) +} +export function offlineCount(url, params) { + return request({ + url: url + '/offlineCount', method: 'get', params }) } -export function getOverviewAllList(params) { +export function track(url, params) { return request({ - url: 'busCarPosition/list', + url: url + '/track', method: 'get', params }) } -export function offlineCount(params) { +export function trail(url, params) { return request({ - url: 'busCarPosition/offlineCount', + url: url + '/trace', method: 'get', params }) } -export function track(id) { +export function speedLine(url, params) { return request({ - url: 'busCarPosition/track', - method: 'get', - params: { - carId: id - } - }) -} -export function trail(params) { - return request({ - url: 'busCarPosition/trace', - method: 'get', - params - }) -} -export function speedLine(params) { - return request({ - url: 'busCarPosition/speedLine', + url: url + '/speedLine', method: 'get', params }) diff --git a/src/assets/global_images/bag-map.png b/src/assets/global_images/bag-map.png new file mode 100644 index 0000000..e3b85cc --- /dev/null +++ b/src/assets/global_images/bag-map.png Binary files differ diff --git a/src/assets/global_images/bag.png b/src/assets/global_images/bag.png new file mode 100644 index 0000000..200b865 --- /dev/null +++ b/src/assets/global_images/bag.png Binary files differ diff --git a/src/assets/global_images/car-alarm.png b/src/assets/global_images/car-alarm.png index 4128ec9..a19e6e4 100644 --- a/src/assets/global_images/car-alarm.png +++ b/src/assets/global_images/car-alarm.png Binary files differ diff --git a/src/assets/global_images/car-alarm1.png b/src/assets/global_images/car-alarm1.png new file mode 100644 index 0000000..4128ec9 --- /dev/null +++ b/src/assets/global_images/car-alarm1.png Binary files differ diff --git a/src/assets/global_images/car-offline.png b/src/assets/global_images/car-offline.png index 6a6fc19..a19e6e4 100644 --- a/src/assets/global_images/car-offline.png +++ b/src/assets/global_images/car-offline.png Binary files differ diff --git a/src/assets/global_images/car-offline1.png b/src/assets/global_images/car-offline1.png new file mode 100644 index 0000000..6a6fc19 --- /dev/null +++ b/src/assets/global_images/car-offline1.png Binary files differ diff --git a/src/assets/global_images/car-online.png b/src/assets/global_images/car-online.png index c79e4f7..a19e6e4 100644 --- a/src/assets/global_images/car-online.png +++ b/src/assets/global_images/car-online.png Binary files differ diff --git a/src/assets/global_images/car-online1.png b/src/assets/global_images/car-online1.png new file mode 100644 index 0000000..c79e4f7 --- /dev/null +++ b/src/assets/global_images/car-online1.png Binary files differ diff --git a/src/assets/global_images/car-stop.png b/src/assets/global_images/car-stop.png index 77b125d..a19e6e4 100644 --- a/src/assets/global_images/car-stop.png +++ b/src/assets/global_images/car-stop.png Binary files differ diff --git a/src/assets/global_images/car-stop1.png b/src/assets/global_images/car-stop1.png new file mode 100644 index 0000000..77b125d --- /dev/null +++ b/src/assets/global_images/car-stop1.png Binary files differ diff --git a/src/router/index.js b/src/router/index.js index 808ada2..6b348f4 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -60,14 +60,14 @@ name: 'Track', hidden: true, component: () => import('@/views/car/track'), - meta: { title: '消防车实时位置追踪', icon: 'function' } + meta: { title: '实时位置追踪', icon: 'function' } }, { path: '/trail', name: 'Trail', hidden: true, component: () => import('@/views/car/trail'), - meta: { title: '消防车历史轨迹', icon: 'function' } + meta: { title: '历史轨迹', icon: 'function' } } ] } diff --git a/src/views/car/listoverview.vue b/src/views/car/listoverview.vue index ea8528e..1ad2606 100644 --- a/src/views/car/listoverview.vue +++ b/src/views/car/listoverview.vue @@ -1,7 +1,7 @@ + + +
-
+
@@ -101,6 +108,10 @@
灭火器
+ + +
背负式
+
@@ -131,6 +142,7 @@ listQuery: { description: '', wellType: '', + backpackCode: '', carCode: '', carType: '', deptId: '', @@ -158,6 +170,25 @@ width: 70 } ], + '背负式': [ + { + text: '背包描述', + value: 'description', + align: 'center' + }, + { + text: '背包编号', + value: 'backpackCode', + align: 'center', + width: 90 + }, + { + text: '状态', + value: 'status', + align: 'center', + width: 70 + } + ], '井盖': [ { text: '井盖编号', @@ -180,7 +211,7 @@ text: '消防栓编号', value: 'wellCode', align: 'center' - }, + }, { text: '消防栓名称', value: 'wellName', @@ -198,7 +229,7 @@ text: '灭火器编号', value: 'wellCode', align: 'center' - }, + }, { text: '灭火器名称', value: 'wellName', @@ -261,6 +292,7 @@ this.$router.push({ name: 'Track', query: { + type: this.bottombtn, id: id } }) @@ -269,8 +301,9 @@ this.$router.push({ name: 'Trail', query: { + type: this.bottombtn, id: id, - name: row.carCode + '-' + row.carTypeName + name: this.bottombtn === '消防车' ? row.carCode + '-' + row.carTypeName : row.backpackCode + '-背负式' } }) }, @@ -335,44 +368,43 @@ } } }, - fetchData(isNowPage = true) { - this.listLoading = true - this.list = [] - if (this.bottombtn === '消防车') { - offlineCount(this.listQuery).then(response => { - this.online = response.data.online - this.offline = response.data.offline - }) - this.sec = Number(this.refresh) - if (!isNowPage) { - this.listQuery.offset = 1 - } - getOverviewList(this.listQuery).then(response => { - this.list = response.data.rows - this.total = parseInt(response.data.total) - this.listLoading = false - }) - getOverviewAllList(this.listQuery).then(response => { - this.alllist = response.data - if (this.pointlayer !== null) this.map.removeLayer(this.pointlayer) - this.pointlayer = new L.layerGroup().addTo(this.map) - var list = [] - for (i = 0; i < this.alllist.length; i++) { - if (Number(this.alllist[i].lat) === 0 && Number(this.alllist[i].lng) === 0) { - continue - } - var item = [Number(this.alllist[i].lat), Number(this.alllist[i].lng)] - list.push(item) + initCar(isNowPage = true, url) { + offlineCount(url, this.listQuery).then(response => { + this.online = response.data.online + this.offline = response.data.offline + }) + this.sec = Number(this.refresh) + if (!isNowPage) { + this.listQuery.offset = 1 + } + getOverviewList(url, this.listQuery).then(response => { + this.list = response.data.rows + this.total = response.data.total + this.listLoading = false + }) + getOverviewAllList(url, this.listQuery).then(response => { + this.alllist = response.data + if (this.pointlayer !== null) this.map.removeLayer(this.pointlayer) + this.pointlayer = new L.layerGroup().addTo(this.map) + var list = [] + for (i = 0; i < this.alllist.length; i++) { + if (Number(this.alllist[i].lat) === 0 && Number(this.alllist[i].lng) === 0) { + continue } - // if (list.length !== 0) { - // this.setZoom(list) - // } - var Icon - for (var i = 0; i < this.alllist.length; i++) { - if (i === 0 && !this.initlocation) { - this.map.setView({ lat: this.alllist[0].lat, lng: this.alllist[0].lng }, 16) - this.initlocation = true - } + var item = [Number(this.alllist[i].lat), Number(this.alllist[i].lng)] + list.push(item) + } + if (list.length !== 0) { + // this.setZoom(list) + this.map.setView({ lat: this.alllist[0].lat, lng: this.alllist[0].lng }, 10) + } + var Icon + for (var i = 0; i < this.alllist.length; i++) { + if (i === 0 && !this.initlocation) { + this.map.setView({ lat: this.alllist[0].lat, lng: this.alllist[0].lng }, 16) + this.initlocation = true + } + if (this.bottombtn === '消防车') { if (this.alllist[i].status === '离线') { Icon = L.icon({ iconUrl: require('../../assets/global_images/car-offline.png'), // 灰 @@ -399,22 +431,35 @@ iconSize: [40, 40] }) } - var myIcon = L.divIcon({ - html: '
' + this.alllist[i].description + '
', - className: '', - iconSize: [100, 15] + } else { + Icon = L.icon({ + iconUrl: require('../../assets/global_images/bag-map.png'), // 灰 + iconSize: [30, 30] }) - L.marker([this.alllist[i].lat, this.alllist[i].lng], { icon: myIcon }).addTo(this.pointlayer) - const { carId, description, carTypeName, deptName, status, lng, lat, upTime, speed, liquidValue } = this.alllist[i] - var btndetail = 'btndetail' + carId - var btntrack = 'btntrack' + carId - var btntrail = 'btntrail' + carId - var str = `
车辆位置概要信息
+ } + var myIcon = L.divIcon({ + html: '
' + this.alllist[i].description + '
', + className: '', + iconSize: [100, 15] + }) + L.marker([this.alllist[i].lat, this.alllist[i].lng], { icon: myIcon }).addTo(this.pointlayer) + const { carId, backpackId, description, carTypeName, deptName, status, lng, lat, upTime, speed, liquidValue } = this.alllist[i] + var btndetail, btntrack, btntrail + if (this.bottombtn === '消防车') { + btndetail = 'btndetail' + carId + btntrack = 'btntrack' + carId + btntrail = 'btntrail' + carId + } else { + btndetail = 'btndetail' + backpackId + btntrack = 'btntrack' + backpackId + btntrail = 'btntrail' + backpackId + } + //
${carTypeName}
+ var str = `
${this.bottombtn}位置概要信息
${description}
-
${carTypeName}
${deptName}
${status}
-
${lng} , ${lat}
+
${Number(lng).toFixed(6)} , ${Number(lat).toFixed(6)}
${upTime}
${speed} (km/h)
${liquidValue}
@@ -422,34 +467,42 @@
` - var popup = L.popup().setContent(str) - var marker = L.marker([this.alllist[i].lat, this.alllist[i].lng], { - icon: Icon, - slug: this.alllist[i], - rotationAngle: this.alllist[i].direction, - zIndexOffset: 100000 - }).addTo(this.pointlayer).bindPopup(popup) + var popup = L.popup().setContent(str) + var marker = L.marker([this.alllist[i].lat, this.alllist[i].lng], { + icon: Icon, + slug: this.alllist[i], + rotationAngle: this.alllist[i].direction, + zIndexOffset: 100000 + }).addTo(this.pointlayer).bindPopup(popup) - var that = this - marker.on('click', function(e) { - var carId = e.sourceTarget.options.slug.carId - var btndetail = 'btndetail' + carId - var btntrack = 'btntrack' + carId - var btntrail = 'btntrail' + carId - console.log('按钮:', document.getElementById(btndetail)) - // document.getElementById(btndetail).onclick = function() { - // console.log('carId:', e.sourceTarget.options.slug.carId) - // that.detail(e.sourceTarget.options.slug.carId) - // } - document.getElementById(btntrack).onclick = function() { - that.track(e.sourceTarget.options.slug.carId) - } - document.getElementById(btntrail).onclick = function() { - that.trail(e.sourceTarget.options.slug.carId, e.sourceTarget.options.slug) - } - }) - } - }) + var that = this + marker.on('click', function(e) { + var carId = that.bottombtn === '消防车' ? e.sourceTarget.options.slug.carId : e.sourceTarget.options.slug.backpackId + var btndetail = 'btndetail' + carId + var btntrack = 'btntrack' + carId + var btntrail = 'btntrail' + carId + // console.log('按钮:', document.getElementById(btndetail)) + // document.getElementById(btndetail).onclick = function() { + // console.log('carId:', e.sourceTarget.options.slug.carId) + // that.detail(e.sourceTarget.options.slug.carId) + // } + document.getElementById(btntrack).onclick = function() { + that.track(carId) + } + document.getElementById(btntrail).onclick = function() { + that.trail(carId, e.sourceTarget.options.slug) + } + }) + } + }) + }, + fetchData(isNowPage = true) { + this.listLoading = true + this.list = [] + if (this.bottombtn === '消防车') { + this.initCar(isNowPage, 'busCarPosition') + } else if (this.bottombtn === '背负式') { + this.initCar(isNowPage, 'backpackPosition') } else { this.inittable(this.bottombtn) } diff --git a/src/views/car/track.vue b/src/views/car/track.vue index 2c1b425..b34964b 100644 --- a/src/views/car/track.vue +++ b/src/views/car/track.vue @@ -38,6 +38,7 @@ refresh: '10', showtable: true, id: '', + type: '', marker: null, label: null, baselayer: [], @@ -60,6 +61,7 @@ mounted() { if (this.$route.query) { this.id = this.$route.query.id + this.type = this.$route.query.type } this.initMap() this.fetchData() @@ -69,7 +71,9 @@ }, methods: { initMap() { - track(this.id).then(response => { + const url = this.type === '消防车' ? 'busCarPosition' : 'backpackPosition' + const params = this.type === '消防车' ? { carId: this.id } : { backpackId: this.id } + track(url, params).then(response => { var data = response.data var map if (data.lat !== '') { @@ -95,9 +99,8 @@ } this.map = map // data上需要挂载 window.map = map - var url = 'http://webrd0{s}.is.autonavi.com/appmaptile?x={x}&y={y}&z={z}&lang=zh_cn&size=1&scale=1&style=8' this.baselayer.push( - L.tileLayer(url, { + L.tileLayer('http://webrd0{s}.is.autonavi.com/appmaptile?x={x}&y={y}&z={z}&lang=zh_cn&size=1&scale=1&style=8', { subdomains: '1234' }).addTo(map)) }) @@ -106,7 +109,9 @@ this.sec = Number(this.refresh) }, fetchData() { - track(this.id).then(response => { + const url = this.type === '消防车' ? 'busCarPosition' : 'backpackPosition' + const params = this.type === '消防车' ? { carId: this.id } : { backpackId: this.id } + track(url, params).then(response => { var data = response.data if (this.marker != null) { this.marker.remove() @@ -115,35 +120,42 @@ var Icon if (data.status === '') { return - } else if (data.status === '离线') { + } else if (this.type === '消防车') { + if (data.status === '离线') { + Icon = L.icon({ + iconUrl: require('../../assets/global_images/car-offline.png'), + iconSize: [40, 40] + }) + } else if (data.status === '超时') { + Icon = L.icon({ + iconUrl: require('../../assets/global_images/car-timeout.png'), + iconSize: [40, 40] + }) + } else if (data.status === '停车') { + Icon = L.icon({ + iconUrl: require('../../assets/global_images/car-stop.png'), + iconSize: [40, 40] + }) + } else if (data.status === '行驶') { + Icon = L.icon({ + iconUrl: require('../../assets/global_images/car-online.png'), + iconSize: [40, 40] + }) + } else if (data.status === '报警') { + Icon = L.icon({ + iconUrl: require('../../assets/global_images/car-alarm.png'), + iconSize: [40, 40] + }) + } + } else { Icon = L.icon({ - iconUrl: require('../../assets/global_images/car-offline.png'), - iconSize: [40, 40] - }) - } else if (data.status === '超时') { - Icon = L.icon({ - iconUrl: require('../../assets/global_images/car-timeout.png'), - iconSize: [40, 40] - }) - } else if (data.status === '停车') { - Icon = L.icon({ - iconUrl: require('../../assets/global_images/car-stop.png'), - iconSize: [40, 40] - }) - } else if (data.status === '行驶') { - Icon = L.icon({ - iconUrl: require('../../assets/global_images/car-online.png'), - iconSize: [40, 40] - }) - } else if (data.status === '报警') { - Icon = L.icon({ - iconUrl: require('../../assets/global_images/car-alarm.png'), - iconSize: [40, 40] + iconUrl: require('../../assets/global_images/bag-map.png'), // 灰 + iconSize: [30, 30] }) } var str = '
车辆位置概要信息
' + '
' + data.description + '
' + - '
' + data.carTypeName + '
' + + // '
' + data.carTypeName + '
' + '
' + data.deptName + '
' + '
' + data.status + '
' + '
' + data.lng + ' , ' + data.lat + '
' + diff --git a/src/views/car/trail.vue b/src/views/car/trail.vue index 37429ef..39dfd07 100644 --- a/src/views/car/trail.vue +++ b/src/views/car/trail.vue @@ -62,11 +62,13 @@ deptShow: true, listQuery: { carId: '', + backpackId: '', startTime: '', endTime: '' }, // 查询条件 baselayer: [], carName: '', + type: '', dateTimeRange: [], pathlist: [], // 列表数据 list: [], // 列表数据 @@ -91,7 +93,9 @@ mounted() { if (this.$route.query) { this.listQuery.carId = this.$route.query.id + this.listQuery.backpackId = this.$route.query.id this.carName = this.$route.query.name + this.type = this.$route.query.type } const date = new Date() const year = date.getFullYear() // 年 @@ -126,7 +130,7 @@ this.carpoint.remove() // add point var Icon = L.icon({ - iconUrl: require('../../assets/global_images/car.png'), + iconUrl: this.type === '消防车' ? require('../../assets/global_images/car.png') : require('../../assets/global_images/bag-map.png'), iconSize: [40, 40] }) var str = '
车辆轨迹点信息
' + @@ -154,7 +158,7 @@ this.carpoint.remove() } var Icon = L.icon({ - iconUrl: require('../../assets/global_images/car.png'), + iconUrl: this.type === '消防车' ? require('../../assets/global_images/car.png') : require('../../assets/global_images/bag-map.png'), iconSize: [40, 40] }) var str = '
车辆轨迹点信息
' + @@ -177,7 +181,7 @@ this.carpoint.remove() } var Icon = L.icon({ - iconUrl: require('../../assets/global_images/car.png'), + iconUrl: this.type === '消防车' ? require('../../assets/global_images/car.png') : require('../../assets/global_images/bag-map.png'), iconSize: [40, 40] }) var str = '
车辆轨迹点信息
' + @@ -283,7 +287,8 @@ }, fetchData() { // 划线 this.listLoading = true - trail(this.listQuery).then(response => { + const url = this.type === '消防车' ? 'busCarPosition' : 'backpackPosition' + trail(url, this.listQuery).then(response => { this.list = response.data var base = this.baselayer this.map.eachLayer(function(layer) { diff --git a/package.json b/package.json index 7b32d4d..84c75ec 100644 --- a/package.json +++ b/package.json @@ -24,10 +24,14 @@ "js-cookie": "2.2.0", "jsencrypt": "^3.0.0-rc.1", "leaflet": "^1.8.0", + "leaflet-rotatedmarker": "^0.2.0", + "leaflet.pm": "^2.2.0", "mockjs": "1.0.1-beta3", + "node-sass": "^6.0.1", "normalize.css": "7.0.0", "npm": "^6.11.3", "nprogress": "0.2.0", + "sass-loader": "^7.0.1", "v-charts": "^1.19.0", "vue": "2.5.17", "vue-amap": "^0.5.9", diff --git a/src/api/overview.js b/src/api/overview.js index 18f6446..e22debf 100644 --- a/src/api/overview.js +++ b/src/api/overview.js @@ -43,46 +43,44 @@ // 车辆 // 车辆定位列表 -export function getOverviewList(params) { +export function getOverviewList(url, data) { return request({ - url: 'busCarPosition/listPage', + url: url + '/listPage', + method: 'post', + data + }) +} +export function getOverviewAllList(url, data) { + return request({ + url: url + '/list', + method: 'post', + data + }) +} +export function offlineCount(url, params) { + return request({ + url: url + '/offlineCount', method: 'get', params }) } -export function getOverviewAllList(params) { +export function track(url, params) { return request({ - url: 'busCarPosition/list', + url: url + '/track', method: 'get', params }) } -export function offlineCount(params) { +export function trail(url, params) { return request({ - url: 'busCarPosition/offlineCount', + url: url + '/trace', method: 'get', params }) } -export function track(id) { +export function speedLine(url, params) { return request({ - url: 'busCarPosition/track', - method: 'get', - params: { - carId: id - } - }) -} -export function trail(params) { - return request({ - url: 'busCarPosition/trace', - method: 'get', - params - }) -} -export function speedLine(params) { - return request({ - url: 'busCarPosition/speedLine', + url: url + '/speedLine', method: 'get', params }) diff --git a/src/assets/global_images/bag-map.png b/src/assets/global_images/bag-map.png new file mode 100644 index 0000000..e3b85cc --- /dev/null +++ b/src/assets/global_images/bag-map.png Binary files differ diff --git a/src/assets/global_images/bag.png b/src/assets/global_images/bag.png new file mode 100644 index 0000000..200b865 --- /dev/null +++ b/src/assets/global_images/bag.png Binary files differ diff --git a/src/assets/global_images/car-alarm.png b/src/assets/global_images/car-alarm.png index 4128ec9..a19e6e4 100644 --- a/src/assets/global_images/car-alarm.png +++ b/src/assets/global_images/car-alarm.png Binary files differ diff --git a/src/assets/global_images/car-alarm1.png b/src/assets/global_images/car-alarm1.png new file mode 100644 index 0000000..4128ec9 --- /dev/null +++ b/src/assets/global_images/car-alarm1.png Binary files differ diff --git a/src/assets/global_images/car-offline.png b/src/assets/global_images/car-offline.png index 6a6fc19..a19e6e4 100644 --- a/src/assets/global_images/car-offline.png +++ b/src/assets/global_images/car-offline.png Binary files differ diff --git a/src/assets/global_images/car-offline1.png b/src/assets/global_images/car-offline1.png new file mode 100644 index 0000000..6a6fc19 --- /dev/null +++ b/src/assets/global_images/car-offline1.png Binary files differ diff --git a/src/assets/global_images/car-online.png b/src/assets/global_images/car-online.png index c79e4f7..a19e6e4 100644 --- a/src/assets/global_images/car-online.png +++ b/src/assets/global_images/car-online.png Binary files differ diff --git a/src/assets/global_images/car-online1.png b/src/assets/global_images/car-online1.png new file mode 100644 index 0000000..c79e4f7 --- /dev/null +++ b/src/assets/global_images/car-online1.png Binary files differ diff --git a/src/assets/global_images/car-stop.png b/src/assets/global_images/car-stop.png index 77b125d..a19e6e4 100644 --- a/src/assets/global_images/car-stop.png +++ b/src/assets/global_images/car-stop.png Binary files differ diff --git a/src/assets/global_images/car-stop1.png b/src/assets/global_images/car-stop1.png new file mode 100644 index 0000000..77b125d --- /dev/null +++ b/src/assets/global_images/car-stop1.png Binary files differ diff --git a/src/router/index.js b/src/router/index.js index 808ada2..6b348f4 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -60,14 +60,14 @@ name: 'Track', hidden: true, component: () => import('@/views/car/track'), - meta: { title: '消防车实时位置追踪', icon: 'function' } + meta: { title: '实时位置追踪', icon: 'function' } }, { path: '/trail', name: 'Trail', hidden: true, component: () => import('@/views/car/trail'), - meta: { title: '消防车历史轨迹', icon: 'function' } + meta: { title: '历史轨迹', icon: 'function' } } ] } diff --git a/src/views/car/listoverview.vue b/src/views/car/listoverview.vue index ea8528e..1ad2606 100644 --- a/src/views/car/listoverview.vue +++ b/src/views/car/listoverview.vue @@ -1,7 +1,7 @@ + + +
-
+
@@ -101,6 +108,10 @@
灭火器
+ + +
背负式
+
@@ -131,6 +142,7 @@ listQuery: { description: '', wellType: '', + backpackCode: '', carCode: '', carType: '', deptId: '', @@ -158,6 +170,25 @@ width: 70 } ], + '背负式': [ + { + text: '背包描述', + value: 'description', + align: 'center' + }, + { + text: '背包编号', + value: 'backpackCode', + align: 'center', + width: 90 + }, + { + text: '状态', + value: 'status', + align: 'center', + width: 70 + } + ], '井盖': [ { text: '井盖编号', @@ -180,7 +211,7 @@ text: '消防栓编号', value: 'wellCode', align: 'center' - }, + }, { text: '消防栓名称', value: 'wellName', @@ -198,7 +229,7 @@ text: '灭火器编号', value: 'wellCode', align: 'center' - }, + }, { text: '灭火器名称', value: 'wellName', @@ -261,6 +292,7 @@ this.$router.push({ name: 'Track', query: { + type: this.bottombtn, id: id } }) @@ -269,8 +301,9 @@ this.$router.push({ name: 'Trail', query: { + type: this.bottombtn, id: id, - name: row.carCode + '-' + row.carTypeName + name: this.bottombtn === '消防车' ? row.carCode + '-' + row.carTypeName : row.backpackCode + '-背负式' } }) }, @@ -335,44 +368,43 @@ } } }, - fetchData(isNowPage = true) { - this.listLoading = true - this.list = [] - if (this.bottombtn === '消防车') { - offlineCount(this.listQuery).then(response => { - this.online = response.data.online - this.offline = response.data.offline - }) - this.sec = Number(this.refresh) - if (!isNowPage) { - this.listQuery.offset = 1 - } - getOverviewList(this.listQuery).then(response => { - this.list = response.data.rows - this.total = parseInt(response.data.total) - this.listLoading = false - }) - getOverviewAllList(this.listQuery).then(response => { - this.alllist = response.data - if (this.pointlayer !== null) this.map.removeLayer(this.pointlayer) - this.pointlayer = new L.layerGroup().addTo(this.map) - var list = [] - for (i = 0; i < this.alllist.length; i++) { - if (Number(this.alllist[i].lat) === 0 && Number(this.alllist[i].lng) === 0) { - continue - } - var item = [Number(this.alllist[i].lat), Number(this.alllist[i].lng)] - list.push(item) + initCar(isNowPage = true, url) { + offlineCount(url, this.listQuery).then(response => { + this.online = response.data.online + this.offline = response.data.offline + }) + this.sec = Number(this.refresh) + if (!isNowPage) { + this.listQuery.offset = 1 + } + getOverviewList(url, this.listQuery).then(response => { + this.list = response.data.rows + this.total = response.data.total + this.listLoading = false + }) + getOverviewAllList(url, this.listQuery).then(response => { + this.alllist = response.data + if (this.pointlayer !== null) this.map.removeLayer(this.pointlayer) + this.pointlayer = new L.layerGroup().addTo(this.map) + var list = [] + for (i = 0; i < this.alllist.length; i++) { + if (Number(this.alllist[i].lat) === 0 && Number(this.alllist[i].lng) === 0) { + continue } - // if (list.length !== 0) { - // this.setZoom(list) - // } - var Icon - for (var i = 0; i < this.alllist.length; i++) { - if (i === 0 && !this.initlocation) { - this.map.setView({ lat: this.alllist[0].lat, lng: this.alllist[0].lng }, 16) - this.initlocation = true - } + var item = [Number(this.alllist[i].lat), Number(this.alllist[i].lng)] + list.push(item) + } + if (list.length !== 0) { + // this.setZoom(list) + this.map.setView({ lat: this.alllist[0].lat, lng: this.alllist[0].lng }, 10) + } + var Icon + for (var i = 0; i < this.alllist.length; i++) { + if (i === 0 && !this.initlocation) { + this.map.setView({ lat: this.alllist[0].lat, lng: this.alllist[0].lng }, 16) + this.initlocation = true + } + if (this.bottombtn === '消防车') { if (this.alllist[i].status === '离线') { Icon = L.icon({ iconUrl: require('../../assets/global_images/car-offline.png'), // 灰 @@ -399,22 +431,35 @@ iconSize: [40, 40] }) } - var myIcon = L.divIcon({ - html: '
' + this.alllist[i].description + '
', - className: '', - iconSize: [100, 15] + } else { + Icon = L.icon({ + iconUrl: require('../../assets/global_images/bag-map.png'), // 灰 + iconSize: [30, 30] }) - L.marker([this.alllist[i].lat, this.alllist[i].lng], { icon: myIcon }).addTo(this.pointlayer) - const { carId, description, carTypeName, deptName, status, lng, lat, upTime, speed, liquidValue } = this.alllist[i] - var btndetail = 'btndetail' + carId - var btntrack = 'btntrack' + carId - var btntrail = 'btntrail' + carId - var str = `
车辆位置概要信息
+ } + var myIcon = L.divIcon({ + html: '
' + this.alllist[i].description + '
', + className: '', + iconSize: [100, 15] + }) + L.marker([this.alllist[i].lat, this.alllist[i].lng], { icon: myIcon }).addTo(this.pointlayer) + const { carId, backpackId, description, carTypeName, deptName, status, lng, lat, upTime, speed, liquidValue } = this.alllist[i] + var btndetail, btntrack, btntrail + if (this.bottombtn === '消防车') { + btndetail = 'btndetail' + carId + btntrack = 'btntrack' + carId + btntrail = 'btntrail' + carId + } else { + btndetail = 'btndetail' + backpackId + btntrack = 'btntrack' + backpackId + btntrail = 'btntrail' + backpackId + } + //
${carTypeName}
+ var str = `
${this.bottombtn}位置概要信息
${description}
-
${carTypeName}
${deptName}
${status}
-
${lng} , ${lat}
+
${Number(lng).toFixed(6)} , ${Number(lat).toFixed(6)}
${upTime}
${speed} (km/h)
${liquidValue}
@@ -422,34 +467,42 @@
` - var popup = L.popup().setContent(str) - var marker = L.marker([this.alllist[i].lat, this.alllist[i].lng], { - icon: Icon, - slug: this.alllist[i], - rotationAngle: this.alllist[i].direction, - zIndexOffset: 100000 - }).addTo(this.pointlayer).bindPopup(popup) + var popup = L.popup().setContent(str) + var marker = L.marker([this.alllist[i].lat, this.alllist[i].lng], { + icon: Icon, + slug: this.alllist[i], + rotationAngle: this.alllist[i].direction, + zIndexOffset: 100000 + }).addTo(this.pointlayer).bindPopup(popup) - var that = this - marker.on('click', function(e) { - var carId = e.sourceTarget.options.slug.carId - var btndetail = 'btndetail' + carId - var btntrack = 'btntrack' + carId - var btntrail = 'btntrail' + carId - console.log('按钮:', document.getElementById(btndetail)) - // document.getElementById(btndetail).onclick = function() { - // console.log('carId:', e.sourceTarget.options.slug.carId) - // that.detail(e.sourceTarget.options.slug.carId) - // } - document.getElementById(btntrack).onclick = function() { - that.track(e.sourceTarget.options.slug.carId) - } - document.getElementById(btntrail).onclick = function() { - that.trail(e.sourceTarget.options.slug.carId, e.sourceTarget.options.slug) - } - }) - } - }) + var that = this + marker.on('click', function(e) { + var carId = that.bottombtn === '消防车' ? e.sourceTarget.options.slug.carId : e.sourceTarget.options.slug.backpackId + var btndetail = 'btndetail' + carId + var btntrack = 'btntrack' + carId + var btntrail = 'btntrail' + carId + // console.log('按钮:', document.getElementById(btndetail)) + // document.getElementById(btndetail).onclick = function() { + // console.log('carId:', e.sourceTarget.options.slug.carId) + // that.detail(e.sourceTarget.options.slug.carId) + // } + document.getElementById(btntrack).onclick = function() { + that.track(carId) + } + document.getElementById(btntrail).onclick = function() { + that.trail(carId, e.sourceTarget.options.slug) + } + }) + } + }) + }, + fetchData(isNowPage = true) { + this.listLoading = true + this.list = [] + if (this.bottombtn === '消防车') { + this.initCar(isNowPage, 'busCarPosition') + } else if (this.bottombtn === '背负式') { + this.initCar(isNowPage, 'backpackPosition') } else { this.inittable(this.bottombtn) } diff --git a/src/views/car/track.vue b/src/views/car/track.vue index 2c1b425..b34964b 100644 --- a/src/views/car/track.vue +++ b/src/views/car/track.vue @@ -38,6 +38,7 @@ refresh: '10', showtable: true, id: '', + type: '', marker: null, label: null, baselayer: [], @@ -60,6 +61,7 @@ mounted() { if (this.$route.query) { this.id = this.$route.query.id + this.type = this.$route.query.type } this.initMap() this.fetchData() @@ -69,7 +71,9 @@ }, methods: { initMap() { - track(this.id).then(response => { + const url = this.type === '消防车' ? 'busCarPosition' : 'backpackPosition' + const params = this.type === '消防车' ? { carId: this.id } : { backpackId: this.id } + track(url, params).then(response => { var data = response.data var map if (data.lat !== '') { @@ -95,9 +99,8 @@ } this.map = map // data上需要挂载 window.map = map - var url = 'http://webrd0{s}.is.autonavi.com/appmaptile?x={x}&y={y}&z={z}&lang=zh_cn&size=1&scale=1&style=8' this.baselayer.push( - L.tileLayer(url, { + L.tileLayer('http://webrd0{s}.is.autonavi.com/appmaptile?x={x}&y={y}&z={z}&lang=zh_cn&size=1&scale=1&style=8', { subdomains: '1234' }).addTo(map)) }) @@ -106,7 +109,9 @@ this.sec = Number(this.refresh) }, fetchData() { - track(this.id).then(response => { + const url = this.type === '消防车' ? 'busCarPosition' : 'backpackPosition' + const params = this.type === '消防车' ? { carId: this.id } : { backpackId: this.id } + track(url, params).then(response => { var data = response.data if (this.marker != null) { this.marker.remove() @@ -115,35 +120,42 @@ var Icon if (data.status === '') { return - } else if (data.status === '离线') { + } else if (this.type === '消防车') { + if (data.status === '离线') { + Icon = L.icon({ + iconUrl: require('../../assets/global_images/car-offline.png'), + iconSize: [40, 40] + }) + } else if (data.status === '超时') { + Icon = L.icon({ + iconUrl: require('../../assets/global_images/car-timeout.png'), + iconSize: [40, 40] + }) + } else if (data.status === '停车') { + Icon = L.icon({ + iconUrl: require('../../assets/global_images/car-stop.png'), + iconSize: [40, 40] + }) + } else if (data.status === '行驶') { + Icon = L.icon({ + iconUrl: require('../../assets/global_images/car-online.png'), + iconSize: [40, 40] + }) + } else if (data.status === '报警') { + Icon = L.icon({ + iconUrl: require('../../assets/global_images/car-alarm.png'), + iconSize: [40, 40] + }) + } + } else { Icon = L.icon({ - iconUrl: require('../../assets/global_images/car-offline.png'), - iconSize: [40, 40] - }) - } else if (data.status === '超时') { - Icon = L.icon({ - iconUrl: require('../../assets/global_images/car-timeout.png'), - iconSize: [40, 40] - }) - } else if (data.status === '停车') { - Icon = L.icon({ - iconUrl: require('../../assets/global_images/car-stop.png'), - iconSize: [40, 40] - }) - } else if (data.status === '行驶') { - Icon = L.icon({ - iconUrl: require('../../assets/global_images/car-online.png'), - iconSize: [40, 40] - }) - } else if (data.status === '报警') { - Icon = L.icon({ - iconUrl: require('../../assets/global_images/car-alarm.png'), - iconSize: [40, 40] + iconUrl: require('../../assets/global_images/bag-map.png'), // 灰 + iconSize: [30, 30] }) } var str = '
车辆位置概要信息
' + '
' + data.description + '
' + - '
' + data.carTypeName + '
' + + // '
' + data.carTypeName + '
' + '
' + data.deptName + '
' + '
' + data.status + '
' + '
' + data.lng + ' , ' + data.lat + '
' + diff --git a/src/views/car/trail.vue b/src/views/car/trail.vue index 37429ef..39dfd07 100644 --- a/src/views/car/trail.vue +++ b/src/views/car/trail.vue @@ -62,11 +62,13 @@ deptShow: true, listQuery: { carId: '', + backpackId: '', startTime: '', endTime: '' }, // 查询条件 baselayer: [], carName: '', + type: '', dateTimeRange: [], pathlist: [], // 列表数据 list: [], // 列表数据 @@ -91,7 +93,9 @@ mounted() { if (this.$route.query) { this.listQuery.carId = this.$route.query.id + this.listQuery.backpackId = this.$route.query.id this.carName = this.$route.query.name + this.type = this.$route.query.type } const date = new Date() const year = date.getFullYear() // 年 @@ -126,7 +130,7 @@ this.carpoint.remove() // add point var Icon = L.icon({ - iconUrl: require('../../assets/global_images/car.png'), + iconUrl: this.type === '消防车' ? require('../../assets/global_images/car.png') : require('../../assets/global_images/bag-map.png'), iconSize: [40, 40] }) var str = '
车辆轨迹点信息
' + @@ -154,7 +158,7 @@ this.carpoint.remove() } var Icon = L.icon({ - iconUrl: require('../../assets/global_images/car.png'), + iconUrl: this.type === '消防车' ? require('../../assets/global_images/car.png') : require('../../assets/global_images/bag-map.png'), iconSize: [40, 40] }) var str = '
车辆轨迹点信息
' + @@ -177,7 +181,7 @@ this.carpoint.remove() } var Icon = L.icon({ - iconUrl: require('../../assets/global_images/car.png'), + iconUrl: this.type === '消防车' ? require('../../assets/global_images/car.png') : require('../../assets/global_images/bag-map.png'), iconSize: [40, 40] }) var str = '
车辆轨迹点信息
' + @@ -283,7 +287,8 @@ }, fetchData() { // 划线 this.listLoading = true - trail(this.listQuery).then(response => { + const url = this.type === '消防车' ? 'busCarPosition' : 'backpackPosition' + trail(url, this.listQuery).then(response => { this.list = response.data var base = this.baselayer this.map.eachLayer(function(layer) { diff --git a/src/views/car/trailStatic.vue b/src/views/car/trailStatic.vue index c6543fc..0acf586 100644 --- a/src/views/car/trailStatic.vue +++ b/src/views/car/trailStatic.vue @@ -22,9 +22,10 @@ }, methods: { // 初始化对话框 - initDialog: function(dialogFormVisible, row, name ) { + initDialog: function(dialogFormVisible, row, name, type ) { this.dialogFormVisible = dialogFormVisible - speedLine(row).then(response => { + const url = type === '消防车' ? 'busCarPosition' : 'backpackPosition' + speedLine(url, row).then(response => { this.xdata = [] this.ydata = [] for(var i=0;i import('@/views/car/track'), - meta: { title: '消防车实时位置追踪', icon: 'function' } + meta: { title: '实时位置追踪', icon: 'function' } }, { path: '/trail', name: 'Trail', hidden: true, component: () => import('@/views/car/trail'), - meta: { title: '消防车历史轨迹', icon: 'function' } + meta: { title: '历史轨迹', icon: 'function' } } ] } diff --git a/src/views/car/listoverview.vue b/src/views/car/listoverview.vue index ea8528e..1ad2606 100644 --- a/src/views/car/listoverview.vue +++ b/src/views/car/listoverview.vue @@ -1,7 +1,7 @@ + + +
-
+
@@ -101,6 +108,10 @@
灭火器
+ + +
背负式
+
@@ -131,6 +142,7 @@ listQuery: { description: '', wellType: '', + backpackCode: '', carCode: '', carType: '', deptId: '', @@ -158,6 +170,25 @@ width: 70 } ], + '背负式': [ + { + text: '背包描述', + value: 'description', + align: 'center' + }, + { + text: '背包编号', + value: 'backpackCode', + align: 'center', + width: 90 + }, + { + text: '状态', + value: 'status', + align: 'center', + width: 70 + } + ], '井盖': [ { text: '井盖编号', @@ -180,7 +211,7 @@ text: '消防栓编号', value: 'wellCode', align: 'center' - }, + }, { text: '消防栓名称', value: 'wellName', @@ -198,7 +229,7 @@ text: '灭火器编号', value: 'wellCode', align: 'center' - }, + }, { text: '灭火器名称', value: 'wellName', @@ -261,6 +292,7 @@ this.$router.push({ name: 'Track', query: { + type: this.bottombtn, id: id } }) @@ -269,8 +301,9 @@ this.$router.push({ name: 'Trail', query: { + type: this.bottombtn, id: id, - name: row.carCode + '-' + row.carTypeName + name: this.bottombtn === '消防车' ? row.carCode + '-' + row.carTypeName : row.backpackCode + '-背负式' } }) }, @@ -335,44 +368,43 @@ } } }, - fetchData(isNowPage = true) { - this.listLoading = true - this.list = [] - if (this.bottombtn === '消防车') { - offlineCount(this.listQuery).then(response => { - this.online = response.data.online - this.offline = response.data.offline - }) - this.sec = Number(this.refresh) - if (!isNowPage) { - this.listQuery.offset = 1 - } - getOverviewList(this.listQuery).then(response => { - this.list = response.data.rows - this.total = parseInt(response.data.total) - this.listLoading = false - }) - getOverviewAllList(this.listQuery).then(response => { - this.alllist = response.data - if (this.pointlayer !== null) this.map.removeLayer(this.pointlayer) - this.pointlayer = new L.layerGroup().addTo(this.map) - var list = [] - for (i = 0; i < this.alllist.length; i++) { - if (Number(this.alllist[i].lat) === 0 && Number(this.alllist[i].lng) === 0) { - continue - } - var item = [Number(this.alllist[i].lat), Number(this.alllist[i].lng)] - list.push(item) + initCar(isNowPage = true, url) { + offlineCount(url, this.listQuery).then(response => { + this.online = response.data.online + this.offline = response.data.offline + }) + this.sec = Number(this.refresh) + if (!isNowPage) { + this.listQuery.offset = 1 + } + getOverviewList(url, this.listQuery).then(response => { + this.list = response.data.rows + this.total = response.data.total + this.listLoading = false + }) + getOverviewAllList(url, this.listQuery).then(response => { + this.alllist = response.data + if (this.pointlayer !== null) this.map.removeLayer(this.pointlayer) + this.pointlayer = new L.layerGroup().addTo(this.map) + var list = [] + for (i = 0; i < this.alllist.length; i++) { + if (Number(this.alllist[i].lat) === 0 && Number(this.alllist[i].lng) === 0) { + continue } - // if (list.length !== 0) { - // this.setZoom(list) - // } - var Icon - for (var i = 0; i < this.alllist.length; i++) { - if (i === 0 && !this.initlocation) { - this.map.setView({ lat: this.alllist[0].lat, lng: this.alllist[0].lng }, 16) - this.initlocation = true - } + var item = [Number(this.alllist[i].lat), Number(this.alllist[i].lng)] + list.push(item) + } + if (list.length !== 0) { + // this.setZoom(list) + this.map.setView({ lat: this.alllist[0].lat, lng: this.alllist[0].lng }, 10) + } + var Icon + for (var i = 0; i < this.alllist.length; i++) { + if (i === 0 && !this.initlocation) { + this.map.setView({ lat: this.alllist[0].lat, lng: this.alllist[0].lng }, 16) + this.initlocation = true + } + if (this.bottombtn === '消防车') { if (this.alllist[i].status === '离线') { Icon = L.icon({ iconUrl: require('../../assets/global_images/car-offline.png'), // 灰 @@ -399,22 +431,35 @@ iconSize: [40, 40] }) } - var myIcon = L.divIcon({ - html: '
' + this.alllist[i].description + '
', - className: '', - iconSize: [100, 15] + } else { + Icon = L.icon({ + iconUrl: require('../../assets/global_images/bag-map.png'), // 灰 + iconSize: [30, 30] }) - L.marker([this.alllist[i].lat, this.alllist[i].lng], { icon: myIcon }).addTo(this.pointlayer) - const { carId, description, carTypeName, deptName, status, lng, lat, upTime, speed, liquidValue } = this.alllist[i] - var btndetail = 'btndetail' + carId - var btntrack = 'btntrack' + carId - var btntrail = 'btntrail' + carId - var str = `
车辆位置概要信息
+ } + var myIcon = L.divIcon({ + html: '
' + this.alllist[i].description + '
', + className: '', + iconSize: [100, 15] + }) + L.marker([this.alllist[i].lat, this.alllist[i].lng], { icon: myIcon }).addTo(this.pointlayer) + const { carId, backpackId, description, carTypeName, deptName, status, lng, lat, upTime, speed, liquidValue } = this.alllist[i] + var btndetail, btntrack, btntrail + if (this.bottombtn === '消防车') { + btndetail = 'btndetail' + carId + btntrack = 'btntrack' + carId + btntrail = 'btntrail' + carId + } else { + btndetail = 'btndetail' + backpackId + btntrack = 'btntrack' + backpackId + btntrail = 'btntrail' + backpackId + } + //
${carTypeName}
+ var str = `
${this.bottombtn}位置概要信息
${description}
-
${carTypeName}
${deptName}
${status}
-
${lng} , ${lat}
+
${Number(lng).toFixed(6)} , ${Number(lat).toFixed(6)}
${upTime}
${speed} (km/h)
${liquidValue}
@@ -422,34 +467,42 @@
` - var popup = L.popup().setContent(str) - var marker = L.marker([this.alllist[i].lat, this.alllist[i].lng], { - icon: Icon, - slug: this.alllist[i], - rotationAngle: this.alllist[i].direction, - zIndexOffset: 100000 - }).addTo(this.pointlayer).bindPopup(popup) + var popup = L.popup().setContent(str) + var marker = L.marker([this.alllist[i].lat, this.alllist[i].lng], { + icon: Icon, + slug: this.alllist[i], + rotationAngle: this.alllist[i].direction, + zIndexOffset: 100000 + }).addTo(this.pointlayer).bindPopup(popup) - var that = this - marker.on('click', function(e) { - var carId = e.sourceTarget.options.slug.carId - var btndetail = 'btndetail' + carId - var btntrack = 'btntrack' + carId - var btntrail = 'btntrail' + carId - console.log('按钮:', document.getElementById(btndetail)) - // document.getElementById(btndetail).onclick = function() { - // console.log('carId:', e.sourceTarget.options.slug.carId) - // that.detail(e.sourceTarget.options.slug.carId) - // } - document.getElementById(btntrack).onclick = function() { - that.track(e.sourceTarget.options.slug.carId) - } - document.getElementById(btntrail).onclick = function() { - that.trail(e.sourceTarget.options.slug.carId, e.sourceTarget.options.slug) - } - }) - } - }) + var that = this + marker.on('click', function(e) { + var carId = that.bottombtn === '消防车' ? e.sourceTarget.options.slug.carId : e.sourceTarget.options.slug.backpackId + var btndetail = 'btndetail' + carId + var btntrack = 'btntrack' + carId + var btntrail = 'btntrail' + carId + // console.log('按钮:', document.getElementById(btndetail)) + // document.getElementById(btndetail).onclick = function() { + // console.log('carId:', e.sourceTarget.options.slug.carId) + // that.detail(e.sourceTarget.options.slug.carId) + // } + document.getElementById(btntrack).onclick = function() { + that.track(carId) + } + document.getElementById(btntrail).onclick = function() { + that.trail(carId, e.sourceTarget.options.slug) + } + }) + } + }) + }, + fetchData(isNowPage = true) { + this.listLoading = true + this.list = [] + if (this.bottombtn === '消防车') { + this.initCar(isNowPage, 'busCarPosition') + } else if (this.bottombtn === '背负式') { + this.initCar(isNowPage, 'backpackPosition') } else { this.inittable(this.bottombtn) } diff --git a/src/views/car/track.vue b/src/views/car/track.vue index 2c1b425..b34964b 100644 --- a/src/views/car/track.vue +++ b/src/views/car/track.vue @@ -38,6 +38,7 @@ refresh: '10', showtable: true, id: '', + type: '', marker: null, label: null, baselayer: [], @@ -60,6 +61,7 @@ mounted() { if (this.$route.query) { this.id = this.$route.query.id + this.type = this.$route.query.type } this.initMap() this.fetchData() @@ -69,7 +71,9 @@ }, methods: { initMap() { - track(this.id).then(response => { + const url = this.type === '消防车' ? 'busCarPosition' : 'backpackPosition' + const params = this.type === '消防车' ? { carId: this.id } : { backpackId: this.id } + track(url, params).then(response => { var data = response.data var map if (data.lat !== '') { @@ -95,9 +99,8 @@ } this.map = map // data上需要挂载 window.map = map - var url = 'http://webrd0{s}.is.autonavi.com/appmaptile?x={x}&y={y}&z={z}&lang=zh_cn&size=1&scale=1&style=8' this.baselayer.push( - L.tileLayer(url, { + L.tileLayer('http://webrd0{s}.is.autonavi.com/appmaptile?x={x}&y={y}&z={z}&lang=zh_cn&size=1&scale=1&style=8', { subdomains: '1234' }).addTo(map)) }) @@ -106,7 +109,9 @@ this.sec = Number(this.refresh) }, fetchData() { - track(this.id).then(response => { + const url = this.type === '消防车' ? 'busCarPosition' : 'backpackPosition' + const params = this.type === '消防车' ? { carId: this.id } : { backpackId: this.id } + track(url, params).then(response => { var data = response.data if (this.marker != null) { this.marker.remove() @@ -115,35 +120,42 @@ var Icon if (data.status === '') { return - } else if (data.status === '离线') { + } else if (this.type === '消防车') { + if (data.status === '离线') { + Icon = L.icon({ + iconUrl: require('../../assets/global_images/car-offline.png'), + iconSize: [40, 40] + }) + } else if (data.status === '超时') { + Icon = L.icon({ + iconUrl: require('../../assets/global_images/car-timeout.png'), + iconSize: [40, 40] + }) + } else if (data.status === '停车') { + Icon = L.icon({ + iconUrl: require('../../assets/global_images/car-stop.png'), + iconSize: [40, 40] + }) + } else if (data.status === '行驶') { + Icon = L.icon({ + iconUrl: require('../../assets/global_images/car-online.png'), + iconSize: [40, 40] + }) + } else if (data.status === '报警') { + Icon = L.icon({ + iconUrl: require('../../assets/global_images/car-alarm.png'), + iconSize: [40, 40] + }) + } + } else { Icon = L.icon({ - iconUrl: require('../../assets/global_images/car-offline.png'), - iconSize: [40, 40] - }) - } else if (data.status === '超时') { - Icon = L.icon({ - iconUrl: require('../../assets/global_images/car-timeout.png'), - iconSize: [40, 40] - }) - } else if (data.status === '停车') { - Icon = L.icon({ - iconUrl: require('../../assets/global_images/car-stop.png'), - iconSize: [40, 40] - }) - } else if (data.status === '行驶') { - Icon = L.icon({ - iconUrl: require('../../assets/global_images/car-online.png'), - iconSize: [40, 40] - }) - } else if (data.status === '报警') { - Icon = L.icon({ - iconUrl: require('../../assets/global_images/car-alarm.png'), - iconSize: [40, 40] + iconUrl: require('../../assets/global_images/bag-map.png'), // 灰 + iconSize: [30, 30] }) } var str = '
车辆位置概要信息
' + '
' + data.description + '
' + - '
' + data.carTypeName + '
' + + // '
' + data.carTypeName + '
' + '
' + data.deptName + '
' + '
' + data.status + '
' + '
' + data.lng + ' , ' + data.lat + '
' + diff --git a/src/views/car/trail.vue b/src/views/car/trail.vue index 37429ef..39dfd07 100644 --- a/src/views/car/trail.vue +++ b/src/views/car/trail.vue @@ -62,11 +62,13 @@ deptShow: true, listQuery: { carId: '', + backpackId: '', startTime: '', endTime: '' }, // 查询条件 baselayer: [], carName: '', + type: '', dateTimeRange: [], pathlist: [], // 列表数据 list: [], // 列表数据 @@ -91,7 +93,9 @@ mounted() { if (this.$route.query) { this.listQuery.carId = this.$route.query.id + this.listQuery.backpackId = this.$route.query.id this.carName = this.$route.query.name + this.type = this.$route.query.type } const date = new Date() const year = date.getFullYear() // 年 @@ -126,7 +130,7 @@ this.carpoint.remove() // add point var Icon = L.icon({ - iconUrl: require('../../assets/global_images/car.png'), + iconUrl: this.type === '消防车' ? require('../../assets/global_images/car.png') : require('../../assets/global_images/bag-map.png'), iconSize: [40, 40] }) var str = '
车辆轨迹点信息
' + @@ -154,7 +158,7 @@ this.carpoint.remove() } var Icon = L.icon({ - iconUrl: require('../../assets/global_images/car.png'), + iconUrl: this.type === '消防车' ? require('../../assets/global_images/car.png') : require('../../assets/global_images/bag-map.png'), iconSize: [40, 40] }) var str = '
车辆轨迹点信息
' + @@ -177,7 +181,7 @@ this.carpoint.remove() } var Icon = L.icon({ - iconUrl: require('../../assets/global_images/car.png'), + iconUrl: this.type === '消防车' ? require('../../assets/global_images/car.png') : require('../../assets/global_images/bag-map.png'), iconSize: [40, 40] }) var str = '
车辆轨迹点信息
' + @@ -283,7 +287,8 @@ }, fetchData() { // 划线 this.listLoading = true - trail(this.listQuery).then(response => { + const url = this.type === '消防车' ? 'busCarPosition' : 'backpackPosition' + trail(url, this.listQuery).then(response => { this.list = response.data var base = this.baselayer this.map.eachLayer(function(layer) { diff --git a/src/views/car/trailStatic.vue b/src/views/car/trailStatic.vue index c6543fc..0acf586 100644 --- a/src/views/car/trailStatic.vue +++ b/src/views/car/trailStatic.vue @@ -22,9 +22,10 @@ }, methods: { // 初始化对话框 - initDialog: function(dialogFormVisible, row, name ) { + initDialog: function(dialogFormVisible, row, name, type ) { this.dialogFormVisible = dialogFormVisible - speedLine(row).then(response => { + const url = type === '消防车' ? 'busCarPosition' : 'backpackPosition' + speedLine(url, row).then(response => { this.xdata = [] this.ydata = [] for(var i=0;i